From 00e85147c9a1dd35a0857f361e5833a1c25f4a0a Mon Sep 17 00:00:00 2001 From: Amir Rajan Date: Sat, 10 Apr 2021 03:51:14 -0500 Subject: Synced from DRGTK 2.10. --- docs/android-chrome-192x192.png | Bin 0 -> 15294 bytes docs/android-chrome-512x512.png | Bin 0 -> 49136 bytes docs/apple-touch-icon.png | Bin 0 -> 13731 bytes docs/docs.css | 28 +- docs/docs.html | 34903 +++- docs/docs.txt | 26562 ++- docs/favicon-16x16.png | Bin 0 -> 554 bytes docs/favicon-32x32.png | Bin 0 -> 1405 bytes docs/favicon.ico | Bin 0 -> 15406 bytes docs/parse_log.txt | 189777 ++++++++++++------ docs/site.webmanifest | 1 + dragon/args.rb | 11 +- dragon/assert.rb | 10 + dragon/attr_sprite.rb | 27 +- dragon/autocomplete.rb | 27 +- dragon/console.rb | 7 +- dragon/directional_input_helper_methods.rb | 6 +- dragon/docs.rb | 14 +- dragon/easing.rb | 14 + dragon/hotload.rb | 2 + dragon/inputs.rb | 13 + dragon/ios_wizard.rb | 815 +- dragon/keys.rb | 2 +- dragon/layout.rb | 5 + dragon/numeric.rb | 186 +- dragon/readme_docs.rb | 75 +- dragon/remote_hotload_client.rb | 193 + dragon/runtime_docs.rb | 481 +- dragon/string.rb | 11 +- samples/01_rendering_basics/05_sounds/app/main.rb | 6 - .../08_z_targeting_camera/app/main.rb | 106 + .../metadata/game_metadata.txt | 6 + .../08_z_targeting_camera/metadata/icon.png | Bin 0 -> 14417 bytes .../08_z_targeting_camera/sprites/arena.png | Bin 0 -> 1072678 bytes .../08_z_targeting_camera/sprites/player.png | Bin 0 -> 9510 bytes .../08_z_targeting_camera/sprites/square/black.png | Bin 0 -> 250 bytes .../03_unit_tests/fn_tests.rb | 180 + .../03_unit_tests/nil_coercion_tests.rb | 92 + samples/11_http/02_web_server/app/main.rb | 27 + .../11_http/02_web_server/license-for-sample.txt | 9 + .../02_web_server/metadata/game_metadata.txt | 6 + samples/11_http/02_web_server/metadata/icon.png | Bin 0 -> 14417 bytes .../09_tower_defense/app/main.rb | 301 + .../09_tower_defense/sprites/circle/gray.png | Bin 0 -> 3006 bytes .../09_tower_defense/sprites/circle/orange.png | Bin 0 -> 2670 bytes .../09_tower_defense/sprites/circle/white.png | Bin 0 -> 1754 bytes .../09_tower_defense/tower_defence.gif | Bin 0 -> 5557663 bytes samples/99_genre_arcade/bullet_hell/app/main.rb | 189 + .../bullet_hell/sprites/circle-blue.png | Bin 0 -> 2901 bytes .../bullet_hell/sprites/circle-gray.png | Bin 0 -> 3006 bytes .../bullet_hell/sprites/circle-green.png | Bin 0 -> 2887 bytes .../bullet_hell/sprites/circle-orange.png | Bin 0 -> 2670 bytes .../bullet_hell/sprites/explosion-0.png | Bin 0 -> 267 bytes .../bullet_hell/sprites/explosion-1.png | Bin 0 -> 4585 bytes .../bullet_hell/sprites/explosion-2.png | Bin 0 -> 4675 bytes .../bullet_hell/sprites/explosion-3.png | Bin 0 -> 4724 bytes .../bullet_hell/sprites/explosion-4.png | Bin 0 -> 4773 bytes .../bullet_hell/sprites/explosion-5.png | Bin 0 -> 4742 bytes .../bullet_hell/sprites/explosion-6.png | Bin 0 -> 4665 bytes .../99_genre_arcade/bullet_hell/sprites/star.png | Bin 0 -> 711 bytes samples/99_genre_arcade/sound_golf/app/main.rb | 190 + .../sound_golf/license-for-sample.txt | 9 + samples/99_genre_arcade/sound_golf/replay.txt | 965 + samples/99_genre_arcade/sound_golf/sounds/A3.wav | Bin 0 -> 177456 bytes samples/99_genre_arcade/sound_golf/sounds/B3.wav | Bin 0 -> 177456 bytes samples/99_genre_arcade/sound_golf/sounds/C3.wav | Bin 0 -> 174340 bytes samples/99_genre_arcade/sound_golf/sounds/C4.wav | Bin 0 -> 184712 bytes samples/99_genre_arcade/sound_golf/sounds/D3.wav | Bin 0 -> 176340 bytes samples/99_genre_arcade/sound_golf/sounds/E3.wav | Bin 0 -> 176340 bytes samples/99_genre_arcade/sound_golf/sounds/F3.wav | Bin 0 -> 176340 bytes samples/99_genre_arcade/sound_golf/sounds/G3.wav | Bin 0 -> 175780 bytes samples/99_genre_lowrez/nokia_3310/app/main.rb | 625 + samples/99_genre_lowrez/nokia_3310/app/nokia.rb | 259 + .../99_genre_lowrez/nokia_3310/fonts/lowrez.ttf | Bin 0 -> 10224 bytes .../nokia_3310/sprites/explosion-0.png | Bin 0 -> 1614 bytes .../nokia_3310/sprites/explosion-1.png | Bin 0 -> 4881 bytes .../nokia_3310/sprites/explosion-2.png | Bin 0 -> 4976 bytes .../nokia_3310/sprites/explosion-3.png | Bin 0 -> 4955 bytes .../nokia_3310/sprites/explosion-4.png | Bin 0 -> 4948 bytes .../nokia_3310/sprites/explosion-5.png | Bin 0 -> 4869 bytes .../nokia_3310/sprites/explosion-6.png | Bin 0 -> 4868 bytes .../nokia_3310/sprites/explosion-sheet.png | Bin 0 -> 2258 bytes .../nokia_3310/sprites/monochrome-ship.png | Bin 0 -> 1616 bytes .../01_roguelike_starting_point/app/constants.rb | 8 + .../01_roguelike_starting_point/app/legend.rb | 65 + .../01_roguelike_starting_point/app/main.rb | 97 + .../app/sprite_lookup.rb | 124 + .../license-for-sample.txt | 9 + .../sprites/simple-mood-16x16.png | Bin 0 -> 14424 bytes .../02_roguelike_line_of_sight/app/main.rb | 439 + .../license-for-sample.txt | 9 + .../02_roguelike_line_of_sight/replay.txt | 555 + 92 files changed, 183374 insertions(+), 74072 deletions(-) create mode 100644 docs/android-chrome-192x192.png create mode 100644 docs/android-chrome-512x512.png create mode 100644 docs/apple-touch-icon.png create mode 100644 docs/favicon-16x16.png create mode 100644 docs/favicon-32x32.png create mode 100644 docs/favicon.ico create mode 100644 docs/site.webmanifest create mode 100644 dragon/remote_hotload_client.rb create mode 100644 samples/07_advanced_rendering/08_z_targeting_camera/app/main.rb create mode 100644 samples/07_advanced_rendering/08_z_targeting_camera/metadata/game_metadata.txt create mode 100644 samples/07_advanced_rendering/08_z_targeting_camera/metadata/icon.png create mode 100644 samples/07_advanced_rendering/08_z_targeting_camera/sprites/arena.png create mode 100644 samples/07_advanced_rendering/08_z_targeting_camera/sprites/player.png create mode 100644 samples/07_advanced_rendering/08_z_targeting_camera/sprites/square/black.png create mode 100644 samples/10_advanced_debugging/03_unit_tests/fn_tests.rb create mode 100644 samples/10_advanced_debugging/03_unit_tests/nil_coercion_tests.rb create mode 100644 samples/11_http/02_web_server/app/main.rb create mode 100644 samples/11_http/02_web_server/license-for-sample.txt create mode 100644 samples/11_http/02_web_server/metadata/game_metadata.txt create mode 100644 samples/11_http/02_web_server/metadata/icon.png create mode 100644 samples/13_path_finding_algorithms/09_tower_defense/app/main.rb create mode 100644 samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/gray.png create mode 100644 samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/orange.png create mode 100644 samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/white.png create mode 100644 samples/13_path_finding_algorithms/09_tower_defense/tower_defence.gif create mode 100644 samples/99_genre_arcade/bullet_hell/app/main.rb create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/circle-blue.png create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/circle-gray.png create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/circle-green.png create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/circle-orange.png create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/explosion-0.png create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/explosion-1.png create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/explosion-2.png create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/explosion-3.png create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/explosion-4.png create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/explosion-5.png create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/explosion-6.png create mode 100644 samples/99_genre_arcade/bullet_hell/sprites/star.png create mode 100644 samples/99_genre_arcade/sound_golf/app/main.rb create mode 100644 samples/99_genre_arcade/sound_golf/license-for-sample.txt create mode 100644 samples/99_genre_arcade/sound_golf/replay.txt create mode 100644 samples/99_genre_arcade/sound_golf/sounds/A3.wav create mode 100644 samples/99_genre_arcade/sound_golf/sounds/B3.wav create mode 100644 samples/99_genre_arcade/sound_golf/sounds/C3.wav create mode 100644 samples/99_genre_arcade/sound_golf/sounds/C4.wav create mode 100644 samples/99_genre_arcade/sound_golf/sounds/D3.wav create mode 100644 samples/99_genre_arcade/sound_golf/sounds/E3.wav create mode 100644 samples/99_genre_arcade/sound_golf/sounds/F3.wav create mode 100644 samples/99_genre_arcade/sound_golf/sounds/G3.wav create mode 100644 samples/99_genre_lowrez/nokia_3310/app/main.rb create mode 100644 samples/99_genre_lowrez/nokia_3310/app/nokia.rb create mode 100644 samples/99_genre_lowrez/nokia_3310/fonts/lowrez.ttf create mode 100644 samples/99_genre_lowrez/nokia_3310/sprites/explosion-0.png create mode 100644 samples/99_genre_lowrez/nokia_3310/sprites/explosion-1.png create mode 100644 samples/99_genre_lowrez/nokia_3310/sprites/explosion-2.png create mode 100644 samples/99_genre_lowrez/nokia_3310/sprites/explosion-3.png create mode 100644 samples/99_genre_lowrez/nokia_3310/sprites/explosion-4.png create mode 100644 samples/99_genre_lowrez/nokia_3310/sprites/explosion-5.png create mode 100644 samples/99_genre_lowrez/nokia_3310/sprites/explosion-6.png create mode 100644 samples/99_genre_lowrez/nokia_3310/sprites/explosion-sheet.png create mode 100644 samples/99_genre_lowrez/nokia_3310/sprites/monochrome-ship.png create mode 100644 samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/constants.rb create mode 100644 samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/legend.rb create mode 100644 samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb create mode 100644 samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb create mode 100644 samples/99_genre_rpg_roguelike/01_roguelike_starting_point/license-for-sample.txt create mode 100644 samples/99_genre_rpg_roguelike/01_roguelike_starting_point/sprites/simple-mood-16x16.png create mode 100644 samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb create mode 100644 samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/license-for-sample.txt create mode 100644 samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/replay.txt diff --git a/docs/android-chrome-192x192.png b/docs/android-chrome-192x192.png new file mode 100644 index 0000000..6230adf Binary files /dev/null and b/docs/android-chrome-192x192.png differ diff --git a/docs/android-chrome-512x512.png b/docs/android-chrome-512x512.png new file mode 100644 index 0000000..7427991 Binary files /dev/null and b/docs/android-chrome-512x512.png differ diff --git a/docs/apple-touch-icon.png b/docs/apple-touch-icon.png new file mode 100644 index 0000000..1618c86 Binary files /dev/null and b/docs/apple-touch-icon.png differ diff --git a/docs/docs.css b/docs/docs.css index acbe0df..115fd34 100644 --- a/docs/docs.css +++ b/docs/docs.css @@ -98,6 +98,7 @@ pre { white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; + background-color: #f0f0f0; } code { @@ -105,7 +106,6 @@ code { padding-right: 2px; padding-top: 1px; padding-bottom: 1px; - background-color: #f0f0f0; border-radius: 5px; } @@ -128,7 +128,29 @@ blockquote { } #toc { - font-size: smaller; + font-size: 14px; +} + +#toc ul { + margin-left: 3px; + padding-left: 15px; +} + + +#toc .header-1 { + display: inline-block; + margin-top: 10px; + font-weight: 900; +} + +#toc .header-2 { + display: inline-block; + padding-left: 5px; + padding-right: 5px; + margin-top: 10px; +} + +#toc .header-3 { } @media only screen and (min-width: 1280px) { @@ -139,7 +161,7 @@ blockquote { } #toc { - border: solid 1px silver; + border: solid 1px #f0f0f0; padding: 10px; padding-bottom: 30px; position: fixed; diff --git a/docs/docs.html b/docs/docs.html index 8fafcb1..39d0086 100644 --- a/docs/docs.html +++ b/docs/docs.html @@ -1,208 +1,56 @@ DragonRuby Game Toolkit Documentation - +

Table Of Contents

+
  • DragonRuby Game Toolkit Live Docs
  • +
  • Hello World
  • +
  • Join the Discord and Subscribe to the News Letter
  • +
  • Watch Some Intro Videos
  • +
  • Getting Started Tutorial
  • +
  • Deploying To Itch.io
  • +
  • Deploying To Mobile Devices
  • +
  • DragonRuby's Philosophy
  • +
  • Frequently Asked Questions, Comments, and Concerns
  • +
  • RECIPIES:
  • +
  • DOCS: GTK::Runtime
  • +
  • SUMMARY: def tick args; end;
  • +
  • DOCS: GTK::Runtime#reset
  • +
  • DOCS: GTK::Runtime#calcstringbox
  • +
  • DOCS: GTK::Runtime#write_file
  • +
  • DOCS: Array
  • +
  • DOCS: Array#map
  • +
  • DOCS: Array#each
  • +
  • DOCS: Array#reject_nil
  • +
  • DOCS: Array#reject_false
  • +
  • DOCS: Array#product
  • +
  • DOCS: Array#map_2d
  • +
  • DOCS: Array#include_any?
  • +
  • DOCS: Array#any_intersect_rect?
  • +
  • DOCS: GTK::Args#audio
  • +
  • DOCS: GTK::Outputs
  • +
  • DOCS: GTK::Outputs#solids
  • +
  • DOCS: GTK::Outputs#borders
  • +
  • DOCS: GTK::Outputs#screenshots
  • +
  • DOCS: GTK::Mouse
  • +
  • DOCS: GTK::MousePoint
  • +
  • DOCS: GTK::OpenEntity
  • +
  • DOCS: GTK::OpenEntity#as_hash
  • +
  • DOCS: Numeric#frame_index
  • +
  • DOCS: Numeric#elapsed_time
  • +
  • DOCS: Numeric#elapsed?
  • +
  • DOCS: Numeric#created?
  • +
  • DOCS: Kernel
  • +
  • DOCS: Kernel::tick_count
  • +
  • DOCS: Kernel::global_tick_count
  • +
  • DOCS: Geometry
  • +
  • DOCS: GTK::Geometry#scale_rect
  • +
  • Source Code
  • +

    DragonRuby Game Toolkit Live Docs

    @@ -211,8 +59,8 @@ The information contained here is all available via the DragonRuby Console. You

    To search docs you can type docs_search "SEARCH TERM" or if you want to get fancy you can provide a lambda to filter documentation:

    -
    docs_search { |entry| (entry.include? "Array") && (!entry.include? "Enumerable") }
    -
    +
    docs_search { |entry| (entry.include? "Array") && (!entry.include? "Enumerable") }
    +

    @@ -262,7 +110,7 @@ You may also want to try this free course provided at https://en.wikipedia.org/wiki/Ryan_C._Gordon).

    -

    Introduction

    +

    Introduction

    Welcome!

    @@ -278,14 +126,14 @@ Did you not know that? Did you think you couldn't write a game because you're a

    Here, we're going to be programming in a language called "Ruby." In the interest of full disclosure, I (Ryan Gordon) wrote the C parts of this toolkit and Ruby looks a little strange to me (Amir Rajan wrote the Ruby parts, discounting the parts I mangled), but I'm going to walk you through the basics because we're all learning together, and if you mostly think of yourself as someone that writes C (or C++, C#, Objective-C), PHP, or Java, then you're only a step behind me right now.

    -

    Prerequisites

    +

    Prerequisites

    Here's the most important thing you should know: Ruby lets you do some complicated things really easily, and you can learn that stuff later. I'm going to show you one or two cool tricks, but that's all.

    Do you know what an if statement is? A for-loop? An array? That's all you'll need to start.

    -

    The Game Loop

    +

    The Game Loop

    Ok, here are few rules with regards to game development with GTK:

    @@ -300,18 +148,18 @@ That's an entire video game in one run-on sentence.

    Here's that function. You're going to want to put this in mygame/app/main.rb, because that's where we'll look for it by default. Load it up in your favorite text editor.

    -
    def tick args
    +
    def tick args
       args.outputs.labels << [580, 400, 'Hello World!']
     end
    -
    +

    Now run dragonruby ...did you get a window with "Hello World!" written in it? Good, you're officially a game developer!

    -

    Breakdown Of The tick Method

    +

    Breakdown Of The tick Method

    mygame/app/main.rb, is where the Ruby source code is located. This looks a little strange, so I'll break it down line by line. In Ruby, a '#' character starts a single-line comment, so I'll talk about this inline.

    -
    # This "def"ines a function, named "tick," which takes a single argument
    +
    # This "def"ines a function, named "tick," which takes a single argument
     # named "args". DragonRuby looks for this function and calls it every
     # frame, 60 times a second. "args" is a magic structure with lots of
     # information in it. You can set variables in there for your own game state,
    @@ -328,11 +176,11 @@ def tick args
       # args.outputs.labels)
       args.outputs.labels << [580, 400, 'Hello World!']
     end
    -
    +

    Once your tick function finishes, we look at all the arrays you made and figure out how to draw it. You don't need to know about graphics APIs. You're just setting up some arrays! DragonRuby clears out these arrays every frame, so you just need to add what you need _right now_ each time.

    -

    Rendering A Sprite

    +

    Rendering A Sprite

    Now let's spice this up a little.

    @@ -342,18 +190,18 @@ We're going to add some graphics. Each 2D image in DragonRuby is called a "sprit

    There's a "dragonruby.png" file included, just to get you started. Let's have it draw every frame with our text:

    -
    def tick args
    +
    def tick args
       args.outputs.labels  << [580, 400, 'Hello World!']
       args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png']
     end
    -
    +

    (Pro Tip: you don't have to restart DragonRuby to test your changes; when you save main.rb, DragonRuby will notice and reload your program.)

    That .sprites line says "add a sprite to the list of sprites we're drawing, and draw it at position (576, 100) at a size of 128x101 pixels". You can find the image to draw at dragonruby.png.

    -

    Coordinate System and Virtual Canvas

    +

    Coordinate System and Virtual Canvas

    Quick note about coordinates: (0, 0) is the bottom left corner of the screen, and positive numbers go up and to the right. This is more "geometrically correct," even if it's not how you remember doing 2D graphics, but we chose this for a simpler reason: when you're making Super Mario Brothers and you want Mario to jump, you should be able to add to Mario's y position as he goes up and subtract as he falls. It makes things easier to understand.

    @@ -363,17 +211,17 @@ Also: your game screen is _always_ 1280x720 pixels. If you resize the window, we

    Ok, now we have an image on the screen, let's animate it:

    -
    def tick args
    +
    def tick args
       args.state.rotation  ||= 0
       args.outputs.labels  << [580, 400, 'Hello World!' ]
       args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png', args.state.rotation]
       args.state.rotation  -= 1
     end
    -
    +

    Now you can see that this function is getting called a lot!

    -

    Game State

    +

    Game State

    Here's a fun Ruby thing: args.state.rotation ||= 0 is shorthand for "if args.state.rotation isn't initialized, set it to zero." It's a nice way to embed your initialization code right next to where you need the variable.

    @@ -383,18 +231,18 @@ Here's a fun Ruby thing: args.state.rotation ||= 0 is shorthand for

    In this case, the current rotation of our sprite, which is happily spinning at 60 frames per second. If you don't specify rotation (or alpha, or color modulation, or a source rectangle, etc), DragonRuby picks a reasonable default, and the array is ordered by the most likely things you need to tell us: position, size, name.

    -

    There Is No Delta Time

    +

    There Is No Delta Time

    One thing we decided to do in DragonRuby is not make you worry about delta time: your function runs at 60 frames per second (about 16 milliseconds) and that's that. Having to worry about framerate is something massive triple-AAA games do, but for fun little 2D games? You'd have to work really hard to not hit 60fps. All your drawing is happening on a GPU designed to run Fortnite quickly; it can definitely handle this.

    Since we didn't make you worry about delta time, you can just move the rotation by 1 every time and it works without you having to keep track of time and math. Want it to move faster? Subtract 2.

    -

    Handling User Input

    +

    Handling User Input

    Now, let's move that image around.

    -
    def tick args
    +
    def tick args
       args.state.rotation ||= 0
       args.state.x ||= 576
       args.state.y ||= 100
    @@ -414,11 +262,11 @@ Now, let's move that image around.
     
       args.state.rotation -= 1
     end
    -
    +

    Everywhere you click your mouse, the image moves there. We set a default location for it with args.state.x ||= 576, and then we change those variables when we see the mouse button in action. You can get at the keyboard and game controllers in similar ways.

    -

    Coding On A Raspberry Pi

    +

    Coding On A Raspberry Pi

    We have only tested DragonRuby on a Raspberry Pi 3, Models B and B+, but we believe it _should_ work on any model with comparable specs.

    @@ -428,8 +276,8 @@ If you're running DragonRuby Game Toolkit on a Raspberry Pi, or trying to run a

    You're probably running a desktop environment: menus, apps, web browsers, etc. This is okay! Launch the terminal app and type:

    -
    do raspi-config
    -
    +
    do raspi-config
    +

    It'll ask you for your password (if you don't know, try "raspberry"), and then give you a menu of options. Find your way to "Advanced Options", then "GL Driver", and change this to "GL (Full KMS)" ... not "fake KMS," which is also listed there. Save and reboot. In theory, this should fix the problem.

    @@ -439,51 +287,15 @@ If you're _still_ having problems and have a Raspberry Pi 2 or better, go back t

    Note that you can also run DragonRuby without X11 at all: if you run it from a virtual terminal it will render fullscreen and won't need the "Full KMS" option. This might be attractive if you want to use it as a game console sort of thing, or develop over ssh, or launch it from RetroPie, etc.

    -

    Conclusion

    +

    Conclusion

    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 args.output anymore.

    -

    IMPORTANT: Go through all of the sample apps! Study them thoroughly!! No really, you should definitely do this!

    -

    -Now that you've completed the Hello World tutorial. Head over to the `samples` directory. It is very very important that you study the sample apps thoroughly! Go through them in order. Here is a short description of each sample app. -

    -

    Guided Samples

    -
      -
    1. samples/00_learn_ruby_optional: This directory contains sample apps that will help you learn the language.
    2. -
    3. samples/01_rendering_basics: This set of samples will show you how to render basic primitives such as labels, solids, borders, lines, sprites, and how to play sounds.
    4. -
    5. samples/02_input_basics: This set of samples show you how to accept input from the mouse, keyboard, and controllers.
    6. -
    7. samples/03_rendering_sprites: This set of samples shows you all the different ways to render sprites (including how to use a sprite sheet).
    8. -
    9. samples/04_physics_and_collision: This set of samples shows how to do various types of collisions and physics.
    10. -
    11. samples/05_mouse: This set of samples show more advanced usages of the mouse.
    12. -
    13. samples/06_save_load: This set of samples show how to save and load game data.
    14. -
    15. samples/07_advanced_rendering: This set of samples show how to programmatically render sprites using render targets.
    16. -
    17. samples/08_tweening_lerping_easing_functions: This set of samples show how to perform animations.
    18. -
    19. samples/09_performance: This set of samples show how to handle performance issues when a large number of sprites on the screen.
    20. -
    21. samples/10_advanced_debugging: This set of samples show how advanced debugging techniques and testing techniques.
    22. -
    23. samples/11_http: This set of samples show how use http.
    24. -
    -

    Sample Games

    -

    -There are samples that contain the path samples/99_*. The sample apps that are prefixed with 99_ show non-trivial implemementations for a real game: -

    -
      -
    1. 3D Cube: Shows how to do faux 3D in DragonRuby.
    2. -
    3. Dueling Starships: A two player top-down versus game where each player controls a ship.
    4. -
    5. Flappy Dragon: DragonRuby's clone of Flappy Bird.
    6. -
    7. Pong: A simple implementation of the game Pong.
    8. -
    9. Snakemoji: The classic game of Snake but with all of the code written using emojis (sometimes you just have to have a little fun).
    10. -
    11. Solar System: A simulation of our solar system.
    12. -
    13. Crafting Starting Point: A starting point for those that want to build a crafting game.
    14. -
    15. Dev Tools: A set of sample apps that show how you can extend DragonRuby's Console, starting point for a tile editor, and a starting point for a paint app.
    16. -
    17. LOWREZ: Sample apps that show how to render at different resolutions.
    18. -
    19. RPG: Various sample apps that show how to create narrative, topdown, tactical grid-based, and roguelike RPGs.
    20. -
    21. Platformers: Various sample apps that show how to create different kinds of physics/collision based platformers.
    22. -

    Deploying To Itch.io

    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!

    -

    Creating Your Game Landing Page

    +

    Creating Your Game Landing Page

    Log into Itch.io and go to https://itch.io/game/new.

    @@ -498,28 +310,28 @@ Log into Itch.io and go to https://itch.io/ga

    You can fill out all the other options later.

    -

    Update Your Game's Metadata

    +

    Update Your Game's Metadata

    Point your text editor at mygame/metadata/game_metadata.txt and make it look like this:

    NOTE: Remove the # at the beginning of each line.

    -
    devid=bob
    +
    devid=bob
     devtitle=Bob The Game Developer
     gameid=mygame
     gametitle=My Game
     version=0.1
    -
    +

    The devid property is the username you use to log into Itch.io. The devtitle is your name or company name (it can contain spaces). The gameid is the Project URL value. The gametitle is the name of your game (it can contain spaces). The version can be any major.minor number format.

    -

    Building Your Game For Distribution

    +

    Building Your Game For Distribution

    Open up the terminal and run this from the command line:

    -
    ./dragonruby-publish --only-package mygame
    -
    +
    ./dragonruby-publish --only-package mygame
    +

    (if you're on Windows, don't put the "./" on the front. That's a Mac and Linux thing.)

    @@ -532,8 +344,8 @@ For the HTML version of your game after you upload it. Check the checkbox labele

    For subsequent updates you can use an automated deployment to Itch.io:

    -
    ./dragonruby-publish mygame
    -
    +
    ./dragonruby-publish mygame
    +

    DragonRuby will package _and publish_ your game to itch.io! Tell your friends to go to your game's very own webpage and buy it!

    @@ -550,16 +362,16 @@ To deploy to iOS, you need to have a Mac running MacOS Catalina, an iOS device,

    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:

    -
    > adb logcat -e mygame # you'll want to run this in a separate terminal
    +
    > 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
     > apksigner sign --ks mygame.keystore mygame-android.apk
     > adb install mygame-android.apk
    -
    +

    DragonRuby's Philosophy

    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.

    -

    Challenge The Status Quo

    +

    Challenge The Status Quo

    Game engines of today are in a local maximum and don't take into consideration the challenges of this day and age. Unity and GameMaker specifically rot your brain. It's not sufficient to say:

    @@ -571,51 +383,49 @@ But that's how we've always done it.

    It's a hard pill to swallow, but forget blindly accepted best practices and try to figure out the underlying motivation for a specific approach to game development. Collaborate with us.

    -

    Continuity of Design

    +

    Continuity of Design

    -There is a programming idiom in software called "the pit of success". The term normalizes up front pain as a necessity in the (hopes that the investment will yield dividends "when you become successful"). This results in more "Enterprise TM" code upfront, and makes it more difficult to get started when you are new to programming. +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.

    -DragonRuby's philosophy is to provide a spectrum across the "make it fast" vs "make it right" spectrum and provide incremental, intuitive transitions between points on that spectrum. This is captured in how render primitives can be represented as tuples/arrays, hashes, open structs/entities, and then finally classes (as opposed to forcing devs to use classes upfront). +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).

    -

    Release Often And Soon

    +

    Release Early and Often

    -The biggest mistake game devs make is spending too much time in isolation building their game. Release something, however small, and release it quickly. +The biggest mistake game devs make is spending too much time in isolation building their game. Release something, however small, and release it soon.

    Stop worrying about everything being pixel perfect. Don't wait until your game is 100% complete. Build your game publicly and iterate. Post in the #show-and-tell channel in the community Discord. You'll find a lot of support and encouragement there.

    -Remember: +Real artists ship. Remember that.

    -
    -

    -Real artists ship. -

    -
    -

    Sustainable And Ethical Monetization

    +

    Sustainable And Ethical Monetization

    We all aspire to put food on the table doing what we love. Whether it is building games, writing tools to support game development, or anything in between.

    Charge a fair amount of money for the things you create. It's expected and encouraged within the community. Give what you create away for free to those that can't afford it.

    -

    Sustainable And Ethical Open Source

    +

    +If you are gainfully employed, pay full price for the things you use. If you do end up getting something at a discount, pay the difference "forward" to someone else. +

    +

    Sustainable And Ethical Open Source

    This goes hand in hand with sustainable and ethical monetization. The current state of open source is not sustainable. There is an immense amount of contributor burnout. Users of open source expect everything to be free, and few give back. This is a problem we want to fix (we're still trying to figure out the best solution).

    So, don't be "that guy" in the Discord that says "DragonRuby should be free and open source!" You will be personally flogged by Amir.

    -

    People Over Entities

    +

    People Over Entities

    We prioritize the endorsement of real people over faceless entities. This game engine, and other products we create, are not insignificant line items of a large company. And you aren't a generic "commodity" or "corporate resource". So be active in the community Discord and you'll reap the benefits as more devs use DragonRuby.

    -

    Building A Game Should Be Fun And Bring Happiness

    +

    Building A Game Should Be Fun And Bring Happiness

    We will prioritize the removal of pain. The aesthetics of Ruby make it such a joy to work with, and we want to capture that within the engine.

    -

    Real World Application Drives Features

    +

    Real World Application Drives Features

    We are bombarded by marketing speak day in and day out. We don't do that here. There are things that are really great in the engine, and things that need a lot of work. Collaborate with us so we can help you reach your goals. Ask for features you actually need as opposed to anything speculative.

    @@ -626,8 +436,8 @@ We want DragonRuby to *actually* help you build the game you want to build (as o

    Here are questions, comments, and concerns that frequently come up.

    -

    Frequently Asked Questions

    -

    What is DragonRuby LLP?

    +

    Frequently Asked Questions

    +

    What is DragonRuby LLP?

    DragonRuby LLP is a partnership of four devs who came together with the goal of bringing the aesthetics and joy of Ruby, everywhere possible.

    @@ -652,7 +462,7 @@ NOTE: We leave the "A DragonRuby LLP Product" off of this one because that just

    NOTE: Devs who use DragonRuby are "Dragon Riders/Riders of Dragons". That's a bad ass identifier huh?

    -

    What is DragonRuby?

    +

    What is DragonRuby?

    The response to this question requires a few subparts. First we need to clarify some terms. Specifically _language specification_ vs _runtime_.

    @@ -703,7 +513,7 @@ These levels allow us to stay up to date with open source implementations of Rub

    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.

    -

    How is DragonRuby different than MRI?

    +

    How is DragonRuby different than MRI?

    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).

    @@ -718,11 +528,11 @@ You can use DragonRuby's Console within the game to inspect object and execute s
    • Any code you write in there will be executed when you change the file. You can organize different pieces of code using the repl method:
    -
    repl do
    +
    repl do
       puts "hello world"
       puts 1 + 1
     end
    -
    +
    diff --git a/docs/docs.txt b/docs/docs.txt index 6887e35..0b543de 100644 --- a/docs/docs.txt +++ b/docs/docs.txt @@ -310,44 +310,6 @@ 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 ~args.output~ anymore. -* IMPORTANT: Go through all of the sample apps! Study them thoroughly!! No really, you should definitely do this! - -Now that you've completed the Hello World tutorial. Head over to the -`samples` directory. It is very very important that you study the -sample apps thoroughly! Go through them in order. Here is a short -description of each sample app. - -** Guided Samples - -1. ~samples/00_learn_ruby_optional~: This directory contains sample apps that will help you learn the language. -2. ~samples/01_rendering_basics~: This set of samples will show you how to render basic primitives such as ~labels~, ~solids~, ~borders~, ~lines~, ~sprites~, and how to play ~sounds~. -3. ~samples/02_input_basics~: This set of samples show you how to accept input from the ~mouse~, ~keyboard~, and ~controllers~. -4. ~samples/03_rendering_sprites~: This set of samples shows you all the different ways to render sprites (including how to use a sprite sheet). -4. ~samples/04_physics_and_collision~: This set of samples shows how to do various types of collisions and physics. -5. ~samples/05_mouse~: This set of samples show more advanced usages of the mouse. -6. ~samples/06_save_load~: This set of samples show how to save and load game data. -7. ~samples/07_advanced_rendering~: This set of samples show how to programmatically render sprites using render targets. -8. ~samples/08_tweening_lerping_easing_functions~: This set of samples show how to perform animations. -9. ~samples/09_performance~: This set of samples show how to handle performance issues when a large number of sprites on the screen. -10. ~samples/10_advanced_debugging~: This set of samples show how advanced debugging techniques and testing techniques. -11. ~samples/11_http~: This set of samples show how use http. - -** Sample Games - -There are samples that contain the path ~samples/99_*~. The sample apps that are prefixed with ~99_~ show non-trivial implemementations for a real game: - -1. 3D Cube: Shows how to do faux 3D in DragonRuby. -2. Dueling Starships: A two player top-down versus game where each player controls a ship. -3. Flappy Dragon: DragonRuby's clone of Flappy Bird. -4. Pong: A simple implementation of the game Pong. -5. Snakemoji: The classic game of Snake but with all of the code written using emojis (sometimes you just have to have a little fun). -6. Solar System: A simulation of our solar system. -7. Crafting Starting Point: A starting point for those that want to build a crafting game. -8. Dev Tools: A set of sample apps that show how you can extend DragonRuby's Console, starting point for a tile editor, and a starting point for a paint app. -9. LOWREZ: Sample apps that show how to render at different resolutions. -10. RPG: Various sample apps that show how to create narrative, topdown, tactical grid-based, and roguelike RPGs. -11. Platformers: Various sample apps that show how to create different kinds of physics/collision based platformers. - * Deploying To Itch.io @@ -467,35 +429,36 @@ specific approach to game development. Collaborate with us. ** Continuity of Design -There is a programming idiom in software called "the pit of -success". The term normalizes up front pain as a necessity in the -(hopes that the investment will yield dividends "when you become -successful"). This results in more "Enterprise TM" code upfront, and -makes it more difficult to get started when you are new to programming. - -DragonRuby's philosophy is to provide a spectrum across the "make it -fast" vs "make it right" spectrum and provide incremental, intuitive -transitions between points on that spectrum. This is captured in how -render primitives can be represented as tuples/arrays, hashes, open -structs/entities, and then finally classes (as opposed to forcing devs -to use classes upfront). - -** Release Often And Soon +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. + +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). + +** Release Early and Often The biggest mistake game devs make is spending too much time in isolation building their game. Release something, however small, and -release it quickly. +release it soon. Stop worrying about everything being pixel perfect. Don't wait until your game is 100% complete. Build your game publicly and iterate. Post in the #show-and-tell channel in the community Discord. You'll find a lot of support and encouragement there. -Remember: - -#+begin_quote -Real artists ship. -#+end_quote +Real artists ship. Remember that. ** Sustainable And Ethical Monetization @@ -507,6 +470,10 @@ Charge a fair amount of money for the things you create. It's expected and encouraged within the community. Give what you create away for free to those that can't afford it. +If you are gainfully employed, pay full price for the things you use. If you +do end up getting something at a discount, pay the difference "forward" to +someone else. + ** Sustainable And Ethical Open Source This goes hand in hand with sustainable and ethical monetization. The @@ -702,7 +669,7 @@ file called ~repl.rb~ and put it in ~mygame/app/repl.rb~: # use xrepl to "comment out" code xrepl do - puts "This code will not be executed because of the x infront of repl". + puts "This code will not be executed because of the x in front of repl". end #+end_src @@ -835,7 +802,8 @@ But, in the event that sad day comes, our partnership bylaws state that _all_ DragonRuby IP that can be legally open sourced, will be released under a permissive license. -* CHEATSHEET: How To Determine What Frame You Are On +* RECIPIES: +** How To Determine What Frame You Are On There is a property on ~state~ called ~tick_count~ that is incremented by DragonRuby every time the ~tick~ method is called. The following @@ -847,7 +815,7 @@ code renders a label that displays the current ~tick_count~. end #+end_src -* CHEATSHEET: How To Get Current Framerate +** How To Get Current Framerate Current framerate is a top level property on the Game Toolkit Runtime and is accessible via ~args.gtk.current_framerate~. @@ -858,7 +826,7 @@ and is accessible via ~args.gtk.current_framerate~. end #+end_src -* CHEATSHEET: How To Render A Sprite Using An Array +** How To Render A Sprite Using An Array All file paths should use the forward slash ~/~ *not* backslash ~~. Game Toolkit includes a number of sprites in the ~sprites~ @@ -881,7 +849,7 @@ The following code renders a sprite with a ~width~ and ~height~ of end #+end_src -* CHEATSHEET: More Sprite Properties As An Array +** More Sprite Properties As An Array Here are all the properties you can set on a sprite. @@ -902,7 +870,7 @@ Here are all the properties you can set on a sprite. end #+end_src -* CHEATSHEET: Different Sprite Representations +** Different Sprite Representations Using ordinal positioning can get a little unruly given so many properties you have control over. @@ -968,7 +936,7 @@ You can represent a sprite as an ~object~: end #+end_src -* CHEATSHEET: How To Render A Label +** How To Render A Label ~args.outputs.labels~ is used to render labels. @@ -984,7 +952,7 @@ Here is the minimum code: end #+end_src -* CHEATSHEET: A Colored Label +** A Colored Label #+begin_src def tick args @@ -994,7 +962,7 @@ Here is the minimum code: end #+end_src -* CHEATSHEET: Extended Label Properties +** Extended Label Properties #+begin_src def tick args @@ -1022,7 +990,7 @@ label's size. An ~ALIGNMENT_ENUM~ of ~0~ represents "left aligned". ~1~ represents "center aligned". ~2~ represents "right aligned". -* CHEATSHEET: Rendering A Label As A ~Hash~ +** Rendering A Label As A ~Hash~ You can add additional metadata about your game within a label, which requires you to use a `Hash` instead. @@ -1050,7 +1018,7 @@ You can add additional metadata about your game within a label, which requires y end #+end_src -* CHEATSHEET: Getting The Size Of A Piece Of Text +** Getting The Size Of A Piece Of Text You can get the render size of any string using ~args.gtk.calcstringbox~. @@ -1071,7 +1039,7 @@ You can get the render size of any string using ~args.gtk.calcstringbox~. end #+end_src -* CHEATSHEET: How To Play A Sound +** How To Play A Sound Sounds that end ~.wav~ will play once: @@ -1106,7 +1074,7 @@ If you want to play a ~.ogg~ once as if it were a sound effect, you can do: end #+end_src -* CHEATSHEET: Using ~args.state~ To Store Your Game State +** Using ~args.state~ To Store Your Game State ~args.state~ is a open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of @@ -1144,7 +1112,7 @@ sure_ you've initialized a default value. end #+end_src -* CHEATSHEET: Troubleshoot Performance +** Troubleshoot Performance 1. If you're using ~Array~s for your primitives (~args.outputs.sprites << []~), use ~Hash~ instead (~args.outputs.sprites << { x: ... }~). 2. If you're using ~Entity~ for your primitives (~args.outputs.sprites << args.state.new_entity~), use ~StrictEntity~ instead (~args.outputs.sprites << args.state.new_entity_strict~). @@ -1167,18 +1135,469 @@ do * DOCS: ~GTK::Runtime~ The GTK::Runtime class is the core of DragonRuby. It is globally accessible via ~$gtk~. -* DOCS: ~GTK::Runtime#write_file~ -This function takes in two parameters. The first paramter is the file path and assumes the the game -directory is the root. The second parameter is the string that will be written. The method overwrites whatever -is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting. +* SUMMARY: ~def tick args; end;~ +Most everything you will need to build your game is in the ~args~ parameter that is provided to your ~tick~ method. Follows is a high level summary of each function that is available from ~args~. + +All the properties below hang off of ~args~ and can be accessed in the ~tick~ method: +#+begin_src + def tick args + args.PROPERTY + end +#+end_src +** ~args.state~ +Store your game state inside of this ~state~. Properties with arbitrary nesting is allowed and a backing Entity will be created on your behalf. +#+begin_src + def tick args + args.state.player.x ||= 0 + args.state.player.y ||= 0 + end +#+end_src +*** ~.*.entity_id~ +Entities automatically receive an ~entity_id~ of type ~Fixnum~. +*** ~.*.entity_type~ +Entities can have an ~entity_type~ which is represented as a ~Symbol~. +*** ~.*.created_at~ +Entities have ~created_at~ set to ~args.state.tick_count~ when they are created. +*** ~.*.created_at_elapsed~ +Returns the elapsed number of ticks since creation. +*** ~.*.global_created_at~ +Entities have ~global_created_at~ set to ~Kernel.global_tick_count~ when they are created. +*** ~.*.global_created_at_elapsed~ +Returns the elapsed number of global ticks since creation. +*** ~.*.as_hash~ +Entity cast to a ~Hash~ so you can update values as if you were updating a ~Hash~. +*** ~.new_entity~ +Creates a new Entity with a ~type~, and initial properties. An option block can be passed to change the newly created entity: +#+begin_src ruby + def tick args + args.state.player ||= args.state.new_entity :player, x: 0, y: 0 do |e| + e.max_hp = 100 + e.hp = e.max_hp * rand + end + end +#+end_src +*** ~.new_entity_strict~ +Creates a new Strict Entity. While Entities created via ~args.state.new_entity~ can have new properties added later on, Entities created +using ~args.state.new_entity~ must define all properties that are allowed during its initialization. Attempting to add new properties after +initialization will result in an exception. +*** ~.tick_count~ +Returns the current tick of the game. ~args.state.tick_count~ is ~0~ when the game is first started or if the game is reset via ~$gtk.reset~. +** ~args.inputs~ +Access using input using ~args.inputs~. +*** ~.up~ +Returns ~true~ if: the ~up~ arrow or ~w~ key is pressed or held on the ~keyboard~; or if ~up~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted upwards. +*** ~.down~ +Returns ~true~ if: the ~down~ arrow or ~s~ key is pressed or held on the ~keyboard~; or if ~down~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted downwards. +*** ~.left~ +Returns ~true~ if: the ~left~ arrow or ~a~ key is pressed or held on the ~keyboard~; or if ~left~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the left. +*** ~.right~ +Returns ~true~ if: the ~right~ arrow or ~d~ key is pressed or held on the ~keyboard~; or if ~right~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the right. +*** ~.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~. +*** ~.text~ OR ~.history~ +Returns a string that represents the last key that was pressed on the keyboard. +*** ~.mouse~ +Represents the user's +**** ~.x~ +Returns the current ~x~ location of the mouse. +**** ~mouse.y~ +Return. +**** ~.inside_rect? rect~ +Return. ~args.inputs.mouse.inside_rect?~ takes in any primitive that responds to ~x, y, w, h~: +**** ~.inside_circle? center_point, radius~ +Returns ~true~ if the mouse is inside of a specified circle. ~args.inputs.mouse.inside_circle?~ takes in any primitive that responds to ~x, y~ (which represents the circle's center), and takes in a ~radius~: +**** ~.moved~ +Returns ~true~ if the mouse has moved on the current frame. +**** ~.button_left~ +Returns ~true~ if the left mouse button is down. +**** ~.button_middle~ +Returns ~true~ if the middle mouse button is down. +**** ~.button_right~ +Returns ~true~ if the right mouse button is down. +**** ~.button_bits~ +Returns a bitmask for all buttons on the mouse: ~1~ for a button in the ~down~ state, ~0~ for a button in the ~up~ state. +**** ~mouse.wheel~ +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. +**** ~.click~ OR ~.down~, ~.previous_click~, ~.up~ +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 +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 +Returns ~true~ if ~up~ is pressed or held on the directional or left analog. +**** ~.down +Returns ~true~ if ~down~ is pressed or held on the directional or left analog. +**** ~.left +Returns ~true~ if ~left~ is pressed or held on the directional or left analog. +**** ~.right +Returns ~true~ if ~right~ is pressed or held on the directional or left analog. +**** ~.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 +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~). +**** ~.left_analog_y_raw|right_analog_y_raw)~ +Returns the raw integer value for the analog's vertical movement (~-32,000 to +32,000~). +**** ~.left_analog_x_perc|right_analog_x_perc)~ +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)~ +Returns ~true~ if ~up~ is pressed or held on the directional. +**** ~.directional_down)~ +Returns ~true~ if ~down~ is pressed or held on the directional. +**** ~.directional_left)~ +Returns ~true~ if ~left~ is pressed or held on the directional. +**** ~.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. +**** ~.truthy_keys~ +Returns a collection of ~Symbol~s that represent all keys that are in the pressed or held state. +**** ~.key_down~ +Returns ~true~ if the specific button was pressed on this frame. ~args.inputs.controller_(one|two).key_down.BUTTON~ will only be true on the frame it was pressed. +**** ~.key_held~ +Returns ~true~ if the specific button is being held. ~args.inputs.controller_(one|two).key_held.BUTTON~ will be true for all frames after ~key_down~ (until released). +**** ~.key_up~ +Returns ~true~ if the specific button was released. ~args.inputs.controller_(one|two).key_up.BUTTON~ will be true only on the frame the button was released. +*** ~.keyboard~ +Represents the user's keyboard +**** ~.up~ +Returns ~true~ if ~up~ or ~w~ is pressed or held on the keyboard. +**** ~.down~ +Returns ~true~ if ~down~ or ~s~ is pressed or held on the keyboard. +**** ~.left~ +Returns ~true~ if ~left~ or ~a~ is pressed or held on the keyboard. +**** ~.right~ +Returns ~true~ if ~right~ or ~d~ is pressed or held on the keyboard. +**** ~.left_right~ +Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.left~ and ~args.inputs.keyboard.right~. +**** ~.up_down~ +Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.up~ and ~args.inputs.keyboard.up~. +**** keyboard properties +The following properties represent keys on the keyboard and are available on ~args.inputs.keyboard.KEY~, ~args.inputs.keyboard.key_down.KEY~, ~args.inputs.keyboard.key_held.KEY~, and ~args.inputs.keyboard.key_up.KEY~: +- ~alt~ +- ~meta~ +- ~control~ +- ~shift~ +- ~ctrl_KEY~ (dynamic method, eg ~args.inputs.keyboard.ctrl_a~) +- ~exclamation_point~ +- ~zero~ +- ~one~ +- ~two~ +- ~three~ +- ~four~ +- ~five~ +- ~six~ +- ~seven~ +- ~eight~ +- ~nine~ +- ~backspace~ +- ~delete~ +- ~escape~ +- ~enter~ +- ~tab~ +- ~open_round_brace~ +- ~close_round_brace~ +- ~open_curly_brace~ +- ~close_curly_brace~ +- ~open_square_brace~ +- ~close_square_brace~ +- ~colon~ +- ~semicolon~ +- ~equal_sign~ +- ~hyphen~ +- ~space~ +- ~dollar_sign~ +- ~double_quotation_mark~ +- ~single_quotation_mark~ +- ~backtick~ +- ~tilde~ +- ~period~ +- ~comma~ +- ~pipe~ +- ~underscore~ +- ~a~ +- ~b~ +- ~c~ +- ~d~ +- ~e~ +- ~f~ +- ~g~ +- ~h~ +- ~i~ +- ~j~ +- ~k~ +- ~l~ +- ~m~ +- ~n~ +- ~o~ +- ~p~ +- ~q~ +- ~r~ +- ~s~ +- ~t~ +- ~u~ +- ~v~ +- ~w~ +- ~x~ +- ~y~ +- ~z~ +- ~shift~ +- ~control~ +- ~alt~ +- ~meta~ +- ~left~ +- ~right~ +- ~up~ +- ~down~ +- ~pageup~ +- ~pagedown~ +- ~char~ +- ~plus~ +- ~at~ +- ~forward_slash~ +- ~back_slash~ +- ~asterisk~ +- ~less_than~ +- ~greater_than~ +- ~carat~ +- ~ampersand~ +- ~superscript_two~ +- ~circumflex~ +- ~question_mark~ +- ~section_sign~ +- ~ordinal_indicator~ +- ~raw_key~ +- ~raw_key~ +- ~left_right~ +- ~up_down~ +- ~directional_vector~ +- ~truthy_keys~ +**** ~inputs.keyboard.keys~ +Returns a ~Hash~ with all keys on the keyboard in their respective state. The ~Hash~ contains the following ~keys~ +- ~:down~ +- ~:held~ +- ~:down_or_held~ +- ~:up~ +** ~args.outputs~ +~args.outputs.PROPERTY~ is how you render to the screen. +*** ~.background_color~ +Set ~args.outputs.background_color~ to an ~Array~ with ~RGB~ values (eg. ~[255, 255, 255]~ for the color white). +*** ~.sounds~ +Send a file path to this collection to play a sound. The sound file must be under the ~mygame~ directory. Example: ~args.outputs.sounds << "sounds/jump.wav"~. +*** ~.solids~ +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. +*** ~.static_solids~ +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. +*** ~.sprites~, ~.static_sprites~ +Send a Primitive to this collection to render a sprite to the screen. +*** ~.primitives~, ~.static_primitives~ +Send a Primitive of any type and it'll be rendered. The Primitive must have a ~primitive_marker~ that returns ~:solid~, ~:sprite~, ~:label~, ~:line~, ~:border~. +*** ~.labels~, ~.static_labels~ +Send a Primitive to this collection to render text to the screen. +*** ~.lines~, ~.static_lines~ +Send a Primitive to this collection to render a line to the screen. +*** ~.borders~, ~.static_borders~ +Send a Primitive to this collection to render an unfilled rectangle to the screen. +*** ~.debug~, ~.static_debug~ +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~. +*** ~.inside_rect? rect_1, rect_2~ +Returns ~true~ if ~rect_1~ is inside ~rect_2~. +*** ~.intersect_rect? rect_2, rect_2~ +Returns ~true~ if ~rect_1~ intersects ~rect_2~. +*** ~.scale_rect rect, x_percentage, y_percentage~ +Returns a new rectangle that is scaled by the percentages provided. +*** ~.angle_to start_point, end_point~ +Returns the angle in degrees between two points ~start_point~ to ~end_point~. +*** ~.angle_from start_point, end_point~ +Returns the angle in degrees between two points ~start_point~ from ~end_point~. +*** ~.point_inside_circle? point, circle_center_point, radius~ +Returns ~true~ if a point is inside a circle defined by its center and radius. +*** ~.center_inside_rect rect, other_rect~ +Returns a new rectangle based of off ~rect~ that is centered inside of ~other_rect~. +*** ~.center_inside_rect_x rect, other_rect~ +Returns a new rectangle based of off ~rect~ that is centered horizontally inside of ~other_rect~. +*** ~.center_inside_rect_y rect, other_rect~ +Returns a new rectangle based of off ~rect~ that is centered vertically inside of ~other_rect~. +*** ~.anchor_rect rect, anchor_x, anchor_y~ +Returns a new rectangle based of off ~rect~ that has been repositioned based on the percentages passed into anchor_x, and anchor_y. +*** ~.shift_line line, x, y~ +Returns a line that is offset by ~x~, and ~y~. +*** ~.line_y_intercept line~ +Given a line, the ~b~ value is determined for the point slope form equation: ~y = mx + b~. +*** ~.angle_between_lines line_one, line_two, replace_infinity:~ +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. +*** ~.line_slope line, replace_infinity:~ +Given a line, the ~m~ value is determined for the point slope form equation: ~y = mx + b~. +*** ~.line_rise_run~ +Given a line, a ~Hash~ is returned that returns the slope as ~x~ and ~y~ properties with normalized values (the number is between -1 and 1). +*** ~.ray_test point, line~ +Given a point and a line, ~:on~, ~:left~, or ~:right~ which represents the location of the point relative to the line. +*** ~.line_rect line~ +Returns the bounding rectangle for a line. +*** ~.line_intersect line_one, line_two~ +Returns a point that represents the intersection of the lines. +*** ~.distance point_one, point_two~ +Returns the distance between two points. +*** ~.cubic_bezier t, a, b, c, d~ +Returns the cubic bezier function for tick_count ~t~ with anchors ~a~, ~b~, ~c~, and ~d~. +** ~args.easing~ +A set of functions that allow you to determine the current progression of an easing function. +*** ~.ease start_tick, current_tick, duration, easing_functions~ +Given a start, current, duration, and easing function names, ~ease~ returns a number between 0 and 1 that represents the progress of an easing function. + +The built in easing definitions you have access to are ~:identity~, ~:flip~, ~:quad~, ~:cube~, ~:quart~, and ~:quint~. + +This example will move a box at a linear speed from 0 to 1280. #+begin_src ruby def tick args - if args.inputs.mouse.click - args.gtk.write_file "last-mouse-click.txt", "Mouse was clicked at #{args.state.tick_count}." + start_time = 10 + duration = 60 + current_progress = args.easing.ease start_time, + args.state.tick_count, + duration, + :identity + args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 } + end +#+end_src +*** ~.ease_spline start_tick, current_tick, duration, spline~ +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. + +This example will move a box at a linear speed from 0 to 1280 and then back to 0 using two bezier definitions (represented as an array with four values). + +#+begin_src ruby + def tick args + start_time = 10 + duration = 60 + spline = [ + [ 0, 0.25, 0.75, 1.0], + [1.0, 0.75, 0.25, 0] + ] + current_progress = args.easing.ease_spline start_time, + args.state.tick_count, + duration, + spline + args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 } + end +#+end_src +** ~args.string~ +Useful string functions not included in Ruby core libraries. +*** ~.wrapped_lines string, max_character_length~ +This function will return a collection of strings given an input +~string~ and ~max_character_length~. The collection of strings returned will split the +input string into strings of ~length <= max_character_length~. + +The following example takes a string with new lines and creates a label for each one. +Labels (~args.outputs.labels~) ignore newline characters ~\n~. + +#+begin_src ruby + def tick args + long_string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Integer 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 +** ~args.grid~ +Returns the virtual grid for the game. +*** ~.name~ +Returns either ~:origin_bottom_left~ or ~:origin_center~. +*** ~.bottom~ +Returns the ~y~ value that represents the bottom of the grid. +*** ~.top~ +Returns the ~y~ value that represents the top of the grid. +*** ~.left~ +Returns the ~x~ value that represents the left of the grid. +*** ~.right~ +Returns the ~x~ value that represents the right of the grid. +*** ~.rect~ +Returns a rectangle Primitive that represents the grid. +*** ~.origin_bottom_left!~ +Change the grids coordinate system to 0, 0 at the bottom left corner. +*** ~.origin_center!~ +Change the grids coordinate system to 0, 0 at the center of the screen. +*** ~.w~ +Returns the grid's width (always 1280). +*** ~.h~ +Returns the grid's height (always 720). +** ~args.gtk~ +This represents the DragonRuby Game Toolkit's Runtime Environment and can be accessed via ~args.gtk.METHOD~. +*** ~.argv~ +Returns a ~String~ that represents the parameters passed into the ~./dragonruby~ binary. +*** ~.platform~ +Returns a ~String~ representing the operating system the game is running on. +*** ~.request_quit~ +Request that the runtime quit the game. +*** ~.write_file path, contents~ +Writes/overwrites a file within the game directory + path. +*** ~.write_file_root~ +Writes/overwrites a file within the root dragonruby binary directory + path. +*** ~.append_file path, contents~ +Append content to a file located at the game directory + path. +*** ~.append_file_root path, contents~ +Append content to a file located at the root dragonruby binary directory + path. +*** ~.read_file path~ +Reads a file from the sandboxed file system. +*** ~.parse_xml string, parse_xml_file path~ +Returns a ~Hash~ for a ~String~ that represents XML. +*** ~.parse_json string, parse_json_file path~ +Returns a ~Hash~ for a ~String~ that represents JSON. +*** ~.http_get url, extra_headers = {}~ +Creates an async task to perform an HTTP GET. +*** ~.http_post url, form_fields = {}, extra_headers = {}~ +Creates an async task to perform an HTTP POST. +*** ~.reset~ +Resets the game by deleting all data in ~args.state~ and setting ~args.state.tick_count~ back to ~0~. +*** ~.stop_music~ +Stops all background music. +*** ~.calcstringbox str, size_enum, font~ +Returns a tuple with width and height of a string being rendered. +*** ~.slowmo! factor~ +Slows the game down by the factor provided. +*** ~.notify! string~ +Renders a toast message at the bottom of the screen. +*** ~.system~ +Invokes a shell command and prints the result to the console. +*** ~.exec~ +Invokes a shell command and returns a ~String~ that represents the result. +*** ~.save_state~ +Saves the game state to ~game_state.txt~. +*** ~.load_state~ +Load ~args.state~ from ~game_state.txt~. +*** ~.serialize_state file, state~ +Saves entity state to a file. If only one parameter is provided a string is returned for state instead of writing to a file. +*** ~.deserialize_state file~ +Returns entity state from a file or serialization data represented as a ~String~. +*** ~.reset_sprite path~ +Invalids the texture cache of a sprite. +*** ~.show_cursor~ +Shows the mouse cursor. +*** ~.hide_cursor~ +Hides the mouse cursor. +*** ~.cursor_shown?~ +Returns ~true~ if the mouse cursor is shown. +*** ~.set_window_fullscreen enabled~ +Sets the game to either fullscreen (~enabled=true~) or windowed (~enabled=false)~. +*** ~.openurl url~ +Opens a url using the Operating System's default browser. +*** ~.get_base_dir~ +Returns the full path of the DragonRuby binary directory. +*** ~.get_game_dir~ +Returns the full path of the game directory in its sandboxed environment. * DOCS: ~GTK::Runtime#reset~ This function will reset Kernel.tick_count to 0 and will remove all data from args.state. @@ -1193,6 +1612,19 @@ This function returns the width and height of a string. end #+end_src +* DOCS: ~GTK::Runtime#write_file~ +This function takes in two parameters. The first parameter is the file path and assumes the the game +directory is the root. The second parameter is the string that will be written. The method overwrites whatever +is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting. + +#+begin_src ruby + def tick args + if args.inputs.mouse.click + args.gtk.write_file "last-mouse-click.txt", "Mouse was clicked at #{args.state.tick_count}." + end + end +#+end_src + * DOCS: ~Array~ The Array class has been extend to provide methods that @@ -1442,6 +1874,76 @@ considered intersecting unless they are overlapping by more than ~0.1~. #+end_src +* DOCS: ~GTK::Args#audio~ + +Hash that contains audio sources that are playing. If you want to add a new sound add a hash with keys/values as +in the following example: + +#+begin_src + def tick args + # The values below (except for input of course) are the default values that apply if you don't + # specify the value in the hash. + args.audio[:my_audio] = { + input: 'sound/boom.wav', # Filename + x: 0.0, y: 0.0, z: 0.0, # Relative position to the listener, x, y, z from -1.0 to 1.0 + gain: 1.0, # Volume (0.0 to 1.0) + pitch: 1.0, # Pitch of the sound (1.0 = original pitch) + paused: false, # Set to true to pause the sound at the current playback position + looping: false, # Set to true to loop the sound/music until you stop it + } + end +#+end_src + +Sounds that don't specify ~looping: true~ will be removed automatically from the hash after the playback ends. +Looping sounds or sounds that should stop early must be removed manually. + +** Audio synthesis (Pro only) + +Instead of a path to an audio file you can specify an array ~[channels, sample_rate, sound_source]~ for ~input~ +to procedurally generate sound. You do this by providing an array of float values between -1.0 and 1.0 that +describe the waveform you want to play. + +- ~channels~ is the number of channels: 1 = mono, 2 = stereo +- ~sample_rate~ is the number of values per seconds you will provide to describe the audio wave +- ~sound_source~ The source of your sound. See below + +*** Sound source + +A sound source can be one of two things: + +- A ~Proc~ object that is called on demand to generate the next samples to play. Every call should generate + enough samples for at least 0.1 to 0.5 seconds to get continuous playback without audio skips. + The audio will continue playing endlessly until removed, so the ~looping~ option will have no effect. + +- An array of sample values that will be played back once. This is useful for procedurally generated one-off SFX. + ~looping~ will work as expected + +When you specify 2 for ~channels~, then the generated sample array will be played back in an interleaved manner. +The first element is the first sample for the left channel, the second element is the first sample for the right +channel, the third element is the second sample for the left channel etc. + +*** Example: + +#+begin_src + def tick args + sample_rate = 48000 + + generate_sine_wave = lambda do + frequency = 440.0 # A5 + samples_per_period = (sample_rate / frequency).ceil + one_period = samples_per_period.map_with_index { |i| + Math.sin((2 * Math::PI) * (i / samples_per_period)) + } + one_period * frequency # Generate 1 second worth of sound + end + + args.audio[:my_audio] ||= { + input: [1, sample_rate, generate_sine_wave] + } + end +#+end_src + + * DOCS: ~GTK::Outputs~ Outputs is how you render primitives to the screen. The minimal setup for @@ -1920,10 +2422,40 @@ Returns the current tick of the game. This value is reset if you call $gtk.reset Returns the current tick of the application from the point it was started. This value is never reset. +* DOCS: ~Geometry~ + +The Geometry module contains methods for calculations that are frequently used in game development. + + +* DOCS: ~GTK::Geometry#scale_rect~ + +Given an array with 4 elements representing a rect [x, y, w, h], this function returns a scaled rect. It accepts three arguments: + +~ratio~: the ratio by which to scale the rect. A ratio of 2 will double the dimensions of the rect while a ratio of 0.5 will halve its dimensions. + +~anchor_x~ and ~anchor_y~ specify the point within the rect from which to resize it. Setting both to 0 will affect the width and height of the rect, leaving x and y unchanged. Setting both to 0.5 will scale all sides of the rect proportionally from the center. + +The ~scale_rect~ method can be applied directly to a sprite or other primitives. See CHEATSHEET: How to Scale a Sprite. + +#+begin_src ruby + def tick args + # x, y, w, h + my_rect = [100, 100, 200, 200] + + # halve the dimensions of the rect: + # ratio, anchor_x, anchor_y + new_rect = my_rect.scale_rect(0.5, 0.5, 0.5) + + puts new_rect # => [150.0, 150.0, 100.0, 100.0] + end +#+end_src + + -* Open Source -Follows is a source code listing for all files that have been open sourced. This code can be found in the ~./samples~ directory and online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]]. -* Learn Ruby Optional - Beginner Ruby Primer - automation.rb +* Source Code +Follows is a source code listing for all files that have been open sourced. This code can be found in the ~./samples~ directory. +** Samples +*** Learn Ruby Optional - Beginner Ruby Primer - automation.rb #+begin_src ruby # ./samples/00_learn_ruby_optional/00_beginner_ruby_primer/app/automation.rb # ========================================================================== @@ -2049,7 +2581,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Learn Ruby Optional - Beginner Ruby Primer - main.rb +*** Learn Ruby Optional - Beginner Ruby Primer - main.rb #+begin_src ruby # ./samples/00_learn_ruby_optional/00_beginner_ruby_primer/app/main.rb # ========================================================================== @@ -2372,7 +2904,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Learn Ruby Optional - Intermediate Ruby Primer - printing.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - printing.txt #+begin_src ruby # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/01_printing.txt # ==================================================================================== @@ -2409,7 +2941,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Learn Ruby Optional - Intermediate Ruby Primer - strings.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - strings.txt #+begin_src ruby # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/02_strings.txt # ==================================================================================== @@ -2430,7 +2962,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt #+begin_src ruby # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/03_numbers.txt # ==================================================================================== @@ -2457,7 +2989,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Learn Ruby Optional - Intermediate Ruby Primer - booleans.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - booleans.txt #+begin_src ruby # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/04_booleans.txt # ==================================================================================== @@ -2495,7 +3027,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Learn Ruby Optional - Intermediate Ruby Primer - conditionals.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - conditionals.txt #+begin_src ruby # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/05_conditionals.txt # ==================================================================================== @@ -2615,7 +3147,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Learn Ruby Optional - Intermediate Ruby Primer - looping.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - looping.txt #+begin_src ruby # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/06_looping.txt # ==================================================================================== @@ -2676,7 +3208,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Learn Ruby Optional - Intermediate Ruby Primer - functions.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - functions.txt #+begin_src ruby # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/07_functions.txt # ==================================================================================== @@ -2751,7 +3283,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt #+begin_src ruby # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/08_arrays.txt # ==================================================================================== @@ -2967,7 +3499,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Learn Ruby Optional - Intermediate Ruby Primer - main.rb +*** Learn Ruby Optional - Intermediate Ruby Primer - main.rb #+begin_src ruby # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/main.rb def tick args @@ -2976,7 +3508,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rendering Basics - Labels - main.rb +*** Rendering Basics - Labels - main.rb #+begin_src ruby # ./samples/01_rendering_basics/01_labels/app/main.rb =begin @@ -3081,7 +3613,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rendering Basics - Lines - main.rb +*** Rendering Basics - Lines - main.rb #+begin_src ruby # ./samples/01_rendering_basics/02_lines/app/main.rb =begin @@ -3141,7 +3673,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rendering Basics - Solids Borders - main.rb +*** Rendering Basics - Solids Borders - main.rb #+begin_src ruby # ./samples/01_rendering_basics/03_solids_borders/app/main.rb =begin @@ -3213,7 +3745,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rendering Basics - Sprites - main.rb +*** Rendering Basics - Sprites - main.rb #+begin_src ruby # ./samples/01_rendering_basics/04_sprites/app/main.rb =begin @@ -3262,7 +3794,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rendering Basics - Sounds - main.rb +*** Rendering Basics - Sounds - main.rb #+begin_src ruby # ./samples/01_rendering_basics/05_sounds/app/main.rb =begin @@ -3274,12 +3806,6 @@ Follows is a source code listing for all files that have been open sourced. This of available notes. Reminders: - - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual - 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720). - - - args.state.new_entity: Used when we want to create a new object, like a sprite or button. - For example, if we want to create a new button, we would declare it as a new entity and - then define its properties. - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated as Ruby code, and the placeholder is replaced with its corresponding value or result. @@ -3287,16 +3813,6 @@ Follows is a source code listing for all files that have been open sourced. This - args.outputs.labels: An array. The values generate a label. The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] For more information about labels, go to mygame/documentation/02-labels.md. - - - reject: Removes elements from a collection if they meet certain requirements. - - - first: Returns the first element of an array. - - - inside_rect: Returns true or false depending on if the point is inside the rect. - - - to_sym: Returns symbol corresponding to string. Will create a symbol if it does - not already exist. - =end # This sample app allows users to test their musical skills by matching the piano sound that plays in each @@ -3304,160 +3820,18 @@ Follows is a source code listing for all files that have been open sourced. This # Runs all the methods necessary for the game to function properly. def tick args - defaults args - render args - calc args - input_mouse args - tick_instructions args, "Sample app shows how to play sounds. args.outputs.sounds << \"path_to_wav.wav\"" - end - - # Sets default values and creates empty collections - # Initialization happens in the first frame only - def defaults _ - _.state.notes ||= [] - _.state.click_feedbacks ||= [] - _.state.current_level ||= 1 - _.state.times_wrong ||= 0 # when game starts, user hasn't guessed wrong yet - end - - # Uses a label to display current level, and shows the score - # Creates a button to play the sample note, and displays the available notes that could be a potential match - def render _ + args.outputs.labels << [640, 360, "Click anywhere to play a random sound.", 0, 1] + args.state.notes ||= [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4] - # grid.w_half positions the label in the horizontal center of the screen. - _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(40), "Hole #{_.state.current_level} of 9", 0, 1, 0, 0, 0] - - render_score _ # shows score on screen - - if _.state.game_over # if game is over, a "play again" button is shown - # Calculations ensure that Play Again label is displayed in center of border - # Remove calculations from y parameters and see what happens to border and label placement - _.state.play_again_border ||= _.state.with_meta([560, _.grid.h * 3 / 4 - 40, 160, 60], 'again') # array definition, text/title - _.outputs.labels << [_.grid.w_half, _.grid.h * 3 / 4, "Play Again", 0, 1, 0, 0, 0] # outputs label - _.outputs.borders << _.state.play_again_border # outputs border - else # otherwise, if game is not over - # Calculations ensure that label appears in center of border - _.state.play_note_border ||= _.state.with_meta([560, _.grid.h * 3 / 4 - 40, 160, 60], 'play') # array definition, text/title - _.outputs.labels << [_.grid.w_half, _.grid.h * 3 / 4, "Play Note ##{_.state.current_level}", 0, 1, 0, 0, 0] # outputs label - _.outputs.borders << _.state.play_note_border # outputs border - end - - return if _.state.game_over # return if game is over - - _.outputs.labels << [_.grid.w_half, 400, "I think the note is a(n)...", 0, 1, 0, 0, 0] # outputs label - - # Shows all of the available notes that can be potential matches. - available_notes.each_with_index do |note, i| - _.state.notes[i] ||= piano_button(_, note, i + 1) # calls piano_button method on each note (creates label and border) - _.outputs.labels << _.state.notes[i].label # outputs note on screen with a label and a border - _.outputs.borders << _.state.notes[i].border - end - - # Shows whether or not the user is correct by filling the screen with either red or green - _.outputs.solids << _.state.click_feedbacks.map { |c| c.solid } - end - - # Shows the score (number of times the user guesses wrong) onto the screen using labels. - def render_score _ - if _.state.times_wrong == 0 # if the user has guessed wrong zero times, the score is par - _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(80), "Score: PAR", 0, 1, 0, 0, 0] - else # otherwise, number of times the user has guessed wrong is shown - _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(80), "Score: +#{_.state.times_wrong}", 0, 1, 0, 0, 0] # shows score using string interpolation - end - end - - # Sets the target note for the level and performs calculations on click_feedbacks. - def calc _ - _.state.target_note ||= available_notes.sample # chooses a note from available_notes collection as target note - _.state.click_feedbacks.each { |c| c.solid[-1] -= 5 } # remove this line and solid color will remain on screen indefinitely - # comment this line out and the solid color will keep flashing on screen instead of being removed from click_feedbacks collection - _.state.click_feedbacks.reject! { |c| c.solid[-1] <= 0 } - end - - # Uses input from the user to play the target note, as well as the other notes that could be a potential match. - def input_mouse _ - return unless _.inputs.mouse.click # return unless the mouse is clicked - - # finds button that was clicked by user - button_clicked = _.outputs.borders.find_all do |b| # go through borders collection to find all borders that meet requirements - _.inputs.mouse.click.point.inside_rect? b # find button border that mouse was clicked inside of - end.reject {|b| !_.state.meta(b)}.first # reject, return first element - - return unless button_clicked # return unless button_clicked as a value (a button was clicked) - - queue_click_feedback _, # calls queue_click_feedback method on the button that was clicked - button_clicked.x, - button_clicked.y, - button_clicked.w, - button_clicked.h, - 150, 100, 200 # sets color of button to shade of purple - - if _.state.meta(button_clicked) == 'play' # if "play note" button is pressed - _.outputs.sounds << "sounds/#{_.state.target_note}.wav" # sound of target note is output - elsif _.state.meta(button_clicked) == 'again' # if "play game again" button is pressed - _.state.target_note = nil # no target note - _.state.current_level = 1 # starts at level 1 again - _.state.times_wrong = 0 # starts off with 0 wrong guesses - _.state.game_over = false # the game is not over (because it has just been restarted) - else # otherwise if neither of those buttons were pressed - _.outputs.sounds << "sounds/#{_.state.meta(button_clicked)}.wav" # sound of clicked note is played - if _.state.meta(button_clicked).to_sym == _.state.target_note # if clicked note is target note - _.state.target_note = nil # target note is emptied - - if _.state.current_level < 9 # if game hasn't reached level 9 - _.state.current_level += 1 # game goes to next level - else # otherwise, if game has reached level 9 - _.state.game_over = true # the game is over - end - - queue_click_feedback _, 0, 0, _.grid.w, _.grid.h, 100, 200, 100 # green shown if user guesses correctly - else # otherwise, if clicked note is not target note - _.state.times_wrong += 1 # increments times user guessed wrong - queue_click_feedback _, 0, 0, _.grid.w, _.grid.h, 200, 100, 100 # red shown is user guesses wrong - end - end - end - - # Creates a collection of all of the available notes as symbols - def available_notes - [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4] - end - - # Creates buttons for each note, and sets a label (the note's name) and border for each note's button. - def piano_button _, note, position - _.state.new_entity(:button) do |b| # declares button as new entity - b.label = [460 + 40.mult(position), _.grid.h * 0.4, "#{note}", 0, 1, 0, 0, 0] # label definition - b.border = _.state.with_meta([460 + 40.mult(position) - 20, _.grid.h * 0.4 - 32, 40, 40], note) # border definition, text/title; 20 subtracted so label is in center of border - end - end - - # Color of click feedback changes depending on what button was clicked, and whether the guess is right or wrong - # If a button is clicked, the inside of button is purple (see input_mouse method) - # If correct note is clicked, screen turns green - # If incorrect note is clicked, screen turns red (again, see input_mouse method) - def queue_click_feedback _, x, y, w, h, *color - _.state.click_feedbacks << _.state.new_entity(:click_feedback) do |c| # declares feedback as new entity - c.solid = [x, y, w, h, *color, 255] # sets color - 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.escape - args.state.key_event_occurred = true + if args.inputs.mouse.click + # Play a sound by adding a string to args.outputs.sounds + args.outputs.sounds << "sounds/#{args.state.notes.sample}.wav" # sound of target note is output 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 -* Rendering Basics - Audio Mixer - main.rb +*** Rendering Basics - Audio Mixer - main.rb #+begin_src ruby # ./samples/01_rendering_basics/06_audio_mixer/app/main.rb $gtk.reset @@ -3623,369 +3997,606 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rendering Basics - Sound Synthesis - main.rb +*** Rendering Basics - Sound Synthesis - main.rb #+begin_src ruby # ./samples/01_rendering_basics/07_sound_synthesis/app/main.rb - def tick args - defaults args - render args - input args - process_audio_queue args - end + 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 defaults args - args.state.sine_waves ||= {} - args.state.audio_queue ||= [] - args.state.buttons ||= [ - (frequency_buttons args), - (note_buttons args), - (bell_buttons args) - ].flatten - 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 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 - def play_sine_wave args, sender - queue_sine_wave args, - frequency: sender[:frequency], - duration: 1.seconds, - fade_out: true - 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 } - def note_buttons args - [ - (button args, - row: 1.5, col: 3, text: "C4", - note: :c, octave: 4, method_to_call: :play_note), - (button args, - row: 2.5, col: 3, text: "D4", - note: :d, octave: 4, method_to_call: :play_note), - (button args, - row: 3.5, col: 3, text: "E4", - note: :e, octave: 4, method_to_call: :play_note), - (button args, - row: 4.5, col: 3, text: "F4", - note: :f, octave: 4, method_to_call: :play_note), - (button args, - row: 5.5, col: 3, text: "G4", - note: :g, octave: 4, method_to_call: :play_note), - (button args, - row: 6.5, col: 3, text: "A5", - note: :a, octave: 5, method_to_call: :play_note), - (button args, - row: 7.5, col: 3, text: "B5", - note: :b, octave: 5, method_to_call: :play_note), - (button args, - row: 8.5, col: 3, text: "C5", - note: :c, octave: 5, method_to_call: :play_note), - ] - end + args.audio.find_all { |k, v| v[:decay_rate] } + .each { |k, v| v[:gain] -= v[:decay_rate] } - def play_note args, sender - queue_sine_wave args, - frequency: (frequency_for note: sender[:note], - octave: sender[:octave]), - duration: 1.seconds, - fade_out: true - end + sounds_to_stop = args.audio + .find_all { |k, v| v[:stop_at] && args.state.tick_count >= v[:stop_at] } + .map { |k, v| k } - def bell_buttons args - [ - (button args, - row: 1.5, col: 6, text: "Bell C4", - note: :c, octave: 4, method_to_call: :play_bell), - (button args, - row: 2.5, col: 6, text: "Bell D4", - note: :d, octave: 4, method_to_call: :play_bell), - (button args, - row: 3.5, col: 6, text: "Bell E4", - note: :e, octave: 4, method_to_call: :play_bell), - (button args, - row: 4.5, col: 6, text: "Bell F4", - note: :f, octave: 4, method_to_call: :play_bell), - (button args, - row: 5.5, col: 6, text: "Bell G4", - note: :g, octave: 4, method_to_call: :play_bell), - (button args, - row: 6.5, col: 6, text: "Bell A5", - note: :a, octave: 5, method_to_call: :play_bell), - (button args, - row: 7.5, col: 6, text: "Bell B5", - note: :b, octave: 5, method_to_call: :play_bell), - (button args, - row: 8.5, col: 6, text: "Bell C5", - note: :c, octave: 5, method_to_call: :play_bell), - ] + sounds_to_stop.each { |k| args.audio.delete k } + end end - def play_bell args, sender - queue_bell args, - frequency: (frequency_for note: sender[:note], - octave: sender[:octave]), - duration: 2.seconds, - fade_out: true - 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)) - 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 + button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0 - def input args - args.state.buttons.each do |b| - if 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 + 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 - if 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' + def play_sine_wave args, sender + queue_sine_wave args, + frequency: sender[:frequency], + duration: 1.seconds, + fade_out: true 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 + 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 - to_queue.each do |a| - args.audio[a[:id]] = a + send method_to_call, args, + frequency: (frequency_for note: sender[:note], octave: sender[:octave]), + duration: 1.seconds, + fade_out: true end - args.audio.each do |k, v| - if v[:decay_rate] - v[:gain] -= v[:decay_rate] - 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 - sounds_to_stop = args.audio.find_all do |k, v| - v[:stop_at] && args.state.tick_count >= v[:stop_at] + 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 - sounds_to_stop.each do |(k, v)| - args.audio.delete k + 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 - end - - def graph_sine_wave args, sine_wave, frequency - if args.state.tick_count != args.state.graphed_at - args.outputs.static_lines.clear - args.outputs.static_sprites.clear + 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 - r, g, b = frequency.to_i % 80, frequency.to_i % 128, frequency.to_i % 255 - center_row = args.layout.rect(row: 5, col: 9) - x_scale = 20 - y_scale = 100 - max_points = 20 - - points = sine_wave - if sine_wave.length > max_points - resolution = sine_wave.length.idiv max_points - points = sine_wave.find_all - .with_index { |y, i| i % resolution == 0 } + 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 - args.outputs.static_lines << points.map_with_index do |y, x| - next_y = points[x + 1] + 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 - if next_y - { - x: center_row.x + (x * x_scale), - y: center_row.y + center_row.h.half + y_scale * y, - x2: center_row.x + ((x + 1) * x_scale), - y2: center_row.y + center_row.h.half + y_scale * next_y, - r: r, - g: g, - b: b - } + begin # region: wave generation + begin # sine wave + def defaults_sine_wave_for + { frequency: 440, sample_rate: 48000 } end - end - args.outputs.static_sprites << points.map_with_index do |y, x| - { - x: (center_row.x + (x * x_scale)) - 1, - y: (center_row.y + center_row.h.half + y_scale * y) - 1, - w: 2, - h: 2, - path: 'sprites/square-black.png' - } + 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 - args.state.graphed_at = args.state.tick_count - end + begin # region: square wave + def defaults_square_wave_for + { frequency: 440, sample_rate: 48000 } + end - def defaults_period_sine_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 sine_wave_for opts = { } - opts = defaults_period_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_square_wave + { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 } + end - 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 queue_square_wave args, opts = {} + opts = defaults_queue_square_wave.merge opts + frequency = opts[:frequency] + sample_rate = 48000 - def defaults_queue_sine_wave - { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 } - end + 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 - def queue_sine_wave args, opts = { } - opts = defaults_queue_sine_wave.merge opts - decay_rate = 0 - decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out] - frequency = opts[:frequency] - sample_rate = 48000 + proc = lambda do + generate_audio_data args.state.square_waves[frequency], sample_rate + end - audio_state = { - 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 - } + 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 - 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 + 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.sine_waves[frequency], 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 - audio_state[:input] = [1, sample_rate, proc] - graph_sine_wave args, sine_wave, frequency - args.state.audio_queue << audio_state - end + begin # region: triangle wave + def defaults_triangle_wave_for + { frequency: 440, sample_rate: 48000 } + end - def defaults_queue_bell - { frequency: 440, duration: 1.seconds, queue_in: 0 } - 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 queue_bell args, opts = {} - (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b } - end + def defaults_queue_triangle_wave + { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 } + 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 queue_triangle_wave args, opts = {} + opts = defaults_queue_triangle_wave.merge opts + frequency = opts[:frequency] + sample_rate = 48000 - def bell_to_sine_waves 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 - } + 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 - end - def defaults_frequency_for - { note: :a, octave: 5, sharp: false, flat: false } - 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 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 + 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 - 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 + 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 new_id! args - args.state.audio_id ||= 0 - args.state.audio_id += 1 - 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 button args, opts - button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1)) + 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 - button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0 + args.state.graphed_at = args.state.tick_count + end + end - font_size_enum = args.layout.font_relative_size_enum 0 - label_offset_x = 4 - label_offset_y = button_def[:rect].h.half + button_def[:rect].h.idiv(4) + begin # region: musical note mapping + def defaults_frequency_for + { note: :a, octave: 5, sharp: false, flat: false } + end - button_def[:label] = button_def[:rect].merge text: opts[:text], - size_enum: font_size_enum, - x: button_def[:rect].x + label_offset_x, - y: button_def[:rect].y + label_offset_y + 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 - button_def + 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 +*** Input Basics - Keyboard - main.rb #+begin_src ruby # ./samples/02_input_basics/01_keyboard/app/main.rb =begin @@ -4161,7 +4772,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Input Basics - Mouse - main.rb +*** Input Basics - Mouse - main.rb #+begin_src ruby # ./samples/02_input_basics/02_mouse/app/main.rb =begin @@ -4254,7 +4865,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Input Basics - Mouse Point To Rect - main.rb +*** Input Basics - Mouse Point To Rect - main.rb #+begin_src ruby # ./samples/02_input_basics/03_mouse_point_to_rect/app/main.rb =begin @@ -4350,7 +4961,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Input Basics - Mouse Rect To Rect - main.rb +*** Input Basics - Mouse Rect To Rect - main.rb #+begin_src ruby # ./samples/02_input_basics/04_mouse_rect_to_rect/app/main.rb =begin @@ -4453,7 +5064,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Input Basics - Controller - main.rb +*** Input Basics - Controller - main.rb #+begin_src ruby # ./samples/02_input_basics/05_controller/app/main.rb =begin @@ -4585,7 +5196,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Input Basics - Touch - main.rb +*** Input Basics - Touch - main.rb #+begin_src ruby # ./samples/02_input_basics/06_touch/app/main.rb def tick args @@ -4633,7 +5244,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rendering Sprites - Animation Using Separate Pngs - main.rb +*** Rendering Sprites - Animation Using Separate Pngs - main.rb #+begin_src ruby # ./samples/03_rendering_sprites/01_animation_using_separate_pngs/app/main.rb =begin @@ -4770,7 +5381,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rendering Sprites - Animation Using Sprite Sheet - main.rb +*** Rendering Sprites - Animation Using Sprite Sheet - main.rb #+begin_src ruby # ./samples/03_rendering_sprites/02_animation_using_sprite_sheet/app/main.rb def tick args @@ -4874,7 +5485,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rendering Sprites - Animation States - main.rb +*** Rendering Sprites - Animation States - main.rb #+begin_src ruby # ./samples/03_rendering_sprites/03_animation_states/app/main.rb class Game @@ -5063,7 +5674,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rendering Sprites - Color And Rotation - main.rb +*** Rendering Sprites - Color And Rotation - main.rb #+begin_src ruby # ./samples/03_rendering_sprites/04_color_and_rotation/app/main.rb =begin @@ -5295,7 +5906,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Physics And Collisions - Simple - main.rb +*** Physics And Collisions - Simple - main.rb #+begin_src ruby # ./samples/04_physics_and_collisions/01_simple/app/main.rb =begin @@ -5409,7 +6020,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Physics And Collisions - Moving Objects - main.rb +*** Physics And Collisions - Moving Objects - main.rb #+begin_src ruby # ./samples/04_physics_and_collisions/02_moving_objects/app/main.rb =begin @@ -5715,7 +6326,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Physics And Collisions - Entities - main.rb +*** Physics And Collisions - Entities - main.rb #+begin_src ruby # ./samples/04_physics_and_collisions/03_entities/app/main.rb =begin @@ -5872,7 +6483,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Physics And Collisions - Box Collision - main.rb +*** Physics And Collisions - Box Collision - main.rb #+begin_src ruby # ./samples/04_physics_and_collisions/04_box_collision/app/main.rb =begin @@ -6215,7 +6826,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Physics And Collisions - Box Collision 2 - main.rb +*** Physics And Collisions - Box Collision 2 - main.rb #+begin_src ruby # ./samples/04_physics_and_collisions/05_box_collision_2/app/main.rb =begin @@ -6691,9 +7302,270 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Physics And Collisions - Jump Physics - main.rb +*** Physics And Collisions - Box Collision 3 - main.rb +#+begin_src ruby + # ./samples/04_physics_and_collisions/06_box_collision_3/app/main.rb + class Game + attr_gtk + + def tick + defaults + render + input_edit_map + input_player + calc_player + end + + def defaults + state.gravity = -0.4 + state.drag = 0.15 + state.tile_size = 32 + state.player.size = 16 + state.player.jump_power = 12 + + state.tiles ||= [] + state.player.y ||= 800 + state.player.x ||= 100 + state.player.dy ||= 0 + state.player.dx ||= 0 + state.player.jumped_down_at ||= 0 + state.player.jumped_at ||= 0 + + calc_player_rect if !state.player.rect + end + + def render + outputs.labels << [10, 10.from_top, "tile: click to add a tile, hold X key and click to delete a tile."] + outputs.labels << [10, 35.from_top, "move: use left and right to move, space to jump, down and space to jump down."] + outputs.labels << [10, 55.from_top, " You can jump through or jump down through tiles with a height of 1."] + outputs.background_color = [80, 80, 80] + outputs.sprites << tiles.map(&:sprite) + outputs.sprites << (player.rect.merge path: 'sprites/square/green.png') + + mouse_overlay = { + x: (inputs.mouse.x.ifloor state.tile_size), + y: (inputs.mouse.y.ifloor state.tile_size), + w: state.tile_size, + h: state.tile_size, + a: 100 + } + + mouse_overlay = mouse_overlay.merge r: 255 if state.delete_mode + + if state.mouse_held + outputs.primitives << mouse_overlay.border + else + outputs.primitives << mouse_overlay.solid + end + end + + def input_edit_map + state.mouse_held = true if inputs.mouse.down + state.mouse_held = false if inputs.mouse.up + + if inputs.keyboard.x + state.delete_mode = true + elsif inputs.keyboard.key_up.x + state.delete_mode = false + end + + return unless state.mouse_held + + ordinal = { x: (inputs.mouse.x.idiv state.tile_size), + y: (inputs.mouse.y.idiv state.tile_size) } + + found = find_tile ordinal + if !found && !state.delete_mode + tiles << (state.new_entity :tile, ordinal) + recompute_tiles + elsif found && state.delete_mode + tiles.delete found + recompute_tiles + end + end + + def input_player + player.dx += inputs.left_right + + if inputs.keyboard.key_down.space && inputs.keyboard.down + player.dy = player.jump_power * -1 + player.jumped_at = 0 + player.jumped_down_at = state.tick_count + elsif inputs.keyboard.key_down.space + player.dy = player.jump_power + player.jumped_at = state.tick_count + player.jumped_down_at = 0 + end + end + + def calc_player + calc_player_rect + calc_below + calc_left + calc_right + calc_above + calc_player_dy + calc_player_dx + reset_player if player_off_stage? + end + + def calc_player_rect + player.rect = current_player_rect + player.next_rect = player.rect.merge x: player.x + player.dx, + y: player.y + player.dy + player.prev_rect = player.rect.merge x: player.x - player.dx, + y: player.y - player.dy + end + + def calc_below + return unless player.dy <= 0 + tiles_below = find_tiles { |t| t.rect.top <= player.y } + collision = find_colliding_tile tiles_below, (player.rect.merge y: player.next_rect.y) + return unless collision + if collision.neighbors.b == :none && player.jumped_down_at.elapsed_time < 10 + player.dy = -1 + else + player.y = collision.rect.y + state.tile_size + player.dy = 0 + end + end + + def calc_left + return unless player.dx < 0 + tiles_left = find_tiles { |t| t.rect.right <= player.prev_rect.left } + collision = find_colliding_tile tiles_left, (player.rect.merge x: player.next_rect.x) + return unless collision + player.x = collision.rect.right + player.dx = 0 + end + + def calc_right + return unless player.dx > 0 + tiles_right = find_tiles { |t| t.rect.left >= player.prev_rect.right } + collision = find_colliding_tile tiles_right, (player.rect.merge x: player.next_rect.x) + return unless collision + player.x = collision.rect.left - player.rect.w + player.dx = 0 + end + + def calc_above + return unless player.dy > 0 + tiles_above = find_tiles { |t| t.rect.y >= player.y } + collision = find_colliding_tile tiles_above, (player.rect.merge y: player.next_rect.y) + return unless collision + return if collision.neighbors.t == :none + player.dy = 0 + player.y = collision.rect.bottom - player.rect.h + end + + def calc_player_dx + player.y += player.dy + player.dy += state.gravity + player.dy += player.dy * state.drag ** 2 * -1 + end + + def calc_player_dy + player.dx = player.dx.clamp(-5, 5) + player.dx *= 0.9 + player.x += player.dx + end + + def reset_player + player.x = 100 + player.y = 720 + player.dy = 0 + end + + def recompute_tiles + tiles.each do |t| + t.w = state.tile_size + t.h = state.tile_size + t.neighbors = tile_neighbors t, tiles + + t.rect = [t.x * state.tile_size, + t.y * state.tile_size, + state.tile_size, + state.tile_size].rect.to_hash + + sprite_sub_path = t.neighbors.mask.map { |m| flip_bit m }.join("") + + t.sprite = { + x: t.x * state.tile_size, + y: t.y * state.tile_size, + w: state.tile_size, + h: state.tile_size, + path: "sprites/tile/wall-#{sprite_sub_path}.png" + } + end + end + + def flip_bit bit + return 0 if bit == 1 + return 1 + end + + def player + state.player + end + + def player_off_stage? + player.rect.top < grid.bottom || + player.rect.right < grid.left || + player.rect.left > grid.right + end + + def current_player_rect + { x: player.x, y: player.y, w: player.size, h: player.size } + end + + def tiles + state.tiles + end + + def find_tile ordinal + tiles.find { |t| t.x == ordinal.x && t.y == ordinal.y } + end + + def find_tiles &block + tiles.find_all(&block) + end + + def find_colliding_tile tiles, target + tiles.find { |t| t.rect.intersect_rect? target } + end + + def tile_neighbors tile, other_points + t = find_tile x: tile.x + 0, y: tile.y + 1 + r = find_tile x: tile.x + 1, y: tile.y + 0 + b = find_tile x: tile.x + 0, y: tile.y - 1 + l = find_tile x: tile.x - 1, y: tile.y + 0 + + tile_t, tile_r, tile_b, tile_l = 0 + + tile_t = 1 if t + tile_r = 1 if r + tile_b = 1 if b + tile_l = 1 if l + + state.new_entity :neighbors, mask: [tile_t, tile_r, tile_b, tile_l], + t: t ? :some : :none, + b: b ? :some : :none, + l: l ? :some : :none, + r: r ? :some : :none + end + end + + def tick args + $game ||= Game.new + $game.args = args + $game.tick + end + +#+end_src + +*** Physics And Collisions - Jump Physics - main.rb #+begin_src ruby - # ./samples/04_physics_and_collisions/06_jump_physics/app/main.rb + # ./samples/04_physics_and_collisions/07_jump_physics/app/main.rb =begin Reminders: @@ -6893,1900 +7765,2844 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Mouse - Mouse Click - main.rb +*** Physics And Collisions - Bouncing On Collision - ball.rb #+begin_src ruby - # ./samples/05_mouse/01_mouse_click/app/main.rb - =begin + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/ball.rb + GRAVITY = -0.08 - APIs listing that haven't been encountered in previous sample apps: + class Ball + attr_accessor :velocity, :center, :radius, :collision_enabled - - product: Returns an array of all combinations of elements from all arrays. + def initialize args + #Start the ball in the top center + #@x = args.grid.w / 2 + #@y = args.grid.h - 20 - For example, [1,2].product([1,2]) would return the following array... - [[1,1], [1,2], [2,1], [2,2]] - More than two arrays can be given to product and it will still work, - such as [1,2].product([1,2],[3,4]). What would product return in this case? + @velocity = {x: 0, y: 0} + #@width = 20 + #@height = @width + @radius = 20.0 / 2.0 + @center = {x: (args.grid.w / 2), y: (args.grid.h)} - Answer: - [[1,1,3],[1,1,4],[1,2,3],[1,2,4],[2,1,3],[2,1,4],[2,2,3],[2,2,4]] + #@left_wall = (args.state.board_width + args.grid.w / 8) + #@right_wall = @left_wall + args.state.board_width + @left_wall = 0 + @right_wall = $args.grid.right - - num1.fdiv(num2): Returns the float division (will have a decimal) of the two given numbers. - For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0 + @max_velocity = 7 + @collision_enabled = true + end - - yield: Allows you to call a method with a code block and yield to that block. + #Move the ball according to its velocity + def update args + @center.x += @velocity.x + @center.y += @velocity.y + @velocity.y += GRAVITY - Reminders: + alpha = 0.2 + if @center.y-@radius <= 0 + @velocity.y = (@velocity.y.abs*0.7).abs + @velocity.x = (@velocity.x.abs*0.9).abs * ((@velocity.x < 0) ? -1 : 1) - - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect. + if @velocity.y.abs() < alpha + @velocity.y=0 + end + if @velocity.x.abs() < alpha + @velocity.x=0 + end + end - - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated - as Ruby code, and the placeholder is replaced with its corresponding value or result. + if @center.x > args.grid.right+@radius*2 + @center.x = 0-@radius + elsif @center.x< 0-@radius*2 + @center.x = args.grid.right + @radius + end + end - - args.inputs.mouse.click: This property will be set if the mouse was clicked. + def wallBounds args + #if @x < @left_wall || @x + @width > @right_wall + #@velocity.x *= -1.1 + #if @velocity.x > @max_velocity + #@velocity.x = @max_velocity + #elsif @velocity.x < @max_velocity * -1 + #@velocity.x = @max_velocity * -1 + #end + #end + #if @y < 0 || @y + @height > args.grid.h + #@velocity.y *= -1.1 + #if @velocity.y > @max_velocity + #@velocity.y = @max_velocity + #elsif @velocity.y < @max_velocity * -1 + #@velocity.y = @max_velocity * -1 + #end + #end + end + + #render the ball to the screen + def draw args + #args.outputs.solids << [@x, @y, @width, @height, 255, 255, 0]; + args.outputs.sprites << [ + @center.x-@radius, + @center.y-@radius, + @radius*2, + @radius*2, + "sprites/circle-white.png", + 0, + 255, + 255, #r + 0, #g + 255 #b + ] + end + end + +#+end_src + +*** Physics And Collisions - Bouncing On Collision - block.rb +#+begin_src ruby + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/block.rb + DEGREES_TO_RADIANS = Math::PI / 180 + + class Block + def initialize(x, y, block_size, rotation) + @x = x + @y = y + @block_size = block_size + @rotation = rotation + + #The repel velocity? + @velocity = {x: 2, y: 0} + + horizontal_offset = (3 * block_size) * Math.cos(rotation * DEGREES_TO_RADIANS) + vertical_offset = block_size * Math.sin(rotation * DEGREES_TO_RADIANS) + + if rotation >= 0 + theta = 90 - rotation + #The line doesn't visually line up exactly with the edge of the sprite, so artificially move it a bit + modifier = 5 + x_offset = modifier * Math.cos(theta * DEGREES_TO_RADIANS) + y_offset = modifier * Math.sin(theta * DEGREES_TO_RADIANS) + @x1 = @x - x_offset + @y1 = @y + y_offset + @x2 = @x1 + horizontal_offset + @y2 = @y1 + (vertical_offset * 3) + + @imaginary_line = [ @x1, @y1, @x2, @y2 ] + else + theta = 90 + rotation + x_offset = @block_size * Math.cos(theta * DEGREES_TO_RADIANS) + y_offset = @block_size * Math.sin(theta * DEGREES_TO_RADIANS) + @x1 = @x + x_offset + @y1 = @y + y_offset + 19 + @x2 = @x1 + horizontal_offset + @y2 = @y1 + (vertical_offset * 3) + + @imaginary_line = [ @x1, @y1, @x2, @y2 ] + end + + end + + def draw args + args.outputs.sprites << [ + @x, + @y, + @block_size*3, + @block_size, + "sprites/square-green.png", + @rotation + ] - - Ternary operator (?): Will evaluate a statement (just like an if statement) - and perform an action if the result is true or another action if it is false. + args.outputs.lines << @imaginary_line + args.outputs.solids << @debug_shape + end - - reject: Removes elements from a collection if they meet certain requirements. + def multiply_matricies + end - - args.outputs.borders: An array. The values generate a border. - The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE] - For more information about borders, go to mygame/documentation/03-solids-and-borders.md. + def calc args + if collision? args + collide args + end + end - - args.outputs.labels: An array. The values generate a label. - The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] - For more information about labels, go to mygame/documentation/02-labels. + #Determine if the ball and block are touching + def collision? args + #The minimum area enclosed by the center of the ball and the 2 corners of the block + #If the area ever drops below this value, we know there is a collision + min_area = ((@block_size * 3) * args.state.ball.radius) / 2 - =end + #https://www.mathopenref.com/coordtrianglearea.html + ax = @x1 + ay = @y1 + bx = @x2 + by = @y2 + cx = args.state.ball.center.x + cy = args.state.ball.center.y - # This sample app is a classic game of Tic Tac Toe. + current_area = (ax*(by-cy)+bx*(cy-ay)+cx*(ay-by))/2 - class TicTacToe - attr_accessor :_, :state, :outputs, :inputs, :grid, :gtk + collision = false + if @rotation >= 0 + if (current_area < min_area && + current_area > 0 && + args.state.ball.center.y > @y1 && + args.state.ball.center.x < @x2) - # Starts the game with player x's turn and creates an array (to_a) for space combinations. - # Calls methods necessary for the game to run properly. - def tick - state.current_turn ||= :x - state.space_combinations = [-1, 0, 1].product([-1, 0, 1]).to_a - render_board - input_board + collision = true + end + else + if (current_area < min_area && + current_area > 0 && + args.state.ball.center.y > @y2 && + args.state.ball.center.x > @x1) + + collision = true + end + end + + return collision end - # Uses borders to create grid squares for the game's board. Also outputs the game pieces using labels. - def render_board - square_size = 80 + def collide args + #Slope of the block + slope = (@y2 - @y1) / (@x2 - @x1) - # Positions the game's board in the center of the screen. - # Try removing what follows grid.w_half or grid.h_half and see how the position changes! - board_left = grid.w_half - square_size * 1.5 - board_top = grid.h_half - square_size * 1.5 + #Create a unit vector and tilt it (@rotation) number of degrees + x = -Math.cos(@rotation * DEGREES_TO_RADIANS) + y = Math.sin(@rotation * DEGREES_TO_RADIANS) - # At first glance, the add(1) looks pretty trivial. But if you remove it, - # you'll see that the positioning of the board would be skewed without it! - # Or if you put 2 in the parenthesis, the pieces will be placed in the wrong squares - # due to the change in board placement. - outputs.borders << all_spaces do |x, y, space| # outputs borders for all board spaces - space.border ||= [ - board_left + x.add(1) * square_size, # space.border is initialized using this definition - board_top + y.add(1) * square_size, - square_size, - square_size - ] - end + #Find the vector that is perpendicular to the slope + perpVect = { x: x, y: y } + mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magniude of the perpVect + perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magniude to make it a unit vector - # Again, the calculations ensure that the piece is placed in the center of the grid square. - # Remove the '- 20' and the piece will be placed at the top of the grid square instead of the center. - outputs.labels << filled_spaces do |x, y, space| # put label in each filled space of board - label board_left + x.add(1) * square_size + square_size.fdiv(2), - board_top + y.add(1) * square_size + square_size - 20, - space.piece # text of label, either "x" or "o" - end + previousPosition = { # calculate an ESTIMATE of the previousPosition of the ball + x:args.state.ball.center.x-args.state.ball.velocity.x, + y:args.state.ball.center.y-args.state.ball.velocity.y + } + + velocityMag = (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5 # the current velocity magnitude of the ball + theta_ball = Math.atan2(args.state.ball.velocity.y, args.state.ball.velocity.x) #the angle of the ball's velocity + theta_repel = (180 * DEGREES_TO_RADIANS) - theta_ball + (@rotation * DEGREES_TO_RADIANS) - # Uses a label to output whether x or o won, or if a draw occurred. - # If the game is ongoing, a label shows whose turn it currently is. - outputs.labels << if state.x_won - label grid.w_half, grid.top - 80, "x won" # the '-80' positions the label 80 pixels lower than top - elsif state.o_won - label grid.w_half, grid.top - 80, "o won" # grid.w_half positions the label in the center horizontally - elsif state.draw - label grid.w_half, grid.top - 80, "a draw" - else # if no one won and the game is ongoing - label grid.w_half, grid.top - 80, "turn: #{state.current_turn}" - end - end + fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity + fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity - # Calls the methods responsible for handling user input and determining the winner. - # Does nothing unless the mouse is clicked. - def input_board - return unless inputs.mouse.click - input_place_piece - input_restart_game - determine_winner - end + frx = velocityMag * Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx + fry = velocityMag * Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby - # Handles user input for placing pieces on the board. - def input_place_piece - return if state.game_over + args.state.display_value = velocityMag + fsumx = fbx+frx #sum of x forces + fsumy = fby+fry #sum of y forces + fr = velocityMag #fr is the resulting magnitude + thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle - # Checks to find the space that the mouse was clicked inside of, and makes sure the space does not already - # have a piece in it. - __, __, space = all_spaces.find do |__, __, space| - inputs.mouse.click.point.inside_rect?(space.border) && !space.piece + xnew = fr*Math.cos(thetaNew) #resulting x velocity + ynew = fr*Math.sin(thetaNew) #resulting y velocity + + dampener = 0.3 + ynew *= dampener * 0.5 + + #If the bounce is very low, that means the ball is rolling and we don't want to dampenen the X velocity + if ynew > -0.1 + xnew *= dampener end - # The piece that goes into the space belongs to the player whose turn it currently is. - return unless space - space.piece = state.current_turn + #Add the sine component of gravity back in (X component) + gravity_x = 4 * Math.sin(@rotation * DEGREES_TO_RADIANS) + xnew += gravity_x + + args.state.ball.velocity.x = -xnew + args.state.ball.velocity.y = -ynew - # This ternary operator statement allows us to change the current player's turn. - # If it is currently x's turn, it becomes o's turn. If it is not x's turn, it become's x's turn. - state.current_turn = state.current_turn == :x ? :o : :x + #Set the position of the ball to the previous position so it doesn't warp throught the block + args.state.ball.center.x = previousPosition.x + args.state.ball.center.y = previousPosition.y end - - # Resets the game. - def input_restart_game - return unless state.game_over - gtk.reset + end + +#+end_src + +*** Physics And Collisions - Bouncing On Collision - cannon.rb +#+begin_src ruby + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/cannon.rb + class Cannon + def initialize args + @pointA = {x: args.grid.right/2,y: args.grid.top} + @pointB = {x: args.inputs.mouse.x, y: args.inputs.mouse.y} end + def update args + activeBall = args.state.ball + @pointB = {x: args.inputs.mouse.x, y: args.inputs.mouse.y} - # Checks if x or o won the game. - # If neither player wins and all nine squares are filled, a draw happens. - # Once a player is chosen as the winner or a draw happens, the game is over. - def determine_winner - state.x_won = won? :x # evaluates to either true or false (boolean values) - state.o_won = won? :o - state.draw = true if filled_spaces.length == 9 && !state.x_won && !state.o_won - state.game_over = state.x_won || state.o_won || state.draw + if args.inputs.mouse.click + alpha = 0.01 + activeBall.velocity.y = (@pointB.y - @pointA.y) * alpha + activeBall.velocity.x = (@pointB.x - @pointA.x) * alpha + activeBall.center = {x: (args.grid.w / 2), y: (args.grid.h)} + end end + def render args + args.outputs.lines << [@pointA.x, @pointA.y, @pointB.x, @pointB.y] + end + end + +#+end_src + +*** Physics And Collisions - Bouncing On Collision - main.rb +#+begin_src ruby + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/main.rb + INFINITY= 10**10 - # Determines if a player won by checking if there is a horizontal match or vertical match. - # Horizontal_match and vertical_match have boolean values. If either is true, the game has been won. - def won? piece - # performs action on all space combinations - won = [[-1, 0, 1]].product([-1, 0, 1]).map do |xs, y| - - # Checks if the 3 grid spaces with the same y value (or same row) and - # x values that are next to each other have pieces that belong to the same player. - # Remember, the value of piece is equal to the current turn (which is the player). - horizontal_match = state.spaces[xs[0]][y].piece == piece && - state.spaces[xs[1]][y].piece == piece && - state.spaces[xs[2]][y].piece == piece + require 'app/vector2d.rb' + require 'app/peg.rb' + require 'app/block.rb' + require 'app/ball.rb' + require 'app/cannon.rb' - # Checks if the 3 grid spaces with the same x value (or same column) and - # y values that are next to each other have pieces that belong to the same player. - # The && represents an "and" statement: if even one part of the statement is false, - # the entire statement evaluates to false. - vertical_match = state.spaces[y][xs[0]].piece == piece && - state.spaces[y][xs[1]].piece == piece && - state.spaces[y][xs[2]].piece == piece - horizontal_match || vertical_match # if either is true, true is returned + #Method to init default values + def defaults args + args.state.pegs ||= [] + args.state.blocks ||= [] + args.state.cannon ||= Cannon.new args + args.state.ball ||= Ball.new args + args.state.horizontal_offset ||= 0 + init_pegs args + init_blocks args + + args.state.display_value ||= "test" + end + + begin :default_methods + def init_pegs args + num_horizontal_pegs = 14 + num_rows = 5 + + return unless args.state.pegs.count < num_rows * num_horizontal_pegs + + block_size = 32 + block_spacing = 50 + total_width = num_horizontal_pegs * (block_size + block_spacing) + starting_offset = (args.grid.w - total_width) / 2 + block_size + + for i in (0...num_rows) + for j in (0...num_horizontal_pegs) + row_offset = 0 + if i % 2 == 0 + row_offset = 20 + else + row_offset = -20 + end + args.state.pegs.append(Peg.new(j * (block_size+block_spacing) + starting_offset + row_offset, (args.grid.h - block_size * 2) - (i * block_size * 2)-90, block_size)) + end end - # Sees if there is a diagonal match, starting from the bottom left and ending at the top right. - # Is added to won regardless of whether the statement is true or false. - won << (state.spaces[-1][-1].piece == piece && # bottom left - state.spaces[ 0][ 0].piece == piece && # center - state.spaces[ 1][ 1].piece == piece) # top right + end - # Sees if there is a diagonal match, starting at the bottom right and ending at the top left - # and is added to won. - won << (state.spaces[ 1][-1].piece == piece && # bottom right - state.spaces[ 0][ 0].piece == piece && # center - state.spaces[-1][ 1].piece == piece) # top left + def init_blocks args + return unless args.state.blocks.count < 10 - # Any false statements (meaning false diagonal matches) are rejected from won - won.reject_false.any? - end + #Sprites are rotated in degrees, but the Ruby math functions work on radians + radians_to_degrees = Math::PI / 180 - # Defines filled spaces on the board by rejecting all spaces that do not have game pieces in them. - # The ! before a statement means "not". For example, we are rejecting any space combinations that do - # NOT have pieces in them. - def filled_spaces - state.space_combinations - .reject { |x, y| !state.spaces[x][y].piece } # reject spaces with no pieces in them - .map do |x, y| - if block_given? - yield x, y, state.spaces[x][y] - else - [x, y, state.spaces[x][y]] # sets definition of space - end + block_size = 25 + #Rotation angle (in degrees) of the blocks + rotation = 30 + vertical_offset = block_size * Math.sin(rotation * radians_to_degrees) + horizontal_offset = (3 * block_size) * Math.cos(rotation * radians_to_degrees) + center = args.grid.w / 2 + + for i in (0...5) + #Create a ramp of blocks. Not going to be perfect because of the float to integer conversion and anisotropic to isotropic coversion + args.state.blocks.append(Block.new((center + 100 + (i * horizontal_offset)).to_i, 100 + (vertical_offset * i) + (i * block_size), block_size, rotation)) + args.state.blocks.append(Block.new((center - 100 - (i * horizontal_offset)).to_i, 100 + (vertical_offset * i) + (i * block_size), block_size, -rotation)) end end + end - # Defines all spaces on the board. - def all_spaces - if !block_given? - state.space_combinations.map do |x, y| - [x, y, state.spaces[x][y]] # sets definition of space - end - else # if a block is given (block_given? is true) - state.space_combinations.map do |x, y| - yield x, y, state.spaces[x][y] # yield if a block is given - end + #Render loop + def render args + args.outputs.borders << args.state.game_area + render_pegs args + render_blocks args + args.state.cannon.render args + args.state.ball.draw args + end + + begin :render_methods + #Draw the pegs in a grid pattern + def render_pegs args + args.state.pegs.each do |peg| + peg.draw args end end - # Sets values for a label, such as the position, value, size, alignment, and color. - def label x, y, value - [x, y + 10, value, 20, 1, 0, 0, 0] + def render_blocks args + args.state.blocks.each do |block| + block.draw args + end end + end - $tic_tac_toe = TicTacToe.new + #Calls all methods necessary for performing calculations + def calc args + args.state.pegs.each do |peg| + peg.calc args + end - def tick args - $tic_tac_toe._ = args - $tic_tac_toe.state = args.state - $tic_tac_toe.outputs = args.outputs - $tic_tac_toe.inputs = args.inputs - $tic_tac_toe.grid = args.grid - $tic_tac_toe.gtk = args.gtk - $tic_tac_toe.tick - tick_instructions args, "Sample app shows how to work with mouse clicks." + args.state.blocks.each do |block| + block.calc args + end + + args.state.ball.update args + args.state.cannon.update args 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.escape - args.state.key_event_occurred = true - end + begin :calc_methods - 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 + + def tick args + defaults args + render args + calc args end #+end_src -* Mouse - Mouse Move - main.rb +*** Physics And Collisions - Bouncing On Collision - peg.rb #+begin_src ruby - # ./samples/05_mouse/02_mouse_move/app/main.rb - =begin + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/peg.rb + class Peg + def initialize(x, y, block_size) + @x = x # x cordinate of the LEFT side of the peg + @y = y # y cordinate of the RIGHT side of the peg + @block_size = block_size # diameter of the peg + + @radius = @block_size/2.0 # radius of the peg + @center = { # cordinatees of the CENTER of the peg + x: @x+@block_size/2.0, + y: @y+@block_size/2.0 + } - Reminders: + @r = 255 # color of the peg + @g = 0 + @b = 0 + + @velocity = {x: 2, y: 0} + end + + def draw args + args.outputs.sprites << [ # draw the peg according to the @x, @y, @radius, and the RGB + @x, + @y, + @radius*2.0, + @radius*2.0, + "sprites/circle-white.png", + 0, + 255, + @r, #r + @g, #g + @b #b + ] + end - - num1.greater(num2): Returns the greater value. - For example, if we have the command - puts 4.greater(3) - the number 4 would be printed to the console since it has a greater value than 3. - Similar to lesser, which returns the lesser value. - - find_all: Finds all elements of a collection that meet certain requirements. - For example, in this sample app, we're using find_all to find all zombies that have intersected - or hit the player's sprite since these zombies have been killed. + def calc args + if collisionWithBounce? args # if the is a collision with the bouncing ball + collide args + @r = 0 + @b = 0 + @g = 255 + else + end + end - - args.inputs.keyboard.key_down.KEY: Determines if a key is being held or pressed. - Stores the frame the "down" event occurred. - For more information about the keyboard, go to mygame/documentation/06-keyboard.md. - - args.outputs.sprites: An array. The values generate a sprite. - The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE] - For more information about sprites, go to mygame/documentation/05-sprites.md. + # do two circles (the ball and this peg) intersect + def collisionWithBounce? args + squareDistance = ( # the squared distance between the ball's center and this peg's center + (args.state.ball.center.x - @center.x) ** 2.0 + + (args.state.ball.center.y - @center.y) ** 2.0 + ) + radiusSum = ( # the sum of the radius squared of the this peg and the ball + (args.state.ball.radius + @radius) ** 2.0 + ) + # if the squareDistance is less or equal to radiusSum, then there is a radial intersection between the ball and this peg + return (squareDistance <= radiusSum) + end - - args.state.new_entity: Used when we want to create a new object, like a sprite or button. - When we want to create a new object, we can declare it as a new entity and then define - its properties. (Remember, you can use state to define ANY property and it will - be retained across frames.) + # ! The following links explain the getRepelMagnitude function ! + # https://raw.githubusercontent.com/DragonRuby/dragonruby-game-toolkit-physics/master/docs/docImages/LinearCollider_4.png + # https://raw.githubusercontent.com/DragonRuby/dragonruby-game-toolkit-physics/master/docs/docImages/LinearCollider_5.png + # https://github.com/DragonRuby/dragonruby-game-toolkit-physics/blob/master/docs/LinearCollider.md + def getRepelMagnitude (args, fbx, fby, vrx, vry, ballMag) + a = fbx ; b = vrx ; c = fby + d = vry ; e = ballMag + if b**2 + d**2 == 0 + #unexpected + end - - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated - as Ruby code, and the placeholder is replaced with its corresponding value or result. + x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2) + x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)) - - map: Ruby method used to transform data; used in arrays, hashes, and collections. - Can be used to perform an action on every element of a collection, such as multiplying - each element by 2 or declaring every element as a new entity. + err = 0.00001 + o = ((fbx + x1*vrx)**2 + (fby + x1*vry)**2 ) ** 0.5 + p = ((fbx + x2*vrx)**2 + (fby + x2*vry)**2 ) ** 0.5 + r = 0 - - sample: Chooses a random element from the array. + if (ballMag >= o-err and ballMag <= o+err) + r = x1 + elsif (ballMag >= p-err and ballMag <= p+err) + r = x2 + else + #unexpected + end - - reject: Removes elements that meet certain requirements. - In this sample app, we're removing/rejecting zombies that reach the center of the screen. We're also - rejecting zombies that were killed more than 30 frames ago. + if (args.state.ball.center.x > @center.x) + return x2*-1 + end - =end + return x2 - # This sample app allows users to move around the screen in order to kill zombies. Zombies appear from every direction so the goal - # is to kill the zombies as fast as possible! + #return r + end - class ProtectThePuppiesFromTheZombies - attr_accessor :grid, :inputs, :state, :outputs + #this sets the new velocity of the ball once it has collided with this peg + def collide args + normalOfRCCollision = [ #this is the normal of the collision in COMPONENT FORM + {x: @center.x, y: @center.y}, #see https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.mathscard.co.uk%2Fonline%2Fcircle-coordinate-geometry%2F&psig=AOvVaw2GcD-e2-nJR_IUKpw3hO98&ust=1605731315521000&source=images&cd=vfe&ved=0CAIQjRxqFwoTCMjBo7e1iu0CFQAAAAAdAAAAABAD + {x: args.state.ball.center.x, y: args.state.ball.center.y}, + ] - # Calls the methods necessary for the game to run properly. - def tick - defaults - render - calc - input - end + normalSlope = ( #normalSlope is the slope of normalOfRCCollision + (normalOfRCCollision[1].y - normalOfRCCollision[0].y) / + (normalOfRCCollision[1].x - normalOfRCCollision[0].x) + ) + slope = normalSlope**-1.0 * -1 # slope is the slope of the tangent + # args.state.display_value = slope + pointA = { # pointA and pointB are using the var slope to tangent in COMPONENT FORM + x: args.state.ball.center.x-1, + y: -(slope-args.state.ball.center.y) + } + pointB = { + x: args.state.ball.center.x+1, + y: slope+args.state.ball.center.y + } - # Sets default values for the zombies and for the player. - # Initialization happens only in the first frame. - def defaults - state.flash_at ||= 0 - state.zombie_min_spawn_rate ||= 60 - state.zombie_spawn_countdown ||= random_spawn_countdown state.zombie_min_spawn_rate - state.zombies ||= [] - state.killed_zombies ||= [] + perpVect = {x: pointB.x - pointA.x, y:pointB.y - pointA.y} # perpVect is to be VECTOR of the perpendicular tangent + mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magniude of the perpVect + perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magniude to make it a unit vector + perpVect = {x: -perpVect.y, y: perpVect.x} # swap the x and y and multiply by -1 to make the vector perpendicular + args.state.display_value = perpVect + if perpVect.y > 0 #ensure perpVect points upward + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} + end - # Declares player as a new entity and sets its properties. - # The player begins the game in the center of the screen, not moving in any direction. - state.player ||= state.new_entity(:player, { x: 640, - y: 360, - attack_angle: 0, - dx: 0, - dy: 0 }) - end + previousPosition = { # calculate an ESTIMATE of the previousPosition of the ball + x:args.state.ball.center.x-args.state.ball.velocity.x, + y:args.state.ball.center.y-args.state.ball.velocity.y + } - # Outputs a gray background. - # Calls the methods needed to output the player, zombies, etc onto the screen. - def render - outputs.solids << [grid.rect, 100, 100, 100] - render_zombies - render_killed_zombies - render_player - render_flash - end + yInterc = pointA.y + -slope*pointA.x + if slope == INFINITY # the perpVect presently either points in the correct dirrection or it is 180 degrees off we need to correct this + if previousPosition.x < pointA.x + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} + yInterc = -INFINITY + end + elsif previousPosition.y < slope*previousPosition.x + yInterc # check if ball is bellow or above the collider to determine if perpVect is - or + + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} + end + + velocityMag = # the current velocity magnitude of the ball + (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5 + theta_ball= + Math.atan2(args.state.ball.velocity.y,args.state.ball.velocity.x) #the angle of the ball's velocity + theta_repel= + Math.atan2(args.state.ball.center.y,args.state.ball.center.x) #the angle of the repelling force(perpVect) + + fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity + fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity + repelMag = getRepelMagnitude( # the magniude of the collision vector + args, + fbx, + fby, + perpVect.x, + perpVect.y, + (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5 + ) + frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx + fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby + + fsumx = fbx+frx # sum of x forces + fsumy = fby+fry # sum of y forces + fr = velocityMag # fr is the resulting magnitude + thetaNew = Math.atan2(fsumy, fsumx) # thetaNew is the resulting angle + xnew = fr*Math.cos(thetaNew) # resulting x velocity + ynew = fr*Math.sin(thetaNew) # resulting y velocity + if (args.state.ball.center.x >= @center.x) # this is necessary for the ball colliding on the right side of the peg + xnew=xnew.abs + end + + args.state.ball.velocity.x = xnew # set the x-velocity to the new velocity + if args.state.ball.center.y > @center.y # if the ball is above the middle of the peg we need to temporarily ignore some of the gravity + args.state.ball.velocity.y = ynew + GRAVITY * 0.01 + else + args.state.ball.velocity.y = ynew - GRAVITY * 0.01 # if the ball is bellow the middle of the peg we need to temporarily increase the power of the gravity + end - # Outputs the zombies on the screen and sets values for the sprites, such as the position, width, height, and animation. - def render_zombies - outputs.sprites << state.zombies.map do |z| # performs action on all zombies in the collection - z.sprite = [z.x, z.y, 4 * 3, 8 * 3, animation_sprite(z)].sprite # sets definition for sprite, calls animation_sprite method - z.sprite + args.state.ball.center.x+= args.state.ball.velocity.x # update the position of the ball so it never looks like the ball is intersecting the circle + args.state.ball.center.y+= args.state.ball.velocity.y + end + end + +#+end_src + +*** Physics And Collisions - Bouncing On Collision - vector2d.rb +#+begin_src ruby + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/vector2d.rb + class Vector2d + attr_accessor :x, :y + + def initialize x=0, y=0 + @x=x + @y=y + end + + #returns a vector multiplied by scalar x + #x [float] scalar + def mult x + r = Vector2d.new(0,0) + r.x=@x*x + r.y=@y*x + r + end + + # vect [Vector2d] vector to copy + def copy vect + Vector2d.new(@x, @y) + end + + #returns a new vector equivalent to this+vect + #vect [Vector2d] vector to add to self + def add vect + Vector2d.new(@x+vect.x,@y+vect.y) + end + + #returns a new vector equivalent to this-vect + #vect [Vector2d] vector to subtract to self + def sub vect + Vector2d.new(@x-vect.c, @y-vect.y) + end + + #return the magnitude of the vector + def mag + ((@x**2)+(@y**2))**0.5 + end + + #returns a new normalize version of the vector + def normalize + Vector2d.new(@x/mag, @y/mag) + end + + #TODO delet? + def distABS vect + (((vect.x-@x)**2+(vect.y-@y)**2)**0.5).abs() end end +#+end_src + +*** Physics And Collisions - Arbitrary Collision - ball.rb +#+begin_src ruby + # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/ball.rb - # Outputs sprites of killed zombies, and displays a slash image to show that a zombie has been killed. - def render_killed_zombies - outputs.sprites << state.killed_zombies.map do |z| # performs action on all killed zombies in collection - z.sprite = [z.x, - z.y, - 4 * 3, - 8 * 3, - animation_sprite(z, z.death_at), # calls animation_sprite method - 0, # angle - 255 * z.death_at.ease(30, :flip)].sprite # transparency of a zombie changes when they die - # change the value of 30 and see what happens when a zombie is killed + class Ball + attr_accessor :velocity, :child, :parent, :number, :leastChain + attr_reader :x, :y, :hypotenuse, :width, :height - # Sets values to output the slash over the zombie's sprite when a zombie is killed. - # The slash is tilted 45 degrees from the angle of the player's attack. - # Change the 3 inside scale_rect to 30 and the slash will be HUGE! Scale_rect positions - # the slash over the killed zombie's sprite. - [z.sprite, [z.sprite.rect, 'sprites/slash.png', 45 + state.player.attack_angle_on_click, z.sprite.a].scale_rect(3, 0.5, 0.5)] - end - end + def initialize args, number, leastChain, parent, child + #Start the ball in the top center + @number = number + @leastChain = leastChain + @x = args.grid.w / 2 + @y = args.grid.h - 20 - # Outputs the player sprite using the images in the sprites folder. - def render_player - state.player_sprite = [state.player.x, - state.player.y, - 4 * 3, - 8 * 3, "sprites/player-#{animation_index(state.player.created_at_elapsed)}.png"] # string interpolation - outputs.sprites << state.player_sprite + @velocity = Vector2d.new(2, -2) + @width = 10 + @height = 10 - # Outputs a small red square that previews the angles that the player can attack in. - # It can be moved in a perfect circle around the player to show possible movements. - # Change the 60 in the parenthesis and see what happens to the movement of the red square. - outputs.solids << [state.player.x + state.player.attack_angle.vector_x(60), - state.player.y + state.player.attack_angle.vector_y(60), - 3, 3, 255, 0, 0] - end + @left_wall = (args.state.board_width + args.grid.w / 8) + @right_wall = @left_wall + args.state.board_width - # Renders flash as a solid. The screen turns white for 10 frames when a zombie is killed. - def render_flash - return if state.flash_at.elapsed_time > 10 # return if more than 10 frames have passed since flash. - # Transparency gradually changes (or eases) during the 10 frames of flash. - outputs.primitives << [grid.rect, 255, 255, 255, 255 * state.flash_at.ease(10, :flip)].solid - end + @max_velocity = MAX_VELOCITY - # Calls all methods necessary for performing calculations. - def calc - calc_spawn_zombie - calc_move_zombies - calc_player - calc_kill_zombie - end + @child = child + @parent = parent - # Decreases the zombie spawn countdown by 1 if it has a value greater than 0. - def calc_spawn_zombie - if state.zombie_spawn_countdown > 0 - state.zombie_spawn_countdown -= 1 - return + @past = [{x: @x, y: @y}] + @next = nil end - # New zombies are created, positioned on the screen, and added to the zombies collection. - state.zombies << state.new_entity(:zombie) do |z| # each zombie is declared a new entity - if rand > 0.5 - z.x = grid.rect.w.randomize(:ratio) # random x position on screen (within grid scope) - z.y = [-10, 730].sample # y position is set to either -10 or 730 (randomly chosen) - # the possible values exceed the screen's scope so zombies appear to be coming from far away - else - z.x = [-10, 1290].sample # x position is set to either -10 or 1290 (randomly chosen) - z.y = grid.rect.w.randomize(:ratio) # random y position on screen + def reassignLeastChain (lc=nil) + if (lc == nil) + lc = @number end + @leastChain = lc + if (parent != nil) + @parent.reassignLeastChain(lc) + end + end - # Calls random_spawn_countdown method (determines how fast new zombies appear) - state.zombie_spawn_countdown = random_spawn_countdown state.zombie_min_spawn_rate - state.zombie_min_spawn_rate -= 1 - # set to either the current zombie_min_spawn_rate or 0, depending on which value is greater - state.zombie_min_spawn_rate = state.zombie_min_spawn_rate.greater(0) - end + def makeLeader args + if isLeader + return + end + @parent.reassignLeastChain + args.state.ballParents.push(self) + @parent = nil - # Moves all zombies towards the center of the screen. - # All zombies that reach the center (640, 360) are rejected from the zombies collection and disappear. - def calc_move_zombies - state.zombies.each do |z| # for each zombie in the collection - z.y = z.y.towards(360, 0.1) # move the zombie towards the center (640, 360) at a rate of 0.1 - z.x = z.x.towards(640, 0.1) # change 0.1 to 1.1 and see how much faster the zombies move to the center end - state.zombies = state.zombies.reject { |z| z.y == 360 && z.x == 640 } # remove zombies that are in center - end - # Calculates the position and movement of the player on the screen. - def calc_player - state.player.x += state.player.dx # changes x based on dx (change in x) - state.player.y += state.player.dy # changes y based on dy (change in y) + def isLeader + return (parent == nil) + end - state.player.dx *= 0.9 # scales dx down - state.player.dy *= 0.9 # scales dy down + def receiveNext (p) + #trace! + if parent != nil + @x = p[:x] + @y = p[:y] + @velocity = p[:velocity] + #puts @x.to_s + "|" + @y.to_s + "|"+@velocity.to_s + @past.append(p) + if (@past.length >= BALL_DISTANCE) + if (@child != nil) + @child.receiveNext(@past[0]) + @past.shift + end + end + end + end - # Compares player's x to 1280 to find lesser value, then compares result to 0 to find greater value. - # This ensures that the player remains within the screen's scope. - state.player.x = state.player.x.lesser(1280).greater(0) - state.player.y = state.player.y.lesser(720).greater(0) # same with player's y - end + #Move the ball according to its velocity + def update args - # Finds all zombies that intersect with the player's sprite. These zombies are removed from the zombies collection - # and added to the killed_zombies collection since any zombie that intersects with the player is killed. - def calc_kill_zombie + if isLeader + wallBounds args + @x += @velocity.x + @y += @velocity.y + @past.append({x: @x, y: @y, velocity: @velocity}) + #puts @past - # Find all zombies that intersect with the player. They are considered killed. - killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite } - state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection - state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies + if (@past.length >= BALL_DISTANCE) + if (@child != nil) + @child.receiveNext(@past[0]) + @past.shift + end + end - if killed_this_frame.length > 0 # if atleast one zombie was killed in the frame - state.flash_at = state.tick_count # flash_at set to the frame when the zombie was killed - # Don't forget, the rendered flash lasts for 10 frames after the zombie is killed (look at render_flash method) + else + puts "unexpected" + raise "unexpected" + end end - # Sets the tick_count (passage of time) as the value of the death_at variable for each killed zombie. - # Death_at stores the frame a zombie was killed. - killed_this_frame.each do |z| - z.death_at = state.tick_count + def wallBounds args + b= false + if @x < @left_wall + @velocity.x = @velocity.x.abs() * 1 + b=true + elsif @x + @width > @right_wall + @velocity.x = @velocity.x.abs() * -1 + b=true + end + if @y < 0 + @velocity.y = @velocity.y.abs() * 1 + b=true + elsif @y + @height > args.grid.h + @velocity.y = @velocity.y.abs() * -1 + b=true + end + mag = (@velocity.x**2.0 + @velocity.y**2.0)**0.5 + if (b == true && mag < MAX_VELOCITY) + @velocity.x*=1.1; + @velocity.y*=1.1; + end + end - # Zombies are rejected from the killed_zombies collection depending on when they were killed. - # They are rejected if more than 30 frames have passed since their death. - state.killed_zombies = state.killed_zombies.reject { |z| state.tick_count - z.death_at > 30 } - end + #render the ball to the screen + def draw args - # Uses input from the user to move the player around the screen. - def input + #update args + #args.outputs.solids << [@x, @y, @width, @height, 255, 255, 0]; + #args.outputs.sprits << { + #x: @x, + #y: @y, + #w: @width, + #h: @height, + #path: "sprites/ball10.png" + #} + #args.outputs.sprites <<[@x, @y, @width, @height, "sprites/ball10.png"] + args.outputs.sprites << {x: @x, y: @y, w: @width, h: @height, path:"sprites/ball10.png" } + end - # If the "a" key or left key is pressed, the x position of the player decreases. - # Otherwise, if the "d" key or right key is pressed, the x position of the player increases. - if inputs.keyboard.key_held.a || inputs.keyboard.key_held.left - state.player.x -= 5 - elsif inputs.keyboard.key_held.d || inputs.keyboard.key_held.right - state.player.x += 5 + def getDraw args + #wallBounds args + #update args + #args.outputs.labels << [@x, @y, @number.to_s + "|" + @leastChain.to_s] + return [@x, @y, @width, @height, "sprites/ball10.png"] end - # If the "w" or up key is pressed, the y position of the player increases. - # Otherwise, if the "s" or down key is pressed, the y position of the player decreases. - if inputs.keyboard.key_held.w || inputs.keyboard.key_held.up - state.player.y += 5 - elsif inputs.keyboard.key_held.s || inputs.keyboard.key_held.down - state.player.y -= 5 + def getPoints args + points = [ + {x:@x+@width/2, y: @y}, + {x:@x+@width, y:@y+@height/2}, + {x:@x+@width/2,y:@y+@height}, + {x:@x,y:@y+@height/2} + ] + #psize = 5.0 + #for p in points + #args.outputs.solids << [p.x-psize/2.0, p.y-psize/2.0, psize, psize, 0, 0, 0]; + #end + return points end - # Sets the attack angle so the player can move and attack in the precise direction it wants to go. - # If the mouse is moved, the attack angle is changed (based on the player's position and mouse position). - # Attack angle also contributes to the position of red square. - if inputs.mouse.moved - state.player.attack_angle = inputs.mouse.position.angle_from [state.player.x, state.player.y] + def serialize + {x: @x, y:@y} end - if inputs.mouse.click && state.player.dx < 0.5 && state.player.dy < 0.5 - state.player.attack_angle_on_click = inputs.mouse.position.angle_from [state.player.x, state.player.y] - state.player.attack_angle = state.player.attack_angle_on_click # player's attack angle is set - state.player.dx = state.player.attack_angle.vector_x(25) # change in player's position - state.player.dy = state.player.attack_angle.vector_y(25) + def inspect + serialize.to_s + end + + def to_s + serialize.to_s end end + +#+end_src + +*** Physics And Collisions - Arbitrary Collision - blocks.rb +#+begin_src ruby + # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/blocks.rb + MAX_COUNT=100 + + def universalUpdateOne args, shape + didHit = false + hitters = [] + #puts shape.to_s + toCollide = nil + for b in args.state.balls + if [b.x, b.y, b.width, b.height].intersect_rect?(shape.bold) + didSquare = false + for s in shape.squareColliders + if (s.collision?(args, b)) + didSquare = true + didHit = true + #s.collide(args, b) + toCollide = s + #hitter = b + hitters.append(b) + end #end if + end #end for + if (didSquare == false) + for c in shape.colliders + #puts args.state.ball.velocity + if c.collision?(args, b.getPoints(args),b) + #c.collide args, b + toCollide = c + didHit = true + hitters.append(b) + end #end if + end #end for + end #end if + end#end if + end#end for + if (didHit) + shape.count=0 + hitters = hitters.uniq + for hitter in hitters + hitter.makeLeader args + #toCollide.collide(args, hitter) + if shape.home == "squares" + args.state.squares.delete(shape) + elsif shape.home == "tshapes" + args.state.tshapes.delete(shape) + else shape.home == "lines" + args.state.lines.delete(shape) + end + end - # Sets the zombie spawn's countdown to a random number. - # How fast zombies appear (change the 60 to 6 and too many zombies will appear at once!) - def random_spawn_countdown minimum - 10.randomize(:ratio, :sign).to_i + 60 + #puts "HIT!" + hitter.number end + end - # Helps to iterate through the images in the sprites folder by setting the animation index. - # 3 frames is how long to show an image, and 6 is how many images to flip through. - def animation_index at - at.idiv(3).mod(6) + def universalUpdate args, shape + #puts shape.home + if (shape.count <= 1) + universalUpdateOne args, shape + return end - # Animates the zombies by using the animation index to go through the images in the sprites folder. - def animation_sprite zombie, at = nil - at ||= zombie.created_at_elapsed # how long it is has been since a zombie was created - index = animation_index at - "sprites/zombie-#{index}.png" # string interpolation to iterate through images + didHit = false + hitter = nil + for b in args.state.ballParents + if [b.x, b.y, b.width, b.height].intersect_rect?(shape.bold) + didSquare = false + for s in shape.squareColliders + if (s.collision?(args, b)) + didSquare = true + didHit = true + s.collide(args, b) + hitter = b + end + end + if (didSquare == false) + for c in shape.colliders + #puts args.state.ball.velocity + if c.collision?(args, b.getPoints(args),b) + c.collide args, b + didHit = true + hitter = b + end + end + end + end + end + if (didHit) + shape.count=shape.count-1 + shape.damageCount.append([(hitter.leastChain+1 - hitter.number)-1, args.state.tick_count]) + + end + i=0 + while i < shape.damageCount.length + if shape.damageCount[i][0] <= 0 + shape.damageCount.delete_at(i) + i-=1 + elsif shape.damageCount[i][1].elapsed_time > BALL_DISTANCE and shape.damageCount[i][0] > 1 + shape.count-=1 + shape.damageCount[i][0]-=1 + shape.damageCount[i][1] = args.state.tick_count + end + i+=1 end end - $protect_the_puppies_from_the_zombies = ProtectThePuppiesFromTheZombies.new - def tick args - $protect_the_puppies_from_the_zombies.grid = args.grid - $protect_the_puppies_from_the_zombies.inputs = args.inputs - $protect_the_puppies_from_the_zombies.state = args.state - $protect_the_puppies_from_the_zombies.outputs = args.outputs - $protect_the_puppies_from_the_zombies.tick - tick_instructions args, "How to get the mouse position and translate it to an x, y position using .vector_x and .vector_y. CLICK to play." - 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.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 - -* Mouse - Mouse Move Paint App - main.rb -#+begin_src ruby - # ./samples/05_mouse/03_mouse_move_paint_app/app/main.rb - =begin - - APIs listing that haven't been encountered in previous sample apps: + class Square + attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount + def initialize(args, x, y, block_size, orientation, block_offset) + @x = x * block_size + @y = y * block_size + @block_size = block_size + @block_offset = block_offset + @orientation = orientation + @damageCount = [] + @home = 'squares' - - Floor: Method that returns an integer number smaller than or equal to the original with no decimal. - For example, if we have a variable, a = 13.7, and we called floor on it, it would look like this... - puts a.floor() - which would print out 13. - (There is also a ceil method, which returns an integer number greater than or equal to the original - with no decimal. If we had called ceil on the variable a, the result would have been 14.) + Kernel.srand() + @r = rand(255) + @g = rand(255) + @b = rand(255) - Reminders: + @count = rand(MAX_COUNT)+1 - - Hashes: Collection of unique keys and their corresponding values. The value can be found - using their keys. + x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2 + @x_adjusted = @x + x_offset + @y_adjusted = @y + @size_adjusted = @block_size * 2 - @block_offset - For example, if we have a "numbers" hash that stores numbers in English as the - key and numbers in Spanish as the value, we'd have a hash that looks like this... - numbers = { "one" => "uno", "two" => "dos", "three" => "tres" } - and on it goes. + hypotenuse=args.state.ball_hypotenuse + @bold = [(@x_adjusted-hypotenuse/2)-1, (@y_adjusted-hypotenuse/2)-1, @size_adjusted + hypotenuse + 2, @size_adjusted + hypotenuse + 2] - Now if we wanted to find the corresponding value of the "one" key, we could say - puts numbers["one"] - which would print "uno" to the console. + @points = [ + {x:@x_adjusted, y:@y_adjusted}, + {x:@x_adjusted+@size_adjusted, y:@y_adjusted}, + {x:@x_adjusted+@size_adjusted, y:@y_adjusted+@size_adjusted}, + {x:@x_adjusted, y:@y_adjusted+@size_adjusted} + ] + @squareColliders = [ + SquareCollider.new(@points[0].x,@points[0].y,{x:-1,y:-1}), + SquareCollider.new(@points[1].x-COLLISIONWIDTH,@points[1].y,{x:1,y:-1}), + SquareCollider.new(@points[2].x-COLLISIONWIDTH,@points[2].y-COLLISIONWIDTH,{x:1,y:1}), + SquareCollider.new(@points[3].x,@points[3].y-COLLISIONWIDTH,{x:-1,y:1}), + ] + @colliders = [ + LinearCollider.new(@points[0],@points[1], :neg), + LinearCollider.new(@points[1],@points[2], :neg), + LinearCollider.new(@points[2],@points[3], :pos), + LinearCollider.new(@points[0],@points[3], :pos) + ] + end - - args.state.new_entity: Used when we want to create a new object, like a sprite or button. - In this sample app, new_entity is used to create a new button that clears the grid. - (Remember, you can use state to define ANY property and it will be retained across frames.) + def draw(args) + #Offset the coordinates to the edge of the game area + x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2 + #args.outputs.solids << [@x + x_offset, @y, @block_size * 2 - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b] + args.outputs.solids <<{x: (@x + x_offset), y: (@y), w: (@block_size * 2 - @block_offset), h: (@block_size * 2 - @block_offset), r: @r , g: @g , b: @b } + #args.outputs.solids << @bold.append([255,0,0]) + args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s] - - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse. + end - - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in. + def update args + universalUpdate args, self + end + end - - args.outputs.labels: An array. The values in the array generate a label. - The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] - For more information about labels, go to mygame/documentation/02-labels.md. + class TShape + attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount + def initialize(args, x, y, block_size, orientation, block_offset) + @x = x * block_size + @y = y * block_size + @block_size = block_size + @block_offset = block_offset + @orientation = orientation + @damageCount = [] + @home = "tshapes" + + Kernel.srand() + @r = rand(255) + @g = rand(255) + @b = rand(255) + + @count = rand(MAX_COUNT)+1 + + + @shapePoints = getShapePoints(args) + minX={x:INFINITY, y:0} + minY={x:0, y:INFINITY} + maxX={x:-INFINITY, y:0} + maxY={x:0, y:-INFINITY} + for p in @shapePoints + if p.x < minX.x + minX = p + end + if p.x > maxX.x + maxX = p + end + if p.y < minY.y + minY = p + end + if p.y > maxY.y + maxY = p + end + end - - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect. - =end + hypotenuse=args.state.ball_hypotenuse - # This sample app shows an empty grid that the user can paint on. - # To paint, the user must keep their mouse presssed and drag it around the grid. - # The "clear" button allows users to clear the grid so they can start over. + @bold = [(minX.x-hypotenuse/2)-1, (minY.y-hypotenuse/2)-1, -((minX.x-hypotenuse/2)-1)+(maxX.x + hypotenuse + 2), -((minY.y-hypotenuse/2)-1)+(maxY.y + hypotenuse + 2)] + end + def getShapePoints(args) + points=[] + x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2) - class PaintApp - attr_accessor :inputs, :state, :outputs, :grid, :args + if @orientation == :right + #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2, @block_size, @r, @g, @b] + points = [ + {x:@x + x_offset, y:@y}, + {x:(@x + x_offset)+(@block_size - @block_offset), y:@y}, + {x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size}, + {x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size}, + {x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size+@block_size}, + {x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size+@block_size}, + {x:(@x + x_offset)+(@block_size - @block_offset), y:@y+ @block_size * 3 - @block_offset}, + {x:@x + x_offset , y:@y+ @block_size * 3 - @block_offset} + ] + @squareColliders = [ + SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}), + SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}), + SquareCollider.new(points[2].x,points[2].y-COLLISIONWIDTH,{x:1,y:-1}), + SquareCollider.new(points[3].x-COLLISIONWIDTH,points[3].y,{x:1,y:-1}), + SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y-COLLISIONWIDTH,{x:1,y:1}), + SquareCollider.new(points[5].x,points[5].y,{x:1,y:1}), + SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y-COLLISIONWIDTH,{x:1,y:1}), + SquareCollider.new(points[7].x,points[7].y-COLLISIONWIDTH,{x:-1,y:1}), + ] + @colliders = [ + LinearCollider.new(points[0],points[1], :neg), + LinearCollider.new(points[1],points[2], :neg), + LinearCollider.new(points[2],points[3], :neg), + LinearCollider.new(points[3],points[4], :neg), + LinearCollider.new(points[4],points[5], :pos), + LinearCollider.new(points[5],points[6], :neg), + LinearCollider.new(points[6],points[7], :pos), + LinearCollider.new(points[0],points[7], :pos) + ] + elsif @orientation == :up + #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size, @block_size * 2, @r, @g, @b] + points = [ + {x:@x + x_offset, y:@y}, + {x:(@x + x_offset)+(@block_size * 3 - @block_offset), y:@y}, + {x:(@x + x_offset)+(@block_size * 3 - @block_offset), y:@y+(@block_size - @block_offset)}, + {x:@x + x_offset + @block_size + @block_size, y:@y+(@block_size - @block_offset)}, + {x:@x + x_offset + @block_size + @block_size, y:@y+@block_size*2}, + {x:@x + x_offset + @block_size, y:@y+@block_size*2}, + {x:@x + x_offset + @block_size, y:@y+(@block_size - @block_offset)}, + {x:@x + x_offset, y:@y+(@block_size - @block_offset)} + ] + @squareColliders = [ + SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}), + SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}), + SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}), + SquareCollider.new(points[3].x,points[3].y,{x:1,y:1}), + SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y-COLLISIONWIDTH,{x:1,y:1}), + SquareCollider.new(points[5].x,points[5].y-COLLISIONWIDTH,{x:-1,y:1}), + SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y,{x:-1,y:1}), + SquareCollider.new(points[7].x,points[7].y-COLLISIONWIDTH,{x:-1,y:1}), + ] + @colliders = [ + LinearCollider.new(points[0],points[1], :neg), + LinearCollider.new(points[1],points[2], :neg), + LinearCollider.new(points[2],points[3], :pos), + LinearCollider.new(points[3],points[4], :neg), + LinearCollider.new(points[4],points[5], :pos), + LinearCollider.new(points[5],points[6], :neg), + LinearCollider.new(points[6],points[7], :pos), + LinearCollider.new(points[0],points[7], :pos) + ] + elsif @orientation == :left + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2 - @block_offset, @block_size - @block_offset, @r, @g, @b] + xh = @x + x_offset + #points = [ + #{x:@x + x_offset, y:@y}, + #{x:(@x + x_offset)+(@block_size - @block_offset), y:@y}, + #{x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size}, + #{x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size}, + #{x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size+@block_size}, + #{x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size+@block_size}, + #{x:(@x + x_offset)+(@block_size - @block_offset), y:@y+ @block_size * 3 - @block_offset}, + #{x:@x + x_offset , y:@y+ @block_size * 3 - @block_offset} + #] + points = [ + {x:@x + x_offset + @block_size, y:@y}, + {x:@x + x_offset + @block_size + (@block_size - @block_offset), y:@y}, + {x:@x + x_offset + @block_size + (@block_size - @block_offset),y:@y+@block_size*3- @block_offset}, + {x:@x + x_offset + @block_size, y:@y+@block_size*3- @block_offset}, + {x:@x + x_offset+@block_size, y:@y+@block_size*2- @block_offset}, + {x:@x + x_offset, y:@y+@block_size*2- @block_offset}, + {x:@x + x_offset, y:@y+@block_size}, + {x:@x + x_offset+@block_size, y:@y+@block_size} + ] + @squareColliders = [ + SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}), + SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}), + SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}), + SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:-1,y:1}), + SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y,{x:-1,y:1}), + SquareCollider.new(points[5].x,points[5].y-COLLISIONWIDTH,{x:-1,y:1}), + SquareCollider.new(points[6].x,points[6].y,{x:-1,y:-1}), + SquareCollider.new(points[7].x-COLLISIONWIDTH,points[7].y-COLLISIONWIDTH,{x:-1,y:-1}), + ] + @colliders = [ + LinearCollider.new(points[0],points[1], :neg), + LinearCollider.new(points[1],points[2], :neg), + LinearCollider.new(points[2],points[3], :pos), + LinearCollider.new(points[3],points[4], :neg), + LinearCollider.new(points[4],points[5], :pos), + LinearCollider.new(points[5],points[6], :neg), + LinearCollider.new(points[6],points[7], :neg), + LinearCollider.new(points[0],points[7], :pos) + ] + elsif @orientation == :down + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b] + + points = [ + {x:@x + x_offset, y:@y+(@block_size*2)-@block_offset}, + {x:@x + x_offset+ @block_size*3-@block_offset, y:@y+(@block_size*2)-@block_offset}, + {x:@x + x_offset+ @block_size*3-@block_offset, y:@y+(@block_size)}, + {x:@x + x_offset+ @block_size*2-@block_offset, y:@y+(@block_size)}, + {x:@x + x_offset+ @block_size*2-@block_offset, y:@y},# + {x:@x + x_offset+ @block_size, y:@y},# + {x:@x + x_offset + @block_size, y:@y+(@block_size)}, + {x:@x + x_offset, y:@y+(@block_size)} + ] + @squareColliders = [ + SquareCollider.new(points[0].x,points[0].y-COLLISIONWIDTH,{x:-1,y:1}), + SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y-COLLISIONWIDTH,{x:1,y:1}), + SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y,{x:1,y:-1}), + SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:1,y:-1}), + SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y,{x:1,y:-1}), + SquareCollider.new(points[5].x,points[5].y,{x:-1,y:-1}), + SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y-COLLISIONWIDTH,{x:-1,y:-1}), + SquareCollider.new(points[7].x,points[7].y,{x:-1,y:-1}), + ] + @colliders = [ + LinearCollider.new(points[0],points[1], :pos), + LinearCollider.new(points[1],points[2], :pos), + LinearCollider.new(points[2],points[3], :neg), + LinearCollider.new(points[3],points[4], :pos), + LinearCollider.new(points[4],points[5], :neg), + LinearCollider.new(points[5],points[6], :pos), + LinearCollider.new(points[6],points[7], :neg), + LinearCollider.new(points[0],points[7], :neg) + ] + end + return points + end + + def draw(args) + #Offset the coordinates to the edge of the game area + x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2) + + if @orientation == :right + #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] + args.outputs.solids << {x: (@x + x_offset), y: @y, w: @block_size - @block_offset, h: (@block_size * 3 - @block_offset), r: @r , g: @g, b: @b} + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2, @block_size, @r, @g, @b] + args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 2), h: (@block_size), r: @r , g: @g, b: @b } + elsif @orientation == :up + #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] + args.outputs.solids << {x: (@x + x_offset), y: (@y), w: (@block_size * 3 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b} + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size, @block_size * 2, @r, @g, @b] + args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size), h: (@block_size * 2), r: @r , g: @g, b: @b} + elsif @orientation == :left + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] + args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size - @block_offset), h: (@block_size * 3 - @block_offset), r: @r , g: @g, b: @b} + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2 - @block_offset, @block_size - @block_offset, @r, @g, @b] + args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 2 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b} + elsif @orientation == :down + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] + args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 3 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b} + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b] + args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size - @block_offset), h: ( @block_size * 2 - @block_offset), r: @r , g: @g, b: @b} + end - # Runs methods necessary for the game to function properly. - def tick - print_title - add_grid - check_click - draw_buttons - end + #psize = 5.0 + #for p in @shapePoints + #args.outputs.solids << [p.x-psize/2, p.y-psize/2, psize, psize, 0, 0, 0] + #end + args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s] + + end + + def updateOne_old args + didHit = false + hitter = nil + toCollide = nil + for b in args.state.balls + if [b.x, b.y, b.width, b.height].intersect_rect?(@bold) + didSquare = false + for s in @squareColliders + if (s.collision?(args, b)) + didSquare = true + didHit = true + #s.collide(args, b) + toCollide = s + hitter = b + break + end + end + if (didSquare == false) + for c in @colliders + #puts args.state.ball.velocity + if c.collision?(args, b.getPoints(args),b) + #c.collide args, b + toCollide = c + didHit = true + hitter = b + break + end + end + end + end + if didHit + break + end + end + if (didHit) + @count=0 + hitter.makeLeader args + #toCollide.collide(args, hitter) + args.state.tshapes.delete(self) + #puts "HIT!" + hitter.number + end + end - # Prints the title onto the screen by using a label. - # Also separates the title from the grid with a line as a horizontal separator. - def print_title - args.outputs.labels << [ 640, 700, 'Paint!', 0, 1 ] - outputs.lines << horizontal_separator(660, 0, 1280) - end + def update_old args + if (@count == 1) + updateOne args + return + end + didHit = false + hitter = nil + for b in args.state.ballParents + if [b.x, b.y, b.width, b.height].intersect_rect?(@bold) + didSquare = false + for s in @squareColliders + if (s.collision?(args, b)) + didSquare = true + didHit=true + s.collide(args, b) + hitter = b + end + end + if (didSquare == false) + for c in @colliders + #puts args.state.ball.velocity + if c.collision?(args, b.getPoints(args), b) + c.collide args, b + didHit=true + hitter = b + end + end + end + end + end + if (didHit) + @count=@count-1 + @damageCount.append([(hitter.leastChain+1 - hitter.number)-1, args.state.tick_count]) - # Sets the starting position, ending position, and color for the horizontal separator. - # The starting and ending positions have the same y values. - def horizontal_separator y, x, x2 - [x, y, x2, y, 150, 150, 150] - end + if (@count == 0) + args.state.tshapes.delete(self) + return + end + end + i=0 + + while i < @damageCount.length + if @damageCount[i][0] <= 0 + @damageCount.delete_at(i) + i-=1 + elsif @damageCount[i][1].elapsed_time > BALL_DISTANCE + @count-=1 + @damageCount[i][0]-=1 + end + if (@count == 0) + args.state.tshapes.delete(self) + return + end + i+=1 + end + end #end update - # Sets the starting position, ending position, and color for the vertical separator. - # The starting and ending positions have the same x values. - def vertical_separator x, y, y2 - [x, y, x, y2, 150, 150, 150] - end + def update args + universalUpdate args, self + end - # Outputs a border and a grid containing empty squares onto the screen. - def add_grid + end - # Sets the x, y, height, and width of the grid. - # There are 31 horizontal lines and 31 vertical lines in the grid. - # Feel free to count them yourself before continuing! - x, y, h, w = 640 - 500/2, 640 - 500, 500, 500 # calculations done so the grid appears in screen's center - lines_h = 31 - lines_v = 31 + class Line + attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount + def initialize(args, x, y, block_size, orientation, block_offset) + @x = x * block_size + @y = y * block_size + @block_size = block_size + @block_offset = block_offset + @orientation = orientation + @damageCount = [] + @home = "lines" - # Sets values for the grid's border, grid lines, and filled squares. - # The filled_squares variable is initially set to an empty array. - state.grid_border ||= [ x, y, h, w ] # definition of grid's outer border - state.grid_lines ||= draw_grid(x, y, h, w, lines_h, lines_v) # calls draw_grid method - state.filled_squares ||= [] # there are no filled squares until the user fills them in + Kernel.srand() + @r = rand(255) + @g = rand(255) + @b = rand(255) - # Outputs the grid lines, border, and filled squares onto the screen. - outputs.lines.concat state.grid_lines - outputs.borders << state.grid_border - outputs.solids << state.filled_squares - end + @count = rand(MAX_COUNT)+1 - # Draws the grid by adding in vertical and horizontal separators. - def draw_grid x, y, h, w, lines_h, lines_v + @shapePoints = getShapePoints(args) + minX={x:INFINITY, y:0} + minY={x:0, y:INFINITY} + maxX={x:-INFINITY, y:0} + maxY={x:0, y:-INFINITY} + for p in @shapePoints + if p.x < minX.x + minX = p + end + if p.x > maxX.x + maxX = p + end + if p.y < minY.y + minY = p + end + if p.y > maxY.y + maxY = p + end + end - # The grid starts off empty. - grid = [] - # Calculates the placement and adds horizontal lines or separators into the grid. - curr_y = y # start at the bottom of the box - dist_y = h / (lines_h + 1) # finds distance to place horizontal lines evenly throughout 500 height of grid - lines_h.times do - curr_y += dist_y # increment curr_y by the distance between the horizontal lines - grid << horizontal_separator(curr_y, x, x + w - 1) # add a separator into the grid + hypotenuse=args.state.ball_hypotenuse + + @bold = [(minX.x-hypotenuse/2)-1, (minY.y-hypotenuse/2)-1, -((minX.x-hypotenuse/2)-1)+(maxX.x + hypotenuse + 2), -((minY.y-hypotenuse/2)-1)+(maxY.y + hypotenuse + 2)] + end + + def getShapePoints(args) + points=[] + x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2) + + if @orientation == :right + #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] + xa =@x + x_offset + ya =@y + wa =@block_size * 3 - @block_offset + ha =(@block_size - @block_offset) + elsif @orientation == :up + #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] + xa =@x + x_offset + ya =@y + wa =@block_size - @block_offset + ha =@block_size * 3 - @block_offset + + elsif @orientation == :left + #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] + xa =@x + x_offset + ya =@y + wa =@block_size * 3 - @block_offset + ha =@block_size - @block_offset + elsif @orientation == :down + #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] + xa =@x + x_offset + ya =@y + wa =@block_size - @block_offset + ha =@block_size * 3 - @block_offset + end + points = [ + {x: xa, y:ya}, + {x: xa + wa,y:ya}, + {x: xa + wa,y:ya+ha}, + {x: xa, y:ya+ha}, + ] + @squareColliders = [ + SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}), + SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}), + SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}), + SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:-1,y:1}), + ] + @colliders = [ + LinearCollider.new(points[0],points[1], :neg), + LinearCollider.new(points[1],points[2], :neg), + LinearCollider.new(points[2],points[3], :pos), + LinearCollider.new(points[0],points[3], :pos), + ] + return points end - # Calculates the placement and adds vertical lines or separators into the grid. - curr_x = x # now start at the left of the box - dist_x = w / (lines_v + 1) # finds distance to place vertical lines evenly throughout 500 width of grid - lines_v.times do - curr_x += dist_x # increment curr_x by the distance between the vertical lines - grid << vertical_separator(curr_x, y + 1, y + h) # add separator + def update args + universalUpdate args, self end - # paint_grid uses a hash to assign values to keys. - state.paint_grid ||= {"x" => x, "y" => y, "h" => h, "w" => w, "lines_h" => lines_h, - "lines_v" => lines_v, "dist_x" => dist_x, - "dist_y" => dist_y } + def draw(args) + x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2 - return grid - end + if @orientation == :right + args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] + elsif @orientation == :up + args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] + elsif @orientation == :left + args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] + elsif @orientation == :down + args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] + end - # Checks if the user is keeping the mouse pressed down and sets the mouse_hold variable accordingly using boolean values. - # If the mouse is up, the user cannot drag the mouse. - def check_click - if inputs.mouse.down #is mouse up or down? - state.mouse_held = true # mouse is being held down - elsif inputs.mouse.up # if mouse is up - state.mouse_held = false # mouse is not being held down or dragged - state.mouse_dragging = false - end + args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s] - if state.mouse_held && # mouse needs to be down - !inputs.mouse.click && # must not be first click - ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15) # Need to move 15 pixels before "drag" - state.mouse_dragging = true end + end + +#+end_src + +*** Physics And Collisions - Arbitrary Collision - linear_collider.rb +#+begin_src ruby + # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/linear_collider.rb - # If the user clicks their mouse inside the grid, the search_lines method is called with a click input type. - if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border)) - search_lines(inputs.mouse.click.point, :click) + COLLISIONWIDTH=8 - # If the user drags their mouse inside the grid, the search_lines method is called with a drag input type. - elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border)) - search_lines(inputs.mouse.position, :drag) + class LinearCollider + attr_reader :pointA, :pointB + def initialize (pointA, pointB, mode,collisionWidth=COLLISIONWIDTH) + @pointA = pointA + @pointB = pointB + @mode = mode + @collisionWidth = collisionWidth + + if (@pointA.x > @pointB.x) + @pointA, @pointB = @pointB, @pointA end + + @linearCollider_collision_once = false end - # Sets the definition of a grid box and handles user input to fill in or clear grid boxes. - def search_lines (point, input_type) - point.x -= state.paint_grid["x"] # subtracts the value assigned to the "x" key in the paint_grid hash - point.y -= state.paint_grid["y"] # subtracts the value assigned to the "y" key in the paint_grid hash + def collisionSlope args + if (@pointB.x-@pointA.x == 0) + return INFINITY + end + return (@pointB.y - @pointA.y) / (@pointB.x - @pointA.x) + end - # Remove code following the .floor and see what happens when you try to fill in grid squares - point.x = (point.x / state.paint_grid["dist_x"]).floor * state.paint_grid["dist_x"] - point.y = (point.y / state.paint_grid["dist_y"]).floor * state.paint_grid["dist_y"] - point.x += state.paint_grid["x"] - point.y += state.paint_grid["y"] + def collision? (args, points, ball=nil) - # Sets definition of a grid box, meaning its x, y, width, and height. - # Floor is called on the point.x and point.y variables. - # Ceil method is called on values of the distance hash keys, setting the width and height of a box. - grid_box = [ point.x.floor, point.y.floor, state.paint_grid["dist_x"].ceil, state.paint_grid["dist_y"].ceil ] + slope = collisionSlope args + result = false - if input_type == :click # if user clicks their mouse - if state.filled_squares.include? grid_box # if grid box is already filled in - state.filled_squares.delete grid_box # box is cleared and removed from filled_squares - else - state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares - end - elsif input_type == :drag # if user drags mouse - unless state.filled_squares.include? grid_box # unless the grid box dragged over is already filled in - state.filled_squares << grid_box # the box is filled in and added to filled_squares + # calculate a vector with a magnitude of (1/2)collisionWidth and a direction perpendicular to the collision line + vect=nil;mag=nil;vect=nil; + if @mode == :both + vect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y} + mag = (vect.x**2 + vect.y**2)**0.5 + vect = {y: -1*(vect.x/(mag))*@collisionWidth*0.5, x: (vect.y/(mag))*@collisionWidth*0.5} + else + vect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y} + mag = (vect.x**2 + vect.y**2)**0.5 + vect = {y: -1*(vect.x/(mag))*@collisionWidth, x: (vect.y/(mag))*@collisionWidth} + end + + rpointA=nil;rpointB=nil;rpointC=nil;rpointD=nil; + if @mode == :pos + rpointA = {x:@pointA.x + vect.x, y:@pointA.y + vect.y} + rpointB = {x:@pointB.x + vect.x, y:@pointB.y + vect.y} + rpointC = {x:@pointB.x, y:@pointB.y} + rpointD = {x:@pointA.x, y:@pointA.y} + elsif @mode == :neg + rpointA = {x:@pointA.x, y:@pointA.y} + rpointB = {x:@pointB.x, y:@pointB.y} + rpointC = {x:@pointB.x - vect.x, y:@pointB.y - vect.y} + rpointD = {x:@pointA.x - vect.x, y:@pointA.y - vect.y} + elsif @mode == :both + rpointA = {x:@pointA.x + vect.x, y:@pointA.y + vect.y} + rpointB = {x:@pointB.x + vect.x, y:@pointB.y + vect.y} + rpointC = {x:@pointB.x - vect.x, y:@pointB.y - vect.y} + rpointD = {x:@pointA.x - vect.x, y:@pointA.y - vect.y} + end + #four point rectangle + + + + if ball != nil + xs = [rpointA.x,rpointB.x,rpointC.x,rpointD.x] + ys = [rpointA.y,rpointB.y,rpointC.y,rpointD.y] + correct = 1 + rect1 = [ball.x, ball.y, ball.width, ball.height] + #$r1 = rect1 + rect2 = [xs.min-correct,ys.min-correct,(xs.max-xs.min)+correct*2,(ys.max-ys.min)+correct*2] + #$r2 = rect2 + if rect1.intersect_rect?(rect2) == false + return false end end - end - # Creates and outputs a "Clear" button on the screen using a label and a border. - # If the button is clicked, the filled squares are cleared, making the filled_squares collection empty. - def draw_buttons - x, y, w, h = 390, 50, 240, 50 - state.clear_button ||= state.new_entity(:button_with_fade) - # The x and y positions are set to display the label in the center of the button. - # Try changing the first two parameters to simply x, y and see what happens to the text placement! - state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] # placed in center of border - state.clear_button.border ||= [x, y, w, h] + #area of a triangle + triArea = -> (a,b,c) { ((a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y))/2.0).abs } - # If the mouse is clicked inside the borders of the clear button, - # the filled_squares collection is emptied and the squares are cleared. - if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border) - state.clear_button.clicked_at = inputs.mouse.click.created_at # time (frame) the click occurred - state.filled_squares.clear - inputs.mouse.previous_click = nil + #if at least on point is in the rectangle then collision? is true - otherwise false + for point in points + #Check whether a given point lies inside a rectangle or not: + #if the sum of the area of traingls, PAB, PBC, PCD, PAD equal the area of the rec, then an intersection has occured + areaRec = triArea.call(rpointA, rpointB, rpointC)+triArea.call(rpointA, rpointC, rpointD) + areaSum = [ + triArea.call(point, rpointA, rpointB),triArea.call(point, rpointB, rpointC), + triArea.call(point, rpointC, rpointD),triArea.call(point, rpointA, rpointD) + ].inject(0){|sum,x| sum + x } + e = 0.0001 #allow for minor error + if areaRec>= areaSum-e and areaRec<= areaSum+e + result = true + #return true + break + end end - outputs.labels << state.clear_button.label - outputs.borders << state.clear_button.border + #args.outputs.lines << [@pointA.x, @pointA.y, @pointB.x, @pointB.y, 000, 000, 000] + #args.outputs.lines << [rpointA.x, rpointA.y, rpointB.x, rpointB.y, 255, 000, 000] + #args.outputs.lines << [rpointC.x, rpointC.y, rpointD.x, rpointD.y, 000, 000, 255] - # When the clear button is clicked, the color of the button changes - # and the transparency changes, as well. If you change the time from - # 0.25.seconds to 1.25.seconds or more, the change will last longer. - if state.clear_button.clicked_at - outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)] + + #puts (rpointA.x.to_s + " " + rpointA.y.to_s + " " + rpointB.x.to_s + " "+ rpointB.y.to_s) + return result + end #end collision? + + def getRepelMagnitude (fbx, fby, vrx, vry, ballMag) + a = fbx ; b = vrx ; c = fby + d = vry ; e = ballMag + if b**2 + d**2 == 0 + #unexpected end + x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2) + x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)) + err = 0.00001 + o = ((fbx + x1*vrx)**2 + (fby + x1*vry)**2 ) ** 0.5 + p = ((fbx + x2*vrx)**2 + (fby + x2*vry)**2 ) ** 0.5 + r = 0 + if (ballMag >= o-err and ballMag <= o+err) + r = x1 + elsif (ballMag >= p-err and ballMag <= p+err) + r = x2 + else + #unexpected + end + return r end - end - $paint_app = PaintApp.new + def collide args, ball + slope = collisionSlope args - def tick args - $paint_app.inputs = args.inputs - $paint_app.state = args.state - $paint_app.grid = args.grid - $paint_app.args = args - $paint_app.outputs = args.outputs - $paint_app.tick - tick_instructions args, "How to create a simple paint app. CLICK and HOLD to draw." - end + # perpVect: normal vector perpendicular to collision + perpVect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y} + mag = (perpVect.x**2 + perpVect.y**2)**0.5 + perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} + perpVect = {x: -perpVect.y, y: perpVect.x} + if perpVect.y > 0 #ensure perpVect points upward + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} + end + previousPosition = { + x:ball.x-ball.velocity.x, + y:ball.y-ball.velocity.y + } + yInterc = @pointA.y + -slope*@pointA.x + if slope == INFINITY + if previousPosition.x < @pointA.x + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} + yInterc = -INFINITY + end + elsif previousPosition.y < slope*previousPosition.x + yInterc #check if ball is bellow or above the collider to determine if perpVect is - or + + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} + end + + velocityMag = (ball.velocity.x**2 + ball.velocity.y**2)**0.5 + theta_ball=Math.atan2(ball.velocity.y,ball.velocity.x) #the angle of the ball's velocity + theta_repel=Math.atan2(perpVect.y,perpVect.x) #the angle of the repelling force(perpVect) + + fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity + fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity + + #the magnitude of the repelling force + repelMag = getRepelMagnitude(fbx, fby, perpVect.x, perpVect.y, (ball.velocity.x**2 + ball.velocity.y**2)**0.5) + frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx + fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby + + fsumx = fbx+frx #sum of x forces + fsumy = fby+fry #sum of y forces + fr = velocityMag#fr is the resulting magnitude + thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle + xnew = fr*Math.cos(thetaNew)#resulting x velocity + ynew = fr*Math.sin(thetaNew)#resulting y velocity + if (velocityMag < MAX_VELOCITY) + ball.velocity = Vector2d.new(xnew*1.1, ynew*1.1) + else + ball.velocity = Vector2d.new(xnew, ynew) + 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.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 -* Mouse - Coordinate Systems - main.rb +*** Physics And Collisions - Arbitrary Collision - main.rb #+begin_src ruby - # ./samples/05_mouse/04_coordinate_systems/app/main.rb - =begin - - APIs listing that haven't been encountered in previous sample apps: - - - args.inputs.mouse.click.position: Coordinates of the mouse's position on the screen. - Unlike args.inputs.mouse.click.point, the mouse does not need to be pressed down for - position to know the mouse's coordinates. - For more information about the mouse, go to mygame/documentation/07-mouse.md. - - Reminders: + # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/main.rb + INFINITY= 10**10 + MAX_VELOCITY = 8.0 + BALL_COUNT = 90 + BALL_DISTANCE = 20 + require 'app/vector2d.rb' + require 'app/blocks.rb' + require 'app/ball.rb' + require 'app/rectangle.rb' + require 'app/linear_collider.rb' + require 'app/square_collider.rb' - - args.inputs.mouse.click: This property will be set if the mouse was clicked. - - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse. - - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated - as Ruby code, and the placeholder is replaced with its corresponding value or result. + #Method to init default values + def defaults args + args.state.board_width ||= args.grid.w / 4 + args.state.board_height ||= args.grid.h + args.state.game_area ||= [(args.state.board_width + args.grid.w / 8), 0, args.state.board_width, args.grid.h] + args.state.balls ||= [] + args.state.num_balls ||= 0 + args.state.ball_created_at ||= args.state.tick_count + args.state.ball_hypotenuse = (10**2 + 10**2)**0.5 + args.state.ballParents ||=nil + + init_blocks args + init_balls args + end + + begin :default_methods + def init_blocks args + block_size = args.state.board_width / 8 + #Space inbetween each block + block_offset = 4 + + args.state.squares ||=[ + Square.new(args, 2, 0, block_size, :right, block_offset), + Square.new(args, 5, 0, block_size, :right, block_offset), + Square.new(args, 6, 7, block_size, :right, block_offset) + ] - In this sample app, string interpolation is used to show the current position of the mouse - in a label. - - args.outputs.labels: An array that generates a label. - The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] - For more information about labels, go to mygame/documentation/02-labels.md. + #Possible orientations are :right, :left, :up, :down - - args.outputs.solids: An array that generates a solid. - The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] - For more information about solids, go to mygame/documentation/03-solids-and-borders.md. - - args.outputs.lines: An array that generates a line. - The parameters are [X, Y, X2, Y2, RED, GREEN, BLUE, ALPHA] - For more information about lines, go to mygame/documentation/04-lines.md. + args.state.tshapes ||= [ + TShape.new(args, 0, 6, block_size, :left, block_offset), + TShape.new(args, 3, 3, block_size, :down, block_offset), + TShape.new(args, 0, 3, block_size, :right, block_offset), + TShape.new(args, 0, 11, block_size, :up, block_offset) + ] - =end + args.state.lines ||= [ + Line.new(args,3, 8, block_size, :down, block_offset), + Line.new(args, 7, 3, block_size, :up, block_offset), + Line.new(args, 3, 7, block_size, :right, block_offset) + ] - # This sample app shows a coordinate system or grid. The user can move their mouse around the screen and the - # coordinates of their position on the screen will be displayed. Users can choose to view one quadrant or - # four quadrants by pressing the button. + #exit() + end - def tick args + def init_balls args + return unless args.state.num_balls < BALL_COUNT - # The addition and subtraction in the first two parameters of the label and solid - # ensure that the outputs don't overlap each other. Try removing them and see what happens. - pos = args.inputs.mouse.position # stores coordinates of mouse's position - args.outputs.labels << [pos.x + 10, pos.y + 10, "#{pos}"] # outputs label of coordinates - args.outputs.solids << [pos.x - 2, pos.y - 2, 5, 5] # outputs small blackk box placed where mouse is hovering - button = [0, 0, 370, 50] # sets definition of toggle button - args.outputs.borders << button # outputs button as border (not filled in) - args.outputs.labels << [10, 35, "click here toggle coordinate system"] # label of button - args.outputs.lines << [ 0, -720, 0, 720] # vertical line dividing quadrants - args.outputs.lines << [-1280, 0, 1280, 0] # horizontal line dividing quadrants + #only create a new ball every 10 ticks + return unless args.state.ball_created_at.elapsed_time > 10 - if args.inputs.mouse.click # if the user clicks the mouse - pos = args.inputs.mouse.click.point # pos's value is point where user clicked (coordinates) - if pos.inside_rect? button # if the click occurred inside the button - if args.grid.name == :bottom_left # if the grid shows bottom left as origin - args.grid.origin_center! # origin will be shown in center - else - args.grid.origin_bottom_left! # otherwise, the view will change to show bottom left as origin - end + if (args.state.num_balls == 0) + args.state.balls.append(Ball.new(args,args.state.num_balls,BALL_COUNT-1, nil, nil)) + args.state.ballParents = [args.state.balls[0]] + else + args.state.balls.append(Ball.new(args,args.state.num_balls,BALL_COUNT-1, args.state.balls.last, nil) ) + args.state.balls[-2].child = args.state.balls[-1] end + args.state.ball_created_at = args.state.tick_count + args.state.num_balls += 1 end - - tick_instructions args, "Sample app shows the two supported coordinate systems in Game Toolkit." 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.escape - args.state.key_event_occurred = true - end + #Render loop + def render args + bgClr = {r:10, g:10, b:200} + bgClr = {r:255-30, g:255-30, b:255-30} - 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 - -* Save Load - Save Load Game - main.rb -#+begin_src ruby - # ./samples/06_save_load/01_save_load_game/app/main.rb - =begin + args.outputs.solids << [0, 0, $args.grid.right, $args.grid.top, bgClr[:r], bgClr[:g], bgClr[:b]]; + args.outputs.borders << args.state.game_area - APIs listing that haven't been encountered in previous sample apps: + render_instructions args + render_shapes args - - Symbol (:): Ruby object with a name and an internal ID. Symbols are useful - because with a given symbol name, you can refer to the same object throughout - a Ruby program. + render_balls args - In this sample app, we're using symbols for our buttons. We have buttons that - light fires, save, load, etc. Each of these buttons has a distinct symbol like - :light_fire, :save_game, :load_game, etc. + #args.state.rectangle.draw args - - to_sym: Returns the symbol corresponding to the given string; creates the symbol - if it does not already exist. - For example, - 'car'.to_sym - would return the symbol :car. + args.outputs.sprites << [$args.grid.right-(args.state.board_width + args.grid.w / 8), 0, $args.grid.right, $args.grid.top, "sprites/square-white-2.png", 0, 255, bgClr[:r], bgClr[:g], bgClr[:b]] + args.outputs.sprites << [0, 0, (args.state.board_width + args.grid.w / 8), $args.grid.top, "sprites/square-white-2.png", 0, 255, bgClr[:r], bgClr[:g], bgClr[:b]] - - last: Returns the last element of an array. + end - Reminders: + begin :render_methods + def render_instructions args + #gtk.current_framerate + args.outputs.labels << [20, $args.grid.top-20, "FPS: " + $gtk.current_framerate.to_s] + if (args.state.balls != nil && args.state.balls[0] != nil) + bx = args.state.balls[0].velocity.x + by = args.state.balls[0].velocity.y + bmg = (bx**2.0 + by**2.0)**0.5 + args.outputs.labels << [20, $args.grid.top-20-20, "V: " + bmg.to_s ] + end - - num1.lesser(num2): finds the lower value of the given options. - For example, in the statement - a = 4.lesser(3) - 3 has a lower value than 4, which means that the value of a would be set to 3, - but if the statement had been - a = 4.lesser(5) - 4 has a lower value than 5, which means that the value of a would be set to 4. - - num1.fdiv(num2): returns the float division (will have a decimal) of the two given numbers. - For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0 + end - - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated - as Ruby code, and the placeholder is replaced with its corresponding value or result. + def render_shapes args + for s in args.state.squares + s.draw args + end - - args.outputs.labels: An array. Values generate a label. - Parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] - For more information, go to mygame/documentation/02-labels.md. + for l in args.state.lines + l.draw args + end - - ARRAY#inside_rect?: An array with at least two values is considered a point. An array - with at least four values is considered a rect. The inside_rect? function returns true - or false depending on if the point is inside the rect. + for t in args.state.tshapes + t.draw args + end - =end - # This code allows users to perform different tasks, such as saving and loading the game. - # Users also have options to reset the game and light a fire. + end - class TextedBasedGame + def render_balls args + #args.state.balls.each do |ball| + #ball.draw args + #end - # Contains methods needed for game to run properly. - # Increments tick count by 1 each time it runs (60 times in a single second) - def tick - default - show_intro - state.engine_tick_count += 1 - tick_fire + args.outputs.sprites << args.state.balls.map do |ball| + ball.getDraw args + end end + end - # Sets default values. - # The ||= ensures that a variable's value is only set to the value following the = sign - # if the value has not already been set before. Intialization happens only in the first frame. - def default - state.engine_tick_count ||= 0 - state.active_module ||= :room - state.fire_progress ||= 0 - state.fire_ready_in ||= 10 - state.previous_fire ||= :dead - state.fire ||= :dead + #Calls all methods necessary for performing calculations + def calc args + for b in args.state.ballParents + b.update args end - def show_intro - return unless state.engine_tick_count == 0 # return unless the game just started - set_story_line "awake." # calls set_story_line method, sets to "awake" + for s in args.state.squares + s.update args end - # Sets story line. - def set_story_line story_line - state.story_line = story_line # story line set to value of parameter - state.active_module = :alert # active module set to alert + for l in args.state.lines + l.update args end - # Clears story line. - def clear_storyline - state.active_module = :none # active module set to none - state.story_line = nil # story line is cleared, set to nil (or empty) + for t in args.state.tshapes + t.update args end - # Determines fire progress (how close the fire is to being ready to light). - def tick_fire - return if state.active_module == :alert # return if active module is alert - state.fire_progress += 1 # increment fire progress - # fire_ready_in is 10. The fire_progress is either the current value or 10, whichever has a lower value. - state.fire_progress = state.fire_progress.lesser(state.fire_ready_in) - end - # Sets the value of fire (whether it is dead or roaring), and the story line - def light_fire - return unless fire_ready? # returns unless the fire is ready to be lit - state.fire = :roaring # fire is lit, set to roaring - state.fire_progress = 0 # the fire progress returns to 0, since the fire has been lit - if state.fire != state.previous_fire - set_story_line "the fire is #{state.fire}." # the story line is set using string interpolation - state.previous_fire = state.fire + + end + + begin :calc_methods + + end + + def tick args + defaults args + render args + calc args + end + +#+end_src + +*** Physics And Collisions - Arbitrary Collision - paddle.rb +#+begin_src ruby + # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/paddle.rb + class Paddle + attr_accessor :enabled + + def initialize () + @x=WIDTH/2 + @y=100 + @width=100 + @height=20 + @speed=10 + + @xyCollision = LinearCollider.new({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5}) + @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos) + @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height+5}) + @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}, :pos) + + @enabled = true + end + + def update args + @xyCollision.resetPoints({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5}) + @xyCollision2.resetPoints({x: @x,y: @y}, {x: @x+@width, y: @y}) + @xyCollision3.resetPoints({x: @x,y: @y}, {x: @x, y: @y+@height+5}) + @xyCollision4.resetPoints({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}) + + @xyCollision.update args + @xyCollision2.update args + @xyCollision3.update args + @xyCollision4.update args + + args.inputs.keyboard.key_held.left ||= false + args.inputs.keyboard.key_held.right ||= false + + if not (args.inputs.keyboard.key_held.left == args.inputs.keyboard.key_held.right) + if args.inputs.keyboard.key_held.left && @enabled + @x-=@speed + elsif args.inputs.keyboard.key_held.right && @enabled + @x+=@speed + end end + + xmin =WIDTH/4 + xmax = 3*(WIDTH/4) + @x = (@x+@width > xmax) ? xmax-@width : (@x= [@pointA.x,@pointB.x].min+(@extension == :pos ? -@thickness : 0) && + point.x <= [@pointA.x,@pointB.x].max+(@extension == :neg ? @thickness : 0) && + point.y >= [@pointA.y,@pointB.y].min && point.y <= [@pointA.y,@pointB.y].max + return true + end - self.send method_to_call # invoke method identified by symbol - else # otherwise, if self doesn't respond to given method - border = button[1][:primitives].last # sets border definition using value of last key in hash + isNegInLine = @extension == :neg && + point.y <= slope(@pointA, @pointB)*point.x+intercept(@pointA,@pointB) && + point.y >= point.x*slope(@pointAExtended, @pointBExtended)+intercept(@pointAExtended,@pointBExtended) + isPosInLine = @extension == :pos && + point.y >= slope(@pointA, @pointB)*point.x+intercept(@pointA,@pointB) && + point.y <= point.x*slope(@pointAExtended, @pointBExtended)+intercept(@pointAExtended,@pointBExtended) + isInBoxBounds = point.x >= [@pointA.x,@pointB.x].min && + point.x <= [@pointA.x,@pointB.x].max && + point.y >= [@pointA.y,@pointB.y].min+(@extension == :neg ? -@thickness : 0) && + point.y <= [@pointA.y,@pointB.y].max+(@extension == :pos ? @thickness : 0) - # declares each highlight as a new entity, sets properties - state.layout.highlights << state.new_entity(:highlight) do |h| - h.x = border.x - h.y = border.y - h.w = border.w - h.h = border.h - h.max_lifetime = 4 # different max_lifetime than the one set if respond_to? had been true - h.lifetime = h.max_lifetime - h.color = [120, 80, 80] # sets color to dark color - end + return isInBoxBounds && (isNegInLine || isPosInLine) - # instructions for users on how to add the missing method_to_call to the code - puts "It looks like #{method_to_call} doesn't exists on TextedBasedGamePresenter. Please add this method:" - puts "Just copy the code below and put it in the #{TextedBasedGamePresenter} class definition." - puts "" - puts "```" - puts "class TextedBasedGamePresenter <--- find this class and put the method below in it" - puts "" - puts " def #{method_to_call}" - puts " puts 'Yay that worked!'" - puts " end" - puts "" - puts "end <-- make sure to put the #{method_to_call} method in between the `class` word and the final `end` statement." - puts "```" - puts "" - end end - # Returns the position of the mouse when it is clicked. - def click_pos - return nil unless inputs.mouse.click # returns nil unless the mouse was clicked - return inputs.mouse.click.point # returns location of mouse click (coordinates) - end + def getRepelMagnitude (fbx, fby, vrx, vry, args) + a = fbx ; b = vrx ; c = fby + d = vry ; e = args.state.ball.velocity.mag - # Creates buttons for the button_list and sets their values using a hash (uses symbols as keys) - def button id, x, y, text - @button_list[id] ||= { # assigns values to hash keys - id: id, - text: text, - primitives: [ - [x + 10, y + 30, text, 2, 0].label, # positions label inside border - [x, y, 300, 50].border, # sets definition of border - ] - } + if b**2 + d**2 == 0 + puts "magnitude error" + end - @button_list[id][:primitives] # returns label and border for buttons + x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2) + x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)) + return ((a+x1*b)**2 + (c+x1*d)**2 == e**2) ? x1 : x2 end - # Creates a progress bar (used for lighting the fire) and sets its values. - def progress_bar id, x, y, text, percentage - @button_list[id] = { # assigns values to hash keys - id: id, - text: text, - primitives: [ - [x, y, 300, 50, 100, 100, 100].solid, # sets definition for solid (which fills the bar with gray) - [x + 10, y + 30, text, 2, 0].label, # sets definition for label, positions inside border - [x, y, 300, 50].border, # sets definition of border - ] - } + def update args + #each of the four points on the square ball - NOTE simple to extend to a circle + points= [ {x: args.state.ball.xy.x, y: args.state.ball.xy.y}, + {x: args.state.ball.xy.x+args.state.ball.width, y: args.state.ball.xy.y}, + {x: args.state.ball.xy.x, y: args.state.ball.xy.y+args.state.ball.height}, + {x: args.state.ball.xy.x+args.state.ball.width, y: args.state.ball.xy.y + args.state.ball.height} + ] - # Fills progress bar based on percentage. If the fire was ready to be lit (100%) and we multiplied by - # 100, only 1/3 of the bar would only be filled in. 200 would cause only 2/3 to be filled in. - @button_list[id][:primitives][0][2] = 300 * percentage - @button_list[id][:primitives] - end + #for each point p in points + for point in points + #isCollision.md has more information on this section + #TODO: section can certainly be simplifyed + if isCollision?(point) + u = Vector2d.new(1.0,((slope(@pointA, @pointB)==0) ? INFINITY : -1/slope(@pointA, @pointB))*1.0).normalize #normal perpendicular (to line segment) vector - # Defines the game. - def game - @game - end + #the vector with the repeling force can be u or -u depending of where the ball was coming from in relation to the line segment + previousBallPosition=Vector2d.new(point.x-args.state.ball.velocity.x,point.y-args.state.ball.velocity.y) + choiceA = (u.mult(1)) + choiceB = (u.mult(-1)) + vectorRepel = nil - # Initalizes the game and creates an empty list of buttons. - def initialize - @game = TextedBasedGame.new self - @button_list ||= {} - end + if (slope(@pointA, @pointB))!=INFINITY && u.y < 0 + choiceA, choiceB = choiceB, choiceA + end + vectorRepel = (previousBallPosition.y > calcY(@pointA, @pointB, previousBallPosition.x)) ? choiceA : choiceB - # Clears the storyline and takes the user to the room. - def alert_dismiss_clicked - game.clear_storyline - game.go_to_room - end + #vectorRepel = (previousBallPosition.y > slope(@pointA, @pointB)*previousBallPosition.x+intercept(@pointA,@pointB)) ? choiceA : choiceB) + if (slope(@pointA, @pointB) == INFINITY) #slope INFINITY breaks down in the above test, ergo it requires a custom test + vectorRepel = (previousBallPosition.x > @pointA.x) ? (u.mult(1)) : (u.mult(-1)) + end + #puts (" " + $t[0].to_s + "," + $t[1].to_s + " " + $t[2].to_s + "," + $t[3].to_s + " " + " " + u.x.to_s + "," + u.y.to_s) + #vectorRepel now has the repeling force - # Lights the fire when the user clicks the "light fire" option. - def light_fire_clicked - game.light_fire - end + mag = args.state.ball.velocity.mag + theta_ball=Math.atan2(args.state.ball.velocity.y,args.state.ball.velocity.x) #the angle of the ball's velocity + theta_repel=Math.atan2(vectorRepel.y,vectorRepel.x) #the angle of the repeling force + #puts ("theta:" + theta_ball.to_s + " " + theta_repel.to_s) #theta okay - # Saves the game when the user clicks the "save" option. - def save_game_clicked - game.save - end + fbx = mag * Math.cos(theta_ball) #the x component of the ball's velocity + fby = mag * Math.sin(theta_ball) #the y component of the ball's velocity - # Resets the game when the user clicks the "reset" option. - def reset_game_clicked - game.reset - end + repelMag = getRepelMagnitude(fbx, fby, vectorRepel.x, vectorRepel.y, args) - # Loads the game when the user clicks the "load" option. - def load_game_clicked - game.load - end - end + frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx + fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby - $text_based_rpg = TextedBasedGamePresenter.new + fsumx = fbx+frx #sum of x forces + fsumy = fby+fry #sum of y forces + fr = mag#fr is the resulting magnitude + thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle + xnew = fr*Math.cos(thetaNew) #resulting x velocity + ynew = fr*Math.sin(thetaNew) #resulting y velocity + + args.state.ball.velocity = Vector2d.new(xnew,ynew) + #args.state.ball.xy.add(args.state.ball.velocity) + break #no need to check the other points ? + else + end + end + end #end update - def tick args - $text_based_rpg.state = args.state - $text_based_rpg.outputs = args.outputs - $text_based_rpg.inputs = args.inputs - $text_based_rpg.tick end #+end_src -* Advanced Rendering - Simple Render Targets - main.rb +*** Physics And Collisions - Collision With Object Removal - main.rb #+begin_src ruby - # ./samples/07_advanced_rendering/01_simple_render_targets/app/main.rb - def tick args - # args.outputs.render_targets are really really powerful. - # They essentially allow you to create a sprite programmatically and cache the result. + # ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/main.rb + # coding: utf-8 + INFINITY= 10**10 + WIDTH=1280 + HEIGHT=720 - # Create a render_target of a :block and a :gradient on tick zero. - if args.state.tick_count == 0 - args.render_target(:block).solids << [0, 0, 1280, 100] + require 'app/vector2d.rb' + require 'app/paddle.rb' + require 'app/ball.rb' + require 'app/linear_collider.rb' - # The gradient is actually just a collection of black solids with increasing - # opacities. - args.render_target(:gradient).solids << 90.map_with_index do |x| - 50.map_with_index do |y| - [x * 15, y * 15, 15, 15, 0, 0, 0, (x * 3).fdiv(255) * 255] - end - end + #Method to init default values + def defaults args + args.state.game_board ||= [(args.grid.w / 2 - args.grid.w / 4), 0, (args.grid.w / 2), args.grid.h] + args.state.bricks ||= [] + args.state.num_bricks ||= 0 + args.state.game_over_at ||= 0 + args.state.paddle ||= Paddle.new + args.state.ball ||= Ball.new + args.state.westWall ||= LinearCollider.new({x: args.grid.w/4, y: 0}, {x: args.grid.w/4, y: args.grid.h}, :pos) + args.state.eastWall ||= LinearCollider.new({x: 3*args.grid.w*0.25, y: 0}, {x: 3*args.grid.w*0.25, y: args.grid.h}) + args.state.southWall ||= LinearCollider.new({x: 0, y: 0}, {x: args.grid.w, y: 0}) + args.state.northWall ||= LinearCollider.new({x: 0, y:args.grid.h}, {x: args.grid.w, y: args.grid.h}, :pos) + + #args.state.testWall ||= LinearCollider.new({x:0 , y:0},{x:args.grid.w, y:args.grid.h}) + end + + #Render loop + def render args + render_instructions args + render_board args + render_bricks args + end + + begin :render_methods + #Method to display the instructions of the game + def render_instructions args + args.outputs.labels << [225, args.grid.h - 30, "← and → to move the paddle left and right", 0, 1] end - # Take the :block render_target and present it horizontally centered. - # Use a subsection of the render_targetd specified by source_x, - # source_y, source_w, source_h. - args.outputs.sprites << { x: 0, - y: 310, - w: 1280, - h: 100, - path: :block, - source_x: 0, - source_y: 0, - source_w: 1280, - source_h: 100 } + def render_board args + args.outputs.borders << args.state.game_board + end - # After rendering :block, render gradient on top of :block. - args.outputs.sprites << [0, 0, 1280, 720, :gradient] + def render_bricks args + args.outputs.solids << args.state.bricks.map(&:rect) + end + end - args.outputs.labels << [1270, 710, args.gtk.current_framerate, 0, 2, 255, 255, 255] - tick_instructions args, "Sample app shows how to use render_targets (programmatically create cached sprites)." + #Calls all methods necessary for performing calculations + def calc args + add_new_bricks args + reset_game args + calc_collision args + win_game args + + args.state.westWall.update args + args.state.eastWall.update args + args.state.southWall.update args + args.state.northWall.update args + args.state.paddle.update args + args.state.ball.update args + + #args.state.testWall.update args + + args.state.paddle.render args + args.state.ball.render args 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.escape - args.state.key_event_occurred = true + begin :calc_methods + def add_new_bricks args + return if args.state.num_bricks > 40 + + #Width of the game board is 640px + brick_width = (args.grid.w / 2) / 10 + brick_height = brick_width / 2 + + (4).map_with_index do |y| + #Make a box that is 10 bricks wide and 4 bricks tall + args.state.bricks += (10).map_with_index do |x| + args.state.new_entity(:brick) do |b| + b.x = x * brick_width + (args.grid.w / 2 - args.grid.w / 4) + b.y = args.grid.h - ((y + 1) * brick_height) + b.rect = [b.x + 1, b.y - 1, brick_width - 2, brick_height - 2, 235, 50 * y, 52] + + #Add linear colliders to the brick + b.collider_bottom = LinearCollider.new([(b.x-2), (b.y-5)], [(b.x+brick_width+1), (b.y-5)], :pos, brick_height) + b.collider_right = LinearCollider.new([(b.x+brick_width+1), (b.y-5)], [(b.x+brick_width+1), (b.y+brick_height+1)], :pos) + b.collider_left = LinearCollider.new([(b.x-2), (b.y-5)], [(b.x-2), (b.y+brick_height+1)], :neg) + b.collider_top = LinearCollider.new([(b.x-2), (b.y+brick_height+1)], [(b.x+brick_width+1), (b.y+brick_height+1)], :neg) + + # @xyCollision = LinearCollider.new({x: @x,y: @y+@height}, {x: @x+@width, y: @y+@height}) + # @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos) + # @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height}) + # @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height}, :pos) + + b.broken = false + + args.state.num_bricks += 1 + end + end + end + end + + def reset_game args + if args.state.ball.xy.y < 20 && args.state.game_over_at.elapsed_time > 60 + #Freeze the ball + args.state.ball.velocity.x = 0 + args.state.ball.velocity.y = 0 + #Freeze the paddle + args.state.paddle.enabled = false + + args.state.game_over_at = args.state.tick_count + end + + if args.state.game_over_at.elapsed_time < 60 && args.state.tick_count > 60 && args.state.bricks.count != 0 + #Display a "Game over" message + args.outputs.labels << [100, 100, "GAME OVER", 10] + end + + #If 60 frames have passed since the game ended, restart the game + if args.state.game_over_at != 0 && args.state.game_over_at.elapsed_time == 60 + # FIXME: only put value types in state + args.state.ball = Ball.new + + # FIXME: only put value types in state + args.state.paddle = Paddle.new + + args.state.bricks = [] + args.state.num_bricks = 0 + end + end + + def calc_collision args + #Remove the brick if it is hit with the ball + ball = args.state.ball + ball_rect = [ball.xy.x, ball.xy.y, 20, 20] + + #Loop through each brick to see if the ball is colliding with it + args.state.bricks.each do |b| + if b.rect.intersect_rect?(ball_rect) + #Run the linear collider for the brick if there is a collision + b[:collider_bottom].update args + b[:collider_right].update args + b[:collider_left].update args + b[:collider_top].update args + + b.broken = true + end + end + + args.state.bricks = args.state.bricks.reject(&:broken) + end + + def win_game args + if args.state.bricks.count == 0 && args.state.game_over_at.elapsed_time > 60 + #Freeze the ball + args.state.ball.velocity.x = 0 + args.state.ball.velocity.y = 0 + #Freeze the paddle + args.state.paddle.enabled = false + + args.state.game_over_at = args.state.tick_count + end + + if args.state.game_over_at.elapsed_time < 60 && args.state.tick_count > 60 && args.state.bricks.count == 0 + #Display a "Game over" message + args.outputs.labels << [100, 100, "CONGRATULATIONS!", 10] + end 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 - $gtk.reset + def tick args + defaults args + render args + calc args + + #args.outputs.lines << [0, 0, args.grid.w, args.grid.h] + + #$tc+=1 + #if $tc == 5 + #$train << [args.state.ball.xy.x, args.state.ball.xy.y] + #$tc = 0 + #end + #for t in $train + + #args.outputs.solids << [t[0],t[1],5,5,255,0,0]; + #end + end #+end_src -* Advanced Rendering - Render Targets With Tile Manipulation - main.rb +*** Physics And Collisions - Collision With Object Removal - paddle.rb #+begin_src 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 - # a scene to wipe away; the actual wipe effect is in the last 20 lines or - # so. + # ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/paddle.rb + class Paddle + attr_accessor :enabled + + def initialize () + @x=WIDTH/2 + @y=100 + @width=100 + @height=20 + @speed=10 + + @xyCollision = LinearCollider.new({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5}) + @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos) + @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height+5}) + @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}, :pos) + + @enabled = true + end + + def update args + @xyCollision.resetPoints({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5}) + @xyCollision2.resetPoints({x: @x,y: @y}, {x: @x+@width, y: @y}) + @xyCollision3.resetPoints({x: @x,y: @y}, {x: @x, y: @y+@height+5}) + @xyCollision4.resetPoints({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}) + + @xyCollision.update args + @xyCollision2.update args + @xyCollision3.update args + @xyCollision4.update args + + args.inputs.keyboard.key_held.left ||= false + args.inputs.keyboard.key_held.right ||= false + + if not (args.inputs.keyboard.key_held.left == args.inputs.keyboard.key_held.right) + if args.inputs.keyboard.key_held.left && @enabled + @x-=@speed + elsif args.inputs.keyboard.key_held.right && @enabled + @x+=@speed + end + end - $gtk.reset # reset all game state if reloaded. + xmin =WIDTH/4 + xmax = 3*(WIDTH/4) + @x = (@x+@width > xmax) ? xmax-@width : (@x 0 - last_frame = args.state.static_debounce == 1 - target = last_frame ? args.render_target(:last_frame) : args.outputs - draw_scene args, target - args.state.static_debounce -= 1 - return unless last_frame - 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 - # build up the wipe... + puts "running tests" + $gtk.reset 100 + $gtk.log_level = :off + $gtk.tests.start + +#+end_src + +*** Physics And Collisions - Collision With Object Removal - vector2d.rb +#+begin_src ruby + # ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/vector2d.rb - # this is the thing we're wiping to. - args.outputs.sprites << [ 0, 0, 1280, 720, 'dragonruby.png' ] + class Vector2d + attr_accessor :x, :y - return if (args.state.baseyoff > (1280 + 100)) # stop when done sliding + def initialize x=0, y=0 + @x=x + @y=y + end - segmentw = 1280 / segments + #returns a vector multiplied by scalar x + #x [float] scalar + def mult x + r = Vector2d.new(0,0) + r.x=@x*x + r.y=@y*x + r + end - x = 0 - for i in 0..segments do - yoffset = 0 - if args.state.yoffsets[i] < args.state.baseyoff - yoffset = args.state.baseyoff - args.state.yoffsets[i] - end + # vect [Vector2d] vector to copy + def copy vect + Vector2d.new(@x, @y) + end - # (720 - yoffset) flips the coordinate system, (- 720) adjusts for the height of the segment. - args.outputs.sprites << [ x, (720 - yoffset) - 720, segmentw, 720, 'last_frame', 0, 255, 255, 255, 255, x, 0, segmentw, 720 ] - x += segmentw + #returns a new vector equivalent to this+vect + #vect [Vector2d] vector to add to self + def add vect + Vector2d.new(@x+vect.x,@y+vect.y) end - args.state.baseyoff += 4 + #returns a new vector equivalent to this-vect + #vect [Vector2d] vector to subtract to self + def sub vect + Vector2d.new(@x-vect.c, @y-vect.y) + end - tick_instructions args, "Sample app shows an advanced usage of render_target." - end + #return the magnitude of the vector + def mag + ((@x**2)+(@y**2))**0.5 + 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.escape - args.state.key_event_occurred = true + #returns a new normalize version of the vector + def normalize + Vector2d.new(@x/mag, @y/mag) 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 + #TODO delet? + def distABS vect + (((vect.x-@x)**2+(vect.y-@y)**2)**0.5).abs() + end end #+end_src -* Advanced Rendering - Render Target Viewports - main.rb +*** Mouse - Mouse Click - main.rb #+begin_src ruby - # ./samples/07_advanced_rendering/03_render_target_viewports/app/main.rb + # ./samples/05_mouse/01_mouse_click/app/main.rb =begin APIs listing that haven't been encountered in previous sample apps: - - args.state.new_entity: Used when we want to create a new object, like a sprite or button. - For example, if we want to create a new button, we would declare it as a new entity and - then define its properties. (Remember, you can use state to define ANY property and it will - be retained across frames.) - - If you have a solar system and you're creating args.state.sun and setting its image path to an - image in the sprites folder, you would do the following: - (See samples/99_sample_nddnug_workshop for more details.) + - product: Returns an array of all combinations of elements from all arrays. - args.state.sun ||= args.state.new_entity(:sun) do |s| - s.path = 'sprites/sun.png' - end + For example, [1,2].product([1,2]) would return the following array... + [[1,1], [1,2], [2,1], [2,2]] + More than two arrays can be given to product and it will still work, + such as [1,2].product([1,2],[3,4]). What would product return in this case? - - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated - as Ruby code, and the placeholder is replaced with its corresponding value or result. + Answer: + [[1,1,3],[1,1,4],[1,2,3],[1,2,4],[2,1,3],[2,1,4],[2,2,3],[2,2,4]] - For example, if we have a variable - name = "Ruby" - then the line - puts "How are you, #{name}?" - would print "How are you, Ruby?" to the console. - (Remember, string interpolation only works with double quotes!) + - num1.fdiv(num2): Returns the float division (will have a decimal) of the two given numbers. + For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0 - - Ternary operator (?): Similar to if statement; first evalulates whether a statement is - true or false, and then executes a command depending on that result. - For example, if we had a variable - grade = 75 - and used the ternary operator in the command - pass_or_fail = grade > 65 ? "pass" : "fail" - then the value of pass_or_fail would be "pass" since grade's value was greater than 65. + - yield: Allows you to call a method with a code block and yield to that block. Reminders: - - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual - 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720). + - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect. - - Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction - by adding or subracting. + - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated + as Ruby code, and the placeholder is replaced with its corresponding value or result. - - ARRAY#inside_rect?: An array with at least two values is considered a point. An array - with at least four values is considered a rect. The inside_rect? function returns true - or false depending on if the point is inside the rect. + - args.inputs.mouse.click: This property will be set if the mouse was clicked. - - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect. + - Ternary operator (?): Will evaluate a statement (just like an if statement) + and perform an action if the result is true or another action if it is false. - - args.inputs.mouse.click: This property will be set if the mouse was clicked. - For more information about the mouse, go to mygame/documentation/07-mouse.md. + - reject: Removes elements from a collection if they meet certain requirements. - - args.inputs.keyboard.key_up.KEY: The value of the properties will be set - to the frame that the key_up event occurred (the frame correlates - to args.state.tick_count). - For more information about the keyboard, go to mygame/documentation/06-keyboard.md. + - args.outputs.borders: An array. The values generate a border. + The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE] + For more information about borders, go to mygame/documentation/03-solids-and-borders.md. - - args.state.labels: - The parameters for a label are - 1. the position (x, y) - 2. the text - 3. the size - 4. the alignment - 5. the color (red, green, and blue saturations) - 6. the alpha (or transparency) - For more information about labels, go to mygame/documentation/02-labels.md. + - args.outputs.labels: An array. The values generate a label. + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] + For more information about labels, go to mygame/documentation/02-labels. - - args.state.lines: - The parameters for a line are - 1. the starting position (x, y) - 2. the ending position (x2, y2) - 3. the color (red, green, and blue saturations) - 4. the alpha (or transparency) - For more information about lines, go to mygame/documentation/04-lines.md. - - - args.state.solids (and args.state.borders): - The parameters for a solid (or border) are - 1. the position (x, y) - 2. the width (w) - 3. the height (h) - 4. the color (r, g, b) - 5. the alpha (or transparency) - For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md. - - - args.state.sprites: - The parameters for a sprite are - 1. the position (x, y) - 2. the width (w) - 3. the height (h) - 4. the image path - 5. the angle - 6. the alpha (or transparency) - For more information about sprites, go to mygame/documentation/05-sprites.md. =end - # This sample app shows different objects that can be used when making games, such as labels, - # lines, sprites, solids, buttons, etc. Each demo section shows how these objects can be used. - - # Also note that state.tick_count refers to the passage of time, or current frame. + # This sample app is a classic game of Tic Tac Toe. - class TechDemo - attr_accessor :inputs, :state, :outputs, :grid, :args + class TicTacToe + attr_accessor :_, :state, :outputs, :inputs, :grid, :gtk - # Calls all methods necessary for the app to run properly. + # Starts the game with player x's turn and creates an array (to_a) for space combinations. + # Calls methods necessary for the game to run properly. def tick - labels_tech_demo - lines_tech_demo - solids_tech_demo - borders_tech_demo - sprites_tech_demo - keyboards_tech_demo - controller_tech_demo - mouse_tech_demo - point_to_rect_tech_demo - rect_to_rect_tech_demo - button_tech_demo - export_game_state_demo - window_state_demo - render_seperators - end - - # Shows output of different kinds of labels on the screen - def labels_tech_demo - outputs.labels << [grid.left.shift_right(5), grid.top.shift_down(5), "This is a label located at the top left."] - outputs.labels << [grid.left.shift_right(5), grid.bottom.shift_up(30), "This is a label located at the bottom left."] - outputs.labels << [ 5, 690, "Labels (x, y, text, size, align, r, g, b, a)"] - outputs.labels << [ 5, 660, "Smaller label.", -2] - outputs.labels << [ 5, 630, "Small label.", -1] - outputs.labels << [ 5, 600, "Medium label.", 0] - outputs.labels << [ 5, 570, "Large label.", 1] - outputs.labels << [ 5, 540, "Larger label.", 2] - outputs.labels << [300, 660, "Left aligned.", 0, 2] - outputs.labels << [300, 640, "Center aligned.", 0, 1] - outputs.labels << [300, 620, "Right aligned.", 0, 0] - outputs.labels << [175, 595, "Red Label.", 0, 0, 255, 0, 0] - outputs.labels << [175, 575, "Green Label.", 0, 0, 0, 255, 0] - outputs.labels << [175, 555, "Blue Label.", 0, 0, 0, 0, 255] - outputs.labels << [175, 535, "Faded Label.", 0, 0, 0, 0, 0, 128] + state.current_turn ||= :x + state.space_combinations = [-1, 0, 1].product([-1, 0, 1]).to_a + render_board + input_board end - # Shows output of lines on the screen - def lines_tech_demo - outputs.labels << [5, 500, "Lines (x, y, x2, y2, r, g, b, a)"] - outputs.lines << [5, 450, 100, 450] - outputs.lines << [5, 430, 300, 430] - outputs.lines << [5, 410, 300, 410, state.tick_count % 255, 0, 0, 255] # red saturation changes - outputs.lines << [5, 390 - state.tick_count % 25, 300, 390, 0, 0, 0, 255] # y position changes - outputs.lines << [5 + state.tick_count % 200, 360, 300, 360, 0, 0, 0, 255] # x position changes - end + # Uses borders to create grid squares for the game's board. Also outputs the game pieces using labels. + def render_board + square_size = 80 - # Shows output of different kinds of solids on the screen - def solids_tech_demo - outputs.labels << [ 5, 350, "Solids (x, y, w, h, r, g, b, a)"] - outputs.solids << [ 10, 270, 50, 50] - outputs.solids << [ 70, 270, 50, 50, 0, 0, 0] - outputs.solids << [130, 270, 50, 50, 255, 0, 0] - outputs.solids << [190, 270, 50, 50, 255, 0, 0, 128] - outputs.solids << [250, 270, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes - end + # Positions the game's board in the center of the screen. + # Try removing what follows grid.w_half or grid.h_half and see how the position changes! + board_left = grid.w_half - square_size * 1.5 + board_top = grid.h_half - square_size * 1.5 - # Shows output of different kinds of borders on the screen - # The parameters for a border are the same as the parameters for a solid - def borders_tech_demo - outputs.labels << [ 5, 260, "Borders (x, y, w, h, r, g, b, a)"] - outputs.borders << [ 10, 180, 50, 50] - outputs.borders << [ 70, 180, 50, 50, 0, 0, 0] - outputs.borders << [130, 180, 50, 50, 255, 0, 0] - outputs.borders << [190, 180, 50, 50, 255, 0, 0, 128] - outputs.borders << [250, 180, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes - end + # At first glance, the add(1) looks pretty trivial. But if you remove it, + # you'll see that the positioning of the board would be skewed without it! + # Or if you put 2 in the parenthesis, the pieces will be placed in the wrong squares + # due to the change in board placement. + outputs.borders << all_spaces do |x, y, space| # outputs borders for all board spaces + space.border ||= [ + board_left + x.add(1) * square_size, # space.border is initialized using this definition + board_top + y.add(1) * square_size, + square_size, + square_size + ] + end - # Shows output of different kinds of sprites on the screen - def sprites_tech_demo - outputs.labels << [ 5, 170, "Sprites (x, y, w, h, path, angle, a)"] - outputs.sprites << [ 10, 40, 128, 101, 'dragonruby.png'] - outputs.sprites << [ 150, 40, 128, 101, 'dragonruby.png', state.tick_count % 360] # angle changes - outputs.sprites << [ 300, 40, 128, 101, 'dragonruby.png', 0, state.tick_count % 255] # transparency changes - end + # Again, the calculations ensure that the piece is placed in the center of the grid square. + # Remove the '- 20' and the piece will be placed at the top of the grid square instead of the center. + outputs.labels << filled_spaces do |x, y, space| # put label in each filled space of board + label board_left + x.add(1) * square_size + square_size.fdiv(2), + board_top + y.add(1) * square_size + square_size - 20, + space.piece # text of label, either "x" or "o" + end - # Holds size, alignment, color (black), and alpha (transparency) parameters - # Using small_font as a parameter accounts for all remaining parameters - # so they don't have to be repeatedly typed - def small_font - [-2, 0, 0, 0, 0, 255] + # Uses a label to output whether x or o won, or if a draw occurred. + # If the game is ongoing, a label shows whose turn it currently is. + outputs.labels << if state.x_won + label grid.w_half, grid.top - 80, "x won" # the '-80' positions the label 80 pixels lower than top + elsif state.o_won + label grid.w_half, grid.top - 80, "o won" # grid.w_half positions the label in the center horizontally + elsif state.draw + label grid.w_half, grid.top - 80, "a draw" + else # if no one won and the game is ongoing + label grid.w_half, grid.top - 80, "turn: #{state.current_turn}" + end end - # Sets position of each row - # Converts given row value to pixels that DragonRuby understands - def row_to_px row_number - - # Row 0 starts 5 units below the top of the grid. - # Each row afterward is 20 units lower. - grid.top.shift_down(5).shift_down(20 * row_number) + # Calls the methods responsible for handling user input and determining the winner. + # Does nothing unless the mouse is clicked. + def input_board + return unless inputs.mouse.click + input_place_piece + input_restart_game + determine_winner end - # Uses labels to output current game time (passage of time), and whether or not "h" was pressed - # If "h" is pressed, the frame is output when the key_up event occurred - def keyboards_tech_demo - outputs.labels << [460, row_to_px(0), "Current game time: #{state.tick_count}", small_font] - outputs.labels << [460, row_to_px(2), "Keyboard input: inputs.keyboard.key_up.h", small_font] - outputs.labels << [460, row_to_px(3), "Press \"h\" on the keyboard.", small_font] + # Handles user input for placing pieces on the board. + def input_place_piece + return if state.game_over - if inputs.keyboard.key_up.h # if "h" key_up event occurs - state.h_pressed_at = state.tick_count # frame it occurred is stored + # Checks to find the space that the mouse was clicked inside of, and makes sure the space does not already + # have a piece in it. + __, __, space = all_spaces.find do |__, __, space| + inputs.mouse.click.point.inside_rect?(space.border) && !space.piece end - # h_pressed_at is initially set to false, and changes once the user presses the "h" key. - state.h_pressed_at ||= false - - if state.h_pressed_at # if h is pressed (pressed_at has a frame number and is no longer false) - outputs.labels << [460, row_to_px(4), "\"h\" was pressed at time: #{state.h_pressed_at}", small_font] - else # otherwise, label says "h" was never pressed - outputs.labels << [460, row_to_px(4), "\"h\" has never been pressed.", small_font] - end + # The piece that goes into the space belongs to the player whose turn it currently is. + return unless space + space.piece = state.current_turn - # border around keyboard input demo section - outputs.borders << [455, row_to_px(5), 360, row_to_px(2).shift_up(5) - row_to_px(5)] + # This ternary operator statement allows us to change the current player's turn. + # If it is currently x's turn, it becomes o's turn. If it is not x's turn, it become's x's turn. + state.current_turn = state.current_turn == :x ? :o : :x end - # Sets definition for a small label - # Makes it easier to position labels in respect to the position of other labels - def small_label x, row, message - [x, row_to_px(row), message, small_font] + # Resets the game. + def input_restart_game + return unless state.game_over + gtk.reset end - # Uses small labels to show whether the "a" button on the controller is down, held, or up. - # y value of each small label is set by calling the row_to_px method - def controller_tech_demo - x = 460 - outputs.labels << small_label(x, 6, "Controller one input: inputs.controller_one") - outputs.labels << small_label(x, 7, "Current state of the \"a\" button.") - outputs.labels << small_label(x, 8, "Check console window for more info.") - - if inputs.controller_one.key_down.a # if "a" is in "down" state - outputs.labels << small_label(x, 9, "\"a\" button down: #{inputs.controller_one.key_down.a}") - puts "\"a\" button down at #{inputs.controller_one.key_down.a}" # prints frame the event occurred - elsif inputs.controller_one.key_held.a # if "a" is held down - outputs.labels << small_label(x, 9, "\"a\" button held: #{inputs.controller_one.key_held.a}") - elsif inputs.controller_one.key_up.a # if "a" is in up state - outputs.labels << small_label(x, 9, "\"a\" button up: #{inputs.controller_one.key_up.a}") - puts "\"a\" key up at #{inputs.controller_one.key_up.a}" - else # if no event has occurred - outputs.labels << small_label(x, 9, "\"a\" button state is nil.") - end - - # border around controller input demo section - outputs.borders << [455, row_to_px(10), 360, row_to_px(6).shift_up(5) - row_to_px(10)] + # Checks if x or o won the game. + # If neither player wins and all nine squares are filled, a draw happens. + # Once a player is chosen as the winner or a draw happens, the game is over. + def determine_winner + state.x_won = won? :x # evaluates to either true or false (boolean values) + state.o_won = won? :o + state.draw = true if filled_spaces.length == 9 && !state.x_won && !state.o_won + state.game_over = state.x_won || state.o_won || state.draw end - # Outputs when the mouse was clicked, as well as the coordinates on the screen - # of where the click occurred - def mouse_tech_demo - x = 460 - - outputs.labels << small_label(x, 11, "Mouse input: inputs.mouse") + # Determines if a player won by checking if there is a horizontal match or vertical match. + # Horizontal_match and vertical_match have boolean values. If either is true, the game has been won. + def won? piece + # performs action on all space combinations + won = [[-1, 0, 1]].product([-1, 0, 1]).map do |xs, y| - if inputs.mouse.click # if click has a value and is not nil - state.last_mouse_click = inputs.mouse.click # coordinates of click are stored - end + # Checks if the 3 grid spaces with the same y value (or same row) and + # x values that are next to each other have pieces that belong to the same player. + # Remember, the value of piece is equal to the current turn (which is the player). + horizontal_match = state.spaces[xs[0]][y].piece == piece && + state.spaces[xs[1]][y].piece == piece && + state.spaces[xs[2]][y].piece == piece - if state.last_mouse_click # if mouse is clicked (has coordinates as value) - # outputs the time (frame) the click occurred, as well as how many frames have passed since the event - outputs.labels << small_label(x, 12, "Mouse click happened at: #{state.last_mouse_click.created_at}, #{state.last_mouse_click.created_at_elapsed}") - # outputs coordinates of click - outputs.labels << small_label(x, 13, "Mouse click location: #{state.last_mouse_click.point.x}, #{state.last_mouse_click.point.y}") - else # otherwise if the mouse has not been clicked - outputs.labels << small_label(x, 12, "Mouse click has not occurred yet.") - outputs.labels << small_label(x, 13, "Please click mouse.") - end - end - - # Outputs whether a mouse click occurred inside or outside of a box - def point_to_rect_tech_demo - x = 460 - - outputs.labels << small_label(x, 15, "Click inside the blue box maybe ---->") - - box = [765, 370, 50, 50, 0, 0, 170] # blue box - outputs.borders << box + # Checks if the 3 grid spaces with the same x value (or same column) and + # y values that are next to each other have pieces that belong to the same player. + # The && represents an "and" statement: if even one part of the statement is false, + # the entire statement evaluates to false. + vertical_match = state.spaces[y][xs[0]].piece == piece && + state.spaces[y][xs[1]].piece == piece && + state.spaces[y][xs[2]].piece == piece - if state.last_mouse_click # if the mouse was clicked - if state.last_mouse_click.point.inside_rect? box # if mouse clicked inside box - outputs.labels << small_label(x, 16, "Mouse click happened inside the box.") - else # otherwise, if mouse was clicked outside the box - outputs.labels << small_label(x, 16, "Mouse click happened outside the box.") - end - else # otherwise, if was not clicked at all - outputs.labels << small_label(x, 16, "Mouse click has not occurred yet.") # output if the mouse was not clicked + horizontal_match || vertical_match # if either is true, true is returned end - # border around mouse input demo section - outputs.borders << [455, row_to_px(14), 360, row_to_px(11).shift_up(5) - row_to_px(14)] - end + # Sees if there is a diagonal match, starting from the bottom left and ending at the top right. + # Is added to won regardless of whether the statement is true or false. + won << (state.spaces[-1][-1].piece == piece && # bottom left + state.spaces[ 0][ 0].piece == piece && # center + state.spaces[ 1][ 1].piece == piece) # top right - # Outputs a red box onto the screen. A mouse click from the user inside of the red box will output - # a smaller box. If two small boxes are inside of the red box, it will be determined whether or not - # they intersect. - def rect_to_rect_tech_demo - x = 460 + # Sees if there is a diagonal match, starting at the bottom right and ending at the top left + # and is added to won. + won << (state.spaces[ 1][-1].piece == piece && # bottom right + state.spaces[ 0][ 0].piece == piece && # center + state.spaces[-1][ 1].piece == piece) # top left - outputs.labels << small_label(x, 17.5, "Click inside the red box below.") # label with instructions - red_box = [460, 250, 355, 90, 170, 0, 0] # definition of the red box - outputs.borders << red_box # output as a border (not filled in) + # Any false statements (meaning false diagonal matches) are rejected from won + won.reject_false.any? + end - # If the mouse is clicked inside the red box, two collision boxes are created. - if inputs.mouse.click - if inputs.mouse.click.point.inside_rect? red_box - if !state.box_collision_one # if the collision_one box does not yet have a definition - # Subtracts 25 from the x and y positions of the click point in order to make the click point the center of the box. - # You can try deleting the subtraction to see how it impacts the box placement. - state.box_collision_one = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 180, 0, 0, 180] # sets definition - elsif !state.box_collision_two # if collision_two does not yet have a definition - state.box_collision_two = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 0, 0, 180, 180] # sets definition + # Defines filled spaces on the board by rejecting all spaces that do not have game pieces in them. + # The ! before a statement means "not". For example, we are rejecting any space combinations that do + # NOT have pieces in them. + def filled_spaces + state.space_combinations + .reject { |x, y| !state.spaces[x][y].piece } # reject spaces with no pieces in them + .map do |x, y| + if block_given? + yield x, y, state.spaces[x][y] else - state.box_collision_one = nil # both boxes are empty - state.box_collision_two = nil + [x, y, state.spaces[x][y]] # sets definition of space end - end - end - - # If collision boxes exist, they are output onto screen inside the red box as solids - if state.box_collision_one - outputs.solids << state.box_collision_one - end - - if state.box_collision_two - outputs.solids << state.box_collision_two - end - - # Outputs whether or not the two collision boxes intersect. - if state.box_collision_one && state.box_collision_two # if both collision_boxes are defined (and not nil or empty) - if state.box_collision_one.intersect_rect? state.box_collision_two # if the two boxes intersect - outputs.labels << small_label(x, 23.5, 'The boxes intersect.') - else # otherwise, if the two boxes do not intersect - outputs.labels << small_label(x, 23.5, 'The boxes do not intersect.') - end - else - outputs.labels << small_label(x, 23.5, '--') # if the two boxes are not defined (are nil or empty), this label is output - end - end - - # Creates a button and outputs it onto the screen using labels and borders. - # If the button is clicked, the color changes to make it look faded. - def button_tech_demo - x, y, w, h = 460, 160, 300, 50 - state.button ||= state.new_entity(:button_with_fade) - - # Adds w.half to x and h.half + 10 to y in order to display the text inside the button's borders. - state.button.label ||= [x + w.half, y + h.half + 10, "click me and watch me fade", 0, 1] - state.button.border ||= [x, y, w, h] - - if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.button.border) # if mouse is clicked, and clicked inside button's border - state.button.clicked_at = inputs.mouse.click.created_at # stores the time the click occurred - end - - outputs.labels << state.button.label - outputs.borders << state.button.border - - if state.button.clicked_at # if button was clicked (variable has a value and is not nil) - - # The appearance of the button changes for 0.25 seconds after the time the button is clicked at. - # The color changes (rgb is set to 0, 180, 80) and the transparency gradually changes. - # Change 0.25 to 1.25 and notice that the transparency takes longer to return to normal. - outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.button.clicked_at.ease(0.25.seconds, :flip)] - end - end - - # Creates a new button by declaring it as a new entity, and sets values. - def new_button_prefab x, y, message - w, h = 300, 50 - button = state.new_entity(:button_with_fade) - button.label = [x + w.half, y + h.half + 10, message, 0, 1] # '+ 10' keeps label's text within button's borders - button.border = [x, y, w, h] # sets border definition - button - end - - # If the mouse has been clicked and the click's location is inside of the button's border, that means - # that the button has been clicked. This method returns a boolean value. - def button_clicked? button - inputs.mouse.click && inputs.mouse.click.point.inside_rect?(button.border) - end - - # Determines if button was clicked, and changes its appearance if it is clicked - def tick_button_prefab button - outputs.labels << button.label # outputs button's label and border - outputs.borders << button.border - - if button_clicked? button # if button is clicked - button.clicked_at = inputs.mouse.click.created_at # stores the time that the button was clicked - end - - if button.clicked_at # if clicked_at has a frame value and is not nil - # button is output; color changes and transparency changes for 0.25 seconds after click occurs - outputs.solids << [button.border.x, button.border.y, button.border.w, button.border.h, - 0, 180, 80, 255 * button.clicked_at.ease(0.25.seconds, :flip)] # transparency changes for 0.25 seconds end end - # Exports the app's game state if the export button is clicked. - def export_game_state_demo - state.export_game_state_button ||= new_button_prefab(460, 100, "click to export app state") - tick_button_prefab(state.export_game_state_button) # calls method to output button - if button_clicked? state.export_game_state_button # if the export button is clicked - args.gtk.export! "Exported from clicking the export button in the tech demo." # the export occurs + # Defines all spaces on the board. + def all_spaces + if !block_given? + state.space_combinations.map do |x, y| + [x, y, state.spaces[x][y]] # sets definition of space + end + else # if a block is given (block_given? is true) + state.space_combinations.map do |x, y| + yield x, y, state.spaces[x][y] # yield if a block is given + end end end - # The mouse and keyboard focus are set to "yes" when the Dragonruby window is the active window. - def window_state_demo - m = $gtk.args.inputs.mouse.has_focus ? 'Y' : 'N' # ternary operator (similar to if statement) - k = $gtk.args.inputs.keyboard.has_focus ? 'Y' : 'N' - outputs.labels << [460, 20, "mouse focus: #{m} keyboard focus: #{k}", small_font] - end - - #Sets values for the horizontal separator (divides demo sections) - def horizontal_seperator y, x, x2 - [x, y, x2, y, 150, 150, 150] - end - - #Sets the values for the vertical separator (divides demo sections) - def vertical_seperator x, y, y2 - [x, y, x, y2, 150, 150, 150] - end - - # Outputs vertical and horizontal separators onto the screen to separate each demo section. - def render_seperators - outputs.lines << horizontal_seperator(505, grid.left, 445) - outputs.lines << horizontal_seperator(353, grid.left, 445) - outputs.lines << horizontal_seperator(264, grid.left, 445) - outputs.lines << horizontal_seperator(174, grid.left, 445) - - outputs.lines << vertical_seperator(445, grid.top, grid.bottom) - - outputs.lines << horizontal_seperator(690, 445, 820) - outputs.lines << horizontal_seperator(426, 445, 820) - - outputs.lines << vertical_seperator(820, grid.top, grid.bottom) + # Sets values for a label, such as the position, value, size, alignment, and color. + def label x, y, value + [x, y + 10, value, 20, 1, 0, 0, 0] end end - $tech_demo = TechDemo.new + $tic_tac_toe = TicTacToe.new def tick args - $tech_demo.inputs = args.inputs - $tech_demo.state = args.state - $tech_demo.grid = args.grid - $tech_demo.args = args - $tech_demo.outputs = args.render_target(:mini_map) - $tech_demo.tick - args.outputs.labels << [830, 715, "Render target:", [-2, 0, 0, 0, 0, 255]] - args.outputs.sprites << [0, 0, 1280, 720, :mini_map] - args.outputs.sprites << [830, 300, 675, 379, :mini_map] - tick_instructions args, "Sample app shows all the rendering apis available." + $tic_tac_toe._ = args + $tic_tac_toe.state = args.state + $tic_tac_toe.outputs = args.outputs + $tic_tac_toe.inputs = args.inputs + $tic_tac_toe.grid = args.grid + $tic_tac_toe.gtk = args.gtk + $tic_tac_toe.tick + tick_instructions args, "Sample app shows how to work with mouse clicks." end def tick_instructions args, text, y = 715 @@ -8805,189 +10621,323 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Advanced Rendering - Render Primitive Hierarchies - main.rb +*** Mouse - Mouse Move - main.rb #+begin_src ruby - # ./samples/07_advanced_rendering/04_render_primitive_hierarchies/app/main.rb + # ./samples/05_mouse/02_mouse_move/app/main.rb =begin - APIs listing that haven't been encountered in previous sample apps: + Reminders: - - Nested array: An array whose individual elements are also arrays; useful for - storing groups of similar data. Also called multidimensional arrays. + - num1.greater(num2): Returns the greater value. + For example, if we have the command + puts 4.greater(3) + the number 4 would be printed to the console since it has a greater value than 3. + Similar to lesser, which returns the lesser value. - In this sample app, we see nested arrays being used in object definitions. - Notice the parameters for solids, listed below. Parameters 1-3 set the - definition for the rect, and parameter 4 sets the definition of the color. + - find_all: Finds all elements of a collection that meet certain requirements. + For example, in this sample app, we're using find_all to find all zombies that have intersected + or hit the player's sprite since these zombies have been killed. - Instead of having a solid definition that looks like this, - [X, Y, W, H, R, G, B] - we can separate it into two separate array definitions in one, like this - [[X, Y, W, H], [R, G, B]] - and both options work fine in defining our solid (or any object). + - args.inputs.keyboard.key_down.KEY: Determines if a key is being held or pressed. + Stores the frame the "down" event occurred. + For more information about the keyboard, go to mygame/documentation/06-keyboard.md. - - Collections: Lists of data; useful for organizing large amounts of data. - One element of a collection could be an array (which itself contains many elements). - For example, a collection that stores two solid objects would look like this: - [ - [100, 100, 50, 50, 0, 0, 0], - [100, 150, 50, 50, 255, 255, 255] - ] - If this collection was added to args.outputs.solids, two solids would be output - next to each other, one black and one white. - Nested arrays can be used in collections, as you will see in this sample app. + - args.outputs.sprites: An array. The values generate a sprite. + The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE] + For more information about sprites, go to mygame/documentation/05-sprites.md. - Reminders: + - args.state.new_entity: Used when we want to create a new object, like a sprite or button. + When we want to create a new object, we can declare it as a new entity and then define + its properties. (Remember, you can use state to define ANY property and it will + be retained across frames.) - - args.outputs.solids: An array. The values generate a solid. - The parameters for a solid are - 1. The position on the screen (x, y) - 2. The width (w) - 3. The height (h) - 4. The color (r, g, b) (if a color is not assigned, the object's default color will be black) - NOTE: THE PARAMETERS ARE THE SAME FOR BORDERS! + - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated + as Ruby code, and the placeholder is replaced with its corresponding value or result. - Here is an example of a (red) border or solid definition: - [100, 100, 400, 500, 255, 0, 0] - It will be a solid or border depending on if it is added to args.outputs.solids or args.outputs.borders. - For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md. + - map: Ruby method used to transform data; used in arrays, hashes, and collections. + Can be used to perform an action on every element of a collection, such as multiplying + each element by 2 or declaring every element as a new entity. - - args.outputs.sprites: An array. The values generate a sprite. - The parameters for sprites are - 1. The position on the screen (x, y) - 2. The width (w) - 3. The height (h) - 4. The image path (p) + - sample: Chooses a random element from the array. - Here is an example of a sprite definition: - [100, 100, 400, 500, 'sprites/dragonruby.png'] - For more information about sprites, go to mygame/documentation/05-sprites.md. + - reject: Removes elements that meet certain requirements. + In this sample app, we're removing/rejecting zombies that reach the center of the screen. We're also + rejecting zombies that were killed more than 30 frames ago. =end - # This code demonstrates the creation and output of objects like sprites, borders, and solids - # If filled in, they are solids - # If hollow, they are borders - # If images, they are sprites + # This sample app allows users to move around the screen in order to kill zombies. Zombies appear from every direction so the goal + # is to kill the zombies as fast as possible! - # Solids are added to args.outputs.solids - # Borders are added to args.outputs.borders - # Sprites are added to args.outputs.sprites + class ProtectThePuppiesFromTheZombies + attr_accessor :grid, :inputs, :state, :outputs - # The tick method runs 60 frames every second. - # Your game is going to happen under this one function. - def tick args - border_as_solid_and_solid_as_border args - sprite_as_border_or_solids args - collection_of_borders_and_solids args - collection_of_sprites args - end + # Calls the methods necessary for the game to run properly. + def tick + defaults + render + calc + input + end - # Shows a border being output onto the screen as a border and a solid - # Also shows how colors can be set - def border_as_solid_and_solid_as_border args - border = [0, 0, 50, 50] - args.outputs.borders << border - args.outputs.solids << border + # Sets default values for the zombies and for the player. + # Initialization happens only in the first frame. + def defaults + state.flash_at ||= 0 + state.zombie_min_spawn_rate ||= 60 + state.zombie_spawn_countdown ||= random_spawn_countdown state.zombie_min_spawn_rate + state.zombies ||= [] + state.killed_zombies ||= [] - # Red, green, blue saturations (last three parameters) can be any number between 0 and 255 - border_with_color = [0, 100, 50, 50, 255, 0, 0] - args.outputs.borders << border_with_color - args.outputs.solids << border_with_color + # Declares player as a new entity and sets its properties. + # The player begins the game in the center of the screen, not moving in any direction. + state.player ||= state.new_entity(:player, { x: 640, + y: 360, + attack_angle: 0, + dx: 0, + dy: 0 }) + end - border_with_nested_color = [0, 200, 50, 50, [0, 255, 0]] # nested color - args.outputs.borders << border_with_nested_color - args.outputs.solids << border_with_nested_color + # Outputs a gray background. + # Calls the methods needed to output the player, zombies, etc onto the screen. + def render + outputs.solids << [grid.rect, 100, 100, 100] + render_zombies + render_killed_zombies + render_player + render_flash + end - border_with_nested_rect = [[0, 300, 50, 50], 0, 0, 255] # nested rect - args.outputs.borders << border_with_nested_rect - args.outputs.solids << border_with_nested_rect + # Outputs the zombies on the screen and sets values for the sprites, such as the position, width, height, and animation. + def render_zombies + outputs.sprites << state.zombies.map do |z| # performs action on all zombies in the collection + z.sprite = [z.x, z.y, 4 * 3, 8 * 3, animation_sprite(z)].sprite # sets definition for sprite, calls animation_sprite method + z.sprite + end + end - border_with_nested_color_and_rect = [[0, 400, 50, 50], [255, 0, 255]] # nested rect and color - args.outputs.borders << border_with_nested_color_and_rect - args.outputs.solids << border_with_nested_color_and_rect - end + # Outputs sprites of killed zombies, and displays a slash image to show that a zombie has been killed. + def render_killed_zombies + outputs.sprites << state.killed_zombies.map do |z| # performs action on all killed zombies in collection + z.sprite = [z.x, + z.y, + 4 * 3, + 8 * 3, + animation_sprite(z, z.death_at), # calls animation_sprite method + 0, # angle + 255 * z.death_at.ease(30, :flip)].sprite # transparency of a zombie changes when they die + # change the value of 30 and see what happens when a zombie is killed - # Shows a sprite output onto the screen as a sprite, border, and solid - # Demonstrates that all three outputs appear differently on screen - def sprite_as_border_or_solids args - sprite = [100, 0, 50, 50, 'sprites/ship.png'] - args.outputs.sprites << sprite + # Sets values to output the slash over the zombie's sprite when a zombie is killed. + # The slash is tilted 45 degrees from the angle of the player's attack. + # Change the 3 inside scale_rect to 30 and the slash will be HUGE! Scale_rect positions + # the slash over the killed zombie's sprite. + [z.sprite, [z.sprite.rect, 'sprites/slash.png', 45 + state.player.attack_angle_on_click, z.sprite.a].scale_rect(3, 0.5, 0.5)] + end + end - # Sprite_as_border variable has same parameters (excluding position) as above object, - # but will appear differently on screen because it is added to args.outputs.borders - sprite_as_border = [100, 100, 50, 50, 'sprites/ship.png'] - args.outputs.borders << sprite_as_border + # Outputs the player sprite using the images in the sprites folder. + def render_player + state.player_sprite = [state.player.x, + state.player.y, + 4 * 3, + 8 * 3, "sprites/player-#{animation_index(state.player.created_at_elapsed)}.png"] # string interpolation + outputs.sprites << state.player_sprite - # Sprite_as_solid variable has same parameters (excluding position) as above object, - # but will appear differently on screen because it is added to args.outputs.solids - sprite_as_solid = [100, 200, 50, 50, 'sprites/ship.png'] - args.outputs.solids << sprite_as_solid - end + # Outputs a small red square that previews the angles that the player can attack in. + # It can be moved in a perfect circle around the player to show possible movements. + # Change the 60 in the parenthesis and see what happens to the movement of the red square. + outputs.solids << [state.player.x + state.player.attack_angle.vector_x(60), + state.player.y + state.player.attack_angle.vector_y(60), + 3, 3, 255, 0, 0] + end - # Holds and outputs a collection of borders and a collection of solids - # Collections are created by using arrays to hold parameters of each individual object - def collection_of_borders_and_solids args - collection_borders = [ - [ - [200, 0, 50, 50], # black border - [200, 100, 50, 50, 255, 0, 0], # red border - [200, 200, 50, 50, [0, 255, 0]], # nested color - ], - [[200, 300, 50, 50], 0, 0, 255], # nested rect - [[200, 400, 50, 50], [255, 0, 255]] # nested rect and nested color - ] + # Renders flash as a solid. The screen turns white for 10 frames when a zombie is killed. + def render_flash + return if state.flash_at.elapsed_time > 10 # return if more than 10 frames have passed since flash. + # Transparency gradually changes (or eases) during the 10 frames of flash. + outputs.primitives << [grid.rect, 255, 255, 255, 255 * state.flash_at.ease(10, :flip)].solid + end - args.outputs.borders << collection_borders + # Calls all methods necessary for performing calculations. + def calc + calc_spawn_zombie + calc_move_zombies + calc_player + calc_kill_zombie + end - collection_solids = [ - [ - [[300, 300, 50, 50], 0, 0, 255], # nested rect - [[300, 400, 50, 50], [255, 0, 255]] # nested rect and nested color - ], - [300, 0, 50, 50], - [300, 100, 50, 50, 255, 0, 0], - [300, 200, 50, 50, [0, 255, 0]], # nested color - ] + # Decreases the zombie spawn countdown by 1 if it has a value greater than 0. + def calc_spawn_zombie + if state.zombie_spawn_countdown > 0 + state.zombie_spawn_countdown -= 1 + return + end - args.outputs.solids << collection_solids - end + # New zombies are created, positioned on the screen, and added to the zombies collection. + state.zombies << state.new_entity(:zombie) do |z| # each zombie is declared a new entity + if rand > 0.5 + z.x = grid.rect.w.randomize(:ratio) # random x position on screen (within grid scope) + z.y = [-10, 730].sample # y position is set to either -10 or 730 (randomly chosen) + # the possible values exceed the screen's scope so zombies appear to be coming from far away + else + z.x = [-10, 1290].sample # x position is set to either -10 or 1290 (randomly chosen) + z.y = grid.rect.w.randomize(:ratio) # random y position on screen + end + end - # Holds and outputs a collection of sprites by adding it to args.outputs.sprites - # Also outputs a collection with same parameters (excluding position) by adding - # it to args.outputs.solids and another to args.outputs.borders - def collection_of_sprites args - sprites_collection = [ - [ - [400, 0, 50, 50, 'sprites/ship.png'], - [400, 100, 50, 50, 'sprites/ship.png'], - ], - [400, 200, 50, 50, 'sprites/ship.png'] - ] + # Calls random_spawn_countdown method (determines how fast new zombies appear) + state.zombie_spawn_countdown = random_spawn_countdown state.zombie_min_spawn_rate + state.zombie_min_spawn_rate -= 1 + # set to either the current zombie_min_spawn_rate or 0, depending on which value is greater + state.zombie_min_spawn_rate = state.zombie_min_spawn_rate.greater(0) + end - args.outputs.sprites << sprites_collection + # Moves all zombies towards the center of the screen. + # All zombies that reach the center (640, 360) are rejected from the zombies collection and disappear. + def calc_move_zombies + state.zombies.each do |z| # for each zombie in the collection + z.y = z.y.towards(360, 0.1) # move the zombie towards the center (640, 360) at a rate of 0.1 + z.x = z.x.towards(640, 0.1) # change 0.1 to 1.1 and see how much faster the zombies move to the center + end + state.zombies = state.zombies.reject { |z| z.y == 360 && z.x == 640 } # remove zombies that are in center + end - args.outputs.solids << [ - [500, 0, 50, 50, 'sprites/ship.png'], - [500, 100, 50, 50, 'sprites/ship.png'], - [[[500, 200, 50, 50, 'sprites/ship.png']]] - ] + # Calculates the position and movement of the player on the screen. + def calc_player + state.player.x += state.player.dx # changes x based on dx (change in x) + state.player.y += state.player.dy # changes y based on dy (change in y) - args.outputs.borders << [ - [ - [600, 0, 50, 50, 'sprites/ship.png'], - [600, 100, 50, 50, 'sprites/ship.png'], - ], - [600, 200, 50, 50, 'sprites/ship.png'] - ] + state.player.dx *= 0.9 # scales dx down + state.player.dy *= 0.9 # scales dy down + + # Compares player's x to 1280 to find lesser value, then compares result to 0 to find greater value. + # This ensures that the player remains within the screen's scope. + state.player.x = state.player.x.lesser(1280).greater(0) + state.player.y = state.player.y.lesser(720).greater(0) # same with player's y + end + + # Finds all zombies that intersect with the player's sprite. These zombies are removed from the zombies collection + # and added to the killed_zombies collection since any zombie that intersects with the player is killed. + def calc_kill_zombie + + # Find all zombies that intersect with the player. They are considered killed. + killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite } + state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection + state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies + + if killed_this_frame.length > 0 # if atleast one zombie was killed in the frame + state.flash_at = state.tick_count # flash_at set to the frame when the zombie was killed + # Don't forget, the rendered flash lasts for 10 frames after the zombie is killed (look at render_flash method) + end + + # Sets the tick_count (passage of time) as the value of the death_at variable for each killed zombie. + # Death_at stores the frame a zombie was killed. + killed_this_frame.each do |z| + z.death_at = state.tick_count + end + + # Zombies are rejected from the killed_zombies collection depending on when they were killed. + # They are rejected if more than 30 frames have passed since their death. + state.killed_zombies = state.killed_zombies.reject { |z| state.tick_count - z.death_at > 30 } + end + + # Uses input from the user to move the player around the screen. + def input + + # If the "a" key or left key is pressed, the x position of the player decreases. + # Otherwise, if the "d" key or right key is pressed, the x position of the player increases. + if inputs.keyboard.key_held.a || inputs.keyboard.key_held.left + state.player.x -= 5 + elsif inputs.keyboard.key_held.d || inputs.keyboard.key_held.right + state.player.x += 5 + end + + # If the "w" or up key is pressed, the y position of the player increases. + # Otherwise, if the "s" or down key is pressed, the y position of the player decreases. + if inputs.keyboard.key_held.w || inputs.keyboard.key_held.up + state.player.y += 5 + elsif inputs.keyboard.key_held.s || inputs.keyboard.key_held.down + state.player.y -= 5 + end + + # Sets the attack angle so the player can move and attack in the precise direction it wants to go. + # If the mouse is moved, the attack angle is changed (based on the player's position and mouse position). + # Attack angle also contributes to the position of red square. + if inputs.mouse.moved + state.player.attack_angle = inputs.mouse.position.angle_from [state.player.x, state.player.y] + end + + if inputs.mouse.click && state.player.dx < 0.5 && state.player.dy < 0.5 + state.player.attack_angle_on_click = inputs.mouse.position.angle_from [state.player.x, state.player.y] + state.player.attack_angle = state.player.attack_angle_on_click # player's attack angle is set + state.player.dx = state.player.attack_angle.vector_x(25) # change in player's position + state.player.dy = state.player.attack_angle.vector_y(25) + end + end + + # Sets the zombie spawn's countdown to a random number. + # How fast zombies appear (change the 60 to 6 and too many zombies will appear at once!) + def random_spawn_countdown minimum + 10.randomize(:ratio, :sign).to_i + 60 + end + + # Helps to iterate through the images in the sprites folder by setting the animation index. + # 3 frames is how long to show an image, and 6 is how many images to flip through. + def animation_index at + at.idiv(3).mod(6) + end + + # Animates the zombies by using the animation index to go through the images in the sprites folder. + def animation_sprite zombie, at = nil + at ||= zombie.created_at_elapsed # how long it is has been since a zombie was created + index = animation_index at + "sprites/zombie-#{index}.png" # string interpolation to iterate through images + end + end + + $protect_the_puppies_from_the_zombies = ProtectThePuppiesFromTheZombies.new + + def tick args + $protect_the_puppies_from_the_zombies.grid = args.grid + $protect_the_puppies_from_the_zombies.inputs = args.inputs + $protect_the_puppies_from_the_zombies.state = args.state + $protect_the_puppies_from_the_zombies.outputs = args.outputs + $protect_the_puppies_from_the_zombies.tick + tick_instructions args, "How to get the mouse position and translate it to an x, y position using .vector_x and .vector_y. CLICK to play." + 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.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 -* Advanced Rendering - Render Primitives As Hash - main.rb +*** Mouse - Mouse Move Paint App - main.rb #+begin_src ruby - # ./samples/07_advanced_rendering/05_render_primitives_as_hash/app/main.rb + # ./samples/05_mouse/03_mouse_move_paint_app/app/main.rb =begin + APIs listing that haven't been encountered in previous sample apps: + + - Floor: Method that returns an integer number smaller than or equal to the original with no decimal. + + For example, if we have a variable, a = 13.7, and we called floor on it, it would look like this... + puts a.floor() + which would print out 13. + (There is also a ceil method, which returns an integer number greater than or equal to the original + with no decimal. If we had called ceil on the variable a, the result would have been 14.) + Reminders: - Hashes: Collection of unique keys and their corresponding values. The value can be found @@ -9002,107 +10952,1635 @@ Follows is a source code listing for all files that have been open sourced. This puts numbers["one"] which would print "uno" to the console. - - args.outputs.sprites: An array. The values generate a sprite. - The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE] - For more information about sprites, go to mygame/documentation/05-sprites.md. - - - args.outputs.labels: An array. The values generate a label. - The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] - For more information about labels, go to mygame/documentation/02-labels.md. + - args.state.new_entity: Used when we want to create a new object, like a sprite or button. + In this sample app, new_entity is used to create a new button that clears the grid. + (Remember, you can use state to define ANY property and it will be retained across frames.) - - args.outputs.solids: An array. The values generate a solid. - The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] - For more information about solids, go to mygame/documentation/03-solids-and-borders.md. + - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse. - - args.outputs.borders: An array. The values generate a border. - The parameters are the same as a solid. - For more information about borders, go to mygame/documentation/03-solids-and-borders.md. + - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in. - - args.outputs.lines: An array. The values generate a line. - The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE] + - args.outputs.labels: An array. The values in the array generate a label. + The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] For more information about labels, go to mygame/documentation/02-labels.md. + - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect. + =end - # This sample app demonstrates how hashes can be used to output different kinds of objects. + # This sample app shows an empty grid that the user can paint on. + # To paint, the user must keep their mouse presssed and drag it around the grid. + # The "clear" button allows users to clear the grid so they can start over. - def tick args - args.state.angle ||= 0 # initializes angle to 0 - args.state.angle += 1 # increments angle by 1 every frame (60 times a second) + class PaintApp + attr_accessor :inputs, :state, :outputs, :grid, :args - # Outputs sprite using a hash - args.outputs.sprites << { - x: 30, # sprite position - y: 550, - w: 128, # sprite size - h: 101, - path: "dragonruby.png", # image path - angle: args.state.angle, # angle - a: 255, # alpha (transparency) - r: 255, # color saturation - g: 255, - b: 255, - tile_x: 0, # sprite sub division/tile - tile_y: 0, - tile_w: -1, - tile_h: -1, - flip_vertically: false, # don't flip sprite - flip_horizontally: false, - angle_anchor_x: 0.5, # rotation center set to middle - angle_anchor_y: 0.5 - } + # Runs methods necessary for the game to function properly. + def tick + print_title + add_grid + check_click + draw_buttons + end - # Outputs label using a hash - args.outputs.labels << { - x: 200, # label position - y: 550, - text: "dragonruby", # label text - size_enum: 2, - alignment_enum: 1, - r: 155, # color saturation - g: 50, - b: 50, - a: 255, # transparency - font: "fonts/manaspc.ttf" # font style; without mentioned file, label won't output correctly - } + # Prints the title onto the screen by using a label. + # Also separates the title from the grid with a line as a horizontal separator. + def print_title + args.outputs.labels << [ 640, 700, 'Paint!', 0, 1 ] + outputs.lines << horizontal_separator(660, 0, 1280) + end - # Outputs solid using a hash - # [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] - args.outputs.solids << { - x: 400, # position - y: 550, - w: 160, # size - h: 90, - r: 120, # color saturation - g: 50, - b: 50, - a: 255 # transparency - } + # Sets the starting position, ending position, and color for the horizontal separator. + # The starting and ending positions have the same y values. + def horizontal_separator y, x, x2 + [x, y, x2, y, 150, 150, 150] + end - # Outputs border using a hash - # Same parameters as a solid - args.outputs.borders << { - x: 600, - y: 550, - w: 160, - h: 90, - r: 120, - g: 50, - b: 50, - a: 255 - } + # Sets the starting position, ending position, and color for the vertical separator. + # The starting and ending positions have the same x values. + def vertical_separator x, y, y2 + [x, y, x, y2, 150, 150, 150] + end - # Outputs line using a hash - args.outputs.lines << { - x: 900, # starting position - y: 550, - x2: 1200, # ending position - y2: 550, - r: 120, # color saturation - g: 50, - b: 50, - a: 255 # transparency - } + # Outputs a border and a grid containing empty squares onto the screen. + def add_grid + + # Sets the x, y, height, and width of the grid. + # There are 31 horizontal lines and 31 vertical lines in the grid. + # Feel free to count them yourself before continuing! + x, y, h, w = 640 - 500/2, 640 - 500, 500, 500 # calculations done so the grid appears in screen's center + lines_h = 31 + lines_v = 31 + + # Sets values for the grid's border, grid lines, and filled squares. + # The filled_squares variable is initially set to an empty array. + state.grid_border ||= [ x, y, h, w ] # definition of grid's outer border + state.grid_lines ||= draw_grid(x, y, h, w, lines_h, lines_v) # calls draw_grid method + state.filled_squares ||= [] # there are no filled squares until the user fills them in + + # Outputs the grid lines, border, and filled squares onto the screen. + outputs.lines.concat state.grid_lines + outputs.borders << state.grid_border + outputs.solids << state.filled_squares + end + + # Draws the grid by adding in vertical and horizontal separators. + def draw_grid x, y, h, w, lines_h, lines_v + + # The grid starts off empty. + grid = [] + + # Calculates the placement and adds horizontal lines or separators into the grid. + curr_y = y # start at the bottom of the box + dist_y = h / (lines_h + 1) # finds distance to place horizontal lines evenly throughout 500 height of grid + lines_h.times do + curr_y += dist_y # increment curr_y by the distance between the horizontal lines + grid << horizontal_separator(curr_y, x, x + w - 1) # add a separator into the grid + end + + # Calculates the placement and adds vertical lines or separators into the grid. + curr_x = x # now start at the left of the box + dist_x = w / (lines_v + 1) # finds distance to place vertical lines evenly throughout 500 width of grid + lines_v.times do + curr_x += dist_x # increment curr_x by the distance between the vertical lines + grid << vertical_separator(curr_x, y + 1, y + h) # add separator + end + + # paint_grid uses a hash to assign values to keys. + state.paint_grid ||= {"x" => x, "y" => y, "h" => h, "w" => w, "lines_h" => lines_h, + "lines_v" => lines_v, "dist_x" => dist_x, + "dist_y" => dist_y } + + return grid + end + + # Checks if the user is keeping the mouse pressed down and sets the mouse_hold variable accordingly using boolean values. + # If the mouse is up, the user cannot drag the mouse. + def check_click + if inputs.mouse.down #is mouse up or down? + state.mouse_held = true # mouse is being held down + elsif inputs.mouse.up # if mouse is up + state.mouse_held = false # mouse is not being held down or dragged + state.mouse_dragging = false + end + + if state.mouse_held && # mouse needs to be down + !inputs.mouse.click && # must not be first click + ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15) # Need to move 15 pixels before "drag" + state.mouse_dragging = true + end + + # If the user clicks their mouse inside the grid, the search_lines method is called with a click input type. + if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border)) + search_lines(inputs.mouse.click.point, :click) + + # If the user drags their mouse inside the grid, the search_lines method is called with a drag input type. + elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border)) + search_lines(inputs.mouse.position, :drag) + end + end + + # Sets the definition of a grid box and handles user input to fill in or clear grid boxes. + def search_lines (point, input_type) + point.x -= state.paint_grid["x"] # subtracts the value assigned to the "x" key in the paint_grid hash + point.y -= state.paint_grid["y"] # subtracts the value assigned to the "y" key in the paint_grid hash + + # Remove code following the .floor and see what happens when you try to fill in grid squares + point.x = (point.x / state.paint_grid["dist_x"]).floor * state.paint_grid["dist_x"] + point.y = (point.y / state.paint_grid["dist_y"]).floor * state.paint_grid["dist_y"] + + point.x += state.paint_grid["x"] + point.y += state.paint_grid["y"] + + # Sets definition of a grid box, meaning its x, y, width, and height. + # Floor is called on the point.x and point.y variables. + # Ceil method is called on values of the distance hash keys, setting the width and height of a box. + grid_box = [ point.x.floor, point.y.floor, state.paint_grid["dist_x"].ceil, state.paint_grid["dist_y"].ceil ] + + if input_type == :click # if user clicks their mouse + if state.filled_squares.include? grid_box # if grid box is already filled in + state.filled_squares.delete grid_box # box is cleared and removed from filled_squares + else + state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares + end + elsif input_type == :drag # if user drags mouse + unless state.filled_squares.include? grid_box # unless the grid box dragged over is already filled in + state.filled_squares << grid_box # the box is filled in and added to filled_squares + end + end + end + + # Creates and outputs a "Clear" button on the screen using a label and a border. + # If the button is clicked, the filled squares are cleared, making the filled_squares collection empty. + def draw_buttons + x, y, w, h = 390, 50, 240, 50 + state.clear_button ||= state.new_entity(:button_with_fade) + + # The x and y positions are set to display the label in the center of the button. + # Try changing the first two parameters to simply x, y and see what happens to the text placement! + state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] # placed in center of border + state.clear_button.border ||= [x, y, w, h] + + # If the mouse is clicked inside the borders of the clear button, + # the filled_squares collection is emptied and the squares are cleared. + if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border) + state.clear_button.clicked_at = inputs.mouse.click.created_at # time (frame) the click occurred + state.filled_squares.clear + inputs.mouse.previous_click = nil + end + + outputs.labels << state.clear_button.label + outputs.borders << state.clear_button.border + + # When the clear button is clicked, the color of the button changes + # and the transparency changes, as well. If you change the time from + # 0.25.seconds to 1.25.seconds or more, the change will last longer. + if state.clear_button.clicked_at + outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)] + end + end + end + + $paint_app = PaintApp.new + + def tick args + $paint_app.inputs = args.inputs + $paint_app.state = args.state + $paint_app.grid = args.grid + $paint_app.args = args + $paint_app.outputs = args.outputs + $paint_app.tick + tick_instructions args, "How to create a simple paint app. CLICK and HOLD to draw." + 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.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 + +*** Mouse - Coordinate Systems - main.rb +#+begin_src ruby + # ./samples/05_mouse/04_coordinate_systems/app/main.rb + =begin + + APIs listing that haven't been encountered in previous sample apps: + + - args.inputs.mouse.click.position: Coordinates of the mouse's position on the screen. + Unlike args.inputs.mouse.click.point, the mouse does not need to be pressed down for + position to know the mouse's coordinates. + For more information about the mouse, go to mygame/documentation/07-mouse.md. + + Reminders: + + - args.inputs.mouse.click: This property will be set if the mouse was clicked. + + - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse. + + - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated + as Ruby code, and the placeholder is replaced with its corresponding value or result. + + In this sample app, string interpolation is used to show the current position of the mouse + in a label. + + - args.outputs.labels: An array that generates a label. + The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] + For more information about labels, go to mygame/documentation/02-labels.md. + + - args.outputs.solids: An array that generates a solid. + The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] + For more information about solids, go to mygame/documentation/03-solids-and-borders.md. + + - args.outputs.lines: An array that generates a line. + The parameters are [X, Y, X2, Y2, RED, GREEN, BLUE, ALPHA] + For more information about lines, go to mygame/documentation/04-lines.md. + + =end + + # This sample app shows a coordinate system or grid. The user can move their mouse around the screen and the + # coordinates of their position on the screen will be displayed. Users can choose to view one quadrant or + # four quadrants by pressing the button. + + def tick args + + # The addition and subtraction in the first two parameters of the label and solid + # ensure that the outputs don't overlap each other. Try removing them and see what happens. + pos = args.inputs.mouse.position # stores coordinates of mouse's position + args.outputs.labels << [pos.x + 10, pos.y + 10, "#{pos}"] # outputs label of coordinates + args.outputs.solids << [pos.x - 2, pos.y - 2, 5, 5] # outputs small blackk box placed where mouse is hovering + + button = [0, 0, 370, 50] # sets definition of toggle button + args.outputs.borders << button # outputs button as border (not filled in) + args.outputs.labels << [10, 35, "click here toggle coordinate system"] # label of button + args.outputs.lines << [ 0, -720, 0, 720] # vertical line dividing quadrants + args.outputs.lines << [-1280, 0, 1280, 0] # horizontal line dividing quadrants + + if args.inputs.mouse.click # if the user clicks the mouse + pos = args.inputs.mouse.click.point # pos's value is point where user clicked (coordinates) + if pos.inside_rect? button # if the click occurred inside the button + if args.grid.name == :bottom_left # if the grid shows bottom left as origin + args.grid.origin_center! # origin will be shown in center + else + args.grid.origin_bottom_left! # otherwise, the view will change to show bottom left as origin + end + end + end + + tick_instructions args, "Sample app shows the two supported coordinate systems in Game Toolkit." + 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.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 + +*** Save Load - Save Load Game - main.rb +#+begin_src ruby + # ./samples/06_save_load/01_save_load_game/app/main.rb + =begin + + APIs listing that haven't been encountered in previous sample apps: + + - Symbol (:): Ruby object with a name and an internal ID. Symbols are useful + because with a given symbol name, you can refer to the same object throughout + a Ruby program. + + In this sample app, we're using symbols for our buttons. We have buttons that + light fires, save, load, etc. Each of these buttons has a distinct symbol like + :light_fire, :save_game, :load_game, etc. + + - to_sym: Returns the symbol corresponding to the given string; creates the symbol + if it does not already exist. + For example, + 'car'.to_sym + would return the symbol :car. + + - last: Returns the last element of an array. + + Reminders: + + - num1.lesser(num2): finds the lower value of the given options. + For example, in the statement + a = 4.lesser(3) + 3 has a lower value than 4, which means that the value of a would be set to 3, + but if the statement had been + a = 4.lesser(5) + 4 has a lower value than 5, which means that the value of a would be set to 4. + + - num1.fdiv(num2): returns the float division (will have a decimal) of the two given numbers. + For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0 + + - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated + as Ruby code, and the placeholder is replaced with its corresponding value or result. + + - args.outputs.labels: An array. Values generate a label. + Parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] + For more information, go to mygame/documentation/02-labels.md. + + - ARRAY#inside_rect?: An array with at least two values is considered a point. An array + with at least four values is considered a rect. The inside_rect? function returns true + or false depending on if the point is inside the rect. + + =end + + # This code allows users to perform different tasks, such as saving and loading the game. + # Users also have options to reset the game and light a fire. + + class TextedBasedGame + + # Contains methods needed for game to run properly. + # Increments tick count by 1 each time it runs (60 times in a single second) + def tick + default + show_intro + state.engine_tick_count += 1 + tick_fire + end + + # Sets default values. + # The ||= ensures that a variable's value is only set to the value following the = sign + # if the value has not already been set before. Intialization happens only in the first frame. + def default + state.engine_tick_count ||= 0 + state.active_module ||= :room + state.fire_progress ||= 0 + state.fire_ready_in ||= 10 + state.previous_fire ||= :dead + state.fire ||= :dead + end + + def show_intro + return unless state.engine_tick_count == 0 # return unless the game just started + set_story_line "awake." # calls set_story_line method, sets to "awake" + end + + # Sets story line. + def set_story_line story_line + state.story_line = story_line # story line set to value of parameter + state.active_module = :alert # active module set to alert + end + + # Clears story line. + def clear_storyline + state.active_module = :none # active module set to none + state.story_line = nil # story line is cleared, set to nil (or empty) + end + + # Determines fire progress (how close the fire is to being ready to light). + def tick_fire + return if state.active_module == :alert # return if active module is alert + state.fire_progress += 1 # increment fire progress + # fire_ready_in is 10. The fire_progress is either the current value or 10, whichever has a lower value. + state.fire_progress = state.fire_progress.lesser(state.fire_ready_in) + end + + # Sets the value of fire (whether it is dead or roaring), and the story line + def light_fire + return unless fire_ready? # returns unless the fire is ready to be lit + state.fire = :roaring # fire is lit, set to roaring + state.fire_progress = 0 # the fire progress returns to 0, since the fire has been lit + if state.fire != state.previous_fire + set_story_line "the fire is #{state.fire}." # the story line is set using string interpolation + state.previous_fire = state.fire + end + end + + # Checks if the fire is ready to be lit. Returns a boolean value. + def fire_ready? + # If fire_progress (value between 0 and 10) is equal to fire_ready_in (value of 10), + # the fire is ready to be lit. + state.fire_progress == state.fire_ready_in + end + + # Divides the value of the fire_progress variable by 10 to determine how close the user is to + # being able to light a fire. + def light_fire_progress + state.fire_progress.fdiv(10) # float division + end + + # Defines fire as the state.fire variable. + def fire + state.fire + end + + # Sets the title of the room. + def room_title + return "a room that is dark" if state.fire == :dead # room is dark if the fire is dead + return "a room that is lit" # room is lit if the fire is not dead + end + + # Sets the active_module to room. + def go_to_room + state.active_module = :room + end + + # Defines active_module as the state.active_module variable. + def active_module + state.active_module + end + + # Defines story_line as the state.story_line variable. + def story_line + state.story_line + end + + # Update every 60 frames (or every second) + def should_tick? + state.tick_count.mod_zero?(60) + end + + # Sets the value of the game state provider. + def initialize game_state_provider + @game_state_provider = game_state_provider + end + + # Defines the game state. + # Any variable prefixed with an @ symbol is an instance variable. + def state + @game_state_provider.state + end + + # Saves the state of the game in a text file called game_state.txt. + def save + $gtk.serialize_state('game_state.txt', state) + end + + # Loads the game state from the game_state.txt text file. + # If the load is unsuccessful, the user is informed since the story line indicates the failure. + def load + parsed_state = $gtk.deserialize_state('game_state.txt') + if !parsed_state + set_story_line "no game to load. press save first." + else + $gtk.args.state = parsed_state + end + end + + # Resets the game. + def reset + $gtk.reset + end + end + + class TextedBasedGamePresenter + attr_accessor :state, :outputs, :inputs + + # Creates empty collection called highlights. + # Calls methods necessary to run the game. + def tick + state.layout.highlights ||= [] + game.tick if game.should_tick? + render + process_input + end + + # Outputs a label of the tick count (passage of time) and calls all render methods. + def render + outputs.labels << [10, 30, state.tick_count] + render_alert + render_room + render_highlights + end + + # Outputs a label onto the screen that shows the story line, and also outputs a "close" button. + def render_alert + return unless game.active_module == :alert + + outputs.labels << [640, 480, game.story_line, 5, 1] # outputs story line label + outputs.primitives << button(:alert_dismiss, 490, 380, "close") # positions "close" button under story line + end + + def render_room + return unless game.active_module == :room + outputs.labels << [640, 700, game.room_title, 4, 1] # outputs room title label at top of screen + + # The parameters for these outputs are (symbol, x, y, text, value/percentage) and each has a y value + # that positions it 60 pixels lower than the previous output. + + # outputs the light_fire_progress bar, uses light_fire_progress for its percentage (which changes bar's appearance) + outputs.primitives << progress_bar(:light_fire, 490, 600, "light fire", game.light_fire_progress) + outputs.primitives << button( :save_game, 490, 540, "save") # outputs save button + outputs.primitives << button( :load_game, 490, 480, "load") # outputs load button + outputs.primitives << button( :reset_game, 490, 420, "reset") # outputs reset button + outputs.labels << [640, 30, "the fire is #{game.fire}", 0, 1] # outputs fire label at bottom of screen + end + + # Outputs a collection of highlights using an array to set their values, and also rejects certain values from the collection. + def render_highlights + state.layout.highlights.each do |h| # for each highlight in the collection + h.lifetime -= 1 # decrease the value of its lifetime + end + + outputs.solids << state.layout.highlights.map do |h| # outputs highlights collection + [h.x, h.y, h.w, h.h, h.color, 255 * h.lifetime / h.max_lifetime] # sets definition for each highlight + # transparency changes; divide lifetime by max_lifetime, multiply result by 255 + end + + # reject highlights from collection that have no remaining lifetime + state.layout.highlights = state.layout.highlights.reject { |h| h.lifetime <= 0 } + end + + # Checks whether or not a button was clicked. + # Returns a boolean value. + def process_input + button = button_clicked? # calls button_clicked? method + end + + # Returns a boolean value. + # Finds the button that was clicked from the button list and determines what method to call. + # Adds a highlight to the highlights collection. + def button_clicked? + return nil unless click_pos # return nil unless click_pos holds coordinates of mouse click + button = @button_list.find do |k, v| # goes through button_list to find button clicked + click_pos.inside_rect? v[:primitives].last.rect # was the mouse clicked inside the rect of button? + end + return unless button # return unless a button was clicked + method_to_call = "#{button[0]}_clicked".to_sym # sets method_to_call to symbol (like :save_game or :load_game) + if self.respond_to? method_to_call # returns true if self responds to the given method (method actually exists) + border = button[1][:primitives].last # sets border definition using value of last key in button list hash + + # declares each highlight as a new entity, sets properties + state.layout.highlights << state.new_entity(:highlight) do |h| + h.x = border.x + h.y = border.y + h.w = border.w + h.h = border.h + h.max_lifetime = 10 + h.lifetime = h.max_lifetime + h.color = [120, 120, 180] # sets color to shade of purple + end + + self.send method_to_call # invoke method identified by symbol + else # otherwise, if self doesn't respond to given method + border = button[1][:primitives].last # sets border definition using value of last key in hash + + # declares each highlight as a new entity, sets properties + state.layout.highlights << state.new_entity(:highlight) do |h| + h.x = border.x + h.y = border.y + h.w = border.w + h.h = border.h + h.max_lifetime = 4 # different max_lifetime than the one set if respond_to? had been true + h.lifetime = h.max_lifetime + h.color = [120, 80, 80] # sets color to dark color + end + + # instructions for users on how to add the missing method_to_call to the code + puts "It looks like #{method_to_call} doesn't exists on TextedBasedGamePresenter. Please add this method:" + puts "Just copy the code below and put it in the #{TextedBasedGamePresenter} class definition." + puts "" + puts "```" + puts "class TextedBasedGamePresenter <--- find this class and put the method below in it" + puts "" + puts " def #{method_to_call}" + puts " puts 'Yay that worked!'" + puts " end" + puts "" + puts "end <-- make sure to put the #{method_to_call} method in between the `class` word and the final `end` statement." + puts "```" + puts "" + end + end + + # Returns the position of the mouse when it is clicked. + def click_pos + return nil unless inputs.mouse.click # returns nil unless the mouse was clicked + return inputs.mouse.click.point # returns location of mouse click (coordinates) + end + + # Creates buttons for the button_list and sets their values using a hash (uses symbols as keys) + def button id, x, y, text + @button_list[id] ||= { # assigns values to hash keys + id: id, + text: text, + primitives: [ + [x + 10, y + 30, text, 2, 0].label, # positions label inside border + [x, y, 300, 50].border, # sets definition of border + ] + } + + @button_list[id][:primitives] # returns label and border for buttons + end + + # Creates a progress bar (used for lighting the fire) and sets its values. + def progress_bar id, x, y, text, percentage + @button_list[id] = { # assigns values to hash keys + id: id, + text: text, + primitives: [ + [x, y, 300, 50, 100, 100, 100].solid, # sets definition for solid (which fills the bar with gray) + [x + 10, y + 30, text, 2, 0].label, # sets definition for label, positions inside border + [x, y, 300, 50].border, # sets definition of border + ] + } + + # Fills progress bar based on percentage. If the fire was ready to be lit (100%) and we multiplied by + # 100, only 1/3 of the bar would only be filled in. 200 would cause only 2/3 to be filled in. + @button_list[id][:primitives][0][2] = 300 * percentage + @button_list[id][:primitives] + end + + # Defines the game. + def game + @game + end + + # Initalizes the game and creates an empty list of buttons. + def initialize + @game = TextedBasedGame.new self + @button_list ||= {} + end + + # Clears the storyline and takes the user to the room. + def alert_dismiss_clicked + game.clear_storyline + game.go_to_room + end + + # Lights the fire when the user clicks the "light fire" option. + def light_fire_clicked + game.light_fire + end + + # Saves the game when the user clicks the "save" option. + def save_game_clicked + game.save + end + + # Resets the game when the user clicks the "reset" option. + def reset_game_clicked + game.reset + end + + # Loads the game when the user clicks the "load" option. + def load_game_clicked + game.load + end + end + + $text_based_rpg = TextedBasedGamePresenter.new + + def tick args + $text_based_rpg.state = args.state + $text_based_rpg.outputs = args.outputs + $text_based_rpg.inputs = args.inputs + $text_based_rpg.tick + end + +#+end_src + +*** Advanced Rendering - Simple Render Targets - main.rb +#+begin_src ruby + # ./samples/07_advanced_rendering/01_simple_render_targets/app/main.rb + def tick args + # args.outputs.render_targets are really really powerful. + # They essentially allow you to create a sprite programmatically and cache the result. + + # Create a render_target of a :block and a :gradient on tick zero. + if args.state.tick_count == 0 + args.render_target(:block).solids << [0, 0, 1280, 100] + + # The gradient is actually just a collection of black solids with increasing + # opacities. + args.render_target(:gradient).solids << 90.map_with_index do |x| + 50.map_with_index do |y| + [x * 15, y * 15, 15, 15, 0, 0, 0, (x * 3).fdiv(255) * 255] + end + end + end + + # Take the :block render_target and present it horizontally centered. + # Use a subsection of the render_targetd specified by source_x, + # source_y, source_w, source_h. + args.outputs.sprites << { x: 0, + y: 310, + w: 1280, + h: 100, + path: :block, + source_x: 0, + source_y: 0, + source_w: 1280, + source_h: 100 } + + # After rendering :block, render gradient on top of :block. + args.outputs.sprites << [0, 0, 1280, 720, :gradient] + + args.outputs.labels << [1270, 710, args.gtk.current_framerate, 0, 2, 255, 255, 255] + tick_instructions args, "Sample app shows how to use render_targets (programmatically create cached sprites)." + 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.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 + + $gtk.reset + +#+end_src + +*** Advanced Rendering - Render Targets With Tile Manipulation - main.rb +#+begin_src 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 + # a scene to wipe away; the actual wipe effect is in the last 20 lines or + # so. + + $gtk.reset # reset all game state if reloaded. + + def circle_of_blocks pass, xoffset, yoffset, angleoffset, blocksize, distance + numblocks = 10 + + for i in 1..numblocks do + angle = ((360 / numblocks) * i) + angleoffset + radians = angle * (Math::PI / 180) + x = (xoffset + (distance * Math.cos(radians))).round + y = (yoffset + (distance * Math.sin(radians))).round + pass.solids << [ x, y, blocksize, blocksize, 255, 255, 0 ] + end + end + + def draw_scene args, pass + pass.solids << [0, 360, 1280, 360, 0, 0, 200] + pass.solids << [0, 0, 1280, 360, 0, 127, 0] + + blocksize = 100 + angleoffset = args.state.tick_count * 2.5 + centerx = (1280 - blocksize) / 2 + centery = (720 - blocksize) / 2 + + circle_of_blocks pass, centerx, centery, angleoffset, blocksize * 2, 500 + circle_of_blocks pass, centerx, centery, angleoffset, blocksize, 325 + circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 2, 200 + circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 4, 100 + end + + def tick args + segments = 160 + + # On the first tick, initialize some stuff. + if !args.state.yoffsets + args.state.baseyoff = 0 + args.state.yoffsets = [] + for i in 0..segments do + args.state.yoffsets << rand * 100 + end + end + + # Just draw some random stuff for a few seconds. + args.state.static_debounce ||= 60 * 2.5 + if args.state.static_debounce > 0 + last_frame = args.state.static_debounce == 1 + target = last_frame ? args.render_target(:last_frame) : args.outputs + draw_scene args, target + args.state.static_debounce -= 1 + return unless last_frame + end + + # build up the wipe... + + # this is the thing we're wiping to. + args.outputs.sprites << [ 0, 0, 1280, 720, 'dragonruby.png' ] + + return if (args.state.baseyoff > (1280 + 100)) # stop when done sliding + + segmentw = 1280 / segments + + x = 0 + for i in 0..segments do + yoffset = 0 + if args.state.yoffsets[i] < args.state.baseyoff + yoffset = args.state.baseyoff - args.state.yoffsets[i] + end + + # (720 - yoffset) flips the coordinate system, (- 720) adjusts for the height of the segment. + args.outputs.sprites << [ x, (720 - yoffset) - 720, segmentw, 720, 'last_frame', 0, 255, 255, 255, 255, x, 0, segmentw, 720 ] + x += segmentw + end + + args.state.baseyoff += 4 + + tick_instructions args, "Sample app shows an advanced usage of render_target." + 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.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 + +*** Advanced Rendering - Render Target Viewports - main.rb +#+begin_src ruby + # ./samples/07_advanced_rendering/03_render_target_viewports/app/main.rb + =begin + + APIs listing that haven't been encountered in previous sample apps: + + - args.state.new_entity: Used when we want to create a new object, like a sprite or button. + For example, if we want to create a new button, we would declare it as a new entity and + then define its properties. (Remember, you can use state to define ANY property and it will + be retained across frames.) + + If you have a solar system and you're creating args.state.sun and setting its image path to an + image in the sprites folder, you would do the following: + (See samples/99_sample_nddnug_workshop for more details.) + + args.state.sun ||= args.state.new_entity(:sun) do |s| + s.path = 'sprites/sun.png' + end + + - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated + as Ruby code, and the placeholder is replaced with its corresponding value or result. + + For example, if we have a variable + name = "Ruby" + then the line + puts "How are you, #{name}?" + would print "How are you, Ruby?" to the console. + (Remember, string interpolation only works with double quotes!) + + - Ternary operator (?): Similar to if statement; first evalulates whether a statement is + true or false, and then executes a command depending on that result. + For example, if we had a variable + grade = 75 + and used the ternary operator in the command + pass_or_fail = grade > 65 ? "pass" : "fail" + then the value of pass_or_fail would be "pass" since grade's value was greater than 65. + + Reminders: + + - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual + 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720). + + - Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction + by adding or subracting. + + - ARRAY#inside_rect?: An array with at least two values is considered a point. An array + with at least four values is considered a rect. The inside_rect? function returns true + or false depending on if the point is inside the rect. + + - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect. + + - args.inputs.mouse.click: This property will be set if the mouse was clicked. + For more information about the mouse, go to mygame/documentation/07-mouse.md. + + - args.inputs.keyboard.key_up.KEY: The value of the properties will be set + to the frame that the key_up event occurred (the frame correlates + to args.state.tick_count). + For more information about the keyboard, go to mygame/documentation/06-keyboard.md. + + - args.state.labels: + The parameters for a label are + 1. the position (x, y) + 2. the text + 3. the size + 4. the alignment + 5. the color (red, green, and blue saturations) + 6. the alpha (or transparency) + For more information about labels, go to mygame/documentation/02-labels.md. + + - args.state.lines: + The parameters for a line are + 1. the starting position (x, y) + 2. the ending position (x2, y2) + 3. the color (red, green, and blue saturations) + 4. the alpha (or transparency) + For more information about lines, go to mygame/documentation/04-lines.md. + + - args.state.solids (and args.state.borders): + The parameters for a solid (or border) are + 1. the position (x, y) + 2. the width (w) + 3. the height (h) + 4. the color (r, g, b) + 5. the alpha (or transparency) + For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md. + + - args.state.sprites: + The parameters for a sprite are + 1. the position (x, y) + 2. the width (w) + 3. the height (h) + 4. the image path + 5. the angle + 6. the alpha (or transparency) + For more information about sprites, go to mygame/documentation/05-sprites.md. + =end + + # This sample app shows different objects that can be used when making games, such as labels, + # lines, sprites, solids, buttons, etc. Each demo section shows how these objects can be used. + + # Also note that state.tick_count refers to the passage of time, or current frame. + + class TechDemo + attr_accessor :inputs, :state, :outputs, :grid, :args + + # Calls all methods necessary for the app to run properly. + def tick + labels_tech_demo + lines_tech_demo + solids_tech_demo + borders_tech_demo + sprites_tech_demo + keyboards_tech_demo + controller_tech_demo + mouse_tech_demo + point_to_rect_tech_demo + rect_to_rect_tech_demo + button_tech_demo + export_game_state_demo + window_state_demo + render_seperators + end + + # Shows output of different kinds of labels on the screen + def labels_tech_demo + outputs.labels << [grid.left.shift_right(5), grid.top.shift_down(5), "This is a label located at the top left."] + outputs.labels << [grid.left.shift_right(5), grid.bottom.shift_up(30), "This is a label located at the bottom left."] + outputs.labels << [ 5, 690, "Labels (x, y, text, size, align, r, g, b, a)"] + outputs.labels << [ 5, 660, "Smaller label.", -2] + outputs.labels << [ 5, 630, "Small label.", -1] + outputs.labels << [ 5, 600, "Medium label.", 0] + outputs.labels << [ 5, 570, "Large label.", 1] + outputs.labels << [ 5, 540, "Larger label.", 2] + outputs.labels << [300, 660, "Left aligned.", 0, 2] + outputs.labels << [300, 640, "Center aligned.", 0, 1] + outputs.labels << [300, 620, "Right aligned.", 0, 0] + outputs.labels << [175, 595, "Red Label.", 0, 0, 255, 0, 0] + outputs.labels << [175, 575, "Green Label.", 0, 0, 0, 255, 0] + outputs.labels << [175, 555, "Blue Label.", 0, 0, 0, 0, 255] + outputs.labels << [175, 535, "Faded Label.", 0, 0, 0, 0, 0, 128] + end + + # Shows output of lines on the screen + def lines_tech_demo + outputs.labels << [5, 500, "Lines (x, y, x2, y2, r, g, b, a)"] + outputs.lines << [5, 450, 100, 450] + outputs.lines << [5, 430, 300, 430] + outputs.lines << [5, 410, 300, 410, state.tick_count % 255, 0, 0, 255] # red saturation changes + outputs.lines << [5, 390 - state.tick_count % 25, 300, 390, 0, 0, 0, 255] # y position changes + outputs.lines << [5 + state.tick_count % 200, 360, 300, 360, 0, 0, 0, 255] # x position changes + end + + # Shows output of different kinds of solids on the screen + def solids_tech_demo + outputs.labels << [ 5, 350, "Solids (x, y, w, h, r, g, b, a)"] + outputs.solids << [ 10, 270, 50, 50] + outputs.solids << [ 70, 270, 50, 50, 0, 0, 0] + outputs.solids << [130, 270, 50, 50, 255, 0, 0] + outputs.solids << [190, 270, 50, 50, 255, 0, 0, 128] + outputs.solids << [250, 270, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes + end + + # Shows output of different kinds of borders on the screen + # The parameters for a border are the same as the parameters for a solid + def borders_tech_demo + outputs.labels << [ 5, 260, "Borders (x, y, w, h, r, g, b, a)"] + outputs.borders << [ 10, 180, 50, 50] + outputs.borders << [ 70, 180, 50, 50, 0, 0, 0] + outputs.borders << [130, 180, 50, 50, 255, 0, 0] + outputs.borders << [190, 180, 50, 50, 255, 0, 0, 128] + outputs.borders << [250, 180, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes + end + + # Shows output of different kinds of sprites on the screen + def sprites_tech_demo + outputs.labels << [ 5, 170, "Sprites (x, y, w, h, path, angle, a)"] + outputs.sprites << [ 10, 40, 128, 101, 'dragonruby.png'] + outputs.sprites << [ 150, 40, 128, 101, 'dragonruby.png', state.tick_count % 360] # angle changes + outputs.sprites << [ 300, 40, 128, 101, 'dragonruby.png', 0, state.tick_count % 255] # transparency changes + end + + # Holds size, alignment, color (black), and alpha (transparency) parameters + # Using small_font as a parameter accounts for all remaining parameters + # so they don't have to be repeatedly typed + def small_font + [-2, 0, 0, 0, 0, 255] + end + + # Sets position of each row + # Converts given row value to pixels that DragonRuby understands + def row_to_px row_number + + # Row 0 starts 5 units below the top of the grid. + # Each row afterward is 20 units lower. + grid.top.shift_down(5).shift_down(20 * row_number) + end + + # Uses labels to output current game time (passage of time), and whether or not "h" was pressed + # If "h" is pressed, the frame is output when the key_up event occurred + def keyboards_tech_demo + outputs.labels << [460, row_to_px(0), "Current game time: #{state.tick_count}", small_font] + outputs.labels << [460, row_to_px(2), "Keyboard input: inputs.keyboard.key_up.h", small_font] + outputs.labels << [460, row_to_px(3), "Press \"h\" on the keyboard.", small_font] + + if inputs.keyboard.key_up.h # if "h" key_up event occurs + state.h_pressed_at = state.tick_count # frame it occurred is stored + end + + # h_pressed_at is initially set to false, and changes once the user presses the "h" key. + state.h_pressed_at ||= false + + if state.h_pressed_at # if h is pressed (pressed_at has a frame number and is no longer false) + outputs.labels << [460, row_to_px(4), "\"h\" was pressed at time: #{state.h_pressed_at}", small_font] + else # otherwise, label says "h" was never pressed + outputs.labels << [460, row_to_px(4), "\"h\" has never been pressed.", small_font] + end + + # border around keyboard input demo section + outputs.borders << [455, row_to_px(5), 360, row_to_px(2).shift_up(5) - row_to_px(5)] + end + + # Sets definition for a small label + # Makes it easier to position labels in respect to the position of other labels + def small_label x, row, message + [x, row_to_px(row), message, small_font] + end + + # Uses small labels to show whether the "a" button on the controller is down, held, or up. + # y value of each small label is set by calling the row_to_px method + def controller_tech_demo + x = 460 + outputs.labels << small_label(x, 6, "Controller one input: inputs.controller_one") + outputs.labels << small_label(x, 7, "Current state of the \"a\" button.") + outputs.labels << small_label(x, 8, "Check console window for more info.") + + if inputs.controller_one.key_down.a # if "a" is in "down" state + outputs.labels << small_label(x, 9, "\"a\" button down: #{inputs.controller_one.key_down.a}") + puts "\"a\" button down at #{inputs.controller_one.key_down.a}" # prints frame the event occurred + elsif inputs.controller_one.key_held.a # if "a" is held down + outputs.labels << small_label(x, 9, "\"a\" button held: #{inputs.controller_one.key_held.a}") + elsif inputs.controller_one.key_up.a # if "a" is in up state + outputs.labels << small_label(x, 9, "\"a\" button up: #{inputs.controller_one.key_up.a}") + puts "\"a\" key up at #{inputs.controller_one.key_up.a}" + else # if no event has occurred + outputs.labels << small_label(x, 9, "\"a\" button state is nil.") + end + + # border around controller input demo section + outputs.borders << [455, row_to_px(10), 360, row_to_px(6).shift_up(5) - row_to_px(10)] + end + + # Outputs when the mouse was clicked, as well as the coordinates on the screen + # of where the click occurred + def mouse_tech_demo + x = 460 + + outputs.labels << small_label(x, 11, "Mouse input: inputs.mouse") + + if inputs.mouse.click # if click has a value and is not nil + state.last_mouse_click = inputs.mouse.click # coordinates of click are stored + end + + if state.last_mouse_click # if mouse is clicked (has coordinates as value) + # outputs the time (frame) the click occurred, as well as how many frames have passed since the event + outputs.labels << small_label(x, 12, "Mouse click happened at: #{state.last_mouse_click.created_at}, #{state.last_mouse_click.created_at_elapsed}") + # outputs coordinates of click + outputs.labels << small_label(x, 13, "Mouse click location: #{state.last_mouse_click.point.x}, #{state.last_mouse_click.point.y}") + else # otherwise if the mouse has not been clicked + outputs.labels << small_label(x, 12, "Mouse click has not occurred yet.") + outputs.labels << small_label(x, 13, "Please click mouse.") + end + end + + # Outputs whether a mouse click occurred inside or outside of a box + def point_to_rect_tech_demo + x = 460 + + outputs.labels << small_label(x, 15, "Click inside the blue box maybe ---->") + + box = [765, 370, 50, 50, 0, 0, 170] # blue box + outputs.borders << box + + if state.last_mouse_click # if the mouse was clicked + if state.last_mouse_click.point.inside_rect? box # if mouse clicked inside box + outputs.labels << small_label(x, 16, "Mouse click happened inside the box.") + else # otherwise, if mouse was clicked outside the box + outputs.labels << small_label(x, 16, "Mouse click happened outside the box.") + end + else # otherwise, if was not clicked at all + outputs.labels << small_label(x, 16, "Mouse click has not occurred yet.") # output if the mouse was not clicked + end + + # border around mouse input demo section + outputs.borders << [455, row_to_px(14), 360, row_to_px(11).shift_up(5) - row_to_px(14)] + end + + # Outputs a red box onto the screen. A mouse click from the user inside of the red box will output + # a smaller box. If two small boxes are inside of the red box, it will be determined whether or not + # they intersect. + def rect_to_rect_tech_demo + x = 460 + + outputs.labels << small_label(x, 17.5, "Click inside the red box below.") # label with instructions + red_box = [460, 250, 355, 90, 170, 0, 0] # definition of the red box + outputs.borders << red_box # output as a border (not filled in) + + # If the mouse is clicked inside the red box, two collision boxes are created. + if inputs.mouse.click + if inputs.mouse.click.point.inside_rect? red_box + if !state.box_collision_one # if the collision_one box does not yet have a definition + # Subtracts 25 from the x and y positions of the click point in order to make the click point the center of the box. + # You can try deleting the subtraction to see how it impacts the box placement. + state.box_collision_one = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 180, 0, 0, 180] # sets definition + elsif !state.box_collision_two # if collision_two does not yet have a definition + state.box_collision_two = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 0, 0, 180, 180] # sets definition + else + state.box_collision_one = nil # both boxes are empty + state.box_collision_two = nil + end + end + end + + # If collision boxes exist, they are output onto screen inside the red box as solids + if state.box_collision_one + outputs.solids << state.box_collision_one + end + + if state.box_collision_two + outputs.solids << state.box_collision_two + end + + # Outputs whether or not the two collision boxes intersect. + if state.box_collision_one && state.box_collision_two # if both collision_boxes are defined (and not nil or empty) + if state.box_collision_one.intersect_rect? state.box_collision_two # if the two boxes intersect + outputs.labels << small_label(x, 23.5, 'The boxes intersect.') + else # otherwise, if the two boxes do not intersect + outputs.labels << small_label(x, 23.5, 'The boxes do not intersect.') + end + else + outputs.labels << small_label(x, 23.5, '--') # if the two boxes are not defined (are nil or empty), this label is output + end + end + + # Creates a button and outputs it onto the screen using labels and borders. + # If the button is clicked, the color changes to make it look faded. + def button_tech_demo + x, y, w, h = 460, 160, 300, 50 + state.button ||= state.new_entity(:button_with_fade) + + # Adds w.half to x and h.half + 10 to y in order to display the text inside the button's borders. + state.button.label ||= [x + w.half, y + h.half + 10, "click me and watch me fade", 0, 1] + state.button.border ||= [x, y, w, h] + + if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.button.border) # if mouse is clicked, and clicked inside button's border + state.button.clicked_at = inputs.mouse.click.created_at # stores the time the click occurred + end + + outputs.labels << state.button.label + outputs.borders << state.button.border + + if state.button.clicked_at # if button was clicked (variable has a value and is not nil) + + # The appearance of the button changes for 0.25 seconds after the time the button is clicked at. + # The color changes (rgb is set to 0, 180, 80) and the transparency gradually changes. + # Change 0.25 to 1.25 and notice that the transparency takes longer to return to normal. + outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.button.clicked_at.ease(0.25.seconds, :flip)] + end + end + + # Creates a new button by declaring it as a new entity, and sets values. + def new_button_prefab x, y, message + w, h = 300, 50 + button = state.new_entity(:button_with_fade) + button.label = [x + w.half, y + h.half + 10, message, 0, 1] # '+ 10' keeps label's text within button's borders + button.border = [x, y, w, h] # sets border definition + button + end + + # If the mouse has been clicked and the click's location is inside of the button's border, that means + # that the button has been clicked. This method returns a boolean value. + def button_clicked? button + inputs.mouse.click && inputs.mouse.click.point.inside_rect?(button.border) + end + + # Determines if button was clicked, and changes its appearance if it is clicked + def tick_button_prefab button + outputs.labels << button.label # outputs button's label and border + outputs.borders << button.border + + if button_clicked? button # if button is clicked + button.clicked_at = inputs.mouse.click.created_at # stores the time that the button was clicked + end + + if button.clicked_at # if clicked_at has a frame value and is not nil + # button is output; color changes and transparency changes for 0.25 seconds after click occurs + outputs.solids << [button.border.x, button.border.y, button.border.w, button.border.h, + 0, 180, 80, 255 * button.clicked_at.ease(0.25.seconds, :flip)] # transparency changes for 0.25 seconds + end + end + + # Exports the app's game state if the export button is clicked. + def export_game_state_demo + state.export_game_state_button ||= new_button_prefab(460, 100, "click to export app state") + tick_button_prefab(state.export_game_state_button) # calls method to output button + if button_clicked? state.export_game_state_button # if the export button is clicked + args.gtk.export! "Exported from clicking the export button in the tech demo." # the export occurs + end + end + + # The mouse and keyboard focus are set to "yes" when the Dragonruby window is the active window. + def window_state_demo + m = $gtk.args.inputs.mouse.has_focus ? 'Y' : 'N' # ternary operator (similar to if statement) + k = $gtk.args.inputs.keyboard.has_focus ? 'Y' : 'N' + outputs.labels << [460, 20, "mouse focus: #{m} keyboard focus: #{k}", small_font] + end + + #Sets values for the horizontal separator (divides demo sections) + def horizontal_seperator y, x, x2 + [x, y, x2, y, 150, 150, 150] + end + + #Sets the values for the vertical separator (divides demo sections) + def vertical_seperator x, y, y2 + [x, y, x, y2, 150, 150, 150] + end + + # Outputs vertical and horizontal separators onto the screen to separate each demo section. + def render_seperators + outputs.lines << horizontal_seperator(505, grid.left, 445) + outputs.lines << horizontal_seperator(353, grid.left, 445) + outputs.lines << horizontal_seperator(264, grid.left, 445) + outputs.lines << horizontal_seperator(174, grid.left, 445) + + outputs.lines << vertical_seperator(445, grid.top, grid.bottom) + + outputs.lines << horizontal_seperator(690, 445, 820) + outputs.lines << horizontal_seperator(426, 445, 820) + + outputs.lines << vertical_seperator(820, grid.top, grid.bottom) + end + end + + $tech_demo = TechDemo.new + + def tick args + $tech_demo.inputs = args.inputs + $tech_demo.state = args.state + $tech_demo.grid = args.grid + $tech_demo.args = args + $tech_demo.outputs = args.render_target(:mini_map) + $tech_demo.tick + args.outputs.labels << [830, 715, "Render target:", [-2, 0, 0, 0, 0, 255]] + args.outputs.sprites << [0, 0, 1280, 720, :mini_map] + args.outputs.sprites << [830, 300, 675, 379, :mini_map] + tick_instructions args, "Sample app shows all the rendering apis available." + 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.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 + +*** Advanced Rendering - Render Primitive Hierarchies - main.rb +#+begin_src ruby + # ./samples/07_advanced_rendering/04_render_primitive_hierarchies/app/main.rb + =begin + + APIs listing that haven't been encountered in previous sample apps: + + - Nested array: An array whose individual elements are also arrays; useful for + storing groups of similar data. Also called multidimensional arrays. + + In this sample app, we see nested arrays being used in object definitions. + Notice the parameters for solids, listed below. Parameters 1-3 set the + definition for the rect, and parameter 4 sets the definition of the color. + + Instead of having a solid definition that looks like this, + [X, Y, W, H, R, G, B] + we can separate it into two separate array definitions in one, like this + [[X, Y, W, H], [R, G, B]] + and both options work fine in defining our solid (or any object). + + - Collections: Lists of data; useful for organizing large amounts of data. + One element of a collection could be an array (which itself contains many elements). + For example, a collection that stores two solid objects would look like this: + [ + [100, 100, 50, 50, 0, 0, 0], + [100, 150, 50, 50, 255, 255, 255] + ] + If this collection was added to args.outputs.solids, two solids would be output + next to each other, one black and one white. + Nested arrays can be used in collections, as you will see in this sample app. + + Reminders: + + - args.outputs.solids: An array. The values generate a solid. + The parameters for a solid are + 1. The position on the screen (x, y) + 2. The width (w) + 3. The height (h) + 4. The color (r, g, b) (if a color is not assigned, the object's default color will be black) + NOTE: THE PARAMETERS ARE THE SAME FOR BORDERS! + + Here is an example of a (red) border or solid definition: + [100, 100, 400, 500, 255, 0, 0] + It will be a solid or border depending on if it is added to args.outputs.solids or args.outputs.borders. + For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md. + + - args.outputs.sprites: An array. The values generate a sprite. + The parameters for sprites are + 1. The position on the screen (x, y) + 2. The width (w) + 3. The height (h) + 4. The image path (p) + + Here is an example of a sprite definition: + [100, 100, 400, 500, 'sprites/dragonruby.png'] + For more information about sprites, go to mygame/documentation/05-sprites.md. + + =end + + # This code demonstrates the creation and output of objects like sprites, borders, and solids + # If filled in, they are solids + # If hollow, they are borders + # If images, they are sprites + + # Solids are added to args.outputs.solids + # Borders are added to args.outputs.borders + # Sprites are added to args.outputs.sprites + + # The tick method runs 60 frames every second. + # Your game is going to happen under this one function. + def tick args + border_as_solid_and_solid_as_border args + sprite_as_border_or_solids args + collection_of_borders_and_solids args + collection_of_sprites args + end + + # Shows a border being output onto the screen as a border and a solid + # Also shows how colors can be set + def border_as_solid_and_solid_as_border args + border = [0, 0, 50, 50] + args.outputs.borders << border + args.outputs.solids << border + + # Red, green, blue saturations (last three parameters) can be any number between 0 and 255 + border_with_color = [0, 100, 50, 50, 255, 0, 0] + args.outputs.borders << border_with_color + args.outputs.solids << border_with_color + + border_with_nested_color = [0, 200, 50, 50, [0, 255, 0]] # nested color + args.outputs.borders << border_with_nested_color + args.outputs.solids << border_with_nested_color + + border_with_nested_rect = [[0, 300, 50, 50], 0, 0, 255] # nested rect + args.outputs.borders << border_with_nested_rect + args.outputs.solids << border_with_nested_rect + + border_with_nested_color_and_rect = [[0, 400, 50, 50], [255, 0, 255]] # nested rect and color + args.outputs.borders << border_with_nested_color_and_rect + args.outputs.solids << border_with_nested_color_and_rect + end + + # Shows a sprite output onto the screen as a sprite, border, and solid + # Demonstrates that all three outputs appear differently on screen + def sprite_as_border_or_solids args + sprite = [100, 0, 50, 50, 'sprites/ship.png'] + args.outputs.sprites << sprite + + # Sprite_as_border variable has same parameters (excluding position) as above object, + # but will appear differently on screen because it is added to args.outputs.borders + sprite_as_border = [100, 100, 50, 50, 'sprites/ship.png'] + args.outputs.borders << sprite_as_border + + # Sprite_as_solid variable has same parameters (excluding position) as above object, + # but will appear differently on screen because it is added to args.outputs.solids + sprite_as_solid = [100, 200, 50, 50, 'sprites/ship.png'] + args.outputs.solids << sprite_as_solid + end + + # Holds and outputs a collection of borders and a collection of solids + # Collections are created by using arrays to hold parameters of each individual object + def collection_of_borders_and_solids args + collection_borders = [ + [ + [200, 0, 50, 50], # black border + [200, 100, 50, 50, 255, 0, 0], # red border + [200, 200, 50, 50, [0, 255, 0]], # nested color + ], + [[200, 300, 50, 50], 0, 0, 255], # nested rect + [[200, 400, 50, 50], [255, 0, 255]] # nested rect and nested color + ] + + args.outputs.borders << collection_borders + + collection_solids = [ + [ + [[300, 300, 50, 50], 0, 0, 255], # nested rect + [[300, 400, 50, 50], [255, 0, 255]] # nested rect and nested color + ], + [300, 0, 50, 50], + [300, 100, 50, 50, 255, 0, 0], + [300, 200, 50, 50, [0, 255, 0]], # nested color + ] + + args.outputs.solids << collection_solids + end + + # Holds and outputs a collection of sprites by adding it to args.outputs.sprites + # Also outputs a collection with same parameters (excluding position) by adding + # it to args.outputs.solids and another to args.outputs.borders + def collection_of_sprites args + sprites_collection = [ + [ + [400, 0, 50, 50, 'sprites/ship.png'], + [400, 100, 50, 50, 'sprites/ship.png'], + ], + [400, 200, 50, 50, 'sprites/ship.png'] + ] + + args.outputs.sprites << sprites_collection + + args.outputs.solids << [ + [500, 0, 50, 50, 'sprites/ship.png'], + [500, 100, 50, 50, 'sprites/ship.png'], + [[[500, 200, 50, 50, 'sprites/ship.png']]] + ] + + args.outputs.borders << [ + [ + [600, 0, 50, 50, 'sprites/ship.png'], + [600, 100, 50, 50, 'sprites/ship.png'], + ], + [600, 200, 50, 50, 'sprites/ship.png'] + ] + end + +#+end_src + +*** Advanced Rendering - Render Primitives As Hash - main.rb +#+begin_src ruby + # ./samples/07_advanced_rendering/05_render_primitives_as_hash/app/main.rb + =begin + + Reminders: + + - Hashes: Collection of unique keys and their corresponding values. The value can be found + using their keys. + + For example, if we have a "numbers" hash that stores numbers in English as the + key and numbers in Spanish as the value, we'd have a hash that looks like this... + numbers = { "one" => "uno", "two" => "dos", "three" => "tres" } + and on it goes. + + Now if we wanted to find the corresponding value of the "one" key, we could say + puts numbers["one"] + which would print "uno" to the console. + + - args.outputs.sprites: An array. The values generate a sprite. + The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE] + For more information about sprites, go to mygame/documentation/05-sprites.md. + + - args.outputs.labels: An array. The values generate a label. + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] + For more information about labels, go to mygame/documentation/02-labels.md. + + - args.outputs.solids: An array. The values generate a solid. + The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] + For more information about solids, go to mygame/documentation/03-solids-and-borders.md. + + - args.outputs.borders: An array. The values generate a border. + The parameters are the same as a solid. + For more information about borders, go to mygame/documentation/03-solids-and-borders.md. + + - args.outputs.lines: An array. The values generate a line. + The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE] + For more information about labels, go to mygame/documentation/02-labels.md. + + =end + + # This sample app demonstrates how hashes can be used to output different kinds of objects. + + def tick args + args.state.angle ||= 0 # initializes angle to 0 + args.state.angle += 1 # increments angle by 1 every frame (60 times a second) + + # Outputs sprite using a hash + args.outputs.sprites << { + x: 30, # sprite position + y: 550, + w: 128, # sprite size + h: 101, + path: "dragonruby.png", # image path + angle: args.state.angle, # angle + a: 255, # alpha (transparency) + r: 255, # color saturation + g: 255, + b: 255, + tile_x: 0, # sprite sub division/tile + tile_y: 0, + tile_w: -1, + tile_h: -1, + flip_vertically: false, # don't flip sprite + flip_horizontally: false, + angle_anchor_x: 0.5, # rotation center set to middle + angle_anchor_y: 0.5 + } + + # Outputs label using a hash + args.outputs.labels << { + x: 200, # label position + y: 550, + text: "dragonruby", # label text + size_enum: 2, + alignment_enum: 1, + r: 155, # color saturation + g: 50, + b: 50, + a: 255, # transparency + font: "fonts/manaspc.ttf" # font style; without mentioned file, label won't output correctly + } + + # Outputs solid using a hash + # [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] + args.outputs.solids << { + x: 400, # position + y: 550, + w: 160, # size + h: 90, + r: 120, # color saturation + g: 50, + b: 50, + a: 255 # transparency + } + + # Outputs border using a hash + # Same parameters as a solid + args.outputs.borders << { + x: 600, + y: 550, + w: 160, + h: 90, + r: 120, + g: 50, + b: 50, + a: 255 + } + + # Outputs line using a hash + args.outputs.lines << { + x: 900, # starting position + y: 550, + x2: 1200, # ending position + y2: 550, + r: 120, # color saturation + g: 50, + b: 50, + a: 255 # transparency + } # Outputs sprite as a primitive using a hash args.outputs.primitives << { @@ -9126,4313 +12604,13556 @@ Follows is a source code listing for all files that have been open sourced. This angle_anchor_y: 0.5 }.sprite - # Outputs label as primitive using a hash - args.outputs.primitives << { - x: 200, # position - y: 200, - text: "dragonruby", # text - size: 2, - alignment: 1, - r: 155, # color saturation - g: 50, - b: 50, - a: 255, # transparency - font: "fonts/manaspc.ttf" # font style - }.label + # Outputs label as primitive using a hash + args.outputs.primitives << { + x: 200, # position + y: 200, + text: "dragonruby", # text + size: 2, + alignment: 1, + r: 155, # color saturation + g: 50, + b: 50, + a: 255, # transparency + font: "fonts/manaspc.ttf" # font style + }.label + + # Outputs solid as primitive using a hash + args.outputs.primitives << { + x: 400, # position + y: 200, + w: 160, # size + h: 90, + r: 120, # color saturation + g: 50, + b: 50, + a: 255 # transparency + }.solid + + # Outputs border as primitive using a hash + # Same parameters as solid + args.outputs.primitives << { + x: 600, # position + y: 200, + w: 160, # size + h: 90, + r: 120, # color saturation + g: 50, + b: 50, + a: 255 # transparency + }.border + + # Outputs line as primitive using a hash + args.outputs.primitives << { + x: 900, # starting position + y: 200, + x2: 1200, # ending position + y2: 200, + r: 120, # color saturation + g: 50, + b: 50, + a: 255 # transparency + }.line + end + +#+end_src + +*** Advanced Rendering - Pixel Arrays - main.rb +#+begin_src ruby + # ./samples/07_advanced_rendering/06_pixel_arrays/app/main.rb + $gtk.reset + + def tick args + args.state.posinc ||= 1 + args.state.pos ||= 0 + args.state.rotation ||= 0 + + dimension = 10 # keep it small and let the GPU scale it when rendering the sprite. + + # Set up our "scanner" pixel array and fill it with black pixels. + args.pixel_array(:scanner).width = dimension + args.pixel_array(:scanner).height = dimension + args.pixel_array(:scanner).pixels.fill(0xFF000000, 0, dimension * dimension) # black, full alpha + + # Draw a green line that bounces up and down the sprite. + args.pixel_array(:scanner).pixels.fill(0xFF00FF00, dimension * args.state.pos, dimension) # green, full alpha + + # Adjust position for next frame. + args.state.pos += args.state.posinc + if args.state.posinc > 0 && args.state.pos >= dimension + args.state.posinc = -1 + args.state.pos = dimension - 1 + elsif args.state.posinc < 0 && args.state.pos < 0 + args.state.posinc = 1 + args.state.pos = 1 + end + + # New/changed pixel arrays get uploaded to the GPU before we render + # anything. At that point, they can be scaled, rotated, and otherwise + # used like any other sprite. + w = 100 + h = 100 + x = (1280 - w) / 2 + y = (720 - h) / 2 + args.outputs.background_color = [64, 0, 128] + args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite + args.state.rotation += 1 + + args.outputs.primitives << args.gtk.current_framerate_primitives + end + + +#+end_src + +*** Advanced Rendering - Splitscreen Camera - main.rb +#+begin_src ruby + # ./samples/07_advanced_rendering/07_splitscreen_camera/app/main.rb + class CameraMovement + attr_accessor :state, :inputs, :outputs, :grid + + #============================================================================================== + #Serialize + def serialize + {state: state, inputs: inputs, outputs: outputs, grid: grid } + end + + def inspect + serialize.to_s + end + + def to_s + serialize.to_s + end + + #============================================================================================== + #Tick + def tick + defaults + calc + render + input + end + + #============================================================================================== + #Default functions + def defaults + outputs[:scene].background_color = [0,0,0] + state.trauma ||= 0.0 + state.trauma_power ||= 2 + state.player_cyan ||= new_player_cyan + state.player_magenta ||= new_player_magenta + state.camera_magenta ||= new_camera_magenta + state.camera_cyan ||= new_camera_cyan + state.camera_center ||= new_camera_center + state.room ||= new_room + end + + def default_player x, y, w, h, sprite_path + state.new_entity(:player, + { x: x, + y: y, + dy: 0, + dx: 0, + w: w, + h: h, + damage: 0, + dead: false, + orientation: "down", + max_alpha: 255, + sprite_path: sprite_path}) + end + + def default_floor_tile x, y, w, h, sprite_path + state.new_entity(:room, + { x: x, + y: y, + w: w, + h: h, + sprite_path: sprite_path}) + end + + def default_camera x, y, w, h + state.new_entity(:camera, + { x: x, + y: y, + dx: 0, + dy: 0, + w: w, + h: h}) + end + + def new_player_cyan + default_player(0, 0, 64, 64, + "sprites/player/player_#{state.player_cyan.orientation}_standing.png") + end + + def new_player_magenta + default_player(64, 0, 64, 64, + "sprites/player/player_#{state.player_magenta.orientation}_standing.png") + end + + def new_camera_magenta + default_camera(0,0,720,720) + end + + def new_camera_cyan + default_camera(0,0,720,720) + end + + def new_camera_center + default_camera(0,0,1280,720) + end + + def new_room + default_floor_tile(0,0,1024,1024,'sprites/rooms/camera_room.png') + end + + #============================================================================================== + #Calculation functions + def calc + calc_camera_magenta + calc_camera_cyan + calc_camera_center + calc_player_cyan + calc_player_magenta + calc_trauma_decay + end + + def center_camera_tolerance + return Math.sqrt(((state.player_magenta.x - state.player_cyan.x) ** 2) + + ((state.player_magenta.y - state.player_cyan.y) ** 2)) > 640 + end + + def calc_player_cyan + state.player_cyan.x += state.player_cyan.dx + state.player_cyan.y += state.player_cyan.dy + end + + def calc_player_magenta + state.player_magenta.x += state.player_magenta.dx + state.player_magenta.y += state.player_magenta.dy + end + + def calc_camera_center + timeScale = 1 + midX = (state.player_magenta.x + state.player_cyan.x)/2 + midY = (state.player_magenta.y + state.player_cyan.y)/2 + targetX = midX - state.camera_center.w/2 + targetY = midY - state.camera_center.h/2 + state.camera_center.x += (targetX - state.camera_center.x) * 0.1 * timeScale + state.camera_center.y += (targetY - state.camera_center.y) * 0.1 * timeScale + end + + + def calc_camera_magenta + timeScale = 1 + targetX = state.player_magenta.x + state.player_magenta.w - state.camera_magenta.w/2 + targetY = state.player_magenta.y + state.player_magenta.h - state.camera_magenta.h/2 + state.camera_magenta.x += (targetX - state.camera_magenta.x) * 0.1 * timeScale + state.camera_magenta.y += (targetY - state.camera_magenta.y) * 0.1 * timeScale + end + + def calc_camera_cyan + timeScale = 1 + targetX = state.player_cyan.x + state.player_cyan.w - state.camera_cyan.w/2 + targetY = state.player_cyan.y + state.player_cyan.h - state.camera_cyan.h/2 + state.camera_cyan.x += (targetX - state.camera_cyan.x) * 0.1 * timeScale + state.camera_cyan.y += (targetY - state.camera_cyan.y) * 0.1 * timeScale + end + + def calc_player_quadrant angle + if angle < 45 and angle > -45 and state.player_cyan.x < state.player_magenta.x + return 1 + elsif angle < 45 and angle > -45 and state.player_cyan.x > state.player_magenta.x + return 3 + elsif (angle > 45 or angle < -45) and state.player_cyan.y < state.player_magenta.y + return 2 + elsif (angle > 45 or angle < -45) and state.player_cyan.y > state.player_magenta.y + return 4 + end + end + + def calc_camera_shake + state.trauma + end + + def calc_trauma_decay + state.trauma = state.trauma * 0.9 + end + + def calc_random_float_range(min, max) + rand * (max-min) + min + end + + #============================================================================================== + #Render Functions + def render + render_floor + render_player_cyan + render_player_magenta + if center_camera_tolerance + render_split_camera_scene + else + render_camera_center_scene + end + end + + def render_player_cyan + outputs[:scene].sprites << {x: state.player_cyan.x, + y: state.player_cyan.y, + w: state.player_cyan.w, + h: state.player_cyan.h, + path: "sprites/player/player_#{state.player_cyan.orientation}_standing.png", + r: 0, + g: 255, + b: 255} + end + + def render_player_magenta + outputs[:scene].sprites << {x: state.player_magenta.x, + y: state.player_magenta.y, + w: state.player_magenta.w, + h: state.player_magenta.h, + path: "sprites/player/player_#{state.player_magenta.orientation}_standing.png", + r: 255, + g: 0, + b: 255} + end + + def render_floor + outputs[:scene].sprites << [state.room.x, state.room.y, + state.room.w, state.room.h, + state.room.sprite_path] + end + + def render_camera_center_scene + zoomFactor = 1 + outputs[:scene].width = state.room.w + outputs[:scene].height = state.room.h + + maxAngle = 10.0 + maxOffset = 20.0 + angle = maxAngle * calc_camera_shake * calc_random_float_range(-1,1) + offsetX = 32 - (maxOffset * calc_camera_shake * calc_random_float_range(-1,1)) + offsetY = 32 - (maxOffset * calc_camera_shake * calc_random_float_range(-1,1)) + + outputs.sprites << {x: (-state.camera_center.x - offsetX)/zoomFactor, + y: (-state.camera_center.y - offsetY)/zoomFactor, + w: outputs[:scene].width/zoomFactor, + h: outputs[:scene].height/zoomFactor, + path: :scene, + angle: angle, + source_w: -1, + source_h: -1} + outputs.labels << [128,64,"#{state.trauma.round(1)}",8,2,255,0,255,255] + end + + def render_split_camera_scene + outputs[:scene].width = state.room.w + outputs[:scene].height = state.room.h + render_camera_magenta_scene + render_camera_cyan_scene + + angle = Math.atan((state.player_magenta.y - state.player_cyan.y)/(state.player_magenta.x- state.player_cyan.x)) * 180/Math::PI + output_split_camera angle + + end + + def render_camera_magenta_scene + zoomFactor = 1 + offsetX = 32 + offsetY = 32 + + outputs[:scene_magenta].sprites << {x: (-state.camera_magenta.x*2), + y: (-state.camera_magenta.y), + w: outputs[:scene].width*2, + h: outputs[:scene].height, + path: :scene} + + end + + def render_camera_cyan_scene + zoomFactor = 1 + offsetX = 32 + offsetY = 32 + outputs[:scene_cyan].sprites << {x: (-state.camera_cyan.x*2), + y: (-state.camera_cyan.y), + w: outputs[:scene].width*2, + h: outputs[:scene].height, + path: :scene} + end + + def output_split_camera angle + #TODO: Clean this up! + quadrant = calc_player_quadrant angle + outputs.labels << [128,64,"#{quadrant}",8,2,255,0,255,255] + if quadrant == 1 + set_camera_attributes(w: 640, h: 720, m_x: 640, m_y: 0, c_x: 0, c_y: 0) + + elsif quadrant == 2 + set_camera_attributes(w: 1280, h: 360, m_x: 0, m_y: 360, c_x: 0, c_y: 0) + + elsif quadrant == 3 + set_camera_attributes(w: 640, h: 720, m_x: 0, m_y: 0, c_x: 640, c_y: 0) + + elsif quadrant == 4 + set_camera_attributes(w: 1280, h: 360, m_x: 0, m_y: 0, c_x: 0, c_y: 360) + + end + end + + def set_camera_attributes(w: 0, h: 0, m_x: 0, m_y: 0, c_x: 0, c_y: 0) + state.camera_cyan.w = w + 64 + state.camera_cyan.h = h + 64 + outputs[:scene_cyan].width = (w) * 2 + outputs[:scene_cyan].height = h + + state.camera_magenta.w = w + 64 + state.camera_magenta.h = h + 64 + outputs[:scene_magenta].width = (w) * 2 + outputs[:scene_magenta].height = h + outputs.sprites << {x: m_x, + y: m_y, + w: w, + h: h, + path: :scene_magenta} + outputs.sprites << {x: c_x, + y: c_y, + w: w, + h: h, + path: :scene_cyan} + end + + def add_trauma amount + state.trauma = [state.trauma + amount, 1.0].min + end + + def remove_trauma amount + state.trauma = [state.trauma - amount, 0.0].max + end + #============================================================================================== + #Input functions + def input + input_move_cyan + input_move_magenta + + if inputs.keyboard.key_down.t + add_trauma(0.5) + elsif inputs.keyboard.key_down.y + remove_trauma(0.1) + end + end + + def input_move_cyan + if inputs.keyboard.key_held.up + state.player_cyan.dy = 5 + state.player_cyan.orientation = "up" + elsif inputs.keyboard.key_held.down + state.player_cyan.dy = -5 + state.player_cyan.orientation = "down" + else + state.player_cyan.dy *= 0.8 + end + if inputs.keyboard.key_held.left + state.player_cyan.dx = -5 + state.player_cyan.orientation = "left" + elsif inputs.keyboard.key_held.right + state.player_cyan.dx = 5 + state.player_cyan.orientation = "right" + else + state.player_cyan.dx *= 0.8 + end + + outputs.labels << [128,512,"#{state.player_cyan.x.round()}",8,2,0,255,255,255] + outputs.labels << [128,480,"#{state.player_cyan.y.round()}",8,2,0,255,255,255] + end + + def input_move_magenta + if inputs.keyboard.key_held.w + state.player_magenta.dy = 5 + state.player_magenta.orientation = "up" + elsif inputs.keyboard.key_held.s + state.player_magenta.dy = -5 + state.player_magenta.orientation = "down" + else + state.player_magenta.dy *= 0.8 + end + if inputs.keyboard.key_held.a + state.player_magenta.dx = -5 + state.player_magenta.orientation = "left" + elsif inputs.keyboard.key_held.d + state.player_magenta.dx = 5 + state.player_magenta.orientation = "right" + else + state.player_magenta.dx *= 0.8 + end + + outputs.labels << [128,360,"#{state.player_magenta.x.round()}",8,2,255,0,255,255] + outputs.labels << [128,328,"#{state.player_magenta.y.round()}",8,2,255,0,255,255] + end + end + + $camera_movement = CameraMovement.new + + def tick args + args.outputs.background_color = [0,0,0] + $camera_movement.inputs = args.inputs + $camera_movement.outputs = args.outputs + $camera_movement.state = args.state + $camera_movement.grid = args.grid + $camera_movement.tick + end + +#+end_src + +*** Advanced Rendering - Z Targeting Camera - main.rb +#+begin_src ruby + # ./samples/07_advanced_rendering/08_z_targeting_camera/app/main.rb + class Game + attr_gtk + + def tick + defaults + render + input + calc + end + + def defaults + outputs.background_color = [219, 208, 191] + player.x ||= 634 + player.y ||= 153 + player.angle ||= 90 + player.distance ||= arena_radius + target.x ||= 634 + target.y ||= 359 + end + + def render + outputs[:scene].sprites << ([0, 0, 933, 700, 'sprites/arena.png'].center_inside_rect grid.rect) + outputs[:scene].sprites << target_sprite + outputs[:scene].sprites << player_sprite + outputs.sprites << scene + end + + def target_sprite + { + x: target.x, y: target.y, + w: 10, h: 10, + path: 'sprites/square/black.png' + }.anchor_rect 0.5, 0.5 + end + + def input + if inputs.up && player.distance > 30 + player.distance -= 2 + elsif inputs.down && player.distance < 200 + player.distance += 2 + end + + player.angle += inputs.left_right * -1 + end + + def calc + player.x = target.x + ((player.angle * 1).vector_x player.distance) + player.y = target.y + ((player.angle * -1).vector_y player.distance) + end + + def player_sprite + { + x: player.x, + y: player.y, + w: 50, + h: 100, + path: 'sprites/player.png', + angle: (player.angle * -1) + 90 + }.anchor_rect 0.5, 0 + end + + def center_map + { x: 634, y: 359 } + end + + def zoom_factor_single + 2 - ((args.geometry.distance player, center_map).fdiv arena_radius) + end + + def zoom_factor + zoom_factor_single ** 2 + end + + def arena_radius + 206 + end + + def scene + { + x: (640 - player.x) + (640 - (640 * zoom_factor)), + y: (360 - player.y - (75 * zoom_factor)) + (320 - (320 * zoom_factor)), + w: 1280 * zoom_factor, + h: 720 * zoom_factor, + path: :scene, + angle: player.angle - 90, + angle_anchor_x: (player.x.fdiv 1280), + angle_anchor_y: (player.y.fdiv 720) + } + end + + def player + state.player + end + + def target + state.target + end + end + + def tick args + $game ||= Game.new + $game.args = args + $game.tick + end + + $gtk.reset + +#+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 + def tick args + # STOP! Watch the following presentation first!!!! + # Math for Game Programmers: Fast and Funky 1D Nonlinear Transformations + # https://www.youtube.com/watch?v=mr5xkf6zSzk + + # You've watched the talk, yes? YES??? + + # define starting and ending points of properties to animate + args.state.target_x = 1180 + args.state.target_y = 620 + args.state.target_w = 100 + args.state.target_h = 100 + args.state.starting_x = 0 + args.state.starting_y = 0 + args.state.starting_w = 300 + args.state.starting_h = 300 + + # define start time and duration of animation + args.state.start_animate_at = 3.seconds # this is the same as writing 60 * 5 (or 300) + args.state.duration = 2.seconds # this is the same as writing 60 * 2 (or 120) + + # define type of animations + # Here are all the options you have for values you can put in the array: + # :identity, :quad, :cube, :quart, :quint, :flip + + # Linear is defined as: + # [:identity] + # + # Smooth start variations are: + # [:quad] + # [:cube] + # [:quart] + # [:quint] + + # Linear reversed, and smooth stop are the same as the animations defined above, but reversed: + # [:flip, :identity] + # [:flip, :quad, :flip] + # [:flip, :cube, :flip] + # [:flip, :quart, :flip] + # [:flip, :quint, :flip] + + # You can also do custom definitions. See the bottom of the file details + # on how to do that. I've defined a couple for you: + # [:smoothest_start] + # [:smoothest_stop] + + # CHANGE THIS LINE TO ONE OF THE LINES ABOVE TO SEE VARIATIONS + args.state.animation_type = [:identity] + # args.state.animation_type = [:quad] + # args.state.animation_type = [:cube] + # args.state.animation_type = [:quart] + # args.state.animation_type = [:quint] + # args.state.animation_type = [:flip, :identity] + # args.state.animation_type = [:flip, :quad, :flip] + # args.state.animation_type = [:flip, :cube, :flip] + # args.state.animation_type = [:flip, :quart, :flip] + # args.state.animation_type = [:flip, :quint, :flip] + # args.state.animation_type = [:smoothest_start] + # args.state.animation_type = [:smoothest_stop] + + # THIS IS WHERE THE MAGIC HAPPENS! + # Numeric#ease + progress = args.state.start_animate_at.ease(args.state.duration, args.state.animation_type) + + # Numeric#ease needs to called: + # 1. On the number that represents the point in time you want to start, and takes two parameters: + # a. The first parameter is how long the animation should take. + # b. The second parameter represents the functions that need to be called. + # + # For example, if I wanted an animate to start 3 seconds in, and last for 10 seconds, + # and I want to animation to start fast and end slow, I would do: + # (60 * 3).ease(60 * 10, :flip, :quint, :flip) + + # initial value delta to the final value + calc_x = args.state.starting_x + (args.state.target_x - args.state.starting_x) * progress + calc_y = args.state.starting_y + (args.state.target_y - args.state.starting_y) * progress + calc_w = args.state.starting_w + (args.state.target_w - args.state.starting_w) * progress + calc_h = args.state.starting_h + (args.state.target_h - args.state.starting_h) * progress + + args.outputs.solids << [calc_x, calc_y, calc_w, calc_h, 0, 0, 0] + + # count down + count_down = args.state.start_animate_at - args.state.tick_count + if count_down > 0 + args.outputs.labels << [640, 375, "Running: #{args.state.animation_type} in...", 3, 1] + args.outputs.labels << [640, 345, "%.2f" % count_down.fdiv(60), 3, 1] + elsif progress >= 1 + args.outputs.labels << [640, 360, "Click screen to reset.", 3, 1] + if args.inputs.click + $gtk.reset + end + end + end + + # $gtk.reset + + # you can make own variations of animations using this + module Easing + # you have access to all the built in functions: identity, flip, quad, cube, quart, quint + def self.smoothest_start x + quad(quint(x)) + end + + def self.smoothest_stop x + flip(quad(quint(flip(x)))) + end + + # this is the source for the existing easing functions + def self.identity x + x + end + + def self.flip x + 1 - x + end + + def self.quad x + x * x + end + + def self.cube x + x * x * x + end + + def self.quart x + x * x * x * x * x + end + + def self.quint x + x * x * x * x * x * x + end + end + +#+end_src + +*** Tweening Lerping Easing Functions - Cubic Bezier - main.rb +#+begin_src ruby + # ./samples/08_tweening_lerping_easing_functions/02_cubic_bezier/app/main.rb + def tick args + args.outputs.background_color = [33, 33, 33] + args.outputs.lines << bezier(100, 100, + 100, 620, + 1180, 620, + 1180, 100, + 0) + + args.outputs.lines << bezier(100, 100, + 100, 620, + 1180, 620, + 1180, 100, + 20) + end + + + def bezier x1, y1, x2, y2, x3, y3, x4, y4, step + step ||= 0 + color = [200, 200, 200] + points = points_for_bezier [x1, y1], [x2, y2], [x3, y3], [x4, y4], step + + points.each_cons(2).map do |p1, p2| + [p1, p2, color] + end + end + + def points_for_bezier p1, p2, p3, p4, step + points = [] + if step == 0 + [p1, p2, p3, p4] + else + t_step = 1.fdiv(step + 1) + t = 0 + t += t_step + points = [] + while t < 1 + points << [ + b_for_t(p1.x, p2.x, p3.x, p4.x, t), + b_for_t(p1.y, p2.y, p3.y, p4.y, t), + ] + t += t_step + end + + [ + p1, + *points, + p4 + ] + end + end + + def b_for_t v0, v1, v2, v3, t + pow(1 - t, 3) * v0 + + 3 * pow(1 - t, 2) * t * v1 + + 3 * (1 - t) * pow(t, 2) * v2 + + pow(t, 3) * v3 + end + + def pow n, to + n ** to + end + +#+end_src + +*** Tweening Lerping Easing Functions - Easing Using Spline - main.rb +#+begin_src ruby + # ./samples/08_tweening_lerping_easing_functions/03_easing_using_spline/app/main.rb + def tick args + args.state.duration = 10.seconds + args.state.spline = [ + [0.0, 0.33, 0.66, 1.0], + [1.0, 1.0, 1.0, 1.0], + [1.0, 0.66, 0.33, 0.0], + ] + + args.state.simulation_tick = args.state.tick_count % args.state.duration + progress = 0.ease_spline_extended args.state.simulation_tick, args.state.duration, args.state.spline + args.outputs.borders << args.grid.rect + args.outputs.solids << [20 + 1240 * progress, + 20 + 680 * progress, + 20, 20].anchor_rect(0.5, 0.5) + args.outputs.labels << [10, + 710, + "perc: #{"%.2f" % (args.state.simulation_tick / args.state.duration)} t: #{args.state.simulation_tick}"] + end + +#+end_src + +*** Tweening Lerping Easing Functions - Parametric Enemy Movement - main.rb +#+begin_src ruby + # ./samples/08_tweening_lerping_easing_functions/04_parametric_enemy_movement/app/main.rb + def new_star args + { x: 1280.randomize(:ratio), + starting_y: 800, + distance_to_travel: 900 + 100.randomize(:ratio), + duration: 100.randomize(:ratio) + 60, + created_at: args.state.tick_count, + max_alpha: 128.randomize(:ratio) + 128, + b: 255.randomize(:ratio), + g: 200.randomize(:ratio), + w: 1.randomize(:ratio) + 1, + h: 1.randomize(:ratio) + 1 } + end + + def new_enemy args + { x: 1280.randomize(:ratio), + starting_y: 800, + distance_to_travel: -900, + duration: 60.randomize(:ratio) + 180, + created_at: args.state.tick_count, + w: 32, + h: 32, + fire_rate: (30.randomize(:ratio) + (60 - args.state.score)).to_i } + end + + def new_bullet args, starting_x, starting_y, enemy_speed + { x: starting_x, + starting_y: starting_y, + distance_to_travel: -900, + created_at: args.state.tick_count, + duration: 900 / (enemy_speed.abs + 2.0 + (5.0 * args.state.score.fdiv(100))).abs, + w: 5, + h: 5 } + end + + def new_player_bullet args, starting_x, starting_y, player_speed + { x: starting_x, + starting_y: starting_y, + distance_to_travel: 900, + created_at: args.state.tick_count, + duration: 900 / (player_speed + 2.0), + w: 5, + h: 5 } + end + + def defaults args + args.outputs.background_color = [0, 0, 0] + args.state.score ||= 0 + args.state.stars ||= [] + args.state.enemies ||= [] + args.state.bullets ||= [] + args.state.player_bullets ||= [] + args.state.max_stars = 50 + args.state.max_enemies = 10 + args.state.player.x ||= 640 + args.state.player.y ||= 100 + args.state.player.w ||= 32 + args.state.player.h ||= 32 + + if args.state.tick_count == 0 + args.state.stars.clear + args.state.max_stars.times do + s = new_star args + s[:created_at] += s[:duration].randomize(:ratio) + args.state.stars << s + end + end + + if args.state.tick_count == 0 + args.state.enemies.clear + args.state.max_enemies.times do + s = new_enemy args + s[:created_at] += s[:duration].randomize(:ratio) + args.state.enemies << s + end + end + end + + def input args + if args.inputs.keyboard.left + args.state.player.x -= 5 + elsif args.inputs.keyboard.right + args.state.player.x += 5 + end + + if args.inputs.keyboard.up + args.state.player.y += 5 + elsif args.inputs.keyboard.down + args.state.player.y -= 5 + end + + if args.inputs.keyboard.key_down.space + args.state.player_bullets << new_player_bullet(args, + args.state.player.x + args.state.player.w.half, + args.state.player.y + args.state.player.h, 5) + end + + args.state.player.y = args.state.player.y.greater(0).lesser(720 - args.state.player.w) + args.state.player.x = args.state.player.x.greater(0).lesser(1280 - args.state.player.h) + end + + def completed? entity + (entity[:created_at] + entity[:duration]).elapsed_time > 0 + end + + def calc_stars args + if (stars_to_add = args.state.max_stars - args.state.stars.length) > 0 + stars_to_add.times { args.state.stars << new_star(args) } + end + args.state.stars = args.state.stars.reject { |s| completed? s } + end + + def move_enemies args + if (enemies_to_add = args.state.max_enemies - args.state.enemies.length) > 0 + enemies_to_add.times { args.state.enemies << new_enemy(args) } + end + + args.state.enemies = args.state.enemies.reject { |s| completed? s } + end + + def move_bullets args + args.state.enemies.each do |e| + if args.state.tick_count.mod_zero?(e[:fire_rate]) + args.state.bullets << new_bullet(args, e[:x] + e[:w].half, current_y(e), e[:distance_to_travel] / e[:duration]) + end + end + + args.state.bullets = args.state.bullets.reject { |s| completed? s } + args.state.player_bullets = args.state.player_bullets.reject { |s| completed? s } + end + + def intersect? entity_one, entity_two + entity_one.merge(y: current_y(entity_one)) + .intersect_rect? entity_two.merge(y: current_y(entity_two)) + end + + def kill args + bullets_hitting_enemies = [] + dead_bullets = [] + dead_enemies = [] + + args.state.player_bullets.each do |b| + args.state.enemies.each do |e| + if intersect? b, e + dead_bullets << b + dead_enemies << e + end + end + end + + args.state.score += dead_enemies.length + + args.state.player_bullets.reject! { |b| dead_bullets.include? b } + args.state.enemies.reject! { |e| dead_enemies.include? e } + + dead = args.state.bullets.any? do |b| + [args.state.player.x, + args.state.player.y, + args.state.player.w, + args.state.player.h].intersect_rect? b.merge(y: current_y(b)) + end + return unless dead + args.gtk.reset + defaults args + end + + def calc args + calc_stars args + move_enemies args + move_bullets args + kill args + end + + def current_y entity + entity[:starting_y] + (entity[:distance_to_travel] * entity[:created_at].ease(entity[:duration], :identity)) + end + + def render args + args.outputs.solids << args.state.stars.map do |s| + [s[:x], + current_y(s), + s[:w], s[:h], 0, s[:g], s[:b], s[:max_alpha] * s[:created_at].ease(20, :identity)] + end + + args.outputs.borders << args.state.enemies.map do |s| + [s[:x], + current_y(s), + s[:w], s[:h], 255, 0, 0] + end + + args.outputs.borders << args.state.bullets.map do |b| + [b[:x], + current_y(b), + b[:w], b[:h], 255, 0, 0] + end + + args.outputs.borders << args.state.player_bullets.map do |b| + [b[:x], + current_y(b), + b[:w], b[:h], 255, 255, 255] + end + + args.borders << [args.state.player.x, + args.state.player.y, + args.state.player.w, + args.state.player.h, 255, 255, 255] + end + + def tick args + defaults args + input args + calc args + render args + end + +#+end_src + +*** Performance - Sprites As Hash - main.rb +#+begin_src ruby + # ./samples/09_performance/01_sprites_as_hash/app/main.rb + + # Sprites represented as Hashes using the queue ~args.outputs.sprites~ + # code up, but are the "slowest" to render. + # The reason for this is the access of the key in the Hash and also + # because the data args.outputs.sprites is cleared every tick. + def random_x args + (args.grid.w.randomize :ratio) * -1 + end + + def random_y args + (args.grid.h.randomize :ratio) * -1 + end + + def random_speed + 1 + (4.randomize :ratio) + end + + def new_star args + { + x: (random_x args), + y: (random_y args), + w: 4, h: 4, path: 'sprites/tiny-star.png', + s: random_speed + } + end + + def move_star args, star + star.x += star[:s] + star.y += star[:s] + if star.x > args.grid.w || star.y > args.grid.h + star.x = (random_x args) + star.y = (random_y args) + star[:s] = random_speed + end + end + + def tick args + args.state.star_count ||= 0 + + # sets console command when sample app initially opens + if Kernel.global_tick_count == 0 + puts "* INFO - Please specify the number of sprites to render." + args.gtk.console.set_command "reset_with count: 100" + end + + # init + if args.state.tick_count == 0 + args.state.stars = args.state.star_count.map { |i| new_star args } + end + + # update + args.state.stars.each { |s| move_star args, s } + + # render + args.outputs.sprites << args.state.stars + args.outputs.background_color = [0, 0, 0] + args.outputs.primitives << args.gtk.current_framerate_primitives + end + + # resets game, and assigns star count given by user + def reset_with count: count + $gtk.reset + $gtk.args.state.star_count = count + end + +#+end_src + +*** Performance - Sprites As Entities - main.rb +#+begin_src 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. + # The hash sample has to use star[:s] to get the speed of the star, but + # an entity can use .s instead. + def random_x args + (args.grid.w.randomize :ratio) * -1 + end + + def random_y args + (args.grid.h.randomize :ratio) * -1 + end + + def random_speed + 1 + (4.randomize :ratio) + end + + def new_star args + args.state.new_entity :star, { + x: (random_x args), + y: (random_y args), + w: 4, h: 4, + path: 'sprites/tiny-star.png', + s: random_speed + } + end + + def move_star args, star + star.x += star.s + star.y += star.s + if star.x > args.grid.w || star.y > args.grid.h + star.x = (random_x args) + star.y = (random_y args) + star.s = random_speed + end + end + + def tick args + args.state.star_count ||= 0 + + # sets console command when sample app initially opens + if Kernel.global_tick_count == 0 + puts "* INFO - Please specify the number of sprites to render." + args.gtk.console.set_command "reset_with count: 100" + end + + # init + if args.state.tick_count == 0 + args.state.stars = args.state.star_count.map { |i| new_star args } + end + + # update + args.state.stars.each { |s| move_star args, s } + + # render + args.outputs.sprites << args.state.stars + args.outputs.background_color = [0, 0, 0] + args.outputs.primitives << args.gtk.current_framerate_primitives + end + + # resets game, and assigns star count given by user + def reset_with count: count + $gtk.reset + $gtk.args.state.star_count = count + end + +#+end_src + +*** Performance - Sprites As Strict Entities - main.rb +#+begin_src ruby + # ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb + # Sprites represented as StrictEntities using the queue ~args.outputs.sprites~ + # yields apis access similar to Entities, but all properties that can be set on the + # entity must be predefined with a default value. Strict entities do not support the + # addition of new properties after the fact. They are more performant than OpenEntities + # because of this constraint. + def random_x args + (args.grid.w.randomize :ratio) * -1 + end + + def random_y args + (args.grid.h.randomize :ratio) * -1 + end + + def random_speed + 1 + (4.randomize :ratio) + end + + def new_star args + args.state.new_entity_strict(:star, + x: (random_x args), + y: (random_y args), + w: 4, h: 4, + path: 'sprites/tiny-star.png', + s: random_speed) do |entity| + # invoke attr_sprite so that it responds to + # all properties that are required to render a sprite + entity.attr_sprite + end + end + + def move_star args, star + star.x += star.s + star.y += star.s + if star.x > args.grid.w || star.y > args.grid.h + star.x = (random_x args) + star.y = (random_y args) + star.s = random_speed + end + end + + def tick args + args.state.star_count ||= 0 + + # sets console command when sample app initially opens + if Kernel.global_tick_count == 0 + puts "* INFO - Please specify the number of sprites to render." + args.gtk.console.set_command "reset_with count: 100" + end + + # init + if args.state.tick_count == 0 + args.state.stars = args.state.star_count.map { |i| new_star args } + end + + # update + args.state.stars.each { |s| move_star args, s } + + # render + args.outputs.sprites << args.state.stars + args.outputs.background_color = [0, 0, 0] + args.outputs.primitives << args.gtk.current_framerate_primitives + end + + # resets game, and assigns star count given by user + def reset_with count: count + $gtk.reset + $gtk.args.state.star_count = count + end + +#+end_src + +*** Performance - Sprites As Classes - main.rb +#+begin_src 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. + # They are more performant than OpenEntities and StrictEntities, but more code upfront. + class Star + attr_sprite + + def initialize grid + @grid = grid + @x = (rand @grid.w) * -1 + @y = (rand @grid.h) * -1 + @w = 4 + @h = 4 + @s = 1 + (4.randomize :ratio) + @path = 'sprites/tiny-star.png' + end + + def move + @x += @s + @y += @s + @x = (rand @grid.w) * -1 if @x > @grid.right + @y = (rand @grid.h) * -1 if @y > @grid.top + end + end + + # calls methods needed for game to run properly + def tick args + # sets console command when sample app initially opens + if Kernel.global_tick_count == 0 + 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 } + 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 + + # resets game, and assigns star count given by user + def reset_with count: count + $gtk.reset + $gtk.args.state.star_count = count + end + +#+end_src + +*** Performance - Static Sprites As Classes - main.rb +#+begin_src 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 + # by reference. You get better performance, but you are mutating state of held objects + # which is less functional/data oriented. + class Star + attr_sprite + + def initialize grid + @grid = grid + @x = (rand @grid.w) * -1 + @y = (rand @grid.h) * -1 + @w = 4 + @h = 4 + @s = 1 + (4.randomize :ratio) + @path = 'sprites/tiny-star.png' + end + + def move + @x += @s + @y += @s + @x = (rand @grid.w) * -1 if @x > @grid.right + @y = (rand @grid.h) * -1 if @y > @grid.top + end + end + + # calls methods needed for game to run properly + def tick args + # sets console command when sample app initially opens + if Kernel.global_tick_count == 0 + 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 } + 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 + + # resets game, and assigns star count given by user + def reset_with count: count + $gtk.reset + $gtk.args.state.star_count = count + end + +#+end_src + +*** Performance - Static Sprites As Classes With Custom Drawing - main.rb +#+begin_src ruby + # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb + # Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~. + # is the fastest approach. This is comparable to what other game engines set as the default behavior. + # There are tradeoffs for all this speed if the creation of a full blown class, and bypassing + # functional/data-oriented practices. + class Star + def initialize grid + @grid = grid + @x = (rand @grid.w) * -1 + @y = (rand @grid.h) * -1 + @w = 4 + @h = 4 + @s = 1 + (4.randomize :ratio) + @path = 'sprites/tiny-star.png' + end + + def move + @x += @s + @y += @s + @x = (rand @grid.w) * -1 if @x > @grid.right + @y = (rand @grid.h) * -1 if @y > @grid.top + end + + # if the object that is in args.outputs.sprites (or static_sprites) + # respond_to? :draw_override, then the method is invoked giving you + # access to the class used to draw to the canvas. + def draw_override ffi_draw + # first move then draw + move + + # The argument order for ffi.draw_sprite is: + # x, y, w, h, path + ffi_draw.draw_sprite @x, @y, @w, @h, @path + + # The argument order for ffi_draw.draw_sprite_2 is (pass in nil for default value): + # x, y, w, h, path, + # angle, alpha + + # The argument order for ffi_draw.draw_sprite_3 is: + # x, y, w, h, + # path, + # angle, + # alpha, red_saturation, green_saturation, blue_saturation + # 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 + end + end + + # calls methods needed for game to run properly + def tick args + # sets console command when sample app initially opens + if Kernel.global_tick_count == 0 + 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 + + # render framerate + args.outputs.background_color = [0, 0, 0] + args.outputs.primitives << args.gtk.current_framerate_primitives + end + + # resets game, and assigns star count given by user + def reset_with count: count + $gtk.reset + $gtk.args.state.star_count = count + end + +#+end_src + +*** Performance - Collision Limits - main.rb +#+begin_src ruby + # ./samples/09_performance/07_collision_limits/app/main.rb + =begin + + Reminders: + - find_all: Finds all elements of a collection that meet certain requirements. + In this sample app, we're finding all bodies that intersect with the center body. + + - args.outputs.solids: An array. The values generate a solid. + The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE] + For more information about solids, go to mygame/documentation/03-solids-and-borders.md. + + - args.outputs.labels: An array. The values generate a label. + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] + For more information about labels, go to mygame/documentation/02-labels.md. + + - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect. + + =end + + # This code demonstrates moving objects that loop around once they exceed the scope of the screen, + # which has dimensions of 1280 by 720, and also detects collisions between objects called "bodies". + + def body_count num + $gtk.args.state.other_bodies = num.map { [1280 * rand, 720 * rand, 10, 10] } # other_bodies set using num collection + end + + def tick args + + # Center body's values are set using an array + # Map is used to set values of 2000 other bodies + # All bodies that intersect with center body are stored in collisions collection + args.state.center_body ||= [640 - 100, 360 - 100, 200, 200] # calculations done to place body in center + args.state.other_bodies ||= 2000.map { [1280 * rand, 720 * rand, 10, 10] } # 2000 bodies given random position on screen + + # finds all bodies that intersect with center body, stores them in collisions + collisions = args.state.other_bodies.find_all { |b| b.intersect_rect? args.state.center_body } + + args.borders << args.state.center_body # outputs center body as a black border + + # transparency changes based on number of collisions; the more collisions, the redder (more transparent) the box becomes + args.solids << [args.state.center_body, 255, 0, 0, collisions.length * 5] # center body is red solid + args.solids << args.state.other_bodies # other bodies are output as (black) solids, as well + + args.labels << [10, 30, args.gtk.current_framerate] # outputs frame rate in bottom left corner + + # Bodies are returned to bottom left corner if positions exceed scope of screen + args.state.other_bodies.each do |b| # for each body in the other_bodies collection + b.x += 5 # x and y are both incremented by 5 + b.y += 5 + b.x = 0 if b.x > 1280 # x becomes 0 if star exceeds scope of screen (goes too far right) + b.y = 0 if b.y > 720 # y becomes 0 if star exceeds scope of screen (goes too far up) + end + end + + # Resets the game. + $gtk.reset + +#+end_src + +*** Advanced Debugging - Trace Debugging - main.rb +#+begin_src ruby + # ./samples/10_advanced_debugging/01_trace_debugging/app/main.rb + class Game + attr_gtk + + def method1 num + method2 num + end + + def method2 num + method3 num + end + + def method3 num + method4 num + end + + def method4 num + if num == 1 + puts "UNLUCKY #{num}." + state.unlucky_count += 1 + if state.unlucky_count > 3 + raise "NAT 1 finally occurred. Check app/trace.txt for all method invocation history." + end + else + puts "LUCKY #{num}." + end + end + + def tick + state.roll_history ||= [] + state.roll_history << rand(20) + 1 + state.countdown ||= 600 + state.countdown -= 1 + state.unlucky_count ||= 0 + outputs.labels << [640, 360, "A dice roll of 1 will cause an exception.", 0, 1] + if state.countdown > 0 + outputs.labels << [640, 340, "Dice roll countdown: #{state.countdown}", 0, 1] + else + state.attempts ||= 0 + state.attempts += 1 + outputs.labels << [640, 340, "ROLLING! #{state.attempts}", 0, 1] + end + return if state.countdown > 0 + method1 state.roll_history[-1] + end + end + + $game = Game.new + + def tick args + trace! $game # <------------------- TRACING ENABLED FOR THIS OBJECT + $game.args = args + $game.tick + end + +#+end_src + +*** Advanced Debugging - Trace Debugging Classes - main.rb +#+begin_src ruby + # ./samples/10_advanced_debugging/02_trace_debugging_classes/app/main.rb + class Foobar + def initialize + trace! # Trace is added to the constructor. + end + + def clicky args + return unless args.inputs.mouse.click + try_rand rand + end + + def try_rand num + return if num < 0.9 + raise "Exception finally occurred. Take a look at logs/trace.txt #{num}." + end + end + + def tick args + args.labels << [640, 360, "Start clicking. Eventually an exception will be thrown. Then look at logs/trace.txt.", 0, 1] + args.state.foobar = Foobar.new if args.tick_count + return unless args.state.foobar + args.state.foobar.clicky args + 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 + begin :shared + class ExceptionalClass + def initialize exception_to_throw = nil + raise exception_to_throw if exception_to_throw + end + end + end + + def test_exception_in_newing_object args, assert + begin + ExceptionalClass.new TypeError + raise "Exception wasn't thrown!" + rescue Exception => e + assert.equal! e.class, TypeError, "Exceptions within constructor should be retained." + end + end + + $gtk.reset 100 + $gtk.log_level = :off + +#+end_src + +*** Advanced Debugging - Unit Tests - fn_tests.rb +#+begin_src ruby + # ./samples/10_advanced_debugging/03_unit_tests/fn_tests.rb + def infinity + 1 / 0 + end + + def neg_infinity + -1 / 0 + end + + def nan + 0.0 / 0 + end + + def test_add args, assert + assert.equal! (args.fn.add), 0 + assert.equal! (args.fn.+), 0 + assert.equal! (args.fn.+ 1, 2, 3), 6 + assert.equal! (args.fn.+ 0), 0 + assert.equal! (args.fn.+ 0, nil), 0 + assert.equal! (args.fn.+ 0, nan), nil + assert.equal! (args.fn.+ 0, nil, infinity), nil + assert.equal! (args.fn.+ [1, 2, 3, [4, 5, 6]]), 21 + assert.equal! (args.fn.+ [nil, [4, 5, 6]]), 15 + end + + def test_sub args, assert + neg_infinity = infinity * -1 + assert.equal! (args.fn.+), 0 + assert.equal! (args.fn.- 1, 2, 3), -4 + assert.equal! (args.fn.- 4), -4 + assert.equal! (args.fn.- 4, nan), nil + assert.equal! (args.fn.- 0, nil), 0 + assert.equal! (args.fn.- 0, nil, infinity), nil + assert.equal! (args.fn.- [0, 1, 2, 3, [4, 5, 6]]), -21 + assert.equal! (args.fn.- [nil, 0, [4, 5, 6]]), -15 + end + + def test_div args, assert + assert.equal! (args.fn.div), 1 + assert.equal! (args.fn./), 1 + assert.equal! (args.fn./ 6, 3), 2 + assert.equal! (args.fn./ 6, infinity), nil + assert.equal! (args.fn./ 6, nan), nil + assert.equal! (args.fn./ infinity), nil + assert.equal! (args.fn./ 0), nil + assert.equal! (args.fn./ 6, [3]), 2 + end + + def test_idiv args, assert + assert.equal! (args.fn.idiv), 1 + assert.equal! (args.fn.idiv 7, 3), 2 + assert.equal! (args.fn.idiv 6, infinity), nil + assert.equal! (args.fn.idiv 6, nan), nil + assert.equal! (args.fn.idiv infinity), nil + assert.equal! (args.fn.idiv 0), nil + assert.equal! (args.fn.idiv 7, [3]), 2 + end + + def test_mul args, assert + assert.equal! (args.fn.mul), 1 + assert.equal! (args.fn.*), 1 + assert.equal! (args.fn.* 7, 3), 21 + assert.equal! (args.fn.* 6, nan), nil + assert.equal! (args.fn.* 6, infinity), nil + assert.equal! (args.fn.* infinity), nil + assert.equal! (args.fn.* 0), 0 + assert.equal! (args.fn.* 7, [3]), 21 + end + + def test_lt args, assert + assert.equal! (args.fn.lt 1), 1 + assert.equal! (args.fn.lt), nil + assert.equal! (args.fn.lt infinity), nil + assert.equal! (args.fn.lt nan), nil + assert.equal! (args.fn.lt 10, 9, 8), 8 + assert.equal! (args.fn.< 10, 9, 8), 8 + assert.equal! (args.fn.< [10, 9, [8]]), 8 + assert.equal! (args.fn.< 10, 10), nil + end + + def test_lte args, assert + assert.equal! (args.fn.lte 1), 1 + assert.equal! (args.fn.lte), nil + assert.equal! (args.fn.lte infinity), nil + assert.equal! (args.fn.lte nan), nil + assert.equal! (args.fn.lte 10, 9, 8), 8 + assert.equal! (args.fn.lte 10, 10), 10 + assert.equal! (args.fn.lte 10, 9, [8]), 8 + assert.equal! (args.fn.<= 10, 9, 8), 8 + end + + def test_gt args, assert + assert.equal! (args.fn.gt 1), 1 + assert.equal! (args.fn.gt), nil + assert.equal! (args.fn.gt infinity), nil + assert.equal! (args.fn.gt nan), nil + assert.equal! (args.fn.gt 8, 9, 10), 10 + assert.equal! (args.fn.gt [8, 9, [10]]), 10 + assert.equal! (args.fn.gt 10, 10), nil + assert.equal! (args.fn.gt 10, 10), nil + assert.equal! (args.fn.gt 10, 9), nil + assert.equal! (args.fn.> 8, 9, 10), 10 + end + + def test_gte args, assert + assert.equal! (args.fn.gte 1), 1 + assert.equal! (args.fn.gte), nil + assert.equal! (args.fn.gte infinity), nil + assert.equal! (args.fn.gte nan), nil + assert.equal! (args.fn.gte 8, 9, 10), 10 + assert.equal! (args.fn.gte 10, 10), 10 + assert.equal! (args.fn.gte 8, 9, [10]), 10 + assert.equal! (args.fn.gte 10, 9), nil + assert.equal! (args.fn.>= 8, 9, 10), 10 + end + + + def test_acopy args, assert + orig = [1, 2, 3] + clone = args.fn.acopy orig + assert.equal! clone, [1, 2, 3] + assert.equal! clone, orig + assert.not_equal! clone.object_id, orig.object_id + end + + def test_aget args, assert + assert.equal! (args.fn.aget [:a, :b, :c], 1), :b + assert.equal! (args.fn.aget [:a, :b, :c], nil), nil + assert.equal! (args.fn.aget nil, 1), nil + end + + def test_alength args, assert + assert.equal! (args.fn.alength [:a, :b, :c]), 3 + assert.equal! (args.fn.alength nil), nil + end + + def test_amap args, assert + inc = lambda { |i| i + 1 } + ary = [1, 2, 3] + assert.equal! (args.fn.amap ary, inc), [2, 3, 4] + assert.equal! (args.fn.amap nil, inc), nil + assert.equal! (args.fn.amap ary, nil), nil + assert.equal! (args.fn.amap ary, inc).class, Array + end + + def test_and args, assert + assert.equal! (args.fn.and 1, 2, 3, 4), 4 + assert.equal! (args.fn.and 1, 2, nil, 4), nil + assert.equal! (args.fn.and), true + end + + def test_or args, assert + assert.equal! (args.fn.or 1, 2, 3, 4), 1 + assert.equal! (args.fn.or 1, 2, nil, 4), 1 + assert.equal! (args.fn.or), nil + assert.equal! (args.fn.or nil, nil, false, 5, 10), 5 + end + + def test_eq_eq args, assert + assert.equal! (args.fn.eq?), true + assert.equal! (args.fn.eq? 1, 0), false + assert.equal! (args.fn.eq? 1, 1, 1), true + assert.equal! (args.fn.== 1, 1, 1), true + assert.equal! (args.fn.== nil, nil), true + end + + def test_apply args, assert + assert.equal! (args.fn.and [nil, nil, nil]), [nil, nil, nil] + assert.equal! (args.fn.apply [nil, nil, nil], args.fn.method(:and)), nil + and_lambda = lambda {|*xs| args.fn.and(*xs)} + assert.equal! (args.fn.apply [nil, nil, nil], and_lambda), nil + end + + def test_areduce args, assert + assert.equal! (args.fn.areduce [1, 2, 3], 0, lambda { |i, a| i + a }), 6 + end + + def test_array_hash args, assert + assert.equal! (args.fn.array_hash :a, 1, :b, 2), { a: 1, b: 2 } + assert.equal! (args.fn.array_hash), { } + end + +#+end_src + +*** Advanced Debugging - Unit Tests - gen_docs.rb +#+begin_src 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! + +#+end_src + +*** Advanced Debugging - Unit Tests - geometry_tests.rb +#+begin_src ruby + # ./samples/10_advanced_debugging/03_unit_tests/geometry_tests.rb + begin :shared + def primitive_representations x, y, w, h + [ + [x, y, w, h], + { x: x, y: y, w: w, h: h }, + RectForTest.new(x, y, w, h) + ] + end + + class RectForTest + attr_sprite + + def initialize x, y, w, h + @x = x + @y = y + @w = w + @h = h + end + + def to_s + "RectForTest: #{[x, y, w, h]}" + end + end + end + + begin :intersect_rect? + def test_intersect_rect_point args, assert + assert.true! [16, 13].intersect_rect?([13, 12, 4, 4]), "point intersects with rect." + end + + def test_intersect_rect args, assert + intersecting = primitive_representations(0, 0, 100, 100) + + primitive_representations(20, 20, 20, 20) + + intersecting.product(intersecting).each do |rect_one, rect_two| + assert.true! rect_one.intersect_rect?(rect_two), + "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected true)." + end + + not_intersecting = [ + [ 0, 0, 5, 5], + { x: 10, y: 10, w: 5, h: 5 }, + RectForTest.new(20, 20, 5, 5) + ] + + not_intersecting.product(not_intersecting) + .reject { |rect_one, rect_two| rect_one == rect_two } + .each do |rect_one, rect_two| + assert.false! rect_one.intersect_rect?(rect_two), + "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected false)." + end + end + end + + begin :inside_rect? + def assert_inside_rect outer: nil, inner: nil, expected: nil, assert: nil + assert.true! inner.inside_rect?(outer) == expected, + "inside_rect? assertion failed for outer: #{outer} inner: #{inner} (expected #{expected})." + end + + def test_inside_rect args, assert + outer_rects = primitive_representations(0, 0, 10, 10) + inner_rects = primitive_representations(1, 1, 5, 5) + primitive_representations(0, 0, 10, 10).product(primitive_representations(1, 1, 5, 5)) + .each do |outer, inner| + assert_inside_rect outer: outer, inner: inner, + expected: true, assert: assert + end + end + end + + begin :angle_to + def test_angle_to args, assert + origins = primitive_representations(0, 0, 0, 0) + rights = primitive_representations(1, 0, 0, 0) + aboves = primitive_representations(0, 1, 0, 0) + + origins.product(aboves).each do |origin, above| + assert.equal! origin.angle_to(above), 90, + "A point directly above should be 90 degrees." + + assert.equal! above.angle_from(origin), 90, + "A point coming from above should be 90 degrees." + end + + origins.product(rights).each do |origin, right| + assert.equal! origin.angle_to(right) % 360, 0, + "A point directly to the right should be 0 degrees." + + assert.equal! right.angle_from(origin) % 360, 0, + "A point coming from the right should be 0 degrees." + + end + end + end + + begin :scale_rect + def test_scale_rect args, assert + assert.equal! [0, 0, 100, 100].scale_rect(0.5, 0.5), + [25.0, 25.0, 50.0, 50.0] + + assert.equal! [0, 0, 100, 100].scale_rect(0.5), + [0.0, 0.0, 50.0, 50.0] + + assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0.5, anchor_y: 0.5), + [25.0, 25.0, 50.0, 50.0] + + assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0, anchor_y: 0), + [0.0, 0.0, 50.0, 50.0] + end + end + + $gtk.reset 100 + $gtk.log_level = :off + +#+end_src + +*** Advanced Debugging - Unit Tests - http_tests.rb +#+begin_src ruby + # ./samples/10_advanced_debugging/03_unit_tests/http_tests.rb + def try_assert_or_schedule args, assert + if $result[:complete] + log_info "Request completed! Verifying." + if $result[:http_response_code] != 200 + log_info "The request yielded a result of #{$result[:http_response_code]} instead of 200." + exit + end + log_info ":try_assert_or_schedule succeeded!" + else + args.gtk.schedule_callback Kernel.tick_count + 10 do + try_assert_or_schedule args, assert + end + end + end + + def test_http args, assert + $result = $gtk.http_get 'http://dragonruby.org' + try_assert_or_schedule args, assert + end + + $gtk.reset 100 + $gtk.log_level = :off + +#+end_src + +*** Advanced Debugging - Unit Tests - nil_coercion_tests.rb +#+begin_src ruby + # ./samples/10_advanced_debugging/03_unit_tests/nil_coercion_tests.rb + # numbers + def test_open_entity_add_number args, assert + assert.nil! args.state.i_value + args.state.i_value += 5 + assert.equal! args.state.i_value, 5 + + assert.nil! args.state.f_value + args.state.f_value += 5.5 + assert.equal! args.state.f_value, 5.5 + end + + def test_open_entity_subtract_number args, assert + assert.nil! args.state.i_value + args.state.i_value -= 5 + assert.equal! args.state.i_value, -5 + + assert.nil! args.state.f_value + args.state.f_value -= 5.5 + assert.equal! args.state.f_value, -5.5 + end + + def test_open_entity_multiply_number args, assert + assert.nil! args.state.i_value + args.state.i_value *= 5 + assert.equal! args.state.i_value, 0 + + assert.nil! args.state.f_value + args.state.f_value *= 5.5 + assert.equal! args.state.f_value, 0 + end + + def test_open_entity_divide_number args, assert + assert.nil! args.state.i_value + args.state.i_value /= 5 + assert.equal! args.state.i_value, 0 + + assert.nil! args.state.f_value + args.state.f_value /= 5.5 + assert.equal! args.state.f_value, 0 + end + + # array + def test_open_entity_add_array args, assert + assert.nil! args.state.values + args.state.values += [:a, :b, :c] + assert.equal! args.state.values, [:a, :b, :c] + end + + def test_open_entity_subtract_array args, assert + assert.nil! args.state.values + args.state.values -= [:a, :b, :c] + assert.equal! args.state.values, [] + end + + def test_open_entity_shovel_array args, assert + assert.nil! args.state.values + args.state.values << :a + assert.equal! args.state.values, [:a] + end + + def test_open_entity_enumerate args, assert + assert.nil! args.state.values + args.state.values = args.state.values.map_with_index { |i| i } + assert.equal! args.state.values, [] + + assert.nil! args.state.values_2 + args.state.values_2 = args.state.values_2.map { |i| i } + assert.equal! args.state.values_2, [] + + assert.nil! args.state.values_3 + args.state.values_3 = args.state.values_3.flat_map { |i| i } + assert.equal! args.state.values_3, [] + end + + # hashes + def test_open_entity_indexer args, assert + GTK::Entity.__reset_id__! + assert.nil! args.state.values + args.state.values[:test] = :value + assert.equal! args.state.values.to_s, { entity_id: 1, entity_name: :values, entity_keys_by_ref: {}, test: :value }.to_s + end + + # bug + def test_open_entity_nil_bug args, assert + GTK::Entity.__reset_id__! + args.state.foo.a + args.state.foo.b + @hello[:foobar] + assert.nil! args.state.foo.a, "a was not nil." + # the line below fails + # assert.nil! args.state.foo.b, "b was not nil." + end + +#+end_src + +*** Advanced Debugging - Unit Tests - object_to_primitive_tests.rb +#+begin_src ruby + # ./samples/10_advanced_debugging/03_unit_tests/object_to_primitive_tests.rb + class PlayerSpriteForTest + end + + def test_array_to_sprite args, assert + array = [[0, 0, 100, 100, "test.png"]].sprites + puts "No exception was thrown. Sweet!" + end + + def test_class_to_sprite args, assert + array = [PlayerSprite.new].sprites + assert.true! array.first.is_a?(PlayerSprite) + puts "No exception was thrown. Sweet!" + end + + $gtk.reset 100 + $gtk.log_level = :off + +#+end_src + +*** Advanced Debugging - Unit Tests - parsing_tests.rb +#+begin_src 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"] }' + assert.equal! result, { "name"=>"John Doe", "aliases"=>["JD"] }, "Parsing JSON failed." + end + + def test_parse_xml args, assert + result = args.gtk.parse_xml <<-S + + John Doe + + S + + expected = {:type=>:element, + :name=>nil, + :children=>[{:type=>:element, + :name=>"Person", + :children=>[{:type=>:element, + :name=>"Name", + :children=>[{:type=>:content, + :data=>"John Doe"}]}], + :attributes=>{"id"=>"100"}}]} + + assert.equal! result, expected, "Parsing xml failed." + end + + $gtk.reset 100 + $gtk.log_level = :off + +#+end_src + +*** Advanced Debugging - Unit Tests - require_tests.rb +#+begin_src ruby + # ./samples/10_advanced_debugging/03_unit_tests/require_tests.rb + def write_src path, src + $gtk.write_file path, src + end + + write_src 'app/unit_testing_game.rb', <<-S + module UnitTesting + class Game + end + end + S + + write_src 'lib/unit_testing_lib.rb', <<-S + module UnitTesting + class Lib + end + end + S + + write_src 'app/nested/unit_testing_nested.rb', <<-S + module UnitTesting + class Nested + end + end + S + + require 'app/unit_testing_game.rb' + require 'app/nested/unit_testing_nested.rb' + require 'lib/unit_testing_lib.rb' + + def test_require args, assert + UnitTesting::Game.new + UnitTesting::Lib.new + UnitTesting::Nested.new + $gtk.exec 'rm ./mygame/app/unit_testing_game.rb' + $gtk.exec 'rm ./mygame/app/nested/unit_testing_nested.rb' + $gtk.exec 'rm ./mygame/lib/unit_testing_lib.rb' + assert.ok! + end + +#+end_src + +*** Advanced Debugging - Unit Tests - serialize_deserialize_tests.rb +#+begin_src ruby + # ./samples/10_advanced_debugging/03_unit_tests/serialize_deserialize_tests.rb + def test_serialize args, assert + GTK::Entity.__reset_id__! + args.state.player_one = "test" + result = args.gtk.serialize_state args.state + assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}" + + GTK::Entity.__reset_id__! + args.gtk.write_file 'state.txt', '' + result = args.gtk.serialize_state 'state.txt', args.state + assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}" + end + + def test_deserialize args, assert + GTK::Entity.__reset_id__! + result = args.gtk.deserialize_state '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}' + assert.equal! result.player_one, "test" + + GTK::Entity.__reset_id__! + args.gtk.write_file 'state.txt', '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}' + result = args.gtk.deserialize_state 'state.txt' + assert.equal! result.player_one, "test" + end + + def test_very_large_serialization args, assert + GTK::Entity.__reset_id__! + size = 3000 + size.map_with_index do |i| + args.state.send("k#{i}=".to_sym, i) + end + + result = args.gtk.serialize_state args.state + assert.true! (args.gtk.console.log.join.include? "unlikely a string this large will deserialize correctly") + end + + def test_strict_entity_serialization args, assert + GTK::Entity.__reset_id__! + args.state.player_one = args.state.new_entity(:player, name: "Ryu") + args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken") + + serialized_state = args.gtk.serialize_state args.state + assert.equal! serialized_state, '{:entity_id=>1, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>3, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken"}}' + + GTK::Entity.__reset_id__! + deserialize_state = args.gtk.deserialize_state serialized_state + + assert.equal! args.state.player_one.name, deserialize_state.player_one.name + assert.true! args.state.player_one.is_a? GTK::OpenEntity + + assert.equal! args.state.player_two.name, deserialize_state.player_two.name + assert.true! args.state.player_two.is_a? GTK::StrictEntity + end + + def test_strict_entity_serialization_with_nil args, assert + GTK::Entity.__reset_id__! + args.state.player_one = args.state.new_entity(:player, name: "Ryu") + args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken", blood_type: nil) + + serialized_state = args.gtk.serialize_state args.state + assert.equal! serialized_state, '{:entity_id=>9, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}' + + GTK::Entity.__reset_id__! + deserialized_state = args.gtk.deserialize_state serialized_state + + assert.equal! args.state.player_one.name, deserialized_state.player_one.name + assert.true! args.state.player_one.is_a? GTK::OpenEntity + + assert.equal! args.state.player_two.name, deserialized_state.player_two.name + assert.equal! args.state.player_two.blood_type, deserialized_state.player_two.blood_type + assert.equal! deserialized_state.player_two.blood_type, nil + assert.true! args.state.player_two.is_a? GTK::StrictEntity + + deserialized_state.player_two.blood_type = :O + assert.equal! deserialized_state.player_two.blood_type, :O + end + + def test_multiple_strict_entities args, assert + GTK::Entity.__reset_id__! + args.state.player = args.state.new_entity_strict(:player_one, name: "Ryu") + args.state.enemy = args.state.new_entity_strict(:enemy, name: "Bison", other_property: 'extra mean') + + serialized_state = args.gtk.serialize_state args.state + + GTK::Entity.__reset_id__! + deserialized_state = args.gtk.deserialize_state serialized_state + + assert.equal! deserialized_state.player.name, "Ryu" + assert.equal! deserialized_state.enemy.other_property, "extra mean" + end + + def test_by_reference_state args, assert + GTK::Entity.__reset_id__! + args.state.a = { name: "Jane Doe" } + args.state.b = args.state.a + assert.equal! args.state.a.object_id, args.state.b.object_id + serialized_state = args.gtk.serialize_state args.state + + GTK::Entity.__reset_id__! + deserialized_state = args.gtk.deserialize_state serialized_state + assert.equal! deserialized_state.a.object_id, deserialized_state.b.object_id + end + + def test_by_reference_state_strict_entities args, assert + GTK::Entity.__reset_id__! + args.state.a = { name: "Jane Doe" } + args.state.strict_entity = args.state.new_entity_strict(:couple) do |e| + e.one = args.state.new_entity_strict(:person, name: "Jane") + e.two = e.one + end + assert.equal! args.state.strict_entity.one, args.state.strict_entity.two + serialized_state = args.gtk.serialize_state args.state + + GTK::Entity.__reset_id__! + deserialized_state = args.gtk.deserialize_state serialized_state + assert.equal! deserialized_state.strict_entity.one, deserialized_state.strict_entity.two + end + +#+end_src + +*** Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb +#+begin_src ruby + # ./samples/10_advanced_debugging/03_unit_tests/state_serialization_experimental_tests.rb + MAX_CODE_GEN_LENGTH = 50 + + # NOTE: This is experimental/advanced stuff. + def needs_partitioning? target + target[:value].to_s.length > MAX_CODE_GEN_LENGTH + end + + def partition target + return [] unless needs_partitioning? target + if target[:value].is_a? GTK::OpenEntity + target[:value] = target[:value].hash + end + + results = [] + idx = 0 + left, right = target[:value].partition do + idx += 1 + idx.even? + end + left, right = Hash[left], Hash[right] + left = { value: left } + right = { value: right} + [left, right] + end + + def add_partition target, path, aggregate, final_result + partitions = partition target + partitions.each do |part| + if needs_partitioning? part + if part[:value].keys.length == 1 + first_key = part[:value].keys[0] + new_part = { value: part[:value][first_key] } + path.push first_key + add_partition new_part, path, aggregate, final_result + path.pop + else + add_partition part, path, aggregate, final_result + end + else + final_result << { value: { __path__: [*path] } } + final_result << { value: part[:value] } + end + end + end + + def state_to_string state + parts_queue = [] + final_queue = [] + add_partition({ value: state.hash }, + [], + parts_queue, + final_queue) + final_queue.reject {|i| i[:value].keys.length == 0}.map do |i| + i[:value].to_s + end.join("\n#==================================================#\n") + end + + def state_from_string string + Kernel.eval("$load_data = {}") + lines = string.split("\n#==================================================#\n") + lines.each do |l| + puts "todo: #{l}" + end + + GTK::OpenEntity.parse_from_hash $load_data + end + + def test_save_and_load args, assert + args.state.item_1.name = "Jane" + string = state_to_string args.state + state = state_from_string string + assert.equal! args.state.item_1.name, state.item_1.name + end + + def test_save_and_load_big args, assert + size = 1000 + size.map_with_index do |i| + args.state.send("k#{i}=".to_sym, i) + end + + string = state_to_string args.state + state = state_from_string string + size.map_with_index do |i| + assert.equal! args.state.send("k#{i}".to_sym), state.send("k#{i}".to_sym) + assert.equal! args.state.send("k#{i}".to_sym), i + assert.equal! state.send("k#{i}".to_sym), i + end + end + + def test_save_and_load_big_nested args, assert + args.state.player_one.friend.nested_hash.k0 = 0 + args.state.player_one.friend.nested_hash.k1 = 1 + args.state.player_one.friend.nested_hash.k2 = 2 + args.state.player_one.friend.nested_hash.k3 = 3 + args.state.player_one.friend.nested_hash.k4 = 4 + args.state.player_one.friend.nested_hash.k5 = 5 + args.state.player_one.friend.nested_hash.k6 = 6 + args.state.player_one.friend.nested_hash.k7 = 7 + args.state.player_one.friend.nested_hash.k8 = 8 + args.state.player_one.friend.nested_hash.k9 = 9 + string = state_to_string args.state + state = state_from_string string + end + + $gtk.reset 100 + $gtk.log_level = :off + +#+end_src + +*** Advanced Debugging - Unit Tests - suggest_autocompletion_tests.rb +#+begin_src ruby + # ./samples/10_advanced_debugging/03_unit_tests/suggest_autocompletion_tests.rb + def default_suggest_autocompletion args + { + index: 4, + text: "args.", + __meta__: { + other_options: [ + { + index: Fixnum, + file: "app/main.rb" + } + ] + } + } + end + + def assert_completion source, *expected + results = suggest_autocompletion text: (source.strip.gsub ":cursor", ""), + index: (source.strip.index ":cursor") + + puts results + end + + def test_args_completion args, assert + $gtk.write_file_root "autocomplete.txt", ($gtk.suggest_autocompletion text: <<-S, index: 128).join("\n") + require 'app/game.rb' + + def tick args + args.gtk.suppress_mailbox = false + $game ||= Game.new + $game.args = args + $game.args. + $game.tick + end + S + + puts "contents:" + puts ($gtk.read_file "autocomplete.txt") + end + +#+end_src + +*** Http - Retrieve Images - main.rb +#+begin_src ruby + # ./samples/11_http/01_retrieve_images/app/main.rb + def tick args + args.outputs.background_color = [0, 0, 0] + + # Show a warning at the start. + args.state.warning_debounce ||= 11 * 60 + if args.state.warning_debounce > 0 + args.state.warning_debounce -= 1 + args.outputs.labels << [640, 600, "This app shows random images from the Internet.", 10, 1, 255, 255, 255] + args.outputs.labels << [640, 500, "Quit in the next few seconds if this is a problem.", 10, 1, 255, 255, 255] + args.outputs.labels << [640, 350, "#{(args.state.warning_debounce / 60.0).to_i}", 10, 1, 255, 255, 255] + return + end + + args.state.download_debounce ||= 0 # start immediately, reset to non zero later. + args.state.photos ||= [] + + # Put a little pause between each download. + if args.state.download.nil? + if args.state.download_debounce > 0 + args.state.download_debounce -= 1 + else + args.state.download = $gtk.http_get 'https://picsum.photos/200/300.jpg' + end + end + + if !args.state.download.nil? + if args.state.download[:complete] + if args.state.download[:http_response_code] == 200 + fname = "sprites/#{args.state.photos.length}.jpg" + $gtk.write_file fname, args.state.download[:response_data] + args.state.photos << [ 100 + rand(1080), 500 - rand(480), fname, rand(80) - 40 ] + end + args.state.download = nil + args.state.download_debounce = (rand(3) + 2) * 60 + end + end + + # draw any downloaded photos... + args.state.photos.each { |i| + args.outputs.primitives << [i[0], i[1], 200, 300, i[2], i[3]].sprite + } + + # Draw a download progress bar... + args.outputs.primitives << [0, 0, 1280, 30, 0, 0, 0, 255].solid + if !args.state.download.nil? + br = args.state.download[:response_read] + total = args.state.download[:response_total] + if total != 0 + pct = br.to_f / total.to_f + args.outputs.primitives << [0, 0, 1280 * pct, 30, 0, 0, 255, 255].solid + end + end + end + +#+end_src + +*** Http - Web Server - main.rb +#+begin_src ruby + # ./samples/11_http/02_web_server/app/main.rb + def tick args + args.state.port ||= 3000 + # by default the embedded webserver runs on port 9001 (the port number is over 9000) and is disabled in a production build + # to enable the http server in a production build, you need to manually start + # the server up: + args.gtk.start_server! port: args.state.port, enable_in_prod: true + args.outputs.background_color = [0, 0, 0] + args.outputs.labels << [640, 600, "Point your web browser at http://localhost:#{args.state.port}/", 10, 1, 255, 255, 255] + + args.inputs.http_requests.each { |req| + puts("METHOD: #{req.method}"); + puts("URI: #{req.uri}"); + puts("HEADERS:"); + req.headers.each { |k,v| puts(" #{k}: #{v}") } + + if (req.uri == '/') + # headers and body can be nil if you don't care about them. + # If you don't set the Content-Type, it will default to + # "text/html; charset=utf-8". + # Don't set Content-Length; we'll ignore it and calculate it for you + args.state.reqnum += 1 + req.respond 200, "hello

    This #{req.method} was request number #{args.state.reqnum}!

    \n", { 'X-DRGTK-header' => 'Powered by DragonRuby!' } + else + req.reject + end + } + end + +#+end_src + +*** C Extensions - Basics - main.rb +#+begin_src ruby + # ./samples/12_c_extensions/01_basics/app/main.rb + $gtk.ffi_misc.gtk_dlopen("ext") + include FFI::CExt + + def tick args + args.outputs.labels << [640, 500, "mouse.x = #{args.mouse.x.to_i}", 5, 1] + args.outputs.labels << [640, 460, "square(mouse.x) = #{square(args.mouse.x.to_i)}", 5, 1] + args.outputs.labels << [640, 420, "mouse.y = #{args.mouse.y.to_i}", 5, 1] + args.outputs.labels << [640, 380, "square(mouse.y) = #{square(args.mouse.y.to_i)}", 5, 1] + end + + +#+end_src + +*** C Extensions - Intermediate - main.rb +#+begin_src ruby + # ./samples/12_c_extensions/02_intermediate/app/main.rb + $gtk.ffi_misc.gtk_dlopen("ext") + include FFI::RE + + def split_words(input) + words = [] + last = IntPointer.new + re = re_compile("\\w+") + first = re_matchp(re, input, last) + while first != -1 + words << input.slice(first, last.value) + input = input.slice(last.value + first, input.length) + first = re_matchp(re, input, last) + end + words + end + + def tick args + args.outputs.labels << [640, 500, split_words("hello, dragonriders!").join(' '), 5, 1] + end + +#+end_src + +*** C Extensions - Native Pixel Arrays - main.rb +#+begin_src ruby + # ./samples/12_c_extensions/03_native_pixel_arrays/app/main.rb + $gtk.ffi_misc.gtk_dlopen("ext") + include FFI::CExt + + def tick args + args.state.rotation ||= 0 + + update_scanner_texture # this calls into a C extension! + + # New/changed pixel arrays get uploaded to the GPU before we render + # anything. At that point, they can be scaled, rotated, and otherwise + # used like any other sprite. + w = 100 + h = 100 + x = (1280 - w) / 2 + y = (720 - h) / 2 + args.outputs.background_color = [64, 0, 128] + args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite + args.state.rotation += 1 + + args.outputs.primitives << args.gtk.current_framerate_primitives + end + + +#+end_src + +*** Path Finding Algorithms - Breadth First Search - main.rb +#+begin_src 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 + + # An animation that can respond to user input in real time + + # A breadth first search expands in all directions one step at a time + # The frontier is a queue of cells to be expanded from + # The visited hash allows quick lookups of cells that have been expanded from + # The walls hash allows quick lookup of whether a cell is a wall + + # The breadth first search starts by adding the red star to the frontier array + # and marking it as visited + # Each step a cell is removed from the front of the frontier array (queue) + # Unless the neighbor is a wall or visited, it is added to the frontier array + # The neighbor is then marked as visited + + # The frontier is blue + # Visited cells are light brown + # Walls are camo green + # Even when walls are visited, they will maintain their wall color + + # The star can be moved by clicking and dragging + # Walls can be added and removed by clicking and dragging + + class BreadthFirstSearch + attr_gtk + + def initialize(args) + # Variables to edit the size and appearance of the grid + # Freely customizable to user's liking + args.state.grid.width = 30 + args.state.grid.height = 15 + args.state.grid.cell_size = 40 + + # Stores which step of the animation is being rendered + # When the user moves the star or messes with the walls, + # the breadth first search is recalculated up to this step + args.state.anim_steps = 0 + + # At some step the animation will end, + # and further steps won't change anything (the whole grid will be explored) + # 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 + args.state.max_steps = args.state.grid.width * args.state.grid.height + + # Whether the animation should play or not + # If true, every tick moves anim_steps forward one + # Pressing the stepwise animation buttons will pause the animation + args.state.play = true + + # The location of the star and walls of the grid + # They can be modified to have a different initial grid + # Walls are stored in a hash for quick look up when doing the search + args.state.star = [0, 0] + args.state.walls = { + [3, 3] => true, + [3, 4] => true, + [3, 5] => true, + [3, 6] => true, + [3, 7] => true, + [3, 8] => true, + [3, 9] => true, + [3, 10] => true, + [3, 11] => true, + [4, 3] => true, + [4, 4] => true, + [4, 5] => true, + [4, 6] => true, + [4, 7] => true, + [4, 8] => true, + [4, 9] => true, + [4, 10] => true, + [4, 11] => true, + + [13, 0] => true, + [13, 1] => true, + [13, 2] => true, + [13, 3] => true, + [13, 4] => true, + [13, 5] => true, + [13, 6] => true, + [13, 7] => true, + [13, 8] => true, + [13, 9] => true, + [13, 10] => true, + [14, 0] => true, + [14, 1] => true, + [14, 2] => true, + [14, 3] => true, + [14, 4] => true, + [14, 5] => true, + [14, 6] => true, + [14, 7] => true, + [14, 8] => true, + [14, 9] => true, + [14, 10] => true, + + [21, 8] => true, + [21, 9] => true, + [21, 10] => true, + [21, 11] => true, + [21, 12] => true, + [21, 13] => true, + [21, 14] => true, + [22, 8] => true, + [22, 9] => true, + [22, 10] => true, + [22, 11] => true, + [22, 12] => true, + [22, 13] => true, + [22, 14] => true, + [23, 8] => true, + [23, 9] => true, + [24, 8] => true, + [24, 9] => true, + [25, 8] => true, + [25, 9] => true, + } + + # Variables that are used by the breadth first search + # Storing cells that the search has visited, prevents unnecessary steps + # Expanding the frontier of the search in order makes the search expand + # from the center outward + args.state.visited = {} + args.state.frontier = [] + + + # What the user is currently editing on the grid + # Possible values are: :none, :slider, :star, :remove_wall, :add_wall + + # 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. + args.state.click_and_drag = :none + + # Store the rects of the buttons that control the animation + # They are here for user customization + # Editing these might require recentering the text inside them + # Those values can be found in the render_button methods + args.state.buttons.left = [450, 600, 50, 50] + args.state.buttons.center = [500, 600, 200, 50] + args.state.buttons.right = [700, 600, 50, 50] + + # The variables below are related to the slider + # They allow the user to customize them + # They also give a central location for the render and input methods to get + # information from + # x & y are the coordinates of the leftmost part of the slider line + args.state.slider.x = 400 + args.state.slider.y = 675 + # This is the width of the line + args.state.slider.w = 360 + # This is the offset for the circle + # Allows the center of the circle to be on the line, + # as opposed to the upper right corner + args.state.slider.offset = 20 + # This is the spacing between each of the notches on the slider + # Notches are places where the circle can rest on the slider line + # There needs to be a notch for each step before the maximum number of steps + args.state.slider.spacing = args.state.slider.w.to_f / args.state.max_steps.to_f + end + + # This method is called every frame/tick + # Every tick, the current state of the search is rendered on the screen, + # User input is processed, and + # The next step in the search is calculated + def tick + render + input + # If animation is playing, and max steps have not been reached + # Move the search a step forward + if state.play && state.anim_steps < state.max_steps + # Variable that tells the program what step to recalculate up to + state.anim_steps += 1 + calc + end + end + + # Draws everything onto the screen + def render + render_buttons + render_slider + + render_background + render_visited + render_frontier + render_walls + render_star + end + + # The methods below subdivide the task of drawing everything to the screen + + # Draws the buttons that control the animation step and state + def render_buttons + render_left_button + render_center_button + render_right_button + end + + # Draws the button which steps the search backward + # Shows the user where to click to move the search backward + def render_left_button + # Draws the gray button, and a black border + # The border separates the buttons visually + outputs.solids << [buttons.left, gray] + outputs.borders << [buttons.left, black] + + # Renders an explanatory label in the center of the button + # Explains to the user what the button does + # If the button size is changed, the label might need to be edited as well + # to keep the label in the center of the button + label_x = buttons.left.x + 20 + label_y = buttons.left.y + 35 + outputs.labels << [label_x, label_y, "<"] + end + + def render_center_button + # Draws the gray button, and a black border + # The border separates the buttons visually + outputs.solids << [buttons.center, gray] + outputs.borders << [buttons.center, black] + + # Renders an explanatory label in the center of the button + # Explains to the user what the button does + # If the button size is changed, the label might need to be edited as well + # to keep the label in the center of the button + label_x = buttons.center.x + 37 + label_y = buttons.center.y + 35 + label_text = state.play ? "Pause Animation" : "Play Animation" + outputs.labels << [label_x, label_y, label_text] + end + + def render_right_button + # Draws the gray button, and a black border + # The border separates the buttons visually + outputs.solids << [buttons.right, gray] + outputs.borders << [buttons.right, black] + + # Renders an explanatory label in the center of the button + # Explains to the user what the button does + label_x = buttons.right.x + 20 + label_y = buttons.right.y + 35 + outputs.labels << [label_x, label_y, ">"] + end + + # Draws the slider so the user can move it and see the progress of the search + def render_slider + # Using primitives hides the line under the white circle of the slider + # Draws the line + outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line + # The circle needs to be offset so that the center of the circle + # overlaps the line instead of the upper right corner of the circle + # The circle's x value is also moved based on the current seach step + circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing) + circle_y = (slider.y - slider.offset) + circle_rect = [circle_x, circle_y, 37, 37] + outputs.primitives << [circle_rect, 'circle-white.png'].sprite + end + + # Draws what the grid looks like with nothing on it + def render_background + render_unvisited + render_grid_lines + end + + # Draws a rectangle the size of the entire grid to represent unvisited cells + def render_unvisited + outputs.solids << [scale_up([0, 0, grid.width, grid.height]), unvisited_color] + end + + # Draws grid lines to show the division of the grid into cells + def render_grid_lines + for x in 0..grid.width + outputs.lines << vertical_line(x) + end + + for y in 0..grid.height + outputs.lines << horizontal_line(y) + end + end + + # Easy way to draw vertical lines given an index + def vertical_line column + scale_up([column, 0, column, grid.height]) + end + + # Easy way to draw horizontal lines given an index + def horizontal_line row + scale_up([0, row, grid.width, row]) + end + + # Draws the area that is going to be searched from + # The frontier is the most outward parts of the search + def render_frontier + outputs.solids << state.frontier.map do |cell| + [scale_up([cell.x, cell.y]), frontier_color] + end + end + + # Draws the walls + def render_walls + outputs.solids << state.walls.map do |wall| + [scale_up([wall.x, wall.y]), wall_color] + end + end + + # Renders cells that have been searched in the appropriate color + def render_visited + outputs.solids << state.visited.map do |cell| + [scale_up([cell.x, cell.y]), visited_color] + end + end + + # Renders the star + def render_star + outputs.sprites << [scale_up(state.star), 'star.png'] + end + + # In code, the cells are represented as 1x1 rectangles + # When drawn, the cells are larger than 1x1 rectangles + # This method is used to scale up cells, and lines + # Objects are scaled up according to the grid.cell_size variable + # This allows for easy customization of the visual scale of the grid + def scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone + + # If cell is just an x and y coordinate + if cell.size == 2 + # Add a width and height of 1 + cell << 1 + cell << 1 + end + + # Scale all the values up + cell.map! { |value| value * grid.cell_size } + + # Returns the scaled up cell + cell + end + + # This method processes user input every tick + # This method allows the user to use the buttons, slider, and edit the grid + # There are 2 types of input: + # Button Input + # Click and Drag Input + # + # Button Input is used for the backward step and forward step buttons + # Input is detected by mouse up within the bounds of the rect + # + # Click and Drag Input is used for moving the star, adding walls, + # removing walls, and the slider + # + # When the mouse is down on the star, the click_and_drag variable is set to :star + # While click_and_drag equals :star, the cursor's position is used to calculate the + # appropriate drag behavior + # + # When the mouse goes up click_and_drag is set to :none + # + # A variable has to be used because the star has to continue being edited even + # when the cursor is no longer over the star + # + # Similar things occur for the other Click and Drag inputs + def input + # Checks whether any of the buttons are being clicked + input_buttons + + # The detection and processing of click and drag inputs are separate + # The program has to remember that the user is dragging an object + # even when the mouse is no longer over that object + detect_click_and_drag + process_click_and_drag + end + + # Detects and Process input for each button + def input_buttons + input_left_button + input_center_button + input_next_step_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 + if left_button_clicked? + state.play = false + state.anim_steps -= 1 + recalculate + end + end + + # Controls the play/pause button + # Inverses whether the animation is playing or not when clicked + def input_center_button + if center_button_clicked? or inputs.keyboard.key_down.space + state.play = !state.play + end + end + + # Checks if the next step button is clicked + # If it is, it pauses the animation and moves the search one step forward + def input_next_step_button + if right_button_clicked? + state.play = false + state.anim_steps += 1 + calc + end + end + + # Determines what the user is editing and stores the value + # Storing the value allows the user to continue the same edit as long as the + # mouse left click is held + def detect_click_and_drag + if inputs.mouse.up + state.click_and_drag = :none + elsif star_clicked? + state.click_and_drag = :star + elsif wall_clicked? + state.click_and_drag = :remove_wall + elsif grid_clicked? + state.click_and_drag = :add_wall + elsif slider_clicked? + state.click_and_drag = :slider + end + end + + # Processes click and drag based on what the user is currently dragging + def process_click_and_drag + if state.click_and_drag == :star + input_star + elsif state.click_and_drag == :remove_wall + input_remove_wall + elsif state.click_and_drag == :add_wall + input_add_wall + elsif state.click_and_drag == :slider + input_slider + end + end + + # Moves the star to the grid closest to the mouse + # Only recalculates the search if the star changes position + # Called whenever the user is editing the star (puts mouse down on star) + def input_star + old_star = state.star.clone + state.star = cell_closest_to_mouse + unless old_star == state.star + recalculate + end + end + + # Removes walls that are under the cursor + def input_remove_wall + # The mouse needs to be inside the grid, because we only want to remove walls + # the cursor is directly over + # Recalculations should only occur when a wall is actually deleted + if mouse_inside_grid? + if state.walls.has_key?(cell_closest_to_mouse) + state.walls.delete(cell_closest_to_mouse) + recalculate + end + end + end + + # Adds walls at cells under the cursor + def input_add_wall + if mouse_inside_grid? + unless state.walls.has_key?(cell_closest_to_mouse) + state.walls[cell_closest_to_mouse] = true + recalculate + end + end + end + + # This method is called when the user is editing the slider + # It pauses the animation and moves the white circle to the closest integer point + # on the slider + # Changes the step of the search to be animated + def input_slider + 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 + + # 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 + state.anim_steps = ((mouse_x - slider.x) / slider.spacing).to_i + + recalculate + end + + # Whenever the user edits the grid, + # The search has to be recalculated upto the current step + # with the current grid as the initial state of the grid + def recalculate + # Resets the search + state.frontier = [] + state.visited = {} + + # Moves the animation forward one step at a time + state.anim_steps.times { calc } + end + + + # This method moves the search forward one step + # When the animation is playing it is called every tick + # And called whenever the current step of the animation needs to be recalculated + + # Moves the search forward one step + # Parameter called_from_tick is true if it is called from the tick method + # It is false when the search is being recalculated after user editing the grid + def calc + + # The setup to the search + # Runs once when the there is no frontier or visited cells + if state.frontier.empty? && state.visited.empty? + state.frontier << state.star + state.visited[state.star] = true + end + + # A step in the search + unless state.frontier.empty? + # Takes the next frontier cell + new_frontier = state.frontier.shift + # For each of its neighbors + adjacent_neighbors(new_frontier).each do |neighbor| + # That have not been visited and are not walls + unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor) + # Add them to the frontier and mark them as visited + state.frontier << neighbor + state.visited[neighbor] = true + end + end + end + end + + + # Returns a list of adjacent cells + # Used to determine what the next cells to be added to the frontier are + def adjacent_neighbors(cell) + neighbors = [] + + neighbors << [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 + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # Finding the cell closest to the mouse helps with this + def cell_closest_to_mouse + # Closest cell to the mouse + 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 + # Return closest cell + [x, y] + end + + # These methods detect when the buttons are clicked + def left_button_clicked? + inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.left) + end + + def center_button_clicked? + inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.center) + end + + def right_button_clicked? + inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.right) + end + + # Signal that the user is going to be moving the slider + # Is the mouse down on the circle of the slider? + def slider_clicked? + circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing) + circle_y = (slider.y - slider.offset) + circle_rect = [circle_x, circle_y, 37, 37] + inputs.mouse.down && inputs.mouse.point.inside_rect?(circle_rect) + end + + # Signal that the user is going to be moving the star + def star_clicked? + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star)) + end + + # Signal that the user is going to be removing walls + def wall_clicked? + inputs.mouse.down && mouse_inside_a_wall? + end + + # Signal that the user is going to be adding walls + def grid_clicked? + inputs.mouse.down && mouse_inside_grid? + end + + # Returns whether the mouse is inside of a wall + # Part of the condition that checks whether the user is removing a wall + def mouse_inside_a_wall? + state.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(scale_up([wall.x, wall.y])) + end + + false + end + + # Returns whether the mouse is inside of a grid + # Part of the condition that checks whether the user is adding a wall + def mouse_inside_grid? + inputs.mouse.point.inside_rect?(scale_up([0, 0, grid.width, grid.height])) + end + + + # These methods provide handy aliases to colors + + # Light brown + def unvisited_color + [221, 212, 213] + end + + # Black + def grid_line_color + [255, 255, 255] + end + + # Dark Brown + def visited_color + [204, 191, 179] + end + + # Blue + def frontier_color + [103, 136, 204] + end + + # Camo Green + def wall_color + [134, 134, 120] + end + + # Button Background + def gray + [190, 190, 190] + end + + # Button Outline + def black + [0, 0, 0] + end + + # These methods make the code more concise + def grid + state.grid + end + + def buttons + state.buttons + end + + def slider + state.slider + end + end + + # Method that is called by DragonRuby periodically + # Used for updating animations and calculations + def tick args + + # Pressing r will reset the application + if args.inputs.keyboard.key_down.r + args.gtk.reset + reset + return + end + + # Every tick, new args are passed, and the Breadth First Search tick is called + $breadth_first_search ||= BreadthFirstSearch.new(args) + $breadth_first_search.args = args + $breadth_first_search.tick + end + + + def reset + $breadth_first_search = nil + end + +#+end_src + +*** Path Finding Algorithms - Detailed Breadth First Search - main.rb +#+begin_src 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 + + # An animation that can respond to user input in real time + + # A breadth first search expands in all directions one step at a time + # The frontier is a queue of cells to be expanded from + # The visited hash allows quick lookups of cells that have been expanded from + # The walls hash allows quick lookup of whether a cell is a wall + + # The breadth first search starts by adding the red star to the frontier array + # and marking it as visited + # Each step a cell is removed from the front of the frontier array (queue) + # Unless the neighbor is a wall or visited, it is added to the frontier array + # The neighbor is then marked as visited + + # The frontier is blue + # Visited cells are light brown + # Walls are camo green + # Even when walls are visited, they will maintain their wall color + + # This search numbers the order in which new cells are explored + # The next cell from where the search will continue is highlighted yellow + # And the cells that will be considered for expansion are in semi-transparent green + + # The star can be moved by clicking and dragging + # Walls can be added and removed by clicking and dragging + + class DetailedBreadthFirstSearch + attr_gtk + + def initialize(args) + # Variables to edit the size and appearance of the grid + # Freely customizable to user's liking + args.state.grid.width = 9 + args.state.grid.height = 4 + args.state.grid.cell_size = 90 + + # Stores which step of the animation is being rendered + # When the user moves the star or messes with the walls, + # the breadth first search is recalculated up to this step + args.state.anim_steps = 0 + + # At some step the animation will end, + # and further steps won't change anything (the whole grid will be explored) + # 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 + args.state.max_steps = args.state.grid.width * args.state.grid.height + + # The location of the star and walls of the grid + # They can be modified to have a different initial grid + # Walls are stored in a hash for quick look up when doing the search + args.state.star = [3, 2] + args.state.walls = {} + + # Variables that are used by the breadth first search + # Storing cells that the search has visited, prevents unnecessary steps + # Expanding the frontier of the search in order makes the search expand + # from the center outward + args.state.visited = {} + args.state.frontier = [] + args.state.cell_numbers = [] + + + + # What the user is currently editing on the grid + # Possible values are: :none, :slider, :star, :remove_wall, :add_wall + + # 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. + args.state.click_and_drag = :none + + # The x, y, w, h values for the buttons + # Allow easy movement of the buttons location + # A centralized location to get values to detect input and draw the buttons + # Editing these values might mean needing to edit the label offsets + # which can be found in the appropriate render button methods + args.state.buttons.left = [450, 600, 160, 50] + args.state.buttons.right = [610, 600, 160, 50] + + # The variables below are related to the slider + # They allow the user to customize them + # They also give a central location for the render and input methods to get + # information from + # x & y are the coordinates of the leftmost part of the slider line + args.state.slider.x = 400 + args.state.slider.y = 675 + # This is the width of the line + args.state.slider.w = 360 + # This is the offset for the circle + # Allows the center of the circle to be on the line, + # as opposed to the upper right corner + args.state.slider.offset = 20 + # This is the spacing between each of the notches on the slider + # Notches are places where the circle can rest on the slider line + # There needs to be a notch for each step before the maximum number of steps + args.state.slider.spacing = args.state.slider.w.to_f / args.state.max_steps.to_f + end + + # This method is called every frame/tick + # Every tick, the current state of the search is rendered on the screen, + # User input is processed, and + def tick + render + input + end + + # This method is called from tick and renders everything every tick + def render + render_buttons + render_slider + + render_background + render_visited + render_frontier + render_walls + render_star + + render_highlights + render_cell_numbers + end + + # The methods below subdivide the task of drawing everything to the screen + + # Draws the buttons that move the search backward or forward + # These buttons are rendered so the user knows where to click to move the search + def render_buttons + render_left_button + render_right_button + end + + # Renders the button which steps the search backward + # Shows the user where to click to move the search backward + def render_left_button + # Draws the gray button, and a black border + # The border separates the buttons visually + outputs.solids << [buttons.left, gray] + outputs.borders << [buttons.left, black] + + # Renders an explanatory label in the center of the button + # Explains to the user what the button does + label_x = buttons.left.x + 05 + label_y = buttons.left.y + 35 + outputs.labels << [label_x, label_y, "< Step backward"] + end + + # Renders the button which steps the search forward + # Shows the user where to click to move the search forward + def render_right_button + # Draws the gray button, and a black border + # The border separates the buttons visually + outputs.solids << [buttons.right, gray] + outputs.borders << [buttons.right, black] + + # Renders an explanatory label in the center of the button + # Explains to the user what the button does + label_x = buttons.right.x + 10 + label_y = buttons.right.y + 35 + outputs.labels << [label_x, label_y, "Step forward >"] + end + + # Draws the slider so the user can move it and see the progress of the search + def render_slider + # Using primitives hides the line under the white circle of the slider + # Draws the line + outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line + # The circle needs to be offset so that the center of the circle + # overlaps the line instead of the upper right corner of the circle + # The circle's x value is also moved based on the current seach step + circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing) + circle_y = (slider.y - slider.offset) + circle_rect = [circle_x, circle_y, 37, 37] + outputs.primitives << [circle_rect, 'circle-white.png'].sprite + end + + # Draws what the grid looks like with nothing on it + # Which is a bunch of unvisited cells + # Drawn first so other things can draw on top of it + def render_background + render_unvisited + + # The grid lines make the cells appear separate + render_grid_lines + end + + # Draws a rectangle the size of the entire grid to represent unvisited cells + # Unvisited cells are the default cell + def render_unvisited + background = [0, 0, grid.width, grid.height] + outputs.solids << [scale_up(background), unvisited_color] + end + + # Draws grid lines to show the division of the grid into cells + def render_grid_lines + for x in 0..grid.width + outputs.lines << [scale_up(vertical_line(x)), grid_line_color] + end + + for y in 0..grid.height + outputs.lines << [scale_up(horizontal_line(y)), grid_line_color] + end + end + + # Easy way to get a vertical line given an index + def vertical_line column + [column, 0, column, grid.height] + end + + # Easy way to get a horizontal line given an index + def horizontal_line row + [0, row, grid.width, row] + end + + # Draws the area that is going to be searched from + # The frontier is the most outward parts of the search + def render_frontier + state.frontier.each do |cell| + outputs.solids << [scale_up(cell), frontier_color] + end + end + + # Draws the walls + def render_walls + state.walls.each_key do |wall| + outputs.solids << [scale_up(wall), wall_color] + end + end + + # Renders cells that have been searched in the appropriate color + def render_visited + state.visited.each_key do |cell| + outputs.solids << [scale_up(cell), visited_color] + end + end + + # Renders the star + def render_star + outputs.sprites << [scale_up(state.star), 'star.png'] + end + + # Cells have a number rendered in them based on when they were explored + # This is based off of their index in the cell_numbers array + # Cells are added to this array the same time they are added to the frontier array + def render_cell_numbers + state.cell_numbers.each_with_index do |cell, index| + # Math that approx centers the number in the cell + label_x = (cell.x * grid.cell_size) + grid.cell_size / 2 - 5 + label_y = (cell.y * grid.cell_size) + (grid.cell_size / 2) + 5 + + outputs.labels << [label_x, label_y, (index + 1).to_s] + end + end + + # The next frontier to be expanded is highlighted yellow + # Its adjacent non-wall neighbors have their border highlighted green + # This is to show the user how the search expands + def render_highlights + return if state.frontier.empty? + + # Highlight the next frontier to be expanded yellow + next_frontier = state.frontier[0] + outputs.solids << [scale_up(next_frontier), highlighter_yellow] + + # Neighbors have a semi-transparent green layer over them + # Unless the neighbor is a wall + adjacent_neighbors(next_frontier).each do |neighbor| + unless state.walls.has_key?(neighbor) + outputs.solids << [scale_up(neighbor), highlighter_green, 70] + end + end + end + + + # Cell Size is used when rendering to allow the grid to be scaled up or down + # Cells in the frontier array and visited hash and walls hash are stored as x & y + # Scaling up cells and lines when rendering allows omitting of width and height + def scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone + + # If cell is just an x and y coordinate + if cell.size == 2 + # Add a width and height of 1 + cell << 1 + cell << 1 + end + + # Scale all the values up + cell.map! { |value| value * grid.cell_size } + + # Returns the scaled up cell + cell + end + + + # This method processes user input every tick + # This method allows the user to use the buttons, slider, and edit the grid + # There are 2 types of input: + # Button Input + # Click and Drag Input + # + # Button Input is used for the backward step and forward step buttons + # Input is detected by mouse up within the bounds of the rect + # + # Click and Drag Input is used for moving the star, adding walls, + # removing walls, and the slider + # + # When the mouse is down on the star, the click_and_drag variable is set to :star + # While click_and_drag equals :star, the cursor's position is used to calculate the + # appropriate drag behavior + # + # When the mouse goes up click_and_drag is set to :none + # + # A variable has to be used because the star has to continue being edited even + # when the cursor is no longer over the star + # + # Similar things occur for the other Click and Drag inputs + def input + # Processes inputs for the buttons + input_buttons + + # Detects which if any click and drag input is occurring + detect_click_and_drag + + # Does the appropriate click and drag input based on the click_and_drag variable + process_click_and_drag + end + + # Detects and Process input for each button + def input_buttons + input_left_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 + if left_button_clicked? + unless state.anim_steps == 0 + state.anim_steps -= 1 + recalculate + end + end + end + + # Checks if the next step button is clicked + # If it is, it pauses the animation and moves the search one step forward + def input_right_button + if right_button_clicked? + unless state.anim_steps == state.max_steps + state.anim_steps += 1 + # Although normally recalculate would be called here + # because the right button only moves the search forward + # We can just do that + calc + end + end + end + + # Whenever the user edits the grid, + # The search has to be recalculated upto the current step + + def recalculate + # Resets the search + state.frontier = [] + state.visited = {} + state.cell_numbers = [] + + # Moves the animation forward one step at a time + state.anim_steps.times { calc } + end + + + # Determines what the user is clicking and planning on dragging + # Click and drag input is initiated by a click on the appropriate item + # and ended by mouse up + # Storing the value allows the user to continue the same edit as long as the + # mouse left click is held + def detect_click_and_drag + if inputs.mouse.up + state.click_and_drag = :none + elsif star_clicked? + state.click_and_drag = :star + elsif wall_clicked? + state.click_and_drag = :remove_wall + elsif grid_clicked? + state.click_and_drag = :add_wall + elsif slider_clicked? + state.click_and_drag = :slider + end + end + + # Processes input based on what the user is currently dragging + def process_click_and_drag + if state.click_and_drag == :slider + input_slider + elsif state.click_and_drag == :star + input_star + elsif state.click_and_drag == :remove_wall + input_remove_wall + elsif state.click_and_drag == :add_wall + input_add_wall + end + end + + # This method is called when the user is dragging the slider + # It moves the current animation step to the point represented by the slider + def input_slider + 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 + + # 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 + state.anim_steps = ((mouse_x - slider.x) / slider.spacing).to_i + + recalculate + end + + # Moves the star to the grid closest to the mouse + # Only recalculates the search if the star changes position + # Called whenever the user is dragging the star + def input_star + old_star = state.star.clone + state.star = cell_closest_to_mouse + unless old_star == state.star + recalculate + end + end + + # Removes walls that are under the cursor + def input_remove_wall + # The mouse needs to be inside the grid, because we only want to remove walls + # the cursor is directly over + # Recalculations should only occur when a wall is actually deleted + if mouse_inside_grid? + if state.walls.has_key?(cell_closest_to_mouse) + state.walls.delete(cell_closest_to_mouse) + recalculate + end + end + end + + # Adds walls at cells under the cursor + def input_add_wall + # Adds a wall to the hash + # We can use the grid closest to mouse, because the cursor is inside the grid + if mouse_inside_grid? + unless state.walls.has_key?(cell_closest_to_mouse) + state.walls[cell_closest_to_mouse] = true + recalculate + end + end + end + + # This method moves the search forward one step + # When the animation is playing it is called every tick + # And called whenever the current step of the animation needs to be recalculated + + # Moves the search forward one step + # Parameter called_from_tick is true if it is called from the tick method + # It is false when the search is being recalculated after user editing the grid + def calc + # The setup to the search + # Runs once when the there is no frontier or visited cells + if state.frontier.empty? && state.visited.empty? + state.frontier << state.star + state.visited[state.star] = true + end + + # A step in the search + unless state.frontier.empty? + # Takes the next frontier cell + new_frontier = state.frontier.shift + # For each of its neighbors + adjacent_neighbors(new_frontier).each do |neighbor| + # That have not been visited and are not walls + unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor) + # Add them to the frontier and mark them as visited + state.frontier << neighbor + state.visited[neighbor] = true + + # Also assign them a frontier number + state.cell_numbers << neighbor + end + end + end + end + + + # Returns a list of adjacent cells + # Used to determine what the next cells to be added to the frontier are + def adjacent_neighbors cell + neighbors = [] + + neighbors << [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 + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # Finding the grid closest to the mouse helps with this + def cell_closest_to_mouse + x = (inputs.mouse.point.x / grid.cell_size).to_i + y = (inputs.mouse.point.y / grid.cell_size).to_i + x = grid.width - 1 if x > grid.width - 1 + y = grid.height - 1 if y > grid.height - 1 + [x, y] + end + + + # These methods detect when the buttons are clicked + def left_button_clicked? + (inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.left)) || inputs.keyboard.key_up.left + end + + def right_button_clicked? + (inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.right)) || inputs.keyboard.key_up.right + end + + # Signal that the user is going to be moving the slider + def slider_clicked? + circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing) + circle_y = (slider.y - slider.offset) + circle_rect = [circle_x, circle_y, 37, 37] + inputs.mouse.down && inputs.mouse.point.inside_rect?(circle_rect) + end + + # Signal that the user is going to be moving the star + def star_clicked? + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star)) + end + + # Signal that the user is going to be removing walls + def wall_clicked? + inputs.mouse.down && mouse_inside_a_wall? + end + + # Signal that the user is going to be adding walls + def grid_clicked? + inputs.mouse.down && mouse_inside_grid? + end + + # Returns whether the mouse is inside of a wall + # Part of the condition that checks whether the user is removing a wall + def mouse_inside_a_wall? + state.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(scale_up(wall)) + end + + false + end + + # Returns whether the mouse is inside of a grid + # Part of the condition that checks whether the user is adding a wall + def mouse_inside_grid? + inputs.mouse.point.inside_rect?(scale_up([0, 0, grid.width, grid.height])) + end + + # These methods provide handy aliases to colors + + # Light brown + def unvisited_color + [221, 212, 213] + end + + # Black + def grid_line_color + [255, 255, 255] + end + + # Dark Brown + def visited_color + [204, 191, 179] + end + + # Blue + def frontier_color + [103, 136, 204] + end + + # Camo Green + def wall_color + [134, 134, 120] + end + + # Next frontier to be expanded + def highlighter_yellow + [214, 231, 125] + end + + # The neighbors of the next frontier to be expanded + def highlighter_green + [65, 191, 127] + end + + # Button background + def gray + [190, 190, 190] + end + + # Button outline + def black + [0, 0, 0] + end + + # These methods make the code more concise + def grid + state.grid + end + + def buttons + state.buttons + end + + def slider + state.slider + end + end + + + def tick args + # Pressing r resets the program + if args.inputs.keyboard.key_down.r + args.gtk.reset + reset + return + end + + $detailed_breadth_first_search ||= DetailedBreadthFirstSearch.new(args) + $detailed_breadth_first_search.args = args + $detailed_breadth_first_search.tick + end + + + def reset + $detailed_breadth_first_search = nil + end + +#+end_src + +*** Path Finding Algorithms - Breadcrumbs - main.rb +#+begin_src ruby + # ./samples/13_path_finding_algorithms/03_breadcrumbs/app/main.rb + class Breadcrumbs + attr_gtk + + # This method is called every frame/tick + # Every tick, the current state of the search is rendered on the screen, + # User input is processed, and + # The next step in the search is calculated + def tick + defaults + # If the grid has not been searched + if search.came_from.empty? + calc + # Calc Path + end + render + input + end + + def defaults + # Variables to edit the size and appearance of the grid + # Freely customizable to user's liking + grid.width ||= 30 + grid.height ||= 15 + grid.cell_size ||= 40 + grid.rect ||= [0, 0, grid.width, grid.height] + + # The location of the star and walls of the grid + # They can be modified to have a different initial grid + # Walls are stored in a hash for quick look up when doing the search + grid.star ||= [2, 8] + grid.target ||= [10, 5] + grid.walls ||= { + [3, 3] => true, + [3, 4] => true, + [3, 5] => true, + [3, 6] => true, + [3, 7] => true, + [3, 8] => true, + [3, 9] => true, + [3, 10] => true, + [3, 11] => true, + [4, 3] => true, + [4, 4] => true, + [4, 5] => true, + [4, 6] => true, + [4, 7] => true, + [4, 8] => true, + [4, 9] => true, + [4, 10] => true, + [4, 11] => true, + [13, 0] => true, + [13, 1] => true, + [13, 2] => true, + [13, 3] => true, + [13, 4] => true, + [13, 5] => true, + [13, 6] => true, + [13, 7] => true, + [13, 8] => true, + [13, 9] => true, + [13, 10] => true, + [14, 0] => true, + [14, 1] => true, + [14, 2] => true, + [14, 3] => true, + [14, 4] => true, + [14, 5] => true, + [14, 6] => true, + [14, 7] => true, + [14, 8] => true, + [14, 9] => true, + [14, 10] => true, + [21, 8] => true, + [21, 9] => true, + [21, 10] => true, + [21, 11] => true, + [21, 12] => true, + [21, 13] => true, + [21, 14] => true, + [22, 8] => true, + [22, 9] => true, + [22, 10] => true, + [22, 11] => true, + [22, 12] => true, + [22, 13] => true, + [22, 14] => true, + [23, 8] => true, + [23, 9] => true, + [24, 8] => true, + [24, 9] => true, + [25, 8] => true, + [25, 9] => true, + } + + # Variables that are used by the breadth first search + # Storing cells that the search has visited, prevents unnecessary steps + # Expanding the frontier of the search in order makes the search expand + # from the center outward + + # The cells from which the search is to expand + search.frontier ||= [] + # A hash of where each cell was expanded from + # The key is a cell, and the value is the cell it came from + search.came_from ||= {} + # Cells that are part of the path from the target to the star + search.path ||= {} + + # What the user is currently editing on the grid + # We store this value, because we want to remember the value even when + # the user's cursor is no longer over what they're interacting with, but + # they are still clicking down on the mouse. + state.current_input ||= :none + end + + def calc + # Setup the search to start from the star + search.frontier << grid.star + search.came_from[grid.star] = nil + + # Until there are no more cells to expand from + until search.frontier.empty? + # Takes the next frontier cell + new_frontier = search.frontier.shift + # For each of its neighbors + adjacent_neighbors(new_frontier).each do |neighbor| + # That have not been visited and are not walls + unless search.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor) + # Add them to the frontier and mark them as visited in the first grid + # Unless the target has been visited + # Add the neighbor to the frontier and remember which cell it came from + search.frontier << neighbor + search.came_from[neighbor] = new_frontier + end + end + end + end + + + # Draws everything onto the screen + def render + render_background + # render_heat_map + render_walls + # render_path + # render_labels + render_arrows + render_star + render_target + unless grid.walls.has_key?(grid.target) + render_trail + end + end + + def render_trail(current_cell=grid.target) + return if current_cell == grid.star + parent_cell = search.came_from[current_cell] + if current_cell && parent_cell + outputs.lines << [(current_cell.x + 0.5) * grid.cell_size, (current_cell.y + 0.5) * grid.cell_size, + (parent_cell.x + 0.5) * grid.cell_size, (parent_cell.y + 0.5) * grid.cell_size, purple] + + end + render_trail(parent_cell) + end + + def render_arrows + search.came_from.each do |child, parent| + if parent && child + arrow_cell = [(child.x + parent.x) / 2, (child.y + parent.y) / 2] + if parent.x > child.x # If the parent cell is to the right of the child cell + outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 0] # Point the arrow to the right + elsif parent.x < child.x # If the parent cell is to the right of the child cell + outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 180] # Point the arrow to the right + elsif parent.y > child.y # If the parent cell is to the right of the child cell + outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 90] # Point the arrow to the right + elsif parent.y < child.y # If the parent cell is to the right of the child cell + outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 270] # Point the arrow to the right + end + end + end + end + + # The methods below subdivide the task of drawing everything to the screen + + # Draws what the grid looks like with nothing on it + def render_background + render_unvisited + render_grid_lines + end + + # Draws both grids + def render_unvisited + outputs.solids << [scale_up(grid.rect), unvisited_color] + end + + # Draws grid lines to show the division of the grid into cells + def render_grid_lines + for x in 0..grid.width + outputs.lines << vertical_line(x) + end + + for y in 0..grid.height + outputs.lines << horizontal_line(y) + end + end + + # Easy way to draw vertical lines given an index + def vertical_line column + scale_up([column, 0, column, grid.height]) + end + + # Easy way to draw horizontal lines given an index + def horizontal_line row + scale_up([0, row, grid.width, row]) + end + + # Draws the walls on both grids + def render_walls + grid.walls.each_key do |wall| + outputs.solids << [scale_up(wall), wall_color] + end + end + + # Renders the star on both grids + def render_star + outputs.sprites << [scale_up(grid.star), 'star.png'] + end + + # Renders the target on both grids + def render_target + outputs.sprites << [scale_up(grid.target), 'target.png'] + end + + # Labels the grids + def render_labels + outputs.labels << [200, 625, "Without early exit"] + end + + # Renders the path based off of the search.path hash + def render_path + # If the star and target are disconnected there will only be one path + # The path should not render in that case + unless search.path.size == 1 + search.path.each_key do | cell | + # Renders path on both grids + outputs.solids << [scale_up(cell), path_color] + end + end + end + + # Calculates the path from the target to the star after the search is over + # Relies on the came_from hash + # Fills the search.path hash, which is later rendered on screen + def calc_path + endpoint = grid.target + while endpoint + search.path[endpoint] = true + endpoint = search.came_from[endpoint] + end + end + + # In code, the cells are represented as 1x1 rectangles + # When drawn, the cells are larger than 1x1 rectangles + # This method is used to scale up cells, and lines + # Objects are scaled up according to the grid.cell_size variable + # This allows for easy customization of the visual scale of the grid + def scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone + + # If cell is just an x and y coordinate + if cell.size == 2 + # Add a width and height of 1 + cell << 1 + cell << 1 + end + + # Scale all the values up + cell.map! { |value| value * grid.cell_size } + + # Returns the scaled up cell + cell + end + + # This method processes user input every tick + # Any method with "1" is related to the first grid + # Any method with "2" is related to the second grid + def input + # The program has to remember that the user is dragging an object + # even when the mouse is no longer over that object + # So detecting input and processing input is separate + # detect_input + # process_input + if inputs.mouse.up + state.current_input = :none + elsif star_clicked? + state.current_input = :star + end + + if mouse_inside_grid? + unless grid.target == cell_closest_to_mouse + grid.target = cell_closest_to_mouse + end + if state.current_input == :star + unless grid.star == cell_closest_to_mouse + grid.star = cell_closest_to_mouse + end + end + end + end + + # Determines what the user is editing and stores the value + # Storing the value allows the user to continue the same edit as long as the + # mouse left click is held + def detect_input + # When the mouse is up, nothing is being edited + if inputs.mouse.up + state.current_input = :none + # When the star in the no second grid is clicked + elsif star_clicked? + state.current_input = :star + # When the target in the no second grid is clicked + elsif target_clicked? + state.current_input = :target + # When a wall in the first grid is clicked + elsif wall_clicked? + state.current_input = :remove_wall + # When the first grid is clicked + elsif grid_clicked? + state.current_input = :add_wall + end + end + + # Processes click and drag based on what the user is currently dragging + def process_input + if state.current_input == :star + input_star + elsif state.current_input == :target + input_target + elsif state.current_input == :remove_wall + input_remove_wall + elsif state.current_input == :add_wall + input_add_wall + end + end + + # Moves the star to the cell closest to the mouse in the first grid + # Only resets the search if the star changes position + # Called whenever the user is editing the star (puts mouse down on star) + def input_star + old_star = grid.star.clone + grid.star = cell_closest_to_mouse + unless old_star == grid.star + reset_search + end + end + + # Moves the target to the grid closest to the mouse in the first grid + # Only reset_searchs the search if the target changes position + # Called whenever the user is editing the target (puts mouse down on target) + def input_target + old_target = grid.target.clone + grid.target = cell_closest_to_mouse + unless old_target == grid.target + reset_search + end + end + + # Removes walls in the first grid that are under the cursor + def input_remove_wall + # The mouse needs to be inside the grid, because we only want to remove walls + # the cursor is directly over + # Recalculations should only occur when a wall is actually deleted + if mouse_inside_grid? + if grid.walls.has_key?(cell_closest_to_mouse) + grid.walls.delete(cell_closest_to_mouse) + reset_search + end + end + end + + # Adds a wall in the first grid in the cell the mouse is over + def input_add_wall + if mouse_inside_grid? + unless grid.walls.has_key?(cell_closest_to_mouse) + grid.walls[cell_closest_to_mouse] = true + reset_search + end + end + end + + + # Whenever the user edits the grid, + # The search has to be reset_searchd upto the current step + # with the current grid as the initial state of the grid + def reset_search + # Reset_Searchs the search + search.frontier = [] + search.came_from = {} + search.path = {} + end + + + # Returns a list of adjacent cells + # Used to determine what the next cells to be added to the frontier are + def adjacent_neighbors(cell) + neighbors = [] + + # 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 + + # Sorts the neighbors so the rendered path is a zigzag path + # Cells in a diagonal direction are given priority + # Comment this line to see the difference + neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) } + + neighbors + end + + # Finds the vertical and horizontal distance of a cell from the star + # and returns the larger value + # This method is used to have a zigzag pattern in the rendered path + # A cell that is [5, 5] from the star, + # is explored before over a cell that is [0, 7] away. + # So, if possible, the search tries to go diagonal (zigzag) first + def proximity_to_star(x, y) + distance_x = (grid.star.x - x).abs + distance_y = (grid.star.y - y).abs + + if distance_x > distance_y + return distance_x + else + return distance_y + end + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # Finding the cell closest to the mouse helps with this + def cell_closest_to_mouse + # Closest cell to the mouse in the first grid + x = (inputs.mouse.point.x / grid.cell_size).to_i + y = (inputs.mouse.point.y / grid.cell_size).to_i + # 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 + # Return closest cell + [x, y] + end + + # Signal that the user is going to be moving the star from the first grid + def star_clicked? + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(grid.star)) + end + + # Signal that the user is going to be moving the target from the first grid + def target_clicked? + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(grid.target)) + end + + # Signal that the user is going to be adding walls from the first grid + def grid_clicked? + inputs.mouse.down && mouse_inside_grid? + end + + # Returns whether the mouse is inside of the first grid + # Part of the condition that checks whether the user is adding a wall + def mouse_inside_grid? + inputs.mouse.point.inside_rect?(scale_up(grid.rect)) + end + + # These methods provide handy aliases to colors + + # Light brown + def unvisited_color + [221, 212, 213] + # [255, 255, 255] + end + + # Camo Green + def wall_color + [134, 134, 120] + end + + # Pastel White + def path_color + [231, 230, 228] + end + + def red + [255, 0, 0] + end + + def purple + [149, 64, 191] + end + + # Makes code more concise + def grid + state.grid + end + + def search + state.search + end + end + + # Method that is called by DragonRuby periodically + # Used for updating animations and calculations + def tick args + + # Pressing r will reset the application + if args.inputs.keyboard.key_down.r + args.gtk.reset + reset + return + end + + # Every tick, new args are passed, and the Breadth First Search tick is called + $breadcrumbs ||= Breadcrumbs.new(args) + $breadcrumbs.args = args + $breadcrumbs.tick + end + + + def reset + $breadcrumbs = nil + end + + # # Representation of how far away visited cells are from the star + # # Replaces the render_visited method + # # Visually demonstrates the effectiveness of early exit for pathfinding + # def render_heat_map + # # THIS CODE NEEDS SOME FIXING DUE TO REFACTORING + # search.came_from.each_key do | cell | + # distance = (grid.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs + # max_distance = grid.width + grid.height + # alpha = 255.to_i * distance.to_i / max_distance.to_i + # outputs.solids << [scale_up(visited_cell), red, alpha] + # # outputs.solids << [early_exit_scale_up(visited_cell), red, alpha] + # end + # end + +#+end_src + +*** Path Finding Algorithms - Early Exit - main.rb +#+begin_src 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 + + # Demonstrates the exploration difference caused by early exit + # Also demonstrates how breadth first search is used for path generation + + # The left grid is a breadth first search without early exit + # The right grid is a breadth first search with early exit + # The red squares represent how far the search expanded + # The darker the red, the farther the search proceeded + # Comparison of the heat map reveals how much searching can be saved by early exit + # The white path shows path generation via breadth first search + class EarlyExitBreadthFirstSearch + attr_gtk + + # This method is called every frame/tick + # Every tick, the current state of the search is rendered on the screen, + # User input is processed, and + # The next step in the search is calculated + def tick + defaults + # If the grid has not been searched + if state.visited.empty? + # Complete the search + state.max_steps.times { step } + # And calculate the path + calc_path + end + render + input + end + + def defaults + # Variables to edit the size and appearance of the grid + # Freely customizable to user's liking + grid.width ||= 15 + grid.height ||= 15 + grid.cell_size ||= 40 + grid.rect ||= [0, 0, grid.width, grid.height] + + # At some step the animation will end, + # and further steps won't change anything (the whole grid.widthill be explored) + # This step is roughly the grid's width * height + # When anim_steps equals max_steps no more calculations will occur + # and the slider will be at the end + state.max_steps ||= args.state.grid.width * args.state.grid.height + + # The location of the star and walls of the grid + # They can be modified to have a different initial grid + # Walls are stored in a hash for quick look up when doing the search + state.star ||= [2, 8] + state.target ||= [10, 5] + state.walls ||= {} + + # Variables that are used by the breadth first search + # Storing cells that the search has visited, prevents unnecessary steps + # Expanding the frontier of the search in order makes the search expand + # from the center outward + + # Visited cells in the first grid + state.visited ||= {} + # Visited cells in the second grid + state.early_exit_visited ||= {} + # The cells from which the search is to expand + state.frontier ||= [] + # A hash of where each cell was expanded from + # The key is a cell, and the value is the cell it came from + state.came_from ||= {} + # Cells that are part of the path from the target to the star + state.path ||= {} + + # What the user is currently editing on the grid + # We store this value, because we want to remember the value even when + # the user's cursor is no longer over what they're interacting with, but + # they are still clicking down on the mouse. + state.current_input ||= :none + end + + # Draws everything onto the screen + def render + render_background + render_heat_map + render_walls + render_path + render_star + render_target + render_labels + end + + # The methods below subdivide the task of drawing everything to the screen + + # Draws what the grid looks like with nothing on it + def render_background + render_unvisited + render_grid_lines + end + + # Draws both grids + def render_unvisited + outputs.solids << [scale_up(grid.rect), unvisited_color] + outputs.solids << [early_exit_scale_up(grid.rect), unvisited_color] + end + + # Draws grid lines to show the division of the grid into cells + def render_grid_lines + for x in 0..grid.width + outputs.lines << vertical_line(x) + outputs.lines << early_exit_vertical_line(x) + end + + for y in 0..grid.height + outputs.lines << horizontal_line(y) + outputs.lines << early_exit_horizontal_line(y) + end + end + + # Easy way to draw vertical lines given an index + def vertical_line column + scale_up([column, 0, column, grid.height]) + end + + # Easy way to draw horizontal lines given an index + def horizontal_line row + scale_up([0, row, grid.width, row]) + end + + # Easy way to draw vertical lines given an index + def early_exit_vertical_line column + scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height]) + end + + # Easy way to draw horizontal lines given an index + def early_exit_horizontal_line row + scale_up([grid.width + 1, row, grid.width + grid.width + 1, row]) + end + + # Draws the walls on both grids + def render_walls + state.walls.each_key do |wall| + outputs.solids << [scale_up(wall), wall_color] + outputs.solids << [early_exit_scale_up(wall), wall_color] + end + end + + # Renders the star on both grids + def render_star + outputs.sprites << [scale_up(state.star), 'star.png'] + outputs.sprites << [early_exit_scale_up(state.star), 'star.png'] + end + + # Renders the target on both grids + def render_target + outputs.sprites << [scale_up(state.target), 'target.png'] + outputs.sprites << [early_exit_scale_up(state.target), 'target.png'] + end + + # Labels the grids + def render_labels + outputs.labels << [200, 625, "Without early exit"] + outputs.labels << [875, 625, "With early exit"] + end + + # Renders the path based off of the state.path hash + def render_path + # If the star and target are disconnected there will only be one path + # The path should not render in that case + unless state.path.size == 1 + state.path.each_key do | cell | + # Renders path on both grids + outputs.solids << [scale_up(cell), path_color] + outputs.solids << [early_exit_scale_up(cell), path_color] + end + end + end + + # Calculates the path from the target to the star after the search is over + # Relies on the came_from hash + # Fills the state.path hash, which is later rendered on screen + def calc_path + endpoint = state.target + while endpoint + state.path[endpoint] = true + endpoint = state.came_from[endpoint] + end + end + + # Representation of how far away visited cells are from the star + # Replaces the render_visited method + # Visually demonstrates the effectiveness of early exit for pathfinding + def render_heat_map + state.visited.each_key do | visited_cell | + distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs + max_distance = grid.width + grid.height + alpha = 255.to_i * distance.to_i / max_distance.to_i + outputs.solids << [scale_up(visited_cell), red, alpha] + # outputs.solids << [early_exit_scale_up(visited_cell), red, alpha] + end + + state.early_exit_visited.each_key do | visited_cell | + distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs + max_distance = grid.width + grid.height + alpha = 255.to_i * distance.to_i / max_distance.to_i + outputs.solids << [early_exit_scale_up(visited_cell), red, alpha] + end + end + + # Translates the given cell grid.width + 1 to the right and then scales up + # Used to draw cells for the second grid + # This method does not work for lines, + # so separate methods exist for the grid lines + def early_exit_scale_up(cell) + cell_clone = cell.clone + cell_clone.x += grid.width + 1 + scale_up(cell_clone) + end + + # In code, the cells are represented as 1x1 rectangles + # When drawn, the cells are larger than 1x1 rectangles + # This method is used to scale up cells, and lines + # Objects are scaled up according to the grid.cell_size variable + # This allows for easy customization of the visual scale of the grid + def scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone + + # If cell is just an x and y coordinate + if cell.size == 2 + # Add a width and height of 1 + cell << 1 + cell << 1 + end + + # Scale all the values up + cell.map! { |value| value * grid.cell_size } + + # Returns the scaled up cell + cell + end + + # This method processes user input every tick + # Any method with "1" is related to the first grid + # Any method with "2" is related to the second grid + def input + # The program has to remember that the user is dragging an object + # even when the mouse is no longer over that object + # So detecting input and processing input is separate + detect_input + process_input + end + + # Determines what the user is editing and stores the value + # Storing the value allows the user to continue the same edit as long as the + # mouse left click is held + def detect_input + # When the mouse is up, nothing is being edited + if inputs.mouse.up + state.current_input = :none + # When the star in the no second grid is clicked + elsif star_clicked? + state.current_input = :star + # When the star in the second grid is clicked + elsif star2_clicked? + state.current_input = :star2 + # When the target in the no second grid is clicked + elsif target_clicked? + state.current_input = :target + # When the target in the second grid is clicked + elsif target2_clicked? + state.current_input = :target2 + # When a wall in the first grid is clicked + elsif wall_clicked? + state.current_input = :remove_wall + # When a wall in the second grid is clicked + elsif wall2_clicked? + state.current_input = :remove_wall2 + # When the first grid is clicked + elsif grid_clicked? + state.current_input = :add_wall + # When the second grid is clicked + elsif grid2_clicked? + state.current_input = :add_wall2 + end + end + + # Processes click and drag based on what the user is currently dragging + def process_input + if state.current_input == :star + input_star + elsif state.current_input == :star2 + input_star2 + elsif state.current_input == :target + input_target + elsif state.current_input == :target2 + input_target2 + elsif state.current_input == :remove_wall + input_remove_wall + elsif state.current_input == :remove_wall2 + input_remove_wall2 + elsif state.current_input == :add_wall + input_add_wall + elsif state.current_input == :add_wall2 + input_add_wall2 + end + end + + # Moves the star to the cell closest to the mouse in the first grid + # Only resets the search if the star changes position + # Called whenever the user is editing the star (puts mouse down on star) + def input_star + old_star = state.star.clone + state.star = cell_closest_to_mouse + unless old_star == state.star + reset_search + end + end + + # Moves the star to the cell closest to the mouse in the second grid + # Only resets the search if the star changes position + # Called whenever the user is editing the star (puts mouse down on star) + def input_star2 + old_star = state.star.clone + state.star = cell_closest_to_mouse2 + unless old_star == state.star + reset_search + end + end + + # Moves the target to the grid closest to the mouse in the first grid + # Only reset_searchs the search if the target changes position + # Called whenever the user is editing the target (puts mouse down on target) + def input_target + old_target = state.target.clone + state.target = cell_closest_to_mouse + unless old_target == state.target + reset_search + end + end + + # Moves the target to the cell closest to the mouse in the second grid + # Only reset_searchs the search if the target changes position + # Called whenever the user is editing the target (puts mouse down on target) + def input_target2 + old_target = state.target.clone + state.target = cell_closest_to_mouse2 + unless old_target == state.target + reset_search + end + end + + # Removes walls in the first grid that are under the cursor + def input_remove_wall + # The mouse needs to be inside the grid, because we only want to remove walls + # the cursor is directly over + # Recalculations should only occur when a wall is actually deleted + if mouse_inside_grid? + if state.walls.has_key?(cell_closest_to_mouse) + state.walls.delete(cell_closest_to_mouse) + reset_search + end + end + end + + # Removes walls in the second grid that are under the cursor + def input_remove_wall2 + # The mouse needs to be inside the grid, because we only want to remove walls + # the cursor is directly over + # Recalculations should only occur when a wall is actually deleted + if mouse_inside_grid2? + if state.walls.has_key?(cell_closest_to_mouse2) + state.walls.delete(cell_closest_to_mouse2) + reset_search + end + end + end + + # Adds a wall in the first grid in the cell the mouse is over + def input_add_wall + if mouse_inside_grid? + unless state.walls.has_key?(cell_closest_to_mouse) + state.walls[cell_closest_to_mouse] = true + reset_search + end + end + end + + + # Adds a wall in the second grid in the cell the mouse is over + def input_add_wall2 + if mouse_inside_grid2? + unless state.walls.has_key?(cell_closest_to_mouse2) + state.walls[cell_closest_to_mouse2] = true + reset_search + end + end + end + + # Whenever the user edits the grid, + # The search has to be reset_searchd upto the current step + # with the current grid as the initial state of the grid + def reset_search + # Reset_Searchs the search + state.frontier = [] + state.visited = {} + state.early_exit_visited = {} + state.came_from = {} + state.path = {} + end + + # Moves the search forward one step + def step + # The setup to the search + # Runs once when there are no visited cells + if state.visited.empty? + state.visited[state.star] = true + state.early_exit_visited[state.star] = true + state.frontier << state.star + state.came_from[state.star] = nil + end + + # A step in the search + unless state.frontier.empty? + # Takes the next frontier cell + new_frontier = state.frontier.shift + # For each of its neighbors + adjacent_neighbors(new_frontier).each do |neighbor| + # That have not been visited and are not walls + unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor) + # Add them to the frontier and mark them as visited in the first grid + state.visited[neighbor] = true + # Unless the target has been visited + unless state.visited.has_key?(state.target) + # Mark the neighbor as visited in the second grid as well + state.early_exit_visited[neighbor] = true + end + + # Add the neighbor to the frontier and remember which cell it came from + state.frontier << neighbor + state.came_from[neighbor] = new_frontier + end + end + end + end + + + # Returns a list of adjacent cells + # Used to determine what the next cells to be added to the frontier are + def adjacent_neighbors(cell) + neighbors = [] + + # 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 + + # Sorts the neighbors so the rendered path is a zigzag path + # Cells in a diagonal direction are given priority + # Comment this line to see the difference + neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) } + + neighbors + end + + # Finds the vertical and horizontal distance of a cell from the star + # and returns the larger value + # This method is used to have a zigzag pattern in the rendered path + # A cell that is [5, 5] from the star, + # is explored before over a cell that is [0, 7] away. + # So, if possible, the search tries to go diagonal (zigzag) first + def proximity_to_star(x, y) + distance_x = (state.star.x - x).abs + distance_y = (state.star.y - y).abs + + if distance_x > distance_y + return distance_x + else + return distance_y + end + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # Finding the cell closest to the mouse helps with this + def cell_closest_to_mouse + # Closest cell to the mouse in the first grid + x = (inputs.mouse.point.x / grid.cell_size).to_i + y = (inputs.mouse.point.y / grid.cell_size).to_i + # 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 + # Return closest cell + [x, y] + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # Finding the cell closest to the mouse in the second grid helps with this + def cell_closest_to_mouse2 + # Closest cell grid to the mouse in the second + x = (inputs.mouse.point.x / grid.cell_size).to_i + y = (inputs.mouse.point.y / grid.cell_size).to_i + # Translate the cell to the first grid + x -= grid.width + 1 + # Bound x and y to the first grid + x = grid.width - 1 if x > grid.width - 1 + y = grid.height - 1 if y > grid.height - 1 + # Return closest cell + [x, y] + end + + # Signal that the user is going to be moving the star from the first grid + def star_clicked? + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star)) + end + + # Signal that the user is going to be moving the star from the second grid + def star2_clicked? + inputs.mouse.down && inputs.mouse.point.inside_rect?(early_exit_scale_up(state.star)) + end + + # Signal that the user is going to be moving the target from the first grid + def target_clicked? + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.target)) + end + + # Signal that the user is going to be moving the target from the second grid + def target2_clicked? + inputs.mouse.down && inputs.mouse.point.inside_rect?(early_exit_scale_up(state.target)) + end + + # Signal that the user is going to be removing walls from the first grid + def wall_clicked? + inputs.mouse.down && mouse_inside_wall? + end + + # Signal that the user is going to be removing walls from the second grid + def wall2_clicked? + inputs.mouse.down && mouse_inside_wall2? + end + + # Signal that the user is going to be adding walls from the first grid + def grid_clicked? + inputs.mouse.down && mouse_inside_grid? + end + + # Signal that the user is going to be adding walls from the second grid + def grid2_clicked? + inputs.mouse.down && mouse_inside_grid2? + end + + # Returns whether the mouse is inside of a wall in the first grid + # Part of the condition that checks whether the user is removing a wall + def mouse_inside_wall? + state.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(scale_up(wall)) + end + + false + end + + # Returns whether the mouse is inside of a wall in the second grid + # Part of the condition that checks whether the user is removing a wall + def mouse_inside_wall2? + state.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(early_exit_scale_up(wall)) + end + + false + end + + # Returns whether the mouse is inside of the first grid + # Part of the condition that checks whether the user is adding a wall + def mouse_inside_grid? + inputs.mouse.point.inside_rect?(scale_up(grid.rect)) + end + + # Returns whether the mouse is inside of the second grid + # Part of the condition that checks whether the user is adding a wall + def mouse_inside_grid2? + inputs.mouse.point.inside_rect?(early_exit_scale_up(grid.rect)) + end + + # These methods provide handy aliases to colors + + # Light brown + def unvisited_color + [221, 212, 213] + end + + # Camo Green + def wall_color + [134, 134, 120] + end + + # Pastel White + def path_color + [231, 230, 228] + end + + def red + [255, 0, 0] + end + + # Makes code more concise + def grid + state.grid + end + end + + # Method that is called by DragonRuby periodically + # Used for updating animations and calculations + def tick args + + # Pressing r will reset the application + if args.inputs.keyboard.key_down.r + args.gtk.reset + reset + return + end + + # Every tick, new args are passed, and the Breadth First Search tick is called + $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new(args) + $early_exit_breadth_first_search.args = args + $early_exit_breadth_first_search.tick + end + + + def reset + $early_exit_breadth_first_search = nil + end + +#+end_src + +*** Path Finding Algorithms - Dijkstra - main.rb +#+begin_src ruby + # ./samples/13_path_finding_algorithms/05_dijkstra/app/main.rb + # Demonstrates how Dijkstra's Algorithm allows movement costs to be considered + + # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html + + # The first grid is a breadth first search with an early exit. + # It shows a heat map of all the cells that were visited by the search and their relative distance. + + # The second grid is an implementation of Dijkstra's algorithm. + # Light green cells have 5 times the movement cost of regular cells. + # The heat map will darken based on movement cost. + + # Dark green cells are walls, and the search cannot go through them. + class Movement_Costs + attr_gtk + + # This method is called every frame/tick + # Every tick, the current state of the search is rendered on the screen, + # User input is processed, and + # The next step in the search is calculated + def tick + defaults + render + input + calc + end + + def defaults + # Variables to edit the size and appearance of the grid + # Freely customizable to user's liking + grid.width ||= 10 + grid.height ||= 10 + grid.cell_size ||= 60 + grid.rect ||= [0, 0, grid.width, grid.height] + + # The location of the star and walls of the grid + # They can be modified to have a different initial grid + # Walls are stored in a hash for quick look up when doing the search + state.star ||= [1, 5] + state.target ||= [8, 4] + state.walls ||= {[1, 1] => true, [2, 1] => true, [3, 1] => true, [1, 2] => true, [2, 2] => true, [3, 2] => true} + state.hills ||= { + [4, 1] => true, + [5, 1] => true, + [4, 2] => true, + [5, 2] => true, + [6, 2] => true, + [4, 3] => true, + [5, 3] => true, + [6, 3] => true, + [3, 4] => true, + [4, 4] => true, + [5, 4] => true, + [6, 4] => true, + [7, 4] => true, + [3, 5] => true, + [4, 5] => true, + [5, 5] => true, + [6, 5] => true, + [7, 5] => true, + [4, 6] => true, + [5, 6] => true, + [6, 6] => true, + [7, 6] => true, + [4, 7] => true, + [5, 7] => true, + [6, 7] => true, + [4, 8] => true, + [5, 8] => true, + } + + # What the user is currently editing on the grid + # 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 + + # Values that are used for the breadth first search + # Keeping track of what cells were visited prevents counting cells multiple times + breadth_first_search.visited ||= {} + # The cells from which the breadth first search will expand + breadth_first_search.frontier ||= [] + # Keeps track of which cell all cells were searched from + # Used to recreate the path from the target to the star + breadth_first_search.came_from ||= {} + + # Keeps track of the movement cost so far to be at a cell + # Allows the costs of new cells to be quickly calculated + # Also doubles as a way to check if cells have already been visited + dijkstra_search.cost_so_far ||= {} + # The cells from which the Dijkstra search will expand + dijkstra_search.frontier ||= [] + # Keeps track of which cell all cells were searched from + # Used to recreate the path from the target to the star + dijkstra_search.came_from ||= {} + end + + # Draws everything onto the screen + def render + render_background + + render_heat_maps + + render_star + render_target + render_hills + render_walls + + render_paths + end + # The methods below subdivide the task of drawing everything to the screen + + # Draws what the grid looks like with nothing on it + def render_background + render_unvisited + render_grid_lines + render_labels + end + + # Draws two rectangles the size of the grid in the default cell color + # Used as part of the background + def render_unvisited + outputs.solids << [scale_up(grid.rect), unvisited_color] + outputs.solids << [move_and_scale_up(grid.rect), unvisited_color] + end + + # Draws grid lines to show the division of the grid into cells + def render_grid_lines + for x in 0..grid.width + outputs.lines << vertical_line(x) + outputs.lines << shifted_vertical_line(x) + end + + for y in 0..grid.height + outputs.lines << horizontal_line(y) + outputs.lines << shifted_horizontal_line(y) + end + end + + # Easy way to draw vertical lines given an index for the first grid + def vertical_line column + scale_up([column, 0, column, grid.height]) + end + + # Easy way to draw horizontal lines given an index for the second grid + def horizontal_line row + scale_up([0, row, grid.width, row]) + end + + # Easy way to draw vertical lines given an index for the first grid + def shifted_vertical_line column + scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height]) + end + + # Easy way to draw horizontal lines given an index for the second grid + def shifted_horizontal_line row + scale_up([grid.width + 1, row, grid.width + grid.width + 1, row]) + end + + # Labels the grids + def render_labels + outputs.labels << [175, 650, "Number of steps", 3] + outputs.labels << [925, 650, "Distance", 3] + end + + def render_paths + render_breadth_first_search_path + render_dijkstra_path + end + + def render_heat_maps + render_breadth_first_search_heat_map + render_dijkstra_heat_map + end + + # Renders the breadth first search on the first grid + def render_breadth_first_search + end + + # This heat map shows the cells explored by the breadth first search and how far they are from the star. + def render_breadth_first_search_heat_map + # For each cell explored + breadth_first_search.visited.each_key do | visited_cell | + # Find its distance from the star + distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs + max_distance = grid.width + grid.height + # Get it as a percent of the maximum distance and scale to 255 for use as an alpha value + alpha = 255.to_i * distance.to_i / max_distance.to_i + outputs.solids << [scale_up(visited_cell), red, alpha] + end + end + + def render_breadth_first_search_path + # If the search found the target + if breadth_first_search.visited.has_key?(state.target) + # Start from the target + endpoint = state.target + # And the cell it came from + next_endpoint = breadth_first_search.came_from[endpoint] + while endpoint and next_endpoint + # Draw a path between these two cells + path = get_path_between(endpoint, next_endpoint) + outputs.solids << [scale_up(path), path_color] + # And get the next pair of cells + endpoint = next_endpoint + next_endpoint = breadth_first_search.came_from[endpoint] + # Continue till there are no more cells + end + end + end + + # Renders the Dijkstra search on the second grid + def render_dijkstra + end + + def render_dijkstra_heat_map + dijkstra_search.cost_so_far.each do |visited_cell, cost| + max_cost = (grid.width + grid.height) #* 5 + alpha = 255.to_i * cost.to_i / max_cost.to_i + outputs.solids << [move_and_scale_up(visited_cell), red, alpha] + end + end + + def render_dijkstra_path + # If the search found the target + if dijkstra_search.came_from.has_key?(state.target) + # Get the target and the cell it came from + endpoint = state.target + next_endpoint = dijkstra_search.came_from[endpoint] + while endpoint and next_endpoint + # Draw a path between them + path = get_path_between(endpoint, next_endpoint) + outputs.solids << [move_and_scale_up(path), path_color] + + # Shift one cell down the path + endpoint = next_endpoint + next_endpoint = dijkstra_search.came_from[endpoint] + + # Repeat till the end of the path + end + end + end + + # Renders the star on both grids + def render_star + outputs.sprites << [scale_up(state.star), 'star.png'] + outputs.sprites << [move_and_scale_up(state.star), 'star.png'] + end + + # Renders the target on both grids + def render_target + outputs.sprites << [scale_up(state.target), 'target.png'] + outputs.sprites << [move_and_scale_up(state.target), 'target.png'] + end + + def render_hills + state.hills.each_key do |hill| + outputs.solids << [scale_up(hill), hill_color] + outputs.solids << [move_and_scale_up(hill), hill_color] + end + end + + # Draws the walls on both grids + def render_walls + state.walls.each_key do |wall| + outputs.solids << [scale_up(wall), wall_color] + outputs.solids << [move_and_scale_up(wall), wall_color] + end + end + + def get_path_between(cell_one, cell_two) + path = nil + if cell_one.x == cell_two.x + if cell_one.y < cell_two.y + path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4] + else + path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4] + end + else + if cell_one.x < cell_two.x + path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4] + else + path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4] + end + end + path + end + + # Representation of how far away visited cells are from the star + # Replaces the render_visited method + # Visually demonstrates the effectiveness of early exit for pathfinding + def render_breadth_first_search_heat_map + breadth_first_search.visited.each_key do | visited_cell | + distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs + max_distance = grid.width + grid.height + alpha = 255.to_i * distance.to_i / max_distance.to_i + outputs.solids << [scale_up(visited_cell), red, alpha] + end + end + + # Translates the given cell grid.width + 1 to the right and then scales up + # Used to draw cells for the second grid + # This method does not work for lines, + # so separate methods exist for the grid lines + def move_and_scale_up(cell) + cell_clone = cell.clone + cell_clone.x += grid.width + 1 + scale_up(cell_clone) + end + + # In code, the cells are represented as 1x1 rectangles + # When drawn, the cells are larger than 1x1 rectangles + # This method is used to scale up cells, and lines + # Objects are scaled up according to the grid.cell_size variable + # This allows for easy customization of the visual scale of the grid + def scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone + + # If cell is just an x and y coordinate + if cell.size == 2 + # Add a width and height of 1 + cell << 1 + cell << 1 + end + + # Scale all the values up + cell.map! { |value| value * grid.cell_size } + + # Returns the scaled up cell + cell + end + + # Handles user input every tick so the grid can be edited + # Separate input detection and processing is needed + # For example: Adding walls is started by clicking down on a hill, + # but the mouse doesn't need to remain over hills to add walls + def input + # If the mouse was lifted this tick + if inputs.mouse.up + # Set current input to none + state.user_input = :none + end + + # If the mouse was clicked this tick + if inputs.mouse.down + # Determine what the user is editing and edit the state.user_input variable + determine_input + end + + # Process user input based on user_input variable and current mouse position + process_input + end + + # Determines what the user is editing and stores the value + # This method is called the tick the mouse is clicked + # Storing the value allows the user to continue the same edit as long as the + # mouse left click is held + def determine_input + # If the mouse is over the star in the first grid + if mouse_over_star? + # The user is editing the star from the first grid + state.user_input = :star + # If the mouse is over the star in the second grid + elsif mouse_over_star2? + # The user is editing the star from the second grid + state.user_input = :star2 + # If the mouse is over the target in the first grid + elsif mouse_over_target? + # The user is editing the target from the first grid + state.user_input = :target + # If the mouse is over the target in the second grid + elsif mouse_over_target2? + # The user is editing the target from the second grid + state.user_input = :target2 + # If the mouse is over a wall in the first grid + elsif mouse_over_wall? + # The user is removing a wall from the first grid + state.user_input = :remove_wall + # If the mouse is over a wall in the second grid + elsif mouse_over_wall2? + # The user is removing a wall from the second grid + state.user_input = :remove_wall2 + # If the mouse is over a hill in the first grid + elsif mouse_over_hill? + # The user is adding a wall from the first grid + state.user_input = :add_wall + # If the mouse is over a hill in the second grid + elsif mouse_over_hill2? + # The user is adding a wall from the second grid + state.user_input = :add_wall2 + # If the mouse is over the first grid + elsif mouse_over_grid? + # The user is adding a hill from the first grid + state.user_input = :add_hill + # If the mouse is over the second grid + elsif mouse_over_grid2? + # The user is adding a hill from the second grid + state.user_input = :add_hill2 + end + end + + # Processes click and drag based on what the user is currently dragging + def process_input + if state.user_input == :star + input_star + elsif state.user_input == :star2 + input_star2 + elsif state.user_input == :target + input_target + elsif state.user_input == :target2 + input_target2 + elsif state.user_input == :remove_wall + input_remove_wall + elsif state.user_input == :remove_wall2 + input_remove_wall2 + elsif state.user_input == :add_hill + input_add_hill + elsif state.user_input == :add_hill2 + input_add_hill2 + elsif state.user_input == :add_wall + input_add_wall + elsif state.user_input == :add_wall2 + input_add_wall2 + end + end + + # Calculates the two searches + def calc + # If the searches have not started + if breadth_first_search.visited.empty? + # Calculate the two searches + calc_breadth_first + calc_dijkstra + end + end + + + def calc_breadth_first + # Sets up the Breadth First Search + breadth_first_search.visited[state.star] = true + breadth_first_search.frontier << state.star + breadth_first_search.came_from[state.star] = nil + + until breadth_first_search.frontier.empty? + return if breadth_first_search.visited.has_key?(state.target) + # A step in the search + # Takes the next frontier cell + new_frontier = breadth_first_search.frontier.shift + # For each of its neighbors + adjacent_neighbors(new_frontier).each do | neighbor | + # That have not been visited and are not walls + unless breadth_first_search.visited.has_key?(neighbor) || state.walls.has_key?(neighbor) + # Add them to the frontier and mark them as visited in the first grid + breadth_first_search.visited[neighbor] = true + breadth_first_search.frontier << neighbor + # Remember which cell the neighbor came from + breadth_first_search.came_from[neighbor] = new_frontier + end + end + end + end + + # Calculates the Dijkstra Search from the beginning to the end + + def calc_dijkstra + # The initial values for the Dijkstra search + dijkstra_search.frontier << [state.star, 0] + dijkstra_search.came_from[state.star] = nil + dijkstra_search.cost_so_far[state.star] = 0 + + # Until their are no more cells to be explored + until dijkstra_search.frontier.empty? + # Get the next cell to be explored from + # We get the first element of the array which is the cell. The second element is the priority. + current = dijkstra_search.frontier.shift[0] + + # Stop the search if we found the target + return if current == state.target + + # For each of the neighbors + adjacent_neighbors(current).each do | neighbor | + # Unless this cell is a wall or has already been explored. + unless dijkstra_search.came_from.has_key?(neighbor) or state.walls.has_key?(neighbor) + # Calculate the movement cost of getting to this cell and memo + new_cost = dijkstra_search.cost_so_far[current] + cost(neighbor) + dijkstra_search.cost_so_far[neighbor] = new_cost + + # Add this neighbor to the cells too be explored + dijkstra_search.frontier << [neighbor, new_cost] + dijkstra_search.came_from[neighbor] = current + end + end + + # Sort the frontier so exploration occurs that have a low cost so far. + # My implementation of a priority queue + dijkstra_search.frontier = dijkstra_search.frontier.sort_by {|cell, priority| priority} + end + end + + def cost(cell) + if state.hills.has_key?(cell) + return 5 + else + return 1 + end + end + + + + + # Moves the star to the cell closest to the mouse in the first grid + # Only resets the search if the star changes position + # Called whenever the user is editing the star (puts mouse down on star) + def input_star + old_star = state.star.clone + unless cell_closest_to_mouse == state.target + state.star = cell_closest_to_mouse + end + unless old_star == state.star + reset_search + end + end + + # Moves the star to the cell closest to the mouse in the second grid + # Only resets the search if the star changes position + # Called whenever the user is editing the star (puts mouse down on star) + def input_star2 + old_star = state.star.clone + unless cell_closest_to_mouse2 == state.target + state.star = cell_closest_to_mouse2 + end + unless old_star == state.star + reset_search + end + end + + # Moves the target to the grid closest to the mouse in the first grid + # Only reset_searchs the search if the target changes position + # Called whenever the user is editing the target (puts mouse down on target) + def input_target + old_target = state.target.clone + unless cell_closest_to_mouse == state.star + state.target = cell_closest_to_mouse + end + unless old_target == state.target + reset_search + end + end + + # Moves the target to the cell closest to the mouse in the second grid + # Only reset_searchs the search if the target changes position + # Called whenever the user is editing the target (puts mouse down on target) + def input_target2 + old_target = state.target.clone + unless cell_closest_to_mouse2 == state.star + state.target = cell_closest_to_mouse2 + end + unless old_target == state.target + reset_search + end + end + + # Removes walls in the first grid that are under the cursor + def input_remove_wall + # The mouse needs to be inside the grid, because we only want to remove walls + # the cursor is directly over + # Recalculations should only occur when a wall is actually deleted + if mouse_over_grid? + if state.walls.has_key?(cell_closest_to_mouse) or state.hills.has_key?(cell_closest_to_mouse) + state.walls.delete(cell_closest_to_mouse) + state.hills.delete(cell_closest_to_mouse) + reset_search + end + end + end + + # Removes walls in the second grid that are under the cursor + def input_remove_wall2 + # The mouse needs to be inside the grid, because we only want to remove walls + # the cursor is directly over + # Recalculations should only occur when a wall is actually deleted + if mouse_over_grid2? + if state.walls.has_key?(cell_closest_to_mouse2) or state.hills.has_key?(cell_closest_to_mouse2) + state.walls.delete(cell_closest_to_mouse2) + state.hills.delete(cell_closest_to_mouse2) + reset_search + end + end + end + + # Adds a hill in the first grid in the cell the mouse is over + def input_add_hill + if mouse_over_grid? + unless state.hills.has_key?(cell_closest_to_mouse) + state.hills[cell_closest_to_mouse] = true + reset_search + end + end + end + + + # Adds a hill in the second grid in the cell the mouse is over + def input_add_hill2 + if mouse_over_grid2? + unless state.hills.has_key?(cell_closest_to_mouse2) + state.hills[cell_closest_to_mouse2] = true + reset_search + end + end + end + + # Adds a wall in the first grid in the cell the mouse is over + def input_add_wall + if mouse_over_grid? + unless state.walls.has_key?(cell_closest_to_mouse) + state.hills.delete(cell_closest_to_mouse) + state.walls[cell_closest_to_mouse] = true + reset_search + end + end + end + + # Adds a wall in the second grid in the cell the mouse is over + def input_add_wall2 + if mouse_over_grid2? + unless state.walls.has_key?(cell_closest_to_mouse2) + state.hills.delete(cell_closest_to_mouse2) + state.walls[cell_closest_to_mouse2] = true + reset_search + end + end + end + + # Whenever the user edits the grid, + # The search has to be reset_searchd upto the current step + # with the current grid as the initial state of the grid + def reset_search + breadth_first_search.visited = {} + breadth_first_search.frontier = [] + breadth_first_search.came_from = {} + + dijkstra_search.frontier = [] + dijkstra_search.came_from = {} + dijkstra_search.cost_so_far = {} + end + + + + # Returns a list of adjacent cells + # Used to determine what the next cells to be added to the frontier are + def adjacent_neighbors(cell) + neighbors = [] + + # 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 + + # Sorts the neighbors so the rendered path is a zigzag path + # Cells in a diagonal direction are given priority + # Comment this line to see the difference + neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) } + + neighbors + end + + # Finds the vertical and horizontal distance of a cell from the star + # and returns the larger value + # This method is used to have a zigzag pattern in the rendered path + # A cell that is [5, 5] from the star, + # is explored before over a cell that is [0, 7] away. + # So, if possible, the search tries to go diagonal (zigzag) first + def proximity_to_star(x, y) + distance_x = (state.star.x - x).abs + distance_y = (state.star.y - y).abs + + if distance_x > distance_y + return distance_x + else + return distance_y + end + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # Finding the cell closest to the mouse helps with this + def cell_closest_to_mouse + # Closest cell to the mouse in the first grid + x = (inputs.mouse.point.x / grid.cell_size).to_i + y = (inputs.mouse.point.y / grid.cell_size).to_i + # 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 + # Return closest cell + [x, y] + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # Finding the cell closest to the mouse in the second grid helps with this + def cell_closest_to_mouse2 + # Closest cell grid to the mouse in the second + x = (inputs.mouse.point.x / grid.cell_size).to_i + y = (inputs.mouse.point.y / grid.cell_size).to_i + # 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 + # Return closest cell + [x, y] + end + + # Signal that the user is going to be moving the star from the first grid + def mouse_over_star? + inputs.mouse.point.inside_rect?(scale_up(state.star)) + end + + # Signal that the user is going to be moving the star from the second grid + def mouse_over_star2? + inputs.mouse.point.inside_rect?(move_and_scale_up(state.star)) + end + + # Signal that the user is going to be moving the target from the first grid + def mouse_over_target? + inputs.mouse.point.inside_rect?(scale_up(state.target)) + end + + # Signal that the user is going to be moving the target from the second grid + def mouse_over_target2? + inputs.mouse.point.inside_rect?(move_and_scale_up(state.target)) + end + + # Signal that the user is going to be removing walls from the first grid + def mouse_over_wall? + state.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(scale_up(wall)) + end + + false + end + + # Signal that the user is going to be removing walls from the second grid + def mouse_over_wall2? + state.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(move_and_scale_up(wall)) + end + + false + end + + # Signal that the user is going to be removing hills from the first grid + def mouse_over_hill? + state.hills.each_key do | hill | + return true if inputs.mouse.point.inside_rect?(scale_up(hill)) + end + + false + end + + # Signal that the user is going to be removing hills from the second grid + def mouse_over_hill2? + state.hills.each_key do | hill | + return true if inputs.mouse.point.inside_rect?(move_and_scale_up(hill)) + end + + false + end + + # Signal that the user is going to be adding walls from the first grid + def mouse_over_grid? + inputs.mouse.point.inside_rect?(scale_up(grid.rect)) + end + + # Signal that the user is going to be adding walls from the second grid + def mouse_over_grid2? + inputs.mouse.point.inside_rect?(move_and_scale_up(grid.rect)) + end + + # These methods provide handy aliases to colors + + # Light brown + def unvisited_color + [221, 212, 213] + end + + # Camo Green + def wall_color + [134, 134, 120] + end + + # Pastel White + def path_color + [231, 230, 228] + end + + def red + [255, 0, 0] + end + + # A Green + def hill_color + [139, 173, 132] + end + + # Makes code more concise + def grid + state.grid + end + + def breadth_first_search + state.breadth_first_search + end + + def dijkstra_search + state.dijkstra_search + end + end + + # Method that is called by DragonRuby periodically + # Used for updating animations and calculations + def tick args + + # Pressing r will reset the application + if args.inputs.keyboard.key_down.r + args.gtk.reset + reset + return + end + + # Every tick, new args are passed, and the Dijkstra tick method is called + $movement_costs ||= Movement_Costs.new(args) + $movement_costs.args = args + $movement_costs.tick + end + + + def reset + $movement_costs = nil + end + +#+end_src + +*** Path Finding Algorithms - Heuristic - main.rb +#+begin_src 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 + + # This time the heuristic search still explored less of the grid, hence finishing faster. + # However, it did not find the shortest path between the star and the target. + + # The only difference between this app and Heuristic is the change of the starting position. + + class Heuristic_With_Walls + attr_gtk + + def tick + defaults + 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 + move_searches_one_step_forward + end + end + + def defaults + # Variables to edit the size and appearance of the grid + # Freely customizable to user's liking + grid.width ||= 15 + grid.height ||= 15 + grid.cell_size ||= 40 + grid.rect ||= [0, 0, grid.width, grid.height] + + grid.star ||= [0, 2] + grid.target ||= [14, 12] + grid.walls ||= {} + # There are no hills in the Heuristic Search Demo + + # What the user is currently editing on the grid + # 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 + + # 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. + # Used to prevent searching cells that have already been found + # and to trace a path from the target back to the starting point. + # Frontier is an array of cells to expand the search from. + # The search is over when there are no more cells to search from. + # Path stores the path from the target to the star, once the target has been found + # It prevents calculating the path every tick. + bfs.came_from ||= {} + bfs.frontier ||= [] + bfs.path ||= [] + + heuristic.came_from ||= {} + heuristic.frontier ||= [] + heuristic.path ||= [] + + # Stores which step of the animation is being rendered + # When the user moves the star or messes with the walls, + # the searches are recalculated up to this step + + # Unless the current step has a value + unless state.current_step + # Set the current step to 10 + state.current_step = 10 + # And calculate the searches up to step 10 + recalculate_searches + end + + # At some step the animation will end, + # and further steps won't change anything (the whole grid will be explored) + # 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 + + # Whether the animation should play or not + # If true, every tick moves anim_steps forward one + # Pressing the stepwise animation buttons will pause the animation + # An if statement instead of the ||= operator is used for assigning a boolean value. + # The || operator does not differentiate between nil and false. + if state.play == nil + state.play = false + end + + # Store the rects of the buttons that control the animation + # They are here for user customization + # Editing these might require recentering the text inside them + # Those values can be found in the render_button methods + buttons.left = [470, 600, 50, 50] + buttons.center = [520, 600, 200, 50] + buttons.right = [720, 600, 50, 50] + + # The variables below are related to the slider + # They allow the user to customize them + # They also give a central location for the render and input methods to get + # information from + # x & y are the coordinates of the leftmost part of the slider line + slider.x = 440 + slider.y = 675 + # This is the width of the line + slider.w = 360 + # This is the offset for the circle + # Allows the center of the circle to be on the line, + # as opposed to the upper right corner + slider.offset = 20 + # This is the spacing between each of the notches on the slider + # Notches are places where the circle can rest on the slider line + # There needs to be a notch for each step before the maximum number of steps + slider.spacing = slider.w.to_f / state.max_steps.to_f + end + + # All methods with render draw stuff on the screen + # UI has buttons, the slider, and labels + # The search specific rendering occurs in the respective methods + def render + render_ui + render_bfs + render_heuristic + end + + def render_ui + render_buttons + render_slider + render_labels + end + + def render_buttons + render_left_button + render_center_button + render_right_button + end + + def render_bfs + render_bfs_grid + render_bfs_star + render_bfs_target + render_bfs_visited + render_bfs_walls + render_bfs_frontier + render_bfs_path + end + + def render_heuristic + render_heuristic_grid + render_heuristic_star + render_heuristic_target + render_heuristic_visited + render_heuristic_walls + render_heuristic_frontier + render_heuristic_path + end + + # This method handles user input every tick + def input + # Check and handle button input + input_buttons + + # If the mouse was lifted this tick + if inputs.mouse.up + # Set current input to none + state.user_input = :none + end + + # If the mouse was clicked this tick + if inputs.mouse.down + # Determine what the user is editing and appropriately edit the state.user_input variable + determine_input + end + + # Process user input based on user_input variable and current mouse position + process_input + end + + # Determines what the user is editing + # This method is called when the mouse is clicked down + def determine_input + if mouse_over_slider? + state.user_input = :slider + # If the mouse is over the star in the first grid + elsif bfs_mouse_over_star? + # The user is editing the star from the first grid + state.user_input = :bfs_star + # If the mouse is over the star in the second grid + elsif heuristic_mouse_over_star? + # The user is editing the star from the second grid + state.user_input = :heuristic_star + # If the mouse is over the target in the first grid + elsif bfs_mouse_over_target? + # The user is editing the target from the first grid + state.user_input = :bfs_target + # If the mouse is over the target in the second grid + elsif heuristic_mouse_over_target? + # The user is editing the target from the second grid + state.user_input = :heuristic_target + # If the mouse is over a wall in the first grid + elsif bfs_mouse_over_wall? + # The user is removing a wall from the first grid + state.user_input = :bfs_remove_wall + # If the mouse is over a wall in the second grid + 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? + # 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? + # The user is adding a wall from the second grid + state.user_input = :heuristic_add_wall + end + end + + # Processes click and drag based on what the user is currently dragging + 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 == :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 + 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 + end + end + + def render_slider + # Using primitives hides the line under the white circle of the slider + # Draws the line + outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line + # The circle needs to be offset so that the center of the circle + # overlaps the line instead of the upper right corner of the circle + # The circle's x value is also moved based on the current seach step + circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing) + circle_y = (slider.y - slider.offset) + circle_rect = [circle_x, circle_y, 37, 37] + outputs.primitives << [circle_rect, 'circle-white.png'].sprite + end + + def render_labels + outputs.labels << [205, 625, "Breadth First Search"] + outputs.labels << [820, 625, "Heuristic Best-First Search"] + end + + def render_left_button + # Draws the button_color button, and a black border + # The border separates the buttons visually + outputs.solids << [buttons.left, button_color] + outputs.borders << [buttons.left] + + # Renders an explanatory label in the center of the button + # Explains to the user what the button does + # If the button size is changed, the label might need to be edited as well + # to keep the label in the center of the button + label_x = buttons.left.x + 20 + label_y = buttons.left.y + 35 + outputs.labels << [label_x, label_y, "<"] + end + + def render_center_button + # Draws the button_color button, and a black border + # The border separates the buttons visually + outputs.solids << [buttons.center, button_color] + outputs.borders << [buttons.center] + + # Renders an explanatory label in the center of the button + # Explains to the user what the button does + # If the button size is changed, the label might need to be edited as well + # to keep the label in the center of the button + label_x = buttons.center.x + 37 + label_y = buttons.center.y + 35 + label_text = state.play ? "Pause Animation" : "Play Animation" + outputs.labels << [label_x, label_y, label_text] + end + + def render_right_button + # Draws the button_color button, and a black border + # The border separates the buttons visually + outputs.solids << [buttons.right, button_color] + outputs.borders << [buttons.right] + + # Renders an explanatory label in the center of the button + # Explains to the user what the button does + label_x = buttons.right.x + 20 + label_y = buttons.right.y + 35 + outputs.labels << [label_x, label_y, ">"] + end + + def render_bfs_grid + # A large rect the size of the grid + outputs.solids << [bfs_scale_up(grid.rect), default_color] + + # The vertical grid lines + for x in 0..grid.width + outputs.lines << bfs_vertical_line(x) + end + + # The horizontal grid lines + for y in 0..grid.height + outputs.lines << bfs_horizontal_line(y) + end + end + + def render_heuristic_grid + # A large rect the size of the grid + outputs.solids << [heuristic_scale_up(grid.rect), default_color] + + # The vertical grid lines + for x in 0..grid.width + outputs.lines << heuristic_vertical_line(x) + end + + # The horizontal grid lines + for y in 0..grid.height + 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]) + end + + # Returns a horizontal line for a column of the first grid + def bfs_horizontal_line row + bfs_scale_up([0, row, grid.width, row]) + end + + # Returns a vertical line for a column of the second grid + def heuristic_vertical_line column + bfs_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height]) + end + + # Returns a horizontal line for a column of the second grid + def heuristic_horizontal_line row + bfs_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row]) + end + + # Renders the star on the first grid + def render_bfs_star + outputs.sprites << [bfs_scale_up(grid.star), 'star.png'] + end + + # Renders the star on the second grid + def render_heuristic_star + outputs.sprites << [heuristic_scale_up(grid.star), 'star.png'] + end + + # Renders the target on the first grid + 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'] + end + + # Renders the walls on the first grid + def render_bfs_walls + 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 | + outputs.solids << [heuristic_scale_up(wall), wall_color] + end + end + + # Renders the visited cells on the first grid + def render_bfs_visited + bfs.came_from.each_key do | visited_cell | + outputs.solids << [bfs_scale_up(visited_cell), visited_color] + end + end + + # Renders the visited cells on the second grid + def render_heuristic_visited + heuristic.came_from.each_key do | visited_cell | + outputs.solids << [heuristic_scale_up(visited_cell), visited_color] + end + end + + # Renders the frontier cells on the first grid + def render_bfs_frontier + 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 | + outputs.solids << [heuristic_scale_up(frontier_cell), frontier_color, 200] + end + end + + # Renders the path found by the breadth first search on the first grid + def render_bfs_path + bfs.path.each do | path | + outputs.solids << [bfs_scale_up(path), path_color] + end + end + + # Renders the path found by the heuristic search on the second grid + def render_heuristic_path + heuristic.path.each do | path | + outputs.solids << [heuristic_scale_up(path), path_color] + end + end + + # Returns the rect for the path between two cells based on their relative positions + def get_path_between(cell_one, cell_two) + path = nil + + # If cell one is above cell two + if cell_one.x == cell_two.x and cell_one.y > cell_two.y + # Path starts from the center of cell two and moves upward to the center of cell one + path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4] + # If cell one is below cell two + elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y + # Path starts from the center of cell one and moves upward to the center of cell two + path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4] + # If cell one is to the left of cell two + elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y + # Path starts from the center of cell two and moves rightward to the center of cell one + path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4] + # If cell one is to the right of cell two + elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y + # Path starts from the center of cell one and moves rightward to the center of cell two + path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4] + end + + path + end + + # In code, the cells are represented as 1x1 rectangles + # When drawn, the cells are larger than 1x1 rectangles + # This method is used to scale up cells, and lines + # Objects are scaled up according to the grid.cell_size variable + # This allows for easy customization of the visual scale of the grid + # This method scales up cells for the first grid + def bfs_scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone + + # If cell is just an x and y coordinate + if cell.size == 2 + # Add a width and height of 1 + cell << 1 + cell << 1 + end + + # Scale all the values up + cell.map! { |value| value * grid.cell_size } + + # Returns the scaled up cell + cell + end + + # Translates the given cell grid.width + 1 to the right and then scales up + # Used to draw cells for the second grid + # This method does not work for lines, + # so separate methods exist for the grid lines + def heuristic_scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone + # Translates the cell to the second grid equivalent + cell.x += grid.width + 1 + # Proceeds as if scaling up for the first grid + bfs_scale_up(cell) + end + + # 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 + 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 + if left_button_clicked? + state.play = false + state.current_step -= 1 + recalculate_searches + end + end + + # Controls the play/pause button + # 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 + end + end + + # Checks if the next step button is clicked + # 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 + move_searches_one_step_forward + end + end + + # These methods detect when the buttons are clicked + def left_button_clicked? + inputs.mouse.point.inside_rect?(buttons.left) && inputs.mouse.up + end + + def center_button_clicked? + inputs.mouse.point.inside_rect?(buttons.center) && inputs.mouse.up + end + + def right_button_clicked? + inputs.mouse.point.inside_rect?(buttons.right) && inputs.mouse.up + end + + + # Signal that the user is going to be moving the slider + # Is the mouse over the circle of the slider? + def mouse_over_slider? + circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing) + circle_y = (slider.y - slider.offset) + circle_rect = [circle_x, circle_y, 37, 37] + inputs.mouse.point.inside_rect?(circle_rect) + end + + # Signal that the user is going to be moving the star from the first grid + def bfs_mouse_over_star? + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.star)) + end + + # Signal that the user is going to be moving the star from the second grid + def heuristic_mouse_over_star? + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.star)) + end + + # Signal that the user is going to be moving the target from the first grid + def bfs_mouse_over_target? + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.target)) + end + + # Signal that the user is going to be moving the target from the second grid + def heuristic_mouse_over_target? + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.target)) + end + + # Signal that the user is going to be removing walls from the first grid + def bfs_mouse_over_wall? + grid.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(bfs_scale_up(wall)) + end + + false + end + + # Signal that the user is going to be removing walls from the second grid + def heuristic_mouse_over_wall? + grid.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(heuristic_scale_up(wall)) + end + + false + end + + # Signal that the user is going to be adding walls from the first grid + def bfs_mouse_over_grid? + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.rect)) + end + + # Signal that the user is going to be adding walls from the second grid + def heuristic_mouse_over_grid? + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.rect)) + end + + # This method is called when the user is editing the slider + # It pauses the animation and moves the white circle to the closest integer point + # on the slider + # Changes the step of the search to be animated + def process_input_slider + 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 + + # 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 + state.current_step = ((mouse_x - slider.x) / slider.spacing).to_i + + recalculate_searches + end + + # Moves the star to the cell closest to the mouse in the first grid + # 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 + unless bfs_cell_closest_to_mouse == grid.target + grid.star = bfs_cell_closest_to_mouse + end + unless old_star == grid.star + recalculate_searches + end + end + + # Moves the star to the cell closest to the mouse in the second grid + # 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 + unless heuristic_cell_closest_to_mouse == grid.target + grid.star = heuristic_cell_closest_to_mouse + end + unless old_star == grid.star + recalculate_searches + end + end + + # Moves the target to the grid closest to the mouse in the first grid + # 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 + unless bfs_cell_closest_to_mouse == grid.star + grid.target = bfs_cell_closest_to_mouse + end + unless old_target == grid.target + recalculate_searches + end + end + + # Moves the target to the cell closest to the mouse in the second grid + # 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 + unless heuristic_cell_closest_to_mouse == grid.star + grid.target = heuristic_cell_closest_to_mouse + end + unless old_target == grid.target + recalculate_searches + end + end + + # Removes walls in the first grid that are under the cursor + def process_input_bfs_remove_wall + # 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 grid.walls.has_key?(bfs_cell_closest_to_mouse) + grid.walls.delete(bfs_cell_closest_to_mouse) + recalculate_searches + end + end + end + + # Removes walls in the second grid that are under the cursor + def process_input_heuristic_remove_wall + # 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 grid.walls.has_key?(heuristic_cell_closest_to_mouse) + 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? + unless grid.walls.has_key?(bfs_cell_closest_to_mouse) + 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? + unless grid.walls.has_key?(heuristic_cell_closest_to_mouse) + grid.walls[heuristic_cell_closest_to_mouse] = true + recalculate_searches + end + end + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # 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 + # 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 + # Return closest cell + [x, y] + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # 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 + # 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 + # Return closest cell + [x, y] + end + + def recalculate_searches + # Reset the searches + bfs.came_from = {} + bfs.frontier = [] + bfs.path = [] + heuristic.came_from = {} + heuristic.frontier = [] + heuristic.path = [] + + # Move the searches forward to the current step + state.current_step.times { move_searches_one_step_forward } + end + + def move_searches_one_step_forward + bfs_one_step_forward + heuristic_one_step_forward + end + + def bfs_one_step_forward + 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 + end + + # A step in the search + unless bfs.frontier.empty? + # Takes the next frontier cell + new_frontier = bfs.frontier.shift + # For each of its neighbors + 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) + # Add them to the frontier and mark them as visited + bfs.frontier << neighbor + bfs.came_from[neighbor] = new_frontier + end + end + end + + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line + # Comment this line and let a path generate to see the difference + bfs.frontier = bfs.frontier.sort_by {| cell | proximity_to_star(cell) } + + # If the search found the target + if bfs.came_from.has_key?(grid.target) + # Calculate the path between the target and star + bfs_calc_path + end + end + + # Calculates the path between the target and star for the breadth first search + # Only called when the breadth first search finds the target + def bfs_calc_path + # Start from the target + endpoint = grid.target + # And the cell it came from + next_endpoint = bfs.came_from[endpoint] + while endpoint and next_endpoint + # Draw a path between these two cells and store it + path = get_path_between(endpoint, next_endpoint) + bfs.path << path + # And get the next pair of cells + endpoint = next_endpoint + next_endpoint = bfs.came_from[endpoint] + # Continue till there are no more cells + end + end + + # Moves the heuristic search forward one step + # Can be called from tick while the animation is playing + # Can also be called when recalculating the searches after the user edited the grid + def heuristic_one_step_forward + # Stop the search if the target has been found + return if heuristic.came_from.has_key?(grid.target) + + # If the search has not begun + if heuristic.came_from.empty? + # Setup the search to begin from the star + heuristic.frontier << grid.star + heuristic.came_from[grid.star] = nil + end + + # One step in the heuristic search + + # Unless there are no more cells to explore from + unless heuristic.frontier.empty? + # Get the next cell to explore from + new_frontier = heuristic.frontier.shift + # For each of its neighbors + 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) + # Add them to the frontier and mark them as visited + heuristic.frontier << neighbor + heuristic.came_from[neighbor] = new_frontier + end + end + end + + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line + heuristic.frontier = heuristic.frontier.sort_by {| cell | proximity_to_star(cell) } + # Sort the frontier so cells that are close to the target are then prioritized + heuristic.frontier = heuristic.frontier.sort_by {| cell | heuristic_heuristic(cell) } + + # If the search found the target + if heuristic.came_from.has_key?(grid.target) + # Calculate the path between the target and star + heuristic_calc_path + end + end + + # Returns one-dimensional absolute distance between cell and target + # Returns a number to compare distances between cells and the target + def heuristic_heuristic(cell) + (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs + end + + # Calculates the path between the target and star for the heuristic search + # Only called when the heuristic search finds the target + def heuristic_calc_path + # Start from the target + endpoint = grid.target + # And the cell it came from + next_endpoint = heuristic.came_from[endpoint] + while endpoint and next_endpoint + # Draw a path between these two cells and store it + path = get_path_between(endpoint, next_endpoint) + heuristic.path << path + # And get the next pair of cells + endpoint = next_endpoint + next_endpoint = heuristic.came_from[endpoint] + # Continue till there are no more cells + end + end + + # Returns a list of adjacent cells + # Used to determine what the next cells to be added to the frontier are + def adjacent_neighbors(cell) + neighbors = [] + + # 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 + end + + # Finds the vertical and horizontal distance of a cell from the star + # and returns the larger value + # This method is used to have a zigzag pattern in the rendered path + # A cell that is [5, 5] from the star, + # is explored before over a cell that is [0, 7] away. + # So, if possible, the search tries to go diagonal (zigzag) first + def proximity_to_star(cell) + distance_x = (grid.star.x - cell.x).abs + distance_y = (grid.star.y - cell.y).abs + + if distance_x > distance_y + return distance_x + else + return distance_y + end + end + + # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored. + def grid + state.grid + end + + def buttons + state.buttons + end + + def slider + state.slider + end + + def bfs + state.bfs + end + + def heuristic + state.heuristic + end + + # Descriptive aliases for colors + def default_color + [221, 212, 213] # Light Brown + end + + def wall_color + [134, 134, 120] # Camo Green + end + + def visited_color + [204, 191, 179] # Dark Brown + end + + def frontier_color + [103, 136, 204] # Blue + end + + def path_color + [231, 230, 228] # Pastel White + end + + def button_color + [190, 190, 190] # Gray + end + end + # Method that is called by DragonRuby periodically + # Used for updating animations and calculations + def tick args + + # Pressing r will reset the application + if args.inputs.keyboard.key_down.r + args.gtk.reset + reset + return + end + + # Every tick, new args are passed, and the Breadth First Search tick is called + $heuristic_with_walls ||= Heuristic_With_Walls.new(args) + $heuristic_with_walls.args = args + $heuristic_with_walls.tick + end + + + def reset + $heuristic_with_walls = nil + end + +#+end_src + +*** Path Finding Algorithms - Heuristic With Walls - main.rb +#+begin_src 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. + # Notice that both searches find the shortest path + # The heuristic search, however, explores less of the grid, and is therefore faster. + # The heuristic search prioritizes searching cells that are closer to the target. + # Make sure to look at the Heuristic with walls program to see some of the downsides of the heuristic algorithm. + + class Heuristic + attr_gtk + + def tick + defaults + 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 + move_searches_one_step_forward + end + end + + def defaults + # Variables to edit the size and appearance of the grid + # Freely customizable to user's liking + grid.width ||= 15 + grid.height ||= 15 + grid.cell_size ||= 40 + grid.rect ||= [0, 0, grid.width, grid.height] + + grid.star ||= [0, 2] + grid.target ||= [14, 12] + grid.walls ||= { + [2, 2] => true, + [3, 2] => true, + [4, 2] => true, + [5, 2] => true, + [6, 2] => true, + [7, 2] => true, + [8, 2] => true, + [9, 2] => true, + [10, 2] => true, + [11, 2] => true, + [12, 2] => true, + [12, 3] => true, + [12, 4] => true, + [12, 5] => true, + [12, 6] => true, + [12, 7] => true, + [12, 8] => true, + [12, 9] => true, + [12, 10] => true, + [12, 11] => true, + [12, 12] => true, + [2, 12] => true, + [3, 12] => true, + [4, 12] => true, + [5, 12] => true, + [6, 12] => true, + [7, 12] => true, + [8, 12] => true, + [9, 12] => true, + [10, 12] => true, + [11, 12] => true, + [12, 12] => true + } + # There are no hills in the Heuristic Search Demo + + # What the user is currently editing on the grid + # 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 + + # 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. + # Used to prevent searching cells that have already been found + # and to trace a path from the target back to the starting point. + # Frontier is an array of cells to expand the search from. + # The search is over when there are no more cells to search from. + # Path stores the path from the target to the star, once the target has been found + # It prevents calculating the path every tick. + bfs.came_from ||= {} + bfs.frontier ||= [] + bfs.path ||= [] + + heuristic.came_from ||= {} + heuristic.frontier ||= [] + heuristic.path ||= [] + + # Stores which step of the animation is being rendered + # When the user moves the star or messes with the walls, + # the searches are recalculated up to this step + + # Unless the current step has a value + unless state.current_step + # Set the current step to 10 + state.current_step = 10 + # And calculate the searches up to step 10 + recalculate_searches + end + + # At some step the animation will end, + # and further steps won't change anything (the whole grid will be explored) + # 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 + + # Whether the animation should play or not + # If true, every tick moves anim_steps forward one + # Pressing the stepwise animation buttons will pause the animation + # An if statement instead of the ||= operator is used for assigning a boolean value. + # The || operator does not differentiate between nil and false. + if state.play == nil + state.play = false + end + + # Store the rects of the buttons that control the animation + # They are here for user customization + # Editing these might require recentering the text inside them + # Those values can be found in the render_button methods + buttons.left = [470, 600, 50, 50] + buttons.center = [520, 600, 200, 50] + buttons.right = [720, 600, 50, 50] + + # The variables below are related to the slider + # They allow the user to customize them + # They also give a central location for the render and input methods to get + # information from + # x & y are the coordinates of the leftmost part of the slider line + slider.x = 440 + slider.y = 675 + # This is the width of the line + slider.w = 360 + # This is the offset for the circle + # Allows the center of the circle to be on the line, + # as opposed to the upper right corner + slider.offset = 20 + # This is the spacing between each of the notches on the slider + # Notches are places where the circle can rest on the slider line + # There needs to be a notch for each step before the maximum number of steps + slider.spacing = slider.w.to_f / state.max_steps.to_f + end + + # All methods with render draw stuff on the screen + # UI has buttons, the slider, and labels + # The search specific rendering occurs in the respective methods + def render + render_ui + render_bfs + render_heuristic + end + + def render_ui + render_buttons + render_slider + render_labels + end + + def render_buttons + render_left_button + render_center_button + render_right_button + end + + def render_bfs + render_bfs_grid + render_bfs_star + render_bfs_target + render_bfs_visited + render_bfs_walls + render_bfs_frontier + render_bfs_path + end + + def render_heuristic + render_heuristic_grid + render_heuristic_star + render_heuristic_target + render_heuristic_visited + render_heuristic_walls + render_heuristic_frontier + render_heuristic_path + end + + # This method handles user input every tick + def input + # Check and handle button input + input_buttons + + # If the mouse was lifted this tick + if inputs.mouse.up + # Set current input to none + state.user_input = :none + end + + # If the mouse was clicked this tick + if inputs.mouse.down + # Determine what the user is editing and appropriately edit the state.user_input variable + determine_input + end + + # Process user input based on user_input variable and current mouse position + process_input + end + + # Determines what the user is editing + # This method is called when the mouse is clicked down + def determine_input + if mouse_over_slider? + state.user_input = :slider + # If the mouse is over the star in the first grid + elsif bfs_mouse_over_star? + # The user is editing the star from the first grid + state.user_input = :bfs_star + # If the mouse is over the star in the second grid + elsif heuristic_mouse_over_star? + # The user is editing the star from the second grid + state.user_input = :heuristic_star + # If the mouse is over the target in the first grid + elsif bfs_mouse_over_target? + # The user is editing the target from the first grid + state.user_input = :bfs_target + # If the mouse is over the target in the second grid + elsif heuristic_mouse_over_target? + # The user is editing the target from the second grid + state.user_input = :heuristic_target + # If the mouse is over a wall in the first grid + elsif bfs_mouse_over_wall? + # The user is removing a wall from the first grid + state.user_input = :bfs_remove_wall + # If the mouse is over a wall in the second grid + 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? + # 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? + # The user is adding a wall from the second grid + state.user_input = :heuristic_add_wall + end + end + + # Processes click and drag based on what the user is currently dragging + 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 == :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 + 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 + end + end + + def render_slider + # Using primitives hides the line under the white circle of the slider + # Draws the line + outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line + # The circle needs to be offset so that the center of the circle + # overlaps the line instead of the upper right corner of the circle + # The circle's x value is also moved based on the current seach step + circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing) + circle_y = (slider.y - slider.offset) + circle_rect = [circle_x, circle_y, 37, 37] + outputs.primitives << [circle_rect, 'circle-white.png'].sprite + end + + def render_labels + outputs.labels << [205, 625, "Breadth First Search"] + outputs.labels << [820, 625, "Heuristic Best-First Search"] + end + + def render_left_button + # Draws the button_color button, and a black border + # The border separates the buttons visually + outputs.solids << [buttons.left, button_color] + outputs.borders << [buttons.left] + + # Renders an explanatory label in the center of the button + # Explains to the user what the button does + # If the button size is changed, the label might need to be edited as well + # to keep the label in the center of the button + label_x = buttons.left.x + 20 + label_y = buttons.left.y + 35 + outputs.labels << [label_x, label_y, "<"] + end + + def render_center_button + # Draws the button_color button, and a black border + # The border separates the buttons visually + outputs.solids << [buttons.center, button_color] + outputs.borders << [buttons.center] + + # Renders an explanatory label in the center of the button + # Explains to the user what the button does + # If the button size is changed, the label might need to be edited as well + # to keep the label in the center of the button + label_x = buttons.center.x + 37 + label_y = buttons.center.y + 35 + label_text = state.play ? "Pause Animation" : "Play Animation" + outputs.labels << [label_x, label_y, label_text] + end + + def render_right_button + # Draws the button_color button, and a black border + # The border separates the buttons visually + outputs.solids << [buttons.right, button_color] + outputs.borders << [buttons.right] + + # Renders an explanatory label in the center of the button + # Explains to the user what the button does + label_x = buttons.right.x + 20 + label_y = buttons.right.y + 35 + outputs.labels << [label_x, label_y, ">"] + end + + def render_bfs_grid + # A large rect the size of the grid + outputs.solids << [bfs_scale_up(grid.rect), default_color] + + # The vertical grid lines + for x in 0..grid.width + outputs.lines << bfs_vertical_line(x) + end + + # The horizontal grid lines + for y in 0..grid.height + outputs.lines << bfs_horizontal_line(y) + end + end + + def render_heuristic_grid + # A large rect the size of the grid + outputs.solids << [heuristic_scale_up(grid.rect), default_color] + + # The vertical grid lines + for x in 0..grid.width + outputs.lines << heuristic_vertical_line(x) + end + + # The horizontal grid lines + for y in 0..grid.height + 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]) + end + + # Returns a horizontal line for a column of the first grid + def bfs_horizontal_line row + bfs_scale_up([0, row, grid.width, row]) + end + + # Returns a vertical line for a column of the second grid + def heuristic_vertical_line column + bfs_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height]) + end + + # Returns a horizontal line for a column of the second grid + def heuristic_horizontal_line row + bfs_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row]) + end + + # Renders the star on the first grid + def render_bfs_star + outputs.sprites << [bfs_scale_up(grid.star), 'star.png'] + end + + # Renders the star on the second grid + def render_heuristic_star + outputs.sprites << [heuristic_scale_up(grid.star), 'star.png'] + end + + # Renders the target on the first grid + 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'] + end + + # Renders the walls on the first grid + def render_bfs_walls + 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 | + outputs.solids << [heuristic_scale_up(wall), wall_color] + end + end + + # Renders the visited cells on the first grid + def render_bfs_visited + bfs.came_from.each_key do | visited_cell | + outputs.solids << [bfs_scale_up(visited_cell), visited_color] + end + end + + # Renders the visited cells on the second grid + def render_heuristic_visited + heuristic.came_from.each_key do | visited_cell | + outputs.solids << [heuristic_scale_up(visited_cell), visited_color] + end + end + + # Renders the frontier cells on the first grid + def render_bfs_frontier + 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 | + outputs.solids << [heuristic_scale_up(frontier_cell), frontier_color, 200] + end + end + + # Renders the path found by the breadth first search on the first grid + def render_bfs_path + bfs.path.each do | path | + outputs.solids << [bfs_scale_up(path), path_color] + end + end + + # Renders the path found by the heuristic search on the second grid + def render_heuristic_path + heuristic.path.each do | path | + outputs.solids << [heuristic_scale_up(path), path_color] + end + end + + # Returns the rect for the path between two cells based on their relative positions + def get_path_between(cell_one, cell_two) + path = [] + + # If cell one is above cell two + if cell_one.x == cell_two.x and cell_one.y > cell_two.y + # Path starts from the center of cell two and moves upward to the center of cell one + path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4] + # If cell one is below cell two + elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y + # Path starts from the center of cell one and moves upward to the center of cell two + path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4] + # If cell one is to the left of cell two + elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y + # Path starts from the center of cell two and moves rightward to the center of cell one + path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4] + # If cell one is to the right of cell two + elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y + # Path starts from the center of cell one and moves rightward to the center of cell two + path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4] + end + + path + end + + # In code, the cells are represented as 1x1 rectangles + # When drawn, the cells are larger than 1x1 rectangles + # This method is used to scale up cells, and lines + # Objects are scaled up according to the grid.cell_size variable + # This allows for easy customization of the visual scale of the grid + # This method scales up cells for the first grid + def bfs_scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone + + # If cell is just an x and y coordinate + if cell.size == 2 + # Add a width and height of 1 + cell << 1 + cell << 1 + end + + # Scale all the values up + cell.map! { |value| value * grid.cell_size } + + # Returns the scaled up cell + cell + end + + # Translates the given cell grid.width + 1 to the right and then scales up + # Used to draw cells for the second grid + # This method does not work for lines, + # so separate methods exist for the grid lines + def heuristic_scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone + # Translates the cell to the second grid equivalent + cell.x += grid.width + 1 + # Proceeds as if scaling up for the first grid + bfs_scale_up(cell) + end + + # 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 + 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 + if left_button_clicked? + state.play = false + state.current_step -= 1 + recalculate_searches + end + end + + # Controls the play/pause button + # 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 + end + end + + # Checks if the next step button is clicked + # 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 + move_searches_one_step_forward + end + end + + # These methods detect when the buttons are clicked + def left_button_clicked? + inputs.mouse.point.inside_rect?(buttons.left) && inputs.mouse.up + end + + def center_button_clicked? + inputs.mouse.point.inside_rect?(buttons.center) && inputs.mouse.up + end + + def right_button_clicked? + inputs.mouse.point.inside_rect?(buttons.right) && inputs.mouse.up + end + + + # Signal that the user is going to be moving the slider + # Is the mouse over the circle of the slider? + def mouse_over_slider? + circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing) + circle_y = (slider.y - slider.offset) + circle_rect = [circle_x, circle_y, 37, 37] + inputs.mouse.point.inside_rect?(circle_rect) + end + + # Signal that the user is going to be moving the star from the first grid + def bfs_mouse_over_star? + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.star)) + end + + # Signal that the user is going to be moving the star from the second grid + def heuristic_mouse_over_star? + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.star)) + end + + # Signal that the user is going to be moving the target from the first grid + def bfs_mouse_over_target? + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.target)) + end + + # Signal that the user is going to be moving the target from the second grid + def heuristic_mouse_over_target? + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.target)) + end + + # Signal that the user is going to be removing walls from the first grid + def bfs_mouse_over_wall? + grid.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(bfs_scale_up(wall)) + end + + false + end + + # Signal that the user is going to be removing walls from the second grid + def heuristic_mouse_over_wall? + grid.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(heuristic_scale_up(wall)) + end + + false + end + + # Signal that the user is going to be adding walls from the first grid + def bfs_mouse_over_grid? + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.rect)) + end + + # Signal that the user is going to be adding walls from the second grid + def heuristic_mouse_over_grid? + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.rect)) + end + + # This method is called when the user is editing the slider + # It pauses the animation and moves the white circle to the closest integer point + # on the slider + # Changes the step of the search to be animated + def process_input_slider + 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 + + # 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 + state.current_step = ((mouse_x - slider.x) / slider.spacing).to_i + + recalculate_searches + end + + # Moves the star to the cell closest to the mouse in the first grid + # 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 + unless bfs_cell_closest_to_mouse == grid.target + grid.star = bfs_cell_closest_to_mouse + end + unless old_star == grid.star + recalculate_searches + end + end + + # Moves the star to the cell closest to the mouse in the second grid + # 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 + unless heuristic_cell_closest_to_mouse == grid.target + grid.star = heuristic_cell_closest_to_mouse + end + unless old_star == grid.star + recalculate_searches + end + end + + # Moves the target to the grid closest to the mouse in the first grid + # 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 + unless bfs_cell_closest_to_mouse == grid.star + grid.target = bfs_cell_closest_to_mouse + end + unless old_target == grid.target + recalculate_searches + end + end + + # Moves the target to the cell closest to the mouse in the second grid + # 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 + unless heuristic_cell_closest_to_mouse == grid.star + grid.target = heuristic_cell_closest_to_mouse + end + unless old_target == grid.target + recalculate_searches + end + end + + # Removes walls in the first grid that are under the cursor + def process_input_bfs_remove_wall + # 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 grid.walls.has_key?(bfs_cell_closest_to_mouse) + grid.walls.delete(bfs_cell_closest_to_mouse) + recalculate_searches + end + end + end + + # Removes walls in the second grid that are under the cursor + def process_input_heuristic_remove_wall + # 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 grid.walls.has_key?(heuristic_cell_closest_to_mouse) + 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? + unless grid.walls.has_key?(bfs_cell_closest_to_mouse) + 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? + unless grid.walls.has_key?(heuristic_cell_closest_to_mouse) + grid.walls[heuristic_cell_closest_to_mouse] = true + recalculate_searches + end + end + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # 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 + # 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 + # Return closest cell + [x, y] + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # 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 + # 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 + # Return closest cell + [x, y] + end + + def recalculate_searches + # Reset the searches + bfs.came_from = {} + bfs.frontier = [] + bfs.path = [] + heuristic.came_from = {} + heuristic.frontier = [] + heuristic.path = [] + + # Move the searches forward to the current step + state.current_step.times { move_searches_one_step_forward } + end + + def move_searches_one_step_forward + bfs_one_step_forward + heuristic_one_step_forward + end + + def bfs_one_step_forward + 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 + end + + # A step in the search + unless bfs.frontier.empty? + # Takes the next frontier cell + new_frontier = bfs.frontier.shift + # For each of its neighbors + 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) + # Add them to the frontier and mark them as visited + bfs.frontier << neighbor + bfs.came_from[neighbor] = new_frontier + end + end + end + + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line + # Comment this line and let a path generate to see the difference + bfs.frontier = bfs.frontier.sort_by {| cell | proximity_to_star(cell) } + + # If the search found the target + if bfs.came_from.has_key?(grid.target) + # Calculate the path between the target and star + bfs_calc_path + end + end + + # Calculates the path between the target and star for the breadth first search + # Only called when the breadth first search finds the target + def bfs_calc_path + # Start from the target + endpoint = grid.target + # And the cell it came from + next_endpoint = bfs.came_from[endpoint] + while endpoint and next_endpoint + # Draw a path between these two cells and store it + path = get_path_between(endpoint, next_endpoint) + bfs.path << path + # And get the next pair of cells + endpoint = next_endpoint + next_endpoint = bfs.came_from[endpoint] + # Continue till there are no more cells + end + end + + # Moves the heuristic search forward one step + # Can be called from tick while the animation is playing + # Can also be called when recalculating the searches after the user edited the grid + def heuristic_one_step_forward + # Stop the search if the target has been found + return if heuristic.came_from.has_key?(grid.target) + + # If the search has not begun + if heuristic.came_from.empty? + # Setup the search to begin from the star + heuristic.frontier << grid.star + heuristic.came_from[grid.star] = nil + end + + # One step in the heuristic search + + # Unless there are no more cells to explore from + unless heuristic.frontier.empty? + # Get the next cell to explore from + new_frontier = heuristic.frontier.shift + # For each of its neighbors + 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) + # Add them to the frontier and mark them as visited + heuristic.frontier << neighbor + heuristic.came_from[neighbor] = new_frontier + end + end + end + + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line + heuristic.frontier = heuristic.frontier.sort_by {| cell | proximity_to_star(cell) } + # Sort the frontier so cells that are close to the target are then prioritized + heuristic.frontier = heuristic.frontier.sort_by {| cell | heuristic_heuristic(cell) } + + # If the search found the target + if heuristic.came_from.has_key?(grid.target) + # Calculate the path between the target and star + heuristic_calc_path + end + end + + # Returns one-dimensional absolute distance between cell and target + # Returns a number to compare distances between cells and the target + def heuristic_heuristic(cell) + (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs + end + + # Calculates the path between the target and star for the heuristic search + # Only called when the heuristic search finds the target + def heuristic_calc_path + # Start from the target + endpoint = grid.target + # And the cell it came from + next_endpoint = heuristic.came_from[endpoint] + while endpoint and next_endpoint + # Draw a path between these two cells and store it + path = get_path_between(endpoint, next_endpoint) + heuristic.path << path + # And get the next pair of cells + endpoint = next_endpoint + next_endpoint = heuristic.came_from[endpoint] + # Continue till there are no more cells + end + end + + # Returns a list of adjacent cells + # Used to determine what the next cells to be added to the frontier are + def adjacent_neighbors(cell) + neighbors = [] + + # 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 + end + + # Finds the vertical and horizontal distance of a cell from the star + # and returns the larger value + # This method is used to have a zigzag pattern in the rendered path + # A cell that is [5, 5] from the star, + # is explored before over a cell that is [0, 7] away. + # So, if possible, the search tries to go diagonal (zigzag) first + def proximity_to_star(cell) + distance_x = (grid.star.x - cell.x).abs + distance_y = (grid.star.y - cell.y).abs + + if distance_x > distance_y + return distance_x + else + return distance_y + end + end + + # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored. + def grid + state.grid + end + + def buttons + state.buttons + end + + def slider + state.slider + end + + def bfs + state.bfs + end + + def heuristic + state.heuristic + end + + # Descriptive aliases for colors + def default_color + [221, 212, 213] # Light Brown + end + + def wall_color + [134, 134, 120] # Camo Green + end + + def visited_color + [204, 191, 179] # Dark Brown + end + + def frontier_color + [103, 136, 204] # Blue + end + + def path_color + [231, 230, 228] # Pastel White + end + + def button_color + [190, 190, 190] # Gray + end + end + # Method that is called by DragonRuby periodically + # Used for updating animations and calculations + def tick args + + # Pressing r will reset the application + if args.inputs.keyboard.key_down.r + args.gtk.reset + reset + return + end + + # Every tick, new args are passed, and the Breadth First Search tick is called + $heuristic ||= Heuristic.new(args) + $heuristic.args = args + $heuristic.tick + end + + + def reset + $heuristic = nil + end + +#+end_src + +*** Path Finding Algorithms - A Star - main.rb +#+begin_src 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 + + # The A* Search works by incorporating both the distance from the starting point + # and the distance from the target in its heurisitic. + + # It tends to find the correct (shortest) path even when the Greedy Best-First Search does not, + # and it explores less of the grid, and is therefore faster, than Dijkstra's Search. + + class A_Star_Algorithm + attr_gtk + + def tick + defaults + render + input + + if dijkstra.came_from.empty? + calc_searches + end + end + + def defaults + # Variables to edit the size and appearance of the grid + # Freely customizable to user's liking + grid.width ||= 15 + grid.height ||= 15 + grid.cell_size ||= 27 + grid.rect ||= [0, 0, grid.width, grid.height] + + grid.star ||= [0, 2] + grid.target ||= [11, 13] + grid.walls ||= { + [2, 2] => true, + [3, 2] => true, + [4, 2] => true, + [5, 2] => true, + [6, 2] => true, + [7, 2] => true, + [8, 2] => true, + [9, 2] => true, + [10, 2] => true, + [11, 2] => true, + [12, 2] => true, + [12, 3] => true, + [12, 4] => true, + [12, 5] => true, + [12, 6] => true, + [12, 7] => true, + [12, 8] => true, + [12, 9] => true, + [12, 10] => true, + [12, 11] => true, + [12, 12] => true, + [5, 12] => true, + [6, 12] => true, + [7, 12] => true, + [8, 12] => true, + [9, 12] => true, + [10, 12] => true, + [11, 12] => true, + [12, 12] => true + } + + # What the user is currently editing on the grid + # 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 + + # 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. + # Used to prevent searching cells that have already been found + # and to trace a path from the target back to the starting point. + # Frontier is an array of cells to expand the search from. + # The search is over when there are no more cells to search from. + # Path stores the path from the target to the star, once the target has been found + # It prevents calculating the path every tick. + dijkstra.came_from ||= {} + dijkstra.cost_so_far ||= {} + dijkstra.frontier ||= [] + dijkstra.path ||= [] + + greedy.came_from ||= {} + greedy.frontier ||= [] + greedy.path ||= [] + + a_star.frontier ||= [] + a_star.came_from ||= {} + a_star.path ||= [] + end + + # All methods with render draw stuff on the screen + # UI has buttons, the slider, and labels + # The search specific rendering occurs in the respective methods + def render + render_labels + render_dijkstra + render_greedy + render_a_star + end + + def render_labels + outputs.labels << [150, 450, "Dijkstra's"] + outputs.labels << [550, 450, "Greedy Best-First"] + outputs.labels << [1025, 450, "A* Search"] + end + + def render_dijkstra + render_dijkstra_grid + render_dijkstra_star + render_dijkstra_target + render_dijkstra_visited + render_dijkstra_walls + render_dijkstra_path + end + + def render_greedy + render_greedy_grid + render_greedy_star + render_greedy_target + render_greedy_visited + render_greedy_walls + render_greedy_path + end + + def render_a_star + render_a_star_grid + render_a_star_star + render_a_star_target + render_a_star_visited + render_a_star_walls + render_a_star_path + end + + # This method handles user input every tick + def input + # If the mouse was lifted this tick + if inputs.mouse.up + # Set current input to none + state.user_input = :none + end + + # If the mouse was clicked this tick + if inputs.mouse.down + # Determine what the user is editing and appropriately edit the state.user_input variable + determine_input + end + + # Process user input based on user_input variable and current mouse position + process_input + end + + # Determines what the user is editing + # This method is called when the mouse is clicked down + def determine_input + # If the mouse is over the star in the first grid + if dijkstra_mouse_over_star? + # The user is editing the star from the first grid + state.user_input = :dijkstra_star + # If the mouse is over the star in the second grid + elsif greedy_mouse_over_star? + # The user is editing the star from the second grid + state.user_input = :greedy_star + # If the mouse is over the star in the third grid + elsif a_star_mouse_over_star? + # The user is editing the star from the third grid + state.user_input = :a_star_star + # If the mouse is over the target in the first grid + elsif dijkstra_mouse_over_target? + # The user is editing the target from the first grid + state.user_input = :dijkstra_target + # If the mouse is over the target in the second grid + elsif greedy_mouse_over_target? + # The user is editing the target from the second grid + state.user_input = :greedy_target + # If the mouse is over the target in the third grid + elsif a_star_mouse_over_target? + # The user is editing the target from the third grid + state.user_input = :a_star_target + # If the mouse is over a wall in the first grid + elsif dijkstra_mouse_over_wall? + # The user is removing a wall from the first grid + state.user_input = :dijkstra_remove_wall + # If the mouse is over a wall in the second grid + elsif greedy_mouse_over_wall? + # The user is removing a wall from the second grid + state.user_input = :greedy_remove_wall + # If the mouse is over a wall in the third grid + elsif a_star_mouse_over_wall? + # The user is removing a wall from the third grid + state.user_input = :a_star_remove_wall + # If the mouse is over the first grid + elsif dijkstra_mouse_over_grid? + # The user is adding a wall from the first grid + state.user_input = :dijkstra_add_wall + # If the mouse is over the second grid + elsif greedy_mouse_over_grid? + # The user is adding a wall from the second grid + state.user_input = :greedy_add_wall + # If the mouse is over the third grid + elsif a_star_mouse_over_grid? + # The user is adding a wall from the third grid + state.user_input = :a_star_add_wall + end + end + + # Processes click and drag based on what the user is currently dragging + def process_input + if state.user_input == :dijkstra_star + process_input_dijkstra_star + elsif state.user_input == :greedy_star + process_input_greedy_star + elsif state.user_input == :a_star_star + process_input_a_star_star + elsif state.user_input == :dijkstra_target + process_input_dijkstra_target + elsif state.user_input == :greedy_target + process_input_greedy_target + elsif state.user_input == :a_star_target + process_input_a_star_target + elsif state.user_input == :dijkstra_remove_wall + process_input_dijkstra_remove_wall + elsif state.user_input == :greedy_remove_wall + process_input_greedy_remove_wall + elsif state.user_input == :a_star_remove_wall + process_input_a_star_remove_wall + elsif state.user_input == :dijkstra_add_wall + process_input_dijkstra_add_wall + elsif state.user_input == :greedy_add_wall + process_input_greedy_add_wall + elsif state.user_input == :a_star_add_wall + process_input_a_star_add_wall + end + end + + def render_dijkstra_grid + # A large rect the size of the grid + outputs.solids << [dijkstra_scale_up(grid.rect), default_color] + + # The vertical grid lines + for x in 0..grid.width + outputs.lines << dijkstra_vertical_line(x) + end + + # The horizontal grid lines + for y in 0..grid.height + outputs.lines << dijkstra_horizontal_line(y) + end + end + + def render_greedy_grid + # A large rect the size of the grid + outputs.solids << [greedy_scale_up(grid.rect), default_color] + + # The vertical grid lines + for x in 0..grid.width + outputs.lines << greedy_vertical_line(x) + end + + # The horizontal grid lines + for y in 0..grid.height + outputs.lines << greedy_horizontal_line(y) + end + end + + def render_a_star_grid + # A large rect the size of the grid + outputs.solids << [a_star_scale_up(grid.rect), default_color] + + # The vertical grid lines + for x in 0..grid.width + outputs.lines << a_star_vertical_line(x) + end + + # The horizontal grid lines + for y in 0..grid.height + outputs.lines << a_star_horizontal_line(y) + end + end + + # Returns a vertical line for a column of the first grid + def dijkstra_vertical_line column + dijkstra_scale_up([column, 0, column, grid.height]) + end + + # Returns a horizontal line for a column of the first grid + def dijkstra_horizontal_line row + dijkstra_scale_up([0, row, grid.width, row]) + end + + # Returns a vertical line for a column of the second grid + def greedy_vertical_line column + dijkstra_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height]) + end + + # Returns a horizontal line for a column of the second grid + def greedy_horizontal_line row + dijkstra_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row]) + end + + # Returns a vertical line for a column of the third grid + def a_star_vertical_line column + dijkstra_scale_up([column + (grid.width * 2) + 2, 0, column + (grid.width * 2) + 2, grid.height]) + end + + # Returns a horizontal line for a column of the third grid + def a_star_horizontal_line row + dijkstra_scale_up([(grid.width * 2) + 2, row, (grid.width * 2) + grid.width + 2, row]) + end + + # Renders the star on the first grid + def render_dijkstra_star + outputs.sprites << [dijkstra_scale_up(grid.star), 'star.png'] + end + + # Renders the star on the second grid + def render_greedy_star + outputs.sprites << [greedy_scale_up(grid.star), 'star.png'] + end + + # Renders the star on the third grid + def render_a_star_star + outputs.sprites << [a_star_scale_up(grid.star), 'star.png'] + end + + # Renders the target on the first grid + def render_dijkstra_target + outputs.sprites << [dijkstra_scale_up(grid.target), 'target.png'] + end + + # Renders the target on the second grid + def render_greedy_target + outputs.sprites << [greedy_scale_up(grid.target), 'target.png'] + end + + # Renders the target on the third grid + def render_a_star_target + outputs.sprites << [a_star_scale_up(grid.target), 'target.png'] + end + + # Renders the walls on the first grid + def render_dijkstra_walls + grid.walls.each_key do | wall | + outputs.solids << [dijkstra_scale_up(wall), wall_color] + end + end + + # Renders the walls on the second grid + def render_greedy_walls + grid.walls.each_key do | wall | + outputs.solids << [greedy_scale_up(wall), wall_color] + end + end + + # Renders the walls on the third grid + def render_a_star_walls + grid.walls.each_key do | wall | + outputs.solids << [a_star_scale_up(wall), wall_color] + end + end - # Outputs solid as primitive using a hash - args.outputs.primitives << { - x: 400, # position - y: 200, - w: 160, # size - h: 90, - r: 120, # color saturation - g: 50, - b: 50, - a: 255 # transparency - }.solid + # Renders the visited cells on the first grid + def render_dijkstra_visited + dijkstra.came_from.each_key do | visited_cell | + outputs.solids << [dijkstra_scale_up(visited_cell), visited_color] + end + end - # Outputs border as primitive using a hash - # Same parameters as solid - args.outputs.primitives << { - x: 600, # position - y: 200, - w: 160, # size - h: 90, - r: 120, # color saturation - g: 50, - b: 50, - a: 255 # transparency - }.border + # Renders the visited cells on the second grid + def render_greedy_visited + greedy.came_from.each_key do | visited_cell | + outputs.solids << [greedy_scale_up(visited_cell), visited_color] + end + end - # Outputs line as primitive using a hash - args.outputs.primitives << { - x: 900, # starting position - y: 200, - x2: 1200, # ending position - y2: 200, - r: 120, # color saturation - g: 50, - b: 50, - a: 255 # transparency - }.line - end - -#+end_src - -* Advanced Rendering - Pixel Arrays - main.rb -#+begin_src ruby - # ./samples/07_advanced_rendering/06_pixel_arrays/app/main.rb - $gtk.reset + # Renders the visited cells on the third grid + def render_a_star_visited + a_star.came_from.each_key do | visited_cell | + outputs.solids << [a_star_scale_up(visited_cell), visited_color] + end + end - def tick args - args.state.posinc ||= 1 - args.state.pos ||= 0 - args.state.rotation ||= 0 + # Renders the path found by the breadth first search on the first grid + def render_dijkstra_path + dijkstra.path.each do | path | + outputs.solids << [dijkstra_scale_up(path), path_color] + end + end - dimension = 10 # keep it small and let the GPU scale it when rendering the sprite. + # Renders the path found by the greedy search on the second grid + def render_greedy_path + greedy.path.each do | path | + outputs.solids << [greedy_scale_up(path), path_color] + end + end - # Set up our "scanner" pixel array and fill it with black pixels. - args.pixel_array(:scanner).width = dimension - args.pixel_array(:scanner).height = dimension - args.pixel_array(:scanner).pixels.fill(0xFF000000, 0, dimension * dimension) # black, full alpha + # Renders the path found by the a_star search on the third grid + def render_a_star_path + a_star.path.each do | path | + outputs.solids << [a_star_scale_up(path), path_color] + end + end - # Draw a green line that bounces up and down the sprite. - args.pixel_array(:scanner).pixels.fill(0xFF00FF00, dimension * args.state.pos, dimension) # green, full alpha + # Returns the rect for the path between two cells based on their relative positions + def get_path_between(cell_one, cell_two) + path = [] - # Adjust position for next frame. - args.state.pos += args.state.posinc - if args.state.posinc > 0 && args.state.pos >= dimension - args.state.posinc = -1 - args.state.pos = dimension - 1 - elsif args.state.posinc < 0 && args.state.pos < 0 - args.state.posinc = 1 - args.state.pos = 1 + # If cell one is above cell two + if cell_one.x == cell_two.x and cell_one.y > cell_two.y + # Path starts from the center of cell two and moves upward to the center of cell one + path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4] + # If cell one is below cell two + elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y + # Path starts from the center of cell one and moves upward to the center of cell two + path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4] + # If cell one is to the left of cell two + elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y + # Path starts from the center of cell two and moves rightward to the center of cell one + path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4] + # If cell one is to the right of cell two + elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y + # Path starts from the center of cell one and moves rightward to the center of cell two + path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4] + end + + path end - # New/changed pixel arrays get uploaded to the GPU before we render - # anything. At that point, they can be scaled, rotated, and otherwise - # used like any other sprite. - w = 100 - h = 100 - x = (1280 - w) / 2 - y = (720 - h) / 2 - args.outputs.background_color = [64, 0, 128] - args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite - args.state.rotation += 1 + # In code, the cells are represented as 1x1 rectangles + # When drawn, the cells are larger than 1x1 rectangles + # This method is used to scale up cells, and lines + # Objects are scaled up according to the grid.cell_size variable + # This allows for easy customization of the visual scale of the grid + # This method scales up cells for the first grid + def dijkstra_scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone - args.outputs.primitives << args.gtk.current_framerate_primitives - end + # If cell is just an x and y coordinate + if cell.size == 2 + # Add a width and height of 1 + cell << 1 + cell << 1 + 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 - def tick args - # STOP! Watch the following presentation first!!!! - # Math for Game Programmers: Fast and Funky 1D Nonlinear Transformations - # https://www.youtube.com/watch?v=mr5xkf6zSzk + # Scale all the values up + cell.map! { |value| value * grid.cell_size } - # You've watched the talk, yes? YES??? + # Returns the scaled up cell + cell + end - # define starting and ending points of properties to animate - args.state.target_x = 1180 - args.state.target_y = 620 - args.state.target_w = 100 - args.state.target_h = 100 - args.state.starting_x = 0 - args.state.starting_y = 0 - args.state.starting_w = 300 - args.state.starting_h = 300 + # Translates the given cell grid.width + 1 to the right and then scales up + # Used to draw cells for the second grid + # This method does not work for lines, + # so separate methods exist for the grid lines + def greedy_scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone + # Translates the cell to the second grid equivalent + cell.x += grid.width + 1 + # Proceeds as if scaling up for the first grid + dijkstra_scale_up(cell) + end - # define start time and duration of animation - args.state.start_animate_at = 3.seconds # this is the same as writing 60 * 5 (or 300) - args.state.duration = 2.seconds # this is the same as writing 60 * 2 (or 120) + # Translates the given cell (grid.width + 1) * 2 to the right and then scales up + # Used to draw cells for the third grid + # This method does not work for lines, + # so separate methods exist for the grid lines + def a_star_scale_up(cell) + # Prevents the original value of cell from being edited + cell = cell.clone + # Translates the cell to the second grid equivalent + cell.x += grid.width + 1 + # Translates the cell to the third grid equivalent + cell.x += grid.width + 1 + # Proceeds as if scaling up for the first grid + dijkstra_scale_up(cell) + end - # define type of animations - # Here are all the options you have for values you can put in the array: - # :identity, :quad, :cube, :quart, :quint, :flip + # Signal that the user is going to be moving the star from the first grid + def dijkstra_mouse_over_star? + inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.star)) + end - # Linear is defined as: - # [:identity] - # - # Smooth start variations are: - # [:quad] - # [:cube] - # [:quart] - # [:quint] + # Signal that the user is going to be moving the star from the second grid + def greedy_mouse_over_star? + inputs.mouse.point.inside_rect?(greedy_scale_up(grid.star)) + end - # Linear reversed, and smooth stop are the same as the animations defined above, but reversed: - # [:flip, :identity] - # [:flip, :quad, :flip] - # [:flip, :cube, :flip] - # [:flip, :quart, :flip] - # [:flip, :quint, :flip] + # Signal that the user is going to be moving the star from the third grid + def a_star_mouse_over_star? + inputs.mouse.point.inside_rect?(a_star_scale_up(grid.star)) + end - # You can also do custom definitions. See the bottom of the file details - # on how to do that. I've defined a couple for you: - # [:smoothest_start] - # [:smoothest_stop] + # Signal that the user is going to be moving the target from the first grid + def dijkstra_mouse_over_target? + inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.target)) + end - # CHANGE THIS LINE TO ONE OF THE LINES ABOVE TO SEE VARIATIONS - args.state.animation_type = [:identity] - # args.state.animation_type = [:quad] - # args.state.animation_type = [:cube] - # args.state.animation_type = [:quart] - # args.state.animation_type = [:quint] - # args.state.animation_type = [:flip, :identity] - # args.state.animation_type = [:flip, :quad, :flip] - # args.state.animation_type = [:flip, :cube, :flip] - # args.state.animation_type = [:flip, :quart, :flip] - # args.state.animation_type = [:flip, :quint, :flip] - # args.state.animation_type = [:smoothest_start] - # args.state.animation_type = [:smoothest_stop] + # Signal that the user is going to be moving the target from the second grid + def greedy_mouse_over_target? + inputs.mouse.point.inside_rect?(greedy_scale_up(grid.target)) + end - # THIS IS WHERE THE MAGIC HAPPENS! - # Numeric#ease - progress = args.state.start_animate_at.ease(args.state.duration, args.state.animation_type) + # Signal that the user is going to be moving the target from the third grid + def a_star_mouse_over_target? + inputs.mouse.point.inside_rect?(a_star_scale_up(grid.target)) + end - # Numeric#ease needs to called: - # 1. On the number that represents the point in time you want to start, and takes two parameters: - # a. The first parameter is how long the animation should take. - # b. The second parameter represents the functions that need to be called. - # - # For example, if I wanted an animate to start 3 seconds in, and last for 10 seconds, - # and I want to animation to start fast and end slow, I would do: - # (60 * 3).ease(60 * 10, :flip, :quint, :flip) + # Signal that the user is going to be removing walls from the first grid + def dijkstra_mouse_over_wall? + grid.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(dijkstra_scale_up(wall)) + end - # initial value delta to the final value - calc_x = args.state.starting_x + (args.state.target_x - args.state.starting_x) * progress - calc_y = args.state.starting_y + (args.state.target_y - args.state.starting_y) * progress - calc_w = args.state.starting_w + (args.state.target_w - args.state.starting_w) * progress - calc_h = args.state.starting_h + (args.state.target_h - args.state.starting_h) * progress + false + end - args.outputs.solids << [calc_x, calc_y, calc_w, calc_h, 0, 0, 0] + # Signal that the user is going to be removing walls from the second grid + def greedy_mouse_over_wall? + grid.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(greedy_scale_up(wall)) + end - # count down - count_down = args.state.start_animate_at - args.state.tick_count - if count_down > 0 - args.outputs.labels << [640, 375, "Running: #{args.state.animation_type} in...", 3, 1] - args.outputs.labels << [640, 345, "%.2f" % count_down.fdiv(60), 3, 1] - elsif progress >= 1 - args.outputs.labels << [640, 360, "Click screen to reset.", 3, 1] - if args.inputs.click - $gtk.reset + false + end + + # Signal that the user is going to be removing walls from the third grid + def a_star_mouse_over_wall? + grid.walls.each_key do | wall | + return true if inputs.mouse.point.inside_rect?(a_star_scale_up(wall)) end + + false end - end - # $gtk.reset + # Signal that the user is going to be adding walls from the first grid + def dijkstra_mouse_over_grid? + inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.rect)) + end - # you can make own variations of animations using this - module Easing - # you have access to all the built in functions: identity, flip, quad, cube, quart, quint - def self.smoothest_start x - quad(quint(x)) + # Signal that the user is going to be adding walls from the second grid + def greedy_mouse_over_grid? + inputs.mouse.point.inside_rect?(greedy_scale_up(grid.rect)) end - def self.smoothest_stop x - flip(quad(quint(flip(x)))) + # Signal that the user is going to be adding walls from the third grid + def a_star_mouse_over_grid? + inputs.mouse.point.inside_rect?(a_star_scale_up(grid.rect)) end - # this is the source for the existing easing functions - def self.identity x - x + # Moves the star to the cell closest to the mouse in the first grid + # Only resets the search if the star changes position + # Called whenever the user is editing the star (puts mouse down on star) + def process_input_dijkstra_star + old_star = grid.star.clone + unless dijkstra_cell_closest_to_mouse == grid.target + grid.star = dijkstra_cell_closest_to_mouse + end + unless old_star == grid.star + reset_searches + end end - def self.flip x - 1 - x + # Moves the star to the cell closest to the mouse in the second grid + # Only resets the search if the star changes position + # Called whenever the user is editing the star (puts mouse down on star) + def process_input_greedy_star + old_star = grid.star.clone + unless greedy_cell_closest_to_mouse == grid.target + grid.star = greedy_cell_closest_to_mouse + end + unless old_star == grid.star + reset_searches + end end - def self.quad x - x * x + # Moves the star to the cell closest to the mouse in the third grid + # Only resets the search if the star changes position + # Called whenever the user is editing the star (puts mouse down on star) + def process_input_a_star_star + old_star = grid.star.clone + unless a_star_cell_closest_to_mouse == grid.target + grid.star = a_star_cell_closest_to_mouse + end + unless old_star == grid.star + reset_searches + end end - def self.cube x - x * x * x + # Moves the target to the grid closest to the mouse in the first grid + # Only reset_searchess the search if the target changes position + # Called whenever the user is editing the target (puts mouse down on target) + def process_input_dijkstra_target + old_target = grid.target.clone + unless dijkstra_cell_closest_to_mouse == grid.star + grid.target = dijkstra_cell_closest_to_mouse + end + unless old_target == grid.target + reset_searches + end end - def self.quart x - x * x * x * x * x + # Moves the target to the cell closest to the mouse in the second grid + # Only reset_searchess the search if the target changes position + # Called whenever the user is editing the target (puts mouse down on target) + def process_input_greedy_target + old_target = grid.target.clone + unless greedy_cell_closest_to_mouse == grid.star + grid.target = greedy_cell_closest_to_mouse + end + unless old_target == grid.target + reset_searches + end end - def self.quint x - x * x * x * x * x * x + # Moves the target to the cell closest to the mouse in the third grid + # Only reset_searchess the search if the target changes position + # Called whenever the user is editing the target (puts mouse down on target) + def process_input_a_star_target + old_target = grid.target.clone + unless a_star_cell_closest_to_mouse == grid.star + grid.target = a_star_cell_closest_to_mouse + end + unless old_target == grid.target + reset_searches + end end - end - -#+end_src - -* Tweening Lerping Easing Functions - Cubic Bezier - main.rb -#+begin_src ruby - # ./samples/08_tweening_lerping_easing_functions/02_cubic_bezier/app/main.rb - def tick args - args.outputs.background_color = [33, 33, 33] - args.outputs.lines << bezier(100, 100, - 100, 620, - 1180, 620, - 1180, 100, - 0) - args.outputs.lines << bezier(100, 100, - 100, 620, - 1180, 620, - 1180, 100, - 20) - end + # Removes walls in the first grid that are under the cursor + def process_input_dijkstra_remove_wall + # The mouse needs to be inside the grid, because we only want to remove walls + # the cursor is directly over + # Recalculations should only occur when a wall is actually deleted + if dijkstra_mouse_over_grid? + if grid.walls.has_key?(dijkstra_cell_closest_to_mouse) + grid.walls.delete(dijkstra_cell_closest_to_mouse) + reset_searches + end + end + end + # Removes walls in the second grid that are under the cursor + def process_input_greedy_remove_wall + # The mouse needs to be inside the grid, because we only want to remove walls + # the cursor is directly over + # Recalculations should only occur when a wall is actually deleted + if greedy_mouse_over_grid? + if grid.walls.has_key?(greedy_cell_closest_to_mouse) + grid.walls.delete(greedy_cell_closest_to_mouse) + reset_searches + end + end + end - def bezier x1, y1, x2, y2, x3, y3, x4, y4, step - step ||= 0 - color = [200, 200, 200] - points = points_for_bezier [x1, y1], [x2, y2], [x3, y3], [x4, y4], step + # Removes walls in the third grid that are under the cursor + def process_input_a_star_remove_wall + # The mouse needs to be inside the grid, because we only want to remove walls + # the cursor is directly over + # Recalculations should only occur when a wall is actually deleted + if a_star_mouse_over_grid? + if grid.walls.has_key?(a_star_cell_closest_to_mouse) + grid.walls.delete(a_star_cell_closest_to_mouse) + reset_searches + end + end + end - points.each_cons(2).map do |p1, p2| - [p1, p2, color] + # Adds a wall in the first grid in the cell the mouse is over + def process_input_dijkstra_add_wall + if dijkstra_mouse_over_grid? + unless grid.walls.has_key?(dijkstra_cell_closest_to_mouse) + grid.walls[dijkstra_cell_closest_to_mouse] = true + reset_searches + end + end end - end - def points_for_bezier p1, p2, p3, p4, step - points = [] - if step == 0 - [p1, p2, p3, p4] - else - t_step = 1.fdiv(step + 1) - t = 0 - t += t_step - points = [] - while t < 1 - points << [ - b_for_t(p1.x, p2.x, p3.x, p4.x, t), - b_for_t(p1.y, p2.y, p3.y, p4.y, t), - ] - t += t_step + # Adds a wall in the second grid in the cell the mouse is over + def process_input_greedy_add_wall + if greedy_mouse_over_grid? + unless grid.walls.has_key?(greedy_cell_closest_to_mouse) + grid.walls[greedy_cell_closest_to_mouse] = true + reset_searches + end end + end - [ - p1, - *points, - p4 - ] + # Adds a wall in the third grid in the cell the mouse is over + def process_input_a_star_add_wall + if a_star_mouse_over_grid? + unless grid.walls.has_key?(a_star_cell_closest_to_mouse) + grid.walls[a_star_cell_closest_to_mouse] = true + reset_searches + end + end end - end - def b_for_t v0, v1, v2, v3, t - pow(1 - t, 3) * v0 + - 3 * pow(1 - t, 2) * t * v1 + - 3 * (1 - t) * pow(t, 2) * v2 + - pow(t, 3) * v3 - end + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # Finding the cell closest to the mouse helps with this + def dijkstra_cell_closest_to_mouse + # Closest cell to the mouse in the first grid + x = (inputs.mouse.point.x / grid.cell_size).to_i + y = (inputs.mouse.point.y / grid.cell_size).to_i + # 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 + # Return closest cell + [x, y] + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # Finding the cell closest to the mouse in the second grid helps with this + def greedy_cell_closest_to_mouse + # Closest cell grid to the mouse in the second + x = (inputs.mouse.point.x / grid.cell_size).to_i + y = (inputs.mouse.point.y / grid.cell_size).to_i + # 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 + # Return closest cell + [x, y] + end + + # When the user grabs the star and puts their cursor to the far right + # and moves up and down, the star is supposed to move along the grid as well + # Finding the cell closest to the mouse in the third grid helps with this + def a_star_cell_closest_to_mouse + # Closest cell grid to the mouse in the second + x = (inputs.mouse.point.x / grid.cell_size).to_i + y = (inputs.mouse.point.y / grid.cell_size).to_i + # Translate the cell to the first grid + x -= (grid.width + 1) * 2 + # Bound x and y to the first grid + x = 0 if x < 0 + y = 0 if y < 0 + x = grid.width - 1 if x > grid.width - 1 + y = grid.height - 1 if y > grid.height - 1 + # Return closest cell + [x, y] + end + + def reset_searches + # Reset the searches + dijkstra.came_from = {} + dijkstra.cost_so_far = {} + dijkstra.frontier = [] + dijkstra.path = [] + + greedy.came_from = {} + greedy.frontier = [] + greedy.path = [] + a_star.came_from = {} + a_star.frontier = [] + a_star.path = [] + end + + def calc_searches + calc_dijkstra + calc_greedy + calc_a_star + # Move the searches forward to the current step + # state.current_step.times { move_searches_one_step_forward } + end + + def calc_dijkstra + # Sets up the search to begin from the star + dijkstra.frontier << grid.star + dijkstra.came_from[grid.star] = nil + dijkstra.cost_so_far[grid.star] = 0 + + # Until the target is found or there are no more cells to explore from + until dijkstra.came_from.has_key?(grid.target) or dijkstra.frontier.empty? + # Take the next frontier cell. The first element is the cell, the second is the priority. + new_frontier = dijkstra.frontier.shift#[0] + # For each of its neighbors + adjacent_neighbors(new_frontier).each do | neighbor | + # That have not been visited and are not walls + unless dijkstra.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor) + # Add them to the frontier and mark them as visited + dijkstra.frontier << neighbor + dijkstra.came_from[neighbor] = new_frontier + dijkstra.cost_so_far[neighbor] = dijkstra.cost_so_far[new_frontier] + 1 + end + end - def pow n, to - n ** to - end - -#+end_src - -* Tweening Lerping Easing Functions - Easing Using Spline - main.rb -#+begin_src ruby - # ./samples/08_tweening_lerping_easing_functions/03_easing_using_spline/app/main.rb - def tick args - args.state.duration = 10.seconds - args.state.spline = [ - [0.0, 0.33, 0.66, 1.0], - [1.0, 1.0, 1.0, 1.0], - [1.0, 0.66, 0.33, 0.0], - ] + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line + # Comment this line and let a path generate to see the difference + dijkstra.frontier = dijkstra.frontier.sort_by {| cell | proximity_to_star(cell) } + dijkstra.frontier = dijkstra.frontier.sort_by {| cell | dijkstra.cost_so_far[cell] } + end - args.state.simulation_tick = args.state.tick_count % args.state.duration - progress = 0.ease_spline_extended args.state.simulation_tick, args.state.duration, args.state.spline - args.outputs.borders << args.grid.rect - args.outputs.solids << [20 + 1240 * progress, - 20 + 680 * progress, - 20, 20].anchor_rect(0.5, 0.5) - args.outputs.labels << [10, - 710, - "perc: #{"%.2f" % (args.state.simulation_tick / args.state.duration)} t: #{args.state.simulation_tick}"] - end - -#+end_src - -* Tweening Lerping Easing Functions - Parametric Enemy Movement - main.rb -#+begin_src ruby - # ./samples/08_tweening_lerping_easing_functions/04_parametric_enemy_movement/app/main.rb - def new_star args - { x: 1280.randomize(:ratio), - starting_y: 800, - distance_to_travel: 900 + 100.randomize(:ratio), - duration: 100.randomize(:ratio) + 60, - created_at: args.state.tick_count, - max_alpha: 128.randomize(:ratio) + 128, - b: 255.randomize(:ratio), - g: 200.randomize(:ratio), - w: 1.randomize(:ratio) + 1, - h: 1.randomize(:ratio) + 1 } - end - def new_enemy args - { x: 1280.randomize(:ratio), - starting_y: 800, - distance_to_travel: -900, - duration: 60.randomize(:ratio) + 180, - created_at: args.state.tick_count, - w: 32, - h: 32, - fire_rate: (30.randomize(:ratio) + (60 - args.state.score)).to_i } - end + # If the search found the target + if dijkstra.came_from.has_key?(grid.target) + # Calculate the path between the target and star + dijkstra_calc_path + end + end - def new_bullet args, starting_x, starting_y, enemy_speed - { x: starting_x, - starting_y: starting_y, - distance_to_travel: -900, - created_at: args.state.tick_count, - duration: 900 / (enemy_speed.abs + 2.0 + (5.0 * args.state.score.fdiv(100))).abs, - w: 5, - h: 5 } - end + def calc_greedy + # Sets up the search to begin from the star + greedy.frontier << grid.star + greedy.came_from[grid.star] = nil - def new_player_bullet args, starting_x, starting_y, player_speed - { x: starting_x, - starting_y: starting_y, - distance_to_travel: 900, - created_at: args.state.tick_count, - duration: 900 / (player_speed + 2.0), - w: 5, - h: 5 } - end + # Until the target is found or there are no more cells to explore from + until greedy.came_from.has_key?(grid.target) or greedy.frontier.empty? + # Take the next frontier cell + new_frontier = greedy.frontier.shift + # For each of its neighbors + adjacent_neighbors(new_frontier).each do | neighbor | + # That have not been visited and are not walls + unless greedy.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor) + # Add them to the frontier and mark them as visited + greedy.frontier << neighbor + greedy.came_from[neighbor] = new_frontier + end + end + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line + # Comment this line and let a path generate to see the difference + greedy.frontier = greedy.frontier.sort_by {| cell | proximity_to_star(cell) } + # Sort the frontier so cells that are close to the target are then prioritized + greedy.frontier = greedy.frontier.sort_by {| cell | greedy_heuristic(cell) } + end - def defaults args - args.outputs.background_color = [0, 0, 0] - args.state.score ||= 0 - args.state.stars ||= [] - args.state.enemies ||= [] - args.state.bullets ||= [] - args.state.player_bullets ||= [] - args.state.max_stars = 50 - args.state.max_enemies = 10 - args.state.player.x ||= 640 - args.state.player.y ||= 100 - args.state.player.w ||= 32 - args.state.player.h ||= 32 - if args.state.tick_count == 0 - args.state.stars.clear - args.state.max_stars.times do - s = new_star args - s[:created_at] += s[:duration].randomize(:ratio) - args.state.stars << s + # If the search found the target + if greedy.came_from.has_key?(grid.target) + # Calculate the path between the target and star + greedy_calc_path end end - if args.state.tick_count == 0 - args.state.enemies.clear - args.state.max_enemies.times do - s = new_enemy args - s[:created_at] += s[:duration].randomize(:ratio) - args.state.enemies << s + def calc_a_star + # Setup the search to start from the star + a_star.came_from[grid.star] = nil + a_star.cost_so_far[grid.star] = 0 + a_star.frontier << grid.star + + # Until there are no more cells to explore from or the search has found the target + until a_star.frontier.empty? or a_star.came_from.has_key?(grid.target) + # Get the next cell to expand from + current_frontier = a_star.frontier.shift + + # For each of that cells neighbors + adjacent_neighbors(current_frontier).each do | neighbor | + # That have not been visited and are not walls + unless a_star.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor) + # Add them to the frontier and mark them as visited + a_star.frontier << neighbor + a_star.came_from[neighbor] = current_frontier + a_star.cost_so_far[neighbor] = a_star.cost_so_far[current_frontier] + 1 + end + end + + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line + # Comment this line and let a path generate to see the difference + a_star.frontier = a_star.frontier.sort_by {| cell | proximity_to_star(cell) } + a_star.frontier = a_star.frontier.sort_by {| cell | a_star.cost_so_far[cell] + greedy_heuristic(cell) } + end + + # If the search found the target + if a_star.came_from.has_key?(grid.target) + # Calculate the path between the target and star + a_star_calc_path + end + end + + # Calculates the path between the target and star for the breadth first search + # Only called when the breadth first search finds the target + def dijkstra_calc_path + # Start from the target + endpoint = grid.target + # And the cell it came from + next_endpoint = dijkstra.came_from[endpoint] + while endpoint and next_endpoint + # Draw a path between these two cells and store it + path = get_path_between(endpoint, next_endpoint) + dijkstra.path << path + # And get the next pair of cells + endpoint = next_endpoint + next_endpoint = dijkstra.came_from[endpoint] + # Continue till there are no more cells + end + end + + # Returns one-dimensional absolute distance between cell and target + # Returns a number to compare distances between cells and the target + def greedy_heuristic(cell) + (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs + end + + # Calculates the path between the target and star for the greedy search + # Only called when the greedy search finds the target + def greedy_calc_path + # Start from the target + endpoint = grid.target + # And the cell it came from + next_endpoint = greedy.came_from[endpoint] + while endpoint and next_endpoint + # Draw a path between these two cells and store it + path = get_path_between(endpoint, next_endpoint) + greedy.path << path + # And get the next pair of cells + endpoint = next_endpoint + next_endpoint = greedy.came_from[endpoint] + # Continue till there are no more cells + end + end + + # Calculates the path between the target and star for the a_star search + # Only called when the a_star search finds the target + def a_star_calc_path + # Start from the target + endpoint = grid.target + # And the cell it came from + next_endpoint = a_star.came_from[endpoint] + + while endpoint and next_endpoint + # Draw a path between these two cells and store it + path = get_path_between(endpoint, next_endpoint) + a_star.path << path + # And get the next pair of cells + endpoint = next_endpoint + next_endpoint = a_star.came_from[endpoint] + # Continue till there are no more cells + end + end + + # Returns a list of adjacent cells + # Used to determine what the next cells to be added to the frontier are + def adjacent_neighbors(cell) + neighbors = [] + + # 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 + end + + # Finds the vertical and horizontal distance of a cell from the star + # and returns the larger value + # This method is used to have a zigzag pattern in the rendered path + # A cell that is [5, 5] from the star, + # is explored before over a cell that is [0, 7] away. + # So, if possible, the search tries to go diagonal (zigzag) first + def proximity_to_star(cell) + distance_x = (grid.star.x - cell.x).abs + distance_y = (grid.star.y - cell.y).abs + + if distance_x > distance_y + return distance_x + else + return distance_y end end - end - def input args - if args.inputs.keyboard.left - args.state.player.x -= 5 - elsif args.inputs.keyboard.right - args.state.player.x += 5 + # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored. + def grid + state.grid end - if args.inputs.keyboard.up - args.state.player.y += 5 - elsif args.inputs.keyboard.down - args.state.player.y -= 5 + def dijkstra + state.dijkstra end - if args.inputs.keyboard.key_down.space - args.state.player_bullets << new_player_bullet(args, - args.state.player.x + args.state.player.w.half, - args.state.player.y + args.state.player.h, 5) + def greedy + state.greedy end - args.state.player.y = args.state.player.y.greater(0).lesser(720 - args.state.player.w) - args.state.player.x = args.state.player.x.greater(0).lesser(1280 - args.state.player.h) - end + def a_star + state.a_star + end - def completed? entity - (entity[:created_at] + entity[:duration]).elapsed_time > 0 - end + # Descriptive aliases for colors + def default_color + [221, 212, 213] # Light Brown + end - def calc_stars args - if (stars_to_add = args.state.max_stars - args.state.stars.length) > 0 - stars_to_add.times { args.state.stars << new_star(args) } + def wall_color + [134, 134, 120] # Camo Green + end + + def visited_color + [204, 191, 179] # Dark Brown + end + + def path_color + [231, 230, 228] # Pastel White + end + + def button_color + [190, 190, 190] # Gray end - args.state.stars = args.state.stars.reject { |s| completed? s } end - def move_enemies args - if (enemies_to_add = args.state.max_enemies - args.state.enemies.length) > 0 - enemies_to_add.times { args.state.enemies << new_enemy(args) } + + # Method that is called by DragonRuby periodically + # Used for updating animations and calculations + def tick args + + # Pressing r will reset the application + if args.inputs.keyboard.key_down.r + args.gtk.reset + reset + return end - args.state.enemies = args.state.enemies.reject { |s| completed? s } + # Every tick, new args are passed, and the Breadth First Search tick is called + $a_star_algorithm ||= A_Star_Algorithm.new(args) + $a_star_algorithm.args = args + $a_star_algorithm.tick end - def move_bullets args - args.state.enemies.each do |e| - if args.state.tick_count.mod_zero?(e[:fire_rate]) - args.state.bullets << new_bullet(args, e[:x] + e[:w].half, current_y(e), e[:distance_to_travel] / e[:duration]) - end - end - args.state.bullets = args.state.bullets.reject { |s| completed? s } - args.state.player_bullets = args.state.player_bullets.reject { |s| completed? s } + def reset + $a_star_algorithm = nil end + +#+end_src + +*** Path Finding Algorithms - Tower Defense - main.rb +#+begin_src 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 - def intersect? entity_one, entity_two - entity_one.merge(y: current_y(entity_one)) - .intersect_rect? entity_two.merge(y: current_y(entity_two)) + # The turrets shoot bullets at the closest tank. The bullets are heat-seeking + + def tick args + $gtk.reset if args.inputs.keyboard.key_down.r + defaults args + render args + calc args end - def kill args - bullets_hitting_enemies = [] - dead_bullets = [] - dead_enemies = [] + def defaults args + args.outputs.background_color = wall_color + args.state.grid_size = 5 + args.state.tile_size = 50 + args.state.grid_start ||= [0, 0] + args.state.grid_goal ||= [4, 4] + + # Try editing these walls to see the path change! + args.state.walls ||= { + [0, 4] => true, + [1, 3] => true, + [3, 1] => true, + # [4, 0] => true, + } - args.state.player_bullets.each do |b| - args.state.enemies.each do |e| - if intersect? b, e - dead_bullets << b - dead_enemies << e - end - end + args.state.a_star.frontier ||= [] + args.state.a_star.came_from ||= {} + args.state.a_star.path ||= [] + + args.state.tanks ||= [] + args.state.tank_spawn_period ||= 60 + args.state.tank_sprite_path ||= 'sprites/circle/white.png' + args.state.tank_speed ||= 1 + + args.state.turret_shoot_period = 10 + # Turrets can be entered as [x, y] but are immediately mapped to hashes + # Walls are also added where the turrets are to prevent tanks from pathing over them + args.state.turrets ||= [ + [2, 2] + ].each { |turret| args.state.walls[turret] = true}.map do |x, y| + { + x: x * args.state.tile_size, + y: y * args.state.tile_size, + w: args.state.tile_size, + h: args.state.tile_size, + path: 'sprites/circle/gray.png', + range: 100 + } end - args.state.score += dead_enemies.length + args.state.bullet_size ||= 25 + args.state.bullets ||= [] + args.state.bullet_path ||= 'sprites/circle/orange.png' + # + end - args.state.player_bullets.reject! { |b| dead_bullets.include? b } - args.state.enemies.reject! { |e| dead_enemies.include? e } + def render args + render_grid args + render_a_star args + args.outputs.sprites << args.state.tanks + args.outputs.sprites << args.state.turrets + args.outputs.sprites << args.state.bullets + end - dead = args.state.bullets.any? do |b| - [args.state.player.x, - args.state.player.y, - args.state.player.w, - args.state.player.h].intersect_rect? b.merge(y: current_y(b)) + def render_grid args + # Draw a square the size and color of the grid + args.outputs.solids << [ + 0, + 0, + args.state.grid_size * args.state.tile_size, + args.state.grid_size * args.state.tile_size, + grid_color + ] + + # Draw lines across the grid to show tiles + (args.state.grid_size + 1).times do | value | + render_horizontal_line(args, value) + render_vertical_line(args, value) end - return unless dead - args.gtk.reset - defaults args + + # Render special tiles + render_tile(args, args.state.grid_start, start_color) + render_tile(args, args.state.grid_goal, goal_color) + args.state.walls.keys.each { |wall| render_tile(args, wall, wall_color) } + end + + def render_vertical_line args, x + args.outputs.lines << [ + x * args.state.tile_size, + 0, + x * args.state.tile_size, + args.state.tile_size * args.state.grid_size, + ] end - def calc args - calc_stars args - move_enemies args - move_bullets args - kill args + def render_horizontal_line args, y + args.outputs.lines << [ + 0, + y * args.state.tile_size, + args.state.tile_size * args.state.grid_size, + y * args.state.tile_size, + ] end - def current_y entity - entity[:starting_y] + (entity[:distance_to_travel] * entity[:created_at].ease(entity[:duration], :identity)) + def render_tile args, tile, color + args.outputs.solids << [ + tile.x * args.state.tile_size, + tile.y * args.state.tile_size, + args.state.tile_size, + args.state.tile_size, + color + ] end - def render args - args.outputs.solids << args.state.stars.map do |s| - [s[:x], - current_y(s), - s[:w], s[:h], 0, s[:g], s[:b], s[:max_alpha] * s[:created_at].ease(20, :identity)] - end + def calc args + calc_a_star args + calc_tanks args + calc_turrets args + calc_bullets args + end - args.outputs.borders << args.state.enemies.map do |s| - [s[:x], - current_y(s), - s[:w], s[:h], 255, 0, 0] - end + def calc_a_star args + # Only does this one time + return unless args.state.a_star.path.empty? - args.outputs.borders << args.state.bullets.map do |b| - [b[:x], - current_y(b), - b[:w], b[:h], 255, 0, 0] + # Start the search from the grid start + args.state.a_star.frontier << args.state.grid_start + args.state.a_star.came_from[args.state.grid_start] = nil + + # Until a path to the goal has been found or there are no more tiles to explore + until (args.state.a_star.came_from.has_key?(args.state.grid_goal)|| args.state.a_star.frontier.empty?) + # For the first tile in the frontier + tile_to_expand_from = args.state.a_star.frontier.shift + # Add each of its neighbors to the frontier + neighbors(args, tile_to_expand_from).each do | tile | + args.state.a_star.frontier << tile + args.state.a_star.came_from[tile] = tile_to_expand_from + end end - args.outputs.borders << args.state.player_bullets.map do |b| - [b[:x], - current_y(b), - b[:w], b[:h], 255, 255, 255] + # Stop calculating a path if the goal was never reached + return unless args.state.a_star.came_from.has_key? args.state.grid_goal + + # Fill path by tracing back from the goal + current_cell = args.state.grid_goal + while current_cell + args.state.a_star.path.unshift current_cell + current_cell = args.state.a_star.came_from[current_cell] end - args.borders << [args.state.player.x, - args.state.player.y, - args.state.player.w, - args.state.player.h, 255, 255, 255] + puts "The path has been calculated" + puts args.state.a_star.path end - def tick args - defaults args - input args - calc args - render args + def calc_tanks args + spawn_tank args + move_tanks args end - -#+end_src - -* Performance - Sprites As Hash - main.rb -#+begin_src ruby - # ./samples/09_performance/01_sprites_as_hash/app/main.rb - # Sprites represented as Hashes using the queue ~args.outputs.sprites~ - # code up, but are the "slowest" to render. - # The reason for this is the access of the key in the Hash and also - # because the data args.outputs.sprites is cleared every tick. - def random_x args - (args.grid.w.randomize :ratio) * -1 - end + def move_tanks args + # Remove tanks that have reached the end of their path + args.state.tanks.reject! { |tank| tank[:a_star].empty? } - def random_y args - (args.grid.h.randomize :ratio) * -1 + # Tanks have an array that has each tile it has to go to in order from a* path + args.state.tanks.each do | tank | + destination = tank[:a_star][0] + # Move the tank towards the destination + tank[:x] += copy_sign(args.state.tank_speed, ((destination.x * args.state.tile_size) - tank[:x])) + tank[:y] += copy_sign(args.state.tank_speed, ((destination.y * args.state.tile_size) - tank[:y])) + # If the tank has reached its destination + if (destination.x * args.state.tile_size) == tank[:x] and + (destination.y * args.state.tile_size) == tank[:y] + # Set the destination to the next point in the path + tank[:a_star].shift + end + end end - def random_speed - 1 + (4.randomize :ratio) + def calc_turrets args + return unless args.state.tick_count.mod_zero? args.state.turret_shoot_period + args.state.turrets.each do | turret | + # Finds the closest tank + target = nil + shortest_distance = turret[:range] + 1 + args.state.tanks.each do | tank | + distance = distance_between(turret[:x], turret[:y], tank[:x], tank[:y]) + if distance < shortest_distance + target = tank + shortest_distance = distance + end + end + # If there is a tank in range, fires a bullet + if target + args.state.bullets << { + x: turret[:x], + y: turret[:y], + w: args.state.bullet_size, + h: args.state.bullet_size, + path: args.state.bullet_path, + # Note that this makes it heat-seeking, because target is passed by reference + # Could do target.clone to make the bullet go to where the tank initially was + target: target + } + end + end end - def new_star args - { - x: (random_x args), - y: (random_y args), - w: 4, h: 4, path: 'sprites/tiny-star.png', - s: random_speed - } + def calc_bullets args + # Bullets aim for the center of their targets + args.state.bullets.each { |bullet| move bullet, center_of(bullet[:target])} + args.state.bullets.reject! { |b| b.intersect_rect? b[:target] } end - def move_star args, star - star.x += star[:s] - star.y += star[:s] - if star.x > args.grid.w || star.y > args.grid.h - star.x = (random_x args) - star.y = (random_y args) - star[:s] = random_speed - end + def center_of object + object = object.clone + object[:x] += 0.5 + object[:y] += 0.5 + object end - def tick args - args.state.star_count ||= 0 - - # sets console command when sample app initially opens - if Kernel.global_tick_count == 0 - puts "* INFO - Please specify the number of sprites to render." - args.gtk.console.set_command "reset_with count: 100" + def render_a_star args + args.state.a_star.path.map do |tile| + # Map each x, y coordinate to the center of the tile and scale up + [(tile.x + 0.5) * args.state.tile_size, (tile.y + 0.5) * args.state.tile_size] + end.inject do | point_a, point_b | + # Render the line between each point + args.outputs.lines << [point_a.x, point_a.y, point_b.x, point_b.y, a_star_color] + point_b end + end - # init - if args.state.tick_count == 0 - args.state.stars = args.state.star_count.map { |i| new_star args } + # Moves object to target at speed + def move object, target, speed = 1 + if target.is_a? Hash + object[:x] += copy_sign(speed, target[:x] - object[:x]) + object[:y] += copy_sign(speed, target[:y] - object[:y]) + else + object[:x] += copy_sign(speed, target.x - object[:x]) + object[:y] += copy_sign(speed, target.y - object[:y]) end + end + # + # + def distance_between a_x, a_y, b_x, b_y + (((b_x - a_x) ** 2) + ((b_y - a_y) ** 2)) ** 0.5 + end - # update - args.state.stars.each { |s| move_star args, s } + def copy_sign value, sign + return 0 if sign == 0 + return value if sign > 0 + -value + end + # + def spawn_tank args + return unless args.state.tick_count.mod_zero? args.state.tank_spawn_period + args.state.tanks << { + x: args.state.grid_start.x, + y: args.state.grid_start.y, + w: args.state.tile_size, + h: args.state.tile_size, + path: args.state.tank_sprite_path, + a_star: args.state.a_star.path.clone + } + end - # render - args.outputs.sprites << args.state.stars - args.outputs.background_color = [0, 0, 0] - args.outputs.primitives << args.gtk.current_framerate_primitives + def neighbors args, tile + [[tile.x, tile.y - 1], + [tile.x, tile.y + 1], + [tile.x + 1, tile.y], + [tile.x - 1, tile.y]].reject do | neighbor | + args.state.a_star.came_from.has_key?(neighbor) or + tile_out_of_bounds?(args, neighbor) or + args.state.walls.has_key? neighbor + end end - # resets game, and assigns star count given by user - def reset_with count: count - $gtk.reset - $gtk.args.state.star_count = count + def tile_out_of_bounds? args, tile + tile.x < 0 or tile.y < 0 or tile.x >= args.state.grid_size or tile.y >= args.state.grid_size end - -#+end_src - -* Performance - Sprites As Entities - main.rb -#+begin_src 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. - # The hash sample has to use star[:s] to get the speed of the star, but - # an entity can use .s instead. - def random_x args - (args.grid.w.randomize :ratio) * -1 + + def grid_color + [133, 226, 144] end - def random_y args - (args.grid.h.randomize :ratio) * -1 + def start_color + [226, 144, 133] end - def random_speed - 1 + (4.randomize :ratio) + def goal_color + [226, 133, 144] end - def new_star args - args.state.new_entity :star, { - x: (random_x args), - y: (random_y args), - w: 4, h: 4, - path: 'sprites/tiny-star.png', - s: random_speed - } + def wall_color + [133, 144, 226] end - def move_star args, star - star.x += star.s - star.y += star.s - if star.x > args.grid.w || star.y > args.grid.h - star.x = (random_x args) - star.y = (random_y args) - star.s = random_speed - end + def a_star_color + [0, 0, 255] end + +#+end_src + +*** 3d - 3d Cube - main.rb +#+begin_src ruby + # ./samples/99_genre_3d/01_3d_cube/app/main.rb + STARTX = 0.0 + STARTY = 0.0 + ENDY = 20.0 + ENDX = 20.0 + SPINPOINT = 10 + SPINDURATION = 400 + POINTSIZE = 8 + BOXDEPTH = 40 + YAW = 1 + DISTANCE = 10 def tick args - args.state.star_count ||= 0 - - # sets console command when sample app initially opens - if Kernel.global_tick_count == 0 - puts "* INFO - Please specify the number of sprites to render." - args.gtk.console.set_command "reset_with count: 100" - end + args.outputs.background_color = [0, 0, 0] + a = Math.sin(args.state.tick_count / SPINDURATION) * Math.tan(args.state.tick_count / SPINDURATION) + s = Math.sin(a) + c = Math.cos(a) + x = STARTX + y = STARTY + offset_x = (1280 - (ENDX - STARTX)) / 2 + offset_y = (360 - (ENDY - STARTY)) / 2 - # init - if args.state.tick_count == 0 - args.state.stars = args.state.star_count.map { |i| new_star args } + srand(1) + while y < ENDY do + while x < ENDX do + if (y == STARTY || + y == (ENDY / 0.5) * 2 || + y == (ENDY / 0.5) * 2 + 0.5 || + y == ENDY - 0.5 || + x == STARTX || + x == ENDX - 0.5) + z = rand(BOXDEPTH) + z *= Math.sin(a / 2) + x -= SPINPOINT + u = (x * c) - (z * s) + v = (x * s) + (z * c) + k = DISTANCE.fdiv(100) + (v / 500 * YAW) + u = u / k + v = y / k + w = POINTSIZE / 10 / k + args.outputs.sprites << { x: offset_x + u - w, y: offset_y + v - w, w: w, h: w, path: 'sprites/square-blue.png'} + x += SPINPOINT + end + x += 0.5 + end + y += 0.5 + x = STARTX end - - # update - args.state.stars.each { |s| move_star args, s } - - # render - args.outputs.sprites << args.state.stars - args.outputs.background_color = [0, 0, 0] - args.outputs.primitives << args.gtk.current_framerate_primitives end - # resets game, and assigns star count given by user - def reset_with count: count - $gtk.reset - $gtk.args.state.star_count = count - end + $gtk.reset #+end_src -* Performance - Sprites As Strict Entities - main.rb +*** 3d - Wireframe - main.rb #+begin_src 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 - # entity must be predefined with a default value. Strict entities do not support the - # addition of new properties after the fact. They are more performant than OpenEntities - # because of this constraint. - def random_x args - (args.grid.w.randomize :ratio) * -1 + # ./samples/99_genre_3d/02_wireframe/app/main.rb + def tick args + args.state.model ||= Object3D.new('data/shuttle.off') + args.state.mtx ||= rotate3D(0, 0, 0) + args.state.inv_mtx ||= rotate3D(0, 0, 0) + delta_mtx = rotate3D(args.inputs.up_down * 0.01, input_roll(args) * 0.01, args.inputs.left_right * 0.01) + args.outputs.lines << args.state.model.edges + args.state.model.fast_3x3_transform! args.state.inv_mtx + args.state.inv_mtx = mtx_mul(delta_mtx.transpose, args.state.inv_mtx) + args.state.mtx = mtx_mul(args.state.mtx, delta_mtx) + args.state.model.fast_3x3_transform! args.state.mtx + args.outputs.background_color = [0, 0, 0] + args.outputs.debug << args.gtk.framerate_diagnostics_primitives end - def random_y args - (args.grid.h.randomize :ratio) * -1 + def input_roll args + roll = 0 + roll += 1 if args.inputs.keyboard.e + roll -= 1 if args.inputs.keyboard.q + roll end - def random_speed - 1 + (4.randomize :ratio) + def rotate3D(theta_x = 0.1, theta_y = 0.1, theta_z = 0.1) + c_x, s_x = Math.cos(theta_x), Math.sin(theta_x) + c_y, s_y = Math.cos(theta_y), Math.sin(theta_y) + c_z, s_z = Math.cos(theta_z), Math.sin(theta_z) + rot_x = [[1, 0, 0], [0, c_x, -s_x], [0, s_x, c_x]] + rot_y = [[c_y, 0, s_y], [0, 1, 0], [-s_y, 0, c_y]] + rot_z = [[c_z, -s_z, 0], [s_z, c_z, 0], [0, 0, 1]] + mtx_mul(mtx_mul(rot_x, rot_y), rot_z) end - def new_star args - args.state.new_entity_strict(:star, - x: (random_x args), - y: (random_y args), - w: 4, h: 4, - path: 'sprites/tiny-star.png', - s: random_speed) do |entity| - # invoke attr_sprite so that it responds to - # all properties that are required to render a sprite - entity.attr_sprite + def mtx_mul(a, b) + is = (0...a.length) + js = (0...b[0].length) + ks = (0...b.length) + is.map do |i| + js.map do |j| + ks.map do |k| + a[i][k] * b[k][j] + end.reduce(&:plus) + end end end - def move_star args, star - star.x += star.s - star.y += star.s - if star.x > args.grid.w || star.y > args.grid.h - star.x = (random_x args) - star.y = (random_y args) - star.s = random_speed + class Object3D + attr_reader :vert_count, :face_count, :edge_count, :verts, :faces, :edges + + def initialize(path) + @vert_count = 0 + @face_count = 0 + @edge_count = 0 + @verts = [] + @faces = [] + @edges = [] + _init_from_file path + end + + def _init_from_file path + file_lines = $gtk.read_file(path).split("\n") + .reject { |line| line.start_with?('#') || line.split(' ').length == 0 } # Strip out simple comments and blank lines + .map { |line| line.split('#')[0] } # Strip out end of line comments + .map { |line| line.split(' ') } # Tokenize by splitting on whitespace + raise "OFF file did not start with OFF." if file_lines.shift != ["OFF"] # OFF meshes are supposed to begin with "OFF" as the first line. + raise " line malformed" if file_lines[0].length != 3 # The second line needs to have 3 numbers. Raise an error if it doesn't. + @vert_count, @face_count, @edge_count = file_lines.shift&.map(&:to_i) # Update the counts + # Only the vertex and face counts need to be accurate. Raise an error if they are inaccurate. + raise "Incorrect number of vertices and/or faces (Parsed VFE header: #{@vert_count} #{@face_count} #{@edge_count})" if file_lines.length != @vert_count + @face_count + # Grab all the lines describing vertices. + vert_lines = file_lines[0, @vert_count] + # Grab all the lines describing faces. + face_lines = file_lines[@vert_count, @face_count] + # Create all the vertices + @verts = vert_lines.map_with_index { |line, id| Vertex.new(line, id) } + # Create all the faces + @faces = face_lines.map { |line| Face.new(line, @verts) } + # Create all the edges + @edges = @faces.flat_map(&:edges).uniq do |edge| + sorted = edge.sorted + [sorted.point_a, sorted.point_b] + end + end + + def fast_3x3_transform! mtx + @verts.each { |vert| vert.fast_3x3_transform! mtx } + end + end + + class Face + + attr_reader :verts, :edges + + def initialize(data, verts) + vert_count = data[0].to_i + vert_ids = data[1, vert_count].map(&:to_i) + @verts = vert_ids.map { |i| verts[i] } + @edges = [] + (0...vert_count).each { |i| @edges[i] = Edge.new(verts[vert_ids[i - 1]], verts[vert_ids[i]]) } + @edges.rotate! 1 end end - def tick args - args.state.star_count ||= 0 + class Edge + attr_reader :point_a, :point_b - # sets console command when sample app initially opens - if Kernel.global_tick_count == 0 - puts "* INFO - Please specify the number of sprites to render." - args.gtk.console.set_command "reset_with count: 100" + def initialize(point_a, point_b) + @point_a = point_a + @point_b = point_b end - # init - if args.state.tick_count == 0 - args.state.stars = args.state.star_count.map { |i| new_star args } + def sorted + @point_a.id < @point_b.id ? self : Edge.new(@point_b, @point_a) end - # update - args.state.stars.each { |s| move_star args, s } + def draw_override ffi + ffi.draw_line(@point_a.render_x, @point_a.render_y, @point_b.render_x, @point_b.render_y, 255, 0, 0, 128) + ffi.draw_line(@point_a.render_x+1, @point_a.render_y, @point_b.render_x+1, @point_b.render_y, 255, 0, 0, 128) + ffi.draw_line(@point_a.render_x, @point_a.render_y+1, @point_b.render_x, @point_b.render_y+1, 255, 0, 0, 128) + ffi.draw_line(@point_a.render_x+1, @point_a.render_y+1, @point_b.render_x+1, @point_b.render_y+1, 255, 0, 0, 128) + end - # render - args.outputs.sprites << args.state.stars - args.outputs.background_color = [0, 0, 0] - args.outputs.primitives << args.gtk.current_framerate_primitives + def primitive_marker + :line + end end - # resets game, and assigns star count given by user - def reset_with count: count - $gtk.reset - $gtk.args.state.star_count = count + class Vertex + attr_accessor :x, :y, :z, :id + + def initialize(data, id) + @x = data[0].to_f + @y = data[1].to_f + @z = data[2].to_f + @id = id + end + + def fast_3x3_transform! mtx + _x, _y, _z = @x, @y, @z + @x = mtx[0][0] * _x + mtx[0][1] * _y + mtx[0][2] * _z + @y = mtx[1][0] * _x + mtx[1][1] * _y + mtx[1][2] * _z + @z = mtx[2][0] * _x + mtx[2][1] * _y + mtx[2][2] * _z + end + + def render_x + @x * (10 / (5 - @y)) * 170 + 640 + end + + def render_y + @z * (10 / (5 - @y)) * 170 + 360 + end end +#+end_src +*** 3d - Wireframe - Data - what-is-this.txt +#+begin_src ruby + # ./samples/99_genre_3d/02_wireframe/data/what-is-this.txt + https://en.wikipedia.org/wiki/OFF_(file_format) #+end_src -* Performance - Sprites As Classes - main.rb +*** Arcade - Bullet Hell - main.rb #+begin_src 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. - # They are more performant than OpenEntities and StrictEntities, but more code upfront. - class Star - attr_sprite - - def initialize grid - @grid = grid - @x = (rand @grid.w) * -1 - @y = (rand @grid.h) * -1 - @w = 4 - @h = 4 - @s = 1 + (4.randomize :ratio) - @path = 'sprites/tiny-star.png' + # ./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 } + args.state.base_rows ||= 5.times.map { |n| 50 * n + 720 - 5 * 50 } + args.state.offset_columns = 10.times.map { |n| (n - 4.5) * Math.sin(Kernel.tick_count.to_radians) * 12 } + args.state.offset_rows = 5.map { 0 } + args.state.columns = 10.times.map { |i| args.state.base_columns[i] + args.state.offset_columns[i] } + args.state.rows = 5.times.map { |i| args.state.base_rows[i] + args.state.offset_rows[i] } + args.state.explosions ||= [] + args.state.enemies ||= [] + args.state.score ||= 0 + args.state.wave ||= 0 + if args.state.enemies.empty? + args.state.wave += 1 + args.state.wave_root = Math.sqrt(args.state.wave) + args.state.enemies = make_enemies + end + args.state.player ||= {x: 620, y: 80, w: 40, h: 40, path: 'sprites/circle-gray.png', angle: 90, cooldown: 0, alive: true} + args.state.enemy_bullets ||= [] + args.state.player_bullets ||= [] + args.state.lives ||= 3 + args.state.missed_shots ||= 0 + args.state.fired_shots ||= 0 + + update_explosions args + update_enemy_positions args + + if args.inputs.left && args.state.player[:x] > (300 + 5) + args.state.player[:x] -= 5 + end + if args.inputs.right && args.state.player[:x] < (1280 - args.state.player[:w] - 300 - 5) + args.state.player[:x] += 5 + end + + args.state.enemy_bullets.each do |bullet| + bullet[:x] += bullet[:dx] + bullet[:y] += bullet[:dy] + end + args.state.player_bullets.each do |bullet| + bullet[:x] += bullet[:dx] + bullet[:y] += bullet[:dy] + end + + args.state.enemy_bullets = args.state.enemy_bullets.find_all { |bullet| bullet[:y].between?(-16, 736) } + args.state.player_bullets = args.state.player_bullets.find_all do |bullet| + if bullet[:y].between?(-16, 736) + true + else + args.state.missed_shots += 1 + false + end end - def move - @x += @s - @y += @s - @x = (rand @grid.w) * -1 if @x > @grid.right - @y = (rand @grid.h) * -1 if @y > @grid.top + args.state.enemies = args.state.enemies.reject do |enemy| + if args.state.player[:alive] && 1500 > (args.state.player[:x] - enemy[:x]) ** 2 + (args.state.player[:y] - enemy[:y]) ** 2 + args.state.explosions << {x: enemy[:x] + 4, y: enemy[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} + args.state.explosions << {x: args.state.player[:x] + 4, y: args.state.player[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} + args.state.player[:alive] = false + true + else + false + end end - end - - # calls methods needed for game to run properly - def tick args - # sets console command when sample app initially opens - if Kernel.global_tick_count == 0 - args.gtk.console.set_command "reset_with count: 100" + args.state.enemy_bullets.each do |bullet| + if args.state.player[:alive] && 400 > (args.state.player[:x] - bullet[:x] + 12) ** 2 + (args.state.player[:y] - bullet[:y] + 12) ** 2 + args.state.explosions << {x: args.state.player[:x] + 4, y: args.state.player[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} + args.state.player[:alive] = false + bullet[:despawn] = true + end end - - # init - if args.state.tick_count == 0 - args.state.stars = args.state.star_count.map { |i| Star.new args.grid } + args.state.enemies = args.state.enemies.reject do |enemy| + args.state.player_bullets.any? do |bullet| + if 400 > (enemy[:x] - bullet[:x] + 12) ** 2 + (enemy[:y] - bullet[:y] + 12) ** 2 + args.state.explosions << {x: enemy[:x] + 4, y: enemy[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} + bullet[:despawn] = true + args.state.score += 1000 * args.state.wave + true + else + false + end + end end - # update - args.state.stars.each(&:move) + args.state.player_bullets = args.state.player_bullets.reject { |bullet| bullet[:despawn] } + args.state.enemy_bullets = args.state.enemy_bullets.reject { |bullet| bullet[:despawn] } - # render - args.outputs.sprites << args.state.stars - args.outputs.background_color = [0, 0, 0] - args.outputs.primitives << args.gtk.current_framerate_primitives - end + args.state.player[:cooldown] -= 1 + if args.inputs.keyboard.key_held.space && args.state.player[:cooldown] <= 0 && args.state.player[:alive] + args.state.player_bullets << {x: args.state.player[:x] + 12, y: args.state.player[:y] + 28, w: 16, h: 16, path: 'sprites/star.png', dx: 0, dy: 8}.sprite + args.state.fired_shots += 1 + args.state.player[:cooldown] = 10 + 20 / args.state.wave + end + args.state.enemies.each do |enemy| + if Math.rand < 0.0005 + 0.0005 * args.state.wave && args.state.player[:alive] && enemy[:move_state] == :normal + args.state.enemy_bullets << {x: enemy[:x] + 12, y: enemy[:y] - 8, w: 16, h: 16, path: 'sprites/star.png', dx: 0, dy: -3 - args.state.wave_root}.sprite + end + end - # resets game, and assigns star count given by user - def reset_with count: count - $gtk.reset - $gtk.args.state.star_count = count + args.outputs.background_color = [0, 0, 0] + args.outputs.primitives << args.state.enemies.map do |enemy| + [enemy[:x], enemy[:y], 40, 40, enemy[:path], -90].sprite + end + args.outputs.primitives << args.state.player if args.state.player[:alive] + args.outputs.primitives << args.state.explosions + args.outputs.primitives << args.state.player_bullets + args.outputs.primitives << args.state.enemy_bullets + accuracy = args.state.fired_shots.zero? ? 1 : (args.state.fired_shots - args.state.missed_shots) / args.state.fired_shots + args.outputs.primitives << [ + [0, 0, 300, 720, 96, 0, 0].solid, + [1280 - 300, 0, 300, 720, 96, 0, 0].solid, + [1280 - 290, 60, "Wave #{args.state.wave}", 255, 255, 255].label, + [1280 - 290, 40, "Accuracy #{(accuracy * 100).floor}%", 255, 255, 255].label, + [1280 - 290, 20, "Score #{(args.state.score * accuracy).floor}", 255, 255, 255].label, + ] + args.outputs.primitives << args.state.lives.times.map do |n| + [1280 - 290 + 50 * n, 80, 40, 40, 'sprites/circle-gray.png', 90].sprite + end + #args.outputs.debug << args.gtk.framerate_diagnostics_primitives + + if (!args.state.player[:alive]) && args.state.enemy_bullets.empty? && args.state.explosions.empty? && args.state.enemies.all? { |enemy| enemy[:move_state] == :normal } + args.state.player[:alive] = true + args.state.player[:x] = 624 + args.state.player[:y] = 80 + args.state.lives -= 1 + if args.state.lives == -1 + args.state.clear! + end + end + end + + def make_enemies + enemies = [] + enemies += 10.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 0, col: n, path: 'sprites/circle-orange.png', move_state: :retreat} } + enemies += 10.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 1, col: n, path: 'sprites/circle-orange.png', move_state: :retreat} } + enemies += 8.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 2, col: n + 1, path: 'sprites/circle-blue.png', move_state: :retreat} } + enemies += 8.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 3, col: n + 1, path: 'sprites/circle-blue.png', move_state: :retreat} } + enemies += 4.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 4, col: n + 3, path: 'sprites/circle-green.png', move_state: :retreat} } + enemies + end + + def update_explosions args + args.state.explosions.each do |explosion| + explosion[:age] += 0.5 + explosion[:path] = "sprites/explosion-#{explosion[:age].floor}.png" + end + args.state.explosions = args.state.explosions.reject { |explosion| explosion[:age] >= 7 } + end + + def update_enemy_positions args + args.state.enemies.each do |enemy| + if enemy[:move_state] == :normal + enemy[:x] = args.state.columns[enemy[:col]] + enemy[:y] = args.state.rows[enemy[:row]] + enemy[:move_state] = :dive if Math.rand < 0.0002 + 0.00005 * args.state.wave && args.state.player[:alive] + elsif enemy[:move_state] == :dive + enemy[:target_x] ||= args.state.player[:x] + enemy[:target_y] ||= args.state.player[:y] + dx = enemy[:target_x] - enemy[:x] + dy = enemy[:target_y] - enemy[:y] + vel = Math.sqrt(dx * dx + dy * dy) + speed_limit = 2 + args.state.wave_root + if vel > speed_limit + dx /= vel / speed_limit + dy /= vel / speed_limit + end + if vel < 1 || !args.state.player[:alive] + enemy[:move_state] = :retreat + end + enemy[:x] += dx + enemy[:y] += dy + elsif enemy[:move_state] == :retreat + enemy[:target_x] = args.state.columns[enemy[:col]] + enemy[:target_y] = args.state.rows[enemy[:row]] + dx = enemy[:target_x] - enemy[:x] + dy = enemy[:target_y] - enemy[:y] + vel = Math.sqrt(dx * dx + dy * dy) + speed_limit = 2 + args.state.wave_root + if vel > speed_limit + dx /= vel / speed_limit + dy /= vel / speed_limit + elsif vel < 1 + enemy[:move_state] = :normal + enemy[:target_x] = nil + enemy[:target_y] = nil + end + enemy[:x] += dx + enemy[:y] += dy + end + end end #+end_src -* Performance - Static Sprites As Classes - main.rb +*** Arcade - Dueling Starships - main.rb #+begin_src 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 - # by reference. You get better performance, but you are mutating state of held objects - # which is less functional/data oriented. - class Star - attr_sprite + # ./samples/99_genre_arcade/dueling_starships/app/main.rb + class DuelingSpaceships + attr_accessor :state, :inputs, :outputs, :grid - def initialize grid - @grid = grid - @x = (rand @grid.w) * -1 - @y = (rand @grid.h) * -1 - @w = 4 - @h = 4 - @s = 1 + (4.randomize :ratio) - @path = 'sprites/tiny-star.png' + def tick + defaults + render + calc + input end - def move - @x += @s - @y += @s - @x = (rand @grid.w) * -1 if @x > @grid.right - @y = (rand @grid.h) * -1 if @y > @grid.top + def defaults + outputs.background_color = [0, 0, 0] + state.ship_blue ||= new_blue_ship + state.ship_red ||= new_red_ship + state.flames ||= [] + state.bullets ||= [] + state.ship_blue_score ||= 0 + state.ship_red_score ||= 0 + state.stars ||= 100.map do + [rand.add(2).to_square(grid.w_half.randomize(:sign, :ratio), + grid.h_half.randomize(:sign, :ratio)), + 128 + 128.randomize(:ratio), 255, 255] + end end - end - # calls methods needed for game to run properly - def tick args - # sets console command when sample app initially opens - if Kernel.global_tick_count == 0 - args.gtk.console.set_command "reset_with count: 100" + def default_ship x, y, angle, sprite_path, bullet_sprite_path, color + state.new_entity(:ship, + { x: x, + y: y, + dy: 0, + dx: 0, + damage: 0, + dead: false, + angle: angle, + max_alpha: 255, + sprite_path: sprite_path, + bullet_sprite_path: bullet_sprite_path, + color: color }) end - # init - if args.state.tick_count == 0 - args.state.stars = args.state.star_count.map { |i| Star.new args.grid } + def new_red_ship + default_ship(400, 250.randomize(:sign, :ratio), + 180, 'sprites/ship_red.png', 'sprites/red_bullet.png', + [255, 90, 90]) end - # update - args.state.stars.each(&:move) + def new_blue_ship + default_ship(-400, 250.randomize(:sign, :ratio), + 0, 'sprites/ship_blue.png', 'sprites/blue_bullet.png', + [110, 140, 255]) + end - # render - args.outputs.sprites << args.state.stars - args.outputs.background_color = [0, 0, 0] - args.outputs.primitives << args.gtk.current_framerate_primitives - end + def render + render_instructions + render_score + render_universe + render_flames + render_ships + render_bullets + end - # resets game, and assigns star count given by user - def reset_with count: count - $gtk.reset - $gtk.args.state.star_count = count - end - -#+end_src - -* Performance - Static Sprites As Classes With Custom Drawing - main.rb -#+begin_src ruby - # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb - # Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~. - # is the fastest approach. This is comparable to what other game engines set as the default behavior. - # There are tradeoffs for all this speed if the creation of a full blown class, and bypassing - # functional/data-oriented practices. - class Star - def initialize grid - @grid = grid - @x = (rand @grid.w) * -1 - @y = (rand @grid.h) * -1 - @w = 4 - @h = 4 - @s = 1 + (4.randomize :ratio) - @path = 'sprites/tiny-star.png' + def render_ships + update_ship_outputs(state.ship_blue) + update_ship_outputs(state.ship_red) + outputs.sprites << [state.ship_blue.sprite, state.ship_red.sprite] + outputs.labels << [state.ship_blue.label, state.ship_red.label] end - def move - @x += @s - @y += @s - @x = (rand @grid.w) * -1 if @x > @grid.right - @y = (rand @grid.h) * -1 if @y > @grid.top + def render_instructions + return if state.ship_blue.dx > 0 || state.ship_blue.dy > 0 || + state.ship_red.dx > 0 || state.ship_red.dy > 0 || + state.flames.length > 0 + + outputs.labels << [grid.left.shift_right(30), + grid.bottom.shift_up(30), + "Two gamepads needed to play. R1 to accelerate. Left and right on D-PAD to turn ship. Hold A to shoot. Press B to drop mines.", + 0, 0, 255, 255, 255] + end + + def calc + calc_thrusts + calc_ships + calc_bullets + calc_winner + end + + def input + input_accelerate + input_turn + input_bullets_and_mines + end + + def render_score + outputs.labels << [grid.left.shift_right(80), + grid.top.shift_down(40), + state.ship_blue_score, 30, 1, state.ship_blue.color] + + outputs.labels << [grid.right.shift_left(80), + grid.top.shift_down(40), + state.ship_red_score, 30, 1, state.ship_red.color] + end + + def render_universe + return if outputs.static_solids.any? + outputs.static_solids << grid.rect + outputs.static_solids << state.stars + end + + def apply_round_finished_alpha entity + return entity unless state.round_finished_debounce + entity.a *= state.round_finished_debounce.percentage_of(2.seconds) + return entity end - # if the object that is in args.outputs.sprites (or static_sprites) - # respond_to? :draw_override, then the method is invoked giving you - # access to the class used to draw to the canvas. - def draw_override ffi_draw - # first move then draw - move + def update_ship_outputs ship, sprite_size = 66 + ship.sprite = + apply_round_finished_alpha [sprite_size.to_square(ship.x, ship.y), + ship.sprite_path, + ship.angle, + ship.dead ? 0 : 255 * ship.created_at.ease(2.seconds)].sprite + ship.label = + apply_round_finished_alpha [ship.x, + ship.y + 100, + "." * 5.minus(ship.damage).greater(0), 20, 1, ship.color, 255].label + end - # The argument order for ffi.draw_sprite is: - # x, y, w, h, path - ffi_draw.draw_sprite @x, @y, @w, @h, @path + def render_flames sprite_size = 6 + outputs.sprites << state.flames.map do |p| + apply_round_finished_alpha [sprite_size.to_square(p.x, p.y), + 'sprites/flame.png', 0, + p.max_alpha * p.created_at.ease(p.lifetime, :flip)].sprite + end + end - # The argument order for ffi_draw.draw_sprite_2 is (pass in nil for default value): - # x, y, w, h, path, - # angle, alpha + def render_bullets sprite_size = 10 + outputs.sprites << state.bullets.map do |b| + apply_round_finished_alpha [b.sprite_size.to_square(b.x, b.y), + b.owner.bullet_sprite_path, + 0, b.max_alpha].sprite + end + end - # The argument order for ffi_draw.draw_sprite_3 is: - # x, y, w, h, - # path, - # angle, - # alpha, red_saturation, green_saturation, blue_saturation - # 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 + def wrap_location! location + location.x = grid.left if location.x > grid.right + location.x = grid.right if location.x < grid.left + location.y = grid.top if location.y < grid.bottom + location.y = grid.bottom if location.y > grid.top + location end - end - # calls methods needed for game to run properly - def tick args - # sets console command when sample app initially opens - if Kernel.global_tick_count == 0 - args.gtk.console.set_command "reset_with count: 100" + def calc_thrusts + state.flames = + state.flames + .reject(&:old?) + .map do |p| + p.speed *= 0.9 + p.y += p.angle.vector_y(p.speed) + p.x += p.angle.vector_x(p.speed) + wrap_location! p + end 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 + def all_ships + [state.ship_blue, state.ship_red] end - # render framerate - args.outputs.background_color = [0, 0, 0] - args.outputs.primitives << args.gtk.current_framerate_primitives - end + def alive_ships + all_ships.reject { |s| s.dead } + end - # resets game, and assigns star count given by user - def reset_with count: count - $gtk.reset - $gtk.args.state.star_count = count - end - -#+end_src - -* Performance - Collision Limits - main.rb -#+begin_src ruby - # ./samples/09_performance/07_collision_limits/app/main.rb - =begin + def calc_bullet bullet + bullet.y += bullet.angle.vector_y(bullet.speed) + bullet.x += bullet.angle.vector_x(bullet.speed) + wrap_location! bullet + explode_bullet! bullet if bullet.old? + return if bullet.exploded + return if state.round_finished + alive_ships.each do |s| + if s != bullet.owner && + s.sprite.intersect_rect?(bullet.sprite_size.to_square(bullet.x, bullet.y)) + explode_bullet! bullet, 10, 5, 30 + s.damage += 1 + end + end + end - Reminders: - - find_all: Finds all elements of a collection that meet certain requirements. - In this sample app, we're finding all bodies that intersect with the center body. + def calc_bullets + state.bullets.each { |b| calc_bullet b } + state.bullets.reject! { |b| b.exploded } + end - - args.outputs.solids: An array. The values generate a solid. - The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE] - For more information about solids, go to mygame/documentation/03-solids-and-borders.md. + def create_explosion! type, entity, flame_count, max_speed, lifetime, max_alpha = 255 + flame_count.times do + state.flames << state.new_entity(type, + { angle: 360.randomize(:ratio), + speed: max_speed.randomize(:ratio), + lifetime: lifetime, + x: entity.x, + y: entity.y, + max_alpha: max_alpha }) + end + end - - args.outputs.labels: An array. The values generate a label. - The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] - For more information about labels, go to mygame/documentation/02-labels.md. + def explode_bullet! bullet, flame_override = 5, max_speed = 5, lifetime = 10 + bullet.exploded = true + create_explosion! :bullet_explosion, + bullet, + flame_override, + max_speed, + lifetime, + bullet.max_alpha + end - - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect. + def calc_ship ship + ship.x += ship.dx + ship.y += ship.dy + wrap_location! ship + end - =end + def calc_ships + all_ships.each { |s| calc_ship s } + return if all_ships.any? { |s| s.dead } + return if state.round_finished + return unless state.ship_blue.sprite.intersect_rect?(state.ship_red.sprite) + state.ship_blue.damage = 5 + state.ship_red.damage = 5 + end - # This code demonstrates moving objects that loop around once they exceed the scope of the screen, - # which has dimensions of 1280 by 720, and also detects collisions between objects called "bodies". + def create_thruster_flames! ship + state.flames << state.new_entity(:ship_thruster, + { angle: ship.angle + 180 + 60.randomize(:sign, :ratio), + speed: 5.randomize(:ratio), + max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), + lifetime: 30, + x: ship.x - ship.angle.vector_x(40) + 5.randomize(:sign, :ratio), + y: ship.y - ship.angle.vector_y(40) + 5.randomize(:sign, :ratio) }) + end - def body_count num - $gtk.args.state.other_bodies = num.map { [1280 * rand, 720 * rand, 10, 10] } # other_bodies set using num collection - end + def input_accelerate_ship should_move_ship, ship + return if ship.dead - def tick args + should_move_ship &&= (ship.dx + ship.dy).abs < 5 - # Center body's values are set using an array - # Map is used to set values of 2000 other bodies - # All bodies that intersect with center body are stored in collisions collection - args.state.center_body ||= [640 - 100, 360 - 100, 200, 200] # calculations done to place body in center - args.state.other_bodies ||= 2000.map { [1280 * rand, 720 * rand, 10, 10] } # 2000 bodies given random position on screen + if should_move_ship + create_thruster_flames! ship + ship.dx += ship.angle.vector_x 0.050 + ship.dy += ship.angle.vector_y 0.050 + else + ship.dx *= 0.99 + ship.dy *= 0.99 + end + end - # finds all bodies that intersect with center body, stores them in collisions - collisions = args.state.other_bodies.find_all { |b| b.intersect_rect? args.state.center_body } + def input_accelerate + input_accelerate_ship inputs.controller_one.key_held.r1 || inputs.keyboard.up, state.ship_blue + input_accelerate_ship inputs.controller_two.key_held.r1, state.ship_red + end - args.borders << args.state.center_body # outputs center body as a black border + def input_turn_ship direction, ship + ship.angle -= 3 * direction + end - # transparency changes based on number of collisions; the more collisions, the redder (more transparent) the box becomes - args.solids << [args.state.center_body, 255, 0, 0, collisions.length * 5] # center body is red solid - args.solids << args.state.other_bodies # other bodies are output as (black) solids, as well + def input_turn + input_turn_ship inputs.controller_one.left_right + inputs.keyboard.left_right, state.ship_blue + input_turn_ship inputs.controller_two.left_right, state.ship_red + end - args.labels << [10, 30, args.gtk.current_framerate] # outputs frame rate in bottom left corner + def input_bullet create_bullet, ship + return unless create_bullet + return if ship.dead - # Bodies are returned to bottom left corner if positions exceed scope of screen - args.state.other_bodies.each do |b| # for each body in the other_bodies collection - b.x += 5 # x and y are both incremented by 5 - b.y += 5 - b.x = 0 if b.x > 1280 # x becomes 0 if star exceeds scope of screen (goes too far right) - b.y = 0 if b.y > 720 # y becomes 0 if star exceeds scope of screen (goes too far up) + state.bullets << state.new_entity(:ship_bullet, + { owner: ship, + angle: ship.angle, + max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), + speed: 5 + ship.dx.mult(ship.angle.vector_x) + ship.dy.mult(ship.angle.vector_y), + lifetime: 120, + sprite_size: 10, + x: ship.x + ship.angle.vector_x * 32, + y: ship.y + ship.angle.vector_y * 32 }) end - end - # Resets the game. - $gtk.reset - -#+end_src - -* Advanced Debugging - Trace Debugging - main.rb -#+begin_src ruby - # ./samples/10_advanced_debugging/01_trace_debugging/app/main.rb - class Game - attr_gtk + def input_mine create_mine, ship + return unless create_mine + return if ship.dead - def method1 num - method2 num + state.bullets << state.new_entity(:ship_bullet, + { owner: ship, + angle: 360.randomize(:sign, :ratio), + max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), + speed: 0.02, + sprite_size: 10, + lifetime: 600, + x: ship.x + ship.angle.vector_x * -50, + y: ship.y + ship.angle.vector_y * -50 }) end - def method2 num - method3 num - end + def input_bullets_and_mines + return if state.bullets.length > 100 - def method3 num - method4 num + [ + [inputs.controller_one.key_held.a || inputs.keyboard.key_held.space, + inputs.controller_one.key_down.b || inputs.keyboard.key_down.down, + state.ship_blue], + [inputs.controller_two.key_held.a, inputs.controller_two.key_down.b, state.ship_red] + ].each do |a_held, b_down, ship| + input_bullet(a_held && state.tick_count.mod_zero?(10).or(a_held == 0), ship) + input_mine(b_down, ship) + end end - def method4 num - if num == 1 - puts "UNLUCKY #{num}." - state.unlucky_count += 1 - if state.unlucky_count > 3 - raise "NAT 1 finally occurred. Check app/trace.txt for all method invocation history." - end - else - puts "LUCKY #{num}." + def calc_kill_ships + alive_ships.find_all { |s| s.damage >= 5 }.each do |s| + s.dead = true + create_explosion! :ship_explosion, s, 20, 20, 30, s.max_alpha end end - def tick - state.roll_history ||= [] - state.roll_history << rand(20) + 1 - state.countdown ||= 600 - state.countdown -= 1 - state.unlucky_count ||= 0 - outputs.labels << [640, 360, "A dice roll of 1 will cause an exception.", 0, 1] - if state.countdown > 0 - outputs.labels << [640, 340, "Dice roll countdown: #{state.countdown}", 0, 1] - else - state.attempts ||= 0 - state.attempts += 1 - outputs.labels << [640, 340, "ROLLING! #{state.attempts}", 0, 1] + def calc_score + return if state.round_finished + return if alive_ships.length > 1 + + if alive_ships.first == state.ship_red + state.ship_red_score += 1 + elsif alive_ships.first == state.ship_blue + state.ship_blue_score += 1 end - return if state.countdown > 0 - method1 state.roll_history[-1] - end - end - $game = Game.new + state.round_finished = true + end - def tick args - trace! $game # <------------------- TRACING ENABLED FOR THIS OBJECT - $game.args = args - $game.tick - end - -#+end_src - -* Advanced Debugging - Trace Debugging Classes - main.rb -#+begin_src ruby - # ./samples/10_advanced_debugging/02_trace_debugging_classes/app/main.rb - class Foobar - def initialize - trace! # Trace is added to the constructor. + def calc_reset_ships + return unless state.round_finished + state.round_finished_debounce ||= 2.seconds + state.round_finished_debounce -= 1 + return if state.round_finished_debounce > 0 + start_new_round! end - def clicky args - return unless args.inputs.mouse.click - try_rand rand + def start_new_round! + state.ship_blue = new_blue_ship + state.ship_red = new_red_ship + state.round_finished = false + state.round_finished_debounce = nil + state.flames.clear + state.bullets.clear end - def try_rand num - return if num < 0.9 - raise "Exception finally occurred. Take a look at logs/trace.txt #{num}." + def calc_winner + calc_kill_ships + calc_score + calc_reset_ships end end + $dueling_spaceship = DuelingSpaceships.new + def tick args - args.labels << [640, 360, "Start clicking. Eventually an exception will be thrown. Then look at logs/trace.txt.", 0, 1] - args.state.foobar = Foobar.new if args.tick_count - return unless args.state.foobar - args.state.foobar.clicky args + args.grid.origin_center! + $dueling_spaceship.inputs = args.inputs + $dueling_spaceship.outputs = args.outputs + $dueling_spaceship.state = args.state + $dueling_spaceship.grid = args.grid + $dueling_spaceship.tick end #+end_src -* Advanced Debugging - Unit Tests - exception_raising_tests.rb +*** arcade/flappy dragon/credits.txt #+begin_src ruby - # ./samples/10_advanced_debugging/03_unit_tests/exception_raising_tests.rb - begin :shared - class ExceptionalClass - def initialize exception_to_throw = nil - raise exception_to_throw if exception_to_throw - end - end - end - - def test_exception_in_newing_object args, assert - begin - ExceptionalClass.new TypeError - raise "Exception wasn't thrown!" - rescue Exception => e - assert.equal! e.class, TypeError, "Exceptions within constructor should be retained." - end - end + # ./samples/99_genre_arcade/flappy_dragon/CREDITS.txt + code: Amir Rajan, https://twitter.com/amirrajan + graphics and audio: Nick Culbertson, https://twitter.com/MobyPixel - puts "running tests" - $gtk.reset 100 - $gtk.log_level = :off - $gtk.tests.start - -#+end_src - -* Advanced Debugging - Unit Tests - gen_docs.rb -#+begin_src ruby - # ./samples/10_advanced_debugging/03_unit_tests/gen_docs.rb - # sh ./amir-build-and-run.sh --eval samples/99_zz_gtk_unit_tests/gen_docs.rb --no-tick - Kernel.export_docs! #+end_src -* Advanced Debugging - Unit Tests - geometry_tests.rb +*** arcade/flappy dragon/main.rb #+begin_src ruby - # ./samples/10_advanced_debugging/03_unit_tests/geometry_tests.rb - begin :shared - def primitive_representations x, y, w, h - [ - [x, y, w, h], - { x: x, y: y, w: w, h: h }, - RectForTest.new(x, y, w, h) - ] - end + # ./samples/99_genre_arcade/flappy_dragon/app/main.rb + class FlappyDragon + attr_accessor :grid, :inputs, :state, :outputs - class RectForTest - attr_sprite + def tick + defaults + render + calc + process_inputs + end - def initialize x, y, w, h - @x = x - @y = y - @w = w - @h = h - end + def defaults + state.flap_power = 11 + state.gravity = 0.9 + state.ceiling = 600 + state.ceiling_flap_power = 6 + state.wall_countdown_length = 100 + state.wall_gap_size = 100 + state.wall_countdown ||= 0 + state.hi_score ||= 0 + state.score ||= 0 + state.walls ||= [] + state.x ||= 50 + state.y ||= 500 + state.dy ||= 0 + state.scene ||= :menu + state.scene_at ||= 0 + state.difficulty ||= :normal + state.new_difficulty ||= :normal + state.countdown ||= 4.seconds + state.flash_at ||= 0 + end - def to_s - "RectForTest: #{[x, y, w, h]}" - end + def render + outputs.sounds << "sounds/flappy-song.ogg" if state.tick_count == 1 + render_score + render_menu + render_game end - end - begin :intersect_rect? - def test_intersect_rect_point args, assert - assert.true! [16, 13].intersect_rect?([13, 12, 4, 4]), "point intersects with rect." + def render_score + outputs.primitives << [10, 710, "HI SCORE: #{state.hi_score}", large_white_typeset].label + outputs.primitives << [10, 680, "SCORE: #{state.score}", large_white_typeset].label + outputs.primitives << [10, 650, "DIFFICULTY: #{state.difficulty.upcase}", large_white_typeset].label end - def test_intersect_rect args, assert - intersecting = primitive_representations(0, 0, 100, 100) + - primitive_representations(20, 20, 20, 20) + def render_menu + return unless state.scene == :menu + render_overlay - intersecting.product(intersecting).each do |rect_one, rect_two| - assert.true! rect_one.intersect_rect?(rect_two), - "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected true)." - end + outputs.labels << [640, 700, "Flappy Dragon", 50, 1, 255, 255, 255] + outputs.labels << [640, 500, "Instructions: Press Spacebar to flap. Don't die.", 4, 1, 255, 255, 255] + outputs.labels << [430, 430, "[Tab] Change difficulty", 4, 0, 255, 255, 255] + outputs.labels << [430, 400, "[Enter] Start at New Difficulty ", 4, 0, 255, 255, 255] + outputs.labels << [430, 370, "[Escape] Cancel/Resume ", 4, 0, 255, 255, 255] + outputs.labels << [640, 300, "(mouse, touch, and game controllers work, too!) ", 4, 1, 255, 255, 255] + outputs.labels << [640, 200, "Difficulty: #{state.new_difficulty.capitalize}", 4, 1, 255, 255, 255] - not_intersecting = [ - [ 0, 0, 5, 5], - { x: 10, y: 10, w: 5, h: 5 }, - RectForTest.new(20, 20, 5, 5) - ] + outputs.labels << [10, 100, "Code: @amirrajan", 255, 255, 255] + outputs.labels << [10, 80, "Art: @mobypixel", 255, 255, 255] + outputs.labels << [10, 60, "Music: @mobypixel", 255, 255, 255] + outputs.labels << [10, 40, "Engine: DragonRuby GTK", 255, 255, 255] + end - not_intersecting.product(not_intersecting) - .reject { |rect_one, rect_two| rect_one == rect_two } - .each do |rect_one, rect_two| - assert.false! rect_one.intersect_rect?(rect_two), - "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected false)." - end + def render_overlay + outputs.primitives << [grid.rect.scale_rect(1.1, 0, 0), 0, 0, 0, 230].solid end - end - begin :inside_rect? - def assert_inside_rect outer: nil, inner: nil, expected: nil, assert: nil - assert.true! inner.inside_rect?(outer) == expected, - "inside_rect? assertion failed for outer: #{outer} inner: #{inner} (expected #{expected})." + def render_game + render_game_over + render_background + render_walls + render_dragon + render_flash + end + + def render_game_over + return unless state.scene == :game + outputs.labels << [638, 358, score_text, 20, 1] + outputs.labels << [635, 360, score_text, 20, 1, 255, 255, 255] + outputs.labels << [638, 428, countdown_text, 20, 1] + outputs.labels << [635, 430, countdown_text, 20, 1, 255, 255, 255] + end + + def render_background + outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png'] + + scroll_point_at = state.tick_count + scroll_point_at = state.scene_at if state.scene == :menu + scroll_point_at = state.death_at if state.countdown > 0 + scroll_point_at ||= 0 + + outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_back.png', 0.25) + outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_middle.png', 0.50) + outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_front.png', 1.00, -80) end - def test_inside_rect args, assert - outer_rects = primitive_representations(0, 0, 10, 10) - inner_rects = primitive_representations(1, 1, 5, 5) - primitive_representations(0, 0, 10, 10).product(primitive_representations(1, 1, 5, 5)) - .each do |outer, inner| - assert_inside_rect outer: outer, inner: inner, - expected: true, assert: assert + def render_walls + state.walls.each do |w| + w.sprites = [ + [w.x, w.bottom_height - 720, 100, 720, 'sprites/wall.png', 180], + [w.x, w.top_y, 100, 720, 'sprites/wallbottom.png', 0] + ] end + outputs.sprites << state.walls.map(&:sprites) end - end - begin :angle_to - def test_angle_to args, assert - origins = primitive_representations(0, 0, 0, 0) - rights = primitive_representations(1, 0, 0, 0) - aboves = primitive_representations(0, 1, 0, 0) + def render_dragon + state.show_death = true if state.countdown == 3.seconds - origins.product(aboves).each do |origin, above| - assert.equal! origin.angle_to(above), 90, - "A point directly above should be 90 degrees." + render_debug_hitbox false - assert.equal! above.angle_from(origin), 90, - "A point coming from above should be 90 degrees." + if state.show_death == false || !state.death_at + animation_index = state.flapped_at.frame_index 6, 2, false if state.flapped_at + sprite_name = "sprites/dragon_fly#{animation_index.or(0) + 1}.png" + state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2] + else + sprite_name = "sprites/dragon_die.png" + state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2] + sprite_changed_elapsed = state.death_at.elapsed_time - 1.seconds + state.dragon_sprite.angle += (sprite_changed_elapsed ** 1.3) * state.death_fall_direction * -1 + state.dragon_sprite.x += (sprite_changed_elapsed ** 1.2) * state.death_fall_direction + state.dragon_sprite.y += (sprite_changed_elapsed * 14 - sprite_changed_elapsed ** 1.6) end - origins.product(rights).each do |origin, right| - assert.equal! origin.angle_to(right) % 360, 0, - "A point directly to the right should be 0 degrees." - - assert.equal! right.angle_from(origin) % 360, 0, - "A point coming from the right should be 0 degrees." + outputs.sprites << state.dragon_sprite + end + def render_debug_hitbox show + return unless show + outputs.borders << [dragon_collision_box.rect, 255, 0, 0] if state.dragon_sprite + outputs.borders << state.walls.flat_map do |w| + w.sprites.map { |s| [s.rect, 255, 0, 0] } end end - end - begin :scale_rect - def test_scale_rect args, assert - assert.equal! [0, 0, 100, 100].scale_rect(0.5, 0.5), - [25.0, 25.0, 50.0, 50.0] + def render_flash + return unless state.flash_at - assert.equal! [0, 0, 100, 100].scale_rect(0.5), - [0.0, 0.0, 50.0, 50.0] + outputs.primitives << [grid.rect, + white, + 255 * state.flash_at.ease(20, :flip)].solid - assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0.5, anchor_y: 0.5), - [25.0, 25.0, 50.0, 50.0] + state.flash_at = 0 if state.flash_at.elapsed_time > 20 + end - assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0, anchor_y: 0), - [0.0, 0.0, 50.0, 50.0] + def calc + return unless state.scene == :game + reset_game if state.countdown == 1 + state.countdown -= 1 and return if state.countdown > 0 + calc_walls + calc_flap + calc_game_over end - end - puts "running tests" - $gtk.reset 100 - $gtk.log_level = :off - $gtk.tests.start - -#+end_src - -* Advanced Debugging - Unit Tests - http_tests.rb -#+begin_src ruby - # ./samples/10_advanced_debugging/03_unit_tests/http_tests.rb - def try_assert_or_schedule args, assert - if $result[:complete] - log_info "Request completed! Verifying." - if $result[:http_response_code] != 200 - log_info "The request yielded a result of #{$result[:http_response_code]} instead of 200." - exit - end - log_info ":try_assert_or_schedule succeeded!" - else - args.gtk.schedule_callback Kernel.tick_count + 10 do - try_assert_or_schedule args, assert + def calc_walls + state.walls.each { |w| w.x -= 8 } + + walls_count_before_removal = state.walls.length + + state.walls.reject! { |w| w.x < -100 } + + state.score += 1 if state.walls.count < walls_count_before_removal + + state.wall_countdown -= 1 and return if state.wall_countdown > 0 + + state.walls << state.new_entity(:wall) do |w| + w.x = grid.right + w.opening = grid.top + .randomize(:ratio) + .greater(200) + .lesser(520) + w.bottom_height = w.opening - state.wall_gap_size + w.top_y = w.opening + state.wall_gap_size end - end - end - def test_http args, assert - $result = $gtk.http_get 'http://dragonruby.org' - try_assert_or_schedule args, assert - end + state.wall_countdown = state.wall_countdown_length + end - puts "running tests" - $gtk.reset 100 - $gtk.log_level = :off - $gtk.tests.start - -#+end_src - -* Advanced Debugging - Unit Tests - object_to_primitive_tests.rb -#+begin_src ruby - # ./samples/10_advanced_debugging/03_unit_tests/object_to_primitive_tests.rb - class PlayerSpriteForTest - end + def calc_flap + state.y += state.dy + state.dy = state.dy.lesser state.flap_power + state.dy -= state.gravity + return if state.y < state.ceiling + state.y = state.ceiling + state.dy = state.dy.lesser state.ceiling_flap_power + end - def test_array_to_sprite args, assert - array = [[0, 0, 100, 100, "test.png"]].sprites - puts "No exception was thrown. Sweet!" - end + def calc_game_over + return unless game_over? - def test_class_to_sprite args, assert - array = [PlayerSprite.new].sprites - assert.true! array.first.is_a?(PlayerSprite) - puts "No exception was thrown. Sweet!" - end + state.death_at = state.tick_count + state.death_from = state.walls.first + state.death_fall_direction = -1 + state.death_fall_direction = 1 if state.x > state.death_from.x + outputs.sounds << "sounds/hit-sound.wav" + begin_countdown + end - $gtk.reset 100 - $gtk.log_level = :off - $gtk.tests.start - -#+end_src - -* Advanced Debugging - Unit Tests - parsing_tests.rb -#+begin_src 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"] }' - assert.equal! result, { "name"=>"John Doe", "aliases"=>["JD"] }, "Parsing JSON failed." - end + def process_inputs + process_inputs_menu + process_inputs_game + end - def test_parse_xml args, assert - result = args.gtk.parse_xml <<-S - - John Doe - - S + def process_inputs_menu + return unless state.scene == :menu - expected = {:type=>:element, - :name=>nil, - :children=>[{:type=>:element, - :name=>"Person", - :children=>[{:type=>:element, - :name=>"Name", - :children=>[{:type=>:content, - :data=>"John Doe"}]}], - :attributes=>{"id"=>"100"}}]} + changediff = inputs.keyboard.key_down.tab || inputs.controller_one.key_down.select + if inputs.mouse.click + p = inputs.mouse.click.point + if (p.y >= 165) && (p.y < 200) && (p.x >= 500) && (p.x < 800) + changediff = true + end + end - assert.equal! result, expected, "Parsing xml failed." - end + if changediff + case state.new_difficulty + when :easy + state.new_difficulty = :normal + when :normal + state.new_difficulty = :hard + when :hard + state.new_difficulty = :flappy + when :flappy + state.new_difficulty = :easy + end + end - puts "running tests" - $gtk.reset 100 - $gtk.log_level = :off - $gtk.tests.start - -#+end_src - -* Advanced Debugging - Unit Tests - serialize_deserialize_tests.rb -#+begin_src ruby - # ./samples/10_advanced_debugging/03_unit_tests/serialize_deserialize_tests.rb - def test_serialize args, assert - GTK::Entity.__reset_id__! - args.state.player_one = "test" - result = args.gtk.serialize_state args.state - assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}" + if inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start || inputs.controller_one.key_down.a + state.difficulty = state.new_difficulty + change_to_scene :game + reset_game false + state.hi_score = 0 + begin_countdown + end - GTK::Entity.__reset_id__! - args.gtk.write_file 'state.txt', '' - result = args.gtk.serialize_state 'state.txt', args.state - assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}" - end + if inputs.keyboard.key_down.escape || (inputs.mouse.click && !changediff) || inputs.controller_one.key_down.b + state.new_difficulty = state.difficulty + change_to_scene :game + end + end - def test_deserialize args, assert - GTK::Entity.__reset_id__! - result = args.gtk.deserialize_state '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}' - assert.equal! result.player_one, "test" + def process_inputs_game + return unless state.scene == :game - GTK::Entity.__reset_id__! - args.gtk.write_file 'state.txt', '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}' - result = args.gtk.deserialize_state 'state.txt' - assert.equal! result.player_one, "test" - end + clicked_menu = false + if inputs.mouse.click + p = inputs.mouse.click.point + clicked_menu = (p.y >= 620) && (p.x < 275) + end - def test_very_large_serialization args, assert - GTK::Entity.__reset_id__! - size = 3000 - size.map_with_index do |i| - args.state.send("k#{i}=".to_sym, i) + if clicked_menu || inputs.keyboard.key_down.escape || inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start + change_to_scene :menu + elsif (inputs.mouse.down || inputs.mouse.click || inputs.keyboard.key_down.space || inputs.controller_one.key_down.a) && state.countdown == 0 + state.dy = 0 + state.dy += state.flap_power + state.flapped_at = state.tick_count + outputs.sounds << "sounds/fly-sound.wav" + end end - result = args.gtk.serialize_state args.state - assert.true! (args.gtk.console.log.join.include? "unlikely a string this large will deserialize correctly") - end + def scrolling_background at, path, rate, y = 0 + [ + [ 0 - at.*(rate) % 1440, y, 1440, 720, path], + [1440 - at.*(rate) % 1440, y, 1440, 720, path] + ] + end - def test_strict_entity_serialization args, assert - GTK::Entity.__reset_id__! - args.state.player_one = args.state.new_entity(:player, name: "Ryu") - args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken") + def white + [255, 255, 255] + end - serialized_state = args.gtk.serialize_state args.state - assert.equal! serialized_state, '{:entity_id=>1, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>3, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken"}}' + def large_white_typeset + [5, 0, 255, 255, 255] + end - GTK::Entity.__reset_id__! - deserialize_state = args.gtk.deserialize_state serialized_state + def at_beginning? + state.walls.count == 0 + end - assert.equal! args.state.player_one.name, deserialize_state.player_one.name - assert.true! args.state.player_one.is_a? GTK::OpenEntity + def dragon_collision_box + state.dragon_sprite + .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5) + .rect_shift_right(10) + .rect_shift_up(state.dy * 2) + end - assert.equal! args.state.player_two.name, deserialize_state.player_two.name - assert.true! args.state.player_two.is_a? GTK::StrictEntity - end + def game_over? + return true if state.y <= 0.-(500 * collision_forgiveness) && !at_beginning? - def test_strict_entity_serialization_with_nil args, assert - GTK::Entity.__reset_id__! - args.state.player_one = args.state.new_entity(:player, name: "Ryu") - args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken", blood_type: nil) + state.walls + .flat_map { |w| w.sprites } + .any? do |s| + s.intersect_rect?(dragon_collision_box) + end + end - serialized_state = args.gtk.serialize_state args.state - assert.equal! serialized_state, '{:entity_id=>9, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}' + def collision_forgiveness + case state.difficulty + when :easy + 0.9 + when :normal + 0.7 + when :hard + 0.5 + when :flappy + 0.3 + else + 0.9 + end + end - GTK::Entity.__reset_id__! - deserialized_state = args.gtk.deserialize_state serialized_state + def countdown_text + state.countdown ||= -1 + return "" if state.countdown == 0 + return "GO!" if state.countdown.idiv(60) == 0 + return "GAME OVER" if state.death_at + return "READY?" + end - assert.equal! args.state.player_one.name, deserialized_state.player_one.name - assert.true! args.state.player_one.is_a? GTK::OpenEntity + def begin_countdown + state.countdown = 4.seconds + end - assert.equal! args.state.player_two.name, deserialized_state.player_two.name - assert.equal! args.state.player_two.blood_type, deserialized_state.player_two.blood_type - assert.equal! deserialized_state.player_two.blood_type, nil - assert.true! args.state.player_two.is_a? GTK::StrictEntity + def score_text + return "" unless state.countdown > 1.seconds + return "" unless state.death_at + return "SCORE: 0 (LOL)" if state.score == 0 + return "HI SCORE: #{state.score}" if state.score == state.hi_score + return "SCORE: #{state.score}" + end - deserialized_state.player_two.blood_type = :O - assert.equal! deserialized_state.player_two.blood_type, :O + def reset_game set_flash = true + state.flash_at = state.tick_count if set_flash + state.walls = [] + state.y = 500 + state.dy = 0 + state.hi_score = state.hi_score.greater(state.score) + state.score = 0 + state.wall_countdown = state.wall_countdown_length.fdiv(2) + state.show_death = false + state.death_at = nil + end + + def change_to_scene scene + state.scene = scene + state.scene_at = state.tick_count + inputs.keyboard.clear + inputs.controller_one.clear + end end - def test_multiple_strict_entities args, assert - GTK::Entity.__reset_id__! - args.state.player = args.state.new_entity_strict(:player_one, name: "Ryu") - args.state.enemy = args.state.new_entity_strict(:enemy, name: "Bison", other_property: 'extra mean') + $flappy_dragon = FlappyDragon.new - serialized_state = args.gtk.serialize_state args.state + def tick args + $flappy_dragon.grid = args.grid + $flappy_dragon.inputs = args.inputs + $flappy_dragon.state = args.state + $flappy_dragon.outputs = args.outputs + $flappy_dragon.tick + end + +#+end_src + +*** Arcade - Pong - main.rb +#+begin_src ruby + # ./samples/99_genre_arcade/pong/app/main.rb + def tick args + defaults args + render args + calc args + input args + end - GTK::Entity.__reset_id__! - deserialized_state = args.gtk.deserialize_state serialized_state + def defaults args + args.state.ball.debounce ||= 3 * 60 + args.state.ball.size ||= 10 + args.state.ball.size_half ||= args.state.ball.size / 2 + args.state.ball.x ||= 640 + args.state.ball.y ||= 360 + args.state.ball.dx ||= 5.randomize(:sign) + args.state.ball.dy ||= 5.randomize(:sign) + args.state.left_paddle.y ||= 360 + args.state.right_paddle.y ||= 360 + args.state.paddle.h ||= 120 + args.state.paddle.w ||= 10 + args.state.left_paddle.score ||= 0 + args.state.right_paddle.score ||= 0 + end - assert.equal! deserialized_state.player.name, "Ryu" - assert.equal! deserialized_state.enemy.other_property, "extra mean" + def render args + render_center_line args + render_scores args + render_countdown args + render_ball args + render_paddles args + render_instructions args end - def test_by_reference_state args, assert - GTK::Entity.__reset_id__! - args.state.a = { name: "Jane Doe" } - args.state.b = args.state.a - assert.equal! args.state.a.object_id, args.state.b.object_id - serialized_state = args.gtk.serialize_state args.state + begin :render_methods + def render_center_line args + args.outputs.lines << [640, 0, 640, 720] + end - GTK::Entity.__reset_id__! - deserialized_state = args.gtk.deserialize_state serialized_state - assert.equal! deserialized_state.a.object_id, deserialized_state.b.object_id - end + def render_scores args + args.outputs.labels << [ + [320, 650, args.state.left_paddle.score, 10, 1], + [960, 650, args.state.right_paddle.score, 10, 1] + ] + end - def test_by_reference_state_strict_entities args, assert - GTK::Entity.__reset_id__! - args.state.a = { name: "Jane Doe" } - args.state.strict_entity = args.state.new_entity_strict(:couple) do |e| - e.one = args.state.new_entity_strict(:person, name: "Jane") - e.two = e.one + def render_countdown args + return unless args.state.ball.debounce > 0 + args.outputs.labels << [640, 360, "%.2f" % args.state.ball.debounce.fdiv(60), 10, 1] end - assert.equal! args.state.strict_entity.one, args.state.strict_entity.two - serialized_state = args.gtk.serialize_state args.state - GTK::Entity.__reset_id__! - deserialized_state = args.gtk.deserialize_state serialized_state - assert.equal! deserialized_state.strict_entity.one, deserialized_state.strict_entity.two - end + def render_ball args + args.outputs.solids << solid_ball(args) + end - $tests.start - -#+end_src - -* Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb -#+begin_src ruby - # ./samples/10_advanced_debugging/03_unit_tests/state_serialization_experimental_tests.rb - MAX_CODE_GEN_LENGTH = 50 + def render_paddles args + args.outputs.solids << solid_left_paddle(args) + args.outputs.solids << solid_right_paddle(args) + end - # NOTE: This is experimental/advanced stuff. - def needs_partitioning? target - target[:value].to_s.length > MAX_CODE_GEN_LENGTH + def render_instructions args + args.outputs.labels << [320, 30, "W and S keys to move left paddle.", 0, 1] + args.outputs.labels << [920, 30, "O and L keys to move right paddle.", 0, 1] + end end - def partition target - return [] unless needs_partitioning? target - if target[:value].is_a? GTK::OpenEntity - target[:value] = target[:value].hash + def calc args + args.state.ball.debounce -= 1 and return if args.state.ball.debounce > 0 + calc_move_ball args + calc_collision_with_left_paddle args + calc_collision_with_right_paddle args + calc_collision_with_walls args + end + + begin :calc_methods + def calc_move_ball args + args.state.ball.x += args.state.ball.dx + args.state.ball.y += args.state.ball.dy + end + + def calc_collision_with_left_paddle args + if solid_left_paddle(args).intersect_rect? solid_ball(args) + args.state.ball.dx *= -1 + elsif args.state.ball.x < 0 + args.state.right_paddle.score += 1 + calc_reset_round args + end end - results = [] - idx = 0 - left, right = target[:value].partition do - idx += 1 - idx.even? + def calc_collision_with_right_paddle args + if solid_right_paddle(args).intersect_rect? solid_ball(args) + args.state.ball.dx *= -1 + elsif args.state.ball.x > 1280 + args.state.left_paddle.score += 1 + calc_reset_round args + end end - left, right = Hash[left], Hash[right] - left = { value: left } - right = { value: right} - [left, right] - end - def add_partition target, path, aggregate, final_result - partitions = partition target - partitions.each do |part| - if needs_partitioning? part - if part[:value].keys.length == 1 - first_key = part[:value].keys[0] - new_part = { value: part[:value][first_key] } - path.push first_key - add_partition new_part, path, aggregate, final_result - path.pop - else - add_partition part, path, aggregate, final_result - end - else - final_result << { value: { __path__: [*path] } } - final_result << { value: part[:value] } + def calc_collision_with_walls args + if args.state.ball.y + args.state.ball.size_half > 720 + args.state.ball.y = 720 - args.state.ball.size_half + args.state.ball.dy *= -1 + elsif args.state.ball.y - args.state.ball.size_half < 0 + args.state.ball.y = args.state.ball.size_half + args.state.ball.dy *= -1 end end + + def calc_reset_round args + args.state.ball.x = 640 + args.state.ball.y = 360 + args.state.ball.dx = 5.randomize(:sign) + args.state.ball.dy = 5.randomize(:sign) + args.state.ball.debounce = 3 * 60 + end end - def state_to_string state - parts_queue = [] - final_queue = [] - add_partition({ value: state.hash }, - [], - parts_queue, - final_queue) - final_queue.reject {|i| i[:value].keys.length == 0}.map do |i| - i[:value].to_s - end.join("\n#==================================================#\n") + def input args + input_left_paddle args + input_right_paddle args end - def state_from_string string - Kernel.eval("$load_data = {}") - lines = string.split("\n#==================================================#\n") - lines.each do |l| - puts "todo: #{l}" + begin :input_methods + def input_left_paddle args + if args.inputs.controller_one.key_down.down || args.inputs.keyboard.key_down.s + args.state.left_paddle.y -= 40 + elsif args.inputs.controller_one.key_down.up || args.inputs.keyboard.key_down.w + args.state.left_paddle.y += 40 + end end - GTK::OpenEntity.parse_from_hash $load_data + def input_right_paddle args + if args.inputs.controller_two.key_down.down || args.inputs.keyboard.key_down.l + args.state.right_paddle.y -= 40 + elsif args.inputs.controller_two.key_down.up || args.inputs.keyboard.key_down.o + args.state.right_paddle.y += 40 + end + end end - def test_save_and_load args, assert - args.state.item_1.name = "Jane" - string = state_to_string args.state - state = state_from_string string - assert.equal! args.state.item_1.name, state.item_1.name - end + begin :assets + def solid_ball args + centered_rect args.state.ball.x, args.state.ball.y, args.state.ball.size, args.state.ball.size + end - def test_save_and_load_big args, assert - size = 1000 - size.map_with_index do |i| - args.state.send("k#{i}=".to_sym, i) + def solid_left_paddle args + centered_rect_vertically 0, args.state.left_paddle.y, args.state.paddle.w, args.state.paddle.h end - string = state_to_string args.state - state = state_from_string string - size.map_with_index do |i| - assert.equal! args.state.send("k#{i}".to_sym), state.send("k#{i}".to_sym) - assert.equal! args.state.send("k#{i}".to_sym), i - assert.equal! state.send("k#{i}".to_sym), i + def solid_right_paddle args + centered_rect_vertically 1280 - args.state.paddle.w, args.state.right_paddle.y, args.state.paddle.w, args.state.paddle.h end - end - def test_save_and_load_big_nested args, assert - args.state.player_one.friend.nested_hash.k0 = 0 - args.state.player_one.friend.nested_hash.k1 = 1 - args.state.player_one.friend.nested_hash.k2 = 2 - args.state.player_one.friend.nested_hash.k3 = 3 - args.state.player_one.friend.nested_hash.k4 = 4 - args.state.player_one.friend.nested_hash.k5 = 5 - args.state.player_one.friend.nested_hash.k6 = 6 - args.state.player_one.friend.nested_hash.k7 = 7 - args.state.player_one.friend.nested_hash.k8 = 8 - args.state.player_one.friend.nested_hash.k9 = 9 - string = state_to_string args.state - state = state_from_string string - end + def centered_rect x, y, w, h + [x - w / 2, y - h / 2, w, h] + end - $gtk.reset 100 - $gtk.log_level = :off - $gtk.tests.start + def centered_rect_vertically x, y, w, h + [x, y - h / 2, w, h] + end + end #+end_src -* Http - Retrieve Images - main.rb +*** Arcade - Snakemoji - main.rb #+begin_src ruby - # ./samples/11_http/01_retrieve_images/app/main.rb - def tick args - args.outputs.background_color = [0, 0, 0] + # ./samples/99_genre_arcade/snakemoji/app/main.rb + # coding: utf-8 + ################################ + # So I was working on a snake game while + # learning DragonRuby, and at some point I had a thought + # what if I use "😀" as a function name, surely it wont work right...? + # RIGHT....? + # BUT IT DID, IT WORKED + # it all went downhill from then + # Created by Anton K. (ai Doge) + # https://gist.github.com/scorp200 + #############LICENSE############ + # Feel free to use this anywhere and however you want + # You can sell this to EA for $1,000,000 if you want, its completely free. + # Just rememeber you are helping this... thing... to spread... + # ALSO! I am not liable for any mental, physical or financial damage caused. + #############LICENSE############ - # Show a warning at the start. - args.state.warning_debounce ||= 11 * 60 - if args.state.warning_debounce > 0 - args.state.warning_debounce -= 1 - args.outputs.labels << [640, 600, "This app shows random images from the Internet.", 10, 1, 255, 255, 255] - args.outputs.labels << [640, 500, "Quit in the next few seconds if this is a problem.", 10, 1, 255, 255, 255] - args.outputs.labels << [640, 350, "#{(args.state.warning_debounce / 60.0).to_i}", 10, 1, 255, 255, 255] - return + + class Array + #Helper function + def move! vector + self.x += vector.x + self.y += vector.y + return self end - args.state.download_debounce ||= 0 # start immediately, reset to non zero later. - args.state.photos ||= [] + #Helper function to draw snake body + def draw! 🎮, 📺, color + translate 📺.solids, 🎮.⛓, [self.x * 🎮.⚖️ + 🎮.🛶 / 2, self.y * 🎮.⚖️ + 🎮.🛶 / 2, 🎮.⚖️ - 🎮.🛶, 🎮.⚖️ - 🎮.🛶, color] + end - # Put a little pause between each download. - if args.state.download.nil? - if args.state.download_debounce > 0 - args.state.download_debounce -= 1 - else - args.state.download = $gtk.http_get 'https://picsum.photos/200/300.jpg' - end + #This is where it all started, I was trying to find good way to multiply a map by a number, * is already used so is ** + #I kept trying different combinations of symbols, when suddenly... + def 😀 value + self.map {|d| d * value} end + end - if !args.state.download.nil? - if args.state.download[:complete] - if args.state.download[:http_response_code] == 200 - fname = "sprites/#{args.state.photos.length}.jpg" - $gtk.write_file fname, args.state.download[:response_data] - args.state.photos << [ 100 + rand(1080), 500 - rand(480), fname, rand(80) - 40 ] - end - args.state.download = nil - args.state.download_debounce = (rand(3) + 2) * 60 + #Draw stuff with an offset + def translate output_collection, ⛓, what + what.x += ⛓.x + what.y += ⛓.y + output_collection << what + end + + BLUE = [33, 150, 243] + RED = [244, 67, 54] + GOLD = [255, 193, 7] + LAST = 0 + + def tick args + defaults args.state + render args.state, args.outputs + input args.state, args.inputs + update args.state + end + + def update 🎮 + #Update every 10 frames + if 🎮.tick_count.mod_zero? 10 + #Add new snake body piece at head's location + 🎮.🐍 << [*🎮.🤖] + #Assign Next Direction to Direction + 🎮.🚗 = *🎮.🚦 + + #Trim the snake a bit if its longer than current size + if 🎮.🐍.length > 🎮.🛒 + 🎮.🐍 = 🎮.🐍[-🎮.🛒..-1] end - end - # draw any downloaded photos... - args.state.photos.each { |i| - args.outputs.primitives << [i[0], i[1], 200, 300, i[2], i[3]].sprite - } + #Move the head in the Direction + 🎮.🤖.move! 🎮.🚗 - # Draw a download progress bar... - args.outputs.primitives << [0, 0, 1280, 30, 0, 0, 0, 255].solid - if !args.state.download.nil? - br = args.state.download[:response_read] - total = args.state.download[:response_total] - if total != 0 - pct = br.to_f / total.to_f - args.outputs.primitives << [0, 0, 1280 * pct, 30, 0, 0, 255, 255].solid + #If Head is outside the playing field, or inside snake's body restart game + if 🎮.🤖.x < 0 || 🎮.🤖.x >= 🎮.🗺.x || 🎮.🤖.y < 0 || 🎮.🤖.y >= 🎮.🗺.y || 🎮.🚗 != [0, 0] && 🎮.🐍.any? {|s| s == 🎮.🤖} + LAST = 🎮.💰 + 🎮.as_hash.clear + return + end + + #If head lands on food add size and score + if 🎮.🤖 == 🎮.🍎 + 🎮.🛒 += 1 + 🎮.💰 += (🎮.🛒 * 0.8).floor.to_i + 5 + spawn_🍎 🎮 + puts 🎮.🍎 end end - end - -#+end_src - -* 12 C Extensions - Basics - main.rb -#+begin_src ruby - # ./samples/12_c_extensions/01_basics/app/main.rb - $gtk.ffi_misc.gtk_dlopen("ext") - include FFI::CExt - - def tick args - args.outputs.labels << [640, 500, "mouse.x = #{args.mouse.x.to_i}", 5, 1] - args.outputs.labels << [640, 460, "square(mouse.x) = #{square(args.mouse.x.to_i)}", 5, 1] - args.outputs.labels << [640, 420, "mouse.y = #{args.mouse.y.to_i}", 5, 1] - args.outputs.labels << [640, 380, "square(mouse.y) = #{square(args.mouse.y.to_i)}", 5, 1] - end - - -#+end_src - -* 12 C Extensions - Intermediate - main.rb -#+begin_src ruby - # ./samples/12_c_extensions/02_intermediate/app/main.rb - $gtk.ffi_misc.gtk_dlopen("ext") - include FFI::RE - def split_words(input) - words = [] - last = IntPointer.new - re = re_compile("\\w+") - first = re_matchp(re, input, last) - while first != -1 - words << input.slice(first, last.value) - input = input.slice(last.value + first, input.length) - first = re_matchp(re, input, last) + #Every second remove 1 point + if 🎮.💰 > 0 && 🎮.tick_count.mod_zero?(60) + 🎮.💰 -= 1 end - words end - def tick args - args.outputs.labels << [640, 500, split_words("hello, dragonriders!").join(' '), 5, 1] + def spawn_🍎 🎮 + #Food + 🎮.🍎 ||= [*🎮.🤖] + #Randomly spawns food inside the playing field, keep doing this if the food keeps landing on the snake's body + while 🎮.🐍.any? {|s| s == 🎮.🍎} || 🎮.🍎 == 🎮.🤖 do + 🎮.🍎 = [rand(🎮.🗺.x), rand(🎮.🗺.y)] + end end - -#+end_src - -* 12 C Extensions - Native Pixel Arrays - main.rb -#+begin_src ruby - # ./samples/12_c_extensions/03_native_pixel_arrays/app/main.rb - $gtk.ffi_misc.gtk_dlopen("ext") - include FFI::CExt - - def tick args - args.state.rotation ||= 0 - update_scanner_texture # this calls into a C extension! + def render 🎮, 📺 + #Paint the background black + 📺.solids << [0, 0, 1280, 720, 0, 0, 0, 255] + #Draw a border for the playing field + translate 📺.borders, 🎮.⛓, [0, 0, 🎮.🗺.x * 🎮.⚖️, 🎮.🗺.y * 🎮.⚖️, 255, 255, 255] - # New/changed pixel arrays get uploaded to the GPU before we render - # anything. At that point, they can be scaled, rotated, and otherwise - # used like any other sprite. - w = 100 - h = 100 - x = (1280 - w) / 2 - y = (720 - h) / 2 - args.outputs.background_color = [64, 0, 128] - args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite - args.state.rotation += 1 + #Draw the snake's body + 🎮.🐍.map do |🐍| 🐍.draw! 🎮, 📺, BLUE end + #Draw the head + 🎮.🤖.draw! 🎮, 📺, BLUE + #Draw the food + 🎮.🍎.draw! 🎮, 📺, RED - args.outputs.primitives << args.gtk.current_framerate_primitives + #Draw current score + translate 📺.labels, 🎮.⛓, [5, 715, "Score: #{🎮.💰}", GOLD] + #Draw your last score, if any + translate 📺.labels, 🎮.⛓, [[*🎮.🤖.😀(🎮.⚖️)].move!([0, 🎮.⚖️ * 2]), "Your Last score is #{LAST}", 0, 1, GOLD] unless LAST == 0 || 🎮.🚗 != [0, 0] + #Draw starting message, only if Direction is 0 + translate 📺.labels, 🎮.⛓, [🎮.🤖.😀(🎮.⚖️), "Press any Arrow key to start", 0, 1, GOLD] unless 🎮.🚗 != [0, 0] end - -#+end_src - -* 3d - 3d Cube - main.rb -#+begin_src ruby - # ./samples/99_genre_3d/3d_cube/app/main.rb - STARTX = 0.0 - STARTY = 0.0 - ENDY = 20.0 - ENDX = 20.0 - SPINPOINT = 10 - SPINDURATION = 400 - POINTSIZE = 8 - BOXDEPTH = 40 - YAW = 1 - DISTANCE = 10 - - def tick args - args.outputs.background_color = [0, 0, 0] - a = Math.sin(args.state.tick_count / SPINDURATION) * Math.tan(args.state.tick_count / SPINDURATION) - s = Math.sin(a) - c = Math.cos(a) - x = STARTX - y = STARTY - offset_x = (1280 - (ENDX - STARTX)) / 2 - offset_y = (360 - (ENDY - STARTY)) / 2 + def input 🎮, 🕹 + #Left and Right keyboard input, only change if X direction is 0 + if 🕹.keyboard.key_held.left && 🎮.🚗.x == 0 + 🎮.🚦 = [-1, 0] + elsif 🕹.keyboard.key_held.right && 🎮.🚗.x == 0 + 🎮.🚦 = [1, 0] + end - srand(1) - while y < ENDY do - while x < ENDX do - if (y == STARTY || - y == (ENDY / 0.5) * 2 || - y == (ENDY / 0.5) * 2 + 0.5 || - y == ENDY - 0.5 || - x == STARTX || - x == ENDX - 0.5) - z = rand(BOXDEPTH) - z *= Math.sin(a / 2) - x -= SPINPOINT - u = (x * c) - (z * s) - v = (x * s) + (z * c) - k = DISTANCE.fdiv(100) + (v / 500 * YAW) - u = u / k - v = y / k - w = POINTSIZE / 10 / k - args.outputs.sprites << { x: offset_x + u - w, y: offset_y + v - w, w: w, h: w, path: 'sprites/square-blue.png'} - x += SPINPOINT - end - x += 0.5 - end - y += 0.5 - x = STARTX + #Up and Down keyboard input, only change if Y direction is 0 + if 🕹.keyboard.key_held.up && 🎮.🚗.y == 0 + 🎮.🚦 = [0, 1] + elsif 🕹.keyboard.key_held.down && 🎮.🚗.y == 0 + 🎮.🚦 = [0, -1] end end - $gtk.reset + def defaults 🎮 + #Playing field size + 🎮.🗺 ||= [20, 20] + #Scale for drawing, screen height / Field height + 🎮.⚖️ ||= 720 / 🎮.🗺.y + #Offset, offset all rendering to the center of the screen + 🎮.⛓ ||= [(1280 - 720).fdiv(2), 0] + #Padding, make the snake body slightly smaller than the scale + 🎮.🛶 ||= (🎮.⚖️ * 0.2).to_i + #Snake Size + 🎮.🛒 ||= 3 + #Snake head, the only part we are actually controlling + 🎮.🤖 ||= [🎮.🗺.x / 2, 🎮.🗺.y / 2] + #Snake body map, follows the head + 🎮.🐍 ||= [] + #Direction the head moves to + 🎮.🚗 ||= [0, 0] + #Next_Direction, during input check only change this variable and then when game updates asign this to Direction + 🎮.🚦 ||= [*🎮.🚗] + #Your score + 🎮.💰 ||= 0 + #Spawns Food randomly + spawn_🍎(🎮) unless 🎮.🍎? + end #+end_src -* Arcade - Dueling Starships - main.rb +*** Arcade - Solar System - main.rb #+begin_src ruby - # ./samples/99_genre_arcade/dueling_starships/app/main.rb - class DuelingSpaceships - attr_accessor :state, :inputs, :outputs, :grid - - def tick - defaults - render - calc - input - end - - def defaults - outputs.background_color = [0, 0, 0] - state.ship_blue ||= new_blue_ship - state.ship_red ||= new_red_ship - state.flames ||= [] - state.bullets ||= [] - state.ship_blue_score ||= 0 - state.ship_red_score ||= 0 - state.stars ||= 100.map do - [rand.add(2).to_square(grid.w_half.randomize(:sign, :ratio), - grid.h_half.randomize(:sign, :ratio)), - 128 + 128.randomize(:ratio), 255, 255] - end - end - - def default_ship x, y, angle, sprite_path, bullet_sprite_path, color - state.new_entity(:ship, - { x: x, - y: y, - dy: 0, - dx: 0, - damage: 0, - dead: false, - angle: angle, - max_alpha: 255, - sprite_path: sprite_path, - bullet_sprite_path: bullet_sprite_path, - color: color }) - end + # ./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 - def new_red_ship - default_ship(400, 250.randomize(:sign, :ratio), - 180, 'sprites/ship_red.png', 'sprites/red_bullet.png', - [255, 90, 90]) + def defaults args + args.outputs.background_color = [0, 0, 0] + args.state.x ||= 640 + args.state.y ||= 360 + args.state.stars ||= 100.map do + [1280 * rand, 720 * rand, rand.fdiv(10), 255 * rand, 255 * rand, 255 * rand] end - def new_blue_ship - default_ship(-400, 250.randomize(:sign, :ratio), - 0, 'sprites/ship_blue.png', 'sprites/blue_bullet.png', - [110, 140, 255]) + args.state.sun ||= args.state.new_entity(:sun) do |s| + s.s = 100 + s.path = 'sprites/sun.png' end - def render - render_instructions - render_score - render_universe - render_flames - render_ships - render_bullets + args.state.planets = [ + [:mercury, 65, 5, 88], + [:venus, 100, 10, 225], + [:earth, 120, 10, 365], + [:mars, 140, 8, 687], + [:jupiter, 280, 30, 365 * 11.8], + [:saturn, 350, 20, 365 * 29.5], + [:uranus, 400, 15, 365 * 84], + [:neptune, 440, 15, 365 * 164.8], + [:pluto, 480, 5, 365 * 247.8], + ].map do |name, distance, size, year_in_days| + args.state.new_entity(name) do |p| + p.path = "sprites/#{name}.png" + p.distance = distance * 0.7 + p.s = size * 0.7 + p.year_in_days = year_in_days + end end - def render_ships - update_ship_outputs(state.ship_blue) - update_ship_outputs(state.ship_red) - outputs.sprites << [state.ship_blue.sprite, state.ship_red.sprite] - outputs.labels << [state.ship_blue.label, state.ship_red.label] + args.state.ship ||= args.state.new_entity(:ship) do |s| + s.x = 1280 * rand + s.y = 720 * rand + s.angle = 0 end + end - def render_instructions - return if state.ship_blue.dx > 0 || state.ship_blue.dy > 0 || - state.ship_red.dx > 0 || state.ship_red.dy > 0 || - state.flames.length > 0 + def to_sprite args, entity + x = 0 + y = 0 - outputs.labels << [grid.left.shift_right(30), - grid.bottom.shift_up(30), - "Two gamepads needed to play. R1 to accelerate. Left and right on D-PAD to turn ship. Hold A to shoot. Press B to drop mines.", - 0, 0, 255, 255, 255] + if entity.year_in_days + day = args.state.tick_count + day_in_year = day % entity.year_in_days + entity.random_start_day ||= day_in_year * rand + percentage_of_year = day_in_year.fdiv(entity.year_in_days) + angle = 365 * percentage_of_year + x = angle.vector_x(entity.distance) + y = angle.vector_y(entity.distance) end - def calc - calc_thrusts - calc_ships - calc_bullets - calc_winner - end + [640 + x - entity.s.half, 360 + y - entity.s.half, entity.s, entity.s, entity.path] + end - def input - input_accelerate - input_turn - input_bullets_and_mines + def render args + args.outputs.solids << [0, 0, 1280, 720] + + args.outputs.sprites << args.state.stars.map do |x, y, _, r, g, b| + [x, y, 10, 10, 'sprites/star.png', 0, 100, r, g, b] end - def render_score - outputs.labels << [grid.left.shift_right(80), - grid.top.shift_down(40), - state.ship_blue_score, 30, 1, state.ship_blue.color] + args.outputs.sprites << to_sprite(args, args.state.sun) + args.outputs.sprites << args.state.planets.map { |p| to_sprite args, p } + args.outputs.sprites << [args.state.ship.x, args.state.ship.y, 20, 20, 'sprites/ship.png', args.state.ship.angle] + end - outputs.labels << [grid.right.shift_left(80), - grid.top.shift_down(40), - state.ship_red_score, 30, 1, state.ship_red.color] + def calc args + args.state.stars = args.state.stars.map do |x, y, speed, r, g, b| + x += speed + y += speed + x = 0 if x > 1280 + y = 0 if y > 720 + [x, y, speed, r, g, b] end - def render_universe - return if outputs.static_solids.any? - outputs.static_solids << grid.rect - outputs.static_solids << state.stars + if args.state.tick_count == 0 + args.outputs.sounds << 'sounds/bg.ogg' end + end - def apply_round_finished_alpha entity - return entity unless state.round_finished_debounce - entity.a *= state.round_finished_debounce.percentage_of(2.seconds) - return entity + def process_inputs args + if args.inputs.keyboard.left || args.inputs.controller_one.key_held.left + args.state.ship.angle += 1 + elsif args.inputs.keyboard.right || args.inputs.controller_one.key_held.right + args.state.ship.angle -= 1 end - def update_ship_outputs ship, sprite_size = 66 - ship.sprite = - apply_round_finished_alpha [sprite_size.to_square(ship.x, ship.y), - ship.sprite_path, - ship.angle, - ship.dead ? 0 : 255 * ship.created_at.ease(2.seconds)].sprite - ship.label = - apply_round_finished_alpha [ship.x, - ship.y + 100, - "." * 5.minus(ship.damage).greater(0), 20, 1, ship.color, 255].label + if args.inputs.keyboard.up || args.inputs.controller_one.key_held.a + args.state.ship.x += args.state.ship.angle.x_vector + args.state.ship.y += args.state.ship.angle.y_vector end + end - def render_flames sprite_size = 6 - outputs.sprites << state.flames.map do |p| - apply_round_finished_alpha [sprite_size.to_square(p.x, p.y), - 'sprites/flame.png', 0, - p.max_alpha * p.created_at.ease(p.lifetime, :flip)].sprite - end - end + def tick args + defaults args + render args + calc args + process_inputs args + end - def render_bullets sprite_size = 10 - outputs.sprites << state.bullets.map do |b| - apply_round_finished_alpha [b.sprite_size.to_square(b.x, b.y), - b.owner.bullet_sprite_path, - 0, b.max_alpha].sprite - end - end + def r + $gtk.reset + end + +#+end_src + +*** Arcade - Sound Golf - main.rb +#+begin_src ruby + # ./samples/99_genre_arcade/sound_golf/app/main.rb + =begin - def wrap_location! location - location.x = grid.left if location.x > grid.right - location.x = grid.right if location.x < grid.left - location.y = grid.top if location.y < grid.bottom - location.y = grid.bottom if location.y > grid.top - location - end + APIs Listing that haven't been encountered in previous sample apps: - def calc_thrusts - state.flames = - state.flames - .reject(&:old?) - .map do |p| - p.speed *= 0.9 - p.y += p.angle.vector_y(p.speed) - p.x += p.angle.vector_x(p.speed) - wrap_location! p - end - end + - sample: Chooses random element from array. + In this sample app, the target note is set by taking a sample from the collection + of available notes. - def all_ships - [state.ship_blue, state.ship_red] - end + Reminders: + - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual + 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720). - def alive_ships - all_ships.reject { |s| s.dead } - end + - args.state.new_entity: Used when we want to create a new object, like a sprite or button. + For example, if we want to create a new button, we would declare it as a new entity and + then define its properties. - def calc_bullet bullet - bullet.y += bullet.angle.vector_y(bullet.speed) - bullet.x += bullet.angle.vector_x(bullet.speed) - wrap_location! bullet - explode_bullet! bullet if bullet.old? - return if bullet.exploded - return if state.round_finished - alive_ships.each do |s| - if s != bullet.owner && - s.sprite.intersect_rect?(bullet.sprite_size.to_square(bullet.x, bullet.y)) - explode_bullet! bullet, 10, 5, 30 - s.damage += 1 - end - end - end + - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated + as Ruby code, and the placeholder is replaced with its corresponding value or result. - def calc_bullets - state.bullets.each { |b| calc_bullet b } - state.bullets.reject! { |b| b.exploded } - end + - args.outputs.labels: An array. The values generate a label. + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] + For more information about labels, go to mygame/documentation/02-labels.md. - def create_explosion! type, entity, flame_count, max_speed, lifetime, max_alpha = 255 - flame_count.times do - state.flames << state.new_entity(type, - { angle: 360.randomize(:ratio), - speed: max_speed.randomize(:ratio), - lifetime: lifetime, - x: entity.x, - y: entity.y, - max_alpha: max_alpha }) - end - end + - find_all: Finds all elements from a collection that meet a certain requirements (and excludes the ones that don't). - def explode_bullet! bullet, flame_override = 5, max_speed = 5, lifetime = 10 - bullet.exploded = true - create_explosion! :bullet_explosion, - bullet, - flame_override, - max_speed, - lifetime, - bullet.max_alpha - end + - first: Returns the first element of an array. - def calc_ship ship - ship.x += ship.dx - ship.y += ship.dy - wrap_location! ship - end + - inside_rect: Returns true or false depending on if the point is inside the rect. - def calc_ships - all_ships.each { |s| calc_ship s } - return if all_ships.any? { |s| s.dead } - return if state.round_finished - return unless state.ship_blue.sprite.intersect_rect?(state.ship_red.sprite) - state.ship_blue.damage = 5 - state.ship_red.damage = 5 - end + - to_sym: Returns symbol corresponding to string. Will create a symbol if it does + not already exist. - def create_thruster_flames! ship - state.flames << state.new_entity(:ship_thruster, - { angle: ship.angle + 180 + 60.randomize(:sign, :ratio), - speed: 5.randomize(:ratio), - max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), - lifetime: 30, - x: ship.x - ship.angle.vector_x(40) + 5.randomize(:sign, :ratio), - y: ship.y - ship.angle.vector_y(40) + 5.randomize(:sign, :ratio) }) - end + =end - def input_accelerate_ship should_move_ship, ship - return if ship.dead + # This sample app allows users to test their musical skills by matching the piano sound that plays in each + # level to the correct note. - should_move_ship &&= (ship.dx + ship.dy).abs < 5 + # Runs all the methods necessary for the game to function properly. + def tick args + defaults args + render args + calc args + input_mouse args + tick_instructions args, "Sample app shows how to play sounds. args.outputs.sounds << \"path_to_wav.wav\"" + end - if should_move_ship - create_thruster_flames! ship - ship.dx += ship.angle.vector_x 0.050 - ship.dy += ship.angle.vector_y 0.050 - else - ship.dx *= 0.99 - ship.dy *= 0.99 - end - end + # Sets default values and creates empty collections + # Initialization happens in the first frame only + def defaults args + args.state.notes ||= [] + args.state.click_feedbacks ||= [] + args.state.current_level ||= 1 + args.state.times_wrong ||= 0 # when game starts, user hasn't guessed wrong yet + end + + # Uses a label to display current level, and shows the score + # Creates a button to play the sample note, and displays the available notes that could be a potential match + def render args - def input_accelerate - input_accelerate_ship inputs.controller_one.key_held.r1 || inputs.keyboard.up, state.ship_blue - input_accelerate_ship inputs.controller_two.key_held.r1, state.ship_red - end + # grid.w_half positions the label in the horizontal center of the screen. + args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(40), "Hole #{args.state.current_level} of 9", 0, 1, 0, 0, 0] - def input_turn_ship direction, ship - ship.angle -= 3 * direction - end + render_score args # shows score on screen - def input_turn - input_turn_ship inputs.controller_one.left_right + inputs.keyboard.left_right, state.ship_blue - input_turn_ship inputs.controller_two.left_right, state.ship_red + args.state.play_again_button ||= { x: 560, y: args.grid.h * 3 / 4 - 40, w: 160, h: 60, label: 'again' } # array definition, text/title + args.state.play_note_button ||= { x: 560, y: args.grid.h * 3 / 4 - 40, w: 160, h: 60, label: 'play' } + + if args.state.game_over # if game is over, a "play again" button is shown + # Calculations ensure that Play Again label is displayed in center of border + # Remove calculations from y parameters and see what happens to border and label placement + args.outputs.labels << [args.grid.w_half, args.grid.h * 3 / 4, "Play Again", 0, 1, 0, 0, 0] # outputs label + args.outputs.borders << args.state.play_again_button # outputs border + else # otherwise, if game is not over + # Calculations ensure that label appears in center of border + args.outputs.labels << [args.grid.w_half, args.grid.h * 3 / 4, "Play Note ##{args.state.current_level}", 0, 1, 0, 0, 0] # outputs label + args.outputs.borders << args.state.play_note_button # outputs border end - def input_bullet create_bullet, ship - return unless create_bullet - return if ship.dead + return if args.state.game_over # return if game is over - state.bullets << state.new_entity(:ship_bullet, - { owner: ship, - angle: ship.angle, - max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), - speed: 5 + ship.dx.mult(ship.angle.vector_x) + ship.dy.mult(ship.angle.vector_y), - lifetime: 120, - sprite_size: 10, - x: ship.x + ship.angle.vector_x * 32, - y: ship.y + ship.angle.vector_y * 32 }) + args.outputs.labels << [args.grid.w_half, 400, "I think the note is a(n)...", 0, 1, 0, 0, 0] # outputs label + + # Shows all of the available notes that can be potential matches. + available_notes.each_with_index do |note, i| + args.state.notes[i] ||= piano_button(args, note, i + 1) # calls piano_button method on each note (creates label and border) + args.outputs.labels << args.state.notes[i].label # outputs note on screen with a label and a border + args.outputs.borders << args.state.notes[i].border end - def input_mine create_mine, ship - return unless create_mine - return if ship.dead + # Shows whether or not the user is correct by filling the screen with either red or green + args.outputs.solids << args.state.click_feedbacks.map { |c| c.solid } + end - state.bullets << state.new_entity(:ship_bullet, - { owner: ship, - angle: 360.randomize(:sign, :ratio), - max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), - speed: 0.02, - sprite_size: 10, - lifetime: 600, - x: ship.x + ship.angle.vector_x * -50, - y: ship.y + ship.angle.vector_y * -50 }) + # Shows the score (number of times the user guesses wrong) onto the screen using labels. + def render_score args + if args.state.times_wrong == 0 # if the user has guessed wrong zero times, the score is par + args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: PAR", 0, 1, 0, 0, 0] + else # otherwise, number of times the user has guessed wrong is shown + args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: +#{args.state.times_wrong}", 0, 1, 0, 0, 0] # shows score using string interpolation end + end - def input_bullets_and_mines - return if state.bullets.length > 100 + # Sets the target note for the level and performs calculations on click_feedbacks. + def calc args + args.state.target_note ||= available_notes.sample # chooses a note from available_notes collection as target note + args.state.click_feedbacks.each { |c| c.solid[-1] -= 5 } # remove this line and solid color will remain on screen indefinitely + # comment this line out and the solid color will keep flashing on screen instead of being removed from click_feedbacks collection + args.state.click_feedbacks.reject! { |c| c.solid[-1] <= 0 } + end - [ - [inputs.controller_one.key_held.a || inputs.keyboard.key_held.space, - inputs.controller_one.key_down.b || inputs.keyboard.key_down.down, - state.ship_blue], - [inputs.controller_two.key_held.a, inputs.controller_two.key_down.b, state.ship_red] - ].each do |a_held, b_down, ship| - input_bullet(a_held && state.tick_count.mod_zero?(10).or(a_held == 0), ship) - input_mine(b_down, ship) - end - end + # Uses input from the user to play the target note, as well as the other notes that could be a potential match. + def input_mouse args + return unless args.inputs.mouse.click # return unless the mouse is clicked - def calc_kill_ships - alive_ships.find_all { |s| s.damage >= 5 }.each do |s| - s.dead = true - create_explosion! :ship_explosion, s, 20, 20, 30, s.max_alpha - end - end + # finds button that was clicked by user + button_clicked = args.outputs.borders.find_all do |b| # go through borders collection to find all borders that meet requirements + args.inputs.mouse.click.point.inside_rect? b # find button border that mouse was clicked inside of + end.find_all { |b| b.is_a? Hash }.first # reject, return first element - def calc_score - return if state.round_finished - return if alive_ships.length > 1 + return unless button_clicked # return unless button_clicked as a value (a button was clicked) - if alive_ships.first == state.ship_red - state.ship_red_score += 1 - elsif alive_ships.first == state.ship_blue - state.ship_blue_score += 1 - end + queue_click_feedback args, # calls queue_click_feedback method on the button that was clicked + button_clicked.x, + button_clicked.y, + button_clicked.w, + button_clicked.h, + 150, 100, 200 # sets color of button to shade of purple - state.round_finished = true - end + if button_clicked[:label] == 'play' # if "play note" button is pressed + args.outputs.sounds << "sounds/#{args.state.target_note}.wav" # sound of target note is output + elsif button_clicked[:label] == 'again' # if "play game again" button is pressed + args.state.target_note = nil # no target note + args.state.current_level = 1 # starts at level 1 again + args.state.times_wrong = 0 # starts off with 0 wrong guesses + args.state.game_over = false # the game is not over (because it has just been restarted) + else # otherwise if neither of those buttons were pressed + args.outputs.sounds << "sounds/#{button_clicked[:label]}.wav" # sound of clicked note is played + if button_clicked[:label] == args.state.target_note # if clicked note is target note + args.state.target_note = nil # target note is emptied - def calc_reset_ships - return unless state.round_finished - state.round_finished_debounce ||= 2.seconds - state.round_finished_debounce -= 1 - return if state.round_finished_debounce > 0 - start_new_round! + if args.state.current_level < 9 # if game hasn't reached level 9 + args.state.current_level += 1 # game goes to next level + else # otherwise, if game has reached level 9 + args.state.game_over = true # the game is over + end + + queue_click_feedback args, 0, 0, args.grid.w, args.grid.h, 100, 200, 100 # green shown if user guesses correctly + else # otherwise, if clicked note is not target note + args.state.times_wrong += 1 # increments times user guessed wrong + queue_click_feedback args, 0, 0, args.grid.w, args.grid.h, 200, 100, 100 # red shown is user guesses wrong + end end + end - def start_new_round! - state.ship_blue = new_blue_ship - state.ship_red = new_red_ship - state.round_finished = false - state.round_finished_debounce = nil - state.flames.clear - state.bullets.clear + # Creates a collection of all of the available notes as symbols + def available_notes + [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4] + end + + # Creates buttons for each note, and sets a label (the note's name) and border for each note's button. + def piano_button args, note, position + args.state.new_entity(:button) do |b| # declares button as new entity + b.label = [460 + 40.mult(position), args.grid.h * 0.4, "#{note}", 0, 1, 0, 0, 0] # label definition + b.border = { x: 460 + 40.mult(position) - 20, y: args.grid.h * 0.4 - 32, w: 40, h: 40, label: note } # border definition, text/title; 20 subtracted so label is in center of border end + end - def calc_winner - calc_kill_ships - calc_score - calc_reset_ships + # Color of click feedback changes depending on what button was clicked, and whether the guess is right or wrong + # If a button is clicked, the inside of button is purple (see input_mouse method) + # If correct note is clicked, screen turns green + # If incorrect note is clicked, screen turns red (again, see input_mouse method) + def queue_click_feedback args, x, y, w, h, *color + args.state.click_feedbacks << args.state.new_entity(:click_feedback) do |c| # declares feedback as new entity + c.solid = [x, y, w, h, *color, 255] # sets color end end - $dueling_spaceship = DuelingSpaceships.new + 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.escape + args.state.key_event_occurred = true + end - def tick args - args.grid.origin_center! - $dueling_spaceship.inputs = args.inputs - $dueling_spaceship.outputs = args.outputs - $dueling_spaceship.state = args.state - $dueling_spaceship.grid = args.grid - $dueling_spaceship.tick + 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 -* arcade/flappy dragon/credits.txt +*** Arcade - Twinstick - main.rb #+begin_src 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 + # ./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} + args.state.enemies ||= [] + args.state.player_bullets ||= [] + args.state.tick_count ||= -1 + args.state.tick_count += 1 + spawn_enemies args + kill_enemies args + move_enemies args + move_bullets args + move_player args + fire_player args + args.state.player[:r] = args.state.player[:g] = args.state.player[:b] = (args.state.player[:health] * 25.5).clamp(0, 255) + label_color = args.state.player[:health] <= 5 ? 255 : 0 + args.outputs.labels << [ + { + x: args.state.player.x + 40, y: args.state.player.y + 60, alignment_enum: 1, text: "#{args.state.player[:health]} HP", + r: label_color, g: label_color, b: label_color + }, { + x: args.state.player.x + 40, y: args.state.player.y + 40, alignment_enum: 1, text: "#{args.state.player[:score]} PTS", + r: label_color, g: label_color, b: label_color, size_enum: 2 - args.state.player[:score].to_s.length, + } + ] + args.outputs.sprites << [args.state.player, args.state.enemies, args.state.player_bullets] + args.state.clear! if args.state.player[:health] < 0 # Reset the game if the player's health drops below zero + end - -#+end_src - -* arcade/flappy dragon/main.rb -#+begin_src ruby - # ./samples/99_genre_arcade/flappy_dragon/app/main.rb - class FlappyDragon - attr_accessor :grid, :inputs, :state, :outputs + def spawn_enemies args + # Spawn enemies more frequently as the player's score increases. + if rand < (100+args.state.player[:score])/(10000 + args.state.player[:score]) || args.state.tick_count.zero? + theta = rand * Math::PI * 2 + args.state.enemies << { + x: 600 + Math.cos(theta) * 800, y: 320 + Math.sin(theta) * 800, w: 80, h: 80, path: 'sprites/circle-white.png', + r: (256 * rand).floor, g: (256 * rand).floor, b: (256 * rand).floor + } + end + end - def tick - defaults - render - calc - process_inputs + def kill_enemies args + args.state.enemies.reject! do |enemy| + # Check if enemy and player are within 80 pixels of each other (i.e. overlapping) + if 6400 > (enemy.x - args.state.player.x) ** 2 + (enemy.y - args.state.player.y) ** 2 + # Enemy is touching player. Kill enemy, and reduce player HP by 1. + args.state.player[:health] -= 1 + else + args.state.player_bullets.any? do |bullet| + # Check if enemy and bullet are within 50 pixels of each other (i.e. overlapping) + if 2500 > (enemy.x - bullet.x + 30) ** 2 + (enemy.y - bullet.y + 30) ** 2 + # Increase player health by one for each enemy killed by a bullet after the first enemy, up to a maximum of 10 HP + args.state.player[:health] += 1 if args.state.player[:health] < 10 && bullet[:kills] > 0 + # Keep track of how many enemies have been killed by this particular bullet + bullet[:kills] += 1 + # Earn more points by killing multiple enemies with one shot. + args.state.player[:score] += bullet[:kills] + end + end + end end + end - def defaults - state.flap_power = 11 - state.gravity = 0.9 - state.ceiling = 600 - state.ceiling_flap_power = 6 - state.wall_countdown_length = 100 - state.wall_gap_size = 100 - state.wall_countdown ||= 0 - state.hi_score ||= 0 - state.score ||= 0 - state.walls ||= [] - state.x ||= 50 - state.y ||= 500 - state.dy ||= 0 - state.scene ||= :menu - state.scene_at ||= 0 - state.difficulty ||= :normal - state.new_difficulty ||= :normal - state.countdown ||= 4.seconds - state.flash_at ||= 0 + def move_enemies args + args.state.enemies.each do |enemy| + # Get the angle from the enemy to the player + theta = Math.atan2(enemy.y - args.state.player.y, enemy.x - args.state.player.x) + # Convert the angle to a vector pointing at the player + dx, dy = theta.to_degrees.vector 5 + # Move the enemy towards thr player + enemy.x -= dx + enemy.y -= dy end + end - def render - outputs.sounds << "sounds/flappy-song.ogg" if state.tick_count == 1 - render_score - render_menu - render_game + def move_bullets args + args.state.player_bullets.each do |bullet| + # Move the bullets according to the bullet's velocity + bullet.x += bullet[:vx] + bullet.y += bullet[:vy] + end + args.state.player_bullets.reject! do |bullet| + # Despawn bullets that are outside the screen area + bullet.x < -20 || bullet.y < -20 || bullet.x > 1300 || bullet.y > 740 + end + end + + def move_player args + # Get the currently held direction. + dx, dy = move_directional_vector args + # Take the weighted average of the old velocities and the desired velocities. + # Since move_directional_vector returns values between -1 and 1, + # and we want to limit the speed to 7.5, we multiply dx and dy by 7.5*0.1 to get 0.75 + args.state.player[:vx] = args.state.player[:vx] * 0.9 + dx * 0.75 + args.state.player[:vy] = args.state.player[:vy] * 0.9 + dy * 0.75 + # Move the player + args.state.player.x += args.state.player[:vx] + args.state.player.y += args.state.player[:vy] + # If the player is about to go out of bounds, put them back in bounds. + args.state.player.x = args.state.player.x.clamp(0, 1201) + args.state.player.y = args.state.player.y.clamp(0, 640) + end + + + def fire_player args + # Reduce the firing cooldown each tick + args.state.player[:cooldown] -= 1 + # If the player is allowed to fire + if args.state.player[:cooldown] <= 0 + dx, dy = shoot_directional_vector args # Get the bullet velocity + return if dx == 0 && dy == 0 # If the velocity is zero, the player doesn't want to fire. Therefore, we just return early. + # Add a new bullet to the list of player bullets. + args.state.player_bullets << { + x: args.state.player.x + 30 + 40 * dx, + y: args.state.player.y + 30 + 40 * dy, + w: 20, h: 20, + path: 'sprites/circle-white.png', + r: 0, g: 0, b: 0, + vx: 10 * dx + args.state.player[:vx] / 7.5, vy: 10 * dy + args.state.player[:vy] / 7.5, # Factor in a bit of the player's velocity + kills: 0 + } + args.state.player[:cooldown] = 30 # Reset the cooldown end + end - def render_score - outputs.primitives << [10, 710, "HI SCORE: #{state.hi_score}", large_white_typeset].label - outputs.primitives << [10, 680, "SCORE: #{state.score}", large_white_typeset].label - outputs.primitives << [10, 650, "DIFFICULTY: #{state.difficulty.upcase}", large_white_typeset].label + # Custom function for getting a directional vector just for movement using WASD + def move_directional_vector args + dx = 0 + dx += 1 if args.inputs.keyboard.d + dx -= 1 if args.inputs.keyboard.a + dy = 0 + dy += 1 if args.inputs.keyboard.w + dy -= 1 if args.inputs.keyboard.s + if dx != 0 && dy != 0 + dx *= 0.7071 + dy *= 0.7071 end + [dx, dy] + end - def render_menu - return unless state.scene == :menu - render_overlay + # Custom function for getting a directional vector just for shooting using the arrow keys + def shoot_directional_vector args + dx = 0 + dx += 1 if args.inputs.keyboard.key_down.right || args.inputs.keyboard.key_held.right + dx -= 1 if args.inputs.keyboard.key_down.left || args.inputs.keyboard.key_held.left + dy = 0 + dy += 1 if args.inputs.keyboard.key_down.up || args.inputs.keyboard.key_held.up + dy -= 1 if args.inputs.keyboard.key_down.down || args.inputs.keyboard.key_held.down + if dx != 0 && dy != 0 + dx *= 0.7071 + dy *= 0.7071 + end + [dx, dy] + end +#+end_src + +*** Crafting - Craft Game Starting Point - main.rb +#+begin_src ruby + # ./samples/99_genre_crafting/craft_game_starting_point/app/main.rb + # ================================================== + # A NOTE TO JAM CRAFT PARTICIPANTS: + # The comments and code in here are just as small piece of DragonRuby's capabilities. + # Be sure to check out the rest of the sample apps. Start with README.txt and go from there! + # ================================================== - outputs.labels << [640, 700, "Flappy Dragon", 50, 1, 255, 255, 255] - outputs.labels << [640, 500, "Instructions: Press Spacebar to flap. Don't die.", 4, 1, 255, 255, 255] - outputs.labels << [430, 430, "[Tab] Change difficulty", 4, 0, 255, 255, 255] - outputs.labels << [430, 400, "[Enter] Start at New Difficulty ", 4, 0, 255, 255, 255] - outputs.labels << [430, 370, "[Escape] Cancel/Resume ", 4, 0, 255, 255, 255] - outputs.labels << [640, 300, "(mouse, touch, and game controllers work, too!) ", 4, 1, 255, 255, 255] - outputs.labels << [640, 200, "Difficulty: #{state.new_difficulty.capitalize}", 4, 1, 255, 255, 255] + # def tick args is the entry point into your game. This function is called at + # a fixed update time of 60hz (60 fps). + def tick args + # The defaults function intitializes the game. + defaults args - outputs.labels << [10, 100, "Code: @amirrajan", 255, 255, 255] - outputs.labels << [10, 80, "Art: @mobypixel", 255, 255, 255] - outputs.labels << [10, 60, "Music: @mobypixel", 255, 255, 255] - outputs.labels << [10, 40, "Engine: DragonRuby GTK", 255, 255, 255] - end + # After the game is initialized, render it. + render args - def render_overlay - outputs.primitives << [grid.rect.scale_rect(1.1, 0, 0), 0, 0, 0, 230].solid - end + # After rendering the player should be able to respond to input. + input args - def render_game - render_game_over - render_background - render_walls - render_dragon - render_flash - end + # After responding to input, the game performs any additional calculations. + calc args + end - def render_game_over - return unless state.scene == :game - outputs.labels << [638, 358, score_text, 20, 1] - outputs.labels << [635, 360, score_text, 20, 1, 255, 255, 255] - outputs.labels << [638, 428, countdown_text, 20, 1] - outputs.labels << [635, 430, countdown_text, 20, 1, 255, 255, 255] + def defaults args + # hide the mouse cursor for this game, we are going to render our own cursor + if args.state.tick_count == 0 + args.gtk.hide_cursor end - def render_background - outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png'] + args.state.click_ripples ||= [] - scroll_point_at = state.tick_count - scroll_point_at = state.scene_at if state.scene == :menu - scroll_point_at = state.death_at if state.countdown > 0 - scroll_point_at ||= 0 + # everything is on a 1280x720 virtual canvas, so you can + # hardcode locations - outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_back.png', 0.25) - outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_middle.png', 0.50) - outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_front.png', 1.00, -80) - end + # define the borders for where the inventory is located + # args.state is a data structure that accepts any arbitrary parameters + # so you can create an object graph without having to create any classes. - def render_walls - state.walls.each do |w| - w.sprites = [ - [w.x, w.bottom_height - 720, 100, 720, 'sprites/wall.png', 180], - [w.x, w.top_y, 100, 720, 'sprites/wallbottom.png', 0] - ] - end - outputs.sprites << state.walls.map(&:sprites) - end + # Bottom left is 0, 0. Top right is 1280, 720. + # The inventory area is at the top of the screen + # the number 80 is the size of all the sprites, so that is what is being + # used to decide the with and height + args.state.sprite_size = 80 - def render_dragon - state.show_death = true if state.countdown == 3.seconds + args.state.inventory_border.w = args.state.sprite_size * 10 + args.state.inventory_border.h = args.state.sprite_size * 3 + args.state.inventory_border.x = 10 + args.state.inventory_border.y = 710 - args.state.inventory_border.h - render_debug_hitbox false + # define the borders for where the crafting area is located + # the crafting area is below the inventory area + # the number 80 is the size of all the sprites, so that is what is being + # used to decide the with and height + args.state.craft_border.x = 10 + args.state.craft_border.y = 220 + args.state.craft_border.w = args.state.sprite_size * 3 + args.state.craft_border.h = args.state.sprite_size * 3 - if state.show_death == false || !state.death_at - animation_index = state.flapped_at.frame_index 6, 2, false if state.flapped_at - sprite_name = "sprites/dragon_fly#{animation_index.or(0) + 1}.png" - state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2] - else - sprite_name = "sprites/dragon_die.png" - state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2] - sprite_changed_elapsed = state.death_at.elapsed_time - 1.seconds - state.dragon_sprite.angle += (sprite_changed_elapsed ** 1.3) * state.death_fall_direction * -1 - state.dragon_sprite.x += (sprite_changed_elapsed ** 1.2) * state.death_fall_direction - state.dragon_sprite.y += (sprite_changed_elapsed * 14 - sprite_changed_elapsed ** 1.6) - end + # define the area where results are located + # the crafting result is to the right of the craft area + args.state.result_border.x = 10 + args.state.sprite_size * 3 + args.state.sprite_size + args.state.result_border.y = 220 + args.state.sprite_size + args.state.result_border.w = args.state.sprite_size + args.state.result_border.h = args.state.sprite_size - outputs.sprites << state.dragon_sprite - end + # initialize items for the first time if they are nil + # you start with 15 wood, 1 chest, and 5 plank + # Ruby has built in syntax for dictionaries (they look a lot like json objects). + # Ruby also has a special type called a Symbol denoted with a : followed by a word. + # Symbols are nice because they remove the need for magic strings. + if !args.state.items + args.state.items = [ + { + id: :wood, # :wood is a Symbol, this is better than using "wood" for the id + quantity: 15, + path: 'sprites/wood.png', + location: :inventory, + ordinal_x: 0, ordinal_y: 0 + }, + { + id: :chest, + quantity: 1, + path: 'sprites/chest.png', + location: :inventory, + ordinal_x: 1, ordinal_y: 0 + }, + { + id: :plank, + quantity: 5, + path: 'sprites/plank.png', + location: :inventory, + ordinal_x: 2, ordinal_y: 0 + }, + ] - def render_debug_hitbox show - return unless show - outputs.borders << [dragon_collision_box.rect, 255, 0, 0] if state.dragon_sprite - outputs.borders << state.walls.flat_map do |w| - w.sprites.map { |s| [s.rect, 255, 0, 0] } - end + # after initializing the oridinal positions, derive the pixel + # locations assuming that the width and height are 80 + args.state.items.each { |item| set_inventory_position args, item } end - def render_flash - return unless state.flash_at + # define all the oridinal positions of the inventory slots + if !args.state.inventory_area + args.state.inventory_area = [ + { ordinal_x: 0, ordinal_y: 0 }, + { ordinal_x: 1, ordinal_y: 0 }, + { ordinal_x: 2, ordinal_y: 0 }, + { ordinal_x: 3, ordinal_y: 0 }, + { ordinal_x: 4, ordinal_y: 0 }, + { ordinal_x: 5, ordinal_y: 0 }, + { ordinal_x: 6, ordinal_y: 0 }, + { ordinal_x: 7, ordinal_y: 0 }, + { ordinal_x: 8, ordinal_y: 0 }, + { ordinal_x: 9, ordinal_y: 0 }, + { ordinal_x: 0, ordinal_y: 1 }, + { ordinal_x: 1, ordinal_y: 1 }, + { ordinal_x: 2, ordinal_y: 1 }, + { ordinal_x: 3, ordinal_y: 1 }, + { ordinal_x: 4, ordinal_y: 1 }, + { ordinal_x: 5, ordinal_y: 1 }, + { ordinal_x: 6, ordinal_y: 1 }, + { ordinal_x: 7, ordinal_y: 1 }, + { ordinal_x: 8, ordinal_y: 1 }, + { ordinal_x: 9, ordinal_y: 1 }, + { ordinal_x: 0, ordinal_y: 2 }, + { ordinal_x: 1, ordinal_y: 2 }, + { ordinal_x: 2, ordinal_y: 2 }, + { ordinal_x: 3, ordinal_y: 2 }, + { ordinal_x: 4, ordinal_y: 2 }, + { ordinal_x: 5, ordinal_y: 2 }, + { ordinal_x: 6, ordinal_y: 2 }, + { ordinal_x: 7, ordinal_y: 2 }, + { ordinal_x: 8, ordinal_y: 2 }, + { ordinal_x: 9, ordinal_y: 2 }, + ] - outputs.primitives << [grid.rect, - white, - 255 * state.flash_at.ease(20, :flip)].solid + # after initializing the oridinal positions, derive the pixel + # locations assuming that the width and height are 80 + args.state.inventory_area.each { |i| set_inventory_position args, i } - state.flash_at = 0 if state.flash_at.elapsed_time > 20 - end + # if you want to see the result you can use the Ruby function called "puts". + # Uncomment this line to see the value. + # puts args.state.inventory_area - def calc - return unless state.scene == :game - reset_game if state.countdown == 1 - state.countdown -= 1 and return if state.countdown > 0 - calc_walls - calc_flap - calc_game_over + # You can see all things written via puts in DragonRuby's Console, or under logs/log.txt. + # To bring up DragonRuby's Console, press the ~ key within the game. end - def calc_walls - state.walls.each { |w| w.x -= 8 } - - walls_count_before_removal = state.walls.length + # define all the oridinal positions of the craft slots + if !args.state.craft_area + args.state.craft_area = [ + { ordinal_x: 0, ordinal_y: 0 }, + { ordinal_x: 0, ordinal_y: 1 }, + { ordinal_x: 0, ordinal_y: 2 }, + { ordinal_x: 1, ordinal_y: 0 }, + { ordinal_x: 1, ordinal_y: 1 }, + { ordinal_x: 1, ordinal_y: 2 }, + { ordinal_x: 2, ordinal_y: 0 }, + { ordinal_x: 2, ordinal_y: 1 }, + { ordinal_x: 2, ordinal_y: 2 }, + ] - state.walls.reject! { |w| w.x < -100 } + # after initializing the oridinal positions, derive the pixel + # locations assuming that the width and height are 80 + args.state.craft_area.each { |c| set_craft_position args, c } + end + end - state.score += 1 if state.walls.count < walls_count_before_removal - state.wall_countdown -= 1 and return if state.wall_countdown > 0 + def render args + # for the results area, create a sprite that show its boundaries + args.outputs.primitives << { x: args.state.result_border.x, + y: args.state.result_border.y, + w: args.state.result_border.w, + h: args.state.result_border.h, + path: 'sprites/border-black.png' } - state.walls << state.new_entity(:wall) do |w| - w.x = grid.right - w.opening = grid.top - .randomize(:ratio) - .greater(200) - .lesser(520) - w.bottom_height = w.opening - state.wall_gap_size - w.top_y = w.opening + state.wall_gap_size - end + # for each inventory spot, create a sprite + # args.outputs.primitives is how DragonRuby performs a render. + # Adding a single hash or multiple hashes to this array will tell + # DragonRuby to render those primitives on that frame. - state.wall_countdown = state.wall_countdown_length + # The .map function on Array is used instead of any kind of looping. + # .map returns a new object for every object within an Array. + args.outputs.primitives << args.state.inventory_area.map do |a| + { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' } end - def calc_flap - state.y += state.dy - state.dy = state.dy.lesser state.flap_power - state.dy -= state.gravity - return if state.y < state.ceiling - state.y = state.ceiling - state.dy = state.dy.lesser state.ceiling_flap_power + # for each craft spot, create a sprite + args.outputs.primitives << args.state.craft_area.map do |a| + { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' } end - def calc_game_over - return unless game_over? + # after the borders have been rendered, render the + # items within those slots (and allow for highlighting) + # if an item isn't currently being held + allow_inventory_highlighting = !args.state.held_item - state.death_at = state.tick_count - state.death_from = state.walls.first - state.death_fall_direction = -1 - state.death_fall_direction = 1 if state.x > state.death_from.x - outputs.sounds << "sounds/hit-sound.wav" - begin_countdown - end + # go through each item and render them + # use Array's find_all method to remove any items that are currently being held + args.state.items.find_all { |item| item[:location] != :held }.map do |item| + # if an item is currently being held, don't render it in it's spot within the + # inventory or craft area (this is handled via the find_all method). - def process_inputs - process_inputs_menu - process_inputs_game + # the item_prefab returns a hash containing all the visual components of an item. + # the main sprite, the black background, the quantity text, and a hover indication + # if the mouse is currently hovering over the item. + args.outputs.primitives << item_prefab(args, item, allow_inventory_highlighting, args.inputs.mouse) end - def process_inputs_menu - return unless state.scene == :menu - - changediff = inputs.keyboard.key_down.tab || inputs.controller_one.key_down.select - if inputs.mouse.click - p = inputs.mouse.click.point - if (p.y >= 165) && (p.y < 200) && (p.x >= 500) && (p.x < 800) - changediff = true - end - end + # The last thing we want to render is the item currently being held. + args.outputs.primitives << item_prefab(args, args.state.held_item, allow_inventory_highlighting, args.inputs.mouse) - if changediff - case state.new_difficulty - when :easy - state.new_difficulty = :normal - when :normal - state.new_difficulty = :hard - when :hard - state.new_difficulty = :flappy - when :flappy - state.new_difficulty = :easy - end - end + args.outputs.primitives << args.state.click_ripples - if inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start || inputs.controller_one.key_down.a - state.difficulty = state.new_difficulty - change_to_scene :game - reset_game false - state.hi_score = 0 - begin_countdown - end + # render a mouse cursor since we have the OS cursor hidden + args.outputs.primitives << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 } + end - if inputs.keyboard.key_down.escape || (inputs.mouse.click && !changediff) || inputs.controller_one.key_down.b - state.new_difficulty = state.difficulty - change_to_scene :game - end - end + # Alrighty! This is where all the fun happens + def input args + # if the mouse is clicked and not item is currently being held + # args.state.held_item is nil when the game starts. + # If the player clicks, the property args.inputs.mouse.click will + # be a non nil value, we don't want to process any of the code here + # if the mouse hasn't been clicked + return if !args.inputs.mouse.click - def process_inputs_game - return unless state.scene == :game + # if a click occurred, add a ripple to the ripple queue + args.state.click_ripples << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 } - clicked_menu = false - if inputs.mouse.click - p = inputs.mouse.click.point - clicked_menu = (p.y >= 620) && (p.x < 275) + # if the mouse has been clicked, and no item is currently held... + if !args.state.held_item + # see if any of the items intersect the pointer using the inside_rect? method + # the find method will either return the first object that returns true + # for the match clause, or it'll return nil if nothing matches the match clause + found = args.state.items.find do |item| + # for each item in args.state.items, run the following boolean check + args.inputs.mouse.click.point.inside_rect?(item) end - if clicked_menu || inputs.keyboard.key_down.escape || inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start - change_to_scene :menu - elsif (inputs.mouse.down || inputs.mouse.click || inputs.keyboard.key_down.space || inputs.controller_one.key_down.a) && state.countdown == 0 - state.dy = 0 - state.dy += state.flap_power - state.flapped_at = state.tick_count - outputs.sounds << "sounds/fly-sound.wav" + # if an item intersects the mouse pointer, then set the item's location to :held and + # set args.state.held_item to the item for later reference + if found + args.state.held_item = found + found[:location] = :held end - end - def scrolling_background at, path, rate, y = 0 - [ - [ 0 - at.*(rate) % 1440, y, 1440, 720, path], - [1440 - at.*(rate) % 1440, y, 1440, 720, path] - ] - end + # if the mouse is clicked and an item is currently beign held.... + elsif args.state.held_item + # determine if a slot within the craft area was clicked + craft_area = args.state.craft_area.find { |a| args.inputs.mouse.click.point.inside_rect? a } - def white - [255, 255, 255] - end + # also determine if a slot within the inventory area was clicked + inventory_area = args.state.inventory_area.find { |a| args.inputs.mouse.click.point.inside_rect? a } - def large_white_typeset - [5, 0, 255, 255, 255] - end + # if the click was within a craft area + if craft_area + # check to see if an item is already there and ignore the click if an item is found + # item_at_craft_slot is a helper method that returns an item or nil for a given oridinal + # position + item_already_there = item_at_craft_slot args, craft_area[:ordinal_x], craft_area[:ordinal_y] - def at_beginning? - state.walls.count == 0 - end + # if an item *doesn't* exist in the craft area + if !item_already_there + # if the quantity they are currently holding is greater than 1 + if args.state.held_item[:quantity] > 1 + # remove one item (creating a seperate item of the same type), and place it + # at the oridinal position and location of the craft area + # the .merge method on Hash creates a new Hash, but updates any values + # passed as arguments to merge + new_item = args.state.held_item.merge(quantity: 1, + location: :craft, + ordinal_x: craft_area[:ordinal_x], + ordinal_y: craft_area[:ordinal_y]) - def dragon_collision_box - state.dragon_sprite - .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5) - .rect_shift_right(10) - .rect_shift_up(state.dy * 2) - end + # after the item is crated, place it into the args.state.items collection + args.state.items << new_item - def game_over? - return true if state.y <= 0.-(500 * collision_forgiveness) && !at_beginning? + # then subtract one from the held item + args.state.held_item[:quantity] -= 1 - state.walls - .flat_map { |w| w.sprites } - .any? do |s| - s.intersect_rect?(dragon_collision_box) + # if the craft area is available and there is only one item being held + elsif args.state.held_item[:quantity] == 1 + # instead of creating any new items just set the location of the held item + # to the oridinal position of the craft area, and then nil out the + # held item state so that a new item can be picked up + args.state.held_item[:location] = :craft + args.state.held_item[:ordinal_x] = craft_area[:ordinal_x] + args.state.held_item[:ordinal_y] = craft_area[:ordinal_y] + args.state.held_item = nil end - end + end - def collision_forgiveness - case state.difficulty - when :easy - 0.9 - when :normal - 0.7 - when :hard - 0.5 - when :flappy - 0.3 - else - 0.9 - end - end + # if the selected area is an inventory area (as opposed to within the craft area) + elsif inventory_area - def countdown_text - state.countdown ||= -1 - return "" if state.countdown == 0 - return "GO!" if state.countdown.idiv(60) == 0 - return "GAME OVER" if state.death_at - return "READY?" - end + # check to see if there is already an item in that inventory slot + # the item_at_inventory_slot helper method returns an item or nil + item_already_there = item_at_inventory_slot args, inventory_area[:ordinal_x], inventory_area[:ordinal_y] - def begin_countdown - state.countdown = 4.seconds - end + # if there is already an item there, and the item types/id match + if item_already_there && item_already_there[:id] == args.state.held_item[:id] + # then merge the item quantities + held_quantity = args.state.held_item[:quantity] + item_already_there[:quantity] += held_quantity - def score_text - return "" unless state.countdown > 1.seconds - return "" unless state.death_at - return "SCORE: 0 (LOL)" if state.score == 0 - return "HI SCORE: #{state.score}" if state.score == state.hi_score - return "SCORE: #{state.score}" - end + # remove the item being held from the items collection (since it's quantity is now 0) + args.state.items.reject! { |i| i[:location] == :held } - def reset_game set_flash = true - state.flash_at = state.tick_count if set_flash - state.walls = [] - state.y = 500 - state.dy = 0 - state.hi_score = state.hi_score.greater(state.score) - state.score = 0 - state.wall_countdown = state.wall_countdown_length.fdiv(2) - state.show_death = false - state.death_at = nil - end + # nil out the held_item so a new item can be picked up + args.state.held_item = nil - def change_to_scene scene - state.scene = scene - state.scene_at = state.tick_count - inputs.keyboard.clear - inputs.controller_one.clear + # if there currently isn't an item there, then put the held item in the slot + elsif !item_already_there + args.state.held_item[:location] = :inventory + args.state.held_item[:ordinal_x] = inventory_area[:ordinal_x] + args.state.held_item[:ordinal_y] = inventory_area[:ordinal_y] + + # nil out the held_item so a new item can be picked up + args.state.held_item = nil + end + end end end - $flappy_dragon = FlappyDragon.new + # the calc method is executed after input + def calc args + # make sure that the real position of the inventory + # items are updated every frame to ensure that they + # are placed correctly given their location and oridinal positions + # instead of using .map, here we use .each (since we are not returning a new item and just updating the items in place) + args.state.items.each do |item| + # based on the location of the item, invoke the correct pixel conversion method + if item[:location] == :inventory + set_inventory_position args, item + elsif item[:location] == :craft + set_craft_position args, item + elsif item[:location] == :held + # if the item is held, center the item around the mouse pointer + args.state.held_item.x = args.inputs.mouse.x - args.state.held_item.w.half + args.state.held_item.y = args.inputs.mouse.y - args.state.held_item.h.half + end + end - def tick args - $flappy_dragon.grid = args.grid - $flappy_dragon.inputs = args.inputs - $flappy_dragon.state = args.state - $flappy_dragon.outputs = args.outputs - $flappy_dragon.tick - end - -#+end_src - -* Arcade - Pong - main.rb -#+begin_src ruby - # ./samples/99_genre_arcade/pong/app/main.rb - def tick args - defaults args - render args - calc args - input args + # for each hash/sprite in the click ripples queue, + # expand its size by 20 percent and decrease its alpha + # by 10. + args.state.click_ripples.each do |ripple| + delta_w = ripple.w * 1.2 - ripple.w + delta_h = ripple.h * 1.2 - ripple.h + ripple.x -= delta_w.half + ripple.y -= delta_h.half + ripple.w += delta_w + ripple.h += delta_h + ripple.a -= 10 + end + + # remove any items from the collection where the alpha value is less than equal to + # zero using the reject! method (reject with an exclamation point at the end changes the + # array value in place, while reject without the exclamation point returns a new array). + args.state.click_ripples.reject! { |ripple| ripple.a <= 0 } end - def defaults args - args.state.ball.debounce ||= 3 * 60 - args.state.ball.size ||= 10 - args.state.ball.size_half ||= args.state.ball.size / 2 - args.state.ball.x ||= 640 - args.state.ball.y ||= 360 - args.state.ball.dx ||= 5.randomize(:sign) - args.state.ball.dy ||= 5.randomize(:sign) - args.state.left_paddle.y ||= 360 - args.state.right_paddle.y ||= 360 - args.state.paddle.h ||= 120 - args.state.paddle.w ||= 10 - args.state.left_paddle.score ||= 0 - args.state.right_paddle.score ||= 0 + # helper function for finding an item at a craft slot + def item_at_craft_slot args, ordinal_x, ordinal_y + args.state.items.find { |i| i[:location] == :craft && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y } end - def render args - render_center_line args - render_scores args - render_countdown args - render_ball args - render_paddles args - render_instructions args + # helper function for finding an item at an inventory slot + def item_at_inventory_slot args, ordinal_x, ordinal_y + args.state.items.find { |i| i[:location] == :inventory && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y } end - begin :render_methods - def render_center_line args - args.outputs.lines << [640, 0, 640, 720] - end + # helper function that creates a visual representation of an item + def item_prefab args, item, should_highlight, mouse + return nil unless item - def render_scores args - args.outputs.labels << [ - [320, 650, args.state.left_paddle.score, 10, 1], - [960, 650, args.state.right_paddle.score, 10, 1] - ] - end + overlay = nil - def render_countdown args - return unless args.state.ball.debounce > 0 - args.outputs.labels << [640, 360, "%.2f" % args.state.ball.debounce.fdiv(60), 10, 1] - end + x = item.x + y = item.y + w = item.w + h = item.h - def render_ball args - args.outputs.solids << solid_ball(args) + if should_highlight && mouse.point.inside_rect?(item) + overlay = { x: x, y: y, w: w, h: h, path: "sprites/square-blue.png", a: 130, } end - def render_paddles args - args.outputs.solids << solid_left_paddle(args) - args.outputs.solids << solid_right_paddle(args) - end + [ + # sprites are hashes with a path property, this is the main sprite + { x: x, y: y, w: args.state.sprite_size, h: args.state.sprite_size, path: item[:path], }, - def render_instructions args - args.outputs.labels << [320, 30, "W and S keys to move left paddle.", 0, 1] - args.outputs.labels << [920, 30, "O and L keys to move right paddle.", 0, 1] - end + # this represents the black area in the bottom right corner of the main sprite so that the + # quantity is visible + { x: x + 55, y: y, w: 25, h: 25, path: "sprites/square-black.png", }, # sprites are hashes with a path property + + # labels are hashes with a text property + { x: x + 56, y: y + 22, text: "#{item[:quantity]}", r: 255, g: 255, b: 255, }, + + # this is the mouse overlay, if the overlay isn't applicable, then this value will be nil (nil values will not be rendered) + overlay + ] end - def calc args - args.state.ball.debounce -= 1 and return if args.state.ball.debounce > 0 - calc_move_ball args - calc_collision_with_left_paddle args - calc_collision_with_right_paddle args - calc_collision_with_walls args + # helper function for deriving the position of an item within inventory + def set_inventory_position args, item + item.x = args.state.inventory_border.x + item[:ordinal_x] * 80 + item.y = (args.state.inventory_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80 + item.w = 80 + item.h = 80 end - begin :calc_methods - def calc_move_ball args - args.state.ball.x += args.state.ball.dx - args.state.ball.y += args.state.ball.dy - end + # helper function for deriving the position of an item within the craft area + def set_craft_position args, item + item.x = args.state.craft_border.x + item[:ordinal_x] * 80 + item.y = (args.state.craft_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80 + item.w = 80 + item.h = 80 + end - def calc_collision_with_left_paddle args - if solid_left_paddle(args).intersect_rect? solid_ball(args) - args.state.ball.dx *= -1 - elsif args.state.ball.x < 0 - args.state.right_paddle.score += 1 - calc_reset_round args - end - end + # Any lines outside of a function will be executed when the file is reloaded. + # So every time you save main.rb, the game will be reset. + # Comment out the line below if you don't want this to happen. + $gtk.reset + +#+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 + # You can customize the buttons that show up in the Console. + class GTK::Console::Menu + # STEP 1: Override the custom_buttons function. + def custom_buttons + [ + (button id: :yay, + # row for button + row: 3, + # column for button + col: 10, + # text + text: "I AM CUSTOM", + # when clicked call the custom_button_clicked function + method: :custom_button_clicked), - def calc_collision_with_right_paddle args - if solid_right_paddle(args).intersect_rect? solid_ball(args) - args.state.ball.dx *= -1 - elsif args.state.ball.x > 1280 - args.state.left_paddle.score += 1 - calc_reset_round args - end + (button id: :yay, + # row for button + row: 3, + # column for button + col: 9, + # text + text: "CUSTOM ALSO", + # when clicked call the custom_button_also_clicked function + method: :custom_button_also_clicked) + ] end - def calc_collision_with_walls args - if args.state.ball.y + args.state.ball.size_half > 720 - args.state.ball.y = 720 - args.state.ball.size_half - args.state.ball.dy *= -1 - elsif args.state.ball.y - args.state.ball.size_half < 0 - args.state.ball.y = args.state.ball.size_half - args.state.ball.dy *= -1 - end + # STEP 2: Define the function that should be called. + def custom_button_clicked + log "* INFO: I AM CUSTOM was clicked!" end - def calc_reset_round args - args.state.ball.x = 640 - args.state.ball.y = 360 - args.state.ball.dx = 5.randomize(:sign) - args.state.ball.dy = 5.randomize(:sign) - args.state.ball.debounce = 3 * 60 + def custom_button_also_clicked + log "* INFO: Custom Button Clicked at #{Kernel.global_tick_count}!" + + all_buttons_as_string = $gtk.console.menu.buttons.map do |b| + <<-S.strip + ** id: #{b[:id]} + :PROPERTIES: + :id: :#{b[:id]} + :method: :#{b[:method]} + :text: #{b[:text]} + :END: + S + end.join("\n") + + log <<-S + * INFO: Here are all the buttons: + #{all_buttons_as_string} + S end end - def input args - input_left_paddle args - input_right_paddle args + def tick args + args.outputs.labels << [args.grid.center.x, args.grid.center.y, + "Open the DragonRuby Console to see the custom menu items.", + 0, 1] end + +#+end_src + +*** Dev Tools - Animation Creator Starting Point - main.rb +#+begin_src ruby + # ./samples/99_genre_dev_tools/animation_creator_starting_point/app/main.rb + class OneBitLowrezPaint + attr_gtk - begin :input_methods - def input_left_paddle args - if args.inputs.controller_one.key_down.down || args.inputs.keyboard.key_down.s - args.state.left_paddle.y -= 40 - elsif args.inputs.controller_one.key_down.up || args.inputs.keyboard.key_down.w - args.state.left_paddle.y += 40 - end + def tick + outputs.background_color = [0, 0, 0] + defaults + render_instructions + render_canvas + render_buttons_frame_selection + render_animation_frame_thumbnails + render_animation + input_mouse_click + input_keyboard + calc_auto_export + calc_buttons_frame_selection + calc_animation_frames + process_queue_create_sprite + process_queue_reset_sprite + process_queue_update_rt_animation_frame end - def input_right_paddle args - if args.inputs.controller_two.key_down.down || args.inputs.keyboard.key_down.l - args.state.right_paddle.y -= 40 - elsif args.inputs.controller_two.key_down.up || args.inputs.keyboard.key_down.o - args.state.right_paddle.y += 40 + def defaults + state.animation_frames_per_second = 12 + queues.create_sprite ||= [] + queues.reset_sprite ||= [] + queues.update_rt_animation_frame ||= [] + + if !state.animation_frames + state.animation_frames ||= [] + add_animation_frame_to_end end - end - end - begin :assets - def solid_ball args - centered_rect args.state.ball.x, args.state.ball.y, args.state.ball.size, args.state.ball.size - end + state.last_mouse_down ||= 0 + state.last_mouse_up ||= 0 - def solid_left_paddle args - centered_rect_vertically 0, args.state.left_paddle.y, args.state.paddle.w, args.state.paddle.h - end + state.buttons_frame_selection.left = 10 + state.buttons_frame_selection.top = grid.top - 10 + state.buttons_frame_selection.size = 20 - def solid_right_paddle args - centered_rect_vertically 1280 - args.state.paddle.w, args.state.right_paddle.y, args.state.paddle.w, args.state.paddle.h - end + defaults_canvas_sprite - def centered_rect x, y, w, h - [x - w / 2, y - h / 2, w, h] + state.edit_mode ||= :drawing end - def centered_rect_vertically x, y, w, h - [x, y - h / 2, w, h] - end - end - -#+end_src - -* Arcade - Snakemoji - main.rb -#+begin_src ruby - # ./samples/99_genre_arcade/snakemoji/app/main.rb - # coding: utf-8 - ################################ - # So I was working on a snake game while - # learning DragonRuby, and at some point I had a thought - # what if I use "😀" as a function name, surely it wont work right...? - # RIGHT....? - # BUT IT DID, IT WORKED - # it all went downhill from then - # Created by Anton K. (ai Doge) - # https://gist.github.com/scorp200 - #############LICENSE############ - # Feel free to use this anywhere and however you want - # You can sell this to EA for $1,000,000 if you want, its completely free. - # Just rememeber you are helping this... thing... to spread... - # ALSO! I am not liable for any mental, physical or financial damage caused. - #############LICENSE############ + def defaults_canvas_sprite + rt_canvas.size = 16 + rt_canvas.zoom = 30 + rt_canvas.width = rt_canvas.size * rt_canvas.zoom + rt_canvas.height = rt_canvas.size * rt_canvas.zoom + rt_canvas.sprite = { x: 0, + y: 0, + w: rt_canvas.width, + h: rt_canvas.height, + path: :rt_canvas }.center_inside_rect(x: 0, y: 0, w: 640, h: 720) + return unless state.tick_count == 1 - class Array - #Helper function - def move! vector - self.x += vector.x - self.y += vector.y - return self + outputs[:rt_canvas].width = rt_canvas.width + outputs[:rt_canvas].height = rt_canvas.height + outputs[:rt_canvas].sprites << (rt_canvas.size + 1).map_with_index do |x| + (rt_canvas.size + 1).map_with_index do |y| + path = 'sprites/square-white.png' + path = 'sprites/square-blue.png' if x == 7 || x == 8 + { x: x * rt_canvas.zoom, + y: y * rt_canvas.zoom, + w: rt_canvas.zoom, + h: rt_canvas.zoom, + path: path, + a: 50 } + end + end end - #Helper function to draw snake body - def draw! 🎮, 📺, color - translate 📺.solids, 🎮.⛓, [self.x * 🎮.⚖️ + 🎮.🛶 / 2, self.y * 🎮.⚖️ + 🎮.🛶 / 2, 🎮.⚖️ - 🎮.🛶, 🎮.⚖️ - 🎮.🛶, color] - end + def render_instructions + instructions = [ + "* Hotkeys:", + "- d: hold to erase, release to draw.", + "- a: add frame.", + "- c: copy frame.", + "- v: paste frame.", + "- x: delete frame.", + "- b: go to previous frame.", + "- f: go to next frame.", + "- w: save to ./canvas directory.", + "- l: load from ./canvas." + ] - #This is where it all started, I was trying to find good way to multiply a map by a number, * is already used so is ** - #I kept trying different combinations of symbols, when suddenly... - def 😀 value - self.map {|d| d * value} + instructions.each.with_index do |l, i| + outputs.labels << { x: 840, y: 500 - (i * 20), text: "#{l}", + r: 180, g: 180, b: 180, size_enum: 0 } + end end - end - #Draw stuff with an offset - def translate output_collection, ⛓, what - what.x += ⛓.x - what.y += ⛓.y - output_collection << what - end + def render_canvas + return if state.tick_count.zero? + outputs.sprites << rt_canvas.sprite + end - BLUE = [33, 150, 243] - RED = [244, 67, 54] - GOLD = [255, 193, 7] - LAST = 0 + def render_buttons_frame_selection + args.outputs.primitives << state.buttons_frame_selection.items.map_with_index do |b, i| + 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 - def tick args - defaults args.state - render args.state, args.outputs - input args.state, args.inputs - update args.state - end + selection_border = b.merge(r: 40, g: 40, b: 40).border - def update 🎮 - #Update every 10 frames - if 🎮.tick_count.mod_zero? 10 - #Add new snake body piece at head's location - 🎮.🐍 << [*🎮.🤖] - #Assign Next Direction to Direction - 🎮.🚗 = *🎮.🚦 + if i == state.animation_frames_selected_index + selection_border = b.merge(r: 40, g: 230, b: 200).border + end - #Trim the snake a bit if its longer than current size - if 🎮.🐍.length > 🎮.🛒 - 🎮.🐍 = 🎮.🐍[-🎮.🛒..-1] + [selection_border, label] end + end - #Move the head in the Direction - 🎮.🤖.move! 🎮.🚗 + def render_animation_frame_thumbnails + return if state.tick_count.zero? - #If Head is outside the playing field, or inside snake's body restart game - if 🎮.🤖.x < 0 || 🎮.🤖.x >= 🎮.🗺.x || 🎮.🤖.y < 0 || 🎮.🤖.y >= 🎮.🗺.y || 🎮.🚗 != [0, 0] && 🎮.🐍.any? {|s| s == 🎮.🤖} - LAST = 🎮.💰 - 🎮.as_hash.clear - return + outputs[:current_animation_frame].width = rt_canvas.size + outputs[:current_animation_frame].height = rt_canvas.size + outputs[:current_animation_frame].solids << selected_animation_frame[:pixels].map_with_index do |f, i| + { x: f.x, + y: f.y, + w: 1, + h: 1, r: 255, g: 255, b: 255 } end - #If head lands on food add size and score - if 🎮.🤖 == 🎮.🍎 - 🎮.🛒 += 1 - 🎮.💰 += (🎮.🛒 * 0.8).floor.to_i + 5 - spawn_🍎 🎮 - puts 🎮.🍎 - end - end + outputs.sprites << rt_canvas.sprite.merge(path: :current_animation_frame) - #Every second remove 1 point - if 🎮.💰 > 0 && 🎮.tick_count.mod_zero?(60) - 🎮.💰 -= 1 + state.animation_frames.map_with_index do |animation_frame, animation_frame_index| + outputs.sprites << state.buttons_frame_selection[:items][animation_frame_index][:inner_rect] + .merge(path: animation_frame[:rt_name]) + end end - end - def spawn_🍎 🎮 - #Food - 🎮.🍎 ||= [*🎮.🤖] - #Randomly spawns food inside the playing field, keep doing this if the food keeps landing on the snake's body - while 🎮.🐍.any? {|s| s == 🎮.🍎} || 🎮.🍎 == 🎮.🤖 do - 🎮.🍎 = [rand(🎮.🗺.x), rand(🎮.🗺.y)] - end - end + def render_animation + sprite_index = 0.frame_index count: state.animation_frames.length, + hold_for: 60 / state.animation_frames_per_second, + repeat: true - def render 🎮, 📺 - #Paint the background black - 📺.solids << [0, 0, 1280, 720, 0, 0, 0, 255] - #Draw a border for the playing field - translate 📺.borders, 🎮.⛓, [0, 0, 🎮.🗺.x * 🎮.⚖️, 🎮.🗺.y * 🎮.⚖️, 255, 255, 255] + args.outputs.sprites << { x: 700 - 8, + y: 120, + w: 16, + h: 16, + path: (sprite_path sprite_index) } - #Draw the snake's body - 🎮.🐍.map do |🐍| 🐍.draw! 🎮, 📺, BLUE end - #Draw the head - 🎮.🤖.draw! 🎮, 📺, BLUE - #Draw the food - 🎮.🍎.draw! 🎮, 📺, RED + args.outputs.sprites << { x: 700 - 16, + y: 230, + w: 32, + h: 32, + path: (sprite_path sprite_index) } - #Draw current score - translate 📺.labels, 🎮.⛓, [5, 715, "Score: #{🎮.💰}", GOLD] - #Draw your last score, if any - translate 📺.labels, 🎮.⛓, [[*🎮.🤖.😀(🎮.⚖️)].move!([0, 🎮.⚖️ * 2]), "Your Last score is #{LAST}", 0, 1, GOLD] unless LAST == 0 || 🎮.🚗 != [0, 0] - #Draw starting message, only if Direction is 0 - translate 📺.labels, 🎮.⛓, [🎮.🤖.😀(🎮.⚖️), "Press any Arrow key to start", 0, 1, GOLD] unless 🎮.🚗 != [0, 0] - end + args.outputs.sprites << { x: 700 - 32, + y: 360, + w: 64, + h: 64, + path: (sprite_path sprite_index) } - def input 🎮, 🕹 - #Left and Right keyboard input, only change if X direction is 0 - if 🕹.keyboard.key_held.left && 🎮.🚗.x == 0 - 🎮.🚦 = [-1, 0] - elsif 🕹.keyboard.key_held.right && 🎮.🚗.x == 0 - 🎮.🚦 = [1, 0] + args.outputs.sprites << { x: 700 - 64, + y: 520, + w: 128, + h: 128, + path: (sprite_path sprite_index) } end - #Up and Down keyboard input, only change if Y direction is 0 - if 🕹.keyboard.key_held.up && 🎮.🚗.y == 0 - 🎮.🚦 = [0, 1] - elsif 🕹.keyboard.key_held.down && 🎮.🚗.y == 0 - 🎮.🚦 = [0, -1] - end - end + def input_mouse_click + if inputs.mouse.up + state.last_mouse_up = state.tick_count + elsif inputs.mouse.moved && user_is_editing? + edit_current_animation_frame inputs.mouse.point + end - def defaults 🎮 - #Playing field size - 🎮.🗺 ||= [20, 20] - #Scale for drawing, screen height / Field height - 🎮.⚖️ ||= 720 / 🎮.🗺.y - #Offset, offset all rendering to the center of the screen - 🎮.⛓ ||= [(1280 - 720).fdiv(2), 0] - #Padding, make the snake body slightly smaller than the scale - 🎮.🛶 ||= (🎮.⚖️ * 0.2).to_i - #Snake Size - 🎮.🛒 ||= 3 - #Snake head, the only part we are actually controlling - 🎮.🤖 ||= [🎮.🗺.x / 2, 🎮.🗺.y / 2] - #Snake body map, follows the head - 🎮.🐍 ||= [] - #Direction the head moves to - 🎮.🚗 ||= [0, 0] - #Next_Direction, during input check only change this variable and then when game updates asign this to Direction - 🎮.🚦 ||= [*🎮.🚗] - #Your score - 🎮.💰 ||= 0 - #Spawns Food randomly - spawn_🍎(🎮) unless 🎮.🍎? - end - -#+end_src - -* Arcade - Solar System - main.rb -#+begin_src 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 + return unless inputs.mouse.click + + clicked_frame_button = state.buttons_frame_selection.items.find do |b| + inputs.mouse.point.inside_rect? b + end - def defaults args - args.outputs.background_color = [0, 0, 0] - args.state.x ||= 640 - args.state.y ||= 360 - args.state.stars ||= 100.map do - [1280 * rand, 720 * rand, rand.fdiv(10), 255 * rand, 255 * rand, 255 * rand] - end + if (clicked_frame_button) + state.animation_frames_selected_index = clicked_frame_button[:index] + end - args.state.sun ||= args.state.new_entity(:sun) do |s| - s.s = 100 - s.path = 'sprites/sun.png' + if (inputs.mouse.point.inside_rect? rt_canvas.sprite) + state.last_mouse_down = state.tick_count + edit_current_animation_frame inputs.mouse.point + end end - args.state.planets = [ - [:mercury, 65, 5, 88], - [:venus, 100, 10, 225], - [:earth, 120, 10, 365], - [:mars, 140, 8, 687], - [:jupiter, 280, 30, 365 * 11.8], - [:saturn, 350, 20, 365 * 29.5], - [:uranus, 400, 15, 365 * 84], - [:neptune, 440, 15, 365 * 164.8], - [:pluto, 480, 5, 365 * 247.8], - ].map do |name, distance, size, year_in_days| - args.state.new_entity(name) do |p| - p.path = "sprites/#{name}.png" - p.distance = distance * 0.7 - p.s = size * 0.7 - p.year_in_days = year_in_days + def input_keyboard + # w to save + if inputs.keyboard.key_down.w + t = Time.now + state.save_description = "Time: #{t} (#{t.to_i})" + gtk.serialize_state 'canvas/state.txt', state + gtk.serialize_state "tmp/canvas_backups/#{t.to_i}/state.txt", state + animation_frames.each_with_index do |animation_frame, i| + queues.update_rt_animation_frame << { index: i, + at: state.tick_count + i, + queue_sprite_creation: true } + queues.create_sprite << { index: i, + at: state.tick_count + animation_frames.length + i, + path_override: "tmp/canvas_backups/#{t.to_i}/sprite-#{i}.png" } + end + gtk.notify! "Canvas saved." end - end - args.state.ship ||= args.state.new_entity(:ship) do |s| - s.x = 1280 * rand - s.y = 720 * rand - s.angle = 0 - end - end + # l to load + if inputs.keyboard.key_down.l + args.state = gtk.deserialize_state 'canvas/state.txt' + animation_frames.each_with_index do |a, i| + queues.update_rt_animation_frame << { index: i, + at: state.tick_count + i, + queue_sprite_creation: true } + end + gtk.notify! "Canvas loaded." + end - def to_sprite args, entity - x = 0 - y = 0 + # d to go into delete mode, release to paint + if inputs.keyboard.key_held.d + state.edit_mode = :erasing + gtk.notify! "Erasing." if inputs.keyboard.key_held.d == (state.tick_count - 1) + elsif inputs.keyboard.key_up.d + state.edit_mode = :drawing + gtk.notify! "Drawing." + end - if entity.year_in_days - day = args.state.tick_count - day_in_year = day % entity.year_in_days - entity.random_start_day ||= day_in_year * rand - percentage_of_year = day_in_year.fdiv(entity.year_in_days) - angle = 365 * percentage_of_year - x = angle.vector_x(entity.distance) - y = angle.vector_y(entity.distance) - end + # a to add a frame to the end + if inputs.keyboard.key_down.a + queues.create_sprite << { index: state.animation_frames_selected_index, + at: state.tick_count } + queues.create_sprite << { index: state.animation_frames_selected_index + 1, + at: state.tick_count } + add_animation_frame_to_end + gtk.notify! "Frame added to end." + end - [640 + x - entity.s.half, 360 + y - entity.s.half, entity.s, entity.s, entity.path] - end + # c or t to copy + if (inputs.keyboard.key_down.c || inputs.keyboard.key_down.t) + state.clipboard = [selected_animation_frame[:pixels]].flatten + gtk.notify! "Current frame copied." + end - def render args - args.outputs.solids << [0, 0, 1280, 720] + # v or q to paste + if (inputs.keyboard.key_down.v || inputs.keyboard.key_down.q) && state.clipboard + selected_animation_frame[:pixels] = [state.clipboard].flatten + queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, + at: state.tick_count, + queue_sprite_creation: true } + gtk.notify! "Pasted." + end - args.outputs.sprites << args.state.stars.map do |x, y, _, r, g, b| - [x, y, 10, 10, 'sprites/star.png', 0, 100, r, g, b] - end + # f to go forward/next frame + if (inputs.keyboard.key_down.f) + if (state.animation_frames_selected_index == (state.animation_frames.length - 1)) + state.animation_frames_selected_index = 0 + else + state.animation_frames_selected_index += 1 + end + gtk.notify! "Next frame." + end - args.outputs.sprites << to_sprite(args, args.state.sun) - args.outputs.sprites << args.state.planets.map { |p| to_sprite args, p } - args.outputs.sprites << [args.state.ship.x, args.state.ship.y, 20, 20, 'sprites/ship.png', args.state.ship.angle] - end + # b to go back/previous frame + if (inputs.keyboard.key_down.b) + if (state.animation_frames_selected_index == 0) + state.animation_frames_selected_index = state.animation_frames.length - 1 + else + state.animation_frames_selected_index -= 1 + end + gtk.notify! "Previous frame." + end - def calc args - args.state.stars = args.state.stars.map do |x, y, speed, r, g, b| - x += speed - y += speed - x = 0 if x > 1280 - y = 0 if y > 720 - [x, y, speed, r, g, b] + # x to delete frame + if (inputs.keyboard.key_down.x) && animation_frames.length > 1 + state.clipboard = selected_animation_frame[:pixels] + state.animation_frames = animation_frames.find_all { |v| v[:index] != state.animation_frames_selected_index } + if state.animation_frames_selected_index >= state.animation_frames.length + state.animation_frames_selected_index = state.animation_frames.length - 1 + end + gtk.notify! "Frame deleted." + end end - if args.state.tick_count == 0 - args.outputs.sounds << 'sounds/bg.ogg' + def calc_auto_export + return if user_is_editing? + return if state.last_mouse_up.elapsed_time != 30 + # auto export current animation frame if there is no editing for 30 ticks + queues.create_sprite << { index: state.animation_frames_selected_index, + at: state.tick_count } end - end - def process_inputs args - if args.inputs.keyboard.left || args.inputs.controller_one.key_held.left - args.state.ship.angle += 1 - elsif args.inputs.keyboard.right || args.inputs.controller_one.key_held.right - args.state.ship.angle -= 1 + def calc_buttons_frame_selection + state.buttons_frame_selection.items = animation_frames.length.map_with_index do |i| + { x: state.buttons_frame_selection.left + i * state.buttons_frame_selection.size, + y: state.buttons_frame_selection.top - state.buttons_frame_selection.size, + inner_rect: { + x: (state.buttons_frame_selection.left + 2) + i * state.buttons_frame_selection.size, + y: (state.buttons_frame_selection.top - state.buttons_frame_selection.size + 2), + w: 16, + h: 16, + }, + w: state.buttons_frame_selection.size, + h: state.buttons_frame_selection.size, + index: i } + end end - if args.inputs.keyboard.up || args.inputs.controller_one.key_held.a - args.state.ship.x += args.state.ship.angle.x_vector - args.state.ship.y += args.state.ship.angle.y_vector + def calc_animation_frames + animation_frames.each_with_index do |animation_frame, i| + animation_frame[:index] = i + animation_frame[:rt_name] = "animation_frame_#{i}" + end end - end - def tick args - defaults args - render args - calc args - process_inputs args - end + def process_queue_create_sprite + sprites_to_create = queues.create_sprite + .find_all { |h| h[:at].elapsed? } - def r - $gtk.reset - end - -#+end_src - -* Crafting - Craft Game Starting Point - main.rb -#+begin_src ruby - # ./samples/99_genre_crafting/craft_game_starting_point/app/main.rb - # ================================================== - # A NOTE TO JAM CRAFT PARTICIPANTS: - # The comments and code in here are just as small piece of DragonRuby's capabilities. - # Be sure to check out the rest of the sample apps. Start with README.txt and go from there! - # ================================================== + queues.create_sprite = queues.create_sprite - sprites_to_create - # def tick args is the entry point into your game. This function is called at - # a fixed update time of 60hz (60 fps). - def tick args - # The defaults function intitializes the game. - defaults args + sprites_to_create.each do |h| + export_animation_frame h[:index], h[:path_override] + end + end - # After the game is initialized, render it. - render args + def process_queue_reset_sprite + sprites_to_reset = queues.reset_sprite + .find_all { |h| h[:at].elapsed? } - # After rendering the player should be able to respond to input. - input args + queues.reset_sprite -= sprites_to_reset - # After responding to input, the game performs any additional calculations. - calc args - end + sprites_to_reset.each { |h| gtk.reset_sprite (sprite_path h[:index]) } + end - def defaults args - # hide the mouse cursor for this game, we are going to render our own cursor - if args.state.tick_count == 0 - args.gtk.hide_cursor + def process_queue_update_rt_animation_frame + animation_frames_to_update = queues.update_rt_animation_frame + .find_all { |h| h[:at].elapsed? } + + queues.update_rt_animation_frame -= animation_frames_to_update + + animation_frames_to_update.each do |h| + update_animation_frame_render_target animation_frames[h[:index]] + + if h[:queue_sprite_creation] + queues.create_sprite << { index: h[:index], + at: state.tick_count + 1 } + end + end end - args.state.click_ripples ||= [] + def update_animation_frame_render_target animation_frame + return if !animation_frame + + outputs[animation_frame[:rt_name]].width = state.rt_canvas.size + outputs[animation_frame[:rt_name]].height = state.rt_canvas.size + outputs[animation_frame[:rt_name]].solids << animation_frame[:pixels].map do |f| + { x: f.x, + y: f.y, + w: 1, + h: 1, r: 255, g: 255, b: 255 } + end + end - # everything is on a 1280x720 virtual canvas, so you can - # hardcode locations + def animation_frames + state.animation_frames + end - # define the borders for where the inventory is located - # args.state is a data structure that accepts any arbitrary parameters - # so you can create an object graph without having to create any classes. + def add_animation_frame_to_end + animation_frames << { + index: animation_frames.length, + pixels: [], + rt_name: "animation_frame_#{animation_frames.length}" + } - # Bottom left is 0, 0. Top right is 1280, 720. - # The inventory area is at the top of the screen - # the number 80 is the size of all the sprites, so that is what is being - # used to decide the with and height - args.state.sprite_size = 80 + state.animation_frames_selected_index = (animation_frames.length - 1) + queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, + at: state.tick_count, + queue_sprite_creation: true } + end - args.state.inventory_border.w = args.state.sprite_size * 10 - args.state.inventory_border.h = args.state.sprite_size * 3 - args.state.inventory_border.x = 10 - args.state.inventory_border.y = 710 - args.state.inventory_border.h + def sprite_path i + "canvas/sprite-#{i}.png" + end - # define the borders for where the crafting area is located - # the crafting area is below the inventory area - # the number 80 is the size of all the sprites, so that is what is being - # used to decide the with and height - args.state.craft_border.x = 10 - args.state.craft_border.y = 220 - args.state.craft_border.w = args.state.sprite_size * 3 - args.state.craft_border.h = args.state.sprite_size * 3 + def export_animation_frame i, path_override = nil + return if !state.animation_frames[i] - # define the area where results are located - # the crafting result is to the right of the craft area - args.state.result_border.x = 10 + args.state.sprite_size * 3 + args.state.sprite_size - args.state.result_border.y = 220 + args.state.sprite_size - args.state.result_border.w = args.state.sprite_size - args.state.result_border.h = args.state.sprite_size + outputs.screenshots << state.buttons_frame_selection + .items[i][:inner_rect] + .merge(path: path_override || (sprite_path i)) - # initialize items for the first time if they are nil - # you start with 15 wood, 1 chest, and 5 plank - # Ruby has built in syntax for dictionaries (they look a lot like json objects). - # Ruby also has a special type called a Symbol denoted with a : followed by a word. - # Symbols are nice because they remove the need for magic strings. - if !args.state.items - args.state.items = [ - { - id: :wood, # :wood is a Symbol, this is better than using "wood" for the id - quantity: 15, - path: 'sprites/wood.png', - location: :inventory, - ordinal_x: 0, ordinal_y: 0 - }, - { - id: :chest, - quantity: 1, - path: 'sprites/chest.png', - location: :inventory, - ordinal_x: 1, ordinal_y: 0 - }, - { - id: :plank, - quantity: 5, - path: 'sprites/plank.png', - location: :inventory, - ordinal_x: 2, ordinal_y: 0 - }, - ] + outputs.screenshots << state.buttons_frame_selection + .items[i][:inner_rect] + .merge(path: "tmp/sprite_backups/#{Time.now.to_i}-sprite-#{i}.png") - # after initializing the oridinal positions, derive the pixel - # locations assuming that the width and height are 80 - args.state.items.each { |item| set_inventory_position args, item } + queues.reset_sprite << { index: i, at: state.tick_count } end - # define all the oridinal positions of the inventory slots - if !args.state.inventory_area - args.state.inventory_area = [ - { ordinal_x: 0, ordinal_y: 0 }, - { ordinal_x: 1, ordinal_y: 0 }, - { ordinal_x: 2, ordinal_y: 0 }, - { ordinal_x: 3, ordinal_y: 0 }, - { ordinal_x: 4, ordinal_y: 0 }, - { ordinal_x: 5, ordinal_y: 0 }, - { ordinal_x: 6, ordinal_y: 0 }, - { ordinal_x: 7, ordinal_y: 0 }, - { ordinal_x: 8, ordinal_y: 0 }, - { ordinal_x: 9, ordinal_y: 0 }, - { ordinal_x: 0, ordinal_y: 1 }, - { ordinal_x: 1, ordinal_y: 1 }, - { ordinal_x: 2, ordinal_y: 1 }, - { ordinal_x: 3, ordinal_y: 1 }, - { ordinal_x: 4, ordinal_y: 1 }, - { ordinal_x: 5, ordinal_y: 1 }, - { ordinal_x: 6, ordinal_y: 1 }, - { ordinal_x: 7, ordinal_y: 1 }, - { ordinal_x: 8, ordinal_y: 1 }, - { ordinal_x: 9, ordinal_y: 1 }, - { ordinal_x: 0, ordinal_y: 2 }, - { ordinal_x: 1, ordinal_y: 2 }, - { ordinal_x: 2, ordinal_y: 2 }, - { ordinal_x: 3, ordinal_y: 2 }, - { ordinal_x: 4, ordinal_y: 2 }, - { ordinal_x: 5, ordinal_y: 2 }, - { ordinal_x: 6, ordinal_y: 2 }, - { ordinal_x: 7, ordinal_y: 2 }, - { ordinal_x: 8, ordinal_y: 2 }, - { ordinal_x: 9, ordinal_y: 2 }, - ] + def selected_animation_frame + state.animation_frames[state.animation_frames_selected_index] + end - # after initializing the oridinal positions, derive the pixel - # locations assuming that the width and height are 80 - args.state.inventory_area.each { |i| set_inventory_position args, i } + def edit_current_animation_frame point + draw_area_point = (to_draw_area point) + if state.edit_mode == :drawing && (!selected_animation_frame[:pixels].include? draw_area_point) + selected_animation_frame[:pixels] << draw_area_point + queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, + at: state.tick_count, + queue_sprite_creation: !user_is_editing? } + elsif state.edit_mode == :erasing && (selected_animation_frame[:pixels].include? draw_area_point) + selected_animation_frame[:pixels] = selected_animation_frame[:pixels].reject { |p| p == draw_area_point } + queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, + at: state.tick_count, + queue_sprite_creation: !user_is_editing? } + end + end - # if you want to see the result you can use the Ruby function called "puts". - # Uncomment this line to see the value. - # puts args.state.inventory_area + def user_is_editing? + state.last_mouse_down > state.last_mouse_up + end - # You can see all things written via puts in DragonRuby's Console, or under logs/log.txt. - # To bring up DragonRuby's Console, press the ~ key within the game. + def to_draw_area point + x, y = point + x -= rt_canvas.sprite.x + y -= rt_canvas.sprite.y + { x: x.idiv(rt_canvas.zoom), + y: y.idiv(rt_canvas.zoom) } end - # define all the oridinal positions of the craft slots - if !args.state.craft_area - args.state.craft_area = [ - { ordinal_x: 0, ordinal_y: 0 }, - { ordinal_x: 0, ordinal_y: 1 }, - { ordinal_x: 0, ordinal_y: 2 }, - { ordinal_x: 1, ordinal_y: 0 }, - { ordinal_x: 1, ordinal_y: 1 }, - { ordinal_x: 1, ordinal_y: 2 }, - { ordinal_x: 2, ordinal_y: 0 }, - { ordinal_x: 2, ordinal_y: 1 }, - { ordinal_x: 2, ordinal_y: 2 }, - ] + def rt_canvas + state.rt_canvas ||= state.new_entity(:rt_canvas) + end - # after initializing the oridinal positions, derive the pixel - # locations assuming that the width and height are 80 - args.state.craft_area.each { |c| set_craft_position args, c } + def queues + state.queues ||= state.new_entity(:queues) end end + $game = OneBitLowrezPaint.new - def render args - # for the results area, create a sprite that show its boundaries - args.outputs.primitives << { x: args.state.result_border.x, - y: args.state.result_border.y, - w: args.state.result_border.w, - h: args.state.result_border.h, - path: 'sprites/border-black.png' } + def tick args + $game.args = args + $game.tick + end - # for each inventory spot, create a sprite - # args.outputs.primitives is how DragonRuby performs a render. - # Adding a single hash or multiple hashes to this array will tell - # DragonRuby to render those primitives on that frame. + # $gtk.reset + +#+end_src + +*** Dev Tools - Tile Editor Starting Point - main.rb +#+begin_src ruby + # ./samples/99_genre_dev_tools/tile_editor_starting_point/app/main.rb + =begin - # The .map function on Array is used instead of any kind of looping. - # .map returns a new object for every object within an Array. - args.outputs.primitives << args.state.inventory_area.map do |a| - { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' } - end + APIs listing that haven't been encountered in previous sample apps: - # for each craft spot, create a sprite - args.outputs.primitives << args.state.craft_area.map do |a| - { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' } - end + - to_s: Returns a string representation of an object. + For example, if we had + 500.to_s + the string "500" would be returned. + Similar to to_i, which returns an integer representation of an object. - # after the borders have been rendered, render the - # items within those slots (and allow for highlighting) - # if an item isn't currently being held - allow_inventory_highlighting = !args.state.held_item + - Ceil: Returns an integer number greater than or equal to the original + with no decimal. - # go through each item and render them - # use Array's find_all method to remove any items that are currently being held - args.state.items.find_all { |item| item[:location] != :held }.map do |item| - # if an item is currently being held, don't render it in it's spot within the - # inventory or craft area (this is handled via the find_all method). + Reminders: - # the item_prefab returns a hash containing all the visual components of an item. - # the main sprite, the black background, the quantity text, and a hover indication - # if the mouse is currently hovering over the item. - args.outputs.primitives << item_prefab(args, item, allow_inventory_highlighting, args.inputs.mouse) - end + - ARRAY#inside_rect?: Returns true or false depending on if the point is inside a rect. - # The last thing we want to render is the item currently being held. - args.outputs.primitives << item_prefab(args, args.state.held_item, allow_inventory_highlighting, args.inputs.mouse) + - args.outputs.labels: An array. The values generate a label. + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] + For more information about labels, go to mygame/documentation/02-labels.md. - args.outputs.primitives << args.state.click_ripples + - args.outputs.sprites: An array. The values generate a sprite. + The parameters are [X, Y, WIDTH, HEIGHT, IMAGE PATH] + For more information about sprites, go to mygame/documentation/05-sprites.md. - # render a mouse cursor since we have the OS cursor hidden - args.outputs.primitives << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 } - end + - args.outputs.solids: An array. The values generate a solid. + The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE] + For more information about solids, go to mygame/documentation/03-solids-and-borders.md. - # Alrighty! This is where all the fun happens - def input args - # if the mouse is clicked and not item is currently being held - # args.state.held_item is nil when the game starts. - # If the player clicks, the property args.inputs.mouse.click will - # be a non nil value, we don't want to process any of the code here - # if the mouse hasn't been clicked - return if !args.inputs.mouse.click + - args.outputs.lines: An array. The values generate a line. + The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE] + For more information about lines, go to mygame/documentation/04-lines.md. - # if a click occurred, add a ripple to the ripple queue - args.state.click_ripples << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 } + - args.state.new_entity: Used when we want to create a new object, like a sprite or button. + In this sample app, new_entity is used to create a new button that clears the grid. + (Remember, you can use state to define ANY property and it will be retained across frames.) - # if the mouse has been clicked, and no item is currently held... - if !args.state.held_item - # see if any of the items intersect the pointer using the inside_rect? method - # the find method will either return the first object that returns true - # for the match clause, or it'll return nil if nothing matches the match clause - found = args.state.items.find do |item| - # for each item in args.state.items, run the following boolean check - args.inputs.mouse.click.point.inside_rect?(item) - end + =end - # if an item intersects the mouse pointer, then set the item's location to :held and - # set args.state.held_item to the item for later reference - if found - args.state.held_item = found - found[:location] = :held - end + # This sample app shows an empty grid that the user can paint in. There are different image tiles that + # the user can use to fill the grid, and the "Clear" button can be pressed to clear the grid boxes. - # if the mouse is clicked and an item is currently beign held.... - elsif args.state.held_item - # determine if a slot within the craft area was clicked - craft_area = args.state.craft_area.find { |a| args.inputs.mouse.click.point.inside_rect? a } + class TileEditor + attr_accessor :inputs, :state, :outputs, :grid, :args - # also determine if a slot within the inventory area was clicked - inventory_area = args.state.inventory_area.find { |a| args.inputs.mouse.click.point.inside_rect? a } + # Runs all the methods necessary for the game to function properly. + def tick + defaults + render + check_click + draw_buttons + end - # if the click was within a craft area - if craft_area - # check to see if an item is already there and ignore the click if an item is found - # item_at_craft_slot is a helper method that returns an item or nil for a given oridinal - # position - item_already_there = item_at_craft_slot args, craft_area[:ordinal_x], craft_area[:ordinal_y] + # Sets default values + # Initialization only happens in the first frame + # NOTE: The values of some of these variables may seem confusingly large at first. + # The gridSize is 1600 but it seems a lot smaller on the screen, for example. + # But keep in mind that by using the "W", "A", "S", and "D" keys, you can + # move the grid's view in all four directions for more grid spaces. + def defaults + state.tileCords ||= [] + state.tileQuantity ||= 6 + state.tileSize ||= 50 + state.tileSelected ||= 1 + state.tempX ||= 50 + state.tempY ||= 500 + state.speed ||= 4 + state.centerX ||= 4000 + state.centerY ||= 4000 + state.originalCenter ||= [state.centerX, state.centerY] + state.gridSize ||= 1600 + state.lineQuantity ||= 50 + state.increment ||= state.gridSize / state.lineQuantity + state.gridX ||= [] + state.gridY ||= [] + state.filled_squares ||= [] + state.grid_border ||= [390, 140, 500, 500] - # if an item *doesn't* exist in the craft area - if !item_already_there - # if the quantity they are currently holding is greater than 1 - if args.state.held_item[:quantity] > 1 - # remove one item (creating a seperate item of the same type), and place it - # at the oridinal position and location of the craft area - # the .merge method on Hash creates a new Hash, but updates any values - # passed as arguments to merge - new_item = args.state.held_item.merge(quantity: 1, - location: :craft, - ordinal_x: craft_area[:ordinal_x], - ordinal_y: craft_area[:ordinal_y]) + get_grid unless state.tempX == 0 # calls get_grid in the first frame only + determineTileCords unless state.tempX == 0 # calls determineTileCords in first frame + state.tempX = 0 # sets tempX to 0; the two methods aren't called again + end - # after the item is crated, place it into the args.state.items collection - args.state.items << new_item + # Calculates the placement of lines or separators in the grid + def get_grid + curr_x = state.centerX - (state.gridSize / 2) # starts at left of grid + deltaX = state.gridSize / state.lineQuantity # finds distance to place vertical lines evenly through width of grid + (state.lineQuantity + 2).times do + state.gridX << curr_x # adds curr_x to gridX collection + curr_x += deltaX # increment curr_x by the distance between vertical lines + end - # then subtract one from the held item - args.state.held_item[:quantity] -= 1 + curr_y = state.centerY - (state.gridSize / 2) # starts at bottom of grid + deltaY = state.gridSize / state.lineQuantity # finds distance to place horizontal lines evenly through height of grid + (state.lineQuantity + 2).times do + state.gridY << curr_y # adds curr_y to gridY collection + curr_y += deltaY # increments curr_y to distance between horizontal lines + end + end - # if the craft area is available and there is only one item being held - elsif args.state.held_item[:quantity] == 1 - # instead of creating any new items just set the location of the held item - # to the oridinal position of the craft area, and then nil out the - # held item state so that a new item can be picked up - args.state.held_item[:location] = :craft - args.state.held_item[:ordinal_x] = craft_area[:ordinal_x] - args.state.held_item[:ordinal_y] = craft_area[:ordinal_y] - args.state.held_item = nil - end + # Determines coordinate positions of patterned tiles (on the left side of the grid) + def determineTileCords + state.tempCounter ||= 1 # initializes tempCounter to 1 + state.tileQuantity.times do # there are 6 different kinds of tiles + state.tileCords += [[state.tempX, state.tempY, state.tempCounter]] # adds tile definition to collection + state.tempX += 75 # increments tempX to put horizontal space between the patterned tiles + state.tempCounter += 1 # increments tempCounter + if state.tempX > 200 # if tempX exceeds 200 pixels + state.tempX = 50 # a new row of patterned tiles begins + state.tempY -= 75 # the new row is 75 pixels lower than the previous row end + end + end - # if the selected area is an inventory area (as opposed to within the craft area) - elsif inventory_area + # Outputs objects (grid, tiles, etc) onto the screen + def render + outputs.sprites << state.tileCords.map do # outputs tileCords collection using images in sprites folder + |x, y, order| + [x, y, state.tileSize, state.tileSize, 'sprites/image' + order.to_s + ".png"] + end + outputs.solids << [0, 0, 1280, 720, 255, 255, 255] # outputs white background + add_grid # outputs grid + print_title # outputs title and current tile pattern + end - # check to see if there is already an item in that inventory slot - # the item_at_inventory_slot helper method returns an item or nil - item_already_there = item_at_inventory_slot args, inventory_area[:ordinal_x], inventory_area[:ordinal_y] + # Creates a grid by outputting vertical and horizontal grid lines onto the screen. + # Outputs sprites for the filled_squares collection onto the screen. + def add_grid - # if there is already an item there, and the item types/id match - if item_already_there && item_already_there[:id] == args.state.held_item[:id] - # then merge the item quantities - held_quantity = args.state.held_item[:quantity] - item_already_there[:quantity] += held_quantity + # Outputs the grid's border. + outputs.borders << state.grid_border + temp = 0 - # remove the item being held from the items collection (since it's quantity is now 0) - args.state.items.reject! { |i| i[:location] == :held } + # Before looking at the code that outputs the vertical and horizontal lines in the + # grid, take note of the fact that: + # grid_border[1] refers to the border's bottom line (running horizontally), + # grid_border[2] refers to the border's top line (running (horizontally), + # grid_border[0] refers to the border's left line (running vertically), + # and grid_border[3] refers to the border's right line (running vertically). - # nil out the held_item so a new item can be picked up - args.state.held_item = nil + # [2] + # ---------- + # | | + # [0] | | [3] + # | | + # ---------- + # [1] - # if there currently isn't an item there, then put the held item in the slot - elsif !item_already_there - args.state.held_item[:location] = :inventory - args.state.held_item[:ordinal_x] = inventory_area[:ordinal_x] - args.state.held_item[:ordinal_y] = inventory_area[:ordinal_y] + # Calculates the positions and outputs the x grid lines in the color gray. + state.gridX.map do # perform an action on all elements of the gridX collection + |x| + temp += 1 # increment temp - # nil out the held_item so a new item can be picked up - args.state.held_item = nil + # if x's value is greater than (or equal to) the x value of the border's left side + # and less than (or equal to) the x value of the border's right side + if x >= state.centerX - (state.grid_border[2] / 2) && x <= state.centerX + (state.grid_border[2] / 2) + delta = state.centerX - 640 + # vertical lines have the same starting and ending x positions + # starting y and ending y positions lead from the bottom of the border to the top of the border + outputs.lines << [x - delta, state.grid_border[1], x - delta, state.grid_border[1] + state.grid_border[2], 150, 150, 150] # sets definition of vertical line and outputs it end end - end - end + temp = 0 - # the calc method is executed after input - def calc args - # make sure that the real position of the inventory - # items are updated every frame to ensure that they - # are placed correctly given their location and oridinal positions - # instead of using .map, here we use .each (since we are not returning a new item and just updating the items in place) - args.state.items.each do |item| - # based on the location of the item, invoke the correct pixel conversion method - if item[:location] == :inventory - set_inventory_position args, item - elsif item[:location] == :craft - set_craft_position args, item - elsif item[:location] == :held - # if the item is held, center the item around the mouse pointer - args.state.held_item.x = args.inputs.mouse.x - args.state.held_item.w.half - args.state.held_item.y = args.inputs.mouse.y - args.state.held_item.h.half + # Calculates the positions and outputs the y grid lines in the color gray. + state.gridY.map do # perform an action on all elements of the gridY collection + |y| + temp += 1 # increment temp + + # if y's value is greater than (or equal to) the y value of the border's bottom side + # and less than (or equal to) the y value of the border's top side + if y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2) + delta = state.centerY - 393 + # horizontal lines have the same starting and ending y positions + # starting x and ending x positions lead from the left side of the border to the right side of the border + outputs.lines << [state.grid_border[0], y - delta, state.grid_border[0] + state.grid_border[3], y - delta, 150, 150, 150] # sets definition of horizontal line and outputs it + end end + + # Sets values and outputs sprites for the filled_squares collection. + state.filled_squares.map do # perform an action on every element of the filled_squares collection + |x, y, w, h, sprite| + # if x's value is greater than (or equal to) the x value of 17 pixels to the left of the border's left side + # and less than (or equal to) the x value of the border's right side + # and y's value is greater than (or equal to) the y value of the border's bottom side + # and less than (or equal to) the y value of 25 pixels above the border's top side + # NOTE: The allowance of 17 pixels and 25 pixels is due to the fact that a grid box may be slightly cut off or + # not entirely visible in the grid's view (until it is moved using "W", "A", "S", "D") + if x >= state.centerX - (state.grid_border[2] / 2) - 17 && x <= state.centerX + (state.grid_border[2] / 2) && + y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2) + 25 + # calculations done to place sprites in grid spaces that are meant to filled in + # mess around with the x and y values and see how the sprite placement changes + outputs.sprites << [x - state.centerX + 630, y - state.centerY + 360, w, h, sprite] + end + end + + # outputs a white solid along the left side of the grid (change the color and you'll be able to see it against the white background) + # state.increment subtracted in x parameter because solid's position is denoted by bottom left corner + # state.increment subtracted in y parameter to avoid covering the title label + outputs.primitives << [state.grid_border[0] - state.increment, + state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2), + 255, 255, 255].solid + + # outputs a white solid along the right side of the grid + # state.increment subtracted from y parameter to avoid covering title label + outputs.primitives << [state.grid_border[0] + state.grid_border[2], + state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2), + 255, 255, 255].solid + + # outputs a white solid along the bottom of the grid + # state.increment subtracted from y parameter to avoid covering last row of grid boxes + outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] - state.increment, + state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid + + # outputs a white solid along the top of the grid + outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] + state.grid_border[3], + state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid + end - # for each hash/sprite in the click ripples queue, - # expand its size by 20 percent and decrease its alpha - # by 10. - args.state.click_ripples.each do |ripple| - delta_w = ripple.w * 1.2 - ripple.w - delta_h = ripple.h * 1.2 - ripple.h - ripple.x -= delta_w.half - ripple.y -= delta_h.half - ripple.w += delta_w - ripple.h += delta_h - ripple.a -= 10 + # Outputs title and current tile pattern + def print_title + outputs.labels << [640, 700, 'Mouse to Place Tile, WASD to Move Around', 7, 1] # title label + outputs.lines << horizontal_separator(660, 0, 1280) # outputs horizontal separator + outputs.labels << [1050, 500, 'Current:', 3, 1] # outputs Current label + outputs.sprites << [1110, 474, state.tileSize / 2, state.tileSize / 2, 'sprites/image' + state.tileSelected.to_s + ".png"] # outputs sprite of current tile pattern using images in sprites folder; output is half the size of a tile end - # remove any items from the collection where the alpha value is less than equal to - # zero using the reject! method (reject with an exclamation point at the end changes the - # array value in place, while reject without the exclamation point returns a new array). - args.state.click_ripples.reject! { |ripple| ripple.a <= 0 } - end + # Sets the starting position, ending position, and color for the horizontal separator. + def horizontal_separator y, x, x2 + [x, y, x2, y, 150, 150, 150] # definition of separator; horizontal line means same starting/ending y + end - # helper function for finding an item at a craft slot - def item_at_craft_slot args, ordinal_x, ordinal_y - args.state.items.find { |i| i[:location] == :craft && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y } - end + # Checks if the mouse is being clicked or dragged + def check_click + if inputs.keyboard.key_down.r # if the "r" key is pressed down + $dragon.reset + end - # helper function for finding an item at an inventory slot - def item_at_inventory_slot args, ordinal_x, ordinal_y - args.state.items.find { |i| i[:location] == :inventory && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y } - end + if inputs.mouse.down #is mouse up or down? + state.mouse_held = true + if inputs.mouse.position.x < state.grid_border[0] # if mouse's x position is inside the grid's borders + state.tileCords.map do # perform action on all elements of tileCords collection + |x, y, order| + # if mouse's x position is greater than (or equal to) the starting x position of a tile + # and the mouse's x position is also less than (or equal to) the ending x position of that tile, + # and the mouse's y position is greater than (or equal to) the starting y position of that tile, + # and the mouse's y position is also less than (or equal to) the ending y position of that tile, + # (BASICALLY, IF THE MOUSE'S POSITION IS WITHIN THE STARTING AND ENDING POSITIONS OF A TILE) + if inputs.mouse.position.x >= x && inputs.mouse.position.x <= x + state.tileSize && + inputs.mouse.position.y >= y && inputs.mouse.position.y <= y + state.tileSize + state.tileSelected = order # that tile is selected + end + end + end + elsif inputs.mouse.up # otherwise, if the mouse is in the "up" state + state.mouse_held = false # mouse is not held down or dragged + state.mouse_dragging = false + end - # helper function that creates a visual representation of an item - def item_prefab args, item, should_highlight, mouse - return nil unless item + if state.mouse_held && # mouse needs to be down + !inputs.mouse.click && # must not be first click + ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15 || + (inputs.mouse.previous_click.point.y - inputs.mouse.position.y).abs > 15) # Need to move 15 pixels before "drag" + state.mouse_dragging = true + end - overlay = nil + # if mouse is clicked inside grid's border, search_lines method is called with click input type + if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border)) + search_lines(inputs.mouse.click.point, :click) - x = item.x - y = item.y - w = item.w - h = item.h + # if mouse is dragged inside grid's border, search_lines method is called with drag input type + elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border)) + search_lines(inputs.mouse.position, :drag) + end - if should_highlight && mouse.point.inside_rect?(item) - overlay = { x: x, y: y, w: w, h: h, path: "sprites/square-blue.png", a: 130, } + # Changes grid's position on screen by moving it up, down, left, or right. + + # centerX is incremented by speed if the "d" key is pressed and if that sum is less than + # the original left side of the center plus half the grid, minus half the top border of grid. + # MOVES GRID RIGHT (increasing x) + state.centerX += state.speed if inputs.keyboard.key_held.d && + (state.centerX + state.speed) < state.originalCenter[0] + (state.gridSize / 2) - (state.grid_border[2] / 2) + # centerX is decremented by speed if the "a" key is pressed and if that difference is greater than + # the original left side of the center minus half the grid, plus half the top border of grid. + # MOVES GRID LEFT (decreasing x) + state.centerX -= state.speed if inputs.keyboard.key_held.a && + (state.centerX - state.speed) > state.originalCenter[0] - (state.gridSize / 2) + (state.grid_border[2] / 2) + # centerY is incremented by speed if the "w" key is pressed and if that sum is less than + # the original bottom of the center plus half the grid, minus half the right border of grid. + # MOVES GRID UP (increasing y) + state.centerY += state.speed if inputs.keyboard.key_held.w && + (state.centerY + state.speed) < state.originalCenter[1] + (state.gridSize / 2) - (state.grid_border[3] / 2) + # centerY is decremented by speed if the "s" key is pressed and if the difference is greater than + # the original bottom of the center minus half the grid, plus half the right border of grid. + # MOVES GRID DOWN (decreasing y) + state.centerY -= state.speed if inputs.keyboard.key_held.s && + (state.centerY - state.speed) > state.originalCenter[1] - (state.gridSize / 2) + (state.grid_border[3] / 2) end - [ - # sprites are hashes with a path property, this is the main sprite - { x: x, y: y, w: args.state.sprite_size, h: args.state.sprite_size, path: item[:path], }, + # Performs calculations on the gridX and gridY collections, and sets values. + # Sets the definition of a grid box, including the image that it is filled with. + def search_lines (point, input_type) + point.x += state.centerX - 630 # increments x and y + point.y += state.centerY - 360 + findX = 0 + findY = 0 + increment = state.gridSize / state.lineQuantity # divides grid by number of separators - # this represents the black area in the bottom right corner of the main sprite so that the - # quantity is visible - { x: x + 55, y: y, w: 25, h: 25, path: "sprites/square-black.png", }, # sprites are hashes with a path property + state.gridX.map do # perform an action on every element of collection + |x| + # findX increments x by 10 if point.x is less than that sum and findX is currently 0 + findX = x + 10 if point.x < (x + 10) && findX == 0 + end - # labels are hashes with a text property - { x: x + 56, y: y + 22, text: "#{item[:quantity]}", r: 255, g: 255, b: 255, }, + state.gridY.map do + |y| + # findY is set to y if point.y is less than that value and findY is currently 0 + findY = y if point.y < (y) && findY == 0 + end + # position of a box is denoted by bottom left corner, which is why the increment is being subtracted + grid_box = [findX - (increment.ceil), findY - (increment.ceil), increment.ceil, increment.ceil, + "sprites/image" + state.tileSelected.to_s + ".png"] # sets sprite definition - # this is the mouse overlay, if the overlay isn't applicable, then this value will be nil (nil values will not be rendered) - overlay - ] - end + if input_type == :click # if user clicks their mouse + if state.filled_squares.include? grid_box # if grid box is already filled in + state.filled_squares.delete grid_box # box is cleared and removed from filled_squares + else + state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares + end + elsif input_type == :drag # if user drags mouse + unless state.filled_squares.include? grid_box # unless grid box dragged over is already filled in + state.filled_squares << grid_box # box is filled in and added to filled_squares + end + end + end - # helper function for deriving the position of an item within inventory - def set_inventory_position args, item - item.x = args.state.inventory_border.x + item[:ordinal_x] * 80 - item.y = (args.state.inventory_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80 - item.w = 80 - item.h = 80 - end + # Creates a "Clear" button using labels and borders. + def draw_buttons + x, y, w, h = 390, 50, 240, 50 + state.clear_button ||= state.new_entity(:button_with_fade) - # helper function for deriving the position of an item within the craft area - def set_craft_position args, item - item.x = args.state.craft_border.x + item[:ordinal_x] * 80 - item.y = (args.state.craft_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80 - item.w = 80 - item.h = 80 - end + # x and y positions are set to display "Clear" label in center of the button + # Try changing first two parameters to simply x, y and see what happens to the text placement + state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] + state.clear_button.border ||= [x, y, w, h] # definition of button's border - # Any lines outside of a function will be executed when the file is reloaded. - # So every time you save main.rb, the game will be reset. - # Comment out the line below if you don't want this to happen. - $gtk.reset - -#+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 - # You can customize the buttons that show up in the Console. - class GTK::Console::Menu - # STEP 1: Override the custom_buttons function. - def custom_buttons - [ - (button id: :yay, - # row for button - row: 3, - # column for button - col: 10, - # text - text: "I AM CUSTOM", - # when clicked call the custom_button_clicked function - method: :custom_button_clicked), + # If the mouse is clicked inside the borders of the clear button + if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border) + state.clear_button.clicked_at = inputs.mouse.click.created_at # value is frame of mouse click + state.filled_squares.clear # filled squares collection is emptied (squares are cleared) + inputs.mouse.previous_click = nil # no previous click + end - (button id: :yay, - # row for button - row: 3, - # column for button - col: 9, - # text - text: "CUSTOM ALSO", - # when clicked call the custom_button_also_clicked function - method: :custom_button_also_clicked) - ] - end + outputs.labels << state.clear_button.label # outputs clear button + outputs.borders << state.clear_button.border - # STEP 2: Define the function that should be called. - def custom_button_clicked - log "* INFO: I AM CUSTOM was clicked!" + # When the clear button is clicked, the color of the button changes + # and the transparency changes, as well. If you change the time from + # 0.25.seconds to 1.25.seconds or more, the change will last longer. + if state.clear_button.clicked_at + outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)] + end end + end - def custom_button_also_clicked - log "* INFO: Custom Button Clicked at #{Kernel.global_tick_count}!" + $tile_editor = TileEditor.new - all_buttons_as_string = $gtk.console.menu.buttons.map do |b| - <<-S.strip - ** id: #{b[:id]} - :PROPERTIES: - :id: :#{b[:id]} - :method: :#{b[:method]} - :text: #{b[:text]} - :END: - S - end.join("\n") + def tick args + $tile_editor.inputs = args.inputs + $tile_editor.grid = args.grid + $tile_editor.args = args + $tile_editor.outputs = args.outputs + $tile_editor.state = args.state + $tile_editor.tick + tick_instructions args, "Roll your own tile editor. CLICK to select a sprite. CLICK in grid to place sprite. WASD to move around." + end - log <<-S - * INFO: Here are all the buttons: - #{all_buttons_as_string} - S + 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.escape + args.state.key_event_occurred = true end - end - def tick args - args.outputs.labels << [args.grid.center.x, args.grid.center.y, - "Open the DragonRuby Console to see the custom menu items.", - 0, 1] + 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 -* Dev Tools - Animation Creator Starting Point - main.rb +*** Lowrez - Nokia 3310 - main.rb #+begin_src ruby - # ./samples/99_genre_dev_tools/animation_creator_starting_point/app/main.rb - class OneBitLowrezPaint - attr_gtk - - def tick - outputs.background_color = [0, 0, 0] - defaults - render_instructions - render_canvas - render_buttons_frame_selection - render_animation_frame_thumbnails - render_animation - input_mouse_click - input_keyboard - calc_auto_export - calc_buttons_frame_selection - calc_animation_frames - process_queue_create_sprite - process_queue_reset_sprite - process_queue_update_rt_animation_frame - end + # ./samples/99_genre_lowrez/nokia_3310/app/main.rb + require 'app/nokia.rb' - def defaults - state.animation_frames_per_second = 12 - queues.create_sprite ||= [] - queues.reset_sprite ||= [] - queues.update_rt_animation_frame ||= [] + def tick args + # ======================================================================= + # ==== HELLO WORLD ====================================================== + # ======================================================================= + # Steps to get started: + # 1. ~def tick args~ is the entry point for your game. + # 2. There are quite a few code samples below, remove the "##" + # before each line and save the file to see the changes. + # 3. 0, 0 is in bottom left and 83, 47 is in top right corner. + # 4. Be sure to come to the discord channel if you need + # more help: [[http://discord.dragonruby.org]]. - if !state.animation_frames - state.animation_frames ||= [] - add_animation_frame_to_end - end + # Commenting and uncommenting code: + # - Add a "#" infront of lines to comment out code + # - Remove the "#" infront of lines to comment out code - state.last_mouse_down ||= 0 - state.last_mouse_up ||= 0 + # Invoke the hello_world subroutine/method + hello_world args # <---- add a "#" to the beginning of the line to stop running this subroutine/method. - state.buttons_frame_selection.left = 10 - state.buttons_frame_selection.top = grid.top - 10 - state.buttons_frame_selection.size = 20 + # ======================================================================= + # ==== HOW TO RENDER A LABEL ============================================ + # ======================================================================= - defaults_canvas_sprite + # Uncomment the line below to invoke the how_to_render_a_label subroutine/method. + # Note: The method is defined in this file with the signature ~def how_to_render_a_label args~ + # Scroll down to the method to see the details. - state.edit_mode ||= :drawing - end + # Remove the "#" at the beginning of the line below + # how_to_render_a_label args # <---- remove the "#" at the beginning of this line to run the method - def defaults_canvas_sprite - rt_canvas.size = 16 - rt_canvas.zoom = 30 - rt_canvas.width = rt_canvas.size * rt_canvas.zoom - rt_canvas.height = rt_canvas.size * rt_canvas.zoom - rt_canvas.sprite = { x: 0, - y: 0, - w: rt_canvas.width, - h: rt_canvas.height, - path: :rt_canvas }.center_inside_rect(x: 0, y: 0, w: 640, h: 720) - return unless state.tick_count == 1 + # ======================================================================= + # ==== HOW TO RENDER A FILLED SQUARE (SOLID) ============================ + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_render_solids args - outputs[:rt_canvas].width = rt_canvas.width - outputs[:rt_canvas].height = rt_canvas.height - outputs[:rt_canvas].sprites << (rt_canvas.size + 1).map_with_index do |x| - (rt_canvas.size + 1).map_with_index do |y| - path = 'sprites/square-white.png' - path = 'sprites/square-blue.png' if x == 7 || x == 8 - { x: x * rt_canvas.zoom, - y: y * rt_canvas.zoom, - w: rt_canvas.zoom, - h: rt_canvas.zoom, - path: path, - a: 50 } - end - end - end - def render_instructions - instructions = <<-S - * Instructions: - - All data is stored in the ~canvas~ directory. - - Hold ~d~ to set the edit mode to erase. - - Release ~d~ to set the edit mode drawing. - - Press ~a~ to added a frame to the end. - - Press ~b~ to select the previous frame. - - Press ~f~ to select the next frame. - - Press ~c~ to copy a frame. - - Press ~v~ to paste a copied frame into the selected frame. - - Press ~x~ to delete the currently selected frame. - - Press ~w~ to save the canvas and export all sprites. - - Press ~l~ to load the canvas. - S + # ======================================================================= + # ==== HOW TO RENDER AN UNFILLED SQUARE (BORDER) ======================== + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_render_borders args - instructions.strip.each_line.with_index do |l, i| - outputs.labels << { x: 840, y: 500 - (i * 20), text: "#{l}", - r: 180, g: 180, b: 180, size_enum: -3 } - end - end - def render_canvas - return if state.tick_count.zero? - outputs.sprites << rt_canvas.sprite - end + # ======================================================================= + # ==== HOW TO RENDER A LINE ============================================= + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_render_lines args - def render_buttons_frame_selection - args.outputs.primitives << state.buttons_frame_selection.items.map_with_index do |b, i| - 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 - selection_border = b.merge(r: 40, g: 40, b: 40).border + # ======================================================================= + # == HOW TO RENDER A SPRITE ============================================= + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_render_sprites args - if i == state.animation_frames_selected_index - selection_border = b.merge(r: 40, g: 230, b: 200).border - end - [selection_border, label] - end - end + # ======================================================================= + # ==== HOW TO MOVE A SPRITE BASED OFF OF USER INPUT ===================== + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_move_a_sprite args - def render_animation_frame_thumbnails - return if state.tick_count.zero? - outputs[:current_animation_frame].width = rt_canvas.size - outputs[:current_animation_frame].height = rt_canvas.size - outputs[:current_animation_frame].solids << selected_animation_frame[:pixels].map_with_index do |f, i| - { x: f.x, - y: f.y, - w: 1, - h: 1, r: 255, g: 255, b: 255 } - end + # ======================================================================= + # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ========================== + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_animate_a_sprite args - outputs.sprites << rt_canvas.sprite.merge(path: :current_animation_frame) - state.animation_frames.map_with_index do |animation_frame, animation_frame_index| - outputs.sprites << state.buttons_frame_selection[:items][animation_frame_index][:inner_rect] - .merge(path: animation_frame[:rt_name]) - end - end + # ======================================================================= + # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) =========================== + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_animate_a_sprite_sheet args - def render_animation - sprite_index = 0.frame_index count: state.animation_frames.length, - hold_for: 60 / state.animation_frames_per_second, - repeat: true - args.outputs.sprites << { x: 700 - 8, - y: 120, - w: 16, - h: 16, - path: (sprite_path sprite_index) } + # ======================================================================= + # ==== HOW TO DETERMINE COLLISION ============================================= + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_determine_collision args - args.outputs.sprites << { x: 700 - 16, - y: 230, - w: 32, - h: 32, - path: (sprite_path sprite_index) } - args.outputs.sprites << { x: 700 - 32, - y: 360, - w: 64, - h: 64, - path: (sprite_path sprite_index) } + # ======================================================================= + # ==== HOW TO CREATE BUTTONS ================================================== + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_create_buttons args - args.outputs.sprites << { x: 700 - 64, - y: 520, - w: 128, - h: 128, - path: (sprite_path sprite_index) } - end + # ==== The line below renders a debug grid, mouse information, and current tick + # render_debug args + end - def input_mouse_click - if inputs.mouse.up - state.last_mouse_up = state.tick_count - elsif inputs.mouse.moved && user_is_editing? - edit_current_animation_frame inputs.mouse.point - end + # ======================================================================= + # ==== HELLO WORLD ====================================================== + # ======================================================================= + def hello_world args + args.nokia.solids << { x: 0, y: 64, w: 10, h: 10, r: 255 } - return unless inputs.mouse.click + args.nokia.labels << { + x: 42, + y: 46, + text: "nokia 3310 jam 3", + size_enum: NOKIA_FONT_SM, + alignment_enum: 1, + r: 0, + g: 0, + b: 0, + a: 255, + font: NOKIA_FONT_PATH + } - clicked_frame_button = state.buttons_frame_selection.items.find do |b| - inputs.mouse.point.inside_rect? b - end + args.nokia.sprites << { + x: 42 - 10, + y: 26 - 10, + w: 20, + h: 20, + path: 'sprites/monochrome-ship.png', + a: 255, + angle: args.state.tick_count % 360 + } + end - if (clicked_frame_button) - state.animation_frames_selected_index = clicked_frame_button[:index] - end + # ======================================================================= + # ==== HOW TO RENDER A LABEL ============================================ + # ======================================================================= + def how_to_render_a_label args + # NOTE: Text is aligned from the TOP LEFT corner - if (inputs.mouse.point.inside_rect? rt_canvas.sprite) - state.last_mouse_down = state.tick_count - edit_current_animation_frame inputs.mouse.point - end - end + # Render an EXTRA LARGE/XL label (remove the "#" in front of each line below) + args.nokia.labels << { x: 0, y: 46, text: "Hello World", + size_enum: NOKIA_FONT_XL, + r: 0, g: 0, b: 0, a: 255, + font: NOKIA_FONT_PATH } - def input_keyboard - # w to save - if inputs.keyboard.key_down.w - t = Time.now - state.save_description = "Time: #{t} (#{t.to_i})" - gtk.serialize_state 'canvas/state.txt', state - gtk.serialize_state "tmp/canvas_backups/#{t.to_i}/state.txt", state - animation_frames.each_with_index do |animation_frame, i| - queues.update_rt_animation_frame << { index: i, - at: state.tick_count + i, - queue_sprite_creation: true } - queues.create_sprite << { index: i, - at: state.tick_count + animation_frames.length + i, - path_override: "tmp/canvas_backups/#{t.to_i}/sprite-#{i}.png" } - end - gtk.notify! "Canvas saved." - end + # Render a LARGE/LG label (remove the "#" in front of each line below) + args.nokia.labels << { x: 0, y: 29, text: "Hello World", + size_enum: NOKIA_FONT_LG, + r: 0, g: 0, b: 0, a: 255, + font: NOKIA_FONT_PATH } - # l to load - if inputs.keyboard.key_down.l - args.state = gtk.deserialize_state 'canvas/state.txt' - animation_frames.each_with_index do |a, i| - queues.update_rt_animation_frame << { index: i, - at: state.tick_count + i, - queue_sprite_creation: true } - end - gtk.notify! "Canvas loaded." - end + # Render a MEDIUM/MD label (remove the "#" in front of each line below) + args.nokia.labels << { x: 0, y: 16, text: "Hello World", + size_enum: NOKIA_FONT_MD, + r: 0, g: 0, b: 0, a: 255, + font: NOKIA_FONT_PATH } - # d to go into delete mode, release to paint - if inputs.keyboard.key_held.d - state.edit_mode = :erasing - gtk.notify! "Erasing." if inputs.keyboard.key_held.d == (state.tick_count - 1) - elsif inputs.keyboard.key_up.d - state.edit_mode = :drawing - gtk.notify! "Drawing." - end + # Render a SMALL/SM label (remove the "#" in front of each line below) + args.nokia.labels << { x: 0, y: 7, text: "Hello World", + size_enum: NOKIA_FONT_SM, + r: 0, g: 0, b: 0, a: 255, + font: NOKIA_FONT_PATH } - # a to add a frame to the end - if inputs.keyboard.key_down.a - queues.create_sprite << { index: state.animation_frames_selected_index, - at: state.tick_count } - queues.create_sprite << { index: state.animation_frames_selected_index + 1, - at: state.tick_count } - add_animation_frame_to_end - gtk.notify! "Frame added to end." - end + # You are provided args.nokia.default_label which returns a Hash that you + # can ~merge~ properties with + # Example 1 + args.nokia.labels << args.nokia + .default_label + .merge(text: "Default") - # c or t to copy - if (inputs.keyboard.key_down.c || inputs.keyboard.key_down.t) - state.clipboard = [selected_animation_frame[:pixels]].flatten - gtk.notify! "Current frame copied." - end + # Example 2 + args.nokia.labels << args.nokia + .default_label + .merge(x: 31, + text: "Default") + end - # v or q to paste - if (inputs.keyboard.key_down.v || inputs.keyboard.key_down.q) && state.clipboard - selected_animation_frame[:pixels] = [state.clipboard].flatten - queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, - at: state.tick_count, - queue_sprite_creation: true } - gtk.notify! "Pasted." - end + # ============================================================================= + # ==== HOW TO RENDER FILLED SQUARES (SOLIDS) ================================== + # ============================================================================= + def how_to_render_solids args + # Render a square at 0, 0 with a width and height of 1 + args.nokia.solids << { x: 0, y: 0, w: 1, h: 1 } - # f to go forward/next frame - if (inputs.keyboard.key_down.f) - if (state.animation_frames_selected_index == (state.animation_frames.length - 1)) - state.animation_frames_selected_index = 0 - else - state.animation_frames_selected_index += 1 - end - gtk.notify! "Next frame." - end + # Render a square at 1, 1 with a width and height of 2 + args.nokia.solids << { x: 1, y: 1, w: 2, h: 2 } - # b to go back/previous frame - if (inputs.keyboard.key_down.b) - if (state.animation_frames_selected_index == 0) - state.animation_frames_selected_index = state.animation_frames.length - 1 - else - state.animation_frames_selected_index -= 1 - end - gtk.notify! "Previous frame." - end + # Render a square at 3, 3 with a width and height of 3 + args.nokia.solids << { x: 3, y: 3, w: 3, h: 3 } - # x to delete frame - if (inputs.keyboard.key_down.x) && animation_frames.length > 1 - state.clipboard = selected_animation_frame[:pixels] - state.animation_frames = animation_frames.find_all { |v| v[:index] != state.animation_frames_selected_index } - if state.animation_frames_selected_index >= state.animation_frames.length - state.animation_frames_selected_index = state.animation_frames.length - 1 - end - gtk.notify! "Frame deleted." - end - end + # Render a square at 6, 6 with a width and height of 4 + args.nokia.solids << { x: 6, y: 6, w: 4, h: 4 } + end - def calc_auto_export - return if user_is_editing? - return if state.last_mouse_up.elapsed_time != 30 - # auto export current animation frame if there is no editing for 30 ticks - queues.create_sprite << { index: state.animation_frames_selected_index, - at: state.tick_count } - end + # ============================================================================= + # ==== HOW TO RENDER UNFILLED SQUARES (BORDERS) =============================== + # ============================================================================= + def how_to_render_borders args + # Render a square at 0, 0 with a width and height of 3 + args.nokia.borders << { x: 0, y: 0, w: 3, h: 3, a: 255 } - def calc_buttons_frame_selection - state.buttons_frame_selection.items = animation_frames.length.map_with_index do |i| - { x: state.buttons_frame_selection.left + i * state.buttons_frame_selection.size, - y: state.buttons_frame_selection.top - state.buttons_frame_selection.size, - inner_rect: { - x: (state.buttons_frame_selection.left + 2) + i * state.buttons_frame_selection.size, - y: (state.buttons_frame_selection.top - state.buttons_frame_selection.size + 2), - w: 16, - h: 16, - }, - w: state.buttons_frame_selection.size, - h: state.buttons_frame_selection.size, - index: i } - end - end + # Render a square at 3, 3 with a width and height of 3 + args.nokia.borders << { x: 3, y: 3, w: 4, h: 4, a: 255 } - def calc_animation_frames - animation_frames.each_with_index do |animation_frame, i| - animation_frame[:index] = i - animation_frame[:rt_name] = "animation_frame_#{i}" - end - end + # Render a square at 5, 5 with a width and height of 4 + args.nokia.borders << { x: 7, y: 7, w: 5, h: 5, a: 255 } + end - def process_queue_create_sprite - sprites_to_create = queues.create_sprite - .find_all { |h| h[:at].elapsed? } + # ============================================================================= + # ==== HOW TO RENDER A LINE =================================================== + # ============================================================================= + def how_to_render_lines args + # Render a horizontal line at the bottom + args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 0 } - queues.create_sprite = queues.create_sprite - sprites_to_create + # Render a vertical line at the left + args.nokia.lines << { x: 0, y: 0, x2: 0, y2: 47 } - sprites_to_create.each do |h| - export_animation_frame h[:index], h[:path_override] - end - end + # Render a diagonal line starting from the bottom left and going to the top right + args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 47 } + end - def process_queue_reset_sprite - sprites_to_reset = queues.reset_sprite - .find_all { |h| h[:at].elapsed? } + # ============================================================================= + # == HOW TO RENDER A SPRITE =================================================== + # ============================================================================= + def how_to_render_sprites args + # Loop 10 times and create 10 sprites in 10 positions + # Render a sprite at the bottom left with a width and height of 5 and a path of 'sprites/monochrome-ship.png' + 10.times do |i| + args.nokia.sprites << { + x: i * 8.4, + y: i * 4.8, + w: 5, + h: 5, + path: 'sprites/monochrome-ship.png' + } + end - queues.reset_sprite -= sprites_to_reset + # Given an array of positions create sprites + positions = [ + { x: 20, y: 32 }, + { x: 45, y: 15 }, + { x: 72, y: 23 }, + ] - sprites_to_reset.each { |h| gtk.reset_sprite (sprite_path h[:index]) } + positions.each do |position| + # use Ruby's ~Hash#merge~ function to create a sprite + args.nokia.sprites << position.merge(path: 'sprites/monochrome-ship.png', + w: 5, + h: 5) end + end - def process_queue_update_rt_animation_frame - animation_frames_to_update = queues.update_rt_animation_frame - .find_all { |h| h[:at].elapsed? } + # ============================================================================= + # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ========================== + # ============================================================================= + def how_to_animate_a_sprite args + # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds + start_animation_on_tick = 180 - queues.update_rt_animation_frame -= animation_frames_to_update + # STEP 2: Get the frame_index given the start tick. + sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites? + hold_for: 8, # how long to hold each sprite? + repeat: true # should it repeat? - animation_frames_to_update.each do |h| - update_animation_frame_render_target animation_frames[h[:index]] + # STEP 3: frame_index will return nil if the frame hasn't arrived yet + if sprite_index + # if the sprite_index is populated, use it to determine the sprite path and render it + sprite_path = "sprites/explosion-#{sprite_index}.png" + args.nokia.sprites << { x: 42 - 16, + y: 47 - 32, + w: 32, + h: 32, + path: sprite_path } + else + # if the sprite_index is nil, render a countdown instead + countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1) - if h[:queue_sprite_creation] - queues.create_sprite << { index: h[:index], - at: state.tick_count + 1 } - end - end + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 18, + text: "Count Down: #{countdown_in_seconds.to_sf}", + alignment_enum: 0) end - def update_animation_frame_render_target animation_frame - return if !animation_frame + # render the current tick and the resolved sprite index + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 11, + text: "Tick: #{args.state.tick_count}") + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 5, + text: "sprite_index: #{sprite_index}") + end - outputs[animation_frame[:rt_name]].width = state.rt_canvas.size - outputs[animation_frame[:rt_name]].height = state.rt_canvas.size - outputs[animation_frame[:rt_name]].solids << animation_frame[:pixels].map do |f| - { x: f.x, - y: f.y, - w: 1, - h: 1, r: 255, g: 255, b: 255 } - end - end + # ============================================================================= + # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) ================================= + # ============================================================================= + def how_to_animate_a_sprite_sheet args + # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds + start_animation_on_tick = 180 - def animation_frames - state.animation_frames - end + # STEP 2: Get the frame_index given the start tick. + sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites? + hold_for: 8, # how long to hold each sprite? + repeat: true # should it repeat? - def add_animation_frame_to_end - animation_frames << { - index: animation_frames.length, - pixels: [], - rt_name: "animation_frame_#{animation_frames.length}" + # STEP 3: frame_index will return nil if the frame hasn't arrived yet + if sprite_index + # if the sprite_index is populated, use it to determine the source rectangle and render it + args.nokia.sprites << { + x: 42 - 16, + y: 47 - 32, + w: 32, + h: 32, + path: "sprites/explosion-sheet.png", + source_x: 32 * sprite_index, + source_y: 0, + source_w: 32, + source_h: 32 } + else + # if the sprite_index is nil, render a countdown instead + countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1) - state.animation_frames_selected_index = (animation_frames.length - 1) - queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, - at: state.tick_count, - queue_sprite_creation: true } - end - - def sprite_path i - "canvas/sprite-#{i}.png" + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 18, + text: "Count Down: #{countdown_in_seconds.to_sf}", + alignment_enum: 0) end - def export_animation_frame i, path_override = nil - return if !state.animation_frames[i] + # render the current tick and the resolved sprite index + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 11, + text: "tick: #{args.state.tick_count}") + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 5, + text: "sprite_index: #{sprite_index}") + end - outputs.screenshots << state.buttons_frame_selection - .items[i][:inner_rect] - .merge(path: path_override || (sprite_path i)) + # ============================================================================= + # ==== HOW TO STORE STATE, ACCEPT INPUT, AND RENDER SPRITE BASED OFF OF STATE = + # ============================================================================= + def how_to_move_a_sprite args + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 46, text: "Use Arrow Keys", + alignment_enum: 1) - outputs.screenshots << state.buttons_frame_selection - .items[i][:inner_rect] - .merge(path: "tmp/sprite_backups/#{Time.now.to_i}-sprite-#{i}.png") + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 41, text: "Or WASD", + alignment_enum: 1) - queues.reset_sprite << { index: i, at: state.tick_count } - end + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 36, text: "Or Click", + alignment_enum: 1) - def selected_animation_frame - state.animation_frames[state.animation_frames_selected_index] - end + # set the initial values for x and y using ||= ("or equal operator") + args.state.ship.x ||= 0 + args.state.ship.y ||= 0 - def edit_current_animation_frame point - draw_area_point = (to_draw_area point) - if state.edit_mode == :drawing && (!selected_animation_frame[:pixels].include? draw_area_point) - selected_animation_frame[:pixels] << draw_area_point - queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, - at: state.tick_count, - queue_sprite_creation: !user_is_editing? } - elsif state.edit_mode == :erasing && (selected_animation_frame[:pixels].include? draw_area_point) - selected_animation_frame[:pixels] = selected_animation_frame[:pixels].reject { |p| p == draw_area_point } - queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, - at: state.tick_count, - queue_sprite_creation: !user_is_editing? } - end + # if a mouse click occurs, update the ship's x and y to be the location of the click + if args.nokia.mouse_click + args.state.ship.x = args.nokia.mouse_click.x + args.state.ship.y = args.nokia.mouse_click.y end - def user_is_editing? - state.last_mouse_down > state.last_mouse_up + # if a or left arrow is pressed/held, decrement the ships x position + if args.nokia.keyboard.left + args.state.ship.x -= 1 end - def to_draw_area point - x, y = point - x -= rt_canvas.sprite.x - y -= rt_canvas.sprite.y - { x: x.idiv(rt_canvas.zoom), - y: y.idiv(rt_canvas.zoom) } + # if d or right arrow is pressed/held, increment the ships x position + if args.nokia.keyboard.right + args.state.ship.x += 1 end - def rt_canvas - state.rt_canvas ||= state.new_entity(:rt_canvas) + # if s or down arrow is pressed/held, decrement the ships y position + if args.nokia.keyboard.down + args.state.ship.y -= 1 end - def queues - state.queues ||= state.new_entity(:queues) + # if w or up arrow is pressed/held, increment the ships y position + if args.nokia.keyboard.up + args.state.ship.y += 1 end - end - $game = OneBitLowrezPaint.new - - def tick args - $game.args = args - $game.tick + # render the sprite to the screen using the position stored in args.state.ship + args.nokia.sprites << { + x: args.state.ship.x, + y: args.state.ship.y, + w: 5, + h: 5, + path: 'sprites/monochrome-ship.png', + # parameters beyond this point are optional + angle: 0, # Note: rotation angle is denoted in degrees NOT radians + r: 255, + g: 255, + b: 255, + a: 255 + } end - # $gtk.reset - -#+end_src - -* Dev Tools - Tile Editor Starting Point - main.rb -#+begin_src ruby - # ./samples/99_genre_dev_tools/tile_editor_starting_point/app/main.rb - =begin - - APIs listing that haven't been encountered in previous sample apps: - - - to_s: Returns a string representation of an object. - For example, if we had - 500.to_s - the string "500" would be returned. - Similar to to_i, which returns an integer representation of an object. - - - Ceil: Returns an integer number greater than or equal to the original - with no decimal. - - Reminders: + # ======================================================================= + # ==== HOW TO DETERMINE COLLISION ======================================= + # ======================================================================= + def how_to_determine_collision args + # Render the instructions + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 46, text: "Click Anywhere", + alignment_enum: 1) - - ARRAY#inside_rect?: Returns true or false depending on if the point is inside a rect. + # if a mouse click occurs: + # - set ship_one if it isn't set + # - set ship_two if it isn't set + # - otherwise reset ship one and ship two + if args.nokia.mouse_click + # is ship_one set? + if !args.state.ship_one + args.state.ship_one = { x: args.nokia.mouse_click.x - 5, + y: args.nokia.mouse_click.y - 5, + w: 10, + h: 10 } + # is ship_one set? + elsif !args.state.ship_two + args.state.ship_two = { x: args.nokia.mouse_click.x - 5, + y: args.nokia.mouse_click.y - 5, + w: 10, + h: 10 } + # should we reset? + else + args.state.ship_one = nil + args.state.ship_two = nil + end + end - - args.outputs.labels: An array. The values generate a label. - The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] - For more information about labels, go to mygame/documentation/02-labels.md. + # render ship one if it's set + if args.state.ship_one + # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha + # render ship one + args.nokia.sprites << args.state.ship_one.merge(path: 'sprites/monochrome-ship.png') + end - - args.outputs.sprites: An array. The values generate a sprite. - The parameters are [X, Y, WIDTH, HEIGHT, IMAGE PATH] - For more information about sprites, go to mygame/documentation/05-sprites.md. + if args.state.ship_two + # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha + # render ship two + args.nokia.sprites << args.state.ship_two.merge(path: 'sprites/monochrome-ship.png') + end - - args.outputs.solids: An array. The values generate a solid. - The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE] - For more information about solids, go to mygame/documentation/03-solids-and-borders.md. + # if both ship one and ship two are set, then determine collision + if args.state.ship_one && args.state.ship_two + # collision is determined using the intersect_rect? method + if args.state.ship_one.intersect_rect? args.state.ship_two + # if collision occurred, render the words collision! + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 5, + text: "Collision!", + alignment_enum: 1) + else + # if collision occurred, render the words no collision. + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 5, + text: "No Collision.", + alignment_enum: 1) + end + else + # if both ship one and ship two aren't set, then render -- + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 6, + text: "--", + alignment_enum: 1) + end + end - - args.outputs.lines: An array. The values generate a line. - The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE] - For more information about lines, go to mygame/documentation/04-lines.md. + # ============================================================================= + # ==== HOW TO CREATE BUTTONS ================================================== + # ============================================================================= + def how_to_create_buttons args + # Define a button style + args.state.button_style = { w: 82, h: 10, } - - args.state.new_entity: Used when we want to create a new object, like a sprite or button. - In this sample app, new_entity is used to create a new button that clears the grid. - (Remember, you can use state to define ANY property and it will be retained across frames.) + # Render instructions + args.state.button_message ||= "Press a Button!" + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 82, + text: args.state.button_message, + alignment_enum: 1) - =end - # This sample app shows an empty grid that the user can paint in. There are different image tiles that - # the user can use to fill the grid, and the "Clear" button can be pressed to clear the grid boxes. + # Creates button one using a border and a label + args.state.button_one_border = args.state.button_style.merge( x: 1, y: 32) + args.nokia.borders << args.state.button_one_border + args.nokia.labels << args.nokia + .default_label + .merge(x: args.state.button_one_border.x + 2, + y: args.state.button_one_border.y + NOKIA_FONT_SM_HEIGHT + 2, + text: "Button One") - class TileEditor - attr_accessor :inputs, :state, :outputs, :grid, :args + # Creates button two using a border and a label + args.state.button_two_border = args.state.button_style.merge( x: 1, y: 20) - # Runs all the methods necessary for the game to function properly. - def tick - defaults - render - check_click - draw_buttons - end + args.nokia.borders << args.state.button_two_border + args.nokia.labels << args.nokia + .default_label + .merge(x: args.state.button_two_border.x + 2, + y: args.state.button_two_border.y + NOKIA_FONT_SM_HEIGHT + 2, + text: "Button Two") - # Sets default values - # Initialization only happens in the first frame - # NOTE: The values of some of these variables may seem confusingly large at first. - # The gridSize is 1600 but it seems a lot smaller on the screen, for example. - # But keep in mind that by using the "W", "A", "S", and "D" keys, you can - # move the grid's view in all four directions for more grid spaces. - def defaults - state.tileCords ||= [] - state.tileQuantity ||= 6 - state.tileSize ||= 50 - state.tileSelected ||= 1 - state.tempX ||= 50 - state.tempY ||= 500 - state.speed ||= 4 - state.centerX ||= 4000 - state.centerY ||= 4000 - state.originalCenter ||= [state.centerX, state.centerY] - state.gridSize ||= 1600 - state.lineQuantity ||= 50 - state.increment ||= state.gridSize / state.lineQuantity - state.gridX ||= [] - state.gridY ||= [] - state.filled_squares ||= [] - state.grid_border ||= [390, 140, 500, 500] + # Initialize the state variable that tracks which button was clicked to "" (empty stringI + args.state.last_button_clicked ||= "--" - get_grid unless state.tempX == 0 # calls get_grid in the first frame only - determineTileCords unless state.tempX == 0 # calls determineTileCords in first frame - state.tempX = 0 # sets tempX to 0; the two methods aren't called again + # If a click occurs, check to see if either button one, or button two was clicked + # using the inside_rect? method of the mouse + # set args.state.last_button_clicked accordingly + if args.nokia.mouse_click + if args.nokia.mouse_click.inside_rect? args.state.button_one_border + args.state.last_button_clicked = "One Clicked!" + elsif args.nokia.mouse_click.inside_rect? args.state.button_two_border + args.state.last_button_clicked = "Two Clicked!" + else + args.state.last_button_clicked = "--" + end end - # Calculates the placement of lines or separators in the grid - def get_grid - curr_x = state.centerX - (state.gridSize / 2) # starts at left of grid - deltaX = state.gridSize / state.lineQuantity # finds distance to place vertical lines evenly through width of grid - (state.lineQuantity + 2).times do - state.gridX << curr_x # adds curr_x to gridX collection - curr_x += deltaX # increment curr_x by the distance between vertical lines - end + # Render the current value of args.state.last_button_clicked + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 5, + text: args.state.last_button_clicked, + alignment_enum: 1) + end - curr_y = state.centerY - (state.gridSize / 2) # starts at bottom of grid - deltaY = state.gridSize / state.lineQuantity # finds distance to place horizontal lines evenly through height of grid - (state.lineQuantity + 2).times do - state.gridY << curr_y # adds curr_y to gridY collection - curr_y += deltaY # increments curr_y to distance between horizontal lines + def render_debug args + if !args.state.grid_rendered + (NOKIA_HEIGHT + 1).map_with_index do |i| + args.outputs.static_debug << { + x: NOKIA_X_OFFSET, + y: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), + x2: NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH, + y2: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), + r: 128, + g: 128, + b: 128, + a: 80 + }.line end - end - # Determines coordinate positions of patterned tiles (on the left side of the grid) - def determineTileCords - state.tempCounter ||= 1 # initializes tempCounter to 1 - state.tileQuantity.times do # there are 6 different kinds of tiles - state.tileCords += [[state.tempX, state.tempY, state.tempCounter]] # adds tile definition to collection - state.tempX += 75 # increments tempX to put horizontal space between the patterned tiles - state.tempCounter += 1 # increments tempCounter - if state.tempX > 200 # if tempX exceeds 200 pixels - state.tempX = 50 # a new row of patterned tiles begins - state.tempY -= 75 # the new row is 75 pixels lower than the previous row - end + (NOKIA_WIDTH + 1).map_with_index do |i| + args.outputs.static_debug << { + x: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), + y: NOKIA_Y_OFFSET, + x2: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), + y2: NOKIA_Y_OFFSET + NOKIA_ZOOMED_HEIGHT, + r: 128, + g: 128, + b: 128, + a: 80 + }.line end end - # Outputs objects (grid, tiles, etc) onto the screen - def render - outputs.sprites << state.tileCords.map do # outputs tileCords collection using images in sprites folder - |x, y, order| - [x, y, state.tileSize, state.tileSize, 'sprites/image' + order.to_s + ".png"] - end - outputs.solids << [0, 0, 1280, 720, 255, 255, 255] # outputs white background - add_grid # outputs grid - print_title # outputs title and current tile pattern + args.state.grid_rendered = true + + args.state.last_click ||= 0 + args.state.last_up ||= 0 + args.state.last_click = args.state.tick_count if args.nokia.mouse_down # you can also use args.nokia.click + args.state.last_up = args.state.tick_count if args.nokia.mouse_up + args.state.label_style = { size_enum: -1.5 } + + args.state.watch_list = [ + "args.state.tick_count is: #{args.state.tick_count}", + "args.nokia.mouse_position is: #{args.nokia.mouse_position.x}, #{args.nokia.mouse_position.y}", + "args.nokia.mouse_down tick: #{args.state.last_click || "never"}", + "args.nokia.mouse_up tick: #{args.state.last_up || "false"}", + ] + + args.outputs.debug << args.state + .watch_list + .map_with_index do |text, i| + { + x: 5, + y: 720 - (i * 18), + text: text, + size_enum: -1.5, + r: 255, g: 255, b: 255 + }.label end - # Creates a grid by outputting vertical and horizontal grid lines onto the screen. - # Outputs sprites for the filled_squares collection onto the screen. - def add_grid + args.outputs.debug << { + x: 640, + y: 25, + 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, + r: 255, g: 255, b: 255 + }.label + end - # Outputs the grid's border. - outputs.borders << state.grid_border - temp = 0 + def snake_demo args - # Before looking at the code that outputs the vertical and horizontal lines in the - # grid, take note of the fact that: - # grid_border[1] refers to the border's bottom line (running horizontally), - # grid_border[2] refers to the border's top line (running (horizontally), - # grid_border[0] refers to the border's left line (running vertically), - # and grid_border[3] refers to the border's right line (running vertically). + end - # [2] - # ---------- - # | | - # [0] | | [3] - # | | - # ---------- - # [1] + $gtk.reset + +#+end_src + +*** Lowrez - Nokia 3310 - nokia.rb +#+begin_src 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. - # Calculates the positions and outputs the x grid lines in the color gray. - state.gridX.map do # perform an action on all elements of the gridX collection - |x| - temp += 1 # increment temp + NOKIA_WIDTH = 84 + NOKIA_HEIGHT = 48 + NOKIA_ZOOM = 12 + NOKIA_ZOOMED_WIDTH = NOKIA_WIDTH * NOKIA_ZOOM + NOKIA_ZOOMED_HEIGHT = NOKIA_HEIGHT * NOKIA_ZOOM + NOKIA_X_OFFSET = (1280 - NOKIA_ZOOMED_WIDTH).half + NOKIA_Y_OFFSET = ( 720 - NOKIA_ZOOMED_HEIGHT).half - # if x's value is greater than (or equal to) the x value of the border's left side - # and less than (or equal to) the x value of the border's right side - if x >= state.centerX - (state.grid_border[2] / 2) && x <= state.centerX + (state.grid_border[2] / 2) - delta = state.centerX - 640 - # vertical lines have the same starting and ending x positions - # starting y and ending y positions lead from the bottom of the border to the top of the border - outputs.lines << [x - delta, state.grid_border[1], x - delta, state.grid_border[1] + state.grid_border[2], 150, 150, 150] # sets definition of vertical line and outputs it - end - end - temp = 0 + NOKIA_FONT_XL = -1 + NOKIA_FONT_XL_HEIGHT = 20 - # Calculates the positions and outputs the y grid lines in the color gray. - state.gridY.map do # perform an action on all elements of the gridY collection - |y| - temp += 1 # increment temp + NOKIA_FONT_LG = -3.5 + NOKIA_FONT_LG_HEIGHT = 15 - # if y's value is greater than (or equal to) the y value of the border's bottom side - # and less than (or equal to) the y value of the border's top side - if y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2) - delta = state.centerY - 393 - # horizontal lines have the same starting and ending y positions - # starting x and ending x positions lead from the left side of the border to the right side of the border - outputs.lines << [state.grid_border[0], y - delta, state.grid_border[0] + state.grid_border[3], y - delta, 150, 150, 150] # sets definition of horizontal line and outputs it - end - end + NOKIA_FONT_MD = -6 + NOKIA_FONT_MD_HEIGHT = 10 - # Sets values and outputs sprites for the filled_squares collection. - state.filled_squares.map do # perform an action on every element of the filled_squares collection - |x, y, w, h, sprite| - # if x's value is greater than (or equal to) the x value of 17 pixels to the left of the border's left side - # and less than (or equal to) the x value of the border's right side - # and y's value is greater than (or equal to) the y value of the border's bottom side - # and less than (or equal to) the y value of 25 pixels above the border's top side - # NOTE: The allowance of 17 pixels and 25 pixels is due to the fact that a grid box may be slightly cut off or - # not entirely visible in the grid's view (until it is moved using "W", "A", "S", "D") - if x >= state.centerX - (state.grid_border[2] / 2) - 17 && x <= state.centerX + (state.grid_border[2] / 2) && - y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2) + 25 - # calculations done to place sprites in grid spaces that are meant to filled in - # mess around with the x and y values and see how the sprite placement changes - outputs.sprites << [x - state.centerX + 630, y - state.centerY + 360, w, h, sprite] - end - end + NOKIA_FONT_SM = -8.5 + NOKIA_FONT_SM_HEIGHT = 5 - # outputs a white solid along the left side of the grid (change the color and you'll be able to see it against the white background) - # state.increment subtracted in x parameter because solid's position is denoted by bottom left corner - # state.increment subtracted in y parameter to avoid covering the title label - outputs.primitives << [state.grid_border[0] - state.increment, - state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2), - 255, 255, 255].solid + NOKIA_FONT_PATH = 'fonts/lowrez.ttf' - # outputs a white solid along the right side of the grid - # state.increment subtracted from y parameter to avoid covering title label - outputs.primitives << [state.grid_border[0] + state.grid_border[2], - state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2), - 255, 255, 255].solid - # outputs a white solid along the bottom of the grid - # state.increment subtracted from y parameter to avoid covering last row of grid boxes - outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] - state.increment, - state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid + class NokiaOutputs + attr_accessor :width, :height - # outputs a white solid along the top of the grid - outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] + state.grid_border[3], - state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid + def initialize args + @args = args + end + def outputs_nokia + return @args.outputs if @args.state.tick_count <= 0 + return @args.outputs[:nokia] end - # Outputs title and current tile pattern - def print_title - outputs.labels << [640, 700, 'Mouse to Place Tile, WASD to Move Around', 7, 1] # title label - outputs.lines << horizontal_separator(660, 0, 1280) # outputs horizontal separator - outputs.labels << [1050, 500, 'Current:', 3, 1] # outputs Current label - outputs.sprites << [1110, 474, state.tileSize / 2, state.tileSize / 2, 'sprites/image' + state.tileSelected.to_s + ".png"] # outputs sprite of current tile pattern using images in sprites folder; output is half the size of a tile + def solids + outputs_nokia.solids end - # Sets the starting position, ending position, and color for the horizontal separator. - def horizontal_separator y, x, x2 - [x, y, x2, y, 150, 150, 150] # definition of separator; horizontal line means same starting/ending y + def borders + outputs_nokia.borders end - # Checks if the mouse is being clicked or dragged - def check_click - if inputs.keyboard.key_down.r # if the "r" key is pressed down - $dragon.reset - end + def sprites + outputs_nokia.sprites + end - if inputs.mouse.down #is mouse up or down? - state.mouse_held = true - if inputs.mouse.position.x < state.grid_border[0] # if mouse's x position is inside the grid's borders - state.tileCords.map do # perform action on all elements of tileCords collection - |x, y, order| - # if mouse's x position is greater than (or equal to) the starting x position of a tile - # and the mouse's x position is also less than (or equal to) the ending x position of that tile, - # and the mouse's y position is greater than (or equal to) the starting y position of that tile, - # and the mouse's y position is also less than (or equal to) the ending y position of that tile, - # (BASICALLY, IF THE MOUSE'S POSITION IS WITHIN THE STARTING AND ENDING POSITIONS OF A TILE) - if inputs.mouse.position.x >= x && inputs.mouse.position.x <= x + state.tileSize && - inputs.mouse.position.y >= y && inputs.mouse.position.y <= y + state.tileSize - state.tileSelected = order # that tile is selected - end - end - end - elsif inputs.mouse.up # otherwise, if the mouse is in the "up" state - state.mouse_held = false # mouse is not held down or dragged - state.mouse_dragging = false - end + def labels + outputs_nokia.labels + end - if state.mouse_held && # mouse needs to be down - !inputs.mouse.click && # must not be first click - ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15 || - (inputs.mouse.previous_click.point.y - inputs.mouse.position.y).abs > 15) # Need to move 15 pixels before "drag" - state.mouse_dragging = true - end + def default_label + { + x: 0, + y: 63, + text: "", + size_enum: NOKIA_FONT_SM, + alignment_enum: 0, + r: 0, + g: 0, + b: 0, + a: 255, + font: NOKIA_FONT_PATH + } + end - # if mouse is clicked inside grid's border, search_lines method is called with click input type - if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border)) - search_lines(inputs.mouse.click.point, :click) + def lines + outputs_nokia.lines + end - # if mouse is dragged inside grid's border, search_lines method is called with drag input type - elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border)) - search_lines(inputs.mouse.position, :drag) - end + def primitives + outputs_nokia.primitives + end + + def click + return nil unless @args.inputs.mouse.click + mouse + end + + def mouse_click + click + end + + def mouse_down + @args.inputs.mouse.down + end + + def mouse_up + @args.inputs.mouse.up + end + + def mouse + [ + ((@args.inputs.mouse.x - NOKIA_X_OFFSET).idiv(NOKIA_ZOOM)), + ((@args.inputs.mouse.y - NOKIA_Y_OFFSET).idiv(NOKIA_ZOOM)) + ] + end + + def mouse_position + mouse + end + + def keyboard + @args.inputs.keyboard + end + end + + class GTK::Args + def init_nokia + return if @nokia + @nokia = NokiaOutputs.new self + end + + def nokia + @nokia + end + end + + module GTK + class Runtime + alias_method :__original_tick_core__, :tick_core unless Runtime.instance_methods.include?(:__original_tick_core__) - # Changes grid's position on screen by moving it up, down, left, or right. + def tick_core + @args.init_nokia - # centerX is incremented by speed if the "d" key is pressed and if that sum is less than - # the original left side of the center plus half the grid, minus half the top border of grid. - # MOVES GRID RIGHT (increasing x) - state.centerX += state.speed if inputs.keyboard.key_held.d && - (state.centerX + state.speed) < state.originalCenter[0] + (state.gridSize / 2) - (state.grid_border[2] / 2) - # centerX is decremented by speed if the "a" key is pressed and if that difference is greater than - # the original left side of the center minus half the grid, plus half the top border of grid. - # MOVES GRID LEFT (decreasing x) - state.centerX -= state.speed if inputs.keyboard.key_held.a && - (state.centerX - state.speed) > state.originalCenter[0] - (state.gridSize / 2) + (state.grid_border[2] / 2) - # centerY is incremented by speed if the "w" key is pressed and if that sum is less than - # the original bottom of the center plus half the grid, minus half the right border of grid. - # MOVES GRID UP (increasing y) - state.centerY += state.speed if inputs.keyboard.key_held.w && - (state.centerY + state.speed) < state.originalCenter[1] + (state.gridSize / 2) - (state.grid_border[3] / 2) - # centerY is decremented by speed if the "s" key is pressed and if the difference is greater than - # the original bottom of the center minus half the grid, plus half the right border of grid. - # MOVES GRID DOWN (decreasing y) - state.centerY -= state.speed if inputs.keyboard.key_held.s && - (state.centerY - state.speed) > state.originalCenter[1] - (state.gridSize / 2) + (state.grid_border[3] / 2) - end + __original_tick_core__ - # Performs calculations on the gridX and gridY collections, and sets values. - # Sets the definition of a grid box, including the image that it is filled with. - def search_lines (point, input_type) - point.x += state.centerX - 630 # increments x and y - point.y += state.centerY - 360 - findX = 0 - findY = 0 - increment = state.gridSize / state.lineQuantity # divides grid by number of separators + return if @args.state.tick_count <= 0 - state.gridX.map do # perform an action on every element of collection - |x| - # findX increments x by 10 if point.x is less than that sum and findX is currently 0 - findX = x + 10 if point.x < (x + 10) && findX == 0 - end + @args.render_target(:nokia) + .labels + .each do |l| + l.y += 1 + if (l.a || 255) > 128 + l.r = 67 + l.g = 82 + l.b = 61 + l.a = 255 + else + l.a = 0 + end + end - state.gridY.map do - |y| - # findY is set to y if point.y is less than that value and findY is currently 0 - findY = y if point.y < (y) && findY == 0 - end - # position of a box is denoted by bottom left corner, which is why the increment is being subtracted - grid_box = [findX - (increment.ceil), findY - (increment.ceil), increment.ceil, increment.ceil, - "sprites/image" + state.tileSelected.to_s + ".png"] # sets sprite definition + @args.render_target(:nokia) + .sprites + .each do |s| + if (s.a || 255) > 128 + s.a = 255 + else + s.a = 0 + end + end - if input_type == :click # if user clicks their mouse - if state.filled_squares.include? grid_box # if grid box is already filled in - state.filled_squares.delete grid_box # box is cleared and removed from filled_squares - else - state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares + @args.render_target(:nokia) + .solids + .each do |s| + if (s.a || 255) > 128 + s.r = 67 + s.g = 82 + s.b = 61 + s.a = 255 + else + s.a = 0 + end end - elsif input_type == :drag # if user drags mouse - unless state.filled_squares.include? grid_box # unless grid box dragged over is already filled in - state.filled_squares << grid_box # box is filled in and added to filled_squares + + @args.render_target(:nokia) + .borders + .each do |s| + if (s.a || 255) > 128 + s.r = 67 + s.g = 82 + s.b = 61 + s.a = 255 + else + s.a = 0 + end end - end - end - # Creates a "Clear" button using labels and borders. - def draw_buttons - x, y, w, h = 390, 50, 240, 50 - state.clear_button ||= state.new_entity(:button_with_fade) + @args.render_target(:nokia) + .lines + .each do |l| + l.y += 1 + l.y2 += 1 + l.y2 += 1 if l.y1 != l.y2 + l.x2 += 1 if l.x1 != l.x2 - # x and y positions are set to display "Clear" label in center of the button - # Try changing first two parameters to simply x, y and see what happens to the text placement - state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] - state.clear_button.border ||= [x, y, w, h] # definition of button's border + if (l.a || 255) > 128 + l.r = 67 + l.g = 82 + l.b = 61 + l.a = 255 + else + l.a = 0 + end + end - # If the mouse is clicked inside the borders of the clear button - if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border) - state.clear_button.clicked_at = inputs.mouse.click.created_at # value is frame of mouse click - state.filled_squares.clear # filled squares collection is emptied (squares are cleared) - inputs.mouse.previous_click = nil # no previous click - end + @args.outputs.borders << { + x: NOKIA_X_OFFSET - 1, + y: NOKIA_Y_OFFSET - 1, + w: NOKIA_ZOOMED_WIDTH + 2, + h: NOKIA_ZOOMED_HEIGHT + 2, + r: 128, g: 128, b: 128 + } - outputs.labels << state.clear_button.label # outputs clear button - outputs.borders << state.clear_button.border - # When the clear button is clicked, the color of the button changes - # and the transparency changes, as well. If you change the time from - # 0.25.seconds to 1.25.seconds or more, the change will last longer. - if state.clear_button.clicked_at - outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)] - end - end - end + @args.outputs.background_color = [199, 240, 216] - $tile_editor = TileEditor.new + @args.outputs.solids << [0, 0, NOKIA_X_OFFSET, 720] + @args.outputs.solids << [0, 0, 1280, NOKIA_Y_OFFSET] + @args.outputs.solids << [NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH, 0, NOKIA_X_OFFSET, 720] + @args.outputs.solids << [0, NOKIA_Y_OFFSET.from_top, 1280, NOKIA_Y_OFFSET] - def tick args - $tile_editor.inputs = args.inputs - $tile_editor.grid = args.grid - $tile_editor.args = args - $tile_editor.outputs = args.outputs - $tile_editor.state = args.state - $tile_editor.tick - tick_instructions args, "Roll your own tile editor. CLICK to select a sprite. CLICK in grid to place sprite. WASD to move around." - end + @args.outputs + .sprites << { x: NOKIA_X_OFFSET, + y: NOKIA_Y_OFFSET, + w: NOKIA_ZOOMED_WIDTH, + h: NOKIA_ZOOMED_HEIGHT, + source_x: 0, + source_y: 0, + source_w: NOKIA_WIDTH, + source_h: NOKIA_HEIGHT, + path: :nokia } + + if !@args.state.overlay_rendered + (NOKIA_HEIGHT + 1).map_with_index do |i| + @args.outputs.static_lines << { + x: NOKIA_X_OFFSET, + y: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), + x2: NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH, + y2: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), + r: 199, + g: 240, + b: 216, + a: 100 + }.line + 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.escape - args.state.key_event_occurred = true - end + (NOKIA_WIDTH + 1).map_with_index do |i| + @args.outputs.static_lines << { + x: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), + y: NOKIA_Y_OFFSET, + x2: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), + y2: NOKIA_Y_OFFSET + NOKIA_ZOOMED_HEIGHT, + r: 199, + g: 240, + b: 216, + a: 100 + }.line + 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.state.overlay_rendered = true + end + end + end end #+end_src -* Lowrez - Resolution 64x64 - lowrez.rb +*** Lowrez - Resolution 64x64 - lowrez.rb #+begin_src 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 :-) @@ -13608,7 +26329,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Lowrez - Resolution 64x64 - main.rb +*** Lowrez - Resolution 64x64 - main.rb #+begin_src ruby # ./samples/99_genre_lowrez/resolution_64x64/app/main.rb require 'app/lowrez.rb' @@ -14227,7 +26948,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Platformer - Clepto Frog - main.rb +*** Platformer - Clepto Frog - main.rb #+begin_src ruby # ./samples/99_genre_platformer/clepto_frog/app/main.rb MAP_FILE_PATH = 'app/map.txt' @@ -15097,7 +27818,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Platformer - Clepto Frog - map.rb +*** Platformer - Clepto Frog - map.rb #+begin_src ruby # ./samples/99_genre_platformer/clepto_frog/app/map.rb $collisions = [ @@ -16128,7 +28849,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Platformer - Gorillas Basic - credits.txt +*** Platformer - Gorillas Basic - credits.txt #+begin_src ruby # ./samples/99_genre_platformer/gorillas_basic/CREDITS.txt code: Amir Rajan, https://twitter.com/amirrajan @@ -16137,7 +28858,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Platformer - Gorillas Basic - main.rb +*** Platformer - Gorillas Basic - main.rb #+begin_src ruby # ./samples/99_genre_platformer/gorillas_basic/app/main.rb class YouSoBasicGorillas @@ -16516,7 +29237,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Platformer - Gorillas Basic - tests.rb +*** Platformer - Gorillas Basic - tests.rb #+begin_src ruby # ./samples/99_genre_platformer/gorillas_basic/app/tests.rb $gtk.reset 100 @@ -16526,7 +29247,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Platformer - Gorillas Basic - Tests - building_generation_tests.rb +*** Platformer - Gorillas Basic - Tests - building_generation_tests.rb #+begin_src ruby # ./samples/99_genre_platformer/gorillas_basic/app/tests/building_generation_tests.rb def test_solids args, assert @@ -16547,7 +29268,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Platformer - The Little Probe - main.rb +*** Platformer - The Little Probe - main.rb #+begin_src ruby # ./samples/99_genre_platformer/the_little_probe/app/main.rb class FallingCircle @@ -17440,7 +30161,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Platformer - The Little Probe - Data - level.txt +*** Platformer - The Little Probe - Data - level.txt #+begin_src ruby # ./samples/99_genre_platformer/the_little_probe/data/level.txt 640,8840,1180,8840 @@ -18926,7 +31647,7 @@ Follows is a source code listing for all files that have been open sourced. This 923.0029599285435,11398.99893503157,1264.002959928544,11351.99893503157 #+end_src -* Platformer - The Little Probe - Data - level_lava.txt +*** Platformer - The Little Probe - Data - level_lava.txt #+begin_src ruby # ./samples/99_genre_platformer/the_little_probe/data/level_lava.txt 100,10740,500,10780 @@ -19166,7 +31887,7 @@ Follows is a source code listing for all files that have been open sourced. This 1840,11230,2200,11130 #+end_src -* Rpg Narrative - Choose Your Own Adventure - decision.rb +*** Rpg Narrative - Choose Your Own Adventure - decision.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/decision.rb # Hey there! Welcome to Four Decisions. Here is how you @@ -19209,7 +31930,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Choose Your Own Adventure - main.rb +*** Rpg Narrative - Choose Your Own Adventure - main.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/main.rb =begin @@ -19347,7 +32068,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - lowrez_simulator.rb +*** Rpg Narrative - Return Of Serenity - lowrez_simulator.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/lowrez_simulator.rb ################################################################################### @@ -19444,7 +32165,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - main.rb +*** Rpg Narrative - Return Of Serenity - main.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/main.rb require 'app/require.rb' @@ -19923,7 +32644,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - require.rb +*** Rpg Narrative - Return Of Serenity - require.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/require.rb require 'app/lowrez_simulator.rb' @@ -19940,7 +32661,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - storyline.rb +*** Rpg Narrative - Return Of Serenity - storyline.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline.rb def hotspot_top @@ -20092,7 +32813,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - storyline_anka.rb +*** Rpg Narrative - Return Of Serenity - storyline_anka.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_anka.rb def anka_inside_room args @@ -20225,7 +32946,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb +*** Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_blinking_light.rb def the_blinking_light args @@ -20306,7 +33027,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - storyline_day_one.rb +*** Rpg Narrative - Return Of Serenity - storyline_day_one.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_day_one.rb def day_one_beginning args @@ -20518,7 +33239,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - storyline_final_decision.rb +*** Rpg Narrative - Return Of Serenity - storyline_final_decision.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_decision.rb def final_decision_side_of_home args @@ -20660,7 +33381,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - storyline_final_message.rb +*** Rpg Narrative - Return Of Serenity - storyline_final_message.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_message.rb def final_message_sad args @@ -20882,7 +33603,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb +*** Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_alive.rb def serenity_alive_side_of_home args @@ -21107,7 +33828,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb +*** Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_bio.rb def serenity_bio_infront_of_home args @@ -21264,7 +33985,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb +*** Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_introduction.rb # decision_graph "Message from Sasha", @@ -21365,7 +34086,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb +*** Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb #+begin_src ruby # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_speed_of_light.rb def speed_of_light_front_of_home args @@ -21475,9 +34196,9 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Roguelike - Roguelike Line Of Sight - constants.rb +*** Rpg Roguelike - Roguelike Starting Point - constants.rb #+begin_src ruby - # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/constants.rb + # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/constants.rb SHOW_LEGEND = true SOURCE_TILE_SIZE = 16 DESTINATION_TILE_SIZE = 16 @@ -21489,9 +34210,9 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Roguelike - Roguelike Line Of Sight - legend.rb +*** Rpg Roguelike - Roguelike Starting Point - legend.rb #+begin_src ruby - # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/legend.rb + # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/legend.rb def tick_legend args return unless SHOW_LEGEND @@ -21560,9 +34281,9 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Roguelike - Roguelike Line Of Sight - main.rb +*** Rpg Roguelike - Roguelike Starting Point - main.rb #+begin_src ruby - # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/main.rb + # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb require 'app/constants.rb' require 'app/sprite_lookup.rb' require 'app/legend.rb' @@ -21663,9 +34384,9 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Roguelike - Roguelike Line Of Sight - sprite_lookup.rb +*** Rpg Roguelike - Roguelike Starting Point - sprite_lookup.rb #+begin_src ruby - # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/sprite_lookup.rb + # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb def sprite_lookup { 0 => [3, 0], @@ -21793,9 +34514,9 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Roguelike - Roguelike Starting Point - main.rb +*** Rpg Roguelike - Roguelike Line Of Sight - main.rb #+begin_src ruby - # ./samples/99_genre_rpg_roguelike/roguelike_starting_point/app/main.rb + # ./samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb =begin APIs listing that haven't been encountered in previous sample apps: @@ -22238,7 +34959,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Tactical - Hexagonal Grid - main.rb +*** Rpg Tactical - Hexagonal Grid - main.rb #+begin_src ruby # ./samples/99_genre_rpg_tactical/hexagonal_grid/app/main.rb class HexagonTileGame @@ -22312,7 +35033,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Tactical - Isometric Grid - main.rb +*** Rpg Tactical - Isometric Grid - main.rb #+begin_src ruby # ./samples/99_genre_rpg_tactical/isometric_grid/app/main.rb class Isometric @@ -22580,7 +35301,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* Rpg Topdown - Topdown Starting Point - main.rb +*** Rpg Topdown - Topdown Starting Point - main.rb #+begin_src ruby # ./samples/99_genre_rpg_topdown/topdown_starting_point/app/main.rb =begin @@ -22694,7 +35415,9 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* args.rb +** OSS +Follows is a source code listing for all files that have been open sourced. This code can be found online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]]. +*** args.rb #+begin_src ruby # ./dragon/args.rb # coding: utf-8 @@ -22740,6 +35463,8 @@ Follows is a source code listing for all files that have been open sourced. This # @return [Geometry] attr_accessor :geometry + attr_accessor :fn + # This is where you'll put state associated with your video game. # # @return [OpenEntity] @@ -22757,6 +35482,10 @@ Follows is a source code listing for all files that have been open sourced. This attr_accessor :layout + attr_accessor :easing + + attr_accessor :string + def initialize runtime, recording @inputs = Inputs.new @outputs = Outputs.new args: self @@ -22771,8 +35500,11 @@ Follows is a source code listing for all files that have been open sourced. This @pixel_arrays = {} @all_tests = [] @geometry = GTK::Geometry + @fn = GTK::Fn @wizards = Wizards.new @layout = GTK::Layout.new @grid.w, @grid.h + @easing = GTK::Easing + @string = String end @@ -22921,12 +35653,16 @@ Follows is a source code listing for all files that have been open sourced. This def controller_two @inputs.controller_two end + + def autocomplete_methods + [:inputs, :outputs, :gtk, :state, :geometry, :audio, :grid, :layout, :fn] + end end end #+end_src -* assert.rb +*** assert.rb #+begin_src ruby # ./dragon/assert.rb # coding: utf-8 @@ -23035,6 +35771,16 @@ Follows is a source code listing for all files that have been open sourced. This nil end + def not_equal! actual, expected, message = nil + @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}" + raise message + end + nil + end + =begin Assert if a value is explicitly nil (not false). @@ -23060,7 +35806,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* attr_gtk.rb +*** attr_gtk.rb #+begin_src ruby # ./dragon/attr_gtk.rb # coding: utf-8 @@ -23107,11 +35853,15 @@ Follows is a source code listing for all files that have been open sourced. This def geometry args.geometry end + + def layout + args.layout + end end #+end_src -* attr_sprite.rb +*** attr_sprite.rb #+begin_src ruby # ./dragon/attr_sprite.rb # Copyright 2019 DragonRuby LLC @@ -23120,26 +35870,35 @@ Follows is a source code listing for all files that have been open sourced. This # @private module AttrRect + include GTK::Geometry + def left - @x + (@x || self.x) end def right - @x + @w + (@x || self.x) + (@w || self.w) end def bottom - @y + (@y || self.y) end def top - @y + @h + (@y || self.y) + (@h || self.h) + end + + def x1 + (@x || self.x) + end + + def y1 + (@y || self.y) end end module AttrSprite include AttrRect - include GTK::Geometry attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :tile_x, :tile_y, :tile_w, :tile_h, :flip_horizontally, @@ -23154,18 +35913,10 @@ Follows is a source code listing for all files that have been open sourced. This self end - def x1 - @x - end - def x1= value @x = value end - def y1 - @y - end - def y1= value @y = value end @@ -23173,7 +35924,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* console.rb +*** console.rb #+begin_src ruby # ./dragon/console.rb # Copyright 2019 DragonRuby LLC @@ -23331,7 +36082,10 @@ Follows is a source code listing for all files that have been open sourced. This @visible end - # @gtk + def open reason = nil + show reason + end + def show reason = nil @shown_at = Kernel.global_tick_count @show_reason = reason @@ -23614,6 +36368,10 @@ Follows is a source code listing for all files that have been open sourced. This if args.inputs.keyboard.key_down.control || args.inputs.keyboard.key_down.meta prompt << $gtk.ffi_misc.getclipboard end + elsif args.inputs.keyboard.key_down.home + prompt.move_cursor_home + elsif args.inputs.keyboard.key_down.end + prompt.move_cursor_end elsif args.inputs.keyboard.key_down.up if @command_history_index == -1 @nonhistory_input = current_input_str @@ -23632,9 +36390,17 @@ Follows is a source code listing for all files that have been open sourced. This self.current_input_str = @command_history[@command_history_index].dup end elsif args.inputs.keyboard.key_down.left - prompt.move_cursor_left + if args.inputs.keyboard.key_down.control + prompt.move_cursor_left_word + else + prompt.move_cursor_left + end elsif args.inputs.keyboard.key_down.right - prompt.move_cursor_right + if args.inputs.keyboard.key_down.control + prompt.move_cursor_right_word + else + prompt.move_cursor_right + end elsif inputs_scroll_up_full? args scroll_up_full elsif inputs_scroll_down_full? args @@ -23647,8 +36413,10 @@ Follows is a source code listing for all files that have been open sourced. This prompt.clear @command_history_index = -1 @nonhistory_input = '' - elsif args.inputs.keyboard.key_down.backspace || args.inputs.keyboard.key_down.delete + elsif args.inputs.keyboard.key_down.backspace prompt.backspace + elsif args.inputs.keyboard.key_down.delete + prompt.delete elsif args.inputs.keyboard.key_down.tab prompt.autocomplete end @@ -23733,7 +36501,7 @@ Follows is a source code listing for all files that have been open sourced. This end def error_markers - ["exception", "error", "undefined method", "failed", "syntax", "deprecated"] + ["exception:", "error:", "undefined method", "failed", "syntax", "deprecated"] end def include_subdued_markers? text @@ -23745,7 +36513,7 @@ Follows is a source code listing for all files that have been open sourced. This end def subdued_markers - ["reloaded", "exported the"] + ["reloaded", "exported the", "~require~"] end def calc args @@ -23932,7 +36700,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* console_color.rb +*** console_color.rb #+begin_src ruby # ./dragon/console_color.rb # Copyright 2019 DragonRuby LLC @@ -23968,7 +36736,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* console_font_style.rb +*** console_font_style.rb #+begin_src ruby # ./dragon/console_font_style.rb # Copyright 2019 DragonRuby LLC @@ -24014,7 +36782,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* console_menu.rb +*** console_menu.rb #+begin_src ruby # ./dragon/console_menu.rb # Copyright 2019 DragonRuby LLC @@ -24179,7 +36947,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* console_prompt.rb +*** console_prompt.rb #+begin_src ruby # ./dragon/console_prompt.rb # Copyright 2019 DragonRuby LLC @@ -24192,6 +36960,9 @@ Follows is a source code listing for all files that have been open sourced. This module GTK class Console class Prompt + # ? Can be changed, it was just taken from my editor settings :> + WORD_LIMITER_CHARS = "`~!@#$%^&*-=+()[]{}\|;:'\",.<>/?_ \t\n\0".chars + attr_accessor :current_input_str, :font_style, :console_text_width, :last_input_str, :last_input_str_changed def initialize(font_style:, text_color:, console_text_width:) @@ -24216,6 +36987,7 @@ Follows is a source code listing for all files that have been open sourced. This def current_input_str=(str) @current_input_str = str @cursor_position = str.length + update_cursor_position_px end def <<(str) @@ -24235,16 +37007,57 @@ Follows is a source code listing for all files that have been open sourced. This reset_autocomplete end + def delete + return if current_input_str.length.zero? || @cursor_position == current_input_str.length + + @cursor_position += 1 + backspace + end + def move_cursor_left @cursor_position -= 1 if @cursor_position > 0 update_cursor_position_px end + def move_cursor_left_word + return if @cursor_position.zero? + + new_pos = @cursor_position - 1 + (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 end + def move_cursor_right_word + return if @cursor_position.equal? str_len + + new_pos = @cursor_position + 1 + (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 + + def move_cursor_home + @cursor_position = 0 + update_cursor_position_px + end + + def move_cursor_end + @cursor_position = str_len + update_cursor_position_px + end + def clear @current_input_str = '' @cursor_position = 0 @@ -24396,13 +37209,24 @@ Follows is a source code listing for all files that have been open sourced. This @last_autocomplete_prefix = nil @next_candidate_index = 0 end + + def is_word_boundary? char + # Alternative method + # (WORD_LIMITER_CHARS - [char]).length != WORD_LIMITER_CHARS.length + # Production code + WORD_LIMITER_CHARS.include? char + end + + def str_len + @current_input_str.length + end end end end #+end_src -* controller.rb +*** controller.rb #+begin_src ruby # ./dragon/controller.rb # coding: utf-8 @@ -24530,7 +37354,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* controller/config.rb +*** controller/config.rb #+begin_src ruby # ./dragon/controller/config.rb # coding: utf-8 @@ -24935,7 +37759,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* controller/keys.rb +*** controller/keys.rb #+begin_src ruby # ./dragon/controller/keys.rb # coding: utf-8 @@ -24959,7 +37783,7 @@ Follows is a source code listing for all files that have been open sourced. This ].freeze LABELS.each do |label| - attr_reader label + attr label end # Activate a key. @@ -24992,7 +37816,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* directional_input_helper_methods.rb +*** directional_input_helper_methods.rb #+begin_src ruby # ./dragon/directional_input_helper_methods.rb # coding: utf-8 @@ -25051,8 +37875,8 @@ Follows is a source code listing for all files that have been open sourced. This # - ~nil~ which denotes that no directional input exists. # - ~[ 0, 1]~ which denotes that only up is being held/pressed. # - ~[ 0, -1]~ which denotes that only down is being held/pressed. - # - ~[ 0.5, 0.5]~ which denotes that right and up are being pressed/held. - # - ~[-0.5, -0.5]~ which denotes that left and down are being pressed/held. + # - ~[-0.707, 0.707]~ which denotes that right and up are being pressed/held. + # - ~[-0.707, -0.707]~ which denotes that left and down are being pressed/held. # # @gtk def directional_vector @@ -25061,7 +37885,7 @@ Follows is a source code listing for all files that have been open sourced. This if lr == 0 && ud == 0 return nil elsif lr.abs == ud.abs - return [lr.half, ud.half] + return [45.vector_x * lr.sign, 45.vector_y * ud.sign, ud.sign] else return [lr, ud] end @@ -25090,7 +37914,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* easing.rb +*** easing.rb #+begin_src ruby # ./dragon/easing.rb # coding: utf-8 @@ -25100,6 +37924,15 @@ Follows is a source code listing for all files that have been open sourced. This module GTK module Easing + def self.ease start_tick, current_tick, duration, *definitions + ease_extended start_tick, + current_tick, + start_tick + duration, + (initial_value *definitions), + (final_value *definitions), + *definitions + end + def self.ease_extended start_tick, current_tick, end_tick, default_before, default_after, *definitions definitions.flatten! definitions = [:identity] if definitions.length == 0 @@ -25114,7 +37947,12 @@ Follows is a source code listing for all files that have been open sourced. This y end + def self.ease_spline start_tick, current_tick, duration, spline + ease_spline_extended start_tick, current_tick, start_tick + duration, spline + end + def self.ease_spline_extended start_tick, current_tick, end_tick, spline + return spline[-1][-1] if current_tick >= end_tick duration = end_tick - start_tick t = (current_tick - start_tick).fdiv duration time_allocation_per_curve = 1.fdiv(spline.length) @@ -25126,12 +37964,12 @@ Follows is a source code listing for all files that have been open sourced. This def self.initial_value *definitions definitions.flatten! - return Easing.exec_definition (definitions.value(-1) || :identity), 0, 10, 0 + return Easing.exec_definition (definitions.at(-1) || :identity), 0, 10, 0 end def self.final_value *definitions definitions.flatten! - return Easing.exec_definition (definitions.value(-1) || :identity), 0, 10, 1.0 + return Easing.exec_definition (definitions.at(-1) || :identity), 0, 10, 1.0 end def self.exec_definition definition, start_tick, duration, x @@ -25178,7 +38016,104 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* geometry.rb +*** entity.rb +#+begin_src ruby + # ./dragon/entity.rb + # coding: utf-8 + # Copyright 2019 DragonRuby LLC + # MIT License + # entity.rb has been released under MIT (*only this file*). + + module GTK + class Entity + def self.id! + @id ||= 0 + @id += 1 + @id + end + + def self.__reset_id__! + @id = 0 + end + + def self.strict_entities + @strict_entities ||= {} + @strict_entities + end + + def self.parse_serialization_data data + r = Entity.parse_serialization_data data + return r if r.is_a? OpenEntity + return r if r.is_a? StrictEntity + raise <<-S + * ERROR: + The save data looks to be corrupt. + + S + end + + def self.parse_serialization_data value + if value.is_a?(Hash) && value[:entity_id] && value[:entity_strict] + o = new_entity_strict value[:entity_name], value + o.load_entity_data! value + return o + elsif value.is_a?(Hash) && value[:entity_id] + o = OpenEntity.new + o.load_entity_data! value + return o + elsif value.is_a? Array + return value.map { |entry| Entity.parse_serialization_data entry } + else + return value + end + end + + def self.new_entity entity_type, init_hash = nil, block = nil + n = OpenEntity.new(entity_type) + n.entity_type = entity_type + n.created_at = Kernel.tick_count + n.global_created_at = Kernel.global_tick_count + + if init_hash + init_hash.each do |k, v| + n.as_hash[k] = v + end + end + + block.call(n) if block + + n + end + + def self.new_entity_strict entity_type, init_hash = nil, block = nil + if !Entity.strict_entities[entity_type] + init_hash ||= { } + + n = new_entity entity_type, init_hash, block + klass = Class.new(StrictEntity) + + klass.class_eval do + init_hash.each do |k, v| + attr_accessor k + end + + n.as_hash.each do |k, v| + attr_accessor k if !init_hash[k] + end + end + + Entity.strict_entities[entity_type] = klass + end + + klass = Entity.strict_entities[entity_type] + (klass.new entity_type, init_hash, block) + end + end + end + +#+end_src + +*** geometry.rb #+begin_src ruby # ./dragon/geometry.rb # coding: utf-8 @@ -25209,8 +38144,8 @@ Follows is a source code listing for all files that have been open sourced. This # Returns true if a primitive's rectangle is entirely inside another primitive's rectangle. # @gtk - def inside_rect? outer - Geometry.inside_rect? self, outer + def inside_rect? outer, tolerance = 0.0 + Geometry.inside_rect? self, outer, tolerance end # Returns true if a primitive's rectangle overlaps another primitive's rectangle. @@ -25259,23 +38194,45 @@ Follows is a source code listing for all files that have been open sourced. This Geometry.point_inside_circle? self, circle_center_point, radius end + def self.center_inside_rect rect, other_rect + offset_x = (other_rect.w - rect.w).half + offset_y = (other_rect.h - rect.h).half + new_rect = rect.shift_rect(0, 0) + new_rect.x = other_rect.x + offset_x + new_rect.y = other_rect.y + offset_y + new_rect + rescue Exception => e + raise e, <<-S + * ERROR: + center_inside_rect for self #{self} and other_rect #{other_rect}. Failed with exception #{e}. + S + end + def center_inside_rect other_rect - offset_x = (other_rect.w - w).half - offset_y = (other_rect.h - h).half - new_rect = self.shift_rect(0, 0) + Geometry.center_inside_rect self, other_rect + end + + def self.center_inside_rect_x rect, other_rect + offset_x = (other_rect.w - rect.w).half + new_rect = rect.shift_rect(0, 0) new_rect.x = other_rect.x + offset_x - new_rect.y = other_rect.y + offset_y + new_rect.y = other_rect.y new_rect 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_x for self #{self} and other_rect #{other_rect}. Failed with exception #{e}. S end - def center_inside_rect_y other_rect - offset_y = (other_rect.h - h).half - new_rect = self.shift_rect(0, 0) + def center_inside_rect_x other_rect + Geometry.center_inside_rect_x self, other_rect + end + + def self.center_inside_rect_y rect, other_rect + offset_y = (other_rect.h - rect.h).half + new_rect = rect.shift_rect(0, 0) + new_rect.x = other_rect.x new_rect.y = other_rect.y + offset_y new_rect rescue Exception => e @@ -25285,18 +38242,11 @@ Follows is a source code listing for all files that have been open sourced. This S end - def center_inside_rect_x other_rect - offset_x = (other_rect.w - w).half - new_rect = self.shift_rect(0, 0) - new_rect.x = other_rect.x + offset_x - new_rect - rescue Exception => e - raise e, <<-S - * ERROR: - center_inside_rect_x for self #{self} and other_rect #{other_rect}. Failed with exception #{e}. - S + def center_inside_rect_y other_rect + Geometry.center_inside_rect_y self, other_rect end + # Returns a primitive that is anchored/repositioned based off its retangle. # @gtk def anchor_rect anchor_x, anchor_y @@ -25353,10 +38303,27 @@ Follows is a source code listing for all files that have been open sourced. This # @gtk def self.line_slope line, replace_infinity: nil + return replace_infinity if line.x2 == line.x (line.y2 - line.y).fdiv(line.x2 - line.x) .replace_infinity(replace_infinity) end + def self.line_rise_run line + rise = (line.y2 - line.y).to_f + run = (line.x2 - line.x).to_f + if rise.abs > run.abs && rise != 0 + rise = rise.fdiv rise.abs + run = run.fdiv rise.abs + elsif run.abs > rise.abs && run != 0 + rise = rise.fdiv run.abs + run = run.fdiv run.abs + else + rise = rise / rise.abs if rise != 0 + run = run / run.abs if run != 0 + end + return { x: run , y: rise } + end + # @gtk def self.ray_test point, line slope = (line.y2 - line.y).fdiv(line.x2 - line.x) @@ -25422,8 +38389,8 @@ Follows is a source code listing for all files that have been open sourced. This return false if rect_one.bottom + tolerance > rect_two.top - tolerance return true rescue Exception => e - context_help_rect_one = (rect_one.help_contract_implementation contract_intersect_rect?)[:not_implemented_methods] - context_help_rect_two = (rect_two.help_contract_implementation contract_intersect_rect?)[:not_implemented_methods] + context_help_rect_one = (rect_one.__help_contract_implementation contract_intersect_rect?)[:not_implemented_methods] + context_help_rect_two = (rect_two.__help_contract_implementation contract_intersect_rect?)[:not_implemented_methods] context_help = "" if context_help_rect_one && context_help_rect_one.length > 0 context_help += <<-S @@ -25491,11 +38458,11 @@ Follows is a source code listing for all files that have been open sourced. This end # @gtk - def self.inside_rect? inner_rect, outer_rect - inner_rect.x >= outer_rect.x && - inner_rect.right <= outer_rect.right && - inner_rect.y >= outer_rect.y && - inner_rect.top <= outer_rect.top + def self.inside_rect? inner_rect, outer_rect, tolerance = 0.0 + inner_rect.x + tolerance >= outer_rect.x - tolerance && + inner_rect.right - tolerance <= outer_rect.right + tolerance && + inner_rect.y + tolerance >= outer_rect.y - tolerance && + inner_rect.top - tolerance <= outer_rect.top + tolerance rescue Exception => e raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}." end @@ -25553,7 +38520,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* grid.rb +*** grid.rb #+begin_src ruby # ./dragon/grid.rb # coding: utf-8 @@ -25748,7 +38715,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* inputs.rb +*** inputs.rb #+begin_src ruby # ./dragon/inputs.rb # coding: utf-8 @@ -25782,6 +38749,11 @@ Follows is a source code listing for all files that have been open sourced. This :q, :r, :s, :t, :u, :v, :w, :x, :y, :z, :shift, :control, :alt, :meta, + :shift_left, :shift_right, + :control_left, :control_right, + :alt_left, :alt_right, + :meta_left, :meta_right, + :home, :end, :left, :right, :up, :down, :pageup, :pagedown, :char, :plus, :at, :forward_slash, :back_slash, :asterisk, :less_than, :greater_than, :carat, :ampersand, :superscript_two, @@ -25796,7 +38768,10 @@ Follows is a source code listing for all files that have been open sourced. This raw_key == 1073741905 || raw_key == 1073741906 || raw_key == 1073741899 || - raw_key == 1073741902 + raw_key == 1073741902 || + raw_key == 1073741898 || + raw_key == 1073741901 || + (raw_key >= 1073742048 && raw_key <= 1073742055) # Modifier Keys char = KeyboardKeys.char_with_shift raw_key, modifier names = KeyboardKeys.char_to_method char, raw_key @@ -25840,32 +38815,32 @@ Follows is a source code listing for all files that have been open sourced. This def self.char_to_method_hash @char_to_method ||= { - 'A' => [:a, :shift], - 'B' => [:b, :shift], - 'C' => [:c, :shift], - 'D' => [:d, :shift], - 'E' => [:e, :shift], - 'F' => [:f, :shift], - 'G' => [:g, :shift], - 'H' => [:h, :shift], - 'I' => [:i, :shift], - 'J' => [:j, :shift], - 'K' => [:k, :shift], - 'L' => [:l, :shift], - 'M' => [:m, :shift], - 'N' => [:n, :shift], - 'O' => [:o, :shift], - 'P' => [:p, :shift], - 'Q' => [:q, :shift], - 'R' => [:r, :shift], - 'S' => [:s, :shift], - 'T' => [:t, :shift], - 'U' => [:u, :shift], - 'V' => [:v, :shift], - 'W' => [:w, :shift], - 'X' => [:x, :shift], - 'Y' => [:y, :shift], - 'Z' => [:z, :shift], + 'A' => [:a], + 'B' => [:b], + 'C' => [:c], + 'D' => [:d], + 'E' => [:e], + 'F' => [:f], + 'G' => [:g], + 'H' => [:h], + 'I' => [:i], + 'J' => [:j], + 'K' => [:k], + 'L' => [:l], + 'M' => [:m], + 'N' => [:n], + 'O' => [:o], + 'P' => [:p], + 'Q' => [:q], + 'R' => [:r], + 'S' => [:s], + 'T' => [:t], + 'U' => [:u], + 'V' => [:v], + 'W' => [:w], + 'X' => [:x], + 'Y' => [:y], + 'Z' => [:z], "!" => [:exclamation_point], "0" => [:zero], "1" => [:one], @@ -25916,18 +38891,29 @@ Follows is a source code listing for all files that have been open sourced. This "?" => [:question_mark], '%' => [:percent_sign], "º" => [:ordinal_indicator], + 1073741898 => [:home], + 1073741901 => [:end], 1073741903 => [:right], 1073741904 => [:left], 1073741905 => [:down], 1073741906 => [:up], 1073741899 => [:pageup], 1073741902 => [:pagedown], - 127 => [:delete] + 127 => [:delete], + 1073742049 => [:shift_left, :shift], + 1073742053 => [:shift_right, :shift], + 1073742048 => [:control_left, :control], + 1073742052 => [:control_right, :control], + 1073742050 => [:alt_left, :alt], + 1073742054 => [:alt_right, :alt], + 1073742051 => [:meta_left, :meta], + 1073742055 => [:meta_right, :meta] } end def self.char_to_method char, int = nil - char_to_method_hash[char] || char_to_method_hash[int] || [char.to_sym || int] + methods = char_to_method_hash[char] || char_to_method_hash[int] + methods ? methods.dup : [char.to_sym || int] end def clear @@ -26259,6 +39245,10 @@ Follows is a source code listing for all files that have been open sourced. This point.point_inside_circle? center, radius end + def intersect_rect? other_rect + { x: point.x, y: point.y, w: 0, h: 0 }.intersect_rect? other_rect + end + alias_method :position, :point def clear @@ -26316,14 +39306,20 @@ Follows is a source code listing for all files that have been open sourced. This attr_accessor :moved, :moved_at, :global_moved_at, + :down_at, + :global_down_at, :touch_order, + :first_tick_down, :x, :y def initialize @moved = false @moved_at = 0 @global_moved_at = 0 + @down_at = 0 + @global_down_at = 0 @touch_order = 0 + @first_tick_down = true @x = 0 @y = 0 end @@ -26349,6 +39345,9 @@ Follows is a source code listing for all files that have been open sourced. This result[:touch_order] = @touch_order result[:moved] = @moved result[:moved_at] = @moved_at + result[:global_moved_at] = @global_moved_at + result[:down_at] = @down_at + result[:global_down_at] = @global_down_at result end @@ -26379,6 +39378,10 @@ Follows is a source code listing for all files that have been open sourced. This # @gtk attr_reader :mouse + # @return [HTTPRequest[]] + # @gtk + attr_accessor :http_requests + # @return {FingerTouch} # @gtk attr_reader :touch @@ -26395,6 +39398,7 @@ Follows is a source code listing for all files that have been open sourced. This @finger_one = nil @finger_two = nil @text = [] + @http_requests = [] end def up @@ -26470,6 +39474,7 @@ Follows is a source code listing for all files that have been open sourced. This @keyboard.clear @controllers.each(&:clear) @touch.clear + @http_requests.clear @finger_one = nil @finger_two = nil end @@ -26489,7 +39494,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* ios_wizard.rb +*** ios_wizard.rb #+begin_src ruby # ./dragon/ios_wizard.rb # Copyright 2019 DragonRuby LLC @@ -26514,21 +39519,49 @@ Follows is a source code listing for all files that have been open sourced. This end def steps + @steps ||= [] + end + + def steps_development_build [ :check_for_xcode, :check_for_brew, :check_for_certs, :check_for_device, :check_for_dev_profile, + :determine_team_identifier, + :determine_app_name, + :determine_app_id, + :blow_away_temp, + :stage_app, + :development_write_info_plist, + :write_entitlements_plist, + :compile_icons, + :create_payload_directory, + :code_sign_payload, + :create_ipa, + :deploy + ] + end + + def steps_production_build + [ + :check_for_xcode, + :check_for_brew, + :check_for_certs, + :check_for_distribution_profile, + :determine_team_identifier, :determine_app_name, :determine_app_id, :blow_away_temp, :stage_app, - :write_info_plist, + :production_write_info_plist, :write_entitlements_plist, - :code_sign, + :compile_icons, + :create_payload_directory, + :code_sign_payload, :create_ipa, - :deploy, + :print_publish_help ] end @@ -26547,36 +39580,45 @@ Follows is a source code listing for all files that have been open sourced. This sprite_path end - def start + def start opts = nil + @opts = opts || {} + + if !(@opts.is_a? Hash) || !($gtk.args.fn.eq_any? @opts[:env], :dev, :prod) + raise WizardException.new( + "* $wizards.ios.start needs to be provided an environment option.", + "** For development builds type: $wizards.ios.start env: :dev", + "** For production builds type: $wizards.ios.start env: :prod" + ) + end + + @production_build = (@opts[:env] == :prod) + @steps = steps_development_build + @steps = steps_production_build if @production_build @certificate_name = nil init_wizard_status log_info "Starting iOS Wizard so we can deploy to your device." @start_at = Kernel.global_tick_count steps.each do |m| - begin - result = (send m) || :success if @wizard_status[m][:result] != :success - @wizard_status[m][:result] = result - rescue Exception => e - if e.is_a? WizardException - $console.log.clear - $console.archived_log.clear - log "=" * $console.console_text_width - e.console_primitives.each do |p| - $console.add_primitive p - end - log "=" * $console.console_text_width - else - log_error "Step #{m} failed." - log_error e.to_s - end - - $console.set_command "$wizards.ios.start" - - break + log_info "Running step ~:#{m}~." + result = (send m) || :success if @wizard_status[m][:result] != :success + @wizard_status[m][:result] = result + log_info "Running step ~:#{m}~ complete." + end + nil + rescue Exception => e + if e.is_a? WizardException + $console.log.clear + $console.archived_log.clear + log "=" * $console.console_text_width + e.console_primitives.each do |p| + $console.add_primitive p end + log "=" * $console.console_text_width + else + log_error e.to_s end - return nil + $console.set_command "$wizards.ios.start env: :#{@opts[:env]}" end def always_fail @@ -26633,8 +39675,31 @@ Follows is a source code listing for all files that have been open sourced. This start end + def check_for_distribution_profile + @provisioning_profile_path = "profiles/distribution.mobileprovision" + if !($gtk.read_file @provisioning_profile_path) + $gtk.system "mkdir -p #{relative_path}/profiles" + $gtk.system "open #{relative_path}/profiles" + $gtk.system "echo Download the mobile provisioning profile and place it here with the name distribution.mobileprovision > #{relative_path}/profiles/README.txt" + raise WizardException.new( + "* I didn't find a mobile provision.", + "** 1. Go to http://developer.apple.com and click \"Certificates, IDs & Profiles\".", + "** 2. Add an App Identifier.", + "** 3. Select the App IDs option from the list.", + { w: 700, h: 75, path: get_reserved_sprite("identifiers.png") }, + "** 4. Add your Device next. You can use idevice_id -l to get the UUID of your device.", + { w: 365, h: 69, path: get_reserved_sprite("device-link.png") }, + "** 5. Create a Profile. Associate your certs, id, and device.", + { w: 300, h: 122, path: get_reserved_sprite("profiles.png") }, + "** 6. Download the mobile provision and save it to 'profiles/development.mobileprovision'.", + { w: 200, h: 124, path: get_reserved_sprite("profiles-folder.png") }, + ) + end + end + def check_for_dev_profile - if !($gtk.read_file 'profiles/development.mobileprovision') + @provisioning_profile_path = "profiles/development.mobileprovision" + if !($gtk.read_file @provisioning_profile_path) $gtk.system "mkdir -p #{relative_path}/profiles" $gtk.system "open #{relative_path}/profiles" $gtk.system "echo Download the mobile provisioning profile and place it here with the name development.mobileprovision > #{relative_path}/profiles/README.txt" @@ -26654,13 +39719,23 @@ Follows is a source code listing for all files that have been open sourced. This end end + def provisioning_profile_path environment + return "profiles/distribution.mobileprovision" if environment == :prod + return "profiles/development.mobileprovision" + end + + def determine_team_identifier + @team_name = (team_identifier_from_provisioning_profile @opts[:env]) + log_info "Team Identifer is: #{@team_name}" + end + def determine_app_name - @app_name = dev_profile_xml[:children].first[:children].first[:children][1][:children].first[:data] + @app_name = (provisioning_profile_xml @opts[:env])[:children].first[:children].first[:children][1][:children].first[:data] log_info "App name is: #{@app_name}." end - def dev_profile_xml - xml = $gtk.read_file 'profiles/development.mobileprovision' + def provisioning_profile_xml environment + xml = $gtk.read_file (provisioning_profile_path environment) scrubbed = xml.each_line.map do |l| if l.strip.start_with? "<" if l.start_with? '' @@ -26679,9 +39754,36 @@ 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 - # lol - @app_id = dev_profile_xml[:children].first[:children].first[:children][13][:children][1][:children].first[:data] + @app_id = app_id_from_provisioning_profile @opts[:env] + log_info "App Identifier is set to : #{@app_id}" end @@ -26695,7 +39797,7 @@ Follows is a source code listing for all files that have been open sourced. This log_error "I couldn't find a development profile at #{path}." ask_for_dev_profile else - @dev_profile_path = path + @provisioning_profile_path = path start end end @@ -26762,8 +39864,12 @@ Follows is a source code listing for all files that have been open sourced. This raise "You do not have any Apple development certs on this computer." end - @certificate_name = valid_certs.first[:name] - log_info "I will be using '#{@certificate_name}' to deploy to your device." + if @production_build + @certificate_name = valid_certs.find_all { |f| f[:name].include? "Distribution" }.first[:name] + else + @certificate_name = valid_certs.find_all { |f| f[:name].include? "Development" }.first[:name] + end + log_info "I will be using Certificate: '#{@certificate_name}'." end def idevice_id_cli_app @@ -26780,7 +39886,7 @@ Follows is a source code listing for all files that have been open sourced. This def valid_certs certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l| - if l.include?(")") && !l.include?("Developer ID") && l.include?("Development") + if l.include?(")") && !l.include?("Developer ID") && (l.include?("Development") || l.include?("Distribution")) l.strip else nil @@ -26807,22 +39913,37 @@ Follows is a source code listing for all files that have been open sourced. This end def write_entitlements_plist - entitlement_plist_string = <<-XML + if @production_build + entitlement_plist_string = <<-XML + + + + + application-identifier + :app_id + beta-reports-active + + + + XML + else + entitlement_plist_string = <<-XML - - application-identifier - :app_id - get-task-allow - - + + application-identifier + :app_id + get-task-allow + + XML + end log_info "Creating Entitlements.plist" - $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", @app_id).strip + $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_name}.#{@app_id}").strip sh "/usr/bin/plutil -convert binary1 \"#{tmp_directory}/Entitlements.plist\"" sh "/usr/bin/plutil -convert xml1 \"#{tmp_directory}/Entitlements.plist\"" @@ -26830,19 +39951,130 @@ Follows is a source code listing for all files that have been open sourced. This @entitlement_plist_written = true end - def code_sign - sh "cp #{@dev_profile_path} \"#{app_path}/embedded.mobileprovision\"" - + def code_sign_payload log_info "Signing app with #{@certificate_name}." - sh "/usr/bin/plutil -convert binary1 \"#{app_path}/Info.plist\"" - - 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\"" + 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}/ipa_root/Payload/#{@app_name}.app\"" + 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}/ipa_root/Payload/#{@app_name}.app/Runtime\"" @code_sign_completed = true end - def write_info_plist + def write_info_plist_distribution + log_info "Adding Info.plist." + + <<-XML + + + + + BuildMachineOSBuild + 20D91 + CFBundleDevelopmentRegion + en + CFBundleName + :app_name + CFBundleDisplayName + A Dark Room + CFBundleIdentifier + :app_id + CFBundleExecutable + :app_name + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + 5.6 + CFBundleSignature + ???? + CFBundleVersion + 5.6 + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconName + AppIcon + CFBundleIconFiles + + AppIcon60x60 + + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconName + AppIcon + CFBundleIconFiles + + AppIcon60x60 + AppIcon76x76 + AppIcon83.5x83.5 + + + + UILaunchStoryboardName + SimpleSplash + UIRequiresFullScreen + + ITSAppUsesNonExemptEncryption + + UIRequiredDeviceCapabilities + + arm64 + + MinimumOSVersion + 10.3 + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleIconFiles + + AppIcon20x20 + AppIcon29x29 + AppIcon40x40 + AppIcon60x60 + + UIDeviceFamily + + 1 + 2 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UIStatusBarStyle + UIStatusBarStyleDefault + UIBackgroundModes + + + DTXcode + 0124 + DTXcodeBuild + 12D4e + DTSDKName + iphoneos14.4 + DTSDKBuild + 18D46 + DTPlatformName + iphoneos + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformVersion + 14.4 + DTPlatformBuild + 18D46 + + + XML + end + + def development_write_info_plist log_info "Adding Info.plist." info_plist_string = <<-XML @@ -26865,165 +40097,289 @@ Follows is a source code listing for all files that have been open sourced. This - BuildMachineOSBuild - 19C57 - CFBundleDevelopmentRegion - en - CFBundleDisplayName - :app_name - CFBundleExecutable - Runtime - CFBundleIconFiles - - AppIcon60x60 - - CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - AppIcon60x60 - - CFBundleIconName - AppIcon - - - CFBundleIcons~ipad - - CFBundlePrimaryIcon - - CFBundleIconFiles - - AppIcon60x60 - AppIcon76x76 - - CFBundleIconName - AppIcon - - - CFBundleIdentifier - com.carlile.swisscheese - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - :app_name - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - iPhoneOS - - CFBundleVersion - 1.0 - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 17B102 - DTPlatformName - iphoneos - DTPlatformVersion - 13.2 - DTSDKBuild - 17B102 - DTSDKName - iphoneos13.2 - DTXcode - 01131 - DTXcodeBuild - 11C505 - ITSAppUsesNonExemptEncryption - - MinimumOSVersion - 11.0 - UIAppFonts - - UIBackgroundModes - - UIDeviceFamily - - 1 - 2 - - UILaunchImages - - - UILaunchImageMinimumOSVersion - 11.0 - UILaunchImageName - LaunchImage-1100-Portrait-2436h - UILaunchImageOrientation - Portrait - UILaunchImageSize - {375, 812} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - LaunchImage-800-Portrait-736h - UILaunchImageOrientation - Portrait - UILaunchImageSize - {414, 736} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - LaunchImage-800-667h - UILaunchImageOrientation - Portrait - UILaunchImageSize - {375, 667} - - - UILaunchImageMinimumOSVersion - 7.0 - UILaunchImageName - LaunchImage-700 - UILaunchImageOrientation - Portrait - UILaunchImageSize - {320, 480} - - - UILaunchImageMinimumOSVersion - 7.0 - UILaunchImageName - LaunchImage-700-568h - UILaunchImageOrientation - Portrait - UILaunchImageSize - {320, 568} - - - UILaunchImageMinimumOSVersion - 7.0 - UILaunchImageName - LaunchImage-700-Portrait - UILaunchImageOrientation - Portrait - UILaunchImageSize - {768, 1024} - - - UIRequiredDeviceCapabilities - - arm64 - - UIRequiresFullScreen - - UIStatusBarStyle - UIStatusBarStyleDefault - UISupportedInterfaceOrientations - - #{device_orientation_xml} - + BuildMachineOSBuild + 20D91 + CFBundleDevelopmentRegion + en + CFBundleDisplayName + :app_name + CFBundleExecutable + Runtime + CFBundleIconFiles + + AppIcon60x60 + + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon60x60 + + CFBundleIconName + AppIcon + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon60x60 + AppIcon76x76 + AppIcon83.5x83.5 + + CFBundleIconName + AppIcon + + + CFBundleIdentifier + :app_id + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + :app_name + CFBundlePackageType + APPL + CFBundleShortVersionString + 5.2 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 5.2 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 18D46 + DTPlatformName + iphoneos + DTPlatformVersion + 14.4 + DTSDKBuild + 18D46 + DTSDKName + iphoneos14.4 + DTXcode + 0124 + DTXcodeBuild + 12D4e + MinimumOSVersion + 14.4 + UIAppFonts + + UIBackgroundModes + + UIDeviceFamily + + 1 + 2 + + UILaunchImages + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-568h@2x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {320, 568} + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-667h@2x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {375, 667} + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-736h@3x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {414, 736} + + + UILaunchStoryboardName + SimpleSplash + UIRequiredDeviceCapabilities + + arm64 + + UIRequiresFullScreen + + UIStatusBarStyle + UIStatusBarStyleDefault + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeRight + + + + XML + + # UIInterfaceOrientationPortrait + # UIInterfaceOrientationLandscapeRight + + info_plist_string.gsub!(":app_name", @app_name) + info_plist_string.gsub!(":app_id", @app_id) + + $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip + + @info_plist_written = true + end + + def production_write_info_plist + log_info "Adding Info.plist." + + info_plist_string = <<-XML + + + + + BuildMachineOSBuild + 20D91 + CFBundleDevelopmentRegion + en + CFBundleDisplayName + :app_name + CFBundleExecutable + Runtime + CFBundleIconFiles + + AppIcon60x60 + + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon60x60 + + CFBundleIconName + AppIcon + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon60x60 + AppIcon76x76 + AppIcon83.5x83.5 + + CFBundleIconName + AppIcon + + + CFBundleIdentifier + :app_id + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + :app_name + CFBundlePackageType + APPL + CFBundleShortVersionString + 5.2 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 5.2 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 18D46 + DTPlatformName + iphoneos + DTPlatformVersion + 14.4 + DTSDKBuild + 18D46 + DTSDKName + iphoneos14.4 + DTXcode + 0124 + DTXcodeBuild + 12D4e + MinimumOSVersion + 14.4 + UIAppFonts + + UIBackgroundModes + + UIDeviceFamily + + 1 + 2 + + UILaunchImages + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-568h@2x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {320, 568} + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-667h@2x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {375, 667} + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-736h@3x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {414, 736} + + + UILaunchStoryboardName + SimpleSplash + UIRequiredDeviceCapabilities + + arm64 + + UIRequiresFullScreen + + UIStatusBarStyle + UIStatusBarStyleDefault + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeRight + XML @@ -27031,7 +40387,10 @@ Follows is a source code listing for all files that have been open sourced. This # UIInterfaceOrientationPortrait # UIInterfaceOrientationLandscapeRight - $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.gsub(":app_name", @app_name).strip + info_plist_string.gsub!(":app_name", @app_name) + info_plist_string.gsub!(":app_id", @app_id) + + $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip @info_plist_written = true end @@ -27057,7 +40416,9 @@ Follows is a source code listing for all files that have been open sourced. This $gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip end - def create_ipa + 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\"" @@ -27073,18 +40434,11 @@ Follows is a source code listing for all files that have been open sourced. This 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\"" + end + + def create_ipa do_zip sh "cp \"#{tmp_directory}/ipa_root/archive.zip\" \"#{tmp_directory}/#{@app_name}.ipa\"" - sh "XCODE_DIR=\"/Applications/Xcode.app/Contents/Developer\" \"#{relative_path}/dragonruby-deploy-ios\" -d \"#{@device_id}\" \"#{tmp_directory}/#{@app_name}.ipa\"" - cmd_result = `ps -e | grep civetweb` - is_civet_running = (`ps -e | grep civetweb`).strip.each_line.to_a.length > 2 - if !is_civet_running - $gtk.system "cp \"#{relative_path}/civetweb\" \"#{tmp_directory}/../src_backup/civetweb\"" - $gtk.system "open \"#{tmp_directory}/../src_backup/civetweb\" -g" - else - log "* INFO: civetweb is running already running. No need to start another instance." - end - log_info "Check your device!!" end def do_zip @@ -27107,12 +40461,40 @@ Follows is a source code listing for all files that have been open sourced. This end def deploy + sh "XCODE_DIR=\"/Applications/Xcode.app/Contents/Developer\" \"#{relative_path}/dragonruby-deploy-ios\" -d \"#{@device_id}\" \"#{tmp_directory}/#{@app_name}.ipa\"" + log_info "Check your device!!" + 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" + end + + def compile_icons + cmd = <<-S + "/Applications/Xcode.app/Contents/Developer/usr/bin/actool" --output-format human-readable-text \ + --notices --warnings --platform iphoneos \ + --minimum-deployment-target 10.3 \ + --target-device iphone \ + --target-device ipad --app-icon 'AppIcon' \ + --output-partial-info-plist '#{app_path}/AssetCatalog-Info.plist' \ + --compress-pngs --compile "#{app_path}" \ + "#{app_path}/Assets.xcassets" + S + sh cmd + end + + def stage_native_libs + 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 end #+end_src -* itch_wizard.rb +*** itch_wizard.rb #+begin_src ruby # ./dragon/itch_wizard.rb # Copyright 2019 DragonRuby LLC @@ -27209,7 +40591,7 @@ Follows is a source code listing for all files that have been open sourced. This end if metadata[:icon].start_with?("#") || !@icon - log "* PROPT: Please provide icon path for your game." + log "* PROMPT: Please provide icon path for your game." $console.set_command "$wizards.itch.set_icon \"icon.png\"" return :need_icon end @@ -27386,7 +40768,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* layout.rb +*** layout.rb #+begin_src ruby # ./dragon/layout.rb # Copyright 2019 DragonRuby LLC @@ -27750,6 +41132,18 @@ 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[:row] = opts[:row] + result[:col] = opts[:col] + + if $gtk.args.grid.name == :center + result[:x] -= 640 + result[:y] -= 360 + end + result end @@ -27871,7 +41265,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* log.rb +*** log.rb #+begin_src ruby # ./dragon/log.rb # coding: utf-8 @@ -28141,7 +41535,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* numeric.rb +*** numeric.rb #+begin_src ruby # ./dragon/numeric.rb # coding: utf-8 @@ -28153,8 +41547,12 @@ Follows is a source code listing for all files that have been open sourced. This include ValueType include NumericDeprecated + alias_method :gt, :> alias_method :gte, :>= + alias_method :lt, :< alias_method :lte, :<= + alias_method :__original_eq_eq__, :== unless Numeric.instance_methods.include? :__original_eq_eq__ + # Converts a numeric value representing seconds into frames. # @@ -28174,6 +41572,23 @@ Follows is a source code listing for all files that have been open sourced. This clamp(0, 255).to_i end + def clamp_wrap min, max + max, min = min, max if min > max + return self if self >= min && self <= max + return min if min == max + if self < min + overflow = min - self + return (max - overflow).clamp_wrap min, max + end + + if self > max + overflow = self - max + return (min + overflow).clamp_wrap min, max + end + + return self + end + def elapsed_time tick_count_override = nil (tick_count_override || Kernel.tick_count) - self end @@ -28427,16 +41842,18 @@ Follows is a source code listing for all files that have been open sourced. This vector_y max_value end - # @gtk def mod n self % n end - # @gtk def mod_zero? *ns ns.any? { |n| mod(n) == 0 } end + def zmod? n + (self % n) == 0 + end + def mult n self * n end @@ -28543,42 +41960,81 @@ Follows is a source code listing for all files that have been open sourced. This return gte other end - def > other - return false if !other - return gt other + def > other + return false if !other + return gt other + end + + def <= other + return false if !other + return lte other + end + + def < other + return false if !other + return gt other + end + + 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? + raise <<-S + * ERROR: + A block is required for Numeric#map. + + S + end + + self.to_i.times.map do + yield + end + end + + def each + unless block_given? + raise <<-S + * ERROR: + A block is required for Numeric#each. + + S + end + + self.to_i.times do + yield + end end - def <= other - return false if !other - return lte other - end + def times_with_index + unless block_given? + raise <<-S + * ERROR: + A block is required for Numeric#times_with_index. - def < other - return false if !other - return gt other - end + S + end - alias_method(:original_eq_eq, :==) unless Numeric.instance_methods.include?(:original_eq_eq) - def == other - return true if self.original_eq_eq(other) - if other.is_a?(OpenEntity) - return self.original_eq_eq(other.entity_id) + self.to_i.times.with_index do |i| + yield i end - return self.original_eq_eq(other) end - # @gtk - def map + def each_with_index unless block_given? raise <<-S * ERROR: - A block is required for Numeric#map. + A block is required for Numeric#each_with_index. S end - self.to_i.times.map do - yield + self.to_i.times.with_index do |i| + yield i end end @@ -28597,69 +42053,82 @@ Follows is a source code listing for all files that have been open sourced. This end end - def check_numeric! sender, other - return if other.is_a? Numeric - + def __raise_arithmetic_exception__ other, m, e raise <<-S * ERROR: - Attempted to invoke :+ on #{self} with the right hand argument of: + Attempted to invoke :#{m} on #{self} with the right hand argument of: #{other} The object above is not a Numeric. + #{e} S end def - other return nil unless other - check_numeric! :-, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :-, e end def + other return nil unless other - check_numeric! :+, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :+, e end def * other return nil unless other - check_numeric! :*, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :*, e end def / other return nil unless other - check_numeric! :/, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :/, e end def serialize self end + def self.from_top n + return 720 - n unless $gtk + $gtk.args.grid.top - n + end + def from_top - return 720 - self unless $gtk - $gtk.args.grid.h - self + Numeric.from_top self + end + + def self.from_right n + return 1280 - n unless $gtk + $gtk.args.grid.right - n end def from_right - return 1280 - self unless $gtk - $gtk.args.grid.w - self + Numeric.from_right self + end + + def self.clamp n, min, max + n.clamp min, max end end class Fixnum include ValueType - alias_method(:original_eq_eq, :==) unless Fixnum.instance_methods.include?(:original_eq_eq) - - def - other - return nil unless other - check_numeric! :-, other - super - end + alias_method :__original_eq_eq__, :== unless Fixnum.instance_methods.include? :__original_eq_eq__ + alias_method :__original_add__, :+ unless Fixnum.instance_methods.include? :__original_add__ + alias_method :__original_subtract__, :- unless Fixnum.instance_methods.include? :__original_subtract__ + alias_method :__original_multiply__, :* unless Fixnum.instance_methods.include? :__original_multiply__ + alias_method :__original_divide__, :- unless Fixnum.instance_methods.include? :__original_divide__ # Returns `true` if the numeric value is evenly divisible by 2. # @@ -28677,28 +42146,36 @@ Follows is a source code listing for all files that have been open sourced. This def + other return nil unless other - check_numeric! :+, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :+, e end def * other return nil unless other - check_numeric! :*, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :*, e end def / other return nil unless other - check_numeric! :/, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :/, e + end + + def - other + return nil unless other + super + rescue Exception => e + __raise_arithmetic_exception__ other, :-, e end def == other - return true if self.original_eq_eq(other) - if other.is_a?(GTK::OpenEntity) - return self.original_eq_eq(other.entity_id) - end - return self.original_eq_eq(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 @@ -28738,33 +42215,50 @@ Follows is a source code listing for all files that have been open sourced. This def sin Math.sin(self.to_radians) end + + def to_sf + "%.2f" % self + end + + def ifloor int + (self.idiv int.to_i) * int.to_i + end end class Float include ValueType + alias_method :__original_add__, :+ unless Float.instance_methods.include? :__original_add__ + alias_method :__original_subtract__, :- unless Float.instance_methods.include? :__original_subtract__ + alias_method :__original_multiply__, :* unless Float.instance_methods.include? :__original_multiply__ + alias_method :__original_divide__, :- unless Float.instance_methods.include? :__original_divide__ + def - other return nil unless other - check_numeric! :-, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :-, e end def + other return nil unless other - check_numeric! :+, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :+, e end def * other return nil unless other - check_numeric! :*, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :*, e end def / other return nil unless other - check_numeric! :/, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :/, e end def serialize @@ -28784,19 +42278,376 @@ Follows is a source code listing for all files that have been open sourced. This return -scalar if self < 0 return scalar if self > 0 end + + def to_sf + "%.2f" % self + end + + def ifloor int + (self.idiv int.to_i) * int.to_i + end end class Integer - alias_method(:original_round, :round) unless Fixnum.instance_methods.include?(:original_round) + alias_method :__original_round__, :round unless Integer.instance_methods.include? :__original_round__ + alias_method :__original_add__, :+ unless Integer.instance_methods.include? :__original_add__ + alias_method :__original_subtract__, :- unless Integer.instance_methods.include? :__original_subtract__ + alias_method :__original_multiply__, :* unless Integer.instance_methods.include? :__original_multiply__ + alias_method :__original_divide__, :- unless Integer.instance_methods.include? :__original_divide__ def round *args - original_round + __original_round__ + end + + def nan? + false + end + end + +#+end_src + +*** remote_hotload_client.rb +#+begin_src ruby + # ./dragon/remote_hotload_client.rb + # coding: utf-8 + # Copyright 2019 DragonRuby LLC + # MIT License + # hotload_client.rb has been released under MIT (*only this file*). + + module GTK + class RemoteHotloadClient + attr :args + + def gtk + args.gtk + end + + def state + local_state + end + + def initialize local_ip_address + local_state.local_ip_address = local_ip_address + end + + def tick + return unless server_available? + return unless server_needed? + + if should_tick? && server_needed? && !local_state.notified + if server_available? + remote_log "* REMOTE CLIENT INFO: Hotload server found at #{get_server_ip_address}:9001." + end + local_state.notified = true + end + + tick_process_file_retrieval + tick_process_queue + tick_changes + tick_http_boot + end + + def should_tick? + (game_state.tick_count.mod_zero? 60) && game_state.tick_count > 5.seconds + end + + def game_state + args.state + end + + 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.", + changes: { }, + changes_queue: [], + reloaded_files_times: []) + @local_state.hotload_client + end + + def remote_log message + log message + args.gtk.http_post "http://#{get_server_ip_address}:9001/dragon/log/", { message: "=======\n#{message}\n=======\n" }, ["Content-Type: application/x-www-form-urlencoded"] + end + + def get_server_ip_address + return local_state.ip_address if local_state.ip_address + local_state.ip_address ||= ((gtk.read_file 'app/server_ip_address.txt') || "").strip + local_state.ip_address + end + + def server_available? + return false if gtk.platform == 'Emscripten' + get_server_ip_address.length != 0 + end + + def server_needed? + return false if gtk.platform == 'Emscripten' + local_state.local_ip_address != get_server_ip_address + end + + def tick_changes + return unless should_tick? + + local_state.greatest_tick ||= 0 + local_state.last_greatest_tick ||= 0 + + tick_http_changes + end + + def tick_http_boot + return if local_state.booted_at + + + if !local_state.http_boot + # first retrieve changes.txt which has the following format + # file with latest change, + # latest file update_time key + # tmp/src_backup/src_backup_app_main.rb, 1597926596, app/main.rb + local_state.http_boot = args.gtk.http_get "http://#{get_server_ip_address}:9001/dragon/boot/" + elsif local_state.http_boot && local_state.http_boot[:http_response_code] == 200 + local_state.last_greatest_tick = local_state.http_boot[:response_data].strip.to_i + local_state.greatest_tick = local_state.http_boot[:response_data].strip.to_i + local_state.booted_at = local_state.greatest_tick + remote_log '* REMOTE CLIENT INFO: HTTP GET for local_state. boot.txt succeeded.' + remote_log "* REMOTE CLIENT INFO: Looking for changes after: #{local_state.greatest_tick}." + elsif local_state.http_boot && local_state.http_boot[:http_response_code] == -1 && local_state.http_boot[:complete] + remote_log '* REMOTE CLIENT INFO: HTTP GET for boot.txt failed. Retrying.' + local_state.http_boot = nil + end + end + + def tick_http_changes + return unless local_state.booted_at + + if !local_state.http_changes + local_state.http_changes = args.gtk.http_get "http://#{get_server_ip_address}:9001/dragon/changes/" + end + + if local_state.http_changes && local_state.http_changes[:http_response_code] == 200 && local_state.booted_at + local_state.last_greatest_tick = local_state.greatest_tick + # if the retrieval of changes.txt was successful + local_state.http_changes[:response_data].each_line do |l| + if l.strip.length != 0 + # within reload state for that specific changes hash + # set the last time the file was updated + file_name, updated_at, key = l.strip.split(',') + file_name.strip! + updated_at.strip! + key.strip! + updated_at = updated_at.to_i + file_name = file_name.gsub("tmp/src_backup/", "") + + # keep an internal clock that denotes that current time on the + # dev machine + if updated_at > local_state.greatest_tick + local_state.greatest_tick = updated_at + + # create a new entry in change tracking for the file + # for every file where the file was last updated, find all the ones where the time is not the same + # and queue those to be retrieved and required + # if the last time the dev machine time was retrieved is less than the file time changed + # then queue the file for reload + current_updated_at = (local_state.changes[key] || { updated_at: 0 })[:updated_at] + if updated_at > current_updated_at + remote_log "* REMOTE CLIENT INFO: Queueing file #{file_name} for update." + local_state.changes[key] = { key: key, + latest_file: file_name, + updated_at: updated_at } + local_state.changes_queue << local_state.changes[key] + end + end + end + end + + # set the greatest tick/current time of the machine + local_state.http_changes = nil + elsif local_state.http_changes && local_state.http_changes[:http_response_code] == -1 && local_state.http_change[:complete] && local_state.booted_at + local_state.http_changes = nil + end + end + + def tick_process_queue + return if local_state.http_file_changes # don't pop a file off the queue if there is an http request in flight + return if local_state.processing_file_changes # don't pop a file if there is a file currently being processed + return unless local_state.changes_queue.length > 0 # return if the queue is empty + + # if it isn't empty, pop the first file off the queue (FIFO) + local_state.processing_file_changes = local_state.changes_queue.shift + + # create an http request for the file + url = "http://#{get_server_ip_address}:9001/dragon/#{local_state.processing_file_changes[:latest_file]}" + remote_log "* REMOTE CLIENT INFO: Getting new version of #{local_state.processing_file_changes[:latest_file]} (#{url})." + local_state.http_file_changes = args.gtk.http_get url + end + + def tick_process_file_retrieval + return if !local_state.http_file_changes + + # if the http request has finished successfully + if local_state.http_file_changes[:http_response_code] == 200 + file_key = local_state.processing_file_changes[:key] + # notify that a file will be reloaded + remote_log "* REMOTE CLIENT INFO: Loading #{file_key}: #{local_state.processing_file_changes[:latest_file]}" + remote_log "#{local_state.http_file_changes[:response_data]}" + + # write the latest file with what came back from the response data + gtk.write_file "#{file_key}", local_state.http_file_changes[:response_data] + + # nil out the currently processing file so a new item can be processed from the queue + # local_state.reloaded_files_times << local_state.processing_file_changes[:key] + local_state.http_file_changes = nil + local_state.processing_file_changes = nil + end + end end end #+end_src -* runtime/draw.rb +*** runtime/autocomplete.rb +#+begin_src ruby + # ./dragon/runtime/autocomplete.rb + # Copyright 2019 DragonRuby LLC + # MIT License + # autocomplete.rb has been released under MIT (*only this file*). + + module GTK + class Runtime + module Autocomplete + def autocomplete_parse opts + if opts[:file] && !opts[:text] + opts[:text] = read_file opts[:file] + end + + text = opts[:text] + index = opts[:index] + sum = 0 + lines = text.each_line.to_a.map do |l| + sum += l.length + { line: l, length: l.length, sum: sum } + end + cursor_line = lines.find { |l| l[:sum] >= index } + previous_line = lines.find { |l| l[:sum] < index } + previous_line ||= { sum: 0 } + if cursor_line + sub_index = index - previous_line[:sum] + word = (cursor_line[:line][0..sub_index - 1]).strip + token = (word.split " ")[-1] + dots = (token.split ".") + dot = dots[-1] + end + + { + text: opts[:text], + file: opts[:file], + index: opts[:index], + cursor_line: cursor_line, + previous_line: previous_line, + word: word, + token: token, + dots: dots, + dot: dot + } + end + + def autocomplete_filter_methods keys, *ignores + ignores ||= [] + ignores = [ignores].flatten + keys = keys.map { |k| k.to_s } + others = ["def", "end"] + + [ :entity_keys_by_ref, + :entity_name, + :as_hash, + :clear!, + :created_at_elapsed, + :entity_id, + "entity_id=", + "tick_count=", + :global_created_at_elapsed, + :load_entity_data!, + :meta, + :meta!, + :new?, + :old?, + :__original_eq_eq__, :set!, + :update_entity_keys_by_ref, + :with_meta] + + ignores + keys.find_all { |k| k.to_s.to_i.to_s == k.to_s } + + final = (keys - (others.map { |m| m.to_s })).uniq + final + end + + def suggest_autocompletion opts + parse_result = autocomplete_parse opts + return [] unless parse_result[:cursor_line] + text = parse_result[:text] + word = parse_result[:word] + token = parse_result[:token] + dots = parse_result[:dots] + dot = parse_result[:dot] + + return [] if word.strip.start_with? "#" + + if word[-1] == "." && token + lookup = { + 'args' => lambda { $gtk.args.autocomplete_methods }, + 'inputs' => lambda { $gtk.args.inputs.autocomplete_methods }, + 'geometry' => lambda { $gtk.args.geometry.autocomplete_methods }, + 'outputs' => lambda { $gtk.args.outputs.autocomplete_methods }, + 'layout' => lambda { $gtk.args.layouts.autocomplete_methods }, + 'keyboard' => lambda { $gtk.args.keyboard.autocomplete_methods }, + 'key_down' => lambda { $gtk.args.keyboard.key_down.autocomplete_methods }, + 'key_up' => lambda { $gtk.args.keyboard.key_up.autocomplete_methods }, + 'state' => lambda { $gtk.args.state.autocomplete_methods }, + 'fn' => lambda { $gtk.args.fn.autocomplete_methods }, + '$gtk' => lambda { $gtk.autocomplete_methods }, + 'gtk' => lambda { $gtk.autocomplete_methods }, + 'mouse' => lambda { $gtk.args.inputs.mouse.autocomplete_methods }, + 'click' => lambda { [:x, :y, :point] } + } + + lookup_result = lookup[dot] + + return autocomplete_filter_methods lookup_result.call if lookup_result + + start_collecting = false + dots_after_state = dots.find_all do |s| + if s == "state" + start_collecting = true + false + else + start_collecting + end + end + + target = $gtk.args.state + dots_after_state.each do |k| + target = target.as_hash[k.to_sym] if target.respond_to? :as_hash + end + + return autocomplete_filter_methods target.as_hash.keys + end + + + text.gsub!("[", " ") + text.gsub!("]", " ") + text.gsub!("(", " ") + text.gsub!(")", " ") + text.gsub!(":", "") + text.gsub!(".", " ") + text.gsub!("=", " ") + return (autocomplete_filter_methods (text.split " "), + :gtk, :false, :true, :args, :suppress_mailbox, :end) + end + end # end Autocomplete + end # end Runtime + end # end GTK + +#+end_src + +*** runtime/draw.rb #+begin_src ruby # ./dragon/runtime/draw.rb # Copyright 2019 DragonRuby LLC @@ -28817,115 +42668,131 @@ Follows is a source code listing for all files that have been open sourced. This # 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.value idx) # accessing an array using .value instead of [] is faster + 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 } idx = 0 - while idx < pass.static_solids.length - draw_solid (pass.static_solids.value idx) + length = pass.static_solids.length + while idx < length + draw_solid (pass.static_solids.at idx) idx += 1 end # pass.sprites.each { |s| draw_sprite s } idx = 0 - while idx < pass.sprites.length - draw_sprite (pass.sprites.value idx) + length = pass.sprites.length + while idx < length + draw_sprite (pass.sprites.at idx) idx += 1 end # pass.static_sprites.each { |s| draw_sprite s } idx = 0 - while idx < pass.static_sprites.length - draw_sprite (pass.static_sprites.value idx) + length = pass.static_sprites.length + while idx < length + draw_sprite (pass.static_sprites.at idx) idx += 1 end # pass.primitives.each { |p| draw_primitive p } idx = 0 - while idx < pass.primitives.length - draw_primitive (pass.primitives.value idx) + length = pass.primitives.length + while idx < length + draw_primitive (pass.primitives.at idx) idx += 1 end # pass.static_primitives.each { |p| draw_primitive p } idx = 0 - while idx < pass.static_primitives.length - draw_primitive (pass.static_primitives.value idx) + length = pass.static_primitives.length + while idx < length + draw_primitive (pass.static_primitives.at idx) idx += 1 end # pass.labels.each { |l| draw_label l } idx = 0 - while idx < pass.labels.length - draw_label (pass.labels.value idx) + length = pass.labels.length + while idx < length + draw_label (pass.labels.at idx) idx += 1 end # pass.static_labels.each { |l| draw_label l } idx = 0 - while idx < pass.static_labels.length - draw_label (pass.static_labels.value idx) + length = pass.static_labels.length + while idx < length + draw_label (pass.static_labels.at idx) idx += 1 end # pass.lines.each { |l| draw_line l } idx = 0 - while idx < pass.lines.length - draw_line (pass.lines.value idx) + length = pass.lines.length + while idx < length + draw_line (pass.lines.at idx) idx += 1 end # 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.value idx) + draw_line (pass.static_lines.at idx) idx += 1 end # pass.borders.each { |b| draw_border b } idx = 0 - while idx < pass.borders.length - draw_border (pass.borders.value idx) + length = pass.borders.length + while idx < length + draw_border (pass.borders.at idx) idx += 1 end # pass.static_borders.each { |b| draw_border b } idx = 0 - while idx < pass.static_borders.length - draw_border (pass.static_borders.value idx) + length = pass.static_borders.length + while idx < length + draw_border (pass.static_borders.at idx) idx += 1 end if !$gtk.production # pass.debug.each { |r| draw_primitive r } idx = 0 - while idx < pass.debug.length - draw_primitive (pass.debug.value idx) + length = pass.debug.length + while idx < length + draw_primitive (pass.debug.at idx) idx += 1 end # pass.static_debug.each { |r| draw_primitive r } idx = 0 - while idx < pass.static_debug.length - draw_primitive (pass.static_debug.value idx) + length = pass.static_debug.length + while idx < length + draw_primitive (pass.static_debug.at idx) idx += 1 end end # pass.reserved.each { |r| draw_primitive r } idx = 0 - while idx < pass.reserved.length - draw_primitive (pass.reserved.value idx) + length = pass.reserved.length + while idx < length + draw_primitive (pass.reserved.at idx) idx += 1 end # pass.static_reserved.each { |r| draw_primitive r } idx = 0 - while idx < pass.static_reserved.length - draw_primitive (pass.static_reserved.value idx) + length = pass.static_reserved.length + while idx < length + draw_primitive (pass.static_reserved.at idx) idx += 1 end rescue Exception => e @@ -29037,7 +42904,96 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* runtime/framerate_diagnostics.rb +*** runtime/framerate.rb +#+begin_src ruby + # ./dragon/runtime/framerate.rb + # Copyright 2019 DragonRuby LLC + # MIT License + # framerate.rb has been released under MIT (*only this file*). + + module GTK + class Runtime + module Framerate + def framerate_init + @tick_time = Time.new.to_i + end + + def delta_framerate + (current_framerate || 0) - (@previous_framerate || 0) + end + + def reset_framerate_calculation + @tick_speed_sum = 0 + @tick_speed_count = 0 + @previous_framerate = 0 + end + + def check_framerate + if @framerate_diagnostics_requested + log "================================" + log framerate_get_diagnostics + @framerate_diagnostics_requested = false + end + + if !@paused + if @tick_time + @tick_speed_count += 1 + @tick_speed_sum += Time.now.to_i - @tick_time + if @tick_speed_count > 60 * 2 + if framerate_below_threshold? + @last_framerate = current_framerate + if !@console.visible? + if !@framerate_important_notification_happened + log_important framerate_warning_message + else + log framerate_warning_message + end + @framerate_important_notification_happened = true + end + end + + @previous_framerate = current_framerate.floor + end + end + + @tick_time = Time.new.to_i + else + reset_framerate_calculation + end + rescue + reset_framerate_calculation + end + + def framerate_diagnostics + # request framerate diagnostics to be printed at the end of tick + @framerate_diagnostics_requested = true + end + + def framerate_below_threshold? + @last_framerate ||= 60 + current_framerate < @last_framerate && + current_framerate < 50 && + @previous_framerate > current_framerate && + Kernel.tick_count > 600 + end + + def current_framerate + return 60 if !@tick_speed_sum || !@tick_speed_sum + r = 100.fdiv(@tick_speed_sum.fdiv(@tick_speed_count) * 100) + if (r.nan? || r.infinite? || r > 58) + r = 60 + end + r || 60 + rescue + 60 + end + end # module Framerate + end # end class Runtime + end # end module GTK + +#+end_src + +*** runtime/framerate_diagnostics.rb #+begin_src ruby # ./dragon/runtime/framerate_diagnostics.rb # Copyright 2019 DragonRuby LLC @@ -29046,7 +43002,6 @@ Follows is a source code listing for all files that have been open sourced. This module GTK class Runtime - # @visibility private module FramerateDiagnostics def framerate_get_diagnostics <<-S @@ -29213,7 +43168,171 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* string.rb +*** runtime/hotload.rb +#+begin_src ruby + # ./dragon/runtime/hotload.rb + # coding: utf-8 + # Copyright 2019 DragonRuby LLC + # MIT License + # hotlaod.rb has been released under MIT (*only this file*). + + module GTK + class Runtime + # @visibility private + module Hotload + def hotload_init + @hotload_if_needed = 0 + @mailbox_if_needed = 0 + @file_mtimes = { } + @suppress_mailbox = true + files_to_reload.each { |f| init_mtimes f } + init_mtimes 'app/mailbox.rb' + end + + def hotload_on_write_file file_name + return unless file_name.include? 'mailbox.rb' + @mailbox_if_needed = :force + end + + def files_to_reload + if @rcb_release_mode + core_files_to_reload + @required_files + else + [ + 'dragon/docs.rb', + 'dragon/help.rb', + 'dragon/kernel_docs.rb', + 'dragon/kernel.rb', + 'dragon/easing.rb', + 'dragon/top_level.rb', + 'dragon/log.rb', + 'dragon/geometry.rb', + 'dragon/attr_gtk.rb', + 'dragon/attr_sprite.rb', + 'dragon/object.rb', + 'dragon/class.rb', + 'dragon/string.rb', + 'dragon/entity.rb', + 'dragon/strict_entity.rb', + 'dragon/open_entity.rb', + 'dragon/serialize.rb', + 'dragon/primitive.rb', + 'dragon/nil_class_false_class.rb', + 'dragon/symbol.rb', + 'dragon/numeric_deprecated.rb', + 'dragon/numeric.rb', + 'dragon/hash.rb', + 'dragon/outputs_deprecated.rb', + 'dragon/array_docs.rb', + 'dragon/array.rb', + 'dragon/outputs.rb', + 'dragon/inputs.rb', + 'dragon/mouse_docs.rb', + 'dragon/recording.rb', + 'dragon/grid.rb', + 'dragon/layout.rb', + 'dragon/args_deprecated.rb', + 'dragon/fn.rb', + 'dragon/args.rb', + 'dragon/console_prompt.rb', + 'dragon/console_menu.rb', + 'dragon/console.rb', + 'dragon/assert.rb', + 'dragon/tests.rb', + 'dragon/controller_config.rb', + 'dragon/runtime/draw.rb', + 'dragon/runtime/deprecated.rb', + 'dragon/runtime/framerate.rb', + 'dragon/runtime/c_bridge.rb', + 'dragon/runtime/hotload.rb', + 'dragon/runtime/backup.rb', + 'dragon/runtime/async_require.rb', + 'dragon/runtime/autocomplete.rb', + 'dragon/api.rb', + 'dragon/runtime.rb', + 'dragon/trace.rb', + 'dragon/readme_docs.rb', + 'dragon/hotload_client.rb', + 'dragon/ios_wizard.rb', + 'dragon/itch_wizard.rb', + ] + core_files_to_reload + @required_files + end + end + + def core_files_to_reload + [ + 'repl.rb', + 'app/main.rb', + 'app/repl.rb', + 'app/tests.rb', + 'app/test.rb', + 'app/stdin.rb' + ] + 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) + end + + def hotload_source_files + @hotload_if_needed += 1 + return unless @hotload_if_needed == 60 + @hotload_if_needed = 0 + files_to_reload.each { |f| reload_if_needed f } + console.enable + end + + def mailbox_timeout + if @suppress_mailbox + 60 + else + 3 + end + end + + def check_mailbox + if @mailbox_if_needed == :force # lol + reload_if_needed 'app/mailbox.rb', true + @mailbox_if_needed = 1 + return + end + @mailbox_if_needed += 1 + return unless @mailbox_if_needed.mod_zero? mailbox_timeout + @mailbox_if_needed = 1 + reload_if_needed 'app/mailbox.rb' + end + + def hotload_if_needed + hotload_source_files + check_mailbox + end + + def on_load_succeeded file + @rcb_sender.files_reloaded << file + @rcb_sender.reloaded_files << file + Trace.untrace_classes! + 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] + on_load_succeeded file if reload_ruby_file file + @file_mtimes[last_key] = @file_mtimes[current_key] + end + end + end + end + +#+end_src + +*** string.rb #+begin_src ruby # ./dragon/string.rb # coding: utf-8 @@ -29224,7 +43343,7 @@ Follows is a source code listing for all files that have been open sourced. This class String include ValueType - def wrapped_lines_recur word, rest, length, aggregate + def self.wrapped_lines_recur word, rest, length, aggregate if word.nil? return aggregate elsif rest[0].nil? @@ -29256,9 +43375,8 @@ Follows is a source code listing for all files that have been open sourced. This self[0..-2] end - # @gtk - def wrapped_lines length - self.each_line.map do |l| + def self.wrapped_lines string, length + string.each_line.map do |l| l = l.rstrip if l.length < length l + "\n" @@ -29269,6 +43387,10 @@ Follows is a source code listing for all files that have been open sourced. This end.flatten end + def wrapped_lines length + String.wrapped_lines self, length + end + # @gtk def wrap length wrapped_lines(length).join.rstrip @@ -29324,7 +43446,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* tests.rb +*** tests.rb #+begin_src ruby # ./dragon/tests.rb # coding: utf-8 @@ -29469,7 +43591,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* trace.rb +*** trace.rb #+begin_src ruby # ./dragon/trace.rb # coding: utf-8 @@ -29659,7 +43781,7 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src -* wizards.rb +*** wizards.rb #+begin_src ruby # ./dragon/wizards.rb # Copyright 2019 DragonRuby LLC diff --git a/docs/favicon-16x16.png b/docs/favicon-16x16.png new file mode 100644 index 0000000..27ce957 Binary files /dev/null and b/docs/favicon-16x16.png differ diff --git a/docs/favicon-32x32.png b/docs/favicon-32x32.png new file mode 100644 index 0000000..9ac17e5 Binary files /dev/null and b/docs/favicon-32x32.png differ diff --git a/docs/favicon.ico b/docs/favicon.ico new file mode 100644 index 0000000..c024e7d Binary files /dev/null and b/docs/favicon.ico differ diff --git a/docs/parse_log.txt b/docs/parse_log.txt index ec5c73d..5f10281 100644 --- a/docs/parse_log.txt +++ b/docs/parse_log.txt @@ -869,149 +869,6 @@ Note that you can also run DragonRuby without X11 at all: if you run it from a v - End of paragraph detected. *** True Line Result 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 ~args.output~ anymore. -** Processing line: ~* IMPORTANT: Go through all of the sample apps! Study them thoroughly!! No really, you should definitely do this!~ -- Header detected. -*** True Line Result - -*** True Line Result -* IMPORTANT: Go through all of the sample apps! Study them thoroughly!! No really, you should definitely do this! -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~Now that you've completed the Hello World tutorial. Head over to the~ -** Processing line: ~`samples` directory. It is very very important that you study the~ -** Processing line: ~sample apps thoroughly! Go through them in order. Here is a short~ -** Processing line: ~description of each sample app.~ -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result -Now that you've completed the Hello World tutorial. Head over to the `samples` directory. It is very very important that you study the sample apps thoroughly! Go through them in order. Here is a short description of each sample app. -** Processing line: ~** Guided Samples~ -- Header detected. -*** True Line Result - -*** True Line Result -** Guided Samples -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~1. ~samples/00_learn_ruby_optional~: This directory contains sample apps that will help you learn the language.~ -- Line was identified as a start of a list. -*** True Line Result - -** Processing line: ~2. ~samples/01_rendering_basics~: This set of samples will show you how to render basic primitives such as ~labels~, ~solids~, ~borders~, ~lines~, ~sprites~, and how to play ~sounds~.~ -- Line was identified as a continuation of a list. -*** True Line Result -1. ~samples/00_learn_ruby_optional~: This directory contains sample apps that will help you learn the language. -** Processing line: ~3. ~samples/02_input_basics~: This set of samples show you how to accept input from the ~mouse~, ~keyboard~, and ~controllers~.~ -- Line was identified as a continuation of a list. -*** True Line Result -2. ~samples/01_rendering_basics~: This set of samples will show you how to render basic primitives such as ~labels~, ~solids~, ~borders~, ~lines~, ~sprites~, and how to play ~sounds~. -** Processing line: ~4. ~samples/03_rendering_sprites~: This set of samples shows you all the different ways to render sprites (including how to use a sprite sheet).~ -- Line was identified as a continuation of a list. -*** True Line Result -3. ~samples/02_input_basics~: This set of samples show you how to accept input from the ~mouse~, ~keyboard~, and ~controllers~. -** Processing line: ~4. ~samples/04_physics_and_collision~: This set of samples shows how to do various types of collisions and physics.~ -- Line was identified as a continuation of a list. -*** True Line Result -4. ~samples/03_rendering_sprites~: This set of samples shows you all the different ways to render sprites (including how to use a sprite sheet). -** Processing line: ~5. ~samples/05_mouse~: This set of samples show more advanced usages of the mouse.~ -- Line was identified as a continuation of a list. -*** True Line Result -4. ~samples/04_physics_and_collision~: This set of samples shows how to do various types of collisions and physics. -** Processing line: ~6. ~samples/06_save_load~: This set of samples show how to save and load game data.~ -- Line was identified as a continuation of a list. -*** True Line Result -5. ~samples/05_mouse~: This set of samples show more advanced usages of the mouse. -** Processing line: ~7. ~samples/07_advanced_rendering~: This set of samples show how to programmatically render sprites using render targets.~ -- Line was identified as a continuation of a list. -*** True Line Result -6. ~samples/06_save_load~: This set of samples show how to save and load game data. -** Processing line: ~8. ~samples/08_tweening_lerping_easing_functions~: This set of samples show how to perform animations.~ -- Line was identified as a continuation of a list. -*** True Line Result -7. ~samples/07_advanced_rendering~: This set of samples show how to programmatically render sprites using render targets. -** Processing line: ~9. ~samples/09_performance~: This set of samples show how to handle performance issues when a large number of sprites on the screen.~ -- Line was identified as a continuation of a list. -*** True Line Result -8. ~samples/08_tweening_lerping_easing_functions~: This set of samples show how to perform animations. -** Processing line: ~10. ~samples/10_advanced_debugging~: This set of samples show how advanced debugging techniques and testing techniques.~ -- Line was identified as a continuation of a list. -*** True Line Result -9. ~samples/09_performance~: This set of samples show how to handle performance issues when a large number of sprites on the screen. -** Processing line: ~11. ~samples/11_http~: This set of samples show how use http.~ -- Line was identified as a continuation of a list. -*** True Line Result -10. ~samples/10_advanced_debugging~: This set of samples show how advanced debugging techniques and testing techniques. -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result -11. ~samples/11_http~: This set of samples show how use http. -** Processing line: ~** Sample Games~ -- Header detected. -*** True Line Result - -*** True Line Result -** Sample Games -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~There are samples that contain the path ~samples/99_*~. The sample apps that are prefixed with ~99_~ show non-trivial implemementations for a real game:~ -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result -There are samples that contain the path ~samples/99_*~. The sample apps that are prefixed with ~99_~ show non-trivial implemementations for a real game: -** Processing line: ~1. 3D Cube: Shows how to do faux 3D in DragonRuby.~ -- Line was identified as a start of a list. -*** True Line Result - -** Processing line: ~2. Dueling Starships: A two player top-down versus game where each player controls a ship.~ -- Line was identified as a continuation of a list. -*** True Line Result -1. 3D Cube: Shows how to do faux 3D in DragonRuby. -** Processing line: ~3. Flappy Dragon: DragonRuby's clone of Flappy Bird.~ -- Line was identified as a continuation of a list. -*** True Line Result -2. Dueling Starships: A two player top-down versus game where each player controls a ship. -** Processing line: ~4. Pong: A simple implementation of the game Pong.~ -- Line was identified as a continuation of a list. -*** True Line Result -3. Flappy Dragon: DragonRuby's clone of Flappy Bird. -** Processing line: ~5. Snakemoji: The classic game of Snake but with all of the code written using emojis (sometimes you just have to have a little fun).~ -- Line was identified as a continuation of a list. -*** True Line Result -4. Pong: A simple implementation of the game Pong. -** Processing line: ~6. Solar System: A simulation of our solar system.~ -- Line was identified as a continuation of a list. -*** True Line Result -5. Snakemoji: The classic game of Snake but with all of the code written using emojis (sometimes you just have to have a little fun). -** Processing line: ~7. Crafting Starting Point: A starting point for those that want to build a crafting game.~ -- Line was identified as a continuation of a list. -*** True Line Result -6. Solar System: A simulation of our solar system. -** Processing line: ~8. Dev Tools: A set of sample apps that show how you can extend DragonRuby's Console, starting point for a tile editor, and a starting point for a paint app.~ -- Line was identified as a continuation of a list. -*** True Line Result -7. Crafting Starting Point: A starting point for those that want to build a crafting game. -** Processing line: ~9. LOWREZ: Sample apps that show how to render at different resolutions.~ -- Line was identified as a continuation of a list. -*** True Line Result -8. Dev Tools: A set of sample apps that show how you can extend DragonRuby's Console, starting point for a tile editor, and a starting point for a paint app. -** Processing line: ~10. RPG: Various sample apps that show how to create narrative, topdown, tactical grid-based, and roguelike RPGs.~ -- Line was identified as a continuation of a list. -*** True Line Result -9. LOWREZ: Sample apps that show how to render at different resolutions. -** Processing line: ~11. Platformers: Various sample apps that show how to create different kinds of physics/collision based platformers.~ -- Line was identified as a continuation of a list. -*** True Line Result -10. RPG: Various sample apps that show how to create narrative, topdown, tactical grid-based, and roguelike RPGs. -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result -11. Platformers: Various sample apps that show how to create different kinds of physics/collision based platformers. ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -1367,42 +1224,47 @@ It's a hard pill to swallow, but forget blindly accepted best practices and try - End of paragraph detected. *** True Line Result -** Processing line: ~There is a programming idiom in software called "the pit of~ -** Processing line: ~success". The term normalizes up front pain as a necessity in the~ -** Processing line: ~(hopes that the investment will yield dividends "when you become~ -** Processing line: ~successful"). This results in more "Enterprise TM" code upfront, and~ -** Processing line: ~makes it more difficult to get started when you are new to programming.~ +** Processing line: ~There is a programming idiom in software called "The Pit of~ +** Processing line: ~Success". The term normalizes upfront pain as a necessity/requirement in the~ +** Processing line: ~hopes that the investment will yield dividends "when you become~ +** Processing line: ~successful" or "when the code becomes more complicated". This approach to~ +** Processing line: ~development is strongly discouraged by us. It leads to over-architected~ +** Processing line: ~and unnecessary code; creates barriers to rapid prototyping and shipping a game; and~ +** Processing line: ~overwhelms beginners who are new to the engine or programming in general.~ ** Processing line: ~~ - End of paragraph detected. *** True Line Result -There is a programming idiom in software called "the pit of success". The term normalizes up front pain as a necessity in the (hopes that the investment will yield dividends "when you become successful"). This results in more "Enterprise TM" code upfront, and makes it more difficult to get started when you are new to programming. -** Processing line: ~DragonRuby's philosophy is to provide a spectrum across the "make it~ -** Processing line: ~fast" vs "make it right" spectrum and provide incremental, intuitive~ -** Processing line: ~transitions between points on that spectrum. This is captured in how~ -** Processing line: ~render primitives can be represented as tuples/arrays, hashes, open~ -** Processing line: ~structs/entities, and then finally classes (as opposed to forcing devs~ -** Processing line: ~to use classes upfront).~ +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. +** 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: ~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: ~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 a spectrum across the "make it fast" vs "make it right" spectrum and provide incremental, intuitive transitions between points on that spectrum. This is captured in how render primitives can be represented as tuples/arrays, hashes, open structs/entities, and then finally classes (as opposed to forcing devs to use classes upfront). -** Processing line: ~** Release Often And Soon~ +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: ~** Release Early and Often~ - Header detected. *** True Line Result *** True Line Result -** Release Often And Soon +** Release Early and Often ** Processing line: ~~ - End of paragraph detected. *** True Line Result ** Processing line: ~The biggest mistake game devs make is spending too much time in~ ** Processing line: ~isolation building their game. Release something, however small, and~ -** Processing line: ~release it quickly.~ +** Processing line: ~release it soon.~ ** Processing line: ~~ - End of paragraph detected. *** True Line Result -The biggest mistake game devs make is spending too much time in isolation building their game. Release something, however small, and release it quickly. +The biggest mistake game devs make is spending too much time in isolation building their game. Release something, however small, and release it soon. ** Processing line: ~Stop worrying about everything being pixel perfect. Don't wait until~ ** Processing line: ~your game is 100% complete. Build your game publicly and~ ** Processing line: ~iterate. Post in the #show-and-tell channel in the community Discord.~ @@ -1411,28 +1273,11 @@ The biggest mistake game devs make is spending too much time in isolation buildi - End of paragraph detected. *** True Line Result Stop worrying about everything being pixel perfect. Don't wait until your game is 100% complete. Build your game publicly and iterate. Post in the #show-and-tell channel in the community Discord. You'll find a lot of support and encouragement there. -** Processing line: ~Remember:~ +** Processing line: ~Real artists ship. Remember that.~ ** Processing line: ~~ - End of paragraph detected. *** True Line Result -Remember: -** Processing line: ~#+begin_quote~ -- Line was identified as a literal block. -*** True Line Result - -*** True Line Result -#+begin_quote -** Processing line: ~Real artists ship.~ -** Processing line: ~#+end_quote~ -- Line was identified as a literal block. -*** True Line Result -Real artists ship. -*** True Line Result -#+end_quote -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - +Real artists ship. Remember that. ** Processing line: ~** Sustainable And Ethical Monetization~ - Header detected. *** True Line Result @@ -1457,6 +1302,13 @@ We all aspire to put food on the table doing what we love. Whether it is buildin - End of paragraph detected. *** True Line Result Charge a fair amount of money for the things you create. It's expected and encouraged within the community. Give what you create away for free to those that can't afford it. +** Processing line: ~If you are gainfully employed, pay full price for the things you use. If you~ +** Processing line: ~do end up getting something at a discount, pay the difference "forward" to~ +** Processing line: ~someone else.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +If you are gainfully employed, pay full price for the things you use. If you do end up getting something at a discount, pay the difference "forward" to someone else. ** Processing line: ~** Sustainable And Ethical Open Source~ - Header detected. *** True Line Result @@ -2001,10 +1853,10 @@ You can use DragonRuby's Console within the game to inspect object and execute s - Inside source: true *** True Line Result xrepl do -** Processing line: ~ puts "This code will not be executed because of the x infront of repl".~ +** Processing line: ~ puts "This code will not be executed because of the x in front of repl".~ - Inside source: true *** True Line Result - puts "This code will not be executed because of the x infront of repl". + puts "This code will not be executed because of the x in front of repl". ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -2347,12 +2199,18 @@ That won't happen if the development world stop asking for free stuff and non-tr - End of paragraph detected. *** True Line Result But, in the event that sad day comes, our partnership bylaws state that _all_ DragonRuby IP that can be legally open sourced, will be released under a permissive license. -** Processing line: ~* CHEATSHEET: How To Determine What Frame You Are On~ +** Processing line: ~* RECIPIES:~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: How To Determine What Frame You Are On +* RECIPIES: +** Processing line: ~** How To Determine What Frame You Are On~ +- Header detected. +*** True Line Result + +*** True Line Result +** How To Determine What Frame You Are On ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -2390,12 +2248,12 @@ There is a property on ~state~ called ~tick_count~ that is incremented by Dragon - End of paragraph detected. *** True Line Result -** Processing line: ~* CHEATSHEET: How To Get Current Framerate~ +** Processing line: ~** How To Get Current Framerate~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: How To Get Current Framerate +** How To Get Current Framerate ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -2432,12 +2290,12 @@ Current framerate is a top level property on the Game Toolkit Runtime and is acc - End of paragraph detected. *** True Line Result -** Processing line: ~* CHEATSHEET: How To Render A Sprite Using An Array~ +** Processing line: ~** How To Render A Sprite Using An Array~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: How To Render A Sprite Using An Array +** How To Render A Sprite Using An Array ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -2510,12 +2368,12 @@ The following code renders a sprite with a ~width~ and ~height~ of ~100~ in the - End of paragraph detected. *** True Line Result -** Processing line: ~* CHEATSHEET: More Sprite Properties As An Array~ +** Processing line: ~** More Sprite Properties As An Array~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: More Sprite Properties As An Array +** More Sprite Properties As An Array ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -2595,12 +2453,12 @@ Here are all the properties you can set on a sprite. - End of paragraph detected. *** True Line Result -** Processing line: ~* CHEATSHEET: Different Sprite Representations~ +** Processing line: ~** Different Sprite Representations~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: Different Sprite Representations +** Different Sprite Representations ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -2853,12 +2711,12 @@ You can represent a sprite as an ~object~: - End of paragraph detected. *** True Line Result -** Processing line: ~* CHEATSHEET: How To Render A Label~ +** Processing line: ~** How To Render A Label~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: How To Render A Label +** How To Render A Label ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -2909,12 +2767,12 @@ Here is the minimum code: - End of paragraph detected. *** True Line Result -** Processing line: ~* CHEATSHEET: A Colored Label~ +** Processing line: ~** A Colored Label~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: A Colored Label +** A Colored Label ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -2953,12 +2811,12 @@ Here is the minimum code: - End of paragraph detected. *** True Line Result -** Processing line: ~* CHEATSHEET: Extended Label Properties~ +** Processing line: ~** Extended Label Properties~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: Extended Label Properties +** Extended Label Properties ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -3054,12 +2912,12 @@ A ~SIZE_ENUM~ of ~0~ represents "default size". A ~negative~ value will decrease - End of paragraph detected. *** True Line Result An ~ALIGNMENT_ENUM~ of ~0~ represents "left aligned". ~1~ represents "center aligned". ~2~ represents "right aligned". -** Processing line: ~* CHEATSHEET: Rendering A Label As A ~Hash~~ +** Processing line: ~** Rendering A Label As A ~Hash~~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: Rendering A Label As A ~Hash~ +** Rendering A Label As A ~Hash~ ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -3167,12 +3025,12 @@ You can add additional metadata about your game within a label, which requires y - End of paragraph detected. *** True Line Result -** Processing line: ~* CHEATSHEET: Getting The Size Of A Piece Of Text~ +** Processing line: ~** Getting The Size Of A Piece Of Text~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: Getting The Size Of A Piece Of Text +** Getting The Size Of A Piece Of Text ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -3252,12 +3110,12 @@ You can get the render size of any string using ~args.gtk.calcstringbox~. - End of paragraph detected. *** True Line Result -** Processing line: ~* CHEATSHEET: How To Play A Sound~ +** Processing line: ~** How To Play A Sound~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: How To Play A Sound +** How To Play A Sound ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -3391,12 +3249,12 @@ If you want to play a ~.ogg~ once as if it were a sound effect, you can do: - End of paragraph detected. *** True Line Result -** Processing line: ~* CHEATSHEET: Using ~args.state~ To Store Your Game State~ +** Processing line: ~** Using ~args.state~ To Store Your Game State~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: Using ~args.state~ To Store Your Game State +** Using ~args.state~ To Store Your Game State ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -3526,12 +3384,12 @@ To assign a value every frame, just use the ~=~ operator, but _make sure_ you've - End of paragraph detected. *** True Line Result -** Processing line: ~* CHEATSHEET: Troubleshoot Performance~ +** Processing line: ~** Troubleshoot Performance~ - Header detected. *** True Line Result *** True Line Result -* CHEATSHEET: Troubleshoot Performance +** Troubleshoot Performance ** Processing line: ~~ - End of paragraph detected. *** True Line Result @@ -3620,37 +3478,151 @@ do - End of paragraph detected. *** True Line Result The GTK::Runtime class is the core of DragonRuby. It is globally accessible via ~$gtk~. -** Processing line: ~* DOCS: ~GTK::Runtime#write_file~~ +** Processing line: ~* SUMMARY: ~def tick args; end;~~ - Header detected. *** True Line Result *** True Line Result -* DOCS: ~GTK::Runtime#write_file~ -** Processing line: ~This function takes in two parameters. The first paramter is the file path and assumes the the game~ -** Processing line: ~directory is the root. The second parameter is the string that will be written. The method overwrites whatever~ -** Processing line: ~is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting.~ +* SUMMARY: ~def tick args; end;~ +** Processing line: ~Most everything you will need to build your game is in the ~args~ parameter that is provided to your ~tick~ method. Follows is a high level summary of each function that is available from ~args~.~ ** Processing line: ~~ - End of paragraph detected. *** True Line Result -This function takes in two parameters. The first paramter is the file path and assumes the the game directory is the root. The second parameter is the string that will be written. The method overwrites whatever is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting. -** Processing line: ~#+begin_src ruby~ +Most everything you will need to build your game is in the ~args~ parameter that is provided to your ~tick~ method. Follows is a high level summary of each function that is available from ~args~. +** Processing line: ~All the properties below hang off of ~args~ and can be accessed in the ~tick~ method:~ +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result +All the properties below hang off of ~args~ and can be accessed in the ~tick~ method: +*** True Line Result +#+begin_src +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ args.PROPERTY~ +- Inside source: true +*** True Line Result + args.PROPERTY +** 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: ~** ~args.state~~ +- Header detected. +*** True Line Result + +*** True Line Result +** ~args.state~ +** Processing line: ~Store your game state inside of this ~state~. Properties with arbitrary nesting is allowed and a backing Entity will be created on your behalf.~ +** Processing line: ~#+begin_src~ - Line was identified as the beginning of a code block. *** True Line Result +Store your game state inside of this ~state~. Properties with arbitrary nesting is allowed and a backing Entity will be created on your behalf. +*** True Line Result +#+begin_src +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick 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 ||= 0~ +- Inside source: true +*** True Line Result + args.state.player.y ||= 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: ~*** ~.*.entity_id~~ +- Header detected. +*** True Line Result +*** True Line Result +*** ~.*.entity_id~ +** Processing line: ~Entities automatically receive an ~entity_id~ of type ~Fixnum~.~ +** Processing line: ~*** ~.*.entity_type~~ +- Header detected. +*** True Line Result +Entities automatically receive an ~entity_id~ of type ~Fixnum~. +*** True Line Result +*** ~.*.entity_type~ +** Processing line: ~Entities can have an ~entity_type~ which is represented as a ~Symbol~.~ +** Processing line: ~*** ~.*.created_at~~ +- Header detected. +*** True Line Result +Entities can have an ~entity_type~ which is represented as a ~Symbol~. +*** True Line Result +*** ~.*.created_at~ +** Processing line: ~Entities have ~created_at~ set to ~args.state.tick_count~ when they are created.~ +** Processing line: ~*** ~.*.created_at_elapsed~~ +- Header detected. +*** True Line Result +Entities have ~created_at~ set to ~args.state.tick_count~ when they are created. +*** True Line Result +*** ~.*.created_at_elapsed~ +** Processing line: ~Returns the elapsed number of ticks since creation.~ +** Processing line: ~*** ~.*.global_created_at~~ +- Header detected. +*** True Line Result +Returns the elapsed number of ticks since creation. +*** True Line Result +*** ~.*.global_created_at~ +** Processing line: ~Entities have ~global_created_at~ set to ~Kernel.global_tick_count~ when they are created.~ +** Processing line: ~*** ~.*.global_created_at_elapsed~~ +- Header detected. +*** True Line Result +Entities have ~global_created_at~ set to ~Kernel.global_tick_count~ when they are created. +*** True Line Result +*** ~.*.global_created_at_elapsed~ +** Processing line: ~Returns the elapsed number of global ticks since creation.~ +** Processing line: ~*** ~.*.as_hash~~ +- Header detected. +*** True Line Result +Returns the elapsed number of global ticks since creation. +*** True Line Result +*** ~.*.as_hash~ +** Processing line: ~Entity cast to a ~Hash~ so you can update values as if you were updating a ~Hash~.~ +** Processing line: ~*** ~.new_entity~~ +- Header detected. +*** True Line Result +Entity cast to a ~Hash~ so you can update values as if you were updating a ~Hash~. +*** True Line Result +*** ~.new_entity~ +** Processing line: ~Creates a new Entity with a ~type~, and initial properties. An option block can be passed to change the newly created entity:~ +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result +Creates a new Entity with a ~type~, and initial properties. An option block can be passed to change the newly created entity: *** True Line Result #+begin_src ruby ** Processing line: ~ def tick args~ - Inside source: true *** True Line Result def tick args -** Processing line: ~ if args.inputs.mouse.click~ +** Processing line: ~ args.state.player ||= args.state.new_entity :player, x: 0, y: 0 do |e|~ - Inside source: true *** True Line Result - if args.inputs.mouse.click -** Processing line: ~ args.gtk.write_file "last-mouse-click.txt", "Mouse was clicked at #{args.state.tick_count}."~ + args.state.player ||= args.state.new_entity :player, x: 0, y: 0 do |e| +** Processing line: ~ e.max_hp = 100~ - Inside source: true *** True Line Result - args.gtk.write_file "last-mouse-click.txt", "Mouse was clicked at #{args.state.tick_count}." + e.max_hp = 100 +** Processing line: ~ e.hp = e.max_hp * rand~ +- Inside source: true +*** True Line Result + e.hp = e.max_hp * rand ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -3663,10 +3635,1531 @@ This function takes in two parameters. The first paramter is the file path and a - Line was identified as the end of a code block. *** True Line Result #+end_src +** Processing line: ~*** ~.new_entity_strict~~ +- Header detected. +*** True Line Result + +*** True Line Result +*** ~.new_entity_strict~ +** Processing line: ~Creates a new Strict Entity. While Entities created via ~args.state.new_entity~ can have new properties added later on, Entities created~ +** Processing line: ~using ~args.state.new_entity~ must define all properties that are allowed during its initialization. Attempting to add new properties after~ +** Processing line: ~initialization will result in an exception.~ +** Processing line: ~*** ~.tick_count~~ +- Header detected. +*** True Line Result +Creates a new Strict Entity. While Entities created via ~args.state.new_entity~ can have new properties added later on, Entities created using ~args.state.new_entity~ must define all properties that are allowed during its initialization. Attempting to add new properties after initialization will result in an exception. +*** True Line Result +*** ~.tick_count~ +** Processing line: ~Returns the current tick of the game. ~args.state.tick_count~ is ~0~ when the game is first started or if the game is reset via ~$gtk.reset~.~ +** Processing line: ~** ~args.inputs~~ +- Header detected. +*** True Line Result +Returns the current tick of the game. ~args.state.tick_count~ is ~0~ when the game is first started or if the game is reset via ~$gtk.reset~. +*** True Line Result +** ~args.inputs~ +** Processing line: ~Access using input using ~args.inputs~.~ +** Processing line: ~*** ~.up~~ +- Header detected. +*** True Line Result +Access using input using ~args.inputs~. +*** True Line Result +*** ~.up~ +** Processing line: ~Returns ~true~ if: the ~up~ arrow or ~w~ key is pressed or held on the ~keyboard~; or if ~up~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted upwards.~ +** Processing line: ~*** ~.down~~ +- Header detected. +*** True Line Result +Returns ~true~ if: the ~up~ arrow or ~w~ key is pressed or held on the ~keyboard~; or if ~up~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted upwards. +*** True Line Result +*** ~.down~ +** Processing line: ~Returns ~true~ if: the ~down~ arrow or ~s~ key is pressed or held on the ~keyboard~; or if ~down~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted downwards.~ +** Processing line: ~*** ~.left~~ +- Header detected. +*** True Line Result +Returns ~true~ if: the ~down~ arrow or ~s~ key is pressed or held on the ~keyboard~; or if ~down~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted downwards. +*** True Line Result +*** ~.left~ +** Processing line: ~Returns ~true~ if: the ~left~ arrow or ~a~ key is pressed or held on the ~keyboard~; or if ~left~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the left.~ +** Processing line: ~*** ~.right~~ +- Header detected. +*** True Line Result +Returns ~true~ if: the ~left~ arrow or ~a~ key is pressed or held on the ~keyboard~; or if ~left~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the left. +*** True Line Result +*** ~.right~ +** Processing line: ~Returns ~true~ if: the ~right~ arrow or ~d~ key is pressed or held on the ~keyboard~; or if ~right~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the right.~ +** Processing line: ~*** ~.left_right~~ +- Header detected. +*** True Line Result +Returns ~true~ if: the ~right~ arrow or ~d~ key is pressed or held on the ~keyboard~; or if ~right~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the right. +*** True Line Result +*** ~.left_right~ +** Processing line: ~Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.left~ and ~args.inputs.right~.~ +** Processing line: ~*** ~.up_down~~ +- Header detected. +*** True Line Result +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: ~*** ~.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~. +*** True Line Result +*** ~.text~ OR ~.history~ +** Processing line: ~Returns a string that represents the last key that was pressed on the keyboard.~ +** Processing line: ~*** ~.mouse~~ +- Header detected. +*** True Line Result +Returns a string that represents the last key that was pressed on the keyboard. +*** True Line Result +*** ~.mouse~ +** Processing line: ~Represents the user's~ +** Processing line: ~**** ~.x~~ +- Header detected. +*** True Line Result +Represents the user's +*** True Line Result +**** ~.x~ +** Processing line: ~Returns the current ~x~ location of the mouse.~ +** Processing line: ~**** ~mouse.y~~ +- Header detected. +*** True Line Result +Returns the current ~x~ location of the mouse. +*** True Line Result +**** ~mouse.y~ +** Processing line: ~Return.~ +** Processing line: ~**** ~.inside_rect? rect~~ +- Header detected. +*** True Line Result +Return. +*** True Line Result +**** ~.inside_rect? rect~ +** Processing line: ~Return. ~args.inputs.mouse.inside_rect?~ takes in any primitive that responds to ~x, y, w, h~:~ +** Processing line: ~**** ~.inside_circle? center_point, radius~~ +- Header detected. +*** True Line Result +Return. ~args.inputs.mouse.inside_rect?~ takes in any primitive that responds to ~x, y, w, h~: +*** True Line Result +**** ~.inside_circle? center_point, radius~ +** Processing line: ~Returns ~true~ if the mouse is inside of a specified circle. ~args.inputs.mouse.inside_circle?~ takes in any primitive that responds to ~x, y~ (which represents the circle's center), and takes in a ~radius~:~ +** Processing line: ~**** ~.moved~~ +- Header detected. +*** True Line Result +Returns ~true~ if the mouse is inside of a specified circle. ~args.inputs.mouse.inside_circle?~ takes in any primitive that responds to ~x, y~ (which represents the circle's center), and takes in a ~radius~: +*** True Line Result +**** ~.moved~ +** Processing line: ~Returns ~true~ if the mouse has moved on the current frame.~ +** Processing line: ~**** ~.button_left~~ +- Header detected. +*** True Line Result +Returns ~true~ if the mouse has moved on the current frame. +*** True Line Result +**** ~.button_left~ +** Processing line: ~Returns ~true~ if the left mouse button is down.~ +** Processing line: ~**** ~.button_middle~~ +- Header detected. +*** True Line Result +Returns ~true~ if the left mouse button is down. +*** True Line Result +**** ~.button_middle~ +** Processing line: ~Returns ~true~ if the middle mouse button is down.~ +** Processing line: ~**** ~.button_right~~ +- Header detected. +*** True Line Result +Returns ~true~ if the middle mouse button is down. +*** True Line Result +**** ~.button_right~ +** Processing line: ~Returns ~true~ if the right mouse button is down.~ +** Processing line: ~**** ~.button_bits~~ +- Header detected. +*** True Line Result +Returns ~true~ if the right mouse button is down. +*** True Line Result +**** ~.button_bits~ +** Processing line: ~Returns a bitmask for all buttons on the mouse: ~1~ for a button in the ~down~ state, ~0~ for a button in the ~up~ state.~ +** Processing line: ~**** ~mouse.wheel~~ +- Header detected. +*** True Line Result +Returns a bitmask for all buttons on the mouse: ~1~ for a button in the ~down~ state, ~0~ for a button in the ~up~ state. +*** True Line Result +**** ~mouse.wheel~ +** Processing line: ~Represents the mouse wheel. Returns ~nil~ if no mouse wheel actions occurred.~ +** Processing line: ~***** ~.x~~ +** Processing line: ~Returns the negative or positive number if the mouse wheel has changed in the ~x~ axis.~ +** Processing line: ~***** ~.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. +*** 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~ +** Processing line: ~that has an ~x~, ~y~ properties along with helper functions to determine collision: ~inside_rect?~, ~inside_circle~.~ +** Processing line: ~*** ~.controller_one~, ~.controller_two~~ +- Header detected. +*** True Line Result +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 that has an ~x~, ~y~ properties along with helper functions to determine collision: ~inside_rect?~, ~inside_circle~. +*** True Line Result +*** ~.controller_one~, ~.controller_two~ +** Processing line: ~Represents controllers connected to the usb ports.~ +** Processing line: ~**** ~.up~ +- Header detected. +*** True Line Result +Represents controllers connected to the usb ports. +*** True Line Result +**** ~.up +** Processing line: ~Returns ~true~ if ~up~ is pressed or held on the directional or left analog.~ +** 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 +** Processing line: ~Returns ~true~ if ~down~ is pressed or held on the directional or left analog.~ +** 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 +** Processing line: ~Returns ~true~ if ~left~ is pressed or held on the directional or left analog.~ +** 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 +** Processing line: ~Returns ~true~ if ~right~ is pressed or held on the directional or left analog.~ +** 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 +** 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~ +- 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 +** 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. +*** True Line Result +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~. +*** True Line Result +**** ~.(left_analog_x_raw|right_analog_x_raw)~ +** Processing line: ~Returns the raw integer value for the analog's horizontal movement (~-32,000 to +32,000~).~ +** Processing line: ~**** ~.left_analog_y_raw|right_analog_y_raw)~~ +- Header detected. +*** True Line Result +Returns the raw integer value for the analog's horizontal movement (~-32,000 to +32,000~). +*** True Line Result +**** ~.left_analog_y_raw|right_analog_y_raw)~ +** Processing line: ~Returns the raw integer value for the analog's vertical movement (~-32,000 to +32,000~).~ +** Processing line: ~**** ~.left_analog_x_perc|right_analog_x_perc)~~ +- Header detected. +*** True Line Result +Returns the raw integer value for the analog's vertical movement (~-32,000 to +32,000~). +*** True Line Result +**** ~.left_analog_x_perc|right_analog_x_perc)~ +** Processing line: ~Returns a number between ~-1~ and ~1~ which represents the percentage the analog is moved horizontally as a ratio of the maximum horizontal movement.~ +** Processing line: ~**** ~.left_analog_y_perc|right_analog_y_perc)~~ +- Header detected. +*** True Line Result +Returns a number between ~-1~ and ~1~ which represents the percentage the analog is moved horizontally as a ratio of the maximum horizontal movement. +*** 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)~~ +- 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)~ +** Processing line: ~Returns ~true~ if ~up~ is pressed or held on the directional.~ +** 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)~ +** Processing line: ~Returns ~true~ if ~down~ is pressed or held on the directional.~ +** 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)~ +** Processing line: ~Returns ~true~ if ~left~ is pressed or held on the directional.~ +** 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)~ +** 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. +*** True Line Result +Returns ~true~ if ~right~ is pressed or held on the directional. +*** True Line Result +**** ~.(a|b|x|y|l1|r1|l2|r2|l3|r3|start|select)~ +** Processing line: ~Returns ~true~ if the specific button is pressed or held.~ +** Processing line: ~**** ~.truthy_keys~~ +- Header detected. +*** True Line Result +Returns ~true~ if the specific button is pressed or held. +*** True Line Result +**** ~.truthy_keys~ +** Processing line: ~Returns a collection of ~Symbol~s that represent all keys that are in the pressed or held state.~ +** Processing line: ~**** ~.key_down~~ +- Header detected. +*** True Line Result +Returns a collection of ~Symbol~s that represent all keys that are in the pressed or held state. +*** True Line Result +**** ~.key_down~ +** Processing line: ~Returns ~true~ if the specific button was pressed on this frame. ~args.inputs.controller_(one|two).key_down.BUTTON~ will only be true on the frame it was pressed.~ +** Processing line: ~**** ~.key_held~~ +- Header detected. +*** True Line Result +Returns ~true~ if the specific button was pressed on this frame. ~args.inputs.controller_(one|two).key_down.BUTTON~ will only be true on the frame it was pressed. +*** True Line Result +**** ~.key_held~ +** Processing line: ~Returns ~true~ if the specific button is being held. ~args.inputs.controller_(one|two).key_held.BUTTON~ will be true for all frames after ~key_down~ (until released).~ +** Processing line: ~**** ~.key_up~~ +- Header detected. +*** True Line Result +Returns ~true~ if the specific button is being held. ~args.inputs.controller_(one|two).key_held.BUTTON~ will be true for all frames after ~key_down~ (until released). +*** True Line Result +**** ~.key_up~ +** Processing line: ~Returns ~true~ if the specific button was released. ~args.inputs.controller_(one|two).key_up.BUTTON~ will be true only on the frame the button was released.~ +** Processing line: ~*** ~.keyboard~~ +- Header detected. +*** True Line Result +Returns ~true~ if the specific button was released. ~args.inputs.controller_(one|two).key_up.BUTTON~ will be true only on the frame the button was released. +*** True Line Result +*** ~.keyboard~ +** Processing line: ~Represents the user's keyboard~ +** Processing line: ~**** ~.up~~ +- Header detected. +*** True Line Result +Represents the user's keyboard +*** True Line Result +**** ~.up~ +** Processing line: ~Returns ~true~ if ~up~ or ~w~ is pressed or held on the keyboard.~ +** Processing line: ~**** ~.down~~ +- Header detected. +*** True Line Result +Returns ~true~ if ~up~ or ~w~ is pressed or held on the keyboard. +*** True Line Result +**** ~.down~ +** Processing line: ~Returns ~true~ if ~down~ or ~s~ is pressed or held on the keyboard.~ +** Processing line: ~**** ~.left~~ +- Header detected. +*** True Line Result +Returns ~true~ if ~down~ or ~s~ is pressed or held on the keyboard. +*** True Line Result +**** ~.left~ +** Processing line: ~Returns ~true~ if ~left~ or ~a~ is pressed or held on the keyboard.~ +** Processing line: ~**** ~.right~~ +- Header detected. +*** True Line Result +Returns ~true~ if ~left~ or ~a~ is pressed or held on the keyboard. +*** True Line Result +**** ~.right~ +** Processing line: ~Returns ~true~ if ~right~ or ~d~ is pressed or held on the keyboard.~ +** Processing line: ~**** ~.left_right~~ +- Header detected. +*** True Line Result +Returns ~true~ if ~right~ or ~d~ is pressed or held on the keyboard. +*** True Line Result +**** ~.left_right~ +** Processing line: ~Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.left~ and ~args.inputs.keyboard.right~.~ +** Processing line: ~**** ~.up_down~~ +- Header detected. +*** True Line Result +Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.left~ and ~args.inputs.keyboard.right~. +*** True Line Result +**** ~.up_down~ +** Processing line: ~Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.up~ and ~args.inputs.keyboard.up~.~ +** Processing line: ~**** keyboard properties~ +- Header detected. +*** True Line Result +Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.up~ and ~args.inputs.keyboard.up~. +*** True Line Result +**** keyboard properties +** Processing line: ~The following properties represent keys on the keyboard and are available on ~args.inputs.keyboard.KEY~, ~args.inputs.keyboard.key_down.KEY~, ~args.inputs.keyboard.key_held.KEY~, and ~args.inputs.keyboard.key_up.KEY~:~ +** Processing line: ~- ~alt~~ +- Line was identified as a list. +*** True Line Result +The following properties represent keys on the keyboard and are available on ~args.inputs.keyboard.KEY~, ~args.inputs.keyboard.key_down.KEY~, ~args.inputs.keyboard.key_held.KEY~, and ~args.inputs.keyboard.key_up.KEY~: +** Processing line: ~- ~meta~~ +- Line was identified as a list. +*** True Line Result +- ~alt~ +** Processing line: ~- ~control~~ +- Line was identified as a list. +*** True Line Result +- ~meta~ +** Processing line: ~- ~shift~~ +- Line was identified as a list. +*** True Line Result +- ~control~ +** Processing line: ~- ~ctrl_KEY~ (dynamic method, eg ~args.inputs.keyboard.ctrl_a~)~ +- Line was identified as a list. +*** True Line Result +- ~shift~ +** Processing line: ~- ~exclamation_point~~ +- Line was identified as a list. +*** True Line Result +- ~ctrl_KEY~ (dynamic method, eg ~args.inputs.keyboard.ctrl_a~) +** Processing line: ~- ~zero~~ +- Line was identified as a list. +*** True Line Result +- ~exclamation_point~ +** Processing line: ~- ~one~~ +- Line was identified as a list. +*** True Line Result +- ~zero~ +** Processing line: ~- ~two~~ +- Line was identified as a list. +*** True Line Result +- ~one~ +** Processing line: ~- ~three~~ +- Line was identified as a list. +*** True Line Result +- ~two~ +** Processing line: ~- ~four~~ +- Line was identified as a list. +*** True Line Result +- ~three~ +** Processing line: ~- ~five~~ +- Line was identified as a list. +*** True Line Result +- ~four~ +** Processing line: ~- ~six~~ +- Line was identified as a list. +*** True Line Result +- ~five~ +** Processing line: ~- ~seven~~ +- Line was identified as a list. +*** True Line Result +- ~six~ +** Processing line: ~- ~eight~~ +- Line was identified as a list. +*** True Line Result +- ~seven~ +** Processing line: ~- ~nine~~ +- Line was identified as a list. +*** True Line Result +- ~eight~ +** Processing line: ~- ~backspace~~ +- Line was identified as a list. +*** True Line Result +- ~nine~ +** Processing line: ~- ~delete~~ +- Line was identified as a list. +*** True Line Result +- ~backspace~ +** Processing line: ~- ~escape~~ +- Line was identified as a list. +*** True Line Result +- ~delete~ +** Processing line: ~- ~enter~~ +- Line was identified as a list. +*** True Line Result +- ~escape~ +** Processing line: ~- ~tab~~ +- Line was identified as a list. +*** True Line Result +- ~enter~ +** Processing line: ~- ~open_round_brace~~ +- Line was identified as a list. +*** True Line Result +- ~tab~ +** Processing line: ~- ~close_round_brace~~ +- Line was identified as a list. +*** True Line Result +- ~open_round_brace~ +** Processing line: ~- ~open_curly_brace~~ +- Line was identified as a list. +*** True Line Result +- ~close_round_brace~ +** Processing line: ~- ~close_curly_brace~~ +- Line was identified as a list. +*** True Line Result +- ~open_curly_brace~ +** Processing line: ~- ~open_square_brace~~ +- Line was identified as a list. +*** True Line Result +- ~close_curly_brace~ +** Processing line: ~- ~close_square_brace~~ +- Line was identified as a list. +*** True Line Result +- ~open_square_brace~ +** Processing line: ~- ~colon~~ +- Line was identified as a list. +*** True Line Result +- ~close_square_brace~ +** Processing line: ~- ~semicolon~~ +- Line was identified as a list. +*** True Line Result +- ~colon~ +** Processing line: ~- ~equal_sign~~ +- Line was identified as a list. +*** True Line Result +- ~semicolon~ +** Processing line: ~- ~hyphen~~ +- Line was identified as a list. +*** True Line Result +- ~equal_sign~ +** Processing line: ~- ~space~~ +- Line was identified as a list. +*** True Line Result +- ~hyphen~ +** Processing line: ~- ~dollar_sign~~ +- Line was identified as a list. +*** True Line Result +- ~space~ +** Processing line: ~- ~double_quotation_mark~~ +- Line was identified as a list. +*** True Line Result +- ~dollar_sign~ +** Processing line: ~- ~single_quotation_mark~~ +- Line was identified as a list. +*** True Line Result +- ~double_quotation_mark~ +** Processing line: ~- ~backtick~~ +- Line was identified as a list. +*** True Line Result +- ~single_quotation_mark~ +** Processing line: ~- ~tilde~~ +- Line was identified as a list. +*** True Line Result +- ~backtick~ +** Processing line: ~- ~period~~ +- Line was identified as a list. +*** True Line Result +- ~tilde~ +** Processing line: ~- ~comma~~ +- Line was identified as a list. +*** True Line Result +- ~period~ +** Processing line: ~- ~pipe~~ +- Line was identified as a list. +*** True Line Result +- ~comma~ +** Processing line: ~- ~underscore~~ +- Line was identified as a list. +*** True Line Result +- ~pipe~ +** Processing line: ~- ~a~~ +- Line was identified as a list. +*** True Line Result +- ~underscore~ +** Processing line: ~- ~b~~ +- Line was identified as a list. +*** True Line Result +- ~a~ +** Processing line: ~- ~c~~ +- Line was identified as a list. +*** True Line Result +- ~b~ +** Processing line: ~- ~d~~ +- Line was identified as a list. +*** True Line Result +- ~c~ +** Processing line: ~- ~e~~ +- Line was identified as a list. +*** True Line Result +- ~d~ +** Processing line: ~- ~f~~ +- Line was identified as a list. +*** True Line Result +- ~e~ +** Processing line: ~- ~g~~ +- Line was identified as a list. +*** True Line Result +- ~f~ +** Processing line: ~- ~h~~ +- Line was identified as a list. +*** True Line Result +- ~g~ +** Processing line: ~- ~i~~ +- Line was identified as a list. +*** True Line Result +- ~h~ +** Processing line: ~- ~j~~ +- Line was identified as a list. +*** True Line Result +- ~i~ +** Processing line: ~- ~k~~ +- Line was identified as a list. +*** True Line Result +- ~j~ +** Processing line: ~- ~l~~ +- Line was identified as a list. +*** True Line Result +- ~k~ +** Processing line: ~- ~m~~ +- Line was identified as a list. +*** True Line Result +- ~l~ +** Processing line: ~- ~n~~ +- Line was identified as a list. +*** True Line Result +- ~m~ +** Processing line: ~- ~o~~ +- Line was identified as a list. +*** True Line Result +- ~n~ +** Processing line: ~- ~p~~ +- Line was identified as a list. +*** True Line Result +- ~o~ +** Processing line: ~- ~q~~ +- Line was identified as a list. +*** True Line Result +- ~p~ +** Processing line: ~- ~r~~ +- Line was identified as a list. +*** True Line Result +- ~q~ +** Processing line: ~- ~s~~ +- Line was identified as a list. +*** True Line Result +- ~r~ +** Processing line: ~- ~t~~ +- Line was identified as a list. +*** True Line Result +- ~s~ +** Processing line: ~- ~u~~ +- Line was identified as a list. +*** True Line Result +- ~t~ +** Processing line: ~- ~v~~ +- Line was identified as a list. +*** True Line Result +- ~u~ +** Processing line: ~- ~w~~ +- Line was identified as a list. +*** True Line Result +- ~v~ +** Processing line: ~- ~x~~ +- Line was identified as a list. +*** True Line Result +- ~w~ +** Processing line: ~- ~y~~ +- Line was identified as a list. +*** True Line Result +- ~x~ +** Processing line: ~- ~z~~ +- Line was identified as a list. +*** True Line Result +- ~y~ +** Processing line: ~- ~shift~~ +- Line was identified as a list. +*** True Line Result +- ~z~ +** Processing line: ~- ~control~~ +- Line was identified as a list. +*** True Line Result +- ~shift~ +** Processing line: ~- ~alt~~ +- Line was identified as a list. +*** True Line Result +- ~control~ +** Processing line: ~- ~meta~~ +- Line was identified as a list. +*** True Line Result +- ~alt~ +** Processing line: ~- ~left~~ +- Line was identified as a list. +*** True Line Result +- ~meta~ +** Processing line: ~- ~right~~ +- Line was identified as a list. +*** True Line Result +- ~left~ +** Processing line: ~- ~up~~ +- Line was identified as a list. +*** True Line Result +- ~right~ +** Processing line: ~- ~down~~ +- Line was identified as a list. +*** True Line Result +- ~up~ +** Processing line: ~- ~pageup~~ +- Line was identified as a list. +*** True Line Result +- ~down~ +** Processing line: ~- ~pagedown~~ +- Line was identified as a list. +*** True Line Result +- ~pageup~ +** Processing line: ~- ~char~~ +- Line was identified as a list. +*** True Line Result +- ~pagedown~ +** Processing line: ~- ~plus~~ +- Line was identified as a list. +*** True Line Result +- ~char~ +** Processing line: ~- ~at~~ +- Line was identified as a list. +*** True Line Result +- ~plus~ +** Processing line: ~- ~forward_slash~~ +- Line was identified as a list. +*** True Line Result +- ~at~ +** Processing line: ~- ~back_slash~~ +- Line was identified as a list. +*** True Line Result +- ~forward_slash~ +** Processing line: ~- ~asterisk~~ +- Line was identified as a list. +*** True Line Result +- ~back_slash~ +** Processing line: ~- ~less_than~~ +- Line was identified as a list. +*** True Line Result +- ~asterisk~ +** Processing line: ~- ~greater_than~~ +- Line was identified as a list. +*** True Line Result +- ~less_than~ +** Processing line: ~- ~carat~~ +- Line was identified as a list. +*** True Line Result +- ~greater_than~ +** Processing line: ~- ~ampersand~~ +- Line was identified as a list. +*** True Line Result +- ~carat~ +** Processing line: ~- ~superscript_two~~ +- Line was identified as a list. +*** True Line Result +- ~ampersand~ +** Processing line: ~- ~circumflex~~ +- Line was identified as a list. +*** True Line Result +- ~superscript_two~ +** Processing line: ~- ~question_mark~~ +- Line was identified as a list. +*** True Line Result +- ~circumflex~ +** Processing line: ~- ~section_sign~~ +- Line was identified as a list. +*** True Line Result +- ~question_mark~ +** Processing line: ~- ~ordinal_indicator~~ +- Line was identified as a list. +*** True Line Result +- ~section_sign~ +** Processing line: ~- ~raw_key~~ +- Line was identified as a list. +*** True Line Result +- ~ordinal_indicator~ +** Processing line: ~- ~raw_key~~ +- Line was identified as a list. +*** True Line Result +- ~raw_key~ +** Processing line: ~- ~left_right~~ +- Line was identified as a list. +*** True Line Result +- ~raw_key~ +** Processing line: ~- ~up_down~~ +- Line was identified as a list. +*** True Line Result +- ~left_right~ +** Processing line: ~- ~directional_vector~~ +- Line was identified as a list. +*** True Line Result +- ~up_down~ +** Processing line: ~- ~truthy_keys~~ +- Line was identified as a list. +*** True Line Result +- ~directional_vector~ +** Processing line: ~**** ~inputs.keyboard.keys~~ +- Header detected. +*** True Line Result +- ~truthy_keys~ +*** True Line Result +**** ~inputs.keyboard.keys~ +** Processing line: ~Returns a ~Hash~ with all keys on the keyboard in their respective state. The ~Hash~ contains the following ~keys~~ +** Processing line: ~- ~:down~~ +- Line was identified as a list. +*** True Line Result +Returns a ~Hash~ with all keys on the keyboard in their respective state. The ~Hash~ contains the following ~keys~ +** Processing line: ~- ~:held~~ +- Line was identified as a list. +*** True Line Result +- ~:down~ +** Processing line: ~- ~:down_or_held~~ +- Line was identified as a list. +*** True Line Result +- ~:held~ +** Processing line: ~- ~:up~~ +- Line was identified as a list. +*** True Line Result +- ~:down_or_held~ +** Processing line: ~** ~args.outputs~~ +- Header detected. +*** True Line Result +- ~:up~ +*** True Line Result +** ~args.outputs~ +** Processing line: ~~args.outputs.PROPERTY~ is how you render to the screen.~ +** Processing line: ~*** ~.background_color~~ +- Header detected. +*** True Line Result +~args.outputs.PROPERTY~ is how you render to the screen. +*** True Line Result +*** ~.background_color~ +** Processing line: ~Set ~args.outputs.background_color~ to an ~Array~ with ~RGB~ values (eg. ~[255, 255, 255]~ for the color white).~ +** Processing line: ~*** ~.sounds~~ +- Header detected. +*** True Line Result +Set ~args.outputs.background_color~ to an ~Array~ with ~RGB~ values (eg. ~[255, 255, 255]~ for the color white). +*** True Line Result +*** ~.sounds~ +** Processing line: ~Send a file path to this collection to play a sound. The sound file must be under the ~mygame~ directory. Example: ~args.outputs.sounds << "sounds/jump.wav"~.~ +** Processing line: ~*** ~.solids~~ +- Header detected. +*** True Line Result +Send a file path to this collection to play a sound. The sound file must be under the ~mygame~ directory. Example: ~args.outputs.sounds << "sounds/jump.wav"~. +*** True Line Result +*** ~.solids~ +** Processing line: ~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.~ +** Processing line: ~*** ~.static_solids~~ +- Header detected. +*** True Line Result +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. +*** True Line Result +*** ~.static_solids~ +** Processing line: ~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.~ +** Processing line: ~*** ~.sprites~, ~.static_sprites~~ +- Header detected. +*** True Line Result +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. +*** True Line Result +*** ~.sprites~, ~.static_sprites~ +** Processing line: ~Send a Primitive to this collection to render a sprite to the screen.~ +** Processing line: ~*** ~.primitives~, ~.static_primitives~~ +- Header detected. +*** True Line Result +Send a Primitive to this collection to render a sprite to the screen. +*** True Line Result +*** ~.primitives~, ~.static_primitives~ +** Processing line: ~Send a Primitive of any type and it'll be rendered. The Primitive must have a ~primitive_marker~ that returns ~:solid~, ~:sprite~, ~:label~, ~:line~, ~:border~.~ +** Processing line: ~*** ~.labels~, ~.static_labels~~ +- Header detected. +*** True Line Result +Send a Primitive of any type and it'll be rendered. The Primitive must have a ~primitive_marker~ that returns ~:solid~, ~:sprite~, ~:label~, ~:line~, ~:border~. +*** True Line Result +*** ~.labels~, ~.static_labels~ +** Processing line: ~Send a Primitive to this collection to render text to the screen.~ +** Processing line: ~*** ~.lines~, ~.static_lines~~ +- Header detected. +*** True Line Result +Send a Primitive to this collection to render text to the screen. +*** True Line Result +*** ~.lines~, ~.static_lines~ +** Processing line: ~Send a Primitive to this collection to render a line to the screen.~ +** Processing line: ~*** ~.borders~, ~.static_borders~~ +- Header detected. +*** True Line Result +Send a Primitive to this collection to render a line to the screen. +*** True Line Result +*** ~.borders~, ~.static_borders~ +** Processing line: ~Send a Primitive to this collection to render an unfilled rectangle to the screen.~ +** Processing line: ~*** ~.debug~, ~.static_debug~~ +- Header detected. +*** True Line Result +Send a Primitive to this collection to render an unfilled rectangle to the screen. +*** True Line Result +*** ~.debug~, ~.static_debug~ +** Processing line: ~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.~ +** Processing line: ~** ~args.geometry~~ +- Header detected. +*** True Line Result +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. +*** True Line Result +** ~args.geometry~ +** Processing line: ~This property contains geometric functions. Functions can be invoked via ~args.geometry.FUNCTION~.~ +** 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~.~ +** Processing line: ~*** ~.intersect_rect? rect_2, rect_2~~ +- Header detected. +*** True Line Result +Returns ~true~ if ~rect_1~ is inside ~rect_2~. +*** True Line Result +*** ~.intersect_rect? rect_2, rect_2~ +** Processing line: ~Returns ~true~ if ~rect_1~ intersects ~rect_2~.~ +** Processing line: ~*** ~.scale_rect rect, x_percentage, y_percentage~~ +- Header detected. +*** True Line Result +Returns ~true~ if ~rect_1~ intersects ~rect_2~. +*** True Line Result +*** ~.scale_rect rect, x_percentage, y_percentage~ +** Processing line: ~Returns a new rectangle that is scaled by the percentages provided.~ +** Processing line: ~*** ~.angle_to start_point, end_point~~ +- Header detected. +*** True Line Result +Returns a new rectangle that is scaled by the percentages provided. +*** True Line Result +*** ~.angle_to start_point, end_point~ +** Processing line: ~Returns the angle in degrees between two points ~start_point~ to ~end_point~.~ +** Processing line: ~*** ~.angle_from start_point, end_point~~ +- Header detected. +*** True Line Result +Returns the angle in degrees between two points ~start_point~ to ~end_point~. +*** True Line Result +*** ~.angle_from start_point, end_point~ +** Processing line: ~Returns the angle in degrees between two points ~start_point~ from ~end_point~.~ +** Processing line: ~*** ~.point_inside_circle? point, circle_center_point, radius~~ +- Header detected. +*** True Line Result +Returns the angle in degrees between two points ~start_point~ from ~end_point~. +*** True Line Result +*** ~.point_inside_circle? point, circle_center_point, radius~ +** Processing line: ~Returns ~true~ if a point is inside a circle defined by its center and radius.~ +** Processing line: ~*** ~.center_inside_rect rect, other_rect~~ +- Header detected. +*** True Line Result +Returns ~true~ if a point is inside a circle defined by its center and radius. +*** True Line Result +*** ~.center_inside_rect rect, other_rect~ +** Processing line: ~Returns a new rectangle based of off ~rect~ that is centered inside of ~other_rect~.~ +** Processing line: ~*** ~.center_inside_rect_x rect, other_rect~~ +- Header detected. +*** True Line Result +Returns a new rectangle based of off ~rect~ that is centered inside of ~other_rect~. +*** True Line Result +*** ~.center_inside_rect_x rect, other_rect~ +** Processing line: ~Returns a new rectangle based of off ~rect~ that is centered horizontally inside of ~other_rect~.~ +** Processing line: ~*** ~.center_inside_rect_y rect, other_rect~~ +- Header detected. +*** True Line Result +Returns a new rectangle based of off ~rect~ that is centered horizontally inside of ~other_rect~. +*** True Line Result +*** ~.center_inside_rect_y rect, other_rect~ +** Processing line: ~Returns a new rectangle based of off ~rect~ that is centered vertically inside of ~other_rect~.~ +** Processing line: ~*** ~.anchor_rect rect, anchor_x, anchor_y~~ +- Header detected. +*** True Line Result +Returns a new rectangle based of off ~rect~ that is centered vertically inside of ~other_rect~. +*** True Line Result +*** ~.anchor_rect rect, anchor_x, anchor_y~ +** Processing line: ~Returns a new rectangle based of off ~rect~ that has been repositioned based on the percentages passed into anchor_x, and anchor_y.~ +** Processing line: ~*** ~.shift_line line, x, y~~ +- Header detected. +*** True Line Result +Returns a new rectangle based of off ~rect~ that has been repositioned based on the percentages passed into anchor_x, and anchor_y. +*** True Line Result +*** ~.shift_line line, x, y~ +** Processing line: ~Returns a line that is offset by ~x~, and ~y~.~ +** Processing line: ~*** ~.line_y_intercept line~~ +- Header detected. +*** True Line Result +Returns a line that is offset by ~x~, and ~y~. +*** True Line Result +*** ~.line_y_intercept line~ +** Processing line: ~Given a line, the ~b~ value is determined for the point slope form equation: ~y = mx + b~.~ +** Processing line: ~*** ~.angle_between_lines line_one, line_two, replace_infinity:~~ +- Header detected. +*** True Line Result +Given a line, the ~b~ value is determined for the point slope form equation: ~y = mx + b~. +*** True Line Result +*** ~.angle_between_lines line_one, line_two, replace_infinity:~ +** Processing line: ~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.~ +** Processing line: ~*** ~.line_slope line, replace_infinity:~~ +- Header detected. +*** True Line Result +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. +*** True Line Result +*** ~.line_slope line, replace_infinity:~ +** Processing line: ~Given a line, the ~m~ value is determined for the point slope form equation: ~y = mx + b~.~ +** Processing line: ~*** ~.line_rise_run~~ +- Header detected. +*** True Line Result +Given a line, the ~m~ value is determined for the point slope form equation: ~y = mx + b~. +*** True Line Result +*** ~.line_rise_run~ +** Processing line: ~Given a line, a ~Hash~ is returned that returns the slope as ~x~ and ~y~ properties with normalized values (the number is between -1 and 1).~ +** Processing line: ~*** ~.ray_test point, line~~ +- Header detected. +*** True Line Result +Given a line, a ~Hash~ is returned that returns the slope as ~x~ and ~y~ properties with normalized values (the number is between -1 and 1). +*** True Line Result +*** ~.ray_test point, line~ +** Processing line: ~Given a point and a line, ~:on~, ~:left~, or ~:right~ which represents the location of the point relative to the line.~ +** Processing line: ~*** ~.line_rect line~~ +- Header detected. +*** True Line Result +Given a point and a line, ~:on~, ~:left~, or ~:right~ which represents the location of the point relative to the line. +*** True Line Result +*** ~.line_rect line~ +** Processing line: ~Returns the bounding rectangle for a line.~ +** Processing line: ~*** ~.line_intersect line_one, line_two~~ +- Header detected. +*** True Line Result +Returns the bounding rectangle for a line. +*** True Line Result +*** ~.line_intersect line_one, line_two~ +** Processing line: ~Returns a point that represents the intersection of the lines.~ +** Processing line: ~*** ~.distance point_one, point_two~~ +- Header detected. +*** True Line Result +Returns a point that represents the intersection of the lines. +*** True Line Result +*** ~.distance point_one, point_two~ +** Processing line: ~Returns the distance between two points.~ +** Processing line: ~*** ~.cubic_bezier t, a, b, c, d~~ +- Header detected. +*** True Line Result +Returns the distance between two points. +*** True Line Result +*** ~.cubic_bezier t, a, b, c, d~ +** Processing line: ~Returns the cubic bezier function for tick_count ~t~ with anchors ~a~, ~b~, ~c~, and ~d~.~ +** Processing line: ~** ~args.easing~~ +- Header detected. +*** True Line Result +Returns the cubic bezier function for tick_count ~t~ with anchors ~a~, ~b~, ~c~, and ~d~. +*** True Line Result +** ~args.easing~ +** Processing line: ~A set of functions that allow you to determine the current progression of an easing function.~ +** Processing line: ~*** ~.ease start_tick, current_tick, duration, easing_functions~~ +- Header detected. +*** True Line Result +A set of functions that allow you to determine the current progression of an easing function. +*** True Line Result +*** ~.ease start_tick, current_tick, duration, easing_functions~ +** Processing line: ~Given a start, current, duration, and easing function names, ~ease~ returns a number between 0 and 1 that represents the progress of an easing function.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Given a start, current, duration, and easing function names, ~ease~ returns a number between 0 and 1 that represents the progress of an easing function. +** Processing line: ~The built in easing definitions you have access to are ~:identity~, ~:flip~, ~:quad~, ~:cube~, ~:quart~, and ~:quint~.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The built in easing definitions you have access to are ~:identity~, ~:flip~, ~:quad~, ~:cube~, ~:quart~, and ~:quint~. +** Processing line: ~This example will move a box at a linear speed from 0 to 1280.~ ** Processing line: ~~ - End of paragraph detected. *** True Line Result +This example will move a box at a linear speed from 0 to 1280. +** 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: ~ start_time = 10~ +- Inside source: true +*** True Line Result + start_time = 10 +** Processing line: ~ duration = 60~ +- Inside source: true +*** True Line Result + duration = 60 +** Processing line: ~ current_progress = args.easing.ease start_time,~ +- Inside source: true +*** True Line Result + current_progress = args.easing.ease start_time, +** Processing line: ~ args.state.tick_count,~ +- Inside source: true +*** True Line Result + args.state.tick_count, +** Processing line: ~ duration,~ +- Inside source: true +*** True Line Result + duration, +** Processing line: ~ :identity~ +- Inside source: true +*** True Line Result + :identity +** Processing line: ~ args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 }~ +- Inside source: true +*** True Line Result + args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 } +** 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: ~*** ~.ease_spline start_tick, current_tick, duration, spline~~ +- Header detected. +*** True Line Result +*** True Line Result +*** ~.ease_spline start_tick, current_tick, duration, spline~ +** Processing line: ~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.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~This example will move a box at a linear speed from 0 to 1280 and then back to 0 using two bezier definitions (represented as an array with four values).~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +This example will move a box at a linear speed from 0 to 1280 and then back to 0 using two bezier definitions (represented as an array with four values). +** 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: ~ start_time = 10~ +- Inside source: true +*** True Line Result + start_time = 10 +** Processing line: ~ duration = 60~ +- Inside source: true +*** True Line Result + duration = 60 +** Processing line: ~ spline = [~ +- Inside source: true +*** True Line Result + spline = [ +** Processing line: ~ [ 0, 0.25, 0.75, 1.0],~ +- Inside source: true +*** True Line Result + [ 0, 0.25, 0.75, 1.0], +** Processing line: ~ [1.0, 0.75, 0.25, 0]~ +- Inside source: true +*** True Line Result + [1.0, 0.75, 0.25, 0] +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ current_progress = args.easing.ease_spline start_time,~ +- Inside source: true +*** True Line Result + current_progress = args.easing.ease_spline start_time, +** Processing line: ~ args.state.tick_count,~ +- Inside source: true +*** True Line Result + args.state.tick_count, +** Processing line: ~ duration,~ +- Inside source: true +*** True Line Result + duration, +** Processing line: ~ spline~ +- Inside source: true +*** True Line Result + spline +** Processing line: ~ args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 }~ +- Inside source: true +*** True Line Result + args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 } +** 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: ~** ~args.string~~ +- Header detected. +*** True Line Result + +*** True Line Result +** ~args.string~ +** Processing line: ~Useful string functions not included in Ruby core libraries.~ +** Processing line: ~*** ~.wrapped_lines string, max_character_length~~ +- Header detected. +*** True Line Result +Useful string functions not included in Ruby core libraries. +*** True Line Result +*** ~.wrapped_lines string, max_character_length~ +** Processing line: ~This function will return a collection of strings given an input~ +** Processing line: ~~string~ and ~max_character_length~. The collection of strings returned will split the~ +** Processing line: ~input string into strings of ~length <= max_character_length~.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +This function will return a collection of strings given an input ~string~ and ~max_character_length~. The collection of strings returned will split the input string into strings of ~length <= max_character_length~. +** Processing line: ~The following example takes a string with new lines and creates a label for each one.~ +** Processing line: ~Labels (~args.outputs.labels~) ignore newline characters ~\n~.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The following example takes a string with new lines and creates a label for each one. Labels (~args.outputs.labels~) ignore newline characters ~\n~. +** 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 elit.~ +- Inside source: true +*** True Line Result + long_string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. +** Processing line: ~Integer dolor velit, ultricies vitae libero vel, aliquam imperdiet enim."~ +- Inside source: true +*** True Line Result +Integer 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: ~** ~args.grid~~ +- Header detected. +*** True Line Result + +*** True Line Result +** ~args.grid~ +** Processing line: ~Returns the virtual grid for the game.~ +** Processing line: ~*** ~.name~~ +- Header detected. +*** True Line Result +Returns the virtual grid for the game. +*** True Line Result +*** ~.name~ +** Processing line: ~Returns either ~:origin_bottom_left~ or ~:origin_center~.~ +** Processing line: ~*** ~.bottom~~ +- Header detected. +*** True Line Result +Returns either ~:origin_bottom_left~ or ~:origin_center~. +*** True Line Result +*** ~.bottom~ +** Processing line: ~Returns the ~y~ value that represents the bottom of the grid.~ +** Processing line: ~*** ~.top~~ +- Header detected. +*** True Line Result +Returns the ~y~ value that represents the bottom of the grid. +*** True Line Result +*** ~.top~ +** Processing line: ~Returns the ~y~ value that represents the top of the grid.~ +** Processing line: ~*** ~.left~~ +- Header detected. +*** True Line Result +Returns the ~y~ value that represents the top of the grid. +*** True Line Result +*** ~.left~ +** Processing line: ~Returns the ~x~ value that represents the left of the grid.~ +** Processing line: ~*** ~.right~~ +- Header detected. +*** True Line Result +Returns the ~x~ value that represents the left of the grid. +*** True Line Result +*** ~.right~ +** Processing line: ~Returns the ~x~ value that represents the right of the grid.~ +** Processing line: ~*** ~.rect~~ +- Header detected. +*** True Line Result +Returns the ~x~ value that represents the right of the grid. +*** True Line Result +*** ~.rect~ +** Processing line: ~Returns a rectangle Primitive that represents the grid.~ +** Processing line: ~*** ~.origin_bottom_left!~~ +- Header detected. +*** True Line Result +Returns a rectangle Primitive that represents the grid. +*** True Line Result +*** ~.origin_bottom_left!~ +** Processing line: ~Change the grids coordinate system to 0, 0 at the bottom left corner.~ +** Processing line: ~*** ~.origin_center!~~ +- Header detected. +*** True Line Result +Change the grids coordinate system to 0, 0 at the bottom left corner. +*** True Line Result +*** ~.origin_center!~ +** Processing line: ~Change the grids coordinate system to 0, 0 at the center of the screen.~ +** Processing line: ~*** ~.w~~ +- Header detected. +*** True Line Result +Change the grids coordinate system to 0, 0 at the center of the screen. +*** True Line Result +*** ~.w~ +** Processing line: ~Returns the grid's width (always 1280).~ +** Processing line: ~*** ~.h~~ +- Header detected. +*** True Line Result +Returns the grid's width (always 1280). +*** True Line Result +*** ~.h~ +** Processing line: ~Returns the grid's height (always 720).~ +** Processing line: ~** ~args.gtk~~ +- Header detected. +*** True Line Result +Returns the grid's height (always 720). +*** True Line Result +** ~args.gtk~ +** Processing line: ~This represents the DragonRuby Game Toolkit's Runtime Environment and can be accessed via ~args.gtk.METHOD~.~ +** Processing line: ~*** ~.argv~~ +- Header detected. +*** True Line Result +This represents the DragonRuby Game Toolkit's Runtime Environment and can be accessed via ~args.gtk.METHOD~. +*** True Line Result +*** ~.argv~ +** Processing line: ~Returns a ~String~ that represents the parameters passed into the ~./dragonruby~ binary.~ +** Processing line: ~*** ~.platform~~ +- Header detected. +*** True Line Result +Returns a ~String~ that represents the parameters passed into the ~./dragonruby~ binary. +*** True Line Result +*** ~.platform~ +** Processing line: ~Returns a ~String~ representing the operating system the game is running on.~ +** Processing line: ~*** ~.request_quit~~ +- Header detected. +*** True Line Result +Returns a ~String~ representing the operating system the game is running on. +*** True Line Result +*** ~.request_quit~ +** Processing line: ~Request that the runtime quit the game.~ +** Processing line: ~*** ~.write_file path, contents~~ +- Header detected. +*** True Line Result +Request that the runtime quit the game. +*** True Line Result +*** ~.write_file path, contents~ +** Processing line: ~Writes/overwrites a file within the game directory + path.~ +** Processing line: ~*** ~.write_file_root~~ +- Header detected. +*** True Line Result +Writes/overwrites a file within the game directory + path. +*** True Line Result +*** ~.write_file_root~ +** Processing line: ~Writes/overwrites a file within the root dragonruby binary directory + path.~ +** Processing line: ~*** ~.append_file path, contents~~ +- Header detected. +*** True Line Result +Writes/overwrites a file within the root dragonruby binary directory + path. +*** True Line Result +*** ~.append_file path, contents~ +** Processing line: ~Append content to a file located at the game directory + path.~ +** Processing line: ~*** ~.append_file_root path, contents~~ +- Header detected. +*** True Line Result +Append content to a file located at the game directory + path. +*** True Line Result +*** ~.append_file_root path, contents~ +** Processing line: ~Append content to a file located at the root dragonruby binary directory + path.~ +** Processing line: ~*** ~.read_file path~~ +- Header detected. +*** True Line Result +Append content to a file located at the root dragonruby binary directory + path. +*** True Line Result +*** ~.read_file path~ +** Processing line: ~Reads a file from the sandboxed file system.~ +** Processing line: ~*** ~.parse_xml string, parse_xml_file path~~ +- Header detected. +*** True Line Result +Reads a file from the sandboxed file system. +*** True Line Result +*** ~.parse_xml string, parse_xml_file path~ +** Processing line: ~Returns a ~Hash~ for a ~String~ that represents XML.~ +** Processing line: ~*** ~.parse_json string, parse_json_file path~~ +- Header detected. +*** True Line Result +Returns a ~Hash~ for a ~String~ that represents XML. +*** True Line Result +*** ~.parse_json string, parse_json_file path~ +** Processing line: ~Returns a ~Hash~ for a ~String~ that represents JSON.~ +** Processing line: ~*** ~.http_get url, extra_headers = {}~~ +- Header detected. +*** True Line Result +Returns a ~Hash~ for a ~String~ that represents JSON. +*** True Line Result +*** ~.http_get url, extra_headers = {}~ +** Processing line: ~Creates an async task to perform an HTTP GET.~ +** Processing line: ~*** ~.http_post url, form_fields = {}, extra_headers = {}~~ +- Header detected. +*** True Line Result +Creates an async task to perform an HTTP GET. +*** True Line Result +*** ~.http_post url, form_fields = {}, extra_headers = {}~ +** Processing line: ~Creates an async task to perform an HTTP POST.~ +** Processing line: ~*** ~.reset~~ +- Header detected. +*** True Line Result +Creates an async task to perform an HTTP POST. +*** True Line Result +*** ~.reset~ +** Processing line: ~Resets the game by deleting all data in ~args.state~ and setting ~args.state.tick_count~ back to ~0~.~ +** Processing line: ~*** ~.stop_music~~ +- Header detected. +*** True Line Result +Resets the game by deleting all data in ~args.state~ and setting ~args.state.tick_count~ back to ~0~. +*** True Line Result +*** ~.stop_music~ +** Processing line: ~Stops all background music.~ +** Processing line: ~*** ~.calcstringbox str, size_enum, font~~ +- Header detected. +*** True Line Result +Stops all background music. +*** True Line Result +*** ~.calcstringbox str, size_enum, font~ +** Processing line: ~Returns a tuple with width and height of a string being rendered.~ +** Processing line: ~*** ~.slowmo! factor~~ +- Header detected. +*** True Line Result +Returns a tuple with width and height of a string being rendered. +*** True Line Result +*** ~.slowmo! factor~ +** Processing line: ~Slows the game down by the factor provided.~ +** Processing line: ~*** ~.notify! string~~ +- Header detected. +*** True Line Result +Slows the game down by the factor provided. +*** True Line Result +*** ~.notify! string~ +** Processing line: ~Renders a toast message at the bottom of the screen.~ +** Processing line: ~*** ~.system~~ +- Header detected. +*** True Line Result +Renders a toast message at the bottom of the screen. +*** True Line Result +*** ~.system~ +** Processing line: ~Invokes a shell command and prints the result to the console.~ +** Processing line: ~*** ~.exec~~ +- Header detected. +*** True Line Result +Invokes a shell command and prints the result to the console. +*** True Line Result +*** ~.exec~ +** Processing line: ~Invokes a shell command and returns a ~String~ that represents the result.~ +** Processing line: ~*** ~.save_state~~ +- Header detected. +*** True Line Result +Invokes a shell command and returns a ~String~ that represents the result. +*** True Line Result +*** ~.save_state~ +** Processing line: ~Saves the game state to ~game_state.txt~.~ +** Processing line: ~*** ~.load_state~~ +- Header detected. +*** True Line Result +Saves the game state to ~game_state.txt~. +*** True Line Result +*** ~.load_state~ +** Processing line: ~Load ~args.state~ from ~game_state.txt~.~ +** Processing line: ~*** ~.serialize_state file, state~~ +- Header detected. +*** True Line Result +Load ~args.state~ from ~game_state.txt~. +*** True Line Result +*** ~.serialize_state file, state~ +** Processing line: ~Saves entity state to a file. If only one parameter is provided a string is returned for state instead of writing to a file.~ +** Processing line: ~*** ~.deserialize_state file~~ +- Header detected. +*** True Line Result +Saves entity state to a file. If only one parameter is provided a string is returned for state instead of writing to a file. +*** True Line Result +*** ~.deserialize_state file~ +** Processing line: ~Returns entity state from a file or serialization data represented as a ~String~.~ +** Processing line: ~*** ~.reset_sprite path~~ +- Header detected. +*** True Line Result +Returns entity state from a file or serialization data represented as a ~String~. +*** True Line Result +*** ~.reset_sprite path~ +** Processing line: ~Invalids the texture cache of a sprite.~ +** Processing line: ~*** ~.show_cursor~~ +- Header detected. +*** True Line Result +Invalids the texture cache of a sprite. +*** True Line Result +*** ~.show_cursor~ +** Processing line: ~Shows the mouse cursor.~ +** Processing line: ~*** ~.hide_cursor~~ +- Header detected. +*** True Line Result +Shows the mouse cursor. +*** True Line Result +*** ~.hide_cursor~ +** Processing line: ~Hides the mouse cursor.~ +** Processing line: ~*** ~.cursor_shown?~~ +- Header detected. +*** True Line Result +Hides the mouse cursor. +*** True Line Result +*** ~.cursor_shown?~ +** Processing line: ~Returns ~true~ if the mouse cursor is shown.~ +** Processing line: ~*** ~.set_window_fullscreen enabled~~ +- Header detected. +*** True Line Result +Returns ~true~ if the mouse cursor is shown. +*** True Line Result +*** ~.set_window_fullscreen enabled~ +** Processing line: ~Sets the game to either fullscreen (~enabled=true~) or windowed (~enabled=false)~.~ +** Processing line: ~*** ~.openurl url~~ +- Header detected. +*** True Line Result +Sets the game to either fullscreen (~enabled=true~) or windowed (~enabled=false)~. +*** True Line Result +*** ~.openurl url~ +** Processing line: ~Opens a url using the Operating System's default browser.~ +** Processing line: ~*** ~.get_base_dir~~ +- Header detected. +*** True Line Result +Opens a url using the Operating System's default browser. +*** True Line Result +*** ~.get_base_dir~ +** Processing line: ~Returns the full path of the DragonRuby binary directory.~ +** Processing line: ~*** ~.get_game_dir~~ +- Header detected. +*** True Line Result +Returns the full path of the DragonRuby binary directory. +*** True Line Result +*** ~.get_game_dir~ +** Processing line: ~Returns the full path of the game directory in its sandboxed environment.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Returns the full path of the game directory in its sandboxed environment. ** Processing line: ~* DOCS: ~GTK::Runtime#reset~~ - Header detected. *** True Line Result @@ -3719,6 +5212,53 @@ This function returns the width and height of a string. - End of paragraph detected. *** True Line Result +** Processing line: ~* DOCS: ~GTK::Runtime#write_file~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~GTK::Runtime#write_file~ +** Processing line: ~This function takes in two parameters. The first parameter is the file path and assumes the the game~ +** Processing line: ~directory is the root. The second parameter is the string that will be written. The method overwrites whatever~ +** Processing line: ~is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +This function takes in two parameters. The first parameter is the file path and assumes the the game directory is the root. The second parameter is the string that will be written. The method overwrites whatever is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting. +** 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: ~ if args.inputs.mouse.click~ +- Inside source: true +*** True Line Result + if args.inputs.mouse.click +** Processing line: ~ args.gtk.write_file "last-mouse-click.txt", "Mouse was clicked at #{args.state.tick_count}."~ +- Inside source: true +*** True Line Result + args.gtk.write_file "last-mouse-click.txt", "Mouse was clicked 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: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + ** Processing line: ~* DOCS: ~Array~~ - Header detected. *** True Line Result @@ -4665,6 +6205,258 @@ The default tolerance is set to ~0.1~, which means that the primitives are not c - End of paragraph detected. *** True Line Result +** Processing line: ~* DOCS: ~GTK::Args#audio~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~GTK::Args#audio~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Hash that contains audio sources that are playing. If you want to add a new sound add a hash with keys/values as~ +** Processing line: ~in the following example:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Hash that contains audio sources that are playing. If you want to add a new sound add a hash with keys/values as in the following 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: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ # The values below (except for input of course) are the default values that apply if you don't~ +- Inside source: true +*** True Line Result + # The values below (except for input of course) are the default values that apply if you don't +** Processing line: ~ # specify the value in the hash.~ +- Inside source: true +*** True Line Result + # specify the value in the hash. +** Processing line: ~ args.audio[:my_audio] = {~ +- Inside source: true +*** True Line Result + args.audio[:my_audio] = { +** Processing line: ~ input: 'sound/boom.wav', # Filename~ +- Inside source: true +*** True Line Result + input: 'sound/boom.wav', # Filename +** Processing line: ~ x: 0.0, y: 0.0, z: 0.0, # Relative position to the listener, x, y, z from -1.0 to 1.0~ +- Inside source: true +*** True Line Result + x: 0.0, y: 0.0, z: 0.0, # Relative position to the listener, x, y, z from -1.0 to 1.0 +** Processing line: ~ gain: 1.0, # Volume (0.0 to 1.0)~ +- Inside source: true +*** True Line Result + gain: 1.0, # Volume (0.0 to 1.0) +** Processing line: ~ pitch: 1.0, # Pitch of the sound (1.0 = original pitch)~ +- Inside source: true +*** True Line Result + pitch: 1.0, # Pitch of the sound (1.0 = original pitch) +** Processing line: ~ paused: false, # Set to true to pause the sound at the current playback position~ +- Inside source: true +*** True Line Result + paused: false, # Set to true to pause the sound at the current playback position +** Processing line: ~ looping: false, # Set to true to loop the sound/music until you stop it~ +- Inside source: true +*** True Line Result + looping: false, # Set to true to loop the sound/music until you stop it +** 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: ~Sounds that don't specify ~looping: true~ will be removed automatically from the hash after the playback ends.~ +** Processing line: ~Looping sounds or sounds that should stop early must be removed manually.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Sounds that don't specify ~looping: true~ will be removed automatically from the hash after the playback ends. Looping sounds or sounds that should stop early must be removed manually. +** Processing line: ~** Audio synthesis (Pro only)~ +- Header detected. +*** True Line Result + +*** True Line Result +** Audio synthesis (Pro only) +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Instead of a path to an audio file you can specify an array ~[channels, sample_rate, sound_source]~ for ~input~~ +** Processing line: ~to procedurally generate sound. You do this by providing an array of float values between -1.0 and 1.0 that~ +** Processing line: ~describe the waveform you want to play.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Instead of a path to an audio file you can specify an array ~[channels, sample_rate, sound_source]~ for ~input~ to procedurally generate sound. You do this by providing an array of float values between -1.0 and 1.0 that describe the waveform you want to play. +** Processing line: ~- ~channels~ is the number of channels: 1 = mono, 2 = stereo~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~- ~sample_rate~ is the number of values per seconds you will provide to describe the audio wave~ +- Line was identified as a list. +*** True Line Result +- ~channels~ is the number of channels: 1 = mono, 2 = stereo +** Processing line: ~- ~sound_source~ The source of your sound. See below~ +- Line was identified as a list. +*** True Line Result +- ~sample_rate~ is the number of values per seconds you will provide to describe the audio wave +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- ~sound_source~ The source of your sound. See below +** Processing line: ~*** Sound source~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Sound source +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~A sound source can be one of two things:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +A sound source can be one of two things: +** Processing line: ~- A ~Proc~ object that is called on demand to generate the next samples to play. Every call should generate~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~ enough samples for at least 0.1 to 0.5 seconds to get continuous playback without audio skips.~ +** Processing line: ~ The audio will continue playing endlessly until removed, so the ~looping~ option will have no effect.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- A ~Proc~ object that is called on demand to generate the next samples to play. Every call should generate + enough samples for at least 0.1 to 0.5 seconds to get continuous playback without audio skips. The audio will continue playing endlessly until removed, so the ~looping~ option will have no effect. +** Processing line: ~- An array of sample values that will be played back once. This is useful for procedurally generated one-off SFX.~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~ ~looping~ will work as expected~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- An array of sample values that will be played back once. This is useful for procedurally generated one-off SFX. + ~looping~ will work as expected +** Processing line: ~When you specify 2 for ~channels~, then the generated sample array will be played back in an interleaved manner.~ +** Processing line: ~The first element is the first sample for the left channel, the second element is the first sample for the right~ +** Processing line: ~channel, the third element is the second sample for the left channel etc.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +When you specify 2 for ~channels~, then the generated sample array will be played back in an interleaved manner. The first element is the first sample for the left channel, the second element is the first sample for the right channel, the third element is the second sample for the left channel etc. +** Processing line: ~*** Example:~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Example: +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** 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: ~ sample_rate = 48000~ +- Inside source: true +*** True Line Result + sample_rate = 48000 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ generate_sine_wave = lambda do~ +- Inside source: true +*** True Line Result + generate_sine_wave = lambda do +** Processing line: ~ frequency = 440.0 # A5~ +- Inside source: true +*** True Line Result + frequency = 440.0 # A5 +** Processing line: ~ samples_per_period = (sample_rate / frequency).ceil~ +- Inside source: true +*** True Line Result + samples_per_period = (sample_rate / frequency).ceil +** Processing line: ~ one_period = samples_per_period.map_with_index { |i|~ +- Inside source: true +*** True Line Result + one_period = samples_per_period.map_with_index { |i| +** Processing line: ~ Math.sin((2 * Math::PI) * (i / samples_per_period))~ +- Inside source: true +*** True Line Result + Math.sin((2 * Math::PI) * (i / samples_per_period)) +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ one_period * frequency # Generate 1 second worth of sound~ +- Inside source: true +*** True Line Result + one_period * frequency # Generate 1 second worth of sound +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.audio[:my_audio] ||= {~ +- Inside source: true +*** True Line Result + args.audio[:my_audio] ||= { +** Processing line: ~ input: [1, sample_rate, generate_sine_wave]~ +- Inside source: true +*** True Line Result + input: [1, sample_rate, generate_sine_wave] +** 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: ~~ +- End of paragraph detected. +*** True Line Result + ** Processing line: ~* DOCS: ~GTK::Outputs~~ - Header detected. *** True Line Result @@ -6460,23 +8252,136 @@ Returns the current tick of the application from the point it was started. This - End of paragraph detected. *** True Line Result +** Processing line: ~* DOCS: ~Geometry~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Geometry~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The Geometry module contains methods for calculations that are frequently used in game development.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The Geometry module contains methods for calculations that are frequently used in game development. ** Processing line: ~~ - End of paragraph detected. *** True Line Result -** Processing line: ~* Open Source~ +** Processing line: ~* DOCS: ~GTK::Geometry#scale_rect~~ - Header detected. *** True Line Result *** True Line Result -* Open Source -** Processing line: ~Follows is a source code listing for all files that have been open sourced. This code can be found in the ~./samples~ directory and online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]].~ -** Processing line: ~* Learn Ruby Optional - Beginner Ruby Primer - automation.rb~ +* DOCS: ~GTK::Geometry#scale_rect~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Given an array with 4 elements representing a rect [x, y, w, h], this function returns a scaled rect. It accepts three arguments:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Given an array with 4 elements representing a rect [x, y, w, h], this function returns a scaled rect. It accepts three arguments: +** Processing line: ~~ratio~: the ratio by which to scale the rect. A ratio of 2 will double the dimensions of the rect while a ratio of 0.5 will halve its dimensions.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +~ratio~: the ratio by which to scale the rect. A ratio of 2 will double the dimensions of the rect while a ratio of 0.5 will halve its dimensions. +** Processing line: ~~anchor_x~ and ~anchor_y~ specify the point within the rect from which to resize it. Setting both to 0 will affect the width and height of the rect, leaving x and y unchanged. Setting both to 0.5 will scale all sides of the rect proportionally from the center.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +~anchor_x~ and ~anchor_y~ specify the point within the rect from which to resize it. Setting both to 0 will affect the width and height of the rect, leaving x and y unchanged. Setting both to 0.5 will scale all sides of the rect proportionally from the center. +** Processing line: ~The ~scale_rect~ method can be applied directly to a sprite or other primitives. See CHEATSHEET: How to Scale a Sprite.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The ~scale_rect~ method can be applied directly to a sprite or other primitives. See CHEATSHEET: How to Scale a Sprite. +** 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: ~ # x, y, w, h~ +- Inside source: true +*** True Line Result + # x, y, w, h +** Processing line: ~ my_rect = [100, 100, 200, 200]~ +- Inside source: true +*** True Line Result + my_rect = [100, 100, 200, 200] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # halve the dimensions of the rect:~ +- Inside source: true +*** True Line Result + # halve the dimensions of the rect: +** Processing line: ~ # ratio, anchor_x, anchor_y~ +- Inside source: true +*** True Line Result + # ratio, anchor_x, anchor_y +** Processing line: ~ new_rect = my_rect.scale_rect(0.5, 0.5, 0.5)~ +- Inside source: true +*** True Line Result + new_rect = my_rect.scale_rect(0.5, 0.5, 0.5) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ puts new_rect # => [150.0, 150.0, 100.0, 100.0]~ +- Inside source: true +*** True Line Result + puts new_rect # => [150.0, 150.0, 100.0, 100.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: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* Source Code~ +- Header detected. +*** True Line Result + +*** True Line Result +* Source Code +** Processing line: ~Follows is a source code listing for all files that have been open sourced. This code can be found in the ~./samples~ directory.~ +** Processing line: ~** Samples~ - Header detected. *** True Line Result -Follows is a source code listing for all files that have been open sourced. This code can be found in the ~./samples~ directory and online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]]. +Follows is a source code listing for all files that have been open sourced. This code can be found in the ~./samples~ directory. +*** True Line Result +** Samples +** Processing line: ~*** Learn Ruby Optional - Beginner Ruby Primer - automation.rb~ +- Header detected. +*** True Line Result + *** True Line Result -* Learn Ruby Optional - Beginner Ruby Primer - automation.rb +*** Learn Ruby Optional - Beginner Ruby Primer - automation.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -6979,12 +8884,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Learn Ruby Optional - Beginner Ruby Primer - main.rb~ +** Processing line: ~*** Learn Ruby Optional - Beginner Ruby Primer - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Learn Ruby Optional - Beginner Ruby Primer - main.rb +*** Learn Ruby Optional - Beginner Ruby Primer - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -8275,12 +10180,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - printing.txt~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - printing.txt~ - Header detected. *** True Line Result *** True Line Result -* Learn Ruby Optional - Intermediate Ruby Primer - printing.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - printing.txt ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -8427,12 +10332,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - strings.txt~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - strings.txt~ - Header detected. *** True Line Result *** True Line Result -* Learn Ruby Optional - Intermediate Ruby Primer - strings.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - strings.txt ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -8515,12 +10420,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt~ - Header detected. *** True Line Result *** True Line Result -* Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -8627,12 +10532,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - booleans.txt~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - booleans.txt~ - Header detected. *** True Line Result *** True Line Result -* Learn Ruby Optional - Intermediate Ruby Primer - booleans.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - booleans.txt ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -8783,12 +10688,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - conditionals.txt~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - conditionals.txt~ - Header detected. *** True Line Result *** True Line Result -* Learn Ruby Optional - Intermediate Ruby Primer - conditionals.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - conditionals.txt ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -9267,12 +11172,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - looping.txt~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - looping.txt~ - Header detected. *** True Line Result *** True Line Result -* Learn Ruby Optional - Intermediate Ruby Primer - looping.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - looping.txt ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -9515,12 +11420,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - functions.txt~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - functions.txt~ - Header detected. *** True Line Result *** True Line Result -* Learn Ruby Optional - Intermediate Ruby Primer - functions.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - functions.txt ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -9819,12 +11724,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt~ - Header detected. *** True Line Result *** True Line Result -* Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt +*** Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -10687,12 +12592,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - main.rb~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Learn Ruby Optional - Intermediate Ruby Primer - main.rb +*** Learn Ruby Optional - Intermediate Ruby Primer - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -10727,12 +12632,12 @@ 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 - Labels - main.rb~ +** Processing line: ~*** Rendering Basics - Labels - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rendering Basics - Labels - main.rb +*** Rendering Basics - Labels - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -11151,12 +13056,12 @@ 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 - Lines - main.rb~ +** Processing line: ~*** Rendering Basics - Lines - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rendering Basics - Lines - main.rb +*** Rendering Basics - Lines - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -11395,12 +13300,12 @@ 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 - Solids Borders - main.rb~ +** Processing line: ~*** Rendering Basics - Solids Borders - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rendering Basics - Solids Borders - main.rb +*** Rendering Basics - Solids Borders - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -11687,12 +13592,12 @@ 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 - Sprites - main.rb~ +** Processing line: ~*** Rendering Basics - Sprites - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rendering Basics - Sprites - main.rb +*** Rendering Basics - Sprites - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -11887,12 +13792,12 @@ 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 - Sounds - main.rb~ +** Processing line: ~*** Rendering Basics - Sounds - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rendering Basics - Sounds - main.rb +*** Rendering Basics - Sounds - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -11939,30 +13844,6 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result Reminders: -** Processing line: ~ - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual~ -- Inside source: true -*** True Line Result - - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual -** Processing line: ~ 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).~ -- Inside source: true -*** True Line Result - 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720). -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ -- Inside source: true -*** True Line Result - - args.state.new_entity: Used when we want to create a new object, like a sprite or button. -** Processing line: ~ For example, if we want to create a new button, we would declare it as a new entity and~ -- Inside source: true -*** True Line Result - For example, if we want to create a new button, we would declare it as a new entity and -** Processing line: ~ then define its properties.~ -- Inside source: true -*** True Line Result - then define its properties. ** Processing line: ~~ - Inside source: true *** True Line Result @@ -11991,46 +13872,6 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result For more information about labels, go to mygame/documentation/02-labels.md. -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ -- Inside source: true -*** True Line Result - - reject: Removes elements from a collection if they meet certain requirements. -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ - first: Returns the first element of an array.~ -- Inside source: true -*** True Line Result - - first: Returns the first element of an array. -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ - inside_rect: Returns true or false depending on if the point is inside the rect.~ -- Inside source: true -*** True Line Result - - inside_rect: Returns true or false depending on if the point is inside the rect. -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ - to_sym: Returns symbol corresponding to string. Will create a symbol if it does~ -- Inside source: true -*** True Line Result - - to_sym: Returns symbol corresponding to string. Will create a symbol if it does -** Processing line: ~ not already exist.~ -- Inside source: true -*** True Line Result - not already exist. -** Processing line: ~~ -- Inside source: true -*** True Line Result - ** Processing line: ~ =end~ - Inside source: true *** True Line Result @@ -12059,602 +13900,34 @@ 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: ~ defaults args~ -- Inside source: true -*** True Line Result - defaults args -** Processing line: ~ render args~ -- Inside source: true -*** True Line Result - render args -** Processing line: ~ calc args~ -- Inside source: true -*** True Line Result - calc args -** Processing line: ~ input_mouse args~ -- Inside source: true -*** True Line Result - input_mouse args -** Processing line: ~ tick_instructions args, "Sample app shows how to play sounds. args.outputs.sounds << \"path_to_wav.wav\""~ -- Inside source: true -*** True Line Result - tick_instructions args, "Sample app shows how to play sounds. args.outputs.sounds << \"path_to_wav.wav\"" -** 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 happens in the first frame only~ -- Inside source: true -*** True Line Result - # Initialization happens in the first frame only -** Processing line: ~ def defaults _~ -- Inside source: true -*** True Line Result - def defaults _ -** Processing line: ~ _.state.notes ||= []~ -- Inside source: true -*** True Line Result - _.state.notes ||= [] -** Processing line: ~ _.state.click_feedbacks ||= []~ -- Inside source: true -*** True Line Result - _.state.click_feedbacks ||= [] -** Processing line: ~ _.state.current_level ||= 1~ -- Inside source: true -*** True Line Result - _.state.current_level ||= 1 -** Processing line: ~ _.state.times_wrong ||= 0 # when game starts, user hasn't guessed wrong yet~ -- Inside source: true -*** True Line Result - _.state.times_wrong ||= 0 # when game starts, user hasn't guessed wrong yet -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ # Uses a label to display current level, and shows the score~ -- Inside source: true -*** True Line Result - # Uses a label to display current level, and shows the score -** Processing line: ~ # Creates a button to play the sample note, and displays the available notes that could be a potential match~ -- Inside source: true -*** True Line Result - # Creates a button to play the sample note, and displays the available notes that could be a potential match -** Processing line: ~ def render _~ -- Inside source: true -*** True Line Result - def render _ -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ # grid.w_half positions the label in the horizontal center of the screen.~ -- Inside source: true -*** True Line Result - # grid.w_half positions the label in the horizontal center of the screen. -** Processing line: ~ _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(40), "Hole #{_.state.current_level} of 9", 0, 1, 0, 0, 0]~ -- Inside source: true -*** True Line Result - _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(40), "Hole #{_.state.current_level} of 9", 0, 1, 0, 0, 0] -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ render_score _ # shows score on screen~ -- Inside source: true -*** True Line Result - render_score _ # shows score on screen -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ if _.state.game_over # if game is over, a "play again" button is shown~ -- Inside source: true -*** True Line Result - if _.state.game_over # if game is over, a "play again" button is shown -** Processing line: ~ # Calculations ensure that Play Again label is displayed in center of border~ -- Inside source: true -*** True Line Result - # Calculations ensure that Play Again label is displayed in center of border -** Processing line: ~ # Remove calculations from y parameters and see what happens to border and label placement~ -- Inside source: true -*** True Line Result - # Remove calculations from y parameters and see what happens to border and label placement -** Processing line: ~ _.state.play_again_border ||= _.state.with_meta([560, _.grid.h * 3 / 4 - 40, 160, 60], 'again') # array definition, text/title~ -- Inside source: true -*** True Line Result - _.state.play_again_border ||= _.state.with_meta([560, _.grid.h * 3 / 4 - 40, 160, 60], 'again') # array definition, text/title -** Processing line: ~ _.outputs.labels << [_.grid.w_half, _.grid.h * 3 / 4, "Play Again", 0, 1, 0, 0, 0] # outputs label~ -- Inside source: true -*** True Line Result - _.outputs.labels << [_.grid.w_half, _.grid.h * 3 / 4, "Play Again", 0, 1, 0, 0, 0] # outputs label -** Processing line: ~ _.outputs.borders << _.state.play_again_border # outputs border~ -- Inside source: true -*** True Line Result - _.outputs.borders << _.state.play_again_border # outputs border -** Processing line: ~ else # otherwise, if game is not over~ -- Inside source: true -*** True Line Result - else # otherwise, if game is not over -** Processing line: ~ # Calculations ensure that label appears in center of border~ -- Inside source: true -*** True Line Result - # Calculations ensure that label appears in center of border -** Processing line: ~ _.state.play_note_border ||= _.state.with_meta([560, _.grid.h * 3 / 4 - 40, 160, 60], 'play') # array definition, text/title~ -- Inside source: true -*** True Line Result - _.state.play_note_border ||= _.state.with_meta([560, _.grid.h * 3 / 4 - 40, 160, 60], 'play') # array definition, text/title -** Processing line: ~ _.outputs.labels << [_.grid.w_half, _.grid.h * 3 / 4, "Play Note ##{_.state.current_level}", 0, 1, 0, 0, 0] # outputs label~ -- Inside source: true -*** True Line Result - _.outputs.labels << [_.grid.w_half, _.grid.h * 3 / 4, "Play Note ##{_.state.current_level}", 0, 1, 0, 0, 0] # outputs label -** Processing line: ~ _.outputs.borders << _.state.play_note_border # outputs border~ -- Inside source: true -*** True Line Result - _.outputs.borders << _.state.play_note_border # outputs border -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ return if _.state.game_over # return if game is over~ -- Inside source: true -*** True Line Result - return if _.state.game_over # return if game is over -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ _.outputs.labels << [_.grid.w_half, 400, "I think the note is a(n)...", 0, 1, 0, 0, 0] # outputs label~ -- Inside source: true -*** True Line Result - _.outputs.labels << [_.grid.w_half, 400, "I think the note is a(n)...", 0, 1, 0, 0, 0] # outputs label -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ # Shows all of the available notes that can be potential matches.~ -- Inside source: true -*** True Line Result - # Shows all of the available notes that can be potential matches. -** Processing line: ~ available_notes.each_with_index do |note, i|~ -- Inside source: true -*** True Line Result - available_notes.each_with_index do |note, i| -** Processing line: ~ _.state.notes[i] ||= piano_button(_, note, i + 1) # calls piano_button method on each note (creates label and border)~ -- Inside source: true -*** True Line Result - _.state.notes[i] ||= piano_button(_, note, i + 1) # calls piano_button method on each note (creates label and border) -** Processing line: ~ _.outputs.labels << _.state.notes[i].label # outputs note on screen with a label and a border~ -- Inside source: true -*** True Line Result - _.outputs.labels << _.state.notes[i].label # outputs note on screen with a label and a border -** Processing line: ~ _.outputs.borders << _.state.notes[i].border~ -- Inside source: true -*** True Line Result - _.outputs.borders << _.state.notes[i].border -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ # Shows whether or not the user is correct by filling the screen with either red or green~ -- Inside source: true -*** True Line Result - # Shows whether or not the user is correct by filling the screen with either red or green -** Processing line: ~ _.outputs.solids << _.state.click_feedbacks.map { |c| c.solid }~ -- Inside source: true -*** True Line Result - _.outputs.solids << _.state.click_feedbacks.map { |c| c.solid } -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ # Shows the score (number of times the user guesses wrong) onto the screen using labels.~ -- Inside source: true -*** True Line Result - # Shows the score (number of times the user guesses wrong) onto the screen using labels. -** Processing line: ~ def render_score _~ -- Inside source: true -*** True Line Result - def render_score _ -** Processing line: ~ if _.state.times_wrong == 0 # if the user has guessed wrong zero times, the score is par~ -- Inside source: true -*** True Line Result - if _.state.times_wrong == 0 # if the user has guessed wrong zero times, the score is par -** Processing line: ~ _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(80), "Score: PAR", 0, 1, 0, 0, 0]~ -- Inside source: true -*** True Line Result - _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(80), "Score: PAR", 0, 1, 0, 0, 0] -** Processing line: ~ else # otherwise, number of times the user has guessed wrong is shown~ -- Inside source: true -*** True Line Result - else # otherwise, number of times the user has guessed wrong is shown -** Processing line: ~ _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(80), "Score: +#{_.state.times_wrong}", 0, 1, 0, 0, 0] # shows score using string interpolation~ -- Inside source: true -*** True Line Result - _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(80), "Score: +#{_.state.times_wrong}", 0, 1, 0, 0, 0] # shows score using string interpolation -** 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: ~ # Sets the target note for the level and performs calculations on click_feedbacks.~ -- Inside source: true -*** True Line Result - # Sets the target note for the level and performs calculations on click_feedbacks. -** Processing line: ~ def calc _~ -- Inside source: true -*** True Line Result - def calc _ -** Processing line: ~ _.state.target_note ||= available_notes.sample # chooses a note from available_notes collection as target note~ -- Inside source: true -*** True Line Result - _.state.target_note ||= available_notes.sample # chooses a note from available_notes collection as target note -** Processing line: ~ _.state.click_feedbacks.each { |c| c.solid[-1] -= 5 } # remove this line and solid color will remain on screen indefinitely~ -- Inside source: true -*** True Line Result - _.state.click_feedbacks.each { |c| c.solid[-1] -= 5 } # remove this line and solid color will remain on screen indefinitely -** Processing line: ~ # comment this line out and the solid color will keep flashing on screen instead of being removed from click_feedbacks collection~ -- Inside source: true -*** True Line Result - # comment this line out and the solid color will keep flashing on screen instead of being removed from click_feedbacks collection -** Processing line: ~ _.state.click_feedbacks.reject! { |c| c.solid[-1] <= 0 }~ -- Inside source: true -*** True Line Result - _.state.click_feedbacks.reject! { |c| c.solid[-1] <= 0 } -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ # Uses input from the user to play the target note, as well as the other notes that could be a potential match.~ -- Inside source: true -*** True Line Result - # Uses input from the user to play the target note, as well as the other notes that could be a potential match. -** Processing line: ~ def input_mouse _~ -- Inside source: true -*** True Line Result - def input_mouse _ -** Processing line: ~ return unless _.inputs.mouse.click # return unless the mouse is clicked~ -- Inside source: true -*** True Line Result - return unless _.inputs.mouse.click # return unless the mouse is clicked -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ # finds button that was clicked by user~ -- Inside source: true -*** True Line Result - # finds button that was clicked by user -** Processing line: ~ button_clicked = _.outputs.borders.find_all do |b| # go through borders collection to find all borders that meet requirements~ -- Inside source: true -*** True Line Result - button_clicked = _.outputs.borders.find_all do |b| # go through borders collection to find all borders that meet requirements -** Processing line: ~ _.inputs.mouse.click.point.inside_rect? b # find button border that mouse was clicked inside of~ -- Inside source: true -*** True Line Result - _.inputs.mouse.click.point.inside_rect? b # find button border that mouse was clicked inside of -** Processing line: ~ end.reject {|b| !_.state.meta(b)}.first # reject, return first element~ -- Inside source: true -*** True Line Result - end.reject {|b| !_.state.meta(b)}.first # reject, return first element -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ return unless button_clicked # return unless button_clicked as a value (a button was clicked)~ -- Inside source: true -*** True Line Result - return unless button_clicked # return unless button_clicked as a value (a button was clicked) -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ queue_click_feedback _, # calls queue_click_feedback method on the button that was clicked~ -- Inside source: true -*** True Line Result - queue_click_feedback _, # calls queue_click_feedback method on the button that was clicked -** Processing line: ~ button_clicked.x,~ -- Inside source: true -*** True Line Result - button_clicked.x, -** Processing line: ~ button_clicked.y,~ -- Inside source: true -*** True Line Result - button_clicked.y, -** Processing line: ~ button_clicked.w,~ -- Inside source: true -*** True Line Result - button_clicked.w, -** Processing line: ~ button_clicked.h,~ -- Inside source: true -*** True Line Result - button_clicked.h, -** Processing line: ~ 150, 100, 200 # sets color of button to shade of purple~ -- Inside source: true -*** True Line Result - 150, 100, 200 # sets color of button to shade of purple -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ if _.state.meta(button_clicked) == 'play' # if "play note" button is pressed~ -- Inside source: true -*** True Line Result - if _.state.meta(button_clicked) == 'play' # if "play note" button is pressed -** Processing line: ~ _.outputs.sounds << "sounds/#{_.state.target_note}.wav" # sound of target note is output~ -- Inside source: true -*** True Line Result - _.outputs.sounds << "sounds/#{_.state.target_note}.wav" # sound of target note is output -** Processing line: ~ elsif _.state.meta(button_clicked) == 'again' # if "play game again" button is pressed~ -- Inside source: true -*** True Line Result - elsif _.state.meta(button_clicked) == 'again' # if "play game again" button is pressed -** Processing line: ~ _.state.target_note = nil # no target note~ -- Inside source: true -*** True Line Result - _.state.target_note = nil # no target note -** Processing line: ~ _.state.current_level = 1 # starts at level 1 again~ -- Inside source: true -*** True Line Result - _.state.current_level = 1 # starts at level 1 again -** Processing line: ~ _.state.times_wrong = 0 # starts off with 0 wrong guesses~ -- Inside source: true -*** True Line Result - _.state.times_wrong = 0 # starts off with 0 wrong guesses -** Processing line: ~ _.state.game_over = false # the game is not over (because it has just been restarted)~ -- Inside source: true -*** True Line Result - _.state.game_over = false # the game is not over (because it has just been restarted) -** Processing line: ~ else # otherwise if neither of those buttons were pressed~ -- Inside source: true -*** True Line Result - else # otherwise if neither of those buttons were pressed -** Processing line: ~ _.outputs.sounds << "sounds/#{_.state.meta(button_clicked)}.wav" # sound of clicked note is played~ -- Inside source: true -*** True Line Result - _.outputs.sounds << "sounds/#{_.state.meta(button_clicked)}.wav" # sound of clicked note is played -** Processing line: ~ if _.state.meta(button_clicked).to_sym == _.state.target_note # if clicked note is target note~ -- Inside source: true -*** True Line Result - if _.state.meta(button_clicked).to_sym == _.state.target_note # if clicked note is target note -** Processing line: ~ _.state.target_note = nil # target note is emptied~ -- Inside source: true -*** True Line Result - _.state.target_note = nil # target note is emptied -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ if _.state.current_level < 9 # if game hasn't reached level 9~ -- Inside source: true -*** True Line Result - if _.state.current_level < 9 # if game hasn't reached level 9 -** Processing line: ~ _.state.current_level += 1 # game goes to next level~ -- Inside source: true -*** True Line Result - _.state.current_level += 1 # game goes to next level -** Processing line: ~ else # otherwise, if game has reached level 9~ -- Inside source: true -*** True Line Result - else # otherwise, if game has reached level 9 -** Processing line: ~ _.state.game_over = true # the game is over~ -- Inside source: true -*** True Line Result - _.state.game_over = true # the game is over -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ queue_click_feedback _, 0, 0, _.grid.w, _.grid.h, 100, 200, 100 # green shown if user guesses correctly~ -- Inside source: true -*** True Line Result - queue_click_feedback _, 0, 0, _.grid.w, _.grid.h, 100, 200, 100 # green shown if user guesses correctly -** Processing line: ~ else # otherwise, if clicked note is not target note~ -- Inside source: true -*** True Line Result - else # otherwise, if clicked note is not target note -** Processing line: ~ _.state.times_wrong += 1 # increments times user guessed wrong~ -- Inside source: true -*** True Line Result - _.state.times_wrong += 1 # increments times user guessed wrong -** Processing line: ~ queue_click_feedback _, 0, 0, _.grid.w, _.grid.h, 200, 100, 100 # red shown is user guesses wrong~ -- Inside source: true -*** True Line Result - queue_click_feedback _, 0, 0, _.grid.w, _.grid.h, 200, 100, 100 # red shown is user guesses wrong -** 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: ~ # Creates a collection of all of the available notes as symbols~ -- Inside source: true -*** True Line Result - # Creates a collection of all of the available notes as symbols -** Processing line: ~ def available_notes~ -- Inside source: true -*** True Line Result - def available_notes -** Processing line: ~ [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4]~ -- Inside source: true -*** True Line Result - [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4] -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ # Creates buttons for each note, and sets a label (the note's name) and border for each note's button.~ -- Inside source: true -*** True Line Result - # Creates buttons for each note, and sets a label (the note's name) and border for each note's button. -** Processing line: ~ def piano_button _, note, position~ -- Inside source: true -*** True Line Result - def piano_button _, note, position -** Processing line: ~ _.state.new_entity(:button) do |b| # declares button as new entity~ -- Inside source: true -*** True Line Result - _.state.new_entity(:button) do |b| # declares button as new entity -** Processing line: ~ b.label = [460 + 40.mult(position), _.grid.h * 0.4, "#{note}", 0, 1, 0, 0, 0] # label definition~ -- Inside source: true -*** True Line Result - b.label = [460 + 40.mult(position), _.grid.h * 0.4, "#{note}", 0, 1, 0, 0, 0] # label definition -** Processing line: ~ b.border = _.state.with_meta([460 + 40.mult(position) - 20, _.grid.h * 0.4 - 32, 40, 40], note) # border definition, text/title; 20 subtracted so label is in center of border~ +** Processing line: ~ args.outputs.labels << [640, 360, "Click anywhere to play a random sound.", 0, 1]~ - Inside source: true *** True Line Result - b.border = _.state.with_meta([460 + 40.mult(position) - 20, _.grid.h * 0.4 - 32, 40, 40], note) # border definition, text/title; 20 subtracted so label is in center of border -** 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: ~ # Color of click feedback changes depending on what button was clicked, and whether the guess is right or wrong~ -- Inside source: true -*** True Line Result - # Color of click feedback changes depending on what button was clicked, and whether the guess is right or wrong -** Processing line: ~ # If a button is clicked, the inside of button is purple (see input_mouse method)~ -- Inside source: true -*** True Line Result - # If a button is clicked, the inside of button is purple (see input_mouse method) -** Processing line: ~ # If correct note is clicked, screen turns green~ -- Inside source: true -*** True Line Result - # If correct note is clicked, screen turns green -** Processing line: ~ # If incorrect note is clicked, screen turns red (again, see input_mouse method)~ -- Inside source: true -*** True Line Result - # If incorrect note is clicked, screen turns red (again, see input_mouse method) -** Processing line: ~ def queue_click_feedback _, x, y, w, h, *color~ -- Inside source: true -*** True Line Result - def queue_click_feedback _, x, y, w, h, *color -** Processing line: ~ _.state.click_feedbacks << _.state.new_entity(:click_feedback) do |c| # declares feedback as new entity~ -- Inside source: true -*** True Line Result - _.state.click_feedbacks << _.state.new_entity(:click_feedback) do |c| # declares feedback as new entity -** Processing line: ~ c.solid = [x, y, w, h, *color, 255] # sets color~ -- Inside source: true -*** True Line Result - c.solid = [x, y, w, h, *color, 255] # sets color -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~ end~ + args.outputs.labels << [640, 360, "Click anywhere to play a random sound.", 0, 1] +** Processing line: ~ args.state.notes ||= [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4]~ - Inside source: true *** True Line Result - end + args.state.notes ||= [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4] ** 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 ||~ +** Processing line: ~ if args.inputs.mouse.click~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.enter || -** Processing line: ~ args.inputs.keyboard.key_down.escape~ + if args.inputs.mouse.click +** Processing line: ~ # Play a sound by adding a string to args.outputs.sounds~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.escape -** Processing line: ~ args.state.key_event_occurred = true~ + # Play a sound by adding a string to args.outputs.sounds +** Processing line: ~ args.outputs.sounds << "sounds/#{args.state.notes.sample}.wav" # sound of target note is output~ - Inside source: true *** True Line Result - args.state.key_event_occurred = true + args.outputs.sounds << "sounds/#{args.state.notes.sample}.wav" # sound of target note is output ** 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 @@ -12671,12 +13944,12 @@ 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~ +** Processing line: ~*** Rendering Basics - Audio Mixer - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rendering Basics - Audio Mixer - main.rb +*** Rendering Basics - Audio Mixer - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -13339,12 +14612,12 @@ 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 - Sound Synthesis - main.rb~ +** Processing line: ~*** Rendering Basics - Sound Synthesis - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rendering Basics - Sound Synthesis - main.rb +*** Rendering Basics - Sound Synthesis - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -13355,794 +14628,818 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result # ./samples/01_rendering_basics/07_sound_synthesis/app/main.rb -** Processing line: ~ def tick args~ +** Processing line: ~ begin # region: top level tick methods~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ defaults args~ + begin # region: top level tick methods +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - defaults args -** Processing line: ~ render args~ + def tick args +** Processing line: ~ defaults args~ - Inside source: true *** True Line Result - render args -** Processing line: ~ input args~ + defaults args +** Processing line: ~ render args~ - Inside source: true *** True Line Result - input args -** Processing line: ~ process_audio_queue args~ + render args +** Processing line: ~ input args~ - Inside source: true *** True Line Result - process_audio_queue args -** Processing line: ~ end~ + input args +** Processing line: ~ process_audio_queue args~ - Inside source: true *** True Line Result - end + 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~ +** Processing line: ~ def defaults args~ - Inside source: true *** True Line Result - def defaults args -** Processing line: ~ args.state.sine_waves ||= {}~ + def defaults args +** Processing line: ~ args.state.sine_waves ||= {}~ - Inside source: true *** True Line Result - args.state.sine_waves ||= {} -** Processing line: ~ args.state.audio_queue ||= []~ + args.state.sine_waves ||= {} +** Processing line: ~ args.state.square_waves ||= {}~ - Inside source: true *** True Line Result - args.state.audio_queue ||= [] -** Processing line: ~ args.state.buttons ||= [~ + args.state.square_waves ||= {} +** Processing line: ~ args.state.saw_tooth_waves ||= {}~ - Inside source: true *** True Line Result - args.state.buttons ||= [ -** Processing line: ~ (frequency_buttons args),~ + args.state.saw_tooth_waves ||= {} +** Processing line: ~ args.state.triangle_waves ||= {}~ - Inside source: true *** True Line Result - (frequency_buttons args), -** Processing line: ~ (note_buttons args),~ + args.state.triangle_waves ||= {} +** Processing line: ~ args.state.audio_queue ||= []~ - Inside source: true *** True Line Result - (note_buttons args), -** Processing line: ~ (bell_buttons args)~ + args.state.audio_queue ||= [] +** Processing line: ~ args.state.buttons ||= [~ - Inside source: true *** True Line Result - (bell_buttons args) -** Processing line: ~ ].flatten~ + args.state.buttons ||= [ +** Processing line: ~ (frequency_buttons args),~ - Inside source: true *** True Line Result - ].flatten -** Processing line: ~ end~ + (frequency_buttons args), +** Processing line: ~ (sine_wave_note_buttons args),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + (sine_wave_note_buttons args), +** Processing line: ~ (bell_buttons args),~ - Inside source: true *** True Line Result - -** Processing line: ~ def frequency_buttons args~ + (bell_buttons args), +** Processing line: ~ (square_wave_note_buttons args),~ - Inside source: true *** True Line Result - def frequency_buttons args -** Processing line: ~ [~ + (square_wave_note_buttons args), +** Processing line: ~ (saw_tooth_wave_note_buttons args),~ - Inside source: true *** True Line Result - [ -** Processing line: ~ (button args,~ + (saw_tooth_wave_note_buttons args), +** Processing line: ~ (triangle_wave_note_buttons args),~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 4.0, col: 0, text: "300hz",~ + (triangle_wave_note_buttons args), +** Processing line: ~ ].flatten~ - Inside source: true *** True Line Result - row: 4.0, col: 0, text: "300hz", -** Processing line: ~ frequency: 300,~ + ].flatten +** Processing line: ~ end~ - Inside source: true *** True Line Result - frequency: 300, -** Processing line: ~ method_to_call: :play_sine_wave),~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - method_to_call: :play_sine_wave), -** Processing line: ~ (button args,~ + +** Processing line: ~ def render args~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 5.0, col: 0, text: "400hz",~ + def render args +** Processing line: ~ args.outputs.borders << args.state.buttons.map { |b| b[:border] }~ - Inside source: true *** True Line Result - row: 5.0, col: 0, text: "400hz", -** Processing line: ~ frequency: 400,~ + 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 - frequency: 400, -** Processing line: ~ method_to_call: :play_sine_wave),~ + args.outputs.labels << args.state.buttons.map { |b| b[:label] } +** Processing line: ~ args.outputs.labels << args.layout~ - Inside source: true *** True Line Result - method_to_call: :play_sine_wave), -** Processing line: ~ (button args,~ + args.outputs.labels << args.layout +** Processing line: ~ .rect(row: 0, col: 11.5)~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 6.0, col: 0, text: "500hz",~ + .rect(row: 0, col: 11.5) +** Processing line: ~ .yield_self { |r| r.merge y: r.y + r.h }~ - Inside source: true *** True Line Result - row: 6.0, col: 0, text: "500hz", -** Processing line: ~ frequency: 500,~ + .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 - frequency: 500, -** Processing line: ~ method_to_call: :play_sine_wave),~ + .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 - method_to_call: :play_sine_wave), -** Processing line: ~ ]~ + alignment_enum: 1) +** Processing line: ~ end~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def play_sine_wave args, sender~ +** Processing line: ~ def input args~ - Inside source: true *** True Line Result - def play_sine_wave args, sender -** Processing line: ~ queue_sine_wave args,~ + def input args +** Processing line: ~ args.state.buttons.each do |b|~ - Inside source: true *** True Line Result - queue_sine_wave args, -** Processing line: ~ frequency: sender[:frequency],~ + 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 - frequency: sender[:frequency], -** Processing line: ~ duration: 1.seconds,~ + 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 - duration: 1.seconds, -** Processing line: ~ fade_out: true~ + 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 - fade_out: true -** Processing line: ~ end~ + args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}" +** Processing line: ~ send b[:method_to_call], args, b~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 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: ~ def note_buttons args~ +** 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 - def note_buttons args -** 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'~ - Inside source: true *** True Line Result - [ -** Processing line: ~ (button args,~ + args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan' +** Processing line: ~ end~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 1.5, col: 3, text: "C4",~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - row: 1.5, col: 3, text: "C4", -** Processing line: ~ note: :c, octave: 4, method_to_call: :play_note),~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - note: :c, octave: 4, method_to_call: :play_note), -** Processing line: ~ (button args,~ + +** Processing line: ~ def process_audio_queue args~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 2.5, col: 3, text: "D4",~ + 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 - row: 2.5, col: 3, text: "D4", -** Processing line: ~ note: :d, octave: 4, method_to_call: :play_note),~ + 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 - note: :d, octave: 4, method_to_call: :play_note), -** Processing line: ~ (button args,~ + args.state.audio_queue -= to_queue +** Processing line: ~ to_queue.each { |a| args.audio[a[:id]] = a }~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 3.5, col: 3, text: "E4",~ + to_queue.each { |a| args.audio[a[:id]] = a } +** Processing line: ~~ - Inside source: true *** True Line Result - row: 3.5, col: 3, text: "E4", -** Processing line: ~ note: :e, octave: 4, method_to_call: :play_note),~ + +** Processing line: ~ args.audio.find_all { |k, v| v[:decay_rate] }~ - Inside source: true *** True Line Result - note: :e, octave: 4, method_to_call: :play_note), -** Processing line: ~ (button args,~ + 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 - (button args, -** Processing line: ~ row: 4.5, col: 3, text: "F4",~ + .each { |k, v| v[:gain] -= v[:decay_rate] } +** Processing line: ~~ - Inside source: true *** True Line Result - row: 4.5, col: 3, text: "F4", -** Processing line: ~ note: :f, octave: 4, method_to_call: :play_note),~ + +** Processing line: ~ sounds_to_stop = args.audio~ - Inside source: true *** True Line Result - note: :f, octave: 4, method_to_call: :play_note), -** Processing line: ~ (button args,~ + 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 - (button args, -** Processing line: ~ row: 5.5, col: 3, text: "G4",~ + .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 - row: 5.5, col: 3, text: "G4", -** Processing line: ~ note: :g, octave: 4, method_to_call: :play_note),~ + .map { |k, v| k } +** Processing line: ~~ - Inside source: true *** True Line Result - note: :g, octave: 4, method_to_call: :play_note), -** Processing line: ~ (button args,~ + +** Processing line: ~ sounds_to_stop.each { |k| args.audio.delete k }~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 6.5, col: 3, text: "A5",~ + sounds_to_stop.each { |k| args.audio.delete k } +** Processing line: ~ end~ - Inside source: true *** True Line Result - row: 6.5, col: 3, text: "A5", -** Processing line: ~ note: :a, octave: 5, method_to_call: :play_note),~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - note: :a, octave: 5, method_to_call: :play_note), -** Processing line: ~ (button args,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 7.5, col: 3, text: "B5",~ + +** Processing line: ~ begin # region: button definitions, ui layout, callback functions~ - Inside source: true *** True Line Result - row: 7.5, col: 3, text: "B5", -** Processing line: ~ note: :b, octave: 5, method_to_call: :play_note),~ + begin # region: button definitions, ui layout, callback functions +** Processing line: ~ def button args, opts~ - Inside source: true *** True Line Result - note: :b, octave: 5, method_to_call: :play_note), -** Processing line: ~ (button args,~ + 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 args, -** Processing line: ~ row: 8.5, col: 3, text: "C5",~ + button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1)) +** Processing line: ~~ - Inside source: true *** True Line Result - row: 8.5, col: 3, text: "C5", -** Processing line: ~ note: :c, octave: 5, method_to_call: :play_note),~ + +** Processing line: ~ button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0~ - Inside source: true *** True Line Result - note: :c, octave: 5, method_to_call: :play_note), -** Processing line: ~ ]~ + button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0 +** Processing line: ~~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + +** Processing line: ~ label_offset_x = 5~ - Inside source: true *** True Line Result - end + 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: ~ def play_note args, sender~ +** Processing line: ~ button_def[:label] = button_def[:rect].merge text: opts[:text],~ - Inside source: true *** True Line Result - def play_note args, sender -** Processing line: ~ queue_sine_wave args,~ + button_def[:label] = button_def[:rect].merge text: opts[:text], +** Processing line: ~ size_enum: -2.5,~ - Inside source: true *** True Line Result - queue_sine_wave args, -** Processing line: ~ frequency: (frequency_for note: sender[:note],~ + size_enum: -2.5, +** Processing line: ~ x: button_def[:rect].x + label_offset_x,~ - Inside source: true *** True Line Result - frequency: (frequency_for note: sender[:note], -** Processing line: ~ octave: sender[:octave]),~ + x: button_def[:rect].x + label_offset_x, +** Processing line: ~ y: button_def[:rect].y + label_offset_y~ - Inside source: true *** True Line Result - octave: sender[:octave]), -** Processing line: ~ duration: 1.seconds,~ + y: button_def[:rect].y + label_offset_y +** Processing line: ~~ - Inside source: true *** True Line Result - duration: 1.seconds, -** Processing line: ~ fade_out: true~ + +** Processing line: ~ button_def~ - Inside source: true *** True Line Result - fade_out: true -** Processing line: ~ end~ + button_def +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def bell_buttons args~ +** Processing line: ~ def play_sine_wave args, sender~ - Inside source: true *** True Line Result - def bell_buttons args -** Processing line: ~ [~ + def play_sine_wave args, sender +** Processing line: ~ queue_sine_wave args,~ - Inside source: true *** True Line Result - [ -** Processing line: ~ (button args,~ + queue_sine_wave args, +** Processing line: ~ frequency: sender[:frequency],~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 1.5, col: 6, text: "Bell C4",~ + frequency: sender[:frequency], +** Processing line: ~ duration: 1.seconds,~ - Inside source: true *** True Line Result - row: 1.5, col: 6, text: "Bell C4", -** Processing line: ~ note: :c, octave: 4, method_to_call: :play_bell),~ + duration: 1.seconds, +** Processing line: ~ fade_out: true~ - Inside source: true *** True Line Result - note: :c, octave: 4, method_to_call: :play_bell), -** Processing line: ~ (button args,~ + fade_out: true +** Processing line: ~ end~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 2.5, col: 6, text: "Bell D4",~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - row: 2.5, col: 6, text: "Bell D4", -** Processing line: ~ note: :d, octave: 4, method_to_call: :play_bell),~ + +** Processing line: ~ def play_note args, sender~ - Inside source: true *** True Line Result - note: :d, octave: 4, method_to_call: :play_bell), -** Processing line: ~ (button args,~ + def play_note args, sender +** Processing line: ~ method_to_call = :queue_sine_wave~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 3.5, col: 6, text: "Bell E4",~ + method_to_call = :queue_sine_wave +** Processing line: ~ method_to_call = :queue_square_wave if sender[:type] == :square~ - Inside source: true *** True Line Result - row: 3.5, col: 6, text: "Bell E4", -** Processing line: ~ note: :e, octave: 4, method_to_call: :play_bell),~ + 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 - note: :e, octave: 4, method_to_call: :play_bell), -** Processing line: ~ (button args,~ + 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 - (button args, -** Processing line: ~ row: 4.5, col: 6, text: "Bell F4",~ + 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 - row: 4.5, col: 6, text: "Bell F4", -** Processing line: ~ note: :f, octave: 4, method_to_call: :play_bell),~ + method_to_call = :queue_bell if sender[:type] == :bell +** Processing line: ~~ - Inside source: true *** True Line Result - note: :f, octave: 4, method_to_call: :play_bell), -** Processing line: ~ (button args,~ + +** Processing line: ~ send method_to_call, args,~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 5.5, col: 6, text: "Bell G4",~ + send method_to_call, args, +** Processing line: ~ frequency: (frequency_for note: sender[:note], octave: sender[:octave]),~ - Inside source: true *** True Line Result - row: 5.5, col: 6, text: "Bell G4", -** Processing line: ~ note: :g, octave: 4, method_to_call: :play_bell),~ + frequency: (frequency_for note: sender[:note], octave: sender[:octave]), +** Processing line: ~ duration: 1.seconds,~ - Inside source: true *** True Line Result - note: :g, octave: 4, method_to_call: :play_bell), -** Processing line: ~ (button args,~ + duration: 1.seconds, +** Processing line: ~ fade_out: true~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 6.5, col: 6, text: "Bell A5",~ + fade_out: true +** Processing line: ~ end~ - Inside source: true *** True Line Result - row: 6.5, col: 6, text: "Bell A5", -** Processing line: ~ note: :a, octave: 5, method_to_call: :play_bell),~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - note: :a, octave: 5, method_to_call: :play_bell), -** Processing line: ~ (button args,~ + +** Processing line: ~ def frequency_buttons args~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 7.5, col: 6, text: "Bell B5",~ + def frequency_buttons args +** Processing line: ~ [~ - Inside source: true *** True Line Result - row: 7.5, col: 6, text: "Bell B5", -** Processing line: ~ note: :b, octave: 5, method_to_call: :play_bell),~ + [ +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - note: :b, octave: 5, method_to_call: :play_bell), -** Processing line: ~ (button args,~ + (button args, +** Processing line: ~ row: 4.0, col: 0, text: "300hz",~ - Inside source: true *** True Line Result - (button args, -** Processing line: ~ row: 8.5, col: 6, text: "Bell C5",~ + row: 4.0, col: 0, text: "300hz", +** Processing line: ~ frequency: 300,~ - Inside source: true *** True Line Result - row: 8.5, col: 6, text: "Bell C5", -** Processing line: ~ note: :c, octave: 5, method_to_call: :play_bell),~ + frequency: 300, +** Processing line: ~ method_to_call: :play_sine_wave),~ - Inside source: true *** True Line Result - note: :c, octave: 5, method_to_call: :play_bell), -** Processing line: ~ ]~ + method_to_call: :play_sine_wave), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + (button args, +** Processing line: ~ row: 5.0, col: 0, text: "400hz",~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + row: 5.0, col: 0, text: "400hz", +** Processing line: ~ frequency: 400,~ - Inside source: true *** True Line Result - -** Processing line: ~ def play_bell args, sender~ + frequency: 400, +** Processing line: ~ method_to_call: :play_sine_wave),~ - Inside source: true *** True Line Result - def play_bell args, sender -** Processing line: ~ queue_bell args,~ + method_to_call: :play_sine_wave), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - queue_bell args, -** Processing line: ~ frequency: (frequency_for note: sender[:note],~ + (button args, +** Processing line: ~ row: 6.0, col: 0, text: "500hz",~ - Inside source: true *** True Line Result - frequency: (frequency_for note: sender[:note], -** Processing line: ~ octave: sender[:octave]),~ + row: 6.0, col: 0, text: "500hz", +** Processing line: ~ frequency: 500,~ - Inside source: true *** True Line Result - octave: sender[:octave]), -** Processing line: ~ duration: 2.seconds,~ + frequency: 500, +** Processing line: ~ method_to_call: :play_sine_wave),~ - Inside source: true *** True Line Result - duration: 2.seconds, -** Processing line: ~ fade_out: true~ + method_to_call: :play_sine_wave), +** Processing line: ~ ]~ - Inside source: true *** True Line Result - fade_out: true -** Processing line: ~ end~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render args~ +** Processing line: ~ def sine_wave_note_buttons args~ - Inside source: true *** True Line Result - def render args -** Processing line: ~ args.outputs.borders << args.state.buttons.map { |b| b[:border] }~ + def sine_wave_note_buttons args +** Processing line: ~ [~ - 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] }~ + [ +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - args.outputs.labels << args.state.buttons.map { |b| b[:label] } -** Processing line: ~ args.outputs.labels << args.layout~ + (button args, +** Processing line: ~ row: 1.5, col: 2, text: "Sine C4",~ - Inside source: true *** True Line Result - args.outputs.labels << args.layout -** Processing line: ~ .rect(row: 0,~ + 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 - .rect(row: 0, -** Processing line: ~ col: 11.5)~ + note: :c, octave: 4, type: :sine, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - col: 11.5) -** Processing line: ~ .yield_self { |r| r.merge y: r.y + r.h }~ + (button args, +** Processing line: ~ row: 2.5, col: 2, text: "Sine D4",~ - 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.",~ + 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 - .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)~ + note: :d, octave: 4, type: :sine, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - alignment_enum: 1) -** Processing line: ~ end~ + (button args, +** Processing line: ~ row: 3.5, col: 2, text: "Sine E4",~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 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 - -** Processing line: ~ def input args~ + note: :e, octave: 4, type: :sine, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - def input args -** Processing line: ~ args.state.buttons.each do |b|~ + (button args, +** Processing line: ~ row: 4.5, col: 2, text: "Sine F4",~ - Inside source: true *** True Line Result - args.state.buttons.each do |b| -** Processing line: ~ if args.inputs.mouse.click.inside_rect? b[:rect]~ + 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 - if args.inputs.mouse.click.inside_rect? b[:rect] -** Processing line: ~ parameter_string = (b.slice :frequency, :note, :octave).map { |k, v| "#{k}: #{v}" }.join ", "~ + note: :f, octave: 4, type: :sine, method_to_call: :play_note), +** Processing line: ~ (button args,~ - 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}"~ + (button args, +** Processing line: ~ row: 5.5, col: 2, text: "Sine G4",~ - Inside source: true *** True Line Result - args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}" -** Processing line: ~ send b[:method_to_call], args, b~ + 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 - send b[:method_to_call], args, b -** Processing line: ~ end~ + note: :g, octave: 4, type: :sine, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + (button args, +** Processing line: ~ row: 6.5, col: 2, text: "Sine A5",~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 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 - -** Processing line: ~ if 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 })~ + note: :a, octave: 5, type: :sine, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - if 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'~ + (button args, +** Processing line: ~ row: 7.5, col: 2, text: "Sine B5",~ - Inside source: true *** True Line Result - args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan' -** Processing line: ~ end~ + 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 - end -** Processing line: ~ end~ + note: :b, octave: 5, type: :sine, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + (button args, +** Processing line: ~ row: 8.5, col: 2, text: "Sine C5",~ - Inside source: true *** True Line Result - -** Processing line: ~ def process_audio_queue args~ + 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 - def process_audio_queue args -** Processing line: ~ to_queue = args.state.audio_queue.find_all { |v| v[:queue_at] <= args.tick_count }~ + note: :c, octave: 5, type: :sine, method_to_call: :play_note), +** Processing line: ~ ]~ - 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~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.audio_queue -= to_queue + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ to_queue.each do |a|~ +** Processing line: ~ def square_wave_note_buttons args~ - Inside source: true *** True Line Result - to_queue.each do |a| -** Processing line: ~ args.audio[a[:id]] = a~ + def square_wave_note_buttons args +** Processing line: ~ [~ - Inside source: true *** True Line Result - args.audio[a[:id]] = a -** Processing line: ~ end~ + [ +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + (button args, +** Processing line: ~ row: 1.5, col: 6, text: "Square C4",~ - Inside source: true *** True Line Result - -** Processing line: ~ args.audio.each do |k, v|~ + 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 - args.audio.each do |k, v| -** Processing line: ~ if v[:decay_rate]~ + note: :c, octave: 4, type: :square, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - if v[:decay_rate] -** Processing line: ~ v[:gain] -= v[:decay_rate]~ + (button args, +** Processing line: ~ row: 2.5, col: 6, text: "Square D4",~ - Inside source: true *** True Line Result - v[:gain] -= v[:decay_rate] -** Processing line: ~ end~ + 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 - end -** Processing line: ~ end~ + note: :d, octave: 4, type: :square, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + (button args, +** Processing line: ~ row: 3.5, col: 6, text: "Square E4",~ - Inside source: true *** True Line Result - -** Processing line: ~ sounds_to_stop = args.audio.find_all do |k, v|~ + 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 - sounds_to_stop = args.audio.find_all do |k, v| -** Processing line: ~ v[:stop_at] && args.state.tick_count >= v[:stop_at]~ + note: :e, octave: 4, type: :square, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - v[:stop_at] && args.state.tick_count >= v[:stop_at] -** Processing line: ~ end~ + (button args, +** Processing line: ~ row: 4.5, col: 6, text: "Square F4",~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 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 - -** Processing line: ~ sounds_to_stop.each do |(k, v)|~ + note: :f, octave: 4, type: :square, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - sounds_to_stop.each do |(k, v)| -** Processing line: ~ args.audio.delete k~ + (button args, +** Processing line: ~ row: 5.5, col: 6, text: "Square G4",~ - Inside source: true *** True Line Result - args.audio.delete k -** Processing line: ~ end~ + 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 - end -** Processing line: ~ end~ + note: :g, octave: 4, type: :square, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + (button args, +** Processing line: ~ row: 6.5, col: 6, text: "Square A5",~ - Inside source: true *** True Line Result - -** Processing line: ~ def graph_sine_wave args, sine_wave, frequency~ + 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 - def graph_sine_wave args, sine_wave, frequency -** Processing line: ~ if args.state.tick_count != args.state.graphed_at~ + note: :a, octave: 5, type: :square, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - if args.state.tick_count != args.state.graphed_at -** Processing line: ~ args.outputs.static_lines.clear~ + (button args, +** Processing line: ~ row: 7.5, col: 6, text: "Square B5",~ - Inside source: true *** True Line Result - args.outputs.static_lines.clear -** Processing line: ~ args.outputs.static_sprites.clear~ + 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 - args.outputs.static_sprites.clear -** Processing line: ~ end~ + note: :b, octave: 5, type: :square, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + (button args, +** Processing line: ~ row: 8.5, col: 6, text: "Square C5",~ - Inside source: true *** True Line Result - -** Processing line: ~ r, g, b = frequency.to_i % 80, frequency.to_i % 128, frequency.to_i % 255~ + 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 - r, g, b = frequency.to_i % 80, frequency.to_i % 128, frequency.to_i % 255 -** Processing line: ~ center_row = args.layout.rect(row: 5, col: 9)~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - center_row = args.layout.rect(row: 5, col: 9) -** Processing line: ~ x_scale = 20~ + end +** Processing line: ~ def saw_tooth_wave_note_buttons args~ - Inside source: true *** True Line Result - x_scale = 20 -** Processing line: ~ y_scale = 100~ + def saw_tooth_wave_note_buttons args +** Processing line: ~ [~ - Inside source: true *** True Line Result - y_scale = 100 -** Processing line: ~ max_points = 20~ + [ +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - max_points = 20 -** Processing line: ~~ + (button args, +** Processing line: ~ row: 1.5, col: 8, text: "Saw C4",~ - Inside source: true *** True Line Result - -** Processing line: ~ points = sine_wave~ + 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 - points = sine_wave -** Processing line: ~ if sine_wave.length > max_points~ + note: :c, octave: 4, type: :saw_tooth, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - if sine_wave.length > max_points -** Processing line: ~ resolution = sine_wave.length.idiv max_points~ + (button args, +** Processing line: ~ row: 2.5, col: 8, text: "Saw D4",~ - Inside source: true *** True Line Result - resolution = sine_wave.length.idiv max_points -** Processing line: ~ points = sine_wave.find_all~ + 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 - points = sine_wave.find_all -** Processing line: ~ .with_index { |y, i| i % resolution == 0 }~ + note: :d, octave: 4, type: :saw_tooth, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - .with_index { |y, i| i % resolution == 0 } -** Processing line: ~ end~ + (button args, +** Processing line: ~ row: 3.5, col: 8, text: "Saw E4",~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 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 - -** Processing line: ~ args.outputs.static_lines << points.map_with_index do |y, x|~ + note: :e, octave: 4, type: :saw_tooth, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - args.outputs.static_lines << points.map_with_index do |y, x| -** Processing line: ~ next_y = points[x + 1]~ + (button args, +** Processing line: ~ row: 4.5, col: 8, text: "Saw F4",~ - Inside source: true *** True Line Result - next_y = points[x + 1] -** Processing line: ~~ + 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 - -** Processing line: ~ if next_y~ + note: :f, octave: 4, type: :saw_tooth, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - if next_y -** Processing line: ~ {~ + (button args, +** Processing line: ~ row: 5.5, col: 8, text: "Saw G4",~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: center_row.x + (x * x_scale),~ + 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 - x: center_row.x + (x * x_scale), -** Processing line: ~ y: center_row.y + center_row.h.half + y_scale * y,~ + note: :g, octave: 4, type: :saw_tooth, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - y: center_row.y + center_row.h.half + y_scale * y, -** Processing line: ~ x2: center_row.x + ((x + 1) * x_scale),~ + (button args, +** Processing line: ~ row: 6.5, col: 8, text: "Saw A5",~ - Inside source: true *** True Line Result - x2: center_row.x + ((x + 1) * x_scale), -** Processing line: ~ y2: center_row.y + center_row.h.half + y_scale * next_y,~ + 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 - y2: center_row.y + center_row.h.half + y_scale * next_y, -** Processing line: ~ r: r,~ + note: :a, octave: 5, type: :saw_tooth, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - r: r, -** Processing line: ~ g: g,~ + (button args, +** Processing line: ~ row: 7.5, col: 8, text: "Saw B5",~ - Inside source: true *** True Line Result - g: g, -** Processing line: ~ b: b~ + 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 - b: b -** Processing line: ~ }~ + note: :b, octave: 5, type: :saw_tooth, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + (button args, +** Processing line: ~ row: 8.5, col: 8, text: "Saw C5",~ - Inside source: true *** True Line Result - end + 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 @@ -14151,834 +15448,1758 @@ 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.static_sprites << points.map_with_index do |y, x|~ +** Processing line: ~ def triangle_wave_note_buttons args~ - Inside source: true *** True Line Result - args.outputs.static_sprites << points.map_with_index do |y, x| -** Processing line: ~ {~ + def triangle_wave_note_buttons args +** Processing line: ~ [~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: (center_row.x + (x * x_scale)) - 1,~ + [ +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - x: (center_row.x + (x * x_scale)) - 1, -** Processing line: ~ y: (center_row.y + center_row.h.half + y_scale * y) - 1,~ + (button args, +** Processing line: ~ row: 1.5, col: 10, text: "Triangle C4",~ - Inside source: true *** True Line Result - y: (center_row.y + center_row.h.half + y_scale * y) - 1, -** Processing line: ~ w: 2,~ + 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 - w: 2, -** Processing line: ~ h: 2,~ + note: :c, octave: 4, type: :triangle, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - h: 2, -** Processing line: ~ path: 'sprites/square-black.png'~ + (button args, +** Processing line: ~ row: 2.5, col: 10, text: "Triangle D4",~ - Inside source: true *** True Line Result - path: 'sprites/square-black.png' -** Processing line: ~ }~ + 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 - } -** Processing line: ~ end~ + note: :d, octave: 4, type: :triangle, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + (button args, +** Processing line: ~ row: 3.5, col: 10, text: "Triangle E4",~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.graphed_at = args.state.tick_count~ + 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 - args.state.graphed_at = args.state.tick_count -** Processing line: ~ end~ + note: :e, octave: 4, type: :triangle, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + (button args, +** Processing line: ~ row: 4.5, col: 10, text: "Triangle F4",~ - Inside source: true *** True Line Result - -** Processing line: ~ def defaults_period_sine_wave_for~ + 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 - def defaults_period_sine_wave_for -** Processing line: ~ { frequency: 440, sample_rate: 48000 }~ + note: :f, octave: 4, type: :triangle, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - { frequency: 440, sample_rate: 48000 } -** Processing line: ~ end~ + (button args, +** Processing line: ~ row: 5.5, col: 10, text: "Triangle G4",~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 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 - -** Processing line: ~ def sine_wave_for opts = { }~ + note: :g, octave: 4, type: :triangle, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - def sine_wave_for opts = { } -** Processing line: ~ opts = defaults_period_sine_wave_for.merge opts~ + (button args, +** Processing line: ~ row: 6.5, col: 10, text: "Triangle A5",~ - Inside source: true *** True Line Result - opts = defaults_period_sine_wave_for.merge opts -** Processing line: ~ frequency = opts[:frequency]~ + 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 - frequency = opts[:frequency] -** Processing line: ~ sample_rate = opts[:sample_rate]~ + note: :a, octave: 5, type: :triangle, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - sample_rate = opts[:sample_rate] -** Processing line: ~ period_size = (sample_rate.fdiv frequency).ceil~ + (button args, +** Processing line: ~ row: 7.5, col: 10, text: "Triangle B5",~ - Inside source: true *** True Line Result - period_size = (sample_rate.fdiv frequency).ceil -** Processing line: ~ period_size.map_with_index do |i|~ + 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 - period_size.map_with_index do |i| -** Processing line: ~ Math::sin((2.0 * Math::PI) / (sample_rate.to_f / frequency.to_f) * i)~ + note: :b, octave: 5, type: :triangle, method_to_call: :play_note), +** Processing line: ~ (button args,~ - 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~ + (button args, +** Processing line: ~ row: 8.5, col: 10, text: "Triangle C5",~ - Inside source: true *** True Line Result - end.to_a -** Processing line: ~ end~ + 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 - end + 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 generate_audio_data sine_wave, sample_rate~ +** Processing line: ~ def bell_buttons args~ - 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~ + def bell_buttons args +** Processing line: ~ [~ - 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~ + [ +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - copy_count = (sample_size.fdiv sine_wave.length).ceil -** Processing line: ~ sine_wave * copy_count~ + (button args, +** Processing line: ~ row: 1.5, col: 4, text: "Bell C4",~ - Inside source: true *** True Line Result - sine_wave * copy_count -** Processing line: ~ end~ + 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 - end -** Processing line: ~~ + note: :c, octave: 4, type: :bell, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - -** Processing line: ~ def defaults_queue_sine_wave~ + (button args, +** Processing line: ~ row: 2.5, col: 4, text: "Bell D4",~ - 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 }~ + 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 - { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 } -** Processing line: ~ end~ + note: :d, octave: 4, type: :bell, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + (button args, +** Processing line: ~ row: 3.5, col: 4, text: "Bell E4",~ - Inside source: true *** True Line Result - -** Processing line: ~ def queue_sine_wave args, opts = { }~ + 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 - def queue_sine_wave args, opts = { } -** Processing line: ~ opts = defaults_queue_sine_wave.merge opts~ + note: :e, octave: 4, type: :bell, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - opts = defaults_queue_sine_wave.merge opts -** Processing line: ~ decay_rate = 0~ + (button args, +** Processing line: ~ row: 4.5, col: 4, text: "Bell F4",~ - Inside source: true *** True Line Result - decay_rate = 0 -** Processing line: ~ decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out]~ + 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 - decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out] -** Processing line: ~ frequency = opts[:frequency]~ + note: :f, octave: 4, type: :bell, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - frequency = opts[:frequency] -** Processing line: ~ sample_rate = 48000~ + (button args, +** Processing line: ~ row: 5.5, col: 4, text: "Bell G4",~ - Inside source: true *** True Line Result - sample_rate = 48000 -** Processing line: ~~ + 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 - -** Processing line: ~ audio_state = {~ + note: :g, octave: 4, type: :bell, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - audio_state = { -** Processing line: ~ id: (new_id! args),~ + (button args, +** Processing line: ~ row: 6.5, col: 4, text: "Bell A5",~ - Inside source: true *** True Line Result - id: (new_id! args), -** Processing line: ~ frequency: frequency,~ + 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 - frequency: frequency, -** Processing line: ~ sample_rate: 48000,~ + note: :a, octave: 5, type: :bell, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - sample_rate: 48000, -** Processing line: ~ stop_at: args.tick_count + opts[:queue_in] + opts[:duration],~ + (button args, +** Processing line: ~ row: 7.5, col: 4, text: "Bell B5",~ - Inside source: true *** True Line Result - stop_at: args.tick_count + opts[:queue_in] + opts[:duration], -** Processing line: ~ gain: opts[:gain].to_f,~ + 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 - gain: opts[:gain].to_f, -** Processing line: ~ queue_at: args.state.tick_count + opts[:queue_in],~ + note: :b, octave: 5, type: :bell, method_to_call: :play_note), +** Processing line: ~ (button args,~ - Inside source: true *** True Line Result - queue_at: args.state.tick_count + opts[:queue_in], -** Processing line: ~ decay_rate: decay_rate,~ + (button args, +** Processing line: ~ row: 8.5, col: 4, text: "Bell C5",~ - Inside source: true *** True Line Result - decay_rate: decay_rate, -** Processing line: ~ pitch: 1.0,~ + 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 - pitch: 1.0, -** Processing line: ~ looping: true,~ + note: :c, octave: 5, type: :bell, method_to_call: :play_note), +** Processing line: ~ ]~ - Inside source: true *** True Line Result - looping: true, -** Processing line: ~ paused: false~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - paused: false -** Processing line: ~ }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** 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~ +** Processing line: ~ begin # region: wave generation~ - Inside source: true *** True Line Result - args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate -** Processing line: ~~ + begin # region: wave generation +** Processing line: ~ begin # sine wave~ - Inside source: true *** True Line Result - -** Processing line: ~ proc = lambda do~ + begin # sine wave +** Processing line: ~ def defaults_sine_wave_for~ - Inside source: true *** True Line Result - proc = lambda do -** Processing line: ~ generate_audio_data args.state.sine_waves[frequency], sample_rate~ + def defaults_sine_wave_for +** Processing line: ~ { frequency: 440, sample_rate: 48000 }~ - Inside source: true *** True Line Result - generate_audio_data args.state.sine_waves[frequency], sample_rate -** Processing line: ~ end~ + { frequency: 440, sample_rate: 48000 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~ +** Processing line: ~ def sine_wave_for opts = {}~ - Inside source: true *** True Line Result - audio_state[:input] = [1, sample_rate, proc] -** Processing line: ~ graph_sine_wave args, sine_wave, frequency~ + def sine_wave_for opts = {} +** Processing line: ~ opts = defaults_sine_wave_for.merge opts~ - Inside source: true *** True Line Result - graph_sine_wave args, sine_wave, frequency -** Processing line: ~ args.state.audio_queue << audio_state~ + opts = defaults_sine_wave_for.merge opts +** Processing line: ~ frequency = opts[:frequency]~ - Inside source: true *** True Line Result - args.state.audio_queue << audio_state -** Processing line: ~ end~ + frequency = opts[:frequency] +** Processing line: ~ sample_rate = opts[:sample_rate]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + sample_rate = opts[:sample_rate] +** Processing line: ~ period_size = (sample_rate.fdiv frequency).ceil~ - Inside source: true *** True Line Result - -** Processing line: ~ def defaults_queue_bell~ + period_size = (sample_rate.fdiv frequency).ceil +** Processing line: ~ period_size.map_with_index do |i|~ - Inside source: true *** True Line Result - def defaults_queue_bell -** Processing line: ~ { frequency: 440, duration: 1.seconds, queue_in: 0 }~ + 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 - { frequency: 440, duration: 1.seconds, queue_in: 0 } -** Processing line: ~ end~ + 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 + end.to_a +** 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 = {}~ +** Processing line: ~ def defaults_queue_sine_wave~ - 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 }~ + 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 - (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b } -** Processing line: ~ end~ + { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def bell_harmonics~ +** Processing line: ~ def queue_sine_wave args, opts = {}~ - Inside source: true *** True Line Result - def bell_harmonics -** Processing line: ~ [~ + def queue_sine_wave args, opts = {} +** Processing line: ~ opts = defaults_queue_sine_wave.merge opts~ - Inside source: true *** True Line Result - [ -** Processing line: ~ { frequency_ratio: 0.5, duration_ratio: 1.00 },~ + opts = defaults_queue_sine_wave.merge opts +** Processing line: ~ frequency = opts[:frequency]~ - Inside source: true *** True Line Result - { frequency_ratio: 0.5, duration_ratio: 1.00 }, -** Processing line: ~ { frequency_ratio: 1.0, duration_ratio: 0.80 },~ + frequency = opts[:frequency] +** Processing line: ~ sample_rate = 48000~ - Inside source: true *** True Line Result - { frequency_ratio: 1.0, duration_ratio: 0.80 }, -** Processing line: ~ { frequency_ratio: 2.0, duration_ratio: 0.60 },~ + sample_rate = 48000 +** Processing line: ~~ - Inside source: true *** True Line Result - { frequency_ratio: 2.0, duration_ratio: 0.60 }, -** Processing line: ~ { frequency_ratio: 3.0, duration_ratio: 0.40 },~ + +** Processing line: ~ sine_wave = sine_wave_for frequency: frequency, sample_rate: sample_rate~ - Inside source: true *** True Line Result - { frequency_ratio: 3.0, duration_ratio: 0.40 }, -** Processing line: ~ { frequency_ratio: 4.2, duration_ratio: 0.25 },~ + 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 - { frequency_ratio: 4.2, duration_ratio: 0.25 }, -** Processing line: ~ { frequency_ratio: 5.4, duration_ratio: 0.20 },~ + args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate +** Processing line: ~~ - Inside source: true *** True Line Result - { frequency_ratio: 5.4, duration_ratio: 0.20 }, -** Processing line: ~ { frequency_ratio: 6.8, duration_ratio: 0.15 }~ + +** Processing line: ~ proc = lambda do~ - Inside source: true *** True Line Result - { frequency_ratio: 6.8, duration_ratio: 0.15 } -** Processing line: ~ ]~ + proc = lambda do +** Processing line: ~ generate_audio_data args.state.sine_waves[frequency], sample_rate~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + generate_audio_data args.state.sine_waves[frequency], sample_rate +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def bell_to_sine_waves opts~ +** Processing line: ~ audio_state = new_audio_state args, opts~ - Inside source: true *** True Line Result - def bell_to_sine_waves opts -** Processing line: ~ bell_harmonics.map do |b|~ + audio_state = new_audio_state args, opts +** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~ - 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],~ + 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 - frequency: opts[:frequency] * b[:frequency_ratio], -** Processing line: ~ duration: opts[:duration] * b[:duration_ratio],~ + queue_audio args, audio_state: audio_state, wave: sine_wave +** Processing line: ~ end~ - Inside source: true *** True Line Result - duration: opts[:duration] * b[:duration_ratio], -** Processing line: ~ queue_in: opts[:queue_in],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - queue_in: opts[:queue_in], -** Processing line: ~ gain: (1.fdiv bell_harmonics.length),~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - gain: (1.fdiv bell_harmonics.length), -** Processing line: ~ fade_out: true~ + +** Processing line: ~ begin # region: square wave~ - Inside source: true *** True Line Result - fade_out: true -** Processing line: ~ }~ + begin # region: square wave +** Processing line: ~ def defaults_square_wave_for~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + def defaults_square_wave_for +** Processing line: ~ { frequency: 440, sample_rate: 48000 }~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + { frequency: 440, sample_rate: 48000 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def defaults_frequency_for~ +** Processing line: ~ def square_wave_for opts = {}~ - Inside source: true *** True Line Result - def defaults_frequency_for -** Processing line: ~ { note: :a, octave: 5, sharp: false, flat: false }~ + def square_wave_for opts = {} +** Processing line: ~ opts = defaults_square_wave_for.merge opts~ - Inside source: true *** True Line Result - { note: :a, octave: 5, sharp: false, flat: false } -** Processing line: ~ end~ + opts = defaults_square_wave_for.merge opts +** Processing line: ~ sine_wave = sine_wave_for opts~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + sine_wave = sine_wave_for opts +** Processing line: ~ sine_wave.map do |v|~ - Inside source: true *** True Line Result - -** Processing line: ~ def frequency_for opts = {}~ + sine_wave.map do |v| +** Processing line: ~ if v >= 0~ - Inside source: true *** True Line Result - def frequency_for opts = {} -** Processing line: ~ opts = defaults_frequency_for.merge opts~ + if v >= 0 +** Processing line: ~ 1.0~ - Inside source: true *** True Line Result - opts = defaults_frequency_for.merge opts -** Processing line: ~ octave_offset_multiplier = opts[:octave] - 5~ + 1.0 +** Processing line: ~ else~ - Inside source: true *** True Line Result - octave_offset_multiplier = opts[:octave] - 5 -** Processing line: ~ note = note_frequencies_octave_5[opts[:note]]~ + else +** Processing line: ~ -1.0~ - Inside source: true *** True Line Result - note = note_frequencies_octave_5[opts[:note]] -** Processing line: ~ if octave_offset_multiplier < 0~ + -1.0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - if octave_offset_multiplier < 0 -** Processing line: ~ note = note * 1 / (octave_offset_multiplier.abs + 1)~ + end +** Processing line: ~ end.to_a~ - Inside source: true *** True Line Result - note = note * 1 / (octave_offset_multiplier.abs + 1) -** Processing line: ~ elsif octave_offset_multiplier > 0~ + end.to_a +** Processing line: ~ end~ - Inside source: true *** True Line Result - elsif octave_offset_multiplier > 0 -** Processing line: ~ note = note * (octave_offset_multiplier.abs + 1) / 1~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - note = note * (octave_offset_multiplier.abs + 1) / 1 -** Processing line: ~ end~ + +** Processing line: ~ def defaults_queue_square_wave~ - Inside source: true *** True Line Result - end -** Processing line: ~ note~ + 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 - note -** Processing line: ~ end~ + { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def note_frequencies_octave_5~ +** Processing line: ~ def queue_square_wave args, opts = {}~ - Inside source: true *** True Line Result - def note_frequencies_octave_5 -** Processing line: ~ {~ + def queue_square_wave args, opts = {} +** Processing line: ~ opts = defaults_queue_square_wave.merge opts~ - Inside source: true *** True Line Result - { -** Processing line: ~ a: 440.0,~ + opts = defaults_queue_square_wave.merge opts +** Processing line: ~ frequency = opts[:frequency]~ - Inside source: true *** True Line Result - a: 440.0, -** Processing line: ~ a_sharp: 466.16, b_flat: 466.16,~ + frequency = opts[:frequency] +** Processing line: ~ sample_rate = 48000~ - Inside source: true *** True Line Result - a_sharp: 466.16, b_flat: 466.16, -** Processing line: ~ b: 493.88,~ + sample_rate = 48000 +** Processing line: ~~ - Inside source: true *** True Line Result - b: 493.88, -** Processing line: ~ c: 523.25,~ + +** Processing line: ~ square_wave = square_wave_for frequency: frequency, sample_rate: sample_rate~ - Inside source: true *** True Line Result - c: 523.25, -** Processing line: ~ c_sharp: 554.37, d_flat: 587.33,~ + 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 - c_sharp: 554.37, d_flat: 587.33, -** Processing line: ~ d: 587.33,~ + args.state.square_waves[frequency] ||= square_wave_for frequency: frequency, sample_rate: sample_rate +** Processing line: ~~ - Inside source: true *** True Line Result - d: 587.33, -** Processing line: ~ d_sharp: 622.25, e_flat: 659.25,~ + +** Processing line: ~ proc = lambda do~ - Inside source: true *** True Line Result - d_sharp: 622.25, e_flat: 659.25, -** Processing line: ~ e: 659.25,~ + proc = lambda do +** Processing line: ~ generate_audio_data args.state.square_waves[frequency], sample_rate~ - Inside source: true *** True Line Result - e: 659.25, -** Processing line: ~ f: 698.25,~ + generate_audio_data args.state.square_waves[frequency], sample_rate +** Processing line: ~ end~ - Inside source: true *** True Line Result - f: 698.25, -** Processing line: ~ f_sharp: 739.99, g_flat: 739.99,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - f_sharp: 739.99, g_flat: 739.99, -** Processing line: ~ g: 783.99,~ + +** Processing line: ~ audio_state = new_audio_state args, opts~ - Inside source: true *** True Line Result - g: 783.99, -** Processing line: ~ g_sharp: 830.61, a_flat: 830.61~ + audio_state = new_audio_state args, opts +** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~ - Inside source: true *** True Line Result - g_sharp: 830.61, a_flat: 830.61 -** Processing line: ~ }~ + 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 - } -** Processing line: ~ end~ + queue_audio args, audio_state: audio_state, wave: square_wave +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def new_id! args~ +** Processing line: ~ begin # region: saw tooth wave~ - Inside source: true *** True Line Result - def new_id! args -** Processing line: ~ args.state.audio_id ||= 0~ + begin # region: saw tooth wave +** Processing line: ~ def defaults_saw_tooth_wave_for~ - Inside source: true *** True Line Result - args.state.audio_id ||= 0 -** Processing line: ~ args.state.audio_id += 1~ + def defaults_saw_tooth_wave_for +** Processing line: ~ { frequency: 440, sample_rate: 48000 }~ - Inside source: true *** True Line Result - args.state.audio_id += 1 -** Processing line: ~ end~ + { frequency: 440, sample_rate: 48000 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def button args, opts~ +** Processing line: ~ def saw_tooth_wave_for 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))~ + def saw_tooth_wave_for opts = {} +** Processing line: ~ opts = defaults_saw_tooth_wave_for.merge opts~ - Inside source: true *** True Line Result - button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1)) -** Processing line: ~~ + opts = defaults_saw_tooth_wave_for.merge opts +** Processing line: ~ sine_wave = sine_wave_for opts~ - Inside source: true *** True Line Result - -** Processing line: ~ button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0~ + sine_wave = sine_wave_for opts +** Processing line: ~ period_size = sine_wave.length~ - Inside source: true *** True Line Result - button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0 -** Processing line: ~~ + period_size = sine_wave.length +** Processing line: ~ sine_wave.map_with_index do |v, i|~ - Inside source: true *** True Line Result - -** Processing line: ~ font_size_enum = args.layout.font_relative_size_enum 0~ + sine_wave.map_with_index do |v, i| +** Processing line: ~ (((i % period_size).fdiv period_size) * 2) - 1~ - Inside source: true *** True Line Result - font_size_enum = args.layout.font_relative_size_enum 0 -** Processing line: ~ label_offset_x = 4~ + (((i % period_size).fdiv period_size) * 2) - 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - label_offset_x = 4 -** Processing line: ~ label_offset_y = button_def[:rect].h.half + button_def[:rect].h.idiv(4)~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - label_offset_y = button_def[:rect].h.half + button_def[:rect].h.idiv(4) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ button_def[:label] = button_def[:rect].merge text: opts[:text],~ +** Processing line: ~ def defaults_queue_saw_tooth_wave~ - Inside source: true *** True Line Result - button_def[:label] = button_def[:rect].merge text: opts[:text], -** Processing line: ~ size_enum: font_size_enum,~ + 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 - size_enum: font_size_enum, -** 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~ + { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - y: button_def[:rect].y + label_offset_y + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ button_def~ +** Processing line: ~ def queue_saw_tooth_wave args, opts = {}~ - Inside source: true *** True Line Result - button_def -** Processing line: ~ end~ + def queue_saw_tooth_wave args, opts = {} +** Processing line: ~ opts = defaults_queue_saw_tooth_wave.merge opts~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + opts = defaults_queue_saw_tooth_wave.merge opts +** Processing line: ~ frequency = opts[:frequency]~ - Inside source: true *** True Line Result - -** Processing line: ~ $gtk.reset~ + frequency = opts[:frequency] +** Processing line: ~ sample_rate = 48000~ - Inside source: true *** True Line Result - $gtk.reset + sample_rate = 48000 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. +** Processing line: ~ saw_tooth_wave = saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate~ +- Inside source: true *** True Line Result -#+end_src + 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: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Input Basics - Keyboard - main.rb~ -- Header detected. +** 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 -* Input Basics - Keyboard - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + 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 -#+begin_src ruby -** Processing line: ~ # ./samples/02_input_basics/01_keyboard/app/main.rb~ + audio_state = new_audio_state args, opts +** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~ - Inside source: true *** True Line Result - # ./samples/02_input_basics/01_keyboard/app/main.rb -** Processing line: ~ =begin~ + 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 - =begin -** Processing line: ~~ + queue_audio args, audio_state: audio_state, wave: saw_tooth_wave +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - APIs listing that haven't been encountered in a previous sample apps: + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.inputs.keyboard.key_up.KEY: The value of the properties will be set~ +** Processing line: ~ begin # region: triangle wave~ - Inside source: true *** True Line Result - - args.inputs.keyboard.key_up.KEY: The value of the properties will be set -** Processing line: ~ to the frame that the key_up event occurred (the frame correlates~ + begin # region: triangle wave +** Processing line: ~ def defaults_triangle_wave_for~ - Inside source: true *** True Line Result - to the frame that the key_up event occurred (the frame correlates -** Processing line: ~ to args.state.tick_count). Otherwise the value will be nil. For a~ + def defaults_triangle_wave_for +** Processing line: ~ { frequency: 440, sample_rate: 48000 }~ - Inside source: true *** True Line Result - to args.state.tick_count). Otherwise the value will be nil. For a -** Processing line: ~ full listing of keys, take a look at mygame/documentation/06-keyboard.md.~ + { frequency: 440, sample_rate: 48000 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - full listing of keys, take a look at mygame/documentation/06-keyboard.md. -** Processing line: ~ - args.state.PROPERTY: The state property on args is a dynamic~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - - args.state.PROPERTY: The state property on args is a dynamic -** Processing line: ~ structure. You can define ANY property here with ANY type of~ + +** Processing line: ~ def triangle_wave_for opts = {}~ - Inside source: true *** True Line Result - structure. You can define ANY property here with ANY type of -** Processing line: ~ arbitrary nesting. Properties defined on args.state will be retained~ + def triangle_wave_for opts = {} +** Processing line: ~ opts = defaults_saw_tooth_wave_for.merge opts~ - Inside source: true *** True Line Result - arbitrary nesting. Properties defined on args.state will be retained -** Processing line: ~ across frames. If you attempt access a property that doesn't exist~ + opts = defaults_saw_tooth_wave_for.merge opts +** Processing line: ~ sine_wave = sine_wave_for opts~ - Inside source: true *** True Line Result - across frames. If you attempt access a property that doesn't exist -** Processing line: ~ on args.state, it will simply return nil (no exception will be thrown).~ + sine_wave = sine_wave_for opts +** Processing line: ~ period_size = sine_wave.length~ - Inside source: true *** True Line Result - on args.state, it will simply return nil (no exception will be thrown). -** Processing line: ~~ + period_size = sine_wave.length +** Processing line: ~ sine_wave.map_with_index do |v, i|~ - Inside source: true *** True Line Result - -** Processing line: ~ =end~ + sine_wave.map_with_index do |v, i| +** Processing line: ~ ratio = (i.fdiv period_size)~ - Inside source: true *** True Line Result - =end -** Processing line: ~~ + ratio = (i.fdiv period_size) +** Processing line: ~ if ratio <= 0.5~ - Inside source: true *** True Line Result - -** Processing line: ~ # Along with outputs, inputs are also an essential part of video game development~ + if ratio <= 0.5 +** Processing line: ~ (ratio * 4) - 1~ - Inside source: true *** True Line Result - # Along with outputs, inputs are also an essential part of video game development -** Processing line: ~ # DragonRuby can take input from keyboards, mouse, and controllers.~ + (ratio * 4) - 1 +** Processing line: ~ else~ - Inside source: true *** True Line Result - # DragonRuby can take input from keyboards, mouse, and controllers. -** Processing line: ~ # This sample app will cover keyboard input.~ + else +** Processing line: ~ ratio -= 0.5~ - Inside source: true *** True Line Result - # This sample app will cover keyboard input. -** Processing line: ~~ + ratio -= 0.5 +** Processing line: ~ 1 - (ratio * 4)~ - Inside source: true *** True Line Result - -** Processing line: ~ # args.inputs.keyboard.key_up.a will check to see if the a key has been pressed~ + 1 - (ratio * 4) +** Processing line: ~ end~ - Inside source: true *** True Line Result - # args.inputs.keyboard.key_up.a will check to see if the a key has been pressed -** Processing line: ~ # This will work with the other keys as well~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # This will work with the other keys as well -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ def defaults_queue_triangle_wave~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ tick_instructions args, "Sample app shows how keyboard events are registered and accessed.", 360~ + 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 - 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~ + { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 } +** Processing line: ~ end~ - 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]~ + end +** Processing line: ~~ - 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]~ + +** Processing line: ~ def queue_triangle_wave args, opts = {}~ - 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]~ + def queue_triangle_wave args, opts = {} +** Processing line: ~ opts = defaults_queue_triangle_wave.merge opts~ - Inside source: true *** True Line Result - args.outputs.labels << [460, row_to_px(args, 3), "Press \"h\" on the keyboard.", small_font] -** Processing line: ~~ + opts = defaults_queue_triangle_wave.merge opts +** Processing line: ~ frequency = opts[:frequency]~ - Inside source: true *** True Line Result - -** Processing line: ~ # Input on a specifc key can be found through args.inputs.keyboard.key_up followed by the key~ + frequency = opts[:frequency] +** Processing line: ~ sample_rate = 48000~ - Inside source: true *** True Line Result - # 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~ + sample_rate = 48000 +** Processing line: ~~ - Inside source: true *** True Line Result - if args.inputs.keyboard.key_up.h -** Processing line: ~ args.state.h_pressed_at = args.state.tick_count~ + +** Processing line: ~ triangle_wave = triangle_wave_for frequency: frequency, sample_rate: sample_rate~ - Inside source: true *** True Line Result - args.state.h_pressed_at = args.state.tick_count -** Processing line: ~ end~ + 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 - end + args.state.triangle_waves[frequency] ||= triangle_wave_for frequency: frequency, sample_rate: sample_rate ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # This code simplifies to if args.state.h_pressed_at has not been initialized, set it to false~ +** Processing line: ~ proc = lambda do~ - Inside source: true *** True Line Result - # This code simplifies to if args.state.h_pressed_at has not been initialized, set it to false -** Processing line: ~ args.state.h_pressed_at ||= false~ + proc = lambda do +** Processing line: ~ generate_audio_data args.state.triangle_waves[frequency], sample_rate~ - Inside source: true *** True Line Result - args.state.h_pressed_at ||= false + 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: ~ if args.state.h_pressed_at~ +** Processing line: ~ audio_state = new_audio_state args, opts~ - 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]~ + audio_state = new_audio_state args, opts +** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~ - 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] -** Processing line: ~ else~ + 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 - else -** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 4), "\"h\" has never been pressed.", small_font]~ + queue_audio args, audio_state: audio_state, wave: triangle_wave +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.outputs.labels << [460, row_to_px(args, 4), "\"h\" has never been pressed.", small_font] + 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 + +*** True Line Result +*** Input Basics - Keyboard - 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_keyboard/app/main.rb~ +- Inside source: true +*** True Line Result + # ./samples/02_input_basics/01_keyboard/app/main.rb +** Processing line: ~ =begin~ +- Inside source: true +*** True Line Result + =begin +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ +- Inside source: true +*** True Line Result + APIs listing that haven't been encountered in a previous sample apps: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - args.inputs.keyboard.key_up.KEY: The value of the properties will be set~ +- Inside source: true +*** True Line Result + - args.inputs.keyboard.key_up.KEY: The value of the properties will be set +** Processing line: ~ to the frame that the key_up event occurred (the frame correlates~ +- Inside source: true +*** True Line Result + to the frame that the key_up event occurred (the frame correlates +** Processing line: ~ to args.state.tick_count). Otherwise the value will be nil. For a~ +- Inside source: true +*** True Line Result + to args.state.tick_count). Otherwise the value will be nil. For a +** Processing line: ~ full listing of keys, take a look at mygame/documentation/06-keyboard.md.~ +- Inside source: true +*** True Line Result + full listing of keys, take a look at mygame/documentation/06-keyboard.md. +** Processing line: ~ - args.state.PROPERTY: The state property on args is a dynamic~ +- Inside source: true +*** True Line Result + - args.state.PROPERTY: The state property on args is a dynamic +** Processing line: ~ structure. You can define ANY property here with ANY type of~ +- Inside source: true +*** True Line Result + structure. You can define ANY property here with ANY type of +** Processing line: ~ arbitrary nesting. Properties defined on args.state will be retained~ +- Inside source: true +*** True Line Result + arbitrary nesting. Properties defined on args.state will be retained +** Processing line: ~ across frames. If you attempt access a property that doesn't exist~ +- Inside source: true +*** True Line Result + across frames. If you attempt access a property that doesn't exist +** Processing line: ~ on args.state, it will simply return nil (no exception will be thrown).~ +- Inside source: true +*** True Line Result + on args.state, it will simply return nil (no exception will be thrown). +** 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: ~ # Along with outputs, inputs are also an essential part of video game development~ +- Inside source: true +*** True Line Result + # Along with outputs, inputs are also an essential part of video game development +** Processing line: ~ # DragonRuby can take input from keyboards, mouse, and controllers.~ +- Inside source: true +*** True Line Result + # DragonRuby can take input from keyboards, mouse, and controllers. +** Processing line: ~ # This sample app will cover keyboard input.~ +- Inside source: true +*** True Line Result + # This sample app will cover keyboard input. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # args.inputs.keyboard.key_up.a will check to see if the a key has been pressed~ +- Inside source: true +*** True Line Result + # args.inputs.keyboard.key_up.a will check to see if the a key has been pressed +** Processing line: ~ # This will work with the other keys as well~ +- Inside source: true +*** True Line Result + # This will work with the other keys as well +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ tick_instructions args, "Sample app shows how keyboard events are registered and accessed.", 360~ +- Inside source: true +*** True Line Result + 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~ +- 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]~ +- 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]~ +- 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]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [460, row_to_px(args, 3), "Press \"h\" on the keyboard.", small_font] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Input on a specifc key can be found through args.inputs.keyboard.key_up followed by the key~ +- Inside source: true +*** True Line Result + # 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~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_up.h +** Processing line: ~ args.state.h_pressed_at = args.state.tick_count~ +- Inside source: true +*** True Line Result + args.state.h_pressed_at = args.state.tick_count +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # This code simplifies to if args.state.h_pressed_at has not been initialized, set it to false~ +- Inside source: true +*** True Line Result + # This code simplifies to if args.state.h_pressed_at has not been initialized, set it to false +** Processing line: ~ args.state.h_pressed_at ||= false~ +- Inside source: true +*** True Line Result + args.state.h_pressed_at ||= false +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.state.h_pressed_at~ +- 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]~ +- 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] +** 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]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [460, row_to_px(args, 4), "\"h\" has never been pressed.", small_font] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -15499,12 +17720,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Input Basics - Mouse - main.rb~ +** Processing line: ~*** Input Basics - Mouse - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Input Basics - Mouse - main.rb +*** Input Basics - Mouse - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -15875,12 +18096,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Input Basics - Mouse Point To Rect - main.rb~ +** Processing line: ~*** Input Basics - Mouse Point To Rect - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Input Basics - Mouse Point To Rect - main.rb +*** Input Basics - Mouse Point To Rect - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -16263,12 +18484,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Input Basics - Mouse Rect To Rect - main.rb~ +** Processing line: ~*** Input Basics - Mouse Rect To Rect - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Input Basics - Mouse Rect To Rect - main.rb +*** Input Basics - Mouse Rect To Rect - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -16679,12 +18900,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Input Basics - Controller - main.rb~ +** Processing line: ~*** Input Basics - Controller - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Input Basics - Controller - main.rb +*** Input Basics - Controller - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -17211,12 +19432,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Input Basics - Touch - main.rb~ +** Processing line: ~*** Input Basics - Touch - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Input Basics - Touch - main.rb +*** Input Basics - Touch - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -17407,12 +19628,12 @@ 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 Sprites - Animation Using Separate Pngs - main.rb~ +** Processing line: ~*** Rendering Sprites - Animation Using Separate Pngs - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rendering Sprites - Animation Using Separate Pngs - main.rb +*** Rendering Sprites - Animation Using Separate Pngs - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -17959,12 +20180,12 @@ 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 Sprites - Animation Using Sprite Sheet - main.rb~ +** Processing line: ~*** Rendering Sprites - Animation Using Sprite Sheet - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rendering Sprites - Animation Using Sprite Sheet - main.rb +*** Rendering Sprites - Animation Using Sprite Sheet - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -18379,12 +20600,12 @@ 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 Sprites - Animation States - main.rb~ +** Processing line: ~*** Rendering Sprites - Animation States - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rendering Sprites - Animation States - main.rb +*** Rendering Sprites - Animation States - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -19139,12 +21360,12 @@ 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 Sprites - Color And Rotation - main.rb~ +** Processing line: ~*** Rendering Sprites - Color And Rotation - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rendering Sprites - Color And Rotation - main.rb +*** Rendering Sprites - Color And Rotation - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -20071,12 +22292,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Physics And Collisions - Simple - main.rb~ +** Processing line: ~*** Physics And Collisions - Simple - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Physics And Collisions - Simple - main.rb +*** Physics And Collisions - Simple - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -20531,12 +22752,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Physics And Collisions - Moving Objects - main.rb~ +** Processing line: ~*** Physics And Collisions - Moving Objects - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Physics And Collisions - Moving Objects - main.rb +*** Physics And Collisions - Moving Objects - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -21759,12 +23980,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Physics And Collisions - Entities - main.rb~ +** Processing line: ~*** Physics And Collisions - Entities - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Physics And Collisions - Entities - main.rb +*** Physics And Collisions - Entities - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -22391,12 +24612,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Physics And Collisions - Box Collision - main.rb~ +** Processing line: ~*** Physics And Collisions - Box Collision - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Physics And Collisions - Box Collision - main.rb +*** Physics And Collisions - Box Collision - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -23767,12 +25988,12 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Physics And Collisions - Box Collision 2 - main.rb~ +** Processing line: ~*** Physics And Collisions - Box Collision 2 - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Physics And Collisions - Box Collision 2 - main.rb +*** Physics And Collisions - Box Collision 2 - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result @@ -25675,22 +27896,1070 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Physics And Collisions - Jump Physics - main.rb~ +** Processing line: ~*** Physics And Collisions - Box Collision 3 - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Physics And Collisions - Jump Physics - main.rb +*** Physics And Collisions - Box Collision 3 - 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/04_physics_and_collisions/06_jump_physics/app/main.rb~ +** Processing line: ~ # ./samples/04_physics_and_collisions/06_box_collision_3/app/main.rb~ - Inside source: true *** True Line Result - # ./samples/04_physics_and_collisions/06_jump_physics/app/main.rb + # ./samples/04_physics_and_collisions/06_box_collision_3/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_edit_map~ +- Inside source: true +*** True Line Result + input_edit_map +** Processing line: ~ input_player~ +- Inside source: true +*** True Line Result + input_player +** Processing line: ~ calc_player~ +- Inside source: true +*** True Line Result + calc_player +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def defaults~ +- Inside source: true +*** True Line Result + def defaults +** Processing line: ~ state.gravity = -0.4~ +- Inside source: true +*** True Line Result + state.gravity = -0.4 +** Processing line: ~ state.drag = 0.15~ +- Inside source: true +*** True Line Result + state.drag = 0.15 +** Processing line: ~ state.tile_size = 32~ +- Inside source: true +*** True Line Result + state.tile_size = 32 +** Processing line: ~ state.player.size = 16~ +- Inside source: true +*** True Line Result + state.player.size = 16 +** Processing line: ~ state.player.jump_power = 12~ +- Inside source: true +*** True Line Result + state.player.jump_power = 12 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ state.tiles ||= []~ +- Inside source: true +*** True Line Result + state.tiles ||= [] +** Processing line: ~ state.player.y ||= 800~ +- Inside source: true +*** True Line Result + state.player.y ||= 800 +** Processing line: ~ state.player.x ||= 100~ +- Inside source: true +*** True Line Result + state.player.x ||= 100 +** Processing line: ~ state.player.dy ||= 0~ +- Inside source: true +*** True Line Result + state.player.dy ||= 0 +** Processing line: ~ state.player.dx ||= 0~ +- Inside source: true +*** True Line Result + state.player.dx ||= 0 +** Processing line: ~ state.player.jumped_down_at ||= 0~ +- Inside source: true +*** True Line Result + state.player.jumped_down_at ||= 0 +** Processing line: ~ state.player.jumped_at ||= 0~ +- Inside source: true +*** True Line Result + state.player.jumped_at ||= 0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ calc_player_rect if !state.player.rect~ +- Inside source: true +*** True Line Result + calc_player_rect if !state.player.rect +** 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.labels << [10, 10.from_top, "tile: click to add a tile, hold X key and click to delete a tile."]~ +- Inside source: true +*** True Line Result + outputs.labels << [10, 10.from_top, "tile: click to add a tile, hold X key and click to delete a tile."] +** Processing line: ~ outputs.labels << [10, 35.from_top, "move: use left and right to move, space to jump, down and space to jump down."]~ +- Inside source: true +*** True Line Result + outputs.labels << [10, 35.from_top, "move: use left and right to move, space to jump, down and space to jump down."] +** Processing line: ~ outputs.labels << [10, 55.from_top, " You can jump through or jump down through tiles with a height of 1."]~ +- Inside source: true +*** True Line Result + outputs.labels << [10, 55.from_top, " You can jump through or jump down through tiles with a height of 1."] +** Processing line: ~ outputs.background_color = [80, 80, 80]~ +- Inside source: true +*** True Line Result + outputs.background_color = [80, 80, 80] +** Processing line: ~ outputs.sprites << tiles.map(&:sprite)~ +- Inside source: true +*** True Line Result + outputs.sprites << tiles.map(&:sprite) +** Processing line: ~ outputs.sprites << (player.rect.merge path: 'sprites/square/green.png')~ +- Inside source: true +*** True Line Result + outputs.sprites << (player.rect.merge path: 'sprites/square/green.png') +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ mouse_overlay = {~ +- Inside source: true +*** True Line Result + mouse_overlay = { +** Processing line: ~ x: (inputs.mouse.x.ifloor state.tile_size),~ +- Inside source: true +*** True Line Result + x: (inputs.mouse.x.ifloor state.tile_size), +** Processing line: ~ y: (inputs.mouse.y.ifloor state.tile_size),~ +- Inside source: true +*** True Line Result + y: (inputs.mouse.y.ifloor state.tile_size), +** Processing line: ~ w: state.tile_size,~ +- Inside source: true +*** True Line Result + w: state.tile_size, +** Processing line: ~ h: state.tile_size,~ +- Inside source: true +*** True Line Result + h: state.tile_size, +** Processing line: ~ a: 100~ +- Inside source: true +*** True Line Result + a: 100 +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ mouse_overlay = mouse_overlay.merge r: 255 if state.delete_mode~ +- Inside source: true +*** True Line Result + mouse_overlay = mouse_overlay.merge r: 255 if state.delete_mode +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if state.mouse_held~ +- Inside source: true +*** True Line Result + if state.mouse_held +** Processing line: ~ outputs.primitives << mouse_overlay.border~ +- Inside source: true +*** True Line Result + outputs.primitives << mouse_overlay.border +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ outputs.primitives << mouse_overlay.solid~ +- Inside source: true +*** True Line Result + outputs.primitives << mouse_overlay.solid +** 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 input_edit_map~ +- Inside source: true +*** True Line Result + def input_edit_map +** Processing line: ~ state.mouse_held = true if inputs.mouse.down~ +- Inside source: true +*** True Line Result + state.mouse_held = true if inputs.mouse.down +** Processing line: ~ state.mouse_held = false if inputs.mouse.up~ +- Inside source: true +*** True Line Result + state.mouse_held = false if inputs.mouse.up +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if inputs.keyboard.x~ +- Inside source: true +*** True Line Result + if inputs.keyboard.x +** Processing line: ~ state.delete_mode = true~ +- Inside source: true +*** True Line Result + state.delete_mode = true +** Processing line: ~ elsif inputs.keyboard.key_up.x~ +- Inside source: true +*** True Line Result + elsif inputs.keyboard.key_up.x +** Processing line: ~ state.delete_mode = false~ +- Inside source: true +*** True Line Result + state.delete_mode = false +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return unless state.mouse_held~ +- Inside source: true +*** True Line Result + return unless state.mouse_held +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ordinal = { x: (inputs.mouse.x.idiv state.tile_size),~ +- Inside source: true +*** True Line Result + ordinal = { x: (inputs.mouse.x.idiv state.tile_size), +** Processing line: ~ y: (inputs.mouse.y.idiv state.tile_size) }~ +- Inside source: true +*** True Line Result + y: (inputs.mouse.y.idiv state.tile_size) } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ found = find_tile ordinal~ +- Inside source: true +*** True Line Result + found = find_tile ordinal +** Processing line: ~ if !found && !state.delete_mode~ +- Inside source: true +*** True Line Result + if !found && !state.delete_mode +** Processing line: ~ tiles << (state.new_entity :tile, ordinal)~ +- Inside source: true +*** True Line Result + tiles << (state.new_entity :tile, ordinal) +** Processing line: ~ recompute_tiles~ +- Inside source: true +*** True Line Result + recompute_tiles +** Processing line: ~ elsif found && state.delete_mode~ +- Inside source: true +*** True Line Result + elsif found && state.delete_mode +** Processing line: ~ tiles.delete found~ +- Inside source: true +*** True Line Result + tiles.delete found +** Processing line: ~ recompute_tiles~ +- Inside source: true +*** True Line Result + recompute_tiles +** 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 input_player~ +- Inside source: true +*** True Line Result + def input_player +** Processing line: ~ player.dx += inputs.left_right~ +- Inside source: true +*** True Line Result + player.dx += inputs.left_right +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if inputs.keyboard.key_down.space && inputs.keyboard.down~ +- Inside source: true +*** True Line Result + if inputs.keyboard.key_down.space && inputs.keyboard.down +** Processing line: ~ player.dy = player.jump_power * -1~ +- Inside source: true +*** True Line Result + player.dy = player.jump_power * -1 +** Processing line: ~ player.jumped_at = 0~ +- Inside source: true +*** True Line Result + player.jumped_at = 0 +** Processing line: ~ player.jumped_down_at = state.tick_count~ +- Inside source: true +*** True Line Result + player.jumped_down_at = state.tick_count +** Processing line: ~ elsif inputs.keyboard.key_down.space~ +- Inside source: true +*** True Line Result + elsif inputs.keyboard.key_down.space +** Processing line: ~ player.dy = player.jump_power~ +- Inside source: true +*** True Line Result + player.dy = player.jump_power +** Processing line: ~ player.jumped_at = state.tick_count~ +- Inside source: true +*** True Line Result + player.jumped_at = state.tick_count +** Processing line: ~ player.jumped_down_at = 0~ +- Inside source: true +*** True Line Result + player.jumped_down_at = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calc_player~ +- Inside source: true +*** True Line Result + def calc_player +** Processing line: ~ calc_player_rect~ +- Inside source: true +*** True Line Result + calc_player_rect +** Processing line: ~ calc_below~ +- Inside source: true +*** True Line Result + calc_below +** Processing line: ~ calc_left~ +- Inside source: true +*** True Line Result + calc_left +** Processing line: ~ calc_right~ +- Inside source: true +*** True Line Result + calc_right +** Processing line: ~ calc_above~ +- Inside source: true +*** True Line Result + calc_above +** Processing line: ~ calc_player_dy~ +- Inside source: true +*** True Line Result + calc_player_dy +** Processing line: ~ calc_player_dx~ +- Inside source: true +*** True Line Result + calc_player_dx +** Processing line: ~ reset_player if player_off_stage?~ +- Inside source: true +*** True Line Result + reset_player if player_off_stage? +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calc_player_rect~ +- Inside source: true +*** True Line Result + def calc_player_rect +** Processing line: ~ player.rect = current_player_rect~ +- Inside source: true +*** True Line Result + player.rect = current_player_rect +** Processing line: ~ player.next_rect = player.rect.merge x: player.x + player.dx,~ +- Inside source: true +*** True Line Result + player.next_rect = player.rect.merge x: player.x + player.dx, +** Processing line: ~ y: player.y + player.dy~ +- Inside source: true +*** True Line Result + y: player.y + player.dy +** Processing line: ~ player.prev_rect = player.rect.merge x: player.x - player.dx,~ +- Inside source: true +*** True Line Result + player.prev_rect = player.rect.merge x: player.x - player.dx, +** Processing line: ~ y: player.y - player.dy~ +- Inside source: true +*** True Line Result + y: player.y - player.dy +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calc_below~ +- Inside source: true +*** True Line Result + def calc_below +** Processing line: ~ return unless player.dy <= 0~ +- Inside source: true +*** True Line Result + return unless player.dy <= 0 +** Processing line: ~ tiles_below = find_tiles { |t| t.rect.top <= player.y }~ +- Inside source: true +*** True Line Result + tiles_below = find_tiles { |t| t.rect.top <= player.y } +** Processing line: ~ collision = find_colliding_tile tiles_below, (player.rect.merge y: player.next_rect.y)~ +- Inside source: true +*** True Line Result + collision = find_colliding_tile tiles_below, (player.rect.merge y: player.next_rect.y) +** Processing line: ~ return unless collision~ +- Inside source: true +*** True Line Result + return unless collision +** Processing line: ~ if collision.neighbors.b == :none && player.jumped_down_at.elapsed_time < 10~ +- Inside source: true +*** True Line Result + if collision.neighbors.b == :none && player.jumped_down_at.elapsed_time < 10 +** Processing line: ~ player.dy = -1~ +- Inside source: true +*** True Line Result + player.dy = -1 +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ player.y = collision.rect.y + state.tile_size~ +- Inside source: true +*** True Line Result + player.y = collision.rect.y + state.tile_size +** Processing line: ~ player.dy = 0~ +- Inside source: true +*** True Line Result + player.dy = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calc_left~ +- Inside source: true +*** True Line Result + def calc_left +** Processing line: ~ return unless player.dx < 0~ +- Inside source: true +*** True Line Result + return unless player.dx < 0 +** Processing line: ~ tiles_left = find_tiles { |t| t.rect.right <= player.prev_rect.left }~ +- Inside source: true +*** True Line Result + tiles_left = find_tiles { |t| t.rect.right <= player.prev_rect.left } +** Processing line: ~ collision = find_colliding_tile tiles_left, (player.rect.merge x: player.next_rect.x)~ +- Inside source: true +*** True Line Result + collision = find_colliding_tile tiles_left, (player.rect.merge x: player.next_rect.x) +** Processing line: ~ return unless collision~ +- Inside source: true +*** True Line Result + return unless collision +** Processing line: ~ player.x = collision.rect.right~ +- Inside source: true +*** True Line Result + player.x = collision.rect.right +** Processing line: ~ player.dx = 0~ +- Inside source: true +*** True Line Result + player.dx = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calc_right~ +- Inside source: true +*** True Line Result + def calc_right +** Processing line: ~ return unless player.dx > 0~ +- Inside source: true +*** True Line Result + return unless player.dx > 0 +** Processing line: ~ tiles_right = find_tiles { |t| t.rect.left >= player.prev_rect.right }~ +- Inside source: true +*** True Line Result + tiles_right = find_tiles { |t| t.rect.left >= player.prev_rect.right } +** Processing line: ~ collision = find_colliding_tile tiles_right, (player.rect.merge x: player.next_rect.x)~ +- Inside source: true +*** True Line Result + collision = find_colliding_tile tiles_right, (player.rect.merge x: player.next_rect.x) +** Processing line: ~ return unless collision~ +- Inside source: true +*** True Line Result + return unless collision +** Processing line: ~ player.x = collision.rect.left - player.rect.w~ +- Inside source: true +*** True Line Result + player.x = collision.rect.left - player.rect.w +** Processing line: ~ player.dx = 0~ +- Inside source: true +*** True Line Result + player.dx = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calc_above~ +- Inside source: true +*** True Line Result + def calc_above +** Processing line: ~ return unless player.dy > 0~ +- Inside source: true +*** True Line Result + return unless player.dy > 0 +** Processing line: ~ tiles_above = find_tiles { |t| t.rect.y >= player.y }~ +- Inside source: true +*** True Line Result + tiles_above = find_tiles { |t| t.rect.y >= player.y } +** Processing line: ~ collision = find_colliding_tile tiles_above, (player.rect.merge y: player.next_rect.y)~ +- Inside source: true +*** True Line Result + collision = find_colliding_tile tiles_above, (player.rect.merge y: player.next_rect.y) +** Processing line: ~ return unless collision~ +- Inside source: true +*** True Line Result + return unless collision +** Processing line: ~ return if collision.neighbors.t == :none~ +- Inside source: true +*** True Line Result + return if collision.neighbors.t == :none +** Processing line: ~ player.dy = 0~ +- Inside source: true +*** True Line Result + player.dy = 0 +** Processing line: ~ player.y = collision.rect.bottom - player.rect.h~ +- Inside source: true +*** True Line Result + player.y = collision.rect.bottom - player.rect.h +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calc_player_dx~ +- Inside source: true +*** True Line Result + def calc_player_dx +** Processing line: ~ player.y += player.dy~ +- Inside source: true +*** True Line Result + player.y += player.dy +** Processing line: ~ player.dy += state.gravity~ +- Inside source: true +*** True Line Result + player.dy += state.gravity +** Processing line: ~ player.dy += player.dy * state.drag ** 2 * -1~ +- Inside source: true +*** True Line Result + player.dy += player.dy * state.drag ** 2 * -1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calc_player_dy~ +- Inside source: true +*** True Line Result + def calc_player_dy +** Processing line: ~ player.dx = player.dx.clamp(-5, 5)~ +- Inside source: true +*** True Line Result + player.dx = player.dx.clamp(-5, 5) +** Processing line: ~ player.dx *= 0.9~ +- Inside source: true +*** True Line Result + player.dx *= 0.9 +** Processing line: ~ player.x += player.dx~ +- Inside source: true +*** True Line Result + player.x += player.dx +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def reset_player~ +- Inside source: true +*** True Line Result + def reset_player +** Processing line: ~ player.x = 100~ +- Inside source: true +*** True Line Result + player.x = 100 +** Processing line: ~ player.y = 720~ +- Inside source: true +*** True Line Result + player.y = 720 +** Processing line: ~ player.dy = 0~ +- Inside source: true +*** True Line Result + player.dy = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def recompute_tiles~ +- Inside source: true +*** True Line Result + def recompute_tiles +** Processing line: ~ tiles.each do |t|~ +- Inside source: true +*** True Line Result + tiles.each do |t| +** Processing line: ~ t.w = state.tile_size~ +- Inside source: true +*** True Line Result + t.w = state.tile_size +** Processing line: ~ t.h = state.tile_size~ +- Inside source: true +*** True Line Result + t.h = state.tile_size +** Processing line: ~ t.neighbors = tile_neighbors t, tiles~ +- Inside source: true +*** True Line Result + t.neighbors = tile_neighbors t, tiles +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ t.rect = [t.x * state.tile_size,~ +- Inside source: true +*** True Line Result + t.rect = [t.x * state.tile_size, +** Processing line: ~ t.y * state.tile_size,~ +- Inside source: true +*** True Line Result + t.y * state.tile_size, +** Processing line: ~ state.tile_size,~ +- Inside source: true +*** True Line Result + state.tile_size, +** Processing line: ~ state.tile_size].rect.to_hash~ +- Inside source: true +*** True Line Result + state.tile_size].rect.to_hash +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ sprite_sub_path = t.neighbors.mask.map { |m| flip_bit m }.join("")~ +- Inside source: true +*** True Line Result + sprite_sub_path = t.neighbors.mask.map { |m| flip_bit m }.join("") +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ t.sprite = {~ +- Inside source: true +*** True Line Result + t.sprite = { +** Processing line: ~ x: t.x * state.tile_size,~ +- Inside source: true +*** True Line Result + x: t.x * state.tile_size, +** Processing line: ~ y: t.y * state.tile_size,~ +- Inside source: true +*** True Line Result + y: t.y * state.tile_size, +** Processing line: ~ w: state.tile_size,~ +- Inside source: true +*** True Line Result + w: state.tile_size, +** Processing line: ~ h: state.tile_size,~ +- Inside source: true +*** True Line Result + h: state.tile_size, +** Processing line: ~ path: "sprites/tile/wall-#{sprite_sub_path}.png"~ +- Inside source: true +*** True Line Result + path: "sprites/tile/wall-#{sprite_sub_path}.png" +** 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 flip_bit bit~ +- Inside source: true +*** True Line Result + def flip_bit bit +** Processing line: ~ return 0 if bit == 1~ +- Inside source: true +*** True Line Result + return 0 if bit == 1 +** Processing line: ~ return 1~ +- Inside source: true +*** True Line Result + return 1 +** 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 player_off_stage?~ +- Inside source: true +*** True Line Result + def player_off_stage? +** Processing line: ~ player.rect.top < grid.bottom ||~ +- Inside source: true +*** True Line Result + player.rect.top < grid.bottom || +** Processing line: ~ player.rect.right < grid.left ||~ +- Inside source: true +*** True Line Result + player.rect.right < grid.left || +** Processing line: ~ player.rect.left > grid.right~ +- Inside source: true +*** True Line Result + player.rect.left > grid.right +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def current_player_rect~ +- Inside source: true +*** True Line Result + def current_player_rect +** Processing line: ~ { x: player.x, y: player.y, w: player.size, h: player.size }~ +- Inside source: true +*** True Line Result + { x: player.x, y: player.y, w: player.size, h: player.size } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tiles~ +- Inside source: true +*** True Line Result + def tiles +** Processing line: ~ state.tiles~ +- Inside source: true +*** True Line Result + state.tiles +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def find_tile ordinal~ +- Inside source: true +*** True Line Result + def find_tile ordinal +** Processing line: ~ tiles.find { |t| t.x == ordinal.x && t.y == ordinal.y }~ +- Inside source: true +*** True Line Result + tiles.find { |t| t.x == ordinal.x && t.y == ordinal.y } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def find_tiles &block~ +- Inside source: true +*** True Line Result + def find_tiles &block +** Processing line: ~ tiles.find_all(&block)~ +- Inside source: true +*** True Line Result + tiles.find_all(&block) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def find_colliding_tile tiles, target~ +- Inside source: true +*** True Line Result + def find_colliding_tile tiles, target +** Processing line: ~ tiles.find { |t| t.rect.intersect_rect? target }~ +- Inside source: true +*** True Line Result + tiles.find { |t| t.rect.intersect_rect? target } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tile_neighbors tile, other_points~ +- Inside source: true +*** True Line Result + def tile_neighbors tile, other_points +** Processing line: ~ t = find_tile x: tile.x + 0, y: tile.y + 1~ +- Inside source: true +*** True Line Result + t = find_tile x: tile.x + 0, y: tile.y + 1 +** Processing line: ~ r = find_tile x: tile.x + 1, y: tile.y + 0~ +- Inside source: true +*** True Line Result + r = find_tile x: tile.x + 1, y: tile.y + 0 +** Processing line: ~ b = find_tile x: tile.x + 0, y: tile.y - 1~ +- Inside source: true +*** True Line Result + b = find_tile x: tile.x + 0, y: tile.y - 1 +** Processing line: ~ l = find_tile x: tile.x - 1, y: tile.y + 0~ +- Inside source: true +*** True Line Result + l = find_tile x: tile.x - 1, y: tile.y + 0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ tile_t, tile_r, tile_b, tile_l = 0~ +- Inside source: true +*** True Line Result + tile_t, tile_r, tile_b, tile_l = 0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ tile_t = 1 if t~ +- Inside source: true +*** True Line Result + tile_t = 1 if t +** Processing line: ~ tile_r = 1 if r~ +- Inside source: true +*** True Line Result + tile_r = 1 if r +** Processing line: ~ tile_b = 1 if b~ +- Inside source: true +*** True Line Result + tile_b = 1 if b +** Processing line: ~ tile_l = 1 if l~ +- Inside source: true +*** True Line Result + tile_l = 1 if l +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ state.new_entity :neighbors, mask: [tile_t, tile_r, tile_b, tile_l],~ +- Inside source: true +*** True Line Result + state.new_entity :neighbors, mask: [tile_t, tile_r, tile_b, tile_l], +** Processing line: ~ t: t ? :some : :none,~ +- Inside source: true +*** True Line Result + t: t ? :some : :none, +** Processing line: ~ b: b ? :some : :none,~ +- Inside source: true +*** True Line Result + b: b ? :some : :none, +** Processing line: ~ l: l ? :some : :none,~ +- Inside source: true +*** True Line Result + l: l ? :some : :none, +** Processing line: ~ r: r ? :some : :none~ +- Inside source: true +*** True Line Result + r: r ? :some : :none +** 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: ~#+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: ~*** Physics And Collisions - Jump Physics - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Physics And Collisions - Jump Physics - 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/04_physics_and_collisions/07_jump_physics/app/main.rb~ +- Inside source: true +*** True Line Result + # ./samples/04_physics_and_collisions/07_jump_physics/app/main.rb ** Processing line: ~ =begin~ - Inside source: true *** True Line Result @@ -26487,526 +29756,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: ~* Mouse - Mouse Click - main.rb~ +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - ball.rb~ - Header detected. *** True Line Result *** True Line Result -* Mouse - Mouse Click - main.rb +*** Physics And Collisions - Bouncing On Collision - ball.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/05_mouse/01_mouse_click/app/main.rb~ +** Processing line: ~ # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/ball.rb~ - Inside source: true *** True Line Result - # ./samples/05_mouse/01_mouse_click/app/main.rb -** Processing line: ~ =begin~ + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/ball.rb +** Processing line: ~ GRAVITY = -0.08~ - Inside source: true *** True Line Result - =begin + GRAVITY = -0.08 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ -- Inside source: true -*** True Line Result - APIs listing that haven't been encountered in previous sample apps: -** Processing line: ~~ +** Processing line: ~ class Ball~ - Inside source: true *** True Line Result - -** Processing line: ~ - product: Returns an array of all combinations of elements from all arrays.~ + class Ball +** Processing line: ~ attr_accessor :velocity, :center, :radius, :collision_enabled~ - Inside source: true *** True Line Result - - product: Returns an array of all combinations of elements from all arrays. + attr_accessor :velocity, :center, :radius, :collision_enabled ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ For example, [1,2].product([1,2]) would return the following array...~ +** Processing line: ~ def initialize args~ - Inside source: true *** True Line Result - For example, [1,2].product([1,2]) would return the following array... -** Processing line: ~ [[1,1], [1,2], [2,1], [2,2]]~ + def initialize args +** Processing line: ~ #Start the ball in the top center~ - Inside source: true *** True Line Result - [[1,1], [1,2], [2,1], [2,2]] -** Processing line: ~ More than two arrays can be given to product and it will still work,~ + #Start the ball in the top center +** Processing line: ~ #@x = args.grid.w / 2~ - Inside source: true *** True Line Result - More than two arrays can be given to product and it will still work, -** Processing line: ~ such as [1,2].product([1,2],[3,4]). What would product return in this case?~ + #@x = args.grid.w / 2 +** Processing line: ~ #@y = args.grid.h - 20~ - Inside source: true *** True Line Result - such as [1,2].product([1,2],[3,4]). What would product return in this case? + #@y = args.grid.h - 20 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Answer:~ +** Processing line: ~ @velocity = {x: 0, y: 0}~ - Inside source: true *** True Line Result - Answer: -** Processing line: ~ [[1,1,3],[1,1,4],[1,2,3],[1,2,4],[2,1,3],[2,1,4],[2,2,3],[2,2,4]]~ + @velocity = {x: 0, y: 0} +** Processing line: ~ #@width = 20~ - Inside source: true *** True Line Result - [[1,1,3],[1,1,4],[1,2,3],[1,2,4],[2,1,3],[2,1,4],[2,2,3],[2,2,4]] -** Processing line: ~~ + #@width = 20 +** Processing line: ~ #@height = @width~ - Inside source: true *** True Line Result - -** Processing line: ~ - num1.fdiv(num2): Returns the float division (will have a decimal) of the two given numbers.~ + #@height = @width +** Processing line: ~ @radius = 20.0 / 2.0~ - Inside source: true *** True Line Result - - num1.fdiv(num2): Returns the float division (will have a decimal) of the two given numbers. -** Processing line: ~ For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0~ + @radius = 20.0 / 2.0 +** Processing line: ~ @center = {x: (args.grid.w / 2), y: (args.grid.h)}~ - Inside source: true *** True Line Result - For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0 + @center = {x: (args.grid.w / 2), y: (args.grid.h)} ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - yield: Allows you to call a method with a code block and yield to that block.~ +** Processing line: ~ #@left_wall = (args.state.board_width + args.grid.w / 8)~ - Inside source: true *** True Line Result - - yield: Allows you to call a method with a code block and yield to that block. -** Processing line: ~~ + #@left_wall = (args.state.board_width + args.grid.w / 8) +** Processing line: ~ #@right_wall = @left_wall + args.state.board_width~ - Inside source: true *** True Line Result - -** Processing line: ~ Reminders:~ + #@right_wall = @left_wall + args.state.board_width +** Processing line: ~ @left_wall = 0~ - Inside source: true *** True Line Result - Reminders: + @left_wall = 0 +** Processing line: ~ @right_wall = $args.grid.right~ +- Inside source: true +*** True Line Result + @right_wall = $args.grid.right ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect.~ +** Processing line: ~ @max_velocity = 7~ - Inside source: true *** True Line Result - - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect. + @max_velocity = 7 +** Processing line: ~ @collision_enabled = true~ +- Inside source: true +*** True Line Result + @collision_enabled = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ +** Processing line: ~ #Move the ball according to its velocity~ - Inside source: true *** True Line Result - - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ + #Move the ball according to its velocity +** Processing line: ~ def update args~ - Inside source: true *** True Line Result - as Ruby code, and the placeholder is replaced with its corresponding value or result. -** Processing line: ~~ + def update args +** Processing line: ~ @center.x += @velocity.x~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ + @center.x += @velocity.x +** Processing line: ~ @center.y += @velocity.y~ - Inside source: true *** True Line Result - - args.inputs.mouse.click: This property will be set if the mouse was clicked. + @center.y += @velocity.y +** Processing line: ~ @velocity.y += GRAVITY~ +- Inside source: true +*** True Line Result + @velocity.y += GRAVITY ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - Ternary operator (?): Will evaluate a statement (just like an if statement)~ +** Processing line: ~ alpha = 0.2~ - Inside source: true *** True Line Result - - Ternary operator (?): Will evaluate a statement (just like an if statement) -** Processing line: ~ and perform an action if the result is true or another action if it is false.~ + alpha = 0.2 +** Processing line: ~ if @center.y-@radius <= 0~ - Inside source: true *** True Line Result - and perform an action if the result is true or another action if it is false. -** Processing line: ~~ + if @center.y-@radius <= 0 +** Processing line: ~ @velocity.y = (@velocity.y.abs*0.7).abs~ - Inside source: true *** True Line Result - -** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ + @velocity.y = (@velocity.y.abs*0.7).abs +** Processing line: ~ @velocity.x = (@velocity.x.abs*0.9).abs * ((@velocity.x < 0) ? -1 : 1)~ - Inside source: true *** True Line Result - - reject: Removes elements from a collection if they meet certain requirements. + @velocity.x = (@velocity.x.abs*0.9).abs * ((@velocity.x < 0) ? -1 : 1) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.outputs.borders: An array. The values generate a border.~ +** Processing line: ~ if @velocity.y.abs() < alpha~ - Inside source: true *** True Line Result - - args.outputs.borders: An array. The values generate a border. -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ + if @velocity.y.abs() < alpha +** Processing line: ~ @velocity.y=0~ - Inside source: true *** True Line Result - The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE] -** Processing line: ~ For more information about borders, go to mygame/documentation/03-solids-and-borders.md.~ + @velocity.y=0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - For more information about borders, go to mygame/documentation/03-solids-and-borders.md. -** Processing line: ~~ + end +** Processing line: ~ if @velocity.x.abs() < alpha~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ + if @velocity.x.abs() < alpha +** Processing line: ~ @velocity.x=0~ - Inside source: true *** True Line Result - - args.outputs.labels: An array. The values generate a label. -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ + @velocity.x=0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - For more information about labels, go to mygame/documentation/02-labels. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ =end~ +** Processing line: ~ if @center.x > args.grid.right+@radius*2~ - Inside source: true *** True Line Result - =end -** Processing line: ~~ + if @center.x > args.grid.right+@radius*2 +** Processing line: ~ @center.x = 0-@radius~ - Inside source: true *** True Line Result - -** Processing line: ~ # This sample app is a classic game of Tic Tac Toe.~ + @center.x = 0-@radius +** Processing line: ~ elsif @center.x< 0-@radius*2~ - Inside source: true *** True Line Result - # This sample app is a classic game of Tic Tac Toe. -** Processing line: ~~ + elsif @center.x< 0-@radius*2 +** Processing line: ~ @center.x = args.grid.right + @radius~ - Inside source: true *** True Line Result - -** Processing line: ~ class TicTacToe~ + @center.x = args.grid.right + @radius +** Processing line: ~ end~ - Inside source: true *** True Line Result - class TicTacToe -** Processing line: ~ attr_accessor :_, :state, :outputs, :inputs, :grid, :gtk~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_accessor :_, :state, :outputs, :inputs, :grid, :gtk + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Starts the game with player x's turn and creates an array (to_a) for space combinations.~ +** Processing line: ~ def wallBounds args~ - Inside source: true *** True Line Result - # Starts the game with player x's turn and creates an array (to_a) for space combinations. -** Processing line: ~ # Calls methods necessary for the game to run properly.~ + def wallBounds args +** Processing line: ~ #if @x < @left_wall || @x + @width > @right_wall~ - Inside source: true *** True Line Result - # Calls methods necessary for the game to run properly. -** Processing line: ~ def tick~ + #if @x < @left_wall || @x + @width > @right_wall +** Processing line: ~ #@velocity.x *= -1.1~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ state.current_turn ||= :x~ + #@velocity.x *= -1.1 +** Processing line: ~ #if @velocity.x > @max_velocity~ - Inside source: true *** True Line Result - state.current_turn ||= :x -** Processing line: ~ state.space_combinations = [-1, 0, 1].product([-1, 0, 1]).to_a~ + #if @velocity.x > @max_velocity +** Processing line: ~ #@velocity.x = @max_velocity~ - Inside source: true *** True Line Result - state.space_combinations = [-1, 0, 1].product([-1, 0, 1]).to_a -** Processing line: ~ render_board~ + #@velocity.x = @max_velocity +** Processing line: ~ #elsif @velocity.x < @max_velocity * -1~ - Inside source: true *** True Line Result - render_board -** Processing line: ~ input_board~ + #elsif @velocity.x < @max_velocity * -1 +** Processing line: ~ #@velocity.x = @max_velocity * -1~ - Inside source: true *** True Line Result - input_board -** Processing line: ~ end~ + #@velocity.x = @max_velocity * -1 +** Processing line: ~ #end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #end +** Processing line: ~ #end~ - Inside source: true *** True Line Result - -** Processing line: ~ # Uses borders to create grid squares for the game's board. Also outputs the game pieces using labels.~ + #end +** Processing line: ~ #if @y < 0 || @y + @height > args.grid.h~ - Inside source: true *** True Line Result - # Uses borders to create grid squares for the game's board. Also outputs the game pieces using labels. -** Processing line: ~ def render_board~ + #if @y < 0 || @y + @height > args.grid.h +** Processing line: ~ #@velocity.y *= -1.1~ - Inside source: true *** True Line Result - def render_board -** Processing line: ~ square_size = 80~ + #@velocity.y *= -1.1 +** Processing line: ~ #if @velocity.y > @max_velocity~ - Inside source: true *** True Line Result - square_size = 80 -** Processing line: ~~ + #if @velocity.y > @max_velocity +** Processing line: ~ #@velocity.y = @max_velocity~ - Inside source: true *** True Line Result - -** Processing line: ~ # Positions the game's board in the center of the screen.~ + #@velocity.y = @max_velocity +** Processing line: ~ #elsif @velocity.y < @max_velocity * -1~ - Inside source: true *** True Line Result - # Positions the game's board in the center of the screen. -** Processing line: ~ # Try removing what follows grid.w_half or grid.h_half and see how the position changes!~ + #elsif @velocity.y < @max_velocity * -1 +** Processing line: ~ #@velocity.y = @max_velocity * -1~ - Inside source: true *** True Line Result - # Try removing what follows grid.w_half or grid.h_half and see how the position changes! -** Processing line: ~ board_left = grid.w_half - square_size * 1.5~ + #@velocity.y = @max_velocity * -1 +** Processing line: ~ #end~ - Inside source: true *** True Line Result - board_left = grid.w_half - square_size * 1.5 -** Processing line: ~ board_top = grid.h_half - square_size * 1.5~ + #end +** Processing line: ~ #end~ - Inside source: true *** True Line Result - board_top = grid.h_half - square_size * 1.5 -** Processing line: ~~ + #end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # At first glance, the add(1) looks pretty trivial. But if you remove it,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # At first glance, the add(1) looks pretty trivial. But if you remove it, -** Processing line: ~ # you'll see that the positioning of the board would be skewed without it!~ + +** Processing line: ~ #render the ball to the screen~ - Inside source: true *** True Line Result - # you'll see that the positioning of the board would be skewed without it! -** Processing line: ~ # Or if you put 2 in the parenthesis, the pieces will be placed in the wrong squares~ + #render the ball to the screen +** Processing line: ~ def draw args~ - Inside source: true *** True Line Result - # Or if you put 2 in the parenthesis, the pieces will be placed in the wrong squares -** Processing line: ~ # due to the change in board placement.~ + def draw args +** Processing line: ~ #args.outputs.solids << [@x, @y, @width, @height, 255, 255, 0];~ - Inside source: true *** True Line Result - # due to the change in board placement. -** Processing line: ~ outputs.borders << all_spaces do |x, y, space| # outputs borders for all board spaces~ + #args.outputs.solids << [@x, @y, @width, @height, 255, 255, 0]; +** Processing line: ~ args.outputs.sprites << [~ - Inside source: true *** True Line Result - outputs.borders << all_spaces do |x, y, space| # outputs borders for all board spaces -** Processing line: ~ space.border ||= [~ + args.outputs.sprites << [ +** Processing line: ~ @center.x-@radius,~ - Inside source: true *** True Line Result - space.border ||= [ -** Processing line: ~ board_left + x.add(1) * square_size, # space.border is initialized using this definition~ + @center.x-@radius, +** Processing line: ~ @center.y-@radius,~ - Inside source: true *** True Line Result - board_left + x.add(1) * square_size, # space.border is initialized using this definition -** Processing line: ~ board_top + y.add(1) * square_size,~ + @center.y-@radius, +** Processing line: ~ @radius*2,~ - Inside source: true *** True Line Result - board_top + y.add(1) * square_size, -** Processing line: ~ square_size,~ + @radius*2, +** Processing line: ~ @radius*2,~ - Inside source: true *** True Line Result - square_size, -** Processing line: ~ square_size~ + @radius*2, +** Processing line: ~ "sprites/circle-white.png",~ - Inside source: true *** True Line Result - square_size -** Processing line: ~ ]~ + "sprites/circle-white.png", +** Processing line: ~ 0,~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + 0, +** Processing line: ~ 255,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 255, +** Processing line: ~ 255, #r~ - Inside source: true *** True Line Result - -** Processing line: ~ # Again, the calculations ensure that the piece is placed in the center of the grid square.~ + 255, #r +** Processing line: ~ 0, #g~ - Inside source: true *** True Line Result - # Again, the calculations ensure that the piece is placed in the center of the grid square. -** Processing line: ~ # Remove the '- 20' and the piece will be placed at the top of the grid square instead of the center.~ + 0, #g +** Processing line: ~ 255 #b~ - Inside source: true *** True Line Result - # Remove the '- 20' and the piece will be placed at the top of the grid square instead of the center. -** Processing line: ~ outputs.labels << filled_spaces do |x, y, space| # put label in each filled space of board~ + 255 #b +** Processing line: ~ ]~ - Inside source: true *** True Line Result - outputs.labels << filled_spaces do |x, y, space| # put label in each filled space of board -** Processing line: ~ label board_left + x.add(1) * square_size + square_size.fdiv(2),~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - label board_left + x.add(1) * square_size + square_size.fdiv(2), -** Processing line: ~ board_top + y.add(1) * square_size + square_size - 20,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - board_top + y.add(1) * square_size + square_size - 20, -** Processing line: ~ space.piece # text of label, either "x" or "o"~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - space.piece # text of label, either "x" or "o" -** 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: ~ # Uses a label to output whether x or o won, or if a draw occurred.~ +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - block.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Physics And Collisions - Bouncing On Collision - block.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/04_physics_and_collisions/08_bouncing_on_collision/app/block.rb~ - Inside source: true *** True Line Result - # Uses a label to output whether x or o won, or if a draw occurred. -** Processing line: ~ # If the game is ongoing, a label shows whose turn it currently is.~ + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/block.rb +** Processing line: ~ DEGREES_TO_RADIANS = Math::PI / 180~ - Inside source: true *** True Line Result - # If the game is ongoing, a label shows whose turn it currently is. -** Processing line: ~ outputs.labels << if state.x_won~ + DEGREES_TO_RADIANS = Math::PI / 180 +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.labels << if state.x_won -** Processing line: ~ label grid.w_half, grid.top - 80, "x won" # the '-80' positions the label 80 pixels lower than top~ + +** Processing line: ~ class Block~ - Inside source: true *** True Line Result - label grid.w_half, grid.top - 80, "x won" # the '-80' positions the label 80 pixels lower than top -** Processing line: ~ elsif state.o_won~ + class Block +** Processing line: ~ def initialize(x, y, block_size, rotation)~ - Inside source: true *** True Line Result - elsif state.o_won -** Processing line: ~ label grid.w_half, grid.top - 80, "o won" # grid.w_half positions the label in the center horizontally~ + def initialize(x, y, block_size, rotation) +** Processing line: ~ @x = x~ - Inside source: true *** True Line Result - label grid.w_half, grid.top - 80, "o won" # grid.w_half positions the label in the center horizontally -** Processing line: ~ elsif state.draw~ + @x = x +** Processing line: ~ @y = y~ - Inside source: true *** True Line Result - elsif state.draw -** Processing line: ~ label grid.w_half, grid.top - 80, "a draw"~ + @y = y +** Processing line: ~ @block_size = block_size~ - Inside source: true *** True Line Result - label grid.w_half, grid.top - 80, "a draw" -** Processing line: ~ else # if no one won and the game is ongoing~ + @block_size = block_size +** Processing line: ~ @rotation = rotation~ - Inside source: true *** True Line Result - else # if no one won and the game is ongoing -** Processing line: ~ label grid.w_half, grid.top - 80, "turn: #{state.current_turn}"~ + @rotation = rotation +** Processing line: ~~ - Inside source: true *** True Line Result - label grid.w_half, grid.top - 80, "turn: #{state.current_turn}" -** Processing line: ~ end~ + +** Processing line: ~ #The repel velocity?~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + #The repel velocity? +** Processing line: ~ @velocity = {x: 2, y: 0}~ - Inside source: true *** True Line Result - end + @velocity = {x: 2, y: 0} ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Calls the methods responsible for handling user input and determining the winner.~ +** Processing line: ~ horizontal_offset = (3 * block_size) * Math.cos(rotation * DEGREES_TO_RADIANS)~ - Inside source: true *** True Line Result - # Calls the methods responsible for handling user input and determining the winner. -** Processing line: ~ # Does nothing unless the mouse is clicked.~ + horizontal_offset = (3 * block_size) * Math.cos(rotation * DEGREES_TO_RADIANS) +** Processing line: ~ vertical_offset = block_size * Math.sin(rotation * DEGREES_TO_RADIANS)~ - Inside source: true *** True Line Result - # Does nothing unless the mouse is clicked. -** Processing line: ~ def input_board~ + vertical_offset = block_size * Math.sin(rotation * DEGREES_TO_RADIANS) +** Processing line: ~~ - Inside source: true *** True Line Result - def input_board -** Processing line: ~ return unless inputs.mouse.click~ + +** Processing line: ~ if rotation >= 0~ - Inside source: true *** True Line Result - return unless inputs.mouse.click -** Processing line: ~ input_place_piece~ + if rotation >= 0 +** Processing line: ~ theta = 90 - rotation~ - Inside source: true *** True Line Result - input_place_piece -** Processing line: ~ input_restart_game~ + theta = 90 - rotation +** Processing line: ~ #The line doesn't visually line up exactly with the edge of the sprite, so artificially move it a bit~ - Inside source: true *** True Line Result - input_restart_game -** Processing line: ~ determine_winner~ + #The line doesn't visually line up exactly with the edge of the sprite, so artificially move it a bit +** Processing line: ~ modifier = 5~ - Inside source: true *** True Line Result - determine_winner -** Processing line: ~ end~ + modifier = 5 +** Processing line: ~ x_offset = modifier * Math.cos(theta * DEGREES_TO_RADIANS)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x_offset = modifier * Math.cos(theta * DEGREES_TO_RADIANS) +** Processing line: ~ y_offset = modifier * Math.sin(theta * DEGREES_TO_RADIANS)~ - Inside source: true *** True Line Result - -** Processing line: ~ # Handles user input for placing pieces on the board.~ + y_offset = modifier * Math.sin(theta * DEGREES_TO_RADIANS) +** Processing line: ~ @x1 = @x - x_offset~ - Inside source: true *** True Line Result - # Handles user input for placing pieces on the board. -** Processing line: ~ def input_place_piece~ + @x1 = @x - x_offset +** Processing line: ~ @y1 = @y + y_offset~ - Inside source: true *** True Line Result - def input_place_piece -** Processing line: ~ return if state.game_over~ + @y1 = @y + y_offset +** Processing line: ~ @x2 = @x1 + horizontal_offset~ - Inside source: true *** True Line Result - return if state.game_over + @x2 = @x1 + horizontal_offset +** Processing line: ~ @y2 = @y1 + (vertical_offset * 3)~ +- Inside source: true +*** True Line Result + @y2 = @y1 + (vertical_offset * 3) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Checks to find the space that the mouse was clicked inside of, and makes sure the space does not already~ +** Processing line: ~ @imaginary_line = [ @x1, @y1, @x2, @y2 ]~ - Inside source: true *** True Line Result - # Checks to find the space that the mouse was clicked inside of, and makes sure the space does not already -** Processing line: ~ # have a piece in it.~ + @imaginary_line = [ @x1, @y1, @x2, @y2 ] +** Processing line: ~ else~ - Inside source: true *** True Line Result - # have a piece in it. -** Processing line: ~ __, __, space = all_spaces.find do |__, __, space|~ + else +** Processing line: ~ theta = 90 + rotation~ - Inside source: true *** True Line Result - __, __, space = all_spaces.find do |__, __, space| -** Processing line: ~ inputs.mouse.click.point.inside_rect?(space.border) && !space.piece~ + theta = 90 + rotation +** Processing line: ~ x_offset = @block_size * Math.cos(theta * DEGREES_TO_RADIANS)~ - Inside source: true *** True Line Result - inputs.mouse.click.point.inside_rect?(space.border) && !space.piece -** Processing line: ~ end~ + x_offset = @block_size * Math.cos(theta * DEGREES_TO_RADIANS) +** Processing line: ~ y_offset = @block_size * Math.sin(theta * DEGREES_TO_RADIANS)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + y_offset = @block_size * Math.sin(theta * DEGREES_TO_RADIANS) +** Processing line: ~ @x1 = @x + x_offset~ - Inside source: true *** True Line Result - -** Processing line: ~ # The piece that goes into the space belongs to the player whose turn it currently is.~ + @x1 = @x + x_offset +** Processing line: ~ @y1 = @y + y_offset + 19~ - Inside source: true *** True Line Result - # The piece that goes into the space belongs to the player whose turn it currently is. -** Processing line: ~ return unless space~ + @y1 = @y + y_offset + 19 +** Processing line: ~ @x2 = @x1 + horizontal_offset~ - Inside source: true *** True Line Result - return unless space -** Processing line: ~ space.piece = state.current_turn~ + @x2 = @x1 + horizontal_offset +** Processing line: ~ @y2 = @y1 + (vertical_offset * 3)~ - Inside source: true *** True Line Result - space.piece = state.current_turn + @y2 = @y1 + (vertical_offset * 3) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # This ternary operator statement allows us to change the current player's turn.~ +** Processing line: ~ @imaginary_line = [ @x1, @y1, @x2, @y2 ]~ - Inside source: true *** True Line Result - # This ternary operator statement allows us to change the current player's turn. -** Processing line: ~ # If it is currently x's turn, it becomes o's turn. If it is not x's turn, it become's x's turn.~ + @imaginary_line = [ @x1, @y1, @x2, @y2 ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - # If it is currently x's turn, it becomes o's turn. If it is not x's turn, it become's x's turn. -** Processing line: ~ state.current_turn = state.current_turn == :x ? :o : :x~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.current_turn = state.current_turn == :x ? :o : :x + ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -27015,62 +30312,66 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Resets the game.~ +** Processing line: ~ def draw args~ - Inside source: true *** True Line Result - # Resets the game. -** Processing line: ~ def input_restart_game~ + def draw args +** Processing line: ~ args.outputs.sprites << [~ - Inside source: true *** True Line Result - def input_restart_game -** Processing line: ~ return unless state.game_over~ + args.outputs.sprites << [ +** Processing line: ~ @x,~ - Inside source: true *** True Line Result - return unless state.game_over -** Processing line: ~ gtk.reset~ + @x, +** Processing line: ~ @y,~ - Inside source: true *** True Line Result - gtk.reset -** Processing line: ~ end~ + @y, +** Processing line: ~ @block_size*3,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + @block_size*3, +** Processing line: ~ @block_size,~ - Inside source: true *** True Line Result - -** Processing line: ~ # Checks if x or o won the game.~ + @block_size, +** Processing line: ~ "sprites/square-green.png",~ - Inside source: true *** True Line Result - # Checks if x or o won the game. -** Processing line: ~ # If neither player wins and all nine squares are filled, a draw happens.~ + "sprites/square-green.png", +** Processing line: ~ @rotation~ - Inside source: true *** True Line Result - # If neither player wins and all nine squares are filled, a draw happens. -** Processing line: ~ # Once a player is chosen as the winner or a draw happens, the game is over.~ + @rotation +** Processing line: ~ ]~ - Inside source: true *** True Line Result - # Once a player is chosen as the winner or a draw happens, the game is over. -** Processing line: ~ def determine_winner~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - def determine_winner -** Processing line: ~ state.x_won = won? :x # evaluates to either true or false (boolean values)~ + +** Processing line: ~ args.outputs.lines << @imaginary_line~ - Inside source: true *** True Line Result - state.x_won = won? :x # evaluates to either true or false (boolean values) -** Processing line: ~ state.o_won = won? :o~ + args.outputs.lines << @imaginary_line +** Processing line: ~ args.outputs.solids << @debug_shape~ - Inside source: true *** True Line Result - state.o_won = won? :o -** Processing line: ~ state.draw = true if filled_spaces.length == 9 && !state.x_won && !state.o_won~ + args.outputs.solids << @debug_shape +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.draw = true if filled_spaces.length == 9 && !state.x_won && !state.o_won -** Processing line: ~ state.game_over = state.x_won || state.o_won || state.draw~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.game_over = state.x_won || state.o_won || state.draw + +** Processing line: ~ def multiply_matricies~ +- Inside source: true +*** True Line Result + def multiply_matricies ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -27079,402 +30380,406 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Determines if a player won by checking if there is a horizontal match or vertical match.~ +** Processing line: ~ def calc args~ - Inside source: true *** True Line Result - # Determines if a player won by checking if there is a horizontal match or vertical match. -** Processing line: ~ # Horizontal_match and vertical_match have boolean values. If either is true, the game has been won.~ + def calc args +** Processing line: ~ if collision? args~ - Inside source: true *** True Line Result - # Horizontal_match and vertical_match have boolean values. If either is true, the game has been won. -** Processing line: ~ def won? piece~ + if collision? args +** Processing line: ~ collide args~ - Inside source: true *** True Line Result - def won? piece -** Processing line: ~ # performs action on all space combinations~ + collide args +** Processing line: ~ end~ - Inside source: true *** True Line Result - # performs action on all space combinations -** Processing line: ~ won = [[-1, 0, 1]].product([-1, 0, 1]).map do |xs, y|~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - won = [[-1, 0, 1]].product([-1, 0, 1]).map do |xs, y| + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Checks if the 3 grid spaces with the same y value (or same row) and~ -- Inside source: true -*** True Line Result - # Checks if the 3 grid spaces with the same y value (or same row) and -** Processing line: ~ # x values that are next to each other have pieces that belong to the same player.~ +** Processing line: ~ #Determine if the ball and block are touching~ - Inside source: true *** True Line Result - # x values that are next to each other have pieces that belong to the same player. -** Processing line: ~ # Remember, the value of piece is equal to the current turn (which is the player).~ + #Determine if the ball and block are touching +** Processing line: ~ def collision? args~ - Inside source: true *** True Line Result - # Remember, the value of piece is equal to the current turn (which is the player). -** Processing line: ~ horizontal_match = state.spaces[xs[0]][y].piece == piece &&~ + def collision? args +** Processing line: ~ #The minimum area enclosed by the center of the ball and the 2 corners of the block~ - Inside source: true *** True Line Result - horizontal_match = state.spaces[xs[0]][y].piece == piece && -** Processing line: ~ state.spaces[xs[1]][y].piece == piece &&~ + #The minimum area enclosed by the center of the ball and the 2 corners of the block +** Processing line: ~ #If the area ever drops below this value, we know there is a collision~ - Inside source: true *** True Line Result - state.spaces[xs[1]][y].piece == piece && -** Processing line: ~ state.spaces[xs[2]][y].piece == piece~ + #If the area ever drops below this value, we know there is a collision +** Processing line: ~ min_area = ((@block_size * 3) * args.state.ball.radius) / 2~ - Inside source: true *** True Line Result - state.spaces[xs[2]][y].piece == piece + min_area = ((@block_size * 3) * args.state.ball.radius) / 2 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Checks if the 3 grid spaces with the same x value (or same column) and~ +** Processing line: ~ #https://www.mathopenref.com/coordtrianglearea.html~ - Inside source: true *** True Line Result - # Checks if the 3 grid spaces with the same x value (or same column) and -** Processing line: ~ # y values that are next to each other have pieces that belong to the same player.~ + #https://www.mathopenref.com/coordtrianglearea.html +** Processing line: ~ ax = @x1~ - Inside source: true *** True Line Result - # y values that are next to each other have pieces that belong to the same player. -** Processing line: ~ # The && represents an "and" statement: if even one part of the statement is false,~ + ax = @x1 +** Processing line: ~ ay = @y1~ - Inside source: true *** True Line Result - # The && represents an "and" statement: if even one part of the statement is false, -** Processing line: ~ # the entire statement evaluates to false.~ + ay = @y1 +** Processing line: ~ bx = @x2~ - Inside source: true *** True Line Result - # the entire statement evaluates to false. -** Processing line: ~ vertical_match = state.spaces[y][xs[0]].piece == piece &&~ + bx = @x2 +** Processing line: ~ by = @y2~ - Inside source: true *** True Line Result - vertical_match = state.spaces[y][xs[0]].piece == piece && -** Processing line: ~ state.spaces[y][xs[1]].piece == piece &&~ + by = @y2 +** Processing line: ~ cx = args.state.ball.center.x~ - Inside source: true *** True Line Result - state.spaces[y][xs[1]].piece == piece && -** Processing line: ~ state.spaces[y][xs[2]].piece == piece~ + cx = args.state.ball.center.x +** Processing line: ~ cy = args.state.ball.center.y~ - Inside source: true *** True Line Result - state.spaces[y][xs[2]].piece == piece + cy = args.state.ball.center.y ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ horizontal_match || vertical_match # if either is true, true is returned~ -- Inside source: true -*** True Line Result - horizontal_match || vertical_match # if either is true, true is returned -** Processing line: ~ end~ +** Processing line: ~ current_area = (ax*(by-cy)+bx*(cy-ay)+cx*(ay-by))/2~ - Inside source: true *** True Line Result - end + current_area = (ax*(by-cy)+bx*(cy-ay)+cx*(ay-by))/2 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sees if there is a diagonal match, starting from the bottom left and ending at the top right.~ +** Processing line: ~ collision = false~ - Inside source: true *** True Line Result - # Sees if there is a diagonal match, starting from the bottom left and ending at the top right. -** Processing line: ~ # Is added to won regardless of whether the statement is true or false.~ + collision = false +** Processing line: ~ if @rotation >= 0~ - Inside source: true *** True Line Result - # Is added to won regardless of whether the statement is true or false. -** Processing line: ~ won << (state.spaces[-1][-1].piece == piece && # bottom left~ + if @rotation >= 0 +** Processing line: ~ if (current_area < min_area &&~ - Inside source: true *** True Line Result - won << (state.spaces[-1][-1].piece == piece && # bottom left -** Processing line: ~ state.spaces[ 0][ 0].piece == piece && # center~ + if (current_area < min_area && +** Processing line: ~ current_area > 0 &&~ - Inside source: true *** True Line Result - state.spaces[ 0][ 0].piece == piece && # center -** Processing line: ~ state.spaces[ 1][ 1].piece == piece) # top right~ + current_area > 0 && +** Processing line: ~ args.state.ball.center.y > @y1 &&~ - Inside source: true *** True Line Result - state.spaces[ 1][ 1].piece == piece) # top right + args.state.ball.center.y > @y1 && +** Processing line: ~ args.state.ball.center.x < @x2)~ +- Inside source: true +*** True Line Result + args.state.ball.center.x < @x2) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sees if there is a diagonal match, starting at the bottom right and ending at the top left~ +** Processing line: ~ collision = true~ - Inside source: true *** True Line Result - # Sees if there is a diagonal match, starting at the bottom right and ending at the top left -** Processing line: ~ # and is added to won.~ + collision = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - # and is added to won. -** Processing line: ~ won << (state.spaces[ 1][-1].piece == piece && # bottom right~ + end +** Processing line: ~ else~ - Inside source: true *** True Line Result - won << (state.spaces[ 1][-1].piece == piece && # bottom right -** Processing line: ~ state.spaces[ 0][ 0].piece == piece && # center~ + else +** Processing line: ~ if (current_area < min_area &&~ - Inside source: true *** True Line Result - state.spaces[ 0][ 0].piece == piece && # center -** Processing line: ~ state.spaces[-1][ 1].piece == piece) # top left~ + if (current_area < min_area && +** Processing line: ~ current_area > 0 &&~ - Inside source: true *** True Line Result - state.spaces[-1][ 1].piece == piece) # top left + current_area > 0 && +** Processing line: ~ args.state.ball.center.y > @y2 &&~ +- Inside source: true +*** True Line Result + args.state.ball.center.y > @y2 && +** Processing line: ~ args.state.ball.center.x > @x1)~ +- Inside source: true +*** True Line Result + args.state.ball.center.x > @x1) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Any false statements (meaning false diagonal matches) are rejected from won~ +** Processing line: ~ collision = true~ - Inside source: true *** True Line Result - # Any false statements (meaning false diagonal matches) are rejected from won -** Processing line: ~ won.reject_false.any?~ + collision = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - won.reject_false.any? -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Defines filled spaces on the board by rejecting all spaces that do not have game pieces in them.~ +** Processing line: ~ return collision~ - Inside source: true *** True Line Result - # Defines filled spaces on the board by rejecting all spaces that do not have game pieces in them. -** Processing line: ~ # The ! before a statement means "not". For example, we are rejecting any space combinations that do~ + return collision +** Processing line: ~ end~ - Inside source: true *** True Line Result - # The ! before a statement means "not". For example, we are rejecting any space combinations that do -** Processing line: ~ # NOT have pieces in them.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # NOT have pieces in them. -** Processing line: ~ def filled_spaces~ + +** Processing line: ~ def collide args~ - Inside source: true *** True Line Result - def filled_spaces -** Processing line: ~ state.space_combinations~ + def collide args +** Processing line: ~ #Slope of the block~ - Inside source: true *** True Line Result - state.space_combinations -** Processing line: ~ .reject { |x, y| !state.spaces[x][y].piece } # reject spaces with no pieces in them~ + #Slope of the block +** Processing line: ~ slope = (@y2 - @y1) / (@x2 - @x1)~ - Inside source: true *** True Line Result - .reject { |x, y| !state.spaces[x][y].piece } # reject spaces with no pieces in them -** Processing line: ~ .map do |x, y|~ + slope = (@y2 - @y1) / (@x2 - @x1) +** Processing line: ~~ - Inside source: true *** True Line Result - .map do |x, y| -** Processing line: ~ if block_given?~ + +** Processing line: ~ #Create a unit vector and tilt it (@rotation) number of degrees~ - Inside source: true *** True Line Result - if block_given? -** Processing line: ~ yield x, y, state.spaces[x][y]~ + #Create a unit vector and tilt it (@rotation) number of degrees +** Processing line: ~ x = -Math.cos(@rotation * DEGREES_TO_RADIANS)~ - Inside source: true *** True Line Result - yield x, y, state.spaces[x][y] -** Processing line: ~ else~ + x = -Math.cos(@rotation * DEGREES_TO_RADIANS) +** Processing line: ~ y = Math.sin(@rotation * DEGREES_TO_RADIANS)~ - Inside source: true *** True Line Result - else -** Processing line: ~ [x, y, state.spaces[x][y]] # sets definition of space~ + y = Math.sin(@rotation * DEGREES_TO_RADIANS) +** Processing line: ~~ - Inside source: true *** True Line Result - [x, y, state.spaces[x][y]] # sets definition of space -** Processing line: ~ end~ + +** Processing line: ~ #Find the vector that is perpendicular to the slope~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + #Find the vector that is perpendicular to the slope +** Processing line: ~ perpVect = { x: x, y: y }~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + perpVect = { x: x, y: y } +** Processing line: ~ mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magniude of the perpVect~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magniude of the perpVect +** Processing line: ~ perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magniude to make it a unit vector~ - Inside source: true *** True Line Result - -** Processing line: ~ # Defines all spaces on the board.~ + perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magniude to make it a unit vector +** Processing line: ~~ - Inside source: true *** True Line Result - # Defines all spaces on the board. -** Processing line: ~ def all_spaces~ + +** Processing line: ~ previousPosition = { # calculate an ESTIMATE of the previousPosition of the ball~ - Inside source: true *** True Line Result - def all_spaces -** Processing line: ~ if !block_given?~ + previousPosition = { # calculate an ESTIMATE of the previousPosition of the ball +** Processing line: ~ x:args.state.ball.center.x-args.state.ball.velocity.x,~ - Inside source: true *** True Line Result - if !block_given? -** Processing line: ~ state.space_combinations.map do |x, y|~ + x:args.state.ball.center.x-args.state.ball.velocity.x, +** Processing line: ~ y:args.state.ball.center.y-args.state.ball.velocity.y~ - Inside source: true *** True Line Result - state.space_combinations.map do |x, y| -** Processing line: ~ [x, y, state.spaces[x][y]] # sets definition of space~ + y:args.state.ball.center.y-args.state.ball.velocity.y +** Processing line: ~ }~ - Inside source: true *** True Line Result - [x, y, state.spaces[x][y]] # sets definition of space -** Processing line: ~ end~ + } +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ else # if a block is given (block_given? is true)~ + +** Processing line: ~ velocityMag = (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5 # the current velocity magnitude of the ball~ - Inside source: true *** True Line Result - else # if a block is given (block_given? is true) -** Processing line: ~ state.space_combinations.map do |x, y|~ + velocityMag = (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5 # the current velocity magnitude of the ball +** Processing line: ~ theta_ball = Math.atan2(args.state.ball.velocity.y, args.state.ball.velocity.x) #the angle of the ball's velocity~ - Inside source: true *** True Line Result - state.space_combinations.map do |x, y| -** Processing line: ~ yield x, y, state.spaces[x][y] # yield if a block is given~ + theta_ball = Math.atan2(args.state.ball.velocity.y, args.state.ball.velocity.x) #the angle of the ball's velocity +** Processing line: ~ theta_repel = (180 * DEGREES_TO_RADIANS) - theta_ball + (@rotation * DEGREES_TO_RADIANS)~ - Inside source: true *** True Line Result - yield x, y, state.spaces[x][y] # yield if a block is given -** Processing line: ~ end~ + theta_repel = (180 * DEGREES_TO_RADIANS) - theta_ball + (@rotation * DEGREES_TO_RADIANS) +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity +** Processing line: ~ fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity~ - Inside source: true *** True Line Result - end + fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets values for a label, such as the position, value, size, alignment, and color.~ +** Processing line: ~ frx = velocityMag * Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx~ - Inside source: true *** True Line Result - # Sets values for a label, such as the position, value, size, alignment, and color. -** Processing line: ~ def label x, y, value~ + frx = velocityMag * Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx +** Processing line: ~ fry = velocityMag * Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby~ - Inside source: true *** True Line Result - def label x, y, value -** Processing line: ~ [x, y + 10, value, 20, 1, 0, 0, 0]~ + fry = velocityMag * Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby +** Processing line: ~~ - Inside source: true *** True Line Result - [x, y + 10, value, 20, 1, 0, 0, 0] -** Processing line: ~ end~ + +** Processing line: ~ args.state.display_value = velocityMag~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + args.state.display_value = velocityMag +** Processing line: ~ fsumx = fbx+frx #sum of x forces~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + fsumx = fbx+frx #sum of x forces +** Processing line: ~ fsumy = fby+fry #sum of y forces~ - Inside source: true *** True Line Result - -** Processing line: ~ $tic_tac_toe = TicTacToe.new~ + fsumy = fby+fry #sum of y forces +** Processing line: ~ fr = velocityMag #fr is the resulting magnitude~ - Inside source: true *** True Line Result - $tic_tac_toe = TicTacToe.new + fr = velocityMag #fr is the resulting magnitude +** Processing line: ~ thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle~ +- Inside source: true +*** True Line Result + thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ xnew = fr*Math.cos(thetaNew) #resulting x velocity~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ $tic_tac_toe._ = args~ + xnew = fr*Math.cos(thetaNew) #resulting x velocity +** Processing line: ~ ynew = fr*Math.sin(thetaNew) #resulting y velocity~ - Inside source: true *** True Line Result - $tic_tac_toe._ = args -** Processing line: ~ $tic_tac_toe.state = args.state~ + ynew = fr*Math.sin(thetaNew) #resulting y velocity +** Processing line: ~~ - Inside source: true *** True Line Result - $tic_tac_toe.state = args.state -** Processing line: ~ $tic_tac_toe.outputs = args.outputs~ + +** Processing line: ~ dampener = 0.3~ - Inside source: true *** True Line Result - $tic_tac_toe.outputs = args.outputs -** Processing line: ~ $tic_tac_toe.inputs = args.inputs~ + dampener = 0.3 +** Processing line: ~ ynew *= dampener * 0.5~ - Inside source: true *** True Line Result - $tic_tac_toe.inputs = args.inputs -** Processing line: ~ $tic_tac_toe.grid = args.grid~ + ynew *= dampener * 0.5 +** Processing line: ~~ - Inside source: true *** True Line Result - $tic_tac_toe.grid = args.grid -** Processing line: ~ $tic_tac_toe.gtk = args.gtk~ + +** Processing line: ~ #If the bounce is very low, that means the ball is rolling and we don't want to dampenen the X velocity~ - Inside source: true *** True Line Result - $tic_tac_toe.gtk = args.gtk -** Processing line: ~ $tic_tac_toe.tick~ + #If the bounce is very low, that means the ball is rolling and we don't want to dampenen the X velocity +** Processing line: ~ if ynew > -0.1~ - Inside source: true *** True Line Result - $tic_tac_toe.tick -** Processing line: ~ tick_instructions args, "Sample app shows how to work with mouse clicks."~ + if ynew > -0.1 +** Processing line: ~ xnew *= dampener~ - Inside source: true *** True Line Result - tick_instructions args, "Sample app shows how to work with mouse clicks." -** Processing line: ~ end~ + xnew *= dampener +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + 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 ||~ +** Processing line: ~ #Add the sine component of gravity back in (X component)~ - Inside source: true *** True Line Result - if args.inputs.mouse.click || -** Processing line: ~ args.inputs.keyboard.directional_vector ||~ + #Add the sine component of gravity back in (X component) +** Processing line: ~ gravity_x = 4 * Math.sin(@rotation * DEGREES_TO_RADIANS)~ - Inside source: true *** True Line Result - args.inputs.keyboard.directional_vector || -** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ + gravity_x = 4 * Math.sin(@rotation * DEGREES_TO_RADIANS) +** Processing line: ~ xnew += gravity_x~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.enter || -** Processing line: ~ args.inputs.keyboard.key_down.escape~ + xnew += gravity_x +** Processing line: ~~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.escape -** Processing line: ~ args.state.key_event_occurred = true~ + +** Processing line: ~ args.state.ball.velocity.x = -xnew~ - Inside source: true *** True Line Result - args.state.key_event_occurred = true -** Processing line: ~ end~ + args.state.ball.velocity.x = -xnew +** Processing line: ~ args.state.ball.velocity.y = -ynew~ - Inside source: true *** True Line Result - end + args.state.ball.velocity.y = -ynew ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ +** Processing line: ~ #Set the position of the ball to the previous position so it doesn't warp throught the block~ - 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~ + #Set the position of the ball to the previous position so it doesn't warp throught the block +** Processing line: ~ args.state.ball.center.x = previousPosition.x~ - 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.state.ball.center.x = previousPosition.x +** Processing line: ~ args.state.ball.center.y = previousPosition.y~ - Inside source: true *** True Line Result - args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label + args.state.ball.center.y = previousPosition.y +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -27491,310 +30796,314 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Mouse - Mouse Move - main.rb~ +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - cannon.rb~ - Header detected. *** True Line Result *** True Line Result -* Mouse - Mouse Move - main.rb +*** Physics And Collisions - Bouncing On Collision - cannon.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/05_mouse/02_mouse_move/app/main.rb~ -- Inside source: true -*** True Line Result - # ./samples/05_mouse/02_mouse_move/app/main.rb -** Processing line: ~ =begin~ +** Processing line: ~ # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/cannon.rb~ - Inside source: true *** True Line Result - =begin -** Processing line: ~~ + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/cannon.rb +** Processing line: ~ class Cannon~ - Inside source: true *** True Line Result - -** Processing line: ~ Reminders:~ + class Cannon +** Processing line: ~ def initialize args~ - Inside source: true *** True Line Result - Reminders: -** Processing line: ~~ + def initialize args +** Processing line: ~ @pointA = {x: args.grid.right/2,y: args.grid.top}~ - Inside source: true *** True Line Result - -** Processing line: ~ - num1.greater(num2): Returns the greater value.~ + @pointA = {x: args.grid.right/2,y: args.grid.top} +** Processing line: ~ @pointB = {x: args.inputs.mouse.x, y: args.inputs.mouse.y}~ - Inside source: true *** True Line Result - - num1.greater(num2): Returns the greater value. -** Processing line: ~ For example, if we have the command~ + @pointB = {x: args.inputs.mouse.x, y: args.inputs.mouse.y} +** Processing line: ~ end~ - Inside source: true *** True Line Result - For example, if we have the command -** Processing line: ~ puts 4.greater(3)~ + end +** Processing line: ~ def update args~ - Inside source: true *** True Line Result - puts 4.greater(3) -** Processing line: ~ the number 4 would be printed to the console since it has a greater value than 3.~ + def update args +** Processing line: ~ activeBall = args.state.ball~ - Inside source: true *** True Line Result - the number 4 would be printed to the console since it has a greater value than 3. -** Processing line: ~ Similar to lesser, which returns the lesser value.~ + activeBall = args.state.ball +** Processing line: ~ @pointB = {x: args.inputs.mouse.x, y: args.inputs.mouse.y}~ - Inside source: true *** True Line Result - Similar to lesser, which returns the lesser value. + @pointB = {x: args.inputs.mouse.x, y: args.inputs.mouse.y} ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - find_all: Finds all elements of a collection that meet certain requirements.~ +** Processing line: ~ if args.inputs.mouse.click~ - Inside source: true *** True Line Result - - find_all: Finds all elements of a collection that meet certain requirements. -** Processing line: ~ For example, in this sample app, we're using find_all to find all zombies that have intersected~ + if args.inputs.mouse.click +** Processing line: ~ alpha = 0.01~ - Inside source: true *** True Line Result - For example, in this sample app, we're using find_all to find all zombies that have intersected -** Processing line: ~ or hit the player's sprite since these zombies have been killed.~ + alpha = 0.01 +** Processing line: ~ activeBall.velocity.y = (@pointB.y - @pointA.y) * alpha~ - Inside source: true *** True Line Result - or hit the player's sprite since these zombies have been killed. -** Processing line: ~~ + activeBall.velocity.y = (@pointB.y - @pointA.y) * alpha +** Processing line: ~ activeBall.velocity.x = (@pointB.x - @pointA.x) * alpha~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.inputs.keyboard.key_down.KEY: Determines if a key is being held or pressed.~ + activeBall.velocity.x = (@pointB.x - @pointA.x) * alpha +** Processing line: ~ activeBall.center = {x: (args.grid.w / 2), y: (args.grid.h)}~ - Inside source: true *** True Line Result - - args.inputs.keyboard.key_down.KEY: Determines if a key is being held or pressed. -** Processing line: ~ Stores the frame the "down" event occurred.~ + activeBall.center = {x: (args.grid.w / 2), y: (args.grid.h)} +** Processing line: ~ end~ - Inside source: true *** True Line Result - Stores the frame the "down" event occurred. -** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - For more information about the keyboard, go to mygame/documentation/06-keyboard.md. -** Processing line: ~~ + end +** Processing line: ~ def render args~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ + def render args +** Processing line: ~ args.outputs.lines << [@pointA.x, @pointA.y, @pointB.x, @pointB.y]~ - Inside source: true *** True Line Result - - args.outputs.sprites: An array. The values generate a sprite. -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE]~ + args.outputs.lines << [@pointA.x, @pointA.y, @pointB.x, @pointB.y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE] -** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - For more information about sprites, go to mygame/documentation/05-sprites.md. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - - args.state.new_entity: Used when we want to create a new object, like a sprite or button. -** Processing line: ~ When we want to create a new object, we can declare it as a new entity and then define~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - When we want to create a new object, we can declare it as a new entity and then define -** Processing line: ~ its properties. (Remember, you can use state to define ANY property and it will~ -- Inside source: true + +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - main.rb~ +- Header detected. *** True Line Result - its properties. (Remember, you can use state to define ANY property and it will -** Processing line: ~ be retained across frames.)~ -- Inside source: true + *** True Line Result - be retained across frames.) -** Processing line: ~~ -- Inside source: true +*** Physics And Collisions - Bouncing On Collision - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/main.rb~ - Inside source: true *** True Line Result - - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/main.rb +** Processing line: ~ INFINITY= 10**10~ - Inside source: true *** True Line Result - as Ruby code, and the placeholder is replaced with its corresponding value or result. + INFINITY= 10**10 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - map: Ruby method used to transform data; used in arrays, hashes, and collections.~ +** Processing line: ~ require 'app/vector2d.rb'~ - Inside source: true *** True Line Result - - map: Ruby method used to transform data; used in arrays, hashes, and collections. -** Processing line: ~ Can be used to perform an action on every element of a collection, such as multiplying~ + require 'app/vector2d.rb' +** Processing line: ~ require 'app/peg.rb'~ - Inside source: true *** True Line Result - Can be used to perform an action on every element of a collection, such as multiplying -** Processing line: ~ each element by 2 or declaring every element as a new entity.~ + require 'app/peg.rb' +** Processing line: ~ require 'app/block.rb'~ - Inside source: true *** True Line Result - each element by 2 or declaring every element as a new entity. -** Processing line: ~~ + require 'app/block.rb' +** Processing line: ~ require 'app/ball.rb'~ - Inside source: true *** True Line Result - -** Processing line: ~ - sample: Chooses a random element from the array.~ + require 'app/ball.rb' +** Processing line: ~ require 'app/cannon.rb'~ - Inside source: true *** True Line Result - - sample: Chooses a random element from the array. + require 'app/cannon.rb' ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - reject: Removes elements that meet certain requirements.~ +** Processing line: ~~ - Inside source: true *** True Line Result - - reject: Removes elements that meet certain requirements. -** Processing line: ~ In this sample app, we're removing/rejecting zombies that reach the center of the screen. We're also~ + +** Processing line: ~ #Method to init default values~ - Inside source: true *** True Line Result - In this sample app, we're removing/rejecting zombies that reach the center of the screen. We're also -** Processing line: ~ rejecting zombies that were killed more than 30 frames ago.~ + #Method to init default values +** Processing line: ~ def defaults args~ - Inside source: true *** True Line Result - rejecting zombies that were killed more than 30 frames ago. -** Processing line: ~~ + def defaults args +** Processing line: ~ args.state.pegs ||= []~ - Inside source: true *** True Line Result - -** Processing line: ~ =end~ + args.state.pegs ||= [] +** Processing line: ~ args.state.blocks ||= []~ - Inside source: true *** True Line Result - =end -** Processing line: ~~ + args.state.blocks ||= [] +** Processing line: ~ args.state.cannon ||= Cannon.new args~ - Inside source: true *** True Line Result - -** Processing line: ~ # This sample app allows users to move around the screen in order to kill zombies. Zombies appear from every direction so the goal~ + args.state.cannon ||= Cannon.new args +** Processing line: ~ args.state.ball ||= Ball.new args~ - Inside source: true *** True Line Result - # This sample app allows users to move around the screen in order to kill zombies. Zombies appear from every direction so the goal -** Processing line: ~ # is to kill the zombies as fast as possible!~ + args.state.ball ||= Ball.new args +** Processing line: ~ args.state.horizontal_offset ||= 0~ - Inside source: true *** True Line Result - # is to kill the zombies as fast as possible! + args.state.horizontal_offset ||= 0 +** Processing line: ~ init_pegs args~ +- Inside source: true +*** True Line Result + init_pegs args +** Processing line: ~ init_blocks args~ +- Inside source: true +*** True Line Result + init_blocks args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class ProtectThePuppiesFromTheZombies~ +** Processing line: ~ args.state.display_value ||= "test"~ - Inside source: true *** True Line Result - class ProtectThePuppiesFromTheZombies -** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs~ + args.state.display_value ||= "test" +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_accessor :grid, :inputs, :state, :outputs + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Calls the methods necessary for the game to run properly.~ -- Inside source: true -*** True Line Result - # Calls the methods necessary for the game to run properly. -** Processing line: ~ def tick~ +** Processing line: ~ begin :default_methods~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ defaults~ + begin :default_methods +** Processing line: ~ def init_pegs args~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ render~ + def init_pegs args +** Processing line: ~ num_horizontal_pegs = 14~ - Inside source: true *** True Line Result - render -** Processing line: ~ calc~ + num_horizontal_pegs = 14 +** Processing line: ~ num_rows = 5~ - Inside source: true *** True Line Result - calc -** Processing line: ~ input~ + num_rows = 5 +** Processing line: ~~ - Inside source: true *** True Line Result - input -** Processing line: ~ end~ + +** Processing line: ~ return unless args.state.pegs.count < num_rows * num_horizontal_pegs~ - Inside source: true *** True Line Result - end + return unless args.state.pegs.count < num_rows * num_horizontal_pegs ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets default values for the zombies and for the player.~ +** Processing line: ~ block_size = 32~ - Inside source: true *** True Line Result - # Sets default values for the zombies and for the player. -** Processing line: ~ # Initialization happens only in the first frame.~ + block_size = 32 +** Processing line: ~ block_spacing = 50~ - Inside source: true *** True Line Result - # Initialization happens only in the first frame. -** Processing line: ~ def defaults~ + block_spacing = 50 +** Processing line: ~ total_width = num_horizontal_pegs * (block_size + block_spacing)~ - Inside source: true *** True Line Result - def defaults -** Processing line: ~ state.flash_at ||= 0~ + total_width = num_horizontal_pegs * (block_size + block_spacing) +** Processing line: ~ starting_offset = (args.grid.w - total_width) / 2 + block_size~ - Inside source: true *** True Line Result - state.flash_at ||= 0 -** Processing line: ~ state.zombie_min_spawn_rate ||= 60~ + starting_offset = (args.grid.w - total_width) / 2 + block_size +** Processing line: ~~ - Inside source: true *** True Line Result - state.zombie_min_spawn_rate ||= 60 -** Processing line: ~ state.zombie_spawn_countdown ||= random_spawn_countdown state.zombie_min_spawn_rate~ + +** Processing line: ~ for i in (0...num_rows)~ - Inside source: true *** True Line Result - state.zombie_spawn_countdown ||= random_spawn_countdown state.zombie_min_spawn_rate -** Processing line: ~ state.zombies ||= []~ + for i in (0...num_rows) +** Processing line: ~ for j in (0...num_horizontal_pegs)~ - Inside source: true *** True Line Result - state.zombies ||= [] -** Processing line: ~ state.killed_zombies ||= []~ + for j in (0...num_horizontal_pegs) +** Processing line: ~ row_offset = 0~ - Inside source: true *** True Line Result - state.killed_zombies ||= [] -** Processing line: ~~ + row_offset = 0 +** Processing line: ~ if i % 2 == 0~ - Inside source: true *** True Line Result - -** Processing line: ~ # Declares player as a new entity and sets its properties.~ + if i % 2 == 0 +** Processing line: ~ row_offset = 20~ - Inside source: true *** True Line Result - # Declares player as a new entity and sets its properties. -** Processing line: ~ # The player begins the game in the center of the screen, not moving in any direction.~ + row_offset = 20 +** Processing line: ~ else~ - Inside source: true *** True Line Result - # The player begins the game in the center of the screen, not moving in any direction. -** Processing line: ~ state.player ||= state.new_entity(:player, { x: 640,~ + else +** Processing line: ~ row_offset = -20~ - Inside source: true *** True Line Result - state.player ||= state.new_entity(:player, { x: 640, -** Processing line: ~ y: 360,~ + row_offset = -20 +** Processing line: ~ end~ - Inside source: true *** True Line Result - y: 360, -** Processing line: ~ attack_angle: 0,~ + end +** Processing line: ~ args.state.pegs.append(Peg.new(j * (block_size+block_spacing) + starting_offset + row_offset, (args.grid.h - block_size * 2) - (i * block_size * 2)-90, block_size))~ - Inside source: true *** True Line Result - attack_angle: 0, -** Processing line: ~ dx: 0,~ + args.state.pegs.append(Peg.new(j * (block_size+block_spacing) + starting_offset + row_offset, (args.grid.h - block_size * 2) - (i * block_size * 2)-90, block_size)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - dx: 0, -** Processing line: ~ dy: 0 })~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - dy: 0 }) + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -27803,146 +31112,146 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Outputs a gray background.~ +** Processing line: ~ def init_blocks args~ - Inside source: true *** True Line Result - # Outputs a gray background. -** Processing line: ~ # Calls the methods needed to output the player, zombies, etc onto the screen.~ + def init_blocks args +** Processing line: ~ return unless args.state.blocks.count < 10~ - Inside source: true *** True Line Result - # Calls the methods needed to output the player, zombies, etc onto the screen. -** Processing line: ~ def render~ + return unless args.state.blocks.count < 10 +** Processing line: ~~ - Inside source: true *** True Line Result - def render -** Processing line: ~ outputs.solids << [grid.rect, 100, 100, 100]~ + +** Processing line: ~ #Sprites are rotated in degrees, but the Ruby math functions work on radians~ - Inside source: true *** True Line Result - outputs.solids << [grid.rect, 100, 100, 100] -** Processing line: ~ render_zombies~ + #Sprites are rotated in degrees, but the Ruby math functions work on radians +** Processing line: ~ radians_to_degrees = Math::PI / 180~ - Inside source: true *** True Line Result - render_zombies -** Processing line: ~ render_killed_zombies~ + radians_to_degrees = Math::PI / 180 +** Processing line: ~~ - Inside source: true *** True Line Result - render_killed_zombies -** Processing line: ~ render_player~ + +** Processing line: ~ block_size = 25~ - Inside source: true *** True Line Result - render_player -** Processing line: ~ render_flash~ + block_size = 25 +** Processing line: ~ #Rotation angle (in degrees) of the blocks~ - Inside source: true *** True Line Result - render_flash -** Processing line: ~ end~ + #Rotation angle (in degrees) of the blocks +** Processing line: ~ rotation = 30~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + rotation = 30 +** Processing line: ~ vertical_offset = block_size * Math.sin(rotation * radians_to_degrees)~ - Inside source: true *** True Line Result - -** Processing line: ~ # Outputs the zombies on the screen and sets values for the sprites, such as the position, width, height, and animation.~ + vertical_offset = block_size * Math.sin(rotation * radians_to_degrees) +** Processing line: ~ horizontal_offset = (3 * block_size) * Math.cos(rotation * radians_to_degrees)~ - Inside source: true *** True Line Result - # Outputs the zombies on the screen and sets values for the sprites, such as the position, width, height, and animation. -** Processing line: ~ def render_zombies~ + horizontal_offset = (3 * block_size) * Math.cos(rotation * radians_to_degrees) +** Processing line: ~ center = args.grid.w / 2~ - Inside source: true *** True Line Result - def render_zombies -** Processing line: ~ outputs.sprites << state.zombies.map do |z| # performs action on all zombies in the collection~ + center = args.grid.w / 2 +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.sprites << state.zombies.map do |z| # performs action on all zombies in the collection -** Processing line: ~ z.sprite = [z.x, z.y, 4 * 3, 8 * 3, animation_sprite(z)].sprite # sets definition for sprite, calls animation_sprite method~ + +** Processing line: ~ for i in (0...5)~ - Inside source: true *** True Line Result - z.sprite = [z.x, z.y, 4 * 3, 8 * 3, animation_sprite(z)].sprite # sets definition for sprite, calls animation_sprite method -** Processing line: ~ z.sprite~ + for i in (0...5) +** Processing line: ~ #Create a ramp of blocks. Not going to be perfect because of the float to integer conversion and anisotropic to isotropic coversion~ - Inside source: true *** True Line Result - z.sprite -** Processing line: ~ end~ + #Create a ramp of blocks. Not going to be perfect because of the float to integer conversion and anisotropic to isotropic coversion +** Processing line: ~ args.state.blocks.append(Block.new((center + 100 + (i * horizontal_offset)).to_i, 100 + (vertical_offset * i) + (i * block_size), block_size, rotation))~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + args.state.blocks.append(Block.new((center + 100 + (i * horizontal_offset)).to_i, 100 + (vertical_offset * i) + (i * block_size), block_size, rotation)) +** Processing line: ~ args.state.blocks.append(Block.new((center - 100 - (i * horizontal_offset)).to_i, 100 + (vertical_offset * i) + (i * block_size), block_size, -rotation))~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.blocks.append(Block.new((center - 100 - (i * horizontal_offset)).to_i, 100 + (vertical_offset * i) + (i * block_size), block_size, -rotation)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # Outputs sprites of killed zombies, and displays a slash image to show that a zombie has been killed.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Outputs sprites of killed zombies, and displays a slash image to show that a zombie has been killed. -** Processing line: ~ def render_killed_zombies~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - def render_killed_zombies -** Processing line: ~ outputs.sprites << state.killed_zombies.map do |z| # performs action on all killed zombies in collection~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.sprites << state.killed_zombies.map do |z| # performs action on all killed zombies in collection -** Processing line: ~ z.sprite = [z.x,~ + +** Processing line: ~ #Render loop~ - Inside source: true *** True Line Result - z.sprite = [z.x, -** Processing line: ~ z.y,~ + #Render loop +** Processing line: ~ def render args~ - Inside source: true *** True Line Result - z.y, -** Processing line: ~ 4 * 3,~ + def render args +** Processing line: ~ args.outputs.borders << args.state.game_area~ - Inside source: true *** True Line Result - 4 * 3, -** Processing line: ~ 8 * 3,~ + args.outputs.borders << args.state.game_area +** Processing line: ~ render_pegs args~ - Inside source: true *** True Line Result - 8 * 3, -** Processing line: ~ animation_sprite(z, z.death_at), # calls animation_sprite method~ + render_pegs args +** Processing line: ~ render_blocks args~ - Inside source: true *** True Line Result - animation_sprite(z, z.death_at), # calls animation_sprite method -** Processing line: ~ 0, # angle~ + render_blocks args +** Processing line: ~ args.state.cannon.render args~ - Inside source: true *** True Line Result - 0, # angle -** Processing line: ~ 255 * z.death_at.ease(30, :flip)].sprite # transparency of a zombie changes when they die~ + args.state.cannon.render args +** Processing line: ~ args.state.ball.draw args~ - Inside source: true *** True Line Result - 255 * z.death_at.ease(30, :flip)].sprite # transparency of a zombie changes when they die -** Processing line: ~ # change the value of 30 and see what happens when a zombie is killed~ + args.state.ball.draw args +** Processing line: ~ end~ - Inside source: true *** True Line Result - # change the value of 30 and see what happens when a zombie is killed + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets values to output the slash over the zombie's sprite when a zombie is killed.~ +** Processing line: ~ begin :render_methods~ - Inside source: true *** True Line Result - # Sets values to output the slash over the zombie's sprite when a zombie is killed. -** Processing line: ~ # The slash is tilted 45 degrees from the angle of the player's attack.~ + begin :render_methods +** Processing line: ~ #Draw the pegs in a grid pattern~ - Inside source: true *** True Line Result - # The slash is tilted 45 degrees from the angle of the player's attack. -** Processing line: ~ # Change the 3 inside scale_rect to 30 and the slash will be HUGE! Scale_rect positions~ + #Draw the pegs in a grid pattern +** Processing line: ~ def render_pegs args~ - Inside source: true *** True Line Result - # Change the 3 inside scale_rect to 30 and the slash will be HUGE! Scale_rect positions -** Processing line: ~ # the slash over the killed zombie's sprite.~ + def render_pegs args +** Processing line: ~ args.state.pegs.each do |peg|~ - Inside source: true *** True Line Result - # the slash over the killed zombie's sprite. -** Processing line: ~ [z.sprite, [z.sprite.rect, 'sprites/slash.png', 45 + state.player.attack_angle_on_click, z.sprite.a].scale_rect(3, 0.5, 0.5)]~ + args.state.pegs.each do |peg| +** Processing line: ~ peg.draw args~ - Inside source: true *** True Line Result - [z.sprite, [z.sprite.rect, 'sprites/slash.png', 45 + state.player.attack_angle_on_click, z.sprite.a].scale_rect(3, 0.5, 0.5)] + peg.draw args ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -27955,62 +31264,54 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Outputs the player sprite using the images in the sprites folder.~ -- Inside source: true -*** True Line Result - # Outputs the player sprite using the images in the sprites folder. -** Processing line: ~ def render_player~ -- Inside source: true -*** True Line Result - def render_player -** Processing line: ~ state.player_sprite = [state.player.x,~ +** Processing line: ~ def render_blocks args~ - Inside source: true *** True Line Result - state.player_sprite = [state.player.x, -** Processing line: ~ state.player.y,~ + def render_blocks args +** Processing line: ~ args.state.blocks.each do |block|~ - Inside source: true *** True Line Result - state.player.y, -** Processing line: ~ 4 * 3,~ + args.state.blocks.each do |block| +** Processing line: ~ block.draw args~ - Inside source: true *** True Line Result - 4 * 3, -** Processing line: ~ 8 * 3, "sprites/player-#{animation_index(state.player.created_at_elapsed)}.png"] # string interpolation~ + block.draw args +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8 * 3, "sprites/player-#{animation_index(state.player.created_at_elapsed)}.png"] # string interpolation -** Processing line: ~ outputs.sprites << state.player_sprite~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.sprites << state.player_sprite + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs a small red square that previews the angles that the player can attack in.~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Outputs a small red square that previews the angles that the player can attack in. -** Processing line: ~ # It can be moved in a perfect circle around the player to show possible movements.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # It can be moved in a perfect circle around the player to show possible movements. -** Processing line: ~ # Change the 60 in the parenthesis and see what happens to the movement of the red square.~ + +** Processing line: ~ #Calls all methods necessary for performing calculations~ - Inside source: true *** True Line Result - # Change the 60 in the parenthesis and see what happens to the movement of the red square. -** Processing line: ~ outputs.solids << [state.player.x + state.player.attack_angle.vector_x(60),~ + #Calls all methods necessary for performing calculations +** Processing line: ~ def calc args~ - Inside source: true *** True Line Result - outputs.solids << [state.player.x + state.player.attack_angle.vector_x(60), -** Processing line: ~ state.player.y + state.player.attack_angle.vector_y(60),~ + def calc args +** Processing line: ~ args.state.pegs.each do |peg|~ - Inside source: true *** True Line Result - state.player.y + state.player.attack_angle.vector_y(60), -** Processing line: ~ 3, 3, 255, 0, 0]~ + args.state.pegs.each do |peg| +** Processing line: ~ peg.calc args~ - Inside source: true *** True Line Result - 3, 3, 255, 0, 0] + peg.calc args ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -28019,26 +31320,14 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Renders flash as a solid. The screen turns white for 10 frames when a zombie is killed.~ -- Inside source: true -*** True Line Result - # Renders flash as a solid. The screen turns white for 10 frames when a zombie is killed. -** Processing line: ~ def render_flash~ -- Inside source: true -*** True Line Result - def render_flash -** Processing line: ~ return if state.flash_at.elapsed_time > 10 # return if more than 10 frames have passed since flash.~ -- Inside source: true -*** True Line Result - return if state.flash_at.elapsed_time > 10 # return if more than 10 frames have passed since flash. -** Processing line: ~ # Transparency gradually changes (or eases) during the 10 frames of flash.~ +** Processing line: ~ args.state.blocks.each do |block|~ - Inside source: true *** True Line Result - # Transparency gradually changes (or eases) during the 10 frames of flash. -** Processing line: ~ outputs.primitives << [grid.rect, 255, 255, 255, 255 * state.flash_at.ease(10, :flip)].solid~ + args.state.blocks.each do |block| +** Processing line: ~ block.calc args~ - Inside source: true *** True Line Result - outputs.primitives << [grid.rect, 255, 255, 255, 255 * state.flash_at.ease(10, :flip)].solid + block.calc args ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -28047,174 +31336,154 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Calls all methods necessary for performing calculations.~ +** Processing line: ~ args.state.ball.update args~ - Inside source: true *** True Line Result - # Calls all methods necessary for performing calculations. -** Processing line: ~ def calc~ + args.state.ball.update args +** Processing line: ~ args.state.cannon.update args~ - Inside source: true *** True Line Result - def calc -** Processing line: ~ calc_spawn_zombie~ + args.state.cannon.update args +** Processing line: ~ end~ - Inside source: true *** True Line Result - calc_spawn_zombie -** Processing line: ~ calc_move_zombies~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - calc_move_zombies -** Processing line: ~ calc_player~ + +** Processing line: ~ begin :calc_methods~ - Inside source: true *** True Line Result - calc_player -** Processing line: ~ calc_kill_zombie~ + begin :calc_methods +** Processing line: ~~ - Inside source: true *** True Line Result - calc_kill_zombie -** Processing line: ~ end~ + +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Decreases the zombie spawn countdown by 1 if it has a value greater than 0.~ -- Inside source: true -*** True Line Result - # Decreases the zombie spawn countdown by 1 if it has a value greater than 0. -** Processing line: ~ def calc_spawn_zombie~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - def calc_spawn_zombie -** Processing line: ~ if state.zombie_spawn_countdown > 0~ + def tick args +** Processing line: ~ defaults args~ - Inside source: true *** True Line Result - if state.zombie_spawn_countdown > 0 -** Processing line: ~ state.zombie_spawn_countdown -= 1~ + defaults args +** Processing line: ~ render args~ - Inside source: true *** True Line Result - state.zombie_spawn_countdown -= 1 -** Processing line: ~ return~ + render args +** Processing line: ~ calc args~ - Inside source: true *** True Line Result - return -** Processing line: ~ end~ + calc args +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # New zombies are created, positioned on the screen, and added to the zombies collection.~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - # New zombies are created, positioned on the screen, and added to the zombies collection. -** Processing line: ~ state.zombies << state.new_entity(:zombie) do |z| # each zombie is declared a new entity~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - state.zombies << state.new_entity(:zombie) do |z| # each zombie is declared a new entity -** Processing line: ~ if rand > 0.5~ -- Inside source: true + +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - peg.rb~ +- Header detected. *** True Line Result - if rand > 0.5 -** Processing line: ~ z.x = grid.rect.w.randomize(:ratio) # random x position on screen (within grid scope)~ -- Inside source: true + *** True Line Result - z.x = grid.rect.w.randomize(:ratio) # random x position on screen (within grid scope) -** Processing line: ~ z.y = [-10, 730].sample # y position is set to either -10 or 730 (randomly chosen)~ -- Inside source: true +*** Physics And Collisions - Bouncing On Collision - peg.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - z.y = [-10, 730].sample # y position is set to either -10 or 730 (randomly chosen) -** Processing line: ~ # the possible values exceed the screen's scope so zombies appear to be coming from far away~ + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/peg.rb~ - Inside source: true *** True Line Result - # the possible values exceed the screen's scope so zombies appear to be coming from far away -** Processing line: ~ else~ + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/peg.rb +** Processing line: ~ class Peg~ - Inside source: true *** True Line Result - else -** Processing line: ~ z.x = [-10, 1290].sample # x position is set to either -10 or 1290 (randomly chosen)~ + class Peg +** Processing line: ~ def initialize(x, y, block_size)~ - Inside source: true *** True Line Result - z.x = [-10, 1290].sample # x position is set to either -10 or 1290 (randomly chosen) -** Processing line: ~ z.y = grid.rect.w.randomize(:ratio) # random y position on screen~ + def initialize(x, y, block_size) +** Processing line: ~ @x = x # x cordinate of the LEFT side of the peg~ - Inside source: true *** True Line Result - z.y = grid.rect.w.randomize(:ratio) # random y position on screen -** Processing line: ~ end~ + @x = x # x cordinate of the LEFT side of the peg +** Processing line: ~ @y = y # y cordinate of the RIGHT side of the peg~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + @y = y # y cordinate of the RIGHT side of the peg +** Processing line: ~ @block_size = block_size # diameter of the peg~ - Inside source: true *** True Line Result - end + @block_size = block_size # diameter of the peg ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Calls random_spawn_countdown method (determines how fast new zombies appear)~ -- Inside source: true -*** True Line Result - # Calls random_spawn_countdown method (determines how fast new zombies appear) -** Processing line: ~ state.zombie_spawn_countdown = random_spawn_countdown state.zombie_min_spawn_rate~ +** Processing line: ~ @radius = @block_size/2.0 # radius of the peg~ - Inside source: true *** True Line Result - state.zombie_spawn_countdown = random_spawn_countdown state.zombie_min_spawn_rate -** Processing line: ~ state.zombie_min_spawn_rate -= 1~ + @radius = @block_size/2.0 # radius of the peg +** Processing line: ~ @center = { # cordinatees of the CENTER of the peg~ - Inside source: true *** True Line Result - state.zombie_min_spawn_rate -= 1 -** Processing line: ~ # set to either the current zombie_min_spawn_rate or 0, depending on which value is greater~ + @center = { # cordinatees of the CENTER of the peg +** Processing line: ~ x: @x+@block_size/2.0,~ - Inside source: true *** True Line Result - # set to either the current zombie_min_spawn_rate or 0, depending on which value is greater -** Processing line: ~ state.zombie_min_spawn_rate = state.zombie_min_spawn_rate.greater(0)~ + x: @x+@block_size/2.0, +** Processing line: ~ y: @y+@block_size/2.0~ - Inside source: true *** True Line Result - state.zombie_min_spawn_rate = state.zombie_min_spawn_rate.greater(0) -** Processing line: ~ end~ + y: @y+@block_size/2.0 +** Processing line: ~ }~ - Inside source: true *** True Line Result - end + } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Moves all zombies towards the center of the screen.~ -- Inside source: true -*** True Line Result - # Moves all zombies towards the center of the screen. -** Processing line: ~ # All zombies that reach the center (640, 360) are rejected from the zombies collection and disappear.~ -- Inside source: true -*** True Line Result - # All zombies that reach the center (640, 360) are rejected from the zombies collection and disappear. -** Processing line: ~ def calc_move_zombies~ -- Inside source: true -*** True Line Result - def calc_move_zombies -** Processing line: ~ state.zombies.each do |z| # for each zombie in the collection~ +** Processing line: ~ @r = 255 # color of the peg~ - Inside source: true *** True Line Result - state.zombies.each do |z| # for each zombie in the collection -** Processing line: ~ z.y = z.y.towards(360, 0.1) # move the zombie towards the center (640, 360) at a rate of 0.1~ + @r = 255 # color of the peg +** Processing line: ~ @g = 0~ - Inside source: true *** True Line Result - z.y = z.y.towards(360, 0.1) # move the zombie towards the center (640, 360) at a rate of 0.1 -** Processing line: ~ z.x = z.x.towards(640, 0.1) # change 0.1 to 1.1 and see how much faster the zombies move to the center~ + @g = 0 +** Processing line: ~ @b = 0~ - Inside source: true *** True Line Result - z.x = z.x.towards(640, 0.1) # change 0.1 to 1.1 and see how much faster the zombies move to the center -** Processing line: ~ end~ + @b = 0 +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ state.zombies = state.zombies.reject { |z| z.y == 360 && z.x == 640 } # remove zombies that are in center~ + +** Processing line: ~ @velocity = {x: 2, y: 0}~ - Inside source: true *** True Line Result - state.zombies = state.zombies.reject { |z| z.y == 360 && z.x == 640 } # remove zombies that are in center + @velocity = {x: 2, y: 0} ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -28223,54 +31492,58 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Calculates the position and movement of the player on the screen.~ +** Processing line: ~ def draw args~ - Inside source: true *** True Line Result - # Calculates the position and movement of the player on the screen. -** Processing line: ~ def calc_player~ + def draw args +** Processing line: ~ args.outputs.sprites << [ # draw the peg according to the @x, @y, @radius, and the RGB~ - Inside source: true *** True Line Result - def calc_player -** Processing line: ~ state.player.x += state.player.dx # changes x based on dx (change in x)~ + args.outputs.sprites << [ # draw the peg according to the @x, @y, @radius, and the RGB +** Processing line: ~ @x,~ - Inside source: true *** True Line Result - state.player.x += state.player.dx # changes x based on dx (change in x) -** Processing line: ~ state.player.y += state.player.dy # changes y based on dy (change in y)~ + @x, +** Processing line: ~ @y,~ - Inside source: true *** True Line Result - state.player.y += state.player.dy # changes y based on dy (change in y) -** Processing line: ~~ + @y, +** Processing line: ~ @radius*2.0,~ - Inside source: true *** True Line Result - -** Processing line: ~ state.player.dx *= 0.9 # scales dx down~ + @radius*2.0, +** Processing line: ~ @radius*2.0,~ - Inside source: true *** True Line Result - state.player.dx *= 0.9 # scales dx down -** Processing line: ~ state.player.dy *= 0.9 # scales dy down~ + @radius*2.0, +** Processing line: ~ "sprites/circle-white.png",~ - Inside source: true *** True Line Result - state.player.dy *= 0.9 # scales dy down -** Processing line: ~~ + "sprites/circle-white.png", +** Processing line: ~ 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ # Compares player's x to 1280 to find lesser value, then compares result to 0 to find greater value.~ + 0, +** Processing line: ~ 255,~ - Inside source: true *** True Line Result - # Compares player's x to 1280 to find lesser value, then compares result to 0 to find greater value. -** Processing line: ~ # This ensures that the player remains within the screen's scope.~ + 255, +** Processing line: ~ @r, #r~ - Inside source: true *** True Line Result - # This ensures that the player remains within the screen's scope. -** Processing line: ~ state.player.x = state.player.x.lesser(1280).greater(0)~ + @r, #r +** Processing line: ~ @g, #g~ - Inside source: true *** True Line Result - state.player.x = state.player.x.lesser(1280).greater(0) -** Processing line: ~ state.player.y = state.player.y.lesser(720).greater(0) # same with player's y~ + @g, #g +** Processing line: ~ @b #b~ - Inside source: true *** True Line Result - state.player.y = state.player.y.lesser(720).greater(0) # same with player's y + @b #b +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -28279,98 +31552,98 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Finds all zombies that intersect with the player's sprite. These zombies are removed from the zombies collection~ +** Processing line: ~~ - Inside source: true *** True Line Result - # Finds all zombies that intersect with the player's sprite. These zombies are removed from the zombies collection -** Processing line: ~ # and added to the killed_zombies collection since any zombie that intersects with the player is killed.~ + +** Processing line: ~ def calc args~ - Inside source: true *** True Line Result - # and added to the killed_zombies collection since any zombie that intersects with the player is killed. -** Processing line: ~ def calc_kill_zombie~ + def calc args +** Processing line: ~ if collisionWithBounce? args # if the is a collision with the bouncing ball~ - Inside source: true *** True Line Result - def calc_kill_zombie -** Processing line: ~~ + if collisionWithBounce? args # if the is a collision with the bouncing ball +** Processing line: ~ collide args~ - Inside source: true *** True Line Result - -** Processing line: ~ # Find all zombies that intersect with the player. They are considered killed.~ + collide args +** Processing line: ~ @r = 0~ - Inside source: true *** True Line Result - # Find all zombies that intersect with the player. They are considered killed. -** Processing line: ~ killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite }~ + @r = 0 +** Processing line: ~ @b = 0~ - Inside source: true *** True Line Result - killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite } -** Processing line: ~ state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection~ + @b = 0 +** Processing line: ~ @g = 255~ - Inside source: true *** True Line Result - state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection -** Processing line: ~ state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies~ + @g = 255 +** Processing line: ~ else~ - Inside source: true *** True Line Result - state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies -** Processing line: ~~ + else +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ if killed_this_frame.length > 0 # if atleast one zombie was killed in the frame~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - if killed_this_frame.length > 0 # if atleast one zombie was killed in the frame -** Processing line: ~ state.flash_at = state.tick_count # flash_at set to the frame when the zombie was killed~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.flash_at = state.tick_count # flash_at set to the frame when the zombie was killed -** Processing line: ~ # Don't forget, the rendered flash lasts for 10 frames after the zombie is killed (look at render_flash method)~ + +** Processing line: ~~ - Inside source: true *** True Line Result - # Don't forget, the rendered flash lasts for 10 frames after the zombie is killed (look at render_flash method) -** Processing line: ~ end~ + +** Processing line: ~ # do two circles (the ball and this peg) intersect~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # do two circles (the ball and this peg) intersect +** Processing line: ~ def collisionWithBounce? args~ - Inside source: true *** True Line Result - -** Processing line: ~ # Sets the tick_count (passage of time) as the value of the death_at variable for each killed zombie.~ + def collisionWithBounce? args +** Processing line: ~ squareDistance = ( # the squared distance between the ball's center and this peg's center~ - Inside source: true *** True Line Result - # Sets the tick_count (passage of time) as the value of the death_at variable for each killed zombie. -** Processing line: ~ # Death_at stores the frame a zombie was killed.~ + squareDistance = ( # the squared distance between the ball's center and this peg's center +** Processing line: ~ (args.state.ball.center.x - @center.x) ** 2.0 +~ - Inside source: true *** True Line Result - # Death_at stores the frame a zombie was killed. -** Processing line: ~ killed_this_frame.each do |z|~ + (args.state.ball.center.x - @center.x) ** 2.0 + +** Processing line: ~ (args.state.ball.center.y - @center.y) ** 2.0~ - Inside source: true *** True Line Result - killed_this_frame.each do |z| -** Processing line: ~ z.death_at = state.tick_count~ + (args.state.ball.center.y - @center.y) ** 2.0 +** Processing line: ~ )~ - Inside source: true *** True Line Result - z.death_at = state.tick_count -** Processing line: ~ end~ + ) +** Processing line: ~ radiusSum = ( # the sum of the radius squared of the this peg and the ball~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + radiusSum = ( # the sum of the radius squared of the this peg and the ball +** Processing line: ~ (args.state.ball.radius + @radius) ** 2.0~ - Inside source: true *** True Line Result - -** Processing line: ~ # Zombies are rejected from the killed_zombies collection depending on when they were killed.~ + (args.state.ball.radius + @radius) ** 2.0 +** Processing line: ~ )~ - Inside source: true *** True Line Result - # Zombies are rejected from the killed_zombies collection depending on when they were killed. -** Processing line: ~ # They are rejected if more than 30 frames have passed since their death.~ + ) +** Processing line: ~ # if the squareDistance is less or equal to radiusSum, then there is a radial intersection between the ball and this peg~ - Inside source: true *** True Line Result - # They are rejected if more than 30 frames have passed since their death. -** Processing line: ~ state.killed_zombies = state.killed_zombies.reject { |z| state.tick_count - z.death_at > 30 }~ + # if the squareDistance is less or equal to radiusSum, then there is a radial intersection between the ball and this peg +** Processing line: ~ return (squareDistance <= radiusSum)~ - Inside source: true *** True Line Result - state.killed_zombies = state.killed_zombies.reject { |z| state.tick_count - z.death_at > 30 } + return (squareDistance <= radiusSum) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -28379,42 +31652,42 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Uses input from the user to move the player around the screen.~ +** Processing line: ~ # ! The following links explain the getRepelMagnitude function !~ - Inside source: true *** True Line Result - # Uses input from the user to move the player around the screen. -** Processing line: ~ def input~ + # ! The following links explain the getRepelMagnitude function ! +** Processing line: ~ # https://raw.githubusercontent.com/DragonRuby/dragonruby-game-toolkit-physics/master/docs/docImages/LinearCollider_4.png~ - Inside source: true *** True Line Result - def input -** Processing line: ~~ + # https://raw.githubusercontent.com/DragonRuby/dragonruby-game-toolkit-physics/master/docs/docImages/LinearCollider_4.png +** Processing line: ~ # https://raw.githubusercontent.com/DragonRuby/dragonruby-game-toolkit-physics/master/docs/docImages/LinearCollider_5.png~ - Inside source: true *** True Line Result - -** Processing line: ~ # If the "a" key or left key is pressed, the x position of the player decreases.~ + # https://raw.githubusercontent.com/DragonRuby/dragonruby-game-toolkit-physics/master/docs/docImages/LinearCollider_5.png +** Processing line: ~ # https://github.com/DragonRuby/dragonruby-game-toolkit-physics/blob/master/docs/LinearCollider.md~ - Inside source: true *** True Line Result - # If the "a" key or left key is pressed, the x position of the player decreases. -** Processing line: ~ # Otherwise, if the "d" key or right key is pressed, the x position of the player increases.~ + # https://github.com/DragonRuby/dragonruby-game-toolkit-physics/blob/master/docs/LinearCollider.md +** Processing line: ~ def getRepelMagnitude (args, fbx, fby, vrx, vry, ballMag)~ - Inside source: true *** True Line Result - # Otherwise, if the "d" key or right key is pressed, the x position of the player increases. -** Processing line: ~ if inputs.keyboard.key_held.a || inputs.keyboard.key_held.left~ + def getRepelMagnitude (args, fbx, fby, vrx, vry, ballMag) +** Processing line: ~ a = fbx ; b = vrx ; c = fby~ - Inside source: true *** True Line Result - if inputs.keyboard.key_held.a || inputs.keyboard.key_held.left -** Processing line: ~ state.player.x -= 5~ + a = fbx ; b = vrx ; c = fby +** Processing line: ~ d = vry ; e = ballMag~ - Inside source: true *** True Line Result - state.player.x -= 5 -** Processing line: ~ elsif inputs.keyboard.key_held.d || inputs.keyboard.key_held.right~ + d = vry ; e = ballMag +** Processing line: ~ if b**2 + d**2 == 0~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_held.d || inputs.keyboard.key_held.right -** Processing line: ~ state.player.x += 5~ + if b**2 + d**2 == 0 +** Processing line: ~ #unexpected~ - Inside source: true *** True Line Result - state.player.x += 5 + #unexpected ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -28423,58 +31696,62 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # If the "w" or up key is pressed, the y position of the player increases.~ +** Processing line: ~ x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)~ - Inside source: true *** True Line Result - # If the "w" or up key is pressed, the y position of the player increases. -** Processing line: ~ # Otherwise, if the "s" or down key is pressed, the y position of the player decreases.~ + x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2) +** Processing line: ~ x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2))~ - Inside source: true *** True Line Result - # Otherwise, if the "s" or down key is pressed, the y position of the player decreases. -** Processing line: ~ if inputs.keyboard.key_held.w || inputs.keyboard.key_held.up~ + x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)) +** Processing line: ~~ - Inside source: true *** True Line Result - if inputs.keyboard.key_held.w || inputs.keyboard.key_held.up -** Processing line: ~ state.player.y += 5~ + +** Processing line: ~ err = 0.00001~ - Inside source: true *** True Line Result - state.player.y += 5 -** Processing line: ~ elsif inputs.keyboard.key_held.s || inputs.keyboard.key_held.down~ + err = 0.00001 +** Processing line: ~ o = ((fbx + x1*vrx)**2 + (fby + x1*vry)**2 ) ** 0.5~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_held.s || inputs.keyboard.key_held.down -** Processing line: ~ state.player.y -= 5~ + o = ((fbx + x1*vrx)**2 + (fby + x1*vry)**2 ) ** 0.5 +** Processing line: ~ p = ((fbx + x2*vrx)**2 + (fby + x2*vry)**2 ) ** 0.5~ - Inside source: true *** True Line Result - state.player.y -= 5 -** Processing line: ~ end~ + p = ((fbx + x2*vrx)**2 + (fby + x2*vry)**2 ) ** 0.5 +** Processing line: ~ r = 0~ - Inside source: true *** True Line Result - end + r = 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets the attack angle so the player can move and attack in the precise direction it wants to go.~ +** Processing line: ~ if (ballMag >= o-err and ballMag <= o+err)~ - Inside source: true *** True Line Result - # Sets the attack angle so the player can move and attack in the precise direction it wants to go. -** Processing line: ~ # If the mouse is moved, the attack angle is changed (based on the player's position and mouse position).~ + if (ballMag >= o-err and ballMag <= o+err) +** Processing line: ~ r = x1~ - Inside source: true *** True Line Result - # If the mouse is moved, the attack angle is changed (based on the player's position and mouse position). -** Processing line: ~ # Attack angle also contributes to the position of red square.~ + r = x1 +** Processing line: ~ elsif (ballMag >= p-err and ballMag <= p+err)~ - Inside source: true *** True Line Result - # Attack angle also contributes to the position of red square. -** Processing line: ~ if inputs.mouse.moved~ + elsif (ballMag >= p-err and ballMag <= p+err) +** Processing line: ~ r = x2~ - Inside source: true *** True Line Result - if inputs.mouse.moved -** Processing line: ~ state.player.attack_angle = inputs.mouse.position.angle_from [state.player.x, state.player.y]~ + r = x2 +** Processing line: ~ else~ - Inside source: true *** True Line Result - state.player.attack_angle = inputs.mouse.position.angle_from [state.player.x, state.player.y] + else +** Processing line: ~ #unexpected~ +- Inside source: true +*** True Line Result + #unexpected ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -28483,30 +31760,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ if inputs.mouse.click && state.player.dx < 0.5 && state.player.dy < 0.5~ +** Processing line: ~ if (args.state.ball.center.x > @center.x)~ - Inside source: true *** True Line Result - if inputs.mouse.click && state.player.dx < 0.5 && state.player.dy < 0.5 -** Processing line: ~ state.player.attack_angle_on_click = inputs.mouse.position.angle_from [state.player.x, state.player.y]~ + if (args.state.ball.center.x > @center.x) +** Processing line: ~ return x2*-1~ - Inside source: true *** True Line Result - state.player.attack_angle_on_click = inputs.mouse.position.angle_from [state.player.x, state.player.y] -** Processing line: ~ state.player.attack_angle = state.player.attack_angle_on_click # player's attack angle is set~ + return x2*-1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.player.attack_angle = state.player.attack_angle_on_click # player's attack angle is set -** Processing line: ~ state.player.dx = state.player.attack_angle.vector_x(25) # change in player's position~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.player.dx = state.player.attack_angle.vector_x(25) # change in player's position -** Processing line: ~ state.player.dy = state.player.attack_angle.vector_y(25)~ + +** Processing line: ~ return x2~ - Inside source: true *** True Line Result - state.player.dy = state.player.attack_angle.vector_y(25) -** Processing line: ~ end~ + return x2 +** Processing line: ~~ - Inside source: true *** True Line Result - end + +** Processing line: ~ #return r~ +- Inside source: true +*** True Line Result + #return r ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -28515,650 +31796,706 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Sets the zombie spawn's countdown to a random number.~ +** Processing line: ~ #this sets the new velocity of the ball once it has collided with this peg~ - Inside source: true *** True Line Result - # Sets the zombie spawn's countdown to a random number. -** Processing line: ~ # How fast zombies appear (change the 60 to 6 and too many zombies will appear at once!)~ + #this sets the new velocity of the ball once it has collided with this peg +** Processing line: ~ def collide args~ - Inside source: true *** True Line Result - # How fast zombies appear (change the 60 to 6 and too many zombies will appear at once!) -** Processing line: ~ def random_spawn_countdown minimum~ + def collide args +** Processing line: ~ normalOfRCCollision = [ #this is the normal of the collision in COMPONENT FORM~ - Inside source: true *** True Line Result - def random_spawn_countdown minimum -** Processing line: ~ 10.randomize(:ratio, :sign).to_i + 60~ + normalOfRCCollision = [ #this is the normal of the collision in COMPONENT FORM +** Processing line: ~ {x: @center.x, y: @center.y}, #see https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.mathscard.co.uk%2Fonline%2Fcircle-coordinate-geometry%2F&psig=AOvVaw2GcD-e2-nJR_IUKpw3hO98&ust=1605731315521000&source=images&cd=vfe&ved=0CAIQjRxqFwoTCMjBo7e1iu0CFQAAAAAdAAAAABAD~ - Inside source: true *** True Line Result - 10.randomize(:ratio, :sign).to_i + 60 -** Processing line: ~ end~ + {x: @center.x, y: @center.y}, #see https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.mathscard.co.uk%2Fonline%2Fcircle-coordinate-geometry%2F&psig=AOvVaw2GcD-e2-nJR_IUKpw3hO98&ust=1605731315521000&source=images&cd=vfe&ved=0CAIQjRxqFwoTCMjBo7e1iu0CFQAAAAAdAAAAABAD +** Processing line: ~ {x: args.state.ball.center.x, y: args.state.ball.center.y},~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + {x: args.state.ball.center.x, y: args.state.ball.center.y}, +** Processing line: ~ ]~ - Inside source: true *** True Line Result - -** Processing line: ~ # Helps to iterate through the images in the sprites folder by setting the animation index.~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - # Helps to iterate through the images in the sprites folder by setting the animation index. -** Processing line: ~ # 3 frames is how long to show an image, and 6 is how many images to flip through.~ + +** Processing line: ~ normalSlope = ( #normalSlope is the slope of normalOfRCCollision~ - Inside source: true *** True Line Result - # 3 frames is how long to show an image, and 6 is how many images to flip through. -** Processing line: ~ def animation_index at~ + normalSlope = ( #normalSlope is the slope of normalOfRCCollision +** Processing line: ~ (normalOfRCCollision[1].y - normalOfRCCollision[0].y) /~ - Inside source: true *** True Line Result - def animation_index at -** Processing line: ~ at.idiv(3).mod(6)~ + (normalOfRCCollision[1].y - normalOfRCCollision[0].y) / +** Processing line: ~ (normalOfRCCollision[1].x - normalOfRCCollision[0].x)~ - Inside source: true *** True Line Result - at.idiv(3).mod(6) -** Processing line: ~ end~ + (normalOfRCCollision[1].x - normalOfRCCollision[0].x) +** Processing line: ~ )~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + ) +** Processing line: ~ slope = normalSlope**-1.0 * -1 # slope is the slope of the tangent~ - Inside source: true *** True Line Result - -** Processing line: ~ # Animates the zombies by using the animation index to go through the images in the sprites folder.~ + slope = normalSlope**-1.0 * -1 # slope is the slope of the tangent +** Processing line: ~ # args.state.display_value = slope~ - Inside source: true *** True Line Result - # Animates the zombies by using the animation index to go through the images in the sprites folder. -** Processing line: ~ def animation_sprite zombie, at = nil~ + # args.state.display_value = slope +** Processing line: ~ pointA = { # pointA and pointB are using the var slope to tangent in COMPONENT FORM~ - Inside source: true *** True Line Result - def animation_sprite zombie, at = nil -** Processing line: ~ at ||= zombie.created_at_elapsed # how long it is has been since a zombie was created~ + pointA = { # pointA and pointB are using the var slope to tangent in COMPONENT FORM +** Processing line: ~ x: args.state.ball.center.x-1,~ - Inside source: true *** True Line Result - at ||= zombie.created_at_elapsed # how long it is has been since a zombie was created -** Processing line: ~ index = animation_index at~ + x: args.state.ball.center.x-1, +** Processing line: ~ y: -(slope-args.state.ball.center.y)~ - Inside source: true *** True Line Result - index = animation_index at -** Processing line: ~ "sprites/zombie-#{index}.png" # string interpolation to iterate through images~ + y: -(slope-args.state.ball.center.y) +** Processing line: ~ }~ - Inside source: true *** True Line Result - "sprites/zombie-#{index}.png" # string interpolation to iterate through images -** Processing line: ~ end~ + } +** Processing line: ~ pointB = {~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + pointB = { +** Processing line: ~ x: args.state.ball.center.x+1,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x: args.state.ball.center.x+1, +** Processing line: ~ y: slope+args.state.ball.center.y~ - Inside source: true *** True Line Result - -** Processing line: ~ $protect_the_puppies_from_the_zombies = ProtectThePuppiesFromTheZombies.new~ + y: slope+args.state.ball.center.y +** Processing line: ~ }~ - Inside source: true *** True Line Result - $protect_the_puppies_from_the_zombies = ProtectThePuppiesFromTheZombies.new + } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ perpVect = {x: pointB.x - pointA.x, y:pointB.y - pointA.y} # perpVect is to be VECTOR of the perpendicular tangent~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ $protect_the_puppies_from_the_zombies.grid = args.grid~ + perpVect = {x: pointB.x - pointA.x, y:pointB.y - pointA.y} # perpVect is to be VECTOR of the perpendicular tangent +** Processing line: ~ mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magniude of the perpVect~ - Inside source: true *** True Line Result - $protect_the_puppies_from_the_zombies.grid = args.grid -** Processing line: ~ $protect_the_puppies_from_the_zombies.inputs = args.inputs~ + mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magniude of the perpVect +** Processing line: ~ perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magniude to make it a unit vector~ - Inside source: true *** True Line Result - $protect_the_puppies_from_the_zombies.inputs = args.inputs -** Processing line: ~ $protect_the_puppies_from_the_zombies.state = args.state~ + perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magniude to make it a unit vector +** Processing line: ~ perpVect = {x: -perpVect.y, y: perpVect.x} # swap the x and y and multiply by -1 to make the vector perpendicular~ - Inside source: true *** True Line Result - $protect_the_puppies_from_the_zombies.state = args.state -** Processing line: ~ $protect_the_puppies_from_the_zombies.outputs = args.outputs~ + perpVect = {x: -perpVect.y, y: perpVect.x} # swap the x and y and multiply by -1 to make the vector perpendicular +** Processing line: ~ args.state.display_value = perpVect~ - Inside source: true *** True Line Result - $protect_the_puppies_from_the_zombies.outputs = args.outputs -** Processing line: ~ $protect_the_puppies_from_the_zombies.tick~ + args.state.display_value = perpVect +** Processing line: ~ if perpVect.y > 0 #ensure perpVect points upward~ - Inside source: true *** True Line Result - $protect_the_puppies_from_the_zombies.tick -** Processing line: ~ tick_instructions args, "How to get the mouse position and translate it to an x, y position using .vector_x and .vector_y. CLICK to play."~ + if perpVect.y > 0 #ensure perpVect points upward +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ - Inside source: true *** True Line Result - tick_instructions args, "How to get the mouse position and translate it to an x, y position using .vector_x and .vector_y. CLICK to play." -** Processing line: ~ end~ + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick_instructions args, text, y = 715~ +** Processing line: ~ previousPosition = { # calculate an ESTIMATE of the previousPosition of the ball~ - Inside source: true *** True Line Result - def tick_instructions args, text, y = 715 -** Processing line: ~ return if args.state.key_event_occurred~ + previousPosition = { # calculate an ESTIMATE of the previousPosition of the ball +** Processing line: ~ x:args.state.ball.center.x-args.state.ball.velocity.x,~ - Inside source: true *** True Line Result - return if args.state.key_event_occurred -** Processing line: ~ if args.inputs.mouse.click ||~ + x:args.state.ball.center.x-args.state.ball.velocity.x, +** Processing line: ~ y:args.state.ball.center.y-args.state.ball.velocity.y~ - Inside source: true *** True Line Result - if args.inputs.mouse.click || -** Processing line: ~ args.inputs.keyboard.directional_vector ||~ + y:args.state.ball.center.y-args.state.ball.velocity.y +** Processing line: ~ }~ - Inside source: true *** True Line Result - args.inputs.keyboard.directional_vector || -** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ + } +** Processing line: ~~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.enter || -** Processing line: ~ args.inputs.keyboard.key_down.escape~ + +** Processing line: ~ yInterc = pointA.y + -slope*pointA.x~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.escape -** Processing line: ~ args.state.key_event_occurred = true~ + yInterc = pointA.y + -slope*pointA.x +** Processing line: ~ if slope == INFINITY # the perpVect presently either points in the correct dirrection or it is 180 degrees off we need to correct this~ - Inside source: true *** True Line Result - args.state.key_event_occurred = true -** Processing line: ~ end~ + if slope == INFINITY # the perpVect presently either points in the correct dirrection or it is 180 degrees off we need to correct this +** Processing line: ~ if previousPosition.x < pointA.x~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if previousPosition.x < pointA.x +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} +** Processing line: ~ yInterc = -INFINITY~ - 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~ + yInterc = -INFINITY +** Processing line: ~ end~ - 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~ + end +** Processing line: ~ elsif previousPosition.y < slope*previousPosition.x + yInterc # check if ball is bellow or above the collider to determine if perpVect is - or +~ - 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~ + elsif previousPosition.y < slope*previousPosition.x + yInterc # check if ball is bellow or above the collider to determine if perpVect is - or + +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} +** Processing line: ~ end~ - 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 + end ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Mouse - Mouse Move Paint App - main.rb~ -- Header detected. +** Processing line: ~ velocityMag = # the current velocity magnitude of the ball~ +- Inside source: true *** True Line Result - + velocityMag = # the current velocity magnitude of the ball +** Processing line: ~ (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5~ +- Inside source: true *** True Line Result -* Mouse - Mouse Move Paint App - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5 +** Processing line: ~ theta_ball=~ +- Inside source: true *** True Line Result - + theta_ball= +** Processing line: ~ Math.atan2(args.state.ball.velocity.y,args.state.ball.velocity.x) #the angle of the ball's velocity~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/05_mouse/03_mouse_move_paint_app/app/main.rb~ + Math.atan2(args.state.ball.velocity.y,args.state.ball.velocity.x) #the angle of the ball's velocity +** Processing line: ~ theta_repel=~ - Inside source: true *** True Line Result - # ./samples/05_mouse/03_mouse_move_paint_app/app/main.rb -** Processing line: ~ =begin~ + theta_repel= +** Processing line: ~ Math.atan2(args.state.ball.center.y,args.state.ball.center.x) #the angle of the repelling force(perpVect)~ - Inside source: true *** True Line Result - =begin + Math.atan2(args.state.ball.center.y,args.state.ball.center.x) #the angle of the repelling force(perpVect) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~ fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity~ - Inside source: true *** True Line Result - APIs listing that haven't been encountered in previous sample apps: -** Processing line: ~~ + fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity +** Processing line: ~ fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity~ - Inside source: true *** True Line Result - -** Processing line: ~ - Floor: Method that returns an integer number smaller than or equal to the original with no decimal.~ + fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity +** Processing line: ~ repelMag = getRepelMagnitude( # the magniude of the collision vector~ - Inside source: true *** True Line Result - - Floor: Method that returns an integer number smaller than or equal to the original with no decimal. -** Processing line: ~~ + repelMag = getRepelMagnitude( # the magniude of the collision vector +** Processing line: ~ args,~ - Inside source: true *** True Line Result - -** Processing line: ~ For example, if we have a variable, a = 13.7, and we called floor on it, it would look like this...~ + args, +** Processing line: ~ fbx,~ - Inside source: true *** True Line Result - For example, if we have a variable, a = 13.7, and we called floor on it, it would look like this... -** Processing line: ~ puts a.floor()~ + fbx, +** Processing line: ~ fby,~ - Inside source: true *** True Line Result - puts a.floor() -** Processing line: ~ which would print out 13.~ + fby, +** Processing line: ~ perpVect.x,~ - Inside source: true *** True Line Result - which would print out 13. -** Processing line: ~ (There is also a ceil method, which returns an integer number greater than or equal to the original~ + perpVect.x, +** Processing line: ~ perpVect.y,~ - Inside source: true *** True Line Result - (There is also a ceil method, which returns an integer number greater than or equal to the original -** Processing line: ~ with no decimal. If we had called ceil on the variable a, the result would have been 14.)~ + perpVect.y, +** Processing line: ~ (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5~ - Inside source: true *** True Line Result - with no decimal. If we had called ceil on the variable a, the result would have been 14.) -** Processing line: ~~ + (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5 +** Processing line: ~ )~ - Inside source: true *** True Line Result - -** Processing line: ~ Reminders:~ + ) +** Processing line: ~ frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx~ - Inside source: true *** True Line Result - Reminders: + frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx +** Processing line: ~ fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby~ +- Inside source: true +*** True Line Result + fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ +** Processing line: ~ fsumx = fbx+frx # sum of x forces~ - Inside source: true *** True Line Result - - Hashes: Collection of unique keys and their corresponding values. The value can be found -** Processing line: ~ using their keys.~ + fsumx = fbx+frx # sum of x forces +** Processing line: ~ fsumy = fby+fry # sum of y forces~ - Inside source: true *** True Line Result - using their keys. -** Processing line: ~~ + fsumy = fby+fry # sum of y forces +** Processing line: ~ fr = velocityMag # fr is the resulting magnitude~ - Inside source: true *** True Line Result - -** Processing line: ~ For example, if we have a "numbers" hash that stores numbers in English as the~ + fr = velocityMag # fr is the resulting magnitude +** Processing line: ~ thetaNew = Math.atan2(fsumy, fsumx) # thetaNew is the resulting angle~ - Inside source: true *** True Line Result - For example, if we have a "numbers" hash that stores numbers in English as the -** Processing line: ~ key and numbers in Spanish as the value, we'd have a hash that looks like this...~ + thetaNew = Math.atan2(fsumy, fsumx) # thetaNew is the resulting angle +** Processing line: ~ xnew = fr*Math.cos(thetaNew) # resulting x velocity~ - Inside source: true *** True Line Result - key and numbers in Spanish as the value, we'd have a hash that looks like this... -** Processing line: ~ numbers = { "one" => "uno", "two" => "dos", "three" => "tres" }~ + xnew = fr*Math.cos(thetaNew) # resulting x velocity +** Processing line: ~ ynew = fr*Math.sin(thetaNew) # resulting y velocity~ - Inside source: true *** True Line Result - numbers = { "one" => "uno", "two" => "dos", "three" => "tres" } -** Processing line: ~ and on it goes.~ + ynew = fr*Math.sin(thetaNew) # resulting y velocity +** Processing line: ~ if (args.state.ball.center.x >= @center.x) # this is necessary for the ball colliding on the right side of the peg~ - Inside source: true *** True Line Result - and on it goes. + if (args.state.ball.center.x >= @center.x) # this is necessary for the ball colliding on the right side of the peg +** Processing line: ~ xnew=xnew.abs~ +- Inside source: true +*** True Line Result + xnew=xnew.abs +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Now if we wanted to find the corresponding value of the "one" key, we could say~ +** Processing line: ~ args.state.ball.velocity.x = xnew # set the x-velocity to the new velocity~ - Inside source: true *** True Line Result - Now if we wanted to find the corresponding value of the "one" key, we could say -** Processing line: ~ puts numbers["one"]~ + args.state.ball.velocity.x = xnew # set the x-velocity to the new velocity +** Processing line: ~ if args.state.ball.center.y > @center.y # if the ball is above the middle of the peg we need to temporarily ignore some of the gravity~ - Inside source: true *** True Line Result - puts numbers["one"] -** Processing line: ~ which would print "uno" to the console.~ + if args.state.ball.center.y > @center.y # if the ball is above the middle of the peg we need to temporarily ignore some of the gravity +** Processing line: ~ args.state.ball.velocity.y = ynew + GRAVITY * 0.01~ - Inside source: true *** True Line Result - which would print "uno" to the console. + args.state.ball.velocity.y = ynew + GRAVITY * 0.01 +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ args.state.ball.velocity.y = ynew - GRAVITY * 0.01 # if the ball is bellow the middle of the peg we need to temporarily increase the power of the gravity~ +- Inside source: true +*** True Line Result + args.state.ball.velocity.y = ynew - GRAVITY * 0.01 # if the ball is bellow the middle of the peg we need to temporarily increase the power of the gravity +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ +** Processing line: ~ args.state.ball.center.x+= args.state.ball.velocity.x # update the position of the ball so it never looks like the ball is intersecting the circle~ - Inside source: true *** True Line Result - - args.state.new_entity: Used when we want to create a new object, like a sprite or button. -** Processing line: ~ In this sample app, new_entity is used to create a new button that clears the grid.~ + args.state.ball.center.x+= args.state.ball.velocity.x # update the position of the ball so it never looks like the ball is intersecting the circle +** Processing line: ~ args.state.ball.center.y+= args.state.ball.velocity.y~ - Inside source: true *** True Line Result - In this sample app, new_entity is used to create a new button that clears the grid. -** Processing line: ~ (Remember, you can use state to define ANY property and it will be retained across frames.)~ + args.state.ball.center.y+= args.state.ball.velocity.y +** Processing line: ~ end~ - Inside source: true *** True Line Result - (Remember, you can use state to define ANY property and it will be retained across frames.) + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse. +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in.~ -- Inside source: true +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - vector2d.rb~ +- Header detected. *** True Line Result - - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in. -** Processing line: ~~ -- Inside source: true + +*** True Line Result +*** Physics And Collisions - Bouncing On Collision - vector2d.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ - args.outputs.labels: An array. The values in the array generate a label.~ +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/vector2d.rb~ - Inside source: true *** True Line Result - - args.outputs.labels: An array. The values in the array generate a label. -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ + # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/vector2d.rb +** Processing line: ~ class Vector2d~ - Inside source: true *** True Line Result - The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ + class Vector2d +** Processing line: ~ attr_accessor :x, :y~ - Inside source: true *** True Line Result - For more information about labels, go to mygame/documentation/02-labels.md. + attr_accessor :x, :y ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect.~ +** Processing line: ~ def initialize x=0, y=0~ - Inside source: true *** True Line Result - - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect. -** Processing line: ~~ + def initialize x=0, y=0 +** Processing line: ~ @x=x~ - Inside source: true *** True Line Result - -** Processing line: ~ =end~ + @x=x +** Processing line: ~ @y=y~ - Inside source: true *** True Line Result - =end -** Processing line: ~~ + @y=y +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # This sample app shows an empty grid that the user can paint on.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # This sample app shows an empty grid that the user can paint on. -** Processing line: ~ # To paint, the user must keep their mouse presssed and drag it around the grid.~ + +** Processing line: ~ #returns a vector multiplied by scalar x~ - Inside source: true *** True Line Result - # To paint, the user must keep their mouse presssed and drag it around the grid. -** Processing line: ~ # The "clear" button allows users to clear the grid so they can start over.~ + #returns a vector multiplied by scalar x +** Processing line: ~ #x [float] scalar~ - Inside source: true *** True Line Result - # The "clear" button allows users to clear the grid so they can start over. -** Processing line: ~~ + #x [float] scalar +** Processing line: ~ def mult x~ - Inside source: true *** True Line Result - -** Processing line: ~ class PaintApp~ + def mult x +** Processing line: ~ r = Vector2d.new(0,0)~ - Inside source: true *** True Line Result - class PaintApp -** Processing line: ~ attr_accessor :inputs, :state, :outputs, :grid, :args~ + r = Vector2d.new(0,0) +** Processing line: ~ r.x=@x*x~ - Inside source: true *** True Line Result - attr_accessor :inputs, :state, :outputs, :grid, :args -** Processing line: ~~ + r.x=@x*x +** Processing line: ~ r.y=@y*x~ - Inside source: true *** True Line Result - -** Processing line: ~ # Runs methods necessary for the game to function properly.~ + r.y=@y*x +** Processing line: ~ r~ - Inside source: true *** True Line Result - # Runs methods necessary for the game to function properly. -** Processing line: ~ def tick~ + r +** Processing line: ~ end~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ print_title~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - print_title -** Processing line: ~ add_grid~ + +** Processing line: ~ # vect [Vector2d] vector to copy~ - Inside source: true *** True Line Result - add_grid -** Processing line: ~ check_click~ + # vect [Vector2d] vector to copy +** Processing line: ~ def copy vect~ - Inside source: true *** True Line Result - check_click -** Processing line: ~ draw_buttons~ + def copy vect +** Processing line: ~ Vector2d.new(@x, @y)~ - Inside source: true *** True Line Result - draw_buttons -** Processing line: ~ end~ + Vector2d.new(@x, @y) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Prints the title onto the screen by using a label.~ -- Inside source: true -*** True Line Result - # Prints the title onto the screen by using a label. -** Processing line: ~ # Also separates the title from the grid with a line as a horizontal separator.~ +** Processing line: ~ #returns a new vector equivalent to this+vect~ - Inside source: true *** True Line Result - # Also separates the title from the grid with a line as a horizontal separator. -** Processing line: ~ def print_title~ + #returns a new vector equivalent to this+vect +** Processing line: ~ #vect [Vector2d] vector to add to self~ - Inside source: true *** True Line Result - def print_title -** Processing line: ~ args.outputs.labels << [ 640, 700, 'Paint!', 0, 1 ]~ + #vect [Vector2d] vector to add to self +** Processing line: ~ def add vect~ - Inside source: true *** True Line Result - args.outputs.labels << [ 640, 700, 'Paint!', 0, 1 ] -** Processing line: ~ outputs.lines << horizontal_separator(660, 0, 1280)~ + def add vect +** Processing line: ~ Vector2d.new(@x+vect.x,@y+vect.y)~ - Inside source: true *** True Line Result - outputs.lines << horizontal_separator(660, 0, 1280) -** Processing line: ~ end~ + Vector2d.new(@x+vect.x,@y+vect.y) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets the starting position, ending position, and color for the horizontal separator.~ +** Processing line: ~ #returns a new vector equivalent to this-vect~ - Inside source: true *** True Line Result - # Sets the starting position, ending position, and color for the horizontal separator. -** Processing line: ~ # The starting and ending positions have the same y values.~ + #returns a new vector equivalent to this-vect +** Processing line: ~ #vect [Vector2d] vector to subtract to self~ - Inside source: true *** True Line Result - # The starting and ending positions have the same y values. -** Processing line: ~ def horizontal_separator y, x, x2~ + #vect [Vector2d] vector to subtract to self +** Processing line: ~ def sub vect~ - Inside source: true *** True Line Result - def horizontal_separator y, x, x2 -** Processing line: ~ [x, y, x2, y, 150, 150, 150]~ + def sub vect +** Processing line: ~ Vector2d.new(@x-vect.c, @y-vect.y)~ - Inside source: true *** True Line Result - [x, y, x2, y, 150, 150, 150] -** Processing line: ~ end~ + Vector2d.new(@x-vect.c, @y-vect.y) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets the starting position, ending position, and color for the vertical separator.~ -- Inside source: true -*** True Line Result - # Sets the starting position, ending position, and color for the vertical separator. -** Processing line: ~ # The starting and ending positions have the same x values.~ +** Processing line: ~ #return the magnitude of the vector~ - Inside source: true *** True Line Result - # The starting and ending positions have the same x values. -** Processing line: ~ def vertical_separator x, y, y2~ + #return the magnitude of the vector +** Processing line: ~ def mag~ - Inside source: true *** True Line Result - def vertical_separator x, y, y2 -** Processing line: ~ [x, y, x, y2, 150, 150, 150]~ + def mag +** Processing line: ~ ((@x**2)+(@y**2))**0.5~ - Inside source: true *** True Line Result - [x, y, x, y2, 150, 150, 150] -** Processing line: ~ end~ + ((@x**2)+(@y**2))**0.5 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs a border and a grid containing empty squares onto the screen.~ +** Processing line: ~ #returns a new normalize version of the vector~ - Inside source: true *** True Line Result - # Outputs a border and a grid containing empty squares onto the screen. -** Processing line: ~ def add_grid~ + #returns a new normalize version of the vector +** Processing line: ~ def normalize~ - Inside source: true *** True Line Result - def add_grid + def normalize +** Processing line: ~ Vector2d.new(@x/mag, @y/mag)~ +- Inside source: true +*** True Line Result + Vector2d.new(@x/mag, @y/mag) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets the x, y, height, and width of the grid.~ +** Processing line: ~ #TODO delet?~ - Inside source: true *** True Line Result - # Sets the x, y, height, and width of the grid. -** Processing line: ~ # There are 31 horizontal lines and 31 vertical lines in the grid.~ + #TODO delet? +** Processing line: ~ def distABS vect~ - Inside source: true *** True Line Result - # There are 31 horizontal lines and 31 vertical lines in the grid. -** Processing line: ~ # Feel free to count them yourself before continuing!~ + def distABS vect +** Processing line: ~ (((vect.x-@x)**2+(vect.y-@y)**2)**0.5).abs()~ - Inside source: true *** True Line Result - # Feel free to count them yourself before continuing! -** Processing line: ~ x, y, h, w = 640 - 500/2, 640 - 500, 500, 500 # calculations done so the grid appears in screen's center~ + (((vect.x-@x)**2+(vect.y-@y)**2)**0.5).abs() +** Processing line: ~ end~ - Inside source: true *** True Line Result - x, y, h, w = 640 - 500/2, 640 - 500, 500, 500 # calculations done so the grid appears in screen's center -** Processing line: ~ lines_h = 31~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - lines_h = 31 -** Processing line: ~ lines_v = 31~ -- Inside source: true + end +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - lines_v = 31 +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ # Sets values for the grid's border, grid lines, and filled squares.~ +** Processing line: ~*** Physics And Collisions - Arbitrary Collision - ball.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Physics And Collisions - Arbitrary Collision - ball.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/04_physics_and_collisions/09_arbitrary_collision/app/ball.rb~ - Inside source: true *** True Line Result - # Sets values for the grid's border, grid lines, and filled squares. -** Processing line: ~ # The filled_squares variable is initially set to an empty array.~ + # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/ball.rb +** Processing line: ~~ - Inside source: true *** True Line Result - # The filled_squares variable is initially set to an empty array. -** Processing line: ~ state.grid_border ||= [ x, y, h, w ] # definition of grid's outer border~ + +** Processing line: ~ class Ball~ - Inside source: true *** True Line Result - state.grid_border ||= [ x, y, h, w ] # definition of grid's outer border -** Processing line: ~ state.grid_lines ||= draw_grid(x, y, h, w, lines_h, lines_v) # calls draw_grid method~ + class Ball +** Processing line: ~ attr_accessor :velocity, :child, :parent, :number, :leastChain~ - Inside source: true *** True Line Result - state.grid_lines ||= draw_grid(x, y, h, w, lines_h, lines_v) # calls draw_grid method -** Processing line: ~ state.filled_squares ||= [] # there are no filled squares until the user fills them in~ + attr_accessor :velocity, :child, :parent, :number, :leastChain +** Processing line: ~ attr_reader :x, :y, :hypotenuse, :width, :height~ - Inside source: true *** True Line Result - state.filled_squares ||= [] # there are no filled squares until the user fills them in + attr_reader :x, :y, :hypotenuse, :width, :height ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs the grid lines, border, and filled squares onto the screen.~ +** Processing line: ~ def initialize args, number, leastChain, parent, child~ - Inside source: true *** True Line Result - # Outputs the grid lines, border, and filled squares onto the screen. -** Processing line: ~ outputs.lines.concat state.grid_lines~ + def initialize args, number, leastChain, parent, child +** Processing line: ~ #Start the ball in the top center~ - Inside source: true *** True Line Result - outputs.lines.concat state.grid_lines -** Processing line: ~ outputs.borders << state.grid_border~ + #Start the ball in the top center +** Processing line: ~ @number = number~ - Inside source: true *** True Line Result - outputs.borders << state.grid_border -** Processing line: ~ outputs.solids << state.filled_squares~ + @number = number +** Processing line: ~ @leastChain = leastChain~ - Inside source: true *** True Line Result - outputs.solids << state.filled_squares -** Processing line: ~ end~ + @leastChain = leastChain +** Processing line: ~ @x = args.grid.w / 2~ - Inside source: true *** True Line Result - end + @x = args.grid.w / 2 +** Processing line: ~ @y = args.grid.h - 20~ +- Inside source: true +*** True Line Result + @y = args.grid.h - 20 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Draws the grid by adding in vertical and horizontal separators.~ +** Processing line: ~ @velocity = Vector2d.new(2, -2)~ - Inside source: true *** True Line Result - # Draws the grid by adding in vertical and horizontal separators. -** Processing line: ~ def draw_grid x, y, h, w, lines_h, lines_v~ + @velocity = Vector2d.new(2, -2) +** Processing line: ~ @width = 10~ - Inside source: true *** True Line Result - def draw_grid x, y, h, w, lines_h, lines_v + @width = 10 +** Processing line: ~ @height = 10~ +- Inside source: true +*** True Line Result + @height = 10 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # The grid starts off empty.~ +** Processing line: ~ @left_wall = (args.state.board_width + args.grid.w / 8)~ - Inside source: true *** True Line Result - # The grid starts off empty. -** Processing line: ~ grid = []~ + @left_wall = (args.state.board_width + args.grid.w / 8) +** Processing line: ~ @right_wall = @left_wall + args.state.board_width~ - Inside source: true *** True Line Result - grid = [] + @right_wall = @left_wall + args.state.board_width ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Calculates the placement and adds horizontal lines or separators into the grid.~ +** Processing line: ~ @max_velocity = MAX_VELOCITY~ - Inside source: true *** True Line Result - # Calculates the placement and adds horizontal lines or separators into the grid. -** Processing line: ~ curr_y = y # start at the bottom of the box~ + @max_velocity = MAX_VELOCITY +** Processing line: ~~ - Inside source: true *** True Line Result - curr_y = y # start at the bottom of the box -** Processing line: ~ dist_y = h / (lines_h + 1) # finds distance to place horizontal lines evenly throughout 500 height of grid~ + +** Processing line: ~ @child = child~ - Inside source: true *** True Line Result - dist_y = h / (lines_h + 1) # finds distance to place horizontal lines evenly throughout 500 height of grid -** Processing line: ~ lines_h.times do~ + @child = child +** Processing line: ~ @parent = parent~ - Inside source: true *** True Line Result - lines_h.times do -** Processing line: ~ curr_y += dist_y # increment curr_y by the distance between the horizontal lines~ + @parent = parent +** Processing line: ~~ - Inside source: true *** True Line Result - curr_y += dist_y # increment curr_y by the distance between the horizontal lines -** Processing line: ~ grid << horizontal_separator(curr_y, x, x + w - 1) # add a separator into the grid~ + +** Processing line: ~ @past = [{x: @x, y: @y}]~ - Inside source: true *** True Line Result - grid << horizontal_separator(curr_y, x, x + w - 1) # add a separator into the grid + @past = [{x: @x, y: @y}] +** Processing line: ~ @next = nil~ +- Inside source: true +*** True Line Result + @next = nil ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -29167,30 +32504,42 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Calculates the placement and adds vertical lines or separators into the grid.~ +** Processing line: ~ def reassignLeastChain (lc=nil)~ - Inside source: true *** True Line Result - # Calculates the placement and adds vertical lines or separators into the grid. -** Processing line: ~ curr_x = x # now start at the left of the box~ + def reassignLeastChain (lc=nil) +** Processing line: ~ if (lc == nil)~ - Inside source: true *** True Line Result - curr_x = x # now start at the left of the box -** Processing line: ~ dist_x = w / (lines_v + 1) # finds distance to place vertical lines evenly throughout 500 width of grid~ + if (lc == nil) +** Processing line: ~ lc = @number~ - Inside source: true *** True Line Result - dist_x = w / (lines_v + 1) # finds distance to place vertical lines evenly throughout 500 width of grid -** Processing line: ~ lines_v.times do~ + lc = @number +** Processing line: ~ end~ - Inside source: true *** True Line Result - lines_v.times do -** Processing line: ~ curr_x += dist_x # increment curr_x by the distance between the vertical lines~ + end +** Processing line: ~ @leastChain = lc~ - Inside source: true *** True Line Result - curr_x += dist_x # increment curr_x by the distance between the vertical lines -** Processing line: ~ grid << vertical_separator(curr_x, y + 1, y + h) # add separator~ + @leastChain = lc +** Processing line: ~ if (parent != nil)~ - Inside source: true *** True Line Result - grid << vertical_separator(curr_x, y + 1, y + h) # add separator + if (parent != nil) +** Processing line: ~ @parent.reassignLeastChain(lc)~ +- Inside source: true +*** True Line Result + @parent.reassignLeastChain(lc) +** 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 @@ -29199,486 +32548,514 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # paint_grid uses a hash to assign values to keys.~ +** Processing line: ~ def makeLeader args~ - Inside source: true *** True Line Result - # paint_grid uses a hash to assign values to keys. -** Processing line: ~ state.paint_grid ||= {"x" => x, "y" => y, "h" => h, "w" => w, "lines_h" => lines_h,~ + def makeLeader args +** Processing line: ~ if isLeader~ - Inside source: true *** True Line Result - state.paint_grid ||= {"x" => x, "y" => y, "h" => h, "w" => w, "lines_h" => lines_h, -** Processing line: ~ "lines_v" => lines_v, "dist_x" => dist_x,~ + if isLeader +** Processing line: ~ return~ - Inside source: true *** True Line Result - "lines_v" => lines_v, "dist_x" => dist_x, -** Processing line: ~ "dist_y" => dist_y }~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - "dist_y" => dist_y } -** Processing line: ~~ + end +** Processing line: ~ @parent.reassignLeastChain~ - Inside source: true *** True Line Result - -** Processing line: ~ return grid~ + @parent.reassignLeastChain +** Processing line: ~ args.state.ballParents.push(self)~ - Inside source: true *** True Line Result - return grid -** Processing line: ~ end~ + args.state.ballParents.push(self) +** Processing line: ~ @parent = nil~ - Inside source: true *** True Line Result - end + @parent = nil ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Checks if the user is keeping the mouse pressed down and sets the mouse_hold variable accordingly using boolean values.~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Checks if the user is keeping the mouse pressed down and sets the mouse_hold variable accordingly using boolean values. -** Processing line: ~ # If the mouse is up, the user cannot drag the mouse.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # If the mouse is up, the user cannot drag the mouse. -** Processing line: ~ def check_click~ + +** Processing line: ~ def isLeader~ - Inside source: true *** True Line Result - def check_click -** Processing line: ~ if inputs.mouse.down #is mouse up or down?~ + def isLeader +** Processing line: ~ return (parent == nil)~ - Inside source: true *** True Line Result - if inputs.mouse.down #is mouse up or down? -** Processing line: ~ state.mouse_held = true # mouse is being held down~ + return (parent == nil) +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.mouse_held = true # mouse is being held down -** Processing line: ~ elsif inputs.mouse.up # if mouse is up~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif inputs.mouse.up # if mouse is up -** Processing line: ~ state.mouse_held = false # mouse is not being held down or dragged~ + +** Processing line: ~ def receiveNext (p)~ - Inside source: true *** True Line Result - state.mouse_held = false # mouse is not being held down or dragged -** Processing line: ~ state.mouse_dragging = false~ + def receiveNext (p) +** Processing line: ~ #trace!~ - Inside source: true *** True Line Result - state.mouse_dragging = false -** Processing line: ~ end~ + #trace! +** Processing line: ~ if parent != nil~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if parent != nil +** Processing line: ~ @x = p[:x]~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.mouse_held && # mouse needs to be down~ + @x = p[:x] +** Processing line: ~ @y = p[:y]~ - Inside source: true *** True Line Result - if state.mouse_held && # mouse needs to be down -** Processing line: ~ !inputs.mouse.click && # must not be first click~ + @y = p[:y] +** Processing line: ~ @velocity = p[:velocity]~ - Inside source: true *** True Line Result - !inputs.mouse.click && # must not be first click -** Processing line: ~ ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15) # Need to move 15 pixels before "drag"~ + @velocity = p[:velocity] +** Processing line: ~ #puts @x.to_s + "|" + @y.to_s + "|"+@velocity.to_s~ - Inside source: true *** True Line Result - ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15) # Need to move 15 pixels before "drag" -** Processing line: ~ state.mouse_dragging = true~ + #puts @x.to_s + "|" + @y.to_s + "|"+@velocity.to_s +** Processing line: ~ @past.append(p)~ - Inside source: true *** True Line Result - state.mouse_dragging = true -** Processing line: ~ end~ + @past.append(p) +** Processing line: ~ if (@past.length >= BALL_DISTANCE)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if (@past.length >= BALL_DISTANCE) +** Processing line: ~ if (@child != nil)~ - Inside source: true *** True Line Result - -** Processing line: ~ # If the user clicks their mouse inside the grid, the search_lines method is called with a click input type.~ + if (@child != nil) +** Processing line: ~ @child.receiveNext(@past[0])~ - Inside source: true *** True Line Result - # If the user clicks their mouse inside the grid, the search_lines method is called with a click input type. -** Processing line: ~ if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border))~ + @child.receiveNext(@past[0]) +** Processing line: ~ @past.shift~ - Inside source: true *** True Line Result - if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border)) -** Processing line: ~ search_lines(inputs.mouse.click.point, :click)~ + @past.shift +** Processing line: ~ end~ - Inside source: true *** True Line Result - search_lines(inputs.mouse.click.point, :click) -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # If the user drags their mouse inside the grid, the search_lines method is called with a drag input type.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # If the user drags their mouse inside the grid, the search_lines method is called with a drag input type. -** Processing line: ~ elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border))~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border)) -** Processing line: ~ search_lines(inputs.mouse.position, :drag)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - search_lines(inputs.mouse.position, :drag) -** Processing line: ~ end~ + +** Processing line: ~ #Move the ball according to its velocity~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + #Move the ball according to its velocity +** Processing line: ~ def update args~ - Inside source: true *** True Line Result - end + def update args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets the definition of a grid box and handles user input to fill in or clear grid boxes.~ +** Processing line: ~ if isLeader~ - Inside source: true *** True Line Result - # Sets the definition of a grid box and handles user input to fill in or clear grid boxes. -** Processing line: ~ def search_lines (point, input_type)~ + if isLeader +** Processing line: ~ wallBounds args~ - Inside source: true *** True Line Result - def search_lines (point, input_type) -** Processing line: ~ point.x -= state.paint_grid["x"] # subtracts the value assigned to the "x" key in the paint_grid hash~ + wallBounds args +** Processing line: ~ @x += @velocity.x~ - Inside source: true *** True Line Result - point.x -= state.paint_grid["x"] # subtracts the value assigned to the "x" key in the paint_grid hash -** Processing line: ~ point.y -= state.paint_grid["y"] # subtracts the value assigned to the "y" key in the paint_grid hash~ + @x += @velocity.x +** Processing line: ~ @y += @velocity.y~ - Inside source: true *** True Line Result - point.y -= state.paint_grid["y"] # subtracts the value assigned to the "y" key in the paint_grid hash + @y += @velocity.y +** Processing line: ~ @past.append({x: @x, y: @y, velocity: @velocity})~ +- Inside source: true +*** True Line Result + @past.append({x: @x, y: @y, velocity: @velocity}) +** Processing line: ~ #puts @past~ +- Inside source: true +*** True Line Result + #puts @past ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Remove code following the .floor and see what happens when you try to fill in grid squares~ +** Processing line: ~ if (@past.length >= BALL_DISTANCE)~ - Inside source: true *** True Line Result - # Remove code following the .floor and see what happens when you try to fill in grid squares -** Processing line: ~ point.x = (point.x / state.paint_grid["dist_x"]).floor * state.paint_grid["dist_x"]~ + if (@past.length >= BALL_DISTANCE) +** Processing line: ~ if (@child != nil)~ - Inside source: true *** True Line Result - point.x = (point.x / state.paint_grid["dist_x"]).floor * state.paint_grid["dist_x"] -** Processing line: ~ point.y = (point.y / state.paint_grid["dist_y"]).floor * state.paint_grid["dist_y"]~ + if (@child != nil) +** Processing line: ~ @child.receiveNext(@past[0])~ - Inside source: true *** True Line Result - point.y = (point.y / state.paint_grid["dist_y"]).floor * state.paint_grid["dist_y"] -** Processing line: ~~ + @child.receiveNext(@past[0]) +** Processing line: ~ @past.shift~ - Inside source: true *** True Line Result - -** Processing line: ~ point.x += state.paint_grid["x"]~ + @past.shift +** Processing line: ~ end~ - Inside source: true *** True Line Result - point.x += state.paint_grid["x"] -** Processing line: ~ point.y += state.paint_grid["y"]~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - point.y += state.paint_grid["y"] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets definition of a grid box, meaning its x, y, width, and height.~ +** Processing line: ~ else~ - Inside source: true *** True Line Result - # Sets definition of a grid box, meaning its x, y, width, and height. -** Processing line: ~ # Floor is called on the point.x and point.y variables.~ + else +** Processing line: ~ puts "unexpected"~ - Inside source: true *** True Line Result - # Floor is called on the point.x and point.y variables. -** Processing line: ~ # Ceil method is called on values of the distance hash keys, setting the width and height of a box.~ + puts "unexpected" +** Processing line: ~ raise "unexpected"~ - Inside source: true *** True Line Result - # Ceil method is called on values of the distance hash keys, setting the width and height of a box. -** Processing line: ~ grid_box = [ point.x.floor, point.y.floor, state.paint_grid["dist_x"].ceil, state.paint_grid["dist_y"].ceil ]~ + raise "unexpected" +** Processing line: ~ end~ - Inside source: true *** True Line Result - grid_box = [ point.x.floor, point.y.floor, state.paint_grid["dist_x"].ceil, state.paint_grid["dist_y"].ceil ] + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if input_type == :click # if user clicks their mouse~ +** Processing line: ~ def wallBounds args~ - Inside source: true *** True Line Result - if input_type == :click # if user clicks their mouse -** Processing line: ~ if state.filled_squares.include? grid_box # if grid box is already filled in~ + def wallBounds args +** Processing line: ~ b= false~ - Inside source: true *** True Line Result - if state.filled_squares.include? grid_box # if grid box is already filled in -** Processing line: ~ state.filled_squares.delete grid_box # box is cleared and removed from filled_squares~ + b= false +** Processing line: ~ if @x < @left_wall~ - Inside source: true *** True Line Result - state.filled_squares.delete grid_box # box is cleared and removed from filled_squares -** Processing line: ~ else~ + if @x < @left_wall +** Processing line: ~ @velocity.x = @velocity.x.abs() * 1~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares~ + @velocity.x = @velocity.x.abs() * 1 +** Processing line: ~ b=true~ - Inside source: true *** True Line Result - state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares -** Processing line: ~ end~ + b=true +** Processing line: ~ elsif @x + @width > @right_wall~ - Inside source: true *** True Line Result - end -** Processing line: ~ elsif input_type == :drag # if user drags mouse~ + elsif @x + @width > @right_wall +** Processing line: ~ @velocity.x = @velocity.x.abs() * -1~ - Inside source: true *** True Line Result - elsif input_type == :drag # if user drags mouse -** Processing line: ~ unless state.filled_squares.include? grid_box # unless the grid box dragged over is already filled in~ + @velocity.x = @velocity.x.abs() * -1 +** Processing line: ~ b=true~ - Inside source: true *** True Line Result - unless state.filled_squares.include? grid_box # unless the grid box dragged over is already filled in -** Processing line: ~ state.filled_squares << grid_box # the box is filled in and added to filled_squares~ + b=true +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.filled_squares << grid_box # the box is filled in and added to filled_squares -** Processing line: ~ end~ + end +** Processing line: ~ if @y < 0~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + if @y < 0 +** Processing line: ~ @velocity.y = @velocity.y.abs() * 1~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + @velocity.y = @velocity.y.abs() * 1 +** Processing line: ~ b=true~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + b=true +** Processing line: ~ elsif @y + @height > args.grid.h~ - Inside source: true *** True Line Result - -** Processing line: ~ # Creates and outputs a "Clear" button on the screen using a label and a border.~ + elsif @y + @height > args.grid.h +** Processing line: ~ @velocity.y = @velocity.y.abs() * -1~ - Inside source: true *** True Line Result - # Creates and outputs a "Clear" button on the screen using a label and a border. -** Processing line: ~ # If the button is clicked, the filled squares are cleared, making the filled_squares collection empty.~ + @velocity.y = @velocity.y.abs() * -1 +** Processing line: ~ b=true~ - Inside source: true *** True Line Result - # If the button is clicked, the filled squares are cleared, making the filled_squares collection empty. -** Processing line: ~ def draw_buttons~ + b=true +** Processing line: ~ end~ - Inside source: true *** True Line Result - def draw_buttons -** Processing line: ~ x, y, w, h = 390, 50, 240, 50~ + end +** Processing line: ~ mag = (@velocity.x**2.0 + @velocity.y**2.0)**0.5~ - Inside source: true *** True Line Result - x, y, w, h = 390, 50, 240, 50 -** Processing line: ~ state.clear_button ||= state.new_entity(:button_with_fade)~ + mag = (@velocity.x**2.0 + @velocity.y**2.0)**0.5 +** Processing line: ~ if (b == true && mag < MAX_VELOCITY)~ - Inside source: true *** True Line Result - state.clear_button ||= state.new_entity(:button_with_fade) + if (b == true && mag < MAX_VELOCITY) +** Processing line: ~ @velocity.x*=1.1;~ +- Inside source: true +*** True Line Result + @velocity.x*=1.1; +** Processing line: ~ @velocity.y*=1.1;~ +- Inside source: true +*** True Line Result + @velocity.y*=1.1; +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # The x and y positions are set to display the label in the center of the button.~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - # The x and y positions are set to display the label in the center of the button. -** Processing line: ~ # Try changing the first two parameters to simply x, y and see what happens to the text placement!~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # Try changing the first two parameters to simply x, y and see what happens to the text placement! -** Processing line: ~ state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] # placed in center of border~ + +** Processing line: ~ #render the ball to the screen~ - Inside source: true *** True Line Result - state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] # placed in center of border -** Processing line: ~ state.clear_button.border ||= [x, y, w, h]~ + #render the ball to the screen +** Processing line: ~ def draw args~ - Inside source: true *** True Line Result - state.clear_button.border ||= [x, y, w, h] + def draw args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # If the mouse is clicked inside the borders of the clear button,~ +** Processing line: ~ #update args~ - Inside source: true *** True Line Result - # If the mouse is clicked inside the borders of the clear button, -** Processing line: ~ # the filled_squares collection is emptied and the squares are cleared.~ + #update args +** Processing line: ~ #args.outputs.solids << [@x, @y, @width, @height, 255, 255, 0];~ - Inside source: true *** True Line Result - # the filled_squares collection is emptied and the squares are cleared. -** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border)~ + #args.outputs.solids << [@x, @y, @width, @height, 255, 255, 0]; +** Processing line: ~ #args.outputs.sprits << {~ - Inside source: true *** True Line Result - if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border) -** Processing line: ~ state.clear_button.clicked_at = inputs.mouse.click.created_at # time (frame) the click occurred~ + #args.outputs.sprits << { +** Processing line: ~ #x: @x,~ - Inside source: true *** True Line Result - state.clear_button.clicked_at = inputs.mouse.click.created_at # time (frame) the click occurred -** Processing line: ~ state.filled_squares.clear~ + #x: @x, +** Processing line: ~ #y: @y,~ - Inside source: true *** True Line Result - state.filled_squares.clear -** Processing line: ~ inputs.mouse.previous_click = nil~ + #y: @y, +** Processing line: ~ #w: @width,~ - Inside source: true *** True Line Result - inputs.mouse.previous_click = nil -** Processing line: ~ end~ + #w: @width, +** Processing line: ~ #h: @height,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #h: @height, +** Processing line: ~ #path: "sprites/ball10.png"~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.labels << state.clear_button.label~ + #path: "sprites/ball10.png" +** Processing line: ~ #}~ - Inside source: true *** True Line Result - outputs.labels << state.clear_button.label -** Processing line: ~ outputs.borders << state.clear_button.border~ + #} +** Processing line: ~ #args.outputs.sprites <<[@x, @y, @width, @height, "sprites/ball10.png"]~ - Inside source: true *** True Line Result - outputs.borders << state.clear_button.border + #args.outputs.sprites <<[@x, @y, @width, @height, "sprites/ball10.png"] +** Processing line: ~ args.outputs.sprites << {x: @x, y: @y, w: @width, h: @height, path:"sprites/ball10.png" }~ +- Inside source: true +*** True Line Result + args.outputs.sprites << {x: @x, y: @y, w: @width, h: @height, path:"sprites/ball10.png" } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # When the clear button is clicked, the color of the button changes~ +** Processing line: ~ def getDraw args~ - Inside source: true *** True Line Result - # When the clear button is clicked, the color of the button changes -** Processing line: ~ # and the transparency changes, as well. If you change the time from~ + def getDraw args +** Processing line: ~ #wallBounds args~ - Inside source: true *** True Line Result - # and the transparency changes, as well. If you change the time from -** Processing line: ~ # 0.25.seconds to 1.25.seconds or more, the change will last longer.~ + #wallBounds args +** Processing line: ~ #update args~ - Inside source: true *** True Line Result - # 0.25.seconds to 1.25.seconds or more, the change will last longer. -** Processing line: ~ if state.clear_button.clicked_at~ + #update args +** Processing line: ~ #args.outputs.labels << [@x, @y, @number.to_s + "|" + @leastChain.to_s]~ - Inside source: true *** True Line Result - if state.clear_button.clicked_at -** Processing line: ~ outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)]~ + #args.outputs.labels << [@x, @y, @number.to_s + "|" + @leastChain.to_s] +** Processing line: ~ return [@x, @y, @width, @height, "sprites/ball10.png"]~ - Inside source: true *** True Line Result - outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)] + return [@x, @y, @width, @height, "sprites/ball10.png"] ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ def getPoints args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def getPoints args +** Processing line: ~ points = [~ - Inside source: true *** True Line Result - -** Processing line: ~ $paint_app = PaintApp.new~ + points = [ +** Processing line: ~ {x:@x+@width/2, y: @y},~ - Inside source: true *** True Line Result - $paint_app = PaintApp.new -** Processing line: ~~ + {x:@x+@width/2, y: @y}, +** Processing line: ~ {x:@x+@width, y:@y+@height/2},~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + {x:@x+@width, y:@y+@height/2}, +** Processing line: ~ {x:@x+@width/2,y:@y+@height},~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ $paint_app.inputs = args.inputs~ + {x:@x+@width/2,y:@y+@height}, +** Processing line: ~ {x:@x,y:@y+@height/2}~ - Inside source: true *** True Line Result - $paint_app.inputs = args.inputs -** Processing line: ~ $paint_app.state = args.state~ + {x:@x,y:@y+@height/2} +** Processing line: ~ ]~ - Inside source: true *** True Line Result - $paint_app.state = args.state -** Processing line: ~ $paint_app.grid = args.grid~ + ] +** Processing line: ~ #psize = 5.0~ - Inside source: true *** True Line Result - $paint_app.grid = args.grid -** Processing line: ~ $paint_app.args = args~ + #psize = 5.0 +** Processing line: ~ #for p in points~ - Inside source: true *** True Line Result - $paint_app.args = args -** Processing line: ~ $paint_app.outputs = args.outputs~ + #for p in points +** Processing line: ~ #args.outputs.solids << [p.x-psize/2.0, p.y-psize/2.0, psize, psize, 0, 0, 0];~ - Inside source: true *** True Line Result - $paint_app.outputs = args.outputs -** Processing line: ~ $paint_app.tick~ + #args.outputs.solids << [p.x-psize/2.0, p.y-psize/2.0, psize, psize, 0, 0, 0]; +** Processing line: ~ #end~ - Inside source: true *** True Line Result - $paint_app.tick -** Processing line: ~ tick_instructions args, "How to create a simple paint app. CLICK and HOLD to draw."~ + #end +** Processing line: ~ return points~ - Inside source: true *** True Line Result - tick_instructions args, "How to create a simple paint app. CLICK and HOLD to draw." -** Processing line: ~ end~ + return points +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + 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~ +** Processing line: ~ def serialize~ - Inside source: true *** True Line Result - return if args.state.key_event_occurred -** Processing line: ~ if args.inputs.mouse.click ||~ + def serialize +** Processing line: ~ {x: @x, y:@y}~ - Inside source: true *** True Line Result - if args.inputs.mouse.click || -** Processing line: ~ args.inputs.keyboard.directional_vector ||~ + {x: @x, y:@y} +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.inputs.keyboard.directional_vector || -** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.enter || -** Processing line: ~ args.inputs.keyboard.key_down.escape~ + +** Processing line: ~ def inspect~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.escape -** Processing line: ~ args.state.key_event_occurred = true~ + def inspect +** Processing line: ~ serialize.to_s~ - Inside source: true *** True Line Result - args.state.key_event_occurred = true -** Processing line: ~ end~ + serialize.to_s +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ +** Processing line: ~ def to_s~ - 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~ + def to_s +** Processing line: ~ serialize.to_s~ - 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~ + serialize.to_s +** Processing line: ~ end~ - 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~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result @@ -29691,262 +33068,346 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Mouse - Coordinate Systems - main.rb~ +** Processing line: ~*** Physics And Collisions - Arbitrary Collision - blocks.rb~ - Header detected. *** True Line Result *** True Line Result -* Mouse - Coordinate Systems - main.rb +*** Physics And Collisions - Arbitrary Collision - blocks.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/05_mouse/04_coordinate_systems/app/main.rb~ +** Processing line: ~ # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/blocks.rb~ - Inside source: true *** True Line Result - # ./samples/05_mouse/04_coordinate_systems/app/main.rb -** Processing line: ~ =begin~ + # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/blocks.rb +** Processing line: ~ MAX_COUNT=100~ - Inside source: true *** True Line Result - =begin + MAX_COUNT=100 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~ def universalUpdateOne args, shape~ - Inside source: true *** True Line Result - APIs listing that haven't been encountered in previous sample apps: -** Processing line: ~~ + def universalUpdateOne args, shape +** Processing line: ~ didHit = false~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.inputs.mouse.click.position: Coordinates of the mouse's position on the screen.~ + didHit = false +** Processing line: ~ hitters = []~ - Inside source: true *** True Line Result - - args.inputs.mouse.click.position: Coordinates of the mouse's position on the screen. -** Processing line: ~ Unlike args.inputs.mouse.click.point, the mouse does not need to be pressed down for~ + hitters = [] +** Processing line: ~ #puts shape.to_s~ - Inside source: true *** True Line Result - Unlike args.inputs.mouse.click.point, the mouse does not need to be pressed down for -** Processing line: ~ position to know the mouse's coordinates.~ + #puts shape.to_s +** Processing line: ~ toCollide = nil~ - Inside source: true *** True Line Result - position to know the mouse's coordinates. -** Processing line: ~ For more information about the mouse, go to mygame/documentation/07-mouse.md.~ + toCollide = nil +** Processing line: ~ for b in args.state.balls~ - Inside source: true *** True Line Result - For more information about the mouse, go to mygame/documentation/07-mouse.md. -** Processing line: ~~ + for b in args.state.balls +** Processing line: ~ if [b.x, b.y, b.width, b.height].intersect_rect?(shape.bold)~ - Inside source: true *** True Line Result - -** Processing line: ~ Reminders:~ + if [b.x, b.y, b.width, b.height].intersect_rect?(shape.bold) +** Processing line: ~ didSquare = false~ - Inside source: true *** True Line Result - Reminders: -** Processing line: ~~ + didSquare = false +** Processing line: ~ for s in shape.squareColliders~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ + for s in shape.squareColliders +** Processing line: ~ if (s.collision?(args, b))~ - Inside source: true *** True Line Result - - args.inputs.mouse.click: This property will be set if the mouse was clicked. -** Processing line: ~~ + if (s.collision?(args, b)) +** Processing line: ~ didSquare = true~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ + didSquare = true +** Processing line: ~ didHit = true~ - Inside source: true *** True Line Result - - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse. -** Processing line: ~~ + didHit = true +** Processing line: ~ #s.collide(args, b)~ - Inside source: true *** True Line Result - -** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ + #s.collide(args, b) +** Processing line: ~ toCollide = s~ - Inside source: true *** True Line Result - - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ + toCollide = s +** Processing line: ~ #hitter = b~ - Inside source: true *** True Line Result - as Ruby code, and the placeholder is replaced with its corresponding value or result. -** Processing line: ~~ + #hitter = b +** Processing line: ~ hitters.append(b)~ - Inside source: true *** True Line Result - -** Processing line: ~ In this sample app, string interpolation is used to show the current position of the mouse~ + hitters.append(b) +** Processing line: ~ end #end if~ - Inside source: true *** True Line Result - In this sample app, string interpolation is used to show the current position of the mouse -** Processing line: ~ in a label.~ + end #end if +** Processing line: ~ end #end for~ - Inside source: true *** True Line Result - in a label. -** Processing line: ~~ + end #end for +** Processing line: ~ if (didSquare == false)~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.outputs.labels: An array that generates a label.~ + if (didSquare == false) +** Processing line: ~ for c in shape.colliders~ - Inside source: true *** True Line Result - - args.outputs.labels: An array that generates a label. -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ + for c in shape.colliders +** Processing line: ~ #puts args.state.ball.velocity~ - Inside source: true *** True Line Result - The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ + #puts args.state.ball.velocity +** Processing line: ~ if c.collision?(args, b.getPoints(args),b)~ - Inside source: true *** True Line Result - For more information about labels, go to mygame/documentation/02-labels.md. -** Processing line: ~~ + if c.collision?(args, b.getPoints(args),b) +** Processing line: ~ #c.collide args, b~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.outputs.solids: An array that generates a solid.~ + #c.collide args, b +** Processing line: ~ toCollide = c~ - Inside source: true *** True Line Result - - args.outputs.solids: An array that generates a solid. -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ + toCollide = c +** Processing line: ~ didHit = true~ - Inside source: true *** True Line Result - The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] -** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ + didHit = true +** Processing line: ~ hitters.append(b)~ - Inside source: true *** True Line Result - For more information about solids, go to mygame/documentation/03-solids-and-borders.md. -** Processing line: ~~ + hitters.append(b) +** Processing line: ~ end #end if~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.outputs.lines: An array that generates a line.~ + end #end if +** Processing line: ~ end #end for~ - Inside source: true *** True Line Result - - args.outputs.lines: An array that generates a line. -** Processing line: ~ The parameters are [X, Y, X2, Y2, RED, GREEN, BLUE, ALPHA]~ + end #end for +** Processing line: ~ end #end if~ - Inside source: true *** True Line Result - The parameters are [X, Y, X2, Y2, RED, GREEN, BLUE, ALPHA] -** Processing line: ~ For more information about lines, go to mygame/documentation/04-lines.md.~ + end #end if +** Processing line: ~ end#end if~ - Inside source: true *** True Line Result - For more information about lines, go to mygame/documentation/04-lines.md. -** Processing line: ~~ + end#end if +** Processing line: ~ end#end for~ - Inside source: true *** True Line Result - -** Processing line: ~ =end~ + end#end for +** Processing line: ~ if (didHit)~ - Inside source: true *** True Line Result - =end -** Processing line: ~~ + if (didHit) +** Processing line: ~ shape.count=0~ - Inside source: true *** True Line Result - -** Processing line: ~ # This sample app shows a coordinate system or grid. The user can move their mouse around the screen and the~ + shape.count=0 +** Processing line: ~ hitters = hitters.uniq~ - Inside source: true *** True Line Result - # This sample app shows a coordinate system or grid. The user can move their mouse around the screen and the -** Processing line: ~ # coordinates of their position on the screen will be displayed. Users can choose to view one quadrant or~ + hitters = hitters.uniq +** Processing line: ~ for hitter in hitters~ - Inside source: true *** True Line Result - # coordinates of their position on the screen will be displayed. Users can choose to view one quadrant or -** Processing line: ~ # four quadrants by pressing the button.~ + for hitter in hitters +** Processing line: ~ hitter.makeLeader args~ - Inside source: true *** True Line Result - # four quadrants by pressing the button. + hitter.makeLeader args +** Processing line: ~ #toCollide.collide(args, hitter)~ +- Inside source: true +*** True Line Result + #toCollide.collide(args, hitter) +** Processing line: ~ if shape.home == "squares"~ +- Inside source: true +*** True Line Result + if shape.home == "squares" +** Processing line: ~ args.state.squares.delete(shape)~ +- Inside source: true +*** True Line Result + args.state.squares.delete(shape) +** Processing line: ~ elsif shape.home == "tshapes"~ +- Inside source: true +*** True Line Result + elsif shape.home == "tshapes" +** Processing line: ~ args.state.tshapes.delete(shape)~ +- Inside source: true +*** True Line Result + args.state.tshapes.delete(shape) +** Processing line: ~ else shape.home == "lines"~ +- Inside source: true +*** True Line Result + else shape.home == "lines" +** Processing line: ~ args.state.lines.delete(shape)~ +- Inside source: true +*** True Line Result + args.state.lines.delete(shape) +** 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~ +** Processing line: ~ #puts "HIT!" + hitter.number~ - Inside source: true *** True Line Result - def tick args + #puts "HIT!" + hitter.number +** 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: ~ # The addition and subtraction in the first two parameters of the label and solid~ +** Processing line: ~ def universalUpdate args, shape~ - Inside source: true *** True Line Result - # The addition and subtraction in the first two parameters of the label and solid -** Processing line: ~ # ensure that the outputs don't overlap each other. Try removing them and see what happens.~ + def universalUpdate args, shape +** Processing line: ~ #puts shape.home~ - Inside source: true *** True Line Result - # ensure that the outputs don't overlap each other. Try removing them and see what happens. -** Processing line: ~ pos = args.inputs.mouse.position # stores coordinates of mouse's position~ + #puts shape.home +** Processing line: ~ if (shape.count <= 1)~ - Inside source: true *** True Line Result - pos = args.inputs.mouse.position # stores coordinates of mouse's position -** Processing line: ~ args.outputs.labels << [pos.x + 10, pos.y + 10, "#{pos}"] # outputs label of coordinates~ + if (shape.count <= 1) +** Processing line: ~ universalUpdateOne args, shape~ - Inside source: true *** True Line Result - args.outputs.labels << [pos.x + 10, pos.y + 10, "#{pos}"] # outputs label of coordinates -** Processing line: ~ args.outputs.solids << [pos.x - 2, pos.y - 2, 5, 5] # outputs small blackk box placed where mouse is hovering~ + universalUpdateOne args, shape +** Processing line: ~ return~ - Inside source: true *** True Line Result - args.outputs.solids << [pos.x - 2, pos.y - 2, 5, 5] # outputs small blackk box placed where mouse is hovering + return +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ button = [0, 0, 370, 50] # sets definition of toggle button~ +** Processing line: ~ didHit = false~ - Inside source: true *** True Line Result - button = [0, 0, 370, 50] # sets definition of toggle button -** Processing line: ~ args.outputs.borders << button # outputs button as border (not filled in)~ + didHit = false +** Processing line: ~ hitter = nil~ - Inside source: true *** True Line Result - args.outputs.borders << button # outputs button as border (not filled in) -** Processing line: ~ args.outputs.labels << [10, 35, "click here toggle coordinate system"] # label of button~ + hitter = nil +** Processing line: ~ for b in args.state.ballParents~ - Inside source: true *** True Line Result - args.outputs.labels << [10, 35, "click here toggle coordinate system"] # label of button -** Processing line: ~ args.outputs.lines << [ 0, -720, 0, 720] # vertical line dividing quadrants~ + for b in args.state.ballParents +** Processing line: ~ if [b.x, b.y, b.width, b.height].intersect_rect?(shape.bold)~ - Inside source: true *** True Line Result - args.outputs.lines << [ 0, -720, 0, 720] # vertical line dividing quadrants -** Processing line: ~ args.outputs.lines << [-1280, 0, 1280, 0] # horizontal line dividing quadrants~ + if [b.x, b.y, b.width, b.height].intersect_rect?(shape.bold) +** Processing line: ~ didSquare = false~ - Inside source: true *** True Line Result - args.outputs.lines << [-1280, 0, 1280, 0] # horizontal line dividing quadrants -** Processing line: ~~ + didSquare = false +** Processing line: ~ for s in shape.squareColliders~ - Inside source: true *** True Line Result - -** Processing line: ~ if args.inputs.mouse.click # if the user clicks the mouse~ + for s in shape.squareColliders +** Processing line: ~ if (s.collision?(args, b))~ - Inside source: true *** True Line Result - if args.inputs.mouse.click # if the user clicks the mouse -** Processing line: ~ pos = args.inputs.mouse.click.point # pos's value is point where user clicked (coordinates)~ + if (s.collision?(args, b)) +** Processing line: ~ didSquare = true~ - Inside source: true *** True Line Result - pos = args.inputs.mouse.click.point # pos's value is point where user clicked (coordinates) -** Processing line: ~ if pos.inside_rect? button # if the click occurred inside the button~ + didSquare = true +** Processing line: ~ didHit = true~ - Inside source: true *** True Line Result - if pos.inside_rect? button # if the click occurred inside the button -** Processing line: ~ if args.grid.name == :bottom_left # if the grid shows bottom left as origin~ + didHit = true +** Processing line: ~ s.collide(args, b)~ - Inside source: true *** True Line Result - if args.grid.name == :bottom_left # if the grid shows bottom left as origin -** Processing line: ~ args.grid.origin_center! # origin will be shown in center~ + s.collide(args, b) +** Processing line: ~ hitter = b~ - Inside source: true *** True Line Result - args.grid.origin_center! # origin will be shown in center -** Processing line: ~ else~ + hitter = b +** Processing line: ~ end~ - Inside source: true *** True Line Result - else -** Processing line: ~ args.grid.origin_bottom_left! # otherwise, the view will change to show bottom left as origin~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.grid.origin_bottom_left! # otherwise, the view will change to show bottom left as origin + end +** Processing line: ~ if (didSquare == false)~ +- Inside source: true +*** True Line Result + if (didSquare == false) +** Processing line: ~ for c in shape.colliders~ +- Inside source: true +*** True Line Result + for c in shape.colliders +** Processing line: ~ #puts args.state.ball.velocity~ +- Inside source: true +*** True Line Result + #puts args.state.ball.velocity +** Processing line: ~ if c.collision?(args, b.getPoints(args),b)~ +- Inside source: true +*** True Line Result + if c.collision?(args, b.getPoints(args),b) +** Processing line: ~ c.collide args, b~ +- Inside source: true +*** True Line Result + c.collide args, b +** Processing line: ~ didHit = true~ +- Inside source: true +*** True Line Result + didHit = true +** Processing line: ~ hitter = b~ +- Inside source: true +*** True Line Result + hitter = b +** 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 @@ -29959,70 +33420,74 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ if (didHit)~ - Inside source: true *** True Line Result - -** Processing line: ~ tick_instructions args, "Sample app shows the two supported coordinate systems in Game Toolkit."~ + if (didHit) +** Processing line: ~ shape.count=shape.count-1~ - Inside source: true *** True Line Result - tick_instructions args, "Sample app shows the two supported coordinate systems in Game Toolkit." -** Processing line: ~ end~ + shape.count=shape.count-1 +** Processing line: ~ shape.damageCount.append([(hitter.leastChain+1 - hitter.number)-1, args.state.tick_count])~ - Inside source: true *** True Line Result - end + shape.damageCount.append([(hitter.leastChain+1 - hitter.number)-1, args.state.tick_count]) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick_instructions args, text, y = 715~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - def tick_instructions args, text, y = 715 -** Processing line: ~ return if args.state.key_event_occurred~ + end +** Processing line: ~ i=0~ - Inside source: true *** True Line Result - return if args.state.key_event_occurred -** Processing line: ~ if args.inputs.mouse.click ||~ + i=0 +** Processing line: ~ while i < shape.damageCount.length~ - Inside source: true *** True Line Result - if args.inputs.mouse.click || -** Processing line: ~ args.inputs.keyboard.directional_vector ||~ + while i < shape.damageCount.length +** Processing line: ~ if shape.damageCount[i][0] <= 0~ - Inside source: true *** True Line Result - args.inputs.keyboard.directional_vector || -** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ + if shape.damageCount[i][0] <= 0 +** Processing line: ~ shape.damageCount.delete_at(i)~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.enter || -** Processing line: ~ args.inputs.keyboard.key_down.escape~ + shape.damageCount.delete_at(i) +** Processing line: ~ i-=1~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.escape -** Processing line: ~ args.state.key_event_occurred = true~ + i-=1 +** Processing line: ~ elsif shape.damageCount[i][1].elapsed_time > BALL_DISTANCE and shape.damageCount[i][0] > 1~ - Inside source: true *** True Line Result - args.state.key_event_occurred = true -** Processing line: ~ end~ + elsif shape.damageCount[i][1].elapsed_time > BALL_DISTANCE and shape.damageCount[i][0] > 1 +** Processing line: ~ shape.count-=1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + shape.count-=1 +** Processing line: ~ shape.damageCount[i][0]-=1~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ + shape.damageCount[i][0]-=1 +** Processing line: ~ shape.damageCount[i][1] = args.state.tick_count~ - 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~ + shape.damageCount[i][1] = args.state.tick_count +** Processing line: ~ end~ - 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~ + end +** Processing line: ~ i+=1~ - Inside source: true *** True Line Result - args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label + i+=1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -30031,2150 +33496,2186 @@ Follows is a source code listing for all files that have been open sourced. This - 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: ~* Save Load - Save Load Game - main.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ class Square~ +- Inside source: true *** True Line Result -* Save Load - Save Load Game - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + class Square +** Processing line: ~ attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount~ +- Inside source: true *** True Line Result - + attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount +** Processing line: ~ def initialize(args, x, y, block_size, orientation, block_offset)~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/06_save_load/01_save_load_game/app/main.rb~ + def initialize(args, x, y, block_size, orientation, block_offset) +** Processing line: ~ @x = x * block_size~ - Inside source: true *** True Line Result - # ./samples/06_save_load/01_save_load_game/app/main.rb -** Processing line: ~ =begin~ + @x = x * block_size +** Processing line: ~ @y = y * block_size~ - Inside source: true *** True Line Result - =begin -** Processing line: ~~ + @y = y * block_size +** Processing line: ~ @block_size = block_size~ - Inside source: true *** True Line Result - -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ + @block_size = block_size +** Processing line: ~ @block_offset = block_offset~ - Inside source: true *** True Line Result - APIs listing that haven't been encountered in previous sample apps: -** Processing line: ~~ + @block_offset = block_offset +** Processing line: ~ @orientation = orientation~ - Inside source: true *** True Line Result - -** Processing line: ~ - Symbol (:): Ruby object with a name and an internal ID. Symbols are useful~ + @orientation = orientation +** Processing line: ~ @damageCount = []~ - Inside source: true *** True Line Result - - Symbol (:): Ruby object with a name and an internal ID. Symbols are useful -** Processing line: ~ because with a given symbol name, you can refer to the same object throughout~ + @damageCount = [] +** Processing line: ~ @home = 'squares'~ - Inside source: true *** True Line Result - because with a given symbol name, you can refer to the same object throughout -** Processing line: ~ a Ruby program.~ + @home = 'squares' +** Processing line: ~~ - Inside source: true *** True Line Result - a Ruby program. + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ In this sample app, we're using symbols for our buttons. We have buttons that~ +** Processing line: ~ Kernel.srand()~ - Inside source: true *** True Line Result - In this sample app, we're using symbols for our buttons. We have buttons that -** Processing line: ~ light fires, save, load, etc. Each of these buttons has a distinct symbol like~ + Kernel.srand() +** Processing line: ~ @r = rand(255)~ - Inside source: true *** True Line Result - light fires, save, load, etc. Each of these buttons has a distinct symbol like -** Processing line: ~ :light_fire, :save_game, :load_game, etc.~ + @r = rand(255) +** Processing line: ~ @g = rand(255)~ - Inside source: true *** True Line Result - :light_fire, :save_game, :load_game, etc. + @g = rand(255) +** Processing line: ~ @b = rand(255)~ +- Inside source: true +*** True Line Result + @b = rand(255) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - to_sym: Returns the symbol corresponding to the given string; creates the symbol~ +** Processing line: ~ @count = rand(MAX_COUNT)+1~ - Inside source: true *** True Line Result - - to_sym: Returns the symbol corresponding to the given string; creates the symbol -** Processing line: ~ if it does not already exist.~ + @count = rand(MAX_COUNT)+1 +** Processing line: ~~ - Inside source: true *** True Line Result - if it does not already exist. -** Processing line: ~ For example,~ + +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2~ - Inside source: true *** True Line Result - For example, -** Processing line: ~ 'car'.to_sym~ + x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2 +** Processing line: ~ @x_adjusted = @x + x_offset~ - Inside source: true *** True Line Result - 'car'.to_sym -** Processing line: ~ would return the symbol :car.~ + @x_adjusted = @x + x_offset +** Processing line: ~ @y_adjusted = @y~ - Inside source: true *** True Line Result - would return the symbol :car. + @y_adjusted = @y +** Processing line: ~ @size_adjusted = @block_size * 2 - @block_offset~ +- Inside source: true +*** True Line Result + @size_adjusted = @block_size * 2 - @block_offset ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - last: Returns the last element of an array.~ +** Processing line: ~ hypotenuse=args.state.ball_hypotenuse~ - Inside source: true *** True Line Result - - last: Returns the last element of an array. + hypotenuse=args.state.ball_hypotenuse +** Processing line: ~ @bold = [(@x_adjusted-hypotenuse/2)-1, (@y_adjusted-hypotenuse/2)-1, @size_adjusted + hypotenuse + 2, @size_adjusted + hypotenuse + 2]~ +- Inside source: true +*** True Line Result + @bold = [(@x_adjusted-hypotenuse/2)-1, (@y_adjusted-hypotenuse/2)-1, @size_adjusted + hypotenuse + 2, @size_adjusted + hypotenuse + 2] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Reminders:~ +** Processing line: ~ @points = [~ - Inside source: true *** True Line Result - Reminders: -** Processing line: ~~ + @points = [ +** Processing line: ~ {x:@x_adjusted, y:@y_adjusted},~ - Inside source: true *** True Line Result - -** Processing line: ~ - num1.lesser(num2): finds the lower value of the given options.~ + {x:@x_adjusted, y:@y_adjusted}, +** Processing line: ~ {x:@x_adjusted+@size_adjusted, y:@y_adjusted},~ - Inside source: true *** True Line Result - - num1.lesser(num2): finds the lower value of the given options. -** Processing line: ~ For example, in the statement~ + {x:@x_adjusted+@size_adjusted, y:@y_adjusted}, +** Processing line: ~ {x:@x_adjusted+@size_adjusted, y:@y_adjusted+@size_adjusted},~ - Inside source: true *** True Line Result - For example, in the statement -** Processing line: ~ a = 4.lesser(3)~ + {x:@x_adjusted+@size_adjusted, y:@y_adjusted+@size_adjusted}, +** Processing line: ~ {x:@x_adjusted, y:@y_adjusted+@size_adjusted}~ - Inside source: true *** True Line Result - a = 4.lesser(3) -** Processing line: ~ 3 has a lower value than 4, which means that the value of a would be set to 3,~ + {x:@x_adjusted, y:@y_adjusted+@size_adjusted} +** Processing line: ~ ]~ - Inside source: true *** True Line Result - 3 has a lower value than 4, which means that the value of a would be set to 3, -** Processing line: ~ but if the statement had been~ + ] +** Processing line: ~ @squareColliders = [~ - Inside source: true *** True Line Result - but if the statement had been -** Processing line: ~ a = 4.lesser(5)~ + @squareColliders = [ +** Processing line: ~ SquareCollider.new(@points[0].x,@points[0].y,{x:-1,y:-1}),~ - Inside source: true *** True Line Result - a = 4.lesser(5) -** Processing line: ~ 4 has a lower value than 5, which means that the value of a would be set to 4.~ + SquareCollider.new(@points[0].x,@points[0].y,{x:-1,y:-1}), +** Processing line: ~ SquareCollider.new(@points[1].x-COLLISIONWIDTH,@points[1].y,{x:1,y:-1}),~ - Inside source: true *** True Line Result - 4 has a lower value than 5, which means that the value of a would be set to 4. -** Processing line: ~~ + SquareCollider.new(@points[1].x-COLLISIONWIDTH,@points[1].y,{x:1,y:-1}), +** Processing line: ~ SquareCollider.new(@points[2].x-COLLISIONWIDTH,@points[2].y-COLLISIONWIDTH,{x:1,y:1}),~ - Inside source: true *** True Line Result - -** Processing line: ~ - num1.fdiv(num2): returns the float division (will have a decimal) of the two given numbers.~ + SquareCollider.new(@points[2].x-COLLISIONWIDTH,@points[2].y-COLLISIONWIDTH,{x:1,y:1}), +** Processing line: ~ SquareCollider.new(@points[3].x,@points[3].y-COLLISIONWIDTH,{x:-1,y:1}),~ - Inside source: true *** True Line Result - - num1.fdiv(num2): returns the float division (will have a decimal) of the two given numbers. -** Processing line: ~ For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0~ + SquareCollider.new(@points[3].x,@points[3].y-COLLISIONWIDTH,{x:-1,y:1}), +** Processing line: ~ ]~ - Inside source: true *** True Line Result - For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0 -** Processing line: ~~ + ] +** Processing line: ~ @colliders = [~ - Inside source: true *** True Line Result - -** Processing line: ~ - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated~ + @colliders = [ +** Processing line: ~ LinearCollider.new(@points[0],@points[1], :neg),~ - Inside source: true *** True Line Result - - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ + LinearCollider.new(@points[0],@points[1], :neg), +** Processing line: ~ LinearCollider.new(@points[1],@points[2], :neg),~ - Inside source: true *** True Line Result - as Ruby code, and the placeholder is replaced with its corresponding value or result. -** Processing line: ~~ + LinearCollider.new(@points[1],@points[2], :neg), +** Processing line: ~ LinearCollider.new(@points[2],@points[3], :pos),~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.outputs.labels: An array. Values generate a label.~ + LinearCollider.new(@points[2],@points[3], :pos), +** Processing line: ~ LinearCollider.new(@points[0],@points[3], :pos)~ - Inside source: true *** True Line Result - - args.outputs.labels: An array. Values generate a label. -** Processing line: ~ Parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ + LinearCollider.new(@points[0],@points[3], :pos) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - Parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] -** Processing line: ~ For more information, go to mygame/documentation/02-labels.md.~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - For more information, go to mygame/documentation/02-labels.md. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - ARRAY#inside_rect?: An array with at least two values is considered a point. An array~ -- Inside source: true -*** True Line Result - - ARRAY#inside_rect?: An array with at least two values is considered a point. An array -** Processing line: ~ with at least four values is considered a rect. The inside_rect? function returns true~ +** Processing line: ~ def draw(args)~ - Inside source: true *** True Line Result - with at least four values is considered a rect. The inside_rect? function returns true -** Processing line: ~ or false depending on if the point is inside the rect.~ + def draw(args) +** Processing line: ~ #Offset the coordinates to the edge of the game area~ - Inside source: true *** True Line Result - or false depending on if the point is inside the rect. -** Processing line: ~~ + #Offset the coordinates to the edge of the game area +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2~ - Inside source: true *** True Line Result - -** Processing line: ~ =end~ + x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2 +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size * 2 - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - =end -** Processing line: ~~ + #args.outputs.solids << [@x + x_offset, @y, @block_size * 2 - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b] +** Processing line: ~ args.outputs.solids <<{x: (@x + x_offset), y: (@y), w: (@block_size * 2 - @block_offset), h: (@block_size * 2 - @block_offset), r: @r , g: @g , b: @b }~ - Inside source: true *** True Line Result - -** Processing line: ~ # This code allows users to perform different tasks, such as saving and loading the game.~ + args.outputs.solids <<{x: (@x + x_offset), y: (@y), w: (@block_size * 2 - @block_offset), h: (@block_size * 2 - @block_offset), r: @r , g: @g , b: @b } +** Processing line: ~ #args.outputs.solids << @bold.append([255,0,0])~ - Inside source: true *** True Line Result - # This code allows users to perform different tasks, such as saving and loading the game. -** Processing line: ~ # Users also have options to reset the game and light a fire.~ + #args.outputs.solids << @bold.append([255,0,0]) +** Processing line: ~ args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s]~ - Inside source: true *** True Line Result - # Users also have options to reset the game and light a fire. + args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class TextedBasedGame~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - class TextedBasedGame + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Contains methods needed for game to run properly.~ +** Processing line: ~ def update args~ - Inside source: true *** True Line Result - # Contains methods needed for game to run properly. -** Processing line: ~ # Increments tick count by 1 each time it runs (60 times in a single second)~ + def update args +** Processing line: ~ universalUpdate args, self~ - Inside source: true *** True Line Result - # Increments tick count by 1 each time it runs (60 times in a single second) -** Processing line: ~ def tick~ + universalUpdate args, self +** Processing line: ~ end~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ default~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - default -** Processing line: ~ show_intro~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - show_intro -** Processing line: ~ state.engine_tick_count += 1~ + +** Processing line: ~ class TShape~ - Inside source: true *** True Line Result - state.engine_tick_count += 1 -** Processing line: ~ tick_fire~ + class TShape +** Processing line: ~ attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount~ - Inside source: true *** True Line Result - tick_fire -** Processing line: ~ end~ + attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount +** Processing line: ~ def initialize(args, x, y, block_size, orientation, block_offset)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def initialize(args, x, y, block_size, orientation, block_offset) +** Processing line: ~ @x = x * block_size~ - Inside source: true *** True Line Result - -** Processing line: ~ # Sets default values.~ + @x = x * block_size +** Processing line: ~ @y = y * block_size~ - Inside source: true *** True Line Result - # Sets default values. -** Processing line: ~ # The ||= ensures that a variable's value is only set to the value following the = sign~ + @y = y * block_size +** Processing line: ~ @block_size = block_size~ - Inside source: true *** True Line Result - # The ||= ensures that a variable's value is only set to the value following the = sign -** Processing line: ~ # if the value has not already been set before. Intialization happens only in the first frame.~ + @block_size = block_size +** Processing line: ~ @block_offset = block_offset~ - Inside source: true *** True Line Result - # if the value has not already been set before. Intialization happens only in the first frame. -** Processing line: ~ def default~ + @block_offset = block_offset +** Processing line: ~ @orientation = orientation~ - Inside source: true *** True Line Result - def default -** Processing line: ~ state.engine_tick_count ||= 0~ + @orientation = orientation +** Processing line: ~ @damageCount = []~ - Inside source: true *** True Line Result - state.engine_tick_count ||= 0 -** Processing line: ~ state.active_module ||= :room~ + @damageCount = [] +** Processing line: ~ @home = "tshapes"~ - Inside source: true *** True Line Result - state.active_module ||= :room -** Processing line: ~ state.fire_progress ||= 0~ + @home = "tshapes" +** Processing line: ~~ - Inside source: true *** True Line Result - state.fire_progress ||= 0 -** Processing line: ~ state.fire_ready_in ||= 10~ + +** Processing line: ~ Kernel.srand()~ - Inside source: true *** True Line Result - state.fire_ready_in ||= 10 -** Processing line: ~ state.previous_fire ||= :dead~ + Kernel.srand() +** Processing line: ~ @r = rand(255)~ - Inside source: true *** True Line Result - state.previous_fire ||= :dead -** Processing line: ~ state.fire ||= :dead~ + @r = rand(255) +** Processing line: ~ @g = rand(255)~ - Inside source: true *** True Line Result - state.fire ||= :dead -** Processing line: ~ end~ + @g = rand(255) +** Processing line: ~ @b = rand(255)~ - Inside source: true *** True Line Result - end + @b = rand(255) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def show_intro~ -- Inside source: true -*** True Line Result - def show_intro -** Processing line: ~ return unless state.engine_tick_count == 0 # return unless the game just started~ -- Inside source: true -*** True Line Result - return unless state.engine_tick_count == 0 # return unless the game just started -** Processing line: ~ set_story_line "awake." # calls set_story_line method, sets to "awake"~ +** Processing line: ~ @count = rand(MAX_COUNT)+1~ - Inside source: true *** True Line Result - set_story_line "awake." # calls set_story_line method, sets to "awake" -** Processing line: ~ end~ + @count = rand(MAX_COUNT)+1 +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets story line.~ +** Processing line: ~ @shapePoints = getShapePoints(args)~ - Inside source: true *** True Line Result - # Sets story line. -** Processing line: ~ def set_story_line story_line~ + @shapePoints = getShapePoints(args) +** Processing line: ~ minX={x:INFINITY, y:0}~ - Inside source: true *** True Line Result - def set_story_line story_line -** Processing line: ~ state.story_line = story_line # story line set to value of parameter~ + minX={x:INFINITY, y:0} +** Processing line: ~ minY={x:0, y:INFINITY}~ - Inside source: true *** True Line Result - state.story_line = story_line # story line set to value of parameter -** Processing line: ~ state.active_module = :alert # active module set to alert~ + minY={x:0, y:INFINITY} +** Processing line: ~ maxX={x:-INFINITY, y:0}~ - Inside source: true *** True Line Result - state.active_module = :alert # active module set to alert -** Processing line: ~ end~ + maxX={x:-INFINITY, y:0} +** Processing line: ~ maxY={x:0, y:-INFINITY}~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + maxY={x:0, y:-INFINITY} +** Processing line: ~ for p in @shapePoints~ - Inside source: true *** True Line Result - -** Processing line: ~ # Clears story line.~ + for p in @shapePoints +** Processing line: ~ if p.x < minX.x~ - Inside source: true *** True Line Result - # Clears story line. -** Processing line: ~ def clear_storyline~ + if p.x < minX.x +** Processing line: ~ minX = p~ - Inside source: true *** True Line Result - def clear_storyline -** Processing line: ~ state.active_module = :none # active module set to none~ + minX = p +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.active_module = :none # active module set to none -** Processing line: ~ state.story_line = nil # story line is cleared, set to nil (or empty)~ + end +** Processing line: ~ if p.x > maxX.x~ - Inside source: true *** True Line Result - state.story_line = nil # story line is cleared, set to nil (or empty) -** Processing line: ~ end~ + if p.x > maxX.x +** Processing line: ~ maxX = p~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + maxX = p +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # Determines fire progress (how close the fire is to being ready to light).~ + end +** Processing line: ~ if p.y < minY.y~ - Inside source: true *** True Line Result - # Determines fire progress (how close the fire is to being ready to light). -** Processing line: ~ def tick_fire~ + if p.y < minY.y +** Processing line: ~ minY = p~ - Inside source: true *** True Line Result - def tick_fire -** Processing line: ~ return if state.active_module == :alert # return if active module is alert~ + minY = p +** Processing line: ~ end~ - Inside source: true *** True Line Result - return if state.active_module == :alert # return if active module is alert -** Processing line: ~ state.fire_progress += 1 # increment fire progress~ + end +** Processing line: ~ if p.y > maxY.y~ - Inside source: true *** True Line Result - state.fire_progress += 1 # increment fire progress -** Processing line: ~ # fire_ready_in is 10. The fire_progress is either the current value or 10, whichever has a lower value.~ + if p.y > maxY.y +** Processing line: ~ maxY = p~ - Inside source: true *** True Line Result - # fire_ready_in is 10. The fire_progress is either the current value or 10, whichever has a lower value. -** Processing line: ~ state.fire_progress = state.fire_progress.lesser(state.fire_ready_in)~ + maxY = p +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.fire_progress = state.fire_progress.lesser(state.fire_ready_in) -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets the value of fire (whether it is dead or roaring), and the story line~ +** Processing line: ~~ - Inside source: true *** True Line Result - # Sets the value of fire (whether it is dead or roaring), and the story line -** Processing line: ~ def light_fire~ + +** Processing line: ~ hypotenuse=args.state.ball_hypotenuse~ - Inside source: true *** True Line Result - def light_fire -** Processing line: ~ return unless fire_ready? # returns unless the fire is ready to be lit~ + hypotenuse=args.state.ball_hypotenuse +** Processing line: ~~ - Inside source: true *** True Line Result - return unless fire_ready? # returns unless the fire is ready to be lit -** Processing line: ~ state.fire = :roaring # fire is lit, set to roaring~ + +** Processing line: ~ @bold = [(minX.x-hypotenuse/2)-1, (minY.y-hypotenuse/2)-1, -((minX.x-hypotenuse/2)-1)+(maxX.x + hypotenuse + 2), -((minY.y-hypotenuse/2)-1)+(maxY.y + hypotenuse + 2)]~ - Inside source: true *** True Line Result - state.fire = :roaring # fire is lit, set to roaring -** Processing line: ~ state.fire_progress = 0 # the fire progress returns to 0, since the fire has been lit~ + @bold = [(minX.x-hypotenuse/2)-1, (minY.y-hypotenuse/2)-1, -((minX.x-hypotenuse/2)-1)+(maxX.x + hypotenuse + 2), -((minY.y-hypotenuse/2)-1)+(maxY.y + hypotenuse + 2)] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.fire_progress = 0 # the fire progress returns to 0, since the fire has been lit -** Processing line: ~ if state.fire != state.previous_fire~ + end +** Processing line: ~ def getShapePoints(args)~ - Inside source: true *** True Line Result - if state.fire != state.previous_fire -** Processing line: ~ set_story_line "the fire is #{state.fire}." # the story line is set using string interpolation~ + def getShapePoints(args) +** Processing line: ~ points=[]~ - Inside source: true *** True Line Result - set_story_line "the fire is #{state.fire}." # the story line is set using string interpolation -** Processing line: ~ state.previous_fire = state.fire~ + points=[] +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2)~ - Inside source: true *** True Line Result - state.previous_fire = state.fire -** Processing line: ~ end~ + x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2) +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ if @orientation == :right~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if @orientation == :right +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - -** Processing line: ~ # Checks if the fire is ready to be lit. Returns a boolean value.~ + #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2, @block_size, @r, @g, @b]~ - Inside source: true *** True Line Result - # Checks if the fire is ready to be lit. Returns a boolean value. -** Processing line: ~ def fire_ready?~ + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2, @block_size, @r, @g, @b] +** Processing line: ~ points = [~ - Inside source: true *** True Line Result - def fire_ready? -** Processing line: ~ # If fire_progress (value between 0 and 10) is equal to fire_ready_in (value of 10),~ + points = [ +** Processing line: ~ {x:@x + x_offset, y:@y},~ - Inside source: true *** True Line Result - # If fire_progress (value between 0 and 10) is equal to fire_ready_in (value of 10), -** Processing line: ~ # the fire is ready to be lit.~ + {x:@x + x_offset, y:@y}, +** Processing line: ~ {x:(@x + x_offset)+(@block_size - @block_offset), y:@y},~ - Inside source: true *** True Line Result - # the fire is ready to be lit. -** Processing line: ~ state.fire_progress == state.fire_ready_in~ + {x:(@x + x_offset)+(@block_size - @block_offset), y:@y}, +** Processing line: ~ {x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size},~ - Inside source: true *** True Line Result - state.fire_progress == state.fire_ready_in -** Processing line: ~ end~ + {x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size}, +** Processing line: ~ {x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size},~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + {x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size}, +** Processing line: ~ {x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size+@block_size},~ - Inside source: true *** True Line Result - -** Processing line: ~ # Divides the value of the fire_progress variable by 10 to determine how close the user is to~ + {x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size+@block_size}, +** Processing line: ~ {x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size+@block_size},~ - Inside source: true *** True Line Result - # Divides the value of the fire_progress variable by 10 to determine how close the user is to -** Processing line: ~ # being able to light a fire.~ + {x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size+@block_size}, +** Processing line: ~ {x:(@x + x_offset)+(@block_size - @block_offset), y:@y+ @block_size * 3 - @block_offset},~ - Inside source: true *** True Line Result - # being able to light a fire. -** Processing line: ~ def light_fire_progress~ + {x:(@x + x_offset)+(@block_size - @block_offset), y:@y+ @block_size * 3 - @block_offset}, +** Processing line: ~ {x:@x + x_offset , y:@y+ @block_size * 3 - @block_offset}~ - Inside source: true *** True Line Result - def light_fire_progress -** Processing line: ~ state.fire_progress.fdiv(10) # float division~ + {x:@x + x_offset , y:@y+ @block_size * 3 - @block_offset} +** Processing line: ~ ]~ - Inside source: true *** True Line Result - state.fire_progress.fdiv(10) # float division -** Processing line: ~ end~ + ] +** Processing line: ~ @squareColliders = [~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + @squareColliders = [ +** Processing line: ~ SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}),~ - Inside source: true *** True Line Result - -** Processing line: ~ # Defines fire as the state.fire variable.~ + SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}), +** Processing line: ~ SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}),~ - Inside source: true *** True Line Result - # Defines fire as the state.fire variable. -** Processing line: ~ def fire~ + SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}), +** Processing line: ~ SquareCollider.new(points[2].x,points[2].y-COLLISIONWIDTH,{x:1,y:-1}),~ - Inside source: true *** True Line Result - def fire -** Processing line: ~ state.fire~ + SquareCollider.new(points[2].x,points[2].y-COLLISIONWIDTH,{x:1,y:-1}), +** Processing line: ~ SquareCollider.new(points[3].x-COLLISIONWIDTH,points[3].y,{x:1,y:-1}),~ - Inside source: true *** True Line Result - state.fire -** Processing line: ~ end~ + SquareCollider.new(points[3].x-COLLISIONWIDTH,points[3].y,{x:1,y:-1}), +** Processing line: ~ SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y-COLLISIONWIDTH,{x:1,y:1}),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y-COLLISIONWIDTH,{x:1,y:1}), +** Processing line: ~ SquareCollider.new(points[5].x,points[5].y,{x:1,y:1}),~ - Inside source: true *** True Line Result - -** Processing line: ~ # Sets the title of the room.~ + SquareCollider.new(points[5].x,points[5].y,{x:1,y:1}), +** Processing line: ~ SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y-COLLISIONWIDTH,{x:1,y:1}),~ - Inside source: true *** True Line Result - # Sets the title of the room. -** Processing line: ~ def room_title~ + SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y-COLLISIONWIDTH,{x:1,y:1}), +** Processing line: ~ SquareCollider.new(points[7].x,points[7].y-COLLISIONWIDTH,{x:-1,y:1}),~ - Inside source: true *** True Line Result - def room_title -** Processing line: ~ return "a room that is dark" if state.fire == :dead # room is dark if the fire is dead~ + SquareCollider.new(points[7].x,points[7].y-COLLISIONWIDTH,{x:-1,y:1}), +** Processing line: ~ ]~ - Inside source: true *** True Line Result - return "a room that is dark" if state.fire == :dead # room is dark if the fire is dead -** Processing line: ~ return "a room that is lit" # room is lit if the fire is not dead~ + ] +** Processing line: ~ @colliders = [~ - Inside source: true *** True Line Result - return "a room that is lit" # room is lit if the fire is not dead -** Processing line: ~ end~ + @colliders = [ +** Processing line: ~ LinearCollider.new(points[0],points[1], :neg),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + LinearCollider.new(points[0],points[1], :neg), +** Processing line: ~ LinearCollider.new(points[1],points[2], :neg),~ - Inside source: true *** True Line Result - -** Processing line: ~ # Sets the active_module to room.~ + LinearCollider.new(points[1],points[2], :neg), +** Processing line: ~ LinearCollider.new(points[2],points[3], :neg),~ - Inside source: true *** True Line Result - # Sets the active_module to room. -** Processing line: ~ def go_to_room~ + LinearCollider.new(points[2],points[3], :neg), +** Processing line: ~ LinearCollider.new(points[3],points[4], :neg),~ - Inside source: true *** True Line Result - def go_to_room -** Processing line: ~ state.active_module = :room~ + LinearCollider.new(points[3],points[4], :neg), +** Processing line: ~ LinearCollider.new(points[4],points[5], :pos),~ - Inside source: true *** True Line Result - state.active_module = :room -** Processing line: ~ end~ + LinearCollider.new(points[4],points[5], :pos), +** Processing line: ~ LinearCollider.new(points[5],points[6], :neg),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + LinearCollider.new(points[5],points[6], :neg), +** Processing line: ~ LinearCollider.new(points[6],points[7], :pos),~ - Inside source: true *** True Line Result - -** Processing line: ~ # Defines active_module as the state.active_module variable.~ + LinearCollider.new(points[6],points[7], :pos), +** Processing line: ~ LinearCollider.new(points[0],points[7], :pos)~ - Inside source: true *** True Line Result - # Defines active_module as the state.active_module variable. -** Processing line: ~ def active_module~ + LinearCollider.new(points[0],points[7], :pos) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - def active_module -** Processing line: ~ state.active_module~ + ] +** Processing line: ~ elsif @orientation == :up~ - Inside source: true *** True Line Result - state.active_module -** Processing line: ~ end~ + elsif @orientation == :up +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size, @block_size * 2, @r, @g, @b]~ - Inside source: true *** True Line Result - -** Processing line: ~ # Defines story_line as the state.story_line variable.~ + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size, @block_size * 2, @r, @g, @b] +** Processing line: ~ points = [~ - Inside source: true *** True Line Result - # Defines story_line as the state.story_line variable. -** Processing line: ~ def story_line~ + points = [ +** Processing line: ~ {x:@x + x_offset, y:@y},~ - Inside source: true *** True Line Result - def story_line -** Processing line: ~ state.story_line~ + {x:@x + x_offset, y:@y}, +** Processing line: ~ {x:(@x + x_offset)+(@block_size * 3 - @block_offset), y:@y},~ - Inside source: true *** True Line Result - state.story_line -** Processing line: ~ end~ + {x:(@x + x_offset)+(@block_size * 3 - @block_offset), y:@y}, +** Processing line: ~ {x:(@x + x_offset)+(@block_size * 3 - @block_offset), y:@y+(@block_size - @block_offset)},~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + {x:(@x + x_offset)+(@block_size * 3 - @block_offset), y:@y+(@block_size - @block_offset)}, +** Processing line: ~ {x:@x + x_offset + @block_size + @block_size, y:@y+(@block_size - @block_offset)},~ - Inside source: true *** True Line Result - -** Processing line: ~ # Update every 60 frames (or every second)~ + {x:@x + x_offset + @block_size + @block_size, y:@y+(@block_size - @block_offset)}, +** Processing line: ~ {x:@x + x_offset + @block_size + @block_size, y:@y+@block_size*2},~ - Inside source: true *** True Line Result - # Update every 60 frames (or every second) -** Processing line: ~ def should_tick?~ + {x:@x + x_offset + @block_size + @block_size, y:@y+@block_size*2}, +** Processing line: ~ {x:@x + x_offset + @block_size, y:@y+@block_size*2},~ - Inside source: true *** True Line Result - def should_tick? -** Processing line: ~ state.tick_count.mod_zero?(60)~ + {x:@x + x_offset + @block_size, y:@y+@block_size*2}, +** Processing line: ~ {x:@x + x_offset + @block_size, y:@y+(@block_size - @block_offset)},~ - Inside source: true *** True Line Result - state.tick_count.mod_zero?(60) -** Processing line: ~ end~ + {x:@x + x_offset + @block_size, y:@y+(@block_size - @block_offset)}, +** Processing line: ~ {x:@x + x_offset, y:@y+(@block_size - @block_offset)}~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + {x:@x + x_offset, y:@y+(@block_size - @block_offset)} +** Processing line: ~ ]~ - Inside source: true *** True Line Result - -** Processing line: ~ # Sets the value of the game state provider.~ + ] +** Processing line: ~ @squareColliders = [~ - Inside source: true *** True Line Result - # Sets the value of the game state provider. -** Processing line: ~ def initialize game_state_provider~ + @squareColliders = [ +** Processing line: ~ SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}),~ - Inside source: true *** True Line Result - def initialize game_state_provider -** Processing line: ~ @game_state_provider = game_state_provider~ + SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}), +** Processing line: ~ SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}),~ - Inside source: true *** True Line Result - @game_state_provider = game_state_provider -** Processing line: ~ end~ + SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}), +** Processing line: ~ SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}), +** Processing line: ~ SquareCollider.new(points[3].x,points[3].y,{x:1,y:1}),~ - Inside source: true *** True Line Result - -** Processing line: ~ # Defines the game state.~ + SquareCollider.new(points[3].x,points[3].y,{x:1,y:1}), +** Processing line: ~ SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y-COLLISIONWIDTH,{x:1,y:1}),~ - Inside source: true *** True Line Result - # Defines the game state. -** Processing line: ~ # Any variable prefixed with an @ symbol is an instance variable.~ + SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y-COLLISIONWIDTH,{x:1,y:1}), +** Processing line: ~ SquareCollider.new(points[5].x,points[5].y-COLLISIONWIDTH,{x:-1,y:1}),~ - Inside source: true *** True Line Result - # Any variable prefixed with an @ symbol is an instance variable. -** Processing line: ~ def state~ + SquareCollider.new(points[5].x,points[5].y-COLLISIONWIDTH,{x:-1,y:1}), +** Processing line: ~ SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y,{x:-1,y:1}),~ - Inside source: true *** True Line Result - def state -** Processing line: ~ @game_state_provider.state~ + SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y,{x:-1,y:1}), +** Processing line: ~ SquareCollider.new(points[7].x,points[7].y-COLLISIONWIDTH,{x:-1,y:1}),~ - Inside source: true *** True Line Result - @game_state_provider.state -** Processing line: ~ end~ + SquareCollider.new(points[7].x,points[7].y-COLLISIONWIDTH,{x:-1,y:1}), +** Processing line: ~ ]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + ] +** Processing line: ~ @colliders = [~ - Inside source: true *** True Line Result - -** Processing line: ~ # Saves the state of the game in a text file called game_state.txt.~ + @colliders = [ +** Processing line: ~ LinearCollider.new(points[0],points[1], :neg),~ - Inside source: true *** True Line Result - # Saves the state of the game in a text file called game_state.txt. -** Processing line: ~ def save~ + LinearCollider.new(points[0],points[1], :neg), +** Processing line: ~ LinearCollider.new(points[1],points[2], :neg),~ - Inside source: true *** True Line Result - def save -** Processing line: ~ $gtk.serialize_state('game_state.txt', state)~ + LinearCollider.new(points[1],points[2], :neg), +** Processing line: ~ LinearCollider.new(points[2],points[3], :pos),~ - Inside source: true *** True Line Result - $gtk.serialize_state('game_state.txt', state) -** Processing line: ~ end~ + LinearCollider.new(points[2],points[3], :pos), +** Processing line: ~ LinearCollider.new(points[3],points[4], :neg),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + LinearCollider.new(points[3],points[4], :neg), +** Processing line: ~ LinearCollider.new(points[4],points[5], :pos),~ - Inside source: true *** True Line Result - -** Processing line: ~ # Loads the game state from the game_state.txt text file.~ + LinearCollider.new(points[4],points[5], :pos), +** Processing line: ~ LinearCollider.new(points[5],points[6], :neg),~ - Inside source: true *** True Line Result - # Loads the game state from the game_state.txt text file. -** Processing line: ~ # If the load is unsuccessful, the user is informed since the story line indicates the failure.~ + LinearCollider.new(points[5],points[6], :neg), +** Processing line: ~ LinearCollider.new(points[6],points[7], :pos),~ - Inside source: true *** True Line Result - # If the load is unsuccessful, the user is informed since the story line indicates the failure. -** Processing line: ~ def load~ + LinearCollider.new(points[6],points[7], :pos), +** Processing line: ~ LinearCollider.new(points[0],points[7], :pos)~ - Inside source: true *** True Line Result - def load -** Processing line: ~ parsed_state = $gtk.deserialize_state('game_state.txt')~ + LinearCollider.new(points[0],points[7], :pos) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - parsed_state = $gtk.deserialize_state('game_state.txt') -** Processing line: ~ if !parsed_state~ + ] +** Processing line: ~ elsif @orientation == :left~ - Inside source: true *** True Line Result - if !parsed_state -** Processing line: ~ set_story_line "no game to load. press save first."~ + elsif @orientation == :left +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - set_story_line "no game to load. press save first." -** Processing line: ~ else~ + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - else -** Processing line: ~ $gtk.args.state = parsed_state~ + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2 - @block_offset, @block_size - @block_offset, @r, @g, @b] +** Processing line: ~ xh = @x + x_offset~ - Inside source: true *** True Line Result - $gtk.args.state = parsed_state -** Processing line: ~ end~ + xh = @x + x_offset +** Processing line: ~ #points = [~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + #points = [ +** Processing line: ~ #{x:@x + x_offset, y:@y},~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #{x:@x + x_offset, y:@y}, +** Processing line: ~ #{x:(@x + x_offset)+(@block_size - @block_offset), y:@y},~ - Inside source: true *** True Line Result - -** Processing line: ~ # Resets the game.~ + #{x:(@x + x_offset)+(@block_size - @block_offset), y:@y}, +** Processing line: ~ #{x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size},~ - Inside source: true *** True Line Result - # Resets the game. -** Processing line: ~ def reset~ + #{x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size}, +** Processing line: ~ #{x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size},~ - Inside source: true *** True Line Result - def reset -** Processing line: ~ $gtk.reset~ + #{x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size}, +** Processing line: ~ #{x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size+@block_size},~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~ end~ + #{x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size+@block_size}, +** Processing line: ~ #{x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size+@block_size},~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + #{x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size+@block_size}, +** Processing line: ~ #{x:(@x + x_offset)+(@block_size - @block_offset), y:@y+ @block_size * 3 - @block_offset},~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #{x:(@x + x_offset)+(@block_size - @block_offset), y:@y+ @block_size * 3 - @block_offset}, +** Processing line: ~ #{x:@x + x_offset , y:@y+ @block_size * 3 - @block_offset}~ - Inside source: true *** True Line Result - -** Processing line: ~ class TextedBasedGamePresenter~ + #{x:@x + x_offset , y:@y+ @block_size * 3 - @block_offset} +** Processing line: ~ #]~ - Inside source: true *** True Line Result - class TextedBasedGamePresenter -** Processing line: ~ attr_accessor :state, :outputs, :inputs~ + #] +** Processing line: ~ points = [~ - Inside source: true *** True Line Result - attr_accessor :state, :outputs, :inputs -** Processing line: ~~ + points = [ +** Processing line: ~ {x:@x + x_offset + @block_size, y:@y},~ - Inside source: true *** True Line Result - -** Processing line: ~ # Creates empty collection called highlights.~ + {x:@x + x_offset + @block_size, y:@y}, +** Processing line: ~ {x:@x + x_offset + @block_size + (@block_size - @block_offset), y:@y},~ - Inside source: true *** True Line Result - # Creates empty collection called highlights. -** Processing line: ~ # Calls methods necessary to run the game.~ + {x:@x + x_offset + @block_size + (@block_size - @block_offset), y:@y}, +** Processing line: ~ {x:@x + x_offset + @block_size + (@block_size - @block_offset),y:@y+@block_size*3- @block_offset},~ - Inside source: true *** True Line Result - # Calls methods necessary to run the game. -** Processing line: ~ def tick~ + {x:@x + x_offset + @block_size + (@block_size - @block_offset),y:@y+@block_size*3- @block_offset}, +** Processing line: ~ {x:@x + x_offset + @block_size, y:@y+@block_size*3- @block_offset},~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ state.layout.highlights ||= []~ + {x:@x + x_offset + @block_size, y:@y+@block_size*3- @block_offset}, +** Processing line: ~ {x:@x + x_offset+@block_size, y:@y+@block_size*2- @block_offset},~ - Inside source: true *** True Line Result - state.layout.highlights ||= [] -** Processing line: ~ game.tick if game.should_tick?~ + {x:@x + x_offset+@block_size, y:@y+@block_size*2- @block_offset}, +** Processing line: ~ {x:@x + x_offset, y:@y+@block_size*2- @block_offset},~ - Inside source: true *** True Line Result - game.tick if game.should_tick? -** Processing line: ~ render~ + {x:@x + x_offset, y:@y+@block_size*2- @block_offset}, +** Processing line: ~ {x:@x + x_offset, y:@y+@block_size},~ - Inside source: true *** True Line Result - render -** Processing line: ~ process_input~ + {x:@x + x_offset, y:@y+@block_size}, +** Processing line: ~ {x:@x + x_offset+@block_size, y:@y+@block_size}~ - Inside source: true *** True Line Result - process_input -** Processing line: ~ end~ + {x:@x + x_offset+@block_size, y:@y+@block_size} +** Processing line: ~ ]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + ] +** Processing line: ~ @squareColliders = [~ - Inside source: true *** True Line Result - -** Processing line: ~ # Outputs a label of the tick count (passage of time) and calls all render methods.~ + @squareColliders = [ +** Processing line: ~ SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}),~ - Inside source: true *** True Line Result - # Outputs a label of the tick count (passage of time) and calls all render methods. -** Processing line: ~ def render~ + SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}), +** Processing line: ~ SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}),~ - Inside source: true *** True Line Result - def render -** Processing line: ~ outputs.labels << [10, 30, state.tick_count]~ + SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}), +** Processing line: ~ SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}),~ - Inside source: true *** True Line Result - outputs.labels << [10, 30, state.tick_count] -** Processing line: ~ render_alert~ + SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}), +** Processing line: ~ SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:-1,y:1}),~ - Inside source: true *** True Line Result - render_alert -** Processing line: ~ render_room~ + SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:-1,y:1}), +** Processing line: ~ SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y,{x:-1,y:1}),~ - Inside source: true *** True Line Result - render_room -** Processing line: ~ render_highlights~ + SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y,{x:-1,y:1}), +** Processing line: ~ SquareCollider.new(points[5].x,points[5].y-COLLISIONWIDTH,{x:-1,y:1}),~ - Inside source: true *** True Line Result - render_highlights -** Processing line: ~ end~ + SquareCollider.new(points[5].x,points[5].y-COLLISIONWIDTH,{x:-1,y:1}), +** Processing line: ~ SquareCollider.new(points[6].x,points[6].y,{x:-1,y:-1}),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + SquareCollider.new(points[6].x,points[6].y,{x:-1,y:-1}), +** Processing line: ~ SquareCollider.new(points[7].x-COLLISIONWIDTH,points[7].y-COLLISIONWIDTH,{x:-1,y:-1}),~ - Inside source: true *** True Line Result - -** Processing line: ~ # Outputs a label onto the screen that shows the story line, and also outputs a "close" button.~ + SquareCollider.new(points[7].x-COLLISIONWIDTH,points[7].y-COLLISIONWIDTH,{x:-1,y:-1}), +** Processing line: ~ ]~ - Inside source: true *** True Line Result - # Outputs a label onto the screen that shows the story line, and also outputs a "close" button. -** Processing line: ~ def render_alert~ + ] +** Processing line: ~ @colliders = [~ - Inside source: true *** True Line Result - def render_alert -** Processing line: ~ return unless game.active_module == :alert~ + @colliders = [ +** Processing line: ~ LinearCollider.new(points[0],points[1], :neg),~ - Inside source: true *** True Line Result - return unless game.active_module == :alert -** Processing line: ~~ + LinearCollider.new(points[0],points[1], :neg), +** Processing line: ~ LinearCollider.new(points[1],points[2], :neg),~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.labels << [640, 480, game.story_line, 5, 1] # outputs story line label~ + LinearCollider.new(points[1],points[2], :neg), +** Processing line: ~ LinearCollider.new(points[2],points[3], :pos),~ - Inside source: true *** True Line Result - outputs.labels << [640, 480, game.story_line, 5, 1] # outputs story line label -** Processing line: ~ outputs.primitives << button(:alert_dismiss, 490, 380, "close") # positions "close" button under story line~ + LinearCollider.new(points[2],points[3], :pos), +** Processing line: ~ LinearCollider.new(points[3],points[4], :neg),~ - Inside source: true *** True Line Result - outputs.primitives << button(:alert_dismiss, 490, 380, "close") # positions "close" button under story line -** Processing line: ~ end~ + LinearCollider.new(points[3],points[4], :neg), +** Processing line: ~ LinearCollider.new(points[4],points[5], :pos),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + LinearCollider.new(points[4],points[5], :pos), +** Processing line: ~ LinearCollider.new(points[5],points[6], :neg),~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_room~ + LinearCollider.new(points[5],points[6], :neg), +** Processing line: ~ LinearCollider.new(points[6],points[7], :neg),~ - Inside source: true *** True Line Result - def render_room -** Processing line: ~ return unless game.active_module == :room~ + LinearCollider.new(points[6],points[7], :neg), +** Processing line: ~ LinearCollider.new(points[0],points[7], :pos)~ - Inside source: true *** True Line Result - return unless game.active_module == :room -** Processing line: ~ outputs.labels << [640, 700, game.room_title, 4, 1] # outputs room title label at top of screen~ + LinearCollider.new(points[0],points[7], :pos) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - outputs.labels << [640, 700, game.room_title, 4, 1] # outputs room title label at top of screen -** Processing line: ~~ + ] +** Processing line: ~ elsif @orientation == :down~ - Inside source: true *** True Line Result - -** Processing line: ~ # The parameters for these outputs are (symbol, x, y, text, value/percentage) and each has a y value~ + elsif @orientation == :down +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - # The parameters for these outputs are (symbol, x, y, text, value/percentage) and each has a y value -** Processing line: ~ # that positions it 60 pixels lower than the previous output.~ + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - # that positions it 60 pixels lower than the previous output. + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # outputs the light_fire_progress bar, uses light_fire_progress for its percentage (which changes bar's appearance)~ +** Processing line: ~ points = [~ - Inside source: true *** True Line Result - # outputs the light_fire_progress bar, uses light_fire_progress for its percentage (which changes bar's appearance) -** Processing line: ~ outputs.primitives << progress_bar(:light_fire, 490, 600, "light fire", game.light_fire_progress)~ + points = [ +** Processing line: ~ {x:@x + x_offset, y:@y+(@block_size*2)-@block_offset},~ - Inside source: true *** True Line Result - outputs.primitives << progress_bar(:light_fire, 490, 600, "light fire", game.light_fire_progress) -** Processing line: ~ outputs.primitives << button( :save_game, 490, 540, "save") # outputs save button~ + {x:@x + x_offset, y:@y+(@block_size*2)-@block_offset}, +** Processing line: ~ {x:@x + x_offset+ @block_size*3-@block_offset, y:@y+(@block_size*2)-@block_offset},~ - Inside source: true *** True Line Result - outputs.primitives << button( :save_game, 490, 540, "save") # outputs save button -** Processing line: ~ outputs.primitives << button( :load_game, 490, 480, "load") # outputs load button~ + {x:@x + x_offset+ @block_size*3-@block_offset, y:@y+(@block_size*2)-@block_offset}, +** Processing line: ~ {x:@x + x_offset+ @block_size*3-@block_offset, y:@y+(@block_size)},~ - Inside source: true *** True Line Result - outputs.primitives << button( :load_game, 490, 480, "load") # outputs load button -** Processing line: ~ outputs.primitives << button( :reset_game, 490, 420, "reset") # outputs reset button~ + {x:@x + x_offset+ @block_size*3-@block_offset, y:@y+(@block_size)}, +** Processing line: ~ {x:@x + x_offset+ @block_size*2-@block_offset, y:@y+(@block_size)},~ - Inside source: true *** True Line Result - outputs.primitives << button( :reset_game, 490, 420, "reset") # outputs reset button -** Processing line: ~ outputs.labels << [640, 30, "the fire is #{game.fire}", 0, 1] # outputs fire label at bottom of screen~ + {x:@x + x_offset+ @block_size*2-@block_offset, y:@y+(@block_size)}, +** Processing line: ~ {x:@x + x_offset+ @block_size*2-@block_offset, y:@y},#~ - Inside source: true *** True Line Result - outputs.labels << [640, 30, "the fire is #{game.fire}", 0, 1] # outputs fire label at bottom of screen -** Processing line: ~ end~ + {x:@x + x_offset+ @block_size*2-@block_offset, y:@y},# +** Processing line: ~ {x:@x + x_offset+ @block_size, y:@y},#~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + {x:@x + x_offset+ @block_size, y:@y},# +** Processing line: ~ {x:@x + x_offset + @block_size, y:@y+(@block_size)},~ - Inside source: true *** True Line Result - -** Processing line: ~ # Outputs a collection of highlights using an array to set their values, and also rejects certain values from the collection.~ + {x:@x + x_offset + @block_size, y:@y+(@block_size)}, +** Processing line: ~ {x:@x + x_offset, y:@y+(@block_size)}~ - Inside source: true *** True Line Result - # Outputs a collection of highlights using an array to set their values, and also rejects certain values from the collection. -** Processing line: ~ def render_highlights~ + {x:@x + x_offset, y:@y+(@block_size)} +** Processing line: ~ ]~ - Inside source: true *** True Line Result - def render_highlights -** Processing line: ~ state.layout.highlights.each do |h| # for each highlight in the collection~ + ] +** Processing line: ~ @squareColliders = [~ - Inside source: true *** True Line Result - state.layout.highlights.each do |h| # for each highlight in the collection -** Processing line: ~ h.lifetime -= 1 # decrease the value of its lifetime~ + @squareColliders = [ +** Processing line: ~ SquareCollider.new(points[0].x,points[0].y-COLLISIONWIDTH,{x:-1,y:1}),~ - Inside source: true *** True Line Result - h.lifetime -= 1 # decrease the value of its lifetime -** Processing line: ~ end~ + SquareCollider.new(points[0].x,points[0].y-COLLISIONWIDTH,{x:-1,y:1}), +** Processing line: ~ SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y-COLLISIONWIDTH,{x:1,y:1}),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y-COLLISIONWIDTH,{x:1,y:1}), +** Processing line: ~ SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y,{x:1,y:-1}),~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.solids << state.layout.highlights.map do |h| # outputs highlights collection~ + SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y,{x:1,y:-1}), +** Processing line: ~ SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:1,y:-1}),~ - Inside source: true *** True Line Result - outputs.solids << state.layout.highlights.map do |h| # outputs highlights collection -** Processing line: ~ [h.x, h.y, h.w, h.h, h.color, 255 * h.lifetime / h.max_lifetime] # sets definition for each highlight~ + SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:1,y:-1}), +** Processing line: ~ SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y,{x:1,y:-1}),~ - Inside source: true *** True Line Result - [h.x, h.y, h.w, h.h, h.color, 255 * h.lifetime / h.max_lifetime] # sets definition for each highlight -** Processing line: ~ # transparency changes; divide lifetime by max_lifetime, multiply result by 255~ + SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y,{x:1,y:-1}), +** Processing line: ~ SquareCollider.new(points[5].x,points[5].y,{x:-1,y:-1}),~ - Inside source: true *** True Line Result - # transparency changes; divide lifetime by max_lifetime, multiply result by 255 -** Processing line: ~ end~ + SquareCollider.new(points[5].x,points[5].y,{x:-1,y:-1}), +** Processing line: ~ SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y-COLLISIONWIDTH,{x:-1,y:-1}),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y-COLLISIONWIDTH,{x:-1,y:-1}), +** Processing line: ~ SquareCollider.new(points[7].x,points[7].y,{x:-1,y:-1}),~ - Inside source: true *** True Line Result - -** Processing line: ~ # reject highlights from collection that have no remaining lifetime~ + SquareCollider.new(points[7].x,points[7].y,{x:-1,y:-1}), +** Processing line: ~ ]~ - Inside source: true *** True Line Result - # reject highlights from collection that have no remaining lifetime -** Processing line: ~ state.layout.highlights = state.layout.highlights.reject { |h| h.lifetime <= 0 }~ + ] +** Processing line: ~ @colliders = [~ - Inside source: true *** True Line Result - state.layout.highlights = state.layout.highlights.reject { |h| h.lifetime <= 0 } -** Processing line: ~ end~ + @colliders = [ +** Processing line: ~ LinearCollider.new(points[0],points[1], :pos),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + LinearCollider.new(points[0],points[1], :pos), +** Processing line: ~ LinearCollider.new(points[1],points[2], :pos),~ - Inside source: true *** True Line Result - -** Processing line: ~ # Checks whether or not a button was clicked.~ + LinearCollider.new(points[1],points[2], :pos), +** Processing line: ~ LinearCollider.new(points[2],points[3], :neg),~ - Inside source: true *** True Line Result - # Checks whether or not a button was clicked. -** Processing line: ~ # Returns a boolean value.~ + LinearCollider.new(points[2],points[3], :neg), +** Processing line: ~ LinearCollider.new(points[3],points[4], :pos),~ - Inside source: true *** True Line Result - # Returns a boolean value. -** Processing line: ~ def process_input~ + LinearCollider.new(points[3],points[4], :pos), +** Processing line: ~ LinearCollider.new(points[4],points[5], :neg),~ - Inside source: true *** True Line Result - def process_input -** Processing line: ~ button = button_clicked? # calls button_clicked? method~ + LinearCollider.new(points[4],points[5], :neg), +** Processing line: ~ LinearCollider.new(points[5],points[6], :pos),~ - Inside source: true *** True Line Result - button = button_clicked? # calls button_clicked? method -** Processing line: ~ end~ + LinearCollider.new(points[5],points[6], :pos), +** Processing line: ~ LinearCollider.new(points[6],points[7], :neg),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + LinearCollider.new(points[6],points[7], :neg), +** Processing line: ~ LinearCollider.new(points[0],points[7], :neg)~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns a boolean value.~ + LinearCollider.new(points[0],points[7], :neg) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - # Returns a boolean value. -** Processing line: ~ # Finds the button that was clicked from the button list and determines what method to call.~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Finds the button that was clicked from the button list and determines what method to call. -** Processing line: ~ # Adds a highlight to the highlights collection.~ + end +** Processing line: ~ return points~ - Inside source: true *** True Line Result - # Adds a highlight to the highlights collection. -** Processing line: ~ def button_clicked?~ + return points +** Processing line: ~ end~ - Inside source: true *** True Line Result - def button_clicked? -** Processing line: ~ return nil unless click_pos # return nil unless click_pos holds coordinates of mouse click~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - return nil unless click_pos # return nil unless click_pos holds coordinates of mouse click -** Processing line: ~ button = @button_list.find do |k, v| # goes through button_list to find button clicked~ + +** Processing line: ~ def draw(args)~ - Inside source: true *** True Line Result - button = @button_list.find do |k, v| # goes through button_list to find button clicked -** Processing line: ~ click_pos.inside_rect? v[:primitives].last.rect # was the mouse clicked inside the rect of button?~ + def draw(args) +** Processing line: ~ #Offset the coordinates to the edge of the game area~ - Inside source: true *** True Line Result - click_pos.inside_rect? v[:primitives].last.rect # was the mouse clicked inside the rect of button? -** Processing line: ~ end~ + #Offset the coordinates to the edge of the game area +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2)~ - Inside source: true *** True Line Result - end -** Processing line: ~ return unless button # return unless a button was clicked~ + x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2) +** Processing line: ~~ - Inside source: true *** True Line Result - return unless button # return unless a button was clicked -** Processing line: ~ method_to_call = "#{button[0]}_clicked".to_sym # sets method_to_call to symbol (like :save_game or :load_game)~ + +** Processing line: ~ if @orientation == :right~ - Inside source: true *** True Line Result - method_to_call = "#{button[0]}_clicked".to_sym # sets method_to_call to symbol (like :save_game or :load_game) -** Processing line: ~ if self.respond_to? method_to_call # returns true if self responds to the given method (method actually exists)~ + if @orientation == :right +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - if self.respond_to? method_to_call # returns true if self responds to the given method (method actually exists) -** Processing line: ~ border = button[1][:primitives].last # sets border definition using value of last key in button list hash~ + #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset), y: @y, w: @block_size - @block_offset, h: (@block_size * 3 - @block_offset), r: @r , g: @g, b: @b}~ - Inside source: true *** True Line Result - border = button[1][:primitives].last # sets border definition using value of last key in button list hash -** Processing line: ~~ + args.outputs.solids << {x: (@x + x_offset), y: @y, w: @block_size - @block_offset, h: (@block_size * 3 - @block_offset), r: @r , g: @g, b: @b} +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2, @block_size, @r, @g, @b]~ - Inside source: true *** True Line Result - -** Processing line: ~ # declares each highlight as a new entity, sets properties~ + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2, @block_size, @r, @g, @b] +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 2), h: (@block_size), r: @r , g: @g, b: @b }~ - Inside source: true *** True Line Result - # declares each highlight as a new entity, sets properties -** Processing line: ~ state.layout.highlights << state.new_entity(:highlight) do |h|~ + args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 2), h: (@block_size), r: @r , g: @g, b: @b } +** Processing line: ~ elsif @orientation == :up~ - Inside source: true *** True Line Result - state.layout.highlights << state.new_entity(:highlight) do |h| -** Processing line: ~ h.x = border.x~ + elsif @orientation == :up +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - h.x = border.x -** Processing line: ~ h.y = border.y~ + #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset), y: (@y), w: (@block_size * 3 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b}~ - Inside source: true *** True Line Result - h.y = border.y -** Processing line: ~ h.w = border.w~ + args.outputs.solids << {x: (@x + x_offset), y: (@y), w: (@block_size * 3 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b} +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size, @block_size * 2, @r, @g, @b]~ - Inside source: true *** True Line Result - h.w = border.w -** Processing line: ~ h.h = border.h~ + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size, @block_size * 2, @r, @g, @b] +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size), h: (@block_size * 2), r: @r , g: @g, b: @b}~ - Inside source: true *** True Line Result - h.h = border.h -** Processing line: ~ h.max_lifetime = 10~ + args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size), h: (@block_size * 2), r: @r , g: @g, b: @b} +** Processing line: ~ elsif @orientation == :left~ - Inside source: true *** True Line Result - h.max_lifetime = 10 -** Processing line: ~ h.lifetime = h.max_lifetime~ + elsif @orientation == :left +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - h.lifetime = h.max_lifetime -** Processing line: ~ h.color = [120, 120, 180] # sets color to shade of purple~ + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size - @block_offset), h: (@block_size * 3 - @block_offset), r: @r , g: @g, b: @b}~ - Inside source: true *** True Line Result - h.color = [120, 120, 180] # sets color to shade of purple -** Processing line: ~ end~ + args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size - @block_offset), h: (@block_size * 3 - @block_offset), r: @r , g: @g, b: @b} +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2 - @block_offset, @block_size - @block_offset, @r, @g, @b] +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 2 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b}~ - Inside source: true *** True Line Result - -** Processing line: ~ self.send method_to_call # invoke method identified by symbol~ + args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 2 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b} +** Processing line: ~ elsif @orientation == :down~ - Inside source: true *** True Line Result - self.send method_to_call # invoke method identified by symbol -** Processing line: ~ else # otherwise, if self doesn't respond to given method~ + elsif @orientation == :down +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - else # otherwise, if self doesn't respond to given method -** Processing line: ~ border = button[1][:primitives].last # sets border definition using value of last key in hash~ + #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 3 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b}~ - Inside source: true *** True Line Result - border = button[1][:primitives].last # sets border definition using value of last key in hash -** Processing line: ~~ + args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 3 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b} +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - -** Processing line: ~ # declares each highlight as a new entity, sets properties~ + #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b] +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size - @block_offset), h: ( @block_size * 2 - @block_offset), r: @r , g: @g, b: @b}~ - Inside source: true *** True Line Result - # declares each highlight as a new entity, sets properties -** Processing line: ~ state.layout.highlights << state.new_entity(:highlight) do |h|~ + args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size - @block_offset), h: ( @block_size * 2 - @block_offset), r: @r , g: @g, b: @b} +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.layout.highlights << state.new_entity(:highlight) do |h| -** Processing line: ~ h.x = border.x~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - h.x = border.x -** Processing line: ~ h.y = border.y~ + +** Processing line: ~ #psize = 5.0~ - Inside source: true *** True Line Result - h.y = border.y -** Processing line: ~ h.w = border.w~ + #psize = 5.0 +** Processing line: ~ #for p in @shapePoints~ - Inside source: true *** True Line Result - h.w = border.w -** Processing line: ~ h.h = border.h~ + #for p in @shapePoints +** Processing line: ~ #args.outputs.solids << [p.x-psize/2, p.y-psize/2, psize, psize, 0, 0, 0]~ - Inside source: true *** True Line Result - h.h = border.h -** Processing line: ~ h.max_lifetime = 4 # different max_lifetime than the one set if respond_to? had been true~ + #args.outputs.solids << [p.x-psize/2, p.y-psize/2, psize, psize, 0, 0, 0] +** Processing line: ~ #end~ - Inside source: true *** True Line Result - h.max_lifetime = 4 # different max_lifetime than the one set if respond_to? had been true -** Processing line: ~ h.lifetime = h.max_lifetime~ + #end +** Processing line: ~ args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s]~ - Inside source: true *** True Line Result - h.lifetime = h.max_lifetime -** Processing line: ~ h.color = [120, 80, 80] # sets color to dark color~ + args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s] +** Processing line: ~~ - Inside source: true *** True Line Result - h.color = [120, 80, 80] # sets color to dark color -** Processing line: ~ end~ + +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # instructions for users on how to add the missing method_to_call to the code~ +** Processing line: ~ def updateOne_old args~ - Inside source: true *** True Line Result - # instructions for users on how to add the missing method_to_call to the code -** Processing line: ~ puts "It looks like #{method_to_call} doesn't exists on TextedBasedGamePresenter. Please add this method:"~ + def updateOne_old args +** Processing line: ~ didHit = false~ - Inside source: true *** True Line Result - puts "It looks like #{method_to_call} doesn't exists on TextedBasedGamePresenter. Please add this method:" -** Processing line: ~ puts "Just copy the code below and put it in the #{TextedBasedGamePresenter} class definition."~ + didHit = false +** Processing line: ~ hitter = nil~ - Inside source: true *** True Line Result - puts "Just copy the code below and put it in the #{TextedBasedGamePresenter} class definition." -** Processing line: ~ puts ""~ + hitter = nil +** Processing line: ~ toCollide = nil~ - Inside source: true *** True Line Result - puts "" -** Processing line: ~ puts "```"~ + toCollide = nil +** Processing line: ~ for b in args.state.balls~ - Inside source: true *** True Line Result - puts "```" -** Processing line: ~ puts "class TextedBasedGamePresenter <--- find this class and put the method below in it"~ + for b in args.state.balls +** Processing line: ~ if [b.x, b.y, b.width, b.height].intersect_rect?(@bold)~ - Inside source: true *** True Line Result - puts "class TextedBasedGamePresenter <--- find this class and put the method below in it" -** Processing line: ~ puts ""~ + if [b.x, b.y, b.width, b.height].intersect_rect?(@bold) +** Processing line: ~ didSquare = false~ - Inside source: true *** True Line Result - puts "" -** Processing line: ~ puts " def #{method_to_call}"~ + didSquare = false +** Processing line: ~ for s in @squareColliders~ - Inside source: true *** True Line Result - puts " def #{method_to_call}" -** Processing line: ~ puts " puts 'Yay that worked!'"~ + for s in @squareColliders +** Processing line: ~ if (s.collision?(args, b))~ - Inside source: true *** True Line Result - puts " puts 'Yay that worked!'" -** Processing line: ~ puts " end"~ + if (s.collision?(args, b)) +** Processing line: ~ didSquare = true~ - Inside source: true *** True Line Result - puts " end" -** Processing line: ~ puts ""~ + didSquare = true +** Processing line: ~ didHit = true~ - Inside source: true *** True Line Result - puts "" -** Processing line: ~ puts "end <-- make sure to put the #{method_to_call} method in between the `class` word and the final `end` statement."~ + didHit = true +** Processing line: ~ #s.collide(args, b)~ - Inside source: true *** True Line Result - puts "end <-- make sure to put the #{method_to_call} method in between the `class` word and the final `end` statement." -** Processing line: ~ puts "```"~ + #s.collide(args, b) +** Processing line: ~ toCollide = s~ - Inside source: true *** True Line Result - puts "```" -** Processing line: ~ puts ""~ + toCollide = s +** Processing line: ~ hitter = b~ - Inside source: true *** True Line Result - puts "" -** Processing line: ~ end~ + hitter = b +** Processing line: ~ break~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + break +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns the position of the mouse when it is clicked.~ + end +** Processing line: ~ if (didSquare == false)~ - Inside source: true *** True Line Result - # Returns the position of the mouse when it is clicked. -** Processing line: ~ def click_pos~ + if (didSquare == false) +** Processing line: ~ for c in @colliders~ - Inside source: true *** True Line Result - def click_pos -** Processing line: ~ return nil unless inputs.mouse.click # returns nil unless the mouse was clicked~ + for c in @colliders +** Processing line: ~ #puts args.state.ball.velocity~ - Inside source: true *** True Line Result - return nil unless inputs.mouse.click # returns nil unless the mouse was clicked -** Processing line: ~ return inputs.mouse.click.point # returns location of mouse click (coordinates)~ + #puts args.state.ball.velocity +** Processing line: ~ if c.collision?(args, b.getPoints(args),b)~ - Inside source: true *** True Line Result - return inputs.mouse.click.point # returns location of mouse click (coordinates) -** Processing line: ~ end~ + if c.collision?(args, b.getPoints(args),b) +** Processing line: ~ #c.collide args, b~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #c.collide args, b +** Processing line: ~ toCollide = c~ - Inside source: true *** True Line Result - -** Processing line: ~ # Creates buttons for the button_list and sets their values using a hash (uses symbols as keys)~ + toCollide = c +** Processing line: ~ didHit = true~ - Inside source: true *** True Line Result - # Creates buttons for the button_list and sets their values using a hash (uses symbols as keys) -** Processing line: ~ def button id, x, y, text~ + didHit = true +** Processing line: ~ hitter = b~ - Inside source: true *** True Line Result - def button id, x, y, text -** Processing line: ~ @button_list[id] ||= { # assigns values to hash keys~ + hitter = b +** Processing line: ~ break~ - Inside source: true *** True Line Result - @button_list[id] ||= { # assigns values to hash keys -** Processing line: ~ id: id,~ + break +** Processing line: ~ end~ - Inside source: true *** True Line Result - id: id, -** Processing line: ~ text: text,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - text: text, -** Processing line: ~ primitives: [~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - primitives: [ -** Processing line: ~ [x + 10, y + 30, text, 2, 0].label, # positions label inside border~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [x + 10, y + 30, text, 2, 0].label, # positions label inside border -** Processing line: ~ [x, y, 300, 50].border, # sets definition of border~ + end +** Processing line: ~ if didHit~ - Inside source: true *** True Line Result - [x, y, 300, 50].border, # sets definition of border -** Processing line: ~ ]~ + if didHit +** Processing line: ~ break~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + break +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ @button_list[id][:primitives] # returns label and border for buttons~ + end +** Processing line: ~ if (didHit)~ - Inside source: true *** True Line Result - @button_list[id][:primitives] # returns label and border for buttons -** Processing line: ~ end~ + if (didHit) +** Processing line: ~ @count=0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + @count=0 +** Processing line: ~ hitter.makeLeader args~ - Inside source: true *** True Line Result - -** Processing line: ~ # Creates a progress bar (used for lighting the fire) and sets its values.~ + hitter.makeLeader args +** Processing line: ~ #toCollide.collide(args, hitter)~ - Inside source: true *** True Line Result - # Creates a progress bar (used for lighting the fire) and sets its values. -** Processing line: ~ def progress_bar id, x, y, text, percentage~ + #toCollide.collide(args, hitter) +** Processing line: ~ args.state.tshapes.delete(self)~ - Inside source: true *** True Line Result - def progress_bar id, x, y, text, percentage -** Processing line: ~ @button_list[id] = { # assigns values to hash keys~ + args.state.tshapes.delete(self) +** Processing line: ~ #puts "HIT!" + hitter.number~ - Inside source: true *** True Line Result - @button_list[id] = { # assigns values to hash keys -** Processing line: ~ id: id,~ + #puts "HIT!" + hitter.number +** Processing line: ~ end~ - Inside source: true *** True Line Result - id: id, -** Processing line: ~ text: text,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - text: text, -** Processing line: ~ primitives: [~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - primitives: [ -** Processing line: ~ [x, y, 300, 50, 100, 100, 100].solid, # sets definition for solid (which fills the bar with gray)~ + +** Processing line: ~ def update_old args~ - Inside source: true *** True Line Result - [x, y, 300, 50, 100, 100, 100].solid, # sets definition for solid (which fills the bar with gray) -** Processing line: ~ [x + 10, y + 30, text, 2, 0].label, # sets definition for label, positions inside border~ + def update_old args +** Processing line: ~ if (@count == 1)~ - Inside source: true *** True Line Result - [x + 10, y + 30, text, 2, 0].label, # sets definition for label, positions inside border -** Processing line: ~ [x, y, 300, 50].border, # sets definition of border~ + if (@count == 1) +** Processing line: ~ updateOne args~ - Inside source: true *** True Line Result - [x, y, 300, 50].border, # sets definition of border -** Processing line: ~ ]~ + updateOne args +** Processing line: ~ return~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~~ + end +** Processing line: ~ didHit = false~ - Inside source: true *** True Line Result - -** Processing line: ~ # Fills progress bar based on percentage. If the fire was ready to be lit (100%) and we multiplied by~ + didHit = false +** Processing line: ~ hitter = nil~ - Inside source: true *** True Line Result - # Fills progress bar based on percentage. If the fire was ready to be lit (100%) and we multiplied by -** Processing line: ~ # 100, only 1/3 of the bar would only be filled in. 200 would cause only 2/3 to be filled in.~ + hitter = nil +** Processing line: ~ for b in args.state.ballParents~ - Inside source: true *** True Line Result - # 100, only 1/3 of the bar would only be filled in. 200 would cause only 2/3 to be filled in. -** Processing line: ~ @button_list[id][:primitives][0][2] = 300 * percentage~ + for b in args.state.ballParents +** Processing line: ~ if [b.x, b.y, b.width, b.height].intersect_rect?(@bold)~ - Inside source: true *** True Line Result - @button_list[id][:primitives][0][2] = 300 * percentage -** Processing line: ~ @button_list[id][:primitives]~ + if [b.x, b.y, b.width, b.height].intersect_rect?(@bold) +** Processing line: ~ didSquare = false~ - Inside source: true *** True Line Result - @button_list[id][:primitives] -** Processing line: ~ end~ + didSquare = false +** Processing line: ~ for s in @squareColliders~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + for s in @squareColliders +** Processing line: ~ if (s.collision?(args, b))~ - Inside source: true *** True Line Result - -** Processing line: ~ # Defines the game.~ + if (s.collision?(args, b)) +** Processing line: ~ didSquare = true~ - Inside source: true *** True Line Result - # Defines the game. -** Processing line: ~ def game~ + didSquare = true +** Processing line: ~ didHit=true~ - Inside source: true *** True Line Result - def game -** Processing line: ~ @game~ + didHit=true +** Processing line: ~ s.collide(args, b)~ - Inside source: true *** True Line Result - @game -** Processing line: ~ end~ + s.collide(args, b) +** Processing line: ~ hitter = b~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + hitter = b +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # Initalizes the game and creates an empty list of buttons.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Initalizes the game and creates an empty list of buttons. -** Processing line: ~ def initialize~ + end +** Processing line: ~ if (didSquare == false)~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @game = TextedBasedGame.new self~ + if (didSquare == false) +** Processing line: ~ for c in @colliders~ - Inside source: true *** True Line Result - @game = TextedBasedGame.new self -** Processing line: ~ @button_list ||= {}~ + for c in @colliders +** Processing line: ~ #puts args.state.ball.velocity~ - Inside source: true *** True Line Result - @button_list ||= {} -** Processing line: ~ end~ + #puts args.state.ball.velocity +** Processing line: ~ if c.collision?(args, b.getPoints(args), b)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if c.collision?(args, b.getPoints(args), b) +** Processing line: ~ c.collide args, b~ - Inside source: true *** True Line Result - -** Processing line: ~ # Clears the storyline and takes the user to the room.~ + c.collide args, b +** Processing line: ~ didHit=true~ - Inside source: true *** True Line Result - # Clears the storyline and takes the user to the room. -** Processing line: ~ def alert_dismiss_clicked~ + didHit=true +** Processing line: ~ hitter = b~ - Inside source: true *** True Line Result - def alert_dismiss_clicked -** Processing line: ~ game.clear_storyline~ + hitter = b +** Processing line: ~ end~ - Inside source: true *** True Line Result - game.clear_storyline -** Processing line: ~ game.go_to_room~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - game.go_to_room -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # Lights the fire when the user clicks the "light fire" option.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Lights the fire when the user clicks the "light fire" option. -** Processing line: ~ def light_fire_clicked~ + end +** Processing line: ~ if (didHit)~ - Inside source: true *** True Line Result - def light_fire_clicked -** Processing line: ~ game.light_fire~ + if (didHit) +** Processing line: ~ @count=@count-1~ - Inside source: true *** True Line Result - game.light_fire -** Processing line: ~ end~ + @count=@count-1 +** Processing line: ~ @damageCount.append([(hitter.leastChain+1 - hitter.number)-1, args.state.tick_count])~ - Inside source: true *** True Line Result - end + @damageCount.append([(hitter.leastChain+1 - hitter.number)-1, args.state.tick_count]) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Saves the game when the user clicks the "save" option.~ +** Processing line: ~ if (@count == 0)~ - Inside source: true *** True Line Result - # Saves the game when the user clicks the "save" option. -** Processing line: ~ def save_game_clicked~ + if (@count == 0) +** Processing line: ~ args.state.tshapes.delete(self)~ - Inside source: true *** True Line Result - def save_game_clicked -** Processing line: ~ game.save~ + args.state.tshapes.delete(self) +** Processing line: ~ return~ - Inside source: true *** True Line Result - game.save -** Processing line: ~ end~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ i=0~ +- Inside source: true +*** True Line Result + i=0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Resets the game when the user clicks the "reset" option.~ +** Processing line: ~ while i < @damageCount.length~ - Inside source: true *** True Line Result - # Resets the game when the user clicks the "reset" option. -** Processing line: ~ def reset_game_clicked~ + while i < @damageCount.length +** Processing line: ~ if @damageCount[i][0] <= 0~ - Inside source: true *** True Line Result - def reset_game_clicked -** Processing line: ~ game.reset~ + if @damageCount[i][0] <= 0 +** Processing line: ~ @damageCount.delete_at(i)~ - Inside source: true *** True Line Result - game.reset -** Processing line: ~ end~ + @damageCount.delete_at(i) +** Processing line: ~ i-=1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + i-=1 +** Processing line: ~ elsif @damageCount[i][1].elapsed_time > BALL_DISTANCE~ - Inside source: true *** True Line Result - -** Processing line: ~ # Loads the game when the user clicks the "load" option.~ + elsif @damageCount[i][1].elapsed_time > BALL_DISTANCE +** Processing line: ~ @count-=1~ - Inside source: true *** True Line Result - # Loads the game when the user clicks the "load" option. -** Processing line: ~ def load_game_clicked~ + @count-=1 +** Processing line: ~ @damageCount[i][0]-=1~ - Inside source: true *** True Line Result - def load_game_clicked -** Processing line: ~ game.load~ + @damageCount[i][0]-=1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - game.load -** Processing line: ~ end~ + end +** Processing line: ~ if (@count == 0)~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + if (@count == 0) +** Processing line: ~ args.state.tshapes.delete(self)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.tshapes.delete(self) +** Processing line: ~ return~ - Inside source: true *** True Line Result - -** Processing line: ~ $text_based_rpg = TextedBasedGamePresenter.new~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - $text_based_rpg = TextedBasedGamePresenter.new -** Processing line: ~~ + end +** Processing line: ~ i+=1~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + i+=1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ $text_based_rpg.state = args.state~ + end +** Processing line: ~ end #end update~ - Inside source: true *** True Line Result - $text_based_rpg.state = args.state -** Processing line: ~ $text_based_rpg.outputs = args.outputs~ + end #end update +** Processing line: ~~ - Inside source: true *** True Line Result - $text_based_rpg.outputs = args.outputs -** Processing line: ~ $text_based_rpg.inputs = args.inputs~ + +** Processing line: ~ def update args~ - Inside source: true *** True Line Result - $text_based_rpg.inputs = args.inputs -** Processing line: ~ $text_based_rpg.tick~ + def update args +** Processing line: ~ universalUpdate args, self~ - Inside source: true *** True Line Result - $text_based_rpg.tick -** Processing line: ~ end~ + universalUpdate args, self +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Advanced Rendering - Simple Render Targets - main.rb~ -- Header detected. +** Processing line: ~ class Line~ +- Inside source: true *** True Line Result - + class Line +** Processing line: ~ attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount~ +- Inside source: true *** True Line Result -* Advanced Rendering - Simple Render Targets - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount +** Processing line: ~ def initialize(args, x, y, block_size, orientation, block_offset)~ +- Inside source: true *** True Line Result - + def initialize(args, x, y, block_size, orientation, block_offset) +** Processing line: ~ @x = x * block_size~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/07_advanced_rendering/01_simple_render_targets/app/main.rb~ + @x = x * block_size +** Processing line: ~ @y = y * block_size~ - Inside source: true *** True Line Result - # ./samples/07_advanced_rendering/01_simple_render_targets/app/main.rb -** Processing line: ~ def tick args~ + @y = y * block_size +** Processing line: ~ @block_size = block_size~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ # args.outputs.render_targets are really really powerful.~ + @block_size = block_size +** Processing line: ~ @block_offset = block_offset~ - Inside source: true *** True Line Result - # args.outputs.render_targets are really really powerful. -** Processing line: ~ # They essentially allow you to create a sprite programmatically and cache the result.~ + @block_offset = block_offset +** Processing line: ~ @orientation = orientation~ - Inside source: true *** True Line Result - # They essentially allow you to create a sprite programmatically and cache the result. + @orientation = orientation +** Processing line: ~ @damageCount = []~ +- Inside source: true +*** True Line Result + @damageCount = [] +** Processing line: ~ @home = "lines"~ +- Inside source: true +*** True Line Result + @home = "lines" ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Create a render_target of a :block and a :gradient on tick zero.~ +** Processing line: ~ Kernel.srand()~ - Inside source: true *** True Line Result - # Create a render_target of a :block and a :gradient on tick zero. -** Processing line: ~ if args.state.tick_count == 0~ + Kernel.srand() +** Processing line: ~ @r = rand(255)~ - Inside source: true *** True Line Result - if args.state.tick_count == 0 -** Processing line: ~ args.render_target(:block).solids << [0, 0, 1280, 100]~ + @r = rand(255) +** Processing line: ~ @g = rand(255)~ - Inside source: true *** True Line Result - args.render_target(:block).solids << [0, 0, 1280, 100] + @g = rand(255) +** Processing line: ~ @b = rand(255)~ +- Inside source: true +*** True Line Result + @b = rand(255) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # The gradient is actually just a collection of black solids with increasing~ +** Processing line: ~ @count = rand(MAX_COUNT)+1~ - Inside source: true *** True Line Result - # The gradient is actually just a collection of black solids with increasing -** Processing line: ~ # opacities.~ + @count = rand(MAX_COUNT)+1 +** Processing line: ~~ - Inside source: true *** True Line Result - # opacities. -** Processing line: ~ args.render_target(:gradient).solids << 90.map_with_index do |x|~ + +** Processing line: ~ @shapePoints = getShapePoints(args)~ - Inside source: true *** True Line Result - args.render_target(:gradient).solids << 90.map_with_index do |x| -** Processing line: ~ 50.map_with_index do |y|~ + @shapePoints = getShapePoints(args) +** Processing line: ~ minX={x:INFINITY, y:0}~ - Inside source: true *** True Line Result - 50.map_with_index do |y| -** Processing line: ~ [x * 15, y * 15, 15, 15, 0, 0, 0, (x * 3).fdiv(255) * 255]~ + minX={x:INFINITY, y:0} +** Processing line: ~ minY={x:0, y:INFINITY}~ - Inside source: true *** True Line Result - [x * 15, y * 15, 15, 15, 0, 0, 0, (x * 3).fdiv(255) * 255] -** Processing line: ~ end~ + minY={x:0, y:INFINITY} +** Processing line: ~ maxX={x:-INFINITY, y:0}~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + maxX={x:-INFINITY, y:0} +** Processing line: ~ maxY={x:0, y:-INFINITY}~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + maxY={x:0, y:-INFINITY} +** Processing line: ~ for p in @shapePoints~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + for p in @shapePoints +** Processing line: ~ if p.x < minX.x~ - Inside source: true *** True Line Result - -** Processing line: ~ # Take the :block render_target and present it horizontally centered.~ + if p.x < minX.x +** Processing line: ~ minX = p~ - Inside source: true *** True Line Result - # Take the :block render_target and present it horizontally centered. -** Processing line: ~ # Use a subsection of the render_targetd specified by source_x,~ + minX = p +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Use a subsection of the render_targetd specified by source_x, -** Processing line: ~ # source_y, source_w, source_h.~ + end +** Processing line: ~ if p.x > maxX.x~ - Inside source: true *** True Line Result - # source_y, source_w, source_h. -** Processing line: ~ args.outputs.sprites << { x: 0,~ + if p.x > maxX.x +** Processing line: ~ maxX = p~ - Inside source: true *** True Line Result - args.outputs.sprites << { x: 0, -** Processing line: ~ y: 310,~ + maxX = p +** Processing line: ~ end~ - Inside source: true *** True Line Result - y: 310, -** Processing line: ~ w: 1280,~ + end +** Processing line: ~ if p.y < minY.y~ - Inside source: true *** True Line Result - w: 1280, -** Processing line: ~ h: 100,~ + if p.y < minY.y +** Processing line: ~ minY = p~ - Inside source: true *** True Line Result - h: 100, -** Processing line: ~ path: :block,~ + minY = p +** Processing line: ~ end~ - Inside source: true *** True Line Result - path: :block, -** Processing line: ~ source_x: 0,~ + end +** Processing line: ~ if p.y > maxY.y~ - Inside source: true *** True Line Result - source_x: 0, -** Processing line: ~ source_y: 0,~ + if p.y > maxY.y +** Processing line: ~ maxY = p~ - Inside source: true *** True Line Result - source_y: 0, -** Processing line: ~ source_w: 1280,~ + maxY = p +** Processing line: ~ end~ - Inside source: true *** True Line Result - source_w: 1280, -** Processing line: ~ source_h: 100 }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - source_h: 100 } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # After rendering :block, render gradient on top of :block.~ +** Processing line: ~~ - Inside source: true *** True Line Result - # After rendering :block, render gradient on top of :block. -** Processing line: ~ args.outputs.sprites << [0, 0, 1280, 720, :gradient]~ + +** Processing line: ~ hypotenuse=args.state.ball_hypotenuse~ - Inside source: true *** True Line Result - args.outputs.sprites << [0, 0, 1280, 720, :gradient] + hypotenuse=args.state.ball_hypotenuse ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.labels << [1270, 710, args.gtk.current_framerate, 0, 2, 255, 255, 255]~ -- Inside source: true -*** True Line Result - args.outputs.labels << [1270, 710, args.gtk.current_framerate, 0, 2, 255, 255, 255] -** Processing line: ~ tick_instructions args, "Sample app shows how to use render_targets (programmatically create cached sprites)."~ +** Processing line: ~ @bold = [(minX.x-hypotenuse/2)-1, (minY.y-hypotenuse/2)-1, -((minX.x-hypotenuse/2)-1)+(maxX.x + hypotenuse + 2), -((minY.y-hypotenuse/2)-1)+(maxY.y + hypotenuse + 2)]~ - Inside source: true *** True Line Result - tick_instructions args, "Sample app shows how to use render_targets (programmatically create cached sprites)." -** Processing line: ~ end~ + @bold = [(minX.x-hypotenuse/2)-1, (minY.y-hypotenuse/2)-1, -((minX.x-hypotenuse/2)-1)+(maxX.x + hypotenuse + 2), -((minY.y-hypotenuse/2)-1)+(maxY.y + hypotenuse + 2)] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick_instructions args, text, y = 715~ +** Processing line: ~ def getShapePoints(args)~ - Inside source: true *** True Line Result - def tick_instructions args, text, y = 715 -** Processing line: ~ return if args.state.key_event_occurred~ + def getShapePoints(args) +** Processing line: ~ points=[]~ - Inside source: true *** True Line Result - return if args.state.key_event_occurred -** Processing line: ~ if args.inputs.mouse.click ||~ + points=[] +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2)~ - Inside source: true *** True Line Result - if args.inputs.mouse.click || -** Processing line: ~ args.inputs.keyboard.directional_vector ||~ + x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2) +** Processing line: ~~ - Inside source: true *** True Line Result - args.inputs.keyboard.directional_vector || -** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ + +** Processing line: ~ if @orientation == :right~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.enter || -** Processing line: ~ args.inputs.keyboard.key_down.escape~ + if @orientation == :right +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.escape -** Processing line: ~ args.state.key_event_occurred = true~ + #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] +** Processing line: ~ xa =@x + x_offset~ - Inside source: true *** True Line Result - args.state.key_event_occurred = true -** Processing line: ~ end~ + xa =@x + x_offset +** Processing line: ~ ya =@y~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + ya =@y +** Processing line: ~ wa =@block_size * 3 - @block_offset~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ + wa =@block_size * 3 - @block_offset +** Processing line: ~ ha =(@block_size - @block_offset)~ - 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~ + ha =(@block_size - @block_offset) +** Processing line: ~ elsif @orientation == :up~ - 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~ + elsif @orientation == :up +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ - 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~ + #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] +** Processing line: ~ xa =@x + x_offset~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + xa =@x + x_offset +** Processing line: ~ ya =@y~ - Inside source: true *** True Line Result - -** Processing line: ~ $gtk.reset~ + ya =@y +** Processing line: ~ wa =@block_size - @block_offset~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~~ + wa =@block_size - @block_offset +** Processing line: ~ ha =@block_size * 3 - @block_offset~ - 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 + ha =@block_size * 3 - @block_offset ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Advanced Rendering - Render Targets With Tile Manipulation - main.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ elsif @orientation == :left~ +- Inside source: true *** True Line Result -* Advanced Rendering - Render Targets With Tile Manipulation - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + elsif @orientation == :left +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ +- Inside source: true *** True Line Result - + #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] +** Processing line: ~ xa =@x + x_offset~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/07_advanced_rendering/02_render_targets_with_tile_manipulation/app/main.rb~ + xa =@x + x_offset +** Processing line: ~ ya =@y~ - Inside source: true *** True Line Result - # ./samples/07_advanced_rendering/02_render_targets_with_tile_manipulation/app/main.rb -** Processing line: ~ # This sample is meant to show you how to do that dripping transition thing~ + ya =@y +** Processing line: ~ wa =@block_size * 3 - @block_offset~ - Inside source: true *** True Line Result - # This sample is meant to show you how to do that dripping transition thing -** Processing line: ~ # at the start of the original Doom. Most of this file is here to animate~ + wa =@block_size * 3 - @block_offset +** Processing line: ~ ha =@block_size - @block_offset~ - Inside source: true *** True Line Result - # at the start of the original Doom. Most of this file is here to animate -** Processing line: ~ # a scene to wipe away; the actual wipe effect is in the last 20 lines or~ + ha =@block_size - @block_offset +** Processing line: ~ elsif @orientation == :down~ - Inside source: true *** True Line Result - # a scene to wipe away; the actual wipe effect is in the last 20 lines or -** Processing line: ~ # so.~ + elsif @orientation == :down +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - # so. -** Processing line: ~~ + #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] +** Processing line: ~ xa =@x + x_offset~ - Inside source: true *** True Line Result - -** Processing line: ~ $gtk.reset # reset all game state if reloaded.~ + xa =@x + x_offset +** Processing line: ~ ya =@y~ - Inside source: true *** True Line Result - $gtk.reset # reset all game state if reloaded. -** Processing line: ~~ + ya =@y +** Processing line: ~ wa =@block_size - @block_offset~ - Inside source: true *** True Line Result - -** Processing line: ~ def circle_of_blocks pass, xoffset, yoffset, angleoffset, blocksize, distance~ + wa =@block_size - @block_offset +** Processing line: ~ ha =@block_size * 3 - @block_offset~ - Inside source: true *** True Line Result - def circle_of_blocks pass, xoffset, yoffset, angleoffset, blocksize, distance -** Processing line: ~ numblocks = 10~ + ha =@block_size * 3 - @block_offset +** Processing line: ~ end~ - Inside source: true *** True Line Result - numblocks = 10 -** Processing line: ~~ + end +** Processing line: ~ points = [~ - Inside source: true *** True Line Result - -** Processing line: ~ for i in 1..numblocks do~ + points = [ +** Processing line: ~ {x: xa, y:ya},~ - Inside source: true *** True Line Result - for i in 1..numblocks do -** Processing line: ~ angle = ((360 / numblocks) * i) + angleoffset~ + {x: xa, y:ya}, +** Processing line: ~ {x: xa + wa,y:ya},~ - Inside source: true *** True Line Result - angle = ((360 / numblocks) * i) + angleoffset -** Processing line: ~ radians = angle * (Math::PI / 180)~ + {x: xa + wa,y:ya}, +** Processing line: ~ {x: xa + wa,y:ya+ha},~ - Inside source: true *** True Line Result - radians = angle * (Math::PI / 180) -** Processing line: ~ x = (xoffset + (distance * Math.cos(radians))).round~ + {x: xa + wa,y:ya+ha}, +** Processing line: ~ {x: xa, y:ya+ha},~ - Inside source: true *** True Line Result - x = (xoffset + (distance * Math.cos(radians))).round -** Processing line: ~ y = (yoffset + (distance * Math.sin(radians))).round~ + {x: xa, y:ya+ha}, +** Processing line: ~ ]~ - Inside source: true *** True Line Result - y = (yoffset + (distance * Math.sin(radians))).round -** Processing line: ~ pass.solids << [ x, y, blocksize, blocksize, 255, 255, 0 ]~ + ] +** Processing line: ~ @squareColliders = [~ - Inside source: true *** True Line Result - pass.solids << [ x, y, blocksize, blocksize, 255, 255, 0 ] -** Processing line: ~ end~ + @squareColliders = [ +** Processing line: ~ SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}),~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}), +** Processing line: ~ SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}), +** Processing line: ~ SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}),~ - Inside source: true *** True Line Result - -** Processing line: ~ def draw_scene args, pass~ + SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}), +** Processing line: ~ SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:-1,y:1}),~ - Inside source: true *** True Line Result - def draw_scene args, pass -** Processing line: ~ pass.solids << [0, 360, 1280, 360, 0, 0, 200]~ + SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:-1,y:1}), +** Processing line: ~ ]~ - Inside source: true *** True Line Result - pass.solids << [0, 360, 1280, 360, 0, 0, 200] -** Processing line: ~ pass.solids << [0, 0, 1280, 360, 0, 127, 0]~ + ] +** Processing line: ~ @colliders = [~ - Inside source: true *** True Line Result - pass.solids << [0, 0, 1280, 360, 0, 127, 0] -** Processing line: ~~ + @colliders = [ +** Processing line: ~ LinearCollider.new(points[0],points[1], :neg),~ - Inside source: true *** True Line Result - -** Processing line: ~ blocksize = 100~ + LinearCollider.new(points[0],points[1], :neg), +** Processing line: ~ LinearCollider.new(points[1],points[2], :neg),~ - Inside source: true *** True Line Result - blocksize = 100 -** Processing line: ~ angleoffset = args.state.tick_count * 2.5~ + LinearCollider.new(points[1],points[2], :neg), +** Processing line: ~ LinearCollider.new(points[2],points[3], :pos),~ - Inside source: true *** True Line Result - angleoffset = args.state.tick_count * 2.5 -** Processing line: ~ centerx = (1280 - blocksize) / 2~ + LinearCollider.new(points[2],points[3], :pos), +** Processing line: ~ LinearCollider.new(points[0],points[3], :pos),~ - Inside source: true *** True Line Result - centerx = (1280 - blocksize) / 2 -** Processing line: ~ centery = (720 - blocksize) / 2~ + LinearCollider.new(points[0],points[3], :pos), +** Processing line: ~ ]~ - Inside source: true *** True Line Result - centery = (720 - blocksize) / 2 -** Processing line: ~~ + ] +** Processing line: ~ return points~ - Inside source: true *** True Line Result - -** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize * 2, 500~ + return points +** Processing line: ~ end~ - Inside source: true *** True Line Result - circle_of_blocks pass, centerx, centery, angleoffset, blocksize * 2, 500 -** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize, 325~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - circle_of_blocks pass, centerx, centery, angleoffset, blocksize, 325 -** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 2, 200~ + +** Processing line: ~ def update args~ - Inside source: true *** True Line Result - circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 2, 200 -** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 4, 100~ + def update args +** Processing line: ~ universalUpdate args, self~ - Inside source: true *** True Line Result - circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 4, 100 -** Processing line: ~ end~ + universalUpdate args, self +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ def draw(args)~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ segments = 160~ + def draw(args) +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2~ - Inside source: true *** True Line Result - segments = 160 + x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # On the first tick, initialize some stuff.~ +** Processing line: ~ if @orientation == :right~ - Inside source: true *** True Line Result - # On the first tick, initialize some stuff. -** Processing line: ~ if !args.state.yoffsets~ + if @orientation == :right +** Processing line: ~ args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - if !args.state.yoffsets -** Processing line: ~ args.state.baseyoff = 0~ + args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] +** Processing line: ~ elsif @orientation == :up~ - Inside source: true *** True Line Result - args.state.baseyoff = 0 -** Processing line: ~ args.state.yoffsets = []~ + elsif @orientation == :up +** Processing line: ~ args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - args.state.yoffsets = [] -** Processing line: ~ for i in 0..segments do~ + args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] +** Processing line: ~ elsif @orientation == :left~ - Inside source: true *** True Line Result - for i in 0..segments do -** Processing line: ~ args.state.yoffsets << rand * 100~ + elsif @orientation == :left +** Processing line: ~ args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - args.state.yoffsets << rand * 100 -** Processing line: ~ end~ + args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b] +** Processing line: ~ elsif @orientation == :down~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + elsif @orientation == :down +** Processing line: ~ args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ - Inside source: true *** True Line Result - end + args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Just draw some random stuff for a few seconds.~ +** Processing line: ~ args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s]~ - Inside source: true *** True Line Result - # Just draw some random stuff for a few seconds. -** Processing line: ~ args.state.static_debounce ||= 60 * 2.5~ + args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s] +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.static_debounce ||= 60 * 2.5 -** Processing line: ~ if args.state.static_debounce > 0~ + +** Processing line: ~ end~ - Inside source: true *** True Line Result - if args.state.static_debounce > 0 -** Processing line: ~ last_frame = args.state.static_debounce == 1~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - last_frame = args.state.static_debounce == 1 -** Processing line: ~ target = last_frame ? args.render_target(:last_frame) : args.outputs~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - target = last_frame ? args.render_target(:last_frame) : args.outputs -** Processing line: ~ draw_scene args, target~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - draw_scene args, target -** Processing line: ~ args.state.static_debounce -= 1~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - args.state.static_debounce -= 1 -** Processing line: ~ return unless last_frame~ -- Inside source: true + +** Processing line: ~*** Physics And Collisions - Arbitrary Collision - linear_collider.rb~ +- Header detected. *** True Line Result - return unless last_frame -** Processing line: ~ end~ + +*** True Line Result +*** Physics And Collisions - Arbitrary Collision - linear_collider.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/04_physics_and_collisions/09_arbitrary_collision/app/linear_collider.rb~ - Inside source: true *** True Line Result - end + # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/linear_collider.rb ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # build up the wipe...~ +** Processing line: ~ COLLISIONWIDTH=8~ - Inside source: true *** True Line Result - # build up the wipe... + COLLISIONWIDTH=8 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # this is the thing we're wiping to.~ +** Processing line: ~ class LinearCollider~ - Inside source: true *** True Line Result - # this is the thing we're wiping to. -** Processing line: ~ args.outputs.sprites << [ 0, 0, 1280, 720, 'dragonruby.png' ]~ + class LinearCollider +** Processing line: ~ attr_reader :pointA, :pointB~ - Inside source: true *** True Line Result - args.outputs.sprites << [ 0, 0, 1280, 720, 'dragonruby.png' ] -** Processing line: ~~ + attr_reader :pointA, :pointB +** Processing line: ~ def initialize (pointA, pointB, mode,collisionWidth=COLLISIONWIDTH)~ - Inside source: true *** True Line Result - -** Processing line: ~ return if (args.state.baseyoff > (1280 + 100)) # stop when done sliding~ + def initialize (pointA, pointB, mode,collisionWidth=COLLISIONWIDTH) +** Processing line: ~ @pointA = pointA~ - Inside source: true *** True Line Result - return if (args.state.baseyoff > (1280 + 100)) # stop when done sliding -** Processing line: ~~ + @pointA = pointA +** Processing line: ~ @pointB = pointB~ - Inside source: true *** True Line Result - -** Processing line: ~ segmentw = 1280 / segments~ + @pointB = pointB +** Processing line: ~ @mode = mode~ - Inside source: true *** True Line Result - segmentw = 1280 / segments + @mode = mode +** Processing line: ~ @collisionWidth = collisionWidth~ +- Inside source: true +*** True Line Result + @collisionWidth = collisionWidth ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ x = 0~ +** Processing line: ~ if (@pointA.x > @pointB.x)~ - Inside source: true *** True Line Result - x = 0 -** Processing line: ~ for i in 0..segments do~ + if (@pointA.x > @pointB.x) +** Processing line: ~ @pointA, @pointB = @pointB, @pointA~ - Inside source: true *** True Line Result - for i in 0..segments do -** Processing line: ~ yoffset = 0~ + @pointA, @pointB = @pointB, @pointA +** Processing line: ~ end~ - Inside source: true *** True Line Result - yoffset = 0 -** Processing line: ~ if args.state.yoffsets[i] < args.state.baseyoff~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - if args.state.yoffsets[i] < args.state.baseyoff -** Processing line: ~ yoffset = args.state.baseyoff - args.state.yoffsets[i]~ + +** Processing line: ~ @linearCollider_collision_once = false~ - Inside source: true *** True Line Result - yoffset = args.state.baseyoff - args.state.yoffsets[i] -** Processing line: ~ end~ + @linearCollider_collision_once = false +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # (720 - yoffset) flips the coordinate system, (- 720) adjusts for the height of the segment.~ +** Processing line: ~ def collisionSlope args~ - Inside source: true *** True Line Result - # (720 - yoffset) flips the coordinate system, (- 720) adjusts for the height of the segment. -** Processing line: ~ args.outputs.sprites << [ x, (720 - yoffset) - 720, segmentw, 720, 'last_frame', 0, 255, 255, 255, 255, x, 0, segmentw, 720 ]~ + def collisionSlope args +** Processing line: ~ if (@pointB.x-@pointA.x == 0)~ - Inside source: true *** True Line Result - args.outputs.sprites << [ x, (720 - yoffset) - 720, segmentw, 720, 'last_frame', 0, 255, 255, 255, 255, x, 0, segmentw, 720 ] -** Processing line: ~ x += segmentw~ + if (@pointB.x-@pointA.x == 0) +** Processing line: ~ return INFINITY~ - Inside source: true *** True Line Result - x += segmentw + return INFINITY +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ return (@pointB.y - @pointA.y) / (@pointB.x - @pointA.x)~ +- Inside source: true +*** True Line Result + return (@pointB.y - @pointA.y) / (@pointB.x - @pointA.x) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -32183,1078 +35684,1086 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ args.state.baseyoff += 4~ +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.baseyoff += 4 + +** Processing line: ~ def collision? (args, points, ball=nil)~ +- Inside source: true +*** True Line Result + def collision? (args, points, ball=nil) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ tick_instructions args, "Sample app shows an advanced usage of render_target."~ +** Processing line: ~ slope = collisionSlope args~ - Inside source: true *** True Line Result - tick_instructions args, "Sample app shows an advanced usage of render_target." -** Processing line: ~ end~ + slope = collisionSlope args +** Processing line: ~ result = false~ - Inside source: true *** True Line Result - end + result = false ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick_instructions args, text, y = 715~ +** Processing line: ~ # calculate a vector with a magnitude of (1/2)collisionWidth and a direction perpendicular to the collision line~ - Inside source: true *** True Line Result - def tick_instructions args, text, y = 715 -** Processing line: ~ return if args.state.key_event_occurred~ + # calculate a vector with a magnitude of (1/2)collisionWidth and a direction perpendicular to the collision line +** Processing line: ~ vect=nil;mag=nil;vect=nil;~ - Inside source: true *** True Line Result - return if args.state.key_event_occurred -** Processing line: ~ if args.inputs.mouse.click ||~ + vect=nil;mag=nil;vect=nil; +** Processing line: ~ if @mode == :both~ - Inside source: true *** True Line Result - if args.inputs.mouse.click || -** Processing line: ~ args.inputs.keyboard.directional_vector ||~ + if @mode == :both +** Processing line: ~ vect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y}~ - Inside source: true *** True Line Result - args.inputs.keyboard.directional_vector || -** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ + vect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y} +** Processing line: ~ mag = (vect.x**2 + vect.y**2)**0.5~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.enter || -** Processing line: ~ args.inputs.keyboard.key_down.escape~ + mag = (vect.x**2 + vect.y**2)**0.5 +** Processing line: ~ vect = {y: -1*(vect.x/(mag))*@collisionWidth*0.5, x: (vect.y/(mag))*@collisionWidth*0.5}~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.escape -** Processing line: ~ args.state.key_event_occurred = true~ + vect = {y: -1*(vect.x/(mag))*@collisionWidth*0.5, x: (vect.y/(mag))*@collisionWidth*0.5} +** Processing line: ~ else~ - Inside source: true *** True Line Result - args.state.key_event_occurred = true -** Processing line: ~ end~ + else +** Processing line: ~ vect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y}~ - Inside source: true *** True Line Result - end + vect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y} +** Processing line: ~ mag = (vect.x**2 + vect.y**2)**0.5~ +- Inside source: true +*** True Line Result + mag = (vect.x**2 + vect.y**2)**0.5 +** Processing line: ~ vect = {y: -1*(vect.x/(mag))*@collisionWidth, x: (vect.y/(mag))*@collisionWidth}~ +- Inside source: true +*** True Line Result + vect = {y: -1*(vect.x/(mag))*@collisionWidth, x: (vect.y/(mag))*@collisionWidth} +** 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~ +** Processing line: ~ rpointA=nil;rpointB=nil;rpointC=nil;rpointD=nil;~ - 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~ + rpointA=nil;rpointB=nil;rpointC=nil;rpointD=nil; +** Processing line: ~ if @mode == :pos~ - 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~ + if @mode == :pos +** Processing line: ~ rpointA = {x:@pointA.x + vect.x, y:@pointA.y + vect.y}~ - 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~ + rpointA = {x:@pointA.x + vect.x, y:@pointA.y + vect.y} +** Processing line: ~ rpointB = {x:@pointB.x + vect.x, y:@pointB.y + vect.y}~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + rpointB = {x:@pointB.x + vect.x, y:@pointB.y + vect.y} +** Processing line: ~ rpointC = {x:@pointB.x, y:@pointB.y}~ - 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. + rpointC = {x:@pointB.x, y:@pointB.y} +** Processing line: ~ rpointD = {x:@pointA.x, y:@pointA.y}~ +- Inside source: true *** True Line Result - -** Processing line: ~* Advanced Rendering - Render Target Viewports - main.rb~ -- Header detected. + rpointD = {x:@pointA.x, y:@pointA.y} +** Processing line: ~ elsif @mode == :neg~ +- Inside source: true *** True Line Result - + elsif @mode == :neg +** Processing line: ~ rpointA = {x:@pointA.x, y:@pointA.y}~ +- Inside source: true *** True Line Result -* Advanced Rendering - Render Target Viewports - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + rpointA = {x:@pointA.x, y:@pointA.y} +** Processing line: ~ rpointB = {x:@pointB.x, y:@pointB.y}~ +- Inside source: true *** True Line Result - + rpointB = {x:@pointB.x, y:@pointB.y} +** Processing line: ~ rpointC = {x:@pointB.x - vect.x, y:@pointB.y - vect.y}~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/07_advanced_rendering/03_render_target_viewports/app/main.rb~ + rpointC = {x:@pointB.x - vect.x, y:@pointB.y - vect.y} +** Processing line: ~ rpointD = {x:@pointA.x - vect.x, y:@pointA.y - vect.y}~ - Inside source: true *** True Line Result - # ./samples/07_advanced_rendering/03_render_target_viewports/app/main.rb -** Processing line: ~ =begin~ + rpointD = {x:@pointA.x - vect.x, y:@pointA.y - vect.y} +** Processing line: ~ elsif @mode == :both~ - Inside source: true *** True Line Result - =begin -** Processing line: ~~ + elsif @mode == :both +** Processing line: ~ rpointA = {x:@pointA.x + vect.x, y:@pointA.y + vect.y}~ - Inside source: true *** True Line Result - -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ + rpointA = {x:@pointA.x + vect.x, y:@pointA.y + vect.y} +** Processing line: ~ rpointB = {x:@pointB.x + vect.x, y:@pointB.y + vect.y}~ - Inside source: true *** True Line Result - APIs listing that haven't been encountered in previous sample apps: -** Processing line: ~~ + rpointB = {x:@pointB.x + vect.x, y:@pointB.y + vect.y} +** Processing line: ~ rpointC = {x:@pointB.x - vect.x, y:@pointB.y - vect.y}~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ + rpointC = {x:@pointB.x - vect.x, y:@pointB.y - vect.y} +** Processing line: ~ rpointD = {x:@pointA.x - vect.x, y:@pointA.y - vect.y}~ - Inside source: true *** True Line Result - - args.state.new_entity: Used when we want to create a new object, like a sprite or button. -** Processing line: ~ For example, if we want to create a new button, we would declare it as a new entity and~ + rpointD = {x:@pointA.x - vect.x, y:@pointA.y - vect.y} +** Processing line: ~ end~ - Inside source: true *** True Line Result - For example, if we want to create a new button, we would declare it as a new entity and -** Processing line: ~ then define its properties. (Remember, you can use state to define ANY property and it will~ + end +** Processing line: ~ #four point rectangle~ - Inside source: true *** True Line Result - then define its properties. (Remember, you can use state to define ANY property and it will -** Processing line: ~ be retained across frames.)~ + #four point rectangle +** Processing line: ~~ - Inside source: true *** True Line Result - be retained across frames.) + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ If you have a solar system and you're creating args.state.sun and setting its image path to an~ +** Processing line: ~~ - Inside source: true *** True Line Result - If you have a solar system and you're creating args.state.sun and setting its image path to an -** Processing line: ~ image in the sprites folder, you would do the following:~ + +** Processing line: ~ if ball != nil~ - Inside source: true *** True Line Result - image in the sprites folder, you would do the following: -** Processing line: ~ (See samples/99_sample_nddnug_workshop for more details.)~ + if ball != nil +** Processing line: ~ xs = [rpointA.x,rpointB.x,rpointC.x,rpointD.x]~ - Inside source: true *** True Line Result - (See samples/99_sample_nddnug_workshop for more details.) -** Processing line: ~~ + xs = [rpointA.x,rpointB.x,rpointC.x,rpointD.x] +** Processing line: ~ ys = [rpointA.y,rpointB.y,rpointC.y,rpointD.y]~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.sun ||= args.state.new_entity(:sun) do |s|~ + ys = [rpointA.y,rpointB.y,rpointC.y,rpointD.y] +** Processing line: ~ correct = 1~ - Inside source: true *** True Line Result - args.state.sun ||= args.state.new_entity(:sun) do |s| -** Processing line: ~ s.path = 'sprites/sun.png'~ + correct = 1 +** Processing line: ~ rect1 = [ball.x, ball.y, ball.width, ball.height]~ - Inside source: true *** True Line Result - s.path = 'sprites/sun.png' -** Processing line: ~ end~ + rect1 = [ball.x, ball.y, ball.width, ball.height] +** Processing line: ~ #$r1 = rect1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #$r1 = rect1 +** Processing line: ~ rect2 = [xs.min-correct,ys.min-correct,(xs.max-xs.min)+correct*2,(ys.max-ys.min)+correct*2]~ - Inside source: true *** True Line Result - -** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ + rect2 = [xs.min-correct,ys.min-correct,(xs.max-xs.min)+correct*2,(ys.max-ys.min)+correct*2] +** Processing line: ~ #$r2 = rect2~ - Inside source: true *** True Line Result - - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ + #$r2 = rect2 +** Processing line: ~ if rect1.intersect_rect?(rect2) == false~ - Inside source: true *** True Line Result - as Ruby code, and the placeholder is replaced with its corresponding value or result. -** Processing line: ~~ + if rect1.intersect_rect?(rect2) == false +** Processing line: ~ return false~ - Inside source: true *** True Line Result - -** Processing line: ~ For example, if we have a variable~ + return false +** Processing line: ~ end~ - Inside source: true *** True Line Result - For example, if we have a variable -** Processing line: ~ name = "Ruby"~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - name = "Ruby" -** Processing line: ~ then the line~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - then the line -** Processing line: ~ puts "How are you, #{name}?"~ + +** Processing line: ~~ - Inside source: true *** True Line Result - puts "How are you, #{name}?" -** Processing line: ~ would print "How are you, Ruby?" to the console.~ + +** Processing line: ~ #area of a triangle~ - Inside source: true *** True Line Result - would print "How are you, Ruby?" to the console. -** Processing line: ~ (Remember, string interpolation only works with double quotes!)~ + #area of a triangle +** Processing line: ~ triArea = -> (a,b,c) { ((a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y))/2.0).abs }~ - Inside source: true *** True Line Result - (Remember, string interpolation only works with double quotes!) + triArea = -> (a,b,c) { ((a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y))/2.0).abs } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - Ternary operator (?): Similar to if statement; first evalulates whether a statement is~ +** Processing line: ~ #if at least on point is in the rectangle then collision? is true - otherwise false~ - Inside source: true *** True Line Result - - Ternary operator (?): Similar to if statement; first evalulates whether a statement is -** Processing line: ~ true or false, and then executes a command depending on that result.~ + #if at least on point is in the rectangle then collision? is true - otherwise false +** Processing line: ~ for point in points~ - Inside source: true *** True Line Result - true or false, and then executes a command depending on that result. -** Processing line: ~ For example, if we had a variable~ + for point in points +** Processing line: ~ #Check whether a given point lies inside a rectangle or not:~ - Inside source: true *** True Line Result - For example, if we had a variable -** Processing line: ~ grade = 75~ + #Check whether a given point lies inside a rectangle or not: +** Processing line: ~ #if the sum of the area of traingls, PAB, PBC, PCD, PAD equal the area of the rec, then an intersection has occured~ - Inside source: true *** True Line Result - grade = 75 -** Processing line: ~ and used the ternary operator in the command~ + #if the sum of the area of traingls, PAB, PBC, PCD, PAD equal the area of the rec, then an intersection has occured +** Processing line: ~ areaRec = triArea.call(rpointA, rpointB, rpointC)+triArea.call(rpointA, rpointC, rpointD)~ - Inside source: true *** True Line Result - and used the ternary operator in the command -** Processing line: ~ pass_or_fail = grade > 65 ? "pass" : "fail"~ + areaRec = triArea.call(rpointA, rpointB, rpointC)+triArea.call(rpointA, rpointC, rpointD) +** Processing line: ~ areaSum = [~ - Inside source: true *** True Line Result - pass_or_fail = grade > 65 ? "pass" : "fail" -** Processing line: ~ then the value of pass_or_fail would be "pass" since grade's value was greater than 65.~ + areaSum = [ +** Processing line: ~ triArea.call(point, rpointA, rpointB),triArea.call(point, rpointB, rpointC),~ - Inside source: true *** True Line Result - then the value of pass_or_fail would be "pass" since grade's value was greater than 65. -** Processing line: ~~ + triArea.call(point, rpointA, rpointB),triArea.call(point, rpointB, rpointC), +** Processing line: ~ triArea.call(point, rpointC, rpointD),triArea.call(point, rpointA, rpointD)~ - Inside source: true *** True Line Result - -** Processing line: ~ Reminders:~ + triArea.call(point, rpointC, rpointD),triArea.call(point, rpointA, rpointD) +** Processing line: ~ ].inject(0){|sum,x| sum + x }~ - Inside source: true *** True Line Result - Reminders: -** Processing line: ~~ + ].inject(0){|sum,x| sum + x } +** Processing line: ~ e = 0.0001 #allow for minor error~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual~ + e = 0.0001 #allow for minor error +** Processing line: ~ if areaRec>= areaSum-e and areaRec<= areaSum+e~ - Inside source: true *** True Line Result - - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual -** Processing line: ~ 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).~ + if areaRec>= areaSum-e and areaRec<= areaSum+e +** Processing line: ~ result = true~ - Inside source: true *** True Line Result - 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720). -** Processing line: ~~ + result = true +** Processing line: ~ #return true~ - Inside source: true *** True Line Result - -** Processing line: ~ - Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction~ + #return true +** Processing line: ~ break~ - Inside source: true *** True Line Result - - Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction -** Processing line: ~ by adding or subracting.~ + break +** Processing line: ~ end~ - Inside source: true *** True Line Result - by adding or subracting. + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - ARRAY#inside_rect?: An array with at least two values is considered a point. An array~ +** Processing line: ~ #args.outputs.lines << [@pointA.x, @pointA.y, @pointB.x, @pointB.y, 000, 000, 000]~ - Inside source: true *** True Line Result - - ARRAY#inside_rect?: An array with at least two values is considered a point. An array -** Processing line: ~ with at least four values is considered a rect. The inside_rect? function returns true~ + #args.outputs.lines << [@pointA.x, @pointA.y, @pointB.x, @pointB.y, 000, 000, 000] +** Processing line: ~ #args.outputs.lines << [rpointA.x, rpointA.y, rpointB.x, rpointB.y, 255, 000, 000]~ - Inside source: true *** True Line Result - with at least four values is considered a rect. The inside_rect? function returns true -** Processing line: ~ or false depending on if the point is inside the rect.~ + #args.outputs.lines << [rpointA.x, rpointA.y, rpointB.x, rpointB.y, 255, 000, 000] +** Processing line: ~ #args.outputs.lines << [rpointC.x, rpointC.y, rpointD.x, rpointD.y, 000, 000, 255]~ - Inside source: true *** True Line Result - or false depending on if the point is inside the rect. + #args.outputs.lines << [rpointC.x, rpointC.y, rpointD.x, rpointD.y, 000, 000, 255] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect.~ -- Inside source: true -*** True Line Result - - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ +** Processing line: ~ #puts (rpointA.x.to_s + " " + rpointA.y.to_s + " " + rpointB.x.to_s + " "+ rpointB.y.to_s)~ - Inside source: true *** True Line Result - - args.inputs.mouse.click: This property will be set if the mouse was clicked. -** Processing line: ~ For more information about the mouse, go to mygame/documentation/07-mouse.md.~ + #puts (rpointA.x.to_s + " " + rpointA.y.to_s + " " + rpointB.x.to_s + " "+ rpointB.y.to_s) +** Processing line: ~ return result~ - Inside source: true *** True Line Result - For more information about the mouse, go to mygame/documentation/07-mouse.md. -** Processing line: ~~ + return result +** Processing line: ~ end #end collision?~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.inputs.keyboard.key_up.KEY: The value of the properties will be set~ + end #end collision? +** Processing line: ~~ - Inside source: true *** True Line Result - - args.inputs.keyboard.key_up.KEY: The value of the properties will be set -** Processing line: ~ to the frame that the key_up event occurred (the frame correlates~ + +** Processing line: ~ def getRepelMagnitude (fbx, fby, vrx, vry, ballMag)~ - Inside source: true *** True Line Result - to the frame that the key_up event occurred (the frame correlates -** Processing line: ~ to args.state.tick_count).~ + def getRepelMagnitude (fbx, fby, vrx, vry, ballMag) +** Processing line: ~ a = fbx ; b = vrx ; c = fby~ - Inside source: true *** True Line Result - to args.state.tick_count). -** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ + a = fbx ; b = vrx ; c = fby +** Processing line: ~ d = vry ; e = ballMag~ - Inside source: true *** True Line Result - For more information about the keyboard, go to mygame/documentation/06-keyboard.md. -** Processing line: ~~ + d = vry ; e = ballMag +** Processing line: ~ if b**2 + d**2 == 0~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.state.labels:~ + if b**2 + d**2 == 0 +** Processing line: ~ #unexpected~ - Inside source: true *** True Line Result - - args.state.labels: -** Processing line: ~ The parameters for a label are~ + #unexpected +** Processing line: ~ end~ - Inside source: true *** True Line Result - The parameters for a label are -** Processing line: ~ 1. the position (x, y)~ + end +** Processing line: ~ x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)~ - Inside source: true *** True Line Result - 1. the position (x, y) -** Processing line: ~ 2. the text~ + x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2) +** Processing line: ~ x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2))~ - Inside source: true *** True Line Result - 2. the text -** Processing line: ~ 3. the size~ + x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)) +** Processing line: ~ err = 0.00001~ - Inside source: true *** True Line Result - 3. the size -** Processing line: ~ 4. the alignment~ + err = 0.00001 +** Processing line: ~ o = ((fbx + x1*vrx)**2 + (fby + x1*vry)**2 ) ** 0.5~ - Inside source: true *** True Line Result - 4. the alignment -** Processing line: ~ 5. the color (red, green, and blue saturations)~ + o = ((fbx + x1*vrx)**2 + (fby + x1*vry)**2 ) ** 0.5 +** Processing line: ~ p = ((fbx + x2*vrx)**2 + (fby + x2*vry)**2 ) ** 0.5~ - Inside source: true *** True Line Result - 5. the color (red, green, and blue saturations) -** Processing line: ~ 6. the alpha (or transparency)~ + p = ((fbx + x2*vrx)**2 + (fby + x2*vry)**2 ) ** 0.5 +** Processing line: ~ r = 0~ - Inside source: true *** True Line Result - 6. the alpha (or transparency) -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ + r = 0 +** Processing line: ~ if (ballMag >= o-err and ballMag <= o+err)~ - Inside source: true *** True Line Result - For more information about labels, go to mygame/documentation/02-labels.md. -** Processing line: ~~ + if (ballMag >= o-err and ballMag <= o+err) +** Processing line: ~ r = x1~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.state.lines:~ + r = x1 +** Processing line: ~ elsif (ballMag >= p-err and ballMag <= p+err)~ - Inside source: true *** True Line Result - - args.state.lines: -** Processing line: ~ The parameters for a line are~ + elsif (ballMag >= p-err and ballMag <= p+err) +** Processing line: ~ r = x2~ - Inside source: true *** True Line Result - The parameters for a line are -** Processing line: ~ 1. the starting position (x, y)~ + r = x2 +** Processing line: ~ else~ - Inside source: true *** True Line Result - 1. the starting position (x, y) -** Processing line: ~ 2. the ending position (x2, y2)~ + else +** Processing line: ~ #unexpected~ - Inside source: true *** True Line Result - 2. the ending position (x2, y2) -** Processing line: ~ 3. the color (red, green, and blue saturations)~ + #unexpected +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3. the color (red, green, and blue saturations) -** Processing line: ~ 4. the alpha (or transparency)~ + end +** Processing line: ~ return r~ - Inside source: true *** True Line Result - 4. the alpha (or transparency) -** Processing line: ~ For more information about lines, go to mygame/documentation/04-lines.md.~ + return r +** Processing line: ~ end~ - Inside source: true *** True Line Result - For more information about lines, go to mygame/documentation/04-lines.md. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.state.solids (and args.state.borders):~ +** Processing line: ~ def collide args, ball~ - Inside source: true *** True Line Result - - args.state.solids (and args.state.borders): -** Processing line: ~ The parameters for a solid (or border) are~ + def collide args, ball +** Processing line: ~ slope = collisionSlope args~ - Inside source: true *** True Line Result - The parameters for a solid (or border) are -** Processing line: ~ 1. the position (x, y)~ + slope = collisionSlope args +** Processing line: ~~ - Inside source: true *** True Line Result - 1. the position (x, y) -** Processing line: ~ 2. the width (w)~ + +** Processing line: ~ # perpVect: normal vector perpendicular to collision~ - Inside source: true *** True Line Result - 2. the width (w) -** Processing line: ~ 3. the height (h)~ + # perpVect: normal vector perpendicular to collision +** Processing line: ~ perpVect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y}~ - Inside source: true *** True Line Result - 3. the height (h) -** Processing line: ~ 4. the color (r, g, b)~ + perpVect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y} +** Processing line: ~ mag = (perpVect.x**2 + perpVect.y**2)**0.5~ - Inside source: true *** True Line Result - 4. the color (r, g, b) -** Processing line: ~ 5. the alpha (or transparency)~ + mag = (perpVect.x**2 + perpVect.y**2)**0.5 +** Processing line: ~ perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)}~ - Inside source: true *** True Line Result - 5. the alpha (or transparency) -** Processing line: ~ For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md.~ + perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} +** Processing line: ~ perpVect = {x: -perpVect.y, y: perpVect.x}~ - Inside source: true *** True Line Result - For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md. -** Processing line: ~~ + perpVect = {x: -perpVect.y, y: perpVect.x} +** Processing line: ~ if perpVect.y > 0 #ensure perpVect points upward~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.state.sprites:~ + if perpVect.y > 0 #ensure perpVect points upward +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ - Inside source: true *** True Line Result - - args.state.sprites: -** Processing line: ~ The parameters for a sprite are~ + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} +** Processing line: ~ end~ - Inside source: true *** True Line Result - The parameters for a sprite are -** Processing line: ~ 1. the position (x, y)~ + end +** Processing line: ~ previousPosition = {~ - Inside source: true *** True Line Result - 1. the position (x, y) -** Processing line: ~ 2. the width (w)~ + previousPosition = { +** Processing line: ~ x:ball.x-ball.velocity.x,~ - Inside source: true *** True Line Result - 2. the width (w) -** Processing line: ~ 3. the height (h)~ + x:ball.x-ball.velocity.x, +** Processing line: ~ y:ball.y-ball.velocity.y~ - Inside source: true *** True Line Result - 3. the height (h) -** Processing line: ~ 4. the image path~ + y:ball.y-ball.velocity.y +** Processing line: ~ }~ - Inside source: true *** True Line Result - 4. the image path -** Processing line: ~ 5. the angle~ + } +** Processing line: ~ yInterc = @pointA.y + -slope*@pointA.x~ - Inside source: true *** True Line Result - 5. the angle -** Processing line: ~ 6. the alpha (or transparency)~ + yInterc = @pointA.y + -slope*@pointA.x +** Processing line: ~ if slope == INFINITY~ - Inside source: true *** True Line Result - 6. the alpha (or transparency) -** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ + if slope == INFINITY +** Processing line: ~ if previousPosition.x < @pointA.x~ - Inside source: true *** True Line Result - For more information about sprites, go to mygame/documentation/05-sprites.md. -** Processing line: ~ =end~ + if previousPosition.x < @pointA.x +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ - Inside source: true *** True Line Result - =end -** Processing line: ~~ + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} +** Processing line: ~ yInterc = -INFINITY~ - Inside source: true *** True Line Result - -** Processing line: ~ # This sample app shows different objects that can be used when making games, such as labels,~ + yInterc = -INFINITY +** Processing line: ~ end~ - Inside source: true *** True Line Result - # This sample app shows different objects that can be used when making games, such as labels, -** Processing line: ~ # lines, sprites, solids, buttons, etc. Each demo section shows how these objects can be used.~ + end +** Processing line: ~ elsif previousPosition.y < slope*previousPosition.x + yInterc #check if ball is bellow or above the collider to determine if perpVect is - or +~ - Inside source: true *** True Line Result - # lines, sprites, solids, buttons, etc. Each demo section shows how these objects can be used. + elsif previousPosition.y < slope*previousPosition.x + yInterc #check if ball is bellow or above the collider to determine if perpVect is - or + +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ +- Inside source: true +*** True Line Result + perpVect = {x: perpVect.x*-1, y: perpVect.y*-1} +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Also note that state.tick_count refers to the passage of time, or current frame.~ +** Processing line: ~ velocityMag = (ball.velocity.x**2 + ball.velocity.y**2)**0.5~ - Inside source: true *** True Line Result - # Also note that state.tick_count refers to the passage of time, or current frame. + velocityMag = (ball.velocity.x**2 + ball.velocity.y**2)**0.5 +** Processing line: ~ theta_ball=Math.atan2(ball.velocity.y,ball.velocity.x) #the angle of the ball's velocity~ +- Inside source: true +*** True Line Result + theta_ball=Math.atan2(ball.velocity.y,ball.velocity.x) #the angle of the ball's velocity +** Processing line: ~ theta_repel=Math.atan2(perpVect.y,perpVect.x) #the angle of the repelling force(perpVect)~ +- Inside source: true +*** True Line Result + theta_repel=Math.atan2(perpVect.y,perpVect.x) #the angle of the repelling force(perpVect) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class TechDemo~ +** Processing line: ~ fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity~ - Inside source: true *** True Line Result - class TechDemo -** Processing line: ~ attr_accessor :inputs, :state, :outputs, :grid, :args~ + fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity +** Processing line: ~ fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity~ - Inside source: true *** True Line Result - attr_accessor :inputs, :state, :outputs, :grid, :args + fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Calls all methods necessary for the app to run properly.~ +** Processing line: ~ #the magnitude of the repelling force~ - Inside source: true *** True Line Result - # Calls all methods necessary for the app to run properly. -** Processing line: ~ def tick~ + #the magnitude of the repelling force +** Processing line: ~ repelMag = getRepelMagnitude(fbx, fby, perpVect.x, perpVect.y, (ball.velocity.x**2 + ball.velocity.y**2)**0.5)~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ labels_tech_demo~ + repelMag = getRepelMagnitude(fbx, fby, perpVect.x, perpVect.y, (ball.velocity.x**2 + ball.velocity.y**2)**0.5) +** Processing line: ~ frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx~ - Inside source: true *** True Line Result - labels_tech_demo -** Processing line: ~ lines_tech_demo~ + frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx +** Processing line: ~ fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby~ - Inside source: true *** True Line Result - lines_tech_demo -** Processing line: ~ solids_tech_demo~ + fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby +** Processing line: ~~ - Inside source: true *** True Line Result - solids_tech_demo -** Processing line: ~ borders_tech_demo~ + +** Processing line: ~ fsumx = fbx+frx #sum of x forces~ - Inside source: true *** True Line Result - borders_tech_demo -** Processing line: ~ sprites_tech_demo~ + fsumx = fbx+frx #sum of x forces +** Processing line: ~ fsumy = fby+fry #sum of y forces~ - Inside source: true *** True Line Result - sprites_tech_demo -** Processing line: ~ keyboards_tech_demo~ + fsumy = fby+fry #sum of y forces +** Processing line: ~ fr = velocityMag#fr is the resulting magnitude~ - Inside source: true *** True Line Result - keyboards_tech_demo -** Processing line: ~ controller_tech_demo~ + fr = velocityMag#fr is the resulting magnitude +** Processing line: ~ thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle~ - Inside source: true *** True Line Result - controller_tech_demo -** Processing line: ~ mouse_tech_demo~ + thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle +** Processing line: ~ xnew = fr*Math.cos(thetaNew)#resulting x velocity~ - Inside source: true *** True Line Result - mouse_tech_demo -** Processing line: ~ point_to_rect_tech_demo~ + xnew = fr*Math.cos(thetaNew)#resulting x velocity +** Processing line: ~ ynew = fr*Math.sin(thetaNew)#resulting y velocity~ - Inside source: true *** True Line Result - point_to_rect_tech_demo -** Processing line: ~ rect_to_rect_tech_demo~ + ynew = fr*Math.sin(thetaNew)#resulting y velocity +** Processing line: ~ if (velocityMag < MAX_VELOCITY)~ - Inside source: true *** True Line Result - rect_to_rect_tech_demo -** Processing line: ~ button_tech_demo~ + if (velocityMag < MAX_VELOCITY) +** Processing line: ~ ball.velocity = Vector2d.new(xnew*1.1, ynew*1.1)~ - Inside source: true *** True Line Result - button_tech_demo -** Processing line: ~ export_game_state_demo~ + ball.velocity = Vector2d.new(xnew*1.1, ynew*1.1) +** Processing line: ~ else~ - Inside source: true *** True Line Result - export_game_state_demo -** Processing line: ~ window_state_demo~ + else +** Processing line: ~ ball.velocity = Vector2d.new(xnew, ynew)~ - Inside source: true *** True Line Result - window_state_demo -** Processing line: ~ render_seperators~ + ball.velocity = Vector2d.new(xnew, ynew) +** Processing line: ~ end~ - Inside source: true *** True Line Result - render_seperators + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + ** Processing line: ~ end~ - Inside source: true *** True Line Result end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Shows output of different kinds of labels on the screen~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - # Shows output of different kinds of labels on the screen -** Processing line: ~ def labels_tech_demo~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - def labels_tech_demo -** Processing line: ~ outputs.labels << [grid.left.shift_right(5), grid.top.shift_down(5), "This is a label located at the top left."]~ -- Inside source: true + +** Processing line: ~*** Physics And Collisions - Arbitrary Collision - main.rb~ +- Header detected. *** True Line Result - outputs.labels << [grid.left.shift_right(5), grid.top.shift_down(5), "This is a label located at the top left."] -** Processing line: ~ outputs.labels << [grid.left.shift_right(5), grid.bottom.shift_up(30), "This is a label located at the bottom left."]~ -- Inside source: true + *** True Line Result - outputs.labels << [grid.left.shift_right(5), grid.bottom.shift_up(30), "This is a label located at the bottom left."] -** Processing line: ~ outputs.labels << [ 5, 690, "Labels (x, y, text, size, align, r, g, b, a)"]~ -- Inside source: true +*** Physics And Collisions - Arbitrary Collision - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - outputs.labels << [ 5, 690, "Labels (x, y, text, size, align, r, g, b, a)"] -** Processing line: ~ outputs.labels << [ 5, 660, "Smaller label.", -2]~ + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/main.rb~ - Inside source: true *** True Line Result - outputs.labels << [ 5, 660, "Smaller label.", -2] -** Processing line: ~ outputs.labels << [ 5, 630, "Small label.", -1]~ + # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/main.rb +** Processing line: ~ INFINITY= 10**10~ - Inside source: true *** True Line Result - outputs.labels << [ 5, 630, "Small label.", -1] -** Processing line: ~ outputs.labels << [ 5, 600, "Medium label.", 0]~ + INFINITY= 10**10 +** Processing line: ~ MAX_VELOCITY = 8.0~ - Inside source: true *** True Line Result - outputs.labels << [ 5, 600, "Medium label.", 0] -** Processing line: ~ outputs.labels << [ 5, 570, "Large label.", 1]~ + MAX_VELOCITY = 8.0 +** Processing line: ~ BALL_COUNT = 90~ - Inside source: true *** True Line Result - outputs.labels << [ 5, 570, "Large label.", 1] -** Processing line: ~ outputs.labels << [ 5, 540, "Larger label.", 2]~ + BALL_COUNT = 90 +** Processing line: ~ BALL_DISTANCE = 20~ - Inside source: true *** True Line Result - outputs.labels << [ 5, 540, "Larger label.", 2] -** Processing line: ~ outputs.labels << [300, 660, "Left aligned.", 0, 2]~ + BALL_DISTANCE = 20 +** Processing line: ~ require 'app/vector2d.rb'~ - Inside source: true *** True Line Result - outputs.labels << [300, 660, "Left aligned.", 0, 2] -** Processing line: ~ outputs.labels << [300, 640, "Center aligned.", 0, 1]~ + require 'app/vector2d.rb' +** Processing line: ~ require 'app/blocks.rb'~ - Inside source: true *** True Line Result - outputs.labels << [300, 640, "Center aligned.", 0, 1] -** Processing line: ~ outputs.labels << [300, 620, "Right aligned.", 0, 0]~ + require 'app/blocks.rb' +** Processing line: ~ require 'app/ball.rb'~ - Inside source: true *** True Line Result - outputs.labels << [300, 620, "Right aligned.", 0, 0] -** Processing line: ~ outputs.labels << [175, 595, "Red Label.", 0, 0, 255, 0, 0]~ + require 'app/ball.rb' +** Processing line: ~ require 'app/rectangle.rb'~ - Inside source: true *** True Line Result - outputs.labels << [175, 595, "Red Label.", 0, 0, 255, 0, 0] -** Processing line: ~ outputs.labels << [175, 575, "Green Label.", 0, 0, 0, 255, 0]~ + require 'app/rectangle.rb' +** Processing line: ~ require 'app/linear_collider.rb'~ - Inside source: true *** True Line Result - outputs.labels << [175, 575, "Green Label.", 0, 0, 0, 255, 0] -** Processing line: ~ outputs.labels << [175, 555, "Blue Label.", 0, 0, 0, 0, 255]~ + require 'app/linear_collider.rb' +** Processing line: ~ require 'app/square_collider.rb'~ - Inside source: true *** True Line Result - outputs.labels << [175, 555, "Blue Label.", 0, 0, 0, 0, 255] -** Processing line: ~ outputs.labels << [175, 535, "Faded Label.", 0, 0, 0, 0, 0, 128]~ + require 'app/square_collider.rb' +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.labels << [175, 535, "Faded Label.", 0, 0, 0, 0, 0, 128] -** Processing line: ~ end~ + +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Shows output of lines on the screen~ +** Processing line: ~ #Method to init default values~ - Inside source: true *** True Line Result - # Shows output of lines on the screen -** Processing line: ~ def lines_tech_demo~ + #Method to init default values +** Processing line: ~ def defaults args~ - Inside source: true *** True Line Result - def lines_tech_demo -** Processing line: ~ outputs.labels << [5, 500, "Lines (x, y, x2, y2, r, g, b, a)"]~ + def defaults args +** Processing line: ~ args.state.board_width ||= args.grid.w / 4~ - Inside source: true *** True Line Result - outputs.labels << [5, 500, "Lines (x, y, x2, y2, r, g, b, a)"] -** Processing line: ~ outputs.lines << [5, 450, 100, 450]~ + args.state.board_width ||= args.grid.w / 4 +** Processing line: ~ args.state.board_height ||= args.grid.h~ - Inside source: true *** True Line Result - outputs.lines << [5, 450, 100, 450] -** Processing line: ~ outputs.lines << [5, 430, 300, 430]~ + args.state.board_height ||= args.grid.h +** Processing line: ~ args.state.game_area ||= [(args.state.board_width + args.grid.w / 8), 0, args.state.board_width, args.grid.h]~ - Inside source: true *** True Line Result - outputs.lines << [5, 430, 300, 430] -** Processing line: ~ outputs.lines << [5, 410, 300, 410, state.tick_count % 255, 0, 0, 255] # red saturation changes~ + args.state.game_area ||= [(args.state.board_width + args.grid.w / 8), 0, args.state.board_width, args.grid.h] +** Processing line: ~ args.state.balls ||= []~ - Inside source: true *** True Line Result - outputs.lines << [5, 410, 300, 410, state.tick_count % 255, 0, 0, 255] # red saturation changes -** Processing line: ~ outputs.lines << [5, 390 - state.tick_count % 25, 300, 390, 0, 0, 0, 255] # y position changes~ + args.state.balls ||= [] +** Processing line: ~ args.state.num_balls ||= 0~ - Inside source: true *** True Line Result - outputs.lines << [5, 390 - state.tick_count % 25, 300, 390, 0, 0, 0, 255] # y position changes -** Processing line: ~ outputs.lines << [5 + state.tick_count % 200, 360, 300, 360, 0, 0, 0, 255] # x position changes~ + args.state.num_balls ||= 0 +** Processing line: ~ args.state.ball_created_at ||= args.state.tick_count~ - Inside source: true *** True Line Result - outputs.lines << [5 + state.tick_count % 200, 360, 300, 360, 0, 0, 0, 255] # x position changes -** Processing line: ~ end~ + args.state.ball_created_at ||= args.state.tick_count +** Processing line: ~ args.state.ball_hypotenuse = (10**2 + 10**2)**0.5~ - Inside source: true *** True Line Result - end + args.state.ball_hypotenuse = (10**2 + 10**2)**0.5 +** Processing line: ~ args.state.ballParents ||=nil~ +- Inside source: true +*** True Line Result + args.state.ballParents ||=nil ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Shows output of different kinds of solids on the screen~ +** Processing line: ~ init_blocks args~ - Inside source: true *** True Line Result - # Shows output of different kinds of solids on the screen -** Processing line: ~ def solids_tech_demo~ + init_blocks args +** Processing line: ~ init_balls args~ - Inside source: true *** True Line Result - def solids_tech_demo -** Processing line: ~ outputs.labels << [ 5, 350, "Solids (x, y, w, h, r, g, b, a)"]~ + init_balls args +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.labels << [ 5, 350, "Solids (x, y, w, h, r, g, b, a)"] -** Processing line: ~ outputs.solids << [ 10, 270, 50, 50]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.solids << [ 10, 270, 50, 50] -** Processing line: ~ outputs.solids << [ 70, 270, 50, 50, 0, 0, 0]~ + +** Processing line: ~ begin :default_methods~ - Inside source: true *** True Line Result - outputs.solids << [ 70, 270, 50, 50, 0, 0, 0] -** Processing line: ~ outputs.solids << [130, 270, 50, 50, 255, 0, 0]~ + begin :default_methods +** Processing line: ~ def init_blocks args~ - Inside source: true *** True Line Result - outputs.solids << [130, 270, 50, 50, 255, 0, 0] -** Processing line: ~ outputs.solids << [190, 270, 50, 50, 255, 0, 0, 128]~ + def init_blocks args +** Processing line: ~ block_size = args.state.board_width / 8~ - Inside source: true *** True Line Result - outputs.solids << [190, 270, 50, 50, 255, 0, 0, 128] -** Processing line: ~ outputs.solids << [250, 270, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes~ + block_size = args.state.board_width / 8 +** Processing line: ~ #Space inbetween each block~ - Inside source: true *** True Line Result - outputs.solids << [250, 270, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes -** Processing line: ~ end~ + #Space inbetween each block +** Processing line: ~ block_offset = 4~ - Inside source: true *** True Line Result - end + block_offset = 4 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Shows output of different kinds of borders on the screen~ -- Inside source: true -*** True Line Result - # Shows output of different kinds of borders on the screen -** Processing line: ~ # The parameters for a border are the same as the parameters for a solid~ -- Inside source: true -*** True Line Result - # The parameters for a border are the same as the parameters for a solid -** Processing line: ~ def borders_tech_demo~ +** Processing line: ~ args.state.squares ||=[~ - Inside source: true *** True Line Result - def borders_tech_demo -** Processing line: ~ outputs.labels << [ 5, 260, "Borders (x, y, w, h, r, g, b, a)"]~ + args.state.squares ||=[ +** Processing line: ~ Square.new(args, 2, 0, block_size, :right, block_offset),~ - Inside source: true *** True Line Result - outputs.labels << [ 5, 260, "Borders (x, y, w, h, r, g, b, a)"] -** Processing line: ~ outputs.borders << [ 10, 180, 50, 50]~ + Square.new(args, 2, 0, block_size, :right, block_offset), +** Processing line: ~ Square.new(args, 5, 0, block_size, :right, block_offset),~ - Inside source: true *** True Line Result - outputs.borders << [ 10, 180, 50, 50] -** Processing line: ~ outputs.borders << [ 70, 180, 50, 50, 0, 0, 0]~ + Square.new(args, 5, 0, block_size, :right, block_offset), +** Processing line: ~ Square.new(args, 6, 7, block_size, :right, block_offset)~ - Inside source: true *** True Line Result - outputs.borders << [ 70, 180, 50, 50, 0, 0, 0] -** Processing line: ~ outputs.borders << [130, 180, 50, 50, 255, 0, 0]~ + Square.new(args, 6, 7, block_size, :right, block_offset) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - outputs.borders << [130, 180, 50, 50, 255, 0, 0] -** Processing line: ~ outputs.borders << [190, 180, 50, 50, 255, 0, 0, 128]~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.borders << [190, 180, 50, 50, 255, 0, 0, 128] -** Processing line: ~ outputs.borders << [250, 180, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes~ + +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.borders << [250, 180, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes -** Processing line: ~ end~ + +** Processing line: ~ #Possible orientations are :right, :left, :up, :down~ - Inside source: true *** True Line Result - end + #Possible orientations are :right, :left, :up, :down ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Shows output of different kinds of sprites on the screen~ +** Processing line: ~~ - Inside source: true *** True Line Result - # Shows output of different kinds of sprites on the screen -** Processing line: ~ def sprites_tech_demo~ + +** Processing line: ~ args.state.tshapes ||= [~ - Inside source: true *** True Line Result - def sprites_tech_demo -** Processing line: ~ outputs.labels << [ 5, 170, "Sprites (x, y, w, h, path, angle, a)"]~ + args.state.tshapes ||= [ +** Processing line: ~ TShape.new(args, 0, 6, block_size, :left, block_offset),~ - Inside source: true *** True Line Result - outputs.labels << [ 5, 170, "Sprites (x, y, w, h, path, angle, a)"] -** Processing line: ~ outputs.sprites << [ 10, 40, 128, 101, 'dragonruby.png']~ + TShape.new(args, 0, 6, block_size, :left, block_offset), +** Processing line: ~ TShape.new(args, 3, 3, block_size, :down, block_offset),~ - Inside source: true *** True Line Result - outputs.sprites << [ 10, 40, 128, 101, 'dragonruby.png'] -** Processing line: ~ outputs.sprites << [ 150, 40, 128, 101, 'dragonruby.png', state.tick_count % 360] # angle changes~ + TShape.new(args, 3, 3, block_size, :down, block_offset), +** Processing line: ~ TShape.new(args, 0, 3, block_size, :right, block_offset),~ - Inside source: true *** True Line Result - outputs.sprites << [ 150, 40, 128, 101, 'dragonruby.png', state.tick_count % 360] # angle changes -** Processing line: ~ outputs.sprites << [ 300, 40, 128, 101, 'dragonruby.png', 0, state.tick_count % 255] # transparency changes~ + TShape.new(args, 0, 3, block_size, :right, block_offset), +** Processing line: ~ TShape.new(args, 0, 11, block_size, :up, block_offset)~ - Inside source: true *** True Line Result - outputs.sprites << [ 300, 40, 128, 101, 'dragonruby.png', 0, state.tick_count % 255] # transparency changes -** Processing line: ~ end~ + TShape.new(args, 0, 11, block_size, :up, block_offset) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - end + ] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Holds size, alignment, color (black), and alpha (transparency) parameters~ -- Inside source: true -*** True Line Result - # Holds size, alignment, color (black), and alpha (transparency) parameters -** Processing line: ~ # Using small_font as a parameter accounts for all remaining parameters~ +** Processing line: ~ args.state.lines ||= [~ - Inside source: true *** True Line Result - # Using small_font as a parameter accounts for all remaining parameters -** Processing line: ~ # so they don't have to be repeatedly typed~ + args.state.lines ||= [ +** Processing line: ~ Line.new(args,3, 8, block_size, :down, block_offset),~ - Inside source: true *** True Line Result - # so they don't have to be repeatedly typed -** Processing line: ~ def small_font~ + Line.new(args,3, 8, block_size, :down, block_offset), +** Processing line: ~ Line.new(args, 7, 3, block_size, :up, block_offset),~ - Inside source: true *** True Line Result - def small_font -** Processing line: ~ [-2, 0, 0, 0, 0, 255]~ + Line.new(args, 7, 3, block_size, :up, block_offset), +** Processing line: ~ Line.new(args, 3, 7, block_size, :right, block_offset)~ - Inside source: true *** True Line Result - [-2, 0, 0, 0, 0, 255] -** Processing line: ~ end~ + Line.new(args, 3, 7, block_size, :right, block_offset) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - end + ] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets position of each row~ -- Inside source: true -*** True Line Result - # Sets position of each row -** Processing line: ~ # Converts given row value to pixels that DragonRuby understands~ +** Processing line: ~ #exit()~ - Inside source: true *** True Line Result - # Converts given row value to pixels that DragonRuby understands -** Processing line: ~ def row_to_px row_number~ + #exit() +** Processing line: ~ end~ - Inside source: true *** True Line Result - def row_to_px row_number + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Row 0 starts 5 units below the top of the grid.~ -- Inside source: true -*** True Line Result - # Row 0 starts 5 units below the top of the grid. -** Processing line: ~ # Each row afterward is 20 units lower.~ +** Processing line: ~ def init_balls args~ - Inside source: true *** True Line Result - # Each row afterward is 20 units lower. -** Processing line: ~ grid.top.shift_down(5).shift_down(20 * row_number)~ + def init_balls args +** Processing line: ~ return unless args.state.num_balls < BALL_COUNT~ - Inside source: true *** True Line Result - grid.top.shift_down(5).shift_down(20 * row_number) -** Processing line: ~ end~ + return unless args.state.num_balls < BALL_COUNT +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Uses labels to output current game time (passage of time), and whether or not "h" was pressed~ +** Processing line: ~ #only create a new ball every 10 ticks~ - Inside source: true *** True Line Result - # Uses labels to output current game time (passage of time), and whether or not "h" was pressed -** Processing line: ~ # If "h" is pressed, the frame is output when the key_up event occurred~ + #only create a new ball every 10 ticks +** Processing line: ~ return unless args.state.ball_created_at.elapsed_time > 10~ - Inside source: true *** True Line Result - # If "h" is pressed, the frame is output when the key_up event occurred -** Processing line: ~ def keyboards_tech_demo~ + return unless args.state.ball_created_at.elapsed_time > 10 +** Processing line: ~~ - Inside source: true *** True Line Result - def keyboards_tech_demo -** Processing line: ~ outputs.labels << [460, row_to_px(0), "Current game time: #{state.tick_count}", small_font]~ + +** Processing line: ~ if (args.state.num_balls == 0)~ - Inside source: true *** True Line Result - outputs.labels << [460, row_to_px(0), "Current game time: #{state.tick_count}", small_font] -** Processing line: ~ outputs.labels << [460, row_to_px(2), "Keyboard input: inputs.keyboard.key_up.h", small_font]~ + if (args.state.num_balls == 0) +** Processing line: ~ args.state.balls.append(Ball.new(args,args.state.num_balls,BALL_COUNT-1, nil, nil))~ - Inside source: true *** True Line Result - outputs.labels << [460, row_to_px(2), "Keyboard input: inputs.keyboard.key_up.h", small_font] -** Processing line: ~ outputs.labels << [460, row_to_px(3), "Press \"h\" on the keyboard.", small_font]~ + args.state.balls.append(Ball.new(args,args.state.num_balls,BALL_COUNT-1, nil, nil)) +** Processing line: ~ args.state.ballParents = [args.state.balls[0]]~ - Inside source: true *** True Line Result - outputs.labels << [460, row_to_px(3), "Press \"h\" on the keyboard.", small_font] -** Processing line: ~~ + args.state.ballParents = [args.state.balls[0]] +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ if inputs.keyboard.key_up.h # if "h" key_up event occurs~ + else +** Processing line: ~ args.state.balls.append(Ball.new(args,args.state.num_balls,BALL_COUNT-1, args.state.balls.last, nil) )~ - Inside source: true *** True Line Result - if inputs.keyboard.key_up.h # if "h" key_up event occurs -** Processing line: ~ state.h_pressed_at = state.tick_count # frame it occurred is stored~ + args.state.balls.append(Ball.new(args,args.state.num_balls,BALL_COUNT-1, args.state.balls.last, nil) ) +** Processing line: ~ args.state.balls[-2].child = args.state.balls[-1]~ - Inside source: true *** True Line Result - state.h_pressed_at = state.tick_count # frame it occurred is stored + args.state.balls[-2].child = args.state.balls[-1] ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ args.state.ball_created_at = args.state.tick_count~ - Inside source: true *** True Line Result - -** Processing line: ~ # h_pressed_at is initially set to false, and changes once the user presses the "h" key.~ + args.state.ball_created_at = args.state.tick_count +** Processing line: ~ args.state.num_balls += 1~ - Inside source: true *** True Line Result - # h_pressed_at is initially set to false, and changes once the user presses the "h" key. -** Processing line: ~ state.h_pressed_at ||= false~ + args.state.num_balls += 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.h_pressed_at ||= false -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.h_pressed_at # if h is pressed (pressed_at has a frame number and is no longer false)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - if state.h_pressed_at # if h is pressed (pressed_at has a frame number and is no longer false) -** Processing line: ~ outputs.labels << [460, row_to_px(4), "\"h\" was pressed at time: #{state.h_pressed_at}", small_font]~ + +** Processing line: ~ #Render loop~ - Inside source: true *** True Line Result - outputs.labels << [460, row_to_px(4), "\"h\" was pressed at time: #{state.h_pressed_at}", small_font] -** Processing line: ~ else # otherwise, label says "h" was never pressed~ + #Render loop +** Processing line: ~ def render args~ - Inside source: true *** True Line Result - else # otherwise, label says "h" was never pressed -** Processing line: ~ outputs.labels << [460, row_to_px(4), "\"h\" has never been pressed.", small_font]~ + def render args +** Processing line: ~ bgClr = {r:10, g:10, b:200}~ - Inside source: true *** True Line Result - outputs.labels << [460, row_to_px(4), "\"h\" has never been pressed.", small_font] -** Processing line: ~ end~ + bgClr = {r:10, g:10, b:200} +** Processing line: ~ bgClr = {r:255-30, g:255-30, b:255-30}~ - Inside source: true *** True Line Result - end + bgClr = {r:255-30, g:255-30, b:255-30} ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # border around keyboard input demo section~ -- Inside source: true -*** True Line Result - # border around keyboard input demo section -** Processing line: ~ outputs.borders << [455, row_to_px(5), 360, row_to_px(2).shift_up(5) - row_to_px(5)]~ +** Processing line: ~ args.outputs.solids << [0, 0, $args.grid.right, $args.grid.top, bgClr[:r], bgClr[:g], bgClr[:b]];~ - Inside source: true *** True Line Result - outputs.borders << [455, row_to_px(5), 360, row_to_px(2).shift_up(5) - row_to_px(5)] -** Processing line: ~ end~ + args.outputs.solids << [0, 0, $args.grid.right, $args.grid.top, bgClr[:r], bgClr[:g], bgClr[:b]]; +** Processing line: ~ args.outputs.borders << args.state.game_area~ - Inside source: true *** True Line Result - end + args.outputs.borders << args.state.game_area ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets definition for a small label~ -- Inside source: true -*** True Line Result - # Sets definition for a small label -** Processing line: ~ # Makes it easier to position labels in respect to the position of other labels~ +** Processing line: ~ render_instructions args~ - Inside source: true *** True Line Result - # Makes it easier to position labels in respect to the position of other labels -** Processing line: ~ def small_label x, row, message~ + render_instructions args +** Processing line: ~ render_shapes args~ - Inside source: true *** True Line Result - def small_label x, row, message -** Processing line: ~ [x, row_to_px(row), message, small_font]~ + render_shapes args +** Processing line: ~~ - Inside source: true *** True Line Result - [x, row_to_px(row), message, small_font] -** Processing line: ~ end~ + +** Processing line: ~ render_balls args~ - Inside source: true *** True Line Result - end + render_balls args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Uses small labels to show whether the "a" button on the controller is down, held, or up.~ -- Inside source: true -*** True Line Result - # Uses small labels to show whether the "a" button on the controller is down, held, or up. -** Processing line: ~ # y value of each small label is set by calling the row_to_px method~ +** Processing line: ~ #args.state.rectangle.draw args~ - Inside source: true *** True Line Result - # y value of each small label is set by calling the row_to_px method -** Processing line: ~ def controller_tech_demo~ + #args.state.rectangle.draw args +** Processing line: ~~ - Inside source: true *** True Line Result - def controller_tech_demo -** Processing line: ~ x = 460~ + +** Processing line: ~ args.outputs.sprites << [$args.grid.right-(args.state.board_width + args.grid.w / 8), 0, $args.grid.right, $args.grid.top, "sprites/square-white-2.png", 0, 255, bgClr[:r], bgClr[:g], bgClr[:b]]~ - Inside source: true *** True Line Result - x = 460 -** Processing line: ~ outputs.labels << small_label(x, 6, "Controller one input: inputs.controller_one")~ + args.outputs.sprites << [$args.grid.right-(args.state.board_width + args.grid.w / 8), 0, $args.grid.right, $args.grid.top, "sprites/square-white-2.png", 0, 255, bgClr[:r], bgClr[:g], bgClr[:b]] +** Processing line: ~ args.outputs.sprites << [0, 0, (args.state.board_width + args.grid.w / 8), $args.grid.top, "sprites/square-white-2.png", 0, 255, bgClr[:r], bgClr[:g], bgClr[:b]]~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 6, "Controller one input: inputs.controller_one") -** Processing line: ~ outputs.labels << small_label(x, 7, "Current state of the \"a\" button.")~ + args.outputs.sprites << [0, 0, (args.state.board_width + args.grid.w / 8), $args.grid.top, "sprites/square-white-2.png", 0, 255, bgClr[:r], bgClr[:g], bgClr[:b]] +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 7, "Current state of the \"a\" button.") -** Processing line: ~ outputs.labels << small_label(x, 8, "Check console window for more info.")~ + +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 8, "Check console window for more info.") + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if inputs.controller_one.key_down.a # if "a" is in "down" state~ -- Inside source: true -*** True Line Result - if inputs.controller_one.key_down.a # if "a" is in "down" state -** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button down: #{inputs.controller_one.key_down.a}")~ +** Processing line: ~ begin :render_methods~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 9, "\"a\" button down: #{inputs.controller_one.key_down.a}") -** Processing line: ~ puts "\"a\" button down at #{inputs.controller_one.key_down.a}" # prints frame the event occurred~ + begin :render_methods +** Processing line: ~ def render_instructions args~ - Inside source: true *** True Line Result - puts "\"a\" button down at #{inputs.controller_one.key_down.a}" # prints frame the event occurred -** Processing line: ~ elsif inputs.controller_one.key_held.a # if "a" is held down~ + def render_instructions args +** Processing line: ~ #gtk.current_framerate~ - Inside source: true *** True Line Result - elsif inputs.controller_one.key_held.a # if "a" is held down -** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button held: #{inputs.controller_one.key_held.a}")~ + #gtk.current_framerate +** Processing line: ~ args.outputs.labels << [20, $args.grid.top-20, "FPS: " + $gtk.current_framerate.to_s]~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 9, "\"a\" button held: #{inputs.controller_one.key_held.a}") -** Processing line: ~ elsif inputs.controller_one.key_up.a # if "a" is in up state~ + args.outputs.labels << [20, $args.grid.top-20, "FPS: " + $gtk.current_framerate.to_s] +** Processing line: ~ if (args.state.balls != nil && args.state.balls[0] != nil)~ - Inside source: true *** True Line Result - elsif inputs.controller_one.key_up.a # if "a" is in up state -** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button up: #{inputs.controller_one.key_up.a}")~ + if (args.state.balls != nil && args.state.balls[0] != nil) +** Processing line: ~ bx = args.state.balls[0].velocity.x~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 9, "\"a\" button up: #{inputs.controller_one.key_up.a}") -** Processing line: ~ puts "\"a\" key up at #{inputs.controller_one.key_up.a}"~ + bx = args.state.balls[0].velocity.x +** Processing line: ~ by = args.state.balls[0].velocity.y~ - Inside source: true *** True Line Result - puts "\"a\" key up at #{inputs.controller_one.key_up.a}" -** Processing line: ~ else # if no event has occurred~ + by = args.state.balls[0].velocity.y +** Processing line: ~ bmg = (bx**2.0 + by**2.0)**0.5~ - Inside source: true *** True Line Result - else # if no event has occurred -** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button state is nil.")~ + bmg = (bx**2.0 + by**2.0)**0.5 +** Processing line: ~ args.outputs.labels << [20, $args.grid.top-20-20, "V: " + bmg.to_s ]~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 9, "\"a\" button state is nil.") + args.outputs.labels << [20, $args.grid.top-20-20, "V: " + bmg.to_s ] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -33263,14 +36772,10 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # border around controller input demo section~ -- Inside source: true -*** True Line Result - # border around controller input demo section -** Processing line: ~ outputs.borders << [455, row_to_px(10), 360, row_to_px(6).shift_up(5) - row_to_px(10)]~ +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.borders << [455, row_to_px(10), 360, row_to_px(6).shift_up(5) - row_to_px(10)] + ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -33279,42 +36784,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Outputs when the mouse was clicked, as well as the coordinates on the screen~ +** Processing line: ~ def render_shapes args~ - Inside source: true *** True Line Result - # Outputs when the mouse was clicked, as well as the coordinates on the screen -** Processing line: ~ # of where the click occurred~ + def render_shapes args +** Processing line: ~ for s in args.state.squares~ - Inside source: true *** True Line Result - # of where the click occurred -** Processing line: ~ def mouse_tech_demo~ + for s in args.state.squares +** Processing line: ~ s.draw args~ - Inside source: true *** True Line Result - def mouse_tech_demo -** Processing line: ~ x = 460~ + s.draw args +** Processing line: ~ end~ - Inside source: true *** True Line Result - x = 460 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.labels << small_label(x, 11, "Mouse input: inputs.mouse")~ +** Processing line: ~ for l in args.state.lines~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 11, "Mouse input: inputs.mouse") + for l in args.state.lines +** Processing line: ~ l.draw args~ +- Inside source: true +*** True Line Result + l.draw args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if inputs.mouse.click # if click has a value and is not nil~ +** Processing line: ~ for t in args.state.tshapes~ - Inside source: true *** True Line Result - if inputs.mouse.click # if click has a value and is not nil -** Processing line: ~ state.last_mouse_click = inputs.mouse.click # coordinates of click are stored~ + for t in args.state.tshapes +** Processing line: ~ t.draw args~ - Inside source: true *** True Line Result - state.last_mouse_click = inputs.mouse.click # coordinates of click are stored + t.draw args ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -33323,38 +36836,46 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ if state.last_mouse_click # if mouse is clicked (has coordinates as value)~ +** Processing line: ~~ - Inside source: true *** True Line Result - if state.last_mouse_click # if mouse is clicked (has coordinates as value) -** Processing line: ~ # outputs the time (frame) the click occurred, as well as how many frames have passed since the event~ + +** Processing line: ~ end~ - Inside source: true *** True Line Result - # outputs the time (frame) the click occurred, as well as how many frames have passed since the event -** Processing line: ~ outputs.labels << small_label(x, 12, "Mouse click happened at: #{state.last_mouse_click.created_at}, #{state.last_mouse_click.created_at_elapsed}")~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 12, "Mouse click happened at: #{state.last_mouse_click.created_at}, #{state.last_mouse_click.created_at_elapsed}") -** Processing line: ~ # outputs coordinates of click~ + +** Processing line: ~ def render_balls args~ - Inside source: true *** True Line Result - # outputs coordinates of click -** Processing line: ~ outputs.labels << small_label(x, 13, "Mouse click location: #{state.last_mouse_click.point.x}, #{state.last_mouse_click.point.y}")~ + def render_balls args +** Processing line: ~ #args.state.balls.each do |ball|~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 13, "Mouse click location: #{state.last_mouse_click.point.x}, #{state.last_mouse_click.point.y}") -** Processing line: ~ else # otherwise if the mouse has not been clicked~ + #args.state.balls.each do |ball| +** Processing line: ~ #ball.draw args~ - Inside source: true *** True Line Result - else # otherwise if the mouse has not been clicked -** Processing line: ~ outputs.labels << small_label(x, 12, "Mouse click has not occurred yet.")~ + #ball.draw args +** Processing line: ~ #end~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 12, "Mouse click has not occurred yet.") -** Processing line: ~ outputs.labels << small_label(x, 13, "Please click mouse.")~ + #end +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 13, "Please click mouse.") + +** Processing line: ~ args.outputs.sprites << args.state.balls.map do |ball|~ +- Inside source: true +*** True Line Result + args.outputs.sprites << args.state.balls.map do |ball| +** Processing line: ~ ball.getDraw args~ +- Inside source: true +*** True Line Result + ball.getDraw args ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -33363,338 +36884,318 @@ 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: ~ # Outputs whether a mouse click occurred inside or outside of a box~ +** Processing line: ~ #Calls all methods necessary for performing calculations~ - Inside source: true *** True Line Result - # Outputs whether a mouse click occurred inside or outside of a box -** Processing line: ~ def point_to_rect_tech_demo~ + #Calls all methods necessary for performing calculations +** Processing line: ~ def calc args~ - Inside source: true *** True Line Result - def point_to_rect_tech_demo -** Processing line: ~ x = 460~ + def calc args +** Processing line: ~ for b in args.state.ballParents~ - Inside source: true *** True Line Result - x = 460 -** Processing line: ~~ + for b in args.state.ballParents +** Processing line: ~ b.update args~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.labels << small_label(x, 15, "Click inside the blue box maybe ---->")~ + b.update args +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 15, "Click inside the blue box maybe ---->") + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ box = [765, 370, 50, 50, 0, 0, 170] # blue box~ +** Processing line: ~ for s in args.state.squares~ - Inside source: true *** True Line Result - box = [765, 370, 50, 50, 0, 0, 170] # blue box -** Processing line: ~ outputs.borders << box~ + for s in args.state.squares +** Processing line: ~ s.update args~ - Inside source: true *** True Line Result - outputs.borders << box + s.update args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.last_mouse_click # if the mouse was clicked~ +** Processing line: ~ for l in args.state.lines~ - Inside source: true *** True Line Result - if state.last_mouse_click # if the mouse was clicked -** Processing line: ~ if state.last_mouse_click.point.inside_rect? box # if mouse clicked inside box~ + for l in args.state.lines +** Processing line: ~ l.update args~ - Inside source: true *** True Line Result - if state.last_mouse_click.point.inside_rect? box # if mouse clicked inside box -** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click happened inside the box.")~ + l.update args +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 16, "Mouse click happened inside the box.") -** Processing line: ~ else # otherwise, if mouse was clicked outside the box~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else # otherwise, if mouse was clicked outside the box -** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click happened outside the box.")~ + +** Processing line: ~ for t in args.state.tshapes~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 16, "Mouse click happened outside the box.") -** Processing line: ~ end~ + for t in args.state.tshapes +** Processing line: ~ t.update args~ - Inside source: true *** True Line Result - end -** Processing line: ~ else # otherwise, if was not clicked at all~ + t.update args +** Processing line: ~ end~ - Inside source: true *** True Line Result - else # otherwise, if was not clicked at all -** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click has not occurred yet.") # output if the mouse was not clicked~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 16, "Mouse click has not occurred yet.") # output if the mouse was not clicked -** Processing line: ~ end~ + +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # border around mouse input demo section~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - # border around mouse input demo section -** Processing line: ~ outputs.borders << [455, row_to_px(14), 360, row_to_px(11).shift_up(5) - row_to_px(14)]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.borders << [455, row_to_px(14), 360, row_to_px(11).shift_up(5) - row_to_px(14)] -** Processing line: ~ end~ + +** Processing line: ~ begin :calc_methods~ - Inside source: true *** True Line Result - end + begin :calc_methods ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs a red box onto the screen. A mouse click from the user inside of the red box will output~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Outputs a red box onto the screen. A mouse click from the user inside of the red box will output -** Processing line: ~ # a smaller box. If two small boxes are inside of the red box, it will be determined whether or not~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # a smaller box. If two small boxes are inside of the red box, it will be determined whether or not -** Processing line: ~ # they intersect.~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # they intersect. -** Processing line: ~ def rect_to_rect_tech_demo~ + def tick args +** Processing line: ~ defaults args~ - Inside source: true *** True Line Result - def rect_to_rect_tech_demo -** Processing line: ~ x = 460~ + defaults args +** Processing line: ~ render args~ - Inside source: true *** True Line Result - x = 460 -** Processing line: ~~ + render args +** Processing line: ~ calc args~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.labels << small_label(x, 17.5, "Click inside the red box below.") # label with instructions~ + calc args +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 17.5, "Click inside the red box below.") # label with instructions -** Processing line: ~ red_box = [460, 250, 355, 90, 170, 0, 0] # definition of the red box~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - red_box = [460, 250, 355, 90, 170, 0, 0] # definition of the red box -** Processing line: ~ outputs.borders << red_box # output as a border (not filled in)~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - outputs.borders << red_box # output as a border (not filled in) +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ # If the mouse is clicked inside the red box, two collision boxes are created.~ -- Inside source: true -*** True Line Result - # If the mouse is clicked inside the red box, two collision boxes are created. -** Processing line: ~ if inputs.mouse.click~ -- Inside source: true +** Processing line: ~*** Physics And Collisions - Arbitrary Collision - paddle.rb~ +- Header detected. *** True Line Result - if inputs.mouse.click -** Processing line: ~ if inputs.mouse.click.point.inside_rect? red_box~ -- Inside source: true + *** True Line Result - if inputs.mouse.click.point.inside_rect? red_box -** Processing line: ~ if !state.box_collision_one # if the collision_one box does not yet have a definition~ -- Inside source: true +*** Physics And Collisions - Arbitrary Collision - paddle.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - if !state.box_collision_one # if the collision_one box does not yet have a definition -** Processing line: ~ # Subtracts 25 from the x and y positions of the click point in order to make the click point the center of the box.~ -- Inside source: true + *** True Line Result - # Subtracts 25 from the x and y positions of the click point in order to make the click point the center of the box. -** Processing line: ~ # You can try deleting the subtraction to see how it impacts the box placement.~ +#+begin_src ruby +** Processing line: ~ # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/paddle.rb~ - Inside source: true *** True Line Result - # You can try deleting the subtraction to see how it impacts the box placement. -** Processing line: ~ state.box_collision_one = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 180, 0, 0, 180] # sets definition~ + # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/paddle.rb +** Processing line: ~ class Paddle~ - Inside source: true *** True Line Result - state.box_collision_one = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 180, 0, 0, 180] # sets definition -** Processing line: ~ elsif !state.box_collision_two # if collision_two does not yet have a definition~ + class Paddle +** Processing line: ~ attr_accessor :enabled~ - Inside source: true *** True Line Result - elsif !state.box_collision_two # if collision_two does not yet have a definition -** Processing line: ~ state.box_collision_two = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 0, 0, 180, 180] # sets definition~ + attr_accessor :enabled +** Processing line: ~~ - Inside source: true *** True Line Result - state.box_collision_two = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 0, 0, 180, 180] # sets definition -** Processing line: ~ else~ + +** Processing line: ~ def initialize ()~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.box_collision_one = nil # both boxes are empty~ + def initialize () +** Processing line: ~ @x=WIDTH/2~ - Inside source: true *** True Line Result - state.box_collision_one = nil # both boxes are empty -** Processing line: ~ state.box_collision_two = nil~ + @x=WIDTH/2 +** Processing line: ~ @y=100~ - Inside source: true *** True Line Result - state.box_collision_two = nil -** Processing line: ~ end~ + @y=100 +** Processing line: ~ @width=100~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + @width=100 +** Processing line: ~ @height=20~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + @height=20 +** Processing line: ~ @speed=10~ - Inside source: true *** True Line Result - end + @speed=10 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # If collision boxes exist, they are output onto screen inside the red box as solids~ +** Processing line: ~ @xyCollision = LinearCollider.new({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5})~ - Inside source: true *** True Line Result - # If collision boxes exist, they are output onto screen inside the red box as solids -** Processing line: ~ if state.box_collision_one~ + @xyCollision = LinearCollider.new({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5}) +** Processing line: ~ @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos)~ - Inside source: true *** True Line Result - if state.box_collision_one -** Processing line: ~ outputs.solids << state.box_collision_one~ + @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos) +** Processing line: ~ @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height+5})~ - Inside source: true *** True Line Result - outputs.solids << state.box_collision_one -** Processing line: ~ end~ + @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height+5}) +** Processing line: ~ @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}, :pos)~ - Inside source: true *** True Line Result - end + @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}, :pos) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.box_collision_two~ -- Inside source: true -*** True Line Result - if state.box_collision_two -** Processing line: ~ outputs.solids << state.box_collision_two~ +** Processing line: ~ @enabled = true~ - Inside source: true *** True Line Result - outputs.solids << state.box_collision_two -** Processing line: ~ end~ + @enabled = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs whether or not the two collision boxes intersect.~ -- Inside source: true -*** True Line Result - # Outputs whether or not the two collision boxes intersect. -** Processing line: ~ if state.box_collision_one && state.box_collision_two # if both collision_boxes are defined (and not nil or empty)~ +** Processing line: ~ def update args~ - Inside source: true *** True Line Result - if state.box_collision_one && state.box_collision_two # if both collision_boxes are defined (and not nil or empty) -** Processing line: ~ if state.box_collision_one.intersect_rect? state.box_collision_two # if the two boxes intersect~ + def update args +** Processing line: ~ @xyCollision.resetPoints({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5})~ - Inside source: true *** True Line Result - if state.box_collision_one.intersect_rect? state.box_collision_two # if the two boxes intersect -** Processing line: ~ outputs.labels << small_label(x, 23.5, 'The boxes intersect.')~ + @xyCollision.resetPoints({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5}) +** Processing line: ~ @xyCollision2.resetPoints({x: @x,y: @y}, {x: @x+@width, y: @y})~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 23.5, 'The boxes intersect.') -** Processing line: ~ else # otherwise, if the two boxes do not intersect~ + @xyCollision2.resetPoints({x: @x,y: @y}, {x: @x+@width, y: @y}) +** Processing line: ~ @xyCollision3.resetPoints({x: @x,y: @y}, {x: @x, y: @y+@height+5})~ - Inside source: true *** True Line Result - else # otherwise, if the two boxes do not intersect -** Processing line: ~ outputs.labels << small_label(x, 23.5, 'The boxes do not intersect.')~ + @xyCollision3.resetPoints({x: @x,y: @y}, {x: @x, y: @y+@height+5}) +** Processing line: ~ @xyCollision4.resetPoints({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5})~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 23.5, 'The boxes do not intersect.') -** Processing line: ~ end~ + @xyCollision4.resetPoints({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}) +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ else~ + +** Processing line: ~ @xyCollision.update args~ - Inside source: true *** True Line Result - else -** Processing line: ~ outputs.labels << small_label(x, 23.5, '--') # if the two boxes are not defined (are nil or empty), this label is output~ + @xyCollision.update args +** Processing line: ~ @xyCollision2.update args~ - Inside source: true *** True Line Result - outputs.labels << small_label(x, 23.5, '--') # if the two boxes are not defined (are nil or empty), this label is output -** Processing line: ~ end~ + @xyCollision2.update args +** Processing line: ~ @xyCollision3.update args~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + @xyCollision3.update args +** Processing line: ~ @xyCollision4.update args~ - Inside source: true *** True Line Result - end + @xyCollision4.update args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Creates a button and outputs it onto the screen using labels and borders.~ -- Inside source: true -*** True Line Result - # Creates a button and outputs it onto the screen using labels and borders. -** Processing line: ~ # If the button is clicked, the color changes to make it look faded.~ -- Inside source: true -*** True Line Result - # If the button is clicked, the color changes to make it look faded. -** Processing line: ~ def button_tech_demo~ -- Inside source: true -*** True Line Result - def button_tech_demo -** Processing line: ~ x, y, w, h = 460, 160, 300, 50~ +** Processing line: ~ args.inputs.keyboard.key_held.left ||= false~ - Inside source: true *** True Line Result - x, y, w, h = 460, 160, 300, 50 -** Processing line: ~ state.button ||= state.new_entity(:button_with_fade)~ + args.inputs.keyboard.key_held.left ||= false +** Processing line: ~ args.inputs.keyboard.key_held.right ||= false~ - Inside source: true *** True Line Result - state.button ||= state.new_entity(:button_with_fade) + args.inputs.keyboard.key_held.right ||= false ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Adds w.half to x and h.half + 10 to y in order to display the text inside the button's borders.~ +** Processing line: ~ if not (args.inputs.keyboard.key_held.left == args.inputs.keyboard.key_held.right)~ - Inside source: true *** True Line Result - # Adds w.half to x and h.half + 10 to y in order to display the text inside the button's borders. -** Processing line: ~ state.button.label ||= [x + w.half, y + h.half + 10, "click me and watch me fade", 0, 1]~ + if not (args.inputs.keyboard.key_held.left == args.inputs.keyboard.key_held.right) +** Processing line: ~ if args.inputs.keyboard.key_held.left && @enabled~ - Inside source: true *** True Line Result - state.button.label ||= [x + w.half, y + h.half + 10, "click me and watch me fade", 0, 1] -** Processing line: ~ state.button.border ||= [x, y, w, h]~ + if args.inputs.keyboard.key_held.left && @enabled +** Processing line: ~ @x-=@speed~ - Inside source: true *** True Line Result - state.button.border ||= [x, y, w, h] -** Processing line: ~~ + @x-=@speed +** Processing line: ~ elsif args.inputs.keyboard.key_held.right && @enabled~ - Inside source: true *** True Line Result - -** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.button.border) # if mouse is clicked, and clicked inside button's border~ + elsif args.inputs.keyboard.key_held.right && @enabled +** Processing line: ~ @x+=@speed~ - Inside source: true *** True Line Result - if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.button.border) # if mouse is clicked, and clicked inside button's border -** Processing line: ~ state.button.clicked_at = inputs.mouse.click.created_at # stores the time the click occurred~ + @x+=@speed +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.button.clicked_at = inputs.mouse.click.created_at # stores the time the click occurred + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -33703,46 +37204,34 @@ 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 << state.button.label~ +** Processing line: ~ xmin =WIDTH/4~ - Inside source: true *** True Line Result - outputs.labels << state.button.label -** Processing line: ~ outputs.borders << state.button.border~ + xmin =WIDTH/4 +** Processing line: ~ xmax = 3*(WIDTH/4)~ - Inside source: true *** True Line Result - outputs.borders << state.button.border -** Processing line: ~~ + xmax = 3*(WIDTH/4) +** Processing line: ~ @x = (@x+@width > xmax) ? xmax-@width : (@x xmax) ? xmax-@width : (@x= [@pointA.x,@pointB.x].min+(@extension == :pos ? -@thickness : 0) &&~ - Inside source: true *** True Line Result - -** Processing line: ~ For example, if we have a "numbers" hash that stores numbers in English as the~ + point.x >= [@pointA.x,@pointB.x].min+(@extension == :pos ? -@thickness : 0) && +** Processing line: ~ point.x <= [@pointA.x,@pointB.x].max+(@extension == :neg ? @thickness : 0) &&~ - Inside source: true *** True Line Result - For example, if we have a "numbers" hash that stores numbers in English as the -** Processing line: ~ key and numbers in Spanish as the value, we'd have a hash that looks like this...~ + point.x <= [@pointA.x,@pointB.x].max+(@extension == :neg ? @thickness : 0) && +** Processing line: ~ point.y >= [@pointA.y,@pointB.y].min && point.y <= [@pointA.y,@pointB.y].max~ - Inside source: true *** True Line Result - key and numbers in Spanish as the value, we'd have a hash that looks like this... -** Processing line: ~ numbers = { "one" => "uno", "two" => "dos", "three" => "tres" }~ + point.y >= [@pointA.y,@pointB.y].min && point.y <= [@pointA.y,@pointB.y].max +** Processing line: ~ return true~ - Inside source: true *** True Line Result - numbers = { "one" => "uno", "two" => "dos", "three" => "tres" } -** Processing line: ~ and on it goes.~ + return true +** Processing line: ~ end~ - Inside source: true *** True Line Result - and on it goes. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Now if we wanted to find the corresponding value of the "one" key, we could say~ -- Inside source: true -*** True Line Result - Now if we wanted to find the corresponding value of the "one" key, we could say -** Processing line: ~ puts numbers["one"]~ +** Processing line: ~ isNegInLine = @extension == :neg &&~ - Inside source: true *** True Line Result - puts numbers["one"] -** Processing line: ~ which would print "uno" to the console.~ + isNegInLine = @extension == :neg && +** Processing line: ~ point.y <= slope(@pointA, @pointB)*point.x+intercept(@pointA,@pointB) &&~ - Inside source: true *** True Line Result - which would print "uno" to the console. -** Processing line: ~~ + point.y <= slope(@pointA, @pointB)*point.x+intercept(@pointA,@pointB) && +** Processing line: ~ point.y >= point.x*slope(@pointAExtended, @pointBExtended)+intercept(@pointAExtended,@pointBExtended)~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ + point.y >= point.x*slope(@pointAExtended, @pointBExtended)+intercept(@pointAExtended,@pointBExtended) +** Processing line: ~ isPosInLine = @extension == :pos &&~ - Inside source: true *** True Line Result - - args.outputs.sprites: An array. The values generate a sprite. -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE]~ + isPosInLine = @extension == :pos && +** Processing line: ~ point.y >= slope(@pointA, @pointB)*point.x+intercept(@pointA,@pointB) &&~ - Inside source: true *** True Line Result - The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE] -** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ + point.y >= slope(@pointA, @pointB)*point.x+intercept(@pointA,@pointB) && +** Processing line: ~ point.y <= point.x*slope(@pointAExtended, @pointBExtended)+intercept(@pointAExtended,@pointBExtended)~ - Inside source: true *** True Line Result - For more information about sprites, go to mygame/documentation/05-sprites.md. -** Processing line: ~~ + point.y <= point.x*slope(@pointAExtended, @pointBExtended)+intercept(@pointAExtended,@pointBExtended) +** Processing line: ~ isInBoxBounds = point.x >= [@pointA.x,@pointB.x].min &&~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ + isInBoxBounds = point.x >= [@pointA.x,@pointB.x].min && +** Processing line: ~ point.x <= [@pointA.x,@pointB.x].max &&~ - Inside source: true *** True Line Result - - args.outputs.labels: An array. The values generate a label. -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ + point.x <= [@pointA.x,@pointB.x].max && +** Processing line: ~ point.y >= [@pointA.y,@pointB.y].min+(@extension == :neg ? -@thickness : 0) &&~ - Inside source: true *** True Line Result - The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ + point.y >= [@pointA.y,@pointB.y].min+(@extension == :neg ? -@thickness : 0) && +** Processing line: ~ point.y <= [@pointA.y,@pointB.y].max+(@extension == :pos ? @thickness : 0)~ - Inside source: true *** True Line Result - For more information about labels, go to mygame/documentation/02-labels.md. + point.y <= [@pointA.y,@pointB.y].max+(@extension == :pos ? @thickness : 0) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ +** Processing line: ~ return isInBoxBounds && (isNegInLine || isPosInLine)~ - Inside source: true *** True Line Result - - args.outputs.solids: An array. The values generate a solid. -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ + return isInBoxBounds && (isNegInLine || isPosInLine) +** Processing line: ~~ - Inside source: true *** True Line Result - The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] -** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ + +** Processing line: ~ end~ - Inside source: true *** True Line Result - For more information about solids, go to mygame/documentation/03-solids-and-borders.md. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.outputs.borders: An array. The values generate a border.~ +** Processing line: ~ def getRepelMagnitude (fbx, fby, vrx, vry, args)~ - Inside source: true *** True Line Result - - args.outputs.borders: An array. The values generate a border. -** Processing line: ~ The parameters are the same as a solid.~ + def getRepelMagnitude (fbx, fby, vrx, vry, args) +** Processing line: ~ a = fbx ; b = vrx ; c = fby~ - Inside source: true *** True Line Result - The parameters are the same as a solid. -** Processing line: ~ For more information about borders, go to mygame/documentation/03-solids-and-borders.md.~ + a = fbx ; b = vrx ; c = fby +** Processing line: ~ d = vry ; e = args.state.ball.velocity.mag~ - Inside source: true *** True Line Result - For more information about borders, go to mygame/documentation/03-solids-and-borders.md. + d = vry ; e = args.state.ball.velocity.mag ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.outputs.lines: An array. The values generate a line.~ +** Processing line: ~ if b**2 + d**2 == 0~ - Inside source: true *** True Line Result - - args.outputs.lines: An array. The values generate a line. -** Processing line: ~ The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE]~ + if b**2 + d**2 == 0 +** Processing line: ~ puts "magnitude error"~ - Inside source: true *** True Line Result - The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE] -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ + puts "magnitude error" +** Processing line: ~ end~ - Inside source: true *** True Line Result - For more information about labels, go to mygame/documentation/02-labels.md. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ =end~ +** Processing line: ~ x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)~ - Inside source: true *** True Line Result - =end -** Processing line: ~~ + x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2) +** Processing line: ~ x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2))~ - Inside source: true *** True Line Result - -** Processing line: ~ # This sample app demonstrates how hashes can be used to output different kinds of objects.~ + x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)) +** Processing line: ~ return ((a+x1*b)**2 + (c+x1*d)**2 == e**2) ? x1 : x2~ - Inside source: true *** True Line Result - # This sample app demonstrates how hashes can be used to output different kinds of objects. + return ((a+x1*b)**2 + (c+x1*d)**2 == e**2) ? x1 : x2 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ def update args~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.state.angle ||= 0 # initializes angle to 0~ + def update args +** Processing line: ~ #each of the four points on the square ball - NOTE simple to extend to a circle~ - Inside source: true *** True Line Result - args.state.angle ||= 0 # initializes angle to 0 -** Processing line: ~ args.state.angle += 1 # increments angle by 1 every frame (60 times a second)~ + #each of the four points on the square ball - NOTE simple to extend to a circle +** Processing line: ~ points= [ {x: args.state.ball.xy.x, y: args.state.ball.xy.y},~ - Inside source: true *** True Line Result - args.state.angle += 1 # increments angle by 1 every frame (60 times a second) -** Processing line: ~~ + points= [ {x: args.state.ball.xy.x, y: args.state.ball.xy.y}, +** Processing line: ~ {x: args.state.ball.xy.x+args.state.ball.width, y: args.state.ball.xy.y},~ - Inside source: true *** True Line Result - -** Processing line: ~ # Outputs sprite using a hash~ + {x: args.state.ball.xy.x+args.state.ball.width, y: args.state.ball.xy.y}, +** Processing line: ~ {x: args.state.ball.xy.x, y: args.state.ball.xy.y+args.state.ball.height},~ - Inside source: true *** True Line Result - # Outputs sprite using a hash -** Processing line: ~ args.outputs.sprites << {~ + {x: args.state.ball.xy.x, y: args.state.ball.xy.y+args.state.ball.height}, +** Processing line: ~ {x: args.state.ball.xy.x+args.state.ball.width, y: args.state.ball.xy.y + args.state.ball.height}~ - Inside source: true *** True Line Result - args.outputs.sprites << { -** Processing line: ~ x: 30, # sprite position~ + {x: args.state.ball.xy.x+args.state.ball.width, y: args.state.ball.xy.y + args.state.ball.height} +** Processing line: ~ ]~ - Inside source: true *** True Line Result - x: 30, # sprite position -** Processing line: ~ y: 550,~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - y: 550, -** Processing line: ~ w: 128, # sprite size~ + +** Processing line: ~ #for each point p in points~ - Inside source: true *** True Line Result - w: 128, # sprite size -** Processing line: ~ h: 101,~ + #for each point p in points +** Processing line: ~ for point in points~ - Inside source: true *** True Line Result - h: 101, -** Processing line: ~ path: "dragonruby.png", # image path~ + for point in points +** Processing line: ~ #isCollision.md has more information on this section~ - Inside source: true *** True Line Result - path: "dragonruby.png", # image path -** Processing line: ~ angle: args.state.angle, # angle~ + #isCollision.md has more information on this section +** Processing line: ~ #TODO: section can certainly be simplifyed~ - Inside source: true *** True Line Result - angle: args.state.angle, # angle -** Processing line: ~ a: 255, # alpha (transparency)~ + #TODO: section can certainly be simplifyed +** Processing line: ~ if isCollision?(point)~ - Inside source: true *** True Line Result - a: 255, # alpha (transparency) -** Processing line: ~ r: 255, # color saturation~ + if isCollision?(point) +** Processing line: ~ u = Vector2d.new(1.0,((slope(@pointA, @pointB)==0) ? INFINITY : -1/slope(@pointA, @pointB))*1.0).normalize #normal perpendicular (to line segment) vector~ - Inside source: true *** True Line Result - r: 255, # color saturation -** Processing line: ~ g: 255,~ + u = Vector2d.new(1.0,((slope(@pointA, @pointB)==0) ? INFINITY : -1/slope(@pointA, @pointB))*1.0).normalize #normal perpendicular (to line segment) vector +** Processing line: ~~ - Inside source: true *** True Line Result - g: 255, -** Processing line: ~ b: 255,~ + +** Processing line: ~ #the vector with the repeling force can be u or -u depending of where the ball was coming from in relation to the line segment~ - Inside source: true *** True Line Result - b: 255, -** Processing line: ~ tile_x: 0, # sprite sub division/tile~ + #the vector with the repeling force can be u or -u depending of where the ball was coming from in relation to the line segment +** Processing line: ~ previousBallPosition=Vector2d.new(point.x-args.state.ball.velocity.x,point.y-args.state.ball.velocity.y)~ - Inside source: true *** True Line Result - tile_x: 0, # sprite sub division/tile -** Processing line: ~ tile_y: 0,~ + previousBallPosition=Vector2d.new(point.x-args.state.ball.velocity.x,point.y-args.state.ball.velocity.y) +** Processing line: ~ choiceA = (u.mult(1))~ - Inside source: true *** True Line Result - tile_y: 0, -** Processing line: ~ tile_w: -1,~ + choiceA = (u.mult(1)) +** Processing line: ~ choiceB = (u.mult(-1))~ - Inside source: true *** True Line Result - tile_w: -1, -** Processing line: ~ tile_h: -1,~ + choiceB = (u.mult(-1)) +** Processing line: ~ vectorRepel = nil~ - Inside source: true *** True Line Result - tile_h: -1, -** Processing line: ~ flip_vertically: false, # don't flip sprite~ + vectorRepel = nil +** Processing line: ~~ - Inside source: true *** True Line Result - flip_vertically: false, # don't flip sprite -** Processing line: ~ flip_horizontally: false,~ + +** Processing line: ~ if (slope(@pointA, @pointB))!=INFINITY && u.y < 0~ - Inside source: true *** True Line Result - flip_horizontally: false, -** Processing line: ~ angle_anchor_x: 0.5, # rotation center set to middle~ + if (slope(@pointA, @pointB))!=INFINITY && u.y < 0 +** Processing line: ~ choiceA, choiceB = choiceB, choiceA~ - Inside source: true *** True Line Result - angle_anchor_x: 0.5, # rotation center set to middle -** Processing line: ~ angle_anchor_y: 0.5~ + choiceA, choiceB = choiceB, choiceA +** Processing line: ~ end~ - Inside source: true *** True Line Result - angle_anchor_y: 0.5 -** Processing line: ~ }~ + end +** Processing line: ~ vectorRepel = (previousBallPosition.y > calcY(@pointA, @pointB, previousBallPosition.x)) ? choiceA : choiceB~ - Inside source: true *** True Line Result - } + vectorRepel = (previousBallPosition.y > calcY(@pointA, @pointB, previousBallPosition.x)) ? choiceA : choiceB ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs label using a hash~ +** Processing line: ~ #vectorRepel = (previousBallPosition.y > slope(@pointA, @pointB)*previousBallPosition.x+intercept(@pointA,@pointB)) ? choiceA : choiceB)~ - Inside source: true *** True Line Result - # Outputs label using a hash -** Processing line: ~ args.outputs.labels << {~ + #vectorRepel = (previousBallPosition.y > slope(@pointA, @pointB)*previousBallPosition.x+intercept(@pointA,@pointB)) ? choiceA : choiceB) +** Processing line: ~ if (slope(@pointA, @pointB) == INFINITY) #slope INFINITY breaks down in the above test, ergo it requires a custom test~ - Inside source: true *** True Line Result - args.outputs.labels << { -** Processing line: ~ x: 200, # label position~ + if (slope(@pointA, @pointB) == INFINITY) #slope INFINITY breaks down in the above test, ergo it requires a custom test +** Processing line: ~ vectorRepel = (previousBallPosition.x > @pointA.x) ? (u.mult(1)) : (u.mult(-1))~ - Inside source: true *** True Line Result - x: 200, # label position -** Processing line: ~ y: 550,~ + vectorRepel = (previousBallPosition.x > @pointA.x) ? (u.mult(1)) : (u.mult(-1)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - y: 550, -** Processing line: ~ text: "dragonruby", # label text~ + end +** Processing line: ~ #puts (" " + $t[0].to_s + "," + $t[1].to_s + " " + $t[2].to_s + "," + $t[3].to_s + " " + " " + u.x.to_s + "," + u.y.to_s)~ - Inside source: true *** True Line Result - text: "dragonruby", # label text -** Processing line: ~ size_enum: 2,~ + #puts (" " + $t[0].to_s + "," + $t[1].to_s + " " + $t[2].to_s + "," + $t[3].to_s + " " + " " + u.x.to_s + "," + u.y.to_s) +** Processing line: ~ #vectorRepel now has the repeling force~ - Inside source: true *** True Line Result - size_enum: 2, -** Processing line: ~ alignment_enum: 1,~ + #vectorRepel now has the repeling force +** Processing line: ~~ - Inside source: true *** True Line Result - alignment_enum: 1, -** Processing line: ~ r: 155, # color saturation~ + +** Processing line: ~ mag = args.state.ball.velocity.mag~ - Inside source: true *** True Line Result - r: 155, # color saturation -** Processing line: ~ g: 50,~ + mag = args.state.ball.velocity.mag +** Processing line: ~ theta_ball=Math.atan2(args.state.ball.velocity.y,args.state.ball.velocity.x) #the angle of the ball's velocity~ - Inside source: true *** True Line Result - g: 50, -** Processing line: ~ b: 50,~ + theta_ball=Math.atan2(args.state.ball.velocity.y,args.state.ball.velocity.x) #the angle of the ball's velocity +** Processing line: ~ theta_repel=Math.atan2(vectorRepel.y,vectorRepel.x) #the angle of the repeling force~ - Inside source: true *** True Line Result - b: 50, -** Processing line: ~ a: 255, # transparency~ + theta_repel=Math.atan2(vectorRepel.y,vectorRepel.x) #the angle of the repeling force +** Processing line: ~ #puts ("theta:" + theta_ball.to_s + " " + theta_repel.to_s) #theta okay~ - Inside source: true *** True Line Result - a: 255, # transparency -** Processing line: ~ font: "fonts/manaspc.ttf" # font style; without mentioned file, label won't output correctly~ + #puts ("theta:" + theta_ball.to_s + " " + theta_repel.to_s) #theta okay +** Processing line: ~~ - Inside source: true *** True Line Result - font: "fonts/manaspc.ttf" # font style; without mentioned file, label won't output correctly -** Processing line: ~ }~ + +** Processing line: ~ fbx = mag * Math.cos(theta_ball) #the x component of the ball's velocity~ - Inside source: true *** True Line Result - } -** Processing line: ~~ + fbx = mag * Math.cos(theta_ball) #the x component of the ball's velocity +** Processing line: ~ fby = mag * Math.sin(theta_ball) #the y component of the ball's velocity~ - Inside source: true *** True Line Result - -** Processing line: ~ # Outputs solid using a hash~ + fby = mag * Math.sin(theta_ball) #the y component of the ball's velocity +** Processing line: ~~ - Inside source: true *** True Line Result - # Outputs solid using a hash -** Processing line: ~ # [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ + +** Processing line: ~ repelMag = getRepelMagnitude(fbx, fby, vectorRepel.x, vectorRepel.y, args)~ - Inside source: true *** True Line Result - # [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] -** Processing line: ~ args.outputs.solids << {~ + repelMag = getRepelMagnitude(fbx, fby, vectorRepel.x, vectorRepel.y, args) +** Processing line: ~~ - Inside source: true *** True Line Result - args.outputs.solids << { -** Processing line: ~ x: 400, # position~ + +** Processing line: ~ frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx~ - Inside source: true *** True Line Result - x: 400, # position -** Processing line: ~ y: 550,~ + frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx +** Processing line: ~ fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby~ - Inside source: true *** True Line Result - y: 550, -** Processing line: ~ w: 160, # size~ + fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby +** Processing line: ~~ - Inside source: true *** True Line Result - w: 160, # size -** Processing line: ~ h: 90,~ + +** Processing line: ~ fsumx = fbx+frx #sum of x forces~ - Inside source: true *** True Line Result - h: 90, -** Processing line: ~ r: 120, # color saturation~ + fsumx = fbx+frx #sum of x forces +** Processing line: ~ fsumy = fby+fry #sum of y forces~ - Inside source: true *** True Line Result - r: 120, # color saturation -** Processing line: ~ g: 50,~ + fsumy = fby+fry #sum of y forces +** Processing line: ~ fr = mag#fr is the resulting magnitude~ - Inside source: true *** True Line Result - g: 50, -** Processing line: ~ b: 50,~ + fr = mag#fr is the resulting magnitude +** Processing line: ~ thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle~ - Inside source: true *** True Line Result - b: 50, -** Processing line: ~ a: 255 # transparency~ + thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle +** Processing line: ~ xnew = fr*Math.cos(thetaNew) #resulting x velocity~ - Inside source: true *** True Line Result - a: 255 # transparency -** Processing line: ~ }~ + xnew = fr*Math.cos(thetaNew) #resulting x velocity +** Processing line: ~ ynew = fr*Math.sin(thetaNew) #resulting y velocity~ - Inside source: true *** True Line Result - } + ynew = fr*Math.sin(thetaNew) #resulting y velocity ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs border using a hash~ -- Inside source: true -*** True Line Result - # Outputs border using a hash -** Processing line: ~ # Same parameters as a solid~ +** Processing line: ~ args.state.ball.velocity = Vector2d.new(xnew,ynew)~ - Inside source: true *** True Line Result - # Same parameters as a solid -** Processing line: ~ args.outputs.borders << {~ + args.state.ball.velocity = Vector2d.new(xnew,ynew) +** Processing line: ~ #args.state.ball.xy.add(args.state.ball.velocity)~ - Inside source: true *** True Line Result - args.outputs.borders << { -** Processing line: ~ x: 600,~ + #args.state.ball.xy.add(args.state.ball.velocity) +** Processing line: ~ break #no need to check the other points ?~ - Inside source: true *** True Line Result - x: 600, -** Processing line: ~ y: 550,~ + break #no need to check the other points ? +** Processing line: ~ else~ - Inside source: true *** True Line Result - y: 550, -** Processing line: ~ w: 160,~ + else +** Processing line: ~ end~ - Inside source: true *** True Line Result - w: 160, -** Processing line: ~ h: 90,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - h: 90, -** Processing line: ~ r: 120,~ + end +** Processing line: ~ end #end update~ - Inside source: true *** True Line Result - r: 120, -** Processing line: ~ g: 50,~ + end #end update +** Processing line: ~~ - Inside source: true *** True Line Result - g: 50, -** Processing line: ~ b: 50,~ + +** Processing line: ~ end~ - Inside source: true *** True Line Result - b: 50, -** Processing line: ~ a: 255~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - a: 255 -** Processing line: ~ }~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - } +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ # Outputs line using a hash~ -- Inside source: true +** Processing line: ~*** Physics And Collisions - Collision With Object Removal - main.rb~ +- Header detected. *** True Line Result - # Outputs line using a hash -** Processing line: ~ args.outputs.lines << {~ + +*** True Line Result +*** Physics And Collisions - Collision With Object Removal - 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/04_physics_and_collisions/10_collision_with_object_removal/app/main.rb~ - Inside source: true *** True Line Result - args.outputs.lines << { -** Processing line: ~ x: 900, # starting position~ + # ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/main.rb +** Processing line: ~ # coding: utf-8~ - Inside source: true *** True Line Result - x: 900, # starting position -** Processing line: ~ y: 550,~ + # coding: utf-8 +** Processing line: ~ INFINITY= 10**10~ - Inside source: true *** True Line Result - y: 550, -** Processing line: ~ x2: 1200, # ending position~ + INFINITY= 10**10 +** Processing line: ~ WIDTH=1280~ - Inside source: true *** True Line Result - x2: 1200, # ending position -** Processing line: ~ y2: 550,~ + WIDTH=1280 +** Processing line: ~ HEIGHT=720~ - Inside source: true *** True Line Result - y2: 550, -** Processing line: ~ r: 120, # color saturation~ + HEIGHT=720 +** Processing line: ~~ - Inside source: true *** True Line Result - r: 120, # color saturation -** Processing line: ~ g: 50,~ + +** Processing line: ~ require 'app/vector2d.rb'~ - Inside source: true *** True Line Result - g: 50, -** Processing line: ~ b: 50,~ + require 'app/vector2d.rb' +** Processing line: ~ require 'app/paddle.rb'~ - Inside source: true *** True Line Result - b: 50, -** Processing line: ~ a: 255 # transparency~ + require 'app/paddle.rb' +** Processing line: ~ require 'app/ball.rb'~ - Inside source: true *** True Line Result - a: 255 # transparency -** Processing line: ~ }~ + require 'app/ball.rb' +** Processing line: ~ require 'app/linear_collider.rb'~ - Inside source: true *** True Line Result - } + require 'app/linear_collider.rb' ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs sprite as a primitive using a hash~ +** Processing line: ~ #Method to init default values~ - Inside source: true *** True Line Result - # Outputs sprite as a primitive using a hash -** Processing line: ~ args.outputs.primitives << {~ + #Method to init default values +** Processing line: ~ def defaults args~ - Inside source: true *** True Line Result - args.outputs.primitives << { -** Processing line: ~ x: 30, # position~ + def defaults args +** Processing line: ~ args.state.game_board ||= [(args.grid.w / 2 - args.grid.w / 4), 0, (args.grid.w / 2), args.grid.h]~ - Inside source: true *** True Line Result - x: 30, # position -** Processing line: ~ y: 200,~ + args.state.game_board ||= [(args.grid.w / 2 - args.grid.w / 4), 0, (args.grid.w / 2), args.grid.h] +** Processing line: ~ args.state.bricks ||= []~ - Inside source: true *** True Line Result - y: 200, -** Processing line: ~ w: 128, # size~ + args.state.bricks ||= [] +** Processing line: ~ args.state.num_bricks ||= 0~ - Inside source: true *** True Line Result - w: 128, # size -** Processing line: ~ h: 101,~ -- Inside source: true -*** True Line Result - h: 101, -** Processing line: ~ path: "dragonruby.png", # image path~ -- Inside source: true -*** True Line Result - path: "dragonruby.png", # image path -** Processing line: ~ angle: args.state.angle, # angle~ -- Inside source: true -*** True Line Result - angle: args.state.angle, # angle -** Processing line: ~ a: 255, # transparency~ + args.state.num_bricks ||= 0 +** Processing line: ~ args.state.game_over_at ||= 0~ - Inside source: true *** True Line Result - a: 255, # transparency -** Processing line: ~ r: 255, # color saturation~ + args.state.game_over_at ||= 0 +** Processing line: ~ args.state.paddle ||= Paddle.new~ - Inside source: true *** True Line Result - r: 255, # color saturation -** Processing line: ~ g: 255,~ + args.state.paddle ||= Paddle.new +** Processing line: ~ args.state.ball ||= Ball.new~ - Inside source: true *** True Line Result - g: 255, -** Processing line: ~ b: 255,~ + args.state.ball ||= Ball.new +** Processing line: ~ args.state.westWall ||= LinearCollider.new({x: args.grid.w/4, y: 0}, {x: args.grid.w/4, y: args.grid.h}, :pos)~ - Inside source: true *** True Line Result - b: 255, -** Processing line: ~ tile_x: 0, # sprite sub division/tile~ + args.state.westWall ||= LinearCollider.new({x: args.grid.w/4, y: 0}, {x: args.grid.w/4, y: args.grid.h}, :pos) +** Processing line: ~ args.state.eastWall ||= LinearCollider.new({x: 3*args.grid.w*0.25, y: 0}, {x: 3*args.grid.w*0.25, y: args.grid.h})~ - Inside source: true *** True Line Result - tile_x: 0, # sprite sub division/tile -** Processing line: ~ tile_y: 0,~ + args.state.eastWall ||= LinearCollider.new({x: 3*args.grid.w*0.25, y: 0}, {x: 3*args.grid.w*0.25, y: args.grid.h}) +** Processing line: ~ args.state.southWall ||= LinearCollider.new({x: 0, y: 0}, {x: args.grid.w, y: 0})~ - Inside source: true *** True Line Result - tile_y: 0, -** Processing line: ~ tile_w: -1,~ + args.state.southWall ||= LinearCollider.new({x: 0, y: 0}, {x: args.grid.w, y: 0}) +** Processing line: ~ args.state.northWall ||= LinearCollider.new({x: 0, y:args.grid.h}, {x: args.grid.w, y: args.grid.h}, :pos)~ - Inside source: true *** True Line Result - tile_w: -1, -** Processing line: ~ tile_h: -1,~ + args.state.northWall ||= LinearCollider.new({x: 0, y:args.grid.h}, {x: args.grid.w, y: args.grid.h}, :pos) +** Processing line: ~~ - Inside source: true *** True Line Result - tile_h: -1, -** Processing line: ~ flip_vertically: false, # don't flip~ + +** Processing line: ~ #args.state.testWall ||= LinearCollider.new({x:0 , y:0},{x:args.grid.w, y:args.grid.h})~ - Inside source: true *** True Line Result - flip_vertically: false, # don't flip -** Processing line: ~ flip_horizontally: false,~ + #args.state.testWall ||= LinearCollider.new({x:0 , y:0},{x:args.grid.w, y:args.grid.h}) +** Processing line: ~ end~ - Inside source: true *** True Line Result - flip_horizontally: false, -** Processing line: ~ angle_anchor_x: 0.5, # rotation center set to middle~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - angle_anchor_x: 0.5, # rotation center set to middle -** Processing line: ~ angle_anchor_y: 0.5~ + +** Processing line: ~ #Render loop~ - Inside source: true *** True Line Result - angle_anchor_y: 0.5 -** Processing line: ~ }.sprite~ + #Render loop +** Processing line: ~ def render args~ - Inside source: true *** True Line Result - }.sprite -** Processing line: ~~ + def render args +** Processing line: ~ render_instructions args~ - Inside source: true *** True Line Result - -** Processing line: ~ # Outputs label as primitive using a hash~ + render_instructions args +** Processing line: ~ render_board args~ - Inside source: true *** True Line Result - # Outputs label as primitive using a hash -** Processing line: ~ args.outputs.primitives << {~ + render_board args +** Processing line: ~ render_bricks args~ - Inside source: true *** True Line Result - args.outputs.primitives << { -** Processing line: ~ x: 200, # position~ + render_bricks args +** Processing line: ~ end~ - Inside source: true *** True Line Result - x: 200, # position -** Processing line: ~ y: 200,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - y: 200, -** Processing line: ~ text: "dragonruby", # text~ + +** Processing line: ~ begin :render_methods~ - Inside source: true *** True Line Result - text: "dragonruby", # text -** Processing line: ~ size: 2,~ + begin :render_methods +** Processing line: ~ #Method to display the instructions of the game~ - Inside source: true *** True Line Result - size: 2, -** Processing line: ~ alignment: 1,~ + #Method to display the instructions of the game +** Processing line: ~ def render_instructions args~ - Inside source: true *** True Line Result - alignment: 1, -** Processing line: ~ r: 155, # color saturation~ + def render_instructions args +** Processing line: ~ args.outputs.labels << [225, args.grid.h - 30, "← and → to move the paddle left and right", 0, 1]~ - Inside source: true *** True Line Result - r: 155, # color saturation -** Processing line: ~ g: 50,~ + args.outputs.labels << [225, args.grid.h - 30, "← and → to move the paddle left and right", 0, 1] +** Processing line: ~ end~ - Inside source: true *** True Line Result - g: 50, -** Processing line: ~ b: 50,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - b: 50, -** Processing line: ~ a: 255, # transparency~ + +** Processing line: ~ def render_board args~ - Inside source: true *** True Line Result - a: 255, # transparency -** Processing line: ~ font: "fonts/manaspc.ttf" # font style~ + def render_board args +** Processing line: ~ args.outputs.borders << args.state.game_board~ - Inside source: true *** True Line Result - font: "fonts/manaspc.ttf" # font style -** Processing line: ~ }.label~ + args.outputs.borders << args.state.game_board +** Processing line: ~ end~ - Inside source: true *** True Line Result - }.label + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs solid as primitive using a hash~ +** Processing line: ~ def render_bricks args~ - Inside source: true *** True Line Result - # Outputs solid as primitive using a hash -** Processing line: ~ args.outputs.primitives << {~ + def render_bricks args +** Processing line: ~ args.outputs.solids << args.state.bricks.map(&:rect)~ - Inside source: true *** True Line Result - args.outputs.primitives << { -** Processing line: ~ x: 400, # position~ + args.outputs.solids << args.state.bricks.map(&:rect) +** Processing line: ~ end~ - Inside source: true *** True Line Result - x: 400, # position -** Processing line: ~ y: 200,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - y: 200, -** Processing line: ~ w: 160, # size~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - w: 160, # size -** Processing line: ~ h: 90,~ + +** Processing line: ~ #Calls all methods necessary for performing calculations~ - Inside source: true *** True Line Result - h: 90, -** Processing line: ~ r: 120, # color saturation~ + #Calls all methods necessary for performing calculations +** Processing line: ~ def calc args~ - Inside source: true *** True Line Result - r: 120, # color saturation -** Processing line: ~ g: 50,~ + def calc args +** Processing line: ~ add_new_bricks args~ - Inside source: true *** True Line Result - g: 50, -** Processing line: ~ b: 50,~ + add_new_bricks args +** Processing line: ~ reset_game args~ - Inside source: true *** True Line Result - b: 50, -** Processing line: ~ a: 255 # transparency~ + reset_game args +** Processing line: ~ calc_collision args~ - Inside source: true *** True Line Result - a: 255 # transparency -** Processing line: ~ }.solid~ + calc_collision args +** Processing line: ~ win_game args~ - Inside source: true *** True Line Result - }.solid + win_game args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs border as primitive using a hash~ +** Processing line: ~ args.state.westWall.update args~ - Inside source: true *** True Line Result - # Outputs border as primitive using a hash -** Processing line: ~ # Same parameters as solid~ + args.state.westWall.update args +** Processing line: ~ args.state.eastWall.update args~ - Inside source: true *** True Line Result - # Same parameters as solid -** Processing line: ~ args.outputs.primitives << {~ + args.state.eastWall.update args +** Processing line: ~ args.state.southWall.update args~ - Inside source: true *** True Line Result - args.outputs.primitives << { -** Processing line: ~ x: 600, # position~ + args.state.southWall.update args +** Processing line: ~ args.state.northWall.update args~ - Inside source: true *** True Line Result - x: 600, # position -** Processing line: ~ y: 200,~ + args.state.northWall.update args +** Processing line: ~ args.state.paddle.update args~ - Inside source: true *** True Line Result - y: 200, -** Processing line: ~ w: 160, # size~ + args.state.paddle.update args +** Processing line: ~ args.state.ball.update args~ - Inside source: true *** True Line Result - w: 160, # size -** Processing line: ~ h: 90,~ + args.state.ball.update args +** Processing line: ~~ - Inside source: true *** True Line Result - h: 90, -** Processing line: ~ r: 120, # color saturation~ + +** Processing line: ~ #args.state.testWall.update args~ - Inside source: true *** True Line Result - r: 120, # color saturation -** Processing line: ~ g: 50,~ + #args.state.testWall.update args +** Processing line: ~~ - Inside source: true *** True Line Result - g: 50, -** Processing line: ~ b: 50,~ + +** Processing line: ~ args.state.paddle.render args~ - Inside source: true *** True Line Result - b: 50, -** Processing line: ~ a: 255 # transparency~ + args.state.paddle.render args +** Processing line: ~ args.state.ball.render args~ - Inside source: true *** True Line Result - a: 255 # transparency -** Processing line: ~ }.border~ + args.state.ball.render args +** Processing line: ~ end~ - Inside source: true *** True Line Result - }.border + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs line as primitive using a hash~ +** Processing line: ~ begin :calc_methods~ - Inside source: true *** True Line Result - # Outputs line as primitive using a hash -** Processing line: ~ args.outputs.primitives << {~ + begin :calc_methods +** Processing line: ~ def add_new_bricks args~ - Inside source: true *** True Line Result - args.outputs.primitives << { -** Processing line: ~ x: 900, # starting position~ + def add_new_bricks args +** Processing line: ~ return if args.state.num_bricks > 40~ - Inside source: true *** True Line Result - x: 900, # starting position -** Processing line: ~ y: 200,~ + return if args.state.num_bricks > 40 +** Processing line: ~~ - Inside source: true *** True Line Result - y: 200, -** Processing line: ~ x2: 1200, # ending position~ + +** Processing line: ~ #Width of the game board is 640px~ - Inside source: true *** True Line Result - x2: 1200, # ending position -** Processing line: ~ y2: 200,~ + #Width of the game board is 640px +** Processing line: ~ brick_width = (args.grid.w / 2) / 10~ - Inside source: true *** True Line Result - y2: 200, -** Processing line: ~ r: 120, # color saturation~ + brick_width = (args.grid.w / 2) / 10 +** Processing line: ~ brick_height = brick_width / 2~ - Inside source: true *** True Line Result - r: 120, # color saturation -** Processing line: ~ g: 50,~ + brick_height = brick_width / 2 +** Processing line: ~~ - Inside source: true *** True Line Result - g: 50, -** Processing line: ~ b: 50,~ + +** Processing line: ~ (4).map_with_index do |y|~ - Inside source: true *** True Line Result - b: 50, -** Processing line: ~ a: 255 # transparency~ + (4).map_with_index do |y| +** Processing line: ~ #Make a box that is 10 bricks wide and 4 bricks tall~ - Inside source: true *** True Line Result - a: 255 # transparency -** Processing line: ~ }.line~ + #Make a box that is 10 bricks wide and 4 bricks tall +** Processing line: ~ args.state.bricks += (10).map_with_index do |x|~ - Inside source: true *** True Line Result - }.line -** Processing line: ~ end~ + args.state.bricks += (10).map_with_index do |x| +** Processing line: ~ args.state.new_entity(:brick) do |b|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.new_entity(:brick) do |b| +** Processing line: ~ b.x = x * brick_width + (args.grid.w / 2 - args.grid.w / 4)~ - 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 - Pixel Arrays - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Advanced Rendering - Pixel Arrays - 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/06_pixel_arrays/app/main.rb~ + b.x = x * brick_width + (args.grid.w / 2 - args.grid.w / 4) +** Processing line: ~ b.y = args.grid.h - ((y + 1) * brick_height)~ - Inside source: true *** True Line Result - # ./samples/07_advanced_rendering/06_pixel_arrays/app/main.rb -** Processing line: ~ $gtk.reset~ + b.y = args.grid.h - ((y + 1) * brick_height) +** Processing line: ~ b.rect = [b.x + 1, b.y - 1, brick_width - 2, brick_height - 2, 235, 50 * y, 52]~ - Inside source: true *** True Line Result - $gtk.reset + b.rect = [b.x + 1, b.y - 1, brick_width - 2, brick_height - 2, 235, 50 * y, 52] ** 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.posinc ||= 1~ +** Processing line: ~ #Add linear colliders to the brick~ - Inside source: true *** True Line Result - args.state.posinc ||= 1 -** Processing line: ~ args.state.pos ||= 0~ + #Add linear colliders to the brick +** Processing line: ~ b.collider_bottom = LinearCollider.new([(b.x-2), (b.y-5)], [(b.x+brick_width+1), (b.y-5)], :pos, brick_height)~ - Inside source: true *** True Line Result - args.state.pos ||= 0 -** Processing line: ~ args.state.rotation ||= 0~ + b.collider_bottom = LinearCollider.new([(b.x-2), (b.y-5)], [(b.x+brick_width+1), (b.y-5)], :pos, brick_height) +** Processing line: ~ b.collider_right = LinearCollider.new([(b.x+brick_width+1), (b.y-5)], [(b.x+brick_width+1), (b.y+brick_height+1)], :pos)~ - Inside source: true *** True Line Result - args.state.rotation ||= 0 -** Processing line: ~~ + b.collider_right = LinearCollider.new([(b.x+brick_width+1), (b.y-5)], [(b.x+brick_width+1), (b.y+brick_height+1)], :pos) +** Processing line: ~ b.collider_left = LinearCollider.new([(b.x-2), (b.y-5)], [(b.x-2), (b.y+brick_height+1)], :neg)~ - Inside source: true *** True Line Result - -** Processing line: ~ dimension = 10 # keep it small and let the GPU scale it when rendering the sprite.~ + b.collider_left = LinearCollider.new([(b.x-2), (b.y-5)], [(b.x-2), (b.y+brick_height+1)], :neg) +** Processing line: ~ b.collider_top = LinearCollider.new([(b.x-2), (b.y+brick_height+1)], [(b.x+brick_width+1), (b.y+brick_height+1)], :neg)~ - Inside source: true *** True Line Result - dimension = 10 # keep it small and let the GPU scale it when rendering the sprite. + b.collider_top = LinearCollider.new([(b.x-2), (b.y+brick_height+1)], [(b.x+brick_width+1), (b.y+brick_height+1)], :neg) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Set up our "scanner" pixel array and fill it with black pixels.~ +** Processing line: ~ # @xyCollision = LinearCollider.new({x: @x,y: @y+@height}, {x: @x+@width, y: @y+@height})~ - Inside source: true *** True Line Result - # Set up our "scanner" pixel array and fill it with black pixels. -** Processing line: ~ args.pixel_array(:scanner).width = dimension~ + # @xyCollision = LinearCollider.new({x: @x,y: @y+@height}, {x: @x+@width, y: @y+@height}) +** Processing line: ~ # @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos)~ - Inside source: true *** True Line Result - args.pixel_array(:scanner).width = dimension -** Processing line: ~ args.pixel_array(:scanner).height = dimension~ + # @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos) +** Processing line: ~ # @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height})~ - Inside source: true *** True Line Result - args.pixel_array(:scanner).height = dimension -** Processing line: ~ args.pixel_array(:scanner).pixels.fill(0xFF000000, 0, dimension * dimension) # black, full alpha~ + # @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height}) +** Processing line: ~ # @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height}, :pos)~ - Inside source: true *** True Line Result - args.pixel_array(:scanner).pixels.fill(0xFF000000, 0, dimension * dimension) # black, full alpha + # @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height}, :pos) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Draw a green line that bounces up and down the sprite.~ -- Inside source: true -*** True Line Result - # Draw a green line that bounces up and down the sprite. -** Processing line: ~ args.pixel_array(:scanner).pixels.fill(0xFF00FF00, dimension * args.state.pos, dimension) # green, full alpha~ +** Processing line: ~ b.broken = false~ - Inside source: true *** True Line Result - args.pixel_array(:scanner).pixels.fill(0xFF00FF00, dimension * args.state.pos, dimension) # green, full alpha + b.broken = false ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Adjust position for next frame.~ -- Inside source: true -*** True Line Result - # Adjust position for next frame. -** Processing line: ~ args.state.pos += args.state.posinc~ -- Inside source: true -*** True Line Result - args.state.pos += args.state.posinc -** Processing line: ~ if args.state.posinc > 0 && args.state.pos >= dimension~ -- Inside source: true -*** True Line Result - if args.state.posinc > 0 && args.state.pos >= dimension -** Processing line: ~ args.state.posinc = -1~ -- Inside source: true -*** True Line Result - args.state.posinc = -1 -** Processing line: ~ args.state.pos = dimension - 1~ +** Processing line: ~ args.state.num_bricks += 1~ - Inside source: true *** True Line Result - args.state.pos = dimension - 1 -** Processing line: ~ elsif args.state.posinc < 0 && args.state.pos < 0~ + args.state.num_bricks += 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - elsif args.state.posinc < 0 && args.state.pos < 0 -** Processing line: ~ args.state.posinc = 1~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.posinc = 1 -** Processing line: ~ args.state.pos = 1~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.pos = 1 + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -35799,578 +39292,550 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # New/changed pixel arrays get uploaded to the GPU before we render~ +** Processing line: ~ def reset_game args~ - Inside source: true *** True Line Result - # New/changed pixel arrays get uploaded to the GPU before we render -** Processing line: ~ # anything. At that point, they can be scaled, rotated, and otherwise~ + def reset_game args +** Processing line: ~ if args.state.ball.xy.y < 20 && args.state.game_over_at.elapsed_time > 60~ - Inside source: true *** True Line Result - # anything. At that point, they can be scaled, rotated, and otherwise -** Processing line: ~ # used like any other sprite.~ + if args.state.ball.xy.y < 20 && args.state.game_over_at.elapsed_time > 60 +** Processing line: ~ #Freeze the ball~ - Inside source: true *** True Line Result - # used like any other sprite. -** Processing line: ~ w = 100~ + #Freeze the ball +** Processing line: ~ args.state.ball.velocity.x = 0~ - Inside source: true *** True Line Result - w = 100 -** Processing line: ~ h = 100~ + args.state.ball.velocity.x = 0 +** Processing line: ~ args.state.ball.velocity.y = 0~ - Inside source: true *** True Line Result - h = 100 -** Processing line: ~ x = (1280 - w) / 2~ + args.state.ball.velocity.y = 0 +** Processing line: ~ #Freeze the paddle~ - Inside source: true *** True Line Result - x = (1280 - w) / 2 -** Processing line: ~ y = (720 - h) / 2~ + #Freeze the paddle +** Processing line: ~ args.state.paddle.enabled = false~ - Inside source: true *** True Line Result - y = (720 - h) / 2 -** Processing line: ~ args.outputs.background_color = [64, 0, 128]~ + args.state.paddle.enabled = false +** Processing line: ~~ - Inside source: true *** True Line Result - args.outputs.background_color = [64, 0, 128] -** Processing line: ~ args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite~ + +** Processing line: ~ args.state.game_over_at = args.state.tick_count~ - Inside source: true *** True Line Result - args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite -** Processing line: ~ args.state.rotation += 1~ + args.state.game_over_at = args.state.tick_count +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.rotation += 1 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ +** Processing line: ~ if args.state.game_over_at.elapsed_time < 60 && args.state.tick_count > 60 && args.state.bricks.count != 0~ - Inside source: true *** True Line Result - args.outputs.primitives << args.gtk.current_framerate_primitives -** Processing line: ~ end~ + if args.state.game_over_at.elapsed_time < 60 && args.state.tick_count > 60 && args.state.bricks.count != 0 +** Processing line: ~ #Display a "Game over" message~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #Display a "Game over" message +** Processing line: ~ args.outputs.labels << [100, 100, "GAME OVER", 10]~ - Inside source: true *** True Line Result - -** Processing line: ~~ + args.outputs.labels << [100, 100, "GAME OVER", 10] +** Processing line: ~ end~ - 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 + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Tweening Lerping Easing Functions - Easing Functions - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Tweening Lerping Easing Functions - Easing Functions - 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/08_tweening_lerping_easing_functions/01_easing_functions/app/main.rb~ - Inside source: true *** True Line Result - # ./samples/08_tweening_lerping_easing_functions/01_easing_functions/app/main.rb -** Processing line: ~ def tick args~ + +** Processing line: ~ #If 60 frames have passed since the game ended, restart the game~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ # STOP! Watch the following presentation first!!!!~ + #If 60 frames have passed since the game ended, restart the game +** Processing line: ~ if args.state.game_over_at != 0 && args.state.game_over_at.elapsed_time == 60~ - Inside source: true *** True Line Result - # STOP! Watch the following presentation first!!!! -** Processing line: ~ # Math for Game Programmers: Fast and Funky 1D Nonlinear Transformations~ + if args.state.game_over_at != 0 && args.state.game_over_at.elapsed_time == 60 +** Processing line: ~ # FIXME: only put value types in state~ - Inside source: true *** True Line Result - # Math for Game Programmers: Fast and Funky 1D Nonlinear Transformations -** Processing line: ~ # https://www.youtube.com/watch?v=mr5xkf6zSzk~ + # FIXME: only put value types in state +** Processing line: ~ args.state.ball = Ball.new~ - Inside source: true *** True Line Result - # https://www.youtube.com/watch?v=mr5xkf6zSzk + args.state.ball = Ball.new ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # You've watched the talk, yes? YES???~ +** Processing line: ~ # FIXME: only put value types in state~ - Inside source: true *** True Line Result - # You've watched the talk, yes? YES??? + # FIXME: only put value types in state +** Processing line: ~ args.state.paddle = Paddle.new~ +- Inside source: true +*** True Line Result + args.state.paddle = Paddle.new ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # define starting and ending points of properties to animate~ +** Processing line: ~ args.state.bricks = []~ - Inside source: true *** True Line Result - # define starting and ending points of properties to animate -** Processing line: ~ args.state.target_x = 1180~ + args.state.bricks = [] +** Processing line: ~ args.state.num_bricks = 0~ - Inside source: true *** True Line Result - args.state.target_x = 1180 -** Processing line: ~ args.state.target_y = 620~ + args.state.num_bricks = 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.target_y = 620 -** Processing line: ~ args.state.target_w = 100~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.target_w = 100 -** Processing line: ~ args.state.target_h = 100~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.target_h = 100 -** Processing line: ~ args.state.starting_x = 0~ + +** Processing line: ~ def calc_collision args~ - Inside source: true *** True Line Result - args.state.starting_x = 0 -** Processing line: ~ args.state.starting_y = 0~ + def calc_collision args +** Processing line: ~ #Remove the brick if it is hit with the ball~ - Inside source: true *** True Line Result - args.state.starting_y = 0 -** Processing line: ~ args.state.starting_w = 300~ + #Remove the brick if it is hit with the ball +** Processing line: ~ ball = args.state.ball~ - Inside source: true *** True Line Result - args.state.starting_w = 300 -** Processing line: ~ args.state.starting_h = 300~ + ball = args.state.ball +** Processing line: ~ ball_rect = [ball.xy.x, ball.xy.y, 20, 20]~ - Inside source: true *** True Line Result - args.state.starting_h = 300 + ball_rect = [ball.xy.x, ball.xy.y, 20, 20] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # define start time and duration of animation~ -- Inside source: true -*** True Line Result - # define start time and duration of animation -** Processing line: ~ args.state.start_animate_at = 3.seconds # this is the same as writing 60 * 5 (or 300)~ +** Processing line: ~ #Loop through each brick to see if the ball is colliding with it~ - Inside source: true *** True Line Result - args.state.start_animate_at = 3.seconds # this is the same as writing 60 * 5 (or 300) -** Processing line: ~ args.state.duration = 2.seconds # this is the same as writing 60 * 2 (or 120)~ + #Loop through each brick to see if the ball is colliding with it +** Processing line: ~ args.state.bricks.each do |b|~ - Inside source: true *** True Line Result - args.state.duration = 2.seconds # this is the same as writing 60 * 2 (or 120) -** Processing line: ~~ + args.state.bricks.each do |b| +** Processing line: ~ if b.rect.intersect_rect?(ball_rect)~ - Inside source: true *** True Line Result - -** Processing line: ~ # define type of animations~ + if b.rect.intersect_rect?(ball_rect) +** Processing line: ~ #Run the linear collider for the brick if there is a collision~ - Inside source: true *** True Line Result - # define type of animations -** Processing line: ~ # Here are all the options you have for values you can put in the array:~ + #Run the linear collider for the brick if there is a collision +** Processing line: ~ b[:collider_bottom].update args~ - Inside source: true *** True Line Result - # Here are all the options you have for values you can put in the array: -** Processing line: ~ # :identity, :quad, :cube, :quart, :quint, :flip~ + b[:collider_bottom].update args +** Processing line: ~ b[:collider_right].update args~ - Inside source: true *** True Line Result - # :identity, :quad, :cube, :quart, :quint, :flip -** Processing line: ~~ + b[:collider_right].update args +** Processing line: ~ b[:collider_left].update args~ - Inside source: true *** True Line Result - -** Processing line: ~ # Linear is defined as:~ + b[:collider_left].update args +** Processing line: ~ b[:collider_top].update args~ - Inside source: true *** True Line Result - # Linear is defined as: -** Processing line: ~ # [:identity]~ + b[:collider_top].update args +** Processing line: ~~ - Inside source: true *** True Line Result - # [:identity] -** Processing line: ~ #~ + +** Processing line: ~ b.broken = true~ - Inside source: true *** True Line Result - # -** Processing line: ~ # Smooth start variations are:~ + b.broken = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Smooth start variations are: -** Processing line: ~ # [:quad]~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # [:quad] -** Processing line: ~ # [:cube]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # [:cube] -** Processing line: ~ # [:quart]~ + +** Processing line: ~ args.state.bricks = args.state.bricks.reject(&:broken)~ - Inside source: true *** True Line Result - # [:quart] -** Processing line: ~ # [:quint]~ + args.state.bricks = args.state.bricks.reject(&:broken) +** Processing line: ~ end~ - Inside source: true *** True Line Result - # [:quint] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Linear reversed, and smooth stop are the same as the animations defined above, but reversed:~ -- Inside source: true -*** True Line Result - # Linear reversed, and smooth stop are the same as the animations defined above, but reversed: -** Processing line: ~ # [:flip, :identity]~ +** Processing line: ~ def win_game args~ - Inside source: true *** True Line Result - # [:flip, :identity] -** Processing line: ~ # [:flip, :quad, :flip]~ + def win_game args +** Processing line: ~ if args.state.bricks.count == 0 && args.state.game_over_at.elapsed_time > 60~ - Inside source: true *** True Line Result - # [:flip, :quad, :flip] -** Processing line: ~ # [:flip, :cube, :flip]~ + if args.state.bricks.count == 0 && args.state.game_over_at.elapsed_time > 60 +** Processing line: ~ #Freeze the ball~ - Inside source: true *** True Line Result - # [:flip, :cube, :flip] -** Processing line: ~ # [:flip, :quart, :flip]~ + #Freeze the ball +** Processing line: ~ args.state.ball.velocity.x = 0~ - Inside source: true *** True Line Result - # [:flip, :quart, :flip] -** Processing line: ~ # [:flip, :quint, :flip]~ + args.state.ball.velocity.x = 0 +** Processing line: ~ args.state.ball.velocity.y = 0~ - Inside source: true *** True Line Result - # [:flip, :quint, :flip] -** Processing line: ~~ + args.state.ball.velocity.y = 0 +** Processing line: ~ #Freeze the paddle~ - Inside source: true *** True Line Result - -** Processing line: ~ # You can also do custom definitions. See the bottom of the file details~ + #Freeze the paddle +** Processing line: ~ args.state.paddle.enabled = false~ - Inside source: true *** True Line Result - # You can also do custom definitions. See the bottom of the file details -** Processing line: ~ # on how to do that. I've defined a couple for you:~ + args.state.paddle.enabled = false +** Processing line: ~~ - Inside source: true *** True Line Result - # on how to do that. I've defined a couple for you: -** Processing line: ~ # [:smoothest_start]~ + +** Processing line: ~ args.state.game_over_at = args.state.tick_count~ - Inside source: true *** True Line Result - # [:smoothest_start] -** Processing line: ~ # [:smoothest_stop]~ + args.state.game_over_at = args.state.tick_count +** Processing line: ~ end~ - Inside source: true *** True Line Result - # [:smoothest_stop] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # CHANGE THIS LINE TO ONE OF THE LINES ABOVE TO SEE VARIATIONS~ -- Inside source: true -*** True Line Result - # CHANGE THIS LINE TO ONE OF THE LINES ABOVE TO SEE VARIATIONS -** Processing line: ~ args.state.animation_type = [:identity]~ +** Processing line: ~ if args.state.game_over_at.elapsed_time < 60 && args.state.tick_count > 60 && args.state.bricks.count == 0~ - Inside source: true *** True Line Result - args.state.animation_type = [:identity] -** Processing line: ~ # args.state.animation_type = [:quad]~ + if args.state.game_over_at.elapsed_time < 60 && args.state.tick_count > 60 && args.state.bricks.count == 0 +** Processing line: ~ #Display a "Game over" message~ - Inside source: true *** True Line Result - # args.state.animation_type = [:quad] -** Processing line: ~ # args.state.animation_type = [:cube]~ + #Display a "Game over" message +** Processing line: ~ args.outputs.labels << [100, 100, "CONGRATULATIONS!", 10]~ - Inside source: true *** True Line Result - # args.state.animation_type = [:cube] -** Processing line: ~ # args.state.animation_type = [:quart]~ + args.outputs.labels << [100, 100, "CONGRATULATIONS!", 10] +** Processing line: ~ end~ - Inside source: true *** True Line Result - # args.state.animation_type = [:quart] -** Processing line: ~ # args.state.animation_type = [:quint]~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # args.state.animation_type = [:quint] -** Processing line: ~ # args.state.animation_type = [:flip, :identity]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # args.state.animation_type = [:flip, :identity] -** Processing line: ~ # args.state.animation_type = [:flip, :quad, :flip]~ + +** Processing line: ~ end~ - Inside source: true *** True Line Result - # args.state.animation_type = [:flip, :quad, :flip] -** Processing line: ~ # args.state.animation_type = [:flip, :cube, :flip]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # args.state.animation_type = [:flip, :cube, :flip] -** Processing line: ~ # args.state.animation_type = [:flip, :quart, :flip]~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # args.state.animation_type = [:flip, :quart, :flip] -** Processing line: ~ # args.state.animation_type = [:flip, :quint, :flip]~ + def tick args +** Processing line: ~ defaults args~ - Inside source: true *** True Line Result - # args.state.animation_type = [:flip, :quint, :flip] -** Processing line: ~ # args.state.animation_type = [:smoothest_start]~ + defaults args +** Processing line: ~ render args~ - Inside source: true *** True Line Result - # args.state.animation_type = [:smoothest_start] -** Processing line: ~ # args.state.animation_type = [:smoothest_stop]~ + render args +** Processing line: ~ calc args~ - Inside source: true *** True Line Result - # args.state.animation_type = [:smoothest_stop] + calc args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # THIS IS WHERE THE MAGIC HAPPENS!~ +** Processing line: ~ #args.outputs.lines << [0, 0, args.grid.w, args.grid.h]~ - Inside source: true *** True Line Result - # THIS IS WHERE THE MAGIC HAPPENS! -** Processing line: ~ # Numeric#ease~ + #args.outputs.lines << [0, 0, args.grid.w, args.grid.h] +** Processing line: ~~ - Inside source: true *** True Line Result - # Numeric#ease -** Processing line: ~ progress = args.state.start_animate_at.ease(args.state.duration, args.state.animation_type)~ + +** Processing line: ~ #$tc+=1~ - Inside source: true *** True Line Result - progress = args.state.start_animate_at.ease(args.state.duration, args.state.animation_type) -** Processing line: ~~ + #$tc+=1 +** Processing line: ~ #if $tc == 5~ - Inside source: true *** True Line Result - -** Processing line: ~ # Numeric#ease needs to called:~ + #if $tc == 5 +** Processing line: ~ #$train << [args.state.ball.xy.x, args.state.ball.xy.y]~ - Inside source: true *** True Line Result - # Numeric#ease needs to called: -** Processing line: ~ # 1. On the number that represents the point in time you want to start, and takes two parameters:~ + #$train << [args.state.ball.xy.x, args.state.ball.xy.y] +** Processing line: ~ #$tc = 0~ - Inside source: true *** True Line Result - # 1. On the number that represents the point in time you want to start, and takes two parameters: -** Processing line: ~ # a. The first parameter is how long the animation should take.~ + #$tc = 0 +** Processing line: ~ #end~ - Inside source: true *** True Line Result - # a. The first parameter is how long the animation should take. -** Processing line: ~ # b. The second parameter represents the functions that need to be called.~ + #end +** Processing line: ~ #for t in $train~ - Inside source: true *** True Line Result - # b. The second parameter represents the functions that need to be called. -** Processing line: ~ #~ + #for t in $train +** Processing line: ~~ - Inside source: true *** True Line Result - # -** Processing line: ~ # For example, if I wanted an animate to start 3 seconds in, and last for 10 seconds,~ + +** Processing line: ~ #args.outputs.solids << [t[0],t[1],5,5,255,0,0];~ - Inside source: true *** True Line Result - # For example, if I wanted an animate to start 3 seconds in, and last for 10 seconds, -** Processing line: ~ # and I want to animation to start fast and end slow, I would do:~ + #args.outputs.solids << [t[0],t[1],5,5,255,0,0]; +** Processing line: ~ #end~ - Inside source: true *** True Line Result - # and I want to animation to start fast and end slow, I would do: -** Processing line: ~ # (60 * 3).ease(60 * 10, :flip, :quint, :flip)~ + #end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # (60 * 3).ease(60 * 10, :flip, :quint, :flip) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # initial value delta to the final value~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - # initial value delta to the final value -** Processing line: ~ calc_x = args.state.starting_x + (args.state.target_x - args.state.starting_x) * progress~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - calc_x = args.state.starting_x + (args.state.target_x - args.state.starting_x) * progress -** Processing line: ~ calc_y = args.state.starting_y + (args.state.target_y - args.state.starting_y) * progress~ -- Inside source: true + +** Processing line: ~*** Physics And Collisions - Collision With Object Removal - paddle.rb~ +- Header detected. *** True Line Result - calc_y = args.state.starting_y + (args.state.target_y - args.state.starting_y) * progress -** Processing line: ~ calc_w = args.state.starting_w + (args.state.target_w - args.state.starting_w) * progress~ -- Inside source: true + *** True Line Result - calc_w = args.state.starting_w + (args.state.target_w - args.state.starting_w) * progress -** Processing line: ~ calc_h = args.state.starting_h + (args.state.target_h - args.state.starting_h) * progress~ +*** Physics And Collisions - Collision With Object Removal - paddle.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/04_physics_and_collisions/10_collision_with_object_removal/app/paddle.rb~ - Inside source: true *** True Line Result - calc_h = args.state.starting_h + (args.state.target_h - args.state.starting_h) * progress -** Processing line: ~~ + # ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/paddle.rb +** Processing line: ~ class Paddle~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.solids << [calc_x, calc_y, calc_w, calc_h, 0, 0, 0]~ + class Paddle +** Processing line: ~ attr_accessor :enabled~ - Inside source: true *** True Line Result - args.outputs.solids << [calc_x, calc_y, calc_w, calc_h, 0, 0, 0] + attr_accessor :enabled ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # count down~ -- Inside source: true -*** True Line Result - # count down -** Processing line: ~ count_down = args.state.start_animate_at - args.state.tick_count~ +** Processing line: ~ def initialize ()~ - Inside source: true *** True Line Result - count_down = args.state.start_animate_at - args.state.tick_count -** Processing line: ~ if count_down > 0~ + def initialize () +** Processing line: ~ @x=WIDTH/2~ - Inside source: true *** True Line Result - if count_down > 0 -** Processing line: ~ args.outputs.labels << [640, 375, "Running: #{args.state.animation_type} in...", 3, 1]~ + @x=WIDTH/2 +** Processing line: ~ @y=100~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 375, "Running: #{args.state.animation_type} in...", 3, 1] -** Processing line: ~ args.outputs.labels << [640, 345, "%.2f" % count_down.fdiv(60), 3, 1]~ + @y=100 +** Processing line: ~ @width=100~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 345, "%.2f" % count_down.fdiv(60), 3, 1] -** Processing line: ~ elsif progress >= 1~ + @width=100 +** Processing line: ~ @height=20~ - Inside source: true *** True Line Result - elsif progress >= 1 -** Processing line: ~ args.outputs.labels << [640, 360, "Click screen to reset.", 3, 1]~ + @height=20 +** Processing line: ~ @speed=10~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 360, "Click screen to reset.", 3, 1] -** Processing line: ~ if args.inputs.click~ + @speed=10 +** Processing line: ~~ - Inside source: true *** True Line Result - if args.inputs.click -** Processing line: ~ $gtk.reset~ + +** Processing line: ~ @xyCollision = LinearCollider.new({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5})~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~ end~ + @xyCollision = LinearCollider.new({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5}) +** Processing line: ~ @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos)~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos) +** Processing line: ~ @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height+5})~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height+5}) +** Processing line: ~ @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}, :pos)~ - Inside source: true *** True Line Result - end + @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}, :pos) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # $gtk.reset~ +** Processing line: ~ @enabled = true~ - Inside source: true *** True Line Result - # $gtk.reset -** Processing line: ~~ + @enabled = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # you can make own variations of animations using this~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # you can make own variations of animations using this -** Processing line: ~ module Easing~ + +** Processing line: ~ def update args~ - Inside source: true *** True Line Result - module Easing -** Processing line: ~ # you have access to all the built in functions: identity, flip, quad, cube, quart, quint~ + def update args +** Processing line: ~ @xyCollision.resetPoints({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5})~ - Inside source: true *** True Line Result - # you have access to all the built in functions: identity, flip, quad, cube, quart, quint -** Processing line: ~ def self.smoothest_start x~ + @xyCollision.resetPoints({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5}) +** Processing line: ~ @xyCollision2.resetPoints({x: @x,y: @y}, {x: @x+@width, y: @y})~ - Inside source: true *** True Line Result - def self.smoothest_start x -** Processing line: ~ quad(quint(x))~ + @xyCollision2.resetPoints({x: @x,y: @y}, {x: @x+@width, y: @y}) +** Processing line: ~ @xyCollision3.resetPoints({x: @x,y: @y}, {x: @x, y: @y+@height+5})~ - Inside source: true *** True Line Result - quad(quint(x)) -** Processing line: ~ end~ + @xyCollision3.resetPoints({x: @x,y: @y}, {x: @x, y: @y+@height+5}) +** Processing line: ~ @xyCollision4.resetPoints({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5})~ - Inside source: true *** True Line Result - end + @xyCollision4.resetPoints({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.smoothest_stop x~ -- Inside source: true -*** True Line Result - def self.smoothest_stop x -** Processing line: ~ flip(quad(quint(flip(x))))~ +** Processing line: ~ @xyCollision.update args~ - Inside source: true *** True Line Result - flip(quad(quint(flip(x)))) -** Processing line: ~ end~ + @xyCollision.update args +** Processing line: ~ @xyCollision2.update args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + @xyCollision2.update args +** Processing line: ~ @xyCollision3.update args~ - Inside source: true *** True Line Result - -** Processing line: ~ # this is the source for the existing easing functions~ + @xyCollision3.update args +** Processing line: ~ @xyCollision4.update args~ - Inside source: true *** True Line Result - # this is the source for the existing easing functions -** Processing line: ~ def self.identity x~ + @xyCollision4.update args +** Processing line: ~~ - Inside source: true *** True Line Result - def self.identity x -** Processing line: ~ x~ + +** Processing line: ~ args.inputs.keyboard.key_held.left ||= false~ - Inside source: true *** True Line Result - x -** Processing line: ~ end~ + args.inputs.keyboard.key_held.left ||= false +** Processing line: ~ args.inputs.keyboard.key_held.right ||= false~ - Inside source: true *** True Line Result - end + args.inputs.keyboard.key_held.right ||= false ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.flip x~ +** Processing line: ~ if not (args.inputs.keyboard.key_held.left == args.inputs.keyboard.key_held.right)~ - Inside source: true *** True Line Result - def self.flip x -** Processing line: ~ 1 - x~ + if not (args.inputs.keyboard.key_held.left == args.inputs.keyboard.key_held.right) +** Processing line: ~ if args.inputs.keyboard.key_held.left && @enabled~ - Inside source: true *** True Line Result - 1 - x -** Processing line: ~ end~ + if args.inputs.keyboard.key_held.left && @enabled +** Processing line: ~ @x-=@speed~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + @x-=@speed +** Processing line: ~ elsif args.inputs.keyboard.key_held.right && @enabled~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.quad x~ + elsif args.inputs.keyboard.key_held.right && @enabled +** Processing line: ~ @x+=@speed~ - Inside source: true *** True Line Result - def self.quad x -** Processing line: ~ x * x~ + @x+=@speed +** Processing line: ~ end~ - Inside source: true *** True Line Result - x * x -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.cube x~ +** Processing line: ~ xmin =WIDTH/4~ - Inside source: true *** True Line Result - def self.cube x -** Processing line: ~ x * x * x~ + xmin =WIDTH/4 +** Processing line: ~ xmax = 3*(WIDTH/4)~ - Inside source: true *** True Line Result - x * x * x + xmax = 3*(WIDTH/4) +** Processing line: ~ @x = (@x+@width > xmax) ? xmax-@width : (@x xmax) ? xmax-@width : (@x 0~ -- Inside source: true -*** True Line Result - (entity[:created_at] + entity[:duration]).elapsed_time > 0 -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ +** Processing line: ~ # Uses a label to output whether x or o won, or if a draw occurred.~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_stars args~ + # Uses a label to output whether x or o won, or if a draw occurred. +** Processing line: ~ # If the game is ongoing, a label shows whose turn it currently is.~ - Inside source: true *** True Line Result - def calc_stars args -** Processing line: ~ if (stars_to_add = args.state.max_stars - args.state.stars.length) > 0~ + # If the game is ongoing, a label shows whose turn it currently is. +** Processing line: ~ outputs.labels << if state.x_won~ - Inside source: true *** True Line Result - if (stars_to_add = args.state.max_stars - args.state.stars.length) > 0 -** Processing line: ~ stars_to_add.times { args.state.stars << new_star(args) }~ + outputs.labels << if state.x_won +** Processing line: ~ label grid.w_half, grid.top - 80, "x won" # the '-80' positions the label 80 pixels lower than top~ - Inside source: true *** True Line Result - stars_to_add.times { args.state.stars << new_star(args) } -** Processing line: ~ end~ + label grid.w_half, grid.top - 80, "x won" # the '-80' positions the label 80 pixels lower than top +** Processing line: ~ elsif state.o_won~ - Inside source: true *** True Line Result - end -** Processing line: ~ args.state.stars = args.state.stars.reject { |s| completed? s }~ + elsif state.o_won +** Processing line: ~ label grid.w_half, grid.top - 80, "o won" # grid.w_half positions the label in the center horizontally~ - Inside source: true *** True Line Result - args.state.stars = args.state.stars.reject { |s| completed? s } -** Processing line: ~ end~ + label grid.w_half, grid.top - 80, "o won" # grid.w_half positions the label in the center horizontally +** Processing line: ~ elsif state.draw~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif state.draw +** Processing line: ~ label grid.w_half, grid.top - 80, "a draw"~ - Inside source: true *** True Line Result - -** Processing line: ~ def move_enemies args~ + label grid.w_half, grid.top - 80, "a draw" +** Processing line: ~ else # if no one won and the game is ongoing~ - Inside source: true *** True Line Result - def move_enemies args -** Processing line: ~ if (enemies_to_add = args.state.max_enemies - args.state.enemies.length) > 0~ + else # if no one won and the game is ongoing +** Processing line: ~ label grid.w_half, grid.top - 80, "turn: #{state.current_turn}"~ - Inside source: true *** True Line Result - if (enemies_to_add = args.state.max_enemies - args.state.enemies.length) > 0 -** Processing line: ~ enemies_to_add.times { args.state.enemies << new_enemy(args) }~ + label grid.w_half, grid.top - 80, "turn: #{state.current_turn}" +** Processing line: ~ end~ - Inside source: true *** True Line Result - enemies_to_add.times { args.state.enemies << new_enemy(args) } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -37275,38 +40676,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ args.state.enemies = args.state.enemies.reject { |s| completed? s }~ -- Inside source: true -*** True Line Result - args.state.enemies = args.state.enemies.reject { |s| completed? s } -** Processing line: ~ end~ +** Processing line: ~ # Calls the methods responsible for handling user input and determining the winner.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Calls the methods responsible for handling user input and determining the winner. +** Processing line: ~ # Does nothing unless the mouse is clicked.~ - Inside source: true *** True Line Result - -** Processing line: ~ def move_bullets args~ + # Does nothing unless the mouse is clicked. +** Processing line: ~ def input_board~ - Inside source: true *** True Line Result - def move_bullets args -** Processing line: ~ args.state.enemies.each do |e|~ + def input_board +** Processing line: ~ return unless inputs.mouse.click~ - Inside source: true *** True Line Result - args.state.enemies.each do |e| -** Processing line: ~ if args.state.tick_count.mod_zero?(e[:fire_rate])~ + return unless inputs.mouse.click +** Processing line: ~ input_place_piece~ - Inside source: true *** True Line Result - if args.state.tick_count.mod_zero?(e[:fire_rate]) -** Processing line: ~ args.state.bullets << new_bullet(args, e[:x] + e[:w].half, current_y(e), e[:distance_to_travel] / e[:duration])~ + input_place_piece +** Processing line: ~ input_restart_game~ - Inside source: true *** True Line Result - args.state.bullets << new_bullet(args, e[:x] + e[:w].half, current_y(e), e[:distance_to_travel] / e[:duration]) -** Processing line: ~ end~ + input_restart_game +** Processing line: ~ determine_winner~ - Inside source: true *** True Line Result - end + determine_winner ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -37315,90 +40712,74 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ args.state.bullets = args.state.bullets.reject { |s| completed? s }~ +** Processing line: ~ # Handles user input for placing pieces on the board.~ - Inside source: true *** True Line Result - args.state.bullets = args.state.bullets.reject { |s| completed? s } -** Processing line: ~ args.state.player_bullets = args.state.player_bullets.reject { |s| completed? s }~ + # Handles user input for placing pieces on the board. +** Processing line: ~ def input_place_piece~ - Inside source: true *** True Line Result - args.state.player_bullets = args.state.player_bullets.reject { |s| completed? s } -** Processing line: ~ end~ + def input_place_piece +** Processing line: ~ return if state.game_over~ - Inside source: true *** True Line Result - end + return if state.game_over ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def intersect? entity_one, entity_two~ -- Inside source: true -*** True Line Result - def intersect? entity_one, entity_two -** Processing line: ~ entity_one.merge(y: current_y(entity_one))~ -- Inside source: true -*** True Line Result - entity_one.merge(y: current_y(entity_one)) -** Processing line: ~ .intersect_rect? entity_two.merge(y: current_y(entity_two))~ -- Inside source: true -*** True Line Result - .intersect_rect? entity_two.merge(y: current_y(entity_two)) -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ +** Processing line: ~ # Checks to find the space that the mouse was clicked inside of, and makes sure the space does not already~ - Inside source: true *** True Line Result - -** Processing line: ~ def kill args~ + # Checks to find the space that the mouse was clicked inside of, and makes sure the space does not already +** Processing line: ~ # have a piece in it.~ - Inside source: true *** True Line Result - def kill args -** Processing line: ~ bullets_hitting_enemies = []~ + # have a piece in it. +** Processing line: ~ __, __, space = all_spaces.find do |__, __, space|~ - Inside source: true *** True Line Result - bullets_hitting_enemies = [] -** Processing line: ~ dead_bullets = []~ + __, __, space = all_spaces.find do |__, __, space| +** Processing line: ~ inputs.mouse.click.point.inside_rect?(space.border) && !space.piece~ - Inside source: true *** True Line Result - dead_bullets = [] -** Processing line: ~ dead_enemies = []~ + inputs.mouse.click.point.inside_rect?(space.border) && !space.piece +** Processing line: ~ end~ - Inside source: true *** True Line Result - dead_enemies = [] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.state.player_bullets.each do |b|~ +** Processing line: ~ # The piece that goes into the space belongs to the player whose turn it currently is.~ - Inside source: true *** True Line Result - args.state.player_bullets.each do |b| -** Processing line: ~ args.state.enemies.each do |e|~ + # The piece that goes into the space belongs to the player whose turn it currently is. +** Processing line: ~ return unless space~ - Inside source: true *** True Line Result - args.state.enemies.each do |e| -** Processing line: ~ if intersect? b, e~ + return unless space +** Processing line: ~ space.piece = state.current_turn~ - Inside source: true *** True Line Result - if intersect? b, e -** Processing line: ~ dead_bullets << b~ + space.piece = state.current_turn +** Processing line: ~~ - Inside source: true *** True Line Result - dead_bullets << b -** Processing line: ~ dead_enemies << e~ + +** Processing line: ~ # This ternary operator statement allows us to change the current player's turn.~ - Inside source: true *** True Line Result - dead_enemies << e -** Processing line: ~ end~ + # This ternary operator statement allows us to change the current player's turn. +** Processing line: ~ # If it is currently x's turn, it becomes o's turn. If it is not x's turn, it become's x's turn.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # If it is currently x's turn, it becomes o's turn. If it is not x's turn, it become's x's turn. +** Processing line: ~ state.current_turn = state.current_turn == :x ? :o : :x~ - Inside source: true *** True Line Result - end + state.current_turn = state.current_turn == :x ? :o : :x ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -37407,422 +40788,354 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ args.state.score += dead_enemies.length~ +** Processing line: ~ # Resets the game.~ - Inside source: true *** True Line Result - args.state.score += dead_enemies.length -** Processing line: ~~ + # Resets the game. +** Processing line: ~ def input_restart_game~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.player_bullets.reject! { |b| dead_bullets.include? b }~ + def input_restart_game +** Processing line: ~ return unless state.game_over~ - Inside source: true *** True Line Result - args.state.player_bullets.reject! { |b| dead_bullets.include? b } -** Processing line: ~ args.state.enemies.reject! { |e| dead_enemies.include? e }~ + return unless state.game_over +** Processing line: ~ gtk.reset~ - Inside source: true *** True Line Result - args.state.enemies.reject! { |e| dead_enemies.include? e } -** Processing line: ~~ + gtk.reset +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ dead = args.state.bullets.any? do |b|~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - dead = args.state.bullets.any? do |b| -** Processing line: ~ [args.state.player.x,~ + +** Processing line: ~ # Checks if x or o won the game.~ - Inside source: true *** True Line Result - [args.state.player.x, -** Processing line: ~ args.state.player.y,~ + # Checks if x or o won the game. +** Processing line: ~ # If neither player wins and all nine squares are filled, a draw happens.~ - Inside source: true *** True Line Result - args.state.player.y, -** Processing line: ~ args.state.player.w,~ + # If neither player wins and all nine squares are filled, a draw happens. +** Processing line: ~ # Once a player is chosen as the winner or a draw happens, the game is over.~ - Inside source: true *** True Line Result - args.state.player.w, -** Processing line: ~ args.state.player.h].intersect_rect? b.merge(y: current_y(b))~ + # Once a player is chosen as the winner or a draw happens, the game is over. +** Processing line: ~ def determine_winner~ - Inside source: true *** True Line Result - args.state.player.h].intersect_rect? b.merge(y: current_y(b)) -** Processing line: ~ end~ + def determine_winner +** Processing line: ~ state.x_won = won? :x # evaluates to either true or false (boolean values)~ - Inside source: true *** True Line Result - end -** Processing line: ~ return unless dead~ + state.x_won = won? :x # evaluates to either true or false (boolean values) +** Processing line: ~ state.o_won = won? :o~ - Inside source: true *** True Line Result - return unless dead -** Processing line: ~ args.gtk.reset~ + state.o_won = won? :o +** Processing line: ~ state.draw = true if filled_spaces.length == 9 && !state.x_won && !state.o_won~ - Inside source: true *** True Line Result - args.gtk.reset -** Processing line: ~ defaults args~ + state.draw = true if filled_spaces.length == 9 && !state.x_won && !state.o_won +** Processing line: ~ state.game_over = state.x_won || state.o_won || state.draw~ - Inside source: true *** True Line Result - defaults args -** Processing line: ~ end~ + state.game_over = state.x_won || state.o_won || state.draw +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc args~ -- Inside source: true -*** True Line Result - def calc args -** Processing line: ~ calc_stars args~ -- Inside source: true -*** True Line Result - calc_stars args -** Processing line: ~ move_enemies args~ -- Inside source: true -*** True Line Result - move_enemies args -** Processing line: ~ move_bullets args~ -- Inside source: true -*** True Line Result - move_bullets args -** Processing line: ~ kill args~ -- Inside source: true -*** True Line Result - kill args -** Processing line: ~ end~ +** Processing line: ~ # Determines if a player won by checking if there is a horizontal match or vertical match.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Determines if a player won by checking if there is a horizontal match or vertical match. +** Processing line: ~ # Horizontal_match and vertical_match have boolean values. If either is true, the game has been won.~ - Inside source: true *** True Line Result - -** Processing line: ~ def current_y entity~ + # Horizontal_match and vertical_match have boolean values. If either is true, the game has been won. +** Processing line: ~ def won? piece~ - Inside source: true *** True Line Result - def current_y entity -** Processing line: ~ entity[:starting_y] + (entity[:distance_to_travel] * entity[:created_at].ease(entity[:duration], :identity))~ + def won? piece +** Processing line: ~ # performs action on all space combinations~ - Inside source: true *** True Line Result - entity[:starting_y] + (entity[:distance_to_travel] * entity[:created_at].ease(entity[:duration], :identity)) -** Processing line: ~ end~ + # performs action on all space combinations +** Processing line: ~ won = [[-1, 0, 1]].product([-1, 0, 1]).map do |xs, y|~ - Inside source: true *** True Line Result - end + won = [[-1, 0, 1]].product([-1, 0, 1]).map do |xs, y| ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render args~ +** Processing line: ~ # Checks if the 3 grid spaces with the same y value (or same row) and~ - Inside source: true *** True Line Result - def render args -** Processing line: ~ args.outputs.solids << args.state.stars.map do |s|~ + # Checks if the 3 grid spaces with the same y value (or same row) and +** Processing line: ~ # x values that are next to each other have pieces that belong to the same player.~ - Inside source: true *** True Line Result - args.outputs.solids << args.state.stars.map do |s| -** Processing line: ~ [s[:x],~ + # x values that are next to each other have pieces that belong to the same player. +** Processing line: ~ # Remember, the value of piece is equal to the current turn (which is the player).~ - Inside source: true *** True Line Result - [s[:x], -** Processing line: ~ current_y(s),~ + # Remember, the value of piece is equal to the current turn (which is the player). +** Processing line: ~ horizontal_match = state.spaces[xs[0]][y].piece == piece &&~ - Inside source: true *** True Line Result - current_y(s), -** Processing line: ~ s[:w], s[:h], 0, s[:g], s[:b], s[:max_alpha] * s[:created_at].ease(20, :identity)]~ + horizontal_match = state.spaces[xs[0]][y].piece == piece && +** Processing line: ~ state.spaces[xs[1]][y].piece == piece &&~ - Inside source: true *** True Line Result - s[:w], s[:h], 0, s[:g], s[:b], s[:max_alpha] * s[:created_at].ease(20, :identity)] -** Processing line: ~ end~ + state.spaces[xs[1]][y].piece == piece && +** Processing line: ~ state.spaces[xs[2]][y].piece == piece~ - Inside source: true *** True Line Result - end + state.spaces[xs[2]][y].piece == piece ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.borders << args.state.enemies.map do |s|~ -- Inside source: true -*** True Line Result - args.outputs.borders << args.state.enemies.map do |s| -** Processing line: ~ [s[:x],~ +** Processing line: ~ # Checks if the 3 grid spaces with the same x value (or same column) and~ - Inside source: true *** True Line Result - [s[:x], -** Processing line: ~ current_y(s),~ + # Checks if the 3 grid spaces with the same x value (or same column) and +** Processing line: ~ # y values that are next to each other have pieces that belong to the same player.~ - Inside source: true *** True Line Result - current_y(s), -** Processing line: ~ s[:w], s[:h], 255, 0, 0]~ + # y values that are next to each other have pieces that belong to the same player. +** Processing line: ~ # The && represents an "and" statement: if even one part of the statement is false,~ - Inside source: true *** True Line Result - s[:w], s[:h], 255, 0, 0] -** Processing line: ~ end~ + # The && represents an "and" statement: if even one part of the statement is false, +** Processing line: ~ # the entire statement evaluates to false.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # the entire statement evaluates to false. +** Processing line: ~ vertical_match = state.spaces[y][xs[0]].piece == piece &&~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.borders << args.state.bullets.map do |b|~ + vertical_match = state.spaces[y][xs[0]].piece == piece && +** Processing line: ~ state.spaces[y][xs[1]].piece == piece &&~ - Inside source: true *** True Line Result - args.outputs.borders << args.state.bullets.map do |b| -** Processing line: ~ [b[:x],~ + state.spaces[y][xs[1]].piece == piece && +** Processing line: ~ state.spaces[y][xs[2]].piece == piece~ - Inside source: true *** True Line Result - [b[:x], -** Processing line: ~ current_y(b),~ + state.spaces[y][xs[2]].piece == piece +** Processing line: ~~ - Inside source: true *** True Line Result - current_y(b), -** Processing line: ~ b[:w], b[:h], 255, 0, 0]~ + +** Processing line: ~ horizontal_match || vertical_match # if either is true, true is returned~ - Inside source: true *** True Line Result - b[:w], b[:h], 255, 0, 0] -** Processing line: ~ end~ + horizontal_match || vertical_match # if either is true, true is returned +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.borders << args.state.player_bullets.map do |b|~ +** Processing line: ~ # Sees if there is a diagonal match, starting from the bottom left and ending at the top right.~ - Inside source: true *** True Line Result - args.outputs.borders << args.state.player_bullets.map do |b| -** Processing line: ~ [b[:x],~ + # Sees if there is a diagonal match, starting from the bottom left and ending at the top right. +** Processing line: ~ # Is added to won regardless of whether the statement is true or false.~ - Inside source: true *** True Line Result - [b[:x], -** Processing line: ~ current_y(b),~ + # Is added to won regardless of whether the statement is true or false. +** Processing line: ~ won << (state.spaces[-1][-1].piece == piece && # bottom left~ - Inside source: true *** True Line Result - current_y(b), -** Processing line: ~ b[:w], b[:h], 255, 255, 255]~ + won << (state.spaces[-1][-1].piece == piece && # bottom left +** Processing line: ~ state.spaces[ 0][ 0].piece == piece && # center~ - Inside source: true *** True Line Result - b[:w], b[:h], 255, 255, 255] -** Processing line: ~ end~ + state.spaces[ 0][ 0].piece == piece && # center +** Processing line: ~ state.spaces[ 1][ 1].piece == piece) # top right~ - Inside source: true *** True Line Result - end + state.spaces[ 1][ 1].piece == piece) # top right ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.borders << [args.state.player.x,~ +** Processing line: ~ # Sees if there is a diagonal match, starting at the bottom right and ending at the top left~ - Inside source: true *** True Line Result - args.borders << [args.state.player.x, -** Processing line: ~ args.state.player.y,~ + # Sees if there is a diagonal match, starting at the bottom right and ending at the top left +** Processing line: ~ # and is added to won.~ - Inside source: true *** True Line Result - args.state.player.y, -** Processing line: ~ args.state.player.w,~ + # and is added to won. +** Processing line: ~ won << (state.spaces[ 1][-1].piece == piece && # bottom right~ - Inside source: true *** True Line Result - args.state.player.w, -** Processing line: ~ args.state.player.h, 255, 255, 255]~ + won << (state.spaces[ 1][-1].piece == piece && # bottom right +** Processing line: ~ state.spaces[ 0][ 0].piece == piece && # center~ - Inside source: true *** True Line Result - args.state.player.h, 255, 255, 255] -** Processing line: ~ end~ + state.spaces[ 0][ 0].piece == piece && # center +** Processing line: ~ state.spaces[-1][ 1].piece == piece) # top left~ - Inside source: true *** True Line Result - end + state.spaces[-1][ 1].piece == piece) # top left ** 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: ~ input args~ -- Inside source: true -*** True Line Result - input args -** Processing line: ~ calc args~ +** Processing line: ~ # Any false statements (meaning false diagonal matches) are rejected from won~ - Inside source: true *** True Line Result - calc args -** Processing line: ~ render args~ + # Any false statements (meaning false diagonal matches) are rejected from won +** Processing line: ~ won.reject_false.any?~ - Inside source: true *** True Line Result - render args -** Processing line: ~ end~ + won.reject_false.any? +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. -*** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Performance - Sprites As Hash - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Performance - Sprites As Hash - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - +** Processing line: ~ # Defines filled spaces on the board by rejecting all spaces that do not have game pieces in them.~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/09_performance/01_sprites_as_hash/app/main.rb~ + # Defines filled spaces on the board by rejecting all spaces that do not have game pieces in them. +** Processing line: ~ # The ! before a statement means "not". For example, we are rejecting any space combinations that do~ - Inside source: true *** True Line Result - # ./samples/09_performance/01_sprites_as_hash/app/main.rb -** Processing line: ~~ + # The ! before a statement means "not". For example, we are rejecting any space combinations that do +** Processing line: ~ # NOT have pieces in them.~ - Inside source: true *** True Line Result - -** Processing line: ~ # Sprites represented as Hashes using the queue ~args.outputs.sprites~~ + # NOT have pieces in them. +** Processing line: ~ def filled_spaces~ - Inside source: true *** True Line Result - # Sprites represented as Hashes using the queue ~args.outputs.sprites~ -** Processing line: ~ # code up, but are the "slowest" to render.~ + def filled_spaces +** Processing line: ~ state.space_combinations~ - Inside source: true *** True Line Result - # code up, but are the "slowest" to render. -** Processing line: ~ # The reason for this is the access of the key in the Hash and also~ + state.space_combinations +** Processing line: ~ .reject { |x, y| !state.spaces[x][y].piece } # reject spaces with no pieces in them~ - Inside source: true *** True Line Result - # The reason for this is the access of the key in the Hash and also -** Processing line: ~ # because the data args.outputs.sprites is cleared every tick.~ + .reject { |x, y| !state.spaces[x][y].piece } # reject spaces with no pieces in them +** Processing line: ~ .map do |x, y|~ - Inside source: true *** True Line Result - # because the data args.outputs.sprites is cleared every tick. -** Processing line: ~ def random_x args~ + .map do |x, y| +** Processing line: ~ if block_given?~ - Inside source: true *** True Line Result - def random_x args -** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ + if block_given? +** Processing line: ~ yield x, y, state.spaces[x][y]~ - Inside source: true *** True Line Result - (args.grid.w.randomize :ratio) * -1 -** Processing line: ~ end~ + yield x, y, state.spaces[x][y] +** Processing line: ~ else~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + else +** Processing line: ~ [x, y, state.spaces[x][y]] # sets definition of space~ - Inside source: true *** True Line Result - -** Processing line: ~ def random_y args~ + [x, y, state.spaces[x][y]] # sets definition of space +** Processing line: ~ end~ - Inside source: true *** True Line Result - def random_y args -** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - (args.grid.h.randomize :ratio) * -1 -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def random_speed~ +** Processing line: ~ # Defines all spaces on the board.~ - Inside source: true *** True Line Result - def random_speed -** Processing line: ~ 1 + (4.randomize :ratio)~ + # Defines all spaces on the board. +** Processing line: ~ def all_spaces~ - Inside source: true *** True Line Result - 1 + (4.randomize :ratio) -** Processing line: ~ end~ + def all_spaces +** Processing line: ~ if !block_given?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if !block_given? +** Processing line: ~ state.space_combinations.map do |x, y|~ - Inside source: true *** True Line Result - -** Processing line: ~ def new_star args~ + state.space_combinations.map do |x, y| +** Processing line: ~ [x, y, state.spaces[x][y]] # sets definition of space~ - Inside source: true *** True Line Result - def new_star args -** Processing line: ~ {~ + [x, y, state.spaces[x][y]] # sets definition of space +** Processing line: ~ end~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: (random_x args),~ + end +** Processing line: ~ else # if a block is given (block_given? is true)~ - Inside source: true *** True Line Result - x: (random_x args), -** Processing line: ~ y: (random_y args),~ + else # if a block is given (block_given? is true) +** Processing line: ~ state.space_combinations.map do |x, y|~ - Inside source: true *** True Line Result - y: (random_y args), -** Processing line: ~ w: 4, h: 4, path: 'sprites/tiny-star.png',~ + state.space_combinations.map do |x, y| +** Processing line: ~ yield x, y, state.spaces[x][y] # yield if a block is given~ - Inside source: true *** True Line Result - w: 4, h: 4, path: 'sprites/tiny-star.png', -** Processing line: ~ s: random_speed~ + yield x, y, state.spaces[x][y] # yield if a block is given +** Processing line: ~ end~ - Inside source: true *** True Line Result - s: random_speed -** Processing line: ~ }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def move_star args, star~ -- Inside source: true -*** True Line Result - def move_star args, star -** Processing line: ~ star.x += star[:s]~ -- Inside source: true -*** True Line Result - star.x += star[:s] -** Processing line: ~ star.y += star[:s]~ -- Inside source: true -*** True Line Result - star.y += star[:s] -** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ -- Inside source: true -*** True Line Result - if star.x > args.grid.w || star.y > args.grid.h -** Processing line: ~ star.x = (random_x args)~ +** Processing line: ~ # Sets values for a label, such as the position, value, size, alignment, and color.~ - Inside source: true *** True Line Result - star.x = (random_x args) -** Processing line: ~ star.y = (random_y args)~ + # Sets values for a label, such as the position, value, size, alignment, and color. +** Processing line: ~ def label x, y, value~ - Inside source: true *** True Line Result - star.y = (random_y args) -** Processing line: ~ star[:s] = random_speed~ + def label x, y, value +** Processing line: ~ [x, y + 10, value, 20, 1, 0, 0, 0]~ - Inside source: true *** True Line Result - star[:s] = random_speed + [x, y + 10, value, 20, 1, 0, 0, 0] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -37835,114 +41148,106 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ -- Inside source: true -*** True Line Result - def tick args -** Processing line: ~ args.state.star_count ||= 0~ +** Processing line: ~ $tic_tac_toe = TicTacToe.new~ - Inside source: true *** True Line Result - args.state.star_count ||= 0 + $tic_tac_toe = TicTacToe.new ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # sets console command when sample app initially opens~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # sets console command when sample app initially opens -** Processing line: ~ if Kernel.global_tick_count == 0~ + def tick args +** Processing line: ~ $tic_tac_toe._ = args~ - Inside source: true *** True Line Result - if Kernel.global_tick_count == 0 -** Processing line: ~ puts "* INFO - Please specify the number of sprites to render."~ + $tic_tac_toe._ = args +** Processing line: ~ $tic_tac_toe.state = args.state~ - 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"~ + $tic_tac_toe.state = args.state +** Processing line: ~ $tic_tac_toe.outputs = args.outputs~ - Inside source: true *** True Line Result - args.gtk.console.set_command "reset_with count: 100" -** Processing line: ~ end~ + $tic_tac_toe.outputs = args.outputs +** Processing line: ~ $tic_tac_toe.inputs = args.inputs~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + $tic_tac_toe.inputs = args.inputs +** Processing line: ~ $tic_tac_toe.grid = args.grid~ - Inside source: true *** True Line Result - -** Processing line: ~ # init~ + $tic_tac_toe.grid = args.grid +** Processing line: ~ $tic_tac_toe.gtk = args.gtk~ - Inside source: true *** True Line Result - # init -** Processing line: ~ if args.state.tick_count == 0~ + $tic_tac_toe.gtk = args.gtk +** Processing line: ~ $tic_tac_toe.tick~ - Inside source: true *** True Line Result - if args.state.tick_count == 0 -** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ + $tic_tac_toe.tick +** Processing line: ~ tick_instructions args, "Sample app shows how to work with mouse clicks."~ - Inside source: true *** True Line Result - args.state.stars = args.state.star_count.map { |i| new_star args } -** Processing line: ~ end~ + tick_instructions args, "Sample app shows how to work with mouse clicks." +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # update~ +** Processing line: ~ def tick_instructions args, text, y = 715~ - Inside source: true *** True Line Result - # update -** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ + def tick_instructions args, text, y = 715 +** Processing line: ~ return if args.state.key_event_occurred~ - Inside source: true *** True Line Result - args.state.stars.each { |s| move_star args, s } -** Processing line: ~~ + return if args.state.key_event_occurred +** Processing line: ~ if args.inputs.mouse.click ||~ - Inside source: true *** True Line Result - -** Processing line: ~ # render~ + if args.inputs.mouse.click || +** Processing line: ~ args.inputs.keyboard.directional_vector ||~ - Inside source: true *** True Line Result - # render -** Processing line: ~ args.outputs.sprites << args.state.stars~ + args.inputs.keyboard.directional_vector || +** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ - Inside source: true *** True Line Result - args.outputs.sprites << args.state.stars -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ + args.inputs.keyboard.key_down.enter || +** Processing line: ~ args.inputs.keyboard.key_down.escape~ - Inside source: true *** True Line Result - args.outputs.background_color = [0, 0, 0] -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ + args.inputs.keyboard.key_down.escape +** Processing line: ~ args.state.key_event_occurred = true~ - Inside source: true *** True Line Result - args.outputs.primitives << args.gtk.current_framerate_primitives -** Processing line: ~ end~ + args.state.key_event_occurred = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # resets game, and assigns star count given by user~ -- Inside source: true -*** True Line Result - # resets game, and assigns star count given by user -** Processing line: ~ def reset_with count: count~ +** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ - Inside source: true *** True Line Result - def reset_with count: count -** Processing line: ~ $gtk.reset~ + 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 - $gtk.reset -** Processing line: ~ $gtk.args.state.star_count = count~ + 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 - $gtk.args.state.star_count = count + 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 @@ -37959,514 +41264,462 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Performance - Sprites As Entities - main.rb~ +** Processing line: ~*** Mouse - Mouse Move - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Performance - Sprites As Entities - main.rb +*** Mouse - Mouse Move - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result *** True Line Result #+begin_src ruby -** Processing line: ~ # ./samples/09_performance/02_sprites_as_entities/app/main.rb~ +** Processing line: ~ # ./samples/05_mouse/02_mouse_move/app/main.rb~ - Inside source: true *** True Line Result - # ./samples/09_performance/02_sprites_as_entities/app/main.rb -** Processing line: ~ # Sprites represented as Entities using the queue ~args.outputs.sprites~~ + # ./samples/05_mouse/02_mouse_move/app/main.rb +** Processing line: ~ =begin~ - Inside source: true *** True Line Result - # Sprites represented as Entities using the queue ~args.outputs.sprites~ -** Processing line: ~ # yields nicer access apis over Hashes, but require a bit more code upfront.~ + =begin +** Processing line: ~~ - Inside source: true *** True Line Result - # yields nicer access apis over Hashes, but require a bit more code upfront. -** Processing line: ~ # The hash sample has to use star[:s] to get the speed of the star, but~ + +** Processing line: ~ Reminders:~ - Inside source: true *** True Line Result - # The hash sample has to use star[:s] to get the speed of the star, but -** Processing line: ~ # an entity can use .s instead.~ + Reminders: +** Processing line: ~~ - Inside source: true *** True Line Result - # an entity can use .s instead. -** Processing line: ~ def random_x args~ + +** Processing line: ~ - num1.greater(num2): Returns the greater value.~ - Inside source: true *** True Line Result - def random_x args -** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ + - num1.greater(num2): Returns the greater value. +** Processing line: ~ For example, if we have the command~ - Inside source: true *** True Line Result - (args.grid.w.randomize :ratio) * -1 -** Processing line: ~ end~ + For example, if we have the command +** Processing line: ~ puts 4.greater(3)~ - Inside source: true *** True Line Result - end + puts 4.greater(3) +** Processing line: ~ the number 4 would be printed to the console since it has a greater value than 3.~ +- Inside source: true +*** True Line Result + the number 4 would be printed to the console since it has a greater value than 3. +** Processing line: ~ Similar to lesser, which returns the lesser value.~ +- Inside source: true +*** True Line Result + Similar to lesser, which returns the lesser value. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def random_y args~ +** Processing line: ~ - find_all: Finds all elements of a collection that meet certain requirements.~ - Inside source: true *** True Line Result - def random_y args -** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ + - find_all: Finds all elements of a collection that meet certain requirements. +** Processing line: ~ For example, in this sample app, we're using find_all to find all zombies that have intersected~ - Inside source: true *** True Line Result - (args.grid.h.randomize :ratio) * -1 -** Processing line: ~ end~ + For example, in this sample app, we're using find_all to find all zombies that have intersected +** Processing line: ~ or hit the player's sprite since these zombies have been killed.~ - Inside source: true *** True Line Result - end + or hit the player's sprite since these zombies have been killed. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def random_speed~ +** Processing line: ~ - args.inputs.keyboard.key_down.KEY: Determines if a key is being held or pressed.~ - Inside source: true *** True Line Result - def random_speed -** Processing line: ~ 1 + (4.randomize :ratio)~ + - args.inputs.keyboard.key_down.KEY: Determines if a key is being held or pressed. +** Processing line: ~ Stores the frame the "down" event occurred.~ - Inside source: true *** True Line Result - 1 + (4.randomize :ratio) -** Processing line: ~ end~ + Stores the frame the "down" event occurred. +** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ - Inside source: true *** True Line Result - end + For more information about the keyboard, go to mygame/documentation/06-keyboard.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def new_star args~ -- Inside source: true -*** True Line Result - def new_star args -** Processing line: ~ args.state.new_entity :star, {~ +** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ - Inside source: true *** True Line Result - args.state.new_entity :star, { -** Processing line: ~ x: (random_x args),~ + - args.outputs.sprites: An array. The values generate a sprite. +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE]~ - Inside source: true *** True Line Result - x: (random_x args), -** Processing line: ~ y: (random_y args),~ + The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE] +** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ - Inside source: true *** True Line Result - y: (random_y args), -** Processing line: ~ w: 4, h: 4,~ + For more information about sprites, go to mygame/documentation/05-sprites.md. +** Processing line: ~~ - Inside source: true *** True Line Result - w: 4, h: 4, -** Processing line: ~ path: 'sprites/tiny-star.png',~ + +** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ - Inside source: true *** True Line Result - path: 'sprites/tiny-star.png', -** Processing line: ~ s: random_speed~ + - args.state.new_entity: Used when we want to create a new object, like a sprite or button. +** Processing line: ~ When we want to create a new object, we can declare it as a new entity and then define~ - Inside source: true *** True Line Result - s: random_speed -** Processing line: ~ }~ + When we want to create a new object, we can declare it as a new entity and then define +** Processing line: ~ its properties. (Remember, you can use state to define ANY property and it will~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + its properties. (Remember, you can use state to define ANY property and it will +** Processing line: ~ be retained across frames.)~ - Inside source: true *** True Line Result - end + be retained across frames.) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def move_star args, star~ -- Inside source: true -*** True Line Result - def move_star args, star -** Processing line: ~ star.x += star.s~ +** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ - Inside source: true *** True Line Result - star.x += star.s -** Processing line: ~ star.y += star.s~ + - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ - Inside source: true *** True Line Result - star.y += star.s -** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ + as Ruby code, and the placeholder is replaced with its corresponding value or result. +** Processing line: ~~ - Inside source: true *** True Line Result - if star.x > args.grid.w || star.y > args.grid.h -** Processing line: ~ star.x = (random_x args)~ + +** Processing line: ~ - map: Ruby method used to transform data; used in arrays, hashes, and collections.~ - Inside source: true *** True Line Result - star.x = (random_x args) -** Processing line: ~ star.y = (random_y args)~ + - map: Ruby method used to transform data; used in arrays, hashes, and collections. +** Processing line: ~ Can be used to perform an action on every element of a collection, such as multiplying~ - Inside source: true *** True Line Result - star.y = (random_y args) -** Processing line: ~ star.s = random_speed~ + Can be used to perform an action on every element of a collection, such as multiplying +** Processing line: ~ each element by 2 or declaring every element as a new entity.~ - Inside source: true *** True Line Result - star.s = random_speed -** Processing line: ~ end~ + each element by 2 or declaring every element as a new entity. +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ - sample: Chooses a random element from the array.~ - Inside source: true *** True Line Result - end + - sample: Chooses a random element from the array. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ - reject: Removes elements that meet certain requirements.~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.state.star_count ||= 0~ + - reject: Removes elements that meet certain requirements. +** Processing line: ~ In this sample app, we're removing/rejecting zombies that reach the center of the screen. We're also~ - Inside source: true *** True Line Result - args.state.star_count ||= 0 -** Processing line: ~~ + In this sample app, we're removing/rejecting zombies that reach the center of the screen. We're also +** Processing line: ~ rejecting zombies that were killed more than 30 frames ago.~ - Inside source: true *** True Line Result - -** Processing line: ~ # sets console command when sample app initially opens~ + rejecting zombies that were killed more than 30 frames ago. +** Processing line: ~~ - Inside source: true *** True Line Result - # sets console command when sample app initially opens -** Processing line: ~ if Kernel.global_tick_count == 0~ + +** Processing line: ~ =end~ - Inside source: true *** True Line Result - if Kernel.global_tick_count == 0 -** Processing line: ~ puts "* INFO - Please specify the number of sprites to render."~ + =end +** Processing line: ~~ - 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"~ + +** Processing line: ~ # This sample app allows users to move around the screen in order to kill zombies. Zombies appear from every direction so the goal~ - Inside source: true *** True Line Result - args.gtk.console.set_command "reset_with count: 100" -** Processing line: ~ end~ + # This sample app allows users to move around the screen in order to kill zombies. Zombies appear from every direction so the goal +** Processing line: ~ # is to kill the zombies as fast as possible!~ - Inside source: true *** True Line Result - end + # is to kill the zombies as fast as possible! ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # init~ +** Processing line: ~ class ProtectThePuppiesFromTheZombies~ - Inside source: true *** True Line Result - # init -** Processing line: ~ if args.state.tick_count == 0~ -- Inside source: true -*** True Line Result - if args.state.tick_count == 0 -** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ -- Inside source: true -*** True Line Result - args.state.stars = args.state.star_count.map { |i| new_star args } -** Processing line: ~ end~ + class ProtectThePuppiesFromTheZombies +** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs~ - Inside source: true *** True Line Result - end + attr_accessor :grid, :inputs, :state, :outputs ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # update~ -- Inside source: true -*** True Line Result - # update -** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ +** Processing line: ~ # Calls the methods necessary for the game to run properly.~ - Inside source: true *** True Line Result - args.state.stars.each { |s| move_star args, s } -** Processing line: ~~ + # Calls the methods necessary for the game to run properly. +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - -** Processing line: ~ # render~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - # render -** Processing line: ~ args.outputs.sprites << args.state.stars~ + defaults +** Processing line: ~ render~ - Inside source: true *** True Line Result - args.outputs.sprites << args.state.stars -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ + render +** Processing line: ~ calc~ - Inside source: true *** True Line Result - args.outputs.background_color = [0, 0, 0] -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ + calc +** Processing line: ~ input~ - Inside source: true *** True Line Result - args.outputs.primitives << args.gtk.current_framerate_primitives -** Processing line: ~ end~ + input +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # resets game, and assigns star count given by user~ +** Processing line: ~ # Sets default values for the zombies and for the player.~ - Inside source: true *** True Line Result - # resets game, and assigns star count given by user -** Processing line: ~ def reset_with count: count~ + # Sets default values for the zombies and for the player. +** Processing line: ~ # Initialization happens only in the first frame.~ - Inside source: true *** True Line Result - def reset_with count: count -** Processing line: ~ $gtk.reset~ + # Initialization happens only in the first frame. +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~ $gtk.args.state.star_count = count~ + def defaults +** Processing line: ~ state.flash_at ||= 0~ - Inside source: true *** True Line Result - $gtk.args.state.star_count = count -** Processing line: ~ end~ + state.flash_at ||= 0 +** Processing line: ~ state.zombie_min_spawn_rate ||= 60~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.zombie_min_spawn_rate ||= 60 +** Processing line: ~ state.zombie_spawn_countdown ||= random_spawn_countdown state.zombie_min_spawn_rate~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. -*** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Performance - Sprites As Strict Entities - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Performance - Sprites As Strict Entities - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb~ + state.zombie_spawn_countdown ||= random_spawn_countdown state.zombie_min_spawn_rate +** Processing line: ~ state.zombies ||= []~ - Inside source: true *** True Line Result - # ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb -** Processing line: ~ # Sprites represented as StrictEntities using the queue ~args.outputs.sprites~~ + state.zombies ||= [] +** Processing line: ~ state.killed_zombies ||= []~ - Inside source: true *** True Line Result - # Sprites represented as StrictEntities using the queue ~args.outputs.sprites~ -** Processing line: ~ # yields apis access similar to Entities, but all properties that can be set on the~ + state.killed_zombies ||= [] +** Processing line: ~~ - Inside source: true *** True Line Result - # yields apis access similar to Entities, but all properties that can be set on the -** Processing line: ~ # entity must be predefined with a default value. Strict entities do not support the~ + +** Processing line: ~ # Declares player as a new entity and sets its properties.~ - Inside source: true *** True Line Result - # entity must be predefined with a default value. Strict entities do not support the -** Processing line: ~ # addition of new properties after the fact. They are more performant than OpenEntities~ + # Declares player as a new entity and sets its properties. +** Processing line: ~ # The player begins the game in the center of the screen, not moving in any direction.~ - Inside source: true *** True Line Result - # addition of new properties after the fact. They are more performant than OpenEntities -** Processing line: ~ # because of this constraint.~ + # The player begins the game in the center of the screen, not moving in any direction. +** Processing line: ~ state.player ||= state.new_entity(:player, { x: 640,~ - Inside source: true *** True Line Result - # because of this constraint. -** Processing line: ~ def random_x args~ + state.player ||= state.new_entity(:player, { x: 640, +** Processing line: ~ y: 360,~ - Inside source: true *** True Line Result - def random_x args -** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ + y: 360, +** Processing line: ~ attack_angle: 0,~ - Inside source: true *** True Line Result - (args.grid.w.randomize :ratio) * -1 -** Processing line: ~ end~ + attack_angle: 0, +** Processing line: ~ dx: 0,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + dx: 0, +** Processing line: ~ dy: 0 })~ - Inside source: true *** True Line Result - -** Processing line: ~ def random_y args~ + dy: 0 }) +** Processing line: ~ end~ - Inside source: true *** True Line Result - def random_y args -** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - (args.grid.h.randomize :ratio) * -1 -** Processing line: ~ end~ + +** Processing line: ~ # Outputs a gray background.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Outputs a gray background. +** Processing line: ~ # Calls the methods needed to output the player, zombies, etc onto the screen.~ - Inside source: true *** True Line Result - -** Processing line: ~ def random_speed~ + # Calls the methods needed to output the player, zombies, etc onto the screen. +** Processing line: ~ def render~ - Inside source: true *** True Line Result - def random_speed -** Processing line: ~ 1 + (4.randomize :ratio)~ + def render +** Processing line: ~ outputs.solids << [grid.rect, 100, 100, 100]~ - Inside source: true *** True Line Result - 1 + (4.randomize :ratio) -** Processing line: ~ end~ + outputs.solids << [grid.rect, 100, 100, 100] +** Processing line: ~ render_zombies~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + render_zombies +** Processing line: ~ render_killed_zombies~ - Inside source: true *** True Line Result - -** Processing line: ~ def new_star args~ + render_killed_zombies +** Processing line: ~ render_player~ - Inside source: true *** True Line Result - def new_star args -** Processing line: ~ args.state.new_entity_strict(:star,~ + render_player +** Processing line: ~ render_flash~ - Inside source: true *** True Line Result - args.state.new_entity_strict(:star, -** Processing line: ~ x: (random_x args),~ + render_flash +** Processing line: ~ end~ - Inside source: true *** True Line Result - x: (random_x args), -** Processing line: ~ y: (random_y args),~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - y: (random_y args), -** Processing line: ~ w: 4, h: 4,~ + +** Processing line: ~ # Outputs the zombies on the screen and sets values for the sprites, such as the position, width, height, and animation.~ - Inside source: true *** True Line Result - w: 4, h: 4, -** Processing line: ~ path: 'sprites/tiny-star.png',~ + # Outputs the zombies on the screen and sets values for the sprites, such as the position, width, height, and animation. +** Processing line: ~ def render_zombies~ - Inside source: true *** True Line Result - path: 'sprites/tiny-star.png', -** Processing line: ~ s: random_speed) do |entity|~ + def render_zombies +** Processing line: ~ outputs.sprites << state.zombies.map do |z| # performs action on all zombies in the collection~ - Inside source: true *** True Line Result - s: random_speed) do |entity| -** Processing line: ~ # invoke attr_sprite so that it responds to~ + outputs.sprites << state.zombies.map do |z| # performs action on all zombies in the collection +** Processing line: ~ z.sprite = [z.x, z.y, 4 * 3, 8 * 3, animation_sprite(z)].sprite # sets definition for sprite, calls animation_sprite method~ - Inside source: true *** True Line Result - # invoke attr_sprite so that it responds to -** Processing line: ~ # all properties that are required to render a sprite~ + z.sprite = [z.x, z.y, 4 * 3, 8 * 3, animation_sprite(z)].sprite # sets definition for sprite, calls animation_sprite method +** Processing line: ~ z.sprite~ - Inside source: true *** True Line Result - # all properties that are required to render a sprite -** Processing line: ~ entity.attr_sprite~ + z.sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - entity.attr_sprite + 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 move_star args, star~ -- Inside source: true -*** True Line Result - def move_star args, star -** Processing line: ~ star.x += star.s~ +** Processing line: ~ # Outputs sprites of killed zombies, and displays a slash image to show that a zombie has been killed.~ - Inside source: true *** True Line Result - star.x += star.s -** Processing line: ~ star.y += star.s~ + # Outputs sprites of killed zombies, and displays a slash image to show that a zombie has been killed. +** Processing line: ~ def render_killed_zombies~ - Inside source: true *** True Line Result - star.y += star.s -** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ + def render_killed_zombies +** Processing line: ~ outputs.sprites << state.killed_zombies.map do |z| # performs action on all killed zombies in collection~ - Inside source: true *** True Line Result - if star.x > args.grid.w || star.y > args.grid.h -** Processing line: ~ star.x = (random_x args)~ + outputs.sprites << state.killed_zombies.map do |z| # performs action on all killed zombies in collection +** Processing line: ~ z.sprite = [z.x,~ - Inside source: true *** True Line Result - star.x = (random_x args) -** Processing line: ~ star.y = (random_y args)~ + z.sprite = [z.x, +** Processing line: ~ z.y,~ - Inside source: true *** True Line Result - star.y = (random_y args) -** Processing line: ~ star.s = random_speed~ + z.y, +** Processing line: ~ 4 * 3,~ - Inside source: true *** True Line Result - star.s = random_speed -** Processing line: ~ end~ + 4 * 3, +** Processing line: ~ 8 * 3,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 8 * 3, +** Processing line: ~ animation_sprite(z, z.death_at), # calls animation_sprite method~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + animation_sprite(z, z.death_at), # calls animation_sprite method +** Processing line: ~ 0, # angle~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + 0, # angle +** Processing line: ~ 255 * z.death_at.ease(30, :flip)].sprite # transparency of a zombie changes when they die~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.state.star_count ||= 0~ + 255 * z.death_at.ease(30, :flip)].sprite # transparency of a zombie changes when they die +** Processing line: ~ # change the value of 30 and see what happens when a zombie is killed~ - Inside source: true *** True Line Result - args.state.star_count ||= 0 + # change the value of 30 and see what happens when a zombie is killed ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # sets console command when sample app initially opens~ -- Inside source: true -*** True Line Result - # sets console command when sample app initially opens -** Processing line: ~ if Kernel.global_tick_count == 0~ -- Inside source: true -*** True Line Result - if Kernel.global_tick_count == 0 -** Processing line: ~ puts "* 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"~ +** Processing line: ~ # Sets values to output the slash over the zombie's sprite when a zombie is killed.~ - Inside source: true *** True Line Result - args.gtk.console.set_command "reset_with count: 100" -** Processing line: ~ end~ + # Sets values to output the slash over the zombie's sprite when a zombie is killed. +** Processing line: ~ # The slash is tilted 45 degrees from the angle of the player's attack.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # The slash is tilted 45 degrees from the angle of the player's attack. +** Processing line: ~ # Change the 3 inside scale_rect to 30 and the slash will be HUGE! Scale_rect positions~ - Inside source: true *** True Line Result - -** Processing line: ~ # init~ + # Change the 3 inside scale_rect to 30 and the slash will be HUGE! Scale_rect positions +** Processing line: ~ # the slash over the killed zombie's sprite.~ - Inside source: true *** True Line Result - # init -** Processing line: ~ if args.state.tick_count == 0~ + # the slash over the killed zombie's sprite. +** Processing line: ~ [z.sprite, [z.sprite.rect, 'sprites/slash.png', 45 + state.player.attack_angle_on_click, z.sprite.a].scale_rect(3, 0.5, 0.5)]~ - Inside source: true *** True Line Result - if args.state.tick_count == 0 -** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ + [z.sprite, [z.sprite.rect, 'sprites/slash.png', 45 + state.player.attack_angle_on_click, z.sprite.a].scale_rect(3, 0.5, 0.5)] +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.stars = args.state.star_count.map { |i| new_star args } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -38475,146 +41728,122 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # update~ -- Inside source: true -*** True Line Result - # update -** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ +** Processing line: ~ # Outputs the player sprite using the images in the sprites folder.~ - Inside source: true *** True Line Result - args.state.stars.each { |s| move_star args, s } -** Processing line: ~~ + # Outputs the player sprite using the images in the sprites folder. +** Processing line: ~ def render_player~ - Inside source: true *** True Line Result - -** Processing line: ~ # render~ + def render_player +** Processing line: ~ state.player_sprite = [state.player.x,~ - Inside source: true *** True Line Result - # render -** Processing line: ~ args.outputs.sprites << args.state.stars~ + state.player_sprite = [state.player.x, +** Processing line: ~ state.player.y,~ - Inside source: true *** True Line Result - args.outputs.sprites << args.state.stars -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ + state.player.y, +** Processing line: ~ 4 * 3,~ - Inside source: true *** True Line Result - args.outputs.background_color = [0, 0, 0] -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ + 4 * 3, +** Processing line: ~ 8 * 3, "sprites/player-#{animation_index(state.player.created_at_elapsed)}.png"] # string interpolation~ - Inside source: true *** True Line Result - args.outputs.primitives << args.gtk.current_framerate_primitives -** Processing line: ~ end~ + 8 * 3, "sprites/player-#{animation_index(state.player.created_at_elapsed)}.png"] # string interpolation +** Processing line: ~ outputs.sprites << state.player_sprite~ - Inside source: true *** True Line Result - end + outputs.sprites << state.player_sprite ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # resets game, and assigns star count given by user~ +** Processing line: ~ # Outputs a small red square that previews the angles that the player can attack in.~ - Inside source: true *** True Line Result - # resets game, and assigns star count given by user -** Processing line: ~ def reset_with count: count~ + # Outputs a small red square that previews the angles that the player can attack in. +** Processing line: ~ # It can be moved in a perfect circle around the player to show possible movements.~ - Inside source: true *** True Line Result - def reset_with count: count -** Processing line: ~ $gtk.reset~ + # It can be moved in a perfect circle around the player to show possible movements. +** Processing line: ~ # Change the 60 in the parenthesis and see what happens to the movement of the red square.~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~ $gtk.args.state.star_count = count~ + # Change the 60 in the parenthesis and see what happens to the movement of the red square. +** Processing line: ~ outputs.solids << [state.player.x + state.player.attack_angle.vector_x(60),~ - Inside source: true *** True Line Result - $gtk.args.state.star_count = count -** Processing line: ~ end~ + outputs.solids << [state.player.x + state.player.attack_angle.vector_x(60), +** Processing line: ~ state.player.y + state.player.attack_angle.vector_y(60),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.player.y + state.player.attack_angle.vector_y(60), +** Processing line: ~ 3, 3, 255, 0, 0]~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + 3, 3, 255, 0, 0] +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Performance - Sprites As Classes - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Performance - Sprites As Classes - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/09_performance/04_sprites_as_classes/app/main.rb~ +** Processing line: ~ # Renders flash as a solid. The screen turns white for 10 frames when a zombie is killed.~ - Inside source: true *** True Line Result - # ./samples/09_performance/04_sprites_as_classes/app/main.rb -** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.sprites~.~ + # Renders flash as a solid. The screen turns white for 10 frames when a zombie is killed. +** Processing line: ~ def render_flash~ - Inside source: true *** True Line Result - # Sprites represented as Classes using the queue ~args.outputs.sprites~. -** Processing line: ~ # gives you full control of property declaration and method invocation.~ + def render_flash +** Processing line: ~ return if state.flash_at.elapsed_time > 10 # return if more than 10 frames have passed since flash.~ - Inside source: true *** True Line Result - # gives you full control of property declaration and method invocation. -** Processing line: ~ # They are more performant than OpenEntities and StrictEntities, but more code upfront.~ + return if state.flash_at.elapsed_time > 10 # return if more than 10 frames have passed since flash. +** Processing line: ~ # Transparency gradually changes (or eases) during the 10 frames of flash.~ - Inside source: true *** True Line Result - # They are more performant than OpenEntities and StrictEntities, but more code upfront. -** Processing line: ~ class Star~ + # Transparency gradually changes (or eases) during the 10 frames of flash. +** Processing line: ~ outputs.primitives << [grid.rect, 255, 255, 255, 255 * state.flash_at.ease(10, :flip)].solid~ - Inside source: true *** True Line Result - class Star -** Processing line: ~ attr_sprite~ + outputs.primitives << [grid.rect, 255, 255, 255, 255 * state.flash_at.ease(10, :flip)].solid +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_sprite + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def initialize grid~ -- Inside source: true -*** True Line Result - def initialize grid -** Processing line: ~ @grid = grid~ -- Inside source: true -*** True Line Result - @grid = grid -** Processing line: ~ @x = (rand @grid.w) * -1~ +** Processing line: ~ # Calls all methods necessary for performing calculations.~ - Inside source: true *** True Line Result - @x = (rand @grid.w) * -1 -** Processing line: ~ @y = (rand @grid.h) * -1~ + # Calls all methods necessary for performing calculations. +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - @y = (rand @grid.h) * -1 -** Processing line: ~ @w = 4~ + def calc +** Processing line: ~ calc_spawn_zombie~ - Inside source: true *** True Line Result - @w = 4 -** Processing line: ~ @h = 4~ + calc_spawn_zombie +** Processing line: ~ calc_move_zombies~ - Inside source: true *** True Line Result - @h = 4 -** Processing line: ~ @s = 1 + (4.randomize :ratio)~ + calc_move_zombies +** Processing line: ~ calc_player~ - Inside source: true *** True Line Result - @s = 1 + (4.randomize :ratio) -** Processing line: ~ @path = 'sprites/tiny-star.png'~ + calc_player +** Processing line: ~ calc_kill_zombie~ - Inside source: true *** True Line Result - @path = 'sprites/tiny-star.png' + calc_kill_zombie ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -38623,310 +41852,298 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def move~ -- Inside source: true -*** True Line Result - def move -** Processing line: ~ @x += @s~ +** Processing line: ~ # Decreases the zombie spawn countdown by 1 if it has a value greater than 0.~ - Inside source: true *** True Line Result - @x += @s -** Processing line: ~ @y += @s~ + # Decreases the zombie spawn countdown by 1 if it has a value greater than 0. +** Processing line: ~ def calc_spawn_zombie~ - Inside source: true *** True Line Result - @y += @s -** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ + def calc_spawn_zombie +** Processing line: ~ if state.zombie_spawn_countdown > 0~ - Inside source: true *** True Line Result - @x = (rand @grid.w) * -1 if @x > @grid.right -** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ + if state.zombie_spawn_countdown > 0 +** Processing line: ~ state.zombie_spawn_countdown -= 1~ - Inside source: true *** True Line Result - @y = (rand @grid.h) * -1 if @y > @grid.top -** Processing line: ~ end~ + state.zombie_spawn_countdown -= 1 +** Processing line: ~ return~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # calls methods needed for game to run properly~ +** Processing line: ~ # New zombies are created, positioned on the screen, and added to the zombies collection.~ - Inside source: true *** True Line Result - # calls methods needed for game to run properly -** Processing line: ~ def tick args~ + # New zombies are created, positioned on the screen, and added to the zombies collection. +** Processing line: ~ state.zombies << state.new_entity(:zombie) do |z| # each zombie is declared a new entity~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ # sets console command when sample app initially opens~ + state.zombies << state.new_entity(:zombie) do |z| # each zombie is declared a new entity +** Processing line: ~ if rand > 0.5~ - Inside source: true *** True Line Result - # sets console command when sample app initially opens -** Processing line: ~ if Kernel.global_tick_count == 0~ + if rand > 0.5 +** Processing line: ~ z.x = grid.rect.w.randomize(:ratio) # random x position on screen (within grid scope)~ - Inside source: true *** True Line Result - if Kernel.global_tick_count == 0 -** Processing line: ~ args.gtk.console.set_command "reset_with count: 100"~ + z.x = grid.rect.w.randomize(:ratio) # random x position on screen (within grid scope) +** Processing line: ~ z.y = [-10, 730].sample # y position is set to either -10 or 730 (randomly chosen)~ - Inside source: true *** True Line Result - args.gtk.console.set_command "reset_with count: 100" -** Processing line: ~ end~ + z.y = [-10, 730].sample # y position is set to either -10 or 730 (randomly chosen) +** Processing line: ~ # the possible values exceed the screen's scope so zombies appear to be coming from far away~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # the possible values exceed the screen's scope so zombies appear to be coming from far away +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ # init~ + else +** Processing line: ~ z.x = [-10, 1290].sample # x position is set to either -10 or 1290 (randomly chosen)~ - Inside source: true *** True Line Result - # init -** Processing line: ~ if args.state.tick_count == 0~ + z.x = [-10, 1290].sample # x position is set to either -10 or 1290 (randomly chosen) +** Processing line: ~ z.y = grid.rect.w.randomize(:ratio) # random y position on screen~ - Inside source: true *** True Line Result - if args.state.tick_count == 0 -** Processing line: ~ args.state.stars = args.state.star_count.map { |i| Star.new args.grid }~ + z.y = grid.rect.w.randomize(:ratio) # random y position on screen +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.stars = args.state.star_count.map { |i| Star.new args.grid } -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # update~ +** Processing line: ~ # Calls random_spawn_countdown method (determines how fast new zombies appear)~ - Inside source: true *** True Line Result - # update -** Processing line: ~ args.state.stars.each(&:move)~ + # Calls random_spawn_countdown method (determines how fast new zombies appear) +** Processing line: ~ state.zombie_spawn_countdown = random_spawn_countdown state.zombie_min_spawn_rate~ - Inside source: true *** True Line Result - args.state.stars.each(&:move) -** Processing line: ~~ + state.zombie_spawn_countdown = random_spawn_countdown state.zombie_min_spawn_rate +** Processing line: ~ state.zombie_min_spawn_rate -= 1~ - Inside source: true *** True Line Result - -** Processing line: ~ # render~ + state.zombie_min_spawn_rate -= 1 +** Processing line: ~ # set to either the current zombie_min_spawn_rate or 0, depending on which value is greater~ - Inside source: true *** True Line Result - # render -** Processing line: ~ args.outputs.sprites << args.state.stars~ + # set to either the current zombie_min_spawn_rate or 0, depending on which value is greater +** Processing line: ~ state.zombie_min_spawn_rate = state.zombie_min_spawn_rate.greater(0)~ - Inside source: true *** True Line Result - args.outputs.sprites << args.state.stars -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ + state.zombie_min_spawn_rate = state.zombie_min_spawn_rate.greater(0) +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.outputs.background_color = [0, 0, 0] -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.outputs.primitives << args.gtk.current_framerate_primitives -** Processing line: ~ end~ + +** Processing line: ~ # Moves all zombies towards the center of the screen.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Moves all zombies towards the center of the screen. +** Processing line: ~ # All zombies that reach the center (640, 360) are rejected from the zombies collection and disappear.~ - Inside source: true *** True Line Result - -** Processing line: ~ # resets game, and assigns star count given by user~ + # All zombies that reach the center (640, 360) are rejected from the zombies collection and disappear. +** Processing line: ~ def calc_move_zombies~ - Inside source: true *** True Line Result - # resets game, and assigns star count given by user -** Processing line: ~ def reset_with count: count~ + def calc_move_zombies +** Processing line: ~ state.zombies.each do |z| # for each zombie in the collection~ - Inside source: true *** True Line Result - def reset_with count: count -** Processing line: ~ $gtk.reset~ + state.zombies.each do |z| # for each zombie in the collection +** Processing line: ~ z.y = z.y.towards(360, 0.1) # move the zombie towards the center (640, 360) at a rate of 0.1~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~ $gtk.args.state.star_count = count~ + z.y = z.y.towards(360, 0.1) # move the zombie towards the center (640, 360) at a rate of 0.1 +** Processing line: ~ z.x = z.x.towards(640, 0.1) # change 0.1 to 1.1 and see how much faster the zombies move to the center~ - Inside source: true *** True Line Result - $gtk.args.state.star_count = count -** Processing line: ~ end~ + z.x = z.x.towards(640, 0.1) # change 0.1 to 1.1 and see how much faster the zombies move to the center +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ state.zombies = state.zombies.reject { |z| z.y == 360 && z.x == 640 } # remove zombies that are in center~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + state.zombies = state.zombies.reject { |z| z.y == 360 && z.x == 640 } # remove zombies that are in center +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Performance - Static Sprites As Classes - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Performance - Static Sprites As Classes - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/09_performance/05_static_sprites_as_classes/app/main.rb~ +** Processing line: ~ # Calculates the position and movement of the player on the screen.~ - Inside source: true *** True Line Result - # ./samples/09_performance/05_static_sprites_as_classes/app/main.rb -** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.static_sprites~.~ + # Calculates the position and movement of the player on the screen. +** Processing line: ~ def calc_player~ - Inside source: true *** True Line Result - # Sprites represented as Classes using the queue ~args.outputs.static_sprites~. -** Processing line: ~ # bypasses the queue behavior of ~args.outputs.sprites~. All instances are held~ + def calc_player +** Processing line: ~ state.player.x += state.player.dx # changes x based on dx (change in x)~ - Inside source: true *** True Line Result - # bypasses the queue behavior of ~args.outputs.sprites~. All instances are held -** Processing line: ~ # by reference. You get better performance, but you are mutating state of held objects~ + state.player.x += state.player.dx # changes x based on dx (change in x) +** Processing line: ~ state.player.y += state.player.dy # changes y based on dy (change in y)~ - Inside source: true *** True Line Result - # by reference. You get better performance, but you are mutating state of held objects -** Processing line: ~ # which is less functional/data oriented.~ + state.player.y += state.player.dy # changes y based on dy (change in y) +** Processing line: ~~ - Inside source: true *** True Line Result - # which is less functional/data oriented. -** Processing line: ~ class Star~ + +** Processing line: ~ state.player.dx *= 0.9 # scales dx down~ - Inside source: true *** True Line Result - class Star -** Processing line: ~ attr_sprite~ + state.player.dx *= 0.9 # scales dx down +** Processing line: ~ state.player.dy *= 0.9 # scales dy down~ - Inside source: true *** True Line Result - attr_sprite + state.player.dy *= 0.9 # scales dy down ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def initialize grid~ +** Processing line: ~ # Compares player's x to 1280 to find lesser value, then compares result to 0 to find greater value.~ - Inside source: true *** True Line Result - def initialize grid -** Processing line: ~ @grid = grid~ + # Compares player's x to 1280 to find lesser value, then compares result to 0 to find greater value. +** Processing line: ~ # This ensures that the player remains within the screen's scope.~ - Inside source: true *** True Line Result - @grid = grid -** Processing line: ~ @x = (rand @grid.w) * -1~ + # This ensures that the player remains within the screen's scope. +** Processing line: ~ state.player.x = state.player.x.lesser(1280).greater(0)~ - Inside source: true *** True Line Result - @x = (rand @grid.w) * -1 -** Processing line: ~ @y = (rand @grid.h) * -1~ + state.player.x = state.player.x.lesser(1280).greater(0) +** Processing line: ~ state.player.y = state.player.y.lesser(720).greater(0) # same with player's y~ - Inside source: true *** True Line Result - @y = (rand @grid.h) * -1 -** Processing line: ~ @w = 4~ + state.player.y = state.player.y.lesser(720).greater(0) # same with player's y +** Processing line: ~ end~ - Inside source: true *** True Line Result - @w = 4 -** Processing line: ~ @h = 4~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @h = 4 -** Processing line: ~ @s = 1 + (4.randomize :ratio)~ + +** Processing line: ~ # Finds all zombies that intersect with the player's sprite. These zombies are removed from the zombies collection~ - Inside source: true *** True Line Result - @s = 1 + (4.randomize :ratio) -** Processing line: ~ @path = 'sprites/tiny-star.png'~ + # Finds all zombies that intersect with the player's sprite. These zombies are removed from the zombies collection +** Processing line: ~ # and added to the killed_zombies collection since any zombie that intersects with the player is killed.~ - Inside source: true *** True Line Result - @path = 'sprites/tiny-star.png' -** Processing line: ~ end~ + # and added to the killed_zombies collection since any zombie that intersects with the player is killed. +** Processing line: ~ def calc_kill_zombie~ - Inside source: true *** True Line Result - end + def calc_kill_zombie ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def move~ +** Processing line: ~ # Find all zombies that intersect with the player. They are considered killed.~ - Inside source: true *** True Line Result - def move -** Processing line: ~ @x += @s~ + # Find all zombies that intersect with the player. They are considered killed. +** Processing line: ~ killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite }~ - Inside source: true *** True Line Result - @x += @s -** Processing line: ~ @y += @s~ + killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite } +** Processing line: ~ state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection~ - Inside source: true *** True Line Result - @y += @s -** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ + state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection +** Processing line: ~ state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies~ - Inside source: true *** True Line Result - @x = (rand @grid.w) * -1 if @x > @grid.right -** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ + state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies +** Processing line: ~~ - Inside source: true *** True Line Result - @y = (rand @grid.h) * -1 if @y > @grid.top -** Processing line: ~ end~ + +** Processing line: ~ if killed_this_frame.length > 0 # if atleast one zombie was killed in the frame~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + if killed_this_frame.length > 0 # if atleast one zombie was killed in the frame +** Processing line: ~ state.flash_at = state.tick_count # flash_at set to the frame when the zombie was killed~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.flash_at = state.tick_count # flash_at set to the frame when the zombie was killed +** Processing line: ~ # Don't forget, the rendered flash lasts for 10 frames after the zombie is killed (look at render_flash method)~ - Inside source: true *** True Line Result - -** Processing line: ~ # calls methods needed for game to run properly~ + # Don't forget, the rendered flash lasts for 10 frames after the zombie is killed (look at render_flash method) +** Processing line: ~ end~ - Inside source: true *** True Line Result - # calls methods needed for game to run properly -** Processing line: ~ def tick args~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ # sets console command when sample app initially opens~ + +** Processing line: ~ # Sets the tick_count (passage of time) as the value of the death_at variable for each killed zombie.~ - Inside source: true *** True Line Result - # sets console command when sample app initially opens -** Processing line: ~ if Kernel.global_tick_count == 0~ + # Sets the tick_count (passage of time) as the value of the death_at variable for each killed zombie. +** Processing line: ~ # Death_at stores the frame a zombie was killed.~ - Inside source: true *** True Line Result - if Kernel.global_tick_count == 0 -** Processing line: ~ args.gtk.console.set_command "reset_with count: 100"~ + # Death_at stores the frame a zombie was killed. +** Processing line: ~ killed_this_frame.each do |z|~ - Inside source: true *** True Line Result - args.gtk.console.set_command "reset_with count: 100" -** Processing line: ~ end~ + killed_this_frame.each do |z| +** Processing line: ~ z.death_at = state.tick_count~ - Inside source: true *** True Line Result - end + z.death_at = state.tick_count +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # init~ +** Processing line: ~ # Zombies are rejected from the killed_zombies collection depending on when they were killed.~ - Inside source: true *** True Line Result - # init -** Processing line: ~ if args.state.tick_count == 0~ + # Zombies are rejected from the killed_zombies collection depending on when they were killed. +** Processing line: ~ # They are rejected if more than 30 frames have passed since their death.~ - Inside source: true *** True Line Result - if args.state.tick_count == 0 -** Processing line: ~ args.state.stars = args.state.star_count.map { |i| Star.new args.grid }~ + # They are rejected if more than 30 frames have passed since their death. +** Processing line: ~ state.killed_zombies = state.killed_zombies.reject { |z| state.tick_count - z.death_at > 30 }~ - Inside source: true *** True Line Result - args.state.stars = args.state.star_count.map { |i| Star.new args.grid } + state.killed_zombies = state.killed_zombies.reject { |z| state.tick_count - z.death_at > 30 } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -38935,142 +42152,134 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # update~ +** Processing line: ~ # Uses input from the user to move the player around the screen.~ - Inside source: true *** True Line Result - # update -** Processing line: ~ args.state.stars.each(&:move)~ + # Uses input from the user to move the player around the screen. +** Processing line: ~ def input~ - Inside source: true *** True Line Result - args.state.stars.each(&:move) + def input ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # render~ +** Processing line: ~ # If the "a" key or left key is pressed, the x position of the player decreases.~ - Inside source: true *** True Line Result - # render -** Processing line: ~ args.outputs.sprites << args.state.stars~ + # If the "a" key or left key is pressed, the x position of the player decreases. +** Processing line: ~ # Otherwise, if the "d" key or right key is pressed, the x position of the player increases.~ - Inside source: true *** True Line Result - args.outputs.sprites << args.state.stars -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ + # Otherwise, if the "d" key or right key is pressed, the x position of the player increases. +** Processing line: ~ if inputs.keyboard.key_held.a || inputs.keyboard.key_held.left~ - Inside source: true *** True Line Result - args.outputs.background_color = [0, 0, 0] -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ + if inputs.keyboard.key_held.a || inputs.keyboard.key_held.left +** Processing line: ~ state.player.x -= 5~ - Inside source: true *** True Line Result - args.outputs.primitives << args.gtk.current_framerate_primitives -** Processing line: ~ end~ + state.player.x -= 5 +** Processing line: ~ elsif inputs.keyboard.key_held.d || inputs.keyboard.key_held.right~ - Inside source: true *** True Line Result - end + elsif inputs.keyboard.key_held.d || inputs.keyboard.key_held.right +** Processing line: ~ state.player.x += 5~ +- Inside source: true +*** True Line Result + state.player.x += 5 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # resets game, and assigns star count given by user~ +** Processing line: ~ # If the "w" or up key is pressed, the y position of the player increases.~ - Inside source: true *** True Line Result - # resets game, and assigns star count given by user -** Processing line: ~ def reset_with count: count~ + # If the "w" or up key is pressed, the y position of the player increases. +** Processing line: ~ # Otherwise, if the "s" or down key is pressed, the y position of the player decreases.~ - Inside source: true *** True Line Result - def reset_with count: count -** Processing line: ~ $gtk.reset~ + # Otherwise, if the "s" or down key is pressed, the y position of the player decreases. +** Processing line: ~ if inputs.keyboard.key_held.w || inputs.keyboard.key_held.up~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~ $gtk.args.state.star_count = count~ + if inputs.keyboard.key_held.w || inputs.keyboard.key_held.up +** Processing line: ~ state.player.y += 5~ - Inside source: true *** True Line Result - $gtk.args.state.star_count = count -** Processing line: ~ end~ + state.player.y += 5 +** Processing line: ~ elsif inputs.keyboard.key_held.s || inputs.keyboard.key_held.down~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif inputs.keyboard.key_held.s || inputs.keyboard.key_held.down +** Processing line: ~ state.player.y -= 5~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + state.player.y -= 5 +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Performance - Static Sprites As Classes With Custom Drawing - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Performance - Static Sprites As Classes With Custom Drawing - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb~ - Inside source: true *** True Line Result - # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb -** Processing line: ~ # Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~.~ + +** Processing line: ~ # Sets the attack angle so the player can move and attack in the precise direction it wants to go.~ - Inside source: true *** True Line Result - # Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~. -** Processing line: ~ # is the fastest approach. This is comparable to what other game engines set as the default behavior.~ + # Sets the attack angle so the player can move and attack in the precise direction it wants to go. +** Processing line: ~ # If the mouse is moved, the attack angle is changed (based on the player's position and mouse position).~ - Inside source: true *** True Line Result - # is the fastest approach. This is comparable to what other game engines set as the default behavior. -** Processing line: ~ # There are tradeoffs for all this speed if the creation of a full blown class, and bypassing~ + # If the mouse is moved, the attack angle is changed (based on the player's position and mouse position). +** Processing line: ~ # Attack angle also contributes to the position of red square.~ - Inside source: true *** True Line Result - # There are tradeoffs for all this speed if the creation of a full blown class, and bypassing -** Processing line: ~ # functional/data-oriented practices.~ + # Attack angle also contributes to the position of red square. +** Processing line: ~ if inputs.mouse.moved~ - Inside source: true *** True Line Result - # functional/data-oriented practices. -** Processing line: ~ class Star~ + if inputs.mouse.moved +** Processing line: ~ state.player.attack_angle = inputs.mouse.position.angle_from [state.player.x, state.player.y]~ - Inside source: true *** True Line Result - class Star -** Processing line: ~ def initialize grid~ + state.player.attack_angle = inputs.mouse.position.angle_from [state.player.x, state.player.y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - def initialize grid -** Processing line: ~ @grid = grid~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @grid = grid -** Processing line: ~ @x = (rand @grid.w) * -1~ + +** Processing line: ~ if inputs.mouse.click && state.player.dx < 0.5 && state.player.dy < 0.5~ - Inside source: true *** True Line Result - @x = (rand @grid.w) * -1 -** Processing line: ~ @y = (rand @grid.h) * -1~ + if inputs.mouse.click && state.player.dx < 0.5 && state.player.dy < 0.5 +** Processing line: ~ state.player.attack_angle_on_click = inputs.mouse.position.angle_from [state.player.x, state.player.y]~ - Inside source: true *** True Line Result - @y = (rand @grid.h) * -1 -** Processing line: ~ @w = 4~ + state.player.attack_angle_on_click = inputs.mouse.position.angle_from [state.player.x, state.player.y] +** Processing line: ~ state.player.attack_angle = state.player.attack_angle_on_click # player's attack angle is set~ - Inside source: true *** True Line Result - @w = 4 -** Processing line: ~ @h = 4~ + state.player.attack_angle = state.player.attack_angle_on_click # player's attack angle is set +** Processing line: ~ state.player.dx = state.player.attack_angle.vector_x(25) # change in player's position~ - Inside source: true *** True Line Result - @h = 4 -** Processing line: ~ @s = 1 + (4.randomize :ratio)~ + state.player.dx = state.player.attack_angle.vector_x(25) # change in player's position +** Processing line: ~ state.player.dy = state.player.attack_angle.vector_y(25)~ - Inside source: true *** True Line Result - @s = 1 + (4.randomize :ratio) -** Processing line: ~ @path = 'sprites/tiny-star.png'~ + state.player.dy = state.player.attack_angle.vector_y(25) +** Processing line: ~ end~ - Inside source: true *** True Line Result - @path = 'sprites/tiny-star.png' + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -39079,26 +42288,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 move~ -- Inside source: true -*** True Line Result - def move -** Processing line: ~ @x += @s~ +** Processing line: ~ # Sets the zombie spawn's countdown to a random number.~ - Inside source: true *** True Line Result - @x += @s -** Processing line: ~ @y += @s~ + # Sets the zombie spawn's countdown to a random number. +** Processing line: ~ # How fast zombies appear (change the 60 to 6 and too many zombies will appear at once!)~ - Inside source: true *** True Line Result - @y += @s -** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ + # How fast zombies appear (change the 60 to 6 and too many zombies will appear at once!) +** Processing line: ~ def random_spawn_countdown minimum~ - Inside source: true *** True Line Result - @x = (rand @grid.w) * -1 if @x > @grid.right -** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ + def random_spawn_countdown minimum +** Processing line: ~ 10.randomize(:ratio, :sign).to_i + 60~ - Inside source: true *** True Line Result - @y = (rand @grid.h) * -1 if @y > @grid.top + 10.randomize(:ratio, :sign).to_i + 60 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -39107,106 +42312,98 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # if the object that is in args.outputs.sprites (or static_sprites)~ -- Inside source: true -*** True Line Result - # if the object that is in args.outputs.sprites (or static_sprites) -** Processing line: ~ # respond_to? :draw_override, then the method is invoked giving you~ +** Processing line: ~ # Helps to iterate through the images in the sprites folder by setting the animation index.~ - Inside source: true *** True Line Result - # respond_to? :draw_override, then the method is invoked giving you -** Processing line: ~ # access to the class used to draw to the canvas.~ + # Helps to iterate through the images in the sprites folder by setting the animation index. +** Processing line: ~ # 3 frames is how long to show an image, and 6 is how many images to flip through.~ - Inside source: true *** True Line Result - # access to the class used to draw to the canvas. -** Processing line: ~ def draw_override ffi_draw~ + # 3 frames is how long to show an image, and 6 is how many images to flip through. +** Processing line: ~ def animation_index at~ - Inside source: true *** True Line Result - def draw_override ffi_draw -** Processing line: ~ # first move then draw~ + def animation_index at +** Processing line: ~ at.idiv(3).mod(6)~ - Inside source: true *** True Line Result - # first move then draw -** Processing line: ~ move~ + at.idiv(3).mod(6) +** Processing line: ~ end~ - Inside source: true *** True Line Result - move + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # The argument order for ffi.draw_sprite is:~ +** Processing line: ~ # Animates the zombies by using the animation index to go through the images in the sprites folder.~ - Inside source: true *** True Line Result - # The argument order for ffi.draw_sprite is: -** Processing line: ~ # x, y, w, h, path~ + # Animates the zombies by using the animation index to go through the images in the sprites folder. +** Processing line: ~ def animation_sprite zombie, at = nil~ - Inside source: true *** True Line Result - # x, y, w, h, path -** Processing line: ~ ffi_draw.draw_sprite @x, @y, @w, @h, @path~ + def animation_sprite zombie, at = nil +** Processing line: ~ at ||= zombie.created_at_elapsed # how long it is has been since a zombie was created~ - Inside source: true *** True Line Result - ffi_draw.draw_sprite @x, @y, @w, @h, @path -** Processing line: ~~ + at ||= zombie.created_at_elapsed # how long it is has been since a zombie was created +** Processing line: ~ index = animation_index at~ - Inside source: true *** True Line Result - -** Processing line: ~ # The argument order for ffi_draw.draw_sprite_2 is (pass in nil for default value):~ + index = animation_index at +** Processing line: ~ "sprites/zombie-#{index}.png" # string interpolation to iterate through images~ - Inside source: true *** True Line Result - # The argument order for ffi_draw.draw_sprite_2 is (pass in nil for default value): -** Processing line: ~ # x, y, w, h, path,~ + "sprites/zombie-#{index}.png" # string interpolation to iterate through images +** Processing line: ~ end~ - Inside source: true *** True Line Result - # x, y, w, h, path, -** Processing line: ~ # angle, alpha~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # angle, alpha + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # The argument order for ffi_draw.draw_sprite_3 is:~ -- Inside source: true -*** True Line Result - # The argument order for ffi_draw.draw_sprite_3 is: -** Processing line: ~ # x, y, w, h,~ +** Processing line: ~ $protect_the_puppies_from_the_zombies = ProtectThePuppiesFromTheZombies.new~ - Inside source: true *** True Line Result - # x, y, w, h, -** Processing line: ~ # path,~ + $protect_the_puppies_from_the_zombies = ProtectThePuppiesFromTheZombies.new +** Processing line: ~~ - Inside source: true *** True Line Result - # path, -** Processing line: ~ # angle,~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # angle, -** Processing line: ~ # alpha, red_saturation, green_saturation, blue_saturation~ + def tick args +** Processing line: ~ $protect_the_puppies_from_the_zombies.grid = args.grid~ - Inside source: true *** True Line Result - # alpha, red_saturation, green_saturation, blue_saturation -** Processing line: ~ # flip_horizontally, flip_vertically,~ + $protect_the_puppies_from_the_zombies.grid = args.grid +** Processing line: ~ $protect_the_puppies_from_the_zombies.inputs = args.inputs~ - Inside source: true *** True Line Result - # flip_horizontally, flip_vertically, -** Processing line: ~ # tile_x, tile_y, tile_w, tile_h~ + $protect_the_puppies_from_the_zombies.inputs = args.inputs +** Processing line: ~ $protect_the_puppies_from_the_zombies.state = args.state~ - Inside source: true *** True Line Result - # tile_x, tile_y, tile_w, tile_h -** Processing line: ~ # angle_anchor_x, angle_anchor_y,~ + $protect_the_puppies_from_the_zombies.state = args.state +** Processing line: ~ $protect_the_puppies_from_the_zombies.outputs = args.outputs~ - Inside source: true *** True Line Result - # angle_anchor_x, angle_anchor_y, -** Processing line: ~ # source_x, source_y, source_w, source_h~ + $protect_the_puppies_from_the_zombies.outputs = args.outputs +** Processing line: ~ $protect_the_puppies_from_the_zombies.tick~ - Inside source: true *** True Line Result - # source_x, source_y, source_w, source_h -** Processing line: ~ end~ + $protect_the_puppies_from_the_zombies.tick +** Processing line: ~ tick_instructions args, "How to get the mouse position and translate it to an x, y position using .vector_x and .vector_y. CLICK to play."~ - Inside source: true *** True Line Result - end + tick_instructions args, "How to get the mouse position and translate it to an x, y position using .vector_x and .vector_y. CLICK to play." ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -39215,50 +42412,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # calls methods needed for game to run properly~ -- Inside source: true -*** True Line Result - # calls methods needed for game to run properly -** Processing line: ~ def tick args~ -- Inside source: true -*** True Line Result - def tick args -** Processing line: ~ # sets console command when sample app initially opens~ -- Inside source: true -*** True Line Result - # sets console command when sample app initially opens -** Processing line: ~ if Kernel.global_tick_count == 0~ -- Inside source: true -*** True Line Result - if Kernel.global_tick_count == 0 -** Processing line: ~ args.gtk.console.set_command "reset_with count: 100"~ +** Processing line: ~ def tick_instructions args, text, y = 715~ - Inside source: true *** True Line Result - args.gtk.console.set_command "reset_with count: 100" -** Processing line: ~ end~ + def tick_instructions args, text, y = 715 +** Processing line: ~ return if args.state.key_event_occurred~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + return if args.state.key_event_occurred +** Processing line: ~ if args.inputs.mouse.click ||~ - Inside source: true *** True Line Result - -** Processing line: ~ # init~ + if args.inputs.mouse.click || +** Processing line: ~ args.inputs.keyboard.directional_vector ||~ - Inside source: true *** True Line Result - # init -** Processing line: ~ if args.state.tick_count == 0~ + args.inputs.keyboard.directional_vector || +** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ - Inside source: true *** True Line Result - if args.state.tick_count == 0 -** Processing line: ~ args.state.stars = args.state.star_count.map { |i| Star.new args.grid }~ + args.inputs.keyboard.key_down.enter || +** Processing line: ~ args.inputs.keyboard.key_down.escape~ - 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~ + args.inputs.keyboard.key_down.escape +** Processing line: ~ args.state.key_event_occurred = true~ - Inside source: true *** True Line Result - args.outputs.static_sprites << args.state.stars + args.state.key_event_occurred = true ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -39267,18 +42448,18 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # render framerate~ +** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ - Inside source: true *** True Line Result - # render framerate -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ + 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.background_color = [0, 0, 0] -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ + 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.primitives << args.gtk.current_framerate_primitives + 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 @@ -39287,54 +42468,30 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # resets game, and assigns star count given by user~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - # resets game, and assigns star count given by user -** Processing line: ~ def reset_with count: count~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - def reset_with count: count -** Processing line: ~ $gtk.reset~ -- Inside source: true -*** True Line Result - $gtk.reset -** Processing line: ~ $gtk.args.state.star_count = count~ -- Inside source: true -*** True Line Result - $gtk.args.state.star_count = count -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. -*** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Performance - Collision Limits - main.rb~ -- Header detected. + +** Processing line: ~*** Mouse - Mouse Move Paint App - main.rb~ +- Header detected. *** True Line Result *** True Line Result -* Performance - Collision Limits - main.rb +*** Mouse - Mouse Move Paint App - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result *** True Line Result #+begin_src ruby -** Processing line: ~ # ./samples/09_performance/07_collision_limits/app/main.rb~ +** Processing line: ~ # ./samples/05_mouse/03_mouse_move_paint_app/app/main.rb~ - Inside source: true *** True Line Result - # ./samples/09_performance/07_collision_limits/app/main.rb + # ./samples/05_mouse/03_mouse_move_paint_app/app/main.rb ** Processing line: ~ =begin~ - Inside source: true *** True Line Result @@ -39343,282 +42500,246 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ Reminders:~ -- Inside source: true -*** True Line Result - Reminders: -** Processing line: ~ - find_all: Finds all elements of a collection that meet certain requirements.~ -- Inside source: true -*** True Line Result - - find_all: Finds all elements of a collection that meet certain requirements. -** Processing line: ~ In this sample app, we're finding all bodies that intersect with the center body.~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ - Inside source: true *** True Line Result - In this sample app, we're finding all bodies that intersect with the center body. + APIs listing that haven't been encountered in previous sample apps: ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ -- Inside source: true -*** True Line Result - - args.outputs.solids: An array. The values generate a solid. -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ -- Inside source: true -*** True Line Result - The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE] -** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~ - Floor: Method that returns an integer number smaller than or equal to the original with no decimal.~ - Inside source: true *** True Line Result - For more information about solids, go to mygame/documentation/03-solids-and-borders.md. + - Floor: Method that returns an integer number smaller than or equal to the original with no decimal. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ +** Processing line: ~ For example, if we have a variable, a = 13.7, and we called floor on it, it would look like this...~ - Inside source: true *** True Line Result - - args.outputs.labels: An array. The values generate a label. -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ + For example, if we have a variable, a = 13.7, and we called floor on it, it would look like this... +** Processing line: ~ puts a.floor()~ - Inside source: true *** True Line Result - The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ + puts a.floor() +** Processing line: ~ which would print out 13.~ - Inside source: true *** True Line Result - For more information about labels, go to mygame/documentation/02-labels.md. -** Processing line: ~~ + which would print out 13. +** Processing line: ~ (There is also a ceil method, which returns an integer number greater than or equal to the original~ - Inside source: true *** True Line Result - -** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect.~ + (There is also a ceil method, which returns an integer number greater than or equal to the original +** Processing line: ~ with no decimal. If we had called ceil on the variable a, the result would have been 14.)~ - Inside source: true *** True Line Result - - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect. + with no decimal. If we had called ceil on the variable a, the result would have been 14.) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ =end~ +** Processing line: ~ Reminders:~ - Inside source: true *** True Line Result - =end + Reminders: ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # This code demonstrates moving objects that loop around once they exceed the scope of the screen,~ +** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ - Inside source: true *** True Line Result - # This code demonstrates moving objects that loop around once they exceed the scope of the screen, -** Processing line: ~ # which has dimensions of 1280 by 720, and also detects collisions between objects called "bodies".~ + - Hashes: Collection of unique keys and their corresponding values. The value can be found +** Processing line: ~ using their keys.~ - Inside source: true *** True Line Result - # which has dimensions of 1280 by 720, and also detects collisions between objects called "bodies". + using their keys. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def body_count num~ +** Processing line: ~ For example, if we have a "numbers" hash that stores numbers in English as the~ - Inside source: true *** True Line Result - def body_count num -** Processing line: ~ $gtk.args.state.other_bodies = num.map { [1280 * rand, 720 * rand, 10, 10] } # other_bodies set using num collection~ + For example, if we have a "numbers" hash that stores numbers in English as the +** Processing line: ~ key and numbers in Spanish as the value, we'd have a hash that looks like this...~ - Inside source: true *** True Line Result - $gtk.args.state.other_bodies = num.map { [1280 * rand, 720 * rand, 10, 10] } # other_bodies set using num collection -** Processing line: ~ end~ + key and numbers in Spanish as the value, we'd have a hash that looks like this... +** Processing line: ~ numbers = { "one" => "uno", "two" => "dos", "three" => "tres" }~ - Inside source: true *** True Line Result - end + numbers = { "one" => "uno", "two" => "dos", "three" => "tres" } +** Processing line: ~ and on it goes.~ +- Inside source: true +*** True Line Result + and on it goes. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ Now if we wanted to find the corresponding value of the "one" key, we could say~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~~ + Now if we wanted to find the corresponding value of the "one" key, we could say +** Processing line: ~ puts numbers["one"]~ - Inside source: true *** True Line Result - -** Processing line: ~ # Center body's values are set using an array~ + puts numbers["one"] +** Processing line: ~ which would print "uno" to the console.~ - Inside source: true *** True Line Result - # Center body's values are set using an array -** Processing line: ~ # Map is used to set values of 2000 other bodies~ + which would print "uno" to the console. +** Processing line: ~~ - Inside source: true *** True Line Result - # Map is used to set values of 2000 other bodies -** Processing line: ~ # All bodies that intersect with center body are stored in collisions collection~ + +** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ - Inside source: true *** True Line Result - # All bodies that intersect with center body are stored in collisions collection -** Processing line: ~ args.state.center_body ||= [640 - 100, 360 - 100, 200, 200] # calculations done to place body in center~ + - args.state.new_entity: Used when we want to create a new object, like a sprite or button. +** Processing line: ~ In this sample app, new_entity is used to create a new button that clears the grid.~ - Inside source: true *** True Line Result - args.state.center_body ||= [640 - 100, 360 - 100, 200, 200] # calculations done to place body in center -** Processing line: ~ args.state.other_bodies ||= 2000.map { [1280 * rand, 720 * rand, 10, 10] } # 2000 bodies given random position on screen~ + In this sample app, new_entity is used to create a new button that clears the grid. +** Processing line: ~ (Remember, you can use state to define ANY property and it will be retained across frames.)~ - Inside source: true *** True Line Result - args.state.other_bodies ||= 2000.map { [1280 * rand, 720 * rand, 10, 10] } # 2000 bodies given random position on screen + (Remember, you can use state to define ANY property and it will be retained across frames.) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # finds all bodies that intersect with center body, stores them in collisions~ -- Inside source: true -*** True Line Result - # finds all bodies that intersect with center body, stores them in collisions -** Processing line: ~ collisions = args.state.other_bodies.find_all { |b| b.intersect_rect? args.state.center_body }~ +** Processing line: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ - Inside source: true *** True Line Result - collisions = args.state.other_bodies.find_all { |b| b.intersect_rect? args.state.center_body } + - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.borders << args.state.center_body # outputs center body as a black border~ +** Processing line: ~ - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in.~ - Inside source: true *** True Line Result - args.borders << args.state.center_body # outputs center body as a black border + - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # transparency changes based on number of collisions; the more collisions, the redder (more transparent) the box becomes~ +** Processing line: ~ - args.outputs.labels: An array. The values in the array generate a label.~ - Inside source: true *** True Line Result - # transparency changes based on number of collisions; the more collisions, the redder (more transparent) the box becomes -** Processing line: ~ args.solids << [args.state.center_body, 255, 0, 0, collisions.length * 5] # center body is red solid~ + - args.outputs.labels: An array. The values in the array generate a label. +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ - Inside source: true *** True Line Result - args.solids << [args.state.center_body, 255, 0, 0, collisions.length * 5] # center body is red solid -** Processing line: ~ args.solids << args.state.other_bodies # other bodies are output as (black) solids, as well~ + The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ - Inside source: true *** True Line Result - args.solids << args.state.other_bodies # other bodies are output as (black) solids, as well + For more information about labels, go to mygame/documentation/02-labels.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.labels << [10, 30, args.gtk.current_framerate] # outputs frame rate in bottom left corner~ +** Processing line: ~ - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect.~ - Inside source: true *** True Line Result - args.labels << [10, 30, args.gtk.current_framerate] # outputs frame rate in bottom left corner + - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Bodies are returned to bottom left corner if positions exceed scope of screen~ +** Processing line: ~ =end~ - Inside source: true *** True Line Result - # Bodies are returned to bottom left corner if positions exceed scope of screen -** Processing line: ~ args.state.other_bodies.each do |b| # for each body in the other_bodies collection~ + =end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.other_bodies.each do |b| # for each body in the other_bodies collection -** Processing line: ~ b.x += 5 # x and y are both incremented by 5~ + +** Processing line: ~ # This sample app shows an empty grid that the user can paint on.~ - Inside source: true *** True Line Result - b.x += 5 # x and y are both incremented by 5 -** Processing line: ~ b.y += 5~ + # This sample app shows an empty grid that the user can paint on. +** Processing line: ~ # To paint, the user must keep their mouse presssed and drag it around the grid.~ - Inside source: true *** True Line Result - b.y += 5 -** Processing line: ~ b.x = 0 if b.x > 1280 # x becomes 0 if star exceeds scope of screen (goes too far right)~ + # To paint, the user must keep their mouse presssed and drag it around the grid. +** Processing line: ~ # The "clear" button allows users to clear the grid so they can start over.~ - Inside source: true *** True Line Result - b.x = 0 if b.x > 1280 # x becomes 0 if star exceeds scope of screen (goes too far right) -** Processing line: ~ b.y = 0 if b.y > 720 # y becomes 0 if star exceeds scope of screen (goes too far up)~ + # The "clear" button allows users to clear the grid so they can start over. +** Processing line: ~~ - Inside source: true *** True Line Result - b.y = 0 if b.y > 720 # y becomes 0 if star exceeds scope of screen (goes too far up) -** Processing line: ~ end~ + +** Processing line: ~ class PaintApp~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + class PaintApp +** Processing line: ~ attr_accessor :inputs, :state, :outputs, :grid, :args~ - Inside source: true *** True Line Result - end + attr_accessor :inputs, :state, :outputs, :grid, :args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Resets the game.~ +** Processing line: ~ # Runs methods necessary for the game to function properly.~ - Inside source: true *** True Line Result - # Resets the game. -** Processing line: ~ $gtk.reset~ + # Runs methods necessary for the game to function properly. +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~~ + def tick +** Processing line: ~ print_title~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. -*** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Advanced Debugging - Trace Debugging - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Advanced Debugging - Trace Debugging - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - + print_title +** Processing line: ~ add_grid~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/10_advanced_debugging/01_trace_debugging/app/main.rb~ + add_grid +** Processing line: ~ check_click~ - Inside source: true *** True Line Result - # ./samples/10_advanced_debugging/01_trace_debugging/app/main.rb -** Processing line: ~ class Game~ + check_click +** Processing line: ~ draw_buttons~ - Inside source: true *** True Line Result - class Game -** Processing line: ~ attr_gtk~ + draw_buttons +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_gtk + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def method1 num~ -- Inside source: true -*** True Line Result - def method1 num -** Processing line: ~ method2 num~ +** Processing line: ~ # Prints the title onto the screen by using a label.~ - Inside source: true *** True Line Result - method2 num -** Processing line: ~ end~ + # Prints the title onto the screen by using a label. +** Processing line: ~ # Also separates the title from the grid with a line as a horizontal separator.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Also separates the title from the grid with a line as a horizontal separator. +** Processing line: ~ def print_title~ - Inside source: true *** True Line Result - -** Processing line: ~ def method2 num~ + def print_title +** Processing line: ~ args.outputs.labels << [ 640, 700, 'Paint!', 0, 1 ]~ - Inside source: true *** True Line Result - def method2 num -** Processing line: ~ method3 num~ + args.outputs.labels << [ 640, 700, 'Paint!', 0, 1 ] +** Processing line: ~ outputs.lines << horizontal_separator(660, 0, 1280)~ - Inside source: true *** True Line Result - method3 num + outputs.lines << horizontal_separator(660, 0, 1280) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -39627,14 +42748,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 method3 num~ +** Processing line: ~ # Sets the starting position, ending position, and color for the horizontal separator.~ - Inside source: true *** True Line Result - def method3 num -** Processing line: ~ method4 num~ + # Sets the starting position, ending position, and color for the horizontal separator. +** Processing line: ~ # The starting and ending positions have the same y values.~ - Inside source: true *** True Line Result - method4 num + # The starting and ending positions have the same y values. +** Processing line: ~ def horizontal_separator y, x, x2~ +- Inside source: true +*** True Line Result + def horizontal_separator y, x, x2 +** Processing line: ~ [x, y, x2, y, 150, 150, 150]~ +- Inside source: true +*** True Line Result + [x, y, x2, y, 150, 150, 150] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -39643,598 +42772,530 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def method4 num~ +** Processing line: ~ # Sets the starting position, ending position, and color for the vertical separator.~ - Inside source: true *** True Line Result - def method4 num -** Processing line: ~ if num == 1~ + # Sets the starting position, ending position, and color for the vertical separator. +** Processing line: ~ # The starting and ending positions have the same x values.~ - Inside source: true *** True Line Result - if num == 1 -** Processing line: ~ puts "UNLUCKY #{num}."~ + # The starting and ending positions have the same x values. +** Processing line: ~ def vertical_separator x, y, y2~ - Inside source: true *** True Line Result - puts "UNLUCKY #{num}." -** Processing line: ~ state.unlucky_count += 1~ + def vertical_separator x, y, y2 +** Processing line: ~ [x, y, x, y2, 150, 150, 150]~ - Inside source: true *** True Line Result - state.unlucky_count += 1 -** Processing line: ~ if state.unlucky_count > 3~ + [x, y, x, y2, 150, 150, 150] +** Processing line: ~ end~ - Inside source: true *** True Line Result - if state.unlucky_count > 3 -** Processing line: ~ raise "NAT 1 finally occurred. Check app/trace.txt for all method invocation history."~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - raise "NAT 1 finally occurred. Check app/trace.txt for all method invocation history." -** Processing line: ~ end~ + +** Processing line: ~ # Outputs a border and a grid containing empty squares onto the screen.~ - Inside source: true *** True Line Result - end -** Processing line: ~ else~ + # Outputs a border and a grid containing empty squares onto the screen. +** Processing line: ~ def add_grid~ - Inside source: true *** True Line Result - else -** Processing line: ~ puts "LUCKY #{num}."~ + def add_grid +** Processing line: ~~ - Inside source: true *** True Line Result - puts "LUCKY #{num}." -** Processing line: ~ end~ + +** Processing line: ~ # Sets the x, y, height, and width of the grid.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Sets the x, y, height, and width of the grid. +** Processing line: ~ # There are 31 horizontal lines and 31 vertical lines in the grid.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # There are 31 horizontal lines and 31 vertical lines in the grid. +** Processing line: ~ # Feel free to count them yourself before continuing!~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick~ + # Feel free to count them yourself before continuing! +** Processing line: ~ x, y, h, w = 640 - 500/2, 640 - 500, 500, 500 # calculations done so the grid appears in screen's center~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ state.roll_history ||= []~ + x, y, h, w = 640 - 500/2, 640 - 500, 500, 500 # calculations done so the grid appears in screen's center +** Processing line: ~ lines_h = 31~ - Inside source: true *** True Line Result - state.roll_history ||= [] -** Processing line: ~ state.roll_history << rand(20) + 1~ + lines_h = 31 +** Processing line: ~ lines_v = 31~ - Inside source: true *** True Line Result - state.roll_history << rand(20) + 1 -** Processing line: ~ state.countdown ||= 600~ + lines_v = 31 +** Processing line: ~~ - Inside source: true *** True Line Result - state.countdown ||= 600 -** Processing line: ~ state.countdown -= 1~ + +** Processing line: ~ # Sets values for the grid's border, grid lines, and filled squares.~ - Inside source: true *** True Line Result - state.countdown -= 1 -** Processing line: ~ state.unlucky_count ||= 0~ + # Sets values for the grid's border, grid lines, and filled squares. +** Processing line: ~ # The filled_squares variable is initially set to an empty array.~ - Inside source: true *** True Line Result - state.unlucky_count ||= 0 -** Processing line: ~ outputs.labels << [640, 360, "A dice roll of 1 will cause an exception.", 0, 1]~ + # The filled_squares variable is initially set to an empty array. +** Processing line: ~ state.grid_border ||= [ x, y, h, w ] # definition of grid's outer border~ - Inside source: true *** True Line Result - outputs.labels << [640, 360, "A dice roll of 1 will cause an exception.", 0, 1] -** Processing line: ~ if state.countdown > 0~ + state.grid_border ||= [ x, y, h, w ] # definition of grid's outer border +** Processing line: ~ state.grid_lines ||= draw_grid(x, y, h, w, lines_h, lines_v) # calls draw_grid method~ - Inside source: true *** True Line Result - if state.countdown > 0 -** Processing line: ~ outputs.labels << [640, 340, "Dice roll countdown: #{state.countdown}", 0, 1]~ + state.grid_lines ||= draw_grid(x, y, h, w, lines_h, lines_v) # calls draw_grid method +** Processing line: ~ state.filled_squares ||= [] # there are no filled squares until the user fills them in~ - Inside source: true *** True Line Result - outputs.labels << [640, 340, "Dice roll countdown: #{state.countdown}", 0, 1] -** Processing line: ~ else~ + state.filled_squares ||= [] # there are no filled squares until the user fills them in +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.attempts ||= 0~ + +** Processing line: ~ # Outputs the grid lines, border, and filled squares onto the screen.~ - Inside source: true *** True Line Result - state.attempts ||= 0 -** Processing line: ~ state.attempts += 1~ + # Outputs the grid lines, border, and filled squares onto the screen. +** Processing line: ~ outputs.lines.concat state.grid_lines~ - Inside source: true *** True Line Result - state.attempts += 1 -** Processing line: ~ outputs.labels << [640, 340, "ROLLING! #{state.attempts}", 0, 1]~ + outputs.lines.concat state.grid_lines +** Processing line: ~ outputs.borders << state.grid_border~ - Inside source: true *** True Line Result - outputs.labels << [640, 340, "ROLLING! #{state.attempts}", 0, 1] -** Processing line: ~ end~ + outputs.borders << state.grid_border +** Processing line: ~ outputs.solids << state.filled_squares~ - Inside source: true *** True Line Result - end -** Processing line: ~ return if state.countdown > 0~ + outputs.solids << state.filled_squares +** Processing line: ~ end~ - Inside source: true *** True Line Result - return if state.countdown > 0 -** Processing line: ~ method1 state.roll_history[-1]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - method1 state.roll_history[-1] -** Processing line: ~ end~ + +** Processing line: ~ # Draws the grid by adding in vertical and horizontal separators.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Draws the grid by adding in vertical and horizontal separators. +** Processing line: ~ def draw_grid x, y, h, w, lines_h, lines_v~ - Inside source: true *** True Line Result - end + def draw_grid x, y, h, w, lines_h, lines_v ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ $game = Game.new~ +** Processing line: ~ # The grid starts off empty.~ - Inside source: true *** True Line Result - $game = Game.new + # The grid starts off empty. +** Processing line: ~ grid = []~ +- Inside source: true +*** True Line Result + grid = [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ # Calculates the placement and adds horizontal lines or separators into the grid.~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ trace! $game # <------------------- TRACING ENABLED FOR THIS OBJECT~ + # Calculates the placement and adds horizontal lines or separators into the grid. +** Processing line: ~ curr_y = y # start at the bottom of the box~ - Inside source: true *** True Line Result - trace! $game # <------------------- TRACING ENABLED FOR THIS OBJECT -** Processing line: ~ $game.args = args~ + curr_y = y # start at the bottom of the box +** Processing line: ~ dist_y = h / (lines_h + 1) # finds distance to place horizontal lines evenly throughout 500 height of grid~ - Inside source: true *** True Line Result - $game.args = args -** Processing line: ~ $game.tick~ + dist_y = h / (lines_h + 1) # finds distance to place horizontal lines evenly throughout 500 height of grid +** Processing line: ~ lines_h.times do~ - Inside source: true *** True Line Result - $game.tick -** Processing line: ~ end~ + lines_h.times do +** Processing line: ~ curr_y += dist_y # increment curr_y by the distance between the horizontal lines~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + curr_y += dist_y # increment curr_y by the distance between the horizontal lines +** Processing line: ~ grid << horizontal_separator(curr_y, x, x + w - 1) # add a separator into the grid~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + grid << horizontal_separator(curr_y, x, x + w - 1) # add a separator into the grid +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Advanced Debugging - Trace Debugging Classes - main.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ # Calculates the placement and adds vertical lines or separators into the grid.~ +- Inside source: true *** True Line Result -* Advanced Debugging - Trace Debugging Classes - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - + # Calculates the placement and adds vertical lines or separators into the grid. +** Processing line: ~ curr_x = x # now start at the left of the box~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/10_advanced_debugging/02_trace_debugging_classes/app/main.rb~ + curr_x = x # now start at the left of the box +** Processing line: ~ dist_x = w / (lines_v + 1) # finds distance to place vertical lines evenly throughout 500 width of grid~ - Inside source: true *** True Line Result - # ./samples/10_advanced_debugging/02_trace_debugging_classes/app/main.rb -** Processing line: ~ class Foobar~ + dist_x = w / (lines_v + 1) # finds distance to place vertical lines evenly throughout 500 width of grid +** Processing line: ~ lines_v.times do~ - Inside source: true *** True Line Result - class Foobar -** Processing line: ~ def initialize~ + lines_v.times do +** Processing line: ~ curr_x += dist_x # increment curr_x by the distance between the vertical lines~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ trace! # Trace is added to the constructor.~ + curr_x += dist_x # increment curr_x by the distance between the vertical lines +** Processing line: ~ grid << vertical_separator(curr_x, y + 1, y + h) # add separator~ - Inside source: true *** True Line Result - trace! # Trace is added to the constructor. -** Processing line: ~ end~ + grid << vertical_separator(curr_x, y + 1, y + h) # add separator +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def clicky args~ +** Processing line: ~ # paint_grid uses a hash to assign values to keys.~ - Inside source: true *** True Line Result - def clicky args -** Processing line: ~ return unless args.inputs.mouse.click~ + # paint_grid uses a hash to assign values to keys. +** Processing line: ~ state.paint_grid ||= {"x" => x, "y" => y, "h" => h, "w" => w, "lines_h" => lines_h,~ - Inside source: true *** True Line Result - return unless args.inputs.mouse.click -** Processing line: ~ try_rand rand~ + state.paint_grid ||= {"x" => x, "y" => y, "h" => h, "w" => w, "lines_h" => lines_h, +** Processing line: ~ "lines_v" => lines_v, "dist_x" => dist_x,~ - Inside source: true *** True Line Result - try_rand rand -** Processing line: ~ end~ + "lines_v" => lines_v, "dist_x" => dist_x, +** Processing line: ~ "dist_y" => dist_y }~ - Inside source: true *** True Line Result - end + "dist_y" => dist_y } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def try_rand num~ -- Inside source: true -*** True Line Result - def try_rand num -** Processing line: ~ return if num < 0.9~ -- Inside source: true -*** True Line Result - return if num < 0.9 -** Processing line: ~ raise "Exception finally occurred. Take a look at logs/trace.txt #{num}."~ +** Processing line: ~ return grid~ - Inside source: true *** True Line Result - raise "Exception finally occurred. Take a look at logs/trace.txt #{num}." + return grid ** 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~ +** Processing line: ~ # Checks if the user is keeping the mouse pressed down and sets the mouse_hold variable accordingly using boolean values.~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.labels << [640, 360, "Start clicking. Eventually an exception will be thrown. Then look at logs/trace.txt.", 0, 1]~ + # Checks if the user is keeping the mouse pressed down and sets the mouse_hold variable accordingly using boolean values. +** Processing line: ~ # If the mouse is up, the user cannot drag the mouse.~ - Inside source: true *** True Line Result - args.labels << [640, 360, "Start clicking. Eventually an exception will be thrown. Then look at logs/trace.txt.", 0, 1] -** Processing line: ~ args.state.foobar = Foobar.new if args.tick_count~ + # If the mouse is up, the user cannot drag the mouse. +** Processing line: ~ def check_click~ - Inside source: true *** True Line Result - args.state.foobar = Foobar.new if args.tick_count -** Processing line: ~ return unless args.state.foobar~ + def check_click +** Processing line: ~ if inputs.mouse.down #is mouse up or down?~ - Inside source: true *** True Line Result - return unless args.state.foobar -** Processing line: ~ args.state.foobar.clicky args~ + if inputs.mouse.down #is mouse up or down? +** Processing line: ~ state.mouse_held = true # mouse is being held down~ - Inside source: true *** True Line Result - args.state.foobar.clicky args -** Processing line: ~ end~ + state.mouse_held = true # mouse is being held down +** Processing line: ~ elsif inputs.mouse.up # if mouse is up~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif inputs.mouse.up # if mouse is up +** Processing line: ~ state.mouse_held = false # mouse is not being held down or dragged~ - 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 - -*** True Line Result -* Advanced Debugging - Unit Tests - exception_raising_tests.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + state.mouse_held = false # mouse is not being held down or dragged +** Processing line: ~ state.mouse_dragging = false~ +- Inside source: true *** True Line Result - + state.mouse_dragging = false +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/exception_raising_tests.rb~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # ./samples/10_advanced_debugging/03_unit_tests/exception_raising_tests.rb -** Processing line: ~ begin :shared~ + +** Processing line: ~ if state.mouse_held && # mouse needs to be down~ - Inside source: true *** True Line Result - begin :shared -** Processing line: ~ class ExceptionalClass~ + if state.mouse_held && # mouse needs to be down +** Processing line: ~ !inputs.mouse.click && # must not be first click~ - Inside source: true *** True Line Result - class ExceptionalClass -** Processing line: ~ def initialize exception_to_throw = nil~ + !inputs.mouse.click && # must not be first click +** Processing line: ~ ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15) # Need to move 15 pixels before "drag"~ - Inside source: true *** True Line Result - def initialize exception_to_throw = nil -** Processing line: ~ raise exception_to_throw if exception_to_throw~ + ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15) # Need to move 15 pixels before "drag" +** Processing line: ~ state.mouse_dragging = true~ - Inside source: true *** True Line Result - raise exception_to_throw if exception_to_throw + state.mouse_dragging = true ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ # If the user clicks their mouse inside the grid, the search_lines method is called with a click input type.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # If the user clicks their mouse inside the grid, the search_lines method is called with a click input type. +** Processing line: ~ if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border))~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_exception_in_newing_object args, assert~ + if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border)) +** Processing line: ~ search_lines(inputs.mouse.click.point, :click)~ - Inside source: true *** True Line Result - def test_exception_in_newing_object args, assert -** Processing line: ~ begin~ + search_lines(inputs.mouse.click.point, :click) +** Processing line: ~~ - Inside source: true *** True Line Result - begin -** Processing line: ~ ExceptionalClass.new TypeError~ + +** Processing line: ~ # If the user drags their mouse inside the grid, the search_lines method is called with a drag input type.~ - Inside source: true *** True Line Result - ExceptionalClass.new TypeError -** Processing line: ~ raise "Exception wasn't thrown!"~ + # If the user drags their mouse inside the grid, the search_lines method is called with a drag input type. +** Processing line: ~ elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border))~ - Inside source: true *** True Line Result - raise "Exception wasn't thrown!" -** Processing line: ~ rescue Exception => e~ + elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border)) +** Processing line: ~ search_lines(inputs.mouse.position, :drag)~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ assert.equal! e.class, TypeError, "Exceptions within constructor should be retained."~ + search_lines(inputs.mouse.position, :drag) +** Processing line: ~ end~ - Inside source: true *** True Line Result - assert.equal! e.class, TypeError, "Exceptions within constructor should be retained." + 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: ~ puts "running tests"~ +** Processing line: ~ # Sets the definition of a grid box and handles user input to fill in or clear grid boxes.~ - Inside source: true *** True Line Result - puts "running tests" -** Processing line: ~ $gtk.reset 100~ + # Sets the definition of a grid box and handles user input to fill in or clear grid boxes. +** Processing line: ~ def search_lines (point, input_type)~ - Inside source: true *** True Line Result - $gtk.reset 100 -** Processing line: ~ $gtk.log_level = :off~ + def search_lines (point, input_type) +** Processing line: ~ point.x -= state.paint_grid["x"] # subtracts the value assigned to the "x" key in the paint_grid hash~ - Inside source: true *** True Line Result - $gtk.log_level = :off -** Processing line: ~ $gtk.tests.start~ + point.x -= state.paint_grid["x"] # subtracts the value assigned to the "x" key in the paint_grid hash +** Processing line: ~ point.y -= state.paint_grid["y"] # subtracts the value assigned to the "y" key in the paint_grid hash~ - Inside source: true *** True Line Result - $gtk.tests.start + point.y -= state.paint_grid["y"] # subtracts the value assigned to the "y" key in the paint_grid hash ** 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 - gen_docs.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Advanced Debugging - Unit Tests - gen_docs.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/gen_docs.rb~ +** Processing line: ~ # Remove code following the .floor and see what happens when you try to fill in grid squares~ - Inside source: true *** True Line Result - # ./samples/10_advanced_debugging/03_unit_tests/gen_docs.rb -** Processing line: ~ # sh ./amir-build-and-run.sh --eval samples/99_zz_gtk_unit_tests/gen_docs.rb --no-tick~ + # Remove code following the .floor and see what happens when you try to fill in grid squares +** Processing line: ~ point.x = (point.x / state.paint_grid["dist_x"]).floor * state.paint_grid["dist_x"]~ - Inside source: true *** True Line Result - # sh ./amir-build-and-run.sh --eval samples/99_zz_gtk_unit_tests/gen_docs.rb --no-tick -** Processing line: ~ Kernel.export_docs!~ + point.x = (point.x / state.paint_grid["dist_x"]).floor * state.paint_grid["dist_x"] +** Processing line: ~ point.y = (point.y / state.paint_grid["dist_y"]).floor * state.paint_grid["dist_y"]~ - Inside source: true *** True Line Result - Kernel.export_docs! + point.y = (point.y / state.paint_grid["dist_y"]).floor * state.paint_grid["dist_y"] ** 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 - geometry_tests.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Advanced Debugging - Unit Tests - geometry_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/geometry_tests.rb~ +** Processing line: ~ point.x += state.paint_grid["x"]~ - Inside source: true *** True Line Result - # ./samples/10_advanced_debugging/03_unit_tests/geometry_tests.rb -** Processing line: ~ begin :shared~ + point.x += state.paint_grid["x"] +** Processing line: ~ point.y += state.paint_grid["y"]~ - Inside source: true *** True Line Result - begin :shared -** Processing line: ~ def primitive_representations x, y, w, h~ + point.y += state.paint_grid["y"] +** Processing line: ~~ - Inside source: true *** True Line Result - def primitive_representations x, y, w, h -** Processing line: ~ [~ + +** Processing line: ~ # Sets definition of a grid box, meaning its x, y, width, and height.~ - Inside source: true *** True Line Result - [ -** Processing line: ~ [x, y, w, h],~ + # Sets definition of a grid box, meaning its x, y, width, and height. +** Processing line: ~ # Floor is called on the point.x and point.y variables.~ - Inside source: true *** True Line Result - [x, y, w, h], -** Processing line: ~ { x: x, y: y, w: w, h: h },~ + # Floor is called on the point.x and point.y variables. +** Processing line: ~ # Ceil method is called on values of the distance hash keys, setting the width and height of a box.~ - Inside source: true *** True Line Result - { x: x, y: y, w: w, h: h }, -** Processing line: ~ RectForTest.new(x, y, w, h)~ + # Ceil method is called on values of the distance hash keys, setting the width and height of a box. +** Processing line: ~ grid_box = [ point.x.floor, point.y.floor, state.paint_grid["dist_x"].ceil, state.paint_grid["dist_y"].ceil ]~ - Inside source: true *** True Line Result - RectForTest.new(x, y, w, h) -** Processing line: ~ ]~ + grid_box = [ point.x.floor, point.y.floor, state.paint_grid["dist_x"].ceil, state.paint_grid["dist_y"].ceil ] +** Processing line: ~~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + +** Processing line: ~ if input_type == :click # if user clicks their mouse~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if input_type == :click # if user clicks their mouse +** Processing line: ~ if state.filled_squares.include? grid_box # if grid box is already filled in~ - Inside source: true *** True Line Result - -** Processing line: ~ class RectForTest~ + if state.filled_squares.include? grid_box # if grid box is already filled in +** Processing line: ~ state.filled_squares.delete grid_box # box is cleared and removed from filled_squares~ - Inside source: true *** True Line Result - class RectForTest -** Processing line: ~ attr_sprite~ + state.filled_squares.delete grid_box # box is cleared and removed from filled_squares +** Processing line: ~ else~ - Inside source: true *** True Line Result - attr_sprite -** Processing line: ~~ + else +** Processing line: ~ state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize x, y, w, h~ + state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares +** Processing line: ~ end~ - Inside source: true *** True Line Result - def initialize x, y, w, h -** Processing line: ~ @x = x~ + end +** Processing line: ~ elsif input_type == :drag # if user drags mouse~ - Inside source: true *** True Line Result - @x = x -** Processing line: ~ @y = y~ + elsif input_type == :drag # if user drags mouse +** Processing line: ~ unless state.filled_squares.include? grid_box # unless the grid box dragged over is already filled in~ - Inside source: true *** True Line Result - @y = y -** Processing line: ~ @w = w~ + unless state.filled_squares.include? grid_box # unless the grid box dragged over is already filled in +** Processing line: ~ state.filled_squares << grid_box # the box is filled in and added to filled_squares~ - Inside source: true *** True Line Result - @w = w -** Processing line: ~ @h = h~ + state.filled_squares << grid_box # the box is filled in and added to filled_squares +** Processing line: ~ end~ - Inside source: true *** True Line Result - @h = h + 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 to_s~ +** Processing line: ~ # Creates and outputs a "Clear" button on the screen using a label and a border.~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ "RectForTest: #{[x, y, w, h]}"~ + # Creates and outputs a "Clear" button on the screen using a label and a border. +** Processing line: ~ # If the button is clicked, the filled squares are cleared, making the filled_squares collection empty.~ - Inside source: true *** True Line Result - "RectForTest: #{[x, y, w, h]}" -** Processing line: ~ end~ + # If the button is clicked, the filled squares are cleared, making the filled_squares collection empty. +** Processing line: ~ def draw_buttons~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def draw_buttons +** Processing line: ~ x, y, w, h = 390, 50, 240, 50~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + x, y, w, h = 390, 50, 240, 50 +** Processing line: ~ state.clear_button ||= state.new_entity(:button_with_fade)~ - Inside source: true *** True Line Result - end + state.clear_button ||= state.new_entity(:button_with_fade) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ begin :intersect_rect?~ +** Processing line: ~ # The x and y positions are set to display the label in the center of the button.~ - Inside source: true *** True Line Result - begin :intersect_rect? -** Processing line: ~ def test_intersect_rect_point args, assert~ + # The x and y positions are set to display the label in the center of the button. +** Processing line: ~ # Try changing the first two parameters to simply x, y and see what happens to the text placement!~ - Inside source: true *** True Line Result - def test_intersect_rect_point args, assert -** Processing line: ~ assert.true! [16, 13].intersect_rect?([13, 12, 4, 4]), "point intersects with rect."~ + # Try changing the first two parameters to simply x, y and see what happens to the text placement! +** Processing line: ~ state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] # placed in center of border~ - Inside source: true *** True Line Result - assert.true! [16, 13].intersect_rect?([13, 12, 4, 4]), "point intersects with rect." -** Processing line: ~ end~ + state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] # placed in center of border +** Processing line: ~ state.clear_button.border ||= [x, y, w, h]~ - Inside source: true *** True Line Result - end + state.clear_button.border ||= [x, y, w, h] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_intersect_rect args, assert~ -- Inside source: true -*** True Line Result - def test_intersect_rect args, assert -** Processing line: ~ intersecting = primitive_representations(0, 0, 100, 100) +~ +** Processing line: ~ # If the mouse is clicked inside the borders of the clear button,~ - Inside source: true *** True Line Result - intersecting = primitive_representations(0, 0, 100, 100) + -** Processing line: ~ primitive_representations(20, 20, 20, 20)~ + # If the mouse is clicked inside the borders of the clear button, +** Processing line: ~ # the filled_squares collection is emptied and the squares are cleared.~ - Inside source: true *** True Line Result - primitive_representations(20, 20, 20, 20) -** Processing line: ~~ + # the filled_squares collection is emptied and the squares are cleared. +** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border)~ - Inside source: true *** True Line Result - -** Processing line: ~ intersecting.product(intersecting).each do |rect_one, rect_two|~ + if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border) +** Processing line: ~ state.clear_button.clicked_at = inputs.mouse.click.created_at # time (frame) the click occurred~ - Inside source: true *** True Line Result - intersecting.product(intersecting).each do |rect_one, rect_two| -** Processing line: ~ assert.true! rect_one.intersect_rect?(rect_two),~ + state.clear_button.clicked_at = inputs.mouse.click.created_at # time (frame) the click occurred +** Processing line: ~ state.filled_squares.clear~ - Inside source: true *** True Line Result - assert.true! rect_one.intersect_rect?(rect_two), -** Processing line: ~ "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected true)."~ + state.filled_squares.clear +** Processing line: ~ inputs.mouse.previous_click = nil~ - Inside source: true *** True Line Result - "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected true)." + inputs.mouse.previous_click = nil ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -40243,50 +43304,38 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ not_intersecting = [~ -- Inside source: true -*** True Line Result - not_intersecting = [ -** Processing line: ~ [ 0, 0, 5, 5],~ -- Inside source: true -*** True Line Result - [ 0, 0, 5, 5], -** Processing line: ~ { x: 10, y: 10, w: 5, h: 5 },~ -- Inside source: true -*** True Line Result - { x: 10, y: 10, w: 5, h: 5 }, -** Processing line: ~ RectForTest.new(20, 20, 5, 5)~ +** Processing line: ~ outputs.labels << state.clear_button.label~ - Inside source: true *** True Line Result - RectForTest.new(20, 20, 5, 5) -** Processing line: ~ ]~ + outputs.labels << state.clear_button.label +** Processing line: ~ outputs.borders << state.clear_button.border~ - Inside source: true *** True Line Result - ] + outputs.borders << state.clear_button.border ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ not_intersecting.product(not_intersecting)~ +** Processing line: ~ # When the clear button is clicked, the color of the button changes~ - Inside source: true *** True Line Result - not_intersecting.product(not_intersecting) -** Processing line: ~ .reject { |rect_one, rect_two| rect_one == rect_two }~ + # When the clear button is clicked, the color of the button changes +** Processing line: ~ # and the transparency changes, as well. If you change the time from~ - Inside source: true *** True Line Result - .reject { |rect_one, rect_two| rect_one == rect_two } -** Processing line: ~ .each do |rect_one, rect_two|~ + # and the transparency changes, as well. If you change the time from +** Processing line: ~ # 0.25.seconds to 1.25.seconds or more, the change will last longer.~ - Inside source: true *** True Line Result - .each do |rect_one, rect_two| -** Processing line: ~ assert.false! rect_one.intersect_rect?(rect_two),~ + # 0.25.seconds to 1.25.seconds or more, the change will last longer. +** Processing line: ~ if state.clear_button.clicked_at~ - Inside source: true *** True Line Result - assert.false! rect_one.intersect_rect?(rect_two), -** Processing line: ~ "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected false)."~ + if state.clear_button.clicked_at +** Processing line: ~ outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)]~ - Inside source: true *** True Line Result - "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected false)." + outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -40303,66 +43352,46 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ begin :inside_rect?~ -- Inside source: true -*** True Line Result - begin :inside_rect? -** Processing line: ~ def assert_inside_rect outer: nil, inner: nil, expected: nil, assert: nil~ -- Inside source: true -*** True Line Result - def assert_inside_rect outer: nil, inner: nil, expected: nil, assert: nil -** Processing line: ~ assert.true! inner.inside_rect?(outer) == expected,~ -- Inside source: true -*** True Line Result - assert.true! inner.inside_rect?(outer) == expected, -** Processing line: ~ "inside_rect? assertion failed for outer: #{outer} inner: #{inner} (expected #{expected})."~ -- Inside source: true -*** True Line Result - "inside_rect? assertion failed for outer: #{outer} inner: #{inner} (expected #{expected})." -** Processing line: ~ end~ +** Processing line: ~ $paint_app = PaintApp.new~ - Inside source: true *** True Line Result - end + $paint_app = PaintApp.new ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_inside_rect args, assert~ -- Inside source: true -*** True Line Result - def test_inside_rect args, assert -** Processing line: ~ outer_rects = primitive_representations(0, 0, 10, 10)~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - outer_rects = primitive_representations(0, 0, 10, 10) -** Processing line: ~ inner_rects = primitive_representations(1, 1, 5, 5)~ + def tick args +** Processing line: ~ $paint_app.inputs = args.inputs~ - Inside source: true *** True Line Result - inner_rects = primitive_representations(1, 1, 5, 5) -** Processing line: ~ primitive_representations(0, 0, 10, 10).product(primitive_representations(1, 1, 5, 5))~ + $paint_app.inputs = args.inputs +** Processing line: ~ $paint_app.state = args.state~ - Inside source: true *** True Line Result - primitive_representations(0, 0, 10, 10).product(primitive_representations(1, 1, 5, 5)) -** Processing line: ~ .each do |outer, inner|~ + $paint_app.state = args.state +** Processing line: ~ $paint_app.grid = args.grid~ - Inside source: true *** True Line Result - .each do |outer, inner| -** Processing line: ~ assert_inside_rect outer: outer, inner: inner,~ + $paint_app.grid = args.grid +** Processing line: ~ $paint_app.args = args~ - Inside source: true *** True Line Result - assert_inside_rect outer: outer, inner: inner, -** Processing line: ~ expected: true, assert: assert~ + $paint_app.args = args +** Processing line: ~ $paint_app.outputs = args.outputs~ - Inside source: true *** True Line Result - expected: true, assert: assert -** Processing line: ~ end~ + $paint_app.outputs = args.outputs +** Processing line: ~ $paint_app.tick~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + $paint_app.tick +** Processing line: ~ tick_instructions args, "How to create a simple paint app. CLICK and HOLD to draw."~ - Inside source: true *** True Line Result - end + tick_instructions args, "How to create a simple paint app. CLICK and HOLD to draw." ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -40371,362 +43400,346 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ begin :angle_to~ -- Inside source: true -*** True Line Result - begin :angle_to -** Processing line: ~ def test_angle_to args, assert~ +** Processing line: ~ def tick_instructions args, text, y = 715~ - Inside source: true *** True Line Result - def test_angle_to args, assert -** Processing line: ~ origins = primitive_representations(0, 0, 0, 0)~ + def tick_instructions args, text, y = 715 +** Processing line: ~ return if args.state.key_event_occurred~ - Inside source: true *** True Line Result - origins = primitive_representations(0, 0, 0, 0) -** Processing line: ~ rights = primitive_representations(1, 0, 0, 0)~ + return if args.state.key_event_occurred +** Processing line: ~ if args.inputs.mouse.click ||~ - Inside source: true *** True Line Result - rights = primitive_representations(1, 0, 0, 0) -** Processing line: ~ aboves = primitive_representations(0, 1, 0, 0)~ + if args.inputs.mouse.click || +** Processing line: ~ args.inputs.keyboard.directional_vector ||~ - Inside source: true *** True Line Result - aboves = primitive_representations(0, 1, 0, 0) -** Processing line: ~~ + args.inputs.keyboard.directional_vector || +** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ - Inside source: true *** True Line Result - -** Processing line: ~ origins.product(aboves).each do |origin, above|~ + args.inputs.keyboard.key_down.enter || +** Processing line: ~ args.inputs.keyboard.key_down.escape~ - Inside source: true *** True Line Result - origins.product(aboves).each do |origin, above| -** Processing line: ~ assert.equal! origin.angle_to(above), 90,~ + args.inputs.keyboard.key_down.escape +** Processing line: ~ args.state.key_event_occurred = true~ - Inside source: true *** True Line Result - assert.equal! origin.angle_to(above), 90, -** Processing line: ~ "A point directly above should be 90 degrees."~ + args.state.key_event_occurred = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - "A point directly above should be 90 degrees." + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ assert.equal! above.angle_from(origin), 90,~ +** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ - Inside source: true *** True Line Result - assert.equal! above.angle_from(origin), 90, -** Processing line: ~ "A point coming from above should be 90 degrees."~ + 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 - "A point coming from above should be 90 degrees." -** Processing line: ~ end~ + 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 - end + 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: ~ origins.product(rights).each do |origin, right|~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - origins.product(rights).each do |origin, right| -** Processing line: ~ assert.equal! origin.angle_to(right) % 360, 0,~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - assert.equal! origin.angle_to(right) % 360, 0, -** Processing line: ~ "A point directly to the right should be 0 degrees."~ -- Inside source: true + +** Processing line: ~*** Mouse - Coordinate Systems - main.rb~ +- Header detected. *** True Line Result - "A point directly to the right should be 0 degrees." -** Processing line: ~~ -- Inside source: true + +*** True Line Result +*** Mouse - Coordinate Systems - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ assert.equal! right.angle_from(origin) % 360, 0,~ +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/05_mouse/04_coordinate_systems/app/main.rb~ - Inside source: true *** True Line Result - assert.equal! right.angle_from(origin) % 360, 0, -** Processing line: ~ "A point coming from the right should be 0 degrees."~ + # ./samples/05_mouse/04_coordinate_systems/app/main.rb +** Processing line: ~ =begin~ - Inside source: true *** True Line Result - "A point coming from the right should be 0 degrees." + =begin ** 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~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ - Inside source: true *** True Line Result - end + APIs listing that haven't been encountered in previous sample apps: ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ begin :scale_rect~ +** Processing line: ~ - args.inputs.mouse.click.position: Coordinates of the mouse's position on the screen.~ - Inside source: true *** True Line Result - begin :scale_rect -** Processing line: ~ def test_scale_rect args, assert~ + - args.inputs.mouse.click.position: Coordinates of the mouse's position on the screen. +** Processing line: ~ Unlike args.inputs.mouse.click.point, the mouse does not need to be pressed down for~ - Inside source: true *** True Line Result - def test_scale_rect args, assert -** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect(0.5, 0.5),~ + Unlike args.inputs.mouse.click.point, the mouse does not need to be pressed down for +** Processing line: ~ position to know the mouse's coordinates.~ - Inside source: true *** True Line Result - assert.equal! [0, 0, 100, 100].scale_rect(0.5, 0.5), -** Processing line: ~ [25.0, 25.0, 50.0, 50.0]~ + position to know the mouse's coordinates. +** Processing line: ~ For more information about the mouse, go to mygame/documentation/07-mouse.md.~ - Inside source: true *** True Line Result - [25.0, 25.0, 50.0, 50.0] + For more information about the mouse, go to mygame/documentation/07-mouse.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect(0.5),~ -- Inside source: true -*** True Line Result - assert.equal! [0, 0, 100, 100].scale_rect(0.5), -** Processing line: ~ [0.0, 0.0, 50.0, 50.0]~ +** Processing line: ~ Reminders:~ - Inside source: true *** True Line Result - [0.0, 0.0, 50.0, 50.0] + Reminders: ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0.5, anchor_y: 0.5),~ +** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ - Inside source: true *** True Line Result - assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0.5, anchor_y: 0.5), -** Processing line: ~ [25.0, 25.0, 50.0, 50.0]~ -- Inside source: true -*** True Line Result - [25.0, 25.0, 50.0, 50.0] + - args.inputs.mouse.click: This property will be set if the mouse was clicked. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0, anchor_y: 0),~ +** Processing line: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ - Inside source: true *** True Line Result - assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0, anchor_y: 0), -** Processing line: ~ [0.0, 0.0, 50.0, 50.0]~ + - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse. +** Processing line: ~~ - Inside source: true *** True Line Result - [0.0, 0.0, 50.0, 50.0] -** Processing line: ~ end~ + +** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ - Inside source: true *** True Line Result - end + as Ruby code, and the placeholder is replaced with its corresponding value or result. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ puts "running tests"~ +** Processing line: ~ In this sample app, string interpolation is used to show the current position of the mouse~ - Inside source: true *** True Line Result - puts "running tests" -** Processing line: ~ $gtk.reset 100~ + In this sample app, string interpolation is used to show the current position of the mouse +** Processing line: ~ in a label.~ - Inside source: true *** True Line Result - $gtk.reset 100 -** Processing line: ~ $gtk.log_level = :off~ + in a label. +** Processing line: ~~ - Inside source: true *** True Line Result - $gtk.log_level = :off -** Processing line: ~ $gtk.tests.start~ + +** Processing line: ~ - args.outputs.labels: An array that generates a label.~ - Inside source: true *** True Line Result - $gtk.tests.start -** Processing line: ~~ + - args.outputs.labels: An array that generates a label. +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +- Inside source: true *** True Line Result -#+end_src + For more information about labels, go to mygame/documentation/02-labels.md. ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Advanced Debugging - Unit Tests - http_tests.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Advanced Debugging - Unit Tests - http_tests.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/http_tests.rb~ +** Processing line: ~ - args.outputs.solids: An array that generates a solid.~ - Inside source: true *** True Line Result - # ./samples/10_advanced_debugging/03_unit_tests/http_tests.rb -** Processing line: ~ def try_assert_or_schedule args, assert~ + - args.outputs.solids: An array that generates a solid. +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ - Inside source: true *** True Line Result - def try_assert_or_schedule args, assert -** Processing line: ~ if $result[:complete]~ + The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] +** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ - Inside source: true *** True Line Result - if $result[:complete] -** Processing line: ~ log_info "Request completed! Verifying."~ + For more information about solids, go to mygame/documentation/03-solids-and-borders.md. +** Processing line: ~~ - Inside source: true *** True Line Result - log_info "Request completed! Verifying." -** Processing line: ~ if $result[:http_response_code] != 200~ + +** Processing line: ~ - args.outputs.lines: An array that generates a line.~ - Inside source: true *** True Line Result - if $result[:http_response_code] != 200 -** Processing line: ~ log_info "The request yielded a result of #{$result[:http_response_code]} instead of 200."~ + - args.outputs.lines: An array that generates a line. +** Processing line: ~ The parameters are [X, Y, X2, Y2, RED, GREEN, BLUE, ALPHA]~ - Inside source: true *** True Line Result - log_info "The request yielded a result of #{$result[:http_response_code]} instead of 200." -** Processing line: ~ exit~ + The parameters are [X, Y, X2, Y2, RED, GREEN, BLUE, ALPHA] +** Processing line: ~ For more information about lines, go to mygame/documentation/04-lines.md.~ - Inside source: true *** True Line Result - exit -** Processing line: ~ end~ + For more information about lines, go to mygame/documentation/04-lines.md. +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ log_info ":try_assert_or_schedule succeeded!"~ + +** Processing line: ~ =end~ - Inside source: true *** True Line Result - log_info ":try_assert_or_schedule succeeded!" -** Processing line: ~ else~ + =end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ args.gtk.schedule_callback Kernel.tick_count + 10 do~ + +** Processing line: ~ # This sample app shows a coordinate system or grid. The user can move their mouse around the screen and the~ - Inside source: true *** True Line Result - args.gtk.schedule_callback Kernel.tick_count + 10 do -** Processing line: ~ try_assert_or_schedule args, assert~ + # This sample app shows a coordinate system or grid. The user can move their mouse around the screen and the +** Processing line: ~ # coordinates of their position on the screen will be displayed. Users can choose to view one quadrant or~ - Inside source: true *** True Line Result - try_assert_or_schedule args, assert -** Processing line: ~ end~ + # coordinates of their position on the screen will be displayed. Users can choose to view one quadrant or +** Processing line: ~ # four quadrants by pressing the button.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # four quadrants by pressing the button. +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - end + def tick args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_http args, assert~ +** Processing line: ~ # The addition and subtraction in the first two parameters of the label and solid~ - Inside source: true *** True Line Result - def test_http args, assert -** Processing line: ~ $result = $gtk.http_get 'http://dragonruby.org'~ + # The addition and subtraction in the first two parameters of the label and solid +** Processing line: ~ # ensure that the outputs don't overlap each other. Try removing them and see what happens.~ - Inside source: true *** True Line Result - $result = $gtk.http_get 'http://dragonruby.org' -** Processing line: ~ try_assert_or_schedule args, assert~ + # ensure that the outputs don't overlap each other. Try removing them and see what happens. +** Processing line: ~ pos = args.inputs.mouse.position # stores coordinates of mouse's position~ - Inside source: true *** True Line Result - try_assert_or_schedule args, assert -** Processing line: ~ end~ + pos = args.inputs.mouse.position # stores coordinates of mouse's position +** Processing line: ~ args.outputs.labels << [pos.x + 10, pos.y + 10, "#{pos}"] # outputs label of coordinates~ - Inside source: true *** True Line Result - end + args.outputs.labels << [pos.x + 10, pos.y + 10, "#{pos}"] # outputs label of coordinates +** Processing line: ~ args.outputs.solids << [pos.x - 2, pos.y - 2, 5, 5] # outputs small blackk box placed where mouse is hovering~ +- Inside source: true +*** True Line Result + args.outputs.solids << [pos.x - 2, pos.y - 2, 5, 5] # outputs small blackk box placed where mouse is hovering ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ puts "running tests"~ +** Processing line: ~ button = [0, 0, 370, 50] # sets definition of toggle button~ - Inside source: true *** True Line Result - puts "running tests" -** Processing line: ~ $gtk.reset 100~ + button = [0, 0, 370, 50] # sets definition of toggle button +** Processing line: ~ args.outputs.borders << button # outputs button as border (not filled in)~ - Inside source: true *** True Line Result - $gtk.reset 100 -** Processing line: ~ $gtk.log_level = :off~ + args.outputs.borders << button # outputs button as border (not filled in) +** Processing line: ~ args.outputs.labels << [10, 35, "click here toggle coordinate system"] # label of button~ - Inside source: true *** True Line Result - $gtk.log_level = :off -** Processing line: ~ $gtk.tests.start~ + args.outputs.labels << [10, 35, "click here toggle coordinate system"] # label of button +** Processing line: ~ args.outputs.lines << [ 0, -720, 0, 720] # vertical line dividing quadrants~ - Inside source: true *** True Line Result - $gtk.tests.start -** Processing line: ~~ + args.outputs.lines << [ 0, -720, 0, 720] # vertical line dividing quadrants +** Processing line: ~ args.outputs.lines << [-1280, 0, 1280, 0] # horizontal line dividing quadrants~ - 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 + args.outputs.lines << [-1280, 0, 1280, 0] # horizontal line dividing quadrants ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Advanced Debugging - Unit Tests - object_to_primitive_tests.rb~ -- Header detected. +** Processing line: ~ if args.inputs.mouse.click # if the user clicks the mouse~ +- Inside source: true *** True Line Result - + if args.inputs.mouse.click # if the user clicks the mouse +** Processing line: ~ pos = args.inputs.mouse.click.point # pos's value is point where user clicked (coordinates)~ +- Inside source: true *** True Line Result -* Advanced Debugging - Unit Tests - object_to_primitive_tests.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + pos = args.inputs.mouse.click.point # pos's value is point where user clicked (coordinates) +** Processing line: ~ if pos.inside_rect? button # if the click occurred inside the button~ +- Inside source: true *** True Line Result - + if pos.inside_rect? button # if the click occurred inside the button +** Processing line: ~ if args.grid.name == :bottom_left # if the grid shows bottom left as origin~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/object_to_primitive_tests.rb~ + if args.grid.name == :bottom_left # if the grid shows bottom left as origin +** Processing line: ~ args.grid.origin_center! # origin will be shown in center~ - Inside source: true *** True Line Result - # ./samples/10_advanced_debugging/03_unit_tests/object_to_primitive_tests.rb -** Processing line: ~ class PlayerSpriteForTest~ + args.grid.origin_center! # origin will be shown in center +** Processing line: ~ else~ - Inside source: true *** True Line Result - class PlayerSpriteForTest -** Processing line: ~ end~ + else +** Processing line: ~ args.grid.origin_bottom_left! # otherwise, the view will change to show bottom left as origin~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.grid.origin_bottom_left! # otherwise, the view will change to show bottom left as origin +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_array_to_sprite args, assert~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - def test_array_to_sprite args, assert -** Processing line: ~ array = [[0, 0, 100, 100, "test.png"]].sprites~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - array = [[0, 0, 100, 100, "test.png"]].sprites -** Processing line: ~ puts "No exception was thrown. Sweet!"~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - puts "No exception was thrown. Sweet!" + +** Processing line: ~ tick_instructions args, "Sample app shows the two supported coordinate systems in Game Toolkit."~ +- Inside source: true +*** True Line Result + tick_instructions args, "Sample app shows the two supported coordinate systems in Game Toolkit." ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -40735,42 +43748,58 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def test_class_to_sprite args, assert~ +** Processing line: ~ def tick_instructions args, text, y = 715~ - Inside source: true *** True Line Result - def test_class_to_sprite args, assert -** Processing line: ~ array = [PlayerSprite.new].sprites~ + def tick_instructions args, text, y = 715 +** Processing line: ~ return if args.state.key_event_occurred~ - Inside source: true *** True Line Result - array = [PlayerSprite.new].sprites -** Processing line: ~ assert.true! array.first.is_a?(PlayerSprite)~ + return if args.state.key_event_occurred +** Processing line: ~ if args.inputs.mouse.click ||~ - Inside source: true *** True Line Result - assert.true! array.first.is_a?(PlayerSprite) -** Processing line: ~ puts "No exception was thrown. Sweet!"~ + if args.inputs.mouse.click || +** Processing line: ~ args.inputs.keyboard.directional_vector ||~ - Inside source: true *** True Line Result - puts "No exception was thrown. Sweet!" -** Processing line: ~ end~ + args.inputs.keyboard.directional_vector || +** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ - Inside source: true *** True Line Result - end + args.inputs.keyboard.key_down.enter || +** 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: ~ $gtk.reset 100~ +** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ - Inside source: true *** True Line Result - $gtk.reset 100 -** Processing line: ~ $gtk.log_level = :off~ + 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 - $gtk.log_level = :off -** Processing line: ~ $gtk.tests.start~ + 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 - $gtk.tests.start + 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 @@ -40783,278 +43812,254 @@ 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 - parsing_tests.rb~ +** Processing line: ~*** Save Load - Save Load Game - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Advanced Debugging - Unit Tests - parsing_tests.rb +*** Save Load - Save Load Game - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result *** True Line Result #+begin_src ruby -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/parsing_tests.rb~ -- Inside source: true -*** True Line Result - # ./samples/10_advanced_debugging/03_unit_tests/parsing_tests.rb -** Processing line: ~ def test_parse_json args, assert~ +** Processing line: ~ # ./samples/06_save_load/01_save_load_game/app/main.rb~ - Inside source: true *** True Line Result - def test_parse_json args, assert -** Processing line: ~ result = args.gtk.parse_json '{ "name": "John Doe", "aliases": ["JD"] }'~ + # ./samples/06_save_load/01_save_load_game/app/main.rb +** Processing line: ~ =begin~ - Inside source: true *** True Line Result - result = args.gtk.parse_json '{ "name": "John Doe", "aliases": ["JD"] }' -** Processing line: ~ assert.equal! result, { "name"=>"John Doe", "aliases"=>["JD"] }, "Parsing JSON failed."~ + =begin +** Processing line: ~~ - Inside source: true *** True Line Result - assert.equal! result, { "name"=>"John Doe", "aliases"=>["JD"] }, "Parsing JSON failed." -** Processing line: ~ end~ + +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ - Inside source: true *** True Line Result - end + APIs listing that haven't been encountered in previous sample apps: ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_parse_xml args, assert~ +** Processing line: ~ - Symbol (:): Ruby object with a name and an internal ID. Symbols are useful~ - Inside source: true *** True Line Result - def test_parse_xml args, assert -** Processing line: ~ result = args.gtk.parse_xml <<-S~ + - Symbol (:): Ruby object with a name and an internal ID. Symbols are useful +** Processing line: ~ because with a given symbol name, you can refer to the same object throughout~ - Inside source: true *** True Line Result - result = args.gtk.parse_xml <<-S -** Processing line: ~ ~ + because with a given symbol name, you can refer to the same object throughout +** Processing line: ~ a Ruby program.~ - Inside source: true *** True Line Result - -** Processing line: ~ John Doe~ + a Ruby program. +** Processing line: ~~ - Inside source: true *** True Line Result - John Doe -** Processing line: ~ ~ + +** Processing line: ~ In this sample app, we're using symbols for our buttons. We have buttons that~ - Inside source: true *** True Line Result - -** Processing line: ~ S~ + In this sample app, we're using symbols for our buttons. We have buttons that +** Processing line: ~ light fires, save, load, etc. Each of these buttons has a distinct symbol like~ - Inside source: true *** True Line Result - S + light fires, save, load, etc. Each of these buttons has a distinct symbol like +** Processing line: ~ :light_fire, :save_game, :load_game, etc.~ +- Inside source: true +*** True Line Result + :light_fire, :save_game, :load_game, etc. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ expected = {:type=>:element,~ +** Processing line: ~ - to_sym: Returns the symbol corresponding to the given string; creates the symbol~ - Inside source: true *** True Line Result - expected = {:type=>:element, -** Processing line: ~ :name=>nil,~ + - to_sym: Returns the symbol corresponding to the given string; creates the symbol +** Processing line: ~ if it does not already exist.~ - Inside source: true *** True Line Result - :name=>nil, -** Processing line: ~ :children=>[{:type=>:element,~ + if it does not already exist. +** Processing line: ~ For example,~ - Inside source: true *** True Line Result - :children=>[{:type=>:element, -** Processing line: ~ :name=>"Person",~ + For example, +** Processing line: ~ 'car'.to_sym~ - Inside source: true *** True Line Result - :name=>"Person", -** Processing line: ~ :children=>[{:type=>:element,~ + 'car'.to_sym +** Processing line: ~ would return the symbol :car.~ - Inside source: true *** True Line Result - :children=>[{:type=>:element, -** Processing line: ~ :name=>"Name",~ + would return the symbol :car. +** Processing line: ~~ - Inside source: true *** True Line Result - :name=>"Name", -** Processing line: ~ :children=>[{:type=>:content,~ + +** Processing line: ~ - last: Returns the last element of an array.~ - Inside source: true *** True Line Result - :children=>[{:type=>:content, -** Processing line: ~ :data=>"John Doe"}]}],~ + - last: Returns the last element of an array. +** Processing line: ~~ - Inside source: true *** True Line Result - :data=>"John Doe"}]}], -** Processing line: ~ :attributes=>{"id"=>"100"}}]}~ + +** Processing line: ~ Reminders:~ - Inside source: true *** True Line Result - :attributes=>{"id"=>"100"}}]} + Reminders: ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ assert.equal! result, expected, "Parsing xml failed."~ +** Processing line: ~ - num1.lesser(num2): finds the lower value of the given options.~ - Inside source: true *** True Line Result - assert.equal! result, expected, "Parsing xml failed." -** Processing line: ~ end~ + - num1.lesser(num2): finds the lower value of the given options. +** Processing line: ~ For example, in the statement~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + For example, in the statement +** Processing line: ~ a = 4.lesser(3)~ - Inside source: true *** True Line Result - -** Processing line: ~ puts "running tests"~ + a = 4.lesser(3) +** Processing line: ~ 3 has a lower value than 4, which means that the value of a would be set to 3,~ - Inside source: true *** True Line Result - puts "running tests" -** Processing line: ~ $gtk.reset 100~ + 3 has a lower value than 4, which means that the value of a would be set to 3, +** Processing line: ~ but if the statement had been~ - Inside source: true *** True Line Result - $gtk.reset 100 -** Processing line: ~ $gtk.log_level = :off~ + but if the statement had been +** Processing line: ~ a = 4.lesser(5)~ - Inside source: true *** True Line Result - $gtk.log_level = :off -** Processing line: ~ $gtk.tests.start~ + a = 4.lesser(5) +** Processing line: ~ 4 has a lower value than 5, which means that the value of a would be set to 4.~ - Inside source: true *** True Line Result - $gtk.tests.start + 4 has a lower value than 5, which means that the value of a would be set to 4. ** 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 - serialize_deserialize_tests.rb~ -- Header detected. +** Processing line: ~ - num1.fdiv(num2): returns the float division (will have a decimal) of the two given numbers.~ +- Inside source: true *** True Line Result - + - num1.fdiv(num2): returns the float division (will have a decimal) of the two given numbers. +** Processing line: ~ For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0~ +- Inside source: true *** True Line Result -* Advanced Debugging - Unit Tests - serialize_deserialize_tests.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0 +** Processing line: ~~ +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/serialize_deserialize_tests.rb~ +** Processing line: ~ - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated~ - Inside source: true *** True Line Result - # ./samples/10_advanced_debugging/03_unit_tests/serialize_deserialize_tests.rb -** Processing line: ~ def test_serialize args, assert~ + - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ - Inside source: true *** True Line Result - def test_serialize args, assert -** Processing line: ~ GTK::Entity.__reset_id__!~ + as Ruby code, and the placeholder is replaced with its corresponding value or result. +** Processing line: ~~ - Inside source: true *** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ args.state.player_one = "test"~ + +** Processing line: ~ - args.outputs.labels: An array. Values generate a label.~ - Inside source: true *** True Line Result - args.state.player_one = "test" -** Processing line: ~ result = args.gtk.serialize_state args.state~ + - args.outputs.labels: An array. Values generate a label. +** Processing line: ~ Parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ - Inside source: true *** True Line Result - result = args.gtk.serialize_state args.state -** Processing line: ~ assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"~ + Parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE] +** Processing line: ~ For more information, go to mygame/documentation/02-labels.md.~ - Inside source: true *** True Line Result - assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}" + For more information, go to mygame/documentation/02-labels.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ GTK::Entity.__reset_id__!~ -- Inside source: true -*** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ args.gtk.write_file 'state.txt', ''~ -- Inside source: true -*** True Line Result - args.gtk.write_file 'state.txt', '' -** Processing line: ~ result = args.gtk.serialize_state 'state.txt', args.state~ +** Processing line: ~ - ARRAY#inside_rect?: An array with at least two values is considered a point. An array~ - Inside source: true *** True Line Result - result = args.gtk.serialize_state 'state.txt', args.state -** Processing line: ~ assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"~ + - ARRAY#inside_rect?: An array with at least two values is considered a point. An array +** Processing line: ~ with at least four values is considered a rect. The inside_rect? function returns true~ - Inside source: true *** True Line Result - assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}" -** Processing line: ~ end~ + with at least four values is considered a rect. The inside_rect? function returns true +** Processing line: ~ or false depending on if the point is inside the rect.~ - Inside source: true *** True Line Result - end + or false depending on if the point is inside the rect. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_deserialize args, assert~ +** Processing line: ~ =end~ - Inside source: true *** True Line Result - def test_deserialize args, assert -** Processing line: ~ GTK::Entity.__reset_id__!~ + =end +** Processing line: ~~ - Inside source: true *** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ result = args.gtk.deserialize_state '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}'~ + +** Processing line: ~ # This code allows users to perform different tasks, such as saving and loading the game.~ - Inside source: true *** True Line Result - result = args.gtk.deserialize_state '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}' -** Processing line: ~ assert.equal! result.player_one, "test"~ + # This code allows users to perform different tasks, such as saving and loading the game. +** Processing line: ~ # Users also have options to reset the game and light a fire.~ - Inside source: true *** True Line Result - assert.equal! result.player_one, "test" + # Users also have options to reset the game and light a fire. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ GTK::Entity.__reset_id__!~ -- Inside source: true -*** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ args.gtk.write_file 'state.txt', '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}'~ -- Inside source: true -*** True Line Result - args.gtk.write_file 'state.txt', '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}' -** Processing line: ~ result = args.gtk.deserialize_state 'state.txt'~ +** Processing line: ~ class TextedBasedGame~ - Inside source: true *** True Line Result - result = args.gtk.deserialize_state 'state.txt' -** Processing line: ~ assert.equal! result.player_one, "test"~ + class TextedBasedGame +** Processing line: ~~ - Inside source: true *** True Line Result - assert.equal! result.player_one, "test" -** Processing line: ~ end~ + +** Processing line: ~ # Contains methods needed for game to run properly.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Contains methods needed for game to run properly. +** Processing line: ~ # Increments tick count by 1 each time it runs (60 times in a single second)~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_very_large_serialization args, assert~ + # Increments tick count by 1 each time it runs (60 times in a single second) +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - def test_very_large_serialization args, assert -** Processing line: ~ GTK::Entity.__reset_id__!~ + def tick +** Processing line: ~ default~ - Inside source: true *** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ size = 3000~ + default +** Processing line: ~ show_intro~ - Inside source: true *** True Line Result - size = 3000 -** Processing line: ~ size.map_with_index do |i|~ + show_intro +** Processing line: ~ state.engine_tick_count += 1~ - Inside source: true *** True Line Result - size.map_with_index do |i| -** Processing line: ~ args.state.send("k#{i}=".to_sym, i)~ + state.engine_tick_count += 1 +** Processing line: ~ tick_fire~ - Inside source: true *** True Line Result - args.state.send("k#{i}=".to_sym, i) + tick_fire ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -41063,426 +44068,386 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ result = args.gtk.serialize_state args.state~ +** Processing line: ~ # Sets default values.~ - Inside source: true *** True Line Result - result = args.gtk.serialize_state args.state -** Processing line: ~ assert.true! (args.gtk.console.log.join.include? "unlikely a string this large will deserialize correctly")~ + # Sets default values. +** Processing line: ~ # The ||= ensures that a variable's value is only set to the value following the = sign~ - Inside source: true *** True Line Result - assert.true! (args.gtk.console.log.join.include? "unlikely a string this large will deserialize correctly") -** Processing line: ~ end~ + # The ||= ensures that a variable's value is only set to the value following the = sign +** Processing line: ~ # if the value has not already been set before. Intialization happens only in the first frame.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # if the value has not already been set before. Intialization happens only in the first frame. +** Processing line: ~ def default~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_strict_entity_serialization args, assert~ + def default +** Processing line: ~ state.engine_tick_count ||= 0~ - Inside source: true *** True Line Result - def test_strict_entity_serialization args, assert -** Processing line: ~ GTK::Entity.__reset_id__!~ + state.engine_tick_count ||= 0 +** Processing line: ~ state.active_module ||= :room~ - Inside source: true *** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ args.state.player_one = args.state.new_entity(:player, name: "Ryu")~ + state.active_module ||= :room +** Processing line: ~ state.fire_progress ||= 0~ - Inside source: true *** True Line Result - args.state.player_one = args.state.new_entity(:player, name: "Ryu") -** Processing line: ~ args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken")~ + state.fire_progress ||= 0 +** Processing line: ~ state.fire_ready_in ||= 10~ - Inside source: true *** True Line Result - args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken") -** Processing line: ~~ + state.fire_ready_in ||= 10 +** Processing line: ~ state.previous_fire ||= :dead~ - Inside source: true *** True Line Result - -** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ + state.previous_fire ||= :dead +** Processing line: ~ state.fire ||= :dead~ - Inside source: true *** True Line Result - serialized_state = args.gtk.serialize_state args.state -** Processing line: ~ assert.equal! serialized_state, '{:entity_id=>1, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>3, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken"}}'~ + state.fire ||= :dead +** Processing line: ~ end~ - Inside source: true *** True Line Result - assert.equal! serialized_state, '{:entity_id=>1, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>3, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken"}}' + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ GTK::Entity.__reset_id__!~ -- Inside source: true -*** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ deserialize_state = args.gtk.deserialize_state serialized_state~ +** Processing line: ~ def show_intro~ - Inside source: true *** True Line Result - deserialize_state = args.gtk.deserialize_state serialized_state -** Processing line: ~~ + def show_intro +** Processing line: ~ return unless state.engine_tick_count == 0 # return unless the game just started~ - Inside source: true *** True Line Result - -** Processing line: ~ assert.equal! args.state.player_one.name, deserialize_state.player_one.name~ + return unless state.engine_tick_count == 0 # return unless the game just started +** Processing line: ~ set_story_line "awake." # calls set_story_line method, sets to "awake"~ - Inside source: true *** True Line Result - assert.equal! args.state.player_one.name, deserialize_state.player_one.name -** Processing line: ~ assert.true! args.state.player_one.is_a? GTK::OpenEntity~ + set_story_line "awake." # calls set_story_line method, sets to "awake" +** Processing line: ~ end~ - Inside source: true *** True Line Result - assert.true! args.state.player_one.is_a? GTK::OpenEntity + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ assert.equal! args.state.player_two.name, deserialize_state.player_two.name~ -- Inside source: true -*** True Line Result - assert.equal! args.state.player_two.name, deserialize_state.player_two.name -** Processing line: ~ assert.true! args.state.player_two.is_a? GTK::StrictEntity~ -- Inside source: true -*** True Line Result - assert.true! args.state.player_two.is_a? GTK::StrictEntity -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ +** Processing line: ~ # Sets story line.~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_strict_entity_serialization_with_nil args, assert~ + # Sets story line. +** Processing line: ~ def set_story_line story_line~ - Inside source: true *** True Line Result - def test_strict_entity_serialization_with_nil args, assert -** Processing line: ~ GTK::Entity.__reset_id__!~ + def set_story_line story_line +** Processing line: ~ state.story_line = story_line # story line set to value of parameter~ - Inside source: true *** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ args.state.player_one = args.state.new_entity(:player, name: "Ryu")~ + state.story_line = story_line # story line set to value of parameter +** Processing line: ~ state.active_module = :alert # active module set to alert~ - Inside source: true *** True Line Result - args.state.player_one = args.state.new_entity(:player, name: "Ryu") -** Processing line: ~ args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken", blood_type: nil)~ + state.active_module = :alert # active module set to alert +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken", blood_type: nil) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ +** Processing line: ~ # Clears story line.~ - Inside source: true *** True Line Result - serialized_state = args.gtk.serialize_state args.state -** Processing line: ~ assert.equal! serialized_state, '{:entity_id=>9, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}'~ + # Clears story line. +** Processing line: ~ def clear_storyline~ - Inside source: true *** True Line Result - assert.equal! serialized_state, '{:entity_id=>9, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}' -** Processing line: ~~ + def clear_storyline +** Processing line: ~ state.active_module = :none # active module set to none~ - Inside source: true *** True Line Result - -** Processing line: ~ GTK::Entity.__reset_id__!~ + state.active_module = :none # active module set to none +** Processing line: ~ state.story_line = nil # story line is cleared, set to nil (or empty)~ - Inside source: true *** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ + state.story_line = nil # story line is cleared, set to nil (or empty) +** Processing line: ~ end~ - Inside source: true *** True Line Result - deserialized_state = args.gtk.deserialize_state serialized_state + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ assert.equal! args.state.player_one.name, deserialized_state.player_one.name~ +** Processing line: ~ # Determines fire progress (how close the fire is to being ready to light).~ - Inside source: true *** True Line Result - assert.equal! args.state.player_one.name, deserialized_state.player_one.name -** Processing line: ~ assert.true! args.state.player_one.is_a? GTK::OpenEntity~ + # Determines fire progress (how close the fire is to being ready to light). +** Processing line: ~ def tick_fire~ - Inside source: true *** True Line Result - assert.true! args.state.player_one.is_a? GTK::OpenEntity -** Processing line: ~~ + def tick_fire +** Processing line: ~ return if state.active_module == :alert # return if active module is alert~ - Inside source: true *** True Line Result - -** Processing line: ~ assert.equal! args.state.player_two.name, deserialized_state.player_two.name~ + return if state.active_module == :alert # return if active module is alert +** Processing line: ~ state.fire_progress += 1 # increment fire progress~ - Inside source: true *** True Line Result - assert.equal! args.state.player_two.name, deserialized_state.player_two.name -** Processing line: ~ assert.equal! args.state.player_two.blood_type, deserialized_state.player_two.blood_type~ + state.fire_progress += 1 # increment fire progress +** Processing line: ~ # fire_ready_in is 10. The fire_progress is either the current value or 10, whichever has a lower value.~ - Inside source: true *** True Line Result - assert.equal! args.state.player_two.blood_type, deserialized_state.player_two.blood_type -** Processing line: ~ assert.equal! deserialized_state.player_two.blood_type, nil~ + # fire_ready_in is 10. The fire_progress is either the current value or 10, whichever has a lower value. +** Processing line: ~ state.fire_progress = state.fire_progress.lesser(state.fire_ready_in)~ - Inside source: true *** True Line Result - assert.equal! deserialized_state.player_two.blood_type, nil -** Processing line: ~ assert.true! args.state.player_two.is_a? GTK::StrictEntity~ + state.fire_progress = state.fire_progress.lesser(state.fire_ready_in) +** Processing line: ~ end~ - Inside source: true *** True Line Result - assert.true! args.state.player_two.is_a? GTK::StrictEntity + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ deserialized_state.player_two.blood_type = :O~ +** Processing line: ~ # Sets the value of fire (whether it is dead or roaring), and the story line~ - Inside source: true *** True Line Result - deserialized_state.player_two.blood_type = :O -** Processing line: ~ assert.equal! deserialized_state.player_two.blood_type, :O~ + # Sets the value of fire (whether it is dead or roaring), and the story line +** Processing line: ~ def light_fire~ - Inside source: true *** True Line Result - assert.equal! deserialized_state.player_two.blood_type, :O -** Processing line: ~ end~ + def light_fire +** Processing line: ~ return unless fire_ready? # returns unless the fire is ready to be lit~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + return unless fire_ready? # returns unless the fire is ready to be lit +** Processing line: ~ state.fire = :roaring # fire is lit, set to roaring~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_multiple_strict_entities args, assert~ + state.fire = :roaring # fire is lit, set to roaring +** Processing line: ~ state.fire_progress = 0 # the fire progress returns to 0, since the fire has been lit~ - Inside source: true *** True Line Result - def test_multiple_strict_entities args, assert -** Processing line: ~ GTK::Entity.__reset_id__!~ + state.fire_progress = 0 # the fire progress returns to 0, since the fire has been lit +** Processing line: ~ if state.fire != state.previous_fire~ - Inside source: true *** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ args.state.player = args.state.new_entity_strict(:player_one, name: "Ryu")~ + if state.fire != state.previous_fire +** Processing line: ~ set_story_line "the fire is #{state.fire}." # the story line is set using string interpolation~ - Inside source: true *** True Line Result - args.state.player = args.state.new_entity_strict(:player_one, name: "Ryu") -** Processing line: ~ args.state.enemy = args.state.new_entity_strict(:enemy, name: "Bison", other_property: 'extra mean')~ + set_story_line "the fire is #{state.fire}." # the story line is set using string interpolation +** Processing line: ~ state.previous_fire = state.fire~ - Inside source: true *** True Line Result - args.state.enemy = args.state.new_entity_strict(:enemy, name: "Bison", other_property: 'extra mean') -** Processing line: ~~ + state.previous_fire = state.fire +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - serialized_state = args.gtk.serialize_state args.state + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ # Checks if the fire is ready to be lit. Returns a boolean value.~ - Inside source: true *** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ + # Checks if the fire is ready to be lit. Returns a boolean value. +** Processing line: ~ def fire_ready?~ - Inside source: true *** True Line Result - deserialized_state = args.gtk.deserialize_state serialized_state -** Processing line: ~~ + def fire_ready? +** Processing line: ~ # If fire_progress (value between 0 and 10) is equal to fire_ready_in (value of 10),~ - Inside source: true *** True Line Result - -** Processing line: ~ assert.equal! deserialized_state.player.name, "Ryu"~ + # If fire_progress (value between 0 and 10) is equal to fire_ready_in (value of 10), +** Processing line: ~ # the fire is ready to be lit.~ - Inside source: true *** True Line Result - assert.equal! deserialized_state.player.name, "Ryu" -** Processing line: ~ assert.equal! deserialized_state.enemy.other_property, "extra mean"~ + # the fire is ready to be lit. +** Processing line: ~ state.fire_progress == state.fire_ready_in~ - Inside source: true *** True Line Result - assert.equal! deserialized_state.enemy.other_property, "extra mean" -** Processing line: ~ end~ + state.fire_progress == state.fire_ready_in +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_by_reference_state args, assert~ -- Inside source: true -*** True Line Result - def test_by_reference_state args, assert -** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ # Divides the value of the fire_progress variable by 10 to determine how close the user is to~ - Inside source: true *** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ args.state.a = { name: "Jane Doe" }~ + # Divides the value of the fire_progress variable by 10 to determine how close the user is to +** Processing line: ~ # being able to light a fire.~ - Inside source: true *** True Line Result - args.state.a = { name: "Jane Doe" } -** Processing line: ~ args.state.b = args.state.a~ + # being able to light a fire. +** Processing line: ~ def light_fire_progress~ - Inside source: true *** True Line Result - args.state.b = args.state.a -** Processing line: ~ assert.equal! args.state.a.object_id, args.state.b.object_id~ + def light_fire_progress +** Processing line: ~ state.fire_progress.fdiv(10) # float division~ - Inside source: true *** True Line Result - assert.equal! args.state.a.object_id, args.state.b.object_id -** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ + state.fire_progress.fdiv(10) # float division +** Processing line: ~ end~ - Inside source: true *** True Line Result - serialized_state = args.gtk.serialize_state args.state + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ # Defines fire as the state.fire variable.~ - Inside source: true *** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ + # Defines fire as the state.fire variable. +** Processing line: ~ def fire~ - Inside source: true *** True Line Result - deserialized_state = args.gtk.deserialize_state serialized_state -** Processing line: ~ assert.equal! deserialized_state.a.object_id, deserialized_state.b.object_id~ + def fire +** Processing line: ~ state.fire~ - Inside source: true *** True Line Result - assert.equal! deserialized_state.a.object_id, deserialized_state.b.object_id -** Processing line: ~ end~ + state.fire +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_by_reference_state_strict_entities args, assert~ -- Inside source: true -*** True Line Result - def test_by_reference_state_strict_entities args, assert -** Processing line: ~ GTK::Entity.__reset_id__!~ -- Inside source: true -*** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ args.state.a = { name: "Jane Doe" }~ +** Processing line: ~ # Sets the title of the room.~ - Inside source: true *** True Line Result - args.state.a = { name: "Jane Doe" } -** Processing line: ~ args.state.strict_entity = args.state.new_entity_strict(:couple) do |e|~ + # Sets the title of the room. +** Processing line: ~ def room_title~ - Inside source: true *** True Line Result - args.state.strict_entity = args.state.new_entity_strict(:couple) do |e| -** Processing line: ~ e.one = args.state.new_entity_strict(:person, name: "Jane")~ + def room_title +** Processing line: ~ return "a room that is dark" if state.fire == :dead # room is dark if the fire is dead~ - Inside source: true *** True Line Result - e.one = args.state.new_entity_strict(:person, name: "Jane") -** Processing line: ~ e.two = e.one~ + return "a room that is dark" if state.fire == :dead # room is dark if the fire is dead +** Processing line: ~ return "a room that is lit" # room is lit if the fire is not dead~ - Inside source: true *** True Line Result - e.two = e.one + return "a room that is lit" # room is lit if the fire is not dead ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ assert.equal! args.state.strict_entity.one, args.state.strict_entity.two~ -- Inside source: true -*** True Line Result - assert.equal! args.state.strict_entity.one, args.state.strict_entity.two -** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ -- Inside source: true -*** True Line Result - serialized_state = args.gtk.serialize_state args.state ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ # Sets the active_module to room.~ - Inside source: true *** True Line Result - GTK::Entity.__reset_id__! -** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ + # Sets the active_module to room. +** Processing line: ~ def go_to_room~ - Inside source: true *** True Line Result - deserialized_state = args.gtk.deserialize_state serialized_state -** Processing line: ~ assert.equal! deserialized_state.strict_entity.one, deserialized_state.strict_entity.two~ + def go_to_room +** Processing line: ~ state.active_module = :room~ - Inside source: true *** True Line Result - assert.equal! deserialized_state.strict_entity.one, deserialized_state.strict_entity.two -** Processing line: ~ end~ + state.active_module = :room +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ $tests.start~ +** Processing line: ~ # Defines active_module as the state.active_module variable.~ - Inside source: true *** True Line Result - $tests.start -** Processing line: ~~ + # Defines active_module as the state.active_module variable. +** Processing line: ~ def active_module~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + def active_module +** Processing line: ~ state.active_module~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + state.active_module +** Processing line: ~ end~ +- Inside source: true *** True Line Result - -** Processing line: ~* Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb~ -- Header detected. + end +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ # Defines story_line as the state.story_line variable.~ +- Inside source: true *** True Line Result -* Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - + # Defines story_line as the state.story_line variable. +** Processing line: ~ def story_line~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/state_serialization_experimental_tests.rb~ + def story_line +** Processing line: ~ state.story_line~ - Inside source: true *** True Line Result - # ./samples/10_advanced_debugging/03_unit_tests/state_serialization_experimental_tests.rb -** Processing line: ~ MAX_CODE_GEN_LENGTH = 50~ + state.story_line +** Processing line: ~ end~ - Inside source: true *** True Line Result - MAX_CODE_GEN_LENGTH = 50 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # NOTE: This is experimental/advanced stuff.~ +** Processing line: ~ # Update every 60 frames (or every second)~ - Inside source: true *** True Line Result - # NOTE: This is experimental/advanced stuff. -** Processing line: ~ def needs_partitioning? target~ + # Update every 60 frames (or every second) +** Processing line: ~ def should_tick?~ - Inside source: true *** True Line Result - def needs_partitioning? target -** Processing line: ~ target[:value].to_s.length > MAX_CODE_GEN_LENGTH~ + def should_tick? +** Processing line: ~ state.tick_count.mod_zero?(60)~ - Inside source: true *** True Line Result - target[:value].to_s.length > MAX_CODE_GEN_LENGTH -** Processing line: ~ end~ + state.tick_count.mod_zero?(60) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def partition target~ -- Inside source: true -*** True Line Result - def partition target -** Processing line: ~ return [] unless needs_partitioning? target~ +** Processing line: ~ # Sets the value of the game state provider.~ - Inside source: true *** True Line Result - return [] unless needs_partitioning? target -** Processing line: ~ if target[:value].is_a? GTK::OpenEntity~ + # Sets the value of the game state provider. +** Processing line: ~ def initialize game_state_provider~ - Inside source: true *** True Line Result - if target[:value].is_a? GTK::OpenEntity -** Processing line: ~ target[:value] = target[:value].hash~ + def initialize game_state_provider +** Processing line: ~ @game_state_provider = game_state_provider~ - Inside source: true *** True Line Result - target[:value] = target[:value].hash + @game_state_provider = game_state_provider ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -41491,122 +44456,106 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ results = []~ -- Inside source: true -*** True Line Result - results = [] -** Processing line: ~ idx = 0~ +** Processing line: ~ # Defines the game state.~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ left, right = target[:value].partition do~ + # Defines the game state. +** Processing line: ~ # Any variable prefixed with an @ symbol is an instance variable.~ - Inside source: true *** True Line Result - left, right = target[:value].partition do -** Processing line: ~ idx += 1~ + # Any variable prefixed with an @ symbol is an instance variable. +** Processing line: ~ def state~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ idx.even?~ + def state +** Processing line: ~ @game_state_provider.state~ - Inside source: true *** True Line Result - idx.even? + @game_state_provider.state ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ left, right = Hash[left], Hash[right]~ +** Processing line: ~~ - Inside source: true *** True Line Result - left, right = Hash[left], Hash[right] -** Processing line: ~ left = { value: left }~ + +** Processing line: ~ # Saves the state of the game in a text file called game_state.txt.~ - Inside source: true *** True Line Result - left = { value: left } -** Processing line: ~ right = { value: right}~ + # Saves the state of the game in a text file called game_state.txt. +** Processing line: ~ def save~ - Inside source: true *** True Line Result - right = { value: right} -** Processing line: ~ [left, right]~ + def save +** Processing line: ~ $gtk.serialize_state('game_state.txt', state)~ - Inside source: true *** True Line Result - [left, right] -** Processing line: ~ end~ + $gtk.serialize_state('game_state.txt', state) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def add_partition target, path, aggregate, final_result~ -- Inside source: true -*** True Line Result - def add_partition target, path, aggregate, final_result -** Processing line: ~ partitions = partition target~ -- Inside source: true -*** True Line Result - partitions = partition target -** Processing line: ~ partitions.each do |part|~ -- Inside source: true -*** True Line Result - partitions.each do |part| -** Processing line: ~ if needs_partitioning? part~ +** Processing line: ~ # Loads the game state from the game_state.txt text file.~ - Inside source: true *** True Line Result - if needs_partitioning? part -** Processing line: ~ if part[:value].keys.length == 1~ + # Loads the game state from the game_state.txt text file. +** Processing line: ~ # If the load is unsuccessful, the user is informed since the story line indicates the failure.~ - Inside source: true *** True Line Result - if part[:value].keys.length == 1 -** Processing line: ~ first_key = part[:value].keys[0]~ + # If the load is unsuccessful, the user is informed since the story line indicates the failure. +** Processing line: ~ def load~ - Inside source: true *** True Line Result - first_key = part[:value].keys[0] -** Processing line: ~ new_part = { value: part[:value][first_key] }~ + def load +** Processing line: ~ parsed_state = $gtk.deserialize_state('game_state.txt')~ - Inside source: true *** True Line Result - new_part = { value: part[:value][first_key] } -** Processing line: ~ path.push first_key~ + parsed_state = $gtk.deserialize_state('game_state.txt') +** Processing line: ~ if !parsed_state~ - Inside source: true *** True Line Result - path.push first_key -** Processing line: ~ add_partition new_part, path, aggregate, final_result~ + if !parsed_state +** Processing line: ~ set_story_line "no game to load. press save first."~ - Inside source: true *** True Line Result - add_partition new_part, path, aggregate, final_result -** Processing line: ~ path.pop~ + set_story_line "no game to load. press save first." +** Processing line: ~ else~ - Inside source: true *** True Line Result - path.pop -** Processing line: ~ else~ + else +** Processing line: ~ $gtk.args.state = parsed_state~ - Inside source: true *** True Line Result - else -** Processing line: ~ add_partition part, path, aggregate, final_result~ + $gtk.args.state = parsed_state +** Processing line: ~ end~ - Inside source: true *** True Line Result - add_partition part, path, aggregate, final_result -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ final_result << { value: { __path__: [*path] } }~ + +** Processing line: ~ # Resets the game.~ - Inside source: true *** True Line Result - final_result << { value: { __path__: [*path] } } -** Processing line: ~ final_result << { value: part[:value] }~ + # Resets the game. +** Processing line: ~ def reset~ - Inside source: true *** True Line Result - final_result << { value: part[:value] } -** Processing line: ~ end~ + def reset +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - end + $gtk.reset ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -41619,74 +44568,78 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def state_to_string state~ +** Processing line: ~ class TextedBasedGamePresenter~ - Inside source: true *** True Line Result - def state_to_string state -** Processing line: ~ parts_queue = []~ + class TextedBasedGamePresenter +** Processing line: ~ attr_accessor :state, :outputs, :inputs~ - Inside source: true *** True Line Result - parts_queue = [] -** Processing line: ~ final_queue = []~ + attr_accessor :state, :outputs, :inputs +** Processing line: ~~ - Inside source: true *** True Line Result - final_queue = [] -** Processing line: ~ add_partition({ value: state.hash },~ + +** Processing line: ~ # Creates empty collection called highlights.~ - Inside source: true *** True Line Result - add_partition({ value: state.hash }, -** Processing line: ~ [],~ + # Creates empty collection called highlights. +** Processing line: ~ # Calls methods necessary to run the game.~ - Inside source: true *** True Line Result - [], -** Processing line: ~ parts_queue,~ + # Calls methods necessary to run the game. +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - parts_queue, -** Processing line: ~ final_queue)~ + def tick +** Processing line: ~ state.layout.highlights ||= []~ - Inside source: true *** True Line Result - final_queue) -** Processing line: ~ final_queue.reject {|i| i[:value].keys.length == 0}.map do |i|~ + state.layout.highlights ||= [] +** Processing line: ~ game.tick if game.should_tick?~ - Inside source: true *** True Line Result - final_queue.reject {|i| i[:value].keys.length == 0}.map do |i| -** Processing line: ~ i[:value].to_s~ + game.tick if game.should_tick? +** Processing line: ~ render~ - Inside source: true *** True Line Result - i[:value].to_s -** Processing line: ~ end.join("\n#==================================================#\n")~ + render +** Processing line: ~ process_input~ - Inside source: true *** True Line Result - end.join("\n#==================================================#\n") -** Processing line: ~ end~ + process_input +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def state_from_string string~ +** Processing line: ~ # Outputs a label of the tick count (passage of time) and calls all render methods.~ - Inside source: true *** True Line Result - def state_from_string string -** Processing line: ~ Kernel.eval("$load_data = {}")~ + # Outputs a label of the tick count (passage of time) and calls all render methods. +** Processing line: ~ def render~ - Inside source: true *** True Line Result - Kernel.eval("$load_data = {}") -** Processing line: ~ lines = string.split("\n#==================================================#\n")~ + def render +** Processing line: ~ outputs.labels << [10, 30, state.tick_count]~ - Inside source: true *** True Line Result - lines = string.split("\n#==================================================#\n") -** Processing line: ~ lines.each do |l|~ + outputs.labels << [10, 30, state.tick_count] +** Processing line: ~ render_alert~ - Inside source: true *** True Line Result - lines.each do |l| -** Processing line: ~ puts "todo: #{l}"~ + render_alert +** Processing line: ~ render_room~ - Inside source: true *** True Line Result - puts "todo: #{l}" + render_room +** Processing line: ~ render_highlights~ +- Inside source: true +*** True Line Result + render_highlights ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -41695,706 +44648,742 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ GTK::OpenEntity.parse_from_hash $load_data~ +** Processing line: ~ # Outputs a label onto the screen that shows the story line, and also outputs a "close" button.~ - Inside source: true *** True Line Result - GTK::OpenEntity.parse_from_hash $load_data -** Processing line: ~ end~ + # Outputs a label onto the screen that shows the story line, and also outputs a "close" button. +** Processing line: ~ def render_alert~ - Inside source: true *** True Line Result - end + def render_alert +** Processing line: ~ return unless game.active_module == :alert~ +- Inside source: true +*** True Line Result + return unless game.active_module == :alert ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_save_and_load args, assert~ +** Processing line: ~ outputs.labels << [640, 480, game.story_line, 5, 1] # outputs story line label~ - Inside source: true *** True Line Result - def test_save_and_load args, assert -** Processing line: ~ args.state.item_1.name = "Jane"~ + outputs.labels << [640, 480, game.story_line, 5, 1] # outputs story line label +** Processing line: ~ outputs.primitives << button(:alert_dismiss, 490, 380, "close") # positions "close" button under story line~ - Inside source: true *** True Line Result - args.state.item_1.name = "Jane" -** Processing line: ~ string = state_to_string args.state~ + outputs.primitives << button(:alert_dismiss, 490, 380, "close") # positions "close" button under story line +** Processing line: ~ end~ - Inside source: true *** True Line Result - string = state_to_string args.state -** Processing line: ~ state = state_from_string string~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state = state_from_string string -** Processing line: ~ assert.equal! args.state.item_1.name, state.item_1.name~ + +** Processing line: ~ def render_room~ - Inside source: true *** True Line Result - assert.equal! args.state.item_1.name, state.item_1.name -** Processing line: ~ end~ + def render_room +** Processing line: ~ return unless game.active_module == :room~ - Inside source: true *** True Line Result - end + return unless game.active_module == :room +** Processing line: ~ outputs.labels << [640, 700, game.room_title, 4, 1] # outputs room title label at top of screen~ +- Inside source: true +*** True Line Result + outputs.labels << [640, 700, game.room_title, 4, 1] # outputs room title label at top of screen ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_save_and_load_big args, assert~ +** Processing line: ~ # The parameters for these outputs are (symbol, x, y, text, value/percentage) and each has a y value~ - Inside source: true *** True Line Result - def test_save_and_load_big args, assert -** Processing line: ~ size = 1000~ + # The parameters for these outputs are (symbol, x, y, text, value/percentage) and each has a y value +** Processing line: ~ # that positions it 60 pixels lower than the previous output.~ - Inside source: true *** True Line Result - size = 1000 -** Processing line: ~ size.map_with_index do |i|~ + # that positions it 60 pixels lower than the previous output. +** Processing line: ~~ - Inside source: true *** True Line Result - size.map_with_index do |i| -** Processing line: ~ args.state.send("k#{i}=".to_sym, i)~ + +** Processing line: ~ # outputs the light_fire_progress bar, uses light_fire_progress for its percentage (which changes bar's appearance)~ - Inside source: true *** True Line Result - args.state.send("k#{i}=".to_sym, i) -** Processing line: ~ end~ + # outputs the light_fire_progress bar, uses light_fire_progress for its percentage (which changes bar's appearance) +** Processing line: ~ outputs.primitives << progress_bar(:light_fire, 490, 600, "light fire", game.light_fire_progress)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.primitives << progress_bar(:light_fire, 490, 600, "light fire", game.light_fire_progress) +** Processing line: ~ outputs.primitives << button( :save_game, 490, 540, "save") # outputs save button~ - Inside source: true *** True Line Result - -** Processing line: ~ string = state_to_string args.state~ + outputs.primitives << button( :save_game, 490, 540, "save") # outputs save button +** Processing line: ~ outputs.primitives << button( :load_game, 490, 480, "load") # outputs load button~ - Inside source: true *** True Line Result - string = state_to_string args.state -** Processing line: ~ state = state_from_string string~ + outputs.primitives << button( :load_game, 490, 480, "load") # outputs load button +** Processing line: ~ outputs.primitives << button( :reset_game, 490, 420, "reset") # outputs reset button~ - Inside source: true *** True Line Result - state = state_from_string string -** Processing line: ~ size.map_with_index do |i|~ + outputs.primitives << button( :reset_game, 490, 420, "reset") # outputs reset button +** Processing line: ~ outputs.labels << [640, 30, "the fire is #{game.fire}", 0, 1] # outputs fire label at bottom of screen~ - Inside source: true *** True Line Result - size.map_with_index do |i| -** Processing line: ~ assert.equal! args.state.send("k#{i}".to_sym), state.send("k#{i}".to_sym)~ + outputs.labels << [640, 30, "the fire is #{game.fire}", 0, 1] # outputs fire label at bottom of screen +** Processing line: ~ end~ - Inside source: true *** True Line Result - assert.equal! args.state.send("k#{i}".to_sym), state.send("k#{i}".to_sym) -** Processing line: ~ assert.equal! args.state.send("k#{i}".to_sym), i~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - assert.equal! args.state.send("k#{i}".to_sym), i -** Processing line: ~ assert.equal! state.send("k#{i}".to_sym), i~ + +** Processing line: ~ # Outputs a collection of highlights using an array to set their values, and also rejects certain values from the collection.~ - Inside source: true *** True Line Result - assert.equal! state.send("k#{i}".to_sym), i -** Processing line: ~ end~ + # Outputs a collection of highlights using an array to set their values, and also rejects certain values from the collection. +** Processing line: ~ def render_highlights~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def render_highlights +** Processing line: ~ state.layout.highlights.each do |h| # for each highlight in the collection~ - Inside source: true *** True Line Result - end + state.layout.highlights.each do |h| # for each highlight in the collection +** Processing line: ~ h.lifetime -= 1 # decrease the value of its lifetime~ +- Inside source: true +*** True Line Result + h.lifetime -= 1 # decrease the value of its lifetime +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_save_and_load_big_nested args, assert~ +** Processing line: ~ outputs.solids << state.layout.highlights.map do |h| # outputs highlights collection~ - Inside source: true *** True Line Result - def test_save_and_load_big_nested args, assert -** Processing line: ~ args.state.player_one.friend.nested_hash.k0 = 0~ + outputs.solids << state.layout.highlights.map do |h| # outputs highlights collection +** Processing line: ~ [h.x, h.y, h.w, h.h, h.color, 255 * h.lifetime / h.max_lifetime] # sets definition for each highlight~ - Inside source: true *** True Line Result - args.state.player_one.friend.nested_hash.k0 = 0 -** Processing line: ~ args.state.player_one.friend.nested_hash.k1 = 1~ + [h.x, h.y, h.w, h.h, h.color, 255 * h.lifetime / h.max_lifetime] # sets definition for each highlight +** Processing line: ~ # transparency changes; divide lifetime by max_lifetime, multiply result by 255~ - Inside source: true *** True Line Result - args.state.player_one.friend.nested_hash.k1 = 1 -** Processing line: ~ args.state.player_one.friend.nested_hash.k2 = 2~ + # transparency changes; divide lifetime by max_lifetime, multiply result by 255 +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.player_one.friend.nested_hash.k2 = 2 -** Processing line: ~ args.state.player_one.friend.nested_hash.k3 = 3~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.player_one.friend.nested_hash.k3 = 3 -** Processing line: ~ args.state.player_one.friend.nested_hash.k4 = 4~ + +** Processing line: ~ # reject highlights from collection that have no remaining lifetime~ - Inside source: true *** True Line Result - args.state.player_one.friend.nested_hash.k4 = 4 -** Processing line: ~ args.state.player_one.friend.nested_hash.k5 = 5~ + # reject highlights from collection that have no remaining lifetime +** Processing line: ~ state.layout.highlights = state.layout.highlights.reject { |h| h.lifetime <= 0 }~ - Inside source: true *** True Line Result - args.state.player_one.friend.nested_hash.k5 = 5 -** Processing line: ~ args.state.player_one.friend.nested_hash.k6 = 6~ + state.layout.highlights = state.layout.highlights.reject { |h| h.lifetime <= 0 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.player_one.friend.nested_hash.k6 = 6 -** Processing line: ~ args.state.player_one.friend.nested_hash.k7 = 7~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.player_one.friend.nested_hash.k7 = 7 -** Processing line: ~ args.state.player_one.friend.nested_hash.k8 = 8~ + +** Processing line: ~ # Checks whether or not a button was clicked.~ - Inside source: true *** True Line Result - args.state.player_one.friend.nested_hash.k8 = 8 -** Processing line: ~ args.state.player_one.friend.nested_hash.k9 = 9~ + # Checks whether or not a button was clicked. +** Processing line: ~ # Returns a boolean value.~ - Inside source: true *** True Line Result - args.state.player_one.friend.nested_hash.k9 = 9 -** Processing line: ~ string = state_to_string args.state~ + # Returns a boolean value. +** Processing line: ~ def process_input~ - Inside source: true *** True Line Result - string = state_to_string args.state -** Processing line: ~ state = state_from_string string~ + def process_input +** Processing line: ~ button = button_clicked? # calls button_clicked? method~ - Inside source: true *** True Line Result - state = state_from_string string -** Processing line: ~ end~ + button = button_clicked? # calls button_clicked? method +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ $gtk.reset 100~ +** Processing line: ~ # Returns a boolean value.~ - Inside source: true *** True Line Result - $gtk.reset 100 -** Processing line: ~ $gtk.log_level = :off~ + # Returns a boolean value. +** Processing line: ~ # Finds the button that was clicked from the button list and determines what method to call.~ - Inside source: true *** True Line Result - $gtk.log_level = :off -** Processing line: ~ $gtk.tests.start~ + # Finds the button that was clicked from the button list and determines what method to call. +** Processing line: ~ # Adds a highlight to the highlights collection.~ - Inside source: true *** True Line Result - $gtk.tests.start -** Processing line: ~~ + # Adds a highlight to the highlights collection. +** Processing line: ~ def button_clicked?~ - 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. + def button_clicked? +** Processing line: ~ return nil unless click_pos # return nil unless click_pos holds coordinates of mouse click~ +- Inside source: true *** True Line Result - -** Processing line: ~* Http - Retrieve Images - main.rb~ -- Header detected. + return nil unless click_pos # return nil unless click_pos holds coordinates of mouse click +** Processing line: ~ button = @button_list.find do |k, v| # goes through button_list to find button clicked~ +- Inside source: true *** True Line Result - + button = @button_list.find do |k, v| # goes through button_list to find button clicked +** Processing line: ~ click_pos.inside_rect? v[:primitives].last.rect # was the mouse clicked inside the rect of button?~ +- Inside source: true *** True Line Result -* Http - Retrieve Images - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + click_pos.inside_rect? v[:primitives].last.rect # was the mouse clicked inside the rect of button? +** Processing line: ~ end~ +- Inside source: true *** True Line Result - + end +** Processing line: ~ return unless button # return unless a button was clicked~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/11_http/01_retrieve_images/app/main.rb~ + return unless button # return unless a button was clicked +** Processing line: ~ method_to_call = "#{button[0]}_clicked".to_sym # sets method_to_call to symbol (like :save_game or :load_game)~ - Inside source: true *** True Line Result - # ./samples/11_http/01_retrieve_images/app/main.rb -** Processing line: ~ def tick args~ + method_to_call = "#{button[0]}_clicked".to_sym # sets method_to_call to symbol (like :save_game or :load_game) +** Processing line: ~ if self.respond_to? method_to_call # returns true if self responds to the given method (method actually exists)~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ + if self.respond_to? method_to_call # returns true if self responds to the given method (method actually exists) +** Processing line: ~ border = button[1][:primitives].last # sets border definition using value of last key in button list hash~ - Inside source: true *** True Line Result - args.outputs.background_color = [0, 0, 0] + border = button[1][:primitives].last # sets border definition using value of last key in button list hash ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Show a warning at the start.~ +** Processing line: ~ # declares each highlight as a new entity, sets properties~ - Inside source: true *** True Line Result - # Show a warning at the start. -** Processing line: ~ args.state.warning_debounce ||= 11 * 60~ + # declares each highlight as a new entity, sets properties +** Processing line: ~ state.layout.highlights << state.new_entity(:highlight) do |h|~ - Inside source: true *** True Line Result - args.state.warning_debounce ||= 11 * 60 -** Processing line: ~ if args.state.warning_debounce > 0~ + state.layout.highlights << state.new_entity(:highlight) do |h| +** Processing line: ~ h.x = border.x~ - Inside source: true *** True Line Result - if args.state.warning_debounce > 0 -** Processing line: ~ args.state.warning_debounce -= 1~ + h.x = border.x +** Processing line: ~ h.y = border.y~ - Inside source: true *** True Line Result - args.state.warning_debounce -= 1 -** Processing line: ~ args.outputs.labels << [640, 600, "This app shows random images from the Internet.", 10, 1, 255, 255, 255]~ + h.y = border.y +** Processing line: ~ h.w = border.w~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 600, "This app shows random images from the Internet.", 10, 1, 255, 255, 255] -** Processing line: ~ args.outputs.labels << [640, 500, "Quit in the next few seconds if this is a problem.", 10, 1, 255, 255, 255]~ + h.w = border.w +** Processing line: ~ h.h = border.h~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 500, "Quit in the next few seconds if this is a problem.", 10, 1, 255, 255, 255] -** Processing line: ~ args.outputs.labels << [640, 350, "#{(args.state.warning_debounce / 60.0).to_i}", 10, 1, 255, 255, 255]~ + h.h = border.h +** Processing line: ~ h.max_lifetime = 10~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 350, "#{(args.state.warning_debounce / 60.0).to_i}", 10, 1, 255, 255, 255] -** Processing line: ~ return~ + h.max_lifetime = 10 +** Processing line: ~ h.lifetime = h.max_lifetime~ - Inside source: true *** True Line Result - return -** Processing line: ~ end~ + h.lifetime = h.max_lifetime +** Processing line: ~ h.color = [120, 120, 180] # sets color to shade of purple~ - Inside source: true *** True Line Result - end + h.color = [120, 120, 180] # sets color to shade of purple +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.state.download_debounce ||= 0 # start immediately, reset to non zero later.~ +** Processing line: ~ self.send method_to_call # invoke method identified by symbol~ - Inside source: true *** True Line Result - args.state.download_debounce ||= 0 # start immediately, reset to non zero later. -** Processing line: ~ args.state.photos ||= []~ + self.send method_to_call # invoke method identified by symbol +** Processing line: ~ else # otherwise, if self doesn't respond to given method~ - Inside source: true *** True Line Result - args.state.photos ||= [] + else # otherwise, if self doesn't respond to given method +** Processing line: ~ border = button[1][:primitives].last # sets border definition using value of last key in hash~ +- Inside source: true +*** True Line Result + border = button[1][:primitives].last # sets border definition using value of last key in hash ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Put a little pause between each download.~ +** Processing line: ~ # declares each highlight as a new entity, sets properties~ - Inside source: true *** True Line Result - # Put a little pause between each download. -** Processing line: ~ if args.state.download.nil?~ + # declares each highlight as a new entity, sets properties +** Processing line: ~ state.layout.highlights << state.new_entity(:highlight) do |h|~ - Inside source: true *** True Line Result - if args.state.download.nil? -** Processing line: ~ if args.state.download_debounce > 0~ + state.layout.highlights << state.new_entity(:highlight) do |h| +** Processing line: ~ h.x = border.x~ - Inside source: true *** True Line Result - if args.state.download_debounce > 0 -** Processing line: ~ args.state.download_debounce -= 1~ + h.x = border.x +** Processing line: ~ h.y = border.y~ - Inside source: true *** True Line Result - args.state.download_debounce -= 1 -** Processing line: ~ else~ + h.y = border.y +** Processing line: ~ h.w = border.w~ - Inside source: true *** True Line Result - else -** Processing line: ~ args.state.download = $gtk.http_get 'https://picsum.photos/200/300.jpg'~ + h.w = border.w +** Processing line: ~ h.h = border.h~ - Inside source: true *** True Line Result - args.state.download = $gtk.http_get 'https://picsum.photos/200/300.jpg' -** Processing line: ~ end~ + h.h = border.h +** Processing line: ~ h.max_lifetime = 4 # different max_lifetime than the one set if respond_to? had been true~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + h.max_lifetime = 4 # different max_lifetime than the one set if respond_to? had been true +** Processing line: ~ h.lifetime = h.max_lifetime~ - Inside source: true *** True Line Result - end + h.lifetime = h.max_lifetime +** Processing line: ~ h.color = [120, 80, 80] # sets color to dark color~ +- Inside source: true +*** True Line Result + h.color = [120, 80, 80] # sets color to dark color +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if !args.state.download.nil?~ +** Processing line: ~ # instructions for users on how to add the missing method_to_call to the code~ - Inside source: true *** True Line Result - if !args.state.download.nil? -** Processing line: ~ if args.state.download[:complete]~ + # instructions for users on how to add the missing method_to_call to the code +** Processing line: ~ puts "It looks like #{method_to_call} doesn't exists on TextedBasedGamePresenter. Please add this method:"~ - Inside source: true *** True Line Result - if args.state.download[:complete] -** Processing line: ~ if args.state.download[:http_response_code] == 200~ + puts "It looks like #{method_to_call} doesn't exists on TextedBasedGamePresenter. Please add this method:" +** Processing line: ~ puts "Just copy the code below and put it in the #{TextedBasedGamePresenter} class definition."~ - Inside source: true *** True Line Result - if args.state.download[:http_response_code] == 200 -** Processing line: ~ fname = "sprites/#{args.state.photos.length}.jpg"~ + puts "Just copy the code below and put it in the #{TextedBasedGamePresenter} class definition." +** Processing line: ~ puts ""~ - Inside source: true *** True Line Result - fname = "sprites/#{args.state.photos.length}.jpg" -** Processing line: ~ $gtk.write_file fname, args.state.download[:response_data]~ + puts "" +** Processing line: ~ puts "```"~ - Inside source: true *** True Line Result - $gtk.write_file fname, args.state.download[:response_data] -** Processing line: ~ args.state.photos << [ 100 + rand(1080), 500 - rand(480), fname, rand(80) - 40 ]~ + puts "```" +** Processing line: ~ puts "class TextedBasedGamePresenter <--- find this class and put the method below in it"~ - Inside source: true *** True Line Result - args.state.photos << [ 100 + rand(1080), 500 - rand(480), fname, rand(80) - 40 ] -** Processing line: ~ end~ + puts "class TextedBasedGamePresenter <--- find this class and put the method below in it" +** Processing line: ~ puts ""~ - Inside source: true *** True Line Result - end -** Processing line: ~ args.state.download = nil~ + puts "" +** Processing line: ~ puts " def #{method_to_call}"~ - Inside source: true *** True Line Result - args.state.download = nil -** Processing line: ~ args.state.download_debounce = (rand(3) + 2) * 60~ + puts " def #{method_to_call}" +** Processing line: ~ puts " puts 'Yay that worked!'"~ - Inside source: true *** True Line Result - args.state.download_debounce = (rand(3) + 2) * 60 -** Processing line: ~ end~ + puts " puts 'Yay that worked!'" +** Processing line: ~ puts " end"~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + puts " end" +** Processing line: ~ puts ""~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + puts "" +** Processing line: ~ puts "end <-- make sure to put the #{method_to_call} method in between the `class` word and the final `end` statement."~ - Inside source: true *** True Line Result - -** Processing line: ~ # draw any downloaded photos...~ + puts "end <-- make sure to put the #{method_to_call} method in between the `class` word and the final `end` statement." +** Processing line: ~ puts "```"~ - Inside source: true *** True Line Result - # draw any downloaded photos... -** Processing line: ~ args.state.photos.each { |i|~ + puts "```" +** Processing line: ~ puts ""~ - Inside source: true *** True Line Result - args.state.photos.each { |i| -** Processing line: ~ args.outputs.primitives << [i[0], i[1], 200, 300, i[2], i[3]].sprite~ + puts "" +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.outputs.primitives << [i[0], i[1], 200, 300, i[2], i[3]].sprite -** Processing line: ~ }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Draw a download progress bar...~ +** Processing line: ~ # Returns the position of the mouse when it is clicked.~ - Inside source: true *** True Line Result - # Draw a download progress bar... -** Processing line: ~ args.outputs.primitives << [0, 0, 1280, 30, 0, 0, 0, 255].solid~ + # Returns the position of the mouse when it is clicked. +** Processing line: ~ def click_pos~ - Inside source: true *** True Line Result - args.outputs.primitives << [0, 0, 1280, 30, 0, 0, 0, 255].solid -** Processing line: ~ if !args.state.download.nil?~ + def click_pos +** Processing line: ~ return nil unless inputs.mouse.click # returns nil unless the mouse was clicked~ - Inside source: true *** True Line Result - if !args.state.download.nil? -** Processing line: ~ br = args.state.download[:response_read]~ + return nil unless inputs.mouse.click # returns nil unless the mouse was clicked +** Processing line: ~ return inputs.mouse.click.point # returns location of mouse click (coordinates)~ - Inside source: true *** True Line Result - br = args.state.download[:response_read] -** Processing line: ~ total = args.state.download[:response_total]~ + return inputs.mouse.click.point # returns location of mouse click (coordinates) +** Processing line: ~ end~ - Inside source: true *** True Line Result - total = args.state.download[:response_total] -** Processing line: ~ if total != 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - if total != 0 -** Processing line: ~ pct = br.to_f / total.to_f~ + +** Processing line: ~ # Creates buttons for the button_list and sets their values using a hash (uses symbols as keys)~ - Inside source: true *** True Line Result - pct = br.to_f / total.to_f -** Processing line: ~ args.outputs.primitives << [0, 0, 1280 * pct, 30, 0, 0, 255, 255].solid~ + # Creates buttons for the button_list and sets their values using a hash (uses symbols as keys) +** Processing line: ~ def button id, x, y, text~ - Inside source: true *** True Line Result - args.outputs.primitives << [0, 0, 1280 * pct, 30, 0, 0, 255, 255].solid -** Processing line: ~ end~ + def button id, x, y, text +** Processing line: ~ @button_list[id] ||= { # assigns values to hash keys~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + @button_list[id] ||= { # assigns values to hash keys +** Processing line: ~ id: id,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + id: id, +** Processing line: ~ text: text,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + text: text, +** Processing line: ~ primitives: [~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + primitives: [ +** Processing line: ~ [x + 10, y + 30, text, 2, 0].label, # positions label inside border~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + [x + 10, y + 30, text, 2, 0].label, # positions label inside border +** Processing line: ~ [x, y, 300, 50].border, # sets definition of border~ +- Inside source: true *** True Line Result - -** Processing line: ~* 12 C Extensions - Basics - main.rb~ -- Header detected. + [x, y, 300, 50].border, # sets definition of border +** Processing line: ~ ]~ +- Inside source: true *** True Line Result - + ] +** Processing line: ~ }~ +- Inside source: true *** True Line Result -* 12 C Extensions - Basics - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + } +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ @button_list[id][:primitives] # returns label and border for buttons~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/12_c_extensions/01_basics/app/main.rb~ + @button_list[id][:primitives] # returns label and border for buttons +** Processing line: ~ end~ - Inside source: true *** True Line Result - # ./samples/12_c_extensions/01_basics/app/main.rb -** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - $gtk.ffi_misc.gtk_dlopen("ext") -** Processing line: ~ include FFI::CExt~ + +** Processing line: ~ # Creates a progress bar (used for lighting the fire) and sets its values.~ - Inside source: true *** True Line Result - include FFI::CExt -** Processing line: ~~ + # Creates a progress bar (used for lighting the fire) and sets its values. +** Processing line: ~ def progress_bar id, x, y, text, percentage~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + def progress_bar id, x, y, text, percentage +** Processing line: ~ @button_list[id] = { # assigns values to hash keys~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.outputs.labels << [640, 500, "mouse.x = #{args.mouse.x.to_i}", 5, 1]~ + @button_list[id] = { # assigns values to hash keys +** Processing line: ~ id: id,~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 500, "mouse.x = #{args.mouse.x.to_i}", 5, 1] -** Processing line: ~ args.outputs.labels << [640, 460, "square(mouse.x) = #{square(args.mouse.x.to_i)}", 5, 1]~ + id: id, +** Processing line: ~ text: text,~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 460, "square(mouse.x) = #{square(args.mouse.x.to_i)}", 5, 1] -** Processing line: ~ args.outputs.labels << [640, 420, "mouse.y = #{args.mouse.y.to_i}", 5, 1]~ + text: text, +** Processing line: ~ primitives: [~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 420, "mouse.y = #{args.mouse.y.to_i}", 5, 1] -** Processing line: ~ args.outputs.labels << [640, 380, "square(mouse.y) = #{square(args.mouse.y.to_i)}", 5, 1]~ + primitives: [ +** Processing line: ~ [x, y, 300, 50, 100, 100, 100].solid, # sets definition for solid (which fills the bar with gray)~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 380, "square(mouse.y) = #{square(args.mouse.y.to_i)}", 5, 1] -** Processing line: ~ end~ + [x, y, 300, 50, 100, 100, 100].solid, # sets definition for solid (which fills the bar with gray) +** Processing line: ~ [x + 10, y + 30, text, 2, 0].label, # sets definition for label, positions inside border~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [x + 10, y + 30, text, 2, 0].label, # sets definition for label, positions inside border +** Processing line: ~ [x, y, 300, 50].border, # sets definition of border~ - Inside source: true *** True Line Result - -** Processing line: ~~ + [x, y, 300, 50].border, # sets definition of border +** Processing line: ~ ]~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + ] +** Processing line: ~ }~ +- Inside source: true *** True Line Result -#+end_src + } ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* 12 C Extensions - Intermediate - main.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ # Fills progress bar based on percentage. If the fire was ready to be lit (100%) and we multiplied by~ +- Inside source: true *** True Line Result -* 12 C Extensions - Intermediate - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - + # Fills progress bar based on percentage. If the fire was ready to be lit (100%) and we multiplied by +** Processing line: ~ # 100, only 1/3 of the bar would only be filled in. 200 would cause only 2/3 to be filled in.~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/12_c_extensions/02_intermediate/app/main.rb~ + # 100, only 1/3 of the bar would only be filled in. 200 would cause only 2/3 to be filled in. +** Processing line: ~ @button_list[id][:primitives][0][2] = 300 * percentage~ - Inside source: true *** True Line Result - # ./samples/12_c_extensions/02_intermediate/app/main.rb -** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ + @button_list[id][:primitives][0][2] = 300 * percentage +** Processing line: ~ @button_list[id][:primitives]~ - Inside source: true *** True Line Result - $gtk.ffi_misc.gtk_dlopen("ext") -** Processing line: ~ include FFI::RE~ + @button_list[id][:primitives] +** Processing line: ~ end~ - Inside source: true *** True Line Result - include FFI::RE + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def split_words(input)~ +** Processing line: ~ # Defines the game.~ - Inside source: true *** True Line Result - def split_words(input) -** Processing line: ~ words = []~ + # Defines the game. +** Processing line: ~ def game~ - Inside source: true *** True Line Result - words = [] -** Processing line: ~ last = IntPointer.new~ + def game +** Processing line: ~ @game~ - Inside source: true *** True Line Result - last = IntPointer.new -** Processing line: ~ re = re_compile("\\w+")~ + @game +** Processing line: ~ end~ - Inside source: true *** True Line Result - re = re_compile("\\w+") -** Processing line: ~ first = re_matchp(re, input, last)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - first = re_matchp(re, input, last) -** Processing line: ~ while first != -1~ + +** Processing line: ~ # Initalizes the game and creates an empty list of buttons.~ - Inside source: true *** True Line Result - while first != -1 -** Processing line: ~ words << input.slice(first, last.value)~ + # Initalizes the game and creates an empty list of buttons. +** Processing line: ~ def initialize~ - Inside source: true *** True Line Result - words << input.slice(first, last.value) -** Processing line: ~ input = input.slice(last.value + first, input.length)~ + def initialize +** Processing line: ~ @game = TextedBasedGame.new self~ - Inside source: true *** True Line Result - input = input.slice(last.value + first, input.length) -** Processing line: ~ first = re_matchp(re, input, last)~ + @game = TextedBasedGame.new self +** Processing line: ~ @button_list ||= {}~ - Inside source: true *** True Line Result - first = re_matchp(re, input, last) + @button_list ||= {} ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ words~ +** Processing line: ~~ - Inside source: true *** True Line Result - words -** Processing line: ~ end~ + +** Processing line: ~ # Clears the storyline and takes the user to the room.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Clears the storyline and takes the user to the room. +** Processing line: ~ def alert_dismiss_clicked~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + def alert_dismiss_clicked +** Processing line: ~ game.clear_storyline~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.outputs.labels << [640, 500, split_words("hello, dragonriders!").join(' '), 5, 1]~ + game.clear_storyline +** Processing line: ~ game.go_to_room~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 500, split_words("hello, dragonriders!").join(' '), 5, 1] -** Processing line: ~ end~ + game.go_to_room +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. +** Processing line: ~ # Lights the fire when the user clicks the "light fire" option.~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + # Lights the fire when the user clicks the "light fire" option. +** Processing line: ~ def light_fire_clicked~ +- Inside source: true *** True Line Result - -** Processing line: ~* 12 C Extensions - Native Pixel Arrays - main.rb~ -- Header detected. + def light_fire_clicked +** Processing line: ~ game.light_fire~ +- Inside source: true *** True Line Result - + game.light_fire +** Processing line: ~ end~ +- Inside source: true *** True Line Result -* 12 C Extensions - Native Pixel Arrays - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + end +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ # Saves the game when the user clicks the "save" option.~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/12_c_extensions/03_native_pixel_arrays/app/main.rb~ + # Saves the game when the user clicks the "save" option. +** Processing line: ~ def save_game_clicked~ - Inside source: true *** True Line Result - # ./samples/12_c_extensions/03_native_pixel_arrays/app/main.rb -** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ + def save_game_clicked +** Processing line: ~ game.save~ - Inside source: true *** True Line Result - $gtk.ffi_misc.gtk_dlopen("ext") -** Processing line: ~ include FFI::CExt~ + game.save +** Processing line: ~ end~ - Inside source: true *** True Line Result - include FFI::CExt + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ # Resets the game when the user clicks the "reset" option.~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.state.rotation ||= 0~ + # Resets the game when the user clicks the "reset" option. +** Processing line: ~ def reset_game_clicked~ - Inside source: true *** True Line Result - args.state.rotation ||= 0 -** Processing line: ~~ + def reset_game_clicked +** Processing line: ~ game.reset~ - Inside source: true *** True Line Result - -** Processing line: ~ update_scanner_texture # this calls into a C extension!~ + game.reset +** Processing line: ~ end~ - Inside source: true *** True Line Result - update_scanner_texture # this calls into a C extension! + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # New/changed pixel arrays get uploaded to the GPU before we render~ +** Processing line: ~ # Loads the game when the user clicks the "load" option.~ - Inside source: true *** True Line Result - # New/changed pixel arrays get uploaded to the GPU before we render -** Processing line: ~ # anything. At that point, they can be scaled, rotated, and otherwise~ + # Loads the game when the user clicks the "load" option. +** Processing line: ~ def load_game_clicked~ - Inside source: true *** True Line Result - # anything. At that point, they can be scaled, rotated, and otherwise -** Processing line: ~ # used like any other sprite.~ + def load_game_clicked +** Processing line: ~ game.load~ - Inside source: true *** True Line Result - # used like any other sprite. -** Processing line: ~ w = 100~ + game.load +** Processing line: ~ end~ - Inside source: true *** True Line Result - w = 100 -** Processing line: ~ h = 100~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - h = 100 -** Processing line: ~ x = (1280 - w) / 2~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - x = (1280 - w) / 2 -** Processing line: ~ y = (720 - h) / 2~ + +** Processing line: ~ $text_based_rpg = TextedBasedGamePresenter.new~ - Inside source: true *** True Line Result - y = (720 - h) / 2 -** Processing line: ~ args.outputs.background_color = [64, 0, 128]~ + $text_based_rpg = TextedBasedGamePresenter.new +** Processing line: ~~ - Inside source: true *** True Line Result - args.outputs.background_color = [64, 0, 128] -** Processing line: ~ args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite -** Processing line: ~ args.state.rotation += 1~ + def tick args +** Processing line: ~ $text_based_rpg.state = args.state~ - Inside source: true *** True Line Result - args.state.rotation += 1 -** Processing line: ~~ + $text_based_rpg.state = args.state +** Processing line: ~ $text_based_rpg.outputs = args.outputs~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ + $text_based_rpg.outputs = args.outputs +** Processing line: ~ $text_based_rpg.inputs = args.inputs~ - Inside source: true *** True Line Result - args.outputs.primitives << args.gtk.current_framerate_primitives -** Processing line: ~ end~ + $text_based_rpg.inputs = args.inputs +** Processing line: ~ $text_based_rpg.tick~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + $text_based_rpg.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - + end ** Processing line: ~~ - Inside source: true *** True Line Result @@ -42407,210 +45396,218 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* 3d - 3d Cube - main.rb~ +** Processing line: ~*** Advanced Rendering - Simple Render Targets - main.rb~ - Header detected. *** True Line Result *** True Line Result -* 3d - 3d Cube - main.rb +*** Advanced Rendering - Simple Render Targets - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result *** True Line Result #+begin_src ruby -** Processing line: ~ # ./samples/99_genre_3d/3d_cube/app/main.rb~ +** Processing line: ~ # ./samples/07_advanced_rendering/01_simple_render_targets/app/main.rb~ - Inside source: true *** True Line Result - # ./samples/99_genre_3d/3d_cube/app/main.rb -** Processing line: ~ STARTX = 0.0~ + # ./samples/07_advanced_rendering/01_simple_render_targets/app/main.rb +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - STARTX = 0.0 -** Processing line: ~ STARTY = 0.0~ + def tick args +** Processing line: ~ # args.outputs.render_targets are really really powerful.~ - Inside source: true *** True Line Result - STARTY = 0.0 -** Processing line: ~ ENDY = 20.0~ + # args.outputs.render_targets are really really powerful. +** Processing line: ~ # They essentially allow you to create a sprite programmatically and cache the result.~ - Inside source: true *** True Line Result - ENDY = 20.0 -** Processing line: ~ ENDX = 20.0~ + # They essentially allow you to create a sprite programmatically and cache the result. +** Processing line: ~~ - Inside source: true *** True Line Result - ENDX = 20.0 -** Processing line: ~ SPINPOINT = 10~ + +** Processing line: ~ # Create a render_target of a :block and a :gradient on tick zero.~ - Inside source: true *** True Line Result - SPINPOINT = 10 -** Processing line: ~ SPINDURATION = 400~ + # Create a render_target of a :block and a :gradient on tick zero. +** Processing line: ~ if args.state.tick_count == 0~ - Inside source: true *** True Line Result - SPINDURATION = 400 -** Processing line: ~ POINTSIZE = 8~ + if args.state.tick_count == 0 +** Processing line: ~ args.render_target(:block).solids << [0, 0, 1280, 100]~ - Inside source: true *** True Line Result - POINTSIZE = 8 -** Processing line: ~ BOXDEPTH = 40~ + args.render_target(:block).solids << [0, 0, 1280, 100] +** Processing line: ~~ - Inside source: true *** True Line Result - BOXDEPTH = 40 -** Processing line: ~ YAW = 1~ + +** Processing line: ~ # The gradient is actually just a collection of black solids with increasing~ - Inside source: true *** True Line Result - YAW = 1 -** Processing line: ~ DISTANCE = 10~ + # The gradient is actually just a collection of black solids with increasing +** Processing line: ~ # opacities.~ - Inside source: true *** True Line Result - DISTANCE = 10 -** Processing line: ~~ + # opacities. +** Processing line: ~ args.render_target(:gradient).solids << 90.map_with_index do |x|~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + args.render_target(:gradient).solids << 90.map_with_index do |x| +** Processing line: ~ 50.map_with_index do |y|~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ + 50.map_with_index do |y| +** Processing line: ~ [x * 15, y * 15, 15, 15, 0, 0, 0, (x * 3).fdiv(255) * 255]~ - Inside source: true *** True Line Result - args.outputs.background_color = [0, 0, 0] -** Processing line: ~ a = Math.sin(args.state.tick_count / SPINDURATION) * Math.tan(args.state.tick_count / SPINDURATION)~ + [x * 15, y * 15, 15, 15, 0, 0, 0, (x * 3).fdiv(255) * 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - a = Math.sin(args.state.tick_count / SPINDURATION) * Math.tan(args.state.tick_count / SPINDURATION) -** Processing line: ~ s = Math.sin(a)~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - s = Math.sin(a) -** Processing line: ~ c = Math.cos(a)~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - c = Math.cos(a) -** Processing line: ~ x = STARTX~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - x = STARTX -** Processing line: ~ y = STARTY~ + +** Processing line: ~ # Take the :block render_target and present it horizontally centered.~ - Inside source: true *** True Line Result - y = STARTY -** Processing line: ~ offset_x = (1280 - (ENDX - STARTX)) / 2~ + # Take the :block render_target and present it horizontally centered. +** Processing line: ~ # Use a subsection of the render_targetd specified by source_x,~ - Inside source: true *** True Line Result - offset_x = (1280 - (ENDX - STARTX)) / 2 -** Processing line: ~ offset_y = (360 - (ENDY - STARTY)) / 2~ + # Use a subsection of the render_targetd specified by source_x, +** Processing line: ~ # source_y, source_w, source_h.~ - Inside source: true *** True Line Result - offset_y = (360 - (ENDY - STARTY)) / 2 -** Processing line: ~~ + # source_y, source_w, source_h. +** Processing line: ~ args.outputs.sprites << { x: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ srand(1)~ + args.outputs.sprites << { x: 0, +** Processing line: ~ y: 310,~ - Inside source: true *** True Line Result - srand(1) -** Processing line: ~ while y < ENDY do~ + y: 310, +** Processing line: ~ w: 1280,~ - Inside source: true *** True Line Result - while y < ENDY do -** Processing line: ~ while x < ENDX do~ + w: 1280, +** Processing line: ~ h: 100,~ - Inside source: true *** True Line Result - while x < ENDX do -** Processing line: ~ if (y == STARTY ||~ + h: 100, +** Processing line: ~ path: :block,~ - Inside source: true *** True Line Result - if (y == STARTY || -** Processing line: ~ y == (ENDY / 0.5) * 2 ||~ + path: :block, +** Processing line: ~ source_x: 0,~ - Inside source: true *** True Line Result - y == (ENDY / 0.5) * 2 || -** Processing line: ~ y == (ENDY / 0.5) * 2 + 0.5 ||~ + source_x: 0, +** Processing line: ~ source_y: 0,~ - Inside source: true *** True Line Result - y == (ENDY / 0.5) * 2 + 0.5 || -** Processing line: ~ y == ENDY - 0.5 ||~ + source_y: 0, +** Processing line: ~ source_w: 1280,~ - Inside source: true *** True Line Result - y == ENDY - 0.5 || -** Processing line: ~ x == STARTX ||~ + source_w: 1280, +** Processing line: ~ source_h: 100 }~ - Inside source: true *** True Line Result - x == STARTX || -** Processing line: ~ x == ENDX - 0.5)~ + source_h: 100 } +** Processing line: ~~ - Inside source: true *** True Line Result - x == ENDX - 0.5) -** Processing line: ~ z = rand(BOXDEPTH)~ + +** Processing line: ~ # After rendering :block, render gradient on top of :block.~ - Inside source: true *** True Line Result - z = rand(BOXDEPTH) -** Processing line: ~ z *= Math.sin(a / 2)~ + # After rendering :block, render gradient on top of :block. +** Processing line: ~ args.outputs.sprites << [0, 0, 1280, 720, :gradient]~ - Inside source: true *** True Line Result - z *= Math.sin(a / 2) -** Processing line: ~ x -= SPINPOINT~ + args.outputs.sprites << [0, 0, 1280, 720, :gradient] +** Processing line: ~~ - Inside source: true *** True Line Result - x -= SPINPOINT -** Processing line: ~ u = (x * c) - (z * s)~ + +** Processing line: ~ args.outputs.labels << [1270, 710, args.gtk.current_framerate, 0, 2, 255, 255, 255]~ - Inside source: true *** True Line Result - u = (x * c) - (z * s) -** Processing line: ~ v = (x * s) + (z * c)~ + args.outputs.labels << [1270, 710, args.gtk.current_framerate, 0, 2, 255, 255, 255] +** Processing line: ~ tick_instructions args, "Sample app shows how to use render_targets (programmatically create cached sprites)."~ - Inside source: true *** True Line Result - v = (x * s) + (z * c) -** Processing line: ~ k = DISTANCE.fdiv(100) + (v / 500 * YAW)~ + tick_instructions args, "Sample app shows how to use render_targets (programmatically create cached sprites)." +** Processing line: ~ end~ - Inside source: true *** True Line Result - k = DISTANCE.fdiv(100) + (v / 500 * YAW) -** Processing line: ~ u = u / k~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - u = u / k -** Processing line: ~ v = y / k~ + +** Processing line: ~ def tick_instructions args, text, y = 715~ - Inside source: true *** True Line Result - v = y / k -** Processing line: ~ w = POINTSIZE / 10 / k~ + def tick_instructions args, text, y = 715 +** Processing line: ~ return if args.state.key_event_occurred~ - Inside source: true *** True Line Result - w = POINTSIZE / 10 / k -** Processing line: ~ args.outputs.sprites << { x: offset_x + u - w, y: offset_y + v - w, w: w, h: w, path: 'sprites/square-blue.png'}~ + return if args.state.key_event_occurred +** Processing line: ~ if args.inputs.mouse.click ||~ - Inside source: true *** True Line Result - args.outputs.sprites << { x: offset_x + u - w, y: offset_y + v - w, w: w, h: w, path: 'sprites/square-blue.png'} -** Processing line: ~ x += SPINPOINT~ + if args.inputs.mouse.click || +** Processing line: ~ args.inputs.keyboard.directional_vector ||~ - Inside source: true *** True Line Result - x += SPINPOINT -** Processing line: ~ end~ + args.inputs.keyboard.directional_vector || +** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ - Inside source: true *** True Line Result - end -** Processing line: ~ x += 0.5~ + args.inputs.keyboard.key_down.enter || +** Processing line: ~ args.inputs.keyboard.key_down.escape~ - Inside source: true *** True Line Result - x += 0.5 -** Processing line: ~ end~ + args.inputs.keyboard.key_down.escape +** Processing line: ~ args.state.key_event_occurred = true~ - Inside source: true *** True Line Result - end -** Processing line: ~ y += 0.5~ + args.state.key_event_occurred = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - y += 0.5 -** Processing line: ~ x = STARTX~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - x = STARTX -** Processing line: ~ end~ + +** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ - Inside source: true *** True Line Result - end + 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 @@ -42635,198 +45632,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: ~* Arcade - Dueling Starships - main.rb~ +** Processing line: ~*** Advanced Rendering - Render Targets With Tile Manipulation - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Arcade - Dueling Starships - main.rb +*** Advanced Rendering - Render Targets With Tile Manipulation - 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_arcade/dueling_starships/app/main.rb~ +** Processing line: ~ # ./samples/07_advanced_rendering/02_render_targets_with_tile_manipulation/app/main.rb~ - Inside source: true *** True Line Result - # ./samples/99_genre_arcade/dueling_starships/app/main.rb -** Processing line: ~ class DuelingSpaceships~ + # ./samples/07_advanced_rendering/02_render_targets_with_tile_manipulation/app/main.rb +** Processing line: ~ # This sample is meant to show you how to do that dripping transition thing~ - Inside source: true *** True Line Result - class DuelingSpaceships -** Processing line: ~ attr_accessor :state, :inputs, :outputs, :grid~ + # This sample is meant to show you how to do that dripping transition thing +** Processing line: ~ # at the start of the original Doom. Most of this file is here to animate~ - Inside source: true *** True Line Result - attr_accessor :state, :inputs, :outputs, :grid -** Processing line: ~~ + # at the start of the original Doom. Most of this file is here to animate +** Processing line: ~ # a scene to wipe away; the actual wipe effect is in the last 20 lines or~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick~ + # a scene to wipe away; the actual wipe effect is in the last 20 lines or +** Processing line: ~ # so.~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ defaults~ + # so. +** Processing line: ~~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ render~ + +** Processing line: ~ $gtk.reset # reset all game state if reloaded.~ - Inside source: true *** True Line Result - render -** Processing line: ~ calc~ + $gtk.reset # reset all game state if reloaded. +** Processing line: ~~ - Inside source: true *** True Line Result - calc -** Processing line: ~ input~ + +** Processing line: ~ def circle_of_blocks pass, xoffset, yoffset, angleoffset, blocksize, distance~ - Inside source: true *** True Line Result - input -** Processing line: ~ end~ + def circle_of_blocks pass, xoffset, yoffset, angleoffset, blocksize, distance +** Processing line: ~ numblocks = 10~ - Inside source: true *** True Line Result - end + numblocks = 10 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def defaults~ -- Inside source: true -*** True Line Result - def defaults -** Processing line: ~ outputs.background_color = [0, 0, 0]~ -- Inside source: true -*** True Line Result - outputs.background_color = [0, 0, 0] -** Processing line: ~ state.ship_blue ||= new_blue_ship~ +** Processing line: ~ for i in 1..numblocks do~ - Inside source: true *** True Line Result - state.ship_blue ||= new_blue_ship -** Processing line: ~ state.ship_red ||= new_red_ship~ + for i in 1..numblocks do +** Processing line: ~ angle = ((360 / numblocks) * i) + angleoffset~ - Inside source: true *** True Line Result - state.ship_red ||= new_red_ship -** Processing line: ~ state.flames ||= []~ + angle = ((360 / numblocks) * i) + angleoffset +** Processing line: ~ radians = angle * (Math::PI / 180)~ - Inside source: true *** True Line Result - state.flames ||= [] -** Processing line: ~ state.bullets ||= []~ + radians = angle * (Math::PI / 180) +** Processing line: ~ x = (xoffset + (distance * Math.cos(radians))).round~ - Inside source: true *** True Line Result - state.bullets ||= [] -** Processing line: ~ state.ship_blue_score ||= 0~ + x = (xoffset + (distance * Math.cos(radians))).round +** Processing line: ~ y = (yoffset + (distance * Math.sin(radians))).round~ - Inside source: true *** True Line Result - state.ship_blue_score ||= 0 -** Processing line: ~ state.ship_red_score ||= 0~ + y = (yoffset + (distance * Math.sin(radians))).round +** Processing line: ~ pass.solids << [ x, y, blocksize, blocksize, 255, 255, 0 ]~ - Inside source: true *** True Line Result - state.ship_red_score ||= 0 -** Processing line: ~ state.stars ||= 100.map do~ + pass.solids << [ x, y, blocksize, blocksize, 255, 255, 0 ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.stars ||= 100.map do -** Processing line: ~ [rand.add(2).to_square(grid.w_half.randomize(:sign, :ratio),~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [rand.add(2).to_square(grid.w_half.randomize(:sign, :ratio), -** Processing line: ~ grid.h_half.randomize(:sign, :ratio)),~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - grid.h_half.randomize(:sign, :ratio)), -** Processing line: ~ 128 + 128.randomize(:ratio), 255, 255]~ + +** Processing line: ~ def draw_scene args, pass~ - Inside source: true *** True Line Result - 128 + 128.randomize(:ratio), 255, 255] -** Processing line: ~ end~ + def draw_scene args, pass +** Processing line: ~ pass.solids << [0, 360, 1280, 360, 0, 0, 200]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + pass.solids << [0, 360, 1280, 360, 0, 0, 200] +** Processing line: ~ pass.solids << [0, 0, 1280, 360, 0, 127, 0]~ - Inside source: true *** True Line Result - end + pass.solids << [0, 0, 1280, 360, 0, 127, 0] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def default_ship x, y, angle, sprite_path, bullet_sprite_path, color~ +** Processing line: ~ blocksize = 100~ - Inside source: true *** True Line Result - def default_ship x, y, angle, sprite_path, bullet_sprite_path, color -** Processing line: ~ state.new_entity(:ship,~ + blocksize = 100 +** Processing line: ~ angleoffset = args.state.tick_count * 2.5~ - Inside source: true *** True Line Result - state.new_entity(:ship, -** Processing line: ~ { x: x,~ -- Inside source: true -*** True Line Result - { x: x, -** Processing line: ~ y: y,~ + angleoffset = args.state.tick_count * 2.5 +** Processing line: ~ centerx = (1280 - blocksize) / 2~ - Inside source: true *** True Line Result - y: y, -** Processing line: ~ dy: 0,~ + centerx = (1280 - blocksize) / 2 +** Processing line: ~ centery = (720 - blocksize) / 2~ - Inside source: true *** True Line Result - dy: 0, -** Processing line: ~ dx: 0,~ + centery = (720 - blocksize) / 2 +** Processing line: ~~ - Inside source: true *** True Line Result - dx: 0, -** Processing line: ~ damage: 0,~ + +** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize * 2, 500~ - Inside source: true *** True Line Result - damage: 0, -** Processing line: ~ dead: false,~ + circle_of_blocks pass, centerx, centery, angleoffset, blocksize * 2, 500 +** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize, 325~ - Inside source: true *** True Line Result - dead: false, -** Processing line: ~ angle: angle,~ + circle_of_blocks pass, centerx, centery, angleoffset, blocksize, 325 +** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 2, 200~ - Inside source: true *** True Line Result - angle: angle, -** Processing line: ~ max_alpha: 255,~ + circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 2, 200 +** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 4, 100~ - Inside source: true *** True Line Result - max_alpha: 255, -** Processing line: ~ sprite_path: sprite_path,~ + circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 4, 100 +** Processing line: ~ end~ - Inside source: true *** True Line Result - sprite_path: sprite_path, -** Processing line: ~ bullet_sprite_path: bullet_sprite_path,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - bullet_sprite_path: bullet_sprite_path, -** Processing line: ~ color: color })~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - color: color }) -** Processing line: ~ end~ + def tick args +** Processing line: ~ segments = 160~ - Inside source: true *** True Line Result - end + segments = 160 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def new_red_ship~ +** Processing line: ~ # On the first tick, initialize some stuff.~ - Inside source: true *** True Line Result - def new_red_ship -** Processing line: ~ default_ship(400, 250.randomize(:sign, :ratio),~ + # On the first tick, initialize some stuff. +** Processing line: ~ if !args.state.yoffsets~ - Inside source: true *** True Line Result - default_ship(400, 250.randomize(:sign, :ratio), -** Processing line: ~ 180, 'sprites/ship_red.png', 'sprites/red_bullet.png',~ + if !args.state.yoffsets +** Processing line: ~ args.state.baseyoff = 0~ - Inside source: true *** True Line Result - 180, 'sprites/ship_red.png', 'sprites/red_bullet.png', -** Processing line: ~ [255, 90, 90])~ + args.state.baseyoff = 0 +** Processing line: ~ args.state.yoffsets = []~ - Inside source: true *** True Line Result - [255, 90, 90]) + args.state.yoffsets = [] +** Processing line: ~ for i in 0..segments do~ +- Inside source: true +*** True Line Result + for i in 0..segments do +** Processing line: ~ args.state.yoffsets << rand * 100~ +- Inside source: true +*** True Line Result + args.state.yoffsets << rand * 100 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -42835,22 +45832,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 new_blue_ship~ +** Processing line: ~ # Just draw some random stuff for a few seconds.~ - Inside source: true *** True Line Result - def new_blue_ship -** Processing line: ~ default_ship(-400, 250.randomize(:sign, :ratio),~ + # Just draw some random stuff for a few seconds. +** Processing line: ~ args.state.static_debounce ||= 60 * 2.5~ - Inside source: true *** True Line Result - default_ship(-400, 250.randomize(:sign, :ratio), -** Processing line: ~ 0, 'sprites/ship_blue.png', 'sprites/blue_bullet.png',~ + args.state.static_debounce ||= 60 * 2.5 +** Processing line: ~ if args.state.static_debounce > 0~ - Inside source: true *** True Line Result - 0, 'sprites/ship_blue.png', 'sprites/blue_bullet.png', -** Processing line: ~ [110, 140, 255])~ + if args.state.static_debounce > 0 +** Processing line: ~ last_frame = args.state.static_debounce == 1~ - Inside source: true *** True Line Result - [110, 140, 255]) + last_frame = args.state.static_debounce == 1 +** Processing line: ~ target = last_frame ? args.render_target(:last_frame) : args.outputs~ +- Inside source: true +*** True Line Result + target = last_frame ? args.render_target(:last_frame) : args.outputs +** Processing line: ~ draw_scene args, target~ +- Inside source: true +*** True Line Result + draw_scene args, target +** Processing line: ~ args.state.static_debounce -= 1~ +- Inside source: true +*** True Line Result + args.state.static_debounce -= 1 +** Processing line: ~ return unless last_frame~ +- Inside source: true +*** True Line Result + return unless last_frame ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -42859,134 +45872,138 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render~ +** Processing line: ~ # build up the wipe...~ - Inside source: true *** True Line Result - def render -** Processing line: ~ render_instructions~ + # build up the wipe... +** Processing line: ~~ - Inside source: true *** True Line Result - render_instructions -** Processing line: ~ render_score~ + +** Processing line: ~ # this is the thing we're wiping to.~ - Inside source: true *** True Line Result - render_score -** Processing line: ~ render_universe~ + # this is the thing we're wiping to. +** Processing line: ~ args.outputs.sprites << [ 0, 0, 1280, 720, 'dragonruby.png' ]~ - Inside source: true *** True Line Result - render_universe -** Processing line: ~ render_flames~ + args.outputs.sprites << [ 0, 0, 1280, 720, 'dragonruby.png' ] +** Processing line: ~~ - Inside source: true *** True Line Result - render_flames -** Processing line: ~ render_ships~ + +** Processing line: ~ return if (args.state.baseyoff > (1280 + 100)) # stop when done sliding~ - Inside source: true *** True Line Result - render_ships -** Processing line: ~ render_bullets~ + return if (args.state.baseyoff > (1280 + 100)) # stop when done sliding +** Processing line: ~~ - Inside source: true *** True Line Result - render_bullets -** Processing line: ~ end~ + +** Processing line: ~ segmentw = 1280 / segments~ - Inside source: true *** True Line Result - end + segmentw = 1280 / segments ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_ships~ +** Processing line: ~ x = 0~ - Inside source: true *** True Line Result - def render_ships -** Processing line: ~ update_ship_outputs(state.ship_blue)~ + x = 0 +** Processing line: ~ for i in 0..segments do~ - Inside source: true *** True Line Result - update_ship_outputs(state.ship_blue) -** Processing line: ~ update_ship_outputs(state.ship_red)~ + for i in 0..segments do +** Processing line: ~ yoffset = 0~ - Inside source: true *** True Line Result - update_ship_outputs(state.ship_red) -** Processing line: ~ outputs.sprites << [state.ship_blue.sprite, state.ship_red.sprite]~ + yoffset = 0 +** Processing line: ~ if args.state.yoffsets[i] < args.state.baseyoff~ - Inside source: true *** True Line Result - outputs.sprites << [state.ship_blue.sprite, state.ship_red.sprite] -** Processing line: ~ outputs.labels << [state.ship_blue.label, state.ship_red.label]~ + if args.state.yoffsets[i] < args.state.baseyoff +** Processing line: ~ yoffset = args.state.baseyoff - args.state.yoffsets[i]~ - Inside source: true *** True Line Result - outputs.labels << [state.ship_blue.label, state.ship_red.label] -** Processing line: ~ end~ + yoffset = args.state.baseyoff - args.state.yoffsets[i] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_instructions~ +** Processing line: ~ # (720 - yoffset) flips the coordinate system, (- 720) adjusts for the height of the segment.~ - Inside source: true *** True Line Result - def render_instructions -** Processing line: ~ return if state.ship_blue.dx > 0 || state.ship_blue.dy > 0 ||~ + # (720 - yoffset) flips the coordinate system, (- 720) adjusts for the height of the segment. +** Processing line: ~ args.outputs.sprites << [ x, (720 - yoffset) - 720, segmentw, 720, 'last_frame', 0, 255, 255, 255, 255, x, 0, segmentw, 720 ]~ - Inside source: true *** True Line Result - return if state.ship_blue.dx > 0 || state.ship_blue.dy > 0 || -** Processing line: ~ state.ship_red.dx > 0 || state.ship_red.dy > 0 ||~ + args.outputs.sprites << [ x, (720 - yoffset) - 720, segmentw, 720, 'last_frame', 0, 255, 255, 255, 255, x, 0, segmentw, 720 ] +** Processing line: ~ x += segmentw~ - Inside source: true *** True Line Result - state.ship_red.dx > 0 || state.ship_red.dy > 0 || -** Processing line: ~ state.flames.length > 0~ + x += segmentw +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.flames.length > 0 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.labels << [grid.left.shift_right(30),~ -- Inside source: true -*** True Line Result - outputs.labels << [grid.left.shift_right(30), -** Processing line: ~ grid.bottom.shift_up(30),~ +** Processing line: ~ args.state.baseyoff += 4~ - Inside source: true *** True Line Result - grid.bottom.shift_up(30), -** Processing line: ~ "Two gamepads needed to play. R1 to accelerate. Left and right on D-PAD to turn ship. Hold A to shoot. Press B to drop mines.",~ + args.state.baseyoff += 4 +** Processing line: ~~ - Inside source: true *** True Line Result - "Two gamepads needed to play. R1 to accelerate. Left and right on D-PAD to turn ship. Hold A to shoot. Press B to drop mines.", -** Processing line: ~ 0, 0, 255, 255, 255]~ + +** Processing line: ~ tick_instructions args, "Sample app shows an advanced usage of render_target."~ - Inside source: true *** True Line Result - 0, 0, 255, 255, 255] -** Processing line: ~ end~ + tick_instructions args, "Sample app shows an advanced usage of render_target." +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc~ +** Processing line: ~ def tick_instructions args, text, y = 715~ - Inside source: true *** True Line Result - def calc -** Processing line: ~ calc_thrusts~ + def tick_instructions args, text, y = 715 +** Processing line: ~ return if args.state.key_event_occurred~ - Inside source: true *** True Line Result - calc_thrusts -** Processing line: ~ calc_ships~ + return if args.state.key_event_occurred +** Processing line: ~ if args.inputs.mouse.click ||~ - Inside source: true *** True Line Result - calc_ships -** Processing line: ~ calc_bullets~ + if args.inputs.mouse.click || +** Processing line: ~ args.inputs.keyboard.directional_vector ||~ - Inside source: true *** True Line Result - calc_bullets -** Processing line: ~ calc_winner~ + args.inputs.keyboard.directional_vector || +** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ - Inside source: true *** True Line Result - calc_winner + args.inputs.keyboard.key_down.enter || +** 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 @@ -42995,530 +46012,526 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def input~ +** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ - Inside source: true *** True Line Result - def input -** Processing line: ~ input_accelerate~ + 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 - input_accelerate -** Processing line: ~ input_turn~ + 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 - input_turn -** Processing line: ~ input_bullets_and_mines~ + 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 - input_bullets_and_mines -** Processing line: ~ end~ + end +** Processing line: ~~ - 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: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ def render_score~ -- Inside source: true +** Processing line: ~*** Advanced Rendering - Render Target Viewports - main.rb~ +- Header detected. *** True Line Result - def render_score -** Processing line: ~ outputs.labels << [grid.left.shift_right(80),~ -- Inside source: true + *** True Line Result - outputs.labels << [grid.left.shift_right(80), -** Processing line: ~ grid.top.shift_down(40),~ +*** Advanced Rendering - Render Target Viewports - 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/03_render_target_viewports/app/main.rb~ - Inside source: true *** True Line Result - grid.top.shift_down(40), -** Processing line: ~ state.ship_blue_score, 30, 1, state.ship_blue.color]~ + # ./samples/07_advanced_rendering/03_render_target_viewports/app/main.rb +** Processing line: ~ =begin~ - Inside source: true *** True Line Result - state.ship_blue_score, 30, 1, state.ship_blue.color] + =begin ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.labels << [grid.right.shift_left(80),~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ - Inside source: true *** True Line Result - outputs.labels << [grid.right.shift_left(80), -** Processing line: ~ grid.top.shift_down(40),~ + APIs listing that haven't been encountered in previous sample apps: +** Processing line: ~~ - Inside source: true *** True Line Result - grid.top.shift_down(40), -** Processing line: ~ state.ship_red_score, 30, 1, state.ship_red.color]~ + +** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ - Inside source: true *** True Line Result - state.ship_red_score, 30, 1, state.ship_red.color] -** Processing line: ~ end~ + - args.state.new_entity: Used when we want to create a new object, like a sprite or button. +** Processing line: ~ For example, if we want to create a new button, we would declare it as a new entity and~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + For example, if we want to create a new button, we would declare it as a new entity and +** Processing line: ~ then define its properties. (Remember, you can use state to define ANY property and it will~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_universe~ + then define its properties. (Remember, you can use state to define ANY property and it will +** Processing line: ~ be retained across frames.)~ - Inside source: true *** True Line Result - def render_universe -** Processing line: ~ return if outputs.static_solids.any?~ + be retained across frames.) +** Processing line: ~~ - Inside source: true *** True Line Result - return if outputs.static_solids.any? -** Processing line: ~ outputs.static_solids << grid.rect~ + +** Processing line: ~ If you have a solar system and you're creating args.state.sun and setting its image path to an~ - Inside source: true *** True Line Result - outputs.static_solids << grid.rect -** Processing line: ~ outputs.static_solids << state.stars~ + If you have a solar system and you're creating args.state.sun and setting its image path to an +** Processing line: ~ image in the sprites folder, you would do the following:~ - Inside source: true *** True Line Result - outputs.static_solids << state.stars -** Processing line: ~ end~ + image in the sprites folder, you would do the following: +** Processing line: ~ (See samples/99_sample_nddnug_workshop for more details.)~ - Inside source: true *** True Line Result - end + (See samples/99_sample_nddnug_workshop for more details.) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def apply_round_finished_alpha entity~ +** Processing line: ~ args.state.sun ||= args.state.new_entity(:sun) do |s|~ - Inside source: true *** True Line Result - def apply_round_finished_alpha entity -** Processing line: ~ return entity unless state.round_finished_debounce~ + args.state.sun ||= args.state.new_entity(:sun) do |s| +** Processing line: ~ s.path = 'sprites/sun.png'~ - Inside source: true *** True Line Result - return entity unless state.round_finished_debounce -** Processing line: ~ entity.a *= state.round_finished_debounce.percentage_of(2.seconds)~ + s.path = 'sprites/sun.png' +** Processing line: ~ end~ - Inside source: true *** True Line Result - entity.a *= state.round_finished_debounce.percentage_of(2.seconds) -** Processing line: ~ return entity~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - return entity -** Processing line: ~ end~ + +** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ - Inside source: true *** True Line Result - end + - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +- Inside source: true +*** True Line Result + as Ruby code, and the placeholder is replaced with its corresponding value or result. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def update_ship_outputs ship, sprite_size = 66~ +** Processing line: ~ For example, if we have a variable~ - Inside source: true *** True Line Result - def update_ship_outputs ship, sprite_size = 66 -** Processing line: ~ ship.sprite =~ + For example, if we have a variable +** Processing line: ~ name = "Ruby"~ - Inside source: true *** True Line Result - ship.sprite = -** Processing line: ~ apply_round_finished_alpha [sprite_size.to_square(ship.x, ship.y),~ + name = "Ruby" +** Processing line: ~ then the line~ - Inside source: true *** True Line Result - apply_round_finished_alpha [sprite_size.to_square(ship.x, ship.y), -** Processing line: ~ ship.sprite_path,~ + then the line +** Processing line: ~ puts "How are you, #{name}?"~ - Inside source: true *** True Line Result - ship.sprite_path, -** Processing line: ~ ship.angle,~ + puts "How are you, #{name}?" +** Processing line: ~ would print "How are you, Ruby?" to the console.~ - Inside source: true *** True Line Result - ship.angle, -** Processing line: ~ ship.dead ? 0 : 255 * ship.created_at.ease(2.seconds)].sprite~ + would print "How are you, Ruby?" to the console. +** Processing line: ~ (Remember, string interpolation only works with double quotes!)~ - Inside source: true *** True Line Result - ship.dead ? 0 : 255 * ship.created_at.ease(2.seconds)].sprite -** Processing line: ~ ship.label =~ + (Remember, string interpolation only works with double quotes!) +** Processing line: ~~ - Inside source: true *** True Line Result - ship.label = -** Processing line: ~ apply_round_finished_alpha [ship.x,~ + +** Processing line: ~ - Ternary operator (?): Similar to if statement; first evalulates whether a statement is~ - Inside source: true *** True Line Result - apply_round_finished_alpha [ship.x, -** Processing line: ~ ship.y + 100,~ + - Ternary operator (?): Similar to if statement; first evalulates whether a statement is +** Processing line: ~ true or false, and then executes a command depending on that result.~ - Inside source: true *** True Line Result - ship.y + 100, -** Processing line: ~ "." * 5.minus(ship.damage).greater(0), 20, 1, ship.color, 255].label~ + true or false, and then executes a command depending on that result. +** Processing line: ~ For example, if we had a variable~ - Inside source: true *** True Line Result - "." * 5.minus(ship.damage).greater(0), 20, 1, ship.color, 255].label -** Processing line: ~ end~ + For example, if we had a variable +** Processing line: ~ grade = 75~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + grade = 75 +** Processing line: ~ and used the ternary operator in the command~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_flames sprite_size = 6~ + and used the ternary operator in the command +** Processing line: ~ pass_or_fail = grade > 65 ? "pass" : "fail"~ - Inside source: true *** True Line Result - def render_flames sprite_size = 6 -** Processing line: ~ outputs.sprites << state.flames.map do |p|~ + pass_or_fail = grade > 65 ? "pass" : "fail" +** Processing line: ~ then the value of pass_or_fail would be "pass" since grade's value was greater than 65.~ - Inside source: true *** True Line Result - outputs.sprites << state.flames.map do |p| -** Processing line: ~ apply_round_finished_alpha [sprite_size.to_square(p.x, p.y),~ + then the value of pass_or_fail would be "pass" since grade's value was greater than 65. +** Processing line: ~~ - Inside source: true *** True Line Result - apply_round_finished_alpha [sprite_size.to_square(p.x, p.y), -** Processing line: ~ 'sprites/flame.png', 0,~ + +** Processing line: ~ Reminders:~ - Inside source: true *** True Line Result - 'sprites/flame.png', 0, -** Processing line: ~ p.max_alpha * p.created_at.ease(p.lifetime, :flip)].sprite~ + Reminders: +** Processing line: ~~ - Inside source: true *** True Line Result - p.max_alpha * p.created_at.ease(p.lifetime, :flip)].sprite -** Processing line: ~ end~ + +** Processing line: ~ - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual +** Processing line: ~ 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).~ - Inside source: true *** True Line Result - end + 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720). ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_bullets sprite_size = 10~ -- Inside source: true -*** True Line Result - def render_bullets sprite_size = 10 -** Processing line: ~ outputs.sprites << state.bullets.map do |b|~ +** Processing line: ~ - Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction~ - Inside source: true *** True Line Result - outputs.sprites << state.bullets.map do |b| -** Processing line: ~ apply_round_finished_alpha [b.sprite_size.to_square(b.x, b.y),~ + - Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction +** Processing line: ~ by adding or subracting.~ - Inside source: true *** True Line Result - apply_round_finished_alpha [b.sprite_size.to_square(b.x, b.y), -** Processing line: ~ b.owner.bullet_sprite_path,~ + by adding or subracting. +** Processing line: ~~ - Inside source: true *** True Line Result - b.owner.bullet_sprite_path, -** Processing line: ~ 0, b.max_alpha].sprite~ + +** Processing line: ~ - ARRAY#inside_rect?: An array with at least two values is considered a point. An array~ - Inside source: true *** True Line Result - 0, b.max_alpha].sprite -** Processing line: ~ end~ + - ARRAY#inside_rect?: An array with at least two values is considered a point. An array +** Processing line: ~ with at least four values is considered a rect. The inside_rect? function returns true~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + with at least four values is considered a rect. The inside_rect? function returns true +** Processing line: ~ or false depending on if the point is inside the rect.~ - Inside source: true *** True Line Result - end + or false depending on if the point is inside the rect. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def wrap_location! location~ +** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect.~ - Inside source: true *** True Line Result - def wrap_location! location -** Processing line: ~ location.x = grid.left if location.x > grid.right~ + - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect. +** Processing line: ~~ - Inside source: true *** True Line Result - location.x = grid.left if location.x > grid.right -** Processing line: ~ location.x = grid.right if location.x < grid.left~ + +** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ - Inside source: true *** True Line Result - location.x = grid.right if location.x < grid.left -** Processing line: ~ location.y = grid.top if location.y < grid.bottom~ + - args.inputs.mouse.click: This property will be set if the mouse was clicked. +** Processing line: ~ For more information about the mouse, go to mygame/documentation/07-mouse.md.~ - Inside source: true *** True Line Result - location.y = grid.top if location.y < grid.bottom -** Processing line: ~ location.y = grid.bottom if location.y > grid.top~ + For more information about the mouse, go to mygame/documentation/07-mouse.md. +** Processing line: ~~ - Inside source: true *** True Line Result - location.y = grid.bottom if location.y > grid.top -** Processing line: ~ location~ + +** Processing line: ~ - args.inputs.keyboard.key_up.KEY: The value of the properties will be set~ - Inside source: true *** True Line Result - location -** Processing line: ~ end~ + - args.inputs.keyboard.key_up.KEY: The value of the properties will be set +** Processing line: ~ to the frame that the key_up event occurred (the frame correlates~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + to the frame that the key_up event occurred (the frame correlates +** Processing line: ~ to args.state.tick_count).~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_thrusts~ + to args.state.tick_count). +** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ - Inside source: true *** True Line Result - def calc_thrusts -** Processing line: ~ state.flames =~ + For more information about the keyboard, go to mygame/documentation/06-keyboard.md. +** Processing line: ~~ - Inside source: true *** True Line Result - state.flames = -** Processing line: ~ state.flames~ + +** Processing line: ~ - args.state.labels:~ - Inside source: true *** True Line Result - state.flames -** Processing line: ~ .reject(&:old?)~ + - args.state.labels: +** Processing line: ~ The parameters for a label are~ - Inside source: true *** True Line Result - .reject(&:old?) -** Processing line: ~ .map do |p|~ + The parameters for a label are +** Processing line: ~ 1. the position (x, y)~ - Inside source: true *** True Line Result - .map do |p| -** Processing line: ~ p.speed *= 0.9~ + 1. the position (x, y) +** Processing line: ~ 2. the text~ - Inside source: true *** True Line Result - p.speed *= 0.9 -** Processing line: ~ p.y += p.angle.vector_y(p.speed)~ + 2. the text +** Processing line: ~ 3. the size~ - Inside source: true *** True Line Result - p.y += p.angle.vector_y(p.speed) -** Processing line: ~ p.x += p.angle.vector_x(p.speed)~ + 3. the size +** Processing line: ~ 4. the alignment~ - Inside source: true *** True Line Result - p.x += p.angle.vector_x(p.speed) -** Processing line: ~ wrap_location! p~ + 4. the alignment +** Processing line: ~ 5. the color (red, green, and blue saturations)~ - Inside source: true *** True Line Result - wrap_location! p -** Processing line: ~ end~ + 5. the color (red, green, and blue saturations) +** Processing line: ~ 6. the alpha (or transparency)~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 6. the alpha (or transparency) +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ - Inside source: true *** True Line Result - end + For more information about labels, go to mygame/documentation/02-labels.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def all_ships~ +** Processing line: ~ - args.state.lines:~ - Inside source: true *** True Line Result - def all_ships -** Processing line: ~ [state.ship_blue, state.ship_red]~ + - args.state.lines: +** Processing line: ~ The parameters for a line are~ - Inside source: true *** True Line Result - [state.ship_blue, state.ship_red] -** Processing line: ~ end~ + The parameters for a line are +** Processing line: ~ 1. the starting position (x, y)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 1. the starting position (x, y) +** Processing line: ~ 2. the ending position (x2, y2)~ - Inside source: true *** True Line Result - -** Processing line: ~ def alive_ships~ + 2. the ending position (x2, y2) +** Processing line: ~ 3. the color (red, green, and blue saturations)~ - Inside source: true *** True Line Result - def alive_ships -** Processing line: ~ all_ships.reject { |s| s.dead }~ + 3. the color (red, green, and blue saturations) +** Processing line: ~ 4. the alpha (or transparency)~ - Inside source: true *** True Line Result - all_ships.reject { |s| s.dead } -** Processing line: ~ end~ + 4. the alpha (or transparency) +** Processing line: ~ For more information about lines, go to mygame/documentation/04-lines.md.~ - Inside source: true *** True Line Result - end + For more information about lines, go to mygame/documentation/04-lines.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc_bullet bullet~ -- Inside source: true -*** True Line Result - def calc_bullet bullet -** Processing line: ~ bullet.y += bullet.angle.vector_y(bullet.speed)~ +** Processing line: ~ - args.state.solids (and args.state.borders):~ - Inside source: true *** True Line Result - bullet.y += bullet.angle.vector_y(bullet.speed) -** Processing line: ~ bullet.x += bullet.angle.vector_x(bullet.speed)~ + - args.state.solids (and args.state.borders): +** Processing line: ~ The parameters for a solid (or border) are~ - Inside source: true *** True Line Result - bullet.x += bullet.angle.vector_x(bullet.speed) -** Processing line: ~ wrap_location! bullet~ + The parameters for a solid (or border) are +** Processing line: ~ 1. the position (x, y)~ - Inside source: true *** True Line Result - wrap_location! bullet -** Processing line: ~ explode_bullet! bullet if bullet.old?~ + 1. the position (x, y) +** Processing line: ~ 2. the width (w)~ - Inside source: true *** True Line Result - explode_bullet! bullet if bullet.old? -** Processing line: ~ return if bullet.exploded~ + 2. the width (w) +** Processing line: ~ 3. the height (h)~ - Inside source: true *** True Line Result - return if bullet.exploded -** Processing line: ~ return if state.round_finished~ + 3. the height (h) +** Processing line: ~ 4. the color (r, g, b)~ - Inside source: true *** True Line Result - return if state.round_finished -** Processing line: ~ alive_ships.each do |s|~ + 4. the color (r, g, b) +** Processing line: ~ 5. the alpha (or transparency)~ - Inside source: true *** True Line Result - alive_ships.each do |s| -** Processing line: ~ if s != bullet.owner &&~ + 5. the alpha (or transparency) +** Processing line: ~ For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md.~ - Inside source: true *** True Line Result - if s != bullet.owner && -** Processing line: ~ s.sprite.intersect_rect?(bullet.sprite_size.to_square(bullet.x, bullet.y))~ + For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md. +** Processing line: ~~ - Inside source: true *** True Line Result - s.sprite.intersect_rect?(bullet.sprite_size.to_square(bullet.x, bullet.y)) -** Processing line: ~ explode_bullet! bullet, 10, 5, 30~ + +** Processing line: ~ - args.state.sprites:~ - Inside source: true *** True Line Result - explode_bullet! bullet, 10, 5, 30 -** Processing line: ~ s.damage += 1~ + - args.state.sprites: +** Processing line: ~ The parameters for a sprite are~ - Inside source: true *** True Line Result - s.damage += 1 -** Processing line: ~ end~ + The parameters for a sprite are +** Processing line: ~ 1. the position (x, y)~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 1. the position (x, y) +** Processing line: ~ 2. the width (w)~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 2. the width (w) +** Processing line: ~ 3. the height (h)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 3. the height (h) +** Processing line: ~ 4. the image path~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_bullets~ + 4. the image path +** Processing line: ~ 5. the angle~ - Inside source: true *** True Line Result - def calc_bullets -** Processing line: ~ state.bullets.each { |b| calc_bullet b }~ + 5. the angle +** Processing line: ~ 6. the alpha (or transparency)~ - Inside source: true *** True Line Result - state.bullets.each { |b| calc_bullet b } -** Processing line: ~ state.bullets.reject! { |b| b.exploded }~ + 6. the alpha (or transparency) +** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ - Inside source: true *** True Line Result - state.bullets.reject! { |b| b.exploded } -** Processing line: ~ end~ + For more information about sprites, go to mygame/documentation/05-sprites.md. +** Processing line: ~ =end~ - Inside source: true *** True Line Result - end + =end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def create_explosion! type, entity, flame_count, max_speed, lifetime, max_alpha = 255~ -- Inside source: true -*** True Line Result - def create_explosion! type, entity, flame_count, max_speed, lifetime, max_alpha = 255 -** Processing line: ~ flame_count.times do~ -- Inside source: true -*** True Line Result - flame_count.times do -** Processing line: ~ state.flames << state.new_entity(type,~ +** Processing line: ~ # This sample app shows different objects that can be used when making games, such as labels,~ - Inside source: true *** True Line Result - state.flames << state.new_entity(type, -** Processing line: ~ { angle: 360.randomize(:ratio),~ + # This sample app shows different objects that can be used when making games, such as labels, +** Processing line: ~ # lines, sprites, solids, buttons, etc. Each demo section shows how these objects can be used.~ - Inside source: true *** True Line Result - { angle: 360.randomize(:ratio), -** Processing line: ~ speed: max_speed.randomize(:ratio),~ + # lines, sprites, solids, buttons, etc. Each demo section shows how these objects can be used. +** Processing line: ~~ - Inside source: true *** True Line Result - speed: max_speed.randomize(:ratio), -** Processing line: ~ lifetime: lifetime,~ + +** Processing line: ~ # Also note that state.tick_count refers to the passage of time, or current frame.~ - Inside source: true *** True Line Result - lifetime: lifetime, -** Processing line: ~ x: entity.x,~ + # Also note that state.tick_count refers to the passage of time, or current frame. +** Processing line: ~~ - Inside source: true *** True Line Result - x: entity.x, -** Processing line: ~ y: entity.y,~ + +** Processing line: ~ class TechDemo~ - Inside source: true *** True Line Result - y: entity.y, -** Processing line: ~ max_alpha: max_alpha })~ + class TechDemo +** Processing line: ~ attr_accessor :inputs, :state, :outputs, :grid, :args~ - Inside source: true *** True Line Result - max_alpha: max_alpha }) -** Processing line: ~ end~ + attr_accessor :inputs, :state, :outputs, :grid, :args +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ # Calls all methods necessary for the app to run properly.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Calls all methods necessary for the app to run properly. +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - -** Processing line: ~ def explode_bullet! bullet, flame_override = 5, max_speed = 5, lifetime = 10~ + def tick +** Processing line: ~ labels_tech_demo~ - Inside source: true *** True Line Result - def explode_bullet! bullet, flame_override = 5, max_speed = 5, lifetime = 10 -** Processing line: ~ bullet.exploded = true~ + labels_tech_demo +** Processing line: ~ lines_tech_demo~ - Inside source: true *** True Line Result - bullet.exploded = true -** Processing line: ~ create_explosion! :bullet_explosion,~ + lines_tech_demo +** Processing line: ~ solids_tech_demo~ - Inside source: true *** True Line Result - create_explosion! :bullet_explosion, -** Processing line: ~ bullet,~ + solids_tech_demo +** Processing line: ~ borders_tech_demo~ - Inside source: true *** True Line Result - bullet, -** Processing line: ~ flame_override,~ + borders_tech_demo +** Processing line: ~ sprites_tech_demo~ - Inside source: true *** True Line Result - flame_override, -** Processing line: ~ max_speed,~ + sprites_tech_demo +** Processing line: ~ keyboards_tech_demo~ - Inside source: true *** True Line Result - max_speed, -** Processing line: ~ lifetime,~ + keyboards_tech_demo +** Processing line: ~ controller_tech_demo~ - Inside source: true *** True Line Result - lifetime, -** Processing line: ~ bullet.max_alpha~ + controller_tech_demo +** Processing line: ~ mouse_tech_demo~ - Inside source: true *** True Line Result - bullet.max_alpha -** Processing line: ~ end~ + mouse_tech_demo +** Processing line: ~ point_to_rect_tech_demo~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + point_to_rect_tech_demo +** Processing line: ~ rect_to_rect_tech_demo~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_ship ship~ + rect_to_rect_tech_demo +** Processing line: ~ button_tech_demo~ - Inside source: true *** True Line Result - def calc_ship ship -** Processing line: ~ ship.x += ship.dx~ + button_tech_demo +** Processing line: ~ export_game_state_demo~ - Inside source: true *** True Line Result - ship.x += ship.dx -** Processing line: ~ ship.y += ship.dy~ + export_game_state_demo +** Processing line: ~ window_state_demo~ - Inside source: true *** True Line Result - ship.y += ship.dy -** Processing line: ~ wrap_location! ship~ + window_state_demo +** Processing line: ~ render_seperators~ - Inside source: true *** True Line Result - wrap_location! ship + render_seperators ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -43527,74 +46540,74 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_ships~ +** Processing line: ~ # Shows output of different kinds of labels on the screen~ - Inside source: true *** True Line Result - def calc_ships -** Processing line: ~ all_ships.each { |s| calc_ship s }~ + # Shows output of different kinds of labels on the screen +** Processing line: ~ def labels_tech_demo~ - Inside source: true *** True Line Result - all_ships.each { |s| calc_ship s } -** Processing line: ~ return if all_ships.any? { |s| s.dead }~ + def labels_tech_demo +** Processing line: ~ outputs.labels << [grid.left.shift_right(5), grid.top.shift_down(5), "This is a label located at the top left."]~ - Inside source: true *** True Line Result - return if all_ships.any? { |s| s.dead } -** Processing line: ~ return if state.round_finished~ + outputs.labels << [grid.left.shift_right(5), grid.top.shift_down(5), "This is a label located at the top left."] +** Processing line: ~ outputs.labels << [grid.left.shift_right(5), grid.bottom.shift_up(30), "This is a label located at the bottom left."]~ - Inside source: true *** True Line Result - return if state.round_finished -** Processing line: ~ return unless state.ship_blue.sprite.intersect_rect?(state.ship_red.sprite)~ + outputs.labels << [grid.left.shift_right(5), grid.bottom.shift_up(30), "This is a label located at the bottom left."] +** Processing line: ~ outputs.labels << [ 5, 690, "Labels (x, y, text, size, align, r, g, b, a)"]~ - Inside source: true *** True Line Result - return unless state.ship_blue.sprite.intersect_rect?(state.ship_red.sprite) -** Processing line: ~ state.ship_blue.damage = 5~ + outputs.labels << [ 5, 690, "Labels (x, y, text, size, align, r, g, b, a)"] +** Processing line: ~ outputs.labels << [ 5, 660, "Smaller label.", -2]~ - Inside source: true *** True Line Result - state.ship_blue.damage = 5 -** Processing line: ~ state.ship_red.damage = 5~ + outputs.labels << [ 5, 660, "Smaller label.", -2] +** Processing line: ~ outputs.labels << [ 5, 630, "Small label.", -1]~ - Inside source: true *** True Line Result - state.ship_red.damage = 5 -** Processing line: ~ end~ + outputs.labels << [ 5, 630, "Small label.", -1] +** Processing line: ~ outputs.labels << [ 5, 600, "Medium label.", 0]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.labels << [ 5, 600, "Medium label.", 0] +** Processing line: ~ outputs.labels << [ 5, 570, "Large label.", 1]~ - Inside source: true *** True Line Result - -** Processing line: ~ def create_thruster_flames! ship~ + outputs.labels << [ 5, 570, "Large label.", 1] +** Processing line: ~ outputs.labels << [ 5, 540, "Larger label.", 2]~ - Inside source: true *** True Line Result - def create_thruster_flames! ship -** Processing line: ~ state.flames << state.new_entity(:ship_thruster,~ + outputs.labels << [ 5, 540, "Larger label.", 2] +** Processing line: ~ outputs.labels << [300, 660, "Left aligned.", 0, 2]~ - Inside source: true *** True Line Result - state.flames << state.new_entity(:ship_thruster, -** Processing line: ~ { angle: ship.angle + 180 + 60.randomize(:sign, :ratio),~ + outputs.labels << [300, 660, "Left aligned.", 0, 2] +** Processing line: ~ outputs.labels << [300, 640, "Center aligned.", 0, 1]~ - Inside source: true *** True Line Result - { angle: ship.angle + 180 + 60.randomize(:sign, :ratio), -** Processing line: ~ speed: 5.randomize(:ratio),~ + outputs.labels << [300, 640, "Center aligned.", 0, 1] +** Processing line: ~ outputs.labels << [300, 620, "Right aligned.", 0, 0]~ - Inside source: true *** True Line Result - speed: 5.randomize(:ratio), -** Processing line: ~ max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds),~ + outputs.labels << [300, 620, "Right aligned.", 0, 0] +** Processing line: ~ outputs.labels << [175, 595, "Red Label.", 0, 0, 255, 0, 0]~ - Inside source: true *** True Line Result - max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), -** Processing line: ~ lifetime: 30,~ + outputs.labels << [175, 595, "Red Label.", 0, 0, 255, 0, 0] +** Processing line: ~ outputs.labels << [175, 575, "Green Label.", 0, 0, 0, 255, 0]~ - Inside source: true *** True Line Result - lifetime: 30, -** Processing line: ~ x: ship.x - ship.angle.vector_x(40) + 5.randomize(:sign, :ratio),~ + outputs.labels << [175, 575, "Green Label.", 0, 0, 0, 255, 0] +** Processing line: ~ outputs.labels << [175, 555, "Blue Label.", 0, 0, 0, 0, 255]~ - Inside source: true *** True Line Result - x: ship.x - ship.angle.vector_x(40) + 5.randomize(:sign, :ratio), -** Processing line: ~ y: ship.y - ship.angle.vector_y(40) + 5.randomize(:sign, :ratio) })~ + outputs.labels << [175, 555, "Blue Label.", 0, 0, 0, 0, 255] +** Processing line: ~ outputs.labels << [175, 535, "Faded Label.", 0, 0, 0, 0, 0, 128]~ - Inside source: true *** True Line Result - y: ship.y - ship.angle.vector_y(40) + 5.randomize(:sign, :ratio) }) + outputs.labels << [175, 535, "Faded Label.", 0, 0, 0, 0, 0, 128] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -43603,78 +46616,78 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def input_accelerate_ship should_move_ship, ship~ +** Processing line: ~ # Shows output of lines on the screen~ - Inside source: true *** True Line Result - def input_accelerate_ship should_move_ship, ship -** Processing line: ~ return if ship.dead~ + # Shows output of lines on the screen +** Processing line: ~ def lines_tech_demo~ - Inside source: true *** True Line Result - return if ship.dead -** Processing line: ~~ + def lines_tech_demo +** Processing line: ~ outputs.labels << [5, 500, "Lines (x, y, x2, y2, r, g, b, a)"]~ - Inside source: true *** True Line Result - -** Processing line: ~ should_move_ship &&= (ship.dx + ship.dy).abs < 5~ + outputs.labels << [5, 500, "Lines (x, y, x2, y2, r, g, b, a)"] +** Processing line: ~ outputs.lines << [5, 450, 100, 450]~ - Inside source: true *** True Line Result - should_move_ship &&= (ship.dx + ship.dy).abs < 5 -** Processing line: ~~ + outputs.lines << [5, 450, 100, 450] +** Processing line: ~ outputs.lines << [5, 430, 300, 430]~ - Inside source: true *** True Line Result - -** Processing line: ~ if should_move_ship~ + outputs.lines << [5, 430, 300, 430] +** Processing line: ~ outputs.lines << [5, 410, 300, 410, state.tick_count % 255, 0, 0, 255] # red saturation changes~ - Inside source: true *** True Line Result - if should_move_ship -** Processing line: ~ create_thruster_flames! ship~ + outputs.lines << [5, 410, 300, 410, state.tick_count % 255, 0, 0, 255] # red saturation changes +** Processing line: ~ outputs.lines << [5, 390 - state.tick_count % 25, 300, 390, 0, 0, 0, 255] # y position changes~ - Inside source: true *** True Line Result - create_thruster_flames! ship -** Processing line: ~ ship.dx += ship.angle.vector_x 0.050~ + outputs.lines << [5, 390 - state.tick_count % 25, 300, 390, 0, 0, 0, 255] # y position changes +** Processing line: ~ outputs.lines << [5 + state.tick_count % 200, 360, 300, 360, 0, 0, 0, 255] # x position changes~ - Inside source: true *** True Line Result - ship.dx += ship.angle.vector_x 0.050 -** Processing line: ~ ship.dy += ship.angle.vector_y 0.050~ + outputs.lines << [5 + state.tick_count % 200, 360, 300, 360, 0, 0, 0, 255] # x position changes +** Processing line: ~ end~ - Inside source: true *** True Line Result - ship.dy += ship.angle.vector_y 0.050 -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ ship.dx *= 0.99~ + +** Processing line: ~ # Shows output of different kinds of solids on the screen~ - Inside source: true *** True Line Result - ship.dx *= 0.99 -** Processing line: ~ ship.dy *= 0.99~ + # Shows output of different kinds of solids on the screen +** Processing line: ~ def solids_tech_demo~ - Inside source: true *** True Line Result - ship.dy *= 0.99 -** Processing line: ~ end~ + def solids_tech_demo +** Processing line: ~ outputs.labels << [ 5, 350, "Solids (x, y, w, h, r, g, b, a)"]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + outputs.labels << [ 5, 350, "Solids (x, y, w, h, r, g, b, a)"] +** Processing line: ~ outputs.solids << [ 10, 270, 50, 50]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.solids << [ 10, 270, 50, 50] +** Processing line: ~ outputs.solids << [ 70, 270, 50, 50, 0, 0, 0]~ - Inside source: true *** True Line Result - -** Processing line: ~ def input_accelerate~ + outputs.solids << [ 70, 270, 50, 50, 0, 0, 0] +** Processing line: ~ outputs.solids << [130, 270, 50, 50, 255, 0, 0]~ - Inside source: true *** True Line Result - def input_accelerate -** Processing line: ~ input_accelerate_ship inputs.controller_one.key_held.r1 || inputs.keyboard.up, state.ship_blue~ + outputs.solids << [130, 270, 50, 50, 255, 0, 0] +** Processing line: ~ outputs.solids << [190, 270, 50, 50, 255, 0, 0, 128]~ - Inside source: true *** True Line Result - input_accelerate_ship inputs.controller_one.key_held.r1 || inputs.keyboard.up, state.ship_blue -** Processing line: ~ input_accelerate_ship inputs.controller_two.key_held.r1, state.ship_red~ + outputs.solids << [190, 270, 50, 50, 255, 0, 0, 128] +** Processing line: ~ outputs.solids << [250, 270, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes~ - Inside source: true *** True Line Result - input_accelerate_ship inputs.controller_two.key_held.r1, state.ship_red + outputs.solids << [250, 270, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -43683,34 +46696,42 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def input_turn_ship direction, ship~ +** Processing line: ~ # Shows output of different kinds of borders on the screen~ - Inside source: true *** True Line Result - def input_turn_ship direction, ship -** Processing line: ~ ship.angle -= 3 * direction~ + # Shows output of different kinds of borders on the screen +** Processing line: ~ # The parameters for a border are the same as the parameters for a solid~ - Inside source: true *** True Line Result - ship.angle -= 3 * direction -** Processing line: ~ end~ + # The parameters for a border are the same as the parameters for a solid +** Processing line: ~ def borders_tech_demo~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def borders_tech_demo +** Processing line: ~ outputs.labels << [ 5, 260, "Borders (x, y, w, h, r, g, b, a)"]~ - Inside source: true *** True Line Result - -** Processing line: ~ def input_turn~ + outputs.labels << [ 5, 260, "Borders (x, y, w, h, r, g, b, a)"] +** Processing line: ~ outputs.borders << [ 10, 180, 50, 50]~ - Inside source: true *** True Line Result - def input_turn -** Processing line: ~ input_turn_ship inputs.controller_one.left_right + inputs.keyboard.left_right, state.ship_blue~ + outputs.borders << [ 10, 180, 50, 50] +** Processing line: ~ outputs.borders << [ 70, 180, 50, 50, 0, 0, 0]~ - Inside source: true *** True Line Result - input_turn_ship inputs.controller_one.left_right + inputs.keyboard.left_right, state.ship_blue -** Processing line: ~ input_turn_ship inputs.controller_two.left_right, state.ship_red~ + outputs.borders << [ 70, 180, 50, 50, 0, 0, 0] +** Processing line: ~ outputs.borders << [130, 180, 50, 50, 255, 0, 0]~ - Inside source: true *** True Line Result - input_turn_ship inputs.controller_two.left_right, state.ship_red + outputs.borders << [130, 180, 50, 50, 255, 0, 0] +** Processing line: ~ outputs.borders << [190, 180, 50, 50, 255, 0, 0, 128]~ +- Inside source: true +*** True Line Result + outputs.borders << [190, 180, 50, 50, 255, 0, 0, 128] +** Processing line: ~ outputs.borders << [250, 180, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes~ +- Inside source: true +*** True Line Result + outputs.borders << [250, 180, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -43719,58 +46740,58 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def input_bullet create_bullet, ship~ +** Processing line: ~ # Shows output of different kinds of sprites on the screen~ - Inside source: true *** True Line Result - def input_bullet create_bullet, ship -** Processing line: ~ return unless create_bullet~ + # Shows output of different kinds of sprites on the screen +** Processing line: ~ def sprites_tech_demo~ - Inside source: true *** True Line Result - return unless create_bullet -** Processing line: ~ return if ship.dead~ + def sprites_tech_demo +** Processing line: ~ outputs.labels << [ 5, 170, "Sprites (x, y, w, h, path, angle, a)"]~ - Inside source: true *** True Line Result - return if ship.dead -** Processing line: ~~ + outputs.labels << [ 5, 170, "Sprites (x, y, w, h, path, angle, a)"] +** Processing line: ~ outputs.sprites << [ 10, 40, 128, 101, 'dragonruby.png']~ - Inside source: true *** True Line Result - -** Processing line: ~ state.bullets << state.new_entity(:ship_bullet,~ + outputs.sprites << [ 10, 40, 128, 101, 'dragonruby.png'] +** Processing line: ~ outputs.sprites << [ 150, 40, 128, 101, 'dragonruby.png', state.tick_count % 360] # angle changes~ - Inside source: true *** True Line Result - state.bullets << state.new_entity(:ship_bullet, -** Processing line: ~ { owner: ship,~ + outputs.sprites << [ 150, 40, 128, 101, 'dragonruby.png', state.tick_count % 360] # angle changes +** Processing line: ~ outputs.sprites << [ 300, 40, 128, 101, 'dragonruby.png', 0, state.tick_count % 255] # transparency changes~ - Inside source: true *** True Line Result - { owner: ship, -** Processing line: ~ angle: ship.angle,~ + outputs.sprites << [ 300, 40, 128, 101, 'dragonruby.png', 0, state.tick_count % 255] # transparency changes +** Processing line: ~ end~ - Inside source: true *** True Line Result - angle: ship.angle, -** Processing line: ~ max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds),~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), -** Processing line: ~ speed: 5 + ship.dx.mult(ship.angle.vector_x) + ship.dy.mult(ship.angle.vector_y),~ + +** Processing line: ~ # Holds size, alignment, color (black), and alpha (transparency) parameters~ - Inside source: true *** True Line Result - speed: 5 + ship.dx.mult(ship.angle.vector_x) + ship.dy.mult(ship.angle.vector_y), -** Processing line: ~ lifetime: 120,~ + # Holds size, alignment, color (black), and alpha (transparency) parameters +** Processing line: ~ # Using small_font as a parameter accounts for all remaining parameters~ - Inside source: true *** True Line Result - lifetime: 120, -** Processing line: ~ sprite_size: 10,~ + # Using small_font as a parameter accounts for all remaining parameters +** Processing line: ~ # so they don't have to be repeatedly typed~ - Inside source: true *** True Line Result - sprite_size: 10, -** Processing line: ~ x: ship.x + ship.angle.vector_x * 32,~ + # so they don't have to be repeatedly typed +** Processing line: ~ def small_font~ - Inside source: true *** True Line Result - x: ship.x + ship.angle.vector_x * 32, -** Processing line: ~ y: ship.y + ship.angle.vector_y * 32 })~ + def small_font +** Processing line: ~ [-2, 0, 0, 0, 0, 255]~ - Inside source: true *** True Line Result - y: ship.y + ship.angle.vector_y * 32 }) + [-2, 0, 0, 0, 0, 255] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -43779,142 +46800,130 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def input_mine create_mine, ship~ +** Processing line: ~ # Sets position of each row~ - Inside source: true *** True Line Result - def input_mine create_mine, ship -** Processing line: ~ return unless create_mine~ + # Sets position of each row +** Processing line: ~ # Converts given row value to pixels that DragonRuby understands~ - Inside source: true *** True Line Result - return unless create_mine -** Processing line: ~ return if ship.dead~ + # Converts given row value to pixels that DragonRuby understands +** Processing line: ~ def row_to_px row_number~ - Inside source: true *** True Line Result - return if ship.dead + def row_to_px row_number ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.bullets << state.new_entity(:ship_bullet,~ +** Processing line: ~ # Row 0 starts 5 units below the top of the grid.~ - Inside source: true *** True Line Result - state.bullets << state.new_entity(:ship_bullet, -** Processing line: ~ { owner: ship,~ + # Row 0 starts 5 units below the top of the grid. +** Processing line: ~ # Each row afterward is 20 units lower.~ - Inside source: true *** True Line Result - { owner: ship, -** Processing line: ~ angle: 360.randomize(:sign, :ratio),~ + # Each row afterward is 20 units lower. +** Processing line: ~ grid.top.shift_down(5).shift_down(20 * row_number)~ - Inside source: true *** True Line Result - angle: 360.randomize(:sign, :ratio), -** Processing line: ~ max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds),~ + grid.top.shift_down(5).shift_down(20 * row_number) +** Processing line: ~ end~ - Inside source: true *** True Line Result - max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), -** Processing line: ~ speed: 0.02,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - speed: 0.02, -** Processing line: ~ sprite_size: 10,~ + +** Processing line: ~ # Uses labels to output current game time (passage of time), and whether or not "h" was pressed~ - Inside source: true *** True Line Result - sprite_size: 10, -** Processing line: ~ lifetime: 600,~ + # Uses labels to output current game time (passage of time), and whether or not "h" was pressed +** Processing line: ~ # If "h" is pressed, the frame is output when the key_up event occurred~ - Inside source: true *** True Line Result - lifetime: 600, -** Processing line: ~ x: ship.x + ship.angle.vector_x * -50,~ + # If "h" is pressed, the frame is output when the key_up event occurred +** Processing line: ~ def keyboards_tech_demo~ - Inside source: true *** True Line Result - x: ship.x + ship.angle.vector_x * -50, -** Processing line: ~ y: ship.y + ship.angle.vector_y * -50 })~ + def keyboards_tech_demo +** Processing line: ~ outputs.labels << [460, row_to_px(0), "Current game time: #{state.tick_count}", small_font]~ - Inside source: true *** True Line Result - y: ship.y + ship.angle.vector_y * -50 }) -** Processing line: ~ end~ + outputs.labels << [460, row_to_px(0), "Current game time: #{state.tick_count}", small_font] +** Processing line: ~ outputs.labels << [460, row_to_px(2), "Keyboard input: inputs.keyboard.key_up.h", small_font]~ - Inside source: true *** True Line Result - end + outputs.labels << [460, row_to_px(2), "Keyboard input: inputs.keyboard.key_up.h", small_font] +** Processing line: ~ outputs.labels << [460, row_to_px(3), "Press \"h\" on the keyboard.", small_font]~ +- Inside source: true +*** True Line Result + outputs.labels << [460, row_to_px(3), "Press \"h\" on the keyboard.", small_font] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def input_bullets_and_mines~ +** Processing line: ~ if inputs.keyboard.key_up.h # if "h" key_up event occurs~ - Inside source: true *** True Line Result - def input_bullets_and_mines -** Processing line: ~ return if state.bullets.length > 100~ + if inputs.keyboard.key_up.h # if "h" key_up event occurs +** Processing line: ~ state.h_pressed_at = state.tick_count # frame it occurred is stored~ - Inside source: true *** True Line Result - return if state.bullets.length > 100 -** Processing line: ~~ + state.h_pressed_at = state.tick_count # frame it occurred is stored +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ [~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [ -** Processing line: ~ [inputs.controller_one.key_held.a || inputs.keyboard.key_held.space,~ + +** Processing line: ~ # h_pressed_at is initially set to false, and changes once the user presses the "h" key.~ - Inside source: true *** True Line Result - [inputs.controller_one.key_held.a || inputs.keyboard.key_held.space, -** Processing line: ~ inputs.controller_one.key_down.b || inputs.keyboard.key_down.down,~ + # h_pressed_at is initially set to false, and changes once the user presses the "h" key. +** Processing line: ~ state.h_pressed_at ||= false~ - Inside source: true *** True Line Result - inputs.controller_one.key_down.b || inputs.keyboard.key_down.down, -** Processing line: ~ state.ship_blue],~ + state.h_pressed_at ||= false +** Processing line: ~~ - Inside source: true *** True Line Result - state.ship_blue], -** Processing line: ~ [inputs.controller_two.key_held.a, inputs.controller_two.key_down.b, state.ship_red]~ + +** Processing line: ~ if state.h_pressed_at # if h is pressed (pressed_at has a frame number and is no longer false)~ - Inside source: true *** True Line Result - [inputs.controller_two.key_held.a, inputs.controller_two.key_down.b, state.ship_red] -** Processing line: ~ ].each do |a_held, b_down, ship|~ + if state.h_pressed_at # if h is pressed (pressed_at has a frame number and is no longer false) +** Processing line: ~ outputs.labels << [460, row_to_px(4), "\"h\" was pressed at time: #{state.h_pressed_at}", small_font]~ - Inside source: true *** True Line Result - ].each do |a_held, b_down, ship| -** Processing line: ~ input_bullet(a_held && state.tick_count.mod_zero?(10).or(a_held == 0), ship)~ + outputs.labels << [460, row_to_px(4), "\"h\" was pressed at time: #{state.h_pressed_at}", small_font] +** Processing line: ~ else # otherwise, label says "h" was never pressed~ - Inside source: true *** True Line Result - input_bullet(a_held && state.tick_count.mod_zero?(10).or(a_held == 0), ship) -** Processing line: ~ input_mine(b_down, ship)~ + else # otherwise, label says "h" was never pressed +** Processing line: ~ outputs.labels << [460, row_to_px(4), "\"h\" has never been pressed.", small_font]~ - Inside source: true *** True Line Result - input_mine(b_down, ship) + outputs.labels << [460, row_to_px(4), "\"h\" has never been pressed.", small_font] ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc_kill_ships~ -- Inside source: true -*** True Line Result - def calc_kill_ships -** Processing line: ~ alive_ships.find_all { |s| s.damage >= 5 }.each do |s|~ -- Inside source: true -*** True Line Result - alive_ships.find_all { |s| s.damage >= 5 }.each do |s| -** Processing line: ~ s.dead = true~ -- Inside source: true -*** True Line Result - s.dead = true -** Processing line: ~ create_explosion! :ship_explosion, s, 20, 20, 30, s.max_alpha~ +** Processing line: ~ # border around keyboard input demo section~ - Inside source: true *** True Line Result - create_explosion! :ship_explosion, s, 20, 20, 30, s.max_alpha -** Processing line: ~ end~ + # border around keyboard input demo section +** Processing line: ~ outputs.borders << [455, row_to_px(5), 360, row_to_px(2).shift_up(5) - row_to_px(5)]~ - Inside source: true *** True Line Result - end + outputs.borders << [455, row_to_px(5), 360, row_to_px(2).shift_up(5) - row_to_px(5)] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -43923,118 +46932,118 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_score~ +** Processing line: ~ # Sets definition for a small label~ - Inside source: true *** True Line Result - def calc_score -** Processing line: ~ return if state.round_finished~ + # Sets definition for a small label +** Processing line: ~ # Makes it easier to position labels in respect to the position of other labels~ - Inside source: true *** True Line Result - return if state.round_finished -** Processing line: ~ return if alive_ships.length > 1~ + # Makes it easier to position labels in respect to the position of other labels +** Processing line: ~ def small_label x, row, message~ - Inside source: true *** True Line Result - return if alive_ships.length > 1 -** Processing line: ~~ + def small_label x, row, message +** Processing line: ~ [x, row_to_px(row), message, small_font]~ - Inside source: true *** True Line Result - -** Processing line: ~ if alive_ships.first == state.ship_red~ + [x, row_to_px(row), message, small_font] +** Processing line: ~ end~ - Inside source: true *** True Line Result - if alive_ships.first == state.ship_red -** Processing line: ~ state.ship_red_score += 1~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.ship_red_score += 1 -** Processing line: ~ elsif alive_ships.first == state.ship_blue~ + +** Processing line: ~ # Uses small labels to show whether the "a" button on the controller is down, held, or up.~ - Inside source: true *** True Line Result - elsif alive_ships.first == state.ship_blue -** Processing line: ~ state.ship_blue_score += 1~ + # Uses small labels to show whether the "a" button on the controller is down, held, or up. +** Processing line: ~ # y value of each small label is set by calling the row_to_px method~ - Inside source: true *** True Line Result - state.ship_blue_score += 1 -** Processing line: ~ end~ + # y value of each small label is set by calling the row_to_px method +** Processing line: ~ def controller_tech_demo~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def controller_tech_demo +** Processing line: ~ x = 460~ - Inside source: true *** True Line Result - -** Processing line: ~ state.round_finished = true~ + x = 460 +** Processing line: ~ outputs.labels << small_label(x, 6, "Controller one input: inputs.controller_one")~ - Inside source: true *** True Line Result - state.round_finished = true -** Processing line: ~ end~ + outputs.labels << small_label(x, 6, "Controller one input: inputs.controller_one") +** Processing line: ~ outputs.labels << small_label(x, 7, "Current state of the \"a\" button.")~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.labels << small_label(x, 7, "Current state of the \"a\" button.") +** Processing line: ~ outputs.labels << small_label(x, 8, "Check console window for more info.")~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_reset_ships~ + outputs.labels << small_label(x, 8, "Check console window for more info.") +** Processing line: ~~ - Inside source: true *** True Line Result - def calc_reset_ships -** Processing line: ~ return unless state.round_finished~ + +** Processing line: ~ if inputs.controller_one.key_down.a # if "a" is in "down" state~ - Inside source: true *** True Line Result - return unless state.round_finished -** Processing line: ~ state.round_finished_debounce ||= 2.seconds~ + if inputs.controller_one.key_down.a # if "a" is in "down" state +** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button down: #{inputs.controller_one.key_down.a}")~ - Inside source: true *** True Line Result - state.round_finished_debounce ||= 2.seconds -** Processing line: ~ state.round_finished_debounce -= 1~ + outputs.labels << small_label(x, 9, "\"a\" button down: #{inputs.controller_one.key_down.a}") +** Processing line: ~ puts "\"a\" button down at #{inputs.controller_one.key_down.a}" # prints frame the event occurred~ - Inside source: true *** True Line Result - state.round_finished_debounce -= 1 -** Processing line: ~ return if state.round_finished_debounce > 0~ + puts "\"a\" button down at #{inputs.controller_one.key_down.a}" # prints frame the event occurred +** Processing line: ~ elsif inputs.controller_one.key_held.a # if "a" is held down~ - Inside source: true *** True Line Result - return if state.round_finished_debounce > 0 -** Processing line: ~ start_new_round!~ + elsif inputs.controller_one.key_held.a # if "a" is held down +** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button held: #{inputs.controller_one.key_held.a}")~ - Inside source: true *** True Line Result - start_new_round! -** Processing line: ~ end~ + outputs.labels << small_label(x, 9, "\"a\" button held: #{inputs.controller_one.key_held.a}") +** Processing line: ~ elsif inputs.controller_one.key_up.a # if "a" is in up state~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif inputs.controller_one.key_up.a # if "a" is in up state +** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button up: #{inputs.controller_one.key_up.a}")~ - Inside source: true *** True Line Result - -** Processing line: ~ def start_new_round!~ + outputs.labels << small_label(x, 9, "\"a\" button up: #{inputs.controller_one.key_up.a}") +** Processing line: ~ puts "\"a\" key up at #{inputs.controller_one.key_up.a}"~ - Inside source: true *** True Line Result - def start_new_round! -** Processing line: ~ state.ship_blue = new_blue_ship~ + puts "\"a\" key up at #{inputs.controller_one.key_up.a}" +** Processing line: ~ else # if no event has occurred~ - Inside source: true *** True Line Result - state.ship_blue = new_blue_ship -** Processing line: ~ state.ship_red = new_red_ship~ + else # if no event has occurred +** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button state is nil.")~ - Inside source: true *** True Line Result - state.ship_red = new_red_ship -** Processing line: ~ state.round_finished = false~ + outputs.labels << small_label(x, 9, "\"a\" button state is nil.") +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.round_finished = false -** Processing line: ~ state.round_finished_debounce = nil~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.round_finished_debounce = nil -** Processing line: ~ state.flames.clear~ + +** Processing line: ~ # border around controller input demo section~ - Inside source: true *** True Line Result - state.flames.clear -** Processing line: ~ state.bullets.clear~ + # border around controller input demo section +** Processing line: ~ outputs.borders << [455, row_to_px(10), 360, row_to_px(6).shift_up(5) - row_to_px(10)]~ - Inside source: true *** True Line Result - state.bullets.clear + outputs.borders << [455, row_to_px(10), 360, row_to_px(6).shift_up(5) - row_to_px(10)] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -44043,518 +47052,470 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_winner~ -- Inside source: true -*** True Line Result - def calc_winner -** Processing line: ~ calc_kill_ships~ -- Inside source: true -*** True Line Result - calc_kill_ships -** Processing line: ~ calc_score~ +** Processing line: ~ # Outputs when the mouse was clicked, as well as the coordinates on the screen~ - Inside source: true *** True Line Result - calc_score -** Processing line: ~ calc_reset_ships~ + # Outputs when the mouse was clicked, as well as the coordinates on the screen +** Processing line: ~ # of where the click occurred~ - Inside source: true *** True Line Result - calc_reset_ships -** Processing line: ~ end~ + # of where the click occurred +** Processing line: ~ def mouse_tech_demo~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def mouse_tech_demo +** Processing line: ~ x = 460~ - Inside source: true *** True Line Result - end + x = 460 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ $dueling_spaceship = DuelingSpaceships.new~ +** Processing line: ~ outputs.labels << small_label(x, 11, "Mouse input: inputs.mouse")~ - Inside source: true *** True Line Result - $dueling_spaceship = DuelingSpaceships.new + outputs.labels << small_label(x, 11, "Mouse input: inputs.mouse") ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ if inputs.mouse.click # if click has a value and is not nil~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.grid.origin_center!~ + if inputs.mouse.click # if click has a value and is not nil +** Processing line: ~ state.last_mouse_click = inputs.mouse.click # coordinates of click are stored~ - Inside source: true *** True Line Result - args.grid.origin_center! -** Processing line: ~ $dueling_spaceship.inputs = args.inputs~ + state.last_mouse_click = inputs.mouse.click # coordinates of click are stored +** Processing line: ~ end~ - Inside source: true *** True Line Result - $dueling_spaceship.inputs = args.inputs -** Processing line: ~ $dueling_spaceship.outputs = args.outputs~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - $dueling_spaceship.outputs = args.outputs -** Processing line: ~ $dueling_spaceship.state = args.state~ + +** Processing line: ~ if state.last_mouse_click # if mouse is clicked (has coordinates as value)~ - Inside source: true *** True Line Result - $dueling_spaceship.state = args.state -** Processing line: ~ $dueling_spaceship.grid = args.grid~ + if state.last_mouse_click # if mouse is clicked (has coordinates as value) +** Processing line: ~ # outputs the time (frame) the click occurred, as well as how many frames have passed since the event~ - Inside source: true *** True Line Result - $dueling_spaceship.grid = args.grid -** Processing line: ~ $dueling_spaceship.tick~ + # outputs the time (frame) the click occurred, as well as how many frames have passed since the event +** Processing line: ~ outputs.labels << small_label(x, 12, "Mouse click happened at: #{state.last_mouse_click.created_at}, #{state.last_mouse_click.created_at_elapsed}")~ - Inside source: true *** True Line Result - $dueling_spaceship.tick -** Processing line: ~ end~ + outputs.labels << small_label(x, 12, "Mouse click happened at: #{state.last_mouse_click.created_at}, #{state.last_mouse_click.created_at_elapsed}") +** Processing line: ~ # outputs coordinates of click~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # outputs coordinates of click +** Processing line: ~ outputs.labels << small_label(x, 13, "Mouse click location: #{state.last_mouse_click.point.x}, #{state.last_mouse_click.point.y}")~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. -*** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* arcade/flappy dragon/credits.txt~ -- Header detected. -*** True Line Result - -*** True Line Result -* arcade/flappy dragon/credits.txt -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_arcade/flappy_dragon/CREDITS.txt~ + outputs.labels << small_label(x, 13, "Mouse click location: #{state.last_mouse_click.point.x}, #{state.last_mouse_click.point.y}") +** Processing line: ~ else # otherwise if the mouse has not been clicked~ - Inside source: true *** True Line Result - # ./samples/99_genre_arcade/flappy_dragon/CREDITS.txt -** Processing line: ~ code: Amir Rajan, https://twitter.com/amirrajan~ + else # otherwise if the mouse has not been clicked +** Processing line: ~ outputs.labels << small_label(x, 12, "Mouse click has not occurred yet.")~ - Inside source: true *** True Line Result - code: Amir Rajan, https://twitter.com/amirrajan -** Processing line: ~ graphics and audio: Nick Culbertson, https://twitter.com/MobyPixel~ + outputs.labels << small_label(x, 12, "Mouse click has not occurred yet.") +** Processing line: ~ outputs.labels << small_label(x, 13, "Please click mouse.")~ - Inside source: true *** True Line Result - graphics and audio: Nick Culbertson, https://twitter.com/MobyPixel -** Processing line: ~~ + outputs.labels << small_label(x, 13, "Please click mouse.") +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~~ + end +** Processing line: ~ end~ - 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 + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* arcade/flappy dragon/main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* arcade/flappy dragon/main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_arcade/flappy_dragon/app/main.rb~ +** Processing line: ~ # Outputs whether a mouse click occurred inside or outside of a box~ - Inside source: true *** True Line Result - # ./samples/99_genre_arcade/flappy_dragon/app/main.rb -** Processing line: ~ class FlappyDragon~ + # Outputs whether a mouse click occurred inside or outside of a box +** Processing line: ~ def point_to_rect_tech_demo~ - Inside source: true *** True Line Result - class FlappyDragon -** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs~ + def point_to_rect_tech_demo +** Processing line: ~ x = 460~ - Inside source: true *** True Line Result - attr_accessor :grid, :inputs, :state, :outputs + x = 460 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick~ +** Processing line: ~ outputs.labels << small_label(x, 15, "Click inside the blue box maybe ---->")~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ defaults~ + outputs.labels << small_label(x, 15, "Click inside the blue box maybe ---->") +** Processing line: ~~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ render~ + +** Processing line: ~ box = [765, 370, 50, 50, 0, 0, 170] # blue box~ - Inside source: true *** True Line Result - render -** Processing line: ~ calc~ + box = [765, 370, 50, 50, 0, 0, 170] # blue box +** Processing line: ~ outputs.borders << box~ - Inside source: true *** True Line Result - calc -** Processing line: ~ process_inputs~ + outputs.borders << box +** Processing line: ~~ - Inside source: true *** True Line Result - process_inputs -** Processing line: ~ end~ + +** Processing line: ~ if state.last_mouse_click # if the mouse was clicked~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if state.last_mouse_click # if the mouse was clicked +** Processing line: ~ if state.last_mouse_click.point.inside_rect? box # if mouse clicked inside box~ - Inside source: true *** True Line Result - -** Processing line: ~ def defaults~ + if state.last_mouse_click.point.inside_rect? box # if mouse clicked inside box +** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click happened inside the box.")~ - Inside source: true *** True Line Result - def defaults -** Processing line: ~ state.flap_power = 11~ + outputs.labels << small_label(x, 16, "Mouse click happened inside the box.") +** Processing line: ~ else # otherwise, if mouse was clicked outside the box~ - Inside source: true *** True Line Result - state.flap_power = 11 -** Processing line: ~ state.gravity = 0.9~ + else # otherwise, if mouse was clicked outside the box +** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click happened outside the box.")~ - Inside source: true *** True Line Result - state.gravity = 0.9 -** Processing line: ~ state.ceiling = 600~ + outputs.labels << small_label(x, 16, "Mouse click happened outside the box.") +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.ceiling = 600 -** Processing line: ~ state.ceiling_flap_power = 6~ + end +** Processing line: ~ else # otherwise, if was not clicked at all~ - Inside source: true *** True Line Result - state.ceiling_flap_power = 6 -** Processing line: ~ state.wall_countdown_length = 100~ + else # otherwise, if was not clicked at all +** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click has not occurred yet.") # output if the mouse was not clicked~ - Inside source: true *** True Line Result - state.wall_countdown_length = 100 -** Processing line: ~ state.wall_gap_size = 100~ + outputs.labels << small_label(x, 16, "Mouse click has not occurred yet.") # output if the mouse was not clicked +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.wall_gap_size = 100 -** Processing line: ~ state.wall_countdown ||= 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.wall_countdown ||= 0 -** Processing line: ~ state.hi_score ||= 0~ + +** Processing line: ~ # border around mouse input demo section~ - Inside source: true *** True Line Result - state.hi_score ||= 0 -** Processing line: ~ state.score ||= 0~ + # border around mouse input demo section +** Processing line: ~ outputs.borders << [455, row_to_px(14), 360, row_to_px(11).shift_up(5) - row_to_px(14)]~ - Inside source: true *** True Line Result - state.score ||= 0 -** Processing line: ~ state.walls ||= []~ + outputs.borders << [455, row_to_px(14), 360, row_to_px(11).shift_up(5) - row_to_px(14)] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.walls ||= [] -** Processing line: ~ state.x ||= 50~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.x ||= 50 -** Processing line: ~ state.y ||= 500~ + +** Processing line: ~ # Outputs a red box onto the screen. A mouse click from the user inside of the red box will output~ - Inside source: true *** True Line Result - state.y ||= 500 -** Processing line: ~ state.dy ||= 0~ + # Outputs a red box onto the screen. A mouse click from the user inside of the red box will output +** Processing line: ~ # a smaller box. If two small boxes are inside of the red box, it will be determined whether or not~ - Inside source: true *** True Line Result - state.dy ||= 0 -** Processing line: ~ state.scene ||= :menu~ + # a smaller box. If two small boxes are inside of the red box, it will be determined whether or not +** Processing line: ~ # they intersect.~ - Inside source: true *** True Line Result - state.scene ||= :menu -** Processing line: ~ state.scene_at ||= 0~ + # they intersect. +** Processing line: ~ def rect_to_rect_tech_demo~ - Inside source: true *** True Line Result - state.scene_at ||= 0 -** Processing line: ~ state.difficulty ||= :normal~ + def rect_to_rect_tech_demo +** Processing line: ~ x = 460~ - Inside source: true *** True Line Result - state.difficulty ||= :normal -** Processing line: ~ state.new_difficulty ||= :normal~ + x = 460 +** Processing line: ~~ - Inside source: true *** True Line Result - state.new_difficulty ||= :normal -** Processing line: ~ state.countdown ||= 4.seconds~ + +** Processing line: ~ outputs.labels << small_label(x, 17.5, "Click inside the red box below.") # label with instructions~ - Inside source: true *** True Line Result - state.countdown ||= 4.seconds -** Processing line: ~ state.flash_at ||= 0~ + outputs.labels << small_label(x, 17.5, "Click inside the red box below.") # label with instructions +** Processing line: ~ red_box = [460, 250, 355, 90, 170, 0, 0] # definition of the red box~ - Inside source: true *** True Line Result - state.flash_at ||= 0 -** Processing line: ~ end~ + red_box = [460, 250, 355, 90, 170, 0, 0] # definition of the red box +** Processing line: ~ outputs.borders << red_box # output as a border (not filled in)~ - Inside source: true *** True Line Result - end + outputs.borders << red_box # output as a border (not filled in) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render~ -- Inside source: true -*** True Line Result - def render -** Processing line: ~ outputs.sounds << "sounds/flappy-song.ogg" if state.tick_count == 1~ +** Processing line: ~ # If the mouse is clicked inside the red box, two collision boxes are created.~ - Inside source: true *** True Line Result - outputs.sounds << "sounds/flappy-song.ogg" if state.tick_count == 1 -** Processing line: ~ render_score~ + # If the mouse is clicked inside the red box, two collision boxes are created. +** Processing line: ~ if inputs.mouse.click~ - Inside source: true *** True Line Result - render_score -** Processing line: ~ render_menu~ + if inputs.mouse.click +** Processing line: ~ if inputs.mouse.click.point.inside_rect? red_box~ - Inside source: true *** True Line Result - render_menu -** Processing line: ~ render_game~ + if inputs.mouse.click.point.inside_rect? red_box +** Processing line: ~ if !state.box_collision_one # if the collision_one box does not yet have a definition~ - Inside source: true *** True Line Result - render_game -** Processing line: ~ end~ + if !state.box_collision_one # if the collision_one box does not yet have a definition +** Processing line: ~ # Subtracts 25 from the x and y positions of the click point in order to make the click point the center of the box.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Subtracts 25 from the x and y positions of the click point in order to make the click point the center of the box. +** Processing line: ~ # You can try deleting the subtraction to see how it impacts the box placement.~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_score~ + # You can try deleting the subtraction to see how it impacts the box placement. +** Processing line: ~ state.box_collision_one = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 180, 0, 0, 180] # sets definition~ - Inside source: true *** True Line Result - def render_score -** Processing line: ~ outputs.primitives << [10, 710, "HI SCORE: #{state.hi_score}", large_white_typeset].label~ + state.box_collision_one = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 180, 0, 0, 180] # sets definition +** Processing line: ~ elsif !state.box_collision_two # if collision_two does not yet have a definition~ - Inside source: true *** True Line Result - outputs.primitives << [10, 710, "HI SCORE: #{state.hi_score}", large_white_typeset].label -** Processing line: ~ outputs.primitives << [10, 680, "SCORE: #{state.score}", large_white_typeset].label~ + elsif !state.box_collision_two # if collision_two does not yet have a definition +** Processing line: ~ state.box_collision_two = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 0, 0, 180, 180] # sets definition~ - Inside source: true *** True Line Result - outputs.primitives << [10, 680, "SCORE: #{state.score}", large_white_typeset].label -** Processing line: ~ outputs.primitives << [10, 650, "DIFFICULTY: #{state.difficulty.upcase}", large_white_typeset].label~ + state.box_collision_two = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 0, 0, 180, 180] # sets definition +** Processing line: ~ else~ - Inside source: true *** True Line Result - outputs.primitives << [10, 650, "DIFFICULTY: #{state.difficulty.upcase}", large_white_typeset].label -** Processing line: ~ end~ + else +** Processing line: ~ state.box_collision_one = nil # both boxes are empty~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.box_collision_one = nil # both boxes are empty +** Processing line: ~ state.box_collision_two = nil~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_menu~ + state.box_collision_two = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - def render_menu -** Processing line: ~ return unless state.scene == :menu~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - return unless state.scene == :menu -** Processing line: ~ render_overlay~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - render_overlay + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.labels << [640, 700, "Flappy Dragon", 50, 1, 255, 255, 255]~ +** Processing line: ~ # If collision boxes exist, they are output onto screen inside the red box as solids~ - Inside source: true *** True Line Result - outputs.labels << [640, 700, "Flappy Dragon", 50, 1, 255, 255, 255] -** Processing line: ~ outputs.labels << [640, 500, "Instructions: Press Spacebar to flap. Don't die.", 4, 1, 255, 255, 255]~ + # If collision boxes exist, they are output onto screen inside the red box as solids +** Processing line: ~ if state.box_collision_one~ - Inside source: true *** True Line Result - outputs.labels << [640, 500, "Instructions: Press Spacebar to flap. Don't die.", 4, 1, 255, 255, 255] -** Processing line: ~ outputs.labels << [430, 430, "[Tab] Change difficulty", 4, 0, 255, 255, 255]~ + if state.box_collision_one +** Processing line: ~ outputs.solids << state.box_collision_one~ - Inside source: true *** True Line Result - outputs.labels << [430, 430, "[Tab] Change difficulty", 4, 0, 255, 255, 255] -** Processing line: ~ outputs.labels << [430, 400, "[Enter] Start at New Difficulty ", 4, 0, 255, 255, 255]~ + outputs.solids << state.box_collision_one +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.labels << [430, 400, "[Enter] Start at New Difficulty ", 4, 0, 255, 255, 255] -** Processing line: ~ outputs.labels << [430, 370, "[Escape] Cancel/Resume ", 4, 0, 255, 255, 255]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.labels << [430, 370, "[Escape] Cancel/Resume ", 4, 0, 255, 255, 255] -** Processing line: ~ outputs.labels << [640, 300, "(mouse, touch, and game controllers work, too!) ", 4, 1, 255, 255, 255]~ + +** Processing line: ~ if state.box_collision_two~ - Inside source: true *** True Line Result - outputs.labels << [640, 300, "(mouse, touch, and game controllers work, too!) ", 4, 1, 255, 255, 255] -** Processing line: ~ outputs.labels << [640, 200, "Difficulty: #{state.new_difficulty.capitalize}", 4, 1, 255, 255, 255]~ + if state.box_collision_two +** Processing line: ~ outputs.solids << state.box_collision_two~ - Inside source: true *** True Line Result - outputs.labels << [640, 200, "Difficulty: #{state.new_difficulty.capitalize}", 4, 1, 255, 255, 255] + outputs.solids << state.box_collision_two +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.labels << [10, 100, "Code: @amirrajan", 255, 255, 255]~ +** Processing line: ~ # Outputs whether or not the two collision boxes intersect.~ - Inside source: true *** True Line Result - outputs.labels << [10, 100, "Code: @amirrajan", 255, 255, 255] -** Processing line: ~ outputs.labels << [10, 80, "Art: @mobypixel", 255, 255, 255]~ + # Outputs whether or not the two collision boxes intersect. +** Processing line: ~ if state.box_collision_one && state.box_collision_two # if both collision_boxes are defined (and not nil or empty)~ - Inside source: true *** True Line Result - outputs.labels << [10, 80, "Art: @mobypixel", 255, 255, 255] -** Processing line: ~ outputs.labels << [10, 60, "Music: @mobypixel", 255, 255, 255]~ + if state.box_collision_one && state.box_collision_two # if both collision_boxes are defined (and not nil or empty) +** Processing line: ~ if state.box_collision_one.intersect_rect? state.box_collision_two # if the two boxes intersect~ - Inside source: true *** True Line Result - outputs.labels << [10, 60, "Music: @mobypixel", 255, 255, 255] -** Processing line: ~ outputs.labels << [10, 40, "Engine: DragonRuby GTK", 255, 255, 255]~ + if state.box_collision_one.intersect_rect? state.box_collision_two # if the two boxes intersect +** Processing line: ~ outputs.labels << small_label(x, 23.5, 'The boxes intersect.')~ - Inside source: true *** True Line Result - outputs.labels << [10, 40, "Engine: DragonRuby GTK", 255, 255, 255] -** Processing line: ~ end~ + outputs.labels << small_label(x, 23.5, 'The boxes intersect.') +** Processing line: ~ else # otherwise, if the two boxes do not intersect~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + else # otherwise, if the two boxes do not intersect +** Processing line: ~ outputs.labels << small_label(x, 23.5, 'The boxes do not intersect.')~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_overlay~ + outputs.labels << small_label(x, 23.5, 'The boxes do not intersect.') +** Processing line: ~ end~ - Inside source: true *** True Line Result - def render_overlay -** Processing line: ~ outputs.primitives << [grid.rect.scale_rect(1.1, 0, 0), 0, 0, 0, 230].solid~ + end +** Processing line: ~ else~ - Inside source: true *** True Line Result - outputs.primitives << [grid.rect.scale_rect(1.1, 0, 0), 0, 0, 0, 230].solid -** Processing line: ~ end~ + else +** Processing line: ~ outputs.labels << small_label(x, 23.5, '--') # if the two boxes are not defined (are nil or empty), this label is output~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.labels << small_label(x, 23.5, '--') # if the two boxes are not defined (are nil or empty), this label is output +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_game~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - def render_game -** Processing line: ~ render_game_over~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - render_game_over -** Processing line: ~ render_background~ + +** Processing line: ~ # Creates a button and outputs it onto the screen using labels and borders.~ - Inside source: true *** True Line Result - render_background -** Processing line: ~ render_walls~ + # Creates a button and outputs it onto the screen using labels and borders. +** Processing line: ~ # If the button is clicked, the color changes to make it look faded.~ - Inside source: true *** True Line Result - render_walls -** Processing line: ~ render_dragon~ + # If the button is clicked, the color changes to make it look faded. +** Processing line: ~ def button_tech_demo~ - Inside source: true *** True Line Result - render_dragon -** Processing line: ~ render_flash~ + def button_tech_demo +** Processing line: ~ x, y, w, h = 460, 160, 300, 50~ - Inside source: true *** True Line Result - render_flash -** Processing line: ~ end~ + x, y, w, h = 460, 160, 300, 50 +** Processing line: ~ state.button ||= state.new_entity(:button_with_fade)~ - Inside source: true *** True Line Result - end + state.button ||= state.new_entity(:button_with_fade) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_game_over~ +** Processing line: ~ # Adds w.half to x and h.half + 10 to y in order to display the text inside the button's borders.~ - Inside source: true *** True Line Result - def render_game_over -** Processing line: ~ return unless state.scene == :game~ + # Adds w.half to x and h.half + 10 to y in order to display the text inside the button's borders. +** Processing line: ~ state.button.label ||= [x + w.half, y + h.half + 10, "click me and watch me fade", 0, 1]~ - Inside source: true *** True Line Result - return unless state.scene == :game -** Processing line: ~ outputs.labels << [638, 358, score_text, 20, 1]~ + state.button.label ||= [x + w.half, y + h.half + 10, "click me and watch me fade", 0, 1] +** Processing line: ~ state.button.border ||= [x, y, w, h]~ - Inside source: true *** True Line Result - outputs.labels << [638, 358, score_text, 20, 1] -** Processing line: ~ outputs.labels << [635, 360, score_text, 20, 1, 255, 255, 255]~ + state.button.border ||= [x, y, w, h] +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.labels << [635, 360, score_text, 20, 1, 255, 255, 255] -** Processing line: ~ outputs.labels << [638, 428, countdown_text, 20, 1]~ + +** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.button.border) # if mouse is clicked, and clicked inside button's border~ - Inside source: true *** True Line Result - outputs.labels << [638, 428, countdown_text, 20, 1] -** Processing line: ~ outputs.labels << [635, 430, countdown_text, 20, 1, 255, 255, 255]~ + if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.button.border) # if mouse is clicked, and clicked inside button's border +** Processing line: ~ state.button.clicked_at = inputs.mouse.click.created_at # stores the time the click occurred~ - Inside source: true *** True Line Result - outputs.labels << [635, 430, countdown_text, 20, 1, 255, 255, 255] -** Processing line: ~ end~ + state.button.clicked_at = inputs.mouse.click.created_at # stores the time the click occurred +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_background~ +** Processing line: ~ outputs.labels << state.button.label~ - Inside source: true *** True Line Result - def render_background -** Processing line: ~ outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']~ + outputs.labels << state.button.label +** Processing line: ~ outputs.borders << state.button.border~ - Inside source: true *** True Line Result - outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png'] + outputs.borders << state.button.border ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ scroll_point_at = state.tick_count~ -- Inside source: true -*** True Line Result - scroll_point_at = state.tick_count -** Processing line: ~ scroll_point_at = state.scene_at if state.scene == :menu~ +** Processing line: ~ if state.button.clicked_at # if button was clicked (variable has a value and is not nil)~ - Inside source: true *** True Line Result - scroll_point_at = state.scene_at if state.scene == :menu -** Processing line: ~ scroll_point_at = state.death_at if state.countdown > 0~ + if state.button.clicked_at # if button was clicked (variable has a value and is not nil) +** Processing line: ~~ - Inside source: true *** True Line Result - scroll_point_at = state.death_at if state.countdown > 0 -** Processing line: ~ scroll_point_at ||= 0~ + +** Processing line: ~ # The appearance of the button changes for 0.25 seconds after the time the button is clicked at.~ - Inside source: true *** True Line Result - scroll_point_at ||= 0 -** Processing line: ~~ + # The appearance of the button changes for 0.25 seconds after the time the button is clicked at. +** Processing line: ~ # The color changes (rgb is set to 0, 180, 80) and the transparency gradually changes.~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_back.png', 0.25)~ + # The color changes (rgb is set to 0, 180, 80) and the transparency gradually changes. +** Processing line: ~ # Change 0.25 to 1.25 and notice that the transparency takes longer to return to normal.~ - Inside source: true *** True Line Result - outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_back.png', 0.25) -** Processing line: ~ outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_middle.png', 0.50)~ + # Change 0.25 to 1.25 and notice that the transparency takes longer to return to normal. +** Processing line: ~ outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.button.clicked_at.ease(0.25.seconds, :flip)]~ - Inside source: true *** True Line Result - outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_middle.png', 0.50) -** Processing line: ~ outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_front.png', 1.00, -80)~ + outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.button.clicked_at.ease(0.25.seconds, :flip)] +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_front.png', 1.00, -80) + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -44563,38 +47524,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render_walls~ -- Inside source: true -*** True Line Result - def render_walls -** Processing line: ~ state.walls.each do |w|~ +** Processing line: ~ # Creates a new button by declaring it as a new entity, and sets values.~ - Inside source: true *** True Line Result - state.walls.each do |w| -** Processing line: ~ w.sprites = [~ + # Creates a new button by declaring it as a new entity, and sets values. +** Processing line: ~ def new_button_prefab x, y, message~ - Inside source: true *** True Line Result - w.sprites = [ -** Processing line: ~ [w.x, w.bottom_height - 720, 100, 720, 'sprites/wall.png', 180],~ + def new_button_prefab x, y, message +** Processing line: ~ w, h = 300, 50~ - Inside source: true *** True Line Result - [w.x, w.bottom_height - 720, 100, 720, 'sprites/wall.png', 180], -** Processing line: ~ [w.x, w.top_y, 100, 720, 'sprites/wallbottom.png', 0]~ + w, h = 300, 50 +** Processing line: ~ button = state.new_entity(:button_with_fade)~ - Inside source: true *** True Line Result - [w.x, w.top_y, 100, 720, 'sprites/wallbottom.png', 0] -** Processing line: ~ ]~ + button = state.new_entity(:button_with_fade) +** Processing line: ~ button.label = [x + w.half, y + h.half + 10, message, 0, 1] # '+ 10' keeps label's text within button's borders~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + button.label = [x + w.half, y + h.half + 10, message, 0, 1] # '+ 10' keeps label's text within button's borders +** Processing line: ~ button.border = [x, y, w, h] # sets border definition~ - Inside source: true *** True Line Result - end -** Processing line: ~ outputs.sprites << state.walls.map(&:sprites)~ + button.border = [x, y, w, h] # sets border definition +** Processing line: ~ button~ - Inside source: true *** True Line Result - outputs.sprites << state.walls.map(&:sprites) + button ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -44603,82 +47560,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 render_dragon~ +** Processing line: ~ # If the mouse has been clicked and the click's location is inside of the button's border, that means~ - Inside source: true *** True Line Result - def render_dragon -** Processing line: ~ state.show_death = true if state.countdown == 3.seconds~ + # If the mouse has been clicked and the click's location is inside of the button's border, that means +** Processing line: ~ # that the button has been clicked. This method returns a boolean value.~ - Inside source: true *** True Line Result - state.show_death = true if state.countdown == 3.seconds -** Processing line: ~~ + # that the button has been clicked. This method returns a boolean value. +** Processing line: ~ def button_clicked? button~ - Inside source: true *** True Line Result - -** Processing line: ~ render_debug_hitbox false~ + def button_clicked? button +** Processing line: ~ inputs.mouse.click && inputs.mouse.click.point.inside_rect?(button.border)~ - Inside source: true *** True Line Result - render_debug_hitbox false + inputs.mouse.click && inputs.mouse.click.point.inside_rect?(button.border) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.show_death == false || !state.death_at~ +** Processing line: ~ # Determines if button was clicked, and changes its appearance if it is clicked~ - Inside source: true *** True Line Result - if state.show_death == false || !state.death_at -** Processing line: ~ animation_index = state.flapped_at.frame_index 6, 2, false if state.flapped_at~ + # Determines if button was clicked, and changes its appearance if it is clicked +** Processing line: ~ def tick_button_prefab button~ - Inside source: true *** True Line Result - animation_index = state.flapped_at.frame_index 6, 2, false if state.flapped_at -** Processing line: ~ sprite_name = "sprites/dragon_fly#{animation_index.or(0) + 1}.png"~ + def tick_button_prefab button +** Processing line: ~ outputs.labels << button.label # outputs button's label and border~ - Inside source: true *** True Line Result - sprite_name = "sprites/dragon_fly#{animation_index.or(0) + 1}.png" -** Processing line: ~ state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]~ + outputs.labels << button.label # outputs button's label and border +** Processing line: ~ outputs.borders << button.border~ - Inside source: true *** True Line Result - state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2] -** Processing line: ~ else~ + outputs.borders << button.border +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ sprite_name = "sprites/dragon_die.png"~ + +** Processing line: ~ if button_clicked? button # if button is clicked~ - Inside source: true *** True Line Result - sprite_name = "sprites/dragon_die.png" -** Processing line: ~ state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]~ + if button_clicked? button # if button is clicked +** Processing line: ~ button.clicked_at = inputs.mouse.click.created_at # stores the time that the button was clicked~ - Inside source: true *** True Line Result - state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2] -** Processing line: ~ sprite_changed_elapsed = state.death_at.elapsed_time - 1.seconds~ + button.clicked_at = inputs.mouse.click.created_at # stores the time that the button was clicked +** Processing line: ~ end~ - Inside source: true *** True Line Result - sprite_changed_elapsed = state.death_at.elapsed_time - 1.seconds -** Processing line: ~ state.dragon_sprite.angle += (sprite_changed_elapsed ** 1.3) * state.death_fall_direction * -1~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.dragon_sprite.angle += (sprite_changed_elapsed ** 1.3) * state.death_fall_direction * -1 -** Processing line: ~ state.dragon_sprite.x += (sprite_changed_elapsed ** 1.2) * state.death_fall_direction~ + +** Processing line: ~ if button.clicked_at # if clicked_at has a frame value and is not nil~ - Inside source: true *** True Line Result - state.dragon_sprite.x += (sprite_changed_elapsed ** 1.2) * state.death_fall_direction -** Processing line: ~ state.dragon_sprite.y += (sprite_changed_elapsed * 14 - sprite_changed_elapsed ** 1.6)~ + if button.clicked_at # if clicked_at has a frame value and is not nil +** Processing line: ~ # button is output; color changes and transparency changes for 0.25 seconds after click occurs~ - Inside source: true *** True Line Result - state.dragon_sprite.y += (sprite_changed_elapsed * 14 - sprite_changed_elapsed ** 1.6) -** Processing line: ~ end~ + # button is output; color changes and transparency changes for 0.25 seconds after click occurs +** Processing line: ~ outputs.solids << [button.border.x, button.border.y, button.border.w, button.border.h,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.solids << [button.border.x, button.border.y, button.border.w, button.border.h, +** Processing line: ~ 0, 180, 80, 255 * button.clicked_at.ease(0.25.seconds, :flip)] # transparency changes for 0.25 seconds~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.sprites << state.dragon_sprite~ + 0, 180, 80, 255 * button.clicked_at.ease(0.25.seconds, :flip)] # transparency changes for 0.25 seconds +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.sprites << state.dragon_sprite + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -44687,26 +47648,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 render_debug_hitbox show~ +** Processing line: ~ # Exports the app's game state if the export button is clicked.~ - Inside source: true *** True Line Result - def render_debug_hitbox show -** Processing line: ~ return unless show~ + # Exports the app's game state if the export button is clicked. +** Processing line: ~ def export_game_state_demo~ - Inside source: true *** True Line Result - return unless show -** Processing line: ~ outputs.borders << [dragon_collision_box.rect, 255, 0, 0] if state.dragon_sprite~ + def export_game_state_demo +** Processing line: ~ state.export_game_state_button ||= new_button_prefab(460, 100, "click to export app state")~ - Inside source: true *** True Line Result - outputs.borders << [dragon_collision_box.rect, 255, 0, 0] if state.dragon_sprite -** Processing line: ~ outputs.borders << state.walls.flat_map do |w|~ + state.export_game_state_button ||= new_button_prefab(460, 100, "click to export app state") +** Processing line: ~ tick_button_prefab(state.export_game_state_button) # calls method to output button~ - Inside source: true *** True Line Result - outputs.borders << state.walls.flat_map do |w| -** Processing line: ~ w.sprites.map { |s| [s.rect, 255, 0, 0] }~ + tick_button_prefab(state.export_game_state_button) # calls method to output button +** Processing line: ~ if button_clicked? state.export_game_state_button # if the export button is clicked~ - Inside source: true *** True Line Result - w.sprites.map { |s| [s.rect, 255, 0, 0] } + if button_clicked? state.export_game_state_button # if the export button is clicked +** Processing line: ~ args.gtk.export! "Exported from clicking the export button in the tech demo." # the export occurs~ +- Inside source: true +*** True Line Result + args.gtk.export! "Exported from clicking the export button in the tech demo." # the export occurs ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -44719,38 +47684,46 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render_flash~ +** Processing line: ~ # The mouse and keyboard focus are set to "yes" when the Dragonruby window is the active window.~ - Inside source: true *** True Line Result - def render_flash -** Processing line: ~ return unless state.flash_at~ + # The mouse and keyboard focus are set to "yes" when the Dragonruby window is the active window. +** Processing line: ~ def window_state_demo~ - Inside source: true *** True Line Result - return unless state.flash_at -** Processing line: ~~ + def window_state_demo +** Processing line: ~ m = $gtk.args.inputs.mouse.has_focus ? 'Y' : 'N' # ternary operator (similar to if statement)~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.primitives << [grid.rect,~ + m = $gtk.args.inputs.mouse.has_focus ? 'Y' : 'N' # ternary operator (similar to if statement) +** Processing line: ~ k = $gtk.args.inputs.keyboard.has_focus ? 'Y' : 'N'~ - Inside source: true *** True Line Result - outputs.primitives << [grid.rect, -** Processing line: ~ white,~ + k = $gtk.args.inputs.keyboard.has_focus ? 'Y' : 'N' +** Processing line: ~ outputs.labels << [460, 20, "mouse focus: #{m} keyboard focus: #{k}", small_font]~ - Inside source: true *** True Line Result - white, -** Processing line: ~ 255 * state.flash_at.ease(20, :flip)].solid~ + outputs.labels << [460, 20, "mouse focus: #{m} keyboard focus: #{k}", small_font] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 255 * state.flash_at.ease(20, :flip)].solid + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.flash_at = 0 if state.flash_at.elapsed_time > 20~ +** Processing line: ~ #Sets values for the horizontal separator (divides demo sections)~ - Inside source: true *** True Line Result - state.flash_at = 0 if state.flash_at.elapsed_time > 20 + #Sets values for the horizontal separator (divides demo sections) +** Processing line: ~ def horizontal_seperator y, x, x2~ +- Inside source: true +*** True Line Result + def horizontal_seperator y, x, x2 +** Processing line: ~ [x, y, x2, y, 150, 150, 150]~ +- Inside source: true +*** True Line Result + [x, y, x2, y, 150, 150, 150] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -44759,166 +47732,178 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc~ +** Processing line: ~ #Sets the values for the vertical separator (divides demo sections)~ - Inside source: true *** True Line Result - def calc -** Processing line: ~ return unless state.scene == :game~ + #Sets the values for the vertical separator (divides demo sections) +** Processing line: ~ def vertical_seperator x, y, y2~ - Inside source: true *** True Line Result - return unless state.scene == :game -** Processing line: ~ reset_game if state.countdown == 1~ + def vertical_seperator x, y, y2 +** Processing line: ~ [x, y, x, y2, 150, 150, 150]~ - Inside source: true *** True Line Result - reset_game if state.countdown == 1 -** Processing line: ~ state.countdown -= 1 and return if state.countdown > 0~ + [x, y, x, y2, 150, 150, 150] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.countdown -= 1 and return if state.countdown > 0 -** Processing line: ~ calc_walls~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - calc_walls -** Processing line: ~ calc_flap~ + +** Processing line: ~ # Outputs vertical and horizontal separators onto the screen to separate each demo section.~ - Inside source: true *** True Line Result - calc_flap -** Processing line: ~ calc_game_over~ + # Outputs vertical and horizontal separators onto the screen to separate each demo section. +** Processing line: ~ def render_seperators~ - Inside source: true *** True Line Result - calc_game_over -** Processing line: ~ end~ + def render_seperators +** Processing line: ~ outputs.lines << horizontal_seperator(505, grid.left, 445)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.lines << horizontal_seperator(505, grid.left, 445) +** Processing line: ~ outputs.lines << horizontal_seperator(353, grid.left, 445)~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_walls~ + outputs.lines << horizontal_seperator(353, grid.left, 445) +** Processing line: ~ outputs.lines << horizontal_seperator(264, grid.left, 445)~ - Inside source: true *** True Line Result - def calc_walls -** Processing line: ~ state.walls.each { |w| w.x -= 8 }~ + outputs.lines << horizontal_seperator(264, grid.left, 445) +** Processing line: ~ outputs.lines << horizontal_seperator(174, grid.left, 445)~ - Inside source: true *** True Line Result - state.walls.each { |w| w.x -= 8 } + outputs.lines << horizontal_seperator(174, grid.left, 445) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ walls_count_before_removal = state.walls.length~ +** Processing line: ~ outputs.lines << vertical_seperator(445, grid.top, grid.bottom)~ - Inside source: true *** True Line Result - walls_count_before_removal = state.walls.length + outputs.lines << vertical_seperator(445, grid.top, grid.bottom) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.walls.reject! { |w| w.x < -100 }~ +** Processing line: ~ outputs.lines << horizontal_seperator(690, 445, 820)~ - Inside source: true *** True Line Result - state.walls.reject! { |w| w.x < -100 } + outputs.lines << horizontal_seperator(690, 445, 820) +** Processing line: ~ outputs.lines << horizontal_seperator(426, 445, 820)~ +- Inside source: true +*** True Line Result + outputs.lines << horizontal_seperator(426, 445, 820) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.score += 1 if state.walls.count < walls_count_before_removal~ +** Processing line: ~ outputs.lines << vertical_seperator(820, grid.top, grid.bottom)~ - Inside source: true *** True Line Result - state.score += 1 if state.walls.count < walls_count_before_removal + outputs.lines << vertical_seperator(820, grid.top, grid.bottom) +** 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: ~ state.wall_countdown -= 1 and return if state.wall_countdown > 0~ +** Processing line: ~ $tech_demo = TechDemo.new~ - Inside source: true *** True Line Result - state.wall_countdown -= 1 and return if state.wall_countdown > 0 + $tech_demo = TechDemo.new ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.walls << state.new_entity(:wall) do |w|~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - state.walls << state.new_entity(:wall) do |w| -** Processing line: ~ w.x = grid.right~ + def tick args +** Processing line: ~ $tech_demo.inputs = args.inputs~ - Inside source: true *** True Line Result - w.x = grid.right -** Processing line: ~ w.opening = grid.top~ + $tech_demo.inputs = args.inputs +** Processing line: ~ $tech_demo.state = args.state~ - Inside source: true *** True Line Result - w.opening = grid.top -** Processing line: ~ .randomize(:ratio)~ + $tech_demo.state = args.state +** Processing line: ~ $tech_demo.grid = args.grid~ - Inside source: true *** True Line Result - .randomize(:ratio) -** Processing line: ~ .greater(200)~ + $tech_demo.grid = args.grid +** Processing line: ~ $tech_demo.args = args~ - Inside source: true *** True Line Result - .greater(200) -** Processing line: ~ .lesser(520)~ + $tech_demo.args = args +** Processing line: ~ $tech_demo.outputs = args.render_target(:mini_map)~ - Inside source: true *** True Line Result - .lesser(520) -** Processing line: ~ w.bottom_height = w.opening - state.wall_gap_size~ + $tech_demo.outputs = args.render_target(:mini_map) +** Processing line: ~ $tech_demo.tick~ - Inside source: true *** True Line Result - w.bottom_height = w.opening - state.wall_gap_size -** Processing line: ~ w.top_y = w.opening + state.wall_gap_size~ + $tech_demo.tick +** Processing line: ~ args.outputs.labels << [830, 715, "Render target:", [-2, 0, 0, 0, 0, 255]]~ - Inside source: true *** True Line Result - w.top_y = w.opening + state.wall_gap_size -** Processing line: ~ end~ + args.outputs.labels << [830, 715, "Render target:", [-2, 0, 0, 0, 0, 255]] +** Processing line: ~ args.outputs.sprites << [0, 0, 1280, 720, :mini_map]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.outputs.sprites << [0, 0, 1280, 720, :mini_map] +** Processing line: ~ args.outputs.sprites << [830, 300, 675, 379, :mini_map]~ - Inside source: true *** True Line Result - -** Processing line: ~ state.wall_countdown = state.wall_countdown_length~ + args.outputs.sprites << [830, 300, 675, 379, :mini_map] +** Processing line: ~ tick_instructions args, "Sample app shows all the rendering apis available."~ - Inside source: true *** True Line Result - state.wall_countdown = state.wall_countdown_length -** Processing line: ~ end~ + tick_instructions args, "Sample app shows all the rendering apis available." +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc_flap~ +** Processing line: ~ def tick_instructions args, text, y = 715~ - Inside source: true *** True Line Result - def calc_flap -** Processing line: ~ state.y += state.dy~ + def tick_instructions args, text, y = 715 +** Processing line: ~ return if args.state.key_event_occurred~ - Inside source: true *** True Line Result - state.y += state.dy -** Processing line: ~ state.dy = state.dy.lesser state.flap_power~ + return if args.state.key_event_occurred +** Processing line: ~ if args.inputs.mouse.click ||~ - Inside source: true *** True Line Result - state.dy = state.dy.lesser state.flap_power -** Processing line: ~ state.dy -= state.gravity~ + if args.inputs.mouse.click || +** Processing line: ~ args.inputs.keyboard.directional_vector ||~ - Inside source: true *** True Line Result - state.dy -= state.gravity -** Processing line: ~ return if state.y < state.ceiling~ + args.inputs.keyboard.directional_vector || +** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ - Inside source: true *** True Line Result - return if state.y < state.ceiling -** Processing line: ~ state.y = state.ceiling~ + args.inputs.keyboard.key_down.enter || +** Processing line: ~ args.inputs.keyboard.key_down.escape~ - Inside source: true *** True Line Result - state.y = state.ceiling -** Processing line: ~ state.dy = state.dy.lesser state.ceiling_flap_power~ + args.inputs.keyboard.key_down.escape +** Processing line: ~ args.state.key_event_occurred = true~ - Inside source: true *** True Line Result - state.dy = state.dy.lesser state.ceiling_flap_power + args.state.key_event_occurred = true ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -44927,694 +47912,734 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_game_over~ +** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ - Inside source: true *** True Line Result - def calc_game_over -** Processing line: ~ return unless game_over?~ + 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 - return unless game_over? -** 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~ - Inside source: true *** True Line Result - -** Processing line: ~ state.death_at = state.tick_count~ + 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 - state.death_at = state.tick_count -** Processing line: ~ state.death_from = state.walls.first~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.death_from = state.walls.first -** Processing line: ~ state.death_fall_direction = -1~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - state.death_fall_direction = -1 -** Processing line: ~ state.death_fall_direction = 1 if state.x > state.death_from.x~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - state.death_fall_direction = 1 if state.x > state.death_from.x -** Processing line: ~ outputs.sounds << "sounds/hit-sound.wav"~ -- Inside source: true + +** Processing line: ~*** Advanced Rendering - Render Primitive Hierarchies - main.rb~ +- Header detected. *** True Line Result - outputs.sounds << "sounds/hit-sound.wav" -** Processing line: ~ begin_countdown~ + +*** True Line Result +*** Advanced Rendering - Render Primitive Hierarchies - 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/04_render_primitive_hierarchies/app/main.rb~ - Inside source: true *** True Line Result - begin_countdown -** Processing line: ~ end~ + # ./samples/07_advanced_rendering/04_render_primitive_hierarchies/app/main.rb +** Processing line: ~ =begin~ - Inside source: true *** True Line Result - end + =begin ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def process_inputs~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ - Inside source: true *** True Line Result - def process_inputs -** Processing line: ~ process_inputs_menu~ + APIs listing that haven't been encountered in previous sample apps: +** Processing line: ~~ - Inside source: true *** True Line Result - process_inputs_menu -** Processing line: ~ process_inputs_game~ + +** Processing line: ~ - Nested array: An array whose individual elements are also arrays; useful for~ - Inside source: true *** True Line Result - process_inputs_game -** Processing line: ~ end~ + - Nested array: An array whose individual elements are also arrays; useful for +** Processing line: ~ storing groups of similar data. Also called multidimensional arrays.~ - Inside source: true *** True Line Result - end + storing groups of similar data. Also called multidimensional arrays. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def process_inputs_menu~ -- Inside source: true -*** True Line Result - def process_inputs_menu -** Processing line: ~ return unless state.scene == :menu~ +** Processing line: ~ In this sample app, we see nested arrays being used in object definitions.~ - Inside source: true *** True Line Result - return unless state.scene == :menu -** Processing line: ~~ + In this sample app, we see nested arrays being used in object definitions. +** Processing line: ~ Notice the parameters for solids, listed below. Parameters 1-3 set the~ - Inside source: true *** True Line Result - -** Processing line: ~ changediff = inputs.keyboard.key_down.tab || inputs.controller_one.key_down.select~ + Notice the parameters for solids, listed below. Parameters 1-3 set the +** Processing line: ~ definition for the rect, and parameter 4 sets the definition of the color.~ - Inside source: true *** True Line Result - changediff = inputs.keyboard.key_down.tab || inputs.controller_one.key_down.select -** Processing line: ~ if inputs.mouse.click~ + definition for the rect, and parameter 4 sets the definition of the color. +** Processing line: ~~ - Inside source: true *** True Line Result - if inputs.mouse.click -** Processing line: ~ p = inputs.mouse.click.point~ + +** Processing line: ~ Instead of having a solid definition that looks like this,~ - Inside source: true *** True Line Result - p = inputs.mouse.click.point -** Processing line: ~ if (p.y >= 165) && (p.y < 200) && (p.x >= 500) && (p.x < 800)~ + Instead of having a solid definition that looks like this, +** Processing line: ~ [X, Y, W, H, R, G, B]~ - Inside source: true *** True Line Result - if (p.y >= 165) && (p.y < 200) && (p.x >= 500) && (p.x < 800) -** Processing line: ~ changediff = true~ + [X, Y, W, H, R, G, B] +** Processing line: ~ we can separate it into two separate array definitions in one, like this~ - Inside source: true *** True Line Result - changediff = true -** Processing line: ~ end~ + we can separate it into two separate array definitions in one, like this +** Processing line: ~ [[X, Y, W, H], [R, G, B]]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [[X, Y, W, H], [R, G, B]] +** Processing line: ~ and both options work fine in defining our solid (or any object).~ - Inside source: true *** True Line Result - end + and both options work fine in defining our solid (or any object). ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if changediff~ +** Processing line: ~ - Collections: Lists of data; useful for organizing large amounts of data.~ - Inside source: true *** True Line Result - if changediff -** Processing line: ~ case state.new_difficulty~ + - Collections: Lists of data; useful for organizing large amounts of data. +** Processing line: ~ One element of a collection could be an array (which itself contains many elements).~ - Inside source: true *** True Line Result - case state.new_difficulty -** Processing line: ~ when :easy~ + One element of a collection could be an array (which itself contains many elements). +** Processing line: ~ For example, a collection that stores two solid objects would look like this:~ - Inside source: true *** True Line Result - when :easy -** Processing line: ~ state.new_difficulty = :normal~ + For example, a collection that stores two solid objects would look like this: +** Processing line: ~ [~ - Inside source: true *** True Line Result - state.new_difficulty = :normal -** Processing line: ~ when :normal~ + [ +** Processing line: ~ [100, 100, 50, 50, 0, 0, 0],~ - Inside source: true *** True Line Result - when :normal -** Processing line: ~ state.new_difficulty = :hard~ + [100, 100, 50, 50, 0, 0, 0], +** Processing line: ~ [100, 150, 50, 50, 255, 255, 255]~ - Inside source: true *** True Line Result - state.new_difficulty = :hard -** Processing line: ~ when :hard~ + [100, 150, 50, 50, 255, 255, 255] +** Processing line: ~ ]~ - Inside source: true *** True Line Result - when :hard -** Processing line: ~ state.new_difficulty = :flappy~ + ] +** Processing line: ~ If this collection was added to args.outputs.solids, two solids would be output~ - Inside source: true *** True Line Result - state.new_difficulty = :flappy -** Processing line: ~ when :flappy~ + If this collection was added to args.outputs.solids, two solids would be output +** Processing line: ~ next to each other, one black and one white.~ - Inside source: true *** True Line Result - when :flappy -** Processing line: ~ state.new_difficulty = :easy~ + next to each other, one black and one white. +** Processing line: ~ Nested arrays can be used in collections, as you will see in this sample app.~ - Inside source: true *** True Line Result - state.new_difficulty = :easy -** Processing line: ~ end~ + Nested arrays can be used in collections, as you will see in this sample app. +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ Reminders:~ - Inside source: true *** True Line Result - end + Reminders: ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start || inputs.controller_one.key_down.a~ +** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start || inputs.controller_one.key_down.a -** Processing line: ~ state.difficulty = state.new_difficulty~ + - args.outputs.solids: An array. The values generate a solid. +** Processing line: ~ The parameters for a solid are~ - Inside source: true *** True Line Result - state.difficulty = state.new_difficulty -** Processing line: ~ change_to_scene :game~ + The parameters for a solid are +** Processing line: ~ 1. The position on the screen (x, y)~ - Inside source: true *** True Line Result - change_to_scene :game -** Processing line: ~ reset_game false~ + 1. The position on the screen (x, y) +** Processing line: ~ 2. The width (w)~ - Inside source: true *** True Line Result - reset_game false -** Processing line: ~ state.hi_score = 0~ + 2. The width (w) +** Processing line: ~ 3. The height (h)~ - Inside source: true *** True Line Result - state.hi_score = 0 -** Processing line: ~ begin_countdown~ + 3. The height (h) +** Processing line: ~ 4. The color (r, g, b) (if a color is not assigned, the object's default color will be black)~ - Inside source: true *** True Line Result - begin_countdown -** Processing line: ~ end~ + 4. The color (r, g, b) (if a color is not assigned, the object's default color will be black) +** Processing line: ~ NOTE: THE PARAMETERS ARE THE SAME FOR BORDERS!~ - Inside source: true *** True Line Result - end + NOTE: THE PARAMETERS ARE THE SAME FOR BORDERS! ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if inputs.keyboard.key_down.escape || (inputs.mouse.click && !changediff) || inputs.controller_one.key_down.b~ -- Inside source: true -*** True Line Result - if inputs.keyboard.key_down.escape || (inputs.mouse.click && !changediff) || inputs.controller_one.key_down.b -** Processing line: ~ state.new_difficulty = state.difficulty~ +** Processing line: ~ Here is an example of a (red) border or solid definition:~ - Inside source: true *** True Line Result - state.new_difficulty = state.difficulty -** Processing line: ~ change_to_scene :game~ + Here is an example of a (red) border or solid definition: +** Processing line: ~ [100, 100, 400, 500, 255, 0, 0]~ - Inside source: true *** True Line Result - change_to_scene :game -** Processing line: ~ end~ + [100, 100, 400, 500, 255, 0, 0] +** Processing line: ~ It will be a solid or border depending on if it is added to args.outputs.solids or args.outputs.borders.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + It will be a solid or border depending on if it is added to args.outputs.solids or args.outputs.borders. +** Processing line: ~ For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md.~ - Inside source: true *** True Line Result - end + For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def process_inputs_game~ +** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ - Inside source: true *** True Line Result - def process_inputs_game -** Processing line: ~ return unless state.scene == :game~ + - args.outputs.sprites: An array. The values generate a sprite. +** Processing line: ~ The parameters for sprites are~ - Inside source: true *** True Line Result - return unless state.scene == :game -** Processing line: ~~ + The parameters for sprites are +** Processing line: ~ 1. The position on the screen (x, y)~ - Inside source: true *** True Line Result - -** Processing line: ~ clicked_menu = false~ + 1. The position on the screen (x, y) +** Processing line: ~ 2. The width (w)~ - Inside source: true *** True Line Result - clicked_menu = false -** Processing line: ~ if inputs.mouse.click~ + 2. The width (w) +** Processing line: ~ 3. The height (h)~ - Inside source: true *** True Line Result - if inputs.mouse.click -** Processing line: ~ p = inputs.mouse.click.point~ + 3. The height (h) +** Processing line: ~ 4. The image path (p)~ - Inside source: true *** True Line Result - p = inputs.mouse.click.point -** Processing line: ~ clicked_menu = (p.y >= 620) && (p.x < 275)~ + 4. The image path (p) +** Processing line: ~~ - Inside source: true *** True Line Result - clicked_menu = (p.y >= 620) && (p.x < 275) -** Processing line: ~ end~ + +** Processing line: ~ Here is an example of a sprite definition:~ - Inside source: true *** True Line Result - end + Here is an example of a sprite definition: +** Processing line: ~ [100, 100, 400, 500, 'sprites/dragonruby.png']~ +- Inside source: true +*** True Line Result + [100, 100, 400, 500, 'sprites/dragonruby.png'] +** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ +- Inside source: true +*** True Line Result + For more information about sprites, go to mygame/documentation/05-sprites.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if clicked_menu || inputs.keyboard.key_down.escape || inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start~ +** Processing line: ~ =end~ - Inside source: true *** True Line Result - if clicked_menu || inputs.keyboard.key_down.escape || inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start -** Processing line: ~ change_to_scene :menu~ + =end +** Processing line: ~~ - Inside source: true *** True Line Result - change_to_scene :menu -** Processing line: ~ elsif (inputs.mouse.down || inputs.mouse.click || inputs.keyboard.key_down.space || inputs.controller_one.key_down.a) && state.countdown == 0~ + +** Processing line: ~ # This code demonstrates the creation and output of objects like sprites, borders, and solids~ - Inside source: true *** True Line Result - elsif (inputs.mouse.down || inputs.mouse.click || inputs.keyboard.key_down.space || inputs.controller_one.key_down.a) && state.countdown == 0 -** Processing line: ~ state.dy = 0~ + # This code demonstrates the creation and output of objects like sprites, borders, and solids +** Processing line: ~ # If filled in, they are solids~ - Inside source: true *** True Line Result - state.dy = 0 -** Processing line: ~ state.dy += state.flap_power~ + # If filled in, they are solids +** Processing line: ~ # If hollow, they are borders~ - Inside source: true *** True Line Result - state.dy += state.flap_power -** Processing line: ~ state.flapped_at = state.tick_count~ + # If hollow, they are borders +** Processing line: ~ # If images, they are sprites~ - Inside source: true *** True Line Result - state.flapped_at = state.tick_count -** Processing line: ~ outputs.sounds << "sounds/fly-sound.wav"~ + # If images, they are sprites +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.sounds << "sounds/fly-sound.wav" -** Processing line: ~ end~ + +** Processing line: ~ # Solids are added to args.outputs.solids~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Solids are added to args.outputs.solids +** Processing line: ~ # Borders are added to args.outputs.borders~ - Inside source: true *** True Line Result - end + # Borders are added to args.outputs.borders +** Processing line: ~ # Sprites are added to args.outputs.sprites~ +- Inside source: true +*** True Line Result + # Sprites are added to args.outputs.sprites ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def scrolling_background at, path, rate, y = 0~ +** Processing line: ~ # The tick method runs 60 frames every second.~ - Inside source: true *** True Line Result - def scrolling_background at, path, rate, y = 0 -** Processing line: ~ [~ + # The tick method runs 60 frames every second. +** Processing line: ~ # Your game is going to happen under this one function.~ - Inside source: true *** True Line Result - [ -** Processing line: ~ [ 0 - at.*(rate) % 1440, y, 1440, 720, path],~ + # Your game is going to happen under this one function. +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - [ 0 - at.*(rate) % 1440, y, 1440, 720, path], -** Processing line: ~ [1440 - at.*(rate) % 1440, y, 1440, 720, path]~ + def tick args +** Processing line: ~ border_as_solid_and_solid_as_border args~ - Inside source: true *** True Line Result - [1440 - at.*(rate) % 1440, y, 1440, 720, path] -** Processing line: ~ ]~ + border_as_solid_and_solid_as_border args +** Processing line: ~ sprite_as_border_or_solids args~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + sprite_as_border_or_solids args +** Processing line: ~ collection_of_borders_and_solids args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + collection_of_borders_and_solids args +** Processing line: ~ collection_of_sprites args~ - Inside source: true *** True Line Result - -** Processing line: ~ def white~ + collection_of_sprites args +** Processing line: ~ end~ - Inside source: true *** True Line Result - def white -** Processing line: ~ [255, 255, 255]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [255, 255, 255] -** Processing line: ~ end~ + +** Processing line: ~ # Shows a border being output onto the screen as a border and a solid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Shows a border being output onto the screen as a border and a solid +** Processing line: ~ # Also shows how colors can be set~ - Inside source: true *** True Line Result - -** Processing line: ~ def large_white_typeset~ + # Also shows how colors can be set +** Processing line: ~ def border_as_solid_and_solid_as_border args~ - Inside source: true *** True Line Result - def large_white_typeset -** Processing line: ~ [5, 0, 255, 255, 255]~ + def border_as_solid_and_solid_as_border args +** Processing line: ~ border = [0, 0, 50, 50]~ - Inside source: true *** True Line Result - [5, 0, 255, 255, 255] -** Processing line: ~ end~ + border = [0, 0, 50, 50] +** Processing line: ~ args.outputs.borders << border~ - Inside source: true *** True Line Result - end + args.outputs.borders << border +** Processing line: ~ args.outputs.solids << border~ +- Inside source: true +*** True Line Result + args.outputs.solids << border ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def at_beginning?~ +** Processing line: ~ # Red, green, blue saturations (last three parameters) can be any number between 0 and 255~ - Inside source: true *** True Line Result - def at_beginning? -** Processing line: ~ state.walls.count == 0~ + # Red, green, blue saturations (last three parameters) can be any number between 0 and 255 +** Processing line: ~ border_with_color = [0, 100, 50, 50, 255, 0, 0]~ - Inside source: true *** True Line Result - state.walls.count == 0 -** Processing line: ~ end~ + border_with_color = [0, 100, 50, 50, 255, 0, 0] +** Processing line: ~ args.outputs.borders << border_with_color~ - Inside source: true *** True Line Result - end + args.outputs.borders << border_with_color +** Processing line: ~ args.outputs.solids << border_with_color~ +- Inside source: true +*** True Line Result + args.outputs.solids << border_with_color ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def dragon_collision_box~ +** Processing line: ~ border_with_nested_color = [0, 200, 50, 50, [0, 255, 0]] # nested color~ - Inside source: true *** True Line Result - def dragon_collision_box -** Processing line: ~ state.dragon_sprite~ + border_with_nested_color = [0, 200, 50, 50, [0, 255, 0]] # nested color +** Processing line: ~ args.outputs.borders << border_with_nested_color~ - Inside source: true *** True Line Result - state.dragon_sprite -** Processing line: ~ .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)~ + args.outputs.borders << border_with_nested_color +** Processing line: ~ args.outputs.solids << border_with_nested_color~ - Inside source: true *** True Line Result - .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5) -** Processing line: ~ .rect_shift_right(10)~ + args.outputs.solids << border_with_nested_color +** Processing line: ~~ - Inside source: true *** True Line Result - .rect_shift_right(10) -** Processing line: ~ .rect_shift_up(state.dy * 2)~ + +** Processing line: ~ border_with_nested_rect = [[0, 300, 50, 50], 0, 0, 255] # nested rect~ - Inside source: true *** True Line Result - .rect_shift_up(state.dy * 2) -** Processing line: ~ end~ + border_with_nested_rect = [[0, 300, 50, 50], 0, 0, 255] # nested rect +** Processing line: ~ args.outputs.borders << border_with_nested_rect~ - Inside source: true *** True Line Result - end + args.outputs.borders << border_with_nested_rect +** Processing line: ~ args.outputs.solids << border_with_nested_rect~ +- Inside source: true +*** True Line Result + args.outputs.solids << border_with_nested_rect ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def game_over?~ +** Processing line: ~ border_with_nested_color_and_rect = [[0, 400, 50, 50], [255, 0, 255]] # nested rect and color~ - Inside source: true *** True Line Result - def game_over? -** Processing line: ~ return true if state.y <= 0.-(500 * collision_forgiveness) && !at_beginning?~ + border_with_nested_color_and_rect = [[0, 400, 50, 50], [255, 0, 255]] # nested rect and color +** Processing line: ~ args.outputs.borders << border_with_nested_color_and_rect~ - Inside source: true *** True Line Result - return true if state.y <= 0.-(500 * collision_forgiveness) && !at_beginning? -** Processing line: ~~ + args.outputs.borders << border_with_nested_color_and_rect +** Processing line: ~ args.outputs.solids << border_with_nested_color_and_rect~ - Inside source: true *** True Line Result - -** Processing line: ~ state.walls~ + args.outputs.solids << border_with_nested_color_and_rect +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.walls -** Processing line: ~ .flat_map { |w| w.sprites }~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - .flat_map { |w| w.sprites } -** Processing line: ~ .any? do |s|~ + +** Processing line: ~ # Shows a sprite output onto the screen as a sprite, border, and solid~ - Inside source: true *** True Line Result - .any? do |s| -** Processing line: ~ s.intersect_rect?(dragon_collision_box)~ + # Shows a sprite output onto the screen as a sprite, border, and solid +** Processing line: ~ # Demonstrates that all three outputs appear differently on screen~ - Inside source: true *** True Line Result - s.intersect_rect?(dragon_collision_box) -** Processing line: ~ end~ + # Demonstrates that all three outputs appear differently on screen +** Processing line: ~ def sprite_as_border_or_solids args~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def sprite_as_border_or_solids args +** Processing line: ~ sprite = [100, 0, 50, 50, 'sprites/ship.png']~ - Inside source: true *** True Line Result - end + sprite = [100, 0, 50, 50, 'sprites/ship.png'] +** Processing line: ~ args.outputs.sprites << sprite~ +- Inside source: true +*** True Line Result + args.outputs.sprites << sprite ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def collision_forgiveness~ +** Processing line: ~ # Sprite_as_border variable has same parameters (excluding position) as above object,~ - Inside source: true *** True Line Result - def collision_forgiveness -** Processing line: ~ case state.difficulty~ + # Sprite_as_border variable has same parameters (excluding position) as above object, +** Processing line: ~ # but will appear differently on screen because it is added to args.outputs.borders~ - Inside source: true *** True Line Result - case state.difficulty -** Processing line: ~ when :easy~ + # but will appear differently on screen because it is added to args.outputs.borders +** Processing line: ~ sprite_as_border = [100, 100, 50, 50, 'sprites/ship.png']~ - Inside source: true *** True Line Result - when :easy -** Processing line: ~ 0.9~ + sprite_as_border = [100, 100, 50, 50, 'sprites/ship.png'] +** Processing line: ~ args.outputs.borders << sprite_as_border~ - Inside source: true *** True Line Result - 0.9 -** Processing line: ~ when :normal~ + args.outputs.borders << sprite_as_border +** Processing line: ~~ - Inside source: true *** True Line Result - when :normal -** Processing line: ~ 0.7~ + +** Processing line: ~ # Sprite_as_solid variable has same parameters (excluding position) as above object,~ - Inside source: true *** True Line Result - 0.7 -** Processing line: ~ when :hard~ + # Sprite_as_solid variable has same parameters (excluding position) as above object, +** Processing line: ~ # but will appear differently on screen because it is added to args.outputs.solids~ - Inside source: true *** True Line Result - when :hard -** Processing line: ~ 0.5~ + # but will appear differently on screen because it is added to args.outputs.solids +** Processing line: ~ sprite_as_solid = [100, 200, 50, 50, 'sprites/ship.png']~ - Inside source: true *** True Line Result - 0.5 -** Processing line: ~ when :flappy~ + sprite_as_solid = [100, 200, 50, 50, 'sprites/ship.png'] +** Processing line: ~ args.outputs.solids << sprite_as_solid~ - Inside source: true *** True Line Result - when :flappy -** Processing line: ~ 0.3~ + args.outputs.solids << sprite_as_solid +** Processing line: ~ end~ - Inside source: true *** True Line Result - 0.3 -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ 0.9~ + +** Processing line: ~ # Holds and outputs a collection of borders and a collection of solids~ - Inside source: true *** True Line Result - 0.9 -** Processing line: ~ end~ + # Holds and outputs a collection of borders and a collection of solids +** Processing line: ~ # Collections are created by using arrays to hold parameters of each individual object~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Collections are created by using arrays to hold parameters of each individual object +** Processing line: ~ def collection_of_borders_and_solids args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def collection_of_borders_and_solids args +** Processing line: ~ collection_borders = [~ - Inside source: true *** True Line Result - -** Processing line: ~ def countdown_text~ + collection_borders = [ +** Processing line: ~ [~ - Inside source: true *** True Line Result - def countdown_text -** Processing line: ~ state.countdown ||= -1~ + [ +** Processing line: ~ [200, 0, 50, 50], # black border~ - Inside source: true *** True Line Result - state.countdown ||= -1 -** Processing line: ~ return "" if state.countdown == 0~ + [200, 0, 50, 50], # black border +** Processing line: ~ [200, 100, 50, 50, 255, 0, 0], # red border~ - Inside source: true *** True Line Result - return "" if state.countdown == 0 -** Processing line: ~ return "GO!" if state.countdown.idiv(60) == 0~ + [200, 100, 50, 50, 255, 0, 0], # red border +** Processing line: ~ [200, 200, 50, 50, [0, 255, 0]], # nested color~ - Inside source: true *** True Line Result - return "GO!" if state.countdown.idiv(60) == 0 -** Processing line: ~ return "GAME OVER" if state.death_at~ + [200, 200, 50, 50, [0, 255, 0]], # nested color +** Processing line: ~ ],~ - Inside source: true *** True Line Result - return "GAME OVER" if state.death_at -** Processing line: ~ return "READY?"~ + ], +** Processing line: ~ [[200, 300, 50, 50], 0, 0, 255], # nested rect~ - Inside source: true *** True Line Result - return "READY?" -** Processing line: ~ end~ + [[200, 300, 50, 50], 0, 0, 255], # nested rect +** Processing line: ~ [[200, 400, 50, 50], [255, 0, 255]] # nested rect and nested color~ - Inside source: true *** True Line Result - end + [[200, 400, 50, 50], [255, 0, 255]] # nested rect and nested color +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def begin_countdown~ +** Processing line: ~ args.outputs.borders << collection_borders~ - Inside source: true *** True Line Result - def begin_countdown -** Processing line: ~ state.countdown = 4.seconds~ + args.outputs.borders << collection_borders +** Processing line: ~~ - Inside source: true *** True Line Result - state.countdown = 4.seconds -** Processing line: ~ end~ + +** Processing line: ~ collection_solids = [~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + collection_solids = [ +** Processing line: ~ [~ - Inside source: true *** True Line Result - -** Processing line: ~ def score_text~ + [ +** Processing line: ~ [[300, 300, 50, 50], 0, 0, 255], # nested rect~ - Inside source: true *** True Line Result - def score_text -** Processing line: ~ return "" unless state.countdown > 1.seconds~ + [[300, 300, 50, 50], 0, 0, 255], # nested rect +** Processing line: ~ [[300, 400, 50, 50], [255, 0, 255]] # nested rect and nested color~ - Inside source: true *** True Line Result - return "" unless state.countdown > 1.seconds -** Processing line: ~ return "" unless state.death_at~ + [[300, 400, 50, 50], [255, 0, 255]] # nested rect and nested color +** Processing line: ~ ],~ - Inside source: true *** True Line Result - return "" unless state.death_at -** Processing line: ~ return "SCORE: 0 (LOL)" if state.score == 0~ + ], +** Processing line: ~ [300, 0, 50, 50],~ - Inside source: true *** True Line Result - return "SCORE: 0 (LOL)" if state.score == 0 -** Processing line: ~ return "HI SCORE: #{state.score}" if state.score == state.hi_score~ + [300, 0, 50, 50], +** Processing line: ~ [300, 100, 50, 50, 255, 0, 0],~ - Inside source: true *** True Line Result - return "HI SCORE: #{state.score}" if state.score == state.hi_score -** Processing line: ~ return "SCORE: #{state.score}"~ + [300, 100, 50, 50, 255, 0, 0], +** Processing line: ~ [300, 200, 50, 50, [0, 255, 0]], # nested color~ - Inside source: true *** True Line Result - return "SCORE: #{state.score}" -** Processing line: ~ end~ + [300, 200, 50, 50, [0, 255, 0]], # nested color +** Processing line: ~ ]~ - Inside source: true *** True Line Result - end + ] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def reset_game set_flash = true~ +** Processing line: ~ args.outputs.solids << collection_solids~ - Inside source: true *** True Line Result - def reset_game set_flash = true -** Processing line: ~ state.flash_at = state.tick_count if set_flash~ + args.outputs.solids << collection_solids +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.flash_at = state.tick_count if set_flash -** Processing line: ~ state.walls = []~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.walls = [] -** Processing line: ~ state.y = 500~ + +** Processing line: ~ # Holds and outputs a collection of sprites by adding it to args.outputs.sprites~ - Inside source: true *** True Line Result - state.y = 500 -** Processing line: ~ state.dy = 0~ + # Holds and outputs a collection of sprites by adding it to args.outputs.sprites +** Processing line: ~ # Also outputs a collection with same parameters (excluding position) by adding~ - Inside source: true *** True Line Result - state.dy = 0 -** Processing line: ~ state.hi_score = state.hi_score.greater(state.score)~ + # Also outputs a collection with same parameters (excluding position) by adding +** Processing line: ~ # it to args.outputs.solids and another to args.outputs.borders~ - Inside source: true *** True Line Result - state.hi_score = state.hi_score.greater(state.score) -** Processing line: ~ state.score = 0~ + # it to args.outputs.solids and another to args.outputs.borders +** Processing line: ~ def collection_of_sprites args~ - Inside source: true *** True Line Result - state.score = 0 -** Processing line: ~ state.wall_countdown = state.wall_countdown_length.fdiv(2)~ + def collection_of_sprites args +** Processing line: ~ sprites_collection = [~ - Inside source: true *** True Line Result - state.wall_countdown = state.wall_countdown_length.fdiv(2) -** Processing line: ~ state.show_death = false~ + sprites_collection = [ +** Processing line: ~ [~ - Inside source: true *** True Line Result - state.show_death = false -** Processing line: ~ state.death_at = nil~ + [ +** Processing line: ~ [400, 0, 50, 50, 'sprites/ship.png'],~ - Inside source: true *** True Line Result - state.death_at = nil -** Processing line: ~ end~ + [400, 0, 50, 50, 'sprites/ship.png'], +** Processing line: ~ [400, 100, 50, 50, 'sprites/ship.png'],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [400, 100, 50, 50, 'sprites/ship.png'], +** Processing line: ~ ],~ - Inside source: true *** True Line Result - -** Processing line: ~ def change_to_scene scene~ + ], +** Processing line: ~ [400, 200, 50, 50, 'sprites/ship.png']~ - Inside source: true *** True Line Result - def change_to_scene scene -** Processing line: ~ state.scene = scene~ + [400, 200, 50, 50, 'sprites/ship.png'] +** Processing line: ~ ]~ - Inside source: true *** True Line Result - state.scene = scene -** Processing line: ~ state.scene_at = state.tick_count~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - state.scene_at = state.tick_count -** Processing line: ~ inputs.keyboard.clear~ + +** Processing line: ~ args.outputs.sprites << sprites_collection~ - Inside source: true *** True Line Result - inputs.keyboard.clear -** Processing line: ~ inputs.controller_one.clear~ + args.outputs.sprites << sprites_collection +** Processing line: ~~ - Inside source: true *** True Line Result - inputs.controller_one.clear -** Processing line: ~ end~ + +** Processing line: ~ args.outputs.solids << [~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + args.outputs.solids << [ +** Processing line: ~ [500, 0, 50, 50, 'sprites/ship.png'],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [500, 0, 50, 50, 'sprites/ship.png'], +** Processing line: ~ [500, 100, 50, 50, 'sprites/ship.png'],~ - Inside source: true *** True Line Result - -** Processing line: ~ $flappy_dragon = FlappyDragon.new~ + [500, 100, 50, 50, 'sprites/ship.png'], +** Processing line: ~ [[[500, 200, 50, 50, 'sprites/ship.png']]]~ - Inside source: true *** True Line Result - $flappy_dragon = FlappyDragon.new + [[[500, 200, 50, 50, 'sprites/ship.png']]] +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.borders << [~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ $flappy_dragon.grid = args.grid~ + args.outputs.borders << [ +** Processing line: ~ [~ - Inside source: true *** True Line Result - $flappy_dragon.grid = args.grid -** Processing line: ~ $flappy_dragon.inputs = args.inputs~ + [ +** Processing line: ~ [600, 0, 50, 50, 'sprites/ship.png'],~ - Inside source: true *** True Line Result - $flappy_dragon.inputs = args.inputs -** Processing line: ~ $flappy_dragon.state = args.state~ + [600, 0, 50, 50, 'sprites/ship.png'], +** Processing line: ~ [600, 100, 50, 50, 'sprites/ship.png'],~ - Inside source: true *** True Line Result - $flappy_dragon.state = args.state -** Processing line: ~ $flappy_dragon.outputs = args.outputs~ + [600, 100, 50, 50, 'sprites/ship.png'], +** Processing line: ~ ],~ - Inside source: true *** True Line Result - $flappy_dragon.outputs = args.outputs -** Processing line: ~ $flappy_dragon.tick~ + ], +** Processing line: ~ [600, 200, 50, 50, 'sprites/ship.png']~ - Inside source: true *** True Line Result - $flappy_dragon.tick + [600, 200, 50, 50, 'sprites/ship.png'] +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -45631,654 +48656,782 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Arcade - Pong - main.rb~ +** Processing line: ~*** Advanced Rendering - Render Primitives As Hash - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Arcade - Pong - main.rb +*** Advanced Rendering - Render Primitives As Hash - 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_arcade/pong/app/main.rb~ +** Processing line: ~ # ./samples/07_advanced_rendering/05_render_primitives_as_hash/app/main.rb~ - Inside source: true *** True Line Result - # ./samples/99_genre_arcade/pong/app/main.rb -** Processing line: ~ def tick args~ + # ./samples/07_advanced_rendering/05_render_primitives_as_hash/app/main.rb +** Processing line: ~ =begin~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ defaults args~ + =begin +** Processing line: ~~ - Inside source: true *** True Line Result - defaults args -** Processing line: ~ render args~ + +** Processing line: ~ Reminders:~ - Inside source: true *** True Line Result - render args -** Processing line: ~ calc args~ + Reminders: +** Processing line: ~~ - Inside source: true *** True Line Result - calc args -** Processing line: ~ input args~ + +** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ - Inside source: true *** True Line Result - input args -** Processing line: ~ end~ + - Hashes: Collection of unique keys and their corresponding values. The value can be found +** Processing line: ~ using their keys.~ - Inside source: true *** True Line Result - end + using their keys. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def defaults args~ +** Processing line: ~ For example, if we have a "numbers" hash that stores numbers in English as the~ - Inside source: true *** True Line Result - def defaults args -** Processing line: ~ args.state.ball.debounce ||= 3 * 60~ + For example, if we have a "numbers" hash that stores numbers in English as the +** Processing line: ~ key and numbers in Spanish as the value, we'd have a hash that looks like this...~ - Inside source: true *** True Line Result - args.state.ball.debounce ||= 3 * 60 -** Processing line: ~ args.state.ball.size ||= 10~ + key and numbers in Spanish as the value, we'd have a hash that looks like this... +** Processing line: ~ numbers = { "one" => "uno", "two" => "dos", "three" => "tres" }~ - Inside source: true *** True Line Result - args.state.ball.size ||= 10 -** Processing line: ~ args.state.ball.size_half ||= args.state.ball.size / 2~ + numbers = { "one" => "uno", "two" => "dos", "three" => "tres" } +** Processing line: ~ and on it goes.~ - Inside source: true *** True Line Result - args.state.ball.size_half ||= args.state.ball.size / 2 -** Processing line: ~ args.state.ball.x ||= 640~ + and on it goes. +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.ball.x ||= 640 -** Processing line: ~ args.state.ball.y ||= 360~ + +** Processing line: ~ Now if we wanted to find the corresponding value of the "one" key, we could say~ - Inside source: true *** True Line Result - args.state.ball.y ||= 360 -** Processing line: ~ args.state.ball.dx ||= 5.randomize(:sign)~ + Now if we wanted to find the corresponding value of the "one" key, we could say +** Processing line: ~ puts numbers["one"]~ - Inside source: true *** True Line Result - args.state.ball.dx ||= 5.randomize(:sign) -** Processing line: ~ args.state.ball.dy ||= 5.randomize(:sign)~ + puts numbers["one"] +** Processing line: ~ which would print "uno" to the console.~ - Inside source: true *** True Line Result - args.state.ball.dy ||= 5.randomize(:sign) -** Processing line: ~ args.state.left_paddle.y ||= 360~ + which would print "uno" to the console. +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.left_paddle.y ||= 360 -** Processing line: ~ args.state.right_paddle.y ||= 360~ + +** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ - Inside source: true *** True Line Result - args.state.right_paddle.y ||= 360 -** Processing line: ~ args.state.paddle.h ||= 120~ + - args.outputs.sprites: An array. The values generate a sprite. +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE]~ - Inside source: true *** True Line Result - args.state.paddle.h ||= 120 -** Processing line: ~ args.state.paddle.w ||= 10~ + The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE] +** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ - Inside source: true *** True Line Result - args.state.paddle.w ||= 10 -** Processing line: ~ args.state.left_paddle.score ||= 0~ + For more information about sprites, go to mygame/documentation/05-sprites.md. +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.left_paddle.score ||= 0 -** Processing line: ~ args.state.right_paddle.score ||= 0~ + +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ - Inside source: true *** True Line Result - args.state.right_paddle.score ||= 0 -** Processing line: ~ end~ + - args.outputs.labels: An array. The values generate a label. +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ - Inside source: true *** True Line Result - -** Processing line: ~ def render args~ + For more information about labels, go to mygame/documentation/02-labels.md. +** Processing line: ~~ - Inside source: true *** True Line Result - def render args -** Processing line: ~ render_center_line args~ + +** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ - Inside source: true *** True Line Result - render_center_line args -** Processing line: ~ render_scores args~ + - args.outputs.solids: An array. The values generate a solid. +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ - Inside source: true *** True Line Result - render_scores args -** Processing line: ~ render_countdown args~ + The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] +** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ - Inside source: true *** True Line Result - render_countdown args -** Processing line: ~ render_ball args~ + For more information about solids, go to mygame/documentation/03-solids-and-borders.md. +** Processing line: ~~ - Inside source: true *** True Line Result - render_ball args -** Processing line: ~ render_paddles args~ + +** Processing line: ~ - args.outputs.borders: An array. The values generate a border.~ - Inside source: true *** True Line Result - render_paddles args -** Processing line: ~ render_instructions args~ + - args.outputs.borders: An array. The values generate a border. +** Processing line: ~ The parameters are the same as a solid.~ - Inside source: true *** True Line Result - render_instructions args -** Processing line: ~ end~ + The parameters are the same as a solid. +** Processing line: ~ For more information about borders, go to mygame/documentation/03-solids-and-borders.md.~ - Inside source: true *** True Line Result - end + For more information about borders, go to mygame/documentation/03-solids-and-borders.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ begin :render_methods~ -- Inside source: true -*** True Line Result - begin :render_methods -** Processing line: ~ def render_center_line args~ +** Processing line: ~ - args.outputs.lines: An array. The values generate a line.~ - Inside source: true *** True Line Result - def render_center_line args -** Processing line: ~ args.outputs.lines << [640, 0, 640, 720]~ + - args.outputs.lines: An array. The values generate a line. +** Processing line: ~ The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE]~ - Inside source: true *** True Line Result - args.outputs.lines << [640, 0, 640, 720] -** Processing line: ~ end~ + The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE] +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ - Inside source: true *** True Line Result - end + For more information about labels, go to mygame/documentation/02-labels.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_scores args~ +** Processing line: ~ =end~ - Inside source: true *** True Line Result - def render_scores args -** Processing line: ~ args.outputs.labels << [~ + =end +** Processing line: ~~ - Inside source: true *** True Line Result - args.outputs.labels << [ -** Processing line: ~ [320, 650, args.state.left_paddle.score, 10, 1],~ + +** Processing line: ~ # This sample app demonstrates how hashes can be used to output different kinds of objects.~ - Inside source: true *** True Line Result - [320, 650, args.state.left_paddle.score, 10, 1], -** Processing line: ~ [960, 650, args.state.right_paddle.score, 10, 1]~ + # This sample app demonstrates how hashes can be used to output different kinds of objects. +** Processing line: ~~ - Inside source: true *** True Line Result - [960, 650, args.state.right_paddle.score, 10, 1] -** Processing line: ~ ]~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + def tick args +** Processing line: ~ args.state.angle ||= 0 # initializes angle to 0~ - Inside source: true *** True Line Result - end + args.state.angle ||= 0 # initializes angle to 0 +** Processing line: ~ args.state.angle += 1 # increments angle by 1 every frame (60 times a second)~ +- Inside source: true +*** True Line Result + args.state.angle += 1 # increments angle by 1 every frame (60 times a second) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_countdown args~ +** Processing line: ~ # Outputs sprite using a hash~ - Inside source: true *** True Line Result - def render_countdown args -** Processing line: ~ return unless args.state.ball.debounce > 0~ + # Outputs sprite using a hash +** Processing line: ~ args.outputs.sprites << {~ - Inside source: true *** True Line Result - return unless args.state.ball.debounce > 0 -** Processing line: ~ args.outputs.labels << [640, 360, "%.2f" % args.state.ball.debounce.fdiv(60), 10, 1]~ + args.outputs.sprites << { +** Processing line: ~ x: 30, # sprite position~ - Inside source: true *** True Line Result - args.outputs.labels << [640, 360, "%.2f" % args.state.ball.debounce.fdiv(60), 10, 1] -** Processing line: ~ end~ + x: 30, # sprite position +** Processing line: ~ y: 550,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + y: 550, +** Processing line: ~ w: 128, # sprite size~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_ball args~ + w: 128, # sprite size +** Processing line: ~ h: 101,~ - Inside source: true *** True Line Result - def render_ball args -** Processing line: ~ args.outputs.solids << solid_ball(args)~ + h: 101, +** Processing line: ~ path: "dragonruby.png", # image path~ - Inside source: true *** True Line Result - args.outputs.solids << solid_ball(args) -** Processing line: ~ end~ + path: "dragonruby.png", # image path +** Processing line: ~ angle: args.state.angle, # angle~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + angle: args.state.angle, # angle +** Processing line: ~ a: 255, # alpha (transparency)~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_paddles args~ + a: 255, # alpha (transparency) +** Processing line: ~ r: 255, # color saturation~ - Inside source: true *** True Line Result - def render_paddles args -** Processing line: ~ args.outputs.solids << solid_left_paddle(args)~ + r: 255, # color saturation +** Processing line: ~ g: 255,~ - Inside source: true *** True Line Result - args.outputs.solids << solid_left_paddle(args) -** Processing line: ~ args.outputs.solids << solid_right_paddle(args)~ + g: 255, +** Processing line: ~ b: 255,~ - Inside source: true *** True Line Result - args.outputs.solids << solid_right_paddle(args) -** Processing line: ~ end~ + b: 255, +** Processing line: ~ tile_x: 0, # sprite sub division/tile~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + tile_x: 0, # sprite sub division/tile +** Processing line: ~ tile_y: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_instructions args~ + tile_y: 0, +** Processing line: ~ tile_w: -1,~ - Inside source: true *** True Line Result - def render_instructions args -** Processing line: ~ args.outputs.labels << [320, 30, "W and S keys to move left paddle.", 0, 1]~ + tile_w: -1, +** Processing line: ~ tile_h: -1,~ - Inside source: true *** True Line Result - args.outputs.labels << [320, 30, "W and S keys to move left paddle.", 0, 1] -** Processing line: ~ args.outputs.labels << [920, 30, "O and L keys to move right paddle.", 0, 1]~ + tile_h: -1, +** Processing line: ~ flip_vertically: false, # don't flip sprite~ - Inside source: true *** True Line Result - args.outputs.labels << [920, 30, "O and L keys to move right paddle.", 0, 1] -** Processing line: ~ end~ + flip_vertically: false, # don't flip sprite +** Processing line: ~ flip_horizontally: false,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + flip_horizontally: false, +** Processing line: ~ angle_anchor_x: 0.5, # rotation center set to middle~ - Inside source: true *** True Line Result - end + angle_anchor_x: 0.5, # rotation center set to middle +** Processing line: ~ angle_anchor_y: 0.5~ +- Inside source: true +*** True Line Result + angle_anchor_y: 0.5 +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc args~ +** Processing line: ~ # Outputs label using a hash~ - Inside source: true *** True Line Result - def calc args -** Processing line: ~ args.state.ball.debounce -= 1 and return if args.state.ball.debounce > 0~ + # Outputs label using a hash +** Processing line: ~ args.outputs.labels << {~ - Inside source: true *** True Line Result - args.state.ball.debounce -= 1 and return if args.state.ball.debounce > 0 -** Processing line: ~ calc_move_ball args~ + args.outputs.labels << { +** Processing line: ~ x: 200, # label position~ - Inside source: true *** True Line Result - calc_move_ball args -** Processing line: ~ calc_collision_with_left_paddle args~ + x: 200, # label position +** Processing line: ~ y: 550,~ - Inside source: true *** True Line Result - calc_collision_with_left_paddle args -** Processing line: ~ calc_collision_with_right_paddle args~ + y: 550, +** Processing line: ~ text: "dragonruby", # label text~ - Inside source: true *** True Line Result - calc_collision_with_right_paddle args -** Processing line: ~ calc_collision_with_walls args~ + text: "dragonruby", # label text +** Processing line: ~ size_enum: 2,~ - Inside source: true *** True Line Result - calc_collision_with_walls args -** Processing line: ~ end~ + size_enum: 2, +** Processing line: ~ alignment_enum: 1,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + alignment_enum: 1, +** Processing line: ~ r: 155, # color saturation~ - Inside source: true *** True Line Result - -** Processing line: ~ begin :calc_methods~ + r: 155, # color saturation +** Processing line: ~ g: 50,~ - Inside source: true *** True Line Result - begin :calc_methods -** Processing line: ~ def calc_move_ball args~ + g: 50, +** Processing line: ~ b: 50,~ - Inside source: true *** True Line Result - def calc_move_ball args -** Processing line: ~ args.state.ball.x += args.state.ball.dx~ + b: 50, +** Processing line: ~ a: 255, # transparency~ - Inside source: true *** True Line Result - args.state.ball.x += args.state.ball.dx -** Processing line: ~ args.state.ball.y += args.state.ball.dy~ + a: 255, # transparency +** Processing line: ~ font: "fonts/manaspc.ttf" # font style; without mentioned file, label won't output correctly~ - Inside source: true *** True Line Result - args.state.ball.y += args.state.ball.dy -** Processing line: ~ end~ + font: "fonts/manaspc.ttf" # font style; without mentioned file, label won't output correctly +** Processing line: ~ }~ - Inside source: true *** True Line Result - end + } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc_collision_with_left_paddle args~ +** Processing line: ~ # Outputs solid using a hash~ - Inside source: true *** True Line Result - def calc_collision_with_left_paddle args -** Processing line: ~ if solid_left_paddle(args).intersect_rect? solid_ball(args)~ + # Outputs solid using a hash +** Processing line: ~ # [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ - Inside source: true *** True Line Result - if solid_left_paddle(args).intersect_rect? solid_ball(args) -** Processing line: ~ args.state.ball.dx *= -1~ + # [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA] +** Processing line: ~ args.outputs.solids << {~ - Inside source: true *** True Line Result - args.state.ball.dx *= -1 -** Processing line: ~ elsif args.state.ball.x < 0~ + args.outputs.solids << { +** Processing line: ~ x: 400, # position~ - Inside source: true *** True Line Result - elsif args.state.ball.x < 0 -** Processing line: ~ args.state.right_paddle.score += 1~ + x: 400, # position +** Processing line: ~ y: 550,~ - Inside source: true *** True Line Result - args.state.right_paddle.score += 1 -** Processing line: ~ calc_reset_round args~ + y: 550, +** Processing line: ~ w: 160, # size~ - Inside source: true *** True Line Result - calc_reset_round args -** Processing line: ~ end~ + w: 160, # size +** Processing line: ~ h: 90,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + h: 90, +** Processing line: ~ r: 120, # color saturation~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + r: 120, # color saturation +** Processing line: ~ g: 50,~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_collision_with_right_paddle args~ + g: 50, +** Processing line: ~ b: 50,~ - Inside source: true *** True Line Result - def calc_collision_with_right_paddle args -** Processing line: ~ if solid_right_paddle(args).intersect_rect? solid_ball(args)~ + b: 50, +** Processing line: ~ a: 255 # transparency~ - Inside source: true *** True Line Result - if solid_right_paddle(args).intersect_rect? solid_ball(args) -** Processing line: ~ args.state.ball.dx *= -1~ + a: 255 # transparency +** Processing line: ~ }~ - Inside source: true *** True Line Result - args.state.ball.dx *= -1 -** Processing line: ~ elsif args.state.ball.x > 1280~ + } +** Processing line: ~~ - Inside source: true *** True Line Result - elsif args.state.ball.x > 1280 -** Processing line: ~ args.state.left_paddle.score += 1~ + +** Processing line: ~ # Outputs border using a hash~ - Inside source: true *** True Line Result - args.state.left_paddle.score += 1 -** Processing line: ~ calc_reset_round args~ + # Outputs border using a hash +** Processing line: ~ # Same parameters as a solid~ - Inside source: true *** True Line Result - calc_reset_round args -** Processing line: ~ end~ + # Same parameters as a solid +** Processing line: ~ args.outputs.borders << {~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + args.outputs.borders << { +** Processing line: ~ x: 600,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x: 600, +** Processing line: ~ y: 550,~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_collision_with_walls args~ + y: 550, +** Processing line: ~ w: 160,~ - Inside source: true *** True Line Result - def calc_collision_with_walls args -** Processing line: ~ if args.state.ball.y + args.state.ball.size_half > 720~ + w: 160, +** Processing line: ~ h: 90,~ - Inside source: true *** True Line Result - if args.state.ball.y + args.state.ball.size_half > 720 -** Processing line: ~ args.state.ball.y = 720 - args.state.ball.size_half~ + h: 90, +** Processing line: ~ r: 120,~ - Inside source: true *** True Line Result - args.state.ball.y = 720 - args.state.ball.size_half -** Processing line: ~ args.state.ball.dy *= -1~ + r: 120, +** Processing line: ~ g: 50,~ - Inside source: true *** True Line Result - args.state.ball.dy *= -1 -** Processing line: ~ elsif args.state.ball.y - args.state.ball.size_half < 0~ + g: 50, +** Processing line: ~ b: 50,~ - Inside source: true *** True Line Result - elsif args.state.ball.y - args.state.ball.size_half < 0 -** Processing line: ~ args.state.ball.y = args.state.ball.size_half~ + b: 50, +** Processing line: ~ a: 255~ - Inside source: true *** True Line Result - args.state.ball.y = args.state.ball.size_half -** Processing line: ~ args.state.ball.dy *= -1~ + a: 255 +** Processing line: ~ }~ - Inside source: true *** True Line Result - args.state.ball.dy *= -1 -** Processing line: ~ end~ + } +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ # Outputs line using a hash~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Outputs line using a hash +** Processing line: ~ args.outputs.lines << {~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_reset_round args~ + args.outputs.lines << { +** Processing line: ~ x: 900, # starting position~ - Inside source: true *** True Line Result - def calc_reset_round args -** Processing line: ~ args.state.ball.x = 640~ + x: 900, # starting position +** Processing line: ~ y: 550,~ - Inside source: true *** True Line Result - args.state.ball.x = 640 -** Processing line: ~ args.state.ball.y = 360~ + y: 550, +** Processing line: ~ x2: 1200, # ending position~ - Inside source: true *** True Line Result - args.state.ball.y = 360 -** Processing line: ~ args.state.ball.dx = 5.randomize(:sign)~ + x2: 1200, # ending position +** Processing line: ~ y2: 550,~ - Inside source: true *** True Line Result - args.state.ball.dx = 5.randomize(:sign) -** Processing line: ~ args.state.ball.dy = 5.randomize(:sign)~ + y2: 550, +** Processing line: ~ r: 120, # color saturation~ - Inside source: true *** True Line Result - args.state.ball.dy = 5.randomize(:sign) -** Processing line: ~ args.state.ball.debounce = 3 * 60~ + r: 120, # color saturation +** Processing line: ~ g: 50,~ - Inside source: true *** True Line Result - args.state.ball.debounce = 3 * 60 -** Processing line: ~ end~ + g: 50, +** Processing line: ~ b: 50,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + b: 50, +** Processing line: ~ a: 255 # transparency~ - Inside source: true *** True Line Result - end + a: 255 # transparency +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def input args~ +** Processing line: ~ # Outputs sprite as a primitive using a hash~ - Inside source: true *** True Line Result - def input args -** Processing line: ~ input_left_paddle args~ + # Outputs sprite as a primitive using a hash +** Processing line: ~ args.outputs.primitives << {~ - Inside source: true *** True Line Result - input_left_paddle args -** Processing line: ~ input_right_paddle args~ + args.outputs.primitives << { +** Processing line: ~ x: 30, # position~ - Inside source: true *** True Line Result - input_right_paddle args -** Processing line: ~ end~ + x: 30, # position +** Processing line: ~ y: 200,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + y: 200, +** Processing line: ~ w: 128, # size~ - Inside source: true *** True Line Result - -** Processing line: ~ begin :input_methods~ + w: 128, # size +** Processing line: ~ h: 101,~ - Inside source: true *** True Line Result - begin :input_methods -** Processing line: ~ def input_left_paddle args~ + h: 101, +** Processing line: ~ path: "dragonruby.png", # image path~ - Inside source: true *** True Line Result - def input_left_paddle args -** Processing line: ~ if args.inputs.controller_one.key_down.down || args.inputs.keyboard.key_down.s~ + path: "dragonruby.png", # image path +** Processing line: ~ angle: args.state.angle, # angle~ - Inside source: true *** True Line Result - if args.inputs.controller_one.key_down.down || args.inputs.keyboard.key_down.s -** Processing line: ~ args.state.left_paddle.y -= 40~ + angle: args.state.angle, # angle +** Processing line: ~ a: 255, # transparency~ - Inside source: true *** True Line Result - args.state.left_paddle.y -= 40 -** Processing line: ~ elsif args.inputs.controller_one.key_down.up || args.inputs.keyboard.key_down.w~ + a: 255, # transparency +** Processing line: ~ r: 255, # color saturation~ - Inside source: true *** True Line Result - elsif args.inputs.controller_one.key_down.up || args.inputs.keyboard.key_down.w -** Processing line: ~ args.state.left_paddle.y += 40~ + r: 255, # color saturation +** Processing line: ~ g: 255,~ - Inside source: true *** True Line Result - args.state.left_paddle.y += 40 -** Processing line: ~ end~ + g: 255, +** Processing line: ~ b: 255,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + b: 255, +** Processing line: ~ tile_x: 0, # sprite sub division/tile~ - Inside source: true *** True Line Result - end + tile_x: 0, # sprite sub division/tile +** Processing line: ~ tile_y: 0,~ +- Inside source: true +*** True Line Result + tile_y: 0, +** Processing line: ~ tile_w: -1,~ +- Inside source: true +*** True Line Result + tile_w: -1, +** Processing line: ~ tile_h: -1,~ +- Inside source: true +*** True Line Result + tile_h: -1, +** Processing line: ~ flip_vertically: false, # don't flip~ +- Inside source: true +*** True Line Result + flip_vertically: false, # don't flip +** Processing line: ~ flip_horizontally: false,~ +- Inside source: true +*** True Line Result + flip_horizontally: false, +** Processing line: ~ angle_anchor_x: 0.5, # rotation center set to middle~ +- Inside source: true +*** True Line Result + angle_anchor_x: 0.5, # rotation center set to middle +** Processing line: ~ angle_anchor_y: 0.5~ +- Inside source: true +*** True Line Result + angle_anchor_y: 0.5 +** Processing line: ~ }.sprite~ +- Inside source: true +*** True Line Result + }.sprite ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def input_right_paddle args~ +** Processing line: ~ # Outputs label as primitive using a hash~ - Inside source: true *** True Line Result - def input_right_paddle args -** Processing line: ~ if args.inputs.controller_two.key_down.down || args.inputs.keyboard.key_down.l~ + # Outputs label as primitive using a hash +** Processing line: ~ args.outputs.primitives << {~ - Inside source: true *** True Line Result - if args.inputs.controller_two.key_down.down || args.inputs.keyboard.key_down.l -** Processing line: ~ args.state.right_paddle.y -= 40~ + args.outputs.primitives << { +** Processing line: ~ x: 200, # position~ - Inside source: true *** True Line Result - args.state.right_paddle.y -= 40 -** Processing line: ~ elsif args.inputs.controller_two.key_down.up || args.inputs.keyboard.key_down.o~ + x: 200, # position +** Processing line: ~ y: 200,~ - Inside source: true *** True Line Result - elsif args.inputs.controller_two.key_down.up || args.inputs.keyboard.key_down.o -** Processing line: ~ args.state.right_paddle.y += 40~ + y: 200, +** Processing line: ~ text: "dragonruby", # text~ - Inside source: true *** True Line Result - args.state.right_paddle.y += 40 -** Processing line: ~ end~ + text: "dragonruby", # text +** Processing line: ~ size: 2,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + size: 2, +** Processing line: ~ alignment: 1,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + alignment: 1, +** Processing line: ~ r: 155, # color saturation~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + r: 155, # color saturation +** Processing line: ~ g: 50,~ - Inside source: true *** True Line Result - -** Processing line: ~ begin :assets~ + g: 50, +** Processing line: ~ b: 50,~ - Inside source: true *** True Line Result - begin :assets -** Processing line: ~ def solid_ball args~ + b: 50, +** Processing line: ~ a: 255, # transparency~ - Inside source: true *** True Line Result - def solid_ball args -** Processing line: ~ centered_rect args.state.ball.x, args.state.ball.y, args.state.ball.size, args.state.ball.size~ + a: 255, # transparency +** Processing line: ~ font: "fonts/manaspc.ttf" # font style~ - Inside source: true *** True Line Result - centered_rect args.state.ball.x, args.state.ball.y, args.state.ball.size, args.state.ball.size -** Processing line: ~ end~ + font: "fonts/manaspc.ttf" # font style +** Processing line: ~ }.label~ - Inside source: true *** True Line Result - end + }.label ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def solid_left_paddle args~ +** Processing line: ~ # Outputs solid as primitive using a hash~ - Inside source: true *** True Line Result - def solid_left_paddle args -** Processing line: ~ centered_rect_vertically 0, args.state.left_paddle.y, args.state.paddle.w, args.state.paddle.h~ + # Outputs solid as primitive using a hash +** Processing line: ~ args.outputs.primitives << {~ - Inside source: true *** True Line Result - centered_rect_vertically 0, args.state.left_paddle.y, args.state.paddle.w, args.state.paddle.h -** Processing line: ~ end~ + args.outputs.primitives << { +** Processing line: ~ x: 400, # position~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x: 400, # position +** Processing line: ~ y: 200,~ - Inside source: true *** True Line Result - -** Processing line: ~ def solid_right_paddle args~ + y: 200, +** Processing line: ~ w: 160, # size~ - Inside source: true *** True Line Result - def solid_right_paddle args -** Processing line: ~ centered_rect_vertically 1280 - args.state.paddle.w, args.state.right_paddle.y, args.state.paddle.w, args.state.paddle.h~ + w: 160, # size +** Processing line: ~ h: 90,~ - Inside source: true *** True Line Result - centered_rect_vertically 1280 - args.state.paddle.w, args.state.right_paddle.y, args.state.paddle.w, args.state.paddle.h -** Processing line: ~ end~ + h: 90, +** Processing line: ~ r: 120, # color saturation~ - Inside source: true *** True Line Result - end + r: 120, # color saturation +** Processing line: ~ g: 50,~ +- Inside source: true +*** True Line Result + g: 50, +** Processing line: ~ b: 50,~ +- Inside source: true +*** True Line Result + b: 50, +** Processing line: ~ a: 255 # transparency~ +- Inside source: true +*** True Line Result + a: 255 # transparency +** Processing line: ~ }.solid~ +- Inside source: true +*** True Line Result + }.solid ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def centered_rect x, y, w, h~ +** Processing line: ~ # Outputs border as primitive using a hash~ - Inside source: true *** True Line Result - def centered_rect x, y, w, h -** Processing line: ~ [x - w / 2, y - h / 2, w, h]~ + # Outputs border as primitive using a hash +** Processing line: ~ # Same parameters as solid~ - Inside source: true *** True Line Result - [x - w / 2, y - h / 2, w, h] -** Processing line: ~ end~ + # Same parameters as solid +** Processing line: ~ args.outputs.primitives << {~ - Inside source: true *** True Line Result - end + args.outputs.primitives << { +** Processing line: ~ x: 600, # position~ +- Inside source: true +*** True Line Result + x: 600, # position +** Processing line: ~ y: 200,~ +- Inside source: true +*** True Line Result + y: 200, +** Processing line: ~ w: 160, # size~ +- Inside source: true +*** True Line Result + w: 160, # size +** Processing line: ~ h: 90,~ +- Inside source: true +*** True Line Result + h: 90, +** Processing line: ~ r: 120, # color saturation~ +- Inside source: true +*** True Line Result + r: 120, # color saturation +** Processing line: ~ g: 50,~ +- Inside source: true +*** True Line Result + g: 50, +** Processing line: ~ b: 50,~ +- Inside source: true +*** True Line Result + b: 50, +** Processing line: ~ a: 255 # transparency~ +- Inside source: true +*** True Line Result + a: 255 # transparency +** Processing line: ~ }.border~ +- Inside source: true +*** True Line Result + }.border ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def centered_rect_vertically x, y, w, h~ +** Processing line: ~ # Outputs line as primitive using a hash~ - Inside source: true *** True Line Result - def centered_rect_vertically x, y, w, h -** Processing line: ~ [x, y - h / 2, w, h]~ + # Outputs line as primitive using a hash +** Processing line: ~ args.outputs.primitives << {~ - Inside source: true *** True Line Result - [x, y - h / 2, w, h] -** Processing line: ~ end~ + args.outputs.primitives << { +** Processing line: ~ x: 900, # starting position~ - Inside source: true *** True Line Result - end + x: 900, # starting position +** Processing line: ~ y: 200,~ +- Inside source: true +*** True Line Result + y: 200, +** Processing line: ~ x2: 1200, # ending position~ +- Inside source: true +*** True Line Result + x2: 1200, # ending position +** Processing line: ~ y2: 200,~ +- Inside source: true +*** True Line Result + y2: 200, +** Processing line: ~ r: 120, # color saturation~ +- Inside source: true +*** True Line Result + r: 120, # color saturation +** Processing line: ~ g: 50,~ +- Inside source: true +*** True Line Result + g: 50, +** Processing line: ~ b: 50,~ +- Inside source: true +*** True Line Result + b: 50, +** Processing line: ~ a: 255 # transparency~ +- Inside source: true +*** True Line Result + a: 255 # transparency +** Processing line: ~ }.line~ +- Inside source: true +*** True Line Result + }.line ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -46295,118 +49448,122 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Arcade - Snakemoji - main.rb~ +** Processing line: ~*** Advanced Rendering - Pixel Arrays - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Arcade - Snakemoji - main.rb +*** Advanced Rendering - Pixel Arrays - 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_arcade/snakemoji/app/main.rb~ +** Processing line: ~ # ./samples/07_advanced_rendering/06_pixel_arrays/app/main.rb~ - Inside source: true *** True Line Result - # ./samples/99_genre_arcade/snakemoji/app/main.rb -** Processing line: ~ # coding: utf-8~ + # ./samples/07_advanced_rendering/06_pixel_arrays/app/main.rb +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ ################################~ + $gtk.reset +** Processing line: ~~ - Inside source: true *** True Line Result - ################################ -** Processing line: ~ # So I was working on a snake game while~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # So I was working on a snake game while -** Processing line: ~ # learning DragonRuby, and at some point I had a thought~ + def tick args +** Processing line: ~ args.state.posinc ||= 1~ - Inside source: true *** True Line Result - # learning DragonRuby, and at some point I had a thought -** Processing line: ~ # what if I use "😀" as a function name, surely it wont work right...?~ + args.state.posinc ||= 1 +** Processing line: ~ args.state.pos ||= 0~ - Inside source: true *** True Line Result - # what if I use "😀" as a function name, surely it wont work right...? -** Processing line: ~ # RIGHT....?~ + args.state.pos ||= 0 +** Processing line: ~ args.state.rotation ||= 0~ - Inside source: true *** True Line Result - # RIGHT....? -** Processing line: ~ # BUT IT DID, IT WORKED~ + args.state.rotation ||= 0 +** Processing line: ~~ - Inside source: true *** True Line Result - # BUT IT DID, IT WORKED -** Processing line: ~ # it all went downhill from then~ + +** Processing line: ~ dimension = 10 # keep it small and let the GPU scale it when rendering the sprite.~ - Inside source: true *** True Line Result - # it all went downhill from then -** Processing line: ~ # Created by Anton K. (ai Doge)~ + dimension = 10 # keep it small and let the GPU scale it when rendering the sprite. +** Processing line: ~~ - Inside source: true *** True Line Result - # Created by Anton K. (ai Doge) -** Processing line: ~ # https://gist.github.com/scorp200~ + +** Processing line: ~ # Set up our "scanner" pixel array and fill it with black pixels.~ - Inside source: true *** True Line Result - # https://gist.github.com/scorp200 -** Processing line: ~ #############LICENSE############~ + # Set up our "scanner" pixel array and fill it with black pixels. +** Processing line: ~ args.pixel_array(:scanner).width = dimension~ - Inside source: true *** True Line Result - #############LICENSE############ -** Processing line: ~ # Feel free to use this anywhere and however you want~ + args.pixel_array(:scanner).width = dimension +** Processing line: ~ args.pixel_array(:scanner).height = dimension~ - Inside source: true *** True Line Result - # Feel free to use this anywhere and however you want -** Processing line: ~ # You can sell this to EA for $1,000,000 if you want, its completely free.~ + args.pixel_array(:scanner).height = dimension +** Processing line: ~ args.pixel_array(:scanner).pixels.fill(0xFF000000, 0, dimension * dimension) # black, full alpha~ - Inside source: true *** True Line Result - # You can sell this to EA for $1,000,000 if you want, its completely free. -** Processing line: ~ # Just rememeber you are helping this... thing... to spread...~ + args.pixel_array(:scanner).pixels.fill(0xFF000000, 0, dimension * dimension) # black, full alpha +** Processing line: ~~ - Inside source: true *** True Line Result - # Just rememeber you are helping this... thing... to spread... -** Processing line: ~ # ALSO! I am not liable for any mental, physical or financial damage caused.~ + +** Processing line: ~ # Draw a green line that bounces up and down the sprite.~ - Inside source: true *** True Line Result - # ALSO! I am not liable for any mental, physical or financial damage caused. -** Processing line: ~ #############LICENSE############~ + # Draw a green line that bounces up and down the sprite. +** Processing line: ~ args.pixel_array(:scanner).pixels.fill(0xFF00FF00, dimension * args.state.pos, dimension) # green, full alpha~ - Inside source: true *** True Line Result - #############LICENSE############ + args.pixel_array(:scanner).pixels.fill(0xFF00FF00, dimension * args.state.pos, dimension) # green, full alpha ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~~ +** Processing line: ~ # Adjust position for next frame.~ - Inside source: true *** True Line Result - -** Processing line: ~ class Array~ + # Adjust position for next frame. +** Processing line: ~ args.state.pos += args.state.posinc~ - Inside source: true *** True Line Result - class Array -** Processing line: ~ #Helper function~ + args.state.pos += args.state.posinc +** Processing line: ~ if args.state.posinc > 0 && args.state.pos >= dimension~ - Inside source: true *** True Line Result - #Helper function -** Processing line: ~ def move! vector~ + if args.state.posinc > 0 && args.state.pos >= dimension +** Processing line: ~ args.state.posinc = -1~ - Inside source: true *** True Line Result - def move! vector -** Processing line: ~ self.x += vector.x~ + args.state.posinc = -1 +** Processing line: ~ args.state.pos = dimension - 1~ - Inside source: true *** True Line Result - self.x += vector.x -** Processing line: ~ self.y += vector.y~ + args.state.pos = dimension - 1 +** Processing line: ~ elsif args.state.posinc < 0 && args.state.pos < 0~ - Inside source: true *** True Line Result - self.y += vector.y -** Processing line: ~ return self~ + elsif args.state.posinc < 0 && args.state.pos < 0 +** Processing line: ~ args.state.posinc = 1~ - Inside source: true *** True Line Result - return self + args.state.posinc = 1 +** Processing line: ~ args.state.pos = 1~ +- Inside source: true +*** True Line Result + args.state.pos = 1 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -46415,46 +49572,54 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ #Helper function to draw snake body~ +** Processing line: ~ # New/changed pixel arrays get uploaded to the GPU before we render~ - Inside source: true *** True Line Result - #Helper function to draw snake body -** Processing line: ~ def draw! 🎮, 📺, color~ + # New/changed pixel arrays get uploaded to the GPU before we render +** Processing line: ~ # anything. At that point, they can be scaled, rotated, and otherwise~ - Inside source: true *** True Line Result - def draw! 🎮, 📺, color -** Processing line: ~ translate 📺.solids, 🎮.⛓, [self.x * 🎮.⚖️ + 🎮.🛶 / 2, self.y * 🎮.⚖️ + 🎮.🛶 / 2, 🎮.⚖️ - 🎮.🛶, 🎮.⚖️ - 🎮.🛶, color]~ + # anything. At that point, they can be scaled, rotated, and otherwise +** Processing line: ~ # used like any other sprite.~ - Inside source: true *** True Line Result - translate 📺.solids, 🎮.⛓, [self.x * 🎮.⚖️ + 🎮.🛶 / 2, self.y * 🎮.⚖️ + 🎮.🛶 / 2, 🎮.⚖️ - 🎮.🛶, 🎮.⚖️ - 🎮.🛶, color] -** Processing line: ~ end~ + # used like any other sprite. +** Processing line: ~ w = 100~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + w = 100 +** Processing line: ~ h = 100~ - Inside source: true *** True Line Result - -** Processing line: ~ #This is where it all started, I was trying to find good way to multiply a map by a number, * is already used so is **~ + h = 100 +** Processing line: ~ x = (1280 - w) / 2~ - Inside source: true *** True Line Result - #This is where it all started, I was trying to find good way to multiply a map by a number, * is already used so is ** -** Processing line: ~ #I kept trying different combinations of symbols, when suddenly...~ + x = (1280 - w) / 2 +** Processing line: ~ y = (720 - h) / 2~ - Inside source: true *** True Line Result - #I kept trying different combinations of symbols, when suddenly... -** Processing line: ~ def 😀 value~ + y = (720 - h) / 2 +** Processing line: ~ args.outputs.background_color = [64, 0, 128]~ - Inside source: true *** True Line Result - def 😀 value -** Processing line: ~ self.map {|d| d * value}~ + args.outputs.background_color = [64, 0, 128] +** Processing line: ~ args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite~ - Inside source: true *** True Line Result - self.map {|d| d * value} -** Processing line: ~ end~ + args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite +** Processing line: ~ args.state.rotation += 1~ - Inside source: true *** True Line Result - end + args.state.rotation += 1 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ +- Inside source: true +*** True Line Result + args.outputs.primitives << args.gtk.current_framerate_primitives ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -46463,378 +49628,394 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ #Draw stuff with an offset~ +** Processing line: ~~ - Inside source: true *** True Line Result - #Draw stuff with an offset -** Processing line: ~ def translate output_collection, ⛓, what~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - def translate output_collection, ⛓, what -** Processing line: ~ what.x += ⛓.x~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - what.x += ⛓.x -** Processing line: ~ what.y += ⛓.y~ + +** Processing line: ~*** Advanced Rendering - Splitscreen Camera - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Advanced Rendering - Splitscreen 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_splitscreen_camera/app/main.rb~ - Inside source: true *** True Line Result - what.y += ⛓.y -** Processing line: ~ output_collection << what~ + # ./samples/07_advanced_rendering/07_splitscreen_camera/app/main.rb +** Processing line: ~ class CameraMovement~ - Inside source: true *** True Line Result - output_collection << what -** Processing line: ~ end~ + class CameraMovement +** Processing line: ~ attr_accessor :state, :inputs, :outputs, :grid~ - Inside source: true *** True Line Result - end + attr_accessor :state, :inputs, :outputs, :grid ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ BLUE = [33, 150, 243]~ +** Processing line: ~ #==============================================================================================~ - Inside source: true *** True Line Result - BLUE = [33, 150, 243] -** Processing line: ~ RED = [244, 67, 54]~ + #============================================================================================== +** Processing line: ~ #Serialize~ - Inside source: true *** True Line Result - RED = [244, 67, 54] -** Processing line: ~ GOLD = [255, 193, 7]~ + #Serialize +** Processing line: ~ def serialize~ - Inside source: true *** True Line Result - GOLD = [255, 193, 7] -** Processing line: ~ LAST = 0~ + def serialize +** Processing line: ~ {state: state, inputs: inputs, outputs: outputs, grid: grid }~ - Inside source: true *** True Line Result - LAST = 0 + {state: state, inputs: inputs, outputs: outputs, grid: grid } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ def inspect~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ defaults args.state~ + def inspect +** Processing line: ~ serialize.to_s~ - Inside source: true *** True Line Result - defaults args.state -** Processing line: ~ render args.state, args.outputs~ + serialize.to_s +** Processing line: ~ end~ - Inside source: true *** True Line Result - render args.state, args.outputs -** Processing line: ~ input args.state, args.inputs~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - input args.state, args.inputs -** Processing line: ~ update args.state~ + +** Processing line: ~ def to_s~ - Inside source: true *** True Line Result - update args.state -** Processing line: ~ end~ + def to_s +** Processing line: ~ serialize.to_s~ - Inside source: true *** True Line Result - end + serialize.to_s +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def update 🎮~ +** Processing line: ~ #==============================================================================================~ - Inside source: true *** True Line Result - def update 🎮 -** Processing line: ~ #Update every 10 frames~ + #============================================================================================== +** Processing line: ~ #Tick~ - Inside source: true *** True Line Result - #Update every 10 frames -** Processing line: ~ if 🎮.tick_count.mod_zero? 10~ + #Tick +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - if 🎮.tick_count.mod_zero? 10 -** Processing line: ~ #Add new snake body piece at head's location~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - #Add new snake body piece at head's location -** Processing line: ~ 🎮.🐍 << [*🎮.🤖]~ + defaults +** Processing line: ~ calc~ - Inside source: true *** True Line Result - 🎮.🐍 << [*🎮.🤖] -** Processing line: ~ #Assign Next Direction to Direction~ + calc +** Processing line: ~ render~ - Inside source: true *** True Line Result - #Assign Next Direction to Direction -** Processing line: ~ 🎮.🚗 = *🎮.🚦~ + render +** Processing line: ~ input~ - Inside source: true *** True Line Result - 🎮.🚗 = *🎮.🚦 -** Processing line: ~~ + input +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ #Trim the snake a bit if its longer than current size~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - #Trim the snake a bit if its longer than current size -** Processing line: ~ if 🎮.🐍.length > 🎮.🛒~ + +** Processing line: ~ #==============================================================================================~ - Inside source: true *** True Line Result - if 🎮.🐍.length > 🎮.🛒 -** Processing line: ~ 🎮.🐍 = 🎮.🐍[-🎮.🛒..-1]~ + #============================================================================================== +** Processing line: ~ #Default functions~ - Inside source: true *** True Line Result - 🎮.🐍 = 🎮.🐍[-🎮.🛒..-1] -** Processing line: ~ end~ + #Default functions +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def defaults +** Processing line: ~ outputs[:scene].background_color = [0,0,0]~ - Inside source: true *** True Line Result - -** Processing line: ~ #Move the head in the Direction~ + outputs[:scene].background_color = [0,0,0] +** Processing line: ~ state.trauma ||= 0.0~ - Inside source: true *** True Line Result - #Move the head in the Direction -** Processing line: ~ 🎮.🤖.move! 🎮.🚗~ + state.trauma ||= 0.0 +** Processing line: ~ state.trauma_power ||= 2~ - Inside source: true *** True Line Result - 🎮.🤖.move! 🎮.🚗 -** Processing line: ~~ + state.trauma_power ||= 2 +** Processing line: ~ state.player_cyan ||= new_player_cyan~ - Inside source: true *** True Line Result - -** Processing line: ~ #If Head is outside the playing field, or inside snake's body restart game~ + state.player_cyan ||= new_player_cyan +** Processing line: ~ state.player_magenta ||= new_player_magenta~ - Inside source: true *** True Line Result - #If Head is outside the playing field, or inside snake's body restart game -** Processing line: ~ if 🎮.🤖.x < 0 || 🎮.🤖.x >= 🎮.🗺.x || 🎮.🤖.y < 0 || 🎮.🤖.y >= 🎮.🗺.y || 🎮.🚗 != [0, 0] && 🎮.🐍.any? {|s| s == 🎮.🤖}~ + state.player_magenta ||= new_player_magenta +** Processing line: ~ state.camera_magenta ||= new_camera_magenta~ - Inside source: true *** True Line Result - if 🎮.🤖.x < 0 || 🎮.🤖.x >= 🎮.🗺.x || 🎮.🤖.y < 0 || 🎮.🤖.y >= 🎮.🗺.y || 🎮.🚗 != [0, 0] && 🎮.🐍.any? {|s| s == 🎮.🤖} -** Processing line: ~ LAST = 🎮.💰~ + state.camera_magenta ||= new_camera_magenta +** Processing line: ~ state.camera_cyan ||= new_camera_cyan~ - Inside source: true *** True Line Result - LAST = 🎮.💰 -** Processing line: ~ 🎮.as_hash.clear~ + state.camera_cyan ||= new_camera_cyan +** Processing line: ~ state.camera_center ||= new_camera_center~ - Inside source: true *** True Line Result - 🎮.as_hash.clear -** Processing line: ~ return~ + state.camera_center ||= new_camera_center +** Processing line: ~ state.room ||= new_room~ - Inside source: true *** True Line Result - return -** Processing line: ~ end~ + state.room ||= new_room +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ #If head lands on food add size and score~ +** Processing line: ~ def default_player x, y, w, h, sprite_path~ - Inside source: true *** True Line Result - #If head lands on food add size and score -** Processing line: ~ if 🎮.🤖 == 🎮.🍎~ + def default_player x, y, w, h, sprite_path +** Processing line: ~ state.new_entity(:player,~ - Inside source: true *** True Line Result - if 🎮.🤖 == 🎮.🍎 -** Processing line: ~ 🎮.🛒 += 1~ + state.new_entity(:player, +** Processing line: ~ { x: x,~ - Inside source: true *** True Line Result - 🎮.🛒 += 1 -** Processing line: ~ 🎮.💰 += (🎮.🛒 * 0.8).floor.to_i + 5~ + { x: x, +** Processing line: ~ y: y,~ - Inside source: true *** True Line Result - 🎮.💰 += (🎮.🛒 * 0.8).floor.to_i + 5 -** Processing line: ~ spawn_🍎 🎮~ + y: y, +** Processing line: ~ dy: 0,~ - Inside source: true *** True Line Result - spawn_🍎 🎮 -** Processing line: ~ puts 🎮.🍎~ + dy: 0, +** Processing line: ~ dx: 0,~ - Inside source: true *** True Line Result - puts 🎮.🍎 -** Processing line: ~ end~ + dx: 0, +** Processing line: ~ w: w,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + w: w, +** Processing line: ~ h: h,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + h: h, +** Processing line: ~ damage: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ #Every second remove 1 point~ + damage: 0, +** Processing line: ~ dead: false,~ - Inside source: true *** True Line Result - #Every second remove 1 point -** Processing line: ~ if 🎮.💰 > 0 && 🎮.tick_count.mod_zero?(60)~ + dead: false, +** Processing line: ~ orientation: "down",~ - Inside source: true *** True Line Result - if 🎮.💰 > 0 && 🎮.tick_count.mod_zero?(60) -** Processing line: ~ 🎮.💰 -= 1~ + orientation: "down", +** Processing line: ~ max_alpha: 255,~ - Inside source: true *** True Line Result - 🎮.💰 -= 1 -** Processing line: ~ end~ + max_alpha: 255, +** Processing line: ~ sprite_path: sprite_path})~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + sprite_path: sprite_path}) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def spawn_🍎 🎮~ +** Processing line: ~ def default_floor_tile x, y, w, h, sprite_path~ - Inside source: true *** True Line Result - def spawn_🍎 🎮 -** Processing line: ~ #Food~ + def default_floor_tile x, y, w, h, sprite_path +** Processing line: ~ state.new_entity(:room,~ - Inside source: true *** True Line Result - #Food -** Processing line: ~ 🎮.🍎 ||= [*🎮.🤖]~ + state.new_entity(:room, +** Processing line: ~ { x: x,~ - Inside source: true *** True Line Result - 🎮.🍎 ||= [*🎮.🤖] -** Processing line: ~ #Randomly spawns food inside the playing field, keep doing this if the food keeps landing on the snake's body~ + { x: x, +** Processing line: ~ y: y,~ - Inside source: true *** True Line Result - #Randomly spawns food inside the playing field, keep doing this if the food keeps landing on the snake's body -** Processing line: ~ while 🎮.🐍.any? {|s| s == 🎮.🍎} || 🎮.🍎 == 🎮.🤖 do~ + y: y, +** Processing line: ~ w: w,~ - Inside source: true *** True Line Result - while 🎮.🐍.any? {|s| s == 🎮.🍎} || 🎮.🍎 == 🎮.🤖 do -** Processing line: ~ 🎮.🍎 = [rand(🎮.🗺.x), rand(🎮.🗺.y)]~ + w: w, +** Processing line: ~ h: h,~ - Inside source: true *** True Line Result - 🎮.🍎 = [rand(🎮.🗺.x), rand(🎮.🗺.y)] -** Processing line: ~ end~ + h: h, +** Processing line: ~ sprite_path: sprite_path})~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + sprite_path: sprite_path}) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render 🎮, 📺~ -- Inside source: true -*** True Line Result - def render 🎮, 📺 -** Processing line: ~ #Paint the background black~ +** Processing line: ~ def default_camera x, y, w, h~ - Inside source: true *** True Line Result - #Paint the background black -** Processing line: ~ 📺.solids << [0, 0, 1280, 720, 0, 0, 0, 255]~ + def default_camera x, y, w, h +** Processing line: ~ state.new_entity(:camera,~ - Inside source: true *** True Line Result - 📺.solids << [0, 0, 1280, 720, 0, 0, 0, 255] -** Processing line: ~ #Draw a border for the playing field~ + state.new_entity(:camera, +** Processing line: ~ { x: x,~ - Inside source: true *** True Line Result - #Draw a border for the playing field -** Processing line: ~ translate 📺.borders, 🎮.⛓, [0, 0, 🎮.🗺.x * 🎮.⚖️, 🎮.🗺.y * 🎮.⚖️, 255, 255, 255]~ + { x: x, +** Processing line: ~ y: y,~ - Inside source: true *** True Line Result - translate 📺.borders, 🎮.⛓, [0, 0, 🎮.🗺.x * 🎮.⚖️, 🎮.🗺.y * 🎮.⚖️, 255, 255, 255] -** Processing line: ~~ + y: y, +** Processing line: ~ dx: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ #Draw the snake's body~ + dx: 0, +** Processing line: ~ dy: 0,~ - Inside source: true *** True Line Result - #Draw the snake's body -** Processing line: ~ 🎮.🐍.map do |🐍| 🐍.draw! 🎮, 📺, BLUE end~ + dy: 0, +** Processing line: ~ w: w,~ - Inside source: true *** True Line Result - 🎮.🐍.map do |🐍| 🐍.draw! 🎮, 📺, BLUE end -** Processing line: ~ #Draw the head~ + w: w, +** Processing line: ~ h: h})~ - Inside source: true *** True Line Result - #Draw the head -** Processing line: ~ 🎮.🤖.draw! 🎮, 📺, BLUE~ + h: h}) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 🎮.🤖.draw! 🎮, 📺, BLUE -** Processing line: ~ #Draw the food~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - #Draw the food -** Processing line: ~ 🎮.🍎.draw! 🎮, 📺, RED~ + +** Processing line: ~ def new_player_cyan~ - Inside source: true *** True Line Result - 🎮.🍎.draw! 🎮, 📺, RED -** Processing line: ~~ + def new_player_cyan +** Processing line: ~ default_player(0, 0, 64, 64,~ - Inside source: true *** True Line Result - -** Processing line: ~ #Draw current score~ + default_player(0, 0, 64, 64, +** Processing line: ~ "sprites/player/player_#{state.player_cyan.orientation}_standing.png")~ - Inside source: true *** True Line Result - #Draw current score -** Processing line: ~ translate 📺.labels, 🎮.⛓, [5, 715, "Score: #{🎮.💰}", GOLD]~ + "sprites/player/player_#{state.player_cyan.orientation}_standing.png") +** Processing line: ~ end~ - Inside source: true *** True Line Result - translate 📺.labels, 🎮.⛓, [5, 715, "Score: #{🎮.💰}", GOLD] -** Processing line: ~ #Draw your last score, if any~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - #Draw your last score, if any -** Processing line: ~ translate 📺.labels, 🎮.⛓, [[*🎮.🤖.😀(🎮.⚖️)].move!([0, 🎮.⚖️ * 2]), "Your Last score is #{LAST}", 0, 1, GOLD] unless LAST == 0 || 🎮.🚗 != [0, 0]~ + +** Processing line: ~ def new_player_magenta~ - Inside source: true *** True Line Result - translate 📺.labels, 🎮.⛓, [[*🎮.🤖.😀(🎮.⚖️)].move!([0, 🎮.⚖️ * 2]), "Your Last score is #{LAST}", 0, 1, GOLD] unless LAST == 0 || 🎮.🚗 != [0, 0] -** Processing line: ~ #Draw starting message, only if Direction is 0~ + def new_player_magenta +** Processing line: ~ default_player(64, 0, 64, 64,~ - Inside source: true *** True Line Result - #Draw starting message, only if Direction is 0 -** Processing line: ~ translate 📺.labels, 🎮.⛓, [🎮.🤖.😀(🎮.⚖️), "Press any Arrow key to start", 0, 1, GOLD] unless 🎮.🚗 != [0, 0]~ + default_player(64, 0, 64, 64, +** Processing line: ~ "sprites/player/player_#{state.player_magenta.orientation}_standing.png")~ - Inside source: true *** True Line Result - translate 📺.labels, 🎮.⛓, [🎮.🤖.😀(🎮.⚖️), "Press any Arrow key to start", 0, 1, GOLD] unless 🎮.🚗 != [0, 0] -** Processing line: ~ end~ + "sprites/player/player_#{state.player_magenta.orientation}_standing.png") +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def input 🎮, 🕹~ +** Processing line: ~ def new_camera_magenta~ - Inside source: true *** True Line Result - def input 🎮, 🕹 -** Processing line: ~ #Left and Right keyboard input, only change if X direction is 0~ + def new_camera_magenta +** Processing line: ~ default_camera(0,0,720,720)~ - Inside source: true *** True Line Result - #Left and Right keyboard input, only change if X direction is 0 -** Processing line: ~ if 🕹.keyboard.key_held.left && 🎮.🚗.x == 0~ + default_camera(0,0,720,720) +** Processing line: ~ end~ - Inside source: true *** True Line Result - if 🕹.keyboard.key_held.left && 🎮.🚗.x == 0 -** Processing line: ~ 🎮.🚦 = [-1, 0]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 🎮.🚦 = [-1, 0] -** Processing line: ~ elsif 🕹.keyboard.key_held.right && 🎮.🚗.x == 0~ + +** Processing line: ~ def new_camera_cyan~ - Inside source: true *** True Line Result - elsif 🕹.keyboard.key_held.right && 🎮.🚗.x == 0 -** Processing line: ~ 🎮.🚦 = [1, 0]~ + def new_camera_cyan +** Processing line: ~ default_camera(0,0,720,720)~ - Inside source: true *** True Line Result - 🎮.🚦 = [1, 0] + default_camera(0,0,720,720) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -46843,218 +50024,210 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ #Up and Down keyboard input, only change if Y direction is 0~ +** Processing line: ~ def new_camera_center~ - Inside source: true *** True Line Result - #Up and Down keyboard input, only change if Y direction is 0 -** Processing line: ~ if 🕹.keyboard.key_held.up && 🎮.🚗.y == 0~ + def new_camera_center +** Processing line: ~ default_camera(0,0,1280,720)~ - Inside source: true *** True Line Result - if 🕹.keyboard.key_held.up && 🎮.🚗.y == 0 -** Processing line: ~ 🎮.🚦 = [0, 1]~ + default_camera(0,0,1280,720) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 🎮.🚦 = [0, 1] -** Processing line: ~ elsif 🕹.keyboard.key_held.down && 🎮.🚗.y == 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif 🕹.keyboard.key_held.down && 🎮.🚗.y == 0 -** Processing line: ~ 🎮.🚦 = [0, -1]~ + +** Processing line: ~ def new_room~ - Inside source: true *** True Line Result - 🎮.🚦 = [0, -1] -** Processing line: ~ end~ + def new_room +** Processing line: ~ default_floor_tile(0,0,1024,1024,'sprites/rooms/camera_room.png')~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + default_floor_tile(0,0,1024,1024,'sprites/rooms/camera_room.png') +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def defaults 🎮~ +** Processing line: ~ #==============================================================================================~ - Inside source: true *** True Line Result - def defaults 🎮 -** Processing line: ~ #Playing field size~ + #============================================================================================== +** Processing line: ~ #Calculation functions~ - Inside source: true *** True Line Result - #Playing field size -** Processing line: ~ 🎮.🗺 ||= [20, 20]~ + #Calculation functions +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - 🎮.🗺 ||= [20, 20] -** Processing line: ~ #Scale for drawing, screen height / Field height~ + def calc +** Processing line: ~ calc_camera_magenta~ - Inside source: true *** True Line Result - #Scale for drawing, screen height / Field height -** Processing line: ~ 🎮.⚖️ ||= 720 / 🎮.🗺.y~ + calc_camera_magenta +** Processing line: ~ calc_camera_cyan~ - Inside source: true *** True Line Result - 🎮.⚖️ ||= 720 / 🎮.🗺.y -** Processing line: ~ #Offset, offset all rendering to the center of the screen~ + calc_camera_cyan +** Processing line: ~ calc_camera_center~ - Inside source: true *** True Line Result - #Offset, offset all rendering to the center of the screen -** Processing line: ~ 🎮.⛓ ||= [(1280 - 720).fdiv(2), 0]~ + calc_camera_center +** Processing line: ~ calc_player_cyan~ - Inside source: true *** True Line Result - 🎮.⛓ ||= [(1280 - 720).fdiv(2), 0] -** Processing line: ~ #Padding, make the snake body slightly smaller than the scale~ + calc_player_cyan +** Processing line: ~ calc_player_magenta~ - Inside source: true *** True Line Result - #Padding, make the snake body slightly smaller than the scale -** Processing line: ~ 🎮.🛶 ||= (🎮.⚖️ * 0.2).to_i~ + calc_player_magenta +** Processing line: ~ calc_trauma_decay~ - Inside source: true *** True Line Result - 🎮.🛶 ||= (🎮.⚖️ * 0.2).to_i -** Processing line: ~ #Snake Size~ + calc_trauma_decay +** Processing line: ~ end~ - Inside source: true *** True Line Result - #Snake Size -** Processing line: ~ 🎮.🛒 ||= 3~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 🎮.🛒 ||= 3 -** Processing line: ~ #Snake head, the only part we are actually controlling~ + +** Processing line: ~ def center_camera_tolerance~ - Inside source: true *** True Line Result - #Snake head, the only part we are actually controlling -** Processing line: ~ 🎮.🤖 ||= [🎮.🗺.x / 2, 🎮.🗺.y / 2]~ + def center_camera_tolerance +** Processing line: ~ return Math.sqrt(((state.player_magenta.x - state.player_cyan.x) ** 2) +~ - Inside source: true *** True Line Result - 🎮.🤖 ||= [🎮.🗺.x / 2, 🎮.🗺.y / 2] -** Processing line: ~ #Snake body map, follows the head~ + return Math.sqrt(((state.player_magenta.x - state.player_cyan.x) ** 2) + +** Processing line: ~ ((state.player_magenta.y - state.player_cyan.y) ** 2)) > 640~ - Inside source: true *** True Line Result - #Snake body map, follows the head -** Processing line: ~ 🎮.🐍 ||= []~ + ((state.player_magenta.y - state.player_cyan.y) ** 2)) > 640 +** Processing line: ~ end~ - Inside source: true *** True Line Result - 🎮.🐍 ||= [] -** Processing line: ~ #Direction the head moves to~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - #Direction the head moves to -** Processing line: ~ 🎮.🚗 ||= [0, 0]~ + +** Processing line: ~ def calc_player_cyan~ - Inside source: true *** True Line Result - 🎮.🚗 ||= [0, 0] -** Processing line: ~ #Next_Direction, during input check only change this variable and then when game updates asign this to Direction~ + def calc_player_cyan +** Processing line: ~ state.player_cyan.x += state.player_cyan.dx~ - Inside source: true *** True Line Result - #Next_Direction, during input check only change this variable and then when game updates asign this to Direction -** Processing line: ~ 🎮.🚦 ||= [*🎮.🚗]~ + state.player_cyan.x += state.player_cyan.dx +** Processing line: ~ state.player_cyan.y += state.player_cyan.dy~ - Inside source: true *** True Line Result - 🎮.🚦 ||= [*🎮.🚗] -** Processing line: ~ #Your score~ + state.player_cyan.y += state.player_cyan.dy +** Processing line: ~ end~ - Inside source: true *** True Line Result - #Your score -** Processing line: ~ 🎮.💰 ||= 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 🎮.💰 ||= 0 -** Processing line: ~ #Spawns Food randomly~ + +** Processing line: ~ def calc_player_magenta~ - Inside source: true *** True Line Result - #Spawns Food randomly -** Processing line: ~ spawn_🍎(🎮) unless 🎮.🍎?~ + def calc_player_magenta +** Processing line: ~ state.player_magenta.x += state.player_magenta.dx~ - Inside source: true *** True Line Result - spawn_🍎(🎮) unless 🎮.🍎? -** Processing line: ~ end~ + state.player_magenta.x += state.player_magenta.dx +** Processing line: ~ state.player_magenta.y += state.player_magenta.dy~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.player_magenta.y += state.player_magenta.dy +** Processing line: ~ end~ - 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 + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Arcade - Solar System - main.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ def calc_camera_center~ +- Inside source: true *** True Line Result -* Arcade - Solar System - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - + def calc_camera_center +** Processing line: ~ timeScale = 1~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_arcade/solar_system/app/main.rb~ + timeScale = 1 +** Processing line: ~ midX = (state.player_magenta.x + state.player_cyan.x)/2~ - Inside source: true *** True Line Result - # ./samples/99_genre_arcade/solar_system/app/main.rb -** Processing line: ~ # Focused tutorial video: https://s3.amazonaws.com/s3.dragonruby.org/dragonruby-nddnug-workshop.mp4~ + midX = (state.player_magenta.x + state.player_cyan.x)/2 +** Processing line: ~ midY = (state.player_magenta.y + state.player_cyan.y)/2~ - Inside source: true *** True Line Result - # Focused tutorial video: https://s3.amazonaws.com/s3.dragonruby.org/dragonruby-nddnug-workshop.mp4 -** Processing line: ~ # Workshop/Presentation which provides motivation for creating a game engine: https://www.youtube.com/watch?v=S3CFce1arC8~ + midY = (state.player_magenta.y + state.player_cyan.y)/2 +** Processing line: ~ targetX = midX - state.camera_center.w/2~ - Inside source: true *** True Line Result - # Workshop/Presentation which provides motivation for creating a game engine: https://www.youtube.com/watch?v=S3CFce1arC8 -** Processing line: ~~ + targetX = midX - state.camera_center.w/2 +** Processing line: ~ targetY = midY - state.camera_center.h/2~ - Inside source: true *** True Line Result - -** Processing line: ~ def defaults args~ + targetY = midY - state.camera_center.h/2 +** Processing line: ~ state.camera_center.x += (targetX - state.camera_center.x) * 0.1 * timeScale~ - Inside source: true *** True Line Result - def defaults args -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ + state.camera_center.x += (targetX - state.camera_center.x) * 0.1 * timeScale +** Processing line: ~ state.camera_center.y += (targetY - state.camera_center.y) * 0.1 * timeScale~ - Inside source: true *** True Line Result - args.outputs.background_color = [0, 0, 0] -** Processing line: ~ args.state.x ||= 640~ + state.camera_center.y += (targetY - state.camera_center.y) * 0.1 * timeScale +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.x ||= 640 -** Processing line: ~ args.state.y ||= 360~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.y ||= 360 -** Processing line: ~ args.state.stars ||= 100.map do~ + +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.stars ||= 100.map do -** Processing line: ~ [1280 * rand, 720 * rand, rand.fdiv(10), 255 * rand, 255 * rand, 255 * rand]~ + +** Processing line: ~ def calc_camera_magenta~ - Inside source: true *** True Line Result - [1280 * rand, 720 * rand, rand.fdiv(10), 255 * rand, 255 * rand, 255 * rand] -** Processing line: ~ end~ + def calc_camera_magenta +** Processing line: ~ timeScale = 1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + timeScale = 1 +** Processing line: ~ targetX = state.player_magenta.x + state.player_magenta.w - state.camera_magenta.w/2~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.sun ||= args.state.new_entity(:sun) do |s|~ + targetX = state.player_magenta.x + state.player_magenta.w - state.camera_magenta.w/2 +** Processing line: ~ targetY = state.player_magenta.y + state.player_magenta.h - state.camera_magenta.h/2~ - Inside source: true *** True Line Result - args.state.sun ||= args.state.new_entity(:sun) do |s| -** Processing line: ~ s.s = 100~ + targetY = state.player_magenta.y + state.player_magenta.h - state.camera_magenta.h/2 +** Processing line: ~ state.camera_magenta.x += (targetX - state.camera_magenta.x) * 0.1 * timeScale~ - Inside source: true *** True Line Result - s.s = 100 -** Processing line: ~ s.path = 'sprites/sun.png'~ + state.camera_magenta.x += (targetX - state.camera_magenta.x) * 0.1 * timeScale +** Processing line: ~ state.camera_magenta.y += (targetY - state.camera_magenta.y) * 0.1 * timeScale~ - Inside source: true *** True Line Result - s.path = 'sprites/sun.png' + state.camera_magenta.y += (targetY - state.camera_magenta.y) * 0.1 * timeScale ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -47063,70 +50236,74 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ args.state.planets = [~ +** Processing line: ~ def calc_camera_cyan~ - Inside source: true *** True Line Result - args.state.planets = [ -** Processing line: ~ [:mercury, 65, 5, 88],~ + def calc_camera_cyan +** Processing line: ~ timeScale = 1~ - Inside source: true *** True Line Result - [:mercury, 65, 5, 88], -** Processing line: ~ [:venus, 100, 10, 225],~ + timeScale = 1 +** Processing line: ~ targetX = state.player_cyan.x + state.player_cyan.w - state.camera_cyan.w/2~ - Inside source: true *** True Line Result - [:venus, 100, 10, 225], -** Processing line: ~ [:earth, 120, 10, 365],~ + targetX = state.player_cyan.x + state.player_cyan.w - state.camera_cyan.w/2 +** Processing line: ~ targetY = state.player_cyan.y + state.player_cyan.h - state.camera_cyan.h/2~ - Inside source: true *** True Line Result - [:earth, 120, 10, 365], -** Processing line: ~ [:mars, 140, 8, 687],~ + targetY = state.player_cyan.y + state.player_cyan.h - state.camera_cyan.h/2 +** Processing line: ~ state.camera_cyan.x += (targetX - state.camera_cyan.x) * 0.1 * timeScale~ - Inside source: true *** True Line Result - [:mars, 140, 8, 687], -** Processing line: ~ [:jupiter, 280, 30, 365 * 11.8],~ + state.camera_cyan.x += (targetX - state.camera_cyan.x) * 0.1 * timeScale +** Processing line: ~ state.camera_cyan.y += (targetY - state.camera_cyan.y) * 0.1 * timeScale~ - Inside source: true *** True Line Result - [:jupiter, 280, 30, 365 * 11.8], -** Processing line: ~ [:saturn, 350, 20, 365 * 29.5],~ + state.camera_cyan.y += (targetY - state.camera_cyan.y) * 0.1 * timeScale +** Processing line: ~ end~ - Inside source: true *** True Line Result - [:saturn, 350, 20, 365 * 29.5], -** Processing line: ~ [:uranus, 400, 15, 365 * 84],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [:uranus, 400, 15, 365 * 84], -** Processing line: ~ [:neptune, 440, 15, 365 * 164.8],~ + +** Processing line: ~ def calc_player_quadrant angle~ - Inside source: true *** True Line Result - [:neptune, 440, 15, 365 * 164.8], -** Processing line: ~ [:pluto, 480, 5, 365 * 247.8],~ + def calc_player_quadrant angle +** Processing line: ~ if angle < 45 and angle > -45 and state.player_cyan.x < state.player_magenta.x~ - Inside source: true *** True Line Result - [:pluto, 480, 5, 365 * 247.8], -** Processing line: ~ ].map do |name, distance, size, year_in_days|~ + if angle < 45 and angle > -45 and state.player_cyan.x < state.player_magenta.x +** Processing line: ~ return 1~ - Inside source: true *** True Line Result - ].map do |name, distance, size, year_in_days| -** Processing line: ~ args.state.new_entity(name) do |p|~ + return 1 +** Processing line: ~ elsif angle < 45 and angle > -45 and state.player_cyan.x > state.player_magenta.x~ - Inside source: true *** True Line Result - args.state.new_entity(name) do |p| -** Processing line: ~ p.path = "sprites/#{name}.png"~ + elsif angle < 45 and angle > -45 and state.player_cyan.x > state.player_magenta.x +** Processing line: ~ return 3~ - Inside source: true *** True Line Result - p.path = "sprites/#{name}.png" -** Processing line: ~ p.distance = distance * 0.7~ + return 3 +** Processing line: ~ elsif (angle > 45 or angle < -45) and state.player_cyan.y < state.player_magenta.y~ - Inside source: true *** True Line Result - p.distance = distance * 0.7 -** Processing line: ~ p.s = size * 0.7~ + elsif (angle > 45 or angle < -45) and state.player_cyan.y < state.player_magenta.y +** Processing line: ~ return 2~ - Inside source: true *** True Line Result - p.s = size * 0.7 -** Processing line: ~ p.year_in_days = year_in_days~ + return 2 +** Processing line: ~ elsif (angle > 45 or angle < -45) and state.player_cyan.y > state.player_magenta.y~ - Inside source: true *** True Line Result - p.year_in_days = year_in_days + elsif (angle > 45 or angle < -45) and state.player_cyan.y > state.player_magenta.y +** Processing line: ~ return 4~ +- Inside source: true +*** True Line Result + return 4 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -47139,82 +50316,98 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ args.state.ship ||= args.state.new_entity(:ship) do |s|~ +** Processing line: ~ def calc_camera_shake~ - Inside source: true *** True Line Result - args.state.ship ||= args.state.new_entity(:ship) do |s| -** Processing line: ~ s.x = 1280 * rand~ + def calc_camera_shake +** Processing line: ~ state.trauma~ - Inside source: true *** True Line Result - s.x = 1280 * rand -** Processing line: ~ s.y = 720 * rand~ + state.trauma +** Processing line: ~ end~ - Inside source: true *** True Line Result - s.y = 720 * rand -** Processing line: ~ s.angle = 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - s.angle = 0 -** Processing line: ~ end~ + +** Processing line: ~ def calc_trauma_decay~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def calc_trauma_decay +** Processing line: ~ state.trauma = state.trauma * 0.9~ - Inside source: true *** True Line Result - end + state.trauma = state.trauma * 0.9 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def to_sprite args, entity~ +** Processing line: ~ def calc_random_float_range(min, max)~ - Inside source: true *** True Line Result - def to_sprite args, entity -** Processing line: ~ x = 0~ + def calc_random_float_range(min, max) +** Processing line: ~ rand * (max-min) + min~ - Inside source: true *** True Line Result - x = 0 -** Processing line: ~ y = 0~ + rand * (max-min) + min +** Processing line: ~ end~ - Inside source: true *** True Line Result - y = 0 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if entity.year_in_days~ +** Processing line: ~ #==============================================================================================~ - Inside source: true *** True Line Result - if entity.year_in_days -** Processing line: ~ day = args.state.tick_count~ + #============================================================================================== +** Processing line: ~ #Render Functions~ - Inside source: true *** True Line Result - day = args.state.tick_count -** Processing line: ~ day_in_year = day % entity.year_in_days~ + #Render Functions +** Processing line: ~ def render~ - Inside source: true *** True Line Result - day_in_year = day % entity.year_in_days -** Processing line: ~ entity.random_start_day ||= day_in_year * rand~ + def render +** Processing line: ~ render_floor~ - Inside source: true *** True Line Result - entity.random_start_day ||= day_in_year * rand -** Processing line: ~ percentage_of_year = day_in_year.fdiv(entity.year_in_days)~ + render_floor +** Processing line: ~ render_player_cyan~ - Inside source: true *** True Line Result - percentage_of_year = day_in_year.fdiv(entity.year_in_days) -** Processing line: ~ angle = 365 * percentage_of_year~ + render_player_cyan +** Processing line: ~ render_player_magenta~ - Inside source: true *** True Line Result - angle = 365 * percentage_of_year -** Processing line: ~ x = angle.vector_x(entity.distance)~ + render_player_magenta +** Processing line: ~ if center_camera_tolerance~ - Inside source: true *** True Line Result - x = angle.vector_x(entity.distance) -** Processing line: ~ y = angle.vector_y(entity.distance)~ + if center_camera_tolerance +** Processing line: ~ render_split_camera_scene~ - Inside source: true *** True Line Result - y = angle.vector_y(entity.distance) + render_split_camera_scene +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ render_camera_center_scene~ +- Inside source: true +*** True Line Result + render_camera_center_scene +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -47223,38 +50416,42 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ [640 + x - entity.s.half, 360 + y - entity.s.half, entity.s, entity.s, entity.path]~ +** Processing line: ~ def render_player_cyan~ - Inside source: true *** True Line Result - [640 + x - entity.s.half, 360 + y - entity.s.half, entity.s, entity.s, entity.path] -** Processing line: ~ end~ + def render_player_cyan +** Processing line: ~ outputs[:scene].sprites << {x: state.player_cyan.x,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs[:scene].sprites << {x: state.player_cyan.x, +** Processing line: ~ y: state.player_cyan.y,~ - Inside source: true *** True Line Result - -** Processing line: ~ def render args~ + y: state.player_cyan.y, +** Processing line: ~ w: state.player_cyan.w,~ - Inside source: true *** True Line Result - def render args -** Processing line: ~ args.outputs.solids << [0, 0, 1280, 720]~ + w: state.player_cyan.w, +** Processing line: ~ h: state.player_cyan.h,~ - Inside source: true *** True Line Result - args.outputs.solids << [0, 0, 1280, 720] -** Processing line: ~~ + h: state.player_cyan.h, +** Processing line: ~ path: "sprites/player/player_#{state.player_cyan.orientation}_standing.png",~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.sprites << args.state.stars.map do |x, y, _, r, g, b|~ + path: "sprites/player/player_#{state.player_cyan.orientation}_standing.png", +** Processing line: ~ r: 0,~ - Inside source: true *** True Line Result - args.outputs.sprites << args.state.stars.map do |x, y, _, r, g, b| -** Processing line: ~ [x, y, 10, 10, 'sprites/star.png', 0, 100, r, g, b]~ + r: 0, +** Processing line: ~ g: 255,~ - Inside source: true *** True Line Result - [x, y, 10, 10, 'sprites/star.png', 0, 100, r, g, b] + g: 255, +** Processing line: ~ b: 255}~ +- Inside source: true +*** True Line Result + b: 255} ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -47263,54 +50460,66 @@ 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.sprites << to_sprite(args, args.state.sun)~ +** Processing line: ~ def render_player_magenta~ - Inside source: true *** True Line Result - args.outputs.sprites << to_sprite(args, args.state.sun) -** Processing line: ~ args.outputs.sprites << args.state.planets.map { |p| to_sprite args, p }~ + def render_player_magenta +** Processing line: ~ outputs[:scene].sprites << {x: state.player_magenta.x,~ - Inside source: true *** True Line Result - args.outputs.sprites << args.state.planets.map { |p| to_sprite args, p } -** Processing line: ~ args.outputs.sprites << [args.state.ship.x, args.state.ship.y, 20, 20, 'sprites/ship.png', args.state.ship.angle]~ + outputs[:scene].sprites << {x: state.player_magenta.x, +** Processing line: ~ y: state.player_magenta.y,~ - Inside source: true *** True Line Result - args.outputs.sprites << [args.state.ship.x, args.state.ship.y, 20, 20, 'sprites/ship.png', args.state.ship.angle] -** Processing line: ~ end~ + y: state.player_magenta.y, +** Processing line: ~ w: state.player_magenta.w,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + w: state.player_magenta.w, +** Processing line: ~ h: state.player_magenta.h,~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc args~ + h: state.player_magenta.h, +** Processing line: ~ path: "sprites/player/player_#{state.player_magenta.orientation}_standing.png",~ - Inside source: true *** True Line Result - def calc args -** Processing line: ~ args.state.stars = args.state.stars.map do |x, y, speed, r, g, b|~ + path: "sprites/player/player_#{state.player_magenta.orientation}_standing.png", +** Processing line: ~ r: 255,~ - Inside source: true *** True Line Result - args.state.stars = args.state.stars.map do |x, y, speed, r, g, b| -** Processing line: ~ x += speed~ + r: 255, +** Processing line: ~ g: 0,~ - Inside source: true *** True Line Result - x += speed -** Processing line: ~ y += speed~ + g: 0, +** Processing line: ~ b: 255}~ - Inside source: true *** True Line Result - y += speed -** Processing line: ~ x = 0 if x > 1280~ + b: 255} +** Processing line: ~ end~ - Inside source: true *** True Line Result - x = 0 if x > 1280 -** Processing line: ~ y = 0 if y > 720~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - y = 0 if y > 720 -** Processing line: ~ [x, y, speed, r, g, b]~ + +** Processing line: ~ def render_floor~ - Inside source: true *** True Line Result - [x, y, speed, r, g, b] + def render_floor +** Processing line: ~ outputs[:scene].sprites << [state.room.x, state.room.y,~ +- Inside source: true +*** True Line Result + outputs[:scene].sprites << [state.room.x, state.room.y, +** Processing line: ~ state.room.w, state.room.h,~ +- Inside source: true +*** True Line Result + state.room.w, state.room.h, +** Processing line: ~ state.room.sprite_path]~ +- Inside source: true +*** True Line Result + state.room.sprite_path] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -47319,534 +50528,566 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ if args.state.tick_count == 0~ +** Processing line: ~ def render_camera_center_scene~ - Inside source: true *** True Line Result - if args.state.tick_count == 0 -** Processing line: ~ args.outputs.sounds << 'sounds/bg.ogg'~ + def render_camera_center_scene +** Processing line: ~ zoomFactor = 1~ - Inside source: true *** True Line Result - args.outputs.sounds << 'sounds/bg.ogg' -** Processing line: ~ end~ + zoomFactor = 1 +** Processing line: ~ outputs[:scene].width = state.room.w~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + outputs[:scene].width = state.room.w +** Processing line: ~ outputs[:scene].height = state.room.h~ - Inside source: true *** True Line Result - end + outputs[:scene].height = state.room.h ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def process_inputs args~ -- Inside source: true -*** True Line Result - def process_inputs args -** Processing line: ~ if args.inputs.keyboard.left || args.inputs.controller_one.key_held.left~ +** Processing line: ~ maxAngle = 10.0~ - Inside source: true *** True Line Result - if args.inputs.keyboard.left || args.inputs.controller_one.key_held.left -** Processing line: ~ args.state.ship.angle += 1~ + maxAngle = 10.0 +** Processing line: ~ maxOffset = 20.0~ - Inside source: true *** True Line Result - args.state.ship.angle += 1 -** Processing line: ~ elsif args.inputs.keyboard.right || args.inputs.controller_one.key_held.right~ + maxOffset = 20.0 +** Processing line: ~ angle = maxAngle * calc_camera_shake * calc_random_float_range(-1,1)~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.right || args.inputs.controller_one.key_held.right -** Processing line: ~ args.state.ship.angle -= 1~ + angle = maxAngle * calc_camera_shake * calc_random_float_range(-1,1) +** Processing line: ~ offsetX = 32 - (maxOffset * calc_camera_shake * calc_random_float_range(-1,1))~ - Inside source: true *** True Line Result - args.state.ship.angle -= 1 -** Processing line: ~ end~ + offsetX = 32 - (maxOffset * calc_camera_shake * calc_random_float_range(-1,1)) +** Processing line: ~ offsetY = 32 - (maxOffset * calc_camera_shake * calc_random_float_range(-1,1))~ - Inside source: true *** True Line Result - end + offsetY = 32 - (maxOffset * calc_camera_shake * calc_random_float_range(-1,1)) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if args.inputs.keyboard.up || args.inputs.controller_one.key_held.a~ +** Processing line: ~ outputs.sprites << {x: (-state.camera_center.x - offsetX)/zoomFactor,~ - Inside source: true *** True Line Result - if args.inputs.keyboard.up || args.inputs.controller_one.key_held.a -** Processing line: ~ args.state.ship.x += args.state.ship.angle.x_vector~ + outputs.sprites << {x: (-state.camera_center.x - offsetX)/zoomFactor, +** Processing line: ~ y: (-state.camera_center.y - offsetY)/zoomFactor,~ - Inside source: true *** True Line Result - args.state.ship.x += args.state.ship.angle.x_vector -** Processing line: ~ args.state.ship.y += args.state.ship.angle.y_vector~ + y: (-state.camera_center.y - offsetY)/zoomFactor, +** Processing line: ~ w: outputs[:scene].width/zoomFactor,~ - Inside source: true *** True Line Result - args.state.ship.y += args.state.ship.angle.y_vector -** Processing line: ~ end~ + w: outputs[:scene].width/zoomFactor, +** Processing line: ~ h: outputs[:scene].height/zoomFactor,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + h: outputs[:scene].height/zoomFactor, +** Processing line: ~ path: :scene,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + path: :scene, +** Processing line: ~ angle: angle,~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + angle: angle, +** Processing line: ~ source_w: -1,~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ defaults args~ + source_w: -1, +** Processing line: ~ source_h: -1}~ - Inside source: true *** True Line Result - defaults args -** Processing line: ~ render args~ + source_h: -1} +** Processing line: ~ outputs.labels << [128,64,"#{state.trauma.round(1)}",8,2,255,0,255,255]~ - Inside source: true *** True Line Result - render args -** Processing line: ~ calc args~ + outputs.labels << [128,64,"#{state.trauma.round(1)}",8,2,255,0,255,255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - calc args -** Processing line: ~ process_inputs args~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - process_inputs args -** Processing line: ~ end~ + +** Processing line: ~ def render_split_camera_scene~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def render_split_camera_scene +** Processing line: ~ outputs[:scene].width = state.room.w~ - Inside source: true *** True Line Result - -** Processing line: ~ def r~ + outputs[:scene].width = state.room.w +** Processing line: ~ outputs[:scene].height = state.room.h~ - Inside source: true *** True Line Result - def r -** Processing line: ~ $gtk.reset~ + outputs[:scene].height = state.room.h +** Processing line: ~ render_camera_magenta_scene~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~ end~ + render_camera_magenta_scene +** Processing line: ~ render_camera_cyan_scene~ - Inside source: true *** True Line Result - end + render_camera_cyan_scene ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. +** Processing line: ~ angle = Math.atan((state.player_magenta.y - state.player_cyan.y)/(state.player_magenta.x- state.player_cyan.x)) * 180/Math::PI~ +- Inside source: true *** True Line Result -#+end_src + angle = Math.atan((state.player_magenta.y - state.player_cyan.y)/(state.player_magenta.x- state.player_cyan.x)) * 180/Math::PI +** Processing line: ~ output_split_camera angle~ +- Inside source: true +*** True Line Result + output_split_camera angle ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Crafting - Craft Game Starting Point - main.rb~ -- Header detected. +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ def render_camera_magenta_scene~ +- Inside source: true *** True Line Result -* Crafting - Craft Game Starting Point - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + def render_camera_magenta_scene +** Processing line: ~ zoomFactor = 1~ +- Inside source: true +*** True Line Result + zoomFactor = 1 +** Processing line: ~ offsetX = 32~ +- Inside source: true +*** True Line Result + offsetX = 32 +** Processing line: ~ offsetY = 32~ +- Inside source: true +*** True Line Result + offsetY = 32 +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ outputs[:scene_magenta].sprites << {x: (-state.camera_magenta.x*2),~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_crafting/craft_game_starting_point/app/main.rb~ + outputs[:scene_magenta].sprites << {x: (-state.camera_magenta.x*2), +** Processing line: ~ y: (-state.camera_magenta.y),~ - Inside source: true *** True Line Result - # ./samples/99_genre_crafting/craft_game_starting_point/app/main.rb -** Processing line: ~ # ==================================================~ + y: (-state.camera_magenta.y), +** Processing line: ~ w: outputs[:scene].width*2,~ - Inside source: true *** True Line Result - # ================================================== -** Processing line: ~ # A NOTE TO JAM CRAFT PARTICIPANTS:~ + w: outputs[:scene].width*2, +** Processing line: ~ h: outputs[:scene].height,~ - Inside source: true *** True Line Result - # A NOTE TO JAM CRAFT PARTICIPANTS: -** Processing line: ~ # The comments and code in here are just as small piece of DragonRuby's capabilities.~ + h: outputs[:scene].height, +** Processing line: ~ path: :scene}~ - Inside source: true *** True Line Result - # The comments and code in here are just as small piece of DragonRuby's capabilities. -** Processing line: ~ # Be sure to check out the rest of the sample apps. Start with README.txt and go from there!~ + path: :scene} +** Processing line: ~~ - Inside source: true *** True Line Result - # Be sure to check out the rest of the sample apps. Start with README.txt and go from there! -** Processing line: ~ # ==================================================~ + +** Processing line: ~ end~ - Inside source: true *** True Line Result - # ================================================== + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # def tick args is the entry point into your game. This function is called at~ +** Processing line: ~ def render_camera_cyan_scene~ - Inside source: true *** True Line Result - # def tick args is the entry point into your game. This function is called at -** Processing line: ~ # a fixed update time of 60hz (60 fps).~ + def render_camera_cyan_scene +** Processing line: ~ zoomFactor = 1~ - Inside source: true *** True Line Result - # a fixed update time of 60hz (60 fps). -** Processing line: ~ def tick args~ + zoomFactor = 1 +** Processing line: ~ offsetX = 32~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ # The defaults function intitializes the game.~ + offsetX = 32 +** Processing line: ~ offsetY = 32~ - Inside source: true *** True Line Result - # The defaults function intitializes the game. -** Processing line: ~ defaults args~ + offsetY = 32 +** Processing line: ~ outputs[:scene_cyan].sprites << {x: (-state.camera_cyan.x*2),~ - Inside source: true *** True Line Result - defaults args -** Processing line: ~~ + outputs[:scene_cyan].sprites << {x: (-state.camera_cyan.x*2), +** Processing line: ~ y: (-state.camera_cyan.y),~ - Inside source: true *** True Line Result - -** Processing line: ~ # After the game is initialized, render it.~ + y: (-state.camera_cyan.y), +** Processing line: ~ w: outputs[:scene].width*2,~ - Inside source: true *** True Line Result - # After the game is initialized, render it. -** Processing line: ~ render args~ + w: outputs[:scene].width*2, +** Processing line: ~ h: outputs[:scene].height,~ - Inside source: true *** True Line Result - render args + h: outputs[:scene].height, +** Processing line: ~ path: :scene}~ +- Inside source: true +*** True Line Result + path: :scene} +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # After rendering the player should be able to respond to input.~ +** Processing line: ~ def output_split_camera angle~ - Inside source: true *** True Line Result - # After rendering the player should be able to respond to input. -** Processing line: ~ input args~ + def output_split_camera angle +** Processing line: ~ #TODO: Clean this up!~ - Inside source: true *** True Line Result - input args -** Processing line: ~~ + #TODO: Clean this up! +** Processing line: ~ quadrant = calc_player_quadrant angle~ - Inside source: true *** True Line Result - -** Processing line: ~ # After responding to input, the game performs any additional calculations.~ + quadrant = calc_player_quadrant angle +** Processing line: ~ outputs.labels << [128,64,"#{quadrant}",8,2,255,0,255,255]~ - Inside source: true *** True Line Result - # After responding to input, the game performs any additional calculations. -** Processing line: ~ calc args~ + outputs.labels << [128,64,"#{quadrant}",8,2,255,0,255,255] +** Processing line: ~ if quadrant == 1~ - Inside source: true *** True Line Result - calc args -** Processing line: ~ end~ + if quadrant == 1 +** Processing line: ~ set_camera_attributes(w: 640, h: 720, m_x: 640, m_y: 0, c_x: 0, c_y: 0)~ - Inside source: true *** True Line Result - end + set_camera_attributes(w: 640, h: 720, m_x: 640, m_y: 0, c_x: 0, c_y: 0) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def defaults args~ +** Processing line: ~ elsif quadrant == 2~ - Inside source: true *** True Line Result - def defaults args -** Processing line: ~ # hide the mouse cursor for this game, we are going to render our own cursor~ + elsif quadrant == 2 +** Processing line: ~ set_camera_attributes(w: 1280, h: 360, m_x: 0, m_y: 360, c_x: 0, c_y: 0)~ - Inside source: true *** True Line Result - # hide the mouse cursor for this game, we are going to render our own cursor -** Processing line: ~ if args.state.tick_count == 0~ + set_camera_attributes(w: 1280, h: 360, m_x: 0, m_y: 360, c_x: 0, c_y: 0) +** Processing line: ~~ - Inside source: true *** True Line Result - if args.state.tick_count == 0 -** Processing line: ~ args.gtk.hide_cursor~ + +** Processing line: ~ elsif quadrant == 3~ - Inside source: true *** True Line Result - args.gtk.hide_cursor -** Processing line: ~ end~ + elsif quadrant == 3 +** Processing line: ~ set_camera_attributes(w: 640, h: 720, m_x: 0, m_y: 0, c_x: 640, c_y: 0)~ - Inside source: true *** True Line Result - end + set_camera_attributes(w: 640, h: 720, m_x: 0, m_y: 0, c_x: 640, c_y: 0) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.state.click_ripples ||= []~ +** Processing line: ~ elsif quadrant == 4~ - Inside source: true *** True Line Result - args.state.click_ripples ||= [] + elsif quadrant == 4 +** Processing line: ~ set_camera_attributes(w: 1280, h: 360, m_x: 0, m_y: 0, c_x: 0, c_y: 360)~ +- Inside source: true +*** True Line Result + set_camera_attributes(w: 1280, h: 360, m_x: 0, m_y: 0, c_x: 0, c_y: 360) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # everything is on a 1280x720 virtual canvas, so you can~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - # everything is on a 1280x720 virtual canvas, so you can -** Processing line: ~ # hardcode locations~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # hardcode locations + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # define the borders for where the inventory is located~ +** Processing line: ~ def set_camera_attributes(w: 0, h: 0, m_x: 0, m_y: 0, c_x: 0, c_y: 0)~ - Inside source: true *** True Line Result - # define the borders for where the inventory is located -** Processing line: ~ # args.state is a data structure that accepts any arbitrary parameters~ + def set_camera_attributes(w: 0, h: 0, m_x: 0, m_y: 0, c_x: 0, c_y: 0) +** Processing line: ~ state.camera_cyan.w = w + 64~ - Inside source: true *** True Line Result - # args.state is a data structure that accepts any arbitrary parameters -** Processing line: ~ # so you can create an object graph without having to create any classes.~ + state.camera_cyan.w = w + 64 +** Processing line: ~ state.camera_cyan.h = h + 64~ - Inside source: true *** True Line Result - # so you can create an object graph without having to create any classes. + state.camera_cyan.h = h + 64 +** Processing line: ~ outputs[:scene_cyan].width = (w) * 2~ +- Inside source: true +*** True Line Result + outputs[:scene_cyan].width = (w) * 2 +** Processing line: ~ outputs[:scene_cyan].height = h~ +- Inside source: true +*** True Line Result + outputs[:scene_cyan].height = h ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Bottom left is 0, 0. Top right is 1280, 720.~ +** Processing line: ~ state.camera_magenta.w = w + 64~ - Inside source: true *** True Line Result - # Bottom left is 0, 0. Top right is 1280, 720. -** Processing line: ~ # The inventory area is at the top of the screen~ + state.camera_magenta.w = w + 64 +** Processing line: ~ state.camera_magenta.h = h + 64~ - Inside source: true *** True Line Result - # The inventory area is at the top of the screen -** Processing line: ~ # the number 80 is the size of all the sprites, so that is what is being~ + state.camera_magenta.h = h + 64 +** Processing line: ~ outputs[:scene_magenta].width = (w) * 2~ - Inside source: true *** True Line Result - # the number 80 is the size of all the sprites, so that is what is being -** Processing line: ~ # used to decide the with and height~ + outputs[:scene_magenta].width = (w) * 2 +** Processing line: ~ outputs[:scene_magenta].height = h~ - Inside source: true *** True Line Result - # used to decide the with and height -** Processing line: ~ args.state.sprite_size = 80~ + outputs[:scene_magenta].height = h +** Processing line: ~ outputs.sprites << {x: m_x,~ - Inside source: true *** True Line Result - args.state.sprite_size = 80 -** Processing line: ~~ + outputs.sprites << {x: m_x, +** Processing line: ~ y: m_y,~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.inventory_border.w = args.state.sprite_size * 10~ + y: m_y, +** Processing line: ~ w: w,~ - Inside source: true *** True Line Result - args.state.inventory_border.w = args.state.sprite_size * 10 -** Processing line: ~ args.state.inventory_border.h = args.state.sprite_size * 3~ + w: w, +** Processing line: ~ h: h,~ - Inside source: true *** True Line Result - args.state.inventory_border.h = args.state.sprite_size * 3 -** Processing line: ~ args.state.inventory_border.x = 10~ + h: h, +** Processing line: ~ path: :scene_magenta}~ - Inside source: true *** True Line Result - args.state.inventory_border.x = 10 -** Processing line: ~ args.state.inventory_border.y = 710 - args.state.inventory_border.h~ + path: :scene_magenta} +** Processing line: ~ outputs.sprites << {x: c_x,~ - Inside source: true *** True Line Result - args.state.inventory_border.y = 710 - args.state.inventory_border.h -** Processing line: ~~ + outputs.sprites << {x: c_x, +** Processing line: ~ y: c_y,~ - Inside source: true *** True Line Result - -** Processing line: ~ # define the borders for where the crafting area is located~ + y: c_y, +** Processing line: ~ w: w,~ - Inside source: true *** True Line Result - # define the borders for where the crafting area is located -** Processing line: ~ # the crafting area is below the inventory area~ + w: w, +** Processing line: ~ h: h,~ - Inside source: true *** True Line Result - # the crafting area is below the inventory area -** Processing line: ~ # the number 80 is the size of all the sprites, so that is what is being~ + h: h, +** Processing line: ~ path: :scene_cyan}~ - Inside source: true *** True Line Result - # the number 80 is the size of all the sprites, so that is what is being -** Processing line: ~ # used to decide the with and height~ + path: :scene_cyan} +** Processing line: ~ end~ - Inside source: true *** True Line Result - # used to decide the with and height -** Processing line: ~ args.state.craft_border.x = 10~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.craft_border.x = 10 -** Processing line: ~ args.state.craft_border.y = 220~ + +** Processing line: ~ def add_trauma amount~ - Inside source: true *** True Line Result - args.state.craft_border.y = 220 -** Processing line: ~ args.state.craft_border.w = args.state.sprite_size * 3~ + def add_trauma amount +** Processing line: ~ state.trauma = [state.trauma + amount, 1.0].min~ - Inside source: true *** True Line Result - args.state.craft_border.w = args.state.sprite_size * 3 -** Processing line: ~ args.state.craft_border.h = args.state.sprite_size * 3~ + state.trauma = [state.trauma + amount, 1.0].min +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.craft_border.h = args.state.sprite_size * 3 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # define the area where results are located~ -- Inside source: true -*** True Line Result - # define the area where results are located -** Processing line: ~ # the crafting result is to the right of the craft area~ +** Processing line: ~ def remove_trauma amount~ - Inside source: true *** True Line Result - # the crafting result is to the right of the craft area -** Processing line: ~ args.state.result_border.x = 10 + args.state.sprite_size * 3 + args.state.sprite_size~ + def remove_trauma amount +** Processing line: ~ state.trauma = [state.trauma - amount, 0.0].max~ - Inside source: true *** True Line Result - args.state.result_border.x = 10 + args.state.sprite_size * 3 + args.state.sprite_size -** Processing line: ~ args.state.result_border.y = 220 + args.state.sprite_size~ + state.trauma = [state.trauma - amount, 0.0].max +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.result_border.y = 220 + args.state.sprite_size -** Processing line: ~ args.state.result_border.w = args.state.sprite_size~ + end +** Processing line: ~ #==============================================================================================~ - Inside source: true *** True Line Result - args.state.result_border.w = args.state.sprite_size -** Processing line: ~ args.state.result_border.h = args.state.sprite_size~ + #============================================================================================== +** Processing line: ~ #Input functions~ - Inside source: true *** True Line Result - args.state.result_border.h = args.state.sprite_size -** Processing line: ~~ + #Input functions +** Processing line: ~ def input~ - Inside source: true *** True Line Result - -** Processing line: ~ # initialize items for the first time if they are nil~ + def input +** Processing line: ~ input_move_cyan~ - Inside source: true *** True Line Result - # initialize items for the first time if they are nil -** Processing line: ~ # you start with 15 wood, 1 chest, and 5 plank~ + input_move_cyan +** Processing line: ~ input_move_magenta~ - Inside source: true *** True Line Result - # you start with 15 wood, 1 chest, and 5 plank -** Processing line: ~ # Ruby has built in syntax for dictionaries (they look a lot like json objects).~ + input_move_magenta +** Processing line: ~~ - Inside source: true *** True Line Result - # Ruby has built in syntax for dictionaries (they look a lot like json objects). -** Processing line: ~ # Ruby also has a special type called a Symbol denoted with a : followed by a word.~ + +** Processing line: ~ if inputs.keyboard.key_down.t~ - Inside source: true *** True Line Result - # Ruby also has a special type called a Symbol denoted with a : followed by a word. -** Processing line: ~ # Symbols are nice because they remove the need for magic strings.~ + if inputs.keyboard.key_down.t +** Processing line: ~ add_trauma(0.5)~ - Inside source: true *** True Line Result - # Symbols are nice because they remove the need for magic strings. -** Processing line: ~ if !args.state.items~ + add_trauma(0.5) +** Processing line: ~ elsif inputs.keyboard.key_down.y~ - Inside source: true *** True Line Result - if !args.state.items -** Processing line: ~ args.state.items = [~ + elsif inputs.keyboard.key_down.y +** Processing line: ~ remove_trauma(0.1)~ - Inside source: true *** True Line Result - args.state.items = [ -** Processing line: ~ {~ + remove_trauma(0.1) +** Processing line: ~ end~ - Inside source: true *** True Line Result - { -** Processing line: ~ id: :wood, # :wood is a Symbol, this is better than using "wood" for the id~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - id: :wood, # :wood is a Symbol, this is better than using "wood" for the id -** Processing line: ~ quantity: 15,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - quantity: 15, -** Processing line: ~ path: 'sprites/wood.png',~ + +** Processing line: ~ def input_move_cyan~ - Inside source: true *** True Line Result - path: 'sprites/wood.png', -** Processing line: ~ location: :inventory,~ + def input_move_cyan +** Processing line: ~ if inputs.keyboard.key_held.up~ - Inside source: true *** True Line Result - location: :inventory, -** Processing line: ~ ordinal_x: 0, ordinal_y: 0~ + if inputs.keyboard.key_held.up +** Processing line: ~ state.player_cyan.dy = 5~ - Inside source: true *** True Line Result - ordinal_x: 0, ordinal_y: 0 -** Processing line: ~ },~ + state.player_cyan.dy = 5 +** Processing line: ~ state.player_cyan.orientation = "up"~ - Inside source: true *** True Line Result - }, -** Processing line: ~ {~ + state.player_cyan.orientation = "up" +** Processing line: ~ elsif inputs.keyboard.key_held.down~ - Inside source: true *** True Line Result - { -** Processing line: ~ id: :chest,~ + elsif inputs.keyboard.key_held.down +** Processing line: ~ state.player_cyan.dy = -5~ - Inside source: true *** True Line Result - id: :chest, -** Processing line: ~ quantity: 1,~ + state.player_cyan.dy = -5 +** Processing line: ~ state.player_cyan.orientation = "down"~ - Inside source: true *** True Line Result - quantity: 1, -** Processing line: ~ path: 'sprites/chest.png',~ + state.player_cyan.orientation = "down" +** Processing line: ~ else~ - Inside source: true *** True Line Result - path: 'sprites/chest.png', -** Processing line: ~ location: :inventory,~ + else +** Processing line: ~ state.player_cyan.dy *= 0.8~ - Inside source: true *** True Line Result - location: :inventory, -** Processing line: ~ ordinal_x: 1, ordinal_y: 0~ + state.player_cyan.dy *= 0.8 +** Processing line: ~ end~ - Inside source: true *** True Line Result - ordinal_x: 1, ordinal_y: 0 -** Processing line: ~ },~ + end +** Processing line: ~ if inputs.keyboard.key_held.left~ - Inside source: true *** True Line Result - }, -** Processing line: ~ {~ + if inputs.keyboard.key_held.left +** Processing line: ~ state.player_cyan.dx = -5~ - Inside source: true *** True Line Result - { -** Processing line: ~ id: :plank,~ + state.player_cyan.dx = -5 +** Processing line: ~ state.player_cyan.orientation = "left"~ - Inside source: true *** True Line Result - id: :plank, -** Processing line: ~ quantity: 5,~ + state.player_cyan.orientation = "left" +** Processing line: ~ elsif inputs.keyboard.key_held.right~ - Inside source: true *** True Line Result - quantity: 5, -** Processing line: ~ path: 'sprites/plank.png',~ + elsif inputs.keyboard.key_held.right +** Processing line: ~ state.player_cyan.dx = 5~ - Inside source: true *** True Line Result - path: 'sprites/plank.png', -** Processing line: ~ location: :inventory,~ + state.player_cyan.dx = 5 +** Processing line: ~ state.player_cyan.orientation = "right"~ - Inside source: true *** True Line Result - location: :inventory, -** Processing line: ~ ordinal_x: 2, ordinal_y: 0~ + state.player_cyan.orientation = "right" +** Processing line: ~ else~ - Inside source: true *** True Line Result - ordinal_x: 2, ordinal_y: 0 -** Processing line: ~ },~ + else +** Processing line: ~ state.player_cyan.dx *= 0.8~ - Inside source: true *** True Line Result - }, -** Processing line: ~ ]~ + state.player_cyan.dx *= 0.8 +** Processing line: ~ end~ - Inside source: true *** True Line Result - ] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # after initializing the oridinal positions, derive the pixel~ -- Inside source: true -*** True Line Result - # after initializing the oridinal positions, derive the pixel -** Processing line: ~ # locations assuming that the width and height are 80~ +** Processing line: ~ outputs.labels << [128,512,"#{state.player_cyan.x.round()}",8,2,0,255,255,255]~ - Inside source: true *** True Line Result - # locations assuming that the width and height are 80 -** Processing line: ~ args.state.items.each { |item| set_inventory_position args, item }~ + outputs.labels << [128,512,"#{state.player_cyan.x.round()}",8,2,0,255,255,255] +** Processing line: ~ outputs.labels << [128,480,"#{state.player_cyan.y.round()}",8,2,0,255,255,255]~ - Inside source: true *** True Line Result - args.state.items.each { |item| set_inventory_position args, item } + outputs.labels << [128,480,"#{state.player_cyan.y.round()}",8,2,0,255,255,255] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -47855,346 +51096,346 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # define all the oridinal positions of the inventory slots~ +** Processing line: ~ def input_move_magenta~ - Inside source: true *** True Line Result - # define all the oridinal positions of the inventory slots -** Processing line: ~ if !args.state.inventory_area~ + def input_move_magenta +** Processing line: ~ if inputs.keyboard.key_held.w~ - Inside source: true *** True Line Result - if !args.state.inventory_area -** Processing line: ~ args.state.inventory_area = [~ + if inputs.keyboard.key_held.w +** Processing line: ~ state.player_magenta.dy = 5~ - Inside source: true *** True Line Result - args.state.inventory_area = [ -** Processing line: ~ { ordinal_x: 0, ordinal_y: 0 },~ + state.player_magenta.dy = 5 +** Processing line: ~ state.player_magenta.orientation = "up"~ - Inside source: true *** True Line Result - { ordinal_x: 0, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 1, ordinal_y: 0 },~ + state.player_magenta.orientation = "up" +** Processing line: ~ elsif inputs.keyboard.key_held.s~ - Inside source: true *** True Line Result - { ordinal_x: 1, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 2, ordinal_y: 0 },~ + elsif inputs.keyboard.key_held.s +** Processing line: ~ state.player_magenta.dy = -5~ - Inside source: true *** True Line Result - { ordinal_x: 2, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 3, ordinal_y: 0 },~ + state.player_magenta.dy = -5 +** Processing line: ~ state.player_magenta.orientation = "down"~ - Inside source: true *** True Line Result - { ordinal_x: 3, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 4, ordinal_y: 0 },~ + state.player_magenta.orientation = "down" +** Processing line: ~ else~ - Inside source: true *** True Line Result - { ordinal_x: 4, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 5, ordinal_y: 0 },~ + else +** Processing line: ~ state.player_magenta.dy *= 0.8~ - Inside source: true *** True Line Result - { ordinal_x: 5, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 6, ordinal_y: 0 },~ + state.player_magenta.dy *= 0.8 +** Processing line: ~ end~ - Inside source: true *** True Line Result - { ordinal_x: 6, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 7, ordinal_y: 0 },~ + end +** Processing line: ~ if inputs.keyboard.key_held.a~ - Inside source: true *** True Line Result - { ordinal_x: 7, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 8, ordinal_y: 0 },~ + if inputs.keyboard.key_held.a +** Processing line: ~ state.player_magenta.dx = -5~ - Inside source: true *** True Line Result - { ordinal_x: 8, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 9, ordinal_y: 0 },~ + state.player_magenta.dx = -5 +** Processing line: ~ state.player_magenta.orientation = "left"~ - Inside source: true *** True Line Result - { ordinal_x: 9, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 0, ordinal_y: 1 },~ + state.player_magenta.orientation = "left" +** Processing line: ~ elsif inputs.keyboard.key_held.d~ - Inside source: true *** True Line Result - { ordinal_x: 0, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 1, ordinal_y: 1 },~ + elsif inputs.keyboard.key_held.d +** Processing line: ~ state.player_magenta.dx = 5~ - Inside source: true *** True Line Result - { ordinal_x: 1, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 2, ordinal_y: 1 },~ + state.player_magenta.dx = 5 +** Processing line: ~ state.player_magenta.orientation = "right"~ - Inside source: true *** True Line Result - { ordinal_x: 2, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 3, ordinal_y: 1 },~ + state.player_magenta.orientation = "right" +** Processing line: ~ else~ - Inside source: true *** True Line Result - { ordinal_x: 3, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 4, ordinal_y: 1 },~ + else +** Processing line: ~ state.player_magenta.dx *= 0.8~ - Inside source: true *** True Line Result - { ordinal_x: 4, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 5, ordinal_y: 1 },~ + state.player_magenta.dx *= 0.8 +** Processing line: ~ end~ - Inside source: true *** True Line Result - { ordinal_x: 5, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 6, ordinal_y: 1 },~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - { ordinal_x: 6, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 7, ordinal_y: 1 },~ + +** Processing line: ~ outputs.labels << [128,360,"#{state.player_magenta.x.round()}",8,2,255,0,255,255]~ - Inside source: true *** True Line Result - { ordinal_x: 7, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 8, ordinal_y: 1 },~ + outputs.labels << [128,360,"#{state.player_magenta.x.round()}",8,2,255,0,255,255] +** Processing line: ~ outputs.labels << [128,328,"#{state.player_magenta.y.round()}",8,2,255,0,255,255]~ - Inside source: true *** True Line Result - { ordinal_x: 8, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 9, ordinal_y: 1 },~ + outputs.labels << [128,328,"#{state.player_magenta.y.round()}",8,2,255,0,255,255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - { ordinal_x: 9, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 0, ordinal_y: 2 },~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - { ordinal_x: 0, ordinal_y: 2 }, -** Processing line: ~ { ordinal_x: 1, ordinal_y: 2 },~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - { ordinal_x: 1, ordinal_y: 2 }, -** Processing line: ~ { ordinal_x: 2, ordinal_y: 2 },~ + +** Processing line: ~ $camera_movement = CameraMovement.new~ - Inside source: true *** True Line Result - { ordinal_x: 2, ordinal_y: 2 }, -** Processing line: ~ { ordinal_x: 3, ordinal_y: 2 },~ + $camera_movement = CameraMovement.new +** Processing line: ~~ - Inside source: true *** True Line Result - { ordinal_x: 3, ordinal_y: 2 }, -** Processing line: ~ { ordinal_x: 4, ordinal_y: 2 },~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - { ordinal_x: 4, ordinal_y: 2 }, -** Processing line: ~ { ordinal_x: 5, ordinal_y: 2 },~ + def tick args +** Processing line: ~ args.outputs.background_color = [0,0,0]~ - Inside source: true *** True Line Result - { ordinal_x: 5, ordinal_y: 2 }, -** Processing line: ~ { ordinal_x: 6, ordinal_y: 2 },~ + args.outputs.background_color = [0,0,0] +** Processing line: ~ $camera_movement.inputs = args.inputs~ - Inside source: true *** True Line Result - { ordinal_x: 6, ordinal_y: 2 }, -** Processing line: ~ { ordinal_x: 7, ordinal_y: 2 },~ + $camera_movement.inputs = args.inputs +** Processing line: ~ $camera_movement.outputs = args.outputs~ - Inside source: true *** True Line Result - { ordinal_x: 7, ordinal_y: 2 }, -** Processing line: ~ { ordinal_x: 8, ordinal_y: 2 },~ + $camera_movement.outputs = args.outputs +** Processing line: ~ $camera_movement.state = args.state~ - Inside source: true *** True Line Result - { ordinal_x: 8, ordinal_y: 2 }, -** Processing line: ~ { ordinal_x: 9, ordinal_y: 2 },~ + $camera_movement.state = args.state +** Processing line: ~ $camera_movement.grid = args.grid~ - Inside source: true *** True Line Result - { ordinal_x: 9, ordinal_y: 2 }, -** Processing line: ~ ]~ + $camera_movement.grid = args.grid +** Processing line: ~ $camera_movement.tick~ - Inside source: true *** True Line Result - ] + $camera_movement.tick +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # after initializing the oridinal positions, derive the pixel~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - # after initializing the oridinal positions, derive the pixel -** Processing line: ~ # locations assuming that the width and height are 80~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - # locations assuming that the width and height are 80 -** Processing line: ~ args.state.inventory_area.each { |i| set_inventory_position args, i }~ -- Inside source: true + +** Processing line: ~*** Advanced Rendering - Z Targeting Camera - main.rb~ +- Header detected. *** True Line Result - args.state.inventory_area.each { |i| set_inventory_position args, i } -** Processing line: ~~ -- Inside source: true + +*** True Line Result +*** Advanced Rendering - Z Targeting Camera - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ # if you want to see the result you can use the Ruby function called "puts".~ +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/07_advanced_rendering/08_z_targeting_camera/app/main.rb~ - Inside source: true *** True Line Result - # if you want to see the result you can use the Ruby function called "puts". -** Processing line: ~ # Uncomment this line to see the value.~ + # ./samples/07_advanced_rendering/08_z_targeting_camera/app/main.rb +** Processing line: ~ class Game~ - Inside source: true *** True Line Result - # Uncomment this line to see the value. -** Processing line: ~ # puts args.state.inventory_area~ + class Game +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - # puts args.state.inventory_area + attr_gtk ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # You can see all things written via puts in DragonRuby's Console, or under logs/log.txt.~ -- Inside source: true -*** True Line Result - # You can see all things written via puts in DragonRuby's Console, or under logs/log.txt. -** Processing line: ~ # To bring up DragonRuby's Console, press the ~ key within the game.~ +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - # To bring up DragonRuby's Console, press the ~ key within the game. -** Processing line: ~ end~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + defaults +** Processing line: ~ render~ - Inside source: true *** True Line Result - -** Processing line: ~ # define all the oridinal positions of the craft slots~ + render +** Processing line: ~ input~ - Inside source: true *** True Line Result - # define all the oridinal positions of the craft slots -** Processing line: ~ if !args.state.craft_area~ + input +** Processing line: ~ calc~ - Inside source: true *** True Line Result - if !args.state.craft_area -** Processing line: ~ args.state.craft_area = [~ + calc +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.craft_area = [ -** Processing line: ~ { ordinal_x: 0, ordinal_y: 0 },~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - { ordinal_x: 0, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 0, ordinal_y: 1 },~ + +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - { ordinal_x: 0, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 0, ordinal_y: 2 },~ + def defaults +** Processing line: ~ outputs.background_color = [219, 208, 191]~ - Inside source: true *** True Line Result - { ordinal_x: 0, ordinal_y: 2 }, -** Processing line: ~ { ordinal_x: 1, ordinal_y: 0 },~ + outputs.background_color = [219, 208, 191] +** Processing line: ~ player.x ||= 634~ - Inside source: true *** True Line Result - { ordinal_x: 1, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 1, ordinal_y: 1 },~ + player.x ||= 634 +** Processing line: ~ player.y ||= 153~ - Inside source: true *** True Line Result - { ordinal_x: 1, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 1, ordinal_y: 2 },~ + player.y ||= 153 +** Processing line: ~ player.angle ||= 90~ - Inside source: true *** True Line Result - { ordinal_x: 1, ordinal_y: 2 }, -** Processing line: ~ { ordinal_x: 2, ordinal_y: 0 },~ + player.angle ||= 90 +** Processing line: ~ player.distance ||= arena_radius~ - Inside source: true *** True Line Result - { ordinal_x: 2, ordinal_y: 0 }, -** Processing line: ~ { ordinal_x: 2, ordinal_y: 1 },~ + player.distance ||= arena_radius +** Processing line: ~ target.x ||= 634~ - Inside source: true *** True Line Result - { ordinal_x: 2, ordinal_y: 1 }, -** Processing line: ~ { ordinal_x: 2, ordinal_y: 2 },~ + target.x ||= 634 +** Processing line: ~ target.y ||= 359~ - Inside source: true *** True Line Result - { ordinal_x: 2, ordinal_y: 2 }, -** Processing line: ~ ]~ + target.y ||= 359 +** Processing line: ~ end~ - Inside source: true *** True Line Result - ] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # after initializing the oridinal positions, derive the pixel~ +** Processing line: ~ def render~ - Inside source: true *** True Line Result - # after initializing the oridinal positions, derive the pixel -** Processing line: ~ # locations assuming that the width and height are 80~ + def render +** Processing line: ~ outputs[:scene].sprites << ([0, 0, 933, 700, 'sprites/arena.png'].center_inside_rect grid.rect)~ - Inside source: true *** True Line Result - # locations assuming that the width and height are 80 -** Processing line: ~ args.state.craft_area.each { |c| set_craft_position args, c }~ + outputs[:scene].sprites << ([0, 0, 933, 700, 'sprites/arena.png'].center_inside_rect grid.rect) +** Processing line: ~ outputs[:scene].sprites << target_sprite~ - Inside source: true *** True Line Result - args.state.craft_area.each { |c| set_craft_position args, c } -** Processing line: ~ end~ + outputs[:scene].sprites << target_sprite +** Processing line: ~ outputs[:scene].sprites << player_sprite~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + outputs[:scene].sprites << player_sprite +** Processing line: ~ outputs.sprites << scene~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.sprites << scene +** Processing line: ~ end~ - Inside source: true *** True Line Result - + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render args~ +** Processing line: ~ def target_sprite~ - Inside source: true *** True Line Result - def render args -** Processing line: ~ # for the results area, create a sprite that show its boundaries~ + def target_sprite +** Processing line: ~ {~ - Inside source: true *** True Line Result - # for the results area, create a sprite that show its boundaries -** Processing line: ~ args.outputs.primitives << { x: args.state.result_border.x,~ + { +** Processing line: ~ x: target.x, y: target.y,~ - Inside source: true *** True Line Result - args.outputs.primitives << { x: args.state.result_border.x, -** Processing line: ~ y: args.state.result_border.y,~ + x: target.x, y: target.y, +** Processing line: ~ w: 10, h: 10,~ - Inside source: true *** True Line Result - y: args.state.result_border.y, -** Processing line: ~ w: args.state.result_border.w,~ + w: 10, h: 10, +** Processing line: ~ path: 'sprites/square/black.png'~ - Inside source: true *** True Line Result - w: args.state.result_border.w, -** Processing line: ~ h: args.state.result_border.h,~ + path: 'sprites/square/black.png' +** Processing line: ~ }.anchor_rect 0.5, 0.5~ - Inside source: true *** True Line Result - h: args.state.result_border.h, -** Processing line: ~ path: 'sprites/border-black.png' }~ + }.anchor_rect 0.5, 0.5 +** Processing line: ~ end~ - Inside source: true *** True Line Result - path: 'sprites/border-black.png' } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # for each inventory spot, create a sprite~ -- Inside source: true -*** True Line Result - # for each inventory spot, create a sprite -** Processing line: ~ # args.outputs.primitives is how DragonRuby performs a render.~ +** Processing line: ~ def input~ - Inside source: true *** True Line Result - # args.outputs.primitives is how DragonRuby performs a render. -** Processing line: ~ # Adding a single hash or multiple hashes to this array will tell~ + def input +** Processing line: ~ if inputs.up && player.distance > 30~ - Inside source: true *** True Line Result - # Adding a single hash or multiple hashes to this array will tell -** Processing line: ~ # DragonRuby to render those primitives on that frame.~ + if inputs.up && player.distance > 30 +** Processing line: ~ player.distance -= 2~ - Inside source: true *** True Line Result - # DragonRuby to render those primitives on that frame. -** Processing line: ~~ + player.distance -= 2 +** Processing line: ~ elsif inputs.down && player.distance < 200~ - Inside source: true *** True Line Result - -** Processing line: ~ # The .map function on Array is used instead of any kind of looping.~ + elsif inputs.down && player.distance < 200 +** Processing line: ~ player.distance += 2~ - Inside source: true *** True Line Result - # The .map function on Array is used instead of any kind of looping. -** Processing line: ~ # .map returns a new object for every object within an Array.~ + player.distance += 2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - # .map returns a new object for every object within an Array. -** Processing line: ~ args.outputs.primitives << args.state.inventory_area.map do |a|~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.outputs.primitives << args.state.inventory_area.map do |a| -** Processing line: ~ { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' }~ + +** Processing line: ~ player.angle += inputs.left_right * -1~ - Inside source: true *** True Line Result - { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' } + player.angle += inputs.left_right * -1 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -48203,18 +51444,18 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # for each craft spot, create a sprite~ +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - # for each craft spot, create a sprite -** Processing line: ~ args.outputs.primitives << args.state.craft_area.map do |a|~ + def calc +** Processing line: ~ player.x = target.x + ((player.angle * 1).vector_x player.distance)~ - Inside source: true *** True Line Result - args.outputs.primitives << args.state.craft_area.map do |a| -** Processing line: ~ { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' }~ + player.x = target.x + ((player.angle * 1).vector_x player.distance) +** Processing line: ~ player.y = target.y + ((player.angle * -1).vector_y player.distance)~ - Inside source: true *** True Line Result - { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' } + player.y = target.y + ((player.angle * -1).vector_y player.distance) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -48223,66 +51464,58 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # after the borders have been rendered, render the~ +** Processing line: ~ def player_sprite~ - Inside source: true *** True Line Result - # after the borders have been rendered, render the -** Processing line: ~ # items within those slots (and allow for highlighting)~ + def player_sprite +** Processing line: ~ {~ - Inside source: true *** True Line Result - # items within those slots (and allow for highlighting) -** Processing line: ~ # if an item isn't currently being held~ + { +** Processing line: ~ x: player.x,~ - Inside source: true *** True Line Result - # if an item isn't currently being held -** Processing line: ~ allow_inventory_highlighting = !args.state.held_item~ + x: player.x, +** Processing line: ~ y: player.y,~ - Inside source: true *** True Line Result - allow_inventory_highlighting = !args.state.held_item -** Processing line: ~~ + y: player.y, +** Processing line: ~ w: 50,~ - Inside source: true *** True Line Result - -** Processing line: ~ # go through each item and render them~ + w: 50, +** Processing line: ~ h: 100,~ - Inside source: true *** True Line Result - # go through each item and render them -** Processing line: ~ # use Array's find_all method to remove any items that are currently being held~ + h: 100, +** Processing line: ~ path: 'sprites/player.png',~ - Inside source: true *** True Line Result - # use Array's find_all method to remove any items that are currently being held -** Processing line: ~ args.state.items.find_all { |item| item[:location] != :held }.map do |item|~ + path: 'sprites/player.png', +** Processing line: ~ angle: (player.angle * -1) + 90~ - Inside source: true *** True Line Result - args.state.items.find_all { |item| item[:location] != :held }.map do |item| -** Processing line: ~ # if an item is currently being held, don't render it in it's spot within the~ + angle: (player.angle * -1) + 90 +** Processing line: ~ }.anchor_rect 0.5, 0~ - Inside source: true *** True Line Result - # if an item is currently being held, don't render it in it's spot within the -** Processing line: ~ # inventory or craft area (this is handled via the find_all method).~ + }.anchor_rect 0.5, 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - # inventory or craft area (this is handled via the find_all method). + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # the item_prefab returns a hash containing all the visual components of an item.~ -- Inside source: true -*** True Line Result - # the item_prefab returns a hash containing all the visual components of an item. -** Processing line: ~ # the main sprite, the black background, the quantity text, and a hover indication~ -- Inside source: true -*** True Line Result - # the main sprite, the black background, the quantity text, and a hover indication -** Processing line: ~ # if the mouse is currently hovering over the item.~ +** Processing line: ~ def center_map~ - Inside source: true *** True Line Result - # if the mouse is currently hovering over the item. -** Processing line: ~ args.outputs.primitives << item_prefab(args, item, allow_inventory_highlighting, args.inputs.mouse)~ + def center_map +** Processing line: ~ { x: 634, y: 359 }~ - Inside source: true *** True Line Result - args.outputs.primitives << item_prefab(args, item, allow_inventory_highlighting, args.inputs.mouse) + { x: 634, y: 359 } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -48291,590 +51524,602 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # The last thing we want to render is the item currently being held.~ +** Processing line: ~ def zoom_factor_single~ - Inside source: true *** True Line Result - # The last thing we want to render is the item currently being held. -** Processing line: ~ args.outputs.primitives << item_prefab(args, args.state.held_item, allow_inventory_highlighting, args.inputs.mouse)~ + def zoom_factor_single +** Processing line: ~ 2 - ((args.geometry.distance player, center_map).fdiv arena_radius)~ - Inside source: true *** True Line Result - args.outputs.primitives << item_prefab(args, args.state.held_item, allow_inventory_highlighting, args.inputs.mouse) + 2 - ((args.geometry.distance player, center_map).fdiv arena_radius) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.primitives << args.state.click_ripples~ +** Processing line: ~ def zoom_factor~ - Inside source: true *** True Line Result - args.outputs.primitives << args.state.click_ripples + def zoom_factor +** Processing line: ~ zoom_factor_single ** 2~ +- Inside source: true +*** True Line Result + zoom_factor_single ** 2 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # render a mouse cursor since we have the OS cursor hidden~ +** Processing line: ~ def arena_radius~ - Inside source: true *** True Line Result - # render a mouse cursor since we have the OS cursor hidden -** Processing line: ~ args.outputs.primitives << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 }~ + def arena_radius +** Processing line: ~ 206~ - Inside source: true *** True Line Result - args.outputs.primitives << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 } -** Processing line: ~ end~ + 206 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Alrighty! This is where all the fun happens~ +** Processing line: ~ def scene~ - Inside source: true *** True Line Result - # Alrighty! This is where all the fun happens -** Processing line: ~ def input args~ + def scene +** Processing line: ~ {~ - Inside source: true *** True Line Result - def input args -** Processing line: ~ # if the mouse is clicked and not item is currently being held~ + { +** Processing line: ~ x: (640 - player.x) + (640 - (640 * zoom_factor)),~ - Inside source: true *** True Line Result - # if the mouse is clicked and not item is currently being held -** Processing line: ~ # args.state.held_item is nil when the game starts.~ + x: (640 - player.x) + (640 - (640 * zoom_factor)), +** Processing line: ~ y: (360 - player.y - (75 * zoom_factor)) + (320 - (320 * zoom_factor)),~ - Inside source: true *** True Line Result - # args.state.held_item is nil when the game starts. -** Processing line: ~ # If the player clicks, the property args.inputs.mouse.click will~ + y: (360 - player.y - (75 * zoom_factor)) + (320 - (320 * zoom_factor)), +** Processing line: ~ w: 1280 * zoom_factor,~ - Inside source: true *** True Line Result - # If the player clicks, the property args.inputs.mouse.click will -** Processing line: ~ # be a non nil value, we don't want to process any of the code here~ + w: 1280 * zoom_factor, +** Processing line: ~ h: 720 * zoom_factor,~ - Inside source: true *** True Line Result - # be a non nil value, we don't want to process any of the code here -** Processing line: ~ # if the mouse hasn't been clicked~ + h: 720 * zoom_factor, +** Processing line: ~ path: :scene,~ - Inside source: true *** True Line Result - # if the mouse hasn't been clicked -** Processing line: ~ return if !args.inputs.mouse.click~ + path: :scene, +** Processing line: ~ angle: player.angle - 90,~ - Inside source: true *** True Line Result - return if !args.inputs.mouse.click -** Processing line: ~~ + angle: player.angle - 90, +** Processing line: ~ angle_anchor_x: (player.x.fdiv 1280),~ - Inside source: true *** True Line Result - -** Processing line: ~ # if a click occurred, add a ripple to the ripple queue~ + angle_anchor_x: (player.x.fdiv 1280), +** Processing line: ~ angle_anchor_y: (player.y.fdiv 720)~ - Inside source: true *** True Line Result - # if a click occurred, add a ripple to the ripple queue -** Processing line: ~ args.state.click_ripples << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 }~ + angle_anchor_y: (player.y.fdiv 720) +** Processing line: ~ }~ - Inside source: true *** True Line Result - args.state.click_ripples << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 } -** Processing line: ~~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # if the mouse has been clicked, and no item is currently held...~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # if the mouse has been clicked, and no item is currently held... -** Processing line: ~ if !args.state.held_item~ + +** Processing line: ~ def player~ - Inside source: true *** True Line Result - if !args.state.held_item -** Processing line: ~ # see if any of the items intersect the pointer using the inside_rect? method~ + def player +** Processing line: ~ state.player~ - Inside source: true *** True Line Result - # see if any of the items intersect the pointer using the inside_rect? method -** Processing line: ~ # the find method will either return the first object that returns true~ + state.player +** Processing line: ~ end~ - Inside source: true *** True Line Result - # the find method will either return the first object that returns true -** Processing line: ~ # for the match clause, or it'll return nil if nothing matches the match clause~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # for the match clause, or it'll return nil if nothing matches the match clause -** Processing line: ~ found = args.state.items.find do |item|~ + +** Processing line: ~ def target~ - Inside source: true *** True Line Result - found = args.state.items.find do |item| -** Processing line: ~ # for each item in args.state.items, run the following boolean check~ + def target +** Processing line: ~ state.target~ - Inside source: true *** True Line Result - # for each item in args.state.items, run the following boolean check -** Processing line: ~ args.inputs.mouse.click.point.inside_rect?(item)~ + state.target +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.inputs.mouse.click.point.inside_rect?(item) -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if an item intersects the mouse pointer, then set the item's location to :held and~ -- Inside source: true -*** True Line Result - # if an item intersects the mouse pointer, then set the item's location to :held and -** Processing line: ~ # set args.state.held_item to the item for later reference~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # set args.state.held_item to the item for later reference -** Processing line: ~ if found~ + def tick args +** Processing line: ~ $game ||= Game.new~ - Inside source: true *** True Line Result - if found -** Processing line: ~ args.state.held_item = found~ + $game ||= Game.new +** Processing line: ~ $game.args = args~ - Inside source: true *** True Line Result - args.state.held_item = found -** Processing line: ~ found[:location] = :held~ + $game.args = args +** Processing line: ~ $game.tick~ - Inside source: true *** True Line Result - found[:location] = :held -** Processing line: ~ end~ + $game.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if the mouse is clicked and an item is currently beign held....~ -- Inside source: true -*** True Line Result - # if the mouse is clicked and an item is currently beign held.... -** Processing line: ~ elsif args.state.held_item~ +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - elsif args.state.held_item -** Processing line: ~ # determine if a slot within the craft area was clicked~ + $gtk.reset +** Processing line: ~~ - Inside source: true *** True Line Result - # determine if a slot within the craft area was clicked -** Processing line: ~ craft_area = args.state.craft_area.find { |a| args.inputs.mouse.click.point.inside_rect? a }~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - craft_area = args.state.craft_area.find { |a| args.inputs.mouse.click.point.inside_rect? a } +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ # also determine if a slot within the inventory area was clicked~ -- Inside source: true +** Processing line: ~*** Tweening Lerping Easing Functions - Easing Functions - main.rb~ +- Header detected. *** True Line Result - # also determine if a slot within the inventory area was clicked -** Processing line: ~ inventory_area = args.state.inventory_area.find { |a| args.inputs.mouse.click.point.inside_rect? a }~ -- Inside source: true + *** True Line Result - inventory_area = args.state.inventory_area.find { |a| args.inputs.mouse.click.point.inside_rect? a } -** Processing line: ~~ -- Inside source: true +*** Tweening Lerping Easing Functions - Easing Functions - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ # if the click was within a craft area~ -- Inside source: true *** True Line Result - # if the click was within a craft area -** Processing line: ~ if craft_area~ +#+begin_src ruby +** Processing line: ~ # ./samples/08_tweening_lerping_easing_functions/01_easing_functions/app/main.rb~ - Inside source: true *** True Line Result - if craft_area -** Processing line: ~ # check to see if an item is already there and ignore the click if an item is found~ + # ./samples/08_tweening_lerping_easing_functions/01_easing_functions/app/main.rb +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # check to see if an item is already there and ignore the click if an item is found -** Processing line: ~ # item_at_craft_slot is a helper method that returns an item or nil for a given oridinal~ + def tick args +** Processing line: ~ # STOP! Watch the following presentation first!!!!~ - Inside source: true *** True Line Result - # item_at_craft_slot is a helper method that returns an item or nil for a given oridinal -** Processing line: ~ # position~ + # STOP! Watch the following presentation first!!!! +** Processing line: ~ # Math for Game Programmers: Fast and Funky 1D Nonlinear Transformations~ - Inside source: true *** True Line Result - # position -** Processing line: ~ item_already_there = item_at_craft_slot args, craft_area[:ordinal_x], craft_area[:ordinal_y]~ + # Math for Game Programmers: Fast and Funky 1D Nonlinear Transformations +** Processing line: ~ # https://www.youtube.com/watch?v=mr5xkf6zSzk~ - Inside source: true *** True Line Result - item_already_there = item_at_craft_slot args, craft_area[:ordinal_x], craft_area[:ordinal_y] + # https://www.youtube.com/watch?v=mr5xkf6zSzk ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if an item *doesn't* exist in the craft area~ -- Inside source: true -*** True Line Result - # if an item *doesn't* exist in the craft area -** Processing line: ~ if !item_already_there~ +** Processing line: ~ # You've watched the talk, yes? YES???~ - Inside source: true *** True Line Result - if !item_already_there -** Processing line: ~ # if the quantity they are currently holding is greater than 1~ + # You've watched the talk, yes? YES??? +** Processing line: ~~ - Inside source: true *** True Line Result - # if the quantity they are currently holding is greater than 1 -** Processing line: ~ if args.state.held_item[:quantity] > 1~ + +** Processing line: ~ # define starting and ending points of properties to animate~ - Inside source: true *** True Line Result - if args.state.held_item[:quantity] > 1 -** Processing line: ~ # remove one item (creating a seperate item of the same type), and place it~ + # define starting and ending points of properties to animate +** Processing line: ~ args.state.target_x = 1180~ - Inside source: true *** True Line Result - # remove one item (creating a seperate item of the same type), and place it -** Processing line: ~ # at the oridinal position and location of the craft area~ + args.state.target_x = 1180 +** Processing line: ~ args.state.target_y = 620~ - Inside source: true *** True Line Result - # at the oridinal position and location of the craft area -** Processing line: ~ # the .merge method on Hash creates a new Hash, but updates any values~ + args.state.target_y = 620 +** Processing line: ~ args.state.target_w = 100~ - Inside source: true *** True Line Result - # the .merge method on Hash creates a new Hash, but updates any values -** Processing line: ~ # passed as arguments to merge~ + args.state.target_w = 100 +** Processing line: ~ args.state.target_h = 100~ - Inside source: true *** True Line Result - # passed as arguments to merge -** Processing line: ~ new_item = args.state.held_item.merge(quantity: 1,~ + args.state.target_h = 100 +** Processing line: ~ args.state.starting_x = 0~ - Inside source: true *** True Line Result - new_item = args.state.held_item.merge(quantity: 1, -** Processing line: ~ location: :craft,~ + args.state.starting_x = 0 +** Processing line: ~ args.state.starting_y = 0~ - Inside source: true *** True Line Result - location: :craft, -** Processing line: ~ ordinal_x: craft_area[:ordinal_x],~ + args.state.starting_y = 0 +** Processing line: ~ args.state.starting_w = 300~ - Inside source: true *** True Line Result - ordinal_x: craft_area[:ordinal_x], -** Processing line: ~ ordinal_y: craft_area[:ordinal_y])~ + args.state.starting_w = 300 +** Processing line: ~ args.state.starting_h = 300~ - Inside source: true *** True Line Result - ordinal_y: craft_area[:ordinal_y]) + args.state.starting_h = 300 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # after the item is crated, place it into the args.state.items collection~ +** Processing line: ~ # define start time and duration of animation~ - Inside source: true *** True Line Result - # after the item is crated, place it into the args.state.items collection -** Processing line: ~ args.state.items << new_item~ + # define start time and duration of animation +** Processing line: ~ args.state.start_animate_at = 3.seconds # this is the same as writing 60 * 5 (or 300)~ - Inside source: true *** True Line Result - args.state.items << new_item + args.state.start_animate_at = 3.seconds # this is the same as writing 60 * 5 (or 300) +** Processing line: ~ args.state.duration = 2.seconds # this is the same as writing 60 * 2 (or 120)~ +- Inside source: true +*** True Line Result + args.state.duration = 2.seconds # this is the same as writing 60 * 2 (or 120) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # then subtract one from the held item~ +** Processing line: ~ # define type of animations~ - Inside source: true *** True Line Result - # then subtract one from the held item -** Processing line: ~ args.state.held_item[:quantity] -= 1~ + # define type of animations +** Processing line: ~ # Here are all the options you have for values you can put in the array:~ - Inside source: true *** True Line Result - args.state.held_item[:quantity] -= 1 + # Here are all the options you have for values you can put in the array: +** Processing line: ~ # :identity, :quad, :cube, :quart, :quint, :flip~ +- Inside source: true +*** True Line Result + # :identity, :quad, :cube, :quart, :quint, :flip ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if the craft area is available and there is only one item being held~ +** Processing line: ~ # Linear is defined as:~ - Inside source: true *** True Line Result - # if the craft area is available and there is only one item being held -** Processing line: ~ elsif args.state.held_item[:quantity] == 1~ + # Linear is defined as: +** Processing line: ~ # [:identity]~ - Inside source: true *** True Line Result - elsif args.state.held_item[:quantity] == 1 -** Processing line: ~ # instead of creating any new items just set the location of the held item~ + # [:identity] +** Processing line: ~ #~ - Inside source: true *** True Line Result - # instead of creating any new items just set the location of the held item -** Processing line: ~ # to the oridinal position of the craft area, and then nil out the~ + # +** Processing line: ~ # Smooth start variations are:~ - Inside source: true *** True Line Result - # to the oridinal position of the craft area, and then nil out the -** Processing line: ~ # held item state so that a new item can be picked up~ + # Smooth start variations are: +** Processing line: ~ # [:quad]~ - Inside source: true *** True Line Result - # held item state so that a new item can be picked up -** Processing line: ~ args.state.held_item[:location] = :craft~ + # [:quad] +** Processing line: ~ # [:cube]~ - Inside source: true *** True Line Result - args.state.held_item[:location] = :craft -** Processing line: ~ args.state.held_item[:ordinal_x] = craft_area[:ordinal_x]~ + # [:cube] +** Processing line: ~ # [:quart]~ - Inside source: true *** True Line Result - args.state.held_item[:ordinal_x] = craft_area[:ordinal_x] -** Processing line: ~ args.state.held_item[:ordinal_y] = craft_area[:ordinal_y]~ + # [:quart] +** Processing line: ~ # [:quint]~ - Inside source: true *** True Line Result - args.state.held_item[:ordinal_y] = craft_area[:ordinal_y] -** Processing line: ~ args.state.held_item = nil~ + # [:quint] +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.held_item = nil -** Processing line: ~ end~ + +** Processing line: ~ # Linear reversed, and smooth stop are the same as the animations defined above, but reversed:~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Linear reversed, and smooth stop are the same as the animations defined above, but reversed: +** Processing line: ~ # [:flip, :identity]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # [:flip, :identity] +** Processing line: ~ # [:flip, :quad, :flip]~ - Inside source: true *** True Line Result - -** Processing line: ~ # if the selected area is an inventory area (as opposed to within the craft area)~ + # [:flip, :quad, :flip] +** Processing line: ~ # [:flip, :cube, :flip]~ - Inside source: true *** True Line Result - # if the selected area is an inventory area (as opposed to within the craft area) -** Processing line: ~ elsif inventory_area~ + # [:flip, :cube, :flip] +** Processing line: ~ # [:flip, :quart, :flip]~ - Inside source: true *** True Line Result - elsif inventory_area + # [:flip, :quart, :flip] +** Processing line: ~ # [:flip, :quint, :flip]~ +- Inside source: true +*** True Line Result + # [:flip, :quint, :flip] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # check to see if there is already an item in that inventory slot~ +** Processing line: ~ # You can also do custom definitions. See the bottom of the file details~ - Inside source: true *** True Line Result - # check to see if there is already an item in that inventory slot -** Processing line: ~ # the item_at_inventory_slot helper method returns an item or nil~ + # You can also do custom definitions. See the bottom of the file details +** Processing line: ~ # on how to do that. I've defined a couple for you:~ - Inside source: true *** True Line Result - # the item_at_inventory_slot helper method returns an item or nil -** Processing line: ~ item_already_there = item_at_inventory_slot args, inventory_area[:ordinal_x], inventory_area[:ordinal_y]~ + # on how to do that. I've defined a couple for you: +** Processing line: ~ # [:smoothest_start]~ - Inside source: true *** True Line Result - item_already_there = item_at_inventory_slot args, inventory_area[:ordinal_x], inventory_area[:ordinal_y] + # [:smoothest_start] +** Processing line: ~ # [:smoothest_stop]~ +- Inside source: true +*** True Line Result + # [:smoothest_stop] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if there is already an item there, and the item types/id match~ +** Processing line: ~ # CHANGE THIS LINE TO ONE OF THE LINES ABOVE TO SEE VARIATIONS~ - Inside source: true *** True Line Result - # if there is already an item there, and the item types/id match -** Processing line: ~ if item_already_there && item_already_there[:id] == args.state.held_item[:id]~ + # CHANGE THIS LINE TO ONE OF THE LINES ABOVE TO SEE VARIATIONS +** Processing line: ~ args.state.animation_type = [:identity]~ - Inside source: true *** True Line Result - if item_already_there && item_already_there[:id] == args.state.held_item[:id] -** Processing line: ~ # then merge the item quantities~ + args.state.animation_type = [:identity] +** Processing line: ~ # args.state.animation_type = [:quad]~ - Inside source: true *** True Line Result - # then merge the item quantities -** Processing line: ~ held_quantity = args.state.held_item[:quantity]~ + # args.state.animation_type = [:quad] +** Processing line: ~ # args.state.animation_type = [:cube]~ - Inside source: true *** True Line Result - held_quantity = args.state.held_item[:quantity] -** Processing line: ~ item_already_there[:quantity] += held_quantity~ + # args.state.animation_type = [:cube] +** Processing line: ~ # args.state.animation_type = [:quart]~ - Inside source: true *** True Line Result - item_already_there[:quantity] += held_quantity -** Processing line: ~~ + # args.state.animation_type = [:quart] +** Processing line: ~ # args.state.animation_type = [:quint]~ - Inside source: true *** True Line Result - -** Processing line: ~ # remove the item being held from the items collection (since it's quantity is now 0)~ + # args.state.animation_type = [:quint] +** Processing line: ~ # args.state.animation_type = [:flip, :identity]~ - Inside source: true *** True Line Result - # remove the item being held from the items collection (since it's quantity is now 0) -** Processing line: ~ args.state.items.reject! { |i| i[:location] == :held }~ + # args.state.animation_type = [:flip, :identity] +** Processing line: ~ # args.state.animation_type = [:flip, :quad, :flip]~ - Inside source: true *** True Line Result - args.state.items.reject! { |i| i[:location] == :held } -** Processing line: ~~ + # args.state.animation_type = [:flip, :quad, :flip] +** Processing line: ~ # args.state.animation_type = [:flip, :cube, :flip]~ - Inside source: true *** True Line Result - -** Processing line: ~ # nil out the held_item so a new item can be picked up~ + # args.state.animation_type = [:flip, :cube, :flip] +** Processing line: ~ # args.state.animation_type = [:flip, :quart, :flip]~ - Inside source: true *** True Line Result - # nil out the held_item so a new item can be picked up -** Processing line: ~ args.state.held_item = nil~ + # args.state.animation_type = [:flip, :quart, :flip] +** Processing line: ~ # args.state.animation_type = [:flip, :quint, :flip]~ - Inside source: true *** True Line Result - args.state.held_item = nil -** Processing line: ~~ + # args.state.animation_type = [:flip, :quint, :flip] +** Processing line: ~ # args.state.animation_type = [:smoothest_start]~ - Inside source: true *** True Line Result - -** Processing line: ~ # if there currently isn't an item there, then put the held item in the slot~ + # args.state.animation_type = [:smoothest_start] +** Processing line: ~ # args.state.animation_type = [:smoothest_stop]~ - Inside source: true *** True Line Result - # if there currently isn't an item there, then put the held item in the slot -** Processing line: ~ elsif !item_already_there~ + # args.state.animation_type = [:smoothest_stop] +** Processing line: ~~ - Inside source: true *** True Line Result - elsif !item_already_there -** Processing line: ~ args.state.held_item[:location] = :inventory~ + +** Processing line: ~ # THIS IS WHERE THE MAGIC HAPPENS!~ - Inside source: true *** True Line Result - args.state.held_item[:location] = :inventory -** Processing line: ~ args.state.held_item[:ordinal_x] = inventory_area[:ordinal_x]~ + # THIS IS WHERE THE MAGIC HAPPENS! +** Processing line: ~ # Numeric#ease~ - Inside source: true *** True Line Result - args.state.held_item[:ordinal_x] = inventory_area[:ordinal_x] -** Processing line: ~ args.state.held_item[:ordinal_y] = inventory_area[:ordinal_y]~ + # Numeric#ease +** Processing line: ~ progress = args.state.start_animate_at.ease(args.state.duration, args.state.animation_type)~ - Inside source: true *** True Line Result - args.state.held_item[:ordinal_y] = inventory_area[:ordinal_y] + progress = args.state.start_animate_at.ease(args.state.duration, args.state.animation_type) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # nil out the held_item so a new item can be picked up~ +** Processing line: ~ # Numeric#ease needs to called:~ - Inside source: true *** True Line Result - # nil out the held_item so a new item can be picked up -** Processing line: ~ args.state.held_item = nil~ + # Numeric#ease needs to called: +** Processing line: ~ # 1. On the number that represents the point in time you want to start, and takes two parameters:~ - Inside source: true *** True Line Result - args.state.held_item = nil -** Processing line: ~ end~ + # 1. On the number that represents the point in time you want to start, and takes two parameters: +** Processing line: ~ # a. The first parameter is how long the animation should take.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # a. The first parameter is how long the animation should take. +** Processing line: ~ # b. The second parameter represents the functions that need to be called.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # b. The second parameter represents the functions that need to be called. +** Processing line: ~ #~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # +** Processing line: ~ # For example, if I wanted an animate to start 3 seconds in, and last for 10 seconds,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # For example, if I wanted an animate to start 3 seconds in, and last for 10 seconds, +** Processing line: ~ # and I want to animation to start fast and end slow, I would do:~ - Inside source: true *** True Line Result - -** Processing line: ~ # the calc method is executed after input~ + # and I want to animation to start fast and end slow, I would do: +** Processing line: ~ # (60 * 3).ease(60 * 10, :flip, :quint, :flip)~ - Inside source: true *** True Line Result - # the calc method is executed after input -** Processing line: ~ def calc args~ + # (60 * 3).ease(60 * 10, :flip, :quint, :flip) +** Processing line: ~~ - Inside source: true *** True Line Result - def calc args -** Processing line: ~ # make sure that the real position of the inventory~ + +** Processing line: ~ # initial value delta to the final value~ - Inside source: true *** True Line Result - # make sure that the real position of the inventory -** Processing line: ~ # items are updated every frame to ensure that they~ + # initial value delta to the final value +** Processing line: ~ calc_x = args.state.starting_x + (args.state.target_x - args.state.starting_x) * progress~ - Inside source: true *** True Line Result - # items are updated every frame to ensure that they -** Processing line: ~ # are placed correctly given their location and oridinal positions~ + calc_x = args.state.starting_x + (args.state.target_x - args.state.starting_x) * progress +** Processing line: ~ calc_y = args.state.starting_y + (args.state.target_y - args.state.starting_y) * progress~ - Inside source: true *** True Line Result - # are placed correctly given their location and oridinal positions -** Processing line: ~ # instead of using .map, here we use .each (since we are not returning a new item and just updating the items in place)~ + calc_y = args.state.starting_y + (args.state.target_y - args.state.starting_y) * progress +** Processing line: ~ calc_w = args.state.starting_w + (args.state.target_w - args.state.starting_w) * progress~ - Inside source: true *** True Line Result - # instead of using .map, here we use .each (since we are not returning a new item and just updating the items in place) -** Processing line: ~ args.state.items.each do |item|~ + calc_w = args.state.starting_w + (args.state.target_w - args.state.starting_w) * progress +** Processing line: ~ calc_h = args.state.starting_h + (args.state.target_h - args.state.starting_h) * progress~ - Inside source: true *** True Line Result - args.state.items.each do |item| -** Processing line: ~ # based on the location of the item, invoke the correct pixel conversion method~ + calc_h = args.state.starting_h + (args.state.target_h - args.state.starting_h) * progress +** Processing line: ~~ - Inside source: true *** True Line Result - # based on the location of the item, invoke the correct pixel conversion method -** Processing line: ~ if item[:location] == :inventory~ + +** Processing line: ~ args.outputs.solids << [calc_x, calc_y, calc_w, calc_h, 0, 0, 0]~ - Inside source: true *** True Line Result - if item[:location] == :inventory -** Processing line: ~ set_inventory_position args, item~ + args.outputs.solids << [calc_x, calc_y, calc_w, calc_h, 0, 0, 0] +** Processing line: ~~ - Inside source: true *** True Line Result - set_inventory_position args, item -** Processing line: ~ elsif item[:location] == :craft~ + +** Processing line: ~ # count down~ - Inside source: true *** True Line Result - elsif item[:location] == :craft -** Processing line: ~ set_craft_position args, item~ + # count down +** Processing line: ~ count_down = args.state.start_animate_at - args.state.tick_count~ - Inside source: true *** True Line Result - set_craft_position args, item -** Processing line: ~ elsif item[:location] == :held~ + count_down = args.state.start_animate_at - args.state.tick_count +** Processing line: ~ if count_down > 0~ - Inside source: true *** True Line Result - elsif item[:location] == :held -** Processing line: ~ # if the item is held, center the item around the mouse pointer~ + if count_down > 0 +** Processing line: ~ args.outputs.labels << [640, 375, "Running: #{args.state.animation_type} in...", 3, 1]~ - Inside source: true *** True Line Result - # if the item is held, center the item around the mouse pointer -** Processing line: ~ args.state.held_item.x = args.inputs.mouse.x - args.state.held_item.w.half~ + args.outputs.labels << [640, 375, "Running: #{args.state.animation_type} in...", 3, 1] +** Processing line: ~ args.outputs.labels << [640, 345, "%.2f" % count_down.fdiv(60), 3, 1]~ - Inside source: true *** True Line Result - args.state.held_item.x = args.inputs.mouse.x - args.state.held_item.w.half -** Processing line: ~ args.state.held_item.y = args.inputs.mouse.y - args.state.held_item.h.half~ + args.outputs.labels << [640, 345, "%.2f" % count_down.fdiv(60), 3, 1] +** Processing line: ~ elsif progress >= 1~ - Inside source: true *** True Line Result - args.state.held_item.y = args.inputs.mouse.y - args.state.held_item.h.half -** Processing line: ~ end~ + elsif progress >= 1 +** Processing line: ~ args.outputs.labels << [640, 360, "Click screen to reset.", 3, 1]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + args.outputs.labels << [640, 360, "Click screen to reset.", 3, 1] +** Processing line: ~ if args.inputs.click~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if args.inputs.click +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - -** Processing line: ~ # for each hash/sprite in the click ripples queue,~ + $gtk.reset +** Processing line: ~ end~ - Inside source: true *** True Line Result - # for each hash/sprite in the click ripples queue, -** Processing line: ~ # expand its size by 20 percent and decrease its alpha~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # expand its size by 20 percent and decrease its alpha -** Processing line: ~ # by 10.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # by 10. -** Processing line: ~ args.state.click_ripples.each do |ripple|~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.click_ripples.each do |ripple| -** Processing line: ~ delta_w = ripple.w * 1.2 - ripple.w~ + +** Processing line: ~ # $gtk.reset~ - Inside source: true *** True Line Result - delta_w = ripple.w * 1.2 - ripple.w -** Processing line: ~ delta_h = ripple.h * 1.2 - ripple.h~ + # $gtk.reset +** Processing line: ~~ - Inside source: true *** True Line Result - delta_h = ripple.h * 1.2 - ripple.h -** Processing line: ~ ripple.x -= delta_w.half~ + +** Processing line: ~ # you can make own variations of animations using this~ - Inside source: true *** True Line Result - ripple.x -= delta_w.half -** Processing line: ~ ripple.y -= delta_h.half~ + # you can make own variations of animations using this +** Processing line: ~ module Easing~ - Inside source: true *** True Line Result - ripple.y -= delta_h.half -** Processing line: ~ ripple.w += delta_w~ + module Easing +** Processing line: ~ # you have access to all the built in functions: identity, flip, quad, cube, quart, quint~ - Inside source: true *** True Line Result - ripple.w += delta_w -** Processing line: ~ ripple.h += delta_h~ + # you have access to all the built in functions: identity, flip, quad, cube, quart, quint +** Processing line: ~ def self.smoothest_start x~ - Inside source: true *** True Line Result - ripple.h += delta_h -** Processing line: ~ ripple.a -= 10~ + def self.smoothest_start x +** Processing line: ~ quad(quint(x))~ - Inside source: true *** True Line Result - ripple.a -= 10 + quad(quint(x)) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -48883,122 +52128,98 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # remove any items from the collection where the alpha value is less than equal to~ -- Inside source: true -*** True Line Result - # remove any items from the collection where the alpha value is less than equal to -** Processing line: ~ # zero using the reject! method (reject with an exclamation point at the end changes the~ -- Inside source: true -*** True Line Result - # zero using the reject! method (reject with an exclamation point at the end changes the -** Processing line: ~ # array value in place, while reject without the exclamation point returns a new array).~ +** Processing line: ~ def self.smoothest_stop x~ - Inside source: true *** True Line Result - # array value in place, while reject without the exclamation point returns a new array). -** Processing line: ~ args.state.click_ripples.reject! { |ripple| ripple.a <= 0 }~ + def self.smoothest_stop x +** Processing line: ~ flip(quad(quint(flip(x))))~ - Inside source: true *** True Line Result - args.state.click_ripples.reject! { |ripple| ripple.a <= 0 } -** Processing line: ~ end~ + flip(quad(quint(flip(x)))) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # helper function for finding an item at a craft slot~ +** Processing line: ~ # this is the source for the existing easing functions~ - Inside source: true *** True Line Result - # helper function for finding an item at a craft slot -** Processing line: ~ def item_at_craft_slot args, ordinal_x, ordinal_y~ + # this is the source for the existing easing functions +** Processing line: ~ def self.identity x~ - Inside source: true *** True Line Result - def item_at_craft_slot args, ordinal_x, ordinal_y -** Processing line: ~ args.state.items.find { |i| i[:location] == :craft && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y }~ + def self.identity x +** Processing line: ~ x~ - Inside source: true *** True Line Result - args.state.items.find { |i| i[:location] == :craft && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y } -** Processing line: ~ end~ + x +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # helper function for finding an item at an inventory slot~ -- Inside source: true -*** True Line Result - # helper function for finding an item at an inventory slot -** Processing line: ~ def item_at_inventory_slot args, ordinal_x, ordinal_y~ +** Processing line: ~ def self.flip x~ - Inside source: true *** True Line Result - def item_at_inventory_slot args, ordinal_x, ordinal_y -** Processing line: ~ args.state.items.find { |i| i[:location] == :inventory && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y }~ + def self.flip x +** Processing line: ~ 1 - x~ - Inside source: true *** True Line Result - args.state.items.find { |i| i[:location] == :inventory && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y } -** Processing line: ~ end~ + 1 - x +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # helper function that creates a visual representation of an item~ -- Inside source: true -*** True Line Result - # helper function that creates a visual representation of an item -** Processing line: ~ def item_prefab args, item, should_highlight, mouse~ -- Inside source: true -*** True Line Result - def item_prefab args, item, should_highlight, mouse -** Processing line: ~ return nil unless item~ +** Processing line: ~ def self.quad x~ - Inside source: true *** True Line Result - return nil unless item -** Processing line: ~~ + def self.quad x +** Processing line: ~ x * x~ - Inside source: true *** True Line Result - -** Processing line: ~ overlay = nil~ + x * x +** Processing line: ~ end~ - Inside source: true *** True Line Result - overlay = nil + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ x = item.x~ -- Inside source: true -*** True Line Result - x = item.x -** Processing line: ~ y = item.y~ +** Processing line: ~ def self.cube x~ - Inside source: true *** True Line Result - y = item.y -** Processing line: ~ w = item.w~ + def self.cube x +** Processing line: ~ x * x * x~ - Inside source: true *** True Line Result - w = item.w -** Processing line: ~ h = item.h~ + x * x * x +** Processing line: ~ end~ - Inside source: true *** True Line Result - h = item.h + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if should_highlight && mouse.point.inside_rect?(item)~ +** Processing line: ~ def self.quart x~ - Inside source: true *** True Line Result - if should_highlight && mouse.point.inside_rect?(item) -** Processing line: ~ overlay = { x: x, y: y, w: w, h: h, path: "sprites/square-blue.png", a: 130, }~ + def self.quart x +** Processing line: ~ x * x * x * x * x~ - Inside source: true *** True Line Result - overlay = { x: x, y: y, w: w, h: h, path: "sprites/square-blue.png", a: 130, } + x * x * x * x * x ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -49007,126 +52228,102 @@ 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: ~ # sprites are hashes with a path property, this is the main sprite~ -- Inside source: true -*** True Line Result - # sprites are hashes with a path property, this is the main sprite -** Processing line: ~ { x: x, y: y, w: args.state.sprite_size, h: args.state.sprite_size, path: item[:path], },~ -- Inside source: true -*** True Line Result - { x: x, y: y, w: args.state.sprite_size, h: args.state.sprite_size, path: item[:path], }, -** Processing line: ~~ +** Processing line: ~ def self.quint x~ - Inside source: true *** True Line Result - -** Processing line: ~ # this represents the black area in the bottom right corner of the main sprite so that the~ + def self.quint x +** Processing line: ~ x * x * x * x * x * x~ - Inside source: true *** True Line Result - # this represents the black area in the bottom right corner of the main sprite so that the -** Processing line: ~ # quantity is visible~ + x * x * x * x * x * x +** Processing line: ~ end~ - Inside source: true *** True Line Result - # quantity is visible -** Processing line: ~ { x: x + 55, y: y, w: 25, h: 25, path: "sprites/square-black.png", }, # sprites are hashes with a path property~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - { x: x + 55, y: y, w: 25, h: 25, path: "sprites/square-black.png", }, # sprites are hashes with a path property + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # labels are hashes with a text property~ -- Inside source: true -*** True Line Result - # labels are hashes with a text property -** Processing line: ~ { x: x + 56, y: y + 22, text: "#{item[:quantity]}", r: 255, g: 255, b: 255, },~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - { x: x + 56, y: y + 22, text: "#{item[:quantity]}", r: 255, g: 255, b: 255, }, +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ # this is the mouse overlay, if the overlay isn't applicable, then this value will be nil (nil values will not be rendered)~ -- Inside source: true +** Processing line: ~*** Tweening Lerping Easing Functions - Cubic Bezier - main.rb~ +- Header detected. *** True Line Result - # this is the mouse overlay, if the overlay isn't applicable, then this value will be nil (nil values will not be rendered) -** Processing line: ~ overlay~ -- Inside source: true + *** True Line Result - overlay -** Processing line: ~ ]~ -- Inside source: true +*** Tweening Lerping Easing Functions - Cubic Bezier - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - ] -** Processing line: ~ end~ -- Inside source: true + *** True Line Result - end -** Processing line: ~~ +#+begin_src ruby +** Processing line: ~ # ./samples/08_tweening_lerping_easing_functions/02_cubic_bezier/app/main.rb~ - Inside source: true *** True Line Result - -** Processing line: ~ # helper function for deriving the position of an item within inventory~ + # ./samples/08_tweening_lerping_easing_functions/02_cubic_bezier/app/main.rb +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # helper function for deriving the position of an item within inventory -** Processing line: ~ def set_inventory_position args, item~ + def tick args +** Processing line: ~ args.outputs.background_color = [33, 33, 33]~ - Inside source: true *** True Line Result - def set_inventory_position args, item -** Processing line: ~ item.x = args.state.inventory_border.x + item[:ordinal_x] * 80~ + args.outputs.background_color = [33, 33, 33] +** Processing line: ~ args.outputs.lines << bezier(100, 100,~ - Inside source: true *** True Line Result - item.x = args.state.inventory_border.x + item[:ordinal_x] * 80 -** Processing line: ~ item.y = (args.state.inventory_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80~ + args.outputs.lines << bezier(100, 100, +** Processing line: ~ 100, 620,~ - Inside source: true *** True Line Result - item.y = (args.state.inventory_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80 -** Processing line: ~ item.w = 80~ + 100, 620, +** Processing line: ~ 1180, 620,~ - Inside source: true *** True Line Result - item.w = 80 -** Processing line: ~ item.h = 80~ + 1180, 620, +** Processing line: ~ 1180, 100,~ - Inside source: true *** True Line Result - item.h = 80 -** Processing line: ~ end~ + 1180, 100, +** Processing line: ~ 0)~ - Inside source: true *** True Line Result - end + 0) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # helper function for deriving the position of an item within the craft area~ -- Inside source: true -*** True Line Result - # helper function for deriving the position of an item within the craft area -** Processing line: ~ def set_craft_position args, item~ +** Processing line: ~ args.outputs.lines << bezier(100, 100,~ - Inside source: true *** True Line Result - def set_craft_position args, item -** Processing line: ~ item.x = args.state.craft_border.x + item[:ordinal_x] * 80~ + args.outputs.lines << bezier(100, 100, +** Processing line: ~ 100, 620,~ - Inside source: true *** True Line Result - item.x = args.state.craft_border.x + item[:ordinal_x] * 80 -** Processing line: ~ item.y = (args.state.craft_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80~ + 100, 620, +** Processing line: ~ 1180, 620,~ - Inside source: true *** True Line Result - item.y = (args.state.craft_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80 -** Processing line: ~ item.w = 80~ + 1180, 620, +** Processing line: ~ 1180, 100,~ - Inside source: true *** True Line Result - item.w = 80 -** Processing line: ~ item.h = 80~ + 1180, 100, +** Processing line: ~ 20)~ - Inside source: true *** True Line Result - item.h = 80 + 20) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -49135,146 +52332,134 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Any lines outside of a function will be executed when the file is reloaded.~ +** Processing line: ~~ - Inside source: true *** True Line Result - # Any lines outside of a function will be executed when the file is reloaded. -** Processing line: ~ # So every time you save main.rb, the game will be reset.~ + +** Processing line: ~ def bezier x1, y1, x2, y2, x3, y3, x4, y4, step~ - Inside source: true *** True Line Result - # So every time you save main.rb, the game will be reset. -** Processing line: ~ # Comment out the line below if you don't want this to happen.~ + def bezier x1, y1, x2, y2, x3, y3, x4, y4, step +** Processing line: ~ step ||= 0~ - Inside source: true *** True Line Result - # Comment out the line below if you don't want this to happen. -** Processing line: ~ $gtk.reset~ + step ||= 0 +** Processing line: ~ color = [200, 200, 200]~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~~ + color = [200, 200, 200] +** Processing line: ~ points = points_for_bezier [x1, y1], [x2, y2], [x3, y3], [x4, y4], step~ - 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 + points = points_for_bezier [x1, y1], [x2, y2], [x3, y3], [x4, y4], step ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Dev Tools - Add Buttons To Console - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Dev Tools - Add Buttons To Console - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +- Inside source: true *** True Line Result +** Processing line: ~ points.each_cons(2).map do |p1, p2|~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_dev_tools/add_buttons_to_console/app/main.rb~ + points.each_cons(2).map do |p1, p2| +** Processing line: ~ [p1, p2, color]~ - Inside source: true *** True Line Result - # ./samples/99_genre_dev_tools/add_buttons_to_console/app/main.rb -** Processing line: ~ # You can customize the buttons that show up in the Console.~ + [p1, p2, color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - # You can customize the buttons that show up in the Console. -** Processing line: ~ class GTK::Console::Menu~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - class GTK::Console::Menu -** Processing line: ~ # STEP 1: Override the custom_buttons function.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # STEP 1: Override the custom_buttons function. -** Processing line: ~ def custom_buttons~ + +** Processing line: ~ def points_for_bezier p1, p2, p3, p4, step~ - Inside source: true *** True Line Result - def custom_buttons -** Processing line: ~ [~ + def points_for_bezier p1, p2, p3, p4, step +** Processing line: ~ points = []~ - Inside source: true *** True Line Result - [ -** Processing line: ~ (button id: :yay,~ + points = [] +** Processing line: ~ if step == 0~ - Inside source: true *** True Line Result - (button id: :yay, -** Processing line: ~ # row for button~ + if step == 0 +** Processing line: ~ [p1, p2, p3, p4]~ - Inside source: true *** True Line Result - # row for button -** Processing line: ~ row: 3,~ + [p1, p2, p3, p4] +** Processing line: ~ else~ - Inside source: true *** True Line Result - row: 3, -** Processing line: ~ # column for button~ + else +** Processing line: ~ t_step = 1.fdiv(step + 1)~ - Inside source: true *** True Line Result - # column for button -** Processing line: ~ col: 10,~ + t_step = 1.fdiv(step + 1) +** Processing line: ~ t = 0~ - Inside source: true *** True Line Result - col: 10, -** Processing line: ~ # text~ + t = 0 +** Processing line: ~ t += t_step~ - Inside source: true *** True Line Result - # text -** Processing line: ~ text: "I AM CUSTOM",~ + t += t_step +** Processing line: ~ points = []~ - Inside source: true *** True Line Result - text: "I AM CUSTOM", -** Processing line: ~ # when clicked call the custom_button_clicked function~ + points = [] +** Processing line: ~ while t < 1~ - Inside source: true *** True Line Result - # when clicked call the custom_button_clicked function -** Processing line: ~ method: :custom_button_clicked),~ + while t < 1 +** Processing line: ~ points << [~ - Inside source: true *** True Line Result - method: :custom_button_clicked), -** Processing line: ~~ + points << [ +** Processing line: ~ b_for_t(p1.x, p2.x, p3.x, p4.x, t),~ - Inside source: true *** True Line Result - -** Processing line: ~ (button id: :yay,~ + b_for_t(p1.x, p2.x, p3.x, p4.x, t), +** Processing line: ~ b_for_t(p1.y, p2.y, p3.y, p4.y, t),~ - Inside source: true *** True Line Result - (button id: :yay, -** Processing line: ~ # row for button~ + b_for_t(p1.y, p2.y, p3.y, p4.y, t), +** Processing line: ~ ]~ - Inside source: true *** True Line Result - # row for button -** Processing line: ~ row: 3,~ + ] +** Processing line: ~ t += t_step~ - Inside source: true *** True Line Result - row: 3, -** Processing line: ~ # column for button~ + t += t_step +** Processing line: ~ end~ - Inside source: true *** True Line Result - # column for button -** Processing line: ~ col: 9,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - col: 9, -** Processing line: ~ # text~ + +** Processing line: ~ [~ - Inside source: true *** True Line Result - # text -** Processing line: ~ text: "CUSTOM ALSO",~ + [ +** Processing line: ~ p1,~ - Inside source: true *** True Line Result - text: "CUSTOM ALSO", -** Processing line: ~ # when clicked call the custom_button_also_clicked function~ + p1, +** Processing line: ~ *points,~ - Inside source: true *** True Line Result - # when clicked call the custom_button_also_clicked function -** Processing line: ~ method: :custom_button_also_clicked)~ + *points, +** Processing line: ~ p4~ - Inside source: true *** True Line Result - method: :custom_button_also_clicked) + p4 ** Processing line: ~ ]~ - Inside source: true *** True Line Result @@ -49283,130 +52468,150 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # STEP 2: Define the function that should be called.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # STEP 2: Define the function that should be called. -** Processing line: ~ def custom_button_clicked~ + +** Processing line: ~ def b_for_t v0, v1, v2, v3, t~ - Inside source: true *** True Line Result - def custom_button_clicked -** Processing line: ~ log "* INFO: I AM CUSTOM was clicked!"~ + def b_for_t v0, v1, v2, v3, t +** Processing line: ~ pow(1 - t, 3) * v0 +~ - Inside source: true *** True Line Result - log "* INFO: I AM CUSTOM was clicked!" -** Processing line: ~ end~ + pow(1 - t, 3) * v0 + +** Processing line: ~ 3 * pow(1 - t, 2) * t * v1 +~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 3 * pow(1 - t, 2) * t * v1 + +** Processing line: ~ 3 * (1 - t) * pow(t, 2) * v2 +~ - Inside source: true *** True Line Result - -** Processing line: ~ def custom_button_also_clicked~ + 3 * (1 - t) * pow(t, 2) * v2 + +** Processing line: ~ pow(t, 3) * v3~ - Inside source: true *** True Line Result - def custom_button_also_clicked -** Processing line: ~ log "* INFO: Custom Button Clicked at #{Kernel.global_tick_count}!"~ + pow(t, 3) * v3 +** Processing line: ~ end~ - Inside source: true *** True Line Result - log "* INFO: Custom Button Clicked at #{Kernel.global_tick_count}!" + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ all_buttons_as_string = $gtk.console.menu.buttons.map do |b|~ +** Processing line: ~ def pow n, to~ - Inside source: true *** True Line Result - all_buttons_as_string = $gtk.console.menu.buttons.map do |b| -** Processing line: ~ <<-S.strip~ + def pow n, to +** Processing line: ~ n ** to~ - Inside source: true *** True Line Result - <<-S.strip -** Processing line: ~ ** id: #{b[:id]}~ + n ** to +** Processing line: ~ end~ - Inside source: true *** True Line Result - ** id: #{b[:id]} -** Processing line: ~ :PROPERTIES:~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - :PROPERTIES: -** Processing line: ~ :id: :#{b[:id]}~ + +** 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 Using Spline - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Tweening Lerping Easing Functions - Easing Using Spline - 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/08_tweening_lerping_easing_functions/03_easing_using_spline/app/main.rb~ - Inside source: true *** True Line Result - :id: :#{b[:id]} -** Processing line: ~ :method: :#{b[:method]}~ + # ./samples/08_tweening_lerping_easing_functions/03_easing_using_spline/app/main.rb +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - :method: :#{b[:method]} -** Processing line: ~ :text: #{b[:text]}~ + def tick args +** Processing line: ~ args.state.duration = 10.seconds~ - Inside source: true *** True Line Result - :text: #{b[:text]} -** Processing line: ~ :END:~ + args.state.duration = 10.seconds +** Processing line: ~ args.state.spline = [~ - Inside source: true *** True Line Result - :END: -** Processing line: ~ S~ + args.state.spline = [ +** Processing line: ~ [0.0, 0.33, 0.66, 1.0],~ - Inside source: true *** True Line Result - S -** Processing line: ~ end.join("\n")~ + [0.0, 0.33, 0.66, 1.0], +** Processing line: ~ [1.0, 1.0, 1.0, 1.0],~ - Inside source: true *** True Line Result - end.join("\n") -** Processing line: ~~ + [1.0, 1.0, 1.0, 1.0], +** Processing line: ~ [1.0, 0.66, 0.33, 0.0],~ - Inside source: true *** True Line Result - -** Processing line: ~ log <<-S~ + [1.0, 0.66, 0.33, 0.0], +** Processing line: ~ ]~ - Inside source: true *** True Line Result - log <<-S -** Processing line: ~ * INFO: Here are all the buttons:~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - * INFO: Here are all the buttons: -** Processing line: ~ #{all_buttons_as_string}~ + +** Processing line: ~ args.state.simulation_tick = args.state.tick_count % args.state.duration~ - Inside source: true *** True Line Result - #{all_buttons_as_string} -** Processing line: ~ S~ + args.state.simulation_tick = args.state.tick_count % args.state.duration +** Processing line: ~ progress = 0.ease_spline_extended args.state.simulation_tick, args.state.duration, args.state.spline~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + progress = 0.ease_spline_extended args.state.simulation_tick, args.state.duration, args.state.spline +** Processing line: ~ args.outputs.borders << args.grid.rect~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + args.outputs.borders << args.grid.rect +** Processing line: ~ args.outputs.solids << [20 + 1240 * progress,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.outputs.solids << [20 + 1240 * progress, +** Processing line: ~ 20 + 680 * progress,~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + 20 + 680 * progress, +** Processing line: ~ 20, 20].anchor_rect(0.5, 0.5)~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.outputs.labels << [args.grid.center.x, args.grid.center.y,~ + 20, 20].anchor_rect(0.5, 0.5) +** Processing line: ~ args.outputs.labels << [10,~ - Inside source: true *** True Line Result - args.outputs.labels << [args.grid.center.x, args.grid.center.y, -** Processing line: ~ "Open the DragonRuby Console to see the custom menu items.",~ + args.outputs.labels << [10, +** Processing line: ~ 710,~ - Inside source: true *** True Line Result - "Open the DragonRuby Console to see the custom menu items.", -** Processing line: ~ 0, 1]~ + 710, +** Processing line: ~ "perc: #{"%.2f" % (args.state.simulation_tick / args.state.duration)} t: #{args.state.simulation_tick}"]~ - Inside source: true *** True Line Result - 0, 1] + "perc: #{"%.2f" % (args.state.simulation_tick / args.state.duration)} t: #{args.state.simulation_tick}"] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -49423,302 +52628,278 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Dev Tools - Animation Creator Starting Point - main.rb~ +** Processing line: ~*** Tweening Lerping Easing Functions - Parametric Enemy Movement - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Dev Tools - Animation Creator Starting Point - main.rb +*** Tweening Lerping Easing Functions - Parametric Enemy Movement - 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_dev_tools/animation_creator_starting_point/app/main.rb~ -- Inside source: true -*** True Line Result - # ./samples/99_genre_dev_tools/animation_creator_starting_point/app/main.rb -** Processing line: ~ class OneBitLowrezPaint~ -- Inside source: true -*** True Line Result - class OneBitLowrezPaint -** Processing line: ~ attr_gtk~ -- Inside source: true -*** True Line Result - attr_gtk -** Processing line: ~~ +** Processing line: ~ # ./samples/08_tweening_lerping_easing_functions/04_parametric_enemy_movement/app/main.rb~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick~ + # ./samples/08_tweening_lerping_easing_functions/04_parametric_enemy_movement/app/main.rb +** Processing line: ~ def new_star args~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ outputs.background_color = [0, 0, 0]~ + def new_star args +** Processing line: ~ { x: 1280.randomize(:ratio),~ - Inside source: true *** True Line Result - outputs.background_color = [0, 0, 0] -** Processing line: ~ defaults~ + { x: 1280.randomize(:ratio), +** Processing line: ~ starting_y: 800,~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ render_instructions~ + starting_y: 800, +** Processing line: ~ distance_to_travel: 900 + 100.randomize(:ratio),~ - Inside source: true *** True Line Result - render_instructions -** Processing line: ~ render_canvas~ + distance_to_travel: 900 + 100.randomize(:ratio), +** Processing line: ~ duration: 100.randomize(:ratio) + 60,~ - Inside source: true *** True Line Result - render_canvas -** Processing line: ~ render_buttons_frame_selection~ + duration: 100.randomize(:ratio) + 60, +** Processing line: ~ created_at: args.state.tick_count,~ - Inside source: true *** True Line Result - render_buttons_frame_selection -** Processing line: ~ render_animation_frame_thumbnails~ + created_at: args.state.tick_count, +** Processing line: ~ max_alpha: 128.randomize(:ratio) + 128,~ - Inside source: true *** True Line Result - render_animation_frame_thumbnails -** Processing line: ~ render_animation~ + max_alpha: 128.randomize(:ratio) + 128, +** Processing line: ~ b: 255.randomize(:ratio),~ - Inside source: true *** True Line Result - render_animation -** Processing line: ~ input_mouse_click~ + b: 255.randomize(:ratio), +** Processing line: ~ g: 200.randomize(:ratio),~ - Inside source: true *** True Line Result - input_mouse_click -** Processing line: ~ input_keyboard~ + g: 200.randomize(:ratio), +** Processing line: ~ w: 1.randomize(:ratio) + 1,~ - Inside source: true *** True Line Result - input_keyboard -** Processing line: ~ calc_auto_export~ + w: 1.randomize(:ratio) + 1, +** Processing line: ~ h: 1.randomize(:ratio) + 1 }~ - Inside source: true *** True Line Result - calc_auto_export -** Processing line: ~ calc_buttons_frame_selection~ + h: 1.randomize(:ratio) + 1 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - calc_buttons_frame_selection -** Processing line: ~ calc_animation_frames~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - calc_animation_frames -** Processing line: ~ process_queue_create_sprite~ + +** Processing line: ~ def new_enemy args~ - Inside source: true *** True Line Result - process_queue_create_sprite -** Processing line: ~ process_queue_reset_sprite~ + def new_enemy args +** Processing line: ~ { x: 1280.randomize(:ratio),~ - Inside source: true *** True Line Result - process_queue_reset_sprite -** Processing line: ~ process_queue_update_rt_animation_frame~ + { x: 1280.randomize(:ratio), +** Processing line: ~ starting_y: 800,~ - Inside source: true *** True Line Result - process_queue_update_rt_animation_frame -** Processing line: ~ end~ + starting_y: 800, +** Processing line: ~ distance_to_travel: -900,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + distance_to_travel: -900, +** Processing line: ~ duration: 60.randomize(:ratio) + 180,~ - Inside source: true *** True Line Result - -** Processing line: ~ def defaults~ + duration: 60.randomize(:ratio) + 180, +** Processing line: ~ created_at: args.state.tick_count,~ - Inside source: true *** True Line Result - def defaults -** Processing line: ~ state.animation_frames_per_second = 12~ + created_at: args.state.tick_count, +** Processing line: ~ w: 32,~ - Inside source: true *** True Line Result - state.animation_frames_per_second = 12 -** Processing line: ~ queues.create_sprite ||= []~ + w: 32, +** Processing line: ~ h: 32,~ - Inside source: true *** True Line Result - queues.create_sprite ||= [] -** Processing line: ~ queues.reset_sprite ||= []~ + h: 32, +** Processing line: ~ fire_rate: (30.randomize(:ratio) + (60 - args.state.score)).to_i }~ - Inside source: true *** True Line Result - queues.reset_sprite ||= [] -** Processing line: ~ queues.update_rt_animation_frame ||= []~ + fire_rate: (30.randomize(:ratio) + (60 - args.state.score)).to_i } +** Processing line: ~ end~ - Inside source: true *** True Line Result - queues.update_rt_animation_frame ||= [] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if !state.animation_frames~ -- Inside source: true -*** True Line Result - if !state.animation_frames -** Processing line: ~ state.animation_frames ||= []~ -- Inside source: true -*** True Line Result - state.animation_frames ||= [] -** Processing line: ~ add_animation_frame_to_end~ +** Processing line: ~ def new_bullet args, starting_x, starting_y, enemy_speed~ - Inside source: true *** True Line Result - add_animation_frame_to_end -** Processing line: ~ end~ + def new_bullet args, starting_x, starting_y, enemy_speed +** Processing line: ~ { x: starting_x,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + { x: starting_x, +** Processing line: ~ starting_y: starting_y,~ - Inside source: true *** True Line Result - -** Processing line: ~ state.last_mouse_down ||= 0~ + starting_y: starting_y, +** Processing line: ~ distance_to_travel: -900,~ - Inside source: true *** True Line Result - state.last_mouse_down ||= 0 -** Processing line: ~ state.last_mouse_up ||= 0~ + distance_to_travel: -900, +** Processing line: ~ created_at: args.state.tick_count,~ - Inside source: true *** True Line Result - state.last_mouse_up ||= 0 -** Processing line: ~~ + created_at: args.state.tick_count, +** Processing line: ~ duration: 900 / (enemy_speed.abs + 2.0 + (5.0 * args.state.score.fdiv(100))).abs,~ - Inside source: true *** True Line Result - -** Processing line: ~ state.buttons_frame_selection.left = 10~ + duration: 900 / (enemy_speed.abs + 2.0 + (5.0 * args.state.score.fdiv(100))).abs, +** Processing line: ~ w: 5,~ - Inside source: true *** True Line Result - state.buttons_frame_selection.left = 10 -** Processing line: ~ state.buttons_frame_selection.top = grid.top - 10~ + w: 5, +** Processing line: ~ h: 5 }~ - Inside source: true *** True Line Result - state.buttons_frame_selection.top = grid.top - 10 -** Processing line: ~ state.buttons_frame_selection.size = 20~ + h: 5 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.buttons_frame_selection.size = 20 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ defaults_canvas_sprite~ -- Inside source: true -*** True Line Result - defaults_canvas_sprite -** Processing line: ~~ +** Processing line: ~ def new_player_bullet args, starting_x, starting_y, player_speed~ - Inside source: true *** True Line Result - -** Processing line: ~ state.edit_mode ||= :drawing~ + def new_player_bullet args, starting_x, starting_y, player_speed +** Processing line: ~ { x: starting_x,~ - Inside source: true *** True Line Result - state.edit_mode ||= :drawing -** Processing line: ~ end~ + { x: starting_x, +** Processing line: ~ starting_y: starting_y,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + starting_y: starting_y, +** Processing line: ~ distance_to_travel: 900,~ - Inside source: true *** True Line Result - -** Processing line: ~ def defaults_canvas_sprite~ + distance_to_travel: 900, +** Processing line: ~ created_at: args.state.tick_count,~ - Inside source: true *** True Line Result - def defaults_canvas_sprite -** Processing line: ~ rt_canvas.size = 16~ + created_at: args.state.tick_count, +** Processing line: ~ duration: 900 / (player_speed + 2.0),~ - Inside source: true *** True Line Result - rt_canvas.size = 16 -** Processing line: ~ rt_canvas.zoom = 30~ + duration: 900 / (player_speed + 2.0), +** Processing line: ~ w: 5,~ - Inside source: true *** True Line Result - rt_canvas.zoom = 30 -** Processing line: ~ rt_canvas.width = rt_canvas.size * rt_canvas.zoom~ + w: 5, +** Processing line: ~ h: 5 }~ - Inside source: true *** True Line Result - rt_canvas.width = rt_canvas.size * rt_canvas.zoom -** Processing line: ~ rt_canvas.height = rt_canvas.size * rt_canvas.zoom~ + h: 5 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - rt_canvas.height = rt_canvas.size * rt_canvas.zoom -** Processing line: ~ rt_canvas.sprite = { x: 0,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - rt_canvas.sprite = { x: 0, -** Processing line: ~ y: 0,~ + +** Processing line: ~ def defaults args~ - Inside source: true *** True Line Result - y: 0, -** Processing line: ~ w: rt_canvas.width,~ + def defaults args +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - w: rt_canvas.width, -** Processing line: ~ h: rt_canvas.height,~ + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.state.score ||= 0~ - Inside source: true *** True Line Result - h: rt_canvas.height, -** Processing line: ~ path: :rt_canvas }.center_inside_rect(x: 0, y: 0, w: 640, h: 720)~ + args.state.score ||= 0 +** Processing line: ~ args.state.stars ||= []~ - Inside source: true *** True Line Result - path: :rt_canvas }.center_inside_rect(x: 0, y: 0, w: 640, h: 720) -** Processing line: ~~ + args.state.stars ||= [] +** Processing line: ~ args.state.enemies ||= []~ - Inside source: true *** True Line Result - -** Processing line: ~ return unless state.tick_count == 1~ + args.state.enemies ||= [] +** Processing line: ~ args.state.bullets ||= []~ - Inside source: true *** True Line Result - return unless state.tick_count == 1 -** Processing line: ~~ + args.state.bullets ||= [] +** Processing line: ~ args.state.player_bullets ||= []~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs[:rt_canvas].width = rt_canvas.width~ + args.state.player_bullets ||= [] +** Processing line: ~ args.state.max_stars = 50~ - Inside source: true *** True Line Result - outputs[:rt_canvas].width = rt_canvas.width -** Processing line: ~ outputs[:rt_canvas].height = rt_canvas.height~ + args.state.max_stars = 50 +** Processing line: ~ args.state.max_enemies = 10~ - Inside source: true *** True Line Result - outputs[:rt_canvas].height = rt_canvas.height -** Processing line: ~ outputs[:rt_canvas].sprites << (rt_canvas.size + 1).map_with_index do |x|~ + args.state.max_enemies = 10 +** Processing line: ~ args.state.player.x ||= 640~ - Inside source: true *** True Line Result - outputs[:rt_canvas].sprites << (rt_canvas.size + 1).map_with_index do |x| -** Processing line: ~ (rt_canvas.size + 1).map_with_index do |y|~ + args.state.player.x ||= 640 +** Processing line: ~ args.state.player.y ||= 100~ - Inside source: true *** True Line Result - (rt_canvas.size + 1).map_with_index do |y| -** Processing line: ~ path = 'sprites/square-white.png'~ + args.state.player.y ||= 100 +** Processing line: ~ args.state.player.w ||= 32~ - Inside source: true *** True Line Result - path = 'sprites/square-white.png' -** Processing line: ~ path = 'sprites/square-blue.png' if x == 7 || x == 8~ + args.state.player.w ||= 32 +** Processing line: ~ args.state.player.h ||= 32~ - Inside source: true *** True Line Result - path = 'sprites/square-blue.png' if x == 7 || x == 8 -** Processing line: ~ { x: x * rt_canvas.zoom,~ + args.state.player.h ||= 32 +** Processing line: ~~ - Inside source: true *** True Line Result - { x: x * rt_canvas.zoom, -** Processing line: ~ y: y * rt_canvas.zoom,~ + +** Processing line: ~ if args.state.tick_count == 0~ - Inside source: true *** True Line Result - y: y * rt_canvas.zoom, -** Processing line: ~ w: rt_canvas.zoom,~ + if args.state.tick_count == 0 +** Processing line: ~ args.state.stars.clear~ - Inside source: true *** True Line Result - w: rt_canvas.zoom, -** Processing line: ~ h: rt_canvas.zoom,~ + args.state.stars.clear +** Processing line: ~ args.state.max_stars.times do~ - Inside source: true *** True Line Result - h: rt_canvas.zoom, -** Processing line: ~ path: path,~ + args.state.max_stars.times do +** Processing line: ~ s = new_star args~ - Inside source: true *** True Line Result - path: path, -** Processing line: ~ a: 50 }~ + s = new_star args +** Processing line: ~ s[:created_at] += s[:duration].randomize(:ratio)~ - Inside source: true *** True Line Result - a: 50 } -** Processing line: ~ end~ + s[:created_at] += s[:duration].randomize(:ratio) +** Processing line: ~ args.state.stars << s~ - Inside source: true *** True Line Result - end + args.state.stars << s ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -49731,86 +52912,90 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render_instructions~ +** Processing line: ~ if args.state.tick_count == 0~ - Inside source: true *** True Line Result - def render_instructions -** Processing line: ~ instructions = <<-S~ + if args.state.tick_count == 0 +** Processing line: ~ args.state.enemies.clear~ +- Inside source: true +*** True Line Result + args.state.enemies.clear +** Processing line: ~ args.state.max_enemies.times do~ - Inside source: true *** True Line Result - instructions = <<-S -** Processing line: ~ * Instructions:~ + args.state.max_enemies.times do +** Processing line: ~ s = new_enemy args~ - Inside source: true *** True Line Result - * Instructions: -** Processing line: ~ - All data is stored in the ~canvas~ directory.~ + s = new_enemy args +** Processing line: ~ s[:created_at] += s[:duration].randomize(:ratio)~ - Inside source: true *** True Line Result - - All data is stored in the ~canvas~ directory. -** Processing line: ~ - Hold ~d~ to set the edit mode to erase.~ + s[:created_at] += s[:duration].randomize(:ratio) +** Processing line: ~ args.state.enemies << s~ - Inside source: true *** True Line Result - - Hold ~d~ to set the edit mode to erase. -** Processing line: ~ - Release ~d~ to set the edit mode drawing.~ + args.state.enemies << s +** Processing line: ~ end~ - Inside source: true *** True Line Result - - Release ~d~ to set the edit mode drawing. -** Processing line: ~ - Press ~a~ to added a frame to the end.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - - Press ~a~ to added a frame to the end. -** Processing line: ~ - Press ~b~ to select the previous frame.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - - Press ~b~ to select the previous frame. -** Processing line: ~ - Press ~f~ to select the next frame.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - - Press ~f~ to select the next frame. -** Processing line: ~ - Press ~c~ to copy a frame.~ + +** Processing line: ~ def input args~ - Inside source: true *** True Line Result - - Press ~c~ to copy a frame. -** Processing line: ~ - Press ~v~ to paste a copied frame into the selected frame.~ + def input args +** Processing line: ~ if args.inputs.keyboard.left~ - Inside source: true *** True Line Result - - Press ~v~ to paste a copied frame into the selected frame. -** Processing line: ~ - Press ~x~ to delete the currently selected frame.~ + if args.inputs.keyboard.left +** Processing line: ~ args.state.player.x -= 5~ - Inside source: true *** True Line Result - - Press ~x~ to delete the currently selected frame. -** Processing line: ~ - Press ~w~ to save the canvas and export all sprites.~ + args.state.player.x -= 5 +** Processing line: ~ elsif args.inputs.keyboard.right~ - Inside source: true *** True Line Result - - Press ~w~ to save the canvas and export all sprites. -** Processing line: ~ - Press ~l~ to load the canvas.~ + elsif args.inputs.keyboard.right +** Processing line: ~ args.state.player.x += 5~ - Inside source: true *** True Line Result - - Press ~l~ to load the canvas. -** Processing line: ~ S~ + args.state.player.x += 5 +** Processing line: ~ end~ - Inside source: true *** True Line Result - S + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ instructions.strip.each_line.with_index do |l, i|~ +** Processing line: ~ if args.inputs.keyboard.up~ - Inside source: true *** True Line Result - instructions.strip.each_line.with_index do |l, i| -** Processing line: ~ outputs.labels << { x: 840, y: 500 - (i * 20), text: "#{l}",~ + if args.inputs.keyboard.up +** Processing line: ~ args.state.player.y += 5~ - Inside source: true *** True Line Result - outputs.labels << { x: 840, y: 500 - (i * 20), text: "#{l}", -** Processing line: ~ r: 180, g: 180, b: 180, size_enum: -3 }~ + args.state.player.y += 5 +** Processing line: ~ elsif args.inputs.keyboard.down~ - Inside source: true *** True Line Result - r: 180, g: 180, b: 180, size_enum: -3 } -** Processing line: ~ end~ + elsif args.inputs.keyboard.down +** Processing line: ~ args.state.player.y -= 5~ - Inside source: true *** True Line Result - end + args.state.player.y -= 5 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -49819,18 +53004,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 render_canvas~ +** Processing line: ~ if args.inputs.keyboard.key_down.space~ - Inside source: true *** True Line Result - def render_canvas -** Processing line: ~ return if state.tick_count.zero?~ + if args.inputs.keyboard.key_down.space +** Processing line: ~ args.state.player_bullets << new_player_bullet(args,~ - Inside source: true *** True Line Result - return if state.tick_count.zero? -** Processing line: ~ outputs.sprites << rt_canvas.sprite~ + args.state.player_bullets << new_player_bullet(args, +** Processing line: ~ args.state.player.x + args.state.player.w.half,~ - Inside source: true *** True Line Result - outputs.sprites << rt_canvas.sprite + args.state.player.x + args.state.player.w.half, +** Processing line: ~ args.state.player.y + args.state.player.h, 5)~ +- Inside source: true +*** True Line Result + args.state.player.y + args.state.player.h, 5) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -49839,66 +53028,78 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render_buttons_frame_selection~ +** Processing line: ~ args.state.player.y = args.state.player.y.greater(0).lesser(720 - args.state.player.w)~ - Inside source: true *** True Line Result - def render_buttons_frame_selection -** Processing line: ~ args.outputs.primitives << state.buttons_frame_selection.items.map_with_index do |b, i|~ + args.state.player.y = args.state.player.y.greater(0).lesser(720 - args.state.player.w) +** Processing line: ~ args.state.player.x = args.state.player.x.greater(0).lesser(1280 - args.state.player.h)~ - Inside source: true *** True Line Result - args.outputs.primitives << state.buttons_frame_selection.items.map_with_index do |b, i| -** Processing line: ~ label = { x: b.x + state.buttons_frame_selection.size.half,~ + args.state.player.x = args.state.player.x.greater(0).lesser(1280 - args.state.player.h) +** Processing line: ~ end~ - Inside source: true *** True Line Result - label = { x: b.x + state.buttons_frame_selection.size.half, -** Processing line: ~ y: b.y,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - y: b.y, -** Processing line: ~ text: "#{i + 1}", r: 180, g: 180, b: 180,~ + +** Processing line: ~ def completed? entity~ - Inside source: true *** True Line Result - text: "#{i + 1}", r: 180, g: 180, b: 180, -** Processing line: ~ size_enum: -4, alignment_enum: 1 }.label~ + def completed? entity +** Processing line: ~ (entity[:created_at] + entity[:duration]).elapsed_time > 0~ - Inside source: true *** True Line Result - size_enum: -4, alignment_enum: 1 }.label + (entity[:created_at] + entity[:duration]).elapsed_time > 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ selection_border = b.merge(r: 40, g: 40, b: 40).border~ +** Processing line: ~ def calc_stars args~ - Inside source: true *** True Line Result - selection_border = b.merge(r: 40, g: 40, b: 40).border -** Processing line: ~~ + def calc_stars args +** Processing line: ~ if (stars_to_add = args.state.max_stars - args.state.stars.length) > 0~ - Inside source: true *** True Line Result - -** Processing line: ~ if i == state.animation_frames_selected_index~ + if (stars_to_add = args.state.max_stars - args.state.stars.length) > 0 +** Processing line: ~ stars_to_add.times { args.state.stars << new_star(args) }~ - 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~ + stars_to_add.times { args.state.stars << new_star(args) } +** Processing line: ~ end~ - Inside source: true *** True Line Result - selection_border = b.merge(r: 40, g: 230, b: 200).border -** Processing line: ~ end~ + end +** Processing line: ~ args.state.stars = args.state.stars.reject { |s| completed? s }~ - Inside source: true *** True Line Result - end + args.state.stars = args.state.stars.reject { |s| completed? s } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ [selection_border, label]~ +** Processing line: ~ def move_enemies args~ - Inside source: true *** True Line Result - [selection_border, label] -** Processing line: ~ end~ + def move_enemies args +** Processing line: ~ if (enemies_to_add = args.state.max_enemies - args.state.enemies.length) > 0~ - Inside source: true *** True Line Result - end + if (enemies_to_add = args.state.max_enemies - args.state.enemies.length) > 0 +** Processing line: ~ enemies_to_add.times { args.state.enemies << new_enemy(args) }~ +- Inside source: true +*** True Line Result + enemies_to_add.times { args.state.enemies << new_enemy(args) } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -49907,290 +53108,290 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render_animation_frame_thumbnails~ +** Processing line: ~ args.state.enemies = args.state.enemies.reject { |s| completed? s }~ - Inside source: true *** True Line Result - def render_animation_frame_thumbnails -** Processing line: ~ return if state.tick_count.zero?~ + args.state.enemies = args.state.enemies.reject { |s| completed? s } +** Processing line: ~ end~ - Inside source: true *** True Line Result - return if state.tick_count.zero? + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs[:current_animation_frame].width = rt_canvas.size~ +** Processing line: ~ def move_bullets args~ - Inside source: true *** True Line Result - outputs[:current_animation_frame].width = rt_canvas.size -** Processing line: ~ outputs[:current_animation_frame].height = rt_canvas.size~ + def move_bullets args +** Processing line: ~ args.state.enemies.each do |e|~ - Inside source: true *** True Line Result - outputs[:current_animation_frame].height = rt_canvas.size -** Processing line: ~ outputs[:current_animation_frame].solids << selected_animation_frame[:pixels].map_with_index do |f, i|~ + args.state.enemies.each do |e| +** Processing line: ~ if args.state.tick_count.mod_zero?(e[:fire_rate])~ - Inside source: true *** True Line Result - outputs[:current_animation_frame].solids << selected_animation_frame[:pixels].map_with_index do |f, i| -** Processing line: ~ { x: f.x,~ + if args.state.tick_count.mod_zero?(e[:fire_rate]) +** Processing line: ~ args.state.bullets << new_bullet(args, e[:x] + e[:w].half, current_y(e), e[:distance_to_travel] / e[:duration])~ - Inside source: true *** True Line Result - { x: f.x, -** Processing line: ~ y: f.y,~ + args.state.bullets << new_bullet(args, e[:x] + e[:w].half, current_y(e), e[:distance_to_travel] / e[:duration]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - y: f.y, -** Processing line: ~ w: 1,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - w: 1, -** Processing line: ~ h: 1, r: 255, g: 255, b: 255 }~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - h: 1, r: 255, g: 255, b: 255 } -** Processing line: ~ end~ + +** Processing line: ~ args.state.bullets = args.state.bullets.reject { |s| completed? s }~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.bullets = args.state.bullets.reject { |s| completed? s } +** Processing line: ~ args.state.player_bullets = args.state.player_bullets.reject { |s| completed? s }~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.sprites << rt_canvas.sprite.merge(path: :current_animation_frame)~ + args.state.player_bullets = args.state.player_bullets.reject { |s| completed? s } +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.sprites << rt_canvas.sprite.merge(path: :current_animation_frame) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.animation_frames.map_with_index do |animation_frame, animation_frame_index|~ +** Processing line: ~ def intersect? entity_one, entity_two~ - Inside source: true *** True Line Result - state.animation_frames.map_with_index do |animation_frame, animation_frame_index| -** Processing line: ~ outputs.sprites << state.buttons_frame_selection[:items][animation_frame_index][:inner_rect]~ -- Inside source: true -*** True Line Result - outputs.sprites << state.buttons_frame_selection[:items][animation_frame_index][:inner_rect] -** Processing line: ~ .merge(path: animation_frame[:rt_name])~ + def intersect? entity_one, entity_two +** Processing line: ~ entity_one.merge(y: current_y(entity_one))~ - Inside source: true *** True Line Result - .merge(path: animation_frame[:rt_name]) -** Processing line: ~ end~ + entity_one.merge(y: current_y(entity_one)) +** Processing line: ~ .intersect_rect? entity_two.merge(y: current_y(entity_two))~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + .intersect_rect? entity_two.merge(y: current_y(entity_two)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_animation~ +** Processing line: ~ def kill args~ - Inside source: true *** True Line Result - def render_animation -** Processing line: ~ sprite_index = 0.frame_index count: state.animation_frames.length,~ + def kill args +** Processing line: ~ bullets_hitting_enemies = []~ - Inside source: true *** True Line Result - sprite_index = 0.frame_index count: state.animation_frames.length, -** Processing line: ~ hold_for: 60 / state.animation_frames_per_second,~ + bullets_hitting_enemies = [] +** Processing line: ~ dead_bullets = []~ - Inside source: true *** True Line Result - hold_for: 60 / state.animation_frames_per_second, -** Processing line: ~ repeat: true~ + dead_bullets = [] +** Processing line: ~ dead_enemies = []~ - Inside source: true *** True Line Result - repeat: true + dead_enemies = [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.sprites << { x: 700 - 8,~ -- Inside source: true -*** True Line Result - args.outputs.sprites << { x: 700 - 8, -** Processing line: ~ y: 120,~ +** Processing line: ~ args.state.player_bullets.each do |b|~ - Inside source: true *** True Line Result - y: 120, -** Processing line: ~ w: 16,~ + args.state.player_bullets.each do |b| +** Processing line: ~ args.state.enemies.each do |e|~ - Inside source: true *** True Line Result - w: 16, -** Processing line: ~ h: 16,~ + args.state.enemies.each do |e| +** Processing line: ~ if intersect? b, e~ - Inside source: true *** True Line Result - h: 16, -** Processing line: ~ path: (sprite_path sprite_index) }~ + if intersect? b, e +** Processing line: ~ dead_bullets << b~ - Inside source: true *** True Line Result - path: (sprite_path sprite_index) } -** Processing line: ~~ + dead_bullets << b +** Processing line: ~ dead_enemies << e~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.sprites << { x: 700 - 16,~ + dead_enemies << e +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.outputs.sprites << { x: 700 - 16, -** Processing line: ~ y: 230,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - y: 230, -** Processing line: ~ w: 32,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - w: 32, -** Processing line: ~ h: 32,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - h: 32, -** Processing line: ~ path: (sprite_path sprite_index) }~ + +** Processing line: ~ args.state.score += dead_enemies.length~ - Inside source: true *** True Line Result - path: (sprite_path sprite_index) } + args.state.score += dead_enemies.length ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.sprites << { x: 700 - 32,~ +** Processing line: ~ args.state.player_bullets.reject! { |b| dead_bullets.include? b }~ - Inside source: true *** True Line Result - args.outputs.sprites << { x: 700 - 32, -** Processing line: ~ y: 360,~ + args.state.player_bullets.reject! { |b| dead_bullets.include? b } +** Processing line: ~ args.state.enemies.reject! { |e| dead_enemies.include? e }~ - Inside source: true *** True Line Result - y: 360, -** Processing line: ~ w: 64,~ + args.state.enemies.reject! { |e| dead_enemies.include? e } +** Processing line: ~~ - Inside source: true *** True Line Result - w: 64, -** Processing line: ~ h: 64,~ + +** Processing line: ~ dead = args.state.bullets.any? do |b|~ - Inside source: true *** True Line Result - h: 64, -** Processing line: ~ path: (sprite_path sprite_index) }~ + dead = args.state.bullets.any? do |b| +** Processing line: ~ [args.state.player.x,~ - Inside source: true *** True Line Result - path: (sprite_path sprite_index) } -** Processing line: ~~ + [args.state.player.x, +** Processing line: ~ args.state.player.y,~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.sprites << { x: 700 - 64,~ + args.state.player.y, +** Processing line: ~ args.state.player.w,~ - Inside source: true *** True Line Result - args.outputs.sprites << { x: 700 - 64, -** Processing line: ~ y: 520,~ + args.state.player.w, +** Processing line: ~ args.state.player.h].intersect_rect? b.merge(y: current_y(b))~ - Inside source: true *** True Line Result - y: 520, -** Processing line: ~ w: 128,~ + args.state.player.h].intersect_rect? b.merge(y: current_y(b)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - w: 128, -** Processing line: ~ h: 128,~ + end +** Processing line: ~ return unless dead~ - Inside source: true *** True Line Result - h: 128, -** Processing line: ~ path: (sprite_path sprite_index) }~ + return unless dead +** Processing line: ~ args.gtk.reset~ - Inside source: true *** True Line Result - path: (sprite_path sprite_index) } -** Processing line: ~ end~ + args.gtk.reset +** Processing line: ~ defaults args~ - Inside source: true *** True Line Result - end + defaults args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def input_mouse_click~ +** Processing line: ~ def calc args~ - Inside source: true *** True Line Result - def input_mouse_click -** Processing line: ~ if inputs.mouse.up~ + def calc args +** Processing line: ~ calc_stars args~ - Inside source: true *** True Line Result - if inputs.mouse.up -** Processing line: ~ state.last_mouse_up = state.tick_count~ + calc_stars args +** Processing line: ~ move_enemies args~ - Inside source: true *** True Line Result - state.last_mouse_up = state.tick_count -** Processing line: ~ elsif inputs.mouse.moved && user_is_editing?~ + move_enemies args +** Processing line: ~ move_bullets args~ - Inside source: true *** True Line Result - elsif inputs.mouse.moved && user_is_editing? -** Processing line: ~ edit_current_animation_frame inputs.mouse.point~ + move_bullets args +** Processing line: ~ kill args~ - Inside source: true *** True Line Result - edit_current_animation_frame inputs.mouse.point -** Processing line: ~ end~ + kill args +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return unless inputs.mouse.click~ +** Processing line: ~ def current_y entity~ - Inside source: true *** True Line Result - return unless inputs.mouse.click -** Processing line: ~~ + def current_y entity +** Processing line: ~ entity[:starting_y] + (entity[:distance_to_travel] * entity[:created_at].ease(entity[:duration], :identity))~ - Inside source: true *** True Line Result - -** Processing line: ~ clicked_frame_button = state.buttons_frame_selection.items.find do |b|~ + entity[:starting_y] + (entity[:distance_to_travel] * entity[:created_at].ease(entity[:duration], :identity)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - clicked_frame_button = state.buttons_frame_selection.items.find do |b| -** Processing line: ~ inputs.mouse.point.inside_rect? b~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - inputs.mouse.point.inside_rect? b -** Processing line: ~ end~ + +** Processing line: ~ def render args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def render args +** Processing line: ~ args.outputs.solids << args.state.stars.map do |s|~ - Inside source: true *** True Line Result - -** Processing line: ~ if (clicked_frame_button)~ + args.outputs.solids << args.state.stars.map do |s| +** Processing line: ~ [s[:x],~ - Inside source: true *** True Line Result - if (clicked_frame_button) -** Processing line: ~ state.animation_frames_selected_index = clicked_frame_button[:index]~ + [s[:x], +** Processing line: ~ current_y(s),~ - Inside source: true *** True Line Result - state.animation_frames_selected_index = clicked_frame_button[:index] -** Processing line: ~ end~ + current_y(s), +** Processing line: ~ s[:w], s[:h], 0, s[:g], s[:b], s[:max_alpha] * s[:created_at].ease(20, :identity)]~ - Inside source: true *** True Line Result - end + s[:w], s[:h], 0, s[:g], s[:b], s[:max_alpha] * s[:created_at].ease(20, :identity)] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if (inputs.mouse.point.inside_rect? rt_canvas.sprite)~ +** Processing line: ~ args.outputs.borders << args.state.enemies.map do |s|~ - Inside source: true *** True Line Result - if (inputs.mouse.point.inside_rect? rt_canvas.sprite) -** Processing line: ~ state.last_mouse_down = state.tick_count~ + args.outputs.borders << args.state.enemies.map do |s| +** Processing line: ~ [s[:x],~ - Inside source: true *** True Line Result - state.last_mouse_down = state.tick_count -** Processing line: ~ edit_current_animation_frame inputs.mouse.point~ + [s[:x], +** Processing line: ~ current_y(s),~ - Inside source: true *** True Line Result - edit_current_animation_frame inputs.mouse.point -** Processing line: ~ end~ + current_y(s), +** Processing line: ~ s[:w], s[:h], 255, 0, 0]~ - Inside source: true *** True Line Result - end + s[:w], s[:h], 255, 0, 0] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -50199,578 +53400,606 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def input_keyboard~ +** Processing line: ~ args.outputs.borders << args.state.bullets.map do |b|~ - Inside source: true *** True Line Result - def input_keyboard -** Processing line: ~ # w to save~ + args.outputs.borders << args.state.bullets.map do |b| +** Processing line: ~ [b[:x],~ - Inside source: true *** True Line Result - # w to save -** Processing line: ~ if inputs.keyboard.key_down.w~ + [b[:x], +** Processing line: ~ current_y(b),~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.w -** Processing line: ~ t = Time.now~ + current_y(b), +** Processing line: ~ b[:w], b[:h], 255, 0, 0]~ - Inside source: true *** True Line Result - t = Time.now -** Processing line: ~ state.save_description = "Time: #{t} (#{t.to_i})"~ + b[:w], b[:h], 255, 0, 0] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.save_description = "Time: #{t} (#{t.to_i})" -** Processing line: ~ gtk.serialize_state 'canvas/state.txt', state~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - gtk.serialize_state 'canvas/state.txt', state -** Processing line: ~ gtk.serialize_state "tmp/canvas_backups/#{t.to_i}/state.txt", state~ + +** Processing line: ~ args.outputs.borders << args.state.player_bullets.map do |b|~ - Inside source: true *** True Line Result - gtk.serialize_state "tmp/canvas_backups/#{t.to_i}/state.txt", state -** Processing line: ~ animation_frames.each_with_index do |animation_frame, i|~ + args.outputs.borders << args.state.player_bullets.map do |b| +** Processing line: ~ [b[:x],~ - Inside source: true *** True Line Result - animation_frames.each_with_index do |animation_frame, i| -** Processing line: ~ queues.update_rt_animation_frame << { index: i,~ + [b[:x], +** Processing line: ~ current_y(b),~ - Inside source: true *** True Line Result - queues.update_rt_animation_frame << { index: i, -** Processing line: ~ at: state.tick_count + i,~ + current_y(b), +** Processing line: ~ b[:w], b[:h], 255, 255, 255]~ - Inside source: true *** True Line Result - at: state.tick_count + i, -** Processing line: ~ queue_sprite_creation: true }~ + b[:w], b[:h], 255, 255, 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - queue_sprite_creation: true } -** Processing line: ~ queues.create_sprite << { index: i,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - queues.create_sprite << { index: i, -** Processing line: ~ at: state.tick_count + animation_frames.length + i,~ + +** Processing line: ~ args.borders << [args.state.player.x,~ - Inside source: true *** True Line Result - at: state.tick_count + animation_frames.length + i, -** Processing line: ~ path_override: "tmp/canvas_backups/#{t.to_i}/sprite-#{i}.png" }~ + args.borders << [args.state.player.x, +** Processing line: ~ args.state.player.y,~ - Inside source: true *** True Line Result - path_override: "tmp/canvas_backups/#{t.to_i}/sprite-#{i}.png" } -** Processing line: ~ end~ + args.state.player.y, +** Processing line: ~ args.state.player.w,~ - Inside source: true *** True Line Result - end -** Processing line: ~ gtk.notify! "Canvas saved."~ + args.state.player.w, +** Processing line: ~ args.state.player.h, 255, 255, 255]~ - Inside source: true *** True Line Result - gtk.notify! "Canvas saved." -** Processing line: ~ end~ + args.state.player.h, 255, 255, 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # l to load~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # l to load -** Processing line: ~ if inputs.keyboard.key_down.l~ + def tick args +** Processing line: ~ defaults args~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.l -** Processing line: ~ args.state = gtk.deserialize_state 'canvas/state.txt'~ + defaults args +** Processing line: ~ input args~ - Inside source: true *** True Line Result - args.state = gtk.deserialize_state 'canvas/state.txt' -** Processing line: ~ animation_frames.each_with_index do |a, i|~ + input args +** Processing line: ~ calc args~ - Inside source: true *** True Line Result - animation_frames.each_with_index do |a, i| -** Processing line: ~ queues.update_rt_animation_frame << { index: i,~ + calc args +** Processing line: ~ render args~ - Inside source: true *** True Line Result - queues.update_rt_animation_frame << { index: i, -** Processing line: ~ at: state.tick_count + i,~ + render args +** Processing line: ~ end~ - Inside source: true *** True Line Result - at: state.tick_count + i, -** Processing line: ~ queue_sprite_creation: true }~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - queue_sprite_creation: true } -** Processing line: ~ end~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - end -** Processing line: ~ gtk.notify! "Canvas loaded."~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - gtk.notify! "Canvas loaded." -** Processing line: ~ end~ + +** Processing line: ~*** Performance - Sprites As Hash - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Performance - Sprites As Hash - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/09_performance/01_sprites_as_hash/app/main.rb~ - Inside source: true *** True Line Result - end + # ./samples/09_performance/01_sprites_as_hash/app/main.rb ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # d to go into delete mode, release to paint~ -- Inside source: true -*** True Line Result - # d to go into delete mode, release to paint -** Processing line: ~ if inputs.keyboard.key_held.d~ +** Processing line: ~ # Sprites represented as Hashes using the queue ~args.outputs.sprites~~ - Inside source: true *** True Line Result - if inputs.keyboard.key_held.d -** Processing line: ~ state.edit_mode = :erasing~ + # Sprites represented as Hashes using the queue ~args.outputs.sprites~ +** Processing line: ~ # code up, but are the "slowest" to render.~ - Inside source: true *** True Line Result - state.edit_mode = :erasing -** Processing line: ~ gtk.notify! "Erasing." if inputs.keyboard.key_held.d == (state.tick_count - 1)~ + # code up, but are the "slowest" to render. +** Processing line: ~ # The reason for this is the access of the key in the Hash and also~ - Inside source: true *** True Line Result - gtk.notify! "Erasing." if inputs.keyboard.key_held.d == (state.tick_count - 1) -** Processing line: ~ elsif inputs.keyboard.key_up.d~ + # The reason for this is the access of the key in the Hash and also +** Processing line: ~ # because the data args.outputs.sprites is cleared every tick.~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_up.d -** Processing line: ~ state.edit_mode = :drawing~ + # because the data args.outputs.sprites is cleared every tick. +** Processing line: ~ def random_x args~ - Inside source: true *** True Line Result - state.edit_mode = :drawing -** Processing line: ~ gtk.notify! "Drawing."~ + def random_x args +** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ - Inside source: true *** True Line Result - gtk.notify! "Drawing." -** Processing line: ~ end~ + (args.grid.w.randomize :ratio) * -1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # a to add a frame to the end~ +** Processing line: ~ def random_y args~ - Inside source: true *** True Line Result - # a to add a frame to the end -** Processing line: ~ if inputs.keyboard.key_down.a~ + def random_y args +** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.a -** Processing line: ~ queues.create_sprite << { index: state.animation_frames_selected_index,~ + (args.grid.h.randomize :ratio) * -1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - queues.create_sprite << { index: state.animation_frames_selected_index, -** Processing line: ~ at: state.tick_count }~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - at: state.tick_count } -** Processing line: ~ queues.create_sprite << { index: state.animation_frames_selected_index + 1,~ + +** Processing line: ~ def random_speed~ - Inside source: true *** True Line Result - queues.create_sprite << { index: state.animation_frames_selected_index + 1, -** Processing line: ~ at: state.tick_count }~ + def random_speed +** Processing line: ~ 1 + (4.randomize :ratio)~ - Inside source: true *** True Line Result - at: state.tick_count } -** Processing line: ~ add_animation_frame_to_end~ + 1 + (4.randomize :ratio) +** Processing line: ~ end~ - Inside source: true *** True Line Result - add_animation_frame_to_end -** Processing line: ~ gtk.notify! "Frame added to end."~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - gtk.notify! "Frame added to end." -** Processing line: ~ end~ + +** Processing line: ~ def new_star args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def new_star args +** Processing line: ~ {~ - Inside source: true *** True Line Result - -** Processing line: ~ # c or t to copy~ + { +** Processing line: ~ x: (random_x args),~ - Inside source: true *** True Line Result - # c or t to copy -** Processing line: ~ if (inputs.keyboard.key_down.c || inputs.keyboard.key_down.t)~ + x: (random_x args), +** Processing line: ~ y: (random_y args),~ - Inside source: true *** True Line Result - if (inputs.keyboard.key_down.c || inputs.keyboard.key_down.t) -** Processing line: ~ state.clipboard = [selected_animation_frame[:pixels]].flatten~ + y: (random_y args), +** Processing line: ~ w: 4, h: 4, path: 'sprites/tiny-star.png',~ - Inside source: true *** True Line Result - state.clipboard = [selected_animation_frame[:pixels]].flatten -** Processing line: ~ gtk.notify! "Current frame copied."~ + w: 4, h: 4, path: 'sprites/tiny-star.png', +** Processing line: ~ s: random_speed~ - Inside source: true *** True Line Result - gtk.notify! "Current frame copied." -** Processing line: ~ end~ + s: random_speed +** Processing line: ~ }~ - 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: ~ # v or q to paste~ +** Processing line: ~ def move_star args, star~ - Inside source: true *** True Line Result - # v or q to paste -** Processing line: ~ if (inputs.keyboard.key_down.v || inputs.keyboard.key_down.q) && state.clipboard~ + def move_star args, star +** Processing line: ~ star.x += star[:s]~ - Inside source: true *** True Line Result - if (inputs.keyboard.key_down.v || inputs.keyboard.key_down.q) && state.clipboard -** Processing line: ~ selected_animation_frame[:pixels] = [state.clipboard].flatten~ + star.x += star[:s] +** Processing line: ~ star.y += star[:s]~ - Inside source: true *** True Line Result - selected_animation_frame[:pixels] = [state.clipboard].flatten -** Processing line: ~ queues.update_rt_animation_frame << { index: state.animation_frames_selected_index,~ + star.y += star[:s] +** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ - Inside source: true *** True Line Result - queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, -** Processing line: ~ at: state.tick_count,~ + if star.x > args.grid.w || star.y > args.grid.h +** Processing line: ~ star.x = (random_x args)~ - Inside source: true *** True Line Result - at: state.tick_count, -** Processing line: ~ queue_sprite_creation: true }~ + star.x = (random_x args) +** Processing line: ~ star.y = (random_y args)~ - Inside source: true *** True Line Result - queue_sprite_creation: true } -** Processing line: ~ gtk.notify! "Pasted."~ + star.y = (random_y args) +** Processing line: ~ star[:s] = random_speed~ - Inside source: true *** True Line Result - gtk.notify! "Pasted." -** Processing line: ~ end~ + star[:s] = random_speed +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # f to go forward/next frame~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # f to go forward/next frame -** Processing line: ~ if (inputs.keyboard.key_down.f)~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - if (inputs.keyboard.key_down.f) -** Processing line: ~ if (state.animation_frames_selected_index == (state.animation_frames.length - 1))~ + def tick args +** Processing line: ~ args.state.star_count ||= 0~ - Inside source: true *** True Line Result - if (state.animation_frames_selected_index == (state.animation_frames.length - 1)) -** Processing line: ~ state.animation_frames_selected_index = 0~ + args.state.star_count ||= 0 +** Processing line: ~~ - Inside source: true *** True Line Result - state.animation_frames_selected_index = 0 -** Processing line: ~ else~ + +** Processing line: ~ # sets console command when sample app initially opens~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.animation_frames_selected_index += 1~ + # sets console command when sample app initially opens +** Processing line: ~ if Kernel.global_tick_count == 0~ - Inside source: true *** True Line Result - state.animation_frames_selected_index += 1 -** Processing line: ~ end~ + if Kernel.global_tick_count == 0 +** Processing line: ~ puts "* INFO - Please specify the number of sprites to render."~ - Inside source: true *** True Line Result - end -** Processing line: ~ gtk.notify! "Next frame."~ + 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 - gtk.notify! "Next frame." -** Processing line: ~ end~ + args.gtk.console.set_command "reset_with count: 100" +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # b to go back/previous frame~ +** Processing line: ~ # init~ - Inside source: true *** True Line Result - # b to go back/previous frame -** Processing line: ~ if (inputs.keyboard.key_down.b)~ + # init +** Processing line: ~ if args.state.tick_count == 0~ - Inside source: true *** True Line Result - if (inputs.keyboard.key_down.b) -** Processing line: ~ if (state.animation_frames_selected_index == 0)~ + if args.state.tick_count == 0 +** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ - Inside source: true *** True Line Result - if (state.animation_frames_selected_index == 0) -** Processing line: ~ state.animation_frames_selected_index = state.animation_frames.length - 1~ + args.state.stars = args.state.star_count.map { |i| new_star args } +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.animation_frames_selected_index = state.animation_frames.length - 1 -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.animation_frames_selected_index -= 1~ + +** Processing line: ~ # update~ - Inside source: true *** True Line Result - state.animation_frames_selected_index -= 1 -** Processing line: ~ end~ + # update +** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ - Inside source: true *** True Line Result - end -** Processing line: ~ gtk.notify! "Previous frame."~ + args.state.stars.each { |s| move_star args, s } +** Processing line: ~~ - Inside source: true *** True Line Result - gtk.notify! "Previous frame." -** Processing line: ~ end~ + +** Processing line: ~ # render~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # render +** Processing line: ~ args.outputs.sprites << args.state.stars~ - Inside source: true *** True Line Result - -** Processing line: ~ # x to delete frame~ + args.outputs.sprites << args.state.stars +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - # x to delete frame -** Processing line: ~ if (inputs.keyboard.key_down.x) && animation_frames.length > 1~ + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ - Inside source: true *** True Line Result - if (inputs.keyboard.key_down.x) && animation_frames.length > 1 -** Processing line: ~ state.clipboard = selected_animation_frame[:pixels]~ + args.outputs.primitives << args.gtk.current_framerate_primitives +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.clipboard = selected_animation_frame[:pixels] -** Processing line: ~ state.animation_frames = animation_frames.find_all { |v| v[:index] != state.animation_frames_selected_index }~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.animation_frames = animation_frames.find_all { |v| v[:index] != state.animation_frames_selected_index } -** Processing line: ~ if state.animation_frames_selected_index >= state.animation_frames.length~ + +** Processing line: ~ # resets game, and assigns star count given by user~ - Inside source: true *** True Line Result - if state.animation_frames_selected_index >= state.animation_frames.length -** Processing line: ~ state.animation_frames_selected_index = state.animation_frames.length - 1~ + # resets game, and assigns star count given by user +** Processing line: ~ def reset_with count: count~ - Inside source: true *** True Line Result - state.animation_frames_selected_index = state.animation_frames.length - 1 -** Processing line: ~ end~ + def reset_with count: count +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - end -** Processing line: ~ gtk.notify! "Frame deleted."~ + $gtk.reset +** Processing line: ~ $gtk.args.state.star_count = count~ - Inside source: true *** True Line Result - gtk.notify! "Frame deleted." -** Processing line: ~ end~ + $gtk.args.state.star_count = count +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + end +** Processing line: ~~ - 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: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ def calc_auto_export~ +** Processing line: ~*** Performance - Sprites As Entities - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Performance - Sprites As Entities - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/09_performance/02_sprites_as_entities/app/main.rb~ - Inside source: true *** True Line Result - def calc_auto_export -** Processing line: ~ return if user_is_editing?~ + # ./samples/09_performance/02_sprites_as_entities/app/main.rb +** Processing line: ~ # Sprites represented as Entities using the queue ~args.outputs.sprites~~ - Inside source: true *** True Line Result - return if user_is_editing? -** Processing line: ~ return if state.last_mouse_up.elapsed_time != 30~ + # Sprites represented as Entities using the queue ~args.outputs.sprites~ +** Processing line: ~ # yields nicer access apis over Hashes, but require a bit more code upfront.~ - Inside source: true *** True Line Result - return if state.last_mouse_up.elapsed_time != 30 -** Processing line: ~ # auto export current animation frame if there is no editing for 30 ticks~ + # yields nicer access apis over Hashes, but require a bit more code upfront. +** Processing line: ~ # The hash sample has to use star[:s] to get the speed of the star, but~ - Inside source: true *** True Line Result - # auto export current animation frame if there is no editing for 30 ticks -** Processing line: ~ queues.create_sprite << { index: state.animation_frames_selected_index,~ + # The hash sample has to use star[:s] to get the speed of the star, but +** Processing line: ~ # an entity can use .s instead.~ - Inside source: true *** True Line Result - queues.create_sprite << { index: state.animation_frames_selected_index, -** Processing line: ~ at: state.tick_count }~ + # an entity can use .s instead. +** Processing line: ~ def random_x args~ - Inside source: true *** True Line Result - at: state.tick_count } -** Processing line: ~ end~ + def random_x args +** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + (args.grid.w.randomize :ratio) * -1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_buttons_frame_selection~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def calc_buttons_frame_selection -** Processing line: ~ state.buttons_frame_selection.items = animation_frames.length.map_with_index do |i|~ + +** Processing line: ~ def random_y args~ - Inside source: true *** True Line Result - state.buttons_frame_selection.items = animation_frames.length.map_with_index do |i| -** Processing line: ~ { x: state.buttons_frame_selection.left + i * state.buttons_frame_selection.size,~ + def random_y args +** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ - Inside source: true *** True Line Result - { x: state.buttons_frame_selection.left + i * state.buttons_frame_selection.size, -** Processing line: ~ y: state.buttons_frame_selection.top - state.buttons_frame_selection.size,~ + (args.grid.h.randomize :ratio) * -1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - y: state.buttons_frame_selection.top - state.buttons_frame_selection.size, -** Processing line: ~ inner_rect: {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - inner_rect: { -** Processing line: ~ x: (state.buttons_frame_selection.left + 2) + i * state.buttons_frame_selection.size,~ + +** Processing line: ~ def random_speed~ - Inside source: true *** True Line Result - x: (state.buttons_frame_selection.left + 2) + i * state.buttons_frame_selection.size, -** Processing line: ~ y: (state.buttons_frame_selection.top - state.buttons_frame_selection.size + 2),~ + def random_speed +** Processing line: ~ 1 + (4.randomize :ratio)~ - Inside source: true *** True Line Result - y: (state.buttons_frame_selection.top - state.buttons_frame_selection.size + 2), -** Processing line: ~ w: 16,~ + 1 + (4.randomize :ratio) +** Processing line: ~ end~ - Inside source: true *** True Line Result - w: 16, -** Processing line: ~ h: 16,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - h: 16, -** Processing line: ~ },~ + +** Processing line: ~ def new_star args~ - Inside source: true *** True Line Result - }, -** Processing line: ~ w: state.buttons_frame_selection.size,~ + def new_star args +** Processing line: ~ args.state.new_entity :star, {~ - Inside source: true *** True Line Result - w: state.buttons_frame_selection.size, -** Processing line: ~ h: state.buttons_frame_selection.size,~ + args.state.new_entity :star, { +** Processing line: ~ x: (random_x args),~ - Inside source: true *** True Line Result - h: state.buttons_frame_selection.size, -** Processing line: ~ index: i }~ + x: (random_x args), +** Processing line: ~ y: (random_y args),~ - Inside source: true *** True Line Result - index: i } -** Processing line: ~ end~ + y: (random_y args), +** Processing line: ~ w: 4, h: 4,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + w: 4, h: 4, +** Processing line: ~ path: 'sprites/tiny-star.png',~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + path: 'sprites/tiny-star.png', +** Processing line: ~ s: random_speed~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_animation_frames~ + s: random_speed +** Processing line: ~ }~ - Inside source: true *** True Line Result - def calc_animation_frames -** Processing line: ~ animation_frames.each_with_index do |animation_frame, i|~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - animation_frames.each_with_index do |animation_frame, i| -** Processing line: ~ animation_frame[:index] = i~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - animation_frame[:index] = i -** Processing line: ~ animation_frame[:rt_name] = "animation_frame_#{i}"~ + +** Processing line: ~ def move_star args, star~ - Inside source: true *** True Line Result - animation_frame[:rt_name] = "animation_frame_#{i}" -** Processing line: ~ end~ + def move_star args, star +** Processing line: ~ star.x += star.s~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + star.x += star.s +** Processing line: ~ star.y += star.s~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + star.y += star.s +** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ - Inside source: true *** True Line Result - -** Processing line: ~ def process_queue_create_sprite~ + if star.x > args.grid.w || star.y > args.grid.h +** Processing line: ~ star.x = (random_x args)~ - Inside source: true *** True Line Result - def process_queue_create_sprite -** Processing line: ~ sprites_to_create = queues.create_sprite~ + star.x = (random_x args) +** Processing line: ~ star.y = (random_y args)~ - Inside source: true *** True Line Result - sprites_to_create = queues.create_sprite -** Processing line: ~ .find_all { |h| h[:at].elapsed? }~ + star.y = (random_y args) +** Processing line: ~ star.s = random_speed~ - Inside source: true *** True Line Result - .find_all { |h| h[:at].elapsed? } -** Processing line: ~~ + star.s = random_speed +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ queues.create_sprite = queues.create_sprite - sprites_to_create~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - queues.create_sprite = queues.create_sprite - sprites_to_create + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ sprites_to_create.each do |h|~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - sprites_to_create.each do |h| -** Processing line: ~ export_animation_frame h[:index], h[:path_override]~ + def tick args +** Processing line: ~ args.state.star_count ||= 0~ - Inside source: true *** True Line Result - export_animation_frame h[:index], h[:path_override] -** Processing line: ~ end~ + args.state.star_count ||= 0 +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ # sets console command when sample app initially opens~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # sets console command when sample app initially opens +** Processing line: ~ if Kernel.global_tick_count == 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def process_queue_reset_sprite~ + if Kernel.global_tick_count == 0 +** Processing line: ~ puts "* INFO - Please specify the number of sprites to render."~ - Inside source: true *** True Line Result - def process_queue_reset_sprite -** Processing line: ~ sprites_to_reset = queues.reset_sprite~ + 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 - sprites_to_reset = queues.reset_sprite -** Processing line: ~ .find_all { |h| h[:at].elapsed? }~ + args.gtk.console.set_command "reset_with count: 100" +** Processing line: ~ end~ - Inside source: true *** True Line Result - .find_all { |h| h[:at].elapsed? } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ queues.reset_sprite -= sprites_to_reset~ +** Processing line: ~ # init~ - Inside source: true *** True Line Result - queues.reset_sprite -= sprites_to_reset -** Processing line: ~~ + # init +** Processing line: ~ if args.state.tick_count == 0~ - Inside source: true *** True Line Result - -** Processing line: ~ sprites_to_reset.each { |h| gtk.reset_sprite (sprite_path h[:index]) }~ + if args.state.tick_count == 0 +** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ - Inside source: true *** True Line Result - sprites_to_reset.each { |h| gtk.reset_sprite (sprite_path h[:index]) } + args.state.stars = args.state.star_count.map { |i| new_star args } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -50779,346 +54008,278 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def process_queue_update_rt_animation_frame~ -- Inside source: true -*** True Line Result - def process_queue_update_rt_animation_frame -** Processing line: ~ animation_frames_to_update = queues.update_rt_animation_frame~ +** Processing line: ~ # update~ - Inside source: true *** True Line Result - animation_frames_to_update = queues.update_rt_animation_frame -** Processing line: ~ .find_all { |h| h[:at].elapsed? }~ + # update +** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ - Inside source: true *** True Line Result - .find_all { |h| h[:at].elapsed? } + args.state.stars.each { |s| move_star args, s } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ queues.update_rt_animation_frame -= animation_frames_to_update~ +** Processing line: ~ # render~ - Inside source: true *** True Line Result - queues.update_rt_animation_frame -= animation_frames_to_update -** Processing line: ~~ + # render +** Processing line: ~ args.outputs.sprites << args.state.stars~ - Inside source: true *** True Line Result - -** Processing line: ~ animation_frames_to_update.each do |h|~ + args.outputs.sprites << args.state.stars +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - animation_frames_to_update.each do |h| -** Processing line: ~ update_animation_frame_render_target animation_frames[h[:index]]~ + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ - Inside source: true *** True Line Result - update_animation_frame_render_target animation_frames[h[:index]] + args.outputs.primitives << args.gtk.current_framerate_primitives +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if h[:queue_sprite_creation]~ +** Processing line: ~ # resets game, and assigns star count given by user~ - Inside source: true *** True Line Result - if h[:queue_sprite_creation] -** Processing line: ~ queues.create_sprite << { index: h[:index],~ + # resets game, and assigns star count given by user +** Processing line: ~ def reset_with count: count~ - Inside source: true *** True Line Result - queues.create_sprite << { index: h[:index], -** Processing line: ~ at: state.tick_count + 1 }~ + def reset_with count: count +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - at: state.tick_count + 1 } -** Processing line: ~ end~ + $gtk.reset +** Processing line: ~ $gtk.args.state.star_count = count~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + $gtk.args.state.star_count = count +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + end +** Processing line: ~~ - 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: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ def update_animation_frame_render_target animation_frame~ -- Inside source: true +** Processing line: ~*** Performance - Sprites As Strict Entities - main.rb~ +- Header detected. *** True Line Result - def update_animation_frame_render_target animation_frame -** Processing line: ~ return if !animation_frame~ -- Inside source: true + *** True Line Result - return if !animation_frame -** Processing line: ~~ -- Inside source: true +*** Performance - Sprites As Strict Entities - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ outputs[animation_frame[:rt_name]].width = state.rt_canvas.size~ +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb~ - Inside source: true *** True Line Result - outputs[animation_frame[:rt_name]].width = state.rt_canvas.size -** Processing line: ~ outputs[animation_frame[:rt_name]].height = state.rt_canvas.size~ + # ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb +** Processing line: ~ # Sprites represented as StrictEntities using the queue ~args.outputs.sprites~~ - Inside source: true *** True Line Result - outputs[animation_frame[:rt_name]].height = state.rt_canvas.size -** Processing line: ~ outputs[animation_frame[:rt_name]].solids << animation_frame[:pixels].map do |f|~ + # Sprites represented as StrictEntities using the queue ~args.outputs.sprites~ +** Processing line: ~ # yields apis access similar to Entities, but all properties that can be set on the~ - Inside source: true *** True Line Result - outputs[animation_frame[:rt_name]].solids << animation_frame[:pixels].map do |f| -** Processing line: ~ { x: f.x,~ + # yields apis access similar to Entities, but all properties that can be set on the +** Processing line: ~ # entity must be predefined with a default value. Strict entities do not support the~ - Inside source: true *** True Line Result - { x: f.x, -** Processing line: ~ y: f.y,~ + # entity must be predefined with a default value. Strict entities do not support the +** Processing line: ~ # addition of new properties after the fact. They are more performant than OpenEntities~ - Inside source: true *** True Line Result - y: f.y, -** Processing line: ~ w: 1,~ + # addition of new properties after the fact. They are more performant than OpenEntities +** Processing line: ~ # because of this constraint.~ - Inside source: true *** True Line Result - w: 1, -** Processing line: ~ h: 1, r: 255, g: 255, b: 255 }~ + # because of this constraint. +** Processing line: ~ def random_x args~ - Inside source: true *** True Line Result - h: 1, r: 255, g: 255, b: 255 } -** Processing line: ~ end~ + def random_x args +** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + (args.grid.w.randomize :ratio) * -1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def animation_frames~ +** Processing line: ~ def random_y args~ - Inside source: true *** True Line Result - def animation_frames -** Processing line: ~ state.animation_frames~ + def random_y args +** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ - Inside source: true *** True Line Result - state.animation_frames -** Processing line: ~ end~ + (args.grid.h.randomize :ratio) * -1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def add_animation_frame_to_end~ -- Inside source: true -*** True Line Result - def add_animation_frame_to_end -** Processing line: ~ animation_frames << {~ +** Processing line: ~ def random_speed~ - Inside source: true *** True Line Result - animation_frames << { -** Processing line: ~ index: animation_frames.length,~ + def random_speed +** Processing line: ~ 1 + (4.randomize :ratio)~ - Inside source: true *** True Line Result - index: animation_frames.length, -** Processing line: ~ pixels: [],~ + 1 + (4.randomize :ratio) +** Processing line: ~ end~ - Inside source: true *** True Line Result - pixels: [], -** Processing line: ~ rt_name: "animation_frame_#{animation_frames.length}"~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - rt_name: "animation_frame_#{animation_frames.length}" -** Processing line: ~ }~ + +** Processing line: ~ def new_star args~ - Inside source: true *** True Line Result - } -** Processing line: ~~ + def new_star args +** Processing line: ~ args.state.new_entity_strict(:star,~ - Inside source: true *** True Line Result - -** Processing line: ~ state.animation_frames_selected_index = (animation_frames.length - 1)~ + args.state.new_entity_strict(:star, +** Processing line: ~ x: (random_x args),~ - Inside source: true *** True Line Result - state.animation_frames_selected_index = (animation_frames.length - 1) -** Processing line: ~ queues.update_rt_animation_frame << { index: state.animation_frames_selected_index,~ + x: (random_x args), +** Processing line: ~ y: (random_y args),~ - Inside source: true *** True Line Result - queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, -** Processing line: ~ at: state.tick_count,~ + y: (random_y args), +** Processing line: ~ w: 4, h: 4,~ - Inside source: true *** True Line Result - at: state.tick_count, -** Processing line: ~ queue_sprite_creation: true }~ + w: 4, h: 4, +** Processing line: ~ path: 'sprites/tiny-star.png',~ - Inside source: true *** True Line Result - queue_sprite_creation: true } -** Processing line: ~ end~ + path: 'sprites/tiny-star.png', +** Processing line: ~ s: random_speed) do |entity|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + s: random_speed) do |entity| +** Processing line: ~ # invoke attr_sprite so that it responds to~ - Inside source: true *** True Line Result - -** Processing line: ~ def sprite_path i~ + # invoke attr_sprite so that it responds to +** Processing line: ~ # all properties that are required to render a sprite~ - Inside source: true *** True Line Result - def sprite_path i -** Processing line: ~ "canvas/sprite-#{i}.png"~ + # all properties that are required to render a sprite +** Processing line: ~ entity.attr_sprite~ - Inside source: true *** True Line Result - "canvas/sprite-#{i}.png" + entity.attr_sprite ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def export_animation_frame i, path_override = nil~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def export_animation_frame i, path_override = nil -** Processing line: ~ return if !state.animation_frames[i]~ + +** Processing line: ~ def move_star args, star~ - Inside source: true *** True Line Result - return if !state.animation_frames[i] -** Processing line: ~~ + def move_star args, star +** Processing line: ~ star.x += star.s~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.screenshots << state.buttons_frame_selection~ + star.x += star.s +** Processing line: ~ star.y += star.s~ - Inside source: true *** True Line Result - outputs.screenshots << state.buttons_frame_selection -** Processing line: ~ .items[i][:inner_rect]~ + star.y += star.s +** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ - Inside source: true *** True Line Result - .items[i][:inner_rect] -** Processing line: ~ .merge(path: path_override || (sprite_path i))~ + if star.x > args.grid.w || star.y > args.grid.h +** Processing line: ~ star.x = (random_x args)~ - Inside source: true *** True Line Result - .merge(path: path_override || (sprite_path i)) -** Processing line: ~~ + star.x = (random_x args) +** Processing line: ~ star.y = (random_y args)~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.screenshots << state.buttons_frame_selection~ + star.y = (random_y args) +** Processing line: ~ star.s = random_speed~ - Inside source: true *** True Line Result - outputs.screenshots << state.buttons_frame_selection -** Processing line: ~ .items[i][:inner_rect]~ + star.s = random_speed +** Processing line: ~ end~ - Inside source: true *** True Line Result - .items[i][:inner_rect] -** Processing line: ~ .merge(path: "tmp/sprite_backups/#{Time.now.to_i}-sprite-#{i}.png")~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - .merge(path: "tmp/sprite_backups/#{Time.now.to_i}-sprite-#{i}.png") + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ queues.reset_sprite << { index: i, at: state.tick_count }~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - queues.reset_sprite << { index: i, at: state.tick_count } -** Processing line: ~ end~ + def tick args +** Processing line: ~ args.state.star_count ||= 0~ - Inside source: true *** True Line Result - end + args.state.star_count ||= 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def selected_animation_frame~ +** Processing line: ~ # sets console command when sample app initially opens~ - Inside source: true *** True Line Result - def selected_animation_frame -** Processing line: ~ state.animation_frames[state.animation_frames_selected_index]~ -- Inside source: true -*** True Line Result - state.animation_frames[state.animation_frames_selected_index] -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ def edit_current_animation_frame point~ -- Inside source: true -*** True Line Result - def edit_current_animation_frame point -** Processing line: ~ draw_area_point = (to_draw_area point)~ -- Inside source: true -*** True Line Result - draw_area_point = (to_draw_area point) -** Processing line: ~ if state.edit_mode == :drawing && (!selected_animation_frame[:pixels].include? draw_area_point)~ -- Inside source: true -*** True Line Result - if state.edit_mode == :drawing && (!selected_animation_frame[:pixels].include? draw_area_point) -** Processing line: ~ selected_animation_frame[:pixels] << draw_area_point~ -- Inside source: true -*** True Line Result - selected_animation_frame[:pixels] << draw_area_point -** Processing line: ~ queues.update_rt_animation_frame << { index: state.animation_frames_selected_index,~ -- Inside source: true -*** True Line Result - queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, -** Processing line: ~ at: state.tick_count,~ -- Inside source: true -*** True Line Result - at: state.tick_count, -** Processing line: ~ queue_sprite_creation: !user_is_editing? }~ -- Inside source: true -*** True Line Result - queue_sprite_creation: !user_is_editing? } -** Processing line: ~ elsif state.edit_mode == :erasing && (selected_animation_frame[:pixels].include? draw_area_point)~ -- Inside source: true -*** True Line Result - elsif state.edit_mode == :erasing && (selected_animation_frame[:pixels].include? draw_area_point) -** Processing line: ~ selected_animation_frame[:pixels] = selected_animation_frame[:pixels].reject { |p| p == draw_area_point }~ -- Inside source: true -*** True Line Result - selected_animation_frame[:pixels] = selected_animation_frame[:pixels].reject { |p| p == draw_area_point } -** Processing line: ~ queues.update_rt_animation_frame << { index: state.animation_frames_selected_index,~ -- Inside source: true -*** True Line Result - queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, -** Processing line: ~ at: state.tick_count,~ -- Inside source: true -*** True Line Result - at: state.tick_count, -** Processing line: ~ queue_sprite_creation: !user_is_editing? }~ -- Inside source: true -*** True Line Result - queue_sprite_creation: !user_is_editing? } -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ + # sets console command when sample app initially opens +** Processing line: ~ if Kernel.global_tick_count == 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def user_is_editing?~ + if Kernel.global_tick_count == 0 +** Processing line: ~ puts "* INFO - Please specify the number of sprites to render."~ - Inside source: true *** True Line Result - def user_is_editing? -** Processing line: ~ state.last_mouse_down > state.last_mouse_up~ + 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 - state.last_mouse_down > state.last_mouse_up + args.gtk.console.set_command "reset_with count: 100" ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -51127,30 +54288,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 to_draw_area point~ -- Inside source: true -*** True Line Result - def to_draw_area point -** Processing line: ~ x, y = point~ -- Inside source: true -*** True Line Result - x, y = point -** Processing line: ~ x -= rt_canvas.sprite.x~ -- Inside source: true -*** True Line Result - x -= rt_canvas.sprite.x -** Processing line: ~ y -= rt_canvas.sprite.y~ +** Processing line: ~ # init~ - Inside source: true *** True Line Result - y -= rt_canvas.sprite.y -** Processing line: ~ { x: x.idiv(rt_canvas.zoom),~ + # init +** Processing line: ~ if args.state.tick_count == 0~ - Inside source: true *** True Line Result - { x: x.idiv(rt_canvas.zoom), -** Processing line: ~ y: y.idiv(rt_canvas.zoom) }~ + if args.state.tick_count == 0 +** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ - Inside source: true *** True Line Result - y: y.idiv(rt_canvas.zoom) } + args.state.stars = args.state.star_count.map { |i| new_star args } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -51159,34 +54308,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def rt_canvas~ -- Inside source: true -*** True Line Result - def rt_canvas -** Processing line: ~ state.rt_canvas ||= state.new_entity(:rt_canvas)~ +** Processing line: ~ # update~ - Inside source: true *** True Line Result - state.rt_canvas ||= state.new_entity(:rt_canvas) -** Processing line: ~ end~ + # update +** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ - Inside source: true *** True Line Result - end + args.state.stars.each { |s| move_star args, s } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def queues~ +** Processing line: ~ # render~ - Inside source: true *** True Line Result - def queues -** Processing line: ~ state.queues ||= state.new_entity(:queues)~ + # render +** Processing line: ~ args.outputs.sprites << args.state.stars~ - Inside source: true *** True Line Result - state.queues ||= state.new_entity(:queues) -** Processing line: ~ end~ + args.outputs.sprites << args.state.stars +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - end + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ +- Inside source: true +*** True Line Result + args.outputs.primitives << args.gtk.current_framerate_primitives ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -51195,26 +54344,22 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ $game = OneBitLowrezPaint.new~ -- Inside source: true -*** True Line Result - $game = OneBitLowrezPaint.new -** Processing line: ~~ +** Processing line: ~ # resets game, and assigns star count given by user~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + # resets game, and assigns star count given by user +** Processing line: ~ def reset_with count: count~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ $game.args = args~ + def reset_with count: count +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - $game.args = args -** Processing line: ~ $game.tick~ + $gtk.reset +** Processing line: ~ $gtk.args.state.star_count = count~ - Inside source: true *** True Line Result - $game.tick + $gtk.args.state.star_count = count ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -51223,14 +54368,6 @@ 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 @@ -51239,346 +54376,390 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Dev Tools - Tile Editor Starting Point - main.rb~ +** Processing line: ~*** Performance - Sprites As Classes - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Dev Tools - Tile Editor Starting Point - main.rb +*** Performance - Sprites As Classes - 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_dev_tools/tile_editor_starting_point/app/main.rb~ +** Processing line: ~ # ./samples/09_performance/04_sprites_as_classes/app/main.rb~ - Inside source: true *** True Line Result - # ./samples/99_genre_dev_tools/tile_editor_starting_point/app/main.rb -** Processing line: ~ =begin~ + # ./samples/09_performance/04_sprites_as_classes/app/main.rb +** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.sprites~.~ - Inside source: true *** True Line Result - =begin -** Processing line: ~~ + # Sprites represented as Classes using the queue ~args.outputs.sprites~. +** Processing line: ~ # gives you full control of property declaration and method invocation.~ - Inside source: true *** True Line Result - -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ + # gives you full control of property declaration and method invocation. +** Processing line: ~ # They are more performant than OpenEntities and StrictEntities, but more code upfront.~ - Inside source: true *** True Line Result - APIs listing that haven't been encountered in previous sample apps: + # They are more performant than OpenEntities and StrictEntities, but more code upfront. +** Processing line: ~ class Star~ +- Inside source: true +*** True Line Result + class Star +** Processing line: ~ attr_sprite~ +- Inside source: true +*** True Line Result + attr_sprite ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - to_s: Returns a string representation of an object.~ +** Processing line: ~ def initialize grid~ - Inside source: true *** True Line Result - - to_s: Returns a string representation of an object. -** Processing line: ~ For example, if we had~ + def initialize grid +** Processing line: ~ @grid = grid~ - Inside source: true *** True Line Result - For example, if we had -** Processing line: ~ 500.to_s~ + @grid = grid +** Processing line: ~ @x = (rand @grid.w) * -1~ - Inside source: true *** True Line Result - 500.to_s -** Processing line: ~ the string "500" would be returned.~ + @x = (rand @grid.w) * -1 +** Processing line: ~ @y = (rand @grid.h) * -1~ - Inside source: true *** True Line Result - the string "500" would be returned. -** Processing line: ~ Similar to to_i, which returns an integer representation of an object.~ + @y = (rand @grid.h) * -1 +** Processing line: ~ @w = 4~ - Inside source: true *** True Line Result - Similar to to_i, which returns an integer representation of an object. -** Processing line: ~~ + @w = 4 +** Processing line: ~ @h = 4~ - Inside source: true *** True Line Result - -** Processing line: ~ - Ceil: Returns an integer number greater than or equal to the original~ + @h = 4 +** Processing line: ~ @s = 1 + (4.randomize :ratio)~ - Inside source: true *** True Line Result - - Ceil: Returns an integer number greater than or equal to the original -** Processing line: ~ with no decimal.~ + @s = 1 + (4.randomize :ratio) +** Processing line: ~ @path = 'sprites/tiny-star.png'~ - Inside source: true *** True Line Result - with no decimal. + @path = 'sprites/tiny-star.png' +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Reminders:~ +** Processing line: ~ def move~ - Inside source: true *** True Line Result - Reminders: -** Processing line: ~~ + def move +** Processing line: ~ @x += @s~ - Inside source: true *** True Line Result - -** Processing line: ~ - ARRAY#inside_rect?: Returns true or false depending on if the point is inside a rect.~ + @x += @s +** Processing line: ~ @y += @s~ - Inside source: true *** True Line Result - - ARRAY#inside_rect?: Returns true or false depending on if the point is inside a rect. -** Processing line: ~~ + @y += @s +** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ + @x = (rand @grid.w) * -1 if @x > @grid.right +** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ - Inside source: true *** True Line Result - - args.outputs.labels: An array. The values generate a label. -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ + @y = (rand @grid.h) * -1 if @y > @grid.top +** Processing line: ~ end~ - Inside source: true *** True Line Result - The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - For more information about labels, go to mygame/documentation/02-labels.md. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ +** Processing line: ~ # calls methods needed for game to run properly~ - Inside source: true *** True Line Result - - args.outputs.sprites: An array. The values generate a sprite. -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, IMAGE PATH]~ + # calls methods needed for game to run properly +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - The parameters are [X, Y, WIDTH, HEIGHT, IMAGE PATH] -** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ + def tick args +** Processing line: ~ # sets console command when sample app initially opens~ - Inside source: true *** True Line Result - For more information about sprites, go to mygame/documentation/05-sprites.md. + # sets console command when sample app initially opens +** Processing line: ~ if Kernel.global_tick_count == 0~ +- Inside source: true +*** True Line Result + if Kernel.global_tick_count == 0 +** Processing line: ~ args.gtk.console.set_command "reset_with count: 100"~ +- Inside source: true +*** True Line Result + args.gtk.console.set_command "reset_with count: 100" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ +** Processing line: ~ # init~ - Inside source: true *** True Line Result - - args.outputs.solids: An array. The values generate a solid. -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ + # init +** Processing line: ~ if args.state.tick_count == 0~ - Inside source: true *** True Line Result - The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE] -** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ + if args.state.tick_count == 0 +** Processing line: ~ args.state.stars = args.state.star_count.map { |i| Star.new args.grid }~ - Inside source: true *** True Line Result - For more information about solids, go to mygame/documentation/03-solids-and-borders.md. -** Processing line: ~~ + args.state.stars = args.state.star_count.map { |i| Star.new args.grid } +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.outputs.lines: An array. The values generate a line.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - - args.outputs.lines: An array. The values generate a line. -** Processing line: ~ The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE]~ + +** Processing line: ~ # update~ - Inside source: true *** True Line Result - The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE] -** Processing line: ~ For more information about lines, go to mygame/documentation/04-lines.md.~ + # update +** Processing line: ~ args.state.stars.each(&:move)~ - Inside source: true *** True Line Result - For more information about lines, go to mygame/documentation/04-lines.md. + args.state.stars.each(&:move) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ +** Processing line: ~ # render~ - Inside source: true *** True Line Result - - args.state.new_entity: Used when we want to create a new object, like a sprite or button. -** Processing line: ~ In this sample app, new_entity is used to create a new button that clears the grid.~ + # render +** Processing line: ~ args.outputs.sprites << args.state.stars~ - Inside source: true *** True Line Result - In this sample app, new_entity is used to create a new button that clears the grid. -** Processing line: ~ (Remember, you can use state to define ANY property and it will be retained across frames.)~ + args.outputs.sprites << args.state.stars +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - (Remember, you can use state to define ANY property and it will be retained across frames.) -** Processing line: ~~ + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ - Inside source: true *** True Line Result - -** Processing line: ~ =end~ + args.outputs.primitives << args.gtk.current_framerate_primitives +** Processing line: ~ end~ - Inside source: true *** True Line Result - =end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # This sample app shows an empty grid that the user can paint in. There are different image tiles that~ +** Processing line: ~ # resets game, and assigns star count given by user~ - Inside source: true *** True Line Result - # This sample app shows an empty grid that the user can paint in. There are different image tiles that -** Processing line: ~ # the user can use to fill the grid, and the "Clear" button can be pressed to clear the grid boxes.~ + # resets game, and assigns star count given by user +** Processing line: ~ def reset_with count: count~ - Inside source: true *** True Line Result - # the user can use to fill the grid, and the "Clear" button can be pressed to clear the grid boxes. -** Processing line: ~~ + def reset_with count: count +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - -** Processing line: ~ class TileEditor~ + $gtk.reset +** Processing line: ~ $gtk.args.state.star_count = count~ - Inside source: true *** True Line Result - class TileEditor -** Processing line: ~ attr_accessor :inputs, :state, :outputs, :grid, :args~ + $gtk.args.state.star_count = count +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_accessor :inputs, :state, :outputs, :grid, :args + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Runs all the methods necessary for the game to function properly.~ +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Performance - Static Sprites As Classes - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Performance - Static Sprites As Classes - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/09_performance/05_static_sprites_as_classes/app/main.rb~ - Inside source: true *** True Line Result - # Runs all the methods necessary for the game to function properly. -** Processing line: ~ def tick~ + # ./samples/09_performance/05_static_sprites_as_classes/app/main.rb +** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.static_sprites~.~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ defaults~ + # Sprites represented as Classes using the queue ~args.outputs.static_sprites~. +** Processing line: ~ # bypasses the queue behavior of ~args.outputs.sprites~. All instances are held~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ render~ + # bypasses the queue behavior of ~args.outputs.sprites~. All instances are held +** Processing line: ~ # by reference. You get better performance, but you are mutating state of held objects~ - Inside source: true *** True Line Result - render -** Processing line: ~ check_click~ + # by reference. You get better performance, but you are mutating state of held objects +** Processing line: ~ # which is less functional/data oriented.~ - Inside source: true *** True Line Result - check_click -** Processing line: ~ draw_buttons~ + # which is less functional/data oriented. +** Processing line: ~ class Star~ - Inside source: true *** True Line Result - draw_buttons -** Processing line: ~ end~ + class Star +** Processing line: ~ attr_sprite~ - Inside source: true *** True Line Result - end + attr_sprite ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets default values~ +** Processing line: ~ def initialize grid~ - Inside source: true *** True Line Result - # Sets default values -** Processing line: ~ # Initialization only happens in the first frame~ + def initialize grid +** Processing line: ~ @grid = grid~ - Inside source: true *** True Line Result - # Initialization only happens in the first frame -** Processing line: ~ # NOTE: The values of some of these variables may seem confusingly large at first.~ + @grid = grid +** Processing line: ~ @x = (rand @grid.w) * -1~ - Inside source: true *** True Line Result - # NOTE: The values of some of these variables may seem confusingly large at first. -** Processing line: ~ # The gridSize is 1600 but it seems a lot smaller on the screen, for example.~ + @x = (rand @grid.w) * -1 +** Processing line: ~ @y = (rand @grid.h) * -1~ - Inside source: true *** True Line Result - # The gridSize is 1600 but it seems a lot smaller on the screen, for example. -** Processing line: ~ # But keep in mind that by using the "W", "A", "S", and "D" keys, you can~ + @y = (rand @grid.h) * -1 +** Processing line: ~ @w = 4~ - Inside source: true *** True Line Result - # But keep in mind that by using the "W", "A", "S", and "D" keys, you can -** Processing line: ~ # move the grid's view in all four directions for more grid spaces.~ + @w = 4 +** Processing line: ~ @h = 4~ - Inside source: true *** True Line Result - # move the grid's view in all four directions for more grid spaces. -** Processing line: ~ def defaults~ + @h = 4 +** Processing line: ~ @s = 1 + (4.randomize :ratio)~ - Inside source: true *** True Line Result - def defaults -** Processing line: ~ state.tileCords ||= []~ + @s = 1 + (4.randomize :ratio) +** Processing line: ~ @path = 'sprites/tiny-star.png'~ - Inside source: true *** True Line Result - state.tileCords ||= [] -** Processing line: ~ state.tileQuantity ||= 6~ + @path = 'sprites/tiny-star.png' +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.tileQuantity ||= 6 -** Processing line: ~ state.tileSize ||= 50~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.tileSize ||= 50 -** Processing line: ~ state.tileSelected ||= 1~ + +** Processing line: ~ def move~ - Inside source: true *** True Line Result - state.tileSelected ||= 1 -** Processing line: ~ state.tempX ||= 50~ + def move +** Processing line: ~ @x += @s~ - Inside source: true *** True Line Result - state.tempX ||= 50 -** Processing line: ~ state.tempY ||= 500~ + @x += @s +** Processing line: ~ @y += @s~ - Inside source: true *** True Line Result - state.tempY ||= 500 -** Processing line: ~ state.speed ||= 4~ + @y += @s +** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ - Inside source: true *** True Line Result - state.speed ||= 4 -** Processing line: ~ state.centerX ||= 4000~ + @x = (rand @grid.w) * -1 if @x > @grid.right +** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ - Inside source: true *** True Line Result - state.centerX ||= 4000 -** Processing line: ~ state.centerY ||= 4000~ + @y = (rand @grid.h) * -1 if @y > @grid.top +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.centerY ||= 4000 -** Processing line: ~ state.originalCenter ||= [state.centerX, state.centerY]~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.originalCenter ||= [state.centerX, state.centerY] -** Processing line: ~ state.gridSize ||= 1600~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.gridSize ||= 1600 -** Processing line: ~ state.lineQuantity ||= 50~ + +** Processing line: ~ # calls methods needed for game to run properly~ - Inside source: true *** True Line Result - state.lineQuantity ||= 50 -** Processing line: ~ state.increment ||= state.gridSize / state.lineQuantity~ + # calls methods needed for game to run properly +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - state.increment ||= state.gridSize / state.lineQuantity -** Processing line: ~ state.gridX ||= []~ + def tick args +** Processing line: ~ # sets console command when sample app initially opens~ - Inside source: true *** True Line Result - state.gridX ||= [] -** Processing line: ~ state.gridY ||= []~ + # sets console command when sample app initially opens +** Processing line: ~ if Kernel.global_tick_count == 0~ - Inside source: true *** True Line Result - state.gridY ||= [] -** Processing line: ~ state.filled_squares ||= []~ + if Kernel.global_tick_count == 0 +** Processing line: ~ args.gtk.console.set_command "reset_with count: 100"~ - Inside source: true *** True Line Result - state.filled_squares ||= [] -** Processing line: ~ state.grid_border ||= [390, 140, 500, 500]~ + args.gtk.console.set_command "reset_with count: 100" +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.grid_border ||= [390, 140, 500, 500] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ get_grid unless state.tempX == 0 # calls get_grid in the first frame only~ +** Processing line: ~ # init~ - Inside source: true *** True Line Result - get_grid unless state.tempX == 0 # calls get_grid in the first frame only -** Processing line: ~ determineTileCords unless state.tempX == 0 # calls determineTileCords in first frame~ + # init +** Processing line: ~ if args.state.tick_count == 0~ - Inside source: true *** True Line Result - determineTileCords unless state.tempX == 0 # calls determineTileCords in first frame -** Processing line: ~ state.tempX = 0 # sets tempX to 0; the two methods aren't called again~ + if args.state.tick_count == 0 +** Processing line: ~ args.state.stars = args.state.star_count.map { |i| Star.new args.grid }~ - Inside source: true *** True Line Result - state.tempX = 0 # sets tempX to 0; the two methods aren't called again + args.state.stars = args.state.star_count.map { |i| Star.new args.grid } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -51587,166 +54768,170 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Calculates the placement of lines or separators in the grid~ +** Processing line: ~ # update~ - Inside source: true *** True Line Result - # Calculates the placement of lines or separators in the grid -** Processing line: ~ def get_grid~ + # update +** Processing line: ~ args.state.stars.each(&:move)~ - Inside source: true *** True Line Result - def get_grid -** Processing line: ~ curr_x = state.centerX - (state.gridSize / 2) # starts at left of grid~ + args.state.stars.each(&:move) +** Processing line: ~~ - Inside source: true *** True Line Result - curr_x = state.centerX - (state.gridSize / 2) # starts at left of grid -** Processing line: ~ deltaX = state.gridSize / state.lineQuantity # finds distance to place vertical lines evenly through width of grid~ + +** Processing line: ~ # render~ - Inside source: true *** True Line Result - deltaX = state.gridSize / state.lineQuantity # finds distance to place vertical lines evenly through width of grid -** Processing line: ~ (state.lineQuantity + 2).times do~ + # render +** Processing line: ~ args.outputs.sprites << args.state.stars~ - Inside source: true *** True Line Result - (state.lineQuantity + 2).times do -** Processing line: ~ state.gridX << curr_x # adds curr_x to gridX collection~ + args.outputs.sprites << args.state.stars +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - state.gridX << curr_x # adds curr_x to gridX collection -** Processing line: ~ curr_x += deltaX # increment curr_x by the distance between vertical lines~ + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ - Inside source: true *** True Line Result - curr_x += deltaX # increment curr_x by the distance between vertical lines -** Processing line: ~ end~ + args.outputs.primitives << args.gtk.current_framerate_primitives +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ curr_y = state.centerY - (state.gridSize / 2) # starts at bottom of grid~ +** Processing line: ~ # resets game, and assigns star count given by user~ - Inside source: true *** True Line Result - curr_y = state.centerY - (state.gridSize / 2) # starts at bottom of grid -** Processing line: ~ deltaY = state.gridSize / state.lineQuantity # finds distance to place horizontal lines evenly through height of grid~ + # resets game, and assigns star count given by user +** Processing line: ~ def reset_with count: count~ - Inside source: true *** True Line Result - deltaY = state.gridSize / state.lineQuantity # finds distance to place horizontal lines evenly through height of grid -** Processing line: ~ (state.lineQuantity + 2).times do~ + def reset_with count: count +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - (state.lineQuantity + 2).times do -** Processing line: ~ state.gridY << curr_y # adds curr_y to gridY collection~ + $gtk.reset +** Processing line: ~ $gtk.args.state.star_count = count~ - Inside source: true *** True Line Result - state.gridY << curr_y # adds curr_y to gridY collection -** Processing line: ~ curr_y += deltaY # increments curr_y to distance between horizontal lines~ + $gtk.args.state.star_count = count +** Processing line: ~ end~ - Inside source: true *** True Line Result - curr_y += deltaY # increments curr_y to distance between horizontal lines -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end -** 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: ~ # Determines coordinate positions of patterned tiles (on the left side of the grid)~ -- Inside source: true +** Processing line: ~*** Performance - Static Sprites As Classes With Custom Drawing - main.rb~ +- Header detected. *** True Line Result - # Determines coordinate positions of patterned tiles (on the left side of the grid) -** Processing line: ~ def determineTileCords~ -- Inside source: true + *** True Line Result - def determineTileCords -** Processing line: ~ state.tempCounter ||= 1 # initializes tempCounter to 1~ +*** Performance - Static Sprites As Classes With Custom Drawing - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb~ - Inside source: true *** True Line Result - state.tempCounter ||= 1 # initializes tempCounter to 1 -** Processing line: ~ state.tileQuantity.times do # there are 6 different kinds of tiles~ + # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb +** Processing line: ~ # Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~.~ - Inside source: true *** True Line Result - state.tileQuantity.times do # there are 6 different kinds of tiles -** Processing line: ~ state.tileCords += [[state.tempX, state.tempY, state.tempCounter]] # adds tile definition to collection~ + # Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~. +** Processing line: ~ # is the fastest approach. This is comparable to what other game engines set as the default behavior.~ - Inside source: true *** True Line Result - state.tileCords += [[state.tempX, state.tempY, state.tempCounter]] # adds tile definition to collection -** Processing line: ~ state.tempX += 75 # increments tempX to put horizontal space between the patterned tiles~ + # is the fastest approach. This is comparable to what other game engines set as the default behavior. +** Processing line: ~ # There are tradeoffs for all this speed if the creation of a full blown class, and bypassing~ - Inside source: true *** True Line Result - state.tempX += 75 # increments tempX to put horizontal space between the patterned tiles -** Processing line: ~ state.tempCounter += 1 # increments tempCounter~ + # There are tradeoffs for all this speed if the creation of a full blown class, and bypassing +** Processing line: ~ # functional/data-oriented practices.~ - Inside source: true *** True Line Result - state.tempCounter += 1 # increments tempCounter -** Processing line: ~ if state.tempX > 200 # if tempX exceeds 200 pixels~ + # functional/data-oriented practices. +** Processing line: ~ class Star~ - Inside source: true *** True Line Result - if state.tempX > 200 # if tempX exceeds 200 pixels -** Processing line: ~ state.tempX = 50 # a new row of patterned tiles begins~ + class Star +** Processing line: ~ def initialize grid~ - Inside source: true *** True Line Result - state.tempX = 50 # a new row of patterned tiles begins -** Processing line: ~ state.tempY -= 75 # the new row is 75 pixels lower than the previous row~ + def initialize grid +** Processing line: ~ @grid = grid~ - Inside source: true *** True Line Result - state.tempY -= 75 # the new row is 75 pixels lower than the previous row -** Processing line: ~ end~ + @grid = grid +** Processing line: ~ @x = (rand @grid.w) * -1~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + @x = (rand @grid.w) * -1 +** Processing line: ~ @y = (rand @grid.h) * -1~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + @y = (rand @grid.h) * -1 +** Processing line: ~ @w = 4~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + @w = 4 +** Processing line: ~ @h = 4~ - Inside source: true *** True Line Result - -** Processing line: ~ # Outputs objects (grid, tiles, etc) onto the screen~ + @h = 4 +** Processing line: ~ @s = 1 + (4.randomize :ratio)~ - Inside source: true *** True Line Result - # Outputs objects (grid, tiles, etc) onto the screen -** Processing line: ~ def render~ + @s = 1 + (4.randomize :ratio) +** Processing line: ~ @path = 'sprites/tiny-star.png'~ - Inside source: true *** True Line Result - def render -** Processing line: ~ outputs.sprites << state.tileCords.map do # outputs tileCords collection using images in sprites folder~ + @path = 'sprites/tiny-star.png' +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.sprites << state.tileCords.map do # outputs tileCords collection using images in sprites folder -** Processing line: ~ |x, y, order|~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - |x, y, order| -** Processing line: ~ [x, y, state.tileSize, state.tileSize, 'sprites/image' + order.to_s + ".png"]~ + +** Processing line: ~ def move~ - Inside source: true *** True Line Result - [x, y, state.tileSize, state.tileSize, 'sprites/image' + order.to_s + ".png"] -** Processing line: ~ end~ + def move +** Processing line: ~ @x += @s~ - Inside source: true *** True Line Result - end -** Processing line: ~ outputs.solids << [0, 0, 1280, 720, 255, 255, 255] # outputs white background~ + @x += @s +** Processing line: ~ @y += @s~ - Inside source: true *** True Line Result - outputs.solids << [0, 0, 1280, 720, 255, 255, 255] # outputs white background -** Processing line: ~ add_grid # outputs grid~ + @y += @s +** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ - Inside source: true *** True Line Result - add_grid # outputs grid -** Processing line: ~ print_title # outputs title and current tile pattern~ + @x = (rand @grid.w) * -1 if @x > @grid.right +** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ - Inside source: true *** True Line Result - print_title # outputs title and current tile pattern + @y = (rand @grid.h) * -1 if @y > @grid.top ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -51755,698 +54940,734 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Creates a grid by outputting vertical and horizontal grid lines onto the screen.~ -- Inside source: true -*** True Line Result - # Creates a grid by outputting vertical and horizontal grid lines onto the screen. -** Processing line: ~ # Outputs sprites for the filled_squares collection onto the screen.~ +** Processing line: ~ # if the object that is in args.outputs.sprites (or static_sprites)~ - Inside source: true *** True Line Result - # Outputs sprites for the filled_squares collection onto the screen. -** Processing line: ~ def add_grid~ + # if the object that is in args.outputs.sprites (or static_sprites) +** Processing line: ~ # respond_to? :draw_override, then the method is invoked giving you~ - Inside source: true *** True Line Result - def add_grid -** Processing line: ~~ + # respond_to? :draw_override, then the method is invoked giving you +** Processing line: ~ # access to the class used to draw to the canvas.~ - Inside source: true *** True Line Result - -** Processing line: ~ # Outputs the grid's border.~ + # access to the class used to draw to the canvas. +** Processing line: ~ def draw_override ffi_draw~ - Inside source: true *** True Line Result - # Outputs the grid's border. -** Processing line: ~ outputs.borders << state.grid_border~ + def draw_override ffi_draw +** Processing line: ~ # first move then draw~ - Inside source: true *** True Line Result - outputs.borders << state.grid_border -** Processing line: ~ temp = 0~ + # first move then draw +** Processing line: ~ move~ - Inside source: true *** True Line Result - temp = 0 + move ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Before looking at the code that outputs the vertical and horizontal lines in the~ +** Processing line: ~ # The argument order for ffi.draw_sprite is:~ - Inside source: true *** True Line Result - # Before looking at the code that outputs the vertical and horizontal lines in the -** Processing line: ~ # grid, take note of the fact that:~ + # The argument order for ffi.draw_sprite is: +** Processing line: ~ # x, y, w, h, path~ - Inside source: true *** True Line Result - # grid, take note of the fact that: -** Processing line: ~ # grid_border[1] refers to the border's bottom line (running horizontally),~ + # x, y, w, h, path +** Processing line: ~ ffi_draw.draw_sprite @x, @y, @w, @h, @path~ - Inside source: true *** True Line Result - # grid_border[1] refers to the border's bottom line (running horizontally), -** Processing line: ~ # grid_border[2] refers to the border's top line (running (horizontally),~ + ffi_draw.draw_sprite @x, @y, @w, @h, @path +** Processing line: ~~ - Inside source: true *** True Line Result - # grid_border[2] refers to the border's top line (running (horizontally), -** Processing line: ~ # grid_border[0] refers to the border's left line (running vertically),~ + +** Processing line: ~ # The argument order for ffi_draw.draw_sprite_2 is (pass in nil for default value):~ - Inside source: true *** True Line Result - # grid_border[0] refers to the border's left line (running vertically), -** Processing line: ~ # and grid_border[3] refers to the border's right line (running vertically).~ + # The argument order for ffi_draw.draw_sprite_2 is (pass in nil for default value): +** Processing line: ~ # x, y, w, h, path,~ - Inside source: true *** True Line Result - # and grid_border[3] refers to the border's right line (running vertically). -** Processing line: ~~ + # x, y, w, h, path, +** Processing line: ~ # angle, alpha~ - Inside source: true *** True Line Result - -** Processing line: ~ # [2]~ + # angle, alpha +** Processing line: ~~ - Inside source: true *** True Line Result - # [2] -** Processing line: ~ # ----------~ + +** Processing line: ~ # The argument order for ffi_draw.draw_sprite_3 is:~ - Inside source: true *** True Line Result - # ---------- -** Processing line: ~ # | |~ + # The argument order for ffi_draw.draw_sprite_3 is: +** Processing line: ~ # x, y, w, h,~ - Inside source: true *** True Line Result - # | | -** Processing line: ~ # [0] | | [3]~ + # x, y, w, h, +** Processing line: ~ # path,~ - Inside source: true *** True Line Result - # [0] | | [3] -** Processing line: ~ # | |~ + # path, +** Processing line: ~ # angle,~ - Inside source: true *** True Line Result - # | | -** Processing line: ~ # ----------~ + # angle, +** Processing line: ~ # alpha, red_saturation, green_saturation, blue_saturation~ - Inside source: true *** True Line Result - # ---------- -** Processing line: ~ # [1]~ + # alpha, red_saturation, green_saturation, blue_saturation +** Processing line: ~ # flip_horizontally, flip_vertically,~ - Inside source: true *** True Line Result - # [1] -** Processing line: ~~ + # flip_horizontally, flip_vertically, +** Processing line: ~ # tile_x, tile_y, tile_w, tile_h~ - Inside source: true *** True Line Result - -** Processing line: ~ # Calculates the positions and outputs the x grid lines in the color gray.~ + # tile_x, tile_y, tile_w, tile_h +** Processing line: ~ # angle_anchor_x, angle_anchor_y,~ - Inside source: true *** True Line Result - # Calculates the positions and outputs the x grid lines in the color gray. -** Processing line: ~ state.gridX.map do # perform an action on all elements of the gridX collection~ + # angle_anchor_x, angle_anchor_y, +** Processing line: ~ # source_x, source_y, source_w, source_h~ - Inside source: true *** True Line Result - state.gridX.map do # perform an action on all elements of the gridX collection -** Processing line: ~ |x|~ + # source_x, source_y, source_w, source_h +** Processing line: ~ end~ - Inside source: true *** True Line Result - |x| -** Processing line: ~ temp += 1 # increment temp~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - temp += 1 # increment temp + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if x's value is greater than (or equal to) the x value of the border's left side~ +** Processing line: ~ # calls methods needed for game to run properly~ - Inside source: true *** True Line Result - # if x's value is greater than (or equal to) the x value of the border's left side -** Processing line: ~ # and less than (or equal to) the x value of the border's right side~ + # calls methods needed for game to run properly +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # and less than (or equal to) the x value of the border's right side -** Processing line: ~ if x >= state.centerX - (state.grid_border[2] / 2) && x <= state.centerX + (state.grid_border[2] / 2)~ + def tick args +** Processing line: ~ # sets console command when sample app initially opens~ - Inside source: true *** True Line Result - if x >= state.centerX - (state.grid_border[2] / 2) && x <= state.centerX + (state.grid_border[2] / 2) -** Processing line: ~ delta = state.centerX - 640~ + # sets console command when sample app initially opens +** Processing line: ~ if Kernel.global_tick_count == 0~ - Inside source: true *** True Line Result - delta = state.centerX - 640 -** Processing line: ~ # vertical lines have the same starting and ending x positions~ + if Kernel.global_tick_count == 0 +** Processing line: ~ args.gtk.console.set_command "reset_with count: 100"~ - Inside source: true *** True Line Result - # vertical lines have the same starting and ending x positions -** Processing line: ~ # starting y and ending y positions lead from the bottom of the border to the top of the border~ + args.gtk.console.set_command "reset_with count: 100" +** Processing line: ~ end~ - Inside source: true *** True Line Result - # starting y and ending y positions lead from the bottom of the border to the top of the border -** Processing line: ~ outputs.lines << [x - delta, state.grid_border[1], x - delta, state.grid_border[1] + state.grid_border[2], 150, 150, 150] # sets definition of vertical line and outputs it~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.lines << [x - delta, state.grid_border[1], x - delta, state.grid_border[1] + state.grid_border[2], 150, 150, 150] # sets definition of vertical line and outputs it -** Processing line: ~ end~ + +** Processing line: ~ # init~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # init +** Processing line: ~ if args.state.tick_count == 0~ - Inside source: true *** True Line Result - end -** Processing line: ~ temp = 0~ + if args.state.tick_count == 0 +** Processing line: ~ args.state.stars = args.state.star_count.map { |i| Star.new args.grid }~ - Inside source: true *** True Line Result - temp = 0 + 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 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Calculates the positions and outputs the y grid lines in the color gray.~ +** Processing line: ~ # render framerate~ - Inside source: true *** True Line Result - # Calculates the positions and outputs the y grid lines in the color gray. -** Processing line: ~ state.gridY.map do # perform an action on all elements of the gridY collection~ + # render framerate +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - state.gridY.map do # perform an action on all elements of the gridY collection -** Processing line: ~ |y|~ + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ - Inside source: true *** True Line Result - |y| -** Processing line: ~ temp += 1 # increment temp~ + args.outputs.primitives << args.gtk.current_framerate_primitives +** Processing line: ~ end~ - Inside source: true *** True Line Result - temp += 1 # increment temp + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if y's value is greater than (or equal to) the y value of the border's bottom side~ +** Processing line: ~ # resets game, and assigns star count given by user~ - Inside source: true *** True Line Result - # if y's value is greater than (or equal to) the y value of the border's bottom side -** Processing line: ~ # and less than (or equal to) the y value of the border's top side~ + # resets game, and assigns star count given by user +** Processing line: ~ def reset_with count: count~ - Inside source: true *** True Line Result - # and less than (or equal to) the y value of the border's top side -** Processing line: ~ if y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2)~ + def reset_with count: count +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - if y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2) -** Processing line: ~ delta = state.centerY - 393~ + $gtk.reset +** Processing line: ~ $gtk.args.state.star_count = count~ - Inside source: true *** True Line Result - delta = state.centerY - 393 -** Processing line: ~ # horizontal lines have the same starting and ending y positions~ + $gtk.args.state.star_count = count +** Processing line: ~ end~ - Inside source: true *** True Line Result - # horizontal lines have the same starting and ending y positions -** Processing line: ~ # starting x and ending x positions lead from the left side of the border to the right side of the border~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # starting x and ending x positions lead from the left side of the border to the right side of the border -** Processing line: ~ outputs.lines << [state.grid_border[0], y - delta, state.grid_border[0] + state.grid_border[3], y - delta, 150, 150, 150] # sets definition of horizontal line and outputs it~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - outputs.lines << [state.grid_border[0], y - delta, state.grid_border[0] + state.grid_border[3], y - delta, 150, 150, 150] # sets definition of horizontal line and outputs it -** Processing line: ~ end~ +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Performance - Collision Limits - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Performance - Collision Limits - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/09_performance/07_collision_limits/app/main.rb~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # ./samples/09_performance/07_collision_limits/app/main.rb +** Processing line: ~ =begin~ - Inside source: true *** True Line Result - end + =begin ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets values and outputs sprites for the filled_squares collection.~ -- Inside source: true -*** True Line Result - # Sets values and outputs sprites for the filled_squares collection. -** Processing line: ~ state.filled_squares.map do # perform an action on every element of the filled_squares collection~ +** Processing line: ~ Reminders:~ - Inside source: true *** True Line Result - state.filled_squares.map do # perform an action on every element of the filled_squares collection -** Processing line: ~ |x, y, w, h, sprite|~ + Reminders: +** Processing line: ~ - find_all: Finds all elements of a collection that meet certain requirements.~ - Inside source: true *** True Line Result - |x, y, w, h, sprite| -** Processing line: ~ # if x's value is greater than (or equal to) the x value of 17 pixels to the left of the border's left side~ + - find_all: Finds all elements of a collection that meet certain requirements. +** Processing line: ~ In this sample app, we're finding all bodies that intersect with the center body.~ - Inside source: true *** True Line Result - # if x's value is greater than (or equal to) the x value of 17 pixels to the left of the border's left side -** Processing line: ~ # and less than (or equal to) the x value of the border's right side~ + In this sample app, we're finding all bodies that intersect with the center body. +** Processing line: ~~ - Inside source: true *** True Line Result - # and less than (or equal to) the x value of the border's right side -** Processing line: ~ # and y's value is greater than (or equal to) the y value of the border's bottom side~ + +** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ - Inside source: true *** True Line Result - # and y's value is greater than (or equal to) the y value of the border's bottom side -** Processing line: ~ # and less than (or equal to) the y value of 25 pixels above the border's top side~ + - args.outputs.solids: An array. The values generate a solid. +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ - Inside source: true *** True Line Result - # and less than (or equal to) the y value of 25 pixels above the border's top side -** Processing line: ~ # NOTE: The allowance of 17 pixels and 25 pixels is due to the fact that a grid box may be slightly cut off or~ + The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE] +** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ - Inside source: true *** True Line Result - # NOTE: The allowance of 17 pixels and 25 pixels is due to the fact that a grid box may be slightly cut off or -** Processing line: ~ # not entirely visible in the grid's view (until it is moved using "W", "A", "S", "D")~ + For more information about solids, go to mygame/documentation/03-solids-and-borders.md. +** Processing line: ~~ - Inside source: true *** True Line Result - # not entirely visible in the grid's view (until it is moved using "W", "A", "S", "D") -** Processing line: ~ if x >= state.centerX - (state.grid_border[2] / 2) - 17 && x <= state.centerX + (state.grid_border[2] / 2) &&~ + +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ - Inside source: true *** True Line Result - if x >= state.centerX - (state.grid_border[2] / 2) - 17 && x <= state.centerX + (state.grid_border[2] / 2) && -** Processing line: ~ y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2) + 25~ + - args.outputs.labels: An array. The values generate a label. +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ - Inside source: true *** True Line Result - y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2) + 25 -** Processing line: ~ # calculations done to place sprites in grid spaces that are meant to filled in~ + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ - Inside source: true *** True Line Result - # calculations done to place sprites in grid spaces that are meant to filled in -** Processing line: ~ # mess around with the x and y values and see how the sprite placement changes~ + For more information about labels, go to mygame/documentation/02-labels.md. +** Processing line: ~~ - Inside source: true *** True Line Result - # mess around with the x and y values and see how the sprite placement changes -** Processing line: ~ outputs.sprites << [x - state.centerX + 630, y - state.centerY + 360, w, h, sprite]~ + +** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect.~ - Inside source: true *** True Line Result - outputs.sprites << [x - state.centerX + 630, y - state.centerY + 360, w, h, sprite] -** Processing line: ~ end~ + - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect. +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ =end~ - Inside source: true *** True Line Result - end + =end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # outputs a white solid along the left side of the grid (change the color and you'll be able to see it against the white background)~ +** Processing line: ~ # This code demonstrates moving objects that loop around once they exceed the scope of the screen,~ - Inside source: true *** True Line Result - # outputs a white solid along the left side of the grid (change the color and you'll be able to see it against the white background) -** Processing line: ~ # state.increment subtracted in x parameter because solid's position is denoted by bottom left corner~ + # This code demonstrates moving objects that loop around once they exceed the scope of the screen, +** Processing line: ~ # which has dimensions of 1280 by 720, and also detects collisions between objects called "bodies".~ - Inside source: true *** True Line Result - # state.increment subtracted in x parameter because solid's position is denoted by bottom left corner -** Processing line: ~ # state.increment subtracted in y parameter to avoid covering the title label~ + # which has dimensions of 1280 by 720, and also detects collisions between objects called "bodies". +** Processing line: ~~ - Inside source: true *** True Line Result - # state.increment subtracted in y parameter to avoid covering the title label -** Processing line: ~ outputs.primitives << [state.grid_border[0] - state.increment,~ + +** Processing line: ~ def body_count num~ - Inside source: true *** True Line Result - outputs.primitives << [state.grid_border[0] - state.increment, -** Processing line: ~ state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2),~ + def body_count num +** Processing line: ~ $gtk.args.state.other_bodies = num.map { [1280 * rand, 720 * rand, 10, 10] } # other_bodies set using num collection~ - Inside source: true *** True Line Result - state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2), -** Processing line: ~ 255, 255, 255].solid~ + $gtk.args.state.other_bodies = num.map { [1280 * rand, 720 * rand, 10, 10] } # other_bodies set using num collection +** Processing line: ~ end~ - Inside source: true *** True Line Result - 255, 255, 255].solid + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # outputs a white solid along the right side of the grid~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # outputs a white solid along the right side of the grid -** Processing line: ~ # state.increment subtracted from y parameter to avoid covering title label~ + def tick args +** Processing line: ~~ - Inside source: true *** True Line Result - # state.increment subtracted from y parameter to avoid covering title label -** Processing line: ~ outputs.primitives << [state.grid_border[0] + state.grid_border[2],~ + +** Processing line: ~ # Center body's values are set using an array~ - Inside source: true *** True Line Result - outputs.primitives << [state.grid_border[0] + state.grid_border[2], -** Processing line: ~ state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2),~ + # Center body's values are set using an array +** Processing line: ~ # Map is used to set values of 2000 other bodies~ - Inside source: true *** True Line Result - state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2), -** Processing line: ~ 255, 255, 255].solid~ + # Map is used to set values of 2000 other bodies +** Processing line: ~ # All bodies that intersect with center body are stored in collisions collection~ - Inside source: true *** True Line Result - 255, 255, 255].solid + # All bodies that intersect with center body are stored in collisions collection +** Processing line: ~ args.state.center_body ||= [640 - 100, 360 - 100, 200, 200] # calculations done to place body in center~ +- Inside source: true +*** True Line Result + args.state.center_body ||= [640 - 100, 360 - 100, 200, 200] # calculations done to place body in center +** Processing line: ~ args.state.other_bodies ||= 2000.map { [1280 * rand, 720 * rand, 10, 10] } # 2000 bodies given random position on screen~ +- Inside source: true +*** True Line Result + args.state.other_bodies ||= 2000.map { [1280 * rand, 720 * rand, 10, 10] } # 2000 bodies given random position on screen ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # outputs a white solid along the bottom of the grid~ +** Processing line: ~ # finds all bodies that intersect with center body, stores them in collisions~ - Inside source: true *** True Line Result - # outputs a white solid along the bottom of the grid -** Processing line: ~ # state.increment subtracted from y parameter to avoid covering last row of grid boxes~ + # finds all bodies that intersect with center body, stores them in collisions +** Processing line: ~ collisions = args.state.other_bodies.find_all { |b| b.intersect_rect? args.state.center_body }~ - Inside source: true *** True Line Result - # state.increment subtracted from y parameter to avoid covering last row of grid boxes -** Processing line: ~ outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] - state.increment,~ + collisions = args.state.other_bodies.find_all { |b| b.intersect_rect? args.state.center_body } +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] - state.increment, -** Processing line: ~ state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid~ + +** Processing line: ~ args.borders << args.state.center_body # outputs center body as a black border~ - Inside source: true *** True Line Result - state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid + args.borders << args.state.center_body # outputs center body as a black border ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # outputs a white solid along the top of the grid~ +** Processing line: ~ # transparency changes based on number of collisions; the more collisions, the redder (more transparent) the box becomes~ - Inside source: true *** True Line Result - # outputs a white solid along the top of the grid -** Processing line: ~ outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] + state.grid_border[3],~ + # transparency changes based on number of collisions; the more collisions, the redder (more transparent) the box becomes +** Processing line: ~ args.solids << [args.state.center_body, 255, 0, 0, collisions.length * 5] # center body is red solid~ - Inside source: true *** True Line Result - outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] + state.grid_border[3], -** Processing line: ~ state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid~ + args.solids << [args.state.center_body, 255, 0, 0, collisions.length * 5] # center body is red solid +** Processing line: ~ args.solids << args.state.other_bodies # other bodies are output as (black) solids, as well~ - Inside source: true *** True Line Result - state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid + args.solids << args.state.other_bodies # other bodies are output as (black) solids, as well ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ end~ +** Processing line: ~ args.labels << [10, 30, args.gtk.current_framerate] # outputs frame rate in bottom left corner~ - Inside source: true *** True Line Result - end + args.labels << [10, 30, args.gtk.current_framerate] # outputs frame rate in bottom left corner ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs title and current tile pattern~ +** Processing line: ~ # Bodies are returned to bottom left corner if positions exceed scope of screen~ - Inside source: true *** True Line Result - # Outputs title and current tile pattern -** Processing line: ~ def print_title~ + # Bodies are returned to bottom left corner if positions exceed scope of screen +** Processing line: ~ args.state.other_bodies.each do |b| # for each body in the other_bodies collection~ - Inside source: true *** True Line Result - def print_title -** Processing line: ~ outputs.labels << [640, 700, 'Mouse to Place Tile, WASD to Move Around', 7, 1] # title label~ + args.state.other_bodies.each do |b| # for each body in the other_bodies collection +** Processing line: ~ b.x += 5 # x and y are both incremented by 5~ - Inside source: true *** True Line Result - outputs.labels << [640, 700, 'Mouse to Place Tile, WASD to Move Around', 7, 1] # title label -** Processing line: ~ outputs.lines << horizontal_separator(660, 0, 1280) # outputs horizontal separator~ + b.x += 5 # x and y are both incremented by 5 +** Processing line: ~ b.y += 5~ - Inside source: true *** True Line Result - outputs.lines << horizontal_separator(660, 0, 1280) # outputs horizontal separator -** Processing line: ~ outputs.labels << [1050, 500, 'Current:', 3, 1] # outputs Current label~ + b.y += 5 +** Processing line: ~ b.x = 0 if b.x > 1280 # x becomes 0 if star exceeds scope of screen (goes too far right)~ - Inside source: true *** True Line Result - outputs.labels << [1050, 500, 'Current:', 3, 1] # outputs Current label -** Processing line: ~ outputs.sprites << [1110, 474, state.tileSize / 2, state.tileSize / 2, 'sprites/image' + state.tileSelected.to_s + ".png"] # outputs sprite of current tile pattern using images in sprites folder; output is half the size of a tile~ + b.x = 0 if b.x > 1280 # x becomes 0 if star exceeds scope of screen (goes too far right) +** Processing line: ~ b.y = 0 if b.y > 720 # y becomes 0 if star exceeds scope of screen (goes too far up)~ - Inside source: true *** True Line Result - outputs.sprites << [1110, 474, state.tileSize / 2, state.tileSize / 2, 'sprites/image' + state.tileSelected.to_s + ".png"] # outputs sprite of current tile pattern using images in sprites folder; output is half the size of a tile + b.y = 0 if b.y > 720 # y becomes 0 if star exceeds scope of screen (goes too far up) ** 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: ~ # Sets the starting position, ending position, and color for the horizontal separator.~ +** Processing line: ~ # Resets the game.~ - Inside source: true *** True Line Result - # Sets the starting position, ending position, and color for the horizontal separator. -** Processing line: ~ def horizontal_separator y, x, x2~ + # Resets the game. +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - def horizontal_separator y, x, x2 -** Processing line: ~ [x, y, x2, y, 150, 150, 150] # definition of separator; horizontal line means same starting/ending y~ + $gtk.reset +** Processing line: ~~ - Inside source: true *** True Line Result - [x, y, x2, y, 150, 150, 150] # definition of separator; horizontal line means same starting/ending y -** 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: ~ # Checks if the mouse is being clicked or dragged~ -- Inside source: true +** Processing line: ~*** Advanced Debugging - Trace Debugging - main.rb~ +- Header detected. *** True Line Result - # Checks if the mouse is being clicked or dragged -** Processing line: ~ def check_click~ -- Inside source: true + *** True Line Result - def check_click -** Processing line: ~ if inputs.keyboard.key_down.r # if the "r" key is pressed down~ +*** Advanced Debugging - Trace Debugging - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/10_advanced_debugging/01_trace_debugging/app/main.rb~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.r # if the "r" key is pressed down -** Processing line: ~ $dragon.reset~ + # ./samples/10_advanced_debugging/01_trace_debugging/app/main.rb +** Processing line: ~ class Game~ - Inside source: true *** True Line Result - $dragon.reset -** Processing line: ~ end~ + class Game +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - end + attr_gtk ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if inputs.mouse.down #is mouse up or down?~ +** Processing line: ~ def method1 num~ - Inside source: true *** True Line Result - if inputs.mouse.down #is mouse up or down? -** Processing line: ~ state.mouse_held = true~ + def method1 num +** Processing line: ~ method2 num~ - Inside source: true *** True Line Result - state.mouse_held = true -** Processing line: ~ if inputs.mouse.position.x < state.grid_border[0] # if mouse's x position is inside the grid's borders~ + method2 num +** Processing line: ~ end~ - Inside source: true *** True Line Result - if inputs.mouse.position.x < state.grid_border[0] # if mouse's x position is inside the grid's borders -** Processing line: ~ state.tileCords.map do # perform action on all elements of tileCords collection~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.tileCords.map do # perform action on all elements of tileCords collection -** Processing line: ~ |x, y, order|~ + +** Processing line: ~ def method2 num~ - Inside source: true *** True Line Result - |x, y, order| -** Processing line: ~ # if mouse's x position is greater than (or equal to) the starting x position of a tile~ + def method2 num +** Processing line: ~ method3 num~ - Inside source: true *** True Line Result - # if mouse's x position is greater than (or equal to) the starting x position of a tile -** Processing line: ~ # and the mouse's x position is also less than (or equal to) the ending x position of that tile,~ + method3 num +** Processing line: ~ end~ - Inside source: true *** True Line Result - # and the mouse's x position is also less than (or equal to) the ending x position of that tile, -** Processing line: ~ # and the mouse's y position is greater than (or equal to) the starting y position of that tile,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # and the mouse's y position is greater than (or equal to) the starting y position of that tile, -** Processing line: ~ # and the mouse's y position is also less than (or equal to) the ending y position of that tile,~ + +** Processing line: ~ def method3 num~ - Inside source: true *** True Line Result - # and the mouse's y position is also less than (or equal to) the ending y position of that tile, -** Processing line: ~ # (BASICALLY, IF THE MOUSE'S POSITION IS WITHIN THE STARTING AND ENDING POSITIONS OF A TILE)~ + def method3 num +** Processing line: ~ method4 num~ - Inside source: true *** True Line Result - # (BASICALLY, IF THE MOUSE'S POSITION IS WITHIN THE STARTING AND ENDING POSITIONS OF A TILE) -** Processing line: ~ if inputs.mouse.position.x >= x && inputs.mouse.position.x <= x + state.tileSize &&~ + method4 num +** Processing line: ~ end~ - Inside source: true *** True Line Result - if inputs.mouse.position.x >= x && inputs.mouse.position.x <= x + state.tileSize && -** Processing line: ~ inputs.mouse.position.y >= y && inputs.mouse.position.y <= y + state.tileSize~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - inputs.mouse.position.y >= y && inputs.mouse.position.y <= y + state.tileSize -** Processing line: ~ state.tileSelected = order # that tile is selected~ + +** Processing line: ~ def method4 num~ - Inside source: true *** True Line Result - state.tileSelected = order # that tile is selected -** Processing line: ~ end~ + def method4 num +** Processing line: ~ if num == 1~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + if num == 1 +** Processing line: ~ puts "UNLUCKY #{num}."~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + puts "UNLUCKY #{num}." +** Processing line: ~ state.unlucky_count += 1~ - Inside source: true *** True Line Result - end -** Processing line: ~ elsif inputs.mouse.up # otherwise, if the mouse is in the "up" state~ + state.unlucky_count += 1 +** Processing line: ~ if state.unlucky_count > 3~ - Inside source: true *** True Line Result - elsif inputs.mouse.up # otherwise, if the mouse is in the "up" state -** Processing line: ~ state.mouse_held = false # mouse is not held down or dragged~ + if state.unlucky_count > 3 +** Processing line: ~ raise "NAT 1 finally occurred. Check app/trace.txt for all method invocation history."~ - Inside source: true *** True Line Result - state.mouse_held = false # mouse is not held down or dragged -** Processing line: ~ state.mouse_dragging = false~ + raise "NAT 1 finally occurred. Check app/trace.txt for all method invocation history." +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.mouse_dragging = false + end +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ puts "LUCKY #{num}."~ +- Inside source: true +*** True Line Result + puts "LUCKY #{num}." ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.mouse_held && # mouse needs to be down~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - if state.mouse_held && # mouse needs to be down -** Processing line: ~ !inputs.mouse.click && # must not be first click~ + +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - !inputs.mouse.click && # must not be first click -** Processing line: ~ ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15 ||~ + def tick +** Processing line: ~ state.roll_history ||= []~ - Inside source: true *** True Line Result - ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15 || -** Processing line: ~ (inputs.mouse.previous_click.point.y - inputs.mouse.position.y).abs > 15) # Need to move 15 pixels before "drag"~ + state.roll_history ||= [] +** Processing line: ~ state.roll_history << rand(20) + 1~ - Inside source: true *** True Line Result - (inputs.mouse.previous_click.point.y - inputs.mouse.position.y).abs > 15) # Need to move 15 pixels before "drag" -** Processing line: ~ state.mouse_dragging = true~ + state.roll_history << rand(20) + 1 +** Processing line: ~ state.countdown ||= 600~ - Inside source: true *** True Line Result - state.mouse_dragging = true -** Processing line: ~ end~ + state.countdown ||= 600 +** Processing line: ~ state.countdown -= 1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.countdown -= 1 +** Processing line: ~ state.unlucky_count ||= 0~ - Inside source: true *** True Line Result - -** Processing line: ~ # if mouse is clicked inside grid's border, search_lines method is called with click input type~ + state.unlucky_count ||= 0 +** Processing line: ~ outputs.labels << [640, 360, "A dice roll of 1 will cause an exception.", 0, 1]~ - Inside source: true *** True Line Result - # if mouse is clicked inside grid's border, search_lines method is called with click input type -** Processing line: ~ if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border))~ + outputs.labels << [640, 360, "A dice roll of 1 will cause an exception.", 0, 1] +** Processing line: ~ if state.countdown > 0~ - Inside source: true *** True Line Result - if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border)) -** Processing line: ~ search_lines(inputs.mouse.click.point, :click)~ + if state.countdown > 0 +** Processing line: ~ outputs.labels << [640, 340, "Dice roll countdown: #{state.countdown}", 0, 1]~ - Inside source: true *** True Line Result - search_lines(inputs.mouse.click.point, :click) -** Processing line: ~~ + outputs.labels << [640, 340, "Dice roll countdown: #{state.countdown}", 0, 1] +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ # if mouse is dragged inside grid's border, search_lines method is called with drag input type~ + else +** Processing line: ~ state.attempts ||= 0~ - Inside source: true *** True Line Result - # if mouse is dragged inside grid's border, search_lines method is called with drag input type -** Processing line: ~ elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border))~ + state.attempts ||= 0 +** Processing line: ~ state.attempts += 1~ - Inside source: true *** True Line Result - elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border)) -** Processing line: ~ search_lines(inputs.mouse.position, :drag)~ + state.attempts += 1 +** Processing line: ~ outputs.labels << [640, 340, "ROLLING! #{state.attempts}", 0, 1]~ - Inside source: true *** True Line Result - search_lines(inputs.mouse.position, :drag) + outputs.labels << [640, 340, "ROLLING! #{state.attempts}", 0, 1] ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ return if state.countdown > 0~ - Inside source: true *** True Line Result - -** Processing line: ~ # Changes grid's position on screen by moving it up, down, left, or right.~ + return if state.countdown > 0 +** Processing line: ~ method1 state.roll_history[-1]~ - Inside source: true *** True Line Result - # Changes grid's position on screen by moving it up, down, left, or right. -** Processing line: ~~ + method1 state.roll_history[-1] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # centerX is incremented by speed if the "d" key is pressed and if that sum is less than~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # centerX is incremented by speed if the "d" key is pressed and if that sum is less than -** Processing line: ~ # the original left side of the center plus half the grid, minus half the top border of grid.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # the original left side of the center plus half the grid, minus half the top border of grid. -** Processing line: ~ # MOVES GRID RIGHT (increasing x)~ + +** Processing line: ~ $game = Game.new~ - Inside source: true *** True Line Result - # MOVES GRID RIGHT (increasing x) -** Processing line: ~ state.centerX += state.speed if inputs.keyboard.key_held.d &&~ + $game = Game.new +** Processing line: ~~ - Inside source: true *** True Line Result - state.centerX += state.speed if inputs.keyboard.key_held.d && -** Processing line: ~ (state.centerX + state.speed) < state.originalCenter[0] + (state.gridSize / 2) - (state.grid_border[2] / 2)~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - (state.centerX + state.speed) < state.originalCenter[0] + (state.gridSize / 2) - (state.grid_border[2] / 2) -** Processing line: ~ # centerX is decremented by speed if the "a" key is pressed and if that difference is greater than~ + def tick args +** Processing line: ~ trace! $game # <------------------- TRACING ENABLED FOR THIS OBJECT~ - Inside source: true *** True Line Result - # centerX is decremented by speed if the "a" key is pressed and if that difference is greater than -** Processing line: ~ # the original left side of the center minus half the grid, plus half the top border of grid.~ + trace! $game # <------------------- TRACING ENABLED FOR THIS OBJECT +** Processing line: ~ $game.args = args~ - Inside source: true *** True Line Result - # the original left side of the center minus half the grid, plus half the top border of grid. -** Processing line: ~ # MOVES GRID LEFT (decreasing x)~ + $game.args = args +** Processing line: ~ $game.tick~ - Inside source: true *** True Line Result - # MOVES GRID LEFT (decreasing x) -** Processing line: ~ state.centerX -= state.speed if inputs.keyboard.key_held.a &&~ + $game.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.centerX -= state.speed if inputs.keyboard.key_held.a && -** Processing line: ~ (state.centerX - state.speed) > state.originalCenter[0] - (state.gridSize / 2) + (state.grid_border[2] / 2)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - (state.centerX - state.speed) > state.originalCenter[0] - (state.gridSize / 2) + (state.grid_border[2] / 2) -** Processing line: ~ # centerY is incremented by speed if the "w" key is pressed and if that sum is less than~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - # centerY is incremented by speed if the "w" key is pressed and if that sum is less than -** Processing line: ~ # the original bottom of the center plus half the grid, minus half the right border of grid.~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - # the original bottom of the center plus half the grid, minus half the right border of grid. -** Processing line: ~ # MOVES GRID UP (increasing y)~ -- Inside source: true + +** Processing line: ~*** Advanced Debugging - Trace Debugging Classes - main.rb~ +- Header detected. *** True Line Result - # MOVES GRID UP (increasing y) -** Processing line: ~ state.centerY += state.speed if inputs.keyboard.key_held.w &&~ -- Inside source: true + *** True Line Result - state.centerY += state.speed if inputs.keyboard.key_held.w && -** Processing line: ~ (state.centerY + state.speed) < state.originalCenter[1] + (state.gridSize / 2) - (state.grid_border[3] / 2)~ -- Inside source: true +*** Advanced Debugging - Trace Debugging Classes - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - (state.centerY + state.speed) < state.originalCenter[1] + (state.gridSize / 2) - (state.grid_border[3] / 2) -** Processing line: ~ # centerY is decremented by speed if the "s" key is pressed and if the difference is greater than~ -- Inside source: true + *** True Line Result - # centerY is decremented by speed if the "s" key is pressed and if the difference is greater than -** Processing line: ~ # the original bottom of the center minus half the grid, plus half the right border of grid.~ +#+begin_src ruby +** Processing line: ~ # ./samples/10_advanced_debugging/02_trace_debugging_classes/app/main.rb~ - Inside source: true *** True Line Result - # the original bottom of the center minus half the grid, plus half the right border of grid. -** Processing line: ~ # MOVES GRID DOWN (decreasing y)~ + # ./samples/10_advanced_debugging/02_trace_debugging_classes/app/main.rb +** Processing line: ~ class Foobar~ - Inside source: true *** True Line Result - # MOVES GRID DOWN (decreasing y) -** Processing line: ~ state.centerY -= state.speed if inputs.keyboard.key_held.s &&~ + class Foobar +** Processing line: ~ def initialize~ - Inside source: true *** True Line Result - state.centerY -= state.speed if inputs.keyboard.key_held.s && -** Processing line: ~ (state.centerY - state.speed) > state.originalCenter[1] - (state.gridSize / 2) + (state.grid_border[3] / 2)~ + def initialize +** Processing line: ~ trace! # Trace is added to the constructor.~ - Inside source: true *** True Line Result - (state.centerY - state.speed) > state.originalCenter[1] - (state.gridSize / 2) + (state.grid_border[3] / 2) + trace! # Trace is added to the constructor. ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -52455,142 +55676,118 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Performs calculations on the gridX and gridY collections, and sets values.~ -- Inside source: true -*** True Line Result - # Performs calculations on the gridX and gridY collections, and sets values. -** Processing line: ~ # Sets the definition of a grid box, including the image that it is filled with.~ -- Inside source: true -*** True Line Result - # Sets the definition of a grid box, including the image that it is filled with. -** Processing line: ~ def search_lines (point, input_type)~ -- Inside source: true -*** True Line Result - def search_lines (point, input_type) -** Processing line: ~ point.x += state.centerX - 630 # increments x and y~ -- Inside source: true -*** True Line Result - point.x += state.centerX - 630 # increments x and y -** Processing line: ~ point.y += state.centerY - 360~ +** Processing line: ~ def clicky args~ - Inside source: true *** True Line Result - point.y += state.centerY - 360 -** Processing line: ~ findX = 0~ + def clicky args +** Processing line: ~ return unless args.inputs.mouse.click~ - Inside source: true *** True Line Result - findX = 0 -** Processing line: ~ findY = 0~ + return unless args.inputs.mouse.click +** Processing line: ~ try_rand rand~ - Inside source: true *** True Line Result - findY = 0 -** Processing line: ~ increment = state.gridSize / state.lineQuantity # divides grid by number of separators~ + try_rand rand +** Processing line: ~ end~ - Inside source: true *** True Line Result - increment = state.gridSize / state.lineQuantity # divides grid by number of separators + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.gridX.map do # perform an action on every element of collection~ +** Processing line: ~ def try_rand num~ - Inside source: true *** True Line Result - state.gridX.map do # perform an action on every element of collection -** Processing line: ~ |x|~ + def try_rand num +** Processing line: ~ return if num < 0.9~ - Inside source: true *** True Line Result - |x| -** Processing line: ~ # findX increments x by 10 if point.x is less than that sum and findX is currently 0~ + return if num < 0.9 +** Processing line: ~ raise "Exception finally occurred. Take a look at logs/trace.txt #{num}."~ - Inside source: true *** True Line Result - # findX increments x by 10 if point.x is less than that sum and findX is currently 0 -** Processing line: ~ findX = x + 10 if point.x < (x + 10) && findX == 0~ + raise "Exception finally occurred. Take a look at logs/trace.txt #{num}." +** Processing line: ~ end~ - Inside source: true *** True Line Result - findX = x + 10 if point.x < (x + 10) && findX == 0 -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.gridY.map do~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - state.gridY.map do -** Processing line: ~ |y|~ + def tick args +** Processing line: ~ args.labels << [640, 360, "Start clicking. Eventually an exception will be thrown. Then look at logs/trace.txt.", 0, 1]~ - Inside source: true *** True Line Result - |y| -** Processing line: ~ # findY is set to y if point.y is less than that value and findY is currently 0~ + args.labels << [640, 360, "Start clicking. Eventually an exception will be thrown. Then look at logs/trace.txt.", 0, 1] +** Processing line: ~ args.state.foobar = Foobar.new if args.tick_count~ - Inside source: true *** True Line Result - # findY is set to y if point.y is less than that value and findY is currently 0 -** Processing line: ~ findY = y if point.y < (y) && findY == 0~ + args.state.foobar = Foobar.new if args.tick_count +** Processing line: ~ return unless args.state.foobar~ - Inside source: true *** True Line Result - findY = y if point.y < (y) && findY == 0 -** Processing line: ~ end~ + return unless args.state.foobar +** Processing line: ~ args.state.foobar.clicky args~ - Inside source: true *** True Line Result - end -** Processing line: ~ # position of a box is denoted by bottom left corner, which is why the increment is being subtracted~ + args.state.foobar.clicky args +** Processing line: ~ end~ - Inside source: true *** True Line Result - # position of a box is denoted by bottom left corner, which is why the increment is being subtracted -** Processing line: ~ grid_box = [findX - (increment.ceil), findY - (increment.ceil), increment.ceil, increment.ceil,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - grid_box = [findX - (increment.ceil), findY - (increment.ceil), increment.ceil, increment.ceil, -** Processing line: ~ "sprites/image" + state.tileSelected.to_s + ".png"] # sets sprite definition~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - "sprites/image" + state.tileSelected.to_s + ".png"] # sets sprite definition +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ if input_type == :click # if user clicks their mouse~ -- Inside source: true -*** True Line Result - if input_type == :click # if user clicks their mouse -** Processing line: ~ if state.filled_squares.include? grid_box # if grid box is already filled in~ -- Inside source: true +** Processing line: ~*** Advanced Debugging - Unit Tests - exception_raising_tests.rb~ +- Header detected. *** True Line Result - if state.filled_squares.include? grid_box # if grid box is already filled in -** Processing line: ~ state.filled_squares.delete grid_box # box is cleared and removed from filled_squares~ -- Inside source: true + *** True Line Result - state.filled_squares.delete grid_box # box is cleared and removed from filled_squares -** Processing line: ~ else~ -- Inside source: true +*** Advanced Debugging - Unit Tests - exception_raising_tests.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - else -** Processing line: ~ state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares~ -- Inside source: true + *** True Line Result - state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares -** Processing line: ~ end~ +#+begin_src ruby +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/exception_raising_tests.rb~ - Inside source: true *** True Line Result - end -** Processing line: ~ elsif input_type == :drag # if user drags mouse~ + # ./samples/10_advanced_debugging/03_unit_tests/exception_raising_tests.rb +** Processing line: ~ begin :shared~ - Inside source: true *** True Line Result - elsif input_type == :drag # if user drags mouse -** Processing line: ~ unless state.filled_squares.include? grid_box # unless grid box dragged over is already filled in~ + begin :shared +** Processing line: ~ class ExceptionalClass~ - Inside source: true *** True Line Result - unless state.filled_squares.include? grid_box # unless grid box dragged over is already filled in -** Processing line: ~ state.filled_squares << grid_box # box is filled in and added to filled_squares~ + class ExceptionalClass +** Processing line: ~ def initialize exception_to_throw = nil~ - Inside source: true *** True Line Result - state.filled_squares << grid_box # box is filled in and added to filled_squares -** Processing line: ~ end~ + def initialize exception_to_throw = nil +** Processing line: ~ raise exception_to_throw if exception_to_throw~ - Inside source: true *** True Line Result - end + raise exception_to_throw if exception_to_throw ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -52599,118 +55796,94 @@ 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: ~ # Creates a "Clear" button using labels and borders.~ -- Inside source: true -*** True Line Result - # Creates a "Clear" button using labels and borders. -** Processing line: ~ def draw_buttons~ -- Inside source: true -*** True Line Result - def draw_buttons -** Processing line: ~ x, y, w, h = 390, 50, 240, 50~ -- Inside source: true -*** True Line Result - x, y, w, h = 390, 50, 240, 50 -** Processing line: ~ state.clear_button ||= state.new_entity(:button_with_fade)~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.clear_button ||= state.new_entity(:button_with_fade) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # x and y positions are set to display "Clear" label in center of the button~ +** Processing line: ~ def test_exception_in_newing_object args, assert~ - Inside source: true *** True Line Result - # x and y positions are set to display "Clear" label in center of the button -** Processing line: ~ # Try changing first two parameters to simply x, y and see what happens to the text placement~ + def test_exception_in_newing_object args, assert +** Processing line: ~ begin~ - Inside source: true *** True Line Result - # Try changing first two parameters to simply x, y and see what happens to the text placement -** Processing line: ~ state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1]~ + begin +** Processing line: ~ ExceptionalClass.new TypeError~ - Inside source: true *** True Line Result - state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] -** Processing line: ~ state.clear_button.border ||= [x, y, w, h] # definition of button's border~ + ExceptionalClass.new TypeError +** Processing line: ~ raise "Exception wasn't thrown!"~ - Inside source: true *** True Line Result - state.clear_button.border ||= [x, y, w, h] # definition of button's border -** Processing line: ~~ + raise "Exception wasn't thrown!" +** Processing line: ~ rescue Exception => e~ - Inside source: true *** True Line Result - -** Processing line: ~ # If the mouse is clicked inside the borders of the clear button~ + rescue Exception => e +** Processing line: ~ assert.equal! e.class, TypeError, "Exceptions within constructor should be retained."~ - Inside source: true *** True Line Result - # If the mouse is clicked inside the borders of the clear button -** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border)~ + assert.equal! e.class, TypeError, "Exceptions within constructor should be retained." +** Processing line: ~ end~ - Inside source: true *** True Line Result - if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border) -** Processing line: ~ state.clear_button.clicked_at = inputs.mouse.click.created_at # value is frame of mouse click~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.clear_button.clicked_at = inputs.mouse.click.created_at # value is frame of mouse click -** Processing line: ~ state.filled_squares.clear # filled squares collection is emptied (squares are cleared)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.filled_squares.clear # filled squares collection is emptied (squares are cleared) -** Processing line: ~ inputs.mouse.previous_click = nil # no previous click~ + +** Processing line: ~ $gtk.reset 100~ - Inside source: true *** True Line Result - inputs.mouse.previous_click = nil # no previous click -** Processing line: ~ end~ + $gtk.reset 100 +** Processing line: ~ $gtk.log_level = :off~ - Inside source: true *** True Line Result - end + $gtk.log_level = :off ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.labels << state.clear_button.label # outputs clear button~ -- Inside source: true -*** True Line Result - outputs.labels << state.clear_button.label # outputs clear button -** Processing line: ~ outputs.borders << state.clear_button.border~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - outputs.borders << state.clear_button.border +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ # When the clear button is clicked, the color of the button changes~ -- Inside source: true +** Processing line: ~*** Advanced Debugging - Unit Tests - fn_tests.rb~ +- Header detected. *** True Line Result - # When the clear button is clicked, the color of the button changes -** Processing line: ~ # and the transparency changes, as well. If you change the time from~ -- Inside source: true + *** True Line Result - # and the transparency changes, as well. If you change the time from -** Processing line: ~ # 0.25.seconds to 1.25.seconds or more, the change will last longer.~ -- Inside source: true +*** Advanced Debugging - Unit Tests - fn_tests.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - # 0.25.seconds to 1.25.seconds or more, the change will last longer. -** Processing line: ~ if state.clear_button.clicked_at~ -- Inside source: true + *** True Line Result - if state.clear_button.clicked_at -** Processing line: ~ outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)]~ +#+begin_src ruby +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/fn_tests.rb~ - Inside source: true *** True Line Result - outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)] -** Processing line: ~ end~ + # ./samples/10_advanced_debugging/03_unit_tests/fn_tests.rb +** Processing line: ~ def infinity~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def infinity +** Processing line: ~ 1 / 0~ - Inside source: true *** True Line Result - end + 1 / 0 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -52719,46 +55892,30 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ $tile_editor = TileEditor.new~ -- Inside source: true -*** True Line Result - $tile_editor = TileEditor.new -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ def tick args~ -- Inside source: true -*** True Line Result - def tick args -** Processing line: ~ $tile_editor.inputs = args.inputs~ -- Inside source: true -*** True Line Result - $tile_editor.inputs = args.inputs -** Processing line: ~ $tile_editor.grid = args.grid~ +** Processing line: ~ def neg_infinity~ - Inside source: true *** True Line Result - $tile_editor.grid = args.grid -** Processing line: ~ $tile_editor.args = args~ + def neg_infinity +** Processing line: ~ -1 / 0~ - Inside source: true *** True Line Result - $tile_editor.args = args -** Processing line: ~ $tile_editor.outputs = args.outputs~ + -1 / 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - $tile_editor.outputs = args.outputs -** Processing line: ~ $tile_editor.state = args.state~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - $tile_editor.state = args.state -** Processing line: ~ $tile_editor.tick~ + +** Processing line: ~ def nan~ - Inside source: true *** True Line Result - $tile_editor.tick -** Processing line: ~ tick_instructions args, "Roll your own tile editor. CLICK to select a sprite. CLICK in grid to place sprite. WASD to move around."~ + def nan +** Processing line: ~ 0.0 / 0~ - Inside source: true *** True Line Result - tick_instructions args, "Roll your own tile editor. CLICK to select a sprite. CLICK in grid to place sprite. WASD to move around." + 0.0 / 0 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -52767,54 +55924,46 @@ Follows is a source code listing for all files that have been open sourced. This - 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 ||~ +** Processing line: ~ def test_add args, assert~ - Inside source: true *** True Line Result - if args.inputs.mouse.click || -** Processing line: ~ args.inputs.keyboard.directional_vector ||~ + def test_add args, assert +** Processing line: ~ assert.equal! (args.fn.add), 0~ - Inside source: true *** True Line Result - args.inputs.keyboard.directional_vector || -** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ + assert.equal! (args.fn.add), 0 +** Processing line: ~ assert.equal! (args.fn.+), 0~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.enter || -** Processing line: ~ args.inputs.keyboard.key_down.escape~ + assert.equal! (args.fn.+), 0 +** Processing line: ~ assert.equal! (args.fn.+ 1, 2, 3), 6~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.escape -** Processing line: ~ args.state.key_event_occurred = true~ + assert.equal! (args.fn.+ 1, 2, 3), 6 +** Processing line: ~ assert.equal! (args.fn.+ 0), 0~ - Inside source: true *** True Line Result - args.state.key_event_occurred = true -** Processing line: ~ end~ + assert.equal! (args.fn.+ 0), 0 +** Processing line: ~ assert.equal! (args.fn.+ 0, nil), 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + assert.equal! (args.fn.+ 0, nil), 0 +** Processing line: ~ assert.equal! (args.fn.+ 0, nan), nil~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ + assert.equal! (args.fn.+ 0, nan), nil +** Processing line: ~ assert.equal! (args.fn.+ 0, nil, infinity), nil~ - 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~ + assert.equal! (args.fn.+ 0, nil, infinity), nil +** Processing line: ~ assert.equal! (args.fn.+ [1, 2, 3, [4, 5, 6]]), 21~ - 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~ + assert.equal! (args.fn.+ [1, 2, 3, [4, 5, 6]]), 21 +** Processing line: ~ assert.equal! (args.fn.+ [nil, [4, 5, 6]]), 15~ - Inside source: true *** True Line Result - args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label + assert.equal! (args.fn.+ [nil, [4, 5, 6]]), 15 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -52823,506 +55972,478 @@ Follows is a source code listing for all files that have been open sourced. This - 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 - Resolution 64x64 - lowrez.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Lowrez - Resolution 64x64 - lowrez.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_lowrez/resolution_64x64/app/lowrez.rb~ -- Inside source: true -*** True Line Result - # ./samples/99_genre_lowrez/resolution_64x64/app/lowrez.rb -** Processing line: ~ # Emulation of a 64x64 canvas. Don't change this file unless you know what you're doing :-)~ +** Processing line: ~ def test_sub args, assert~ - Inside source: true *** True Line Result - # Emulation of a 64x64 canvas. Don't change this file unless you know what you're doing :-) -** Processing line: ~ # Head over to main.rb and study the code there.~ + def test_sub args, assert +** Processing line: ~ neg_infinity = infinity * -1~ - Inside source: true *** True Line Result - # Head over to main.rb and study the code there. -** Processing line: ~~ + neg_infinity = infinity * -1 +** Processing line: ~ assert.equal! (args.fn.+), 0~ - Inside source: true *** True Line Result - -** Processing line: ~ LOWREZ_SIZE = 64~ + assert.equal! (args.fn.+), 0 +** Processing line: ~ assert.equal! (args.fn.- 1, 2, 3), -4~ - Inside source: true *** True Line Result - LOWREZ_SIZE = 64 -** Processing line: ~ LOWREZ_ZOOM = 10~ + assert.equal! (args.fn.- 1, 2, 3), -4 +** Processing line: ~ assert.equal! (args.fn.- 4), -4~ - Inside source: true *** True Line Result - LOWREZ_ZOOM = 10 -** Processing line: ~ LOWREZ_ZOOMED_SIZE = LOWREZ_SIZE * LOWREZ_ZOOM~ + assert.equal! (args.fn.- 4), -4 +** Processing line: ~ assert.equal! (args.fn.- 4, nan), nil~ - Inside source: true *** True Line Result - LOWREZ_ZOOMED_SIZE = LOWREZ_SIZE * LOWREZ_ZOOM -** Processing line: ~ LOWREZ_X_OFFSET = (1280 - LOWREZ_ZOOMED_SIZE).half~ + assert.equal! (args.fn.- 4, nan), nil +** Processing line: ~ assert.equal! (args.fn.- 0, nil), 0~ - Inside source: true *** True Line Result - LOWREZ_X_OFFSET = (1280 - LOWREZ_ZOOMED_SIZE).half -** Processing line: ~ LOWREZ_Y_OFFSET = ( 720 - LOWREZ_ZOOMED_SIZE).half~ + assert.equal! (args.fn.- 0, nil), 0 +** Processing line: ~ assert.equal! (args.fn.- 0, nil, infinity), nil~ - Inside source: true *** True Line Result - LOWREZ_Y_OFFSET = ( 720 - LOWREZ_ZOOMED_SIZE).half -** Processing line: ~~ + assert.equal! (args.fn.- 0, nil, infinity), nil +** Processing line: ~ assert.equal! (args.fn.- [0, 1, 2, 3, [4, 5, 6]]), -21~ - Inside source: true *** True Line Result - -** Processing line: ~ LOWREZ_FONT_XL = -1~ + assert.equal! (args.fn.- [0, 1, 2, 3, [4, 5, 6]]), -21 +** Processing line: ~ assert.equal! (args.fn.- [nil, 0, [4, 5, 6]]), -15~ - Inside source: true *** True Line Result - LOWREZ_FONT_XL = -1 -** Processing line: ~ LOWREZ_FONT_XL_HEIGHT = 20~ + assert.equal! (args.fn.- [nil, 0, [4, 5, 6]]), -15 +** Processing line: ~ end~ - Inside source: true *** True Line Result - LOWREZ_FONT_XL_HEIGHT = 20 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ LOWREZ_FONT_LG = -3.5~ +** Processing line: ~ def test_div args, assert~ - Inside source: true *** True Line Result - LOWREZ_FONT_LG = -3.5 -** Processing line: ~ LOWREZ_FONT_LG_HEIGHT = 15~ + def test_div args, assert +** Processing line: ~ assert.equal! (args.fn.div), 1~ - Inside source: true *** True Line Result - LOWREZ_FONT_LG_HEIGHT = 15 -** Processing line: ~~ + assert.equal! (args.fn.div), 1 +** Processing line: ~ assert.equal! (args.fn./), 1~ - Inside source: true *** True Line Result - -** Processing line: ~ LOWREZ_FONT_MD = -6~ + assert.equal! (args.fn./), 1 +** Processing line: ~ assert.equal! (args.fn./ 6, 3), 2~ - Inside source: true *** True Line Result - LOWREZ_FONT_MD = -6 -** Processing line: ~ LOWREZ_FONT_MD_HEIGHT = 10~ + assert.equal! (args.fn./ 6, 3), 2 +** Processing line: ~ assert.equal! (args.fn./ 6, infinity), nil~ - Inside source: true *** True Line Result - LOWREZ_FONT_MD_HEIGHT = 10 -** Processing line: ~~ + assert.equal! (args.fn./ 6, infinity), nil +** Processing line: ~ assert.equal! (args.fn./ 6, nan), nil~ - Inside source: true *** True Line Result - -** Processing line: ~ LOWREZ_FONT_SM = -8.5~ + assert.equal! (args.fn./ 6, nan), nil +** Processing line: ~ assert.equal! (args.fn./ infinity), nil~ - Inside source: true *** True Line Result - LOWREZ_FONT_SM = -8.5 -** Processing line: ~ LOWREZ_FONT_SM_HEIGHT = 5~ + assert.equal! (args.fn./ infinity), nil +** Processing line: ~ assert.equal! (args.fn./ 0), nil~ - Inside source: true *** True Line Result - LOWREZ_FONT_SM_HEIGHT = 5 -** Processing line: ~~ + assert.equal! (args.fn./ 0), nil +** Processing line: ~ assert.equal! (args.fn./ 6, [3]), 2~ - Inside source: true *** True Line Result - -** Processing line: ~ LOWREZ_FONT_PATH = 'fonts/lowrez.ttf'~ + assert.equal! (args.fn./ 6, [3]), 2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - LOWREZ_FONT_PATH = 'fonts/lowrez.ttf' + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~~ +** Processing line: ~ def test_idiv args, assert~ - Inside source: true *** True Line Result - -** Processing line: ~ class LowrezOutputs~ + def test_idiv args, assert +** Processing line: ~ assert.equal! (args.fn.idiv), 1~ - Inside source: true *** True Line Result - class LowrezOutputs -** Processing line: ~ attr_accessor :width, :height~ + assert.equal! (args.fn.idiv), 1 +** Processing line: ~ assert.equal! (args.fn.idiv 7, 3), 2~ - Inside source: true *** True Line Result - attr_accessor :width, :height -** Processing line: ~~ + assert.equal! (args.fn.idiv 7, 3), 2 +** Processing line: ~ assert.equal! (args.fn.idiv 6, infinity), nil~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize args~ + assert.equal! (args.fn.idiv 6, infinity), nil +** Processing line: ~ assert.equal! (args.fn.idiv 6, nan), nil~ - Inside source: true *** True Line Result - def initialize args -** Processing line: ~ @args = args~ + assert.equal! (args.fn.idiv 6, nan), nil +** Processing line: ~ assert.equal! (args.fn.idiv infinity), nil~ - Inside source: true *** True Line Result - @args = args -** Processing line: ~ @background_color ||= [0, 0, 0]~ + assert.equal! (args.fn.idiv infinity), nil +** Processing line: ~ assert.equal! (args.fn.idiv 0), nil~ - Inside source: true *** True Line Result - @background_color ||= [0, 0, 0] -** Processing line: ~ @args.outputs.background_color = @background_color~ + assert.equal! (args.fn.idiv 0), nil +** Processing line: ~ assert.equal! (args.fn.idiv 7, [3]), 2~ - Inside source: true *** True Line Result - @args.outputs.background_color = @background_color -** Processing line: ~ end~ + assert.equal! (args.fn.idiv 7, [3]), 2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def background_color~ +** Processing line: ~ def test_mul args, assert~ - Inside source: true *** True Line Result - def background_color -** Processing line: ~ @background_color ||= [0, 0, 0]~ + def test_mul args, assert +** Processing line: ~ assert.equal! (args.fn.mul), 1~ - Inside source: true *** True Line Result - @background_color ||= [0, 0, 0] -** Processing line: ~ end~ + assert.equal! (args.fn.mul), 1 +** Processing line: ~ assert.equal! (args.fn.*), 1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + assert.equal! (args.fn.*), 1 +** Processing line: ~ assert.equal! (args.fn.* 7, 3), 21~ - Inside source: true *** True Line Result - -** Processing line: ~ def background_color= opts~ + assert.equal! (args.fn.* 7, 3), 21 +** Processing line: ~ assert.equal! (args.fn.* 6, nan), nil~ - Inside source: true *** True Line Result - def background_color= opts -** Processing line: ~ @background_color = opts~ + assert.equal! (args.fn.* 6, nan), nil +** Processing line: ~ assert.equal! (args.fn.* 6, infinity), nil~ - Inside source: true *** True Line Result - @background_color = opts -** Processing line: ~ @args.outputs.background_color = @background_color~ + assert.equal! (args.fn.* 6, infinity), nil +** Processing line: ~ assert.equal! (args.fn.* infinity), nil~ - Inside source: true *** True Line Result - @args.outputs.background_color = @background_color -** Processing line: ~~ + assert.equal! (args.fn.* infinity), nil +** Processing line: ~ assert.equal! (args.fn.* 0), 0~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs_lowrez.solids << [0, 0, LOWREZ_SIZE, LOWREZ_SIZE, @background_color]~ + assert.equal! (args.fn.* 0), 0 +** Processing line: ~ assert.equal! (args.fn.* 7, [3]), 21~ - Inside source: true *** True Line Result - outputs_lowrez.solids << [0, 0, LOWREZ_SIZE, LOWREZ_SIZE, @background_color] -** Processing line: ~ end~ + assert.equal! (args.fn.* 7, [3]), 21 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def outputs_lowrez~ -- Inside source: true -*** True Line Result - def outputs_lowrez -** Processing line: ~ return @args.outputs if @args.state.tick_count <= 0~ -- Inside source: true -*** True Line Result - return @args.outputs if @args.state.tick_count <= 0 -** Processing line: ~ return @args.outputs[:lowrez]~ +** Processing line: ~ def test_lt args, assert~ - Inside source: true *** True Line Result - return @args.outputs[:lowrez] -** Processing line: ~ end~ + def test_lt args, assert +** Processing line: ~ assert.equal! (args.fn.lt 1), 1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + assert.equal! (args.fn.lt 1), 1 +** Processing line: ~ assert.equal! (args.fn.lt), nil~ - Inside source: true *** True Line Result - -** Processing line: ~ def solids~ + assert.equal! (args.fn.lt), nil +** Processing line: ~ assert.equal! (args.fn.lt infinity), nil~ - Inside source: true *** True Line Result - def solids -** Processing line: ~ outputs_lowrez.solids~ + assert.equal! (args.fn.lt infinity), nil +** Processing line: ~ assert.equal! (args.fn.lt nan), nil~ - Inside source: true *** True Line Result - outputs_lowrez.solids -** Processing line: ~ end~ + assert.equal! (args.fn.lt nan), nil +** Processing line: ~ assert.equal! (args.fn.lt 10, 9, 8), 8~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + assert.equal! (args.fn.lt 10, 9, 8), 8 +** Processing line: ~ assert.equal! (args.fn.< 10, 9, 8), 8~ - Inside source: true *** True Line Result - -** Processing line: ~ def borders~ + assert.equal! (args.fn.< 10, 9, 8), 8 +** Processing line: ~ assert.equal! (args.fn.< [10, 9, [8]]), 8~ - Inside source: true *** True Line Result - def borders -** Processing line: ~ outputs_lowrez.borders~ + assert.equal! (args.fn.< [10, 9, [8]]), 8 +** Processing line: ~ assert.equal! (args.fn.< 10, 10), nil~ - Inside source: true *** True Line Result - outputs_lowrez.borders -** Processing line: ~ end~ + assert.equal! (args.fn.< 10, 10), nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def sprites~ +** Processing line: ~ def test_lte args, assert~ - Inside source: true *** True Line Result - def sprites -** Processing line: ~ outputs_lowrez.sprites~ + def test_lte args, assert +** Processing line: ~ assert.equal! (args.fn.lte 1), 1~ - Inside source: true *** True Line Result - outputs_lowrez.sprites -** Processing line: ~ end~ + assert.equal! (args.fn.lte 1), 1 +** Processing line: ~ assert.equal! (args.fn.lte), nil~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + assert.equal! (args.fn.lte), nil +** Processing line: ~ assert.equal! (args.fn.lte infinity), nil~ - Inside source: true *** True Line Result - -** Processing line: ~ def labels~ + assert.equal! (args.fn.lte infinity), nil +** Processing line: ~ assert.equal! (args.fn.lte nan), nil~ - Inside source: true *** True Line Result - def labels -** Processing line: ~ outputs_lowrez.labels~ + assert.equal! (args.fn.lte nan), nil +** Processing line: ~ assert.equal! (args.fn.lte 10, 9, 8), 8~ - Inside source: true *** True Line Result - outputs_lowrez.labels -** Processing line: ~ end~ + assert.equal! (args.fn.lte 10, 9, 8), 8 +** Processing line: ~ assert.equal! (args.fn.lte 10, 10), 10~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + assert.equal! (args.fn.lte 10, 10), 10 +** Processing line: ~ assert.equal! (args.fn.lte 10, 9, [8]), 8~ - Inside source: true *** True Line Result - -** Processing line: ~ def default_label~ + assert.equal! (args.fn.lte 10, 9, [8]), 8 +** Processing line: ~ assert.equal! (args.fn.<= 10, 9, 8), 8~ - Inside source: true *** True Line Result - def default_label -** Processing line: ~ {~ + assert.equal! (args.fn.<= 10, 9, 8), 8 +** Processing line: ~ end~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: 0,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - x: 0, -** Processing line: ~ y: 63,~ + +** Processing line: ~ def test_gt args, assert~ - Inside source: true *** True Line Result - y: 63, -** Processing line: ~ text: "",~ + def test_gt args, assert +** Processing line: ~ assert.equal! (args.fn.gt 1), 1~ - Inside source: true *** True Line Result - text: "", -** Processing line: ~ size_enum: LOWREZ_FONT_SM,~ + assert.equal! (args.fn.gt 1), 1 +** Processing line: ~ assert.equal! (args.fn.gt), nil~ - Inside source: true *** True Line Result - size_enum: LOWREZ_FONT_SM, -** Processing line: ~ alignment_enum: 0,~ + assert.equal! (args.fn.gt), nil +** Processing line: ~ assert.equal! (args.fn.gt infinity), nil~ - Inside source: true *** True Line Result - alignment_enum: 0, -** Processing line: ~ r: 0,~ + assert.equal! (args.fn.gt infinity), nil +** Processing line: ~ assert.equal! (args.fn.gt nan), nil~ - Inside source: true *** True Line Result - r: 0, -** Processing line: ~ g: 0,~ + assert.equal! (args.fn.gt nan), nil +** Processing line: ~ assert.equal! (args.fn.gt 8, 9, 10), 10~ - Inside source: true *** True Line Result - g: 0, -** Processing line: ~ b: 0,~ + assert.equal! (args.fn.gt 8, 9, 10), 10 +** Processing line: ~ assert.equal! (args.fn.gt [8, 9, [10]]), 10~ - Inside source: true *** True Line Result - b: 0, -** Processing line: ~ a: 255,~ + assert.equal! (args.fn.gt [8, 9, [10]]), 10 +** Processing line: ~ assert.equal! (args.fn.gt 10, 10), nil~ - Inside source: true *** True Line Result - a: 255, -** Processing line: ~ font: LOWREZ_FONT_PATH~ + assert.equal! (args.fn.gt 10, 10), nil +** Processing line: ~ assert.equal! (args.fn.gt 10, 10), nil~ - Inside source: true *** True Line Result - font: LOWREZ_FONT_PATH -** Processing line: ~ }~ + assert.equal! (args.fn.gt 10, 10), nil +** Processing line: ~ assert.equal! (args.fn.gt 10, 9), nil~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + assert.equal! (args.fn.gt 10, 9), nil +** Processing line: ~ assert.equal! (args.fn.> 8, 9, 10), 10~ - Inside source: true *** True Line Result - end + assert.equal! (args.fn.> 8, 9, 10), 10 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def lines~ +** Processing line: ~ def test_gte args, assert~ - Inside source: true *** True Line Result - def lines -** Processing line: ~ outputs_lowrez.lines~ + def test_gte args, assert +** Processing line: ~ assert.equal! (args.fn.gte 1), 1~ - Inside source: true *** True Line Result - outputs_lowrez.lines -** Processing line: ~ end~ + assert.equal! (args.fn.gte 1), 1 +** Processing line: ~ assert.equal! (args.fn.gte), nil~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + assert.equal! (args.fn.gte), nil +** Processing line: ~ assert.equal! (args.fn.gte infinity), nil~ - Inside source: true *** True Line Result - -** Processing line: ~ def primitives~ + assert.equal! (args.fn.gte infinity), nil +** Processing line: ~ assert.equal! (args.fn.gte nan), nil~ - Inside source: true *** True Line Result - def primitives -** Processing line: ~ outputs_lowrez.primitives~ + assert.equal! (args.fn.gte nan), nil +** Processing line: ~ assert.equal! (args.fn.gte 8, 9, 10), 10~ - Inside source: true *** True Line Result - outputs_lowrez.primitives -** Processing line: ~ end~ + assert.equal! (args.fn.gte 8, 9, 10), 10 +** Processing line: ~ assert.equal! (args.fn.gte 10, 10), 10~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + assert.equal! (args.fn.gte 10, 10), 10 +** Processing line: ~ assert.equal! (args.fn.gte 8, 9, [10]), 10~ - Inside source: true *** True Line Result - -** Processing line: ~ def click~ + assert.equal! (args.fn.gte 8, 9, [10]), 10 +** Processing line: ~ assert.equal! (args.fn.gte 10, 9), nil~ - Inside source: true *** True Line Result - def click -** Processing line: ~ return nil unless @args.inputs.mouse.click~ + assert.equal! (args.fn.gte 10, 9), nil +** Processing line: ~ assert.equal! (args.fn.>= 8, 9, 10), 10~ - Inside source: true *** True Line Result - return nil unless @args.inputs.mouse.click -** Processing line: ~ mouse~ + assert.equal! (args.fn.>= 8, 9, 10), 10 +** Processing line: ~ end~ - Inside source: true *** True Line Result - mouse -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def mouse_click~ +** Processing line: ~ def test_acopy args, assert~ - Inside source: true *** True Line Result - def mouse_click -** Processing line: ~ click~ + def test_acopy args, assert +** Processing line: ~ orig = [1, 2, 3]~ - Inside source: true *** True Line Result - click -** Processing line: ~ end~ + orig = [1, 2, 3] +** Processing line: ~ clone = args.fn.acopy orig~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + clone = args.fn.acopy orig +** Processing line: ~ assert.equal! clone, [1, 2, 3]~ - Inside source: true *** True Line Result - -** Processing line: ~ def mouse_down~ + assert.equal! clone, [1, 2, 3] +** Processing line: ~ assert.equal! clone, orig~ - Inside source: true *** True Line Result - def mouse_down -** Processing line: ~ @args.inputs.mouse.down~ + assert.equal! clone, orig +** Processing line: ~ assert.not_equal! clone.object_id, orig.object_id~ - Inside source: true *** True Line Result - @args.inputs.mouse.down -** Processing line: ~ end~ + assert.not_equal! clone.object_id, orig.object_id +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def mouse_up~ +** Processing line: ~ def test_aget args, assert~ - Inside source: true *** True Line Result - def mouse_up -** Processing line: ~ @args.inputs.mouse.up~ + def test_aget args, assert +** Processing line: ~ assert.equal! (args.fn.aget [:a, :b, :c], 1), :b~ - Inside source: true *** True Line Result - @args.inputs.mouse.up -** Processing line: ~ end~ + assert.equal! (args.fn.aget [:a, :b, :c], 1), :b +** Processing line: ~ assert.equal! (args.fn.aget [:a, :b, :c], nil), nil~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + assert.equal! (args.fn.aget [:a, :b, :c], nil), nil +** Processing line: ~ assert.equal! (args.fn.aget nil, 1), nil~ - Inside source: true *** True Line Result - -** Processing line: ~ def mouse~ + assert.equal! (args.fn.aget nil, 1), nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - def mouse -** Processing line: ~ [~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [ -** Processing line: ~ ((@args.inputs.mouse.x - LOWREZ_X_OFFSET).idiv(LOWREZ_ZOOM)),~ + +** Processing line: ~ def test_alength args, assert~ - Inside source: true *** True Line Result - ((@args.inputs.mouse.x - LOWREZ_X_OFFSET).idiv(LOWREZ_ZOOM)), -** Processing line: ~ ((@args.inputs.mouse.y - LOWREZ_Y_OFFSET).idiv(LOWREZ_ZOOM))~ + def test_alength args, assert +** Processing line: ~ assert.equal! (args.fn.alength [:a, :b, :c]), 3~ - Inside source: true *** True Line Result - ((@args.inputs.mouse.y - LOWREZ_Y_OFFSET).idiv(LOWREZ_ZOOM)) -** Processing line: ~ ]~ + assert.equal! (args.fn.alength [:a, :b, :c]), 3 +** Processing line: ~ assert.equal! (args.fn.alength nil), nil~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + assert.equal! (args.fn.alength nil), nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def mouse_position~ +** Processing line: ~ def test_amap args, assert~ - Inside source: true *** True Line Result - def mouse_position -** Processing line: ~ mouse~ + def test_amap args, assert +** Processing line: ~ inc = lambda { |i| i + 1 }~ - Inside source: true *** True Line Result - mouse -** Processing line: ~ end~ + inc = lambda { |i| i + 1 } +** Processing line: ~ ary = [1, 2, 3]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + ary = [1, 2, 3] +** Processing line: ~ assert.equal! (args.fn.amap ary, inc), [2, 3, 4]~ - Inside source: true *** True Line Result - -** Processing line: ~ def keyboard~ + assert.equal! (args.fn.amap ary, inc), [2, 3, 4] +** Processing line: ~ assert.equal! (args.fn.amap nil, inc), nil~ - Inside source: true *** True Line Result - def keyboard -** Processing line: ~ @args.inputs.keyboard~ + assert.equal! (args.fn.amap nil, inc), nil +** Processing line: ~ assert.equal! (args.fn.amap ary, nil), nil~ - Inside source: true *** True Line Result - @args.inputs.keyboard -** Processing line: ~ end~ + assert.equal! (args.fn.amap ary, nil), nil +** Processing line: ~ assert.equal! (args.fn.amap ary, inc).class, Array~ - Inside source: true *** True Line Result - end + assert.equal! (args.fn.amap ary, inc).class, Array ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -53331,42 +56452,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ class GTK::Args~ +** Processing line: ~ def test_and args, assert~ - Inside source: true *** True Line Result - class GTK::Args -** Processing line: ~ def init_lowrez~ + def test_and args, assert +** Processing line: ~ assert.equal! (args.fn.and 1, 2, 3, 4), 4~ - Inside source: true *** True Line Result - def init_lowrez -** Processing line: ~ return if @lowrez~ + assert.equal! (args.fn.and 1, 2, 3, 4), 4 +** Processing line: ~ assert.equal! (args.fn.and 1, 2, nil, 4), nil~ - Inside source: true *** True Line Result - return if @lowrez -** Processing line: ~ @lowrez = LowrezOutputs.new self~ + assert.equal! (args.fn.and 1, 2, nil, 4), nil +** Processing line: ~ assert.equal! (args.fn.and), true~ - Inside source: true *** True Line Result - @lowrez = LowrezOutputs.new self -** Processing line: ~ end~ + assert.equal! (args.fn.and), true +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def lowrez~ +** Processing line: ~ def test_or args, assert~ - Inside source: true *** True Line Result - def lowrez -** Processing line: ~ @lowrez~ + def test_or args, assert +** Processing line: ~ assert.equal! (args.fn.or 1, 2, 3, 4), 1~ - Inside source: true *** True Line Result - @lowrez -** Processing line: ~ end~ + assert.equal! (args.fn.or 1, 2, 3, 4), 1 +** Processing line: ~ assert.equal! (args.fn.or 1, 2, nil, 4), 1~ - Inside source: true *** True Line Result - end + assert.equal! (args.fn.or 1, 2, nil, 4), 1 +** Processing line: ~ assert.equal! (args.fn.or), nil~ +- Inside source: true +*** True Line Result + assert.equal! (args.fn.or), nil +** Processing line: ~ assert.equal! (args.fn.or nil, nil, false, 5, 10), 5~ +- Inside source: true +*** True Line Result + assert.equal! (args.fn.or nil, nil, false, 5, 10), 5 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -53375,158 +56504,134 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ def test_eq_eq args, assert~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Runtime~ + def test_eq_eq args, assert +** Processing line: ~ assert.equal! (args.fn.eq?), true~ - Inside source: true *** True Line Result - class Runtime -** Processing line: ~ alias_method :__original_tick_core__, :tick_core unless Runtime.instance_methods.include?(:__original_tick_core__)~ + assert.equal! (args.fn.eq?), true +** Processing line: ~ assert.equal! (args.fn.eq? 1, 0), false~ - Inside source: true *** True Line Result - alias_method :__original_tick_core__, :tick_core unless Runtime.instance_methods.include?(:__original_tick_core__) -** Processing line: ~~ + assert.equal! (args.fn.eq? 1, 0), false +** Processing line: ~ assert.equal! (args.fn.eq? 1, 1, 1), true~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick_core~ + assert.equal! (args.fn.eq? 1, 1, 1), true +** Processing line: ~ assert.equal! (args.fn.== 1, 1, 1), true~ - Inside source: true *** True Line Result - def tick_core -** Processing line: ~ @args.init_lowrez~ + assert.equal! (args.fn.== 1, 1, 1), true +** Processing line: ~ assert.equal! (args.fn.== nil, nil), true~ - Inside source: true *** True Line Result - @args.init_lowrez -** Processing line: ~ __original_tick_core__~ + assert.equal! (args.fn.== nil, nil), true +** Processing line: ~ end~ - Inside source: true *** True Line Result - __original_tick_core__ + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return if @args.state.tick_count <= 0~ -- Inside source: true -*** True Line Result - return if @args.state.tick_count <= 0 -** Processing line: ~~ +** Processing line: ~ def test_apply args, assert~ - Inside source: true *** True Line Result - -** Processing line: ~ @args.render_target(:lowrez)~ + def test_apply args, assert +** Processing line: ~ assert.equal! (args.fn.and [nil, nil, nil]), [nil, nil, nil]~ - Inside source: true *** True Line Result - @args.render_target(:lowrez) -** Processing line: ~ .labels~ + assert.equal! (args.fn.and [nil, nil, nil]), [nil, nil, nil] +** Processing line: ~ assert.equal! (args.fn.apply [nil, nil, nil], args.fn.method(:and)), nil~ - Inside source: true *** True Line Result - .labels -** Processing line: ~ .each do |l|~ + assert.equal! (args.fn.apply [nil, nil, nil], args.fn.method(:and)), nil +** Processing line: ~ and_lambda = lambda {|*xs| args.fn.and(*xs)}~ - Inside source: true *** True Line Result - .each do |l| -** Processing line: ~ l.y += 1~ + and_lambda = lambda {|*xs| args.fn.and(*xs)} +** Processing line: ~ assert.equal! (args.fn.apply [nil, nil, nil], and_lambda), nil~ - Inside source: true *** True Line Result - l.y += 1 -** Processing line: ~ end~ + assert.equal! (args.fn.apply [nil, nil, nil], and_lambda), nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @args.render_target(:lowrez)~ +** Processing line: ~ def test_areduce args, assert~ - Inside source: true *** True Line Result - @args.render_target(:lowrez) -** Processing line: ~ .lines~ + def test_areduce args, assert +** Processing line: ~ assert.equal! (args.fn.areduce [1, 2, 3], 0, lambda { |i, a| i + a }), 6~ - Inside source: true *** True Line Result - .lines -** Processing line: ~ .each do |l|~ + assert.equal! (args.fn.areduce [1, 2, 3], 0, lambda { |i, a| i + a }), 6 +** Processing line: ~ end~ - Inside source: true *** True Line Result - .each do |l| -** Processing line: ~ l.y += 1~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - l.y += 1 -** Processing line: ~ l.y2 += 1~ + +** Processing line: ~ def test_array_hash args, assert~ - Inside source: true *** True Line Result - l.y2 += 1 -** Processing line: ~ l.y2 += 1 if l.y1 != l.y2~ + def test_array_hash args, assert +** Processing line: ~ assert.equal! (args.fn.array_hash :a, 1, :b, 2), { a: 1, b: 2 }~ - Inside source: true *** True Line Result - l.y2 += 1 if l.y1 != l.y2 -** Processing line: ~ l.x2 += 1 if l.x1 != l.x2~ + assert.equal! (args.fn.array_hash :a, 1, :b, 2), { a: 1, b: 2 } +** Processing line: ~ assert.equal! (args.fn.array_hash), { }~ - Inside source: true *** True Line Result - l.x2 += 1 if l.x1 != l.x2 -** Processing line: ~ end~ + assert.equal! (args.fn.array_hash), { } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @args.outputs~ -- Inside source: true -*** True Line Result - @args.outputs -** Processing line: ~ .sprites << { x: 320,~ -- Inside source: true -*** True Line Result - .sprites << { x: 320, -** Processing line: ~ y: 40,~ -- Inside source: true -*** True Line Result - y: 40, -** Processing line: ~ w: 640,~ -- Inside source: true -*** True Line Result - w: 640, -** Processing line: ~ h: 640,~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - h: 640, -** Processing line: ~ source_x: 0,~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - source_x: 0, -** Processing line: ~ source_y: 0,~ -- Inside source: true + +** Processing line: ~*** Advanced Debugging - Unit Tests - gen_docs.rb~ +- Header detected. *** True Line Result - source_y: 0, -** Processing line: ~ source_w: 64,~ -- Inside source: true + *** True Line Result - source_w: 64, -** Processing line: ~ source_h: 64,~ -- Inside source: true +*** Advanced Debugging - Unit Tests - gen_docs.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - source_h: 64, -** Processing line: ~ path: :lowrez }~ -- Inside source: true + *** True Line Result - path: :lowrez } -** Processing line: ~ end~ +#+begin_src ruby +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/gen_docs.rb~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # ./samples/10_advanced_debugging/03_unit_tests/gen_docs.rb +** Processing line: ~ # ./dragonruby mygame --eval samples/99_zz_gtk_unit_tests/gen_docs.rb --no-tick~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # ./dragonruby mygame --eval samples/99_zz_gtk_unit_tests/gen_docs.rb --no-tick +** Processing line: ~ Kernel.export_docs!~ - Inside source: true *** True Line Result - end + Kernel.export_docs! ** Processing line: ~~ - Inside source: true *** True Line Result @@ -53539,382 +56644,398 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Lowrez - Resolution 64x64 - main.rb~ +** Processing line: ~*** Advanced Debugging - Unit Tests - geometry_tests.rb~ - Header detected. *** True Line Result *** True Line Result -* Lowrez - Resolution 64x64 - main.rb +*** Advanced Debugging - Unit Tests - geometry_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_lowrez/resolution_64x64/app/main.rb~ +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/geometry_tests.rb~ - Inside source: true *** True Line Result - # ./samples/99_genre_lowrez/resolution_64x64/app/main.rb -** Processing line: ~ require 'app/lowrez.rb'~ + # ./samples/10_advanced_debugging/03_unit_tests/geometry_tests.rb +** Processing line: ~ begin :shared~ - Inside source: true *** True Line Result - require 'app/lowrez.rb' -** Processing line: ~~ + begin :shared +** Processing line: ~ def primitive_representations x, y, w, h~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + def primitive_representations x, y, w, h +** Processing line: ~ [~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ # How to set the background color~ + [ +** Processing line: ~ [x, y, w, h],~ - Inside source: true *** True Line Result - # How to set the background color -** Processing line: ~ args.lowrez.background_color = [255, 255, 255]~ + [x, y, w, h], +** Processing line: ~ { x: x, y: y, w: w, h: h },~ - Inside source: true *** True Line Result - args.lowrez.background_color = [255, 255, 255] -** Processing line: ~~ + { x: x, y: y, w: w, h: h }, +** Processing line: ~ RectForTest.new(x, y, w, h)~ - Inside source: true *** True Line Result - -** Processing line: ~ # ==== HELLO WORLD ======================================================~ + RectForTest.new(x, y, w, h) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - # ==== HELLO WORLD ====================================================== -** Processing line: ~ # Steps to get started:~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Steps to get started: -** Processing line: ~ # 1. ~def tick args~ is the entry point for your game.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # 1. ~def tick args~ is the entry point for your game. -** Processing line: ~ # 2. There are quite a few code samples below, remove the "##"~ + +** Processing line: ~ class RectForTest~ - Inside source: true *** True Line Result - # 2. There are quite a few code samples below, remove the "##" -** Processing line: ~ # before each line and save the file to see the changes.~ + class RectForTest +** Processing line: ~ attr_sprite~ - Inside source: true *** True Line Result - # before each line and save the file to see the changes. -** Processing line: ~ # 3. 0, 0 is in bottom left and 63, 63 is in top right corner.~ + attr_sprite +** Processing line: ~~ - Inside source: true *** True Line Result - # 3. 0, 0 is in bottom left and 63, 63 is in top right corner. -** Processing line: ~ # 4. Be sure to come to the discord channel if you need~ + +** Processing line: ~ def initialize x, y, w, h~ - Inside source: true *** True Line Result - # 4. Be sure to come to the discord channel if you need -** Processing line: ~ # more help: [[http://discord.dragonruby.org]].~ + def initialize x, y, w, h +** Processing line: ~ @x = x~ - Inside source: true *** True Line Result - # more help: [[http://discord.dragonruby.org]]. -** Processing line: ~~ + @x = x +** Processing line: ~ @y = y~ - Inside source: true *** True Line Result - -** Processing line: ~ # Commenting and uncommenting code:~ + @y = y +** Processing line: ~ @w = w~ - Inside source: true *** True Line Result - # Commenting and uncommenting code: -** Processing line: ~ # - Add a "#" infront of lines to comment out code~ + @w = w +** Processing line: ~ @h = h~ - Inside source: true *** True Line Result - # - Add a "#" infront of lines to comment out code -** Processing line: ~ # - Remove the "#" infront of lines to comment out code~ + @h = h +** Processing line: ~ end~ - Inside source: true *** True Line Result - # - Remove the "#" infront of lines to comment out code + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Invoke the hello_world subroutine/method~ +** Processing line: ~ def to_s~ - Inside source: true *** True Line Result - # Invoke the hello_world subroutine/method -** Processing line: ~ hello_world args # <---- add a "#" to the beginning of the line to stop running this subroutine/method.~ + def to_s +** Processing line: ~ "RectForTest: #{[x, y, w, h]}"~ - Inside source: true *** True Line Result - hello_world args # <---- add a "#" to the beginning of the line to stop running this subroutine/method. -** Processing line: ~ # =======================================================================~ + "RectForTest: #{[x, y, w, h]}" +** Processing line: ~ end~ - Inside source: true *** True Line Result - # ======================================================================= -** Processing line: ~~ + 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: ~ # ==== HOW TO RENDER A LABEL ============================================~ +** Processing line: ~ begin :intersect_rect?~ - Inside source: true *** True Line Result - # ==== HOW TO RENDER A LABEL ============================================ -** Processing line: ~ # Uncomment the line below to invoke the how_to_render_a_label subroutine/method.~ + begin :intersect_rect? +** Processing line: ~ def test_intersect_rect_point args, assert~ - Inside source: true *** True Line Result - # Uncomment the line below to invoke the how_to_render_a_label subroutine/method. -** Processing line: ~ # Note: The method is defined in this file with the signature ~def how_to_render_a_label args~~ + def test_intersect_rect_point args, assert +** Processing line: ~ assert.true! [16, 13].intersect_rect?([13, 12, 4, 4]), "point intersects with rect."~ - Inside source: true *** True Line Result - # Note: The method is defined in this file with the signature ~def how_to_render_a_label args~ -** Processing line: ~ # Scroll down to the method to see the details.~ + assert.true! [16, 13].intersect_rect?([13, 12, 4, 4]), "point intersects with rect." +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Scroll down to the method to see the details. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Remove the "#" at the beginning of the line below~ -- Inside source: true -*** True Line Result - # Remove the "#" at the beginning of the line below -** Processing line: ~ # how_to_render_a_label args # <---- remove the "#" at the begging of this line to run the method~ +** Processing line: ~ def test_intersect_rect args, assert~ - Inside source: true *** True Line Result - # how_to_render_a_label args # <---- remove the "#" at the begging of this line to run the method -** Processing line: ~ # =======================================================================~ + def test_intersect_rect args, assert +** Processing line: ~ intersecting = primitive_representations(0, 0, 100, 100) +~ - Inside source: true *** True Line Result - # ======================================================================= -** Processing line: ~~ + intersecting = primitive_representations(0, 0, 100, 100) + +** Processing line: ~ primitive_representations(20, 20, 20, 20)~ - Inside source: true *** True Line Result - + primitive_representations(20, 20, 20, 20) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # ==== HOW TO RENDER A FILLED SQUARE (SOLID) ============================~ +** Processing line: ~ intersecting.product(intersecting).each do |rect_one, rect_two|~ - Inside source: true *** True Line Result - # ==== HOW TO RENDER A FILLED SQUARE (SOLID) ============================ -** Processing line: ~ # Remove the "#" at the beginning of the line below~ + intersecting.product(intersecting).each do |rect_one, rect_two| +** Processing line: ~ assert.true! rect_one.intersect_rect?(rect_two),~ - Inside source: true *** True Line Result - # Remove the "#" at the beginning of the line below -** Processing line: ~ # how_to_render_solids args~ + assert.true! rect_one.intersect_rect?(rect_two), +** Processing line: ~ "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected true)."~ - Inside source: true *** True Line Result - # how_to_render_solids args -** Processing line: ~ # =======================================================================~ + "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected true)." +** Processing line: ~ end~ - Inside source: true *** True Line Result - # ======================================================================= + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~~ +** Processing line: ~ not_intersecting = [~ - Inside source: true *** True Line Result - -** Processing line: ~ # ==== HOW TO RENDER AN UNFILLED SQUARE (BORDER) ========================~ + not_intersecting = [ +** Processing line: ~ [ 0, 0, 5, 5],~ - Inside source: true *** True Line Result - # ==== HOW TO RENDER AN UNFILLED SQUARE (BORDER) ======================== -** Processing line: ~ # Remove the "#" at the beginning of the line below~ + [ 0, 0, 5, 5], +** Processing line: ~ { x: 10, y: 10, w: 5, h: 5 },~ - Inside source: true *** True Line Result - # Remove the "#" at the beginning of the line below -** Processing line: ~ # how_to_render_borders args~ + { x: 10, y: 10, w: 5, h: 5 }, +** Processing line: ~ RectForTest.new(20, 20, 5, 5)~ - Inside source: true *** True Line Result - # how_to_render_borders args -** Processing line: ~ # =======================================================================~ + RectForTest.new(20, 20, 5, 5) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - # ======================================================================= + ] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~~ +** Processing line: ~ not_intersecting.product(not_intersecting)~ - Inside source: true *** True Line Result - -** Processing line: ~ # ==== HOW TO RENDER A LINE =============================================~ + not_intersecting.product(not_intersecting) +** Processing line: ~ .reject { |rect_one, rect_two| rect_one == rect_two }~ - Inside source: true *** True Line Result - # ==== HOW TO RENDER A LINE ============================================= -** Processing line: ~ # Remove the "#" at the beginning of the line below~ + .reject { |rect_one, rect_two| rect_one == rect_two } +** Processing line: ~ .each do |rect_one, rect_two|~ - Inside source: true *** True Line Result - # Remove the "#" at the beginning of the line below -** Processing line: ~ # how_to_render_lines args~ + .each do |rect_one, rect_two| +** Processing line: ~ assert.false! rect_one.intersect_rect?(rect_two),~ - Inside source: true *** True Line Result - # how_to_render_lines args -** Processing line: ~ # =======================================================================~ + assert.false! rect_one.intersect_rect?(rect_two), +** Processing line: ~ "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected false)."~ - Inside source: true *** True Line Result - # ======================================================================= -** Processing line: ~~ + "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected false)." +** 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: ~ # == HOW TO RENDER A SPRITE =============================================~ +** Processing line: ~ begin :inside_rect?~ - Inside source: true *** True Line Result - # == HOW TO RENDER A SPRITE ============================================= -** Processing line: ~ # Remove the "#" at the beginning of the line below~ + begin :inside_rect? +** Processing line: ~ def assert_inside_rect outer: nil, inner: nil, expected: nil, assert: nil~ - Inside source: true *** True Line Result - # Remove the "#" at the beginning of the line below -** Processing line: ~ # how_to_render_sprites args~ + def assert_inside_rect outer: nil, inner: nil, expected: nil, assert: nil +** Processing line: ~ assert.true! inner.inside_rect?(outer) == expected,~ - Inside source: true *** True Line Result - # how_to_render_sprites args -** Processing line: ~ # =======================================================================~ + assert.true! inner.inside_rect?(outer) == expected, +** Processing line: ~ "inside_rect? assertion failed for outer: #{outer} inner: #{inner} (expected #{expected})."~ - Inside source: true *** True Line Result - # ======================================================================= -** Processing line: ~~ + "inside_rect? assertion failed for outer: #{outer} inner: #{inner} (expected #{expected})." +** Processing line: ~ end~ - Inside source: true *** True Line Result - + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # ==== HOW TO MOVE A SPRITE BASED OFF OF USER INPUT =====================~ +** Processing line: ~ def test_inside_rect args, assert~ - Inside source: true *** True Line Result - # ==== HOW TO MOVE A SPRITE BASED OFF OF USER INPUT ===================== -** Processing line: ~ # Remove the "#" at the beginning of the line below~ + def test_inside_rect args, assert +** Processing line: ~ outer_rects = primitive_representations(0, 0, 10, 10)~ - Inside source: true *** True Line Result - # Remove the "#" at the beginning of the line below -** Processing line: ~ # how_to_move_a_sprite args~ + outer_rects = primitive_representations(0, 0, 10, 10) +** Processing line: ~ inner_rects = primitive_representations(1, 1, 5, 5)~ - Inside source: true *** True Line Result - # how_to_move_a_sprite args -** Processing line: ~ # =======================================================================~ + inner_rects = primitive_representations(1, 1, 5, 5) +** Processing line: ~ primitive_representations(0, 0, 10, 10).product(primitive_representations(1, 1, 5, 5))~ - Inside source: true *** True Line Result - # ======================================================================= -** Processing line: ~~ + primitive_representations(0, 0, 10, 10).product(primitive_representations(1, 1, 5, 5)) +** Processing line: ~ .each do |outer, inner|~ - Inside source: true *** True Line Result - -** Processing line: ~~ + .each do |outer, inner| +** Processing line: ~ assert_inside_rect outer: outer, inner: inner,~ - Inside source: true *** True Line Result - -** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================~ + assert_inside_rect outer: outer, inner: inner, +** Processing line: ~ expected: true, assert: assert~ - Inside source: true *** True Line Result - # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ========================== -** Processing line: ~ # Remove the "#" at the beginning of the line below~ + expected: true, assert: assert +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Remove the "#" at the beginning of the line below -** Processing line: ~ # how_to_animate_a_sprite args~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # how_to_animate_a_sprite args -** Processing line: ~ # =======================================================================~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # ======================================================================= + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~~ +** Processing line: ~ begin :angle_to~ - Inside source: true *** True Line Result - -** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) ===========================~ + begin :angle_to +** Processing line: ~ def test_angle_to args, assert~ - Inside source: true *** True Line Result - # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) =========================== -** Processing line: ~ # Remove the "#" at the beginning of the line below~ + def test_angle_to args, assert +** Processing line: ~ origins = primitive_representations(0, 0, 0, 0)~ - Inside source: true *** True Line Result - # Remove the "#" at the beginning of the line below -** Processing line: ~ # how_to_animate_a_sprite_sheet args~ + origins = primitive_representations(0, 0, 0, 0) +** Processing line: ~ rights = primitive_representations(1, 0, 0, 0)~ - Inside source: true *** True Line Result - # how_to_animate_a_sprite_sheet args -** Processing line: ~ # =======================================================================~ + rights = primitive_representations(1, 0, 0, 0) +** Processing line: ~ aboves = primitive_representations(0, 1, 0, 0)~ - Inside source: true *** True Line Result - # ======================================================================= + aboves = primitive_representations(0, 1, 0, 0) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~~ +** Processing line: ~ origins.product(aboves).each do |origin, above|~ - Inside source: true *** True Line Result - -** Processing line: ~ # ==== HOW TO DETERMINE COLLISION =============================================~ + origins.product(aboves).each do |origin, above| +** Processing line: ~ assert.equal! origin.angle_to(above), 90,~ - Inside source: true *** True Line Result - # ==== HOW TO DETERMINE COLLISION ============================================= -** Processing line: ~ # Remove the "#" at the beginning of the line below~ + assert.equal! origin.angle_to(above), 90, +** Processing line: ~ "A point directly above should be 90 degrees."~ - Inside source: true *** True Line Result - # Remove the "#" at the beginning of the line below -** Processing line: ~ # how_to_determine_collision args~ + "A point directly above should be 90 degrees." +** Processing line: ~~ - Inside source: true *** True Line Result - # how_to_determine_collision args -** Processing line: ~ # =======================================================================~ + +** Processing line: ~ assert.equal! above.angle_from(origin), 90,~ - Inside source: true *** True Line Result - # ======================================================================= -** Processing line: ~~ + assert.equal! above.angle_from(origin), 90, +** Processing line: ~ "A point coming from above should be 90 degrees."~ - Inside source: true *** True Line Result - -** Processing line: ~~ + "A point coming from above should be 90 degrees." +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # ==== HOW TO CREATE BUTTONS ==================================================~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # ==== HOW TO CREATE BUTTONS ================================================== -** Processing line: ~ # Remove the "#" at the beginning of the line below~ + +** Processing line: ~ origins.product(rights).each do |origin, right|~ - Inside source: true *** True Line Result - # Remove the "#" at the beginning of the line below -** Processing line: ~ # how_to_create_buttons args~ + origins.product(rights).each do |origin, right| +** Processing line: ~ assert.equal! origin.angle_to(right) % 360, 0,~ - Inside source: true *** True Line Result - # how_to_create_buttons args -** Processing line: ~ # =======================================================================~ + assert.equal! origin.angle_to(right) % 360, 0, +** Processing line: ~ "A point directly to the right should be 0 degrees."~ - Inside source: true *** True Line Result - # ======================================================================= + "A point directly to the right should be 0 degrees." ** Processing line: ~~ - Inside source: true *** True Line Result +** Processing line: ~ assert.equal! right.angle_from(origin) % 360, 0,~ +- Inside source: true +*** True Line Result + assert.equal! right.angle_from(origin) % 360, 0, +** Processing line: ~ "A point coming from the right should be 0 degrees."~ +- Inside source: true +*** True Line Result + "A point coming from the right should be 0 degrees." ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # ==== The line below renders a debug grid, mouse information, and current tick~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - # ==== The line below renders a debug grid, mouse information, and current tick -** Processing line: ~ render_debug args~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - render_debug args + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -53923,298 +57044,298 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def hello_world args~ +** Processing line: ~ begin :scale_rect~ - Inside source: true *** True Line Result - def hello_world args -** Processing line: ~ args.lowrez.solids << { x: 0, y: 64, w: 10, h: 10, r: 255 }~ + begin :scale_rect +** Processing line: ~ def test_scale_rect args, assert~ - Inside source: true *** True Line Result - args.lowrez.solids << { x: 0, y: 64, w: 10, h: 10, r: 255 } -** Processing line: ~~ + def test_scale_rect args, assert +** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect(0.5, 0.5),~ - Inside source: true *** True Line Result - -** Processing line: ~ args.lowrez.labels << {~ + assert.equal! [0, 0, 100, 100].scale_rect(0.5, 0.5), +** Processing line: ~ [25.0, 25.0, 50.0, 50.0]~ - Inside source: true *** True Line Result - args.lowrez.labels << { -** Processing line: ~ x: 32,~ + [25.0, 25.0, 50.0, 50.0] +** Processing line: ~~ - Inside source: true *** True Line Result - x: 32, -** Processing line: ~ y: 63,~ + +** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect(0.5),~ - Inside source: true *** True Line Result - y: 63, -** Processing line: ~ text: "lowrezjam 2020",~ + assert.equal! [0, 0, 100, 100].scale_rect(0.5), +** Processing line: ~ [0.0, 0.0, 50.0, 50.0]~ - Inside source: true *** True Line Result - text: "lowrezjam 2020", -** Processing line: ~ size_enum: LOWREZ_FONT_SM,~ + [0.0, 0.0, 50.0, 50.0] +** Processing line: ~~ - Inside source: true *** True Line Result - size_enum: LOWREZ_FONT_SM, -** Processing line: ~ alignment_enum: 1,~ + +** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0.5, anchor_y: 0.5),~ - Inside source: true *** True Line Result - alignment_enum: 1, -** Processing line: ~ r: 0,~ + assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0.5, anchor_y: 0.5), +** Processing line: ~ [25.0, 25.0, 50.0, 50.0]~ - Inside source: true *** True Line Result - r: 0, -** Processing line: ~ g: 0,~ + [25.0, 25.0, 50.0, 50.0] +** Processing line: ~~ - Inside source: true *** True Line Result - g: 0, -** Processing line: ~ b: 0,~ + +** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0, anchor_y: 0),~ - Inside source: true *** True Line Result - b: 0, -** Processing line: ~ a: 255,~ + assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0, anchor_y: 0), +** Processing line: ~ [0.0, 0.0, 50.0, 50.0]~ - Inside source: true *** True Line Result - a: 255, -** Processing line: ~ font: LOWREZ_FONT_PATH~ + [0.0, 0.0, 50.0, 50.0] +** Processing line: ~ end~ - Inside source: true *** True Line Result - font: LOWREZ_FONT_PATH -** Processing line: ~ }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.lowrez.sprites << {~ +** Processing line: ~ $gtk.reset 100~ - Inside source: true *** True Line Result - args.lowrez.sprites << { -** Processing line: ~ x: 32 - 10,~ + $gtk.reset 100 +** Processing line: ~ $gtk.log_level = :off~ - Inside source: true *** True Line Result - x: 32 - 10, -** Processing line: ~ y: 32 - 10,~ + $gtk.log_level = :off +** Processing line: ~~ - Inside source: true *** True Line Result - y: 32 - 10, -** Processing line: ~ w: 20,~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - w: 20, -** Processing line: ~ h: 20,~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - h: 20, -** Processing line: ~ path: 'sprites/lowrez-ship-blue.png',~ -- Inside source: true + +** Processing line: ~*** Advanced Debugging - Unit Tests - http_tests.rb~ +- Header detected. *** True Line Result - path: 'sprites/lowrez-ship-blue.png', -** Processing line: ~ a: args.state.tick_count % 255,~ -- Inside source: true + *** True Line Result - a: args.state.tick_count % 255, -** Processing line: ~ angle: args.state.tick_count % 360~ -- Inside source: true +*** Advanced Debugging - Unit Tests - http_tests.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - angle: args.state.tick_count % 360 -** Processing line: ~ }~ + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/http_tests.rb~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + # ./samples/10_advanced_debugging/03_unit_tests/http_tests.rb +** Processing line: ~ def try_assert_or_schedule args, assert~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def try_assert_or_schedule args, assert +** Processing line: ~ if $result[:complete]~ - Inside source: true *** True Line Result - -** Processing line: ~~ + if $result[:complete] +** Processing line: ~ log_info "Request completed! Verifying."~ - Inside source: true *** True Line Result - -** Processing line: ~ # =======================================================================~ + log_info "Request completed! Verifying." +** Processing line: ~ if $result[:http_response_code] != 200~ - Inside source: true *** True Line Result - # ======================================================================= -** Processing line: ~ # ==== HOW TO RENDER A LABEL ============================================~ + if $result[:http_response_code] != 200 +** Processing line: ~ log_info "The request yielded a result of #{$result[:http_response_code]} instead of 200."~ - Inside source: true *** True Line Result - # ==== HOW TO RENDER A LABEL ============================================ -** Processing line: ~ # =======================================================================~ + log_info "The request yielded a result of #{$result[:http_response_code]} instead of 200." +** Processing line: ~ exit~ - Inside source: true *** True Line Result - # ======================================================================= -** Processing line: ~ def how_to_render_a_label args~ + exit +** Processing line: ~ end~ - Inside source: true *** True Line Result - def how_to_render_a_label args -** Processing line: ~ # NOTE: Text is aligned from the TOP LEFT corner~ + end +** Processing line: ~ log_info ":try_assert_or_schedule succeeded!"~ - Inside source: true *** True Line Result - # NOTE: Text is aligned from the TOP LEFT corner -** Processing line: ~~ + log_info ":try_assert_or_schedule succeeded!" +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ # Render an EXTRA LARGE/XL label (remove the "#" in front of each line below)~ + else +** Processing line: ~ args.gtk.schedule_callback Kernel.tick_count + 10 do~ - Inside source: true *** True Line Result - # Render an EXTRA LARGE/XL label (remove the "#" in front of each line below) -** Processing line: ~ args.lowrez.labels << { x: 0, y: 57, text: "Hello World",~ + args.gtk.schedule_callback Kernel.tick_count + 10 do +** Processing line: ~ try_assert_or_schedule args, assert~ - Inside source: true *** True Line Result - args.lowrez.labels << { x: 0, y: 57, text: "Hello World", -** Processing line: ~ size_enum: LOWREZ_FONT_XL,~ + try_assert_or_schedule args, assert +** Processing line: ~ end~ - Inside source: true *** True Line Result - size_enum: LOWREZ_FONT_XL, -** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - r: 0, g: 0, b: 0, a: 255, -** Processing line: ~ font: LOWREZ_FONT_PATH }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - font: LOWREZ_FONT_PATH } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Render a LARGE/LG label (remove the "#" in front of each line below)~ -- Inside source: true -*** True Line Result - # Render a LARGE/LG label (remove the "#" in front of each line below) -** Processing line: ~ args.lowrez.labels << { x: 0, y: 36, text: "Hello World",~ +** Processing line: ~ def test_http args, assert~ - Inside source: true *** True Line Result - args.lowrez.labels << { x: 0, y: 36, text: "Hello World", -** Processing line: ~ size_enum: LOWREZ_FONT_LG,~ + def test_http args, assert +** Processing line: ~ $result = $gtk.http_get 'http://dragonruby.org'~ - Inside source: true *** True Line Result - size_enum: LOWREZ_FONT_LG, -** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ + $result = $gtk.http_get 'http://dragonruby.org' +** Processing line: ~ try_assert_or_schedule args, assert~ - Inside source: true *** True Line Result - r: 0, g: 0, b: 0, a: 255, -** Processing line: ~ font: LOWREZ_FONT_PATH }~ + try_assert_or_schedule args, assert +** Processing line: ~ end~ - Inside source: true *** True Line Result - font: LOWREZ_FONT_PATH } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Render a MEDIUM/MD label (remove the "#" in front of each line below)~ -- Inside source: true -*** True Line Result - # Render a MEDIUM/MD label (remove the "#" in front of each line below) -** Processing line: ~ args.lowrez.labels << { x: 0, y: 20, text: "Hello World",~ +** Processing line: ~ $gtk.reset 100~ - Inside source: true *** True Line Result - args.lowrez.labels << { x: 0, y: 20, text: "Hello World", -** Processing line: ~ size_enum: LOWREZ_FONT_MD,~ + $gtk.reset 100 +** Processing line: ~ $gtk.log_level = :off~ - Inside source: true *** True Line Result - size_enum: LOWREZ_FONT_MD, -** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ + $gtk.log_level = :off +** Processing line: ~~ - Inside source: true *** True Line Result - r: 0, g: 0, b: 0, a: 255, -** Processing line: ~ font: LOWREZ_FONT_PATH }~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - font: LOWREZ_FONT_PATH } +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ # Render a SMALL/SM label (remove the "#" in front of each line below)~ -- Inside source: true +** Processing line: ~*** Advanced Debugging - Unit Tests - nil_coercion_tests.rb~ +- Header detected. *** True Line Result - # Render a SMALL/SM label (remove the "#" in front of each line below) -** Processing line: ~ args.lowrez.labels << { x: 0, y: 9, text: "Hello World",~ + +*** True Line Result +*** Advanced Debugging - Unit Tests - nil_coercion_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/nil_coercion_tests.rb~ - Inside source: true *** True Line Result - args.lowrez.labels << { x: 0, y: 9, text: "Hello World", -** Processing line: ~ size_enum: LOWREZ_FONT_SM,~ + # ./samples/10_advanced_debugging/03_unit_tests/nil_coercion_tests.rb +** Processing line: ~ # numbers~ - Inside source: true *** True Line Result - size_enum: LOWREZ_FONT_SM, -** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ + # numbers +** Processing line: ~ def test_open_entity_add_number args, assert~ - Inside source: true *** True Line Result - r: 0, g: 0, b: 0, a: 255, -** Processing line: ~ font: LOWREZ_FONT_PATH }~ + def test_open_entity_add_number args, assert +** Processing line: ~ assert.nil! args.state.i_value~ - Inside source: true *** True Line Result - font: LOWREZ_FONT_PATH } -** Processing line: ~~ + assert.nil! args.state.i_value +** Processing line: ~ args.state.i_value += 5~ - Inside source: true *** True Line Result - -** Processing line: ~ # You are provided args.lowrez.default_label which returns a Hash that you~ + args.state.i_value += 5 +** Processing line: ~ assert.equal! args.state.i_value, 5~ - Inside source: true *** True Line Result - # You are provided args.lowrez.default_label which returns a Hash that you -** Processing line: ~ # can ~merge~ properties with~ + assert.equal! args.state.i_value, 5 +** Processing line: ~~ - Inside source: true *** True Line Result - # can ~merge~ properties with -** Processing line: ~ # Example 1~ + +** Processing line: ~ assert.nil! args.state.f_value~ - Inside source: true *** True Line Result - # Example 1 -** Processing line: ~ args.lowrez.labels << args.lowrez~ + assert.nil! args.state.f_value +** Processing line: ~ args.state.f_value += 5.5~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + args.state.f_value += 5.5 +** Processing line: ~ assert.equal! args.state.f_value, 5.5~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(text: "Default")~ + assert.equal! args.state.f_value, 5.5 +** Processing line: ~ end~ - Inside source: true *** True Line Result - .merge(text: "Default") + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Example 2~ +** Processing line: ~ def test_open_entity_subtract_number args, assert~ - Inside source: true *** True Line Result - # Example 2 -** Processing line: ~ args.lowrez.labels << args.lowrez~ + def test_open_entity_subtract_number args, assert +** Processing line: ~ assert.nil! args.state.i_value~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + assert.nil! args.state.i_value +** Processing line: ~ args.state.i_value -= 5~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 31,~ + args.state.i_value -= 5 +** Processing line: ~ assert.equal! args.state.i_value, -5~ - Inside source: true *** True Line Result - .merge(x: 31, -** Processing line: ~ text: "Default",~ + assert.equal! args.state.i_value, -5 +** Processing line: ~~ - Inside source: true *** True Line Result - text: "Default", -** Processing line: ~ r: 128,~ + +** Processing line: ~ assert.nil! args.state.f_value~ - Inside source: true *** True Line Result - r: 128, -** Processing line: ~ g: 128,~ + assert.nil! args.state.f_value +** Processing line: ~ args.state.f_value -= 5.5~ - Inside source: true *** True Line Result - g: 128, -** Processing line: ~ b: 128)~ + args.state.f_value -= 5.5 +** Processing line: ~ assert.equal! args.state.f_value, -5.5~ - Inside source: true *** True Line Result - b: 128) + assert.equal! args.state.f_value, -5.5 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -54223,66 +57344,78 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ ## # =============================================================================~ +** Processing line: ~ def test_open_entity_multiply_number args, assert~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ ## # ==== HOW TO RENDER FILLED SQUARES (SOLIDS) ==================================~ + def test_open_entity_multiply_number args, assert +** Processing line: ~ assert.nil! args.state.i_value~ - Inside source: true *** True Line Result - ## # ==== HOW TO RENDER FILLED SQUARES (SOLIDS) ================================== -** Processing line: ~ ## # =============================================================================~ + assert.nil! args.state.i_value +** Processing line: ~ args.state.i_value *= 5~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ def how_to_render_solids args~ + args.state.i_value *= 5 +** Processing line: ~ assert.equal! args.state.i_value, 0~ - Inside source: true *** True Line Result - def how_to_render_solids args -** Processing line: ~ # Render a red square at 0, 0 with a width and height of 1~ + assert.equal! args.state.i_value, 0 +** Processing line: ~~ - Inside source: true *** True Line Result - # Render a red square at 0, 0 with a width and height of 1 -** Processing line: ~ args.lowrez.solids << { x: 0, y: 0, w: 1, h: 1, r: 255, g: 0, b: 0, a: 255 }~ + +** Processing line: ~ assert.nil! args.state.f_value~ - Inside source: true *** True Line Result - args.lowrez.solids << { x: 0, y: 0, w: 1, h: 1, r: 255, g: 0, b: 0, a: 255 } -** Processing line: ~~ + assert.nil! args.state.f_value +** Processing line: ~ args.state.f_value *= 5.5~ - Inside source: true *** True Line Result - -** Processing line: ~ # Render a red square at 1, 1 with a width and height of 2~ + args.state.f_value *= 5.5 +** Processing line: ~ assert.equal! args.state.f_value, 0~ - Inside source: true *** True Line Result - # Render a red square at 1, 1 with a width and height of 2 -** Processing line: ~ args.lowrez.solids << { x: 1, y: 1, w: 2, h: 2, r: 255, g: 0, b: 0, a: 255 }~ + assert.equal! args.state.f_value, 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.lowrez.solids << { x: 1, y: 1, w: 2, h: 2, r: 255, g: 0, b: 0, a: 255 } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Render a red square at 3, 3 with a width and height of 3~ +** Processing line: ~ def test_open_entity_divide_number args, assert~ - Inside source: true *** True Line Result - # Render a red square at 3, 3 with a width and height of 3 -** Processing line: ~ args.lowrez.solids << { x: 3, y: 3, w: 3, h: 3, r: 255, g: 0, b: 0 }~ + def test_open_entity_divide_number args, assert +** Processing line: ~ assert.nil! args.state.i_value~ - Inside source: true *** True Line Result - args.lowrez.solids << { x: 3, y: 3, w: 3, h: 3, r: 255, g: 0, b: 0 } + assert.nil! args.state.i_value +** Processing line: ~ args.state.i_value /= 5~ +- Inside source: true +*** True Line Result + args.state.i_value /= 5 +** Processing line: ~ assert.equal! args.state.i_value, 0~ +- Inside source: true +*** True Line Result + assert.equal! args.state.i_value, 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Render a red square at 6, 6 with a width and height of 4~ +** Processing line: ~ assert.nil! args.state.f_value~ - Inside source: true *** True Line Result - # Render a red square at 6, 6 with a width and height of 4 -** Processing line: ~ args.lowrez.solids << { x: 6, y: 6, w: 4, h: 4, r: 255, g: 0, b: 0 }~ + assert.nil! args.state.f_value +** Processing line: ~ args.state.f_value /= 5.5~ - Inside source: true *** True Line Result - args.lowrez.solids << { x: 6, y: 6, w: 4, h: 4, r: 255, g: 0, b: 0 } + args.state.f_value /= 5.5 +** Processing line: ~ assert.equal! args.state.f_value, 0~ +- Inside source: true +*** True Line Result + assert.equal! args.state.f_value, 0 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -54291,54 +57424,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ ## # =============================================================================~ +** Processing line: ~ # array~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ ## # ==== HOW TO RENDER UNFILLED SQUARES (BORDERS) ===============================~ + # array +** Processing line: ~ def test_open_entity_add_array args, assert~ - Inside source: true *** True Line Result - ## # ==== HOW TO RENDER UNFILLED SQUARES (BORDERS) =============================== -** Processing line: ~ ## # =============================================================================~ + def test_open_entity_add_array args, assert +** Processing line: ~ assert.nil! args.state.values~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ def how_to_render_borders args~ + assert.nil! args.state.values +** Processing line: ~ args.state.values += [:a, :b, :c]~ - Inside source: true *** True Line Result - def how_to_render_borders args -** Processing line: ~ # Render a red square at 0, 0 with a width and height of 3~ + args.state.values += [:a, :b, :c] +** Processing line: ~ assert.equal! args.state.values, [:a, :b, :c]~ - Inside source: true *** True Line Result - # Render a red square at 0, 0 with a width and height of 3 -** Processing line: ~ args.lowrez.borders << { x: 0, y: 0, w: 3, h: 3, r: 255, g: 0, b: 0, a: 255 }~ + assert.equal! args.state.values, [:a, :b, :c] +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.lowrez.borders << { x: 0, y: 0, w: 3, h: 3, r: 255, g: 0, b: 0, a: 255 } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Render a red square at 3, 3 with a width and height of 3~ -- Inside source: true -*** True Line Result - # Render a red square at 3, 3 with a width and height of 3 -** Processing line: ~ args.lowrez.borders << { x: 3, y: 3, w: 4, h: 4, r: 255, g: 0, b: 0, a: 255 }~ +** Processing line: ~ def test_open_entity_subtract_array args, assert~ - Inside source: true *** True Line Result - args.lowrez.borders << { x: 3, y: 3, w: 4, h: 4, r: 255, g: 0, b: 0, a: 255 } -** Processing line: ~~ + def test_open_entity_subtract_array args, assert +** Processing line: ~ assert.nil! args.state.values~ - Inside source: true *** True Line Result - -** Processing line: ~ # Render a red square at 5, 5 with a width and height of 4~ + assert.nil! args.state.values +** Processing line: ~ args.state.values -= [:a, :b, :c]~ - Inside source: true *** True Line Result - # Render a red square at 5, 5 with a width and height of 4 -** Processing line: ~ args.lowrez.borders << { x: 7, y: 7, w: 5, h: 5, r: 255, g: 0, b: 0, a: 255 }~ + args.state.values -= [:a, :b, :c] +** Processing line: ~ assert.equal! args.state.values, []~ - Inside source: true *** True Line Result - args.lowrez.borders << { x: 7, y: 7, w: 5, h: 5, r: 255, g: 0, b: 0, a: 255 } + assert.equal! args.state.values, [] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -54347,178 +57476,210 @@ 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: ~ ## # ==== HOW TO RENDER A LINE ===================================================~ +** Processing line: ~ def test_open_entity_shovel_array args, assert~ - Inside source: true *** True Line Result - ## # ==== HOW TO RENDER A LINE =================================================== -** Processing line: ~ ## # =============================================================================~ + def test_open_entity_shovel_array args, assert +** Processing line: ~ assert.nil! args.state.values~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ def how_to_render_lines args~ + assert.nil! args.state.values +** Processing line: ~ args.state.values << :a~ - Inside source: true *** True Line Result - def how_to_render_lines args -** Processing line: ~ # Render a horizontal line at the bottom~ + args.state.values << :a +** Processing line: ~ assert.equal! args.state.values, [:a]~ - Inside source: true *** True Line Result - # Render a horizontal line at the bottom -** Processing line: ~ args.lowrez.lines << { x: 0, y: 0, x2: 63, y2: 0, r: 255 }~ + assert.equal! args.state.values, [:a] +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.lowrez.lines << { x: 0, y: 0, x2: 63, y2: 0, r: 255 } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Render a vertical line at the left~ +** Processing line: ~ def test_open_entity_enumerate args, assert~ - Inside source: true *** True Line Result - # Render a vertical line at the left -** Processing line: ~ args.lowrez.lines << { x: 0, y: 0, x2: 0, y2: 63, r: 255 }~ + def test_open_entity_enumerate args, assert +** Processing line: ~ assert.nil! args.state.values~ - Inside source: true *** True Line Result - args.lowrez.lines << { x: 0, y: 0, x2: 0, y2: 63, r: 255 } + assert.nil! args.state.values +** Processing line: ~ args.state.values = args.state.values.map_with_index { |i| i }~ +- Inside source: true +*** True Line Result + args.state.values = args.state.values.map_with_index { |i| i } +** Processing line: ~ assert.equal! args.state.values, []~ +- Inside source: true +*** True Line Result + assert.equal! args.state.values, [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Render a diagonal line starting from the bottom left and going to the top right~ +** Processing line: ~ assert.nil! args.state.values_2~ - Inside source: true *** True Line Result - # Render a diagonal line starting from the bottom left and going to the top right -** Processing line: ~ args.lowrez.lines << { x: 0, y: 0, x2: 63, y2: 63, r: 255 }~ + assert.nil! args.state.values_2 +** Processing line: ~ args.state.values_2 = args.state.values_2.map { |i| i }~ - Inside source: true *** True Line Result - args.lowrez.lines << { x: 0, y: 0, x2: 63, y2: 63, r: 255 } -** Processing line: ~ end~ + args.state.values_2 = args.state.values_2.map { |i| i } +** Processing line: ~ assert.equal! args.state.values_2, []~ - Inside source: true *** True Line Result - end + assert.equal! args.state.values_2, [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ ## # =============================================================================~ +** Processing line: ~ assert.nil! args.state.values_3~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ ## # == HOW TO RENDER A SPRITE ===================================================~ + assert.nil! args.state.values_3 +** Processing line: ~ args.state.values_3 = args.state.values_3.flat_map { |i| i }~ - Inside source: true *** True Line Result - ## # == HOW TO RENDER A SPRITE =================================================== -** Processing line: ~ ## # =============================================================================~ + args.state.values_3 = args.state.values_3.flat_map { |i| i } +** Processing line: ~ assert.equal! args.state.values_3, []~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ def how_to_render_sprites args~ + assert.equal! args.state.values_3, [] +** Processing line: ~ end~ - Inside source: true *** True Line Result - def how_to_render_sprites args -** Processing line: ~ # Loop 10 times and create 10 sprites in 10 positions~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # Loop 10 times and create 10 sprites in 10 positions -** Processing line: ~ # Render a sprite at the bottom left with a width and height of 5 and a path of 'sprites/lowrez-ship-blue.png'~ + +** Processing line: ~ # hashes~ - Inside source: true *** True Line Result - # Render a sprite at the bottom left with a width and height of 5 and a path of 'sprites/lowrez-ship-blue.png' -** Processing line: ~ 10.times do |i|~ + # hashes +** Processing line: ~ def test_open_entity_indexer args, assert~ - Inside source: true *** True Line Result - 10.times do |i| -** Processing line: ~ args.lowrez.sprites << {~ + def test_open_entity_indexer args, assert +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - args.lowrez.sprites << { -** Processing line: ~ x: i * 5,~ + GTK::Entity.__reset_id__! +** Processing line: ~ assert.nil! args.state.values~ - Inside source: true *** True Line Result - x: i * 5, -** Processing line: ~ y: i * 5,~ + assert.nil! args.state.values +** Processing line: ~ args.state.values[:test] = :value~ - Inside source: true *** True Line Result - y: i * 5, -** Processing line: ~ w: 5,~ + args.state.values[:test] = :value +** Processing line: ~ assert.equal! args.state.values.to_s, { entity_id: 1, entity_name: :values, entity_keys_by_ref: {}, test: :value }.to_s~ - Inside source: true *** True Line Result - w: 5, -** Processing line: ~ h: 5,~ + assert.equal! args.state.values.to_s, { entity_id: 1, entity_name: :values, entity_keys_by_ref: {}, test: :value }.to_s +** Processing line: ~ end~ - Inside source: true *** True Line Result - h: 5, -** Processing line: ~ path: 'sprites/lowrez-ship-blue.png'~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - path: 'sprites/lowrez-ship-blue.png' -** Processing line: ~ }~ + +** Processing line: ~ # bug~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + # bug +** Processing line: ~ def test_open_entity_nil_bug args, assert~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def test_open_entity_nil_bug args, assert +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - -** Processing line: ~ # Given an array of positions create sprites~ + GTK::Entity.__reset_id__! +** Processing line: ~ args.state.foo.a~ - Inside source: true *** True Line Result - # Given an array of positions create sprites -** Processing line: ~ positions = [~ + args.state.foo.a +** Processing line: ~ args.state.foo.b~ - Inside source: true *** True Line Result - positions = [ -** Processing line: ~ { x: 10, y: 42 },~ + args.state.foo.b +** Processing line: ~ @hello[:foobar]~ - Inside source: true *** True Line Result - { x: 10, y: 42 }, -** Processing line: ~ { x: 15, y: 45 },~ + @hello[:foobar] +** Processing line: ~ assert.nil! args.state.foo.a, "a was not nil."~ - Inside source: true *** True Line Result - { x: 15, y: 45 }, -** Processing line: ~ { x: 22, y: 33 },~ + assert.nil! args.state.foo.a, "a was not nil." +** Processing line: ~ # the line below fails~ - Inside source: true *** True Line Result - { x: 22, y: 33 }, -** Processing line: ~ ]~ + # the line below fails +** Processing line: ~ # assert.nil! args.state.foo.b, "b was not nil."~ - Inside source: true *** True Line Result - ] + # assert.nil! args.state.foo.b, "b was not nil." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ positions.each do |position|~ +** 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 - object_to_primitive_tests.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Advanced Debugging - Unit Tests - object_to_primitive_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/object_to_primitive_tests.rb~ - Inside source: true *** True Line Result - positions.each do |position| -** Processing line: ~ # use Ruby's ~Hash#merge~ function to create a sprite~ + # ./samples/10_advanced_debugging/03_unit_tests/object_to_primitive_tests.rb +** Processing line: ~ class PlayerSpriteForTest~ - Inside source: true *** True Line Result - # use Ruby's ~Hash#merge~ function to create a sprite -** Processing line: ~ args.lowrez.sprites << position.merge(path: 'sprites/lowrez-ship-red.png',~ + class PlayerSpriteForTest +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.lowrez.sprites << position.merge(path: 'sprites/lowrez-ship-red.png', -** Processing line: ~ w: 5,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - w: 5, -** Processing line: ~ h: 5)~ + +** Processing line: ~ def test_array_to_sprite args, assert~ - Inside source: true *** True Line Result - h: 5) -** Processing line: ~ end~ + def test_array_to_sprite args, assert +** Processing line: ~ array = [[0, 0, 100, 100, "test.png"]].sprites~ - Inside source: true *** True Line Result - end + array = [[0, 0, 100, 100, "test.png"]].sprites +** Processing line: ~ puts "No exception was thrown. Sweet!"~ +- Inside source: true +*** True Line Result + puts "No exception was thrown. Sweet!" ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -54527,166 +57688,158 @@ 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: ~ ## # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================~ +** Processing line: ~ def test_class_to_sprite args, assert~ - Inside source: true *** True Line Result - ## # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ========================== -** Processing line: ~ ## # =============================================================================~ + def test_class_to_sprite args, assert +** Processing line: ~ array = [PlayerSprite.new].sprites~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ def how_to_animate_a_sprite args~ + array = [PlayerSprite.new].sprites +** Processing line: ~ assert.true! array.first.is_a?(PlayerSprite)~ - Inside source: true *** True Line Result - def how_to_animate_a_sprite args -** Processing line: ~ # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds~ + assert.true! array.first.is_a?(PlayerSprite) +** Processing line: ~ puts "No exception was thrown. Sweet!"~ - Inside source: true *** True Line Result - # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds -** Processing line: ~ start_animation_on_tick = 180~ + puts "No exception was thrown. Sweet!" +** Processing line: ~ end~ - Inside source: true *** True Line Result - start_animation_on_tick = 180 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # STEP 2: Get the frame_index given the start tick.~ +** Processing line: ~ $gtk.reset 100~ - Inside source: true *** True Line Result - # STEP 2: Get the frame_index given the start tick. -** Processing line: ~ sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites?~ + $gtk.reset 100 +** Processing line: ~ $gtk.log_level = :off~ - Inside source: true *** True Line Result - sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites? -** Processing line: ~ hold_for: 4, # how long to hold each sprite?~ + $gtk.log_level = :off +** Processing line: ~~ - Inside source: true *** True Line Result - hold_for: 4, # how long to hold each sprite? -** Processing line: ~ repeat: true # should it repeat?~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - repeat: true # should it repeat? +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ # STEP 3: frame_index will return nil if the frame hasn't arrived yet~ -- Inside source: true +** Processing line: ~*** Advanced Debugging - Unit Tests - parsing_tests.rb~ +- Header detected. *** True Line Result - # STEP 3: frame_index will return nil if the frame hasn't arrived yet -** Processing line: ~ if sprite_index~ -- Inside source: true + *** True Line Result - if sprite_index -** Processing line: ~ # if the sprite_index is populated, use it to determine the sprite path and render it~ -- Inside source: true +*** Advanced Debugging - Unit Tests - parsing_tests.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - # if the sprite_index is populated, use it to determine the sprite path and render it -** Processing line: ~ sprite_path = "sprites/explosion-#{sprite_index}.png"~ + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/parsing_tests.rb~ - Inside source: true *** True Line Result - sprite_path = "sprites/explosion-#{sprite_index}.png" -** Processing line: ~ args.lowrez.sprites << { x: 0, y: 0, w: 64, h: 64, path: sprite_path }~ + # ./samples/10_advanced_debugging/03_unit_tests/parsing_tests.rb +** Processing line: ~ def test_parse_json args, assert~ - Inside source: true *** True Line Result - args.lowrez.sprites << { x: 0, y: 0, w: 64, h: 64, path: sprite_path } -** Processing line: ~ else~ + def test_parse_json args, assert +** Processing line: ~ result = args.gtk.parse_json '{ "name": "John Doe", "aliases": ["JD"] }'~ - Inside source: true *** True Line Result - else -** Processing line: ~ # if the sprite_index is nil, render a countdown instead~ + result = args.gtk.parse_json '{ "name": "John Doe", "aliases": ["JD"] }' +** Processing line: ~ assert.equal! result, { "name"=>"John Doe", "aliases"=>["JD"] }, "Parsing JSON failed."~ - Inside source: true *** True Line Result - # if the sprite_index is nil, render a countdown instead -** Processing line: ~ countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1)~ + assert.equal! result, { "name"=>"John Doe", "aliases"=>["JD"] }, "Parsing JSON failed." +** Processing line: ~ end~ - Inside source: true *** True Line Result - countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.lowrez.labels << args.lowrez~ -- Inside source: true -*** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ +** Processing line: ~ def test_parse_xml args, assert~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 32,~ + def test_parse_xml args, assert +** Processing line: ~ result = args.gtk.parse_xml <<-S~ - Inside source: true *** True Line Result - .merge(x: 32, -** Processing line: ~ y: 32,~ + result = args.gtk.parse_xml <<-S +** Processing line: ~ ~ - Inside source: true *** True Line Result - y: 32, -** Processing line: ~ text: "Count Down: #{countdown_in_seconds}",~ + +** Processing line: ~ John Doe~ - Inside source: true *** True Line Result - text: "Count Down: #{countdown_in_seconds}", -** Processing line: ~ alignment_enum: 1)~ + John Doe +** Processing line: ~ ~ - Inside source: true *** True Line Result - alignment_enum: 1) -** Processing line: ~ end~ + +** Processing line: ~ S~ - Inside source: true *** True Line Result - end + S ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # render the current tick and the resolved sprite index~ +** Processing line: ~ expected = {:type=>:element,~ - Inside source: true *** True Line Result - # render the current tick and the resolved sprite index -** Processing line: ~ args.lowrez.labels << args.lowrez~ + expected = {:type=>:element, +** Processing line: ~ :name=>nil,~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + :name=>nil, +** Processing line: ~ :children=>[{:type=>:element,~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 0,~ + :children=>[{:type=>:element, +** Processing line: ~ :name=>"Person",~ - Inside source: true *** True Line Result - .merge(x: 0, -** Processing line: ~ y: 11,~ + :name=>"Person", +** Processing line: ~ :children=>[{:type=>:element,~ - Inside source: true *** True Line Result - y: 11, -** Processing line: ~ text: "Tick: #{args.state.tick_count}")~ + :children=>[{:type=>:element, +** Processing line: ~ :name=>"Name",~ - Inside source: true *** True Line Result - text: "Tick: #{args.state.tick_count}") -** Processing line: ~ args.lowrez.labels << args.lowrez~ + :name=>"Name", +** Processing line: ~ :children=>[{:type=>:content,~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + :children=>[{:type=>:content, +** Processing line: ~ :data=>"John Doe"}]}],~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 0,~ + :data=>"John Doe"}]}], +** Processing line: ~ :attributes=>{"id"=>"100"}}]}~ - Inside source: true *** True Line Result - .merge(x: 0, -** Processing line: ~ y: 5,~ + :attributes=>{"id"=>"100"}}]} +** Processing line: ~~ - Inside source: true *** True Line Result - y: 5, -** Processing line: ~ text: "sprite_index: #{sprite_index}")~ + +** Processing line: ~ assert.equal! result, expected, "Parsing xml failed."~ - Inside source: true *** True Line Result - text: "sprite_index: #{sprite_index}") + assert.equal! result, expected, "Parsing xml failed." ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -54695,202 +57848,190 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ ## # =============================================================================~ +** Processing line: ~ $gtk.reset 100~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ ## # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) =================================~ + $gtk.reset 100 +** Processing line: ~ $gtk.log_level = :off~ - Inside source: true *** True Line Result - ## # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) ================================= -** Processing line: ~ ## # =============================================================================~ + $gtk.log_level = :off +** Processing line: ~~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ def how_to_animate_a_sprite_sheet args~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - def how_to_animate_a_sprite_sheet args -** Processing line: ~ # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds -** Processing line: ~ start_animation_on_tick = 180~ -- Inside source: true + +** Processing line: ~*** Advanced Debugging - Unit Tests - require_tests.rb~ +- Header detected. *** True Line Result - start_animation_on_tick = 180 -** Processing line: ~~ -- Inside source: true + +*** True Line Result +*** Advanced Debugging - Unit Tests - require_tests.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ # STEP 2: Get the frame_index given the start tick.~ +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/require_tests.rb~ - Inside source: true *** True Line Result - # STEP 2: Get the frame_index given the start tick. -** Processing line: ~ sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites?~ + # ./samples/10_advanced_debugging/03_unit_tests/require_tests.rb +** Processing line: ~ def write_src path, src~ - Inside source: true *** True Line Result - sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites? -** Processing line: ~ hold_for: 4, # how long to hold each sprite?~ + def write_src path, src +** Processing line: ~ $gtk.write_file path, src~ - Inside source: true *** True Line Result - hold_for: 4, # how long to hold each sprite? -** Processing line: ~ repeat: true # should it repeat?~ + $gtk.write_file path, src +** Processing line: ~ end~ - Inside source: true *** True Line Result - repeat: true # should it repeat? + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # STEP 3: frame_index will return nil if the frame hasn't arrived yet~ +** Processing line: ~ write_src 'app/unit_testing_game.rb', <<-S~ - Inside source: true *** True Line Result - # STEP 3: frame_index will return nil if the frame hasn't arrived yet -** Processing line: ~ if sprite_index~ + write_src 'app/unit_testing_game.rb', <<-S +** Processing line: ~ module UnitTesting~ - Inside source: true *** True Line Result - if sprite_index -** Processing line: ~ # if the sprite_index is populated, use it to determine the source rectangle and render it~ + module UnitTesting +** Processing line: ~ class Game~ - Inside source: true *** True Line Result - # if the sprite_index is populated, use it to determine the source rectangle and render it -** Processing line: ~ args.lowrez.sprites << {~ + class Game +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.lowrez.sprites << { -** Processing line: ~ x: 0,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - x: 0, -** Processing line: ~ y: 0,~ + end +** Processing line: ~ S~ - Inside source: true *** True Line Result - y: 0, -** Processing line: ~ w: 64,~ + S +** Processing line: ~~ - Inside source: true *** True Line Result - w: 64, -** Processing line: ~ h: 64,~ + +** Processing line: ~ write_src 'lib/unit_testing_lib.rb', <<-S~ - Inside source: true *** True Line Result - h: 64, -** Processing line: ~ path: "sprites/explosion-sheet.png",~ + write_src 'lib/unit_testing_lib.rb', <<-S +** Processing line: ~ module UnitTesting~ - Inside source: true *** True Line Result - path: "sprites/explosion-sheet.png", -** Processing line: ~ source_x: 32 * sprite_index,~ + module UnitTesting +** Processing line: ~ class Lib~ - Inside source: true *** True Line Result - source_x: 32 * sprite_index, -** Processing line: ~ source_y: 0,~ + class Lib +** Processing line: ~ end~ - Inside source: true *** True Line Result - source_y: 0, -** Processing line: ~ source_w: 32,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - source_w: 32, -** Processing line: ~ source_h: 32~ + end +** Processing line: ~ S~ - Inside source: true *** True Line Result - source_h: 32 -** Processing line: ~ }~ -- Inside source: true -*** True Line Result - } -** Processing line: ~ else~ -- Inside source: true -*** True Line Result - else -** Processing line: ~ # if the sprite_index is nil, render a countdown instead~ -- Inside source: true -*** True Line Result - # if the sprite_index is nil, render a countdown instead -** Processing line: ~ countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1)~ -- Inside source: true -*** True Line Result - countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1) + S ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.lowrez.labels << args.lowrez~ -- Inside source: true -*** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ +** Processing line: ~ write_src 'app/nested/unit_testing_nested.rb', <<-S~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 32,~ + write_src 'app/nested/unit_testing_nested.rb', <<-S +** Processing line: ~ module UnitTesting~ - Inside source: true *** True Line Result - .merge(x: 32, -** Processing line: ~ y: 32,~ + module UnitTesting +** Processing line: ~ class Nested~ - Inside source: true *** True Line Result - y: 32, -** Processing line: ~ text: "Count Down: #{countdown_in_seconds}",~ + class Nested +** Processing line: ~ end~ - Inside source: true *** True Line Result - text: "Count Down: #{countdown_in_seconds}", -** Processing line: ~ alignment_enum: 1)~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - alignment_enum: 1) -** Processing line: ~ end~ + end +** Processing line: ~ S~ - Inside source: true *** True Line Result - end + S ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # render the current tick and the resolved sprite index~ +** Processing line: ~ require 'app/unit_testing_game.rb'~ - Inside source: true *** True Line Result - # render the current tick and the resolved sprite index -** Processing line: ~ args.lowrez.labels << args.lowrez~ + require 'app/unit_testing_game.rb' +** Processing line: ~ require 'app/nested/unit_testing_nested.rb'~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + require 'app/nested/unit_testing_nested.rb' +** Processing line: ~ require 'lib/unit_testing_lib.rb'~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 0,~ + require 'lib/unit_testing_lib.rb' +** Processing line: ~~ - Inside source: true *** True Line Result - .merge(x: 0, -** Processing line: ~ y: 11,~ + +** Processing line: ~ def test_require args, assert~ - Inside source: true *** True Line Result - y: 11, -** Processing line: ~ text: "tick: #{args.state.tick_count}")~ + def test_require args, assert +** Processing line: ~ UnitTesting::Game.new~ - Inside source: true *** True Line Result - text: "tick: #{args.state.tick_count}") -** Processing line: ~ args.lowrez.labels << args.lowrez~ + UnitTesting::Game.new +** Processing line: ~ UnitTesting::Lib.new~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + UnitTesting::Lib.new +** Processing line: ~ UnitTesting::Nested.new~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 0,~ + UnitTesting::Nested.new +** Processing line: ~ $gtk.exec 'rm ./mygame/app/unit_testing_game.rb'~ - Inside source: true *** True Line Result - .merge(x: 0, -** Processing line: ~ y: 5,~ + $gtk.exec 'rm ./mygame/app/unit_testing_game.rb' +** Processing line: ~ $gtk.exec 'rm ./mygame/app/nested/unit_testing_nested.rb'~ - Inside source: true *** True Line Result - y: 5, -** Processing line: ~ text: "sprite_index: #{sprite_index}")~ + $gtk.exec 'rm ./mygame/app/nested/unit_testing_nested.rb' +** Processing line: ~ $gtk.exec 'rm ./mygame/lib/unit_testing_lib.rb'~ - Inside source: true *** True Line Result - text: "sprite_index: #{sprite_index}") + $gtk.exec 'rm ./mygame/lib/unit_testing_lib.rb' +** Processing line: ~ assert.ok!~ +- Inside source: true +*** True Line Result + assert.ok! ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -54899,126 +58040,142 @@ 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 +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - ## # ============================================================================= -** Processing line: ~ ## # ==== HOW TO STORE STATE, ACCEPT INPUT, AND RENDER SPRITE BASED OFF OF STATE =~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - ## # ==== HOW TO STORE STATE, ACCEPT INPUT, AND RENDER SPRITE BASED OFF OF STATE = -** Processing line: ~ ## # =============================================================================~ -- Inside source: true + +** Processing line: ~*** Advanced Debugging - Unit Tests - serialize_deserialize_tests.rb~ +- Header detected. *** True Line Result - ## # ============================================================================= -** Processing line: ~ def how_to_move_a_sprite args~ + +*** True Line Result +*** Advanced Debugging - Unit Tests - serialize_deserialize_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/serialize_deserialize_tests.rb~ - Inside source: true *** True Line Result - def how_to_move_a_sprite args -** Processing line: ~ args.lowrez.labels << args.lowrez~ + # ./samples/10_advanced_debugging/03_unit_tests/serialize_deserialize_tests.rb +** Processing line: ~ def test_serialize args, assert~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + def test_serialize args, assert +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 32,~ + GTK::Entity.__reset_id__! +** Processing line: ~ args.state.player_one = "test"~ - Inside source: true *** True Line Result - .merge(x: 32, -** Processing line: ~ y: 62, text: "Use Arrow Keys",~ + args.state.player_one = "test" +** Processing line: ~ result = args.gtk.serialize_state args.state~ - Inside source: true *** True Line Result - y: 62, text: "Use Arrow Keys", -** Processing line: ~ alignment_enum: 1)~ + result = args.gtk.serialize_state args.state +** Processing line: ~ assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"~ - Inside source: true *** True Line Result - alignment_enum: 1) + assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}" ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.lowrez.labels << args.lowrez~ +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + GTK::Entity.__reset_id__! +** Processing line: ~ args.gtk.write_file 'state.txt', ''~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 32,~ + args.gtk.write_file 'state.txt', '' +** Processing line: ~ result = args.gtk.serialize_state 'state.txt', args.state~ - Inside source: true *** True Line Result - .merge(x: 32, -** Processing line: ~ y: 56, text: "Use WASD",~ + result = args.gtk.serialize_state 'state.txt', args.state +** Processing line: ~ assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"~ - Inside source: true *** True Line Result - y: 56, text: "Use WASD", -** Processing line: ~ alignment_enum: 1)~ + assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}" +** Processing line: ~ end~ - Inside source: true *** True Line Result - alignment_enum: 1) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.lowrez.labels << args.lowrez~ -- Inside source: true -*** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ +** Processing line: ~ def test_deserialize args, assert~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 32,~ + def test_deserialize args, assert +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - .merge(x: 32, -** Processing line: ~ y: 50, text: "Or Click",~ + GTK::Entity.__reset_id__! +** Processing line: ~ result = args.gtk.deserialize_state '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}'~ - Inside source: true *** True Line Result - y: 50, text: "Or Click", -** Processing line: ~ alignment_enum: 1)~ + result = args.gtk.deserialize_state '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}' +** Processing line: ~ assert.equal! result.player_one, "test"~ - Inside source: true *** True Line Result - alignment_enum: 1) + assert.equal! result.player_one, "test" ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # set the initial values for x and y using ||= ("or equal operator")~ +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - # set the initial values for x and y using ||= ("or equal operator") -** Processing line: ~ args.state.ship.x ||= 0~ + GTK::Entity.__reset_id__! +** Processing line: ~ args.gtk.write_file 'state.txt', '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}'~ - Inside source: true *** True Line Result - args.state.ship.x ||= 0 -** Processing line: ~ args.state.ship.y ||= 0~ + args.gtk.write_file 'state.txt', '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}' +** Processing line: ~ result = args.gtk.deserialize_state 'state.txt'~ - Inside source: true *** True Line Result - args.state.ship.y ||= 0 + result = args.gtk.deserialize_state 'state.txt' +** Processing line: ~ assert.equal! result.player_one, "test"~ +- Inside source: true +*** True Line Result + assert.equal! result.player_one, "test" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if a mouse click occurs, update the ship's x and y to be the location of the click~ +** Processing line: ~ def test_very_large_serialization args, assert~ - Inside source: true *** True Line Result - # if a mouse click occurs, update the ship's x and y to be the location of the click -** Processing line: ~ if args.lowrez.mouse_click~ + def test_very_large_serialization args, assert +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - if args.lowrez.mouse_click -** Processing line: ~ args.state.ship.x = args.lowrez.mouse_click.x~ + GTK::Entity.__reset_id__! +** Processing line: ~ size = 3000~ - Inside source: true *** True Line Result - args.state.ship.x = args.lowrez.mouse_click.x -** Processing line: ~ args.state.ship.y = args.lowrez.mouse_click.y~ + size = 3000 +** Processing line: ~ size.map_with_index do |i|~ - Inside source: true *** True Line Result - args.state.ship.y = args.lowrez.mouse_click.y + size.map_with_index do |i| +** Processing line: ~ args.state.send("k#{i}=".to_sym, i)~ +- Inside source: true +*** True Line Result + args.state.send("k#{i}=".to_sym, i) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -55027,458 +58184,466 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # if a or left arrow is pressed/held, decrement the ships x position~ -- Inside source: true -*** True Line Result - # if a or left arrow is pressed/held, decrement the ships x position -** Processing line: ~ if args.lowrez.keyboard.left~ +** Processing line: ~ result = args.gtk.serialize_state args.state~ - Inside source: true *** True Line Result - if args.lowrez.keyboard.left -** Processing line: ~ args.state.ship.x -= 1~ + result = args.gtk.serialize_state args.state +** Processing line: ~ assert.true! (args.gtk.console.log.join.include? "unlikely a string this large will deserialize correctly")~ - Inside source: true *** True Line Result - args.state.ship.x -= 1 -** Processing line: ~ end~ + assert.true! (args.gtk.console.log.join.include? "unlikely a string this large will deserialize correctly") +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if d or right arrow is pressed/held, increment the ships x position~ +** Processing line: ~ def test_strict_entity_serialization args, assert~ - Inside source: true *** True Line Result - # if d or right arrow is pressed/held, increment the ships x position -** Processing line: ~ if args.lowrez.keyboard.right~ + def test_strict_entity_serialization args, assert +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - if args.lowrez.keyboard.right -** Processing line: ~ args.state.ship.x += 1~ + GTK::Entity.__reset_id__! +** Processing line: ~ args.state.player_one = args.state.new_entity(:player, name: "Ryu")~ - Inside source: true *** True Line Result - args.state.ship.x += 1 -** Processing line: ~ end~ + args.state.player_one = args.state.new_entity(:player, name: "Ryu") +** Processing line: ~ args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken")~ - Inside source: true *** True Line Result - end + args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken") ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if s or down arrow is pressed/held, decrement the ships y position~ +** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ - Inside source: true *** True Line Result - # if s or down arrow is pressed/held, decrement the ships y position -** Processing line: ~ if args.lowrez.keyboard.down~ + serialized_state = args.gtk.serialize_state args.state +** Processing line: ~ assert.equal! serialized_state, '{:entity_id=>1, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>3, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken"}}'~ - Inside source: true *** True Line Result - if args.lowrez.keyboard.down -** Processing line: ~ args.state.ship.y -= 1~ + assert.equal! serialized_state, '{:entity_id=>1, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>3, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken"}}' +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.ship.y -= 1 -** Processing line: ~ end~ + +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - end + GTK::Entity.__reset_id__! +** Processing line: ~ deserialize_state = args.gtk.deserialize_state serialized_state~ +- Inside source: true +*** True Line Result + deserialize_state = args.gtk.deserialize_state serialized_state ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if w or up arrow is pressed/held, increment the ships y position~ +** Processing line: ~ assert.equal! args.state.player_one.name, deserialize_state.player_one.name~ - Inside source: true *** True Line Result - # if w or up arrow is pressed/held, increment the ships y position -** Processing line: ~ if args.lowrez.keyboard.up~ + assert.equal! args.state.player_one.name, deserialize_state.player_one.name +** Processing line: ~ assert.true! args.state.player_one.is_a? GTK::OpenEntity~ - Inside source: true *** True Line Result - if args.lowrez.keyboard.up -** Processing line: ~ args.state.ship.y += 1~ + assert.true! args.state.player_one.is_a? GTK::OpenEntity +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.ship.y += 1 -** Processing line: ~ end~ + +** Processing line: ~ assert.equal! args.state.player_two.name, deserialize_state.player_two.name~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + assert.equal! args.state.player_two.name, deserialize_state.player_two.name +** Processing line: ~ assert.true! args.state.player_two.is_a? GTK::StrictEntity~ - Inside source: true *** True Line Result - -** Processing line: ~ # render the sprite to the screen using the position stored in args.state.ship~ + assert.true! args.state.player_two.is_a? GTK::StrictEntity +** Processing line: ~ end~ - Inside source: true *** True Line Result - # render the sprite to the screen using the position stored in args.state.ship -** Processing line: ~ args.lowrez.sprites << {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.lowrez.sprites << { -** Processing line: ~ x: args.state.ship.x,~ + +** Processing line: ~ def test_strict_entity_serialization_with_nil args, assert~ - Inside source: true *** True Line Result - x: args.state.ship.x, -** Processing line: ~ y: args.state.ship.y,~ + def test_strict_entity_serialization_with_nil args, assert +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - y: args.state.ship.y, -** Processing line: ~ w: 5,~ + GTK::Entity.__reset_id__! +** Processing line: ~ args.state.player_one = args.state.new_entity(:player, name: "Ryu")~ - Inside source: true *** True Line Result - w: 5, -** Processing line: ~ h: 5,~ + args.state.player_one = args.state.new_entity(:player, name: "Ryu") +** Processing line: ~ args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken", blood_type: nil)~ - Inside source: true *** True Line Result - h: 5, -** Processing line: ~ path: 'sprites/lowrez-ship-blue.png',~ + args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken", blood_type: nil) +** Processing line: ~~ - Inside source: true *** True Line Result - path: 'sprites/lowrez-ship-blue.png', -** Processing line: ~ # parameters beyond this point are optional~ + +** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ - Inside source: true *** True Line Result - # parameters beyond this point are optional -** Processing line: ~ angle: 0, # Note: rotation angle is denoted in degrees NOT radians~ + serialized_state = args.gtk.serialize_state args.state +** Processing line: ~ assert.equal! serialized_state, '{:entity_id=>9, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}'~ - Inside source: true *** True Line Result - angle: 0, # Note: rotation angle is denoted in degrees NOT radians -** Processing line: ~ r: 255,~ + assert.equal! serialized_state, '{:entity_id=>9, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}' +** Processing line: ~~ - Inside source: true *** True Line Result - r: 255, -** Processing line: ~ g: 255,~ + +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - g: 255, -** Processing line: ~ b: 255,~ + GTK::Entity.__reset_id__! +** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ - Inside source: true *** True Line Result - b: 255, -** Processing line: ~ a: 255~ + deserialized_state = args.gtk.deserialize_state serialized_state +** Processing line: ~~ - Inside source: true *** True Line Result - a: 255 -** Processing line: ~ }~ + +** Processing line: ~ assert.equal! args.state.player_one.name, deserialized_state.player_one.name~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + assert.equal! args.state.player_one.name, deserialized_state.player_one.name +** Processing line: ~ assert.true! args.state.player_one.is_a? GTK::OpenEntity~ - Inside source: true *** True Line Result - end + assert.true! args.state.player_one.is_a? GTK::OpenEntity ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # =======================================================================~ +** Processing line: ~ assert.equal! args.state.player_two.name, deserialized_state.player_two.name~ - Inside source: true *** True Line Result - # ======================================================================= -** Processing line: ~ # ==== HOW TO DETERMINE COLLISION =======================================~ + assert.equal! args.state.player_two.name, deserialized_state.player_two.name +** Processing line: ~ assert.equal! args.state.player_two.blood_type, deserialized_state.player_two.blood_type~ - Inside source: true *** True Line Result - # ==== HOW TO DETERMINE COLLISION ======================================= -** Processing line: ~ # =======================================================================~ + assert.equal! args.state.player_two.blood_type, deserialized_state.player_two.blood_type +** Processing line: ~ assert.equal! deserialized_state.player_two.blood_type, nil~ - Inside source: true *** True Line Result - # ======================================================================= -** Processing line: ~ def how_to_determine_collision args~ + assert.equal! deserialized_state.player_two.blood_type, nil +** Processing line: ~ assert.true! args.state.player_two.is_a? GTK::StrictEntity~ - Inside source: true *** True Line Result - def how_to_determine_collision args -** Processing line: ~ # Render the instructions~ + assert.true! args.state.player_two.is_a? GTK::StrictEntity +** Processing line: ~~ - Inside source: true *** True Line Result - # Render the instructions -** Processing line: ~ args.lowrez.labels << args.lowrez~ + +** Processing line: ~ deserialized_state.player_two.blood_type = :O~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + deserialized_state.player_two.blood_type = :O +** Processing line: ~ assert.equal! deserialized_state.player_two.blood_type, :O~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 32,~ + assert.equal! deserialized_state.player_two.blood_type, :O +** Processing line: ~ end~ - Inside source: true *** True Line Result - .merge(x: 32, -** Processing line: ~ y: 62, text: "Click Anywhere",~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - y: 62, text: "Click Anywhere", -** Processing line: ~ alignment_enum: 1)~ + +** Processing line: ~ def test_multiple_strict_entities args, assert~ - Inside source: true *** True Line Result - alignment_enum: 1) -** Processing line: ~~ + def test_multiple_strict_entities args, assert +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - -** Processing line: ~ # if a mouse click occurs:~ + GTK::Entity.__reset_id__! +** Processing line: ~ args.state.player = args.state.new_entity_strict(:player_one, name: "Ryu")~ - Inside source: true *** True Line Result - # if a mouse click occurs: -** Processing line: ~ # - set ship_one if it isn't set~ + args.state.player = args.state.new_entity_strict(:player_one, name: "Ryu") +** Processing line: ~ args.state.enemy = args.state.new_entity_strict(:enemy, name: "Bison", other_property: 'extra mean')~ - Inside source: true *** True Line Result - # - set ship_one if it isn't set -** Processing line: ~ # - set ship_two if it isn't set~ + args.state.enemy = args.state.new_entity_strict(:enemy, name: "Bison", other_property: 'extra mean') +** Processing line: ~~ - Inside source: true *** True Line Result - # - set ship_two if it isn't set -** Processing line: ~ # - otherwise reset ship one and ship two~ + +** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ - Inside source: true *** True Line Result - # - otherwise reset ship one and ship two -** Processing line: ~ if args.lowrez.mouse_click~ + serialized_state = args.gtk.serialize_state args.state +** Processing line: ~~ - Inside source: true *** True Line Result - if args.lowrez.mouse_click -** Processing line: ~ # is ship_one set?~ + +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - # is ship_one set? -** Processing line: ~ if !args.state.ship_one~ + GTK::Entity.__reset_id__! +** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ - Inside source: true *** True Line Result - if !args.state.ship_one -** Processing line: ~ args.state.ship_one = { x: args.lowrez.mouse_click.x - 10,~ + deserialized_state = args.gtk.deserialize_state serialized_state +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.ship_one = { x: args.lowrez.mouse_click.x - 10, -** Processing line: ~ y: args.lowrez.mouse_click.y - 10,~ + +** Processing line: ~ assert.equal! deserialized_state.player.name, "Ryu"~ - Inside source: true *** True Line Result - y: args.lowrez.mouse_click.y - 10, -** Processing line: ~ w: 20,~ + assert.equal! deserialized_state.player.name, "Ryu" +** Processing line: ~ assert.equal! deserialized_state.enemy.other_property, "extra mean"~ - Inside source: true *** True Line Result - w: 20, -** Processing line: ~ h: 20 }~ + assert.equal! deserialized_state.enemy.other_property, "extra mean" +** Processing line: ~ end~ - Inside source: true *** True Line Result - h: 20 } -** Processing line: ~ # is ship_one set?~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # is ship_one set? -** Processing line: ~ elsif !args.state.ship_two~ + +** Processing line: ~ def test_by_reference_state args, assert~ - Inside source: true *** True Line Result - elsif !args.state.ship_two -** Processing line: ~ args.state.ship_two = { x: args.lowrez.mouse_click.x - 10,~ + def test_by_reference_state args, assert +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - args.state.ship_two = { x: args.lowrez.mouse_click.x - 10, -** Processing line: ~ y: args.lowrez.mouse_click.y - 10,~ + GTK::Entity.__reset_id__! +** Processing line: ~ args.state.a = { name: "Jane Doe" }~ - Inside source: true *** True Line Result - y: args.lowrez.mouse_click.y - 10, -** Processing line: ~ w: 20,~ + args.state.a = { name: "Jane Doe" } +** Processing line: ~ args.state.b = args.state.a~ - Inside source: true *** True Line Result - w: 20, -** Processing line: ~ h: 20 }~ + args.state.b = args.state.a +** Processing line: ~ assert.equal! args.state.a.object_id, args.state.b.object_id~ - Inside source: true *** True Line Result - h: 20 } -** Processing line: ~ # should we reset?~ + assert.equal! args.state.a.object_id, args.state.b.object_id +** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ - Inside source: true *** True Line Result - # should we reset? -** Processing line: ~ else~ + serialized_state = args.gtk.serialize_state args.state +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ args.state.ship_one = nil~ + +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - args.state.ship_one = nil -** Processing line: ~ args.state.ship_two = nil~ + GTK::Entity.__reset_id__! +** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ - Inside source: true *** True Line Result - args.state.ship_two = nil -** Processing line: ~ end~ + deserialized_state = args.gtk.deserialize_state serialized_state +** Processing line: ~ assert.equal! deserialized_state.a.object_id, deserialized_state.b.object_id~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + assert.equal! deserialized_state.a.object_id, deserialized_state.b.object_id +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # render ship one if it's set~ +** Processing line: ~ def test_by_reference_state_strict_entities args, assert~ - Inside source: true *** True Line Result - # render ship one if it's set -** Processing line: ~ if args.state.ship_one~ + def test_by_reference_state_strict_entities args, assert +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - if args.state.ship_one -** Processing line: ~ # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha~ + GTK::Entity.__reset_id__! +** Processing line: ~ args.state.a = { name: "Jane Doe" }~ - Inside source: true *** True Line Result - # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha -** Processing line: ~ # render ship one~ + args.state.a = { name: "Jane Doe" } +** Processing line: ~ args.state.strict_entity = args.state.new_entity_strict(:couple) do |e|~ - Inside source: true *** True Line Result - # render ship one -** Processing line: ~ args.lowrez.sprites << args.state.ship_one.merge(path: 'sprites/lowrez-ship-blue.png', a: 100)~ + args.state.strict_entity = args.state.new_entity_strict(:couple) do |e| +** Processing line: ~ e.one = args.state.new_entity_strict(:person, name: "Jane")~ - Inside source: true *** True Line Result - args.lowrez.sprites << args.state.ship_one.merge(path: 'sprites/lowrez-ship-blue.png', a: 100) + e.one = args.state.new_entity_strict(:person, name: "Jane") +** Processing line: ~ e.two = e.one~ +- Inside source: true +*** True Line Result + e.two = e.one ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ assert.equal! args.state.strict_entity.one, args.state.strict_entity.two~ - Inside source: true *** True Line Result - -** Processing line: ~ if args.state.ship_two~ + assert.equal! args.state.strict_entity.one, args.state.strict_entity.two +** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ - Inside source: true *** True Line Result - if args.state.ship_two -** Processing line: ~ # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha~ + serialized_state = args.gtk.serialize_state args.state +** Processing line: ~~ - Inside source: true *** True Line Result - # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha -** Processing line: ~ # render ship two~ + +** Processing line: ~ GTK::Entity.__reset_id__!~ - Inside source: true *** True Line Result - # render ship two -** Processing line: ~ args.lowrez.sprites << args.state.ship_two.merge(path: 'sprites/lowrez-ship-red.png', a: 100)~ + GTK::Entity.__reset_id__! +** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ - Inside source: true *** True Line Result - args.lowrez.sprites << args.state.ship_two.merge(path: 'sprites/lowrez-ship-red.png', a: 100) -** Processing line: ~ end~ + deserialized_state = args.gtk.deserialize_state serialized_state +** Processing line: ~ assert.equal! deserialized_state.strict_entity.one, deserialized_state.strict_entity.two~ - Inside source: true *** True Line Result - end + assert.equal! deserialized_state.strict_entity.one, deserialized_state.strict_entity.two +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # if both ship one and ship two are set, then determine collision~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - # if both ship one and ship two are set, then determine collision -** Processing line: ~ if args.state.ship_one && args.state.ship_two~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - if args.state.ship_one && args.state.ship_two -** Processing line: ~ # collision is determined using the intersect_rect? method~ -- Inside source: true + +** Processing line: ~*** Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb~ +- Header detected. *** True Line Result - # collision is determined using the intersect_rect? method -** Processing line: ~ if args.state.ship_one.intersect_rect? args.state.ship_two~ -- Inside source: true + *** True Line Result - if args.state.ship_one.intersect_rect? args.state.ship_two -** Processing line: ~ # if collision occurred, render the words collision!~ -- Inside source: true +*** Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - # if collision occurred, render the words collision! -** Processing line: ~ args.lowrez.labels << args.lowrez~ + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/state_serialization_experimental_tests.rb~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + # ./samples/10_advanced_debugging/03_unit_tests/state_serialization_experimental_tests.rb +** Processing line: ~ MAX_CODE_GEN_LENGTH = 50~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 31,~ + MAX_CODE_GEN_LENGTH = 50 +** Processing line: ~~ - Inside source: true *** True Line Result - .merge(x: 31, -** Processing line: ~ y: 5,~ + +** Processing line: ~ # NOTE: This is experimental/advanced stuff.~ - Inside source: true *** True Line Result - y: 5, -** Processing line: ~ text: "Collision!",~ + # NOTE: This is experimental/advanced stuff. +** Processing line: ~ def needs_partitioning? target~ - Inside source: true *** True Line Result - text: "Collision!", -** Processing line: ~ alignment_enum: 1)~ + def needs_partitioning? target +** Processing line: ~ target[:value].to_s.length > MAX_CODE_GEN_LENGTH~ - Inside source: true *** True Line Result - alignment_enum: 1) -** Processing line: ~ else~ + target[:value].to_s.length > MAX_CODE_GEN_LENGTH +** Processing line: ~ end~ - Inside source: true *** True Line Result - else -** Processing line: ~ # if collision occurred, render the words no collision.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # if collision occurred, render the words no collision. -** Processing line: ~ args.lowrez.labels << args.lowrez~ + +** Processing line: ~ def partition target~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + def partition target +** Processing line: ~ return [] unless needs_partitioning? target~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 31,~ + return [] unless needs_partitioning? target +** Processing line: ~ if target[:value].is_a? GTK::OpenEntity~ - Inside source: true *** True Line Result - .merge(x: 31, -** Processing line: ~ y: 5,~ + if target[:value].is_a? GTK::OpenEntity +** Processing line: ~ target[:value] = target[:value].hash~ - Inside source: true *** True Line Result - y: 5, -** Processing line: ~ text: "No Collision.",~ + target[:value] = target[:value].hash +** Processing line: ~ end~ - Inside source: true *** True Line Result - text: "No Collision.", -** Processing line: ~ alignment_enum: 1)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - alignment_enum: 1) -** Processing line: ~ end~ + +** Processing line: ~ results = []~ - Inside source: true *** True Line Result - end -** Processing line: ~ else~ + results = [] +** Processing line: ~ idx = 0~ - Inside source: true *** True Line Result - else -** Processing line: ~ # if both ship one and ship two aren't set, then render --~ + idx = 0 +** Processing line: ~ left, right = target[:value].partition do~ - Inside source: true *** True Line Result - # if both ship one and ship two aren't set, then render -- -** Processing line: ~ args.lowrez.labels << args.lowrez~ + left, right = target[:value].partition do +** Processing line: ~ idx += 1~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + idx += 1 +** Processing line: ~ idx.even?~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(x: 31,~ + idx.even? +** Processing line: ~ end~ - Inside source: true *** True Line Result - .merge(x: 31, -** Processing line: ~ y: 6,~ + end +** Processing line: ~ left, right = Hash[left], Hash[right]~ - Inside source: true *** True Line Result - y: 6, -** Processing line: ~ text: "--",~ + left, right = Hash[left], Hash[right] +** Processing line: ~ left = { value: left }~ - Inside source: true *** True Line Result - text: "--", -** Processing line: ~ alignment_enum: 1)~ + left = { value: left } +** Processing line: ~ right = { value: right}~ - Inside source: true *** True Line Result - alignment_enum: 1) -** Processing line: ~ end~ + right = { value: right} +** Processing line: ~ [left, right]~ - Inside source: true *** True Line Result - end + [left, right] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -55487,222 +58652,218 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ ## # =============================================================================~ +** Processing line: ~ def add_partition target, path, aggregate, final_result~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ ## # ==== HOW TO CREATE BUTTONS ==================================================~ + def add_partition target, path, aggregate, final_result +** Processing line: ~ partitions = partition target~ - Inside source: true *** True Line Result - ## # ==== HOW TO CREATE BUTTONS ================================================== -** Processing line: ~ ## # =============================================================================~ + partitions = partition target +** Processing line: ~ partitions.each do |part|~ - Inside source: true *** True Line Result - ## # ============================================================================= -** Processing line: ~ def how_to_create_buttons args~ + partitions.each do |part| +** Processing line: ~ if needs_partitioning? part~ - Inside source: true *** True Line Result - def how_to_create_buttons args -** Processing line: ~ # Define a button style~ + if needs_partitioning? part +** Processing line: ~ if part[:value].keys.length == 1~ - Inside source: true *** True Line Result - # Define a button style -** Processing line: ~ args.state.button_style = { w: 62, h: 10, r: 80, g: 80, b: 80 }~ + if part[:value].keys.length == 1 +** Processing line: ~ first_key = part[:value].keys[0]~ - Inside source: true *** True Line Result - args.state.button_style = { w: 62, h: 10, r: 80, g: 80, b: 80 } -** Processing line: ~ args.state.label_style = { r: 80, g: 80, b: 80 }~ + first_key = part[:value].keys[0] +** Processing line: ~ new_part = { value: part[:value][first_key] }~ - Inside source: true *** True Line Result - args.state.label_style = { r: 80, g: 80, b: 80 } -** Processing line: ~~ + new_part = { value: part[:value][first_key] } +** Processing line: ~ path.push first_key~ - Inside source: true *** True Line Result - -** Processing line: ~ # Render instructions~ + path.push first_key +** Processing line: ~ add_partition new_part, path, aggregate, final_result~ - Inside source: true *** True Line Result - # Render instructions -** Processing line: ~ args.state.button_message ||= "Press a Button!"~ + add_partition new_part, path, aggregate, final_result +** Processing line: ~ path.pop~ - Inside source: true *** True Line Result - args.state.button_message ||= "Press a Button!" -** Processing line: ~ args.lowrez.labels << args.lowrez~ + path.pop +** Processing line: ~ else~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + else +** Processing line: ~ add_partition part, path, aggregate, final_result~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(args.state.label_style)~ + add_partition part, path, aggregate, final_result +** Processing line: ~ end~ - Inside source: true *** True Line Result - .merge(args.state.label_style) -** Processing line: ~ .merge(x: 32,~ + end +** Processing line: ~ else~ - Inside source: true *** True Line Result - .merge(x: 32, -** Processing line: ~ y: 62,~ + else +** Processing line: ~ final_result << { value: { __path__: [*path] } }~ - Inside source: true *** True Line Result - y: 62, -** Processing line: ~ text: args.state.button_message,~ + final_result << { value: { __path__: [*path] } } +** Processing line: ~ final_result << { value: part[:value] }~ - Inside source: true *** True Line Result - text: args.state.button_message, -** Processing line: ~ alignment_enum: 1)~ + final_result << { value: part[:value] } +** Processing line: ~ end~ - Inside source: true *** True Line Result - alignment_enum: 1) -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # Creates button one using a border and a label~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # Creates button one using a border and a label -** Processing line: ~ args.state.button_one_border = args.state.button_style.merge( x: 1, y: 32)~ + +** Processing line: ~ def state_to_string state~ - Inside source: true *** True Line Result - args.state.button_one_border = args.state.button_style.merge( x: 1, y: 32) -** Processing line: ~ args.lowrez.borders << args.state.button_one_border~ + def state_to_string state +** Processing line: ~ parts_queue = []~ - Inside source: true *** True Line Result - args.lowrez.borders << args.state.button_one_border -** Processing line: ~ args.lowrez.labels << args.lowrez~ + parts_queue = [] +** Processing line: ~ final_queue = []~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + final_queue = [] +** Processing line: ~ add_partition({ value: state.hash },~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(args.state.label_style)~ + add_partition({ value: state.hash }, +** Processing line: ~ [],~ - Inside source: true *** True Line Result - .merge(args.state.label_style) -** Processing line: ~ .merge(x: args.state.button_one_border.x + 2,~ + [], +** Processing line: ~ parts_queue,~ - Inside source: true *** True Line Result - .merge(x: args.state.button_one_border.x + 2, -** Processing line: ~ y: args.state.button_one_border.y + LOWREZ_FONT_SM_HEIGHT + 2,~ + parts_queue, +** Processing line: ~ final_queue)~ - Inside source: true *** True Line Result - y: args.state.button_one_border.y + LOWREZ_FONT_SM_HEIGHT + 2, -** Processing line: ~ text: "Button One")~ + final_queue) +** Processing line: ~ final_queue.reject {|i| i[:value].keys.length == 0}.map do |i|~ - Inside source: true *** True Line Result - text: "Button One") -** Processing line: ~~ + final_queue.reject {|i| i[:value].keys.length == 0}.map do |i| +** Processing line: ~ i[:value].to_s~ - Inside source: true *** True Line Result - -** Processing line: ~ # Creates button two using a border and a label~ + i[:value].to_s +** Processing line: ~ end.join("\n#==================================================#\n")~ - Inside source: true *** True Line Result - # Creates button two using a border and a label -** Processing line: ~ args.state.button_two_border = args.state.button_style.merge( x: 1, y: 20)~ + end.join("\n#==================================================#\n") +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.button_two_border = args.state.button_style.merge( x: 1, y: 20) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.lowrez.borders << args.state.button_two_border~ -- Inside source: true -*** True Line Result - args.lowrez.borders << args.state.button_two_border -** Processing line: ~ args.lowrez.labels << args.lowrez~ +** Processing line: ~ def state_from_string string~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + def state_from_string string +** Processing line: ~ Kernel.eval("$load_data = {}")~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(args.state.label_style)~ + Kernel.eval("$load_data = {}") +** Processing line: ~ lines = string.split("\n#==================================================#\n")~ - Inside source: true *** True Line Result - .merge(args.state.label_style) -** Processing line: ~ .merge(x: args.state.button_two_border.x + 2,~ + lines = string.split("\n#==================================================#\n") +** Processing line: ~ lines.each do |l|~ - Inside source: true *** True Line Result - .merge(x: args.state.button_two_border.x + 2, -** Processing line: ~ y: args.state.button_two_border.y + LOWREZ_FONT_SM_HEIGHT + 2,~ + lines.each do |l| +** Processing line: ~ puts "todo: #{l}"~ - Inside source: true *** True Line Result - y: args.state.button_two_border.y + LOWREZ_FONT_SM_HEIGHT + 2, -** Processing line: ~ text: "Button Two")~ + puts "todo: #{l}" +** Processing line: ~ end~ - Inside source: true *** True Line Result - text: "Button Two") + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Initialize the state variable that tracks which button was clicked to "" (empty stringI~ +** Processing line: ~ GTK::OpenEntity.parse_from_hash $load_data~ - Inside source: true *** True Line Result - # Initialize the state variable that tracks which button was clicked to "" (empty stringI -** Processing line: ~ args.state.last_button_clicked ||= "--"~ + GTK::OpenEntity.parse_from_hash $load_data +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.last_button_clicked ||= "--" + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # If a click occurs, check to see if either button one, or button two was clicked~ +** Processing line: ~ def test_save_and_load args, assert~ - Inside source: true *** True Line Result - # If a click occurs, check to see if either button one, or button two was clicked -** Processing line: ~ # using the inside_rect? method of the mouse~ + def test_save_and_load args, assert +** Processing line: ~ args.state.item_1.name = "Jane"~ - Inside source: true *** True Line Result - # using the inside_rect? method of the mouse -** Processing line: ~ # set args.state.last_button_clicked accordingly~ + args.state.item_1.name = "Jane" +** Processing line: ~ string = state_to_string args.state~ - Inside source: true *** True Line Result - # set args.state.last_button_clicked accordingly -** Processing line: ~ if args.lowrez.mouse_click~ + string = state_to_string args.state +** Processing line: ~ state = state_from_string string~ - Inside source: true *** True Line Result - if args.lowrez.mouse_click -** Processing line: ~ if args.lowrez.mouse_click.inside_rect? args.state.button_one_border~ + state = state_from_string string +** Processing line: ~ assert.equal! args.state.item_1.name, state.item_1.name~ - Inside source: true *** True Line Result - if args.lowrez.mouse_click.inside_rect? args.state.button_one_border -** Processing line: ~ args.state.last_button_clicked = "One Clicked!"~ + assert.equal! args.state.item_1.name, state.item_1.name +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.last_button_clicked = "One Clicked!" -** Processing line: ~ elsif args.lowrez.mouse_click.inside_rect? args.state.button_two_border~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif args.lowrez.mouse_click.inside_rect? args.state.button_two_border -** Processing line: ~ args.state.last_button_clicked = "Two Clicked!"~ + +** Processing line: ~ def test_save_and_load_big args, assert~ - Inside source: true *** True Line Result - args.state.last_button_clicked = "Two Clicked!" -** Processing line: ~ else~ + def test_save_and_load_big args, assert +** Processing line: ~ size = 1000~ - Inside source: true *** True Line Result - else -** Processing line: ~ args.state.last_button_clicked = "--"~ + size = 1000 +** Processing line: ~ size.map_with_index do |i|~ - Inside source: true *** True Line Result - args.state.last_button_clicked = "--" -** Processing line: ~ end~ + size.map_with_index do |i| +** Processing line: ~ args.state.send("k#{i}=".to_sym, i)~ - Inside source: true *** True Line Result - end + args.state.send("k#{i}=".to_sym, i) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -55711,38 +58872,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Render the current value of args.state.last_button_clicked~ -- Inside source: true -*** True Line Result - # Render the current value of args.state.last_button_clicked -** Processing line: ~ args.lowrez.labels << args.lowrez~ +** Processing line: ~ string = state_to_string args.state~ - Inside source: true *** True Line Result - args.lowrez.labels << args.lowrez -** Processing line: ~ .default_label~ + string = state_to_string args.state +** Processing line: ~ state = state_from_string string~ - Inside source: true *** True Line Result - .default_label -** Processing line: ~ .merge(args.state.label_style)~ + state = state_from_string string +** Processing line: ~ size.map_with_index do |i|~ - Inside source: true *** True Line Result - .merge(args.state.label_style) -** Processing line: ~ .merge(x: 32,~ + size.map_with_index do |i| +** Processing line: ~ assert.equal! args.state.send("k#{i}".to_sym), state.send("k#{i}".to_sym)~ - Inside source: true *** True Line Result - .merge(x: 32, -** Processing line: ~ y: 5,~ + assert.equal! args.state.send("k#{i}".to_sym), state.send("k#{i}".to_sym) +** Processing line: ~ assert.equal! args.state.send("k#{i}".to_sym), i~ - Inside source: true *** True Line Result - y: 5, -** Processing line: ~ text: args.state.last_button_clicked,~ + assert.equal! args.state.send("k#{i}".to_sym), i +** Processing line: ~ assert.equal! state.send("k#{i}".to_sym), i~ - Inside source: true *** True Line Result - text: args.state.last_button_clicked, -** Processing line: ~ alignment_enum: 1)~ + assert.equal! state.send("k#{i}".to_sym), i +** Processing line: ~ end~ - Inside source: true *** True Line Result - alignment_enum: 1) + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -55751,250 +58908,250 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~~ +** Processing line: ~ def test_save_and_load_big_nested args, assert~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_debug args~ + def test_save_and_load_big_nested args, assert +** Processing line: ~ args.state.player_one.friend.nested_hash.k0 = 0~ - Inside source: true *** True Line Result - def render_debug args -** Processing line: ~ if !args.state.grid_rendered~ + args.state.player_one.friend.nested_hash.k0 = 0 +** Processing line: ~ args.state.player_one.friend.nested_hash.k1 = 1~ - Inside source: true *** True Line Result - if !args.state.grid_rendered -** Processing line: ~ 65.map_with_index do |i|~ + args.state.player_one.friend.nested_hash.k1 = 1 +** Processing line: ~ args.state.player_one.friend.nested_hash.k2 = 2~ - Inside source: true *** True Line Result - 65.map_with_index do |i| -** Processing line: ~ args.outputs.static_debug << {~ + args.state.player_one.friend.nested_hash.k2 = 2 +** Processing line: ~ args.state.player_one.friend.nested_hash.k3 = 3~ - Inside source: true *** True Line Result - args.outputs.static_debug << { -** Processing line: ~ x: LOWREZ_X_OFFSET,~ + args.state.player_one.friend.nested_hash.k3 = 3 +** Processing line: ~ args.state.player_one.friend.nested_hash.k4 = 4~ - Inside source: true *** True Line Result - x: LOWREZ_X_OFFSET, -** Processing line: ~ y: LOWREZ_Y_OFFSET + (i * 10),~ + args.state.player_one.friend.nested_hash.k4 = 4 +** Processing line: ~ args.state.player_one.friend.nested_hash.k5 = 5~ - Inside source: true *** True Line Result - y: LOWREZ_Y_OFFSET + (i * 10), -** Processing line: ~ x2: LOWREZ_X_OFFSET + LOWREZ_ZOOMED_SIZE,~ + args.state.player_one.friend.nested_hash.k5 = 5 +** Processing line: ~ args.state.player_one.friend.nested_hash.k6 = 6~ - Inside source: true *** True Line Result - x2: LOWREZ_X_OFFSET + LOWREZ_ZOOMED_SIZE, -** Processing line: ~ y2: LOWREZ_Y_OFFSET + (i * 10),~ + args.state.player_one.friend.nested_hash.k6 = 6 +** Processing line: ~ args.state.player_one.friend.nested_hash.k7 = 7~ - Inside source: true *** True Line Result - y2: LOWREZ_Y_OFFSET + (i * 10), -** Processing line: ~ r: 128,~ + args.state.player_one.friend.nested_hash.k7 = 7 +** Processing line: ~ args.state.player_one.friend.nested_hash.k8 = 8~ - Inside source: true *** True Line Result - r: 128, -** Processing line: ~ g: 128,~ + args.state.player_one.friend.nested_hash.k8 = 8 +** Processing line: ~ args.state.player_one.friend.nested_hash.k9 = 9~ - Inside source: true *** True Line Result - g: 128, -** Processing line: ~ b: 128,~ + args.state.player_one.friend.nested_hash.k9 = 9 +** Processing line: ~ string = state_to_string args.state~ - Inside source: true *** True Line Result - b: 128, -** Processing line: ~ a: 80~ + string = state_to_string args.state +** Processing line: ~ state = state_from_string string~ - Inside source: true *** True Line Result - a: 80 -** Processing line: ~ }.line~ + state = state_from_string string +** Processing line: ~ end~ - Inside source: true *** True Line Result - }.line + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.static_debug << {~ +** Processing line: ~ $gtk.reset 100~ - Inside source: true *** True Line Result - args.outputs.static_debug << { -** Processing line: ~ x: LOWREZ_X_OFFSET + (i * 10),~ + $gtk.reset 100 +** Processing line: ~ $gtk.log_level = :off~ - Inside source: true *** True Line Result - x: LOWREZ_X_OFFSET + (i * 10), -** Processing line: ~ y: LOWREZ_Y_OFFSET,~ + $gtk.log_level = :off +** Processing line: ~~ - Inside source: true *** True Line Result - y: LOWREZ_Y_OFFSET, -** Processing line: ~ x2: LOWREZ_X_OFFSET + (i * 10),~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - x2: LOWREZ_X_OFFSET + (i * 10), -** Processing line: ~ y2: LOWREZ_Y_OFFSET + LOWREZ_ZOOMED_SIZE,~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - y2: LOWREZ_Y_OFFSET + LOWREZ_ZOOMED_SIZE, -** Processing line: ~ r: 128,~ + +** Processing line: ~*** Advanced Debugging - Unit Tests - suggest_autocompletion_tests.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Advanced Debugging - Unit Tests - suggest_autocompletion_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/suggest_autocompletion_tests.rb~ - Inside source: true *** True Line Result - r: 128, -** Processing line: ~ g: 128,~ + # ./samples/10_advanced_debugging/03_unit_tests/suggest_autocompletion_tests.rb +** Processing line: ~ def default_suggest_autocompletion args~ - Inside source: true *** True Line Result - g: 128, -** Processing line: ~ b: 128,~ + def default_suggest_autocompletion args +** Processing line: ~ {~ - Inside source: true *** True Line Result - b: 128, -** Processing line: ~ a: 80~ + { +** Processing line: ~ index: 4,~ - Inside source: true *** True Line Result - a: 80 -** Processing line: ~ }.line~ + index: 4, +** Processing line: ~ text: "args.",~ - Inside source: true *** True Line Result - }.line -** Processing line: ~ end~ + text: "args.", +** Processing line: ~ __meta__: {~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + __meta__: { +** Processing line: ~ other_options: [~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + other_options: [ +** Processing line: ~ {~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.grid_rendered = true~ + { +** Processing line: ~ index: Fixnum,~ - Inside source: true *** True Line Result - args.state.grid_rendered = true -** Processing line: ~~ + index: Fixnum, +** Processing line: ~ file: "app/main.rb"~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.last_click ||= 0~ + file: "app/main.rb" +** Processing line: ~ }~ - Inside source: true *** True Line Result - args.state.last_click ||= 0 -** Processing line: ~ args.state.last_up ||= 0~ + } +** Processing line: ~ ]~ - Inside source: true *** True Line Result - args.state.last_up ||= 0 -** Processing line: ~ args.state.last_click = args.state.tick_count if args.lowrez.mouse_down # you can also use args.lowrez.click~ + ] +** Processing line: ~ }~ - Inside source: true *** True Line Result - args.state.last_click = args.state.tick_count if args.lowrez.mouse_down # you can also use args.lowrez.click -** Processing line: ~ args.state.last_up = args.state.tick_count if args.lowrez.mouse_up~ + } +** Processing line: ~ }~ - Inside source: true *** True Line Result - args.state.last_up = args.state.tick_count if args.lowrez.mouse_up -** Processing line: ~ args.state.label_style = { size_enum: -1.5 }~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.label_style = { size_enum: -1.5 } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.state.watch_list = [~ +** Processing line: ~ def assert_completion source, *expected~ - Inside source: true *** True Line Result - args.state.watch_list = [ -** Processing line: ~ "args.state.tick_count is: #{args.state.tick_count}",~ + def assert_completion source, *expected +** Processing line: ~ results = suggest_autocompletion text: (source.strip.gsub ":cursor", ""),~ - Inside source: true *** True Line Result - "args.state.tick_count is: #{args.state.tick_count}", -** Processing line: ~ "args.lowrez.mouse_position is: #{args.lowrez.mouse_position.x}, #{args.lowrez.mouse_position.y}",~ + results = suggest_autocompletion text: (source.strip.gsub ":cursor", ""), +** Processing line: ~ index: (source.strip.index ":cursor")~ - Inside source: true *** True Line Result - "args.lowrez.mouse_position is: #{args.lowrez.mouse_position.x}, #{args.lowrez.mouse_position.y}", -** Processing line: ~ "args.lowrez.mouse_down tick: #{args.state.last_click || "never"}",~ + index: (source.strip.index ":cursor") +** Processing line: ~~ - Inside source: true *** True Line Result - "args.lowrez.mouse_down tick: #{args.state.last_click || "never"}", -** Processing line: ~ "args.lowrez.mouse_up tick: #{args.state.last_up || "false"}",~ + +** Processing line: ~ puts results~ - Inside source: true *** True Line Result - "args.lowrez.mouse_up tick: #{args.state.last_up || "false"}", -** Processing line: ~ ]~ + puts results +** Processing line: ~ end~ - Inside source: true *** True Line Result - ] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.debug << args.state~ -- Inside source: true -*** True Line Result - args.outputs.debug << args.state -** Processing line: ~ .watch_list~ -- Inside source: true -*** True Line Result - .watch_list -** Processing line: ~ .map_with_index do |text, i|~ -- Inside source: true -*** True Line Result - .map_with_index do |text, i| -** Processing line: ~ {~ +** Processing line: ~ def test_args_completion args, assert~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: 5,~ + def test_args_completion args, assert +** Processing line: ~ $gtk.write_file_root "autocomplete.txt", ($gtk.suggest_autocompletion text: <<-S, index: 128).join("\n")~ - Inside source: true *** True Line Result - x: 5, -** Processing line: ~ y: 720 - (i * 20),~ + $gtk.write_file_root "autocomplete.txt", ($gtk.suggest_autocompletion text: <<-S, index: 128).join("\n") +** Processing line: ~ require 'app/game.rb'~ - Inside source: true *** True Line Result - y: 720 - (i * 20), -** Processing line: ~ text: text,~ + require 'app/game.rb' +** Processing line: ~~ - Inside source: true *** True Line Result - text: text, -** Processing line: ~ size_enum: -1.5~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - size_enum: -1.5 -** Processing line: ~ }.label~ + def tick args +** Processing line: ~ args.gtk.suppress_mailbox = false~ - Inside source: true *** True Line Result - }.label -** Processing line: ~ end~ + args.gtk.suppress_mailbox = false +** Processing line: ~ $game ||= Game.new~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + $game ||= Game.new +** Processing line: ~ $game.args = args~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.debug << {~ + $game.args = args +** Processing line: ~ $game.args.~ - Inside source: true *** True Line Result - args.outputs.debug << { -** Processing line: ~ x: 640,~ + $game.args. +** Processing line: ~ $game.tick~ - Inside source: true *** True Line Result - x: 640, -** Processing line: ~ y: 25,~ + $game.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - y: 25, -** 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.",~ + end +** Processing line: ~ S~ - Inside source: true *** True Line Result - 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,~ + S +** Processing line: ~~ - Inside source: true *** True Line Result - size_enum: -0.5, -** Processing line: ~ alignment_enum: 1~ + +** Processing line: ~ puts "contents:"~ - Inside source: true *** True Line Result - alignment_enum: 1 -** Processing line: ~ }.label~ + puts "contents:" +** Processing line: ~ puts ($gtk.read_file "autocomplete.txt")~ - Inside source: true *** True Line Result - }.label + puts ($gtk.read_file "autocomplete.txt") ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -56003,14 +59160,6 @@ 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 @@ -56019,162 +59168,158 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Platformer - Clepto Frog - main.rb~ +** Processing line: ~*** Http - Retrieve Images - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Platformer - Clepto Frog - main.rb +*** Http - Retrieve Images - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result *** True Line Result #+begin_src ruby -** Processing line: ~ # ./samples/99_genre_platformer/clepto_frog/app/main.rb~ -- Inside source: true -*** True Line Result - # ./samples/99_genre_platformer/clepto_frog/app/main.rb -** Processing line: ~ MAP_FILE_PATH = 'app/map.txt'~ +** Processing line: ~ # ./samples/11_http/01_retrieve_images/app/main.rb~ - Inside source: true *** True Line Result - MAP_FILE_PATH = 'app/map.txt' -** Processing line: ~~ + # ./samples/11_http/01_retrieve_images/app/main.rb +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - -** Processing line: ~ require 'app/map.rb'~ + def tick args +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - require 'app/map.rb' + args.outputs.background_color = [0, 0, 0] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class CleptoFrog~ +** Processing line: ~ # Show a warning at the start.~ - Inside source: true *** True Line Result - class CleptoFrog -** Processing line: ~ attr_gtk~ + # Show a warning at the start. +** Processing line: ~ args.state.warning_debounce ||= 11 * 60~ - Inside source: true *** True Line Result - attr_gtk -** Processing line: ~~ + args.state.warning_debounce ||= 11 * 60 +** Processing line: ~ if args.state.warning_debounce > 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_ending~ + if args.state.warning_debounce > 0 +** Processing line: ~ args.state.warning_debounce -= 1~ - Inside source: true *** True Line Result - def render_ending -** Processing line: ~ state.game_over_at ||= state.tick_count~ + args.state.warning_debounce -= 1 +** Processing line: ~ args.outputs.labels << [640, 600, "This app shows random images from the Internet.", 10, 1, 255, 255, 255]~ - Inside source: true *** True Line Result - state.game_over_at ||= state.tick_count -** Processing line: ~~ + args.outputs.labels << [640, 600, "This app shows random images from the Internet.", 10, 1, 255, 255, 255] +** Processing line: ~ args.outputs.labels << [640, 500, "Quit in the next few seconds if this is a problem.", 10, 1, 255, 255, 255]~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.labels << [640, 700, "Clepto Frog", 4, 1]~ + args.outputs.labels << [640, 500, "Quit in the next few seconds if this is a problem.", 10, 1, 255, 255, 255] +** Processing line: ~ args.outputs.labels << [640, 350, "#{(args.state.warning_debounce / 60.0).to_i}", 10, 1, 255, 255, 255]~ - Inside source: true *** True Line Result - outputs.labels << [640, 700, "Clepto Frog", 4, 1] -** Processing line: ~~ + args.outputs.labels << [640, 350, "#{(args.state.warning_debounce / 60.0).to_i}", 10, 1, 255, 255, 255] +** Processing line: ~ return~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.tick_count >= (state.game_over_at + 120)~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - if state.tick_count >= (state.game_over_at + 120) -** Processing line: ~ outputs.labels << [640, 620, "\"I... I.... don't believe it.\" - New Guy",~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.labels << [640, 620, "\"I... I.... don't believe it.\" - New Guy", -** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 120).ease(60)]~ + +** Processing line: ~ args.state.download_debounce ||= 0 # start immediately, reset to non zero later.~ - Inside source: true *** True Line Result - 4, 1, 0, 0, 0, 255 * (state.game_over_at + 120).ease(60)] -** Processing line: ~ end~ + args.state.download_debounce ||= 0 # start immediately, reset to non zero later. +** Processing line: ~ args.state.photos ||= []~ - Inside source: true *** True Line Result - end + args.state.photos ||= [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.tick_count >= (state.game_over_at + 240)~ -- Inside source: true -*** True Line Result - if state.tick_count >= (state.game_over_at + 240) -** Processing line: ~ outputs.labels << [640, 580, "\"He actually stole all the mugs?\" - New Guy",~ -- Inside source: true -*** True Line Result - outputs.labels << [640, 580, "\"He actually stole all the mugs?\" - New Guy", -** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 240).ease(60)]~ +** Processing line: ~ # Put a little pause between each download.~ - Inside source: true *** True Line Result - 4, 1, 0, 0, 0, 255 * (state.game_over_at + 240).ease(60)] -** Processing line: ~ end~ + # Put a little pause between each download. +** Processing line: ~ if args.state.download.nil?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if args.state.download.nil? +** Processing line: ~ if args.state.download_debounce > 0~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.tick_count >= (state.game_over_at + 360)~ + if args.state.download_debounce > 0 +** Processing line: ~ args.state.download_debounce -= 1~ - Inside source: true *** True Line Result - if state.tick_count >= (state.game_over_at + 360) -** Processing line: ~ outputs.labels << [640, 540, "\"Kind of feel bad STARTING HIM WITH NOTHING again.\" - New Guy",~ + args.state.download_debounce -= 1 +** Processing line: ~ else~ - Inside source: true *** True Line Result - outputs.labels << [640, 540, "\"Kind of feel bad STARTING HIM WITH NOTHING again.\" - New Guy", -** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 360).ease(60)]~ + else +** Processing line: ~ args.state.download = $gtk.http_get 'https://picsum.photos/200/300.jpg'~ - Inside source: true *** True Line Result - 4, 1, 0, 0, 0, 255 * (state.game_over_at + 360).ease(60)] + args.state.download = $gtk.http_get 'https://picsum.photos/200/300.jpg' ** 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: ~ outputs.sprites << [640 - 50, 360 - 50, 100, 100,~ +** Processing line: ~ if !args.state.download.nil?~ - Inside source: true *** True Line Result - outputs.sprites << [640 - 50, 360 - 50, 100, 100, -** Processing line: ~ "sprites/square-green.png"]~ + if !args.state.download.nil? +** Processing line: ~ if args.state.download[:complete]~ - Inside source: true *** True Line Result - "sprites/square-green.png"] -** Processing line: ~~ + if args.state.download[:complete] +** Processing line: ~ if args.state.download[:http_response_code] == 200~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.labels << [640, 300, "Current Time: #{"%.2f" % state.stuff_time}", 4, 1]~ + if args.state.download[:http_response_code] == 200 +** Processing line: ~ fname = "sprites/#{args.state.photos.length}.jpg"~ - Inside source: true *** True Line Result - outputs.labels << [640, 300, "Current Time: #{"%.2f" % state.stuff_time}", 4, 1] -** Processing line: ~ outputs.labels << [640, 270, "Best Time: #{"%.2f" % state.stuff_best_time}", 4, 1]~ + fname = "sprites/#{args.state.photos.length}.jpg" +** Processing line: ~ $gtk.write_file fname, args.state.download[:response_data]~ - Inside source: true *** True Line Result - outputs.labels << [640, 270, "Best Time: #{"%.2f" % state.stuff_best_time}", 4, 1] -** Processing line: ~~ + $gtk.write_file fname, args.state.download[:response_data] +** Processing line: ~ args.state.photos << [ 100 + rand(1080), 500 - rand(480), fname, rand(80) - 40 ]~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.tick_count >= (state.game_over_at + 550)~ + args.state.photos << [ 100 + rand(1080), 500 - rand(480), fname, rand(80) - 40 ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - if state.tick_count >= (state.game_over_at + 550) -** Processing line: ~ restart_game~ + end +** Processing line: ~ args.state.download = nil~ - Inside source: true *** True Line Result - restart_game + args.state.download = nil +** Processing line: ~ args.state.download_debounce = (rand(3) + 2) * 60~ +- Inside source: true +*** True Line Result + args.state.download_debounce = (rand(3) + 2) * 60 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -56187,1138 +59332,1226 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def restart_game~ +** Processing line: ~ # draw any downloaded photos...~ - Inside source: true *** True Line Result - def restart_game -** Processing line: ~ state.world = nil~ + # draw any downloaded photos... +** Processing line: ~ args.state.photos.each { |i|~ - Inside source: true *** True Line Result - state.world = nil -** Processing line: ~ state.x = nil~ + args.state.photos.each { |i| +** Processing line: ~ args.outputs.primitives << [i[0], i[1], 200, 300, i[2], i[3]].sprite~ - Inside source: true *** True Line Result - state.x = nil -** Processing line: ~ state.y = nil~ + args.outputs.primitives << [i[0], i[1], 200, 300, i[2], i[3]].sprite +** Processing line: ~ }~ - Inside source: true *** True Line Result - state.y = nil -** Processing line: ~ state.dx = nil~ + } +** Processing line: ~~ - Inside source: true *** True Line Result - state.dx = nil -** Processing line: ~ state.dy = nil~ + +** Processing line: ~ # Draw a download progress bar...~ - Inside source: true *** True Line Result - state.dy = nil -** Processing line: ~ state.stuff_score = 0~ + # Draw a download progress bar... +** Processing line: ~ args.outputs.primitives << [0, 0, 1280, 30, 0, 0, 0, 255].solid~ - Inside source: true *** True Line Result - state.stuff_score = 0 -** Processing line: ~ state.stuff_time = 0~ + args.outputs.primitives << [0, 0, 1280, 30, 0, 0, 0, 255].solid +** Processing line: ~ if !args.state.download.nil?~ - Inside source: true *** True Line Result - state.stuff_time = 0 -** Processing line: ~ state.intro_tick_count = nil~ + if !args.state.download.nil? +** Processing line: ~ br = args.state.download[:response_read]~ - Inside source: true *** True Line Result - state.intro_tick_count = nil -** Processing line: ~ defaults~ + br = args.state.download[:response_read] +** Processing line: ~ total = args.state.download[:response_total]~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ state.game_start_at = state.tick_count~ + total = args.state.download[:response_total] +** Processing line: ~ if total != 0~ - Inside source: true *** True Line Result - state.game_start_at = state.tick_count -** Processing line: ~ state.scene = :game~ + if total != 0 +** Processing line: ~ pct = br.to_f / total.to_f~ - Inside source: true *** True Line Result - state.scene = :game -** Processing line: ~ state.game_over_at = nil~ + pct = br.to_f / total.to_f +** Processing line: ~ args.outputs.primitives << [0, 0, 1280 * pct, 30, 0, 0, 255, 255].solid~ - Inside source: true *** True Line Result - state.game_over_at = nil + args.outputs.primitives << [0, 0, 1280 * pct, 30, 0, 0, 255, 255].solid +** 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 render_intro~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - def render_intro -** Processing line: ~ outputs.labels << [640, 700, "Clepto Frog", 4, 1]~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - outputs.labels << [640, 700, "Clepto Frog", 4, 1] -** Processing line: ~ if state.tick_count >= 120~ + +** Processing line: ~*** Http - Web Server - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Http - Web Server - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/11_http/02_web_server/app/main.rb~ - Inside source: true *** True Line Result - if state.tick_count >= 120 -** Processing line: ~ outputs.labels << [640, 620, "\"Uh... your office has a pet frog?\" - New Guy",~ + # ./samples/11_http/02_web_server/app/main.rb +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - outputs.labels << [640, 620, "\"Uh... your office has a pet frog?\" - New Guy", -** Processing line: ~ 4, 1, 0, 0, 0, 255 * 120.ease(60)]~ + def tick args +** Processing line: ~ args.state.port ||= 3000~ - Inside source: true *** True Line Result - 4, 1, 0, 0, 0, 255 * 120.ease(60)] -** Processing line: ~ end~ + args.state.port ||= 3000 +** Processing line: ~ # by default the embedded webserver runs on port 9001 (the port number is over 9000) and is disabled in a production build~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # by default the embedded webserver runs on port 9001 (the port number is over 9000) and is disabled in a production build +** Processing line: ~ # to enable the http server in a production build, you need to manually start~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.tick_count >= 240~ + # to enable the http server in a production build, you need to manually start +** Processing line: ~ # the server up:~ - Inside source: true *** True Line Result - if state.tick_count >= 240 -** Processing line: ~ outputs.labels << [640, 580, "\"Yep! His name is Clepto.\" - Jim",~ + # the server up: +** Processing line: ~ args.gtk.start_server! port: args.state.port, enable_in_prod: true~ - Inside source: true *** True Line Result - outputs.labels << [640, 580, "\"Yep! His name is Clepto.\" - Jim", -** Processing line: ~ 4, 1, 0, 0, 0, 255 * 240.ease(60)]~ + args.gtk.start_server! port: args.state.port, enable_in_prod: true +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - 4, 1, 0, 0, 0, 255 * 240.ease(60)] -** Processing line: ~ end~ + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.outputs.labels << [640, 600, "Point your web browser at http://localhost:#{args.state.port}/", 10, 1, 255, 255, 255]~ - Inside source: true *** True Line Result - end + args.outputs.labels << [640, 600, "Point your web browser at http://localhost:#{args.state.port}/", 10, 1, 255, 255, 255] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.tick_count >= 360~ +** Processing line: ~ args.inputs.http_requests.each { |req|~ - Inside source: true *** True Line Result - if state.tick_count >= 360 -** Processing line: ~ outputs.labels << [640, 540, "\"Uh...\" - New Guy",~ + args.inputs.http_requests.each { |req| +** Processing line: ~ puts("METHOD: #{req.method}");~ - Inside source: true *** True Line Result - outputs.labels << [640, 540, "\"Uh...\" - New Guy", -** Processing line: ~ 4, 1, 0, 0, 0, 255 * 360.ease(60)]~ + puts("METHOD: #{req.method}"); +** Processing line: ~ puts("URI: #{req.uri}");~ - Inside source: true *** True Line Result - 4, 1, 0, 0, 0, 255 * 360.ease(60)] -** Processing line: ~ end~ + puts("URI: #{req.uri}"); +** Processing line: ~ puts("HEADERS:");~ - Inside source: true *** True Line Result - end + puts("HEADERS:"); +** Processing line: ~ req.headers.each { |k,v| puts(" #{k}: #{v}") }~ +- Inside source: true +*** True Line Result + req.headers.each { |k,v| puts(" #{k}: #{v}") } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.tick_count >= 480~ +** Processing line: ~ if (req.uri == '/')~ - Inside source: true *** True Line Result - if state.tick_count >= 480 -** Processing line: ~ outputs.labels << [640, 500, "\"He steals mugs while we're away...\" - Jim",~ + if (req.uri == '/') +** Processing line: ~ # headers and body can be nil if you don't care about them.~ - Inside source: true *** True Line Result - outputs.labels << [640, 500, "\"He steals mugs while we're away...\" - Jim", -** Processing line: ~ 4, 1, 0, 0, 0, 255 * 480.ease(60)]~ + # headers and body can be nil if you don't care about them. +** Processing line: ~ # If you don't set the Content-Type, it will default to~ - Inside source: true *** True Line Result - 4, 1, 0, 0, 0, 255 * 480.ease(60)] -** Processing line: ~ end~ + # If you don't set the Content-Type, it will default to +** Processing line: ~ # "text/html; charset=utf-8".~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # "text/html; charset=utf-8". +** Processing line: ~ # Don't set Content-Length; we'll ignore it and calculate it for you~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.tick_count >= 600~ + # Don't set Content-Length; we'll ignore it and calculate it for you +** Processing line: ~ args.state.reqnum += 1~ - Inside source: true *** True Line Result - if state.tick_count >= 600 -** Processing line: ~ outputs.labels << [640, 460, "\"It's not a big deal, we take them back in the morning.\" - Jim",~ + args.state.reqnum += 1 +** Processing line: ~ req.respond 200, "hello

    This #{req.method} was request number #{args.state.reqnum}!

    \n", { 'X-DRGTK-header' => 'Powered by DragonRuby!' }~ - Inside source: true *** True Line Result - outputs.labels << [640, 460, "\"It's not a big deal, we take them back in the morning.\" - Jim", -** Processing line: ~ 4, 1, 0, 0, 0, 255 * 600.ease(60)]~ + req.respond 200, "hello

    This #{req.method} was request number #{args.state.reqnum}!

    \n", { 'X-DRGTK-header' => 'Powered by DragonRuby!' } +** Processing line: ~ else~ - Inside source: true *** True Line Result - 4, 1, 0, 0, 0, 255 * 600.ease(60)] + else +** Processing line: ~ req.reject~ +- Inside source: true +*** True Line Result + req.reject ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ }~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.sprites << [640 - 50, 360 - 50, 100, 100,~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.sprites << [640 - 50, 360 - 50, 100, 100, -** Processing line: ~ "sprites/square-green.png"]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - "sprites/square-green.png"] + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ if state.tick_count == 800~ -- Inside source: true +** Processing line: ~*** C Extensions - Basics - main.rb~ +- Header detected. *** True Line Result - if state.tick_count == 800 -** Processing line: ~ state.scene = :game~ -- Inside source: true + *** True Line Result - state.scene = :game -** Processing line: ~ state.game_start_at = state.tick_count~ +*** C Extensions - Basics - 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/12_c_extensions/01_basics/app/main.rb~ - Inside source: true *** True Line Result - state.game_start_at = state.tick_count -** Processing line: ~ end~ + # ./samples/12_c_extensions/01_basics/app/main.rb +** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + $gtk.ffi_misc.gtk_dlopen("ext") +** Processing line: ~ include FFI::CExt~ - Inside source: true *** True Line Result - end + include FFI::CExt ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ defaults~ + def tick args +** Processing line: ~ args.outputs.labels << [640, 500, "mouse.x = #{args.mouse.x.to_i}", 5, 1]~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ if state.scene == :intro && state.tick_count <= 800~ + args.outputs.labels << [640, 500, "mouse.x = #{args.mouse.x.to_i}", 5, 1] +** Processing line: ~ args.outputs.labels << [640, 460, "square(mouse.x) = #{square(args.mouse.x.to_i)}", 5, 1]~ - Inside source: true *** True Line Result - if state.scene == :intro && state.tick_count <= 800 -** Processing line: ~ render_intro~ + args.outputs.labels << [640, 460, "square(mouse.x) = #{square(args.mouse.x.to_i)}", 5, 1] +** Processing line: ~ args.outputs.labels << [640, 420, "mouse.y = #{args.mouse.y.to_i}", 5, 1]~ - Inside source: true *** True Line Result - render_intro -** Processing line: ~ elsif state.scene == :ending~ + args.outputs.labels << [640, 420, "mouse.y = #{args.mouse.y.to_i}", 5, 1] +** Processing line: ~ args.outputs.labels << [640, 380, "square(mouse.y) = #{square(args.mouse.y.to_i)}", 5, 1]~ - Inside source: true *** True Line Result - elsif state.scene == :ending -** Processing line: ~ render_ending~ + args.outputs.labels << [640, 380, "square(mouse.y) = #{square(args.mouse.y.to_i)}", 5, 1] +** Processing line: ~ end~ - Inside source: true *** True Line Result - render_ending -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ render~ + +** Processing line: ~~ - Inside source: true *** True Line Result - render -** Processing line: ~ end~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - end -** Processing line: ~ calc~ +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** C Extensions - Intermediate - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** C Extensions - Intermediate - 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/12_c_extensions/02_intermediate/app/main.rb~ - Inside source: true *** True Line Result - calc -** Processing line: ~ process_inputs~ + # ./samples/12_c_extensions/02_intermediate/app/main.rb +** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ - Inside source: true *** True Line Result - process_inputs -** Processing line: ~ end~ + $gtk.ffi_misc.gtk_dlopen("ext") +** Processing line: ~ include FFI::RE~ - Inside source: true *** True Line Result - end + include FFI::RE ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def defaults~ +** Processing line: ~ def split_words(input)~ - Inside source: true *** True Line Result - def defaults -** Processing line: ~ state.scene ||= :intro~ + def split_words(input) +** Processing line: ~ words = []~ - Inside source: true *** True Line Result - state.scene ||= :intro -** Processing line: ~ state.stuff_score ||= 0~ + words = [] +** Processing line: ~ last = IntPointer.new~ - Inside source: true *** True Line Result - state.stuff_score ||= 0 -** Processing line: ~ state.stuff_time ||= 0~ + last = IntPointer.new +** Processing line: ~ re = re_compile("\\w+")~ - Inside source: true *** True Line Result - state.stuff_time ||= 0 -** Processing line: ~ state.stuff_best_time ||= nil~ + re = re_compile("\\w+") +** Processing line: ~ first = re_matchp(re, input, last)~ - Inside source: true *** True Line Result - state.stuff_best_time ||= nil -** Processing line: ~ state.camera_x ||= 0~ + first = re_matchp(re, input, last) +** Processing line: ~ while first != -1~ - Inside source: true *** True Line Result - state.camera_x ||= 0 -** Processing line: ~ state.camera_y ||= 0~ + while first != -1 +** Processing line: ~ words << input.slice(first, last.value)~ - Inside source: true *** True Line Result - state.camera_y ||= 0 -** Processing line: ~ state.target_camera_scale ||= 1~ + words << input.slice(first, last.value) +** Processing line: ~ input = input.slice(last.value + first, input.length)~ - Inside source: true *** True Line Result - state.target_camera_scale ||= 1 -** Processing line: ~ state.camera_scale ||= 1~ + input = input.slice(last.value + first, input.length) +** Processing line: ~ first = re_matchp(re, input, last)~ - Inside source: true *** True Line Result - state.camera_scale ||= 1 -** Processing line: ~ state.tongue_length ||= 100~ + first = re_matchp(re, input, last) +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.tongue_length ||= 100 -** Processing line: ~ state.dev_action ||= :collision_mode~ + end +** Processing line: ~ words~ - Inside source: true *** True Line Result - state.dev_action ||= :collision_mode -** Processing line: ~ state.action ||= :aiming~ + words +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.action ||= :aiming -** Processing line: ~ state.tongue_angle ||= 90~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.tongue_angle ||= 90 -** Processing line: ~ state.tile_size = 64~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - state.tile_size = 64 -** Processing line: ~ state.gravity = -0.1~ + def tick args +** Processing line: ~ args.outputs.labels << [640, 500, split_words("hello, dragonriders!").join(' '), 5, 1]~ - Inside source: true *** True Line Result - state.gravity = -0.1 -** Processing line: ~ state.air = -0.01~ + args.outputs.labels << [640, 500, split_words("hello, dragonriders!").join(' '), 5, 1] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.air = -0.01 -** Processing line: ~ state.player_width = 60~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.player_width = 60 -** Processing line: ~ state.player_height = 60~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - state.player_height = 60 -** Processing line: ~ state.collision_tolerance = 0.0~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - state.collision_tolerance = 0.0 -** Processing line: ~ state.previous_tile_size ||= state.tile_size~ -- Inside source: true + +** Processing line: ~*** C Extensions - Native Pixel Arrays - main.rb~ +- Header detected. *** True Line Result - state.previous_tile_size ||= state.tile_size -** Processing line: ~ state.x ||= 2400~ -- Inside source: true + *** True Line Result - state.x ||= 2400 -** Processing line: ~ state.y ||= 200~ -- Inside source: true +*** C Extensions - Native Pixel Arrays - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - state.y ||= 200 -** Processing line: ~ state.dy ||= 0~ -- Inside source: true + *** True Line Result - state.dy ||= 0 -** Processing line: ~ state.dx ||= 0~ +#+begin_src ruby +** Processing line: ~ # ./samples/12_c_extensions/03_native_pixel_arrays/app/main.rb~ - Inside source: true *** True Line Result - state.dx ||= 0 -** Processing line: ~ attempt_load_world_from_file~ + # ./samples/12_c_extensions/03_native_pixel_arrays/app/main.rb +** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ - Inside source: true *** True Line Result - attempt_load_world_from_file -** Processing line: ~ state.world_lookup ||= { }~ + $gtk.ffi_misc.gtk_dlopen("ext") +** Processing line: ~ include FFI::CExt~ - Inside source: true *** True Line Result - state.world_lookup ||= { } -** Processing line: ~ state.world_collision_rects ||= []~ + include FFI::CExt +** Processing line: ~~ - Inside source: true *** True Line Result - state.world_collision_rects ||= [] -** Processing line: ~ state.mode ||= :creating~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - state.mode ||= :creating -** Processing line: ~ state.select_menu ||= [0, 720, 1280, 720]~ + def tick args +** Processing line: ~ args.state.rotation ||= 0~ - Inside source: true *** True Line Result - state.select_menu ||= [0, 720, 1280, 720] -** Processing line: ~ state.sprite_quantity ||= 20~ + args.state.rotation ||= 0 +** Processing line: ~~ - Inside source: true *** True Line Result - state.sprite_quantity ||= 20 -** Processing line: ~ state.sprite_coords ||= []~ + +** Processing line: ~ update_scanner_texture # this calls into a C extension!~ - Inside source: true *** True Line Result - state.sprite_coords ||= [] -** Processing line: ~ state.banner_coords ||= [640, 680 + 720]~ + update_scanner_texture # this calls into a C extension! +** Processing line: ~~ - Inside source: true *** True Line Result - state.banner_coords ||= [640, 680 + 720] -** Processing line: ~ state.sprite_selected ||= 1~ + +** Processing line: ~ # New/changed pixel arrays get uploaded to the GPU before we render~ - Inside source: true *** True Line Result - state.sprite_selected ||= 1 -** Processing line: ~ state.map_saved_at ||= 0~ + # New/changed pixel arrays get uploaded to the GPU before we render +** Processing line: ~ # anything. At that point, they can be scaled, rotated, and otherwise~ - Inside source: true *** True Line Result - state.map_saved_at ||= 0 -** Processing line: ~ state.intro_tick_count ||= state.tick_count~ + # anything. At that point, they can be scaled, rotated, and otherwise +** Processing line: ~ # used like any other sprite.~ - Inside source: true *** True Line Result - state.intro_tick_count ||= state.tick_count -** Processing line: ~ if state.sprite_coords == []~ + # used like any other sprite. +** Processing line: ~ w = 100~ - Inside source: true *** True Line Result - if state.sprite_coords == [] -** Processing line: ~ count = 1~ + w = 100 +** Processing line: ~ h = 100~ - Inside source: true *** True Line Result - count = 1 -** Processing line: ~ temp_x = 165~ + h = 100 +** Processing line: ~ x = (1280 - w) / 2~ - Inside source: true *** True Line Result - temp_x = 165 -** Processing line: ~ temp_y = 500 + 720~ + x = (1280 - w) / 2 +** Processing line: ~ y = (720 - h) / 2~ - Inside source: true *** True Line Result - temp_y = 500 + 720 -** Processing line: ~ state.sprite_quantity.times do~ + y = (720 - h) / 2 +** Processing line: ~ args.outputs.background_color = [64, 0, 128]~ - Inside source: true *** True Line Result - state.sprite_quantity.times do -** Processing line: ~ state.sprite_coords += [[temp_x, temp_y, count]]~ + args.outputs.background_color = [64, 0, 128] +** Processing line: ~ args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite~ - Inside source: true *** True Line Result - state.sprite_coords += [[temp_x, temp_y, count]] -** Processing line: ~ temp_x += 100~ + args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite +** Processing line: ~ args.state.rotation += 1~ - Inside source: true *** True Line Result - temp_x += 100 -** Processing line: ~ count += 1~ + args.state.rotation += 1 +** Processing line: ~~ - Inside source: true *** True Line Result - count += 1 -** Processing line: ~ if temp_x > 1280 - (165 + 50)~ + +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ - Inside source: true *** True Line Result - if temp_x > 1280 - (165 + 50) -** Processing line: ~ temp_x = 165~ + args.outputs.primitives << args.gtk.current_framerate_primitives +** Processing line: ~ end~ - Inside source: true *** True Line Result - temp_x = 165 -** Processing line: ~ temp_y -= 75~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - temp_y -= 75 -** Processing line: ~ end~ + +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ 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: ~*** Path Finding Algorithms - Breadth First Search - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Path Finding Algorithms - Breadth First Search - 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/13_path_finding_algorithms/01_breadth_first_search/app/main.rb~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # ./samples/13_path_finding_algorithms/01_breadth_first_search/app/main.rb +** Processing line: ~ # A visual demonstration of a breadth first search~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # A visual demonstration of a breadth first search +** Processing line: ~ # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ - Inside source: true *** True Line Result - end + # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def start_of_tongue x = nil, y = nil~ +** Processing line: ~ # An animation that can respond to user input in real time~ - Inside source: true *** True Line Result - def start_of_tongue x = nil, y = nil -** Processing line: ~ x ||= state.x~ + # An animation that can respond to user input in real time +** Processing line: ~~ - Inside source: true *** True Line Result - x ||= state.x -** Processing line: ~ y ||= state.y~ + +** Processing line: ~ # A breadth first search expands in all directions one step at a time~ - Inside source: true *** True Line Result - y ||= state.y -** Processing line: ~ [~ + # A breadth first search expands in all directions one step at a time +** Processing line: ~ # The frontier is a queue of cells to be expanded from~ - Inside source: true *** True Line Result - [ -** Processing line: ~ x + state.player_width.half,~ + # The frontier is a queue of cells to be expanded from +** Processing line: ~ # The visited hash allows quick lookups of cells that have been expanded from~ - Inside source: true *** True Line Result - x + state.player_width.half, -** Processing line: ~ y + state.player_height.half~ + # The visited hash allows quick lookups of cells that have been expanded from +** Processing line: ~ # The walls hash allows quick lookup of whether a cell is a wall~ - Inside source: true *** True Line Result - y + state.player_height.half -** Processing line: ~ ]~ + # The walls hash allows quick lookup of whether a cell is a wall +** Processing line: ~~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + +** Processing line: ~ # The breadth first search starts by adding the red star to the frontier array~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # The breadth first search starts by adding the red star to the frontier array +** Processing line: ~ # and marking it as visited~ - Inside source: true *** True Line Result - -** Processing line: ~ def stage_definition~ + # and marking it as visited +** Processing line: ~ # Each step a cell is removed from the front of the frontier array (queue)~ - Inside source: true *** True Line Result - def stage_definition -** Processing line: ~ outputs.sprites << [vx(0), vy(0), vw(10000), vw(5875), 'sprites/level-map.png']~ + # Each step a cell is removed from the front of the frontier array (queue) +** Processing line: ~ # Unless the neighbor is a wall or visited, it is added to the frontier array~ - Inside source: true *** True Line Result - outputs.sprites << [vx(0), vy(0), vw(10000), vw(5875), 'sprites/level-map.png'] -** Processing line: ~ end~ + # Unless the neighbor is a wall or visited, it is added to the frontier array +** Processing line: ~ # The neighbor is then marked as visited~ - Inside source: true *** True Line Result - end + # The neighbor is then marked as visited ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render~ +** Processing line: ~ # The frontier is blue~ - Inside source: true *** True Line Result - def render -** Processing line: ~ stage_definition~ + # The frontier is blue +** Processing line: ~ # Visited cells are light brown~ - Inside source: true *** True Line Result - stage_definition -** Processing line: ~ start_of_tongue_render = [vx(start_of_tongue.x), vy(start_of_tongue.y)]~ + # Visited cells are light brown +** Processing line: ~ # Walls are camo green~ - Inside source: true *** True Line Result - start_of_tongue_render = [vx(start_of_tongue.x), vy(start_of_tongue.y)] -** Processing line: ~ end_of_tongue_render = [vx(end_of_tongue.x), vy(end_of_tongue.y)]~ + # Walls are camo green +** Processing line: ~ # Even when walls are visited, they will maintain their wall color~ - Inside source: true *** True Line Result - end_of_tongue_render = [vx(end_of_tongue.x), vy(end_of_tongue.y)] + # Even when walls are visited, they will maintain their wall color ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.anchor_point~ -- Inside source: true -*** True Line Result - if state.anchor_point -** Processing line: ~ anchor_point_render = [vx(state.anchor_point.x), vy(state.anchor_point.y)]~ +** Processing line: ~ # The star can be moved by clicking and dragging~ - Inside source: true *** True Line Result - anchor_point_render = [vx(state.anchor_point.x), vy(state.anchor_point.y)] -** Processing line: ~ outputs.sprites << { x: start_of_tongue_render.x,~ + # The star can be moved by clicking and dragging +** Processing line: ~ # Walls can be added and removed by clicking and dragging~ - Inside source: true *** True Line Result - outputs.sprites << { x: start_of_tongue_render.x, -** Processing line: ~ y: start_of_tongue_render.y,~ + # Walls can be added and removed by clicking and dragging +** Processing line: ~~ - Inside source: true *** True Line Result - y: start_of_tongue_render.y, -** Processing line: ~ w: vw(2),~ + +** Processing line: ~ class BreadthFirstSearch~ - Inside source: true *** True Line Result - w: vw(2), -** Processing line: ~ h: args.geometry.distance(start_of_tongue_render, anchor_point_render),~ + class BreadthFirstSearch +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - h: args.geometry.distance(start_of_tongue_render, anchor_point_render), -** Processing line: ~ path: 'sprites/square-pink.png',~ + attr_gtk +** Processing line: ~~ - Inside source: true *** True Line Result - path: 'sprites/square-pink.png', -** Processing line: ~ angle_anchor_y: 0,~ + +** Processing line: ~ def initialize(args)~ - Inside source: true *** True Line Result - angle_anchor_y: 0, -** Processing line: ~ angle: state.tongue_angle - 90 }~ + def initialize(args) +** Processing line: ~ # Variables to edit the size and appearance of the grid~ - Inside source: true *** True Line Result - angle: state.tongue_angle - 90 } -** Processing line: ~ else~ + # Variables to edit the size and appearance of the grid +** Processing line: ~ # Freely customizable to user's liking~ - Inside source: true *** True Line Result - else -** Processing line: ~ outputs.sprites << { x: vx(start_of_tongue.x),~ + # Freely customizable to user's liking +** Processing line: ~ args.state.grid.width = 30~ - Inside source: true *** True Line Result - outputs.sprites << { x: vx(start_of_tongue.x), -** Processing line: ~ y: vy(start_of_tongue.y),~ + args.state.grid.width = 30 +** Processing line: ~ args.state.grid.height = 15~ - Inside source: true *** True Line Result - y: vy(start_of_tongue.y), -** Processing line: ~ w: vw(2),~ + args.state.grid.height = 15 +** Processing line: ~ args.state.grid.cell_size = 40~ - Inside source: true *** True Line Result - w: vw(2), -** Processing line: ~ h: vh(state.tongue_length),~ + args.state.grid.cell_size = 40 +** Processing line: ~~ - Inside source: true *** True Line Result - h: vh(state.tongue_length), -** Processing line: ~ path: 'sprites/square-pink.png',~ + +** Processing line: ~ # Stores which step of the animation is being rendered~ - Inside source: true *** True Line Result - path: 'sprites/square-pink.png', -** Processing line: ~ angle_anchor_y: 0,~ + # Stores which step of the animation is being rendered +** Processing line: ~ # When the user moves the star or messes with the walls,~ - Inside source: true *** True Line Result - angle_anchor_y: 0, -** Processing line: ~ angle: state.tongue_angle - 90 }~ + # When the user moves the star or messes with the walls, +** Processing line: ~ # the breadth first search is recalculated up to this step~ - Inside source: true *** True Line Result - angle: state.tongue_angle - 90 } -** Processing line: ~ end~ + # the breadth first search is recalculated up to this step +** Processing line: ~ args.state.anim_steps = 0~ - Inside source: true *** True Line Result - end + args.state.anim_steps = 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.sprites << state.objects.map { |o| [vx(o.x), vy(o.y), vw(o.w), vh(o.h), o.path] }~ +** Processing line: ~ # At some step the animation will end,~ - Inside source: true *** True Line Result - outputs.sprites << state.objects.map { |o| [vx(o.x), vy(o.y), vw(o.w), vh(o.h), o.path] } -** Processing line: ~~ + # At some step the animation will end, +** Processing line: ~ # and further steps won't change anything (the whole grid will be explored)~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.god_mode~ + # and further steps won't change anything (the whole grid will be explored) +** Processing line: ~ # This step is roughly the grid's width * height~ - Inside source: true *** True Line Result - if state.god_mode -** Processing line: ~ # SHOW HIDE COLLISIONS~ + # This step is roughly the grid's width * height +** Processing line: ~ # When anim_steps equals max_steps no more calculations will occur~ - Inside source: true *** True Line Result - # SHOW HIDE COLLISIONS -** Processing line: ~ outputs.sprites << state.world.map do |x, y, w, h|~ + # When anim_steps equals max_steps no more calculations will occur +** Processing line: ~ # and the slider will be at the end~ - Inside source: true *** True Line Result - outputs.sprites << state.world.map do |x, y, w, h| -** Processing line: ~ x = vx(x)~ + # and the slider will be at the end +** Processing line: ~ args.state.max_steps = args.state.grid.width * args.state.grid.height~ - Inside source: true *** True Line Result - x = vx(x) -** Processing line: ~ y = vy(y)~ + args.state.max_steps = args.state.grid.width * args.state.grid.height +** Processing line: ~~ - Inside source: true *** True Line Result - y = vy(y) -** Processing line: ~ if x > -80 && x < 1280 && y > -80 && y < 720~ + +** Processing line: ~ # Whether the animation should play or not~ - Inside source: true *** True Line Result - if x > -80 && x < 1280 && y > -80 && y < 720 -** Processing line: ~ {~ + # Whether the animation should play or not +** Processing line: ~ # If true, every tick moves anim_steps forward one~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: x,~ + # If true, every tick moves anim_steps forward one +** Processing line: ~ # Pressing the stepwise animation buttons will pause the animation~ - Inside source: true *** True Line Result - x: x, -** Processing line: ~ y: y,~ + # Pressing the stepwise animation buttons will pause the animation +** Processing line: ~ args.state.play = true~ - Inside source: true *** True Line Result - y: y, -** Processing line: ~ w: vw(w || state.tile_size),~ + args.state.play = true +** Processing line: ~~ - Inside source: true *** True Line Result - w: vw(w || state.tile_size), -** Processing line: ~ h: vh(h || state.tile_size),~ + +** Processing line: ~ # The location of the star and walls of the grid~ - Inside source: true *** True Line Result - h: vh(h || state.tile_size), -** Processing line: ~ path: 'sprites/square-gray.png',~ + # The location of the star and walls of the grid +** Processing line: ~ # They can be modified to have a different initial grid~ - Inside source: true *** True Line Result - path: 'sprites/square-gray.png', -** Processing line: ~ a: 128~ + # They can be modified to have a different initial grid +** Processing line: ~ # Walls are stored in a hash for quick look up when doing the search~ - Inside source: true *** True Line Result - a: 128 -** Processing line: ~ }~ + # Walls are stored in a hash for quick look up when doing the search +** Processing line: ~ args.state.star = [0, 0]~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + args.state.star = [0, 0] +** Processing line: ~ args.state.walls = {~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + args.state.walls = { +** Processing line: ~ [3, 3] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [3, 3] => true, +** Processing line: ~ [3, 4] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3, 4] => true, +** Processing line: ~ [3, 5] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ render_player~ + [3, 5] => true, +** Processing line: ~ [3, 6] => true,~ - Inside source: true *** True Line Result - render_player -** Processing line: ~ outputs.sprites << [vx(2315), vy(45), vw(569), vh(402), 'sprites/square-blue.png', 0, 40]~ + [3, 6] => true, +** Processing line: ~ [3, 7] => true,~ - Inside source: true *** True Line Result - outputs.sprites << [vx(2315), vy(45), vw(569), vh(402), 'sprites/square-blue.png', 0, 40] -** Processing line: ~~ + [3, 7] => true, +** Processing line: ~ [3, 8] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ # Label in top left of the screen~ + [3, 8] => true, +** Processing line: ~ [3, 9] => true,~ - Inside source: true *** True Line Result - # Label in top left of the screen -** Processing line: ~ outputs.primitives << [20, 640, 180, 70, 255, 255, 255, 128].solid~ + [3, 9] => true, +** Processing line: ~ [3, 10] => true,~ - Inside source: true *** True Line Result - outputs.primitives << [20, 640, 180, 70, 255, 255, 255, 128].solid -** Processing line: ~ outputs.primitives << [30, 700, "Stuff: #{state.stuff_score} of #{$mugs.count}", 1].label~ + [3, 10] => true, +** Processing line: ~ [3, 11] => true,~ - Inside source: true *** True Line Result - outputs.primitives << [30, 700, "Stuff: #{state.stuff_score} of #{$mugs.count}", 1].label -** Processing line: ~ outputs.primitives << [30, 670, "Time: #{"%.2f" % state.stuff_time}", 1].label~ + [3, 11] => true, +** Processing line: ~ [4, 3] => true,~ - Inside source: true *** True Line Result - outputs.primitives << [30, 670, "Time: #{"%.2f" % state.stuff_time}", 1].label -** Processing line: ~~ + [4, 3] => true, +** Processing line: ~ [4, 4] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.god_mode~ + [4, 4] => true, +** Processing line: ~ [4, 5] => true,~ - Inside source: true *** True Line Result - if state.god_mode -** Processing line: ~ if state.map_saved_at > 0 && state.map_saved_at.elapsed_time < 120~ + [4, 5] => true, +** Processing line: ~ [4, 6] => true,~ - Inside source: true *** True Line Result - if state.map_saved_at > 0 && state.map_saved_at.elapsed_time < 120 -** Processing line: ~ outputs.primitives << [920, 670, 'Map has been exported!', 1, 0, 50, 100, 50].label~ + [4, 6] => true, +** Processing line: ~ [4, 7] => true,~ - Inside source: true *** True Line Result - outputs.primitives << [920, 670, 'Map has been exported!', 1, 0, 50, 100, 50].label -** Processing line: ~ end~ + [4, 7] => true, +** Processing line: ~ [4, 8] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [4, 8] => true, +** Processing line: ~ [4, 9] => true,~ - Inside source: true *** True Line Result - + [4, 9] => true, +** Processing line: ~ [4, 10] => true,~ +- Inside source: true +*** True Line Result + [4, 10] => true, +** Processing line: ~ [4, 11] => true,~ +- Inside source: true +*** True Line Result + [4, 11] => true, ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Creates sprite following mouse to help indicate which sprite you have selected~ +** Processing line: ~ [13, 0] => true,~ - Inside source: true *** True Line Result - # Creates sprite following mouse to help indicate which sprite you have selected -** Processing line: ~ outputs.primitives << [inputs.mouse.position.x, inputs.mouse.position.y,~ + [13, 0] => true, +** Processing line: ~ [13, 1] => true,~ - Inside source: true *** True Line Result - outputs.primitives << [inputs.mouse.position.x, inputs.mouse.position.y, -** Processing line: ~ state.tile_size, state.tile_size, 'sprites/square-indigo.png', 0, 100].sprite~ + [13, 1] => true, +** Processing line: ~ [13, 2] => true,~ - Inside source: true *** True Line Result - state.tile_size, state.tile_size, 'sprites/square-indigo.png', 0, 100].sprite -** Processing line: ~ end~ + [13, 2] => true, +** Processing line: ~ [13, 3] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [13, 3] => true, +** Processing line: ~ [13, 4] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ render_mini_map~ + [13, 4] => true, +** Processing line: ~ [13, 5] => true,~ - Inside source: true *** True Line Result - render_mini_map -** Processing line: ~ outputs.primitives << [0, 0, 1280, 720, 255, 255, 255, 255 * state.game_start_at.ease(60, :flip)].solid~ + [13, 5] => true, +** Processing line: ~ [13, 6] => true,~ - Inside source: true *** True Line Result - outputs.primitives << [0, 0, 1280, 720, 255, 255, 255, 255 * state.game_start_at.ease(60, :flip)].solid -** Processing line: ~ end~ + [13, 6] => true, +** Processing line: ~ [13, 7] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [13, 7] => true, +** Processing line: ~ [13, 8] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_mini_map~ + [13, 8] => true, +** Processing line: ~ [13, 9] => true,~ - Inside source: true *** True Line Result - def render_mini_map -** Processing line: ~ x, y = 1170, 10~ + [13, 9] => true, +** Processing line: ~ [13, 10] => true,~ - Inside source: true *** True Line Result - x, y = 1170, 10 -** Processing line: ~ outputs.primitives << [x, y, 100, 58, 0, 0, 0, 200].solid~ + [13, 10] => true, +** Processing line: ~ [14, 0] => true,~ - Inside source: true *** True Line Result - outputs.primitives << [x, y, 100, 58, 0, 0, 0, 200].solid -** Processing line: ~ outputs.primitives << [x + args.state.x.fdiv(100) - 1, y + args.state.y.fdiv(100) - 1, 2, 2, 0, 255, 0].solid~ + [14, 0] => true, +** Processing line: ~ [14, 1] => true,~ - Inside source: true *** True Line Result - outputs.primitives << [x + args.state.x.fdiv(100) - 1, y + args.state.y.fdiv(100) - 1, 2, 2, 0, 255, 0].solid -** Processing line: ~ t_start = start_of_tongue~ + [14, 1] => true, +** Processing line: ~ [14, 2] => true,~ - Inside source: true *** True Line Result - t_start = start_of_tongue -** Processing line: ~ t_end = end_of_tongue~ + [14, 2] => true, +** Processing line: ~ [14, 3] => true,~ - Inside source: true *** True Line Result - t_end = end_of_tongue -** Processing line: ~ outputs.primitives << [~ + [14, 3] => true, +** Processing line: ~ [14, 4] => true,~ - Inside source: true *** True Line Result - outputs.primitives << [ -** Processing line: ~ x + t_start.x.fdiv(100), y + t_start.y.fdiv(100),~ + [14, 4] => true, +** Processing line: ~ [14, 5] => true,~ - Inside source: true *** True Line Result - x + t_start.x.fdiv(100), y + t_start.y.fdiv(100), -** Processing line: ~ x + t_end.x.fdiv(100), y + t_end.y.fdiv(100),~ + [14, 5] => true, +** Processing line: ~ [14, 6] => true,~ - Inside source: true *** True Line Result - x + t_end.x.fdiv(100), y + t_end.y.fdiv(100), -** Processing line: ~ 255, 255, 255~ + [14, 6] => true, +** Processing line: ~ [14, 7] => true,~ - Inside source: true *** True Line Result - 255, 255, 255 -** Processing line: ~ ].line~ + [14, 7] => true, +** Processing line: ~ [14, 8] => true,~ - Inside source: true *** True Line Result - ].line + [14, 8] => true, +** Processing line: ~ [14, 9] => true,~ +- Inside source: true +*** True Line Result + [14, 9] => true, +** Processing line: ~ [14, 10] => true,~ +- Inside source: true +*** True Line Result + [14, 10] => true, ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.objects.each do |o|~ +** Processing line: ~ [21, 8] => true,~ - Inside source: true *** True Line Result - state.objects.each do |o| -** Processing line: ~ outputs.primitives << [x + o.x.fdiv(100) - 1, y + o.y.fdiv(100) - 1, 2, 2, 200, 200, 0].solid~ + [21, 8] => true, +** Processing line: ~ [21, 9] => true,~ - Inside source: true *** True Line Result - outputs.primitives << [x + o.x.fdiv(100) - 1, y + o.y.fdiv(100) - 1, 2, 2, 200, 200, 0].solid -** Processing line: ~ end~ + [21, 9] => true, +** Processing line: ~ [21, 10] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [21, 10] => true, +** Processing line: ~ [21, 11] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [21, 11] => true, +** Processing line: ~ [21, 12] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_camera percentage_override = nil~ + [21, 12] => true, +** Processing line: ~ [21, 13] => true,~ - Inside source: true *** True Line Result - def calc_camera percentage_override = nil -** Processing line: ~ percentage = percentage_override || (0.2 * state.camera_scale)~ + [21, 13] => true, +** Processing line: ~ [21, 14] => true,~ - Inside source: true *** True Line Result - percentage = percentage_override || (0.2 * state.camera_scale) -** Processing line: ~ target_scale = state.target_camera_scale~ + [21, 14] => true, +** Processing line: ~ [22, 8] => true,~ - Inside source: true *** True Line Result - target_scale = state.target_camera_scale -** Processing line: ~ distance_scale = target_scale - state.camera_scale~ + [22, 8] => true, +** Processing line: ~ [22, 9] => true,~ - Inside source: true *** True Line Result - distance_scale = target_scale - state.camera_scale -** Processing line: ~ state.camera_scale += distance_scale * percentage~ + [22, 9] => true, +** Processing line: ~ [22, 10] => true,~ - Inside source: true *** True Line Result - state.camera_scale += distance_scale * percentage -** Processing line: ~~ + [22, 10] => true, +** Processing line: ~ [22, 11] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ target_x = state.x * state.target_camera_scale~ + [22, 11] => true, +** Processing line: ~ [22, 12] => true,~ - Inside source: true *** True Line Result - target_x = state.x * state.target_camera_scale -** Processing line: ~ target_y = state.y * state.target_camera_scale~ + [22, 12] => true, +** Processing line: ~ [22, 13] => true,~ - Inside source: true *** True Line Result - target_y = state.y * state.target_camera_scale -** Processing line: ~~ + [22, 13] => true, +** Processing line: ~ [22, 14] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ distance_x = target_x - (state.camera_x + 640)~ + [22, 14] => true, +** Processing line: ~ [23, 8] => true,~ - Inside source: true *** True Line Result - distance_x = target_x - (state.camera_x + 640) -** Processing line: ~ distance_y = target_y - (state.camera_y + 360)~ + [23, 8] => true, +** Processing line: ~ [23, 9] => true,~ - Inside source: true *** True Line Result - distance_y = target_y - (state.camera_y + 360) -** Processing line: ~ state.camera_x += distance_x * percentage if distance_x.abs > 1~ + [23, 9] => true, +** Processing line: ~ [24, 8] => true,~ - Inside source: true *** True Line Result - state.camera_x += distance_x * percentage if distance_x.abs > 1 -** Processing line: ~ state.camera_y += distance_y * percentage if distance_y.abs > 1~ + [24, 8] => true, +** Processing line: ~ [24, 9] => true,~ - Inside source: true *** True Line Result - state.camera_y += distance_y * percentage if distance_y.abs > 1 -** Processing line: ~ state.camera_x = 0 if state.camera_x < 0~ + [24, 9] => true, +** Processing line: ~ [25, 8] => true,~ - Inside source: true *** True Line Result - state.camera_x = 0 if state.camera_x < 0 -** Processing line: ~ state.camera_y = 0 if state.camera_y < 0~ + [25, 8] => true, +** Processing line: ~ [25, 9] => true,~ - Inside source: true *** True Line Result - state.camera_y = 0 if state.camera_y < 0 -** Processing line: ~ end~ + [25, 9] => true, +** Processing line: ~ }~ - Inside source: true *** True Line Result - end + } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def vx x~ -- Inside source: true -*** True Line Result - def vx x -** Processing line: ~ (x * state.camera_scale) - state.camera_x~ +** Processing line: ~ # Variables that are used by the breadth first search~ - Inside source: true *** True Line Result - (x * state.camera_scale) - state.camera_x -** Processing line: ~ end~ + # Variables that are used by the breadth first search +** Processing line: ~ # Storing cells that the search has visited, prevents unnecessary steps~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Storing cells that the search has visited, prevents unnecessary steps +** Processing line: ~ # Expanding the frontier of the search in order makes the search expand~ - Inside source: true *** True Line Result - -** Processing line: ~ def vy y~ + # Expanding the frontier of the search in order makes the search expand +** Processing line: ~ # from the center outward~ - Inside source: true *** True Line Result - def vy y -** Processing line: ~ (y * state.camera_scale) - state.camera_y~ + # from the center outward +** Processing line: ~ args.state.visited = {}~ - Inside source: true *** True Line Result - (y * state.camera_scale) - state.camera_y -** Processing line: ~ end~ + args.state.visited = {} +** Processing line: ~ args.state.frontier = []~ - Inside source: true *** True Line Result - end + args.state.frontier = [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def vw w~ +** Processing line: ~~ - Inside source: true *** True Line Result - def vw w -** Processing line: ~ w * state.camera_scale~ + +** Processing line: ~ # What the user is currently editing on the grid~ - Inside source: true *** True Line Result - w * state.camera_scale -** Processing line: ~ end~ + # What the user is currently editing on the grid +** Processing line: ~ # Possible values are: :none, :slider, :star, :remove_wall, :add_wall~ - Inside source: true *** True Line Result - end + # Possible values are: :none, :slider, :star, :remove_wall, :add_wall ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def vh h~ +** Processing line: ~ # We store this value, because we want to remember the value even when~ - Inside source: true *** True Line Result - def vh h -** Processing line: ~ h * state.camera_scale~ + # We store this value, because we want to remember the value even when +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ - Inside source: true *** True Line Result - h * state.camera_scale -** Processing line: ~ end~ + # the user's cursor is no longer over what they're interacting with, but +** Processing line: ~ # they are still clicking down on the mouse.~ - Inside source: true *** True Line Result - end + # they are still clicking down on the mouse. +** Processing line: ~ args.state.click_and_drag = :none~ +- Inside source: true +*** True Line Result + args.state.click_and_drag = :none ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc~ +** Processing line: ~ # Store the rects of the buttons that control the animation~ - Inside source: true *** True Line Result - def calc -** Processing line: ~ calc_camera~ + # Store the rects of the buttons that control the animation +** Processing line: ~ # They are here for user customization~ - Inside source: true *** True Line Result - calc_camera -** Processing line: ~ calc_world_lookup~ + # They are here for user customization +** Processing line: ~ # Editing these might require recentering the text inside them~ - Inside source: true *** True Line Result - calc_world_lookup -** Processing line: ~ calc_player~ + # Editing these might require recentering the text inside them +** Processing line: ~ # Those values can be found in the render_button methods~ - Inside source: true *** True Line Result - calc_player -** Processing line: ~ calc_on_floor~ + # Those values can be found in the render_button methods +** Processing line: ~ args.state.buttons.left = [450, 600, 50, 50]~ - Inside source: true *** True Line Result - calc_on_floor -** Processing line: ~ calc_score~ + args.state.buttons.left = [450, 600, 50, 50] +** Processing line: ~ args.state.buttons.center = [500, 600, 200, 50]~ - Inside source: true *** True Line Result - calc_score -** Processing line: ~ end~ + args.state.buttons.center = [500, 600, 200, 50] +** Processing line: ~ args.state.buttons.right = [700, 600, 50, 50]~ - Inside source: true *** True Line Result - end + args.state.buttons.right = [700, 600, 50, 50] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def set_camera_scale v = nil~ +** Processing line: ~ # The variables below are related to the slider~ - Inside source: true *** True Line Result - def set_camera_scale v = nil -** Processing line: ~ return if v < 0.1~ + # The variables below are related to the slider +** Processing line: ~ # They allow the user to customize them~ - Inside source: true *** True Line Result - return if v < 0.1 -** Processing line: ~ state.target_camera_scale = v~ + # They allow the user to customize them +** Processing line: ~ # They also give a central location for the render and input methods to get~ - Inside source: true *** True Line Result - state.target_camera_scale = v -** Processing line: ~ end~ + # They also give a central location for the render and input methods to get +** Processing line: ~ # information from~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # information from +** Processing line: ~ # x & y are the coordinates of the leftmost part of the slider line~ - Inside source: true *** True Line Result - -** Processing line: ~ def process_inputs_god_mode~ + # x & y are the coordinates of the leftmost part of the slider line +** Processing line: ~ args.state.slider.x = 400~ - Inside source: true *** True Line Result - def process_inputs_god_mode -** Processing line: ~ return unless state.god_mode~ + args.state.slider.x = 400 +** Processing line: ~ args.state.slider.y = 675~ - Inside source: true *** True Line Result - return unless state.god_mode -** Processing line: ~~ + args.state.slider.y = 675 +** Processing line: ~ # This is the width of the line~ - Inside source: true *** True Line Result - -** Processing line: ~ if inputs.keyboard.key_down.equal_sign || (inputs.keyboard.equal_sign && state.tick_count.mod_zero?(10))~ + # This is the width of the line +** Processing line: ~ args.state.slider.w = 360~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.equal_sign || (inputs.keyboard.equal_sign && state.tick_count.mod_zero?(10)) -** Processing line: ~ set_camera_scale state.camera_scale + 0.1~ + args.state.slider.w = 360 +** Processing line: ~ # This is the offset for the circle~ - Inside source: true *** True Line Result - set_camera_scale state.camera_scale + 0.1 -** Processing line: ~ elsif inputs.keyboard.key_down.hyphen || (inputs.keyboard.hyphen && state.tick_count.mod_zero?(10))~ + # This is the offset for the circle +** Processing line: ~ # Allows the center of the circle to be on the line,~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_down.hyphen || (inputs.keyboard.hyphen && state.tick_count.mod_zero?(10)) -** Processing line: ~ set_camera_scale state.camera_scale - 0.1~ + # Allows the center of the circle to be on the line, +** Processing line: ~ # as opposed to the upper right corner~ - Inside source: true *** True Line Result - set_camera_scale state.camera_scale - 0.1 -** Processing line: ~ elsif inputs.keyboard.eight || inputs.keyboard.zero~ + # as opposed to the upper right corner +** Processing line: ~ args.state.slider.offset = 20~ - Inside source: true *** True Line Result - elsif inputs.keyboard.eight || inputs.keyboard.zero -** Processing line: ~ set_camera_scale 1~ + args.state.slider.offset = 20 +** Processing line: ~ # This is the spacing between each of the notches on the slider~ - Inside source: true *** True Line Result - set_camera_scale 1 -** Processing line: ~ end~ + # This is the spacing between each of the notches on the slider +** Processing line: ~ # Notches are places where the circle can rest on the slider line~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Notches are places where the circle can rest on the slider line +** Processing line: ~ # There needs to be a notch for each step before the maximum number of steps~ - Inside source: true *** True Line Result - -** Processing line: ~ if input_up?~ + # There needs to be a notch for each step before the maximum number of steps +** Processing line: ~ args.state.slider.spacing = args.state.slider.w.to_f / args.state.max_steps.to_f~ - Inside source: true *** True Line Result - if input_up? -** Processing line: ~ state.y += 10~ + args.state.slider.spacing = args.state.slider.w.to_f / args.state.max_steps.to_f +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.y += 10 -** Processing line: ~ state.dy = 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.dy = 0 -** Processing line: ~ elsif input_down?~ + +** Processing line: ~ # This method is called every frame/tick~ - Inside source: true *** True Line Result - elsif input_down? -** Processing line: ~ state.y -= 10~ + # This method is called every frame/tick +** Processing line: ~ # Every tick, the current state of the search is rendered on the screen,~ - Inside source: true *** True Line Result - state.y -= 10 -** Processing line: ~ state.dy = 0~ + # Every tick, the current state of the search is rendered on the screen, +** Processing line: ~ # User input is processed, and~ - Inside source: true *** True Line Result - state.dy = 0 -** Processing line: ~ end~ + # User input is processed, and +** Processing line: ~ # The next step in the search is calculated~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # The next step in the search is calculated +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - -** Processing line: ~ if input_left?~ + def tick +** Processing line: ~ render~ - Inside source: true *** True Line Result - if input_left? -** Processing line: ~ state.x -= 10~ + render +** Processing line: ~ input~ - Inside source: true *** True Line Result - state.x -= 10 -** Processing line: ~ state.dx = 0~ + input +** Processing line: ~ # If animation is playing, and max steps have not been reached~ - Inside source: true *** True Line Result - state.dx = 0 -** Processing line: ~ elsif input_right?~ + # If animation is playing, and max steps have not been reached +** Processing line: ~ # Move the search a step forward~ - Inside source: true *** True Line Result - elsif input_right? -** Processing line: ~ state.x += 10~ + # Move the search a step forward +** Processing line: ~ if state.play && state.anim_steps < state.max_steps~ - Inside source: true *** True Line Result - state.x += 10 -** Processing line: ~ state.dx = 0~ + if state.play && state.anim_steps < state.max_steps +** Processing line: ~ # Variable that tells the program what step to recalculate up to~ - Inside source: true *** True Line Result - state.dx = 0 + # Variable that tells the program what step to recalculate up to +** Processing line: ~ state.anim_steps += 1~ +- Inside source: true +*** True Line Result + state.anim_steps += 1 +** Processing line: ~ calc~ +- Inside source: true +*** True Line Result + calc ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -57331,50 +60564,46 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def process_inputs~ -- Inside source: true -*** True Line Result - def process_inputs -** Processing line: ~ if state.scene == :game~ +** Processing line: ~ # Draws everything onto the screen~ - Inside source: true *** True Line Result - if state.scene == :game -** Processing line: ~ process_inputs_player_movement~ + # Draws everything onto the screen +** Processing line: ~ def render~ - Inside source: true *** True Line Result - process_inputs_player_movement -** Processing line: ~ process_inputs_god_mode~ + def render +** Processing line: ~ render_buttons~ - Inside source: true *** True Line Result - process_inputs_god_mode -** Processing line: ~ elsif state.scene == :intro~ + render_buttons +** Processing line: ~ render_slider~ - Inside source: true *** True Line Result - elsif state.scene == :intro -** Processing line: ~ if args.inputs.keyboard.key_down.enter || args.inputs.keyboard.key_down.space~ + render_slider +** Processing line: ~~ - Inside source: true *** True Line Result - if args.inputs.keyboard.key_down.enter || args.inputs.keyboard.key_down.space -** Processing line: ~ if Kernel.tick_count < 600~ + +** Processing line: ~ render_background~ - Inside source: true *** True Line Result - if Kernel.tick_count < 600 -** Processing line: ~ Kernel.tick_count = 600~ + render_background +** Processing line: ~ render_visited~ - Inside source: true *** True Line Result - Kernel.tick_count = 600 -** Processing line: ~ end~ + render_visited +** Processing line: ~ render_frontier~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + render_frontier +** Processing line: ~ render_walls~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + render_walls +** Processing line: ~ render_star~ - Inside source: true *** True Line Result - end + render_star ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -57383,38 +60612,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def input_up?~ -- Inside source: true -*** True Line Result - def input_up? -** Processing line: ~ inputs.keyboard.w || inputs.keyboard.up || inputs.keyboard.k~ -- Inside source: true -*** True Line Result - inputs.keyboard.w || inputs.keyboard.up || inputs.keyboard.k -** Processing line: ~ end~ +** Processing line: ~ # The methods below subdivide the task of drawing everything to the screen~ - Inside source: true *** True Line Result - end + # The methods below subdivide the task of drawing everything to the screen ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def input_up_released?~ +** Processing line: ~ # Draws the buttons that control the animation step and state~ - Inside source: true *** True Line Result - def input_up_released? -** Processing line: ~ inputs.keyboard.key_up.w ||~ + # Draws the buttons that control the animation step and state +** Processing line: ~ def render_buttons~ - Inside source: true *** True Line Result - inputs.keyboard.key_up.w || -** Processing line: ~ inputs.keyboard.key_up.up ||~ + def render_buttons +** Processing line: ~ render_left_button~ - Inside source: true *** True Line Result - inputs.keyboard.key_up.up || -** Processing line: ~ inputs.keyboard.key_up.k~ + render_left_button +** Processing line: ~ render_center_button~ - Inside source: true *** True Line Result - inputs.keyboard.key_up.k + render_center_button +** Processing line: ~ render_right_button~ +- Inside source: true +*** True Line Result + render_right_button ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -57423,70 +60648,66 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def input_down?~ -- Inside source: true -*** True Line Result - def input_down? -** Processing line: ~ inputs.keyboard.s || inputs.keyboard.down || inputs.keyboard.j~ -- Inside source: true -*** True Line Result - inputs.keyboard.s || inputs.keyboard.down || inputs.keyboard.j -** Processing line: ~ end~ +** Processing line: ~ # Draws the button which steps the search backward~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Draws the button which steps the search backward +** Processing line: ~ # Shows the user where to click to move the search backward~ - Inside source: true *** True Line Result - -** Processing line: ~ def input_down_released?~ + # Shows the user where to click to move the search backward +** Processing line: ~ def render_left_button~ - Inside source: true *** True Line Result - def input_down_released? -** Processing line: ~ inputs.keyboard.key_up.s ||~ + def render_left_button +** Processing line: ~ # Draws the gray button, and a black border~ - Inside source: true *** True Line Result - inputs.keyboard.key_up.s || -** Processing line: ~ inputs.keyboard.key_up.down ||~ + # Draws the gray button, and a black border +** Processing line: ~ # The border separates the buttons visually~ - Inside source: true *** True Line Result - inputs.keyboard.key_up.down || -** Processing line: ~ inputs.keyboard.key_up.j~ + # The border separates the buttons visually +** Processing line: ~ outputs.solids << [buttons.left, gray]~ - Inside source: true *** True Line Result - inputs.keyboard.key_up.j -** Processing line: ~ end~ + outputs.solids << [buttons.left, gray] +** Processing line: ~ outputs.borders << [buttons.left, black]~ - Inside source: true *** True Line Result - end + outputs.borders << [buttons.left, black] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def input_left?~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ - Inside source: true *** True Line Result - def input_left? -** Processing line: ~ inputs.keyboard.a || inputs.keyboard.left || inputs.keyboard.h~ + # Renders an explanatory label in the center of the button +** Processing line: ~ # Explains to the user what the button does~ - Inside source: true *** True Line Result - inputs.keyboard.a || inputs.keyboard.left || inputs.keyboard.h -** Processing line: ~ end~ + # Explains to the user what the button does +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # If the button size is changed, the label might need to be edited as well +** Processing line: ~ # to keep the label in the center of the button~ - Inside source: true *** True Line Result - -** Processing line: ~ def input_right?~ + # to keep the label in the center of the button +** Processing line: ~ label_x = buttons.left.x + 20~ - Inside source: true *** True Line Result - def input_right? -** Processing line: ~ inputs.keyboard.d || inputs.keyboard.right || inputs.keyboard.l~ + label_x = buttons.left.x + 20 +** Processing line: ~ label_y = buttons.left.y + 35~ - Inside source: true *** True Line Result - inputs.keyboard.d || inputs.keyboard.right || inputs.keyboard.l + label_y = buttons.left.y + 35 +** Processing line: ~ outputs.labels << [label_x, label_y, "<"]~ +- Inside source: true +*** True Line Result + outputs.labels << [label_x, label_y, "<"] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -57495,262 +60716,278 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def set_object path, w, h~ +** Processing line: ~ def render_center_button~ - Inside source: true *** True Line Result - def set_object path, w, h -** Processing line: ~ state.object = path~ + def render_center_button +** Processing line: ~ # Draws the gray button, and a black border~ - Inside source: true *** True Line Result - state.object = path -** Processing line: ~ state.object_w = w~ + # Draws the gray button, and a black border +** Processing line: ~ # The border separates the buttons visually~ - Inside source: true *** True Line Result - state.object_w = w -** Processing line: ~ state.object_h = h~ + # The border separates the buttons visually +** Processing line: ~ outputs.solids << [buttons.center, gray]~ - Inside source: true *** True Line Result - state.object_h = h -** Processing line: ~ end~ + outputs.solids << [buttons.center, gray] +** Processing line: ~ outputs.borders << [buttons.center, black]~ - Inside source: true *** True Line Result - end + outputs.borders << [buttons.center, black] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def collision_mode~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ - Inside source: true *** True Line Result - def collision_mode -** Processing line: ~ state.dev_action = :collision_mode~ + # Renders an explanatory label in the center of the button +** Processing line: ~ # Explains to the user what the button does~ - Inside source: true *** True Line Result - state.dev_action = :collision_mode -** Processing line: ~ end~ + # Explains to the user what the button does +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # If the button size is changed, the label might need to be edited as well +** Processing line: ~ # to keep the label in the center of the button~ - Inside source: true *** True Line Result - -** Processing line: ~ def process_inputs_player_movement~ + # to keep the label in the center of the button +** Processing line: ~ label_x = buttons.center.x + 37~ - Inside source: true *** True Line Result - def process_inputs_player_movement -** Processing line: ~ if inputs.keyboard.key_down.g~ + label_x = buttons.center.x + 37 +** Processing line: ~ label_y = buttons.center.y + 35~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.g -** Processing line: ~ state.god_mode = !state.god_mode~ + label_y = buttons.center.y + 35 +** Processing line: ~ label_text = state.play ? "Pause Animation" : "Play Animation"~ - Inside source: true *** True Line Result - state.god_mode = !state.god_mode -** Processing line: ~ puts state.god_mode~ + label_text = state.play ? "Pause Animation" : "Play Animation" +** Processing line: ~ outputs.labels << [label_x, label_y, label_text]~ - Inside source: true *** True Line Result - puts state.god_mode -** Processing line: ~ end~ + outputs.labels << [label_x, label_y, label_text] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if inputs.keyboard.key_down.u && state.dev_action == :collision_mode~ +** Processing line: ~ def render_right_button~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.u && state.dev_action == :collision_mode -** Processing line: ~ state.world = state.world[0..-2]~ + def render_right_button +** Processing line: ~ # Draws the gray button, and a black border~ - Inside source: true *** True Line Result - state.world = state.world[0..-2] -** Processing line: ~ state.world_lookup = {}~ + # Draws the gray button, and a black border +** Processing line: ~ # The border separates the buttons visually~ - Inside source: true *** True Line Result - state.world_lookup = {} -** Processing line: ~ end~ + # The border separates the buttons visually +** Processing line: ~ outputs.solids << [buttons.right, gray]~ - Inside source: true *** True Line Result - end + outputs.solids << [buttons.right, gray] +** Processing line: ~ outputs.borders << [buttons.right, black]~ +- Inside source: true +*** True Line Result + outputs.borders << [buttons.right, black] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if inputs.keyboard.key_down.space && !state.anchor_point~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.space && !state.anchor_point -** Processing line: ~ state.tongue_length = 0~ + # Renders an explanatory label in the center of the button +** Processing line: ~ # Explains to the user what the button does~ - Inside source: true *** True Line Result - state.tongue_length = 0 -** Processing line: ~ state.action = :shooting~ + # Explains to the user what the button does +** Processing line: ~ label_x = buttons.right.x + 20~ - Inside source: true *** True Line Result - state.action = :shooting -** Processing line: ~ outputs.sounds << 'sounds/shooting.wav'~ + label_x = buttons.right.x + 20 +** Processing line: ~ label_y = buttons.right.y + 35~ - Inside source: true *** True Line Result - outputs.sounds << 'sounds/shooting.wav' -** Processing line: ~ elsif inputs.keyboard.key_down.space~ + label_y = buttons.right.y + 35 +** Processing line: ~ outputs.labels << [label_x, label_y, ">"]~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_down.space -** Processing line: ~ state.action = :aiming~ + outputs.labels << [label_x, label_y, ">"] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.action = :aiming -** Processing line: ~ state.anchor_point = nil~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.anchor_point = nil -** Processing line: ~ state.tongue_length = 100~ + +** Processing line: ~ # Draws the slider so the user can move it and see the progress of the search~ - Inside source: true *** True Line Result - state.tongue_length = 100 -** Processing line: ~ end~ + # Draws the slider so the user can move it and see the progress of the search +** Processing line: ~ def render_slider~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def render_slider +** Processing line: ~ # Using primitives hides the line under the white circle of the slider~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.anchor_point~ + # Using primitives hides the line under the white circle of the slider +** Processing line: ~ # Draws the line~ - Inside source: true *** True Line Result - if state.anchor_point -** Processing line: ~ if input_up?~ + # Draws the line +** Processing line: ~ outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line~ - Inside source: true *** True Line Result - if input_up? -** Processing line: ~ if state.tongue_length >= 105~ + outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line +** Processing line: ~ # The circle needs to be offset so that the center of the circle~ - Inside source: true *** True Line Result - if state.tongue_length >= 105 -** Processing line: ~ state.tongue_length -= 5~ + # The circle needs to be offset so that the center of the circle +** Processing line: ~ # overlaps the line instead of the upper right corner of the circle~ - Inside source: true *** True Line Result - state.tongue_length -= 5 -** Processing line: ~ state.dy += 0.8~ + # overlaps the line instead of the upper right corner of the circle +** Processing line: ~ # The circle's x value is also moved based on the current seach step~ - Inside source: true *** True Line Result - state.dy += 0.8 -** Processing line: ~ end~ + # The circle's x value is also moved based on the current seach step +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing)~ - Inside source: true *** True Line Result - end -** Processing line: ~ elsif input_down?~ + circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing) +** Processing line: ~ circle_y = (slider.y - slider.offset)~ - Inside source: true *** True Line Result - elsif input_down? -** Processing line: ~ state.tongue_length += 5~ + circle_y = (slider.y - slider.offset) +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ - Inside source: true *** True Line Result - state.tongue_length += 5 -** Processing line: ~ state.dy -= 0.8~ + circle_rect = [circle_x, circle_y, 37, 37] +** Processing line: ~ outputs.primitives << [circle_rect, 'circle-white.png'].sprite~ - Inside source: true *** True Line Result - state.dy -= 0.8 -** Processing line: ~ end~ + outputs.primitives << [circle_rect, 'circle-white.png'].sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if input_left? && state.dx > 1~ +** Processing line: ~ # Draws what the grid looks like with nothing on it~ - Inside source: true *** True Line Result - if input_left? && state.dx > 1 -** Processing line: ~ state.dx *= 0.98~ + # Draws what the grid looks like with nothing on it +** Processing line: ~ def render_background~ - Inside source: true *** True Line Result - state.dx *= 0.98 -** Processing line: ~ elsif input_left? && state.dx < -1~ + def render_background +** Processing line: ~ render_unvisited~ - Inside source: true *** True Line Result - elsif input_left? && state.dx < -1 -** Processing line: ~ state.dx *= 1.03~ + render_unvisited +** Processing line: ~ render_grid_lines~ - Inside source: true *** True Line Result - state.dx *= 1.03 -** Processing line: ~ elsif input_left? && !state.on_floor~ + render_grid_lines +** Processing line: ~ end~ - Inside source: true *** True Line Result - elsif input_left? && !state.on_floor -** Processing line: ~ state.dx -= 3~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.dx -= 3 -** Processing line: ~ elsif input_right? && state.dx > 1~ + +** Processing line: ~ # Draws a rectangle the size of the entire grid to represent unvisited cells~ - Inside source: true *** True Line Result - elsif input_right? && state.dx > 1 -** Processing line: ~ state.dx *= 1.03~ + # Draws a rectangle the size of the entire grid to represent unvisited cells +** Processing line: ~ def render_unvisited~ - Inside source: true *** True Line Result - state.dx *= 1.03 -** Processing line: ~ elsif input_right? && state.dx < -1~ + def render_unvisited +** Processing line: ~ outputs.solids << [scale_up([0, 0, grid.width, grid.height]), unvisited_color]~ - Inside source: true *** True Line Result - elsif input_right? && state.dx < -1 -** Processing line: ~ state.dx *= 0.98~ + outputs.solids << [scale_up([0, 0, grid.width, grid.height]), unvisited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.dx *= 0.98 -** Processing line: ~ elsif input_right? && !state.on_floor~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif input_right? && !state.on_floor -** Processing line: ~ state.dx += 3~ + +** Processing line: ~ # Draws grid lines to show the division of the grid into cells~ - Inside source: true *** True Line Result - state.dx += 3 -** Processing line: ~ end~ + # Draws grid lines to show the division of the grid into cells +** Processing line: ~ def render_grid_lines~ - Inside source: true *** True Line Result - end -** Processing line: ~ else~ + def render_grid_lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - else -** Processing line: ~ if input_left?~ + for x in 0..grid.width +** Processing line: ~ outputs.lines << vertical_line(x)~ - Inside source: true *** True Line Result - if input_left? -** Processing line: ~ state.tongue_angle += 1.5~ + outputs.lines << vertical_line(x) +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.tongue_angle += 1.5 -** Processing line: ~ state.tongue_angle = state.tongue_angle~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.tongue_angle = state.tongue_angle -** Processing line: ~ elsif input_right?~ + +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - elsif input_right? -** Processing line: ~ state.tongue_angle -= 1.5~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << horizontal_line(y)~ - Inside source: true *** True Line Result - state.tongue_angle -= 1.5 -** Processing line: ~ state.tongue_angle = state.tongue_angle~ + outputs.lines << horizontal_line(y) +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.tongue_angle = state.tongue_angle -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end + +** Processing line: ~ # Easy way to draw vertical lines given an index~ +- Inside source: true +*** True Line Result + # Easy way to draw vertical lines given an index +** Processing line: ~ def vertical_line column~ +- Inside source: true +*** True Line Result + def vertical_line column +** Processing line: ~ scale_up([column, 0, column, grid.height])~ +- Inside source: true +*** True Line Result + scale_up([column, 0, column, grid.height]) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -57759,42 +60996,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def add_floors~ +** Processing line: ~ # Easy way to draw horizontal lines given an index~ - Inside source: true *** True Line Result - def add_floors -** Processing line: ~ # floors~ + # Easy way to draw horizontal lines given an index +** Processing line: ~ def horizontal_line row~ - Inside source: true *** True Line Result - # floors -** Processing line: ~ state.world += [~ + def horizontal_line row +** Processing line: ~ scale_up([0, row, grid.width, row])~ - Inside source: true *** True Line Result - state.world += [ -** Processing line: ~ [0, 0, 10000, 40],~ + scale_up([0, row, grid.width, row]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [0, 0, 10000, 40], -** Processing line: ~ [0, 1670, 3250, 60],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [0, 1670, 3250, 60], -** Processing line: ~ [6691, 1653, 3290, 60],~ + +** Processing line: ~ # Draws the area that is going to be searched from~ - Inside source: true *** True Line Result - [6691, 1653, 3290, 60], -** Processing line: ~ [1521, 3792, 7370, 60],~ + # Draws the area that is going to be searched from +** Processing line: ~ # The frontier is the most outward parts of the search~ - Inside source: true *** True Line Result - [1521, 3792, 7370, 60], -** Processing line: ~ [0, 5137, 3290, 60]~ + # The frontier is the most outward parts of the search +** Processing line: ~ def render_frontier~ - Inside source: true *** True Line Result - [0, 5137, 3290, 60] -** Processing line: ~ ]~ + def render_frontier +** Processing line: ~ outputs.solids << state.frontier.map do |cell|~ - Inside source: true *** True Line Result - ] + outputs.solids << state.frontier.map do |cell| +** Processing line: ~ [scale_up([cell.x, cell.y]), frontier_color]~ +- Inside source: true +*** True Line Result + [scale_up([cell.x, cell.y]), frontier_color] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -57803,114 +61048,138 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def attempt_load_world_from_file~ +** Processing line: ~ # Draws the walls~ - Inside source: true *** True Line Result - def attempt_load_world_from_file -** Processing line: ~ return if state.world~ + # Draws the walls +** Processing line: ~ def render_walls~ - Inside source: true *** True Line Result - return if state.world -** Processing line: ~ # exported_world = gtk.read_file(MAP_FILE_PATH)~ + def render_walls +** Processing line: ~ outputs.solids << state.walls.map do |wall|~ - Inside source: true *** True Line Result - # exported_world = gtk.read_file(MAP_FILE_PATH) -** Processing line: ~ state.world = []~ + outputs.solids << state.walls.map do |wall| +** Processing line: ~ [scale_up([wall.x, wall.y]), wall_color]~ - Inside source: true *** True Line Result - state.world = [] -** Processing line: ~ state.objects = []~ + [scale_up([wall.x, wall.y]), wall_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.objects = [] + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if $collisions~ +** Processing line: ~ # Renders cells that have been searched in the appropriate color~ - Inside source: true *** True Line Result - if $collisions -** Processing line: ~ $collisions.map do |x, y, w, h|~ + # Renders cells that have been searched in the appropriate color +** Processing line: ~ def render_visited~ - Inside source: true *** True Line Result - $collisions.map do |x, y, w, h| -** Processing line: ~ state.world << [x, y, w, h]~ + def render_visited +** Processing line: ~ outputs.solids << state.visited.map do |cell|~ - Inside source: true *** True Line Result - state.world << [x, y, w, h] -** Processing line: ~ end~ + outputs.solids << state.visited.map do |cell| +** Processing line: ~ [scale_up([cell.x, cell.y]), visited_color]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [scale_up([cell.x, cell.y]), visited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ add_floors~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - add_floors -** Processing line: ~ # elsif exported_world~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # elsif exported_world -** Processing line: ~ # exported_world.each_line.map do |l|~ + +** Processing line: ~ # Renders the star~ - Inside source: true *** True Line Result - # exported_world.each_line.map do |l| -** Processing line: ~ # tokens = l.strip.split(',')~ + # Renders the star +** Processing line: ~ def render_star~ - Inside source: true *** True Line Result - # tokens = l.strip.split(',') -** Processing line: ~ # x = tokens[0].to_i~ + def render_star +** Processing line: ~ outputs.sprites << [scale_up(state.star), 'star.png']~ - Inside source: true *** True Line Result - # x = tokens[0].to_i -** Processing line: ~ # y = tokens[1].to_i~ + outputs.sprites << [scale_up(state.star), 'star.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - # y = tokens[1].to_i -** Processing line: ~ # type = tokens[2].to_i~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # type = tokens[2].to_i -** Processing line: ~ # if type == 1~ + +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ - Inside source: true *** True Line Result - # if type == 1 -** Processing line: ~ # state.world << [x, y, state.tile_size, state.tile_size]~ + # In code, the cells are represented as 1x1 rectangles +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ - Inside source: true *** True Line Result - # state.world << [x, y, state.tile_size, state.tile_size] -** Processing line: ~ # elsif type == 2~ + # When drawn, the cells are larger than 1x1 rectangles +** Processing line: ~ # This method is used to scale up cells, and lines~ - Inside source: true *** True Line Result - # elsif type == 2 -** Processing line: ~ # w, h, path = tokens[3..-1]~ + # This method is used to scale up cells, and lines +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ - Inside source: true *** True Line Result - # w, h, path = tokens[3..-1] -** Processing line: ~ # state.objects << [x, y, w.to_i, h.to_i, path]~ + # Objects are scaled up according to the grid.cell_size variable +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ - Inside source: true *** True Line Result - # state.objects << [x, y, w.to_i, h.to_i, path] -** Processing line: ~ # end~ + # This allows for easy customization of the visual scale of the grid +** Processing line: ~ def scale_up(cell)~ - Inside source: true *** True Line Result - # end -** Processing line: ~ # end~ + def scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ - Inside source: true *** True Line Result - # end + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ +- Inside source: true +*** True Line Result + cell = cell.clone ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # add_floors~ +** Processing line: ~ # If cell is just an x and y coordinate~ - Inside source: true *** True Line Result - # add_floors + # If cell is just an x and y coordinate +** Processing line: ~ if cell.size == 2~ +- Inside source: true +*** True Line Result + if cell.size == 2 +** Processing line: ~ # Add a width and height of 1~ +- Inside source: true +*** True Line Result + # Add a width and height of 1 +** Processing line: ~ cell << 1~ +- Inside source: true +*** True Line Result + cell << 1 +** Processing line: ~ cell << 1~ +- Inside source: true +*** True Line Result + cell << 1 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -57919,26 +61188,26 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ if $mugs~ +** Processing line: ~ # Scale all the values up~ - Inside source: true *** True Line Result - if $mugs -** Processing line: ~ $mugs.map do |x, y, w, h, path|~ + # Scale all the values up +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ - Inside source: true *** True Line Result - $mugs.map do |x, y, w, h, path| -** Processing line: ~ state.objects << [x, y, w, h, path]~ + cell.map! { |value| value * grid.cell_size } +** Processing line: ~~ - Inside source: true *** True Line Result - state.objects << [x, y, w, h, path] -** Processing line: ~ end~ + +** Processing line: ~ # Returns the scaled up cell~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Returns the scaled up cell +** Processing line: ~ cell~ - Inside source: true *** True Line Result - end + cell ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -57947,130 +61216,130 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_world_lookup~ +** Processing line: ~ # This method processes user input every tick~ - Inside source: true *** True Line Result - def calc_world_lookup -** Processing line: ~ if state.tile_size != state.previous_tile_size~ + # This method processes user input every tick +** Processing line: ~ # This method allows the user to use the buttons, slider, and edit the grid~ - Inside source: true *** True Line Result - if state.tile_size != state.previous_tile_size -** Processing line: ~ state.previous_tile_size = state.tile_size~ + # This method allows the user to use the buttons, slider, and edit the grid +** Processing line: ~ # There are 2 types of input:~ - Inside source: true *** True Line Result - state.previous_tile_size = state.tile_size -** Processing line: ~ state.world_lookup = {}~ + # There are 2 types of input: +** Processing line: ~ # Button Input~ - Inside source: true *** True Line Result - state.world_lookup = {} -** Processing line: ~ end~ + # Button Input +** Processing line: ~ # Click and Drag Input~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Click and Drag Input +** Processing line: ~ #~ - Inside source: true *** True Line Result - -** Processing line: ~ return if state.world_lookup.keys.length > 0~ + # +** Processing line: ~ # Button Input is used for the backward step and forward step buttons~ - Inside source: true *** True Line Result - return if state.world_lookup.keys.length > 0 -** Processing line: ~ return unless state.world.length > 0~ + # Button Input is used for the backward step and forward step buttons +** Processing line: ~ # Input is detected by mouse up within the bounds of the rect~ - Inside source: true *** True Line Result - return unless state.world.length > 0 -** Processing line: ~~ + # Input is detected by mouse up within the bounds of the rect +** Processing line: ~ #~ - Inside source: true *** True Line Result - -** Processing line: ~ # Searches through the world and finds the cordinates that exist~ + # +** Processing line: ~ # Click and Drag Input is used for moving the star, adding walls,~ - Inside source: true *** True Line Result - # Searches through the world and finds the cordinates that exist -** Processing line: ~ state.world_lookup = {}~ + # Click and Drag Input is used for moving the star, adding walls, +** Processing line: ~ # removing walls, and the slider~ - Inside source: true *** True Line Result - state.world_lookup = {} -** Processing line: ~ state.world.each do |x, y, w, h|~ + # removing walls, and the slider +** Processing line: ~ #~ - Inside source: true *** True Line Result - state.world.each do |x, y, w, h| -** Processing line: ~ state.world_lookup[[x, y, w || state.tile_size, h || state.tile_size]] = true~ + # +** Processing line: ~ # When the mouse is down on the star, the click_and_drag variable is set to :star~ - Inside source: true *** True Line Result - state.world_lookup[[x, y, w || state.tile_size, h || state.tile_size]] = true -** Processing line: ~ end~ + # When the mouse is down on the star, the click_and_drag variable is set to :star +** Processing line: ~ # While click_and_drag equals :star, the cursor's position is used to calculate the~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # While click_and_drag equals :star, the cursor's position is used to calculate the +** Processing line: ~ # appropriate drag behavior~ - Inside source: true *** True Line Result - -** Processing line: ~ # Assigns collision rects for every sprite drawn~ + # appropriate drag behavior +** Processing line: ~ #~ - Inside source: true *** True Line Result - # Assigns collision rects for every sprite drawn -** Processing line: ~ state.world_collision_rects =~ + # +** Processing line: ~ # When the mouse goes up click_and_drag is set to :none~ - Inside source: true *** True Line Result - state.world_collision_rects = -** Processing line: ~ state.world_lookup~ + # When the mouse goes up click_and_drag is set to :none +** Processing line: ~ #~ - Inside source: true *** True Line Result - state.world_lookup -** Processing line: ~ .keys~ + # +** Processing line: ~ # A variable has to be used because the star has to continue being edited even~ - Inside source: true *** True Line Result - .keys -** Processing line: ~ .map do |x, y, w, h|~ + # A variable has to be used because the star has to continue being edited even +** Processing line: ~ # when the cursor is no longer over the star~ - Inside source: true *** True Line Result - .map do |x, y, w, h| -** Processing line: ~ s = state.tile_size~ + # when the cursor is no longer over the star +** Processing line: ~ #~ - Inside source: true *** True Line Result - s = state.tile_size -** Processing line: ~ w ||= s~ + # +** Processing line: ~ # Similar things occur for the other Click and Drag inputs~ - Inside source: true *** True Line Result - w ||= s -** Processing line: ~ h ||= s~ + # Similar things occur for the other Click and Drag inputs +** Processing line: ~ def input~ - Inside source: true *** True Line Result - h ||= s -** Processing line: ~ {~ + def input +** Processing line: ~ # Checks whether any of the buttons are being clicked~ - Inside source: true *** True Line Result - { -** Processing line: ~ args: [x, y, w, h],~ + # Checks whether any of the buttons are being clicked +** Processing line: ~ input_buttons~ - Inside source: true *** True Line Result - args: [x, y, w, h], -** Processing line: ~ left_right: [x, y + 4, w, h - 6],~ + input_buttons +** Processing line: ~~ - Inside source: true *** True Line Result - left_right: [x, y + 4, w, h - 6], -** Processing line: ~ top: [x + 4, y + 6, w - 8, h - 6],~ + +** Processing line: ~ # The detection and processing of click and drag inputs are separate~ - Inside source: true *** True Line Result - top: [x + 4, y + 6, w - 8, h - 6], -** Processing line: ~ bottom: [x + 1, y - 1, w - 2, h - 8],~ + # The detection and processing of click and drag inputs are separate +** Processing line: ~ # The program has to remember that the user is dragging an object~ - Inside source: true *** True Line Result - bottom: [x + 1, y - 1, w - 2, h - 8], -** Processing line: ~ }~ + # The program has to remember that the user is dragging an object +** Processing line: ~ # even when the mouse is no longer over that object~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + # even when the mouse is no longer over that object +** Processing line: ~ detect_click_and_drag~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + detect_click_and_drag +** Processing line: ~ process_click_and_drag~ - Inside source: true *** True Line Result - + process_click_and_drag ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58079,158 +61348,206 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_pendulum~ +** Processing line: ~ # Detects and Process input for each button~ - Inside source: true *** True Line Result - def calc_pendulum -** Processing line: ~ return if !state.anchor_point~ + # Detects and Process input for each button +** Processing line: ~ def input_buttons~ - Inside source: true *** True Line Result - return if !state.anchor_point -** Processing line: ~ target_x = state.anchor_point.x - start_of_tongue.x~ + def input_buttons +** Processing line: ~ input_left_button~ - Inside source: true *** True Line Result - target_x = state.anchor_point.x - start_of_tongue.x -** Processing line: ~ target_y = state.anchor_point.y -~ + input_left_button +** Processing line: ~ input_center_button~ - Inside source: true *** True Line Result - target_y = state.anchor_point.y - -** Processing line: ~ state.tongue_length - 5 - 20 - state.player_height~ + input_center_button +** Processing line: ~ input_next_step_button~ - Inside source: true *** True Line Result - state.tongue_length - 5 - 20 - state.player_height + input_next_step_button +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ diff_y = state.y - target_y~ +** Processing line: ~ # Checks if the previous step button is clicked~ - Inside source: true *** True Line Result - diff_y = state.y - target_y -** Processing line: ~~ + # Checks if the previous step button is clicked +** Processing line: ~ # If it is, it pauses the animation and moves the search one step backward~ - Inside source: true *** True Line Result - -** Processing line: ~ if target_x > 0~ + # If it is, it pauses the animation and moves the search one step backward +** Processing line: ~ def input_left_button~ - Inside source: true *** True Line Result - if target_x > 0 -** Processing line: ~ state.dx += 0.6~ + def input_left_button +** Processing line: ~ if left_button_clicked?~ - Inside source: true *** True Line Result - state.dx += 0.6 -** Processing line: ~ elsif target_x < 0~ + if left_button_clicked? +** Processing line: ~ state.play = false~ - Inside source: true *** True Line Result - elsif target_x < 0 -** Processing line: ~ state.dx -= 0.6~ + state.play = false +** Processing line: ~ state.anim_steps -= 1~ - Inside source: true *** True Line Result - state.dx -= 0.6 + state.anim_steps -= 1 +** Processing line: ~ recalculate~ +- Inside source: true +*** True Line Result + recalculate ** 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 diff_y > 0~ +** Processing line: ~ # Controls the play/pause button~ - Inside source: true *** True Line Result - if diff_y > 0 -** Processing line: ~ state.dy -= 0.1~ + # Controls the play/pause button +** Processing line: ~ # Inverses whether the animation is playing or not when clicked~ - Inside source: true *** True Line Result - state.dy -= 0.1 -** Processing line: ~ elsif diff_y < 0~ + # Inverses whether the animation is playing or not when clicked +** Processing line: ~ def input_center_button~ - Inside source: true *** True Line Result - elsif diff_y < 0 -** Processing line: ~ state.dy += 0.1~ + def input_center_button +** Processing line: ~ if center_button_clicked? or inputs.keyboard.key_down.space~ - Inside source: true *** True Line Result - state.dy += 0.1 + if center_button_clicked? or inputs.keyboard.key_down.space +** Processing line: ~ state.play = !state.play~ +- Inside source: true +*** True Line Result + state.play = !state.play ** 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: ~ state.dx *= 0.99~ +** Processing line: ~ # Checks if the next step button is clicked~ - Inside source: true *** True Line Result - state.dx *= 0.99 -** Processing line: ~~ + # Checks if the next step button is clicked +** Processing line: ~ # If it is, it pauses the animation and moves the search one step forward~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.dy.abs < 2~ + # If it is, it pauses the animation and moves the search one step forward +** Processing line: ~ def input_next_step_button~ - Inside source: true *** True Line Result - if state.dy.abs < 2 -** Processing line: ~ state.dy *= 0.8~ + def input_next_step_button +** Processing line: ~ if right_button_clicked?~ - Inside source: true *** True Line Result - state.dy *= 0.8 -** Processing line: ~ else~ + if right_button_clicked? +** Processing line: ~ state.play = false~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.dy *= 0.90~ + state.play = false +** Processing line: ~ state.anim_steps += 1~ - Inside source: true *** True Line Result - state.dy *= 0.90 + state.anim_steps += 1 +** Processing line: ~ calc~ +- Inside source: true +*** True Line Result + calc ** Processing line: ~ end~ - Inside source: true *** True Line Result end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.tongue_length && state.y~ +** Processing line: ~ # Determines what the user is editing and stores the value~ - Inside source: true *** True Line Result - if state.tongue_length && state.y -** Processing line: ~ state.dy += state.tongue_angle.vector_y state.tongue_length.fdiv(1000)~ + # Determines what the user is editing and stores the value +** Processing line: ~ # Storing the value allows the user to continue the same edit as long as the~ - Inside source: true *** True Line Result - state.dy += state.tongue_angle.vector_y state.tongue_length.fdiv(1000) -** Processing line: ~ end~ + # Storing the value allows the user to continue the same edit as long as the +** Processing line: ~ # mouse left click is held~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # mouse left click is held +** Processing line: ~ def detect_click_and_drag~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def detect_click_and_drag +** Processing line: ~ if inputs.mouse.up~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_tongue_angle~ + if inputs.mouse.up +** Processing line: ~ state.click_and_drag = :none~ - Inside source: true *** True Line Result - def calc_tongue_angle -** Processing line: ~ return unless state.anchor_point~ + state.click_and_drag = :none +** Processing line: ~ elsif star_clicked?~ - Inside source: true *** True Line Result - return unless state.anchor_point -** Processing line: ~ state.tongue_angle = args.geometry.angle_from state.anchor_point, start_of_tongue~ + elsif star_clicked? +** Processing line: ~ state.click_and_drag = :star~ - Inside source: true *** True Line Result - state.tongue_angle = args.geometry.angle_from state.anchor_point, start_of_tongue -** Processing line: ~ state.tongue_length = args.geometry.distance(start_of_tongue, state.anchor_point)~ + state.click_and_drag = :star +** Processing line: ~ elsif wall_clicked?~ - Inside source: true *** True Line Result - state.tongue_length = args.geometry.distance(start_of_tongue, state.anchor_point) -** Processing line: ~ state.tongue_length = state.tongue_length.greater(100)~ + elsif wall_clicked? +** Processing line: ~ state.click_and_drag = :remove_wall~ - Inside source: true *** True Line Result - state.tongue_length = state.tongue_length.greater(100) + state.click_and_drag = :remove_wall +** Processing line: ~ elsif grid_clicked?~ +- Inside source: true +*** True Line Result + elsif grid_clicked? +** Processing line: ~ state.click_and_drag = :add_wall~ +- Inside source: true +*** True Line Result + state.click_and_drag = :add_wall +** Processing line: ~ elsif slider_clicked?~ +- Inside source: true +*** True Line Result + elsif slider_clicked? +** Processing line: ~ state.click_and_drag = :slider~ +- Inside source: true +*** True Line Result + state.click_and_drag = :slider +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58239,50 +61556,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def player_from_end_of_tongue~ +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ - Inside source: true *** True Line Result - def player_from_end_of_tongue -** Processing line: ~ p = state.tongue_angle.vector(state.tongue_length)~ + # Processes click and drag based on what the user is currently dragging +** Processing line: ~ def process_click_and_drag~ - Inside source: true *** True Line Result - p = state.tongue_angle.vector(state.tongue_length) -** Processing line: ~ derived_start = [state.anchor_point.x - p.x, state.anchor_point.y - p.y]~ + def process_click_and_drag +** Processing line: ~ if state.click_and_drag == :star~ - Inside source: true *** True Line Result - derived_start = [state.anchor_point.x - p.x, state.anchor_point.y - p.y] -** Processing line: ~ derived_start.x -= state.player_width.half~ + if state.click_and_drag == :star +** Processing line: ~ input_star~ - Inside source: true *** True Line Result - derived_start.x -= state.player_width.half -** Processing line: ~ derived_start.y -= state.player_height.half~ + input_star +** Processing line: ~ elsif state.click_and_drag == :remove_wall~ - Inside source: true *** True Line Result - derived_start.y -= state.player_height.half -** Processing line: ~ derived_start~ + elsif state.click_and_drag == :remove_wall +** Processing line: ~ input_remove_wall~ - Inside source: true *** True Line Result - derived_start -** Processing line: ~ end~ + input_remove_wall +** Processing line: ~ elsif state.click_and_drag == :add_wall~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif state.click_and_drag == :add_wall +** Processing line: ~ input_add_wall~ - Inside source: true *** True Line Result - -** Processing line: ~ def end_of_tongue~ + input_add_wall +** Processing line: ~ elsif state.click_and_drag == :slider~ - Inside source: true *** True Line Result - def end_of_tongue -** Processing line: ~ p = state.tongue_angle.vector(state.tongue_length)~ + elsif state.click_and_drag == :slider +** Processing line: ~ input_slider~ - Inside source: true *** True Line Result - p = state.tongue_angle.vector(state.tongue_length) -** Processing line: ~ [start_of_tongue.x + p.x, start_of_tongue.y + p.y]~ + input_slider +** Processing line: ~ end~ - Inside source: true *** True Line Result - [start_of_tongue.x + p.x, start_of_tongue.y + p.y] + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58291,122 +61608,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 calc_shooting~ +** Processing line: ~ # Moves the star to the grid closest to the mouse~ - Inside source: true *** True Line Result - def calc_shooting -** Processing line: ~ return unless state.action == :shooting~ + # Moves the star to the grid closest to the mouse +** Processing line: ~ # Only recalculates the search if the star changes position~ - Inside source: true *** True Line Result - return unless state.action == :shooting -** Processing line: ~ state.tongue_length += 30~ + # Only recalculates the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - state.tongue_length += 30 -** Processing line: ~ potential_anchor = end_of_tongue~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def input_star~ - Inside source: true *** True Line Result - potential_anchor = end_of_tongue -** Processing line: ~ if potential_anchor.x <= 0~ + def input_star +** Processing line: ~ old_star = state.star.clone~ - Inside source: true *** True Line Result - if potential_anchor.x <= 0 -** Processing line: ~ state.anchor_point = potential_anchor~ + old_star = state.star.clone +** Processing line: ~ state.star = cell_closest_to_mouse~ - Inside source: true *** True Line Result - state.anchor_point = potential_anchor -** Processing line: ~ state.action = :anchored~ + state.star = cell_closest_to_mouse +** Processing line: ~ unless old_star == state.star~ - Inside source: true *** True Line Result - state.action = :anchored -** Processing line: ~ outputs.sounds << 'sounds/attached.wav'~ + unless old_star == state.star +** Processing line: ~ recalculate~ - Inside source: true *** True Line Result - outputs.sounds << 'sounds/attached.wav' -** Processing line: ~ elsif potential_anchor.x >= 10000~ + recalculate +** Processing line: ~ end~ - Inside source: true *** True Line Result - elsif potential_anchor.x >= 10000 -** Processing line: ~ state.anchor_point = potential_anchor~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.anchor_point = potential_anchor -** Processing line: ~ state.action = :anchored~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.action = :anchored -** Processing line: ~ outputs.sounds << 'sounds/attached.wav'~ + +** Processing line: ~ # Removes walls that are under the cursor~ - Inside source: true *** True Line Result - outputs.sounds << 'sounds/attached.wav' -** Processing line: ~ elsif potential_anchor.y <= 0~ + # Removes walls that are under the cursor +** Processing line: ~ def input_remove_wall~ - Inside source: true *** True Line Result - elsif potential_anchor.y <= 0 -** Processing line: ~ state.anchor_point = potential_anchor~ + def input_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - state.anchor_point = potential_anchor -** Processing line: ~ state.action = :anchored~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - state.action = :anchored -** Processing line: ~ outputs.sounds << 'sounds/attached.wav'~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - outputs.sounds << 'sounds/attached.wav' -** Processing line: ~ elsif potential_anchor.y >= 5875~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if mouse_inside_grid?~ - Inside source: true *** True Line Result - elsif potential_anchor.y >= 5875 -** Processing line: ~ state.anchor_point = potential_anchor~ + if mouse_inside_grid? +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - state.anchor_point = potential_anchor -** Processing line: ~ state.action = :anchored~ + if state.walls.has_key?(cell_closest_to_mouse) +** Processing line: ~ state.walls.delete(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - state.action = :anchored -** Processing line: ~ outputs.sounds << 'sounds/attached.wav'~ + state.walls.delete(cell_closest_to_mouse) +** Processing line: ~ recalculate~ - Inside source: true *** True Line Result - outputs.sounds << 'sounds/attached.wav' -** Processing line: ~ else~ + recalculate +** Processing line: ~ end~ - Inside source: true *** True Line Result - else -** Processing line: ~ anchor_rect = [potential_anchor.x - 5, potential_anchor.y - 5, 10, 10]~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - anchor_rect = [potential_anchor.x - 5, potential_anchor.y - 5, 10, 10] -** Processing line: ~ collision = state.world_collision_rects.find_all do |v|~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - collision = state.world_collision_rects.find_all do |v| -** Processing line: ~ [v[:args].x, v[:args].y, v[:args].w, v[:args].h].intersect_rect?(anchor_rect)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [v[:args].x, v[:args].y, v[:args].w, v[:args].h].intersect_rect?(anchor_rect) -** Processing line: ~ end.first~ + +** Processing line: ~ # Adds walls at cells under the cursor~ - Inside source: true *** True Line Result - end.first -** Processing line: ~ if collision~ + # Adds walls at cells under the cursor +** Processing line: ~ def input_add_wall~ - Inside source: true *** True Line Result - if collision -** Processing line: ~ state.anchor_point = potential_anchor~ + def input_add_wall +** Processing line: ~ if mouse_inside_grid?~ - Inside source: true *** True Line Result - state.anchor_point = potential_anchor -** Processing line: ~ state.action = :anchored~ + if mouse_inside_grid? +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - state.action = :anchored -** Processing line: ~ outputs.sounds << 'sounds/attached.wav'~ + unless state.walls.has_key?(cell_closest_to_mouse) +** Processing line: ~ state.walls[cell_closest_to_mouse] = true~ - Inside source: true *** True Line Result - outputs.sounds << 'sounds/attached.wav' + state.walls[cell_closest_to_mouse] = true +** Processing line: ~ recalculate~ +- Inside source: true +*** True Line Result + recalculate ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58423,62 +61744,74 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_player~ +** Processing line: ~ # This method is called when the user is editing the slider~ - Inside source: true *** True Line Result - def calc_player -** Processing line: ~ calc_shooting~ + # This method is called when the user is editing the slider +** Processing line: ~ # It pauses the animation and moves the white circle to the closest integer point~ - Inside source: true *** True Line Result - calc_shooting -** Processing line: ~ if !state.god_mode~ + # It pauses the animation and moves the white circle to the closest integer point +** Processing line: ~ # on the slider~ - Inside source: true *** True Line Result - if !state.god_mode -** Processing line: ~ state.dy += state.gravity # Since acceleration is the change in velocity, the change in y (dy) increases every frame~ + # on the slider +** Processing line: ~ # Changes the step of the search to be animated~ - Inside source: true *** True Line Result - state.dy += state.gravity # Since acceleration is the change in velocity, the change in y (dy) increases every frame -** Processing line: ~ state.dx += state.dx * state.air~ + # Changes the step of the search to be animated +** Processing line: ~ def input_slider~ - Inside source: true *** True Line Result - state.dx += state.dx * state.air -** Processing line: ~ end~ + def input_slider +** Processing line: ~ state.play = false~ - Inside source: true *** True Line Result - end -** Processing line: ~ calc_pendulum~ + state.play = false +** Processing line: ~ mouse_x = inputs.mouse.point.x~ - Inside source: true *** True Line Result - calc_pendulum -** Processing line: ~ calc_box_collision~ + mouse_x = inputs.mouse.point.x +** Processing line: ~~ - Inside source: true *** True Line Result - calc_box_collision -** Processing line: ~ calc_edge_collision~ + +** Processing line: ~ # Bounds the mouse_x to the closest x value on the slider line~ - Inside source: true *** True Line Result - calc_edge_collision -** Processing line: ~ if !state.god_mode~ + # Bounds the mouse_x to the closest x value on the slider line +** Processing line: ~ mouse_x = slider.x if mouse_x < slider.x~ - Inside source: true *** True Line Result - if !state.god_mode -** Processing line: ~ state.y += state.dy~ + mouse_x = slider.x if mouse_x < slider.x +** Processing line: ~ mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w~ - Inside source: true *** True Line Result - state.y += state.dy -** Processing line: ~ state.x += state.dx~ + mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w +** Processing line: ~~ - Inside source: true *** True Line Result - state.x += state.dx -** Processing line: ~ end~ + +** Processing line: ~ # Sets the current search step to the one represented by the mouse x value~ - Inside source: true *** True Line Result - end -** Processing line: ~ calc_tongue_angle~ + # Sets the current search step to the one represented by the mouse x value +** Processing line: ~ # The slider's circle moves due to the render_slider method using anim_steps~ - Inside source: true *** True Line Result - calc_tongue_angle + # The slider's circle moves due to the render_slider method using anim_steps +** Processing line: ~ state.anim_steps = ((mouse_x - slider.x) / slider.spacing).to_i~ +- Inside source: true +*** True Line Result + state.anim_steps = ((mouse_x - slider.x) / slider.spacing).to_i +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ recalculate~ +- Inside source: true +*** True Line Result + recalculate ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58487,30 +61820,46 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_box_collision~ +** Processing line: ~ # Whenever the user edits the grid,~ - Inside source: true *** True Line Result - def calc_box_collision -** Processing line: ~ return unless state.world_lookup.keys.length > 0~ + # Whenever the user edits the grid, +** Processing line: ~ # The search has to be recalculated upto the current step~ - Inside source: true *** True Line Result - return unless state.world_lookup.keys.length > 0 -** Processing line: ~ collision_floor~ + # The search has to be recalculated upto the current step +** Processing line: ~ # with the current grid as the initial state of the grid~ - Inside source: true *** True Line Result - collision_floor -** Processing line: ~ collision_left~ + # with the current grid as the initial state of the grid +** Processing line: ~ def recalculate~ - Inside source: true *** True Line Result - collision_left -** Processing line: ~ collision_right~ + def recalculate +** Processing line: ~ # Resets the search~ - Inside source: true *** True Line Result - collision_right -** Processing line: ~ collision_ceiling~ + # Resets the search +** Processing line: ~ state.frontier = []~ - Inside source: true *** True Line Result - collision_ceiling + state.frontier = [] +** Processing line: ~ state.visited = {}~ +- Inside source: true +*** True Line Result + state.visited = {} +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Moves the animation forward one step at a time~ +- Inside source: true +*** True Line Result + # Moves the animation forward one step at a time +** Processing line: ~ state.anim_steps.times { calc }~ +- Inside source: true +*** True Line Result + state.anim_steps.times { calc } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58519,50 +61868,66 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_edge_collision~ +** Processing line: ~~ - Inside source: true *** True Line Result - def calc_edge_collision -** Processing line: ~ # Ensures that player doesn't fall below the map~ + +** Processing line: ~ # This method moves the search forward one step~ - Inside source: true *** True Line Result - # Ensures that player doesn't fall below the map -** Processing line: ~ if next_y < 0 && state.dy < 0~ + # This method moves the search forward one step +** Processing line: ~ # When the animation is playing it is called every tick~ - Inside source: true *** True Line Result - if next_y < 0 && state.dy < 0 -** Processing line: ~ state.y = 0~ + # When the animation is playing it is called every tick +** Processing line: ~ # And called whenever the current step of the animation needs to be recalculated~ - Inside source: true *** True Line Result - state.y = 0 -** Processing line: ~ state.dy = state.dy.abs * 0.8~ + # And called whenever the current step of the animation needs to be recalculated +** Processing line: ~~ - Inside source: true *** True Line Result - state.dy = state.dy.abs * 0.8 -** Processing line: ~ state.collision_on_y = true~ + +** Processing line: ~ # Moves the search forward one step~ - Inside source: true *** True Line Result - state.collision_on_y = true -** Processing line: ~ # Ensures player doesn't go insanely high~ + # Moves the search forward one step +** Processing line: ~ # Parameter called_from_tick is true if it is called from the tick method~ - Inside source: true *** True Line Result - # Ensures player doesn't go insanely high -** Processing line: ~ elsif next_y > 5875 - state.tile_size && state.dy > 0~ + # Parameter called_from_tick is true if it is called from the tick method +** Processing line: ~ # It is false when the search is being recalculated after user editing the grid~ - Inside source: true *** True Line Result - elsif next_y > 5875 - state.tile_size && state.dy > 0 -** Processing line: ~ state.y = 5875 - state.tile_size~ + # It is false when the search is being recalculated after user editing the grid +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - state.y = 5875 - state.tile_size -** Processing line: ~ state.dy = state.dy.abs * 0.8 * -1~ + def calc +** Processing line: ~~ - Inside source: true *** True Line Result - state.dy = state.dy.abs * 0.8 * -1 -** Processing line: ~ state.collision_on_y = true~ + +** Processing line: ~ # The setup to the search~ - Inside source: true *** True Line Result - state.collision_on_y = true + # The setup to the search +** Processing line: ~ # Runs once when the there is no frontier or visited cells~ +- Inside source: true +*** True Line Result + # Runs once when the there is no frontier or visited cells +** Processing line: ~ if state.frontier.empty? && state.visited.empty?~ +- Inside source: true +*** True Line Result + if state.frontier.empty? && state.visited.empty? +** Processing line: ~ state.frontier << state.star~ +- Inside source: true +*** True Line Result + state.frontier << state.star +** Processing line: ~ state.visited[state.star] = true~ +- Inside source: true +*** True Line Result + state.visited[state.star] = true ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58571,62 +61936,62 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Ensures that player remains in the horizontal range its supposed to~ +** Processing line: ~ # A step in the search~ - Inside source: true *** True Line Result - # Ensures that player remains in the horizontal range its supposed to -** Processing line: ~ if state.x >= 10000 - state.tile_size && state.dx > 0~ + # A step in the search +** Processing line: ~ unless state.frontier.empty?~ - Inside source: true *** True Line Result - if state.x >= 10000 - state.tile_size && state.dx > 0 -** Processing line: ~ state.x = 10000 - state.tile_size~ + unless state.frontier.empty? +** Processing line: ~ # Takes the next frontier cell~ - Inside source: true *** True Line Result - state.x = 10000 - state.tile_size -** Processing line: ~ state.dx = state.dx.abs * 0.8 * -1~ + # Takes the next frontier cell +** Processing line: ~ new_frontier = state.frontier.shift~ - Inside source: true *** True Line Result - state.dx = state.dx.abs * 0.8 * -1 -** Processing line: ~ state.collision_on_x = true~ + new_frontier = state.frontier.shift +** Processing line: ~ # For each of its neighbors~ - Inside source: true *** True Line Result - state.collision_on_x = true -** Processing line: ~ elsif state.x <= 0 && state.dx < 0~ + # For each of its neighbors +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ - Inside source: true *** True Line Result - elsif state.x <= 0 && state.dx < 0 -** Processing line: ~ state.x = 0~ + adjacent_neighbors(new_frontier).each do |neighbor| +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - state.x = 0 -** Processing line: ~ state.dx = state.dx.abs * 0.8~ + # That have not been visited and are not walls +** Processing line: ~ unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - state.dx = state.dx.abs * 0.8 -** Processing line: ~ state.collision_on_x = true~ + unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited~ - Inside source: true *** True Line Result - state.collision_on_x = true -** Processing line: ~ end~ + # Add them to the frontier and mark them as visited +** Processing line: ~ state.frontier << neighbor~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + state.frontier << neighbor +** Processing line: ~ state.visited[neighbor] = true~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.visited[neighbor] = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def next_y~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - def next_y -** Processing line: ~ state.y + state.dy~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.y + state.dy + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58635,150 +62000,162 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def next_x~ +** Processing line: ~~ - Inside source: true *** True Line Result - def next_x -** Processing line: ~ if state.dx < 0~ + +** Processing line: ~ # Returns a list of adjacent cells~ - Inside source: true *** True Line Result - if state.dx < 0 -** Processing line: ~ return (state.x + state.dx) - (state.tile_size - state.player_width)~ + # Returns a list of adjacent cells +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ - Inside source: true *** True Line Result - return (state.x + state.dx) - (state.tile_size - state.player_width) -** Processing line: ~ else~ + # Used to determine what the next cells to be added to the frontier are +** Processing line: ~ def adjacent_neighbors(cell)~ - Inside source: true *** True Line Result - else -** Processing line: ~ return (state.x + state.dx) + (state.tile_size - state.player_width)~ + def adjacent_neighbors(cell) +** Processing line: ~ neighbors = []~ - Inside source: true *** True Line Result - return (state.x + state.dx) + (state.tile_size - state.player_width) -** Processing line: ~ end~ + neighbors = [] +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1 +** Processing line: ~ neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1~ - Inside source: true *** True Line Result - -** Processing line: ~ def collision_floor~ + neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1 +** Processing line: ~ neighbors << [cell.x, cell.y - 1] unless cell.y == 0~ - Inside source: true *** True Line Result - def collision_floor -** Processing line: ~ return unless state.dy <= 0~ + neighbors << [cell.x, cell.y - 1] unless cell.y == 0 +** Processing line: ~ neighbors << [cell.x - 1, cell.y] unless cell.x == 0~ - Inside source: true *** True Line Result - return unless state.dy <= 0 + neighbors << [cell.x - 1, cell.y] unless cell.x == 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ player_rect = [state.x, next_y, state.tile_size, state.tile_size]~ +** Processing line: ~ neighbors~ - Inside source: true *** True Line Result - player_rect = [state.x, next_y, state.tile_size, state.tile_size] + neighbors +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Runs through all the sprites on the field and determines if the player hits the bottom of sprite (hence "-0.1" above)~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - # Runs through all the sprites on the field and determines if the player hits the bottom of sprite (hence "-0.1" above) -** Processing line: ~ floor_collisions = state.world_collision_rects~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - floor_collisions = state.world_collision_rects -** Processing line: ~ .find_all { |r| r[:top].intersect_rect?(player_rect, state.collision_tolerance) }~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ - Inside source: true *** True Line Result - .find_all { |r| r[:top].intersect_rect?(player_rect, state.collision_tolerance) } -** Processing line: ~ .first~ + # Finding the cell closest to the mouse helps with this +** Processing line: ~ def cell_closest_to_mouse~ - Inside source: true *** True Line Result - .first -** Processing line: ~~ + def cell_closest_to_mouse +** Processing line: ~ # Closest cell to the mouse~ - Inside source: true *** True Line Result - -** Processing line: ~ return unless floor_collisions~ + # Closest cell to the mouse +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - return unless floor_collisions -** Processing line: ~ state.y = floor_collisions[:top].top~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - state.y = floor_collisions[:top].top -** Processing line: ~ state.dy = state.dy.abs * 0.8~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Bound x and y to the grid~ - Inside source: true *** True Line Result - state.dy = state.dy.abs * 0.8 -** Processing line: ~ end~ + # Bound x and y to the grid +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - -** Processing line: ~ def collision_left~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - def collision_left -** Processing line: ~ return unless state.dx < 0~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - return unless state.dx < 0 -** Processing line: ~ player_rect = [next_x, state.y, state.tile_size, state.tile_size]~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - player_rect = [next_x, state.y, state.tile_size, state.tile_size] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Runs through all the sprites on the field and determines if the player hits the left side of sprite (hence "-0.1" above)~ +** Processing line: ~ # These methods detect when the buttons are clicked~ - Inside source: true *** True Line Result - # Runs through all the sprites on the field and determines if the player hits the left side of sprite (hence "-0.1" above) -** Processing line: ~ left_side_collisions = state.world_collision_rects~ + # These methods detect when the buttons are clicked +** Processing line: ~ def left_button_clicked?~ - Inside source: true *** True Line Result - left_side_collisions = state.world_collision_rects -** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) }~ + def left_button_clicked? +** Processing line: ~ inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.left)~ - Inside source: true *** True Line Result - .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) } -** Processing line: ~ .first~ + inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.left) +** Processing line: ~ end~ - Inside source: true *** True Line Result - .first + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return unless left_side_collisions~ +** Processing line: ~ def center_button_clicked?~ - Inside source: true *** True Line Result - return unless left_side_collisions -** Processing line: ~ state.x = left_side_collisions[:left_right].right~ + def center_button_clicked? +** Processing line: ~ inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.center)~ - Inside source: true *** True Line Result - state.x = left_side_collisions[:left_right].right -** Processing line: ~ state.dx = state.dy.abs * 0.8~ + inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.center) +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.dx = state.dy.abs * 0.8 -** Processing line: ~ state.collision_on_x = true~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.collision_on_x = true + +** Processing line: ~ def right_button_clicked?~ +- Inside source: true +*** True Line Result + def right_button_clicked? +** Processing line: ~ inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.right)~ +- Inside source: true +*** True Line Result + inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.right) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58787,58 +62164,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 collision_right~ +** Processing line: ~ # Signal that the user is going to be moving the slider~ - Inside source: true *** True Line Result - def collision_right -** Processing line: ~ return unless state.dx > 0~ + # Signal that the user is going to be moving the slider +** Processing line: ~ # Is the mouse down on the circle of the slider?~ - Inside source: true *** True Line Result - return unless state.dx > 0 -** Processing line: ~~ + # Is the mouse down on the circle of the slider? +** Processing line: ~ def slider_clicked?~ - Inside source: true *** True Line Result - -** Processing line: ~ player_rect = [next_x, state.y, state.tile_size, state.tile_size]~ + def slider_clicked? +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing)~ - Inside source: true *** True Line Result - player_rect = [next_x, state.y, state.tile_size, state.tile_size] -** Processing line: ~ # Runs through all the sprites on the field and determines if the player hits the right side of sprite (hence "-0.1" above)~ + circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing) +** Processing line: ~ circle_y = (slider.y - slider.offset)~ - Inside source: true *** True Line Result - # Runs through all the sprites on the field and determines if the player hits the right side of sprite (hence "-0.1" above) -** Processing line: ~ right_side_collisions = state.world_collision_rects~ + circle_y = (slider.y - slider.offset) +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ - Inside source: true *** True Line Result - right_side_collisions = state.world_collision_rects -** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) }~ + circle_rect = [circle_x, circle_y, 37, 37] +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(circle_rect)~ - Inside source: true *** True Line Result - .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) } -** Processing line: ~ .first~ + inputs.mouse.down && inputs.mouse.point.inside_rect?(circle_rect) +** Processing line: ~ end~ - Inside source: true *** True Line Result - .first + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return unless right_side_collisions~ -- Inside source: true -*** True Line Result - return unless right_side_collisions -** Processing line: ~ state.x = right_side_collisions[:left_right].left - state.tile_size~ +** Processing line: ~ # Signal that the user is going to be moving the star~ - Inside source: true *** True Line Result - state.x = right_side_collisions[:left_right].left - state.tile_size -** Processing line: ~ state.dx = state.dx.abs * 0.8 * -1~ + # Signal that the user is going to be moving the star +** Processing line: ~ def star_clicked?~ - Inside source: true *** True Line Result - state.dx = state.dx.abs * 0.8 * -1 -** Processing line: ~ state.collision_on_x = true~ + def star_clicked? +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star))~ - Inside source: true *** True Line Result - state.collision_on_x = true + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star)) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58847,90 +62220,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 collision_ceiling~ +** Processing line: ~ # Signal that the user is going to be removing walls~ - Inside source: true *** True Line Result - def collision_ceiling -** Processing line: ~ return unless state.dy > 0~ + # Signal that the user is going to be removing walls +** Processing line: ~ def wall_clicked?~ - Inside source: true *** True Line Result - return unless state.dy > 0 -** Processing line: ~~ + def wall_clicked? +** Processing line: ~ inputs.mouse.down && mouse_inside_a_wall?~ - Inside source: true *** True Line Result - -** Processing line: ~ player_rect = [state.x, next_y, state.player_width, state.player_height]~ + inputs.mouse.down && mouse_inside_a_wall? +** Processing line: ~ end~ - Inside source: true *** True Line Result - player_rect = [state.x, next_y, state.player_width, state.player_height] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Runs through all the sprites on the field and determines if the player hits the ceiling of sprite (hence "+0.1" above)~ +** Processing line: ~ # Signal that the user is going to be adding walls~ - Inside source: true *** True Line Result - # Runs through all the sprites on the field and determines if the player hits the ceiling of sprite (hence "+0.1" above) -** Processing line: ~ ceil_collisions = state.world_collision_rects~ + # Signal that the user is going to be adding walls +** Processing line: ~ def grid_clicked?~ - Inside source: true *** True Line Result - ceil_collisions = state.world_collision_rects -** Processing line: ~ .find_all { |r| r[:bottom].intersect_rect?(player_rect, state.collision_tolerance) }~ + def grid_clicked? +** Processing line: ~ inputs.mouse.down && mouse_inside_grid?~ - Inside source: true *** True Line Result - .find_all { |r| r[:bottom].intersect_rect?(player_rect, state.collision_tolerance) } -** Processing line: ~ .first~ + inputs.mouse.down && mouse_inside_grid? +** Processing line: ~ end~ - Inside source: true *** True Line Result - .first + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return unless ceil_collisions~ +** Processing line: ~ # Returns whether the mouse is inside of a wall~ - Inside source: true *** True Line Result - return unless ceil_collisions -** Processing line: ~ state.y = ceil_collisions[:bottom].y - state.tile_size~ + # Returns whether the mouse is inside of a wall +** Processing line: ~ # Part of the condition that checks whether the user is removing a wall~ - Inside source: true *** True Line Result - state.y = ceil_collisions[:bottom].y - state.tile_size -** Processing line: ~ state.dy = state.dy.abs * 0.8 * -1~ + # Part of the condition that checks whether the user is removing a wall +** Processing line: ~ def mouse_inside_a_wall?~ - Inside source: true *** True Line Result - state.dy = state.dy.abs * 0.8 * -1 -** Processing line: ~ state.collision_on_y = true~ + def mouse_inside_a_wall? +** Processing line: ~ state.walls.each_key do | wall |~ - Inside source: true *** True Line Result - state.collision_on_y = true -** Processing line: ~ end~ + state.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(scale_up([wall.x, wall.y]))~ - Inside source: true *** True Line Result - end + return true if inputs.mouse.point.inside_rect?(scale_up([wall.x, wall.y])) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def to_coord point~ +** Processing line: ~ false~ - Inside source: true *** True Line Result - def to_coord point -** Processing line: ~ # Integer divides (idiv) point.x to turn into grid~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Integer divides (idiv) point.x to turn into grid -** Processing line: ~ # Then, you can just multiply each integer by state.tile_size~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # Then, you can just multiply each integer by state.tile_size -** Processing line: ~ # later and huzzah. Grid coordinates~ + +** Processing line: ~ # Returns whether the mouse is inside of a grid~ - Inside source: true *** True Line Result - # later and huzzah. Grid coordinates -** Processing line: ~ [point.x.idiv(state.tile_size), point.y.idiv(state.tile_size)]~ + # Returns whether the mouse is inside of a grid +** Processing line: ~ # Part of the condition that checks whether the user is adding a wall~ - Inside source: true *** True Line Result - [point.x.idiv(state.tile_size), point.y.idiv(state.tile_size)] + # Part of the condition that checks whether the user is adding a wall +** Processing line: ~ def mouse_inside_grid?~ +- Inside source: true +*** True Line Result + def mouse_inside_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up([0, 0, grid.width, grid.height]))~ +- Inside source: true +*** True Line Result + inputs.mouse.point.inside_rect?(scale_up([0, 0, grid.width, grid.height])) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58939,42 +62324,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def export_map~ +** Processing line: ~~ - Inside source: true *** True Line Result - def export_map -** Processing line: ~ export_string = state.world.map do |x, y|~ + +** Processing line: ~ # These methods provide handy aliases to colors~ - Inside source: true *** True Line Result - export_string = state.world.map do |x, y| -** Processing line: ~ "#{x},#{y},1"~ + # These methods provide handy aliases to colors +** Processing line: ~~ - Inside source: true *** True Line Result - "#{x},#{y},1" -** Processing line: ~ end~ + +** Processing line: ~ # Light brown~ - Inside source: true *** True Line Result - end -** Processing line: ~ export_string += state.objects.map do |x, y, w, h, path|~ + # Light brown +** Processing line: ~ def unvisited_color~ - Inside source: true *** True Line Result - export_string += state.objects.map do |x, y, w, h, path| -** Processing line: ~ "#{x},#{y},2,#{w},#{h},#{path}"~ + def unvisited_color +** Processing line: ~ [221, 212, 213]~ - Inside source: true *** True Line Result - "#{x},#{y},2,#{w},#{h},#{path}" -** Processing line: ~ end~ + [221, 212, 213] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ gtk.write_file(MAP_FILE_PATH, export_string.join("\n"))~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - gtk.write_file(MAP_FILE_PATH, export_string.join("\n")) -** Processing line: ~ state.map_saved_at = state.tick_count~ + +** Processing line: ~ # Black~ - Inside source: true *** True Line Result - state.map_saved_at = state.tick_count + # Black +** Processing line: ~ def grid_line_color~ +- Inside source: true +*** True Line Result + def grid_line_color +** Processing line: ~ [255, 255, 255]~ +- Inside source: true +*** True Line Result + [255, 255, 255] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58983,10 +62376,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 inputs_export_stage~ +** Processing line: ~ # Dark Brown~ - Inside source: true *** True Line Result - def inputs_export_stage + # Dark Brown +** Processing line: ~ def visited_color~ +- Inside source: true +*** True Line Result + def visited_color +** Processing line: ~ [204, 191, 179]~ +- Inside source: true +*** True Line Result + [204, 191, 179] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -58995,74 +62396,78 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_score~ +** Processing line: ~ # Blue~ - Inside source: true *** True Line Result - def calc_score -** Processing line: ~ return unless state.scene == :game~ + # Blue +** Processing line: ~ def frontier_color~ - Inside source: true *** True Line Result - return unless state.scene == :game -** Processing line: ~ player = [state.x, state.y, state.player_width, state.player_height]~ + def frontier_color +** Processing line: ~ [103, 136, 204]~ - Inside source: true *** True Line Result - player = [state.x, state.y, state.player_width, state.player_height] -** Processing line: ~ collected = state.objects.find_all { |s| s.intersect_rect? player }~ + [103, 136, 204] +** Processing line: ~ end~ - Inside source: true *** True Line Result - collected = state.objects.find_all { |s| s.intersect_rect? player } -** Processing line: ~ state.stuff_score += collected.length~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.stuff_score += collected.length -** Processing line: ~ if collected.length > 0~ + +** Processing line: ~ # Camo Green~ - Inside source: true *** True Line Result - if collected.length > 0 -** Processing line: ~ outputs.sounds << 'sounds/collectable.wav'~ + # Camo Green +** Processing line: ~ def wall_color~ - Inside source: true *** True Line Result - outputs.sounds << 'sounds/collectable.wav' -** Processing line: ~ end~ + def wall_color +** Processing line: ~ [134, 134, 120]~ - Inside source: true *** True Line Result - end -** Processing line: ~ state.objects = state.objects.reject { |s| collected.include? s }~ + [134, 134, 120] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.objects = state.objects.reject { |s| collected.include? s } -** Processing line: ~ state.stuff_time += 0.01~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.stuff_time += 0.01 -** Processing line: ~ if state.objects.length == 0~ + +** Processing line: ~ # Button Background~ - Inside source: true *** True Line Result - if state.objects.length == 0 -** Processing line: ~ if !state.stuff_best_time || state.stuff_time < state.stuff_best_time~ + # Button Background +** Processing line: ~ def gray~ - Inside source: true *** True Line Result - if !state.stuff_best_time || state.stuff_time < state.stuff_best_time -** Processing line: ~ state.stuff_best_time = state.stuff_time~ + def gray +** Processing line: ~ [190, 190, 190]~ - Inside source: true *** True Line Result - state.stuff_best_time = state.stuff_time -** Processing line: ~ end~ + [190, 190, 190] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ state.game_over_at = nil~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.game_over_at = nil -** Processing line: ~ state.scene = :ending~ + +** Processing line: ~ # Button Outline~ - Inside source: true *** True Line Result - state.scene = :ending -** Processing line: ~ end~ + # Button Outline +** Processing line: ~ def black~ - Inside source: true *** True Line Result - end + def black +** Processing line: ~ [0, 0, 0]~ +- Inside source: true +*** True Line Result + [0, 0, 0] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -59071,82 +62476,98 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_on_floor~ +** Processing line: ~ # These methods make the code more concise~ - Inside source: true *** True Line Result - def calc_on_floor -** Processing line: ~ if state.action == :anchored~ + # These methods make the code more concise +** Processing line: ~ def grid~ - Inside source: true *** True Line Result - if state.action == :anchored -** Processing line: ~ state.on_floor = false~ + def grid +** Processing line: ~ state.grid~ - Inside source: true *** True Line Result - state.on_floor = false -** Processing line: ~ state.on_floor_debounce = 30~ + state.grid +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.on_floor_debounce = 30 -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.on_floor_debounce ||= 30~ + +** Processing line: ~ def buttons~ - Inside source: true *** True Line Result - state.on_floor_debounce ||= 30 + def buttons +** Processing line: ~ state.buttons~ +- Inside source: true +*** True Line Result + state.buttons +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.dy.round != 0~ +** Processing line: ~ def slider~ - Inside source: true *** True Line Result - if state.dy.round != 0 -** Processing line: ~ state.on_floor_debounce = 30~ + def slider +** Processing line: ~ state.slider~ - Inside source: true *** True Line Result - state.on_floor_debounce = 30 -** Processing line: ~ state.on_floor = false~ + state.slider +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.on_floor = false -** Processing line: ~ else~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.on_floor_debounce -= 1~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.on_floor_debounce -= 1 -** Processing line: ~ end~ + +** Processing line: ~ # Method that is called by DragonRuby periodically~ - Inside source: true *** True Line Result - end + # Method that is called by DragonRuby periodically +** Processing line: ~ # Used for updating animations and calculations~ +- Inside source: true +*** True Line Result + # Used for updating animations and calculations +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.on_floor_debounce <= 0~ +** Processing line: ~ # Pressing r will reset the application~ - Inside source: true *** True Line Result - if state.on_floor_debounce <= 0 -** Processing line: ~ state.on_floor_debounce = 0~ + # Pressing r will reset the application +** Processing line: ~ if args.inputs.keyboard.key_down.r~ - Inside source: true *** True Line Result - state.on_floor_debounce = 0 -** Processing line: ~ state.on_floor = true~ + if args.inputs.keyboard.key_down.r +** Processing line: ~ args.gtk.reset~ - Inside source: true *** True Line Result - state.on_floor = true -** Processing line: ~ end~ + args.gtk.reset +** Processing line: ~ reset~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + reset +** Processing line: ~ return~ - Inside source: true *** True Line Result - end + return ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -59155,4570 +62576,4646 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render_player~ +** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ - Inside source: true *** True Line Result - def render_player -** Processing line: ~ path = "sprites/square-green.png"~ + # Every tick, new args are passed, and the Breadth First Search tick is called +** Processing line: ~ $breadth_first_search ||= BreadthFirstSearch.new(args)~ - Inside source: true *** True Line Result - path = "sprites/square-green.png" -** Processing line: ~ angle = 0~ + $breadth_first_search ||= BreadthFirstSearch.new(args) +** Processing line: ~ $breadth_first_search.args = args~ - Inside source: true *** True Line Result - angle = 0 -** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y) - 30, "dy: #{state.dy.round}"]~ + $breadth_first_search.args = args +** Processing line: ~ $breadth_first_search.tick~ - Inside source: true *** True Line Result - # outputs.labels << [vx(state.x), vy(state.y) - 30, "dy: #{state.dy.round}"] -** Processing line: ~ if state.action == :idle~ + $breadth_first_search.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - if state.action == :idle -** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "IDLE"]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # outputs.labels << [vx(state.x), vy(state.y), "IDLE"] -** Processing line: ~ path = "sprites/square-green.png"~ + +** Processing line: ~~ - Inside source: true *** True Line Result - path = "sprites/square-green.png" -** Processing line: ~ elsif state.action == :aiming && !state.on_floor~ + +** Processing line: ~ def reset~ - Inside source: true *** True Line Result - elsif state.action == :aiming && !state.on_floor -** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "AIMING AIR BORN"]~ + def reset +** Processing line: ~ $breadth_first_search = nil~ - Inside source: true *** True Line Result - # outputs.labels << [vx(state.x), vy(state.y), "AIMING AIR BORN"] -** Processing line: ~ angle = state.tongue_angle - 90~ + $breadth_first_search = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - angle = state.tongue_angle - 90 -** Processing line: ~ path = "sprites/square-green.png"~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - path = "sprites/square-green.png" -** Processing line: ~ elsif state.action == :aiming # ON THE GROUND~ + +** 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: ~*** Path Finding Algorithms - Detailed Breadth First Search - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Path Finding Algorithms - Detailed Breadth First Search - 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/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb~ - Inside source: true *** True Line Result - elsif state.action == :aiming # ON THE GROUND -** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "AIMING GROUND"]~ + # ./samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb +** Processing line: ~ # A visual demonstration of a breadth first search~ - Inside source: true *** True Line Result - # outputs.labels << [vx(state.x), vy(state.y), "AIMING GROUND"] -** Processing line: ~ path = "sprites/square-green.png"~ + # A visual demonstration of a breadth first search +** Processing line: ~ # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ - Inside source: true *** True Line Result - path = "sprites/square-green.png" -** Processing line: ~ elsif state.action == :shooting && !state.on_floor~ + # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html +** Processing line: ~~ - Inside source: true *** True Line Result - elsif state.action == :shooting && !state.on_floor -** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "SHOOTING AIR BORN"]~ + +** Processing line: ~ # An animation that can respond to user input in real time~ - Inside source: true *** True Line Result - # outputs.labels << [vx(state.x), vy(state.y), "SHOOTING AIR BORN"] -** Processing line: ~ path = "sprites/square-green.png"~ + # An animation that can respond to user input in real time +** Processing line: ~~ - Inside source: true *** True Line Result - path = "sprites/square-green.png" -** Processing line: ~ angle = state.tongue_angle - 90~ + +** Processing line: ~ # A breadth first search expands in all directions one step at a time~ - Inside source: true *** True Line Result - angle = state.tongue_angle - 90 -** Processing line: ~ elsif state.action == :shooting~ + # A breadth first search expands in all directions one step at a time +** Processing line: ~ # The frontier is a queue of cells to be expanded from~ - Inside source: true *** True Line Result - elsif state.action == :shooting -** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "SHOOTING ON GROUND"]~ + # The frontier is a queue of cells to be expanded from +** Processing line: ~ # The visited hash allows quick lookups of cells that have been expanded from~ - Inside source: true *** True Line Result - # outputs.labels << [vx(state.x), vy(state.y), "SHOOTING ON GROUND"] -** Processing line: ~ path = "sprites/square-green.png"~ + # The visited hash allows quick lookups of cells that have been expanded from +** Processing line: ~ # The walls hash allows quick lookup of whether a cell is a wall~ - Inside source: true *** True Line Result - path = "sprites/square-green.png" -** Processing line: ~ elsif state.action == :anchored~ + # The walls hash allows quick lookup of whether a cell is a wall +** Processing line: ~~ - Inside source: true *** True Line Result - elsif state.action == :anchored -** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "SWINGING"]~ + +** Processing line: ~ # The breadth first search starts by adding the red star to the frontier array~ - Inside source: true *** True Line Result - # outputs.labels << [vx(state.x), vy(state.y), "SWINGING"] -** Processing line: ~ angle = state.tongue_angle - 90~ + # The breadth first search starts by adding the red star to the frontier array +** Processing line: ~ # and marking it as visited~ - Inside source: true *** True Line Result - angle = state.tongue_angle - 90 -** Processing line: ~ path = "sprites/square-green.png"~ + # and marking it as visited +** Processing line: ~ # Each step a cell is removed from the front of the frontier array (queue)~ - Inside source: true *** True Line Result - path = "sprites/square-green.png" -** Processing line: ~ end~ + # Each step a cell is removed from the front of the frontier array (queue) +** Processing line: ~ # Unless the neighbor is a wall or visited, it is added to the frontier array~ - Inside source: true *** True Line Result - end + # Unless the neighbor is a wall or visited, it is added to the frontier array +** Processing line: ~ # The neighbor is then marked as visited~ +- Inside source: true +*** True Line Result + # The neighbor is then marked as visited ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.sprites << [vx(state.x),~ +** Processing line: ~ # The frontier is blue~ - Inside source: true *** True Line Result - outputs.sprites << [vx(state.x), -** Processing line: ~ vy(state.y),~ + # The frontier is blue +** Processing line: ~ # Visited cells are light brown~ - Inside source: true *** True Line Result - vy(state.y), -** Processing line: ~ vw(state.player_width),~ + # Visited cells are light brown +** Processing line: ~ # Walls are camo green~ - Inside source: true *** True Line Result - vw(state.player_width), -** Processing line: ~ vh(state.player_height),~ + # Walls are camo green +** Processing line: ~ # Even when walls are visited, they will maintain their wall color~ - Inside source: true *** True Line Result - vh(state.player_height), -** Processing line: ~ path,~ + # Even when walls are visited, they will maintain their wall color +** Processing line: ~~ - Inside source: true *** True Line Result - path, -** Processing line: ~ angle]~ + +** Processing line: ~ # This search numbers the order in which new cells are explored~ - Inside source: true *** True Line Result - angle] -** Processing line: ~ end~ + # This search numbers the order in which new cells are explored +** Processing line: ~ # The next cell from where the search will continue is highlighted yellow~ - Inside source: true *** True Line Result - end + # The next cell from where the search will continue is highlighted yellow +** Processing line: ~ # And the cells that will be considered for expansion are in semi-transparent green~ +- Inside source: true +*** True Line Result + # And the cells that will be considered for expansion are in semi-transparent green ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_player_old~ +** Processing line: ~ # The star can be moved by clicking and dragging~ - Inside source: true *** True Line Result - def render_player_old -** Processing line: ~ # Player~ + # The star can be moved by clicking and dragging +** Processing line: ~ # Walls can be added and removed by clicking and dragging~ - Inside source: true *** True Line Result - # Player -** Processing line: ~ if state.action == :aiming~ + # Walls can be added and removed by clicking and dragging +** Processing line: ~~ - Inside source: true *** True Line Result - if state.action == :aiming -** Processing line: ~ path = 'sprites\frg\idle\frog_idle.png'~ + +** Processing line: ~ class DetailedBreadthFirstSearch~ - Inside source: true *** True Line Result - path = 'sprites\frg\idle\frog_idle.png' -** Processing line: ~ if state.dx > 2~ + class DetailedBreadthFirstSearch +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - if state.dx > 2 -** Processing line: ~ #directional right sprite was here but i needa redo it~ + attr_gtk +** Processing line: ~~ - Inside source: true *** True Line Result - #directional right sprite was here but i needa redo it -** Processing line: ~ path = 'sprites\frg\anchor\frog-anchor-0.png'~ + +** Processing line: ~ def initialize(args)~ - Inside source: true *** True Line Result - path = 'sprites\frg\anchor\frog-anchor-0.png' -** Processing line: ~ #directional left sprite was here but i needa redo it~ + def initialize(args) +** Processing line: ~ # Variables to edit the size and appearance of the grid~ - Inside source: true *** True Line Result - #directional left sprite was here but i needa redo it -** Processing line: ~ elsif state.dx < -2~ + # Variables to edit the size and appearance of the grid +** Processing line: ~ # Freely customizable to user's liking~ - Inside source: true *** True Line Result - elsif state.dx < -2 -** Processing line: ~ path = 'sprites\frg\anchor\frog-anchor-0.png'~ + # Freely customizable to user's liking +** Processing line: ~ args.state.grid.width = 9~ - Inside source: true *** True Line Result - path = 'sprites\frg\anchor\frog-anchor-0.png' -** Processing line: ~ end~ + args.state.grid.width = 9 +** Processing line: ~ args.state.grid.height = 4~ - Inside source: true *** True Line Result - end -** Processing line: ~ outputs.sprites << [vx(state.x),~ + args.state.grid.height = 4 +** Processing line: ~ args.state.grid.cell_size = 90~ - Inside source: true *** True Line Result - outputs.sprites << [vx(state.x), -** Processing line: ~ vy(state.y),~ + args.state.grid.cell_size = 90 +** Processing line: ~~ - Inside source: true *** True Line Result - vy(state.y), -** Processing line: ~ vw(state.player_width),~ + +** Processing line: ~ # Stores which step of the animation is being rendered~ - Inside source: true *** True Line Result - vw(state.player_width), -** Processing line: ~ vh(state.player_height),~ + # Stores which step of the animation is being rendered +** Processing line: ~ # When the user moves the star or messes with the walls,~ - Inside source: true *** True Line Result - vh(state.player_height), -** Processing line: ~ path,~ + # When the user moves the star or messes with the walls, +** Processing line: ~ # the breadth first search is recalculated up to this step~ - Inside source: true *** True Line Result - path, -** Processing line: ~ (state.tongue_angle - 90)]~ + # the breadth first search is recalculated up to this step +** Processing line: ~ args.state.anim_steps = 0~ - Inside source: true *** True Line Result - (state.tongue_angle - 90)] -** Processing line: ~ elsif state.action == :anchored || state.action == :shooting~ + args.state.anim_steps = 0 +** Processing line: ~~ - Inside source: true *** True Line Result - elsif state.action == :anchored || state.action == :shooting -** Processing line: ~ outputs.sprites << [vx(state.x),~ + +** Processing line: ~ # At some step the animation will end,~ - Inside source: true *** True Line Result - outputs.sprites << [vx(state.x), -** Processing line: ~ vy(state.y),~ + # At some step the animation will end, +** Processing line: ~ # and further steps won't change anything (the whole grid will be explored)~ - Inside source: true *** True Line Result - vy(state.y), -** Processing line: ~ vw(state.player_width),~ + # and further steps won't change anything (the whole grid will be explored) +** Processing line: ~ # This step is roughly the grid's width * height~ - Inside source: true *** True Line Result - vw(state.player_width), -** Processing line: ~ vw(state.player_height),~ + # This step is roughly the grid's width * height +** Processing line: ~ # When anim_steps equals max_steps no more calculations will occur~ - Inside source: true *** True Line Result - vw(state.player_height), -** Processing line: ~ 'sprites/animations_povfrog/frog_bwah_up.png',~ + # When anim_steps equals max_steps no more calculations will occur +** Processing line: ~ # and the slider will be at the end~ - Inside source: true *** True Line Result - 'sprites/animations_povfrog/frog_bwah_up.png', -** Processing line: ~ (state.tongue_angle - 90)]~ + # and the slider will be at the end +** Processing line: ~ args.state.max_steps = args.state.grid.width * args.state.grid.height~ - Inside source: true *** True Line Result - (state.tongue_angle - 90)] -** Processing line: ~ end~ + args.state.max_steps = args.state.grid.width * args.state.grid.height +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ # The location of the star and walls of the grid~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # The location of the star and walls of the grid +** Processing line: ~ # They can be modified to have a different initial grid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # They can be modified to have a different initial grid +** Processing line: ~ # Walls are stored in a hash for quick look up when doing the search~ - Inside source: true *** True Line Result - -** Processing line: ~~ + # Walls are stored in a hash for quick look up when doing the search +** Processing line: ~ args.state.star = [3, 2]~ - Inside source: true *** True Line Result - -** Processing line: ~ $game = CleptoFrog.new~ + args.state.star = [3, 2] +** Processing line: ~ args.state.walls = {}~ - Inside source: true *** True Line Result - $game = CleptoFrog.new + args.state.walls = {} ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ # Variables that are used by the breadth first search~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ if args.state.scene == :game~ + # Variables that are used by the breadth first search +** Processing line: ~ # Storing cells that the search has visited, prevents unnecessary steps~ - Inside source: true *** True Line Result - if args.state.scene == :game -** Processing line: ~ tick_instructions args, "SPACE to SHOOT and RELEASE tongue. LEFT, RIGHT to SWING and BUILD momentum. MINIMAP in bottom right corner.", 360~ + # Storing cells that the search has visited, prevents unnecessary steps +** Processing line: ~ # Expanding the frontier of the search in order makes the search expand~ - Inside source: true *** True Line Result - tick_instructions args, "SPACE to SHOOT and RELEASE tongue. LEFT, RIGHT to SWING and BUILD momentum. MINIMAP in bottom right corner.", 360 -** Processing line: ~ end~ + # Expanding the frontier of the search in order makes the search expand +** Processing line: ~ # from the center outward~ - Inside source: true *** True Line Result - end -** Processing line: ~ $game.args = args~ + # from the center outward +** Processing line: ~ args.state.visited = {}~ - Inside source: true *** True Line Result - $game.args = args -** Processing line: ~ $game.tick~ + args.state.visited = {} +** Processing line: ~ args.state.frontier = []~ - Inside source: true *** True Line Result - $game.tick -** Processing line: ~ end~ + args.state.frontier = [] +** Processing line: ~ args.state.cell_numbers = []~ - Inside source: true *** True Line Result - end + args.state.cell_numbers = [] ** 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~ +** Processing line: ~~ - Inside source: true *** True Line Result - return if args.state.key_event_occurred -** Processing line: ~ if args.inputs.keyboard.directional_vector || args.inputs.keyboard.key_down.space~ + +** Processing line: ~~ - Inside source: true *** True Line Result - if args.inputs.keyboard.directional_vector || args.inputs.keyboard.key_down.space -** Processing line: ~ args.state.key_event_occurred = true~ + +** Processing line: ~ # What the user is currently editing on the grid~ - Inside source: true *** True Line Result - args.state.key_event_occurred = true -** Processing line: ~ end~ + # What the user is currently editing on the grid +** Processing line: ~ # Possible values are: :none, :slider, :star, :remove_wall, :add_wall~ - Inside source: true *** True Line Result - end + # Possible values are: :none, :slider, :star, :remove_wall, :add_wall ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ +** Processing line: ~ # We store this value, because we want to remember the value even when~ - 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~ + # We store this value, because we want to remember the value even when +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ - 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, "(SPACE to dismiss instructions)" , -2, 1, 255, 255, 255].label~ + # the user's cursor is no longer over what they're interacting with, but +** Processing line: ~ # they are still clicking down on the mouse.~ - Inside source: true *** True Line Result - args.outputs.debug << [640, y - 25, "(SPACE to dismiss instructions)" , -2, 1, 255, 255, 255].label -** Processing line: ~ end~ + # they are still clicking down on the mouse. +** Processing line: ~ args.state.click_and_drag = :none~ - Inside source: true *** True Line Result - end + args.state.click_and_drag = :none ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. +** Processing line: ~ # The x, y, w, h values for the buttons~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + # The x, y, w, h values for the buttons +** Processing line: ~ # Allow easy movement of the buttons location~ +- Inside source: true *** True Line Result - -** Processing line: ~* Platformer - Clepto Frog - map.rb~ -- Header detected. + # Allow easy movement of the buttons location +** Processing line: ~ # A centralized location to get values to detect input and draw the buttons~ +- Inside source: true *** True Line Result - + # A centralized location to get values to detect input and draw the buttons +** Processing line: ~ # Editing these values might mean needing to edit the label offsets~ +- Inside source: true *** True Line Result -* Platformer - Clepto Frog - map.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # Editing these values might mean needing to edit the label offsets +** Processing line: ~ # which can be found in the appropriate render button methods~ +- Inside source: true *** True Line Result - + # which can be found in the appropriate render button methods +** Processing line: ~ args.state.buttons.left = [450, 600, 160, 50]~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_platformer/clepto_frog/app/map.rb~ + args.state.buttons.left = [450, 600, 160, 50] +** Processing line: ~ args.state.buttons.right = [610, 600, 160, 50]~ - Inside source: true *** True Line Result - # ./samples/99_genre_platformer/clepto_frog/app/map.rb -** Processing line: ~ $collisions = [~ + args.state.buttons.right = [610, 600, 160, 50] +** Processing line: ~~ - Inside source: true *** True Line Result - $collisions = [ -** Processing line: ~ [326, 463, 64, 64],~ + +** Processing line: ~ # The variables below are related to the slider~ - Inside source: true *** True Line Result - [326, 463, 64, 64], -** Processing line: ~ [274, 462, 64, 64],~ + # The variables below are related to the slider +** Processing line: ~ # They allow the user to customize them~ - Inside source: true *** True Line Result - [274, 462, 64, 64], -** Processing line: ~ [326, 413, 64, 64],~ + # They allow the user to customize them +** Processing line: ~ # They also give a central location for the render and input methods to get~ - Inside source: true *** True Line Result - [326, 413, 64, 64], -** Processing line: ~ [275, 412, 64, 64],~ + # They also give a central location for the render and input methods to get +** Processing line: ~ # information from~ - Inside source: true *** True Line Result - [275, 412, 64, 64], -** Processing line: ~ [124, 651, 64, 64],~ + # information from +** Processing line: ~ # x & y are the coordinates of the leftmost part of the slider line~ - Inside source: true *** True Line Result - [124, 651, 64, 64], -** Processing line: ~ [72, 651, 64, 64],~ + # x & y are the coordinates of the leftmost part of the slider line +** Processing line: ~ args.state.slider.x = 400~ - Inside source: true *** True Line Result - [72, 651, 64, 64], -** Processing line: ~ [124, 600, 64, 64],~ + args.state.slider.x = 400 +** Processing line: ~ args.state.slider.y = 675~ - Inside source: true *** True Line Result - [124, 600, 64, 64], -** Processing line: ~ [69, 599, 64, 64],~ + args.state.slider.y = 675 +** Processing line: ~ # This is the width of the line~ - Inside source: true *** True Line Result - [69, 599, 64, 64], -** Processing line: ~ [501, 997, 64, 64],~ + # This is the width of the line +** Processing line: ~ args.state.slider.w = 360~ - Inside source: true *** True Line Result - [501, 997, 64, 64], -** Processing line: ~ [476, 995, 64, 64],~ + args.state.slider.w = 360 +** Processing line: ~ # This is the offset for the circle~ - Inside source: true *** True Line Result - [476, 995, 64, 64], -** Processing line: ~ [3224, 2057, 64, 64],~ + # This is the offset for the circle +** Processing line: ~ # Allows the center of the circle to be on the line,~ - Inside source: true *** True Line Result - [3224, 2057, 64, 64], -** Processing line: ~ [3224, 1994, 64, 64],~ + # Allows the center of the circle to be on the line, +** Processing line: ~ # as opposed to the upper right corner~ - Inside source: true *** True Line Result - [3224, 1994, 64, 64], -** Processing line: ~ [3225, 1932, 64, 64],~ + # as opposed to the upper right corner +** Processing line: ~ args.state.slider.offset = 20~ - Inside source: true *** True Line Result - [3225, 1932, 64, 64], -** Processing line: ~ [3225, 1870, 64, 64],~ + args.state.slider.offset = 20 +** Processing line: ~ # This is the spacing between each of the notches on the slider~ - Inside source: true *** True Line Result - [3225, 1870, 64, 64], -** Processing line: ~ [3226, 1806, 64, 64],~ + # This is the spacing between each of the notches on the slider +** Processing line: ~ # Notches are places where the circle can rest on the slider line~ - Inside source: true *** True Line Result - [3226, 1806, 64, 64], -** Processing line: ~ [3224, 1744, 64, 64],~ + # Notches are places where the circle can rest on the slider line +** Processing line: ~ # There needs to be a notch for each step before the maximum number of steps~ - Inside source: true *** True Line Result - [3224, 1744, 64, 64], -** Processing line: ~ [3225, 1689, 64, 64],~ + # There needs to be a notch for each step before the maximum number of steps +** Processing line: ~ args.state.slider.spacing = args.state.slider.w.to_f / args.state.max_steps.to_f~ - Inside source: true *** True Line Result - [3225, 1689, 64, 64], -** Processing line: ~ [3226, 1660, 64, 64],~ + args.state.slider.spacing = args.state.slider.w.to_f / args.state.max_steps.to_f +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3226, 1660, 64, 64], -** Processing line: ~ [3161, 1658, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [3161, 1658, 64, 64], -** Processing line: ~ [3097, 1660, 64, 64],~ + +** Processing line: ~ # This method is called every frame/tick~ - Inside source: true *** True Line Result - [3097, 1660, 64, 64], -** Processing line: ~ [3033, 1658, 64, 64],~ + # This method is called every frame/tick +** Processing line: ~ # Every tick, the current state of the search is rendered on the screen,~ - Inside source: true *** True Line Result - [3033, 1658, 64, 64], -** Processing line: ~ [2969, 1658, 64, 64],~ + # Every tick, the current state of the search is rendered on the screen, +** Processing line: ~ # User input is processed, and~ - Inside source: true *** True Line Result - [2969, 1658, 64, 64], -** Processing line: ~ [2904, 1658, 64, 64],~ + # User input is processed, and +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - [2904, 1658, 64, 64], -** Processing line: ~ [2839, 1657, 64, 64],~ + def tick +** Processing line: ~ render~ - Inside source: true *** True Line Result - [2839, 1657, 64, 64], -** Processing line: ~ [2773, 1657, 64, 64],~ + render +** Processing line: ~ input~ - Inside source: true *** True Line Result - [2773, 1657, 64, 64], -** Processing line: ~ [2709, 1658, 64, 64],~ + input +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2709, 1658, 64, 64], -** Processing line: ~ [2643, 1657, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [2643, 1657, 64, 64], -** Processing line: ~ [2577, 1657, 64, 64],~ + +** Processing line: ~ # This method is called from tick and renders everything every tick~ - Inside source: true *** True Line Result - [2577, 1657, 64, 64], -** Processing line: ~ [2509, 1658, 64, 64],~ + # This method is called from tick and renders everything every tick +** Processing line: ~ def render~ - Inside source: true *** True Line Result - [2509, 1658, 64, 64], -** Processing line: ~ [2440, 1658, 64, 64],~ + def render +** Processing line: ~ render_buttons~ - Inside source: true *** True Line Result - [2440, 1658, 64, 64], -** Processing line: ~ [2371, 1658, 64, 64],~ + render_buttons +** Processing line: ~ render_slider~ - Inside source: true *** True Line Result - [2371, 1658, 64, 64], -** Processing line: ~ [2301, 1659, 64, 64],~ + render_slider +** Processing line: ~~ - Inside source: true *** True Line Result - [2301, 1659, 64, 64], -** Processing line: ~ [2230, 1659, 64, 64],~ + +** Processing line: ~ render_background~ - Inside source: true *** True Line Result - [2230, 1659, 64, 64], -** Processing line: ~ [2159, 1659, 64, 64],~ + render_background +** Processing line: ~ render_visited~ - Inside source: true *** True Line Result - [2159, 1659, 64, 64], -** Processing line: ~ [2092, 1660, 64, 64],~ + render_visited +** Processing line: ~ render_frontier~ - Inside source: true *** True Line Result - [2092, 1660, 64, 64], -** Processing line: ~ [2025, 1661, 64, 64],~ + render_frontier +** Processing line: ~ render_walls~ - Inside source: true *** True Line Result - [2025, 1661, 64, 64], -** Processing line: ~ [1958, 1660, 64, 64],~ + render_walls +** Processing line: ~ render_star~ - Inside source: true *** True Line Result - [1958, 1660, 64, 64], -** Processing line: ~ [1888, 1659, 64, 64],~ + render_star +** Processing line: ~~ - Inside source: true *** True Line Result - [1888, 1659, 64, 64], -** Processing line: ~ [1817, 1657, 64, 64],~ + +** Processing line: ~ render_highlights~ - Inside source: true *** True Line Result - [1817, 1657, 64, 64], -** Processing line: ~ [1745, 1656, 64, 64],~ + render_highlights +** Processing line: ~ render_cell_numbers~ - Inside source: true *** True Line Result - [1745, 1656, 64, 64], -** Processing line: ~ [1673, 1658, 64, 64],~ + render_cell_numbers +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1673, 1658, 64, 64], -** Processing line: ~ [1605, 1660, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [1605, 1660, 64, 64], -** Processing line: ~ [1536, 1658, 64, 64],~ + +** Processing line: ~ # The methods below subdivide the task of drawing everything to the screen~ - Inside source: true *** True Line Result - [1536, 1658, 64, 64], -** Processing line: ~ [1465, 1660, 64, 64],~ + # The methods below subdivide the task of drawing everything to the screen +** Processing line: ~~ - Inside source: true *** True Line Result - [1465, 1660, 64, 64], -** Processing line: ~ [1386, 1960, 64, 64],~ + +** Processing line: ~ # Draws the buttons that move the search backward or forward~ - Inside source: true *** True Line Result - [1386, 1960, 64, 64], -** Processing line: ~ [1384, 1908, 64, 64],~ + # Draws the buttons that move the search backward or forward +** Processing line: ~ # These buttons are rendered so the user knows where to click to move the search~ - Inside source: true *** True Line Result - [1384, 1908, 64, 64], -** Processing line: ~ [1387, 1862, 64, 64],~ + # These buttons are rendered so the user knows where to click to move the search +** Processing line: ~ def render_buttons~ - Inside source: true *** True Line Result - [1387, 1862, 64, 64], -** Processing line: ~ [1326, 1863, 64, 64],~ + def render_buttons +** Processing line: ~ render_left_button~ - Inside source: true *** True Line Result - [1326, 1863, 64, 64], -** Processing line: ~ [1302, 1862, 64, 64],~ + render_left_button +** Processing line: ~ render_right_button~ - Inside source: true *** True Line Result - [1302, 1862, 64, 64], -** Processing line: ~ [1119, 1906, 64, 64],~ + render_right_button +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1119, 1906, 64, 64], -** Processing line: ~ [1057, 1905, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [1057, 1905, 64, 64], -** Processing line: ~ [994, 1905, 64, 64],~ + +** Processing line: ~ # Renders the button which steps the search backward~ - Inside source: true *** True Line Result - [994, 1905, 64, 64], -** Processing line: ~ [937, 1904, 64, 64],~ + # Renders the button which steps the search backward +** Processing line: ~ # Shows the user where to click to move the search backward~ - Inside source: true *** True Line Result - [937, 1904, 64, 64], -** Processing line: ~ [896, 1904, 64, 64],~ + # Shows the user where to click to move the search backward +** Processing line: ~ def render_left_button~ - Inside source: true *** True Line Result - [896, 1904, 64, 64], -** Processing line: ~ [1001, 1845, 64, 64],~ + def render_left_button +** Processing line: ~ # Draws the gray button, and a black border~ - Inside source: true *** True Line Result - [1001, 1845, 64, 64], -** Processing line: ~ [1003, 1780, 64, 64],~ + # Draws the gray button, and a black border +** Processing line: ~ # The border separates the buttons visually~ - Inside source: true *** True Line Result - [1003, 1780, 64, 64], -** Processing line: ~ [1003, 1718, 64, 64],~ + # The border separates the buttons visually +** Processing line: ~ outputs.solids << [buttons.left, gray]~ - Inside source: true *** True Line Result - [1003, 1718, 64, 64], -** Processing line: ~ [692, 1958, 64, 64],~ + outputs.solids << [buttons.left, gray] +** Processing line: ~ outputs.borders << [buttons.left, black]~ - Inside source: true *** True Line Result - [692, 1958, 64, 64], -** Processing line: ~ [691, 1900, 64, 64],~ + outputs.borders << [buttons.left, black] +** Processing line: ~~ - Inside source: true *** True Line Result - [691, 1900, 64, 64], -** Processing line: ~ [774, 1861, 64, 64],~ + +** Processing line: ~ # Renders an explanatory label in the center of the button~ - Inside source: true *** True Line Result - [774, 1861, 64, 64], -** Processing line: ~ [712, 1861, 64, 64],~ + # Renders an explanatory label in the center of the button +** Processing line: ~ # Explains to the user what the button does~ - Inside source: true *** True Line Result - [712, 1861, 64, 64], -** Processing line: ~ [691, 1863, 64, 64],~ + # Explains to the user what the button does +** Processing line: ~ label_x = buttons.left.x + 05~ - Inside source: true *** True Line Result - [691, 1863, 64, 64], -** Processing line: ~ [325, 2133, 64, 64],~ + label_x = buttons.left.x + 05 +** Processing line: ~ label_y = buttons.left.y + 35~ - Inside source: true *** True Line Result - [325, 2133, 64, 64], -** Processing line: ~ [275, 2134, 64, 64],~ + label_y = buttons.left.y + 35 +** Processing line: ~ outputs.labels << [label_x, label_y, "< Step backward"]~ - Inside source: true *** True Line Result - [275, 2134, 64, 64], -** Processing line: ~ [326, 2082, 64, 64],~ + outputs.labels << [label_x, label_y, "< Step backward"] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [326, 2082, 64, 64], -** Processing line: ~ [275, 2082, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [275, 2082, 64, 64], -** Processing line: ~ [124, 2321, 64, 64],~ + +** Processing line: ~ # Renders the button which steps the search forward~ - Inside source: true *** True Line Result - [124, 2321, 64, 64], -** Processing line: ~ [71, 2320, 64, 64],~ + # Renders the button which steps the search forward +** Processing line: ~ # Shows the user where to click to move the search forward~ - Inside source: true *** True Line Result - [71, 2320, 64, 64], -** Processing line: ~ [123, 2267, 64, 64],~ + # Shows the user where to click to move the search forward +** Processing line: ~ def render_right_button~ - Inside source: true *** True Line Result - [123, 2267, 64, 64], -** Processing line: ~ [71, 2268, 64, 64],~ + def render_right_button +** Processing line: ~ # Draws the gray button, and a black border~ - Inside source: true *** True Line Result - [71, 2268, 64, 64], -** Processing line: ~ [2354, 1859, 64, 64],~ + # Draws the gray button, and a black border +** Processing line: ~ # The border separates the buttons visually~ - Inside source: true *** True Line Result - [2354, 1859, 64, 64], -** Processing line: ~ [2292, 1859, 64, 64],~ + # The border separates the buttons visually +** Processing line: ~ outputs.solids << [buttons.right, gray]~ - Inside source: true *** True Line Result - [2292, 1859, 64, 64], -** Processing line: ~ [2231, 1857, 64, 64],~ + outputs.solids << [buttons.right, gray] +** Processing line: ~ outputs.borders << [buttons.right, black]~ - Inside source: true *** True Line Result - [2231, 1857, 64, 64], -** Processing line: ~ [2198, 1858, 64, 64],~ + outputs.borders << [buttons.right, black] +** Processing line: ~~ - Inside source: true *** True Line Result - [2198, 1858, 64, 64], -** Processing line: ~ [2353, 1802, 64, 64],~ + +** Processing line: ~ # Renders an explanatory label in the center of the button~ - Inside source: true *** True Line Result - [2353, 1802, 64, 64], -** Processing line: ~ [2296, 1798, 64, 64],~ + # Renders an explanatory label in the center of the button +** Processing line: ~ # Explains to the user what the button does~ - Inside source: true *** True Line Result - [2296, 1798, 64, 64], -** Processing line: ~ [2233, 1797, 64, 64],~ + # Explains to the user what the button does +** Processing line: ~ label_x = buttons.right.x + 10~ - Inside source: true *** True Line Result - [2233, 1797, 64, 64], -** Processing line: ~ [2200, 1797, 64, 64],~ + label_x = buttons.right.x + 10 +** Processing line: ~ label_y = buttons.right.y + 35~ - Inside source: true *** True Line Result - [2200, 1797, 64, 64], -** Processing line: ~ [2352, 1742, 64, 64],~ + label_y = buttons.right.y + 35 +** Processing line: ~ outputs.labels << [label_x, label_y, "Step forward >"]~ - Inside source: true *** True Line Result - [2352, 1742, 64, 64], -** Processing line: ~ [2288, 1741, 64, 64],~ + outputs.labels << [label_x, label_y, "Step forward >"] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2288, 1741, 64, 64], -** Processing line: ~ [2230, 1743, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [2230, 1743, 64, 64], -** Processing line: ~ [2196, 1743, 64, 64],~ + +** Processing line: ~ # Draws the slider so the user can move it and see the progress of the search~ - Inside source: true *** True Line Result - [2196, 1743, 64, 64], -** Processing line: ~ [1736, 460, 64, 64],~ + # Draws the slider so the user can move it and see the progress of the search +** Processing line: ~ def render_slider~ - Inside source: true *** True Line Result - [1736, 460, 64, 64], -** Processing line: ~ [1735, 400, 64, 64],~ + def render_slider +** Processing line: ~ # Using primitives hides the line under the white circle of the slider~ - Inside source: true *** True Line Result - [1735, 400, 64, 64], -** Processing line: ~ [1736, 339, 64, 64],~ + # Using primitives hides the line under the white circle of the slider +** Processing line: ~ # Draws the line~ - Inside source: true *** True Line Result - [1736, 339, 64, 64], -** Processing line: ~ [1736, 275, 64, 64],~ + # Draws the line +** Processing line: ~ outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line~ - Inside source: true *** True Line Result - [1736, 275, 64, 64], -** Processing line: ~ [1738, 210, 64, 64],~ + outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line +** Processing line: ~ # The circle needs to be offset so that the center of the circle~ - Inside source: true *** True Line Result - [1738, 210, 64, 64], -** Processing line: ~ [1735, 145, 64, 64],~ + # The circle needs to be offset so that the center of the circle +** Processing line: ~ # overlaps the line instead of the upper right corner of the circle~ - Inside source: true *** True Line Result - [1735, 145, 64, 64], -** Processing line: ~ [1735, 87, 64, 64],~ + # overlaps the line instead of the upper right corner of the circle +** Processing line: ~ # The circle's x value is also moved based on the current seach step~ - Inside source: true *** True Line Result - [1735, 87, 64, 64], -** Processing line: ~ [1736, 51, 64, 64],~ + # The circle's x value is also moved based on the current seach step +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing)~ - Inside source: true *** True Line Result - [1736, 51, 64, 64], -** Processing line: ~ [539, 289, 64, 64],~ + circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing) +** Processing line: ~ circle_y = (slider.y - slider.offset)~ - Inside source: true *** True Line Result - [539, 289, 64, 64], -** Processing line: ~ [541, 228, 64, 64],~ + circle_y = (slider.y - slider.offset) +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ - Inside source: true *** True Line Result - [541, 228, 64, 64], -** Processing line: ~ [626, 191, 64, 64],~ + circle_rect = [circle_x, circle_y, 37, 37] +** Processing line: ~ outputs.primitives << [circle_rect, 'circle-white.png'].sprite~ - Inside source: true *** True Line Result - [626, 191, 64, 64], -** Processing line: ~ [572, 192, 64, 64],~ + outputs.primitives << [circle_rect, 'circle-white.png'].sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - [572, 192, 64, 64], -** Processing line: ~ [540, 193, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [540, 193, 64, 64], -** Processing line: ~ [965, 233, 64, 64],~ + +** Processing line: ~ # Draws what the grid looks like with nothing on it~ - Inside source: true *** True Line Result - [965, 233, 64, 64], -** Processing line: ~ [904, 234, 64, 64],~ + # Draws what the grid looks like with nothing on it +** Processing line: ~ # Which is a bunch of unvisited cells~ - Inside source: true *** True Line Result - [904, 234, 64, 64], -** Processing line: ~ [840, 234, 64, 64],~ + # Which is a bunch of unvisited cells +** Processing line: ~ # Drawn first so other things can draw on top of it~ - Inside source: true *** True Line Result - [840, 234, 64, 64], -** Processing line: ~ [779, 234, 64, 64],~ + # Drawn first so other things can draw on top of it +** Processing line: ~ def render_background~ - Inside source: true *** True Line Result - [779, 234, 64, 64], -** Processing line: ~ [745, 236, 64, 64],~ + def render_background +** Processing line: ~ render_unvisited~ - Inside source: true *** True Line Result - [745, 236, 64, 64], -** Processing line: ~ [851, 169, 64, 64],~ + render_unvisited +** Processing line: ~~ - Inside source: true *** True Line Result - [851, 169, 64, 64], -** Processing line: ~ [849, 108, 64, 64],~ + +** Processing line: ~ # The grid lines make the cells appear separate~ - Inside source: true *** True Line Result - [849, 108, 64, 64], -** Processing line: ~ [852, 50, 64, 64],~ + # The grid lines make the cells appear separate +** Processing line: ~ render_grid_lines~ - Inside source: true *** True Line Result - [852, 50, 64, 64], -** Processing line: ~ [1237, 289, 64, 64],~ + render_grid_lines +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1237, 289, 64, 64], -** Processing line: ~ [1236, 228, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [1236, 228, 64, 64], -** Processing line: ~ [1238, 197, 64, 64],~ + +** Processing line: ~ # Draws a rectangle the size of the entire grid to represent unvisited cells~ - Inside source: true *** True Line Result - [1238, 197, 64, 64], -** Processing line: ~ [1181, 192, 64, 64],~ + # Draws a rectangle the size of the entire grid to represent unvisited cells +** Processing line: ~ # Unvisited cells are the default cell~ - Inside source: true *** True Line Result - [1181, 192, 64, 64], -** Processing line: ~ [1152, 192, 64, 64],~ + # Unvisited cells are the default cell +** Processing line: ~ def render_unvisited~ - Inside source: true *** True Line Result - [1152, 192, 64, 64], -** Processing line: ~ [1443, 605, 64, 64],~ + def render_unvisited +** Processing line: ~ background = [0, 0, grid.width, grid.height]~ - Inside source: true *** True Line Result - [1443, 605, 64, 64], -** Processing line: ~ [1419, 606, 64, 64],~ + background = [0, 0, grid.width, grid.height] +** Processing line: ~ outputs.solids << [scale_up(background), unvisited_color]~ - Inside source: true *** True Line Result - [1419, 606, 64, 64], -** Processing line: ~ [1069, 925, 64, 64],~ + outputs.solids << [scale_up(background), unvisited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1069, 925, 64, 64], -** Processing line: ~ [1068, 902, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [1068, 902, 64, 64], -** Processing line: ~ [1024, 927, 64, 64],~ + +** Processing line: ~ # Draws grid lines to show the division of the grid into cells~ - Inside source: true *** True Line Result - [1024, 927, 64, 64], -** Processing line: ~ [1017, 897, 64, 64],~ + # Draws grid lines to show the division of the grid into cells +** Processing line: ~ def render_grid_lines~ - Inside source: true *** True Line Result - [1017, 897, 64, 64], -** Processing line: ~ [963, 926, 64, 64],~ + def render_grid_lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - [963, 926, 64, 64], -** Processing line: ~ [958, 898, 64, 64],~ + for x in 0..grid.width +** Processing line: ~ outputs.lines << [scale_up(vertical_line(x)), grid_line_color]~ - Inside source: true *** True Line Result - [958, 898, 64, 64], -** Processing line: ~ [911, 928, 64, 64],~ + outputs.lines << [scale_up(vertical_line(x)), grid_line_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [911, 928, 64, 64], -** Processing line: ~ [911, 896, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [911, 896, 64, 64], -** Processing line: ~ [2132, 803, 64, 64],~ + +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - [2132, 803, 64, 64], -** Processing line: ~ [2081, 803, 64, 64],~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << [scale_up(horizontal_line(y)), grid_line_color]~ - Inside source: true *** True Line Result - [2081, 803, 64, 64], -** Processing line: ~ [2131, 752, 64, 64],~ + outputs.lines << [scale_up(horizontal_line(y)), grid_line_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2131, 752, 64, 64], -** Processing line: ~ [2077, 751, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2077, 751, 64, 64], -** Processing line: ~ [2615, 649, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [2615, 649, 64, 64], -** Processing line: ~ [2564, 651, 64, 64],~ + +** Processing line: ~ # Easy way to get a vertical line given an index~ - Inside source: true *** True Line Result - [2564, 651, 64, 64], -** Processing line: ~ [2533, 650, 64, 64],~ + # Easy way to get a vertical line given an index +** Processing line: ~ def vertical_line column~ - Inside source: true *** True Line Result - [2533, 650, 64, 64], -** Processing line: ~ [2027, 156, 64, 64],~ + def vertical_line column +** Processing line: ~ [column, 0, column, grid.height]~ - Inside source: true *** True Line Result - [2027, 156, 64, 64], -** Processing line: ~ [1968, 155, 64, 64],~ + [column, 0, column, grid.height] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1968, 155, 64, 64], -** Processing line: ~ [1907, 153, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [1907, 153, 64, 64], -** Processing line: ~ [1873, 155, 64, 64],~ + +** Processing line: ~ # Easy way to get a horizontal line given an index~ - Inside source: true *** True Line Result - [1873, 155, 64, 64], -** Processing line: ~ [2025, 95, 64, 64],~ + # Easy way to get a horizontal line given an index +** Processing line: ~ def horizontal_line row~ - Inside source: true *** True Line Result - [2025, 95, 64, 64], -** Processing line: ~ [1953, 98, 64, 64],~ + def horizontal_line row +** Processing line: ~ [0, row, grid.width, row]~ - Inside source: true *** True Line Result - [1953, 98, 64, 64], -** Processing line: ~ [1894, 100, 64, 64],~ + [0, row, grid.width, row] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1894, 100, 64, 64], -** Processing line: ~ [1870, 100, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [1870, 100, 64, 64], -** Processing line: ~ [2029, 45, 64, 64],~ + +** Processing line: ~ # Draws the area that is going to be searched from~ - Inside source: true *** True Line Result - [2029, 45, 64, 64], -** Processing line: ~ [1971, 48, 64, 64],~ + # Draws the area that is going to be searched from +** Processing line: ~ # The frontier is the most outward parts of the search~ - Inside source: true *** True Line Result - [1971, 48, 64, 64], -** Processing line: ~ [1915, 47, 64, 64],~ + # The frontier is the most outward parts of the search +** Processing line: ~ def render_frontier~ - Inside source: true *** True Line Result - [1915, 47, 64, 64], -** Processing line: ~ [1873, 47, 64, 64],~ + def render_frontier +** Processing line: ~ state.frontier.each do |cell|~ - Inside source: true *** True Line Result - [1873, 47, 64, 64], -** Processing line: ~ [3956, 288, 64, 64],~ + state.frontier.each do |cell| +** Processing line: ~ outputs.solids << [scale_up(cell), frontier_color]~ - Inside source: true *** True Line Result - [3956, 288, 64, 64], -** Processing line: ~ [3954, 234, 64, 64],~ + outputs.solids << [scale_up(cell), frontier_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3954, 234, 64, 64], -** Processing line: ~ [4042, 190, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4042, 190, 64, 64], -** Processing line: ~ [3990, 190, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [3990, 190, 64, 64], -** Processing line: ~ [3958, 195, 64, 64],~ + +** Processing line: ~ # Draws the walls~ - Inside source: true *** True Line Result - [3958, 195, 64, 64], -** Processing line: ~ [3422, 709, 64, 64],~ + # Draws the walls +** Processing line: ~ def render_walls~ - Inside source: true *** True Line Result - [3422, 709, 64, 64], -** Processing line: ~ [3425, 686, 64, 64],~ + def render_walls +** Processing line: ~ state.walls.each_key do |wall|~ - Inside source: true *** True Line Result - [3425, 686, 64, 64], -** Processing line: ~ [3368, 709, 64, 64],~ + state.walls.each_key do |wall| +** Processing line: ~ outputs.solids << [scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - [3368, 709, 64, 64], -** Processing line: ~ [3364, 683, 64, 64],~ + outputs.solids << [scale_up(wall), wall_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3364, 683, 64, 64], -** Processing line: ~ [3312, 711, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3312, 711, 64, 64], -** Processing line: ~ [3307, 684, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [3307, 684, 64, 64], -** Processing line: ~ [3266, 712, 64, 64],~ + +** Processing line: ~ # Renders cells that have been searched in the appropriate color~ - Inside source: true *** True Line Result - [3266, 712, 64, 64], -** Processing line: ~ [3269, 681, 64, 64],~ + # Renders cells that have been searched in the appropriate color +** Processing line: ~ def render_visited~ - Inside source: true *** True Line Result - [3269, 681, 64, 64], -** Processing line: ~ [4384, 236, 64, 64],~ + def render_visited +** Processing line: ~ state.visited.each_key do |cell|~ - Inside source: true *** True Line Result - [4384, 236, 64, 64], -** Processing line: ~ [4320, 234, 64, 64],~ + state.visited.each_key do |cell| +** Processing line: ~ outputs.solids << [scale_up(cell), visited_color]~ - Inside source: true *** True Line Result - [4320, 234, 64, 64], -** Processing line: ~ [4257, 235, 64, 64],~ + outputs.solids << [scale_up(cell), visited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4257, 235, 64, 64], -** Processing line: ~ [4192, 234, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4192, 234, 64, 64], -** Processing line: ~ [4162, 234, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [4162, 234, 64, 64], -** Processing line: ~ [4269, 171, 64, 64],~ + +** Processing line: ~ # Renders the star~ - Inside source: true *** True Line Result - [4269, 171, 64, 64], -** Processing line: ~ [4267, 111, 64, 64],~ + # Renders the star +** Processing line: ~ def render_star~ - Inside source: true *** True Line Result - [4267, 111, 64, 64], -** Processing line: ~ [4266, 52, 64, 64],~ + def render_star +** Processing line: ~ outputs.sprites << [scale_up(state.star), 'star.png']~ - Inside source: true *** True Line Result - [4266, 52, 64, 64], -** Processing line: ~ [4580, 458, 64, 64],~ + outputs.sprites << [scale_up(state.star), 'star.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4580, 458, 64, 64], -** Processing line: ~ [4582, 396, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [4582, 396, 64, 64], -** Processing line: ~ [4582, 335, 64, 64],~ + +** Processing line: ~ # Cells have a number rendered in them based on when they were explored~ - Inside source: true *** True Line Result - [4582, 335, 64, 64], -** Processing line: ~ [4581, 275, 64, 64],~ + # Cells have a number rendered in them based on when they were explored +** Processing line: ~ # This is based off of their index in the cell_numbers array~ - Inside source: true *** True Line Result - [4581, 275, 64, 64], -** Processing line: ~ [4581, 215, 64, 64],~ + # This is based off of their index in the cell_numbers array +** Processing line: ~ # Cells are added to this array the same time they are added to the frontier array~ - Inside source: true *** True Line Result - [4581, 215, 64, 64], -** Processing line: ~ [4581, 152, 64, 64],~ + # Cells are added to this array the same time they are added to the frontier array +** Processing line: ~ def render_cell_numbers~ - Inside source: true *** True Line Result - [4581, 152, 64, 64], -** Processing line: ~ [4582, 89, 64, 64],~ + def render_cell_numbers +** Processing line: ~ state.cell_numbers.each_with_index do |cell, index|~ - Inside source: true *** True Line Result - [4582, 89, 64, 64], -** Processing line: ~ [4583, 51, 64, 64],~ + state.cell_numbers.each_with_index do |cell, index| +** Processing line: ~ # Math that approx centers the number in the cell~ - Inside source: true *** True Line Result - [4583, 51, 64, 64], -** Processing line: ~ [4810, 289, 64, 64],~ + # Math that approx centers the number in the cell +** Processing line: ~ label_x = (cell.x * grid.cell_size) + grid.cell_size / 2 - 5~ - Inside source: true *** True Line Result - [4810, 289, 64, 64], -** Processing line: ~ [4810, 227, 64, 64],~ + label_x = (cell.x * grid.cell_size) + grid.cell_size / 2 - 5 +** Processing line: ~ label_y = (cell.y * grid.cell_size) + (grid.cell_size / 2) + 5~ - Inside source: true *** True Line Result - [4810, 227, 64, 64], -** Processing line: ~ [4895, 189, 64, 64],~ + label_y = (cell.y * grid.cell_size) + (grid.cell_size / 2) + 5 +** Processing line: ~~ - Inside source: true *** True Line Result - [4895, 189, 64, 64], -** Processing line: ~ [4844, 191, 64, 64],~ + +** Processing line: ~ outputs.labels << [label_x, label_y, (index + 1).to_s]~ - Inside source: true *** True Line Result - [4844, 191, 64, 64], -** Processing line: ~ [4809, 191, 64, 64],~ + outputs.labels << [label_x, label_y, (index + 1).to_s] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4809, 191, 64, 64], -** Processing line: ~ [5235, 233, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5235, 233, 64, 64], -** Processing line: ~ [5176, 232, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [5176, 232, 64, 64], -** Processing line: ~ [5118, 230, 64, 64],~ + +** Processing line: ~ # The next frontier to be expanded is highlighted yellow~ - Inside source: true *** True Line Result - [5118, 230, 64, 64], -** Processing line: ~ [5060, 232, 64, 64],~ + # The next frontier to be expanded is highlighted yellow +** Processing line: ~ # Its adjacent non-wall neighbors have their border highlighted green~ - Inside source: true *** True Line Result - [5060, 232, 64, 64], -** Processing line: ~ [5015, 237, 64, 64],~ + # Its adjacent non-wall neighbors have their border highlighted green +** Processing line: ~ # This is to show the user how the search expands~ - Inside source: true *** True Line Result - [5015, 237, 64, 64], -** Processing line: ~ [5123, 171, 64, 64],~ + # This is to show the user how the search expands +** Processing line: ~ def render_highlights~ - Inside source: true *** True Line Result - [5123, 171, 64, 64], -** Processing line: ~ [5123, 114, 64, 64],~ + def render_highlights +** Processing line: ~ return if state.frontier.empty?~ - Inside source: true *** True Line Result - [5123, 114, 64, 64], -** Processing line: ~ [5121, 51, 64, 64],~ + return if state.frontier.empty? +** Processing line: ~~ - Inside source: true *** True Line Result - [5121, 51, 64, 64], -** Processing line: ~ [5523, 461, 64, 64],~ + +** Processing line: ~ # Highlight the next frontier to be expanded yellow~ - Inside source: true *** True Line Result - [5523, 461, 64, 64], -** Processing line: ~ [5123, 42, 64, 64],~ + # Highlight the next frontier to be expanded yellow +** Processing line: ~ next_frontier = state.frontier[0]~ - Inside source: true *** True Line Result - [5123, 42, 64, 64], -** Processing line: ~ [5525, 401, 64, 64],~ + next_frontier = state.frontier[0] +** Processing line: ~ outputs.solids << [scale_up(next_frontier), highlighter_yellow]~ - Inside source: true *** True Line Result - [5525, 401, 64, 64], -** Processing line: ~ [5525, 340, 64, 64],~ + outputs.solids << [scale_up(next_frontier), highlighter_yellow] +** Processing line: ~~ - Inside source: true *** True Line Result - [5525, 340, 64, 64], -** Processing line: ~ [5526, 273, 64, 64],~ + +** Processing line: ~ # Neighbors have a semi-transparent green layer over them~ - Inside source: true *** True Line Result - [5526, 273, 64, 64], -** Processing line: ~ [5527, 211, 64, 64],~ + # Neighbors have a semi-transparent green layer over them +** Processing line: ~ # Unless the neighbor is a wall~ - Inside source: true *** True Line Result - [5527, 211, 64, 64], -** Processing line: ~ [5525, 150, 64, 64],~ + # Unless the neighbor is a wall +** Processing line: ~ adjacent_neighbors(next_frontier).each do |neighbor|~ - Inside source: true *** True Line Result - [5525, 150, 64, 64], -** Processing line: ~ [5527, 84, 64, 64],~ + adjacent_neighbors(next_frontier).each do |neighbor| +** Processing line: ~ unless state.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - [5527, 84, 64, 64], -** Processing line: ~ [5524, 44, 64, 64],~ + unless state.walls.has_key?(neighbor) +** Processing line: ~ outputs.solids << [scale_up(neighbor), highlighter_green, 70]~ - Inside source: true *** True Line Result - [5524, 44, 64, 64], -** Processing line: ~ [5861, 288, 64, 64],~ + outputs.solids << [scale_up(neighbor), highlighter_green, 70] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5861, 288, 64, 64], -** Processing line: ~ [5861, 229, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5861, 229, 64, 64], -** Processing line: ~ [5945, 193, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5945, 193, 64, 64], -** Processing line: ~ [5904, 193, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [5904, 193, 64, 64], -** Processing line: ~ [5856, 194, 64, 64],~ + +** Processing line: ~~ - Inside source: true *** True Line Result - [5856, 194, 64, 64], -** Processing line: ~ [6542, 234, 64, 64],~ + +** Processing line: ~ # Cell Size is used when rendering to allow the grid to be scaled up or down~ - Inside source: true *** True Line Result - [6542, 234, 64, 64], -** Processing line: ~ [6478, 235, 64, 64],~ + # Cell Size is used when rendering to allow the grid to be scaled up or down +** Processing line: ~ # Cells in the frontier array and visited hash and walls hash are stored as x & y~ - Inside source: true *** True Line Result - [6478, 235, 64, 64], -** Processing line: ~ [6413, 238, 64, 64],~ + # Cells in the frontier array and visited hash and walls hash are stored as x & y +** Processing line: ~ # Scaling up cells and lines when rendering allows omitting of width and height~ - Inside source: true *** True Line Result - [6413, 238, 64, 64], -** Processing line: ~ [6348, 235, 64, 64],~ + # Scaling up cells and lines when rendering allows omitting of width and height +** Processing line: ~ def scale_up(cell)~ - Inside source: true *** True Line Result - [6348, 235, 64, 64], -** Processing line: ~ [6285, 236, 64, 64],~ + def scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ - Inside source: true *** True Line Result - [6285, 236, 64, 64], -** Processing line: ~ [6222, 235, 64, 64],~ + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ - Inside source: true *** True Line Result - [6222, 235, 64, 64], -** Processing line: ~ [6160, 235, 64, 64],~ + cell = cell.clone +** Processing line: ~~ - Inside source: true *** True Line Result - [6160, 235, 64, 64], -** Processing line: ~ [6097, 236, 64, 64],~ + +** Processing line: ~ # If cell is just an x and y coordinate~ - Inside source: true *** True Line Result - [6097, 236, 64, 64], -** Processing line: ~ [6069, 237, 64, 64],~ + # If cell is just an x and y coordinate +** Processing line: ~ if cell.size == 2~ - Inside source: true *** True Line Result - [6069, 237, 64, 64], -** Processing line: ~ [6321, 174, 64, 64],~ + if cell.size == 2 +** Processing line: ~ # Add a width and height of 1~ - Inside source: true *** True Line Result - [6321, 174, 64, 64], -** Processing line: ~ [6318, 111, 64, 64],~ + # Add a width and height of 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - [6318, 111, 64, 64], -** Processing line: ~ [6320, 49, 64, 64],~ + cell << 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - [6320, 49, 64, 64], -** Processing line: ~ [6753, 291, 64, 64],~ + cell << 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6753, 291, 64, 64], -** Processing line: ~ [6752, 227, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [6752, 227, 64, 64], -** Processing line: ~ [6753, 192, 64, 64],~ + +** Processing line: ~ # Scale all the values up~ - Inside source: true *** True Line Result - [6753, 192, 64, 64], -** Processing line: ~ [6692, 191, 64, 64],~ + # Scale all the values up +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ - Inside source: true *** True Line Result - [6692, 191, 64, 64], -** Processing line: ~ [6668, 193, 64, 64],~ + cell.map! { |value| value * grid.cell_size } +** Processing line: ~~ - Inside source: true *** True Line Result - [6668, 193, 64, 64], -** Processing line: ~ [6336, 604, 64, 64],~ + +** Processing line: ~ # Returns the scaled up cell~ - Inside source: true *** True Line Result - [6336, 604, 64, 64], -** Processing line: ~ [6309, 603, 64, 64],~ + # Returns the scaled up cell +** Processing line: ~ cell~ - Inside source: true *** True Line Result - [6309, 603, 64, 64], -** Processing line: ~ [7264, 461, 64, 64],~ + cell +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7264, 461, 64, 64], -** Processing line: ~ [7264, 395, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [7264, 395, 64, 64], -** Processing line: ~ [7264, 333, 64, 64],~ + +** Processing line: ~~ - Inside source: true *** True Line Result - [7264, 333, 64, 64], -** Processing line: ~ [7264, 270, 64, 64],~ + +** Processing line: ~ # This method processes user input every tick~ - Inside source: true *** True Line Result - [7264, 270, 64, 64], -** Processing line: ~ [7265, 207, 64, 64],~ + # This method processes user input every tick +** Processing line: ~ # This method allows the user to use the buttons, slider, and edit the grid~ - Inside source: true *** True Line Result - [7265, 207, 64, 64], -** Processing line: ~ [7266, 138, 64, 64],~ + # This method allows the user to use the buttons, slider, and edit the grid +** Processing line: ~ # There are 2 types of input:~ - Inside source: true *** True Line Result - [7266, 138, 64, 64], -** Processing line: ~ [7264, 78, 64, 64],~ + # There are 2 types of input: +** Processing line: ~ # Button Input~ - Inside source: true *** True Line Result - [7264, 78, 64, 64], -** Processing line: ~ [7266, 48, 64, 64],~ + # Button Input +** Processing line: ~ # Click and Drag Input~ - Inside source: true *** True Line Result - [7266, 48, 64, 64], -** Processing line: ~ [7582, 149, 64, 64],~ + # Click and Drag Input +** Processing line: ~ #~ - Inside source: true *** True Line Result - [7582, 149, 64, 64], -** Processing line: ~ [7524, 147, 64, 64],~ + # +** Processing line: ~ # Button Input is used for the backward step and forward step buttons~ - Inside source: true *** True Line Result - [7524, 147, 64, 64], -** Processing line: ~ [7461, 146, 64, 64],~ + # Button Input is used for the backward step and forward step buttons +** Processing line: ~ # Input is detected by mouse up within the bounds of the rect~ - Inside source: true *** True Line Result - [7461, 146, 64, 64], -** Processing line: ~ [7425, 148, 64, 64],~ + # Input is detected by mouse up within the bounds of the rect +** Processing line: ~ #~ - Inside source: true *** True Line Result - [7425, 148, 64, 64], -** Processing line: ~ [7580, 86, 64, 64],~ + # +** Processing line: ~ # Click and Drag Input is used for moving the star, adding walls,~ - Inside source: true *** True Line Result - [7580, 86, 64, 64], -** Processing line: ~ [7582, 41, 64, 64],~ + # Click and Drag Input is used for moving the star, adding walls, +** Processing line: ~ # removing walls, and the slider~ - Inside source: true *** True Line Result - [7582, 41, 64, 64], -** Processing line: ~ [7519, 41, 64, 64],~ + # removing walls, and the slider +** Processing line: ~ #~ - Inside source: true *** True Line Result - [7519, 41, 64, 64], -** Processing line: ~ [7460, 40, 64, 64],~ + # +** Processing line: ~ # When the mouse is down on the star, the click_and_drag variable is set to :star~ - Inside source: true *** True Line Result - [7460, 40, 64, 64], -** Processing line: ~ [7427, 96, 64, 64],~ + # When the mouse is down on the star, the click_and_drag variable is set to :star +** Processing line: ~ # While click_and_drag equals :star, the cursor's position is used to calculate the~ - Inside source: true *** True Line Result - [7427, 96, 64, 64], -** Processing line: ~ [7427, 41, 64, 64],~ + # While click_and_drag equals :star, the cursor's position is used to calculate the +** Processing line: ~ # appropriate drag behavior~ - Inside source: true *** True Line Result - [7427, 41, 64, 64], -** Processing line: ~ [8060, 288, 64, 64],~ + # appropriate drag behavior +** Processing line: ~ #~ - Inside source: true *** True Line Result - [8060, 288, 64, 64], -** Processing line: ~ [8059, 226, 64, 64],~ + # +** Processing line: ~ # When the mouse goes up click_and_drag is set to :none~ - Inside source: true *** True Line Result - [8059, 226, 64, 64], -** Processing line: ~ [8145, 194, 64, 64],~ + # When the mouse goes up click_and_drag is set to :none +** Processing line: ~ #~ - Inside source: true *** True Line Result - [8145, 194, 64, 64], -** Processing line: ~ [8081, 194, 64, 64],~ + # +** Processing line: ~ # A variable has to be used because the star has to continue being edited even~ - Inside source: true *** True Line Result - [8081, 194, 64, 64], -** Processing line: ~ [8058, 195, 64, 64],~ + # A variable has to be used because the star has to continue being edited even +** Processing line: ~ # when the cursor is no longer over the star~ - Inside source: true *** True Line Result - [8058, 195, 64, 64], -** Processing line: ~ [8485, 234, 64, 64],~ + # when the cursor is no longer over the star +** Processing line: ~ #~ - Inside source: true *** True Line Result - [8485, 234, 64, 64], -** Processing line: ~ [8422, 235, 64, 64],~ + # +** Processing line: ~ # Similar things occur for the other Click and Drag inputs~ - Inside source: true *** True Line Result - [8422, 235, 64, 64], -** Processing line: ~ [8360, 235, 64, 64],~ + # Similar things occur for the other Click and Drag inputs +** Processing line: ~ def input~ - Inside source: true *** True Line Result - [8360, 235, 64, 64], -** Processing line: ~ [8296, 235, 64, 64],~ + def input +** Processing line: ~ # Processes inputs for the buttons~ - Inside source: true *** True Line Result - [8296, 235, 64, 64], -** Processing line: ~ [8266, 237, 64, 64],~ + # Processes inputs for the buttons +** Processing line: ~ input_buttons~ - Inside source: true *** True Line Result - [8266, 237, 64, 64], -** Processing line: ~ [8371, 173, 64, 64],~ + input_buttons +** Processing line: ~~ - Inside source: true *** True Line Result - [8371, 173, 64, 64], -** Processing line: ~ [8370, 117, 64, 64],~ + +** Processing line: ~ # Detects which if any click and drag input is occurring~ - Inside source: true *** True Line Result - [8370, 117, 64, 64], -** Processing line: ~ [8372, 59, 64, 64],~ + # Detects which if any click and drag input is occurring +** Processing line: ~ detect_click_and_drag~ - Inside source: true *** True Line Result - [8372, 59, 64, 64], -** Processing line: ~ [8372, 51, 64, 64],~ + detect_click_and_drag +** Processing line: ~~ - Inside source: true *** True Line Result - [8372, 51, 64, 64], -** Processing line: ~ [9147, 192, 64, 64],~ + +** Processing line: ~ # Does the appropriate click and drag input based on the click_and_drag variable~ - Inside source: true *** True Line Result - [9147, 192, 64, 64], -** Processing line: ~ [9063, 287, 64, 64],~ + # Does the appropriate click and drag input based on the click_and_drag variable +** Processing line: ~ process_click_and_drag~ - Inside source: true *** True Line Result - [9063, 287, 64, 64], -** Processing line: ~ [9064, 225, 64, 64],~ + process_click_and_drag +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9064, 225, 64, 64], -** Processing line: ~ [9085, 193, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [9085, 193, 64, 64], -** Processing line: ~ [9063, 194, 64, 64],~ + +** Processing line: ~ # Detects and Process input for each button~ - Inside source: true *** True Line Result - [9063, 194, 64, 64], -** Processing line: ~ [9492, 234, 64, 64],~ + # Detects and Process input for each button +** Processing line: ~ def input_buttons~ - Inside source: true *** True Line Result - [9492, 234, 64, 64], -** Processing line: ~ [9428, 234, 64, 64],~ + def input_buttons +** Processing line: ~ input_left_button~ - Inside source: true *** True Line Result - [9428, 234, 64, 64], -** Processing line: ~ [9365, 235, 64, 64],~ + input_left_button +** Processing line: ~ input_right_button~ - Inside source: true *** True Line Result - [9365, 235, 64, 64], -** Processing line: ~ [9302, 235, 64, 64],~ + input_right_button +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9302, 235, 64, 64], -** Processing line: ~ [9270, 237, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [9270, 237, 64, 64], -** Processing line: ~ [9374, 172, 64, 64],~ + +** Processing line: ~ # Checks if the previous step button is clicked~ - Inside source: true *** True Line Result - [9374, 172, 64, 64], -** Processing line: ~ [9376, 109, 64, 64],~ + # Checks if the previous step button is clicked +** Processing line: ~ # If it is, it pauses the animation and moves the search one step backward~ - Inside source: true *** True Line Result - [9376, 109, 64, 64], -** Processing line: ~ [9377, 48, 64, 64],~ + # If it is, it pauses the animation and moves the search one step backward +** Processing line: ~ def input_left_button~ - Inside source: true *** True Line Result - [9377, 48, 64, 64], -** Processing line: ~ [9545, 1060, 64, 64],~ + def input_left_button +** Processing line: ~ if left_button_clicked?~ - Inside source: true *** True Line Result - [9545, 1060, 64, 64], -** Processing line: ~ [9482, 1062, 64, 64],~ + if left_button_clicked? +** Processing line: ~ unless state.anim_steps == 0~ - Inside source: true *** True Line Result - [9482, 1062, 64, 64], -** Processing line: ~ [9423, 1062, 64, 64],~ + unless state.anim_steps == 0 +** Processing line: ~ state.anim_steps -= 1~ - Inside source: true *** True Line Result - [9423, 1062, 64, 64], -** Processing line: ~ [9387, 1062, 64, 64],~ + state.anim_steps -= 1 +** Processing line: ~ recalculate~ - Inside source: true *** True Line Result - [9387, 1062, 64, 64], -** Processing line: ~ [9541, 999, 64, 64],~ + recalculate +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9541, 999, 64, 64], -** Processing line: ~ [9542, 953, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9542, 953, 64, 64], -** Processing line: ~ [9478, 953, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9478, 953, 64, 64], -** Processing line: ~ [9388, 999, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [9388, 999, 64, 64], -** Processing line: ~ [9414, 953, 64, 64],~ + +** Processing line: ~ # Checks if the next step button is clicked~ - Inside source: true *** True Line Result - [9414, 953, 64, 64], -** Processing line: ~ [9389, 953, 64, 64],~ + # Checks if the next step button is clicked +** Processing line: ~ # If it is, it pauses the animation and moves the search one step forward~ - Inside source: true *** True Line Result - [9389, 953, 64, 64], -** Processing line: ~ [9294, 1194, 64, 64],~ + # If it is, it pauses the animation and moves the search one step forward +** Processing line: ~ def input_right_button~ - Inside source: true *** True Line Result - [9294, 1194, 64, 64], -** Processing line: ~ [9245, 1195, 64, 64],~ + def input_right_button +** Processing line: ~ if right_button_clicked?~ - Inside source: true *** True Line Result - [9245, 1195, 64, 64], -** Processing line: ~ [9297, 1143, 64, 64],~ + if right_button_clicked? +** Processing line: ~ unless state.anim_steps == state.max_steps~ - Inside source: true *** True Line Result - [9297, 1143, 64, 64], -** Processing line: ~ [9245, 1144, 64, 64],~ + unless state.anim_steps == state.max_steps +** Processing line: ~ state.anim_steps += 1~ - Inside source: true *** True Line Result - [9245, 1144, 64, 64], -** Processing line: ~ [5575, 1781, 64, 64],~ + state.anim_steps += 1 +** Processing line: ~ # Although normally recalculate would be called here~ - Inside source: true *** True Line Result - [5575, 1781, 64, 64], -** Processing line: ~ [5574, 1753, 64, 64],~ + # Although normally recalculate would be called here +** Processing line: ~ # because the right button only moves the search forward~ - Inside source: true *** True Line Result - [5574, 1753, 64, 64], -** Processing line: ~ [5522, 1782, 64, 64],~ + # because the right button only moves the search forward +** Processing line: ~ # We can just do that~ - Inside source: true *** True Line Result - [5522, 1782, 64, 64], -** Processing line: ~ [5518, 1753, 64, 64],~ + # We can just do that +** Processing line: ~ calc~ - Inside source: true *** True Line Result - [5518, 1753, 64, 64], -** Processing line: ~ [5472, 1783, 64, 64],~ + calc +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5472, 1783, 64, 64], -** Processing line: ~ [5471, 1751, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5471, 1751, 64, 64], -** Processing line: ~ [5419, 1781, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5419, 1781, 64, 64], -** Processing line: ~ [5421, 1749, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [5421, 1749, 64, 64], -** Processing line: ~ [500, 3207, 64, 64],~ + +** Processing line: ~ # Whenever the user edits the grid,~ - Inside source: true *** True Line Result - [500, 3207, 64, 64], -** Processing line: ~ [477, 3205, 64, 64],~ + # Whenever the user edits the grid, +** Processing line: ~ # The search has to be recalculated upto the current step~ - Inside source: true *** True Line Result - [477, 3205, 64, 64], -** Processing line: ~ [1282, 3214, 64, 64],~ + # The search has to be recalculated upto the current step +** Processing line: ~~ - Inside source: true *** True Line Result - [1282, 3214, 64, 64], -** Processing line: ~ [1221, 3214, 64, 64],~ + +** Processing line: ~ def recalculate~ - Inside source: true *** True Line Result - [1221, 3214, 64, 64], -** Processing line: ~ [1188, 3215, 64, 64],~ + def recalculate +** Processing line: ~ # Resets the search~ - Inside source: true *** True Line Result - [1188, 3215, 64, 64], -** Processing line: ~ [1345, 3103, 64, 64],~ + # Resets the search +** Processing line: ~ state.frontier = []~ - Inside source: true *** True Line Result - [1345, 3103, 64, 64], -** Processing line: ~ [1288, 3103, 64, 64],~ + state.frontier = [] +** Processing line: ~ state.visited = {}~ - Inside source: true *** True Line Result - [1288, 3103, 64, 64], -** Processing line: ~ [1231, 3104, 64, 64],~ + state.visited = {} +** Processing line: ~ state.cell_numbers = []~ - Inside source: true *** True Line Result - [1231, 3104, 64, 64], -** Processing line: ~ [1190, 3153, 64, 64],~ + state.cell_numbers = [] +** Processing line: ~~ - Inside source: true *** True Line Result - [1190, 3153, 64, 64], -** Processing line: ~ [1189, 3105, 64, 64],~ + +** Processing line: ~ # Moves the animation forward one step at a time~ - Inside source: true *** True Line Result - [1189, 3105, 64, 64], -** Processing line: ~ [2255, 3508, 64, 64],~ + # Moves the animation forward one step at a time +** Processing line: ~ state.anim_steps.times { calc }~ - Inside source: true *** True Line Result - [2255, 3508, 64, 64], -** Processing line: ~ [2206, 3510, 64, 64],~ + state.anim_steps.times { calc } +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2206, 3510, 64, 64], -** Processing line: ~ [2254, 3458, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [2254, 3458, 64, 64], -** Processing line: ~ [2202, 3458, 64, 64],~ + +** Processing line: ~~ - Inside source: true *** True Line Result - [2202, 3458, 64, 64], -** Processing line: ~ [2754, 2930, 64, 64],~ + +** Processing line: ~ # Determines what the user is clicking and planning on dragging~ - Inside source: true *** True Line Result - [2754, 2930, 64, 64], -** Processing line: ~ [2726, 2932, 64, 64],~ + # Determines what the user is clicking and planning on dragging +** Processing line: ~ # Click and drag input is initiated by a click on the appropriate item~ - Inside source: true *** True Line Result - [2726, 2932, 64, 64], -** Processing line: ~ [3408, 2874, 64, 64],~ + # Click and drag input is initiated by a click on the appropriate item +** Processing line: ~ # and ended by mouse up~ - Inside source: true *** True Line Result - [3408, 2874, 64, 64], -** Processing line: ~ [3407, 2849, 64, 64],~ + # and ended by mouse up +** Processing line: ~ # Storing the value allows the user to continue the same edit as long as the~ - Inside source: true *** True Line Result - [3407, 2849, 64, 64], -** Processing line: ~ [3345, 2872, 64, 64],~ + # Storing the value allows the user to continue the same edit as long as the +** Processing line: ~ # mouse left click is held~ - Inside source: true *** True Line Result - [3345, 2872, 64, 64], -** Processing line: ~ [3342, 2847, 64, 64],~ + # mouse left click is held +** Processing line: ~ def detect_click_and_drag~ - Inside source: true *** True Line Result - [3342, 2847, 64, 64], -** Processing line: ~ [3284, 2874, 64, 64],~ + def detect_click_and_drag +** Processing line: ~ if inputs.mouse.up~ - Inside source: true *** True Line Result - [3284, 2874, 64, 64], -** Processing line: ~ [3284, 2848, 64, 64],~ + if inputs.mouse.up +** Processing line: ~ state.click_and_drag = :none~ - Inside source: true *** True Line Result - [3284, 2848, 64, 64], -** Processing line: ~ [3248, 2878, 64, 64],~ + state.click_and_drag = :none +** Processing line: ~ elsif star_clicked?~ - Inside source: true *** True Line Result - [3248, 2878, 64, 64], -** Processing line: ~ [3252, 2848, 64, 64],~ + elsif star_clicked? +** Processing line: ~ state.click_and_drag = :star~ - Inside source: true *** True Line Result - [3252, 2848, 64, 64], -** Processing line: ~ [3953, 3274, 64, 64],~ + state.click_and_drag = :star +** Processing line: ~ elsif wall_clicked?~ - Inside source: true *** True Line Result - [3953, 3274, 64, 64], -** Processing line: ~ [3899, 3277, 64, 64],~ + elsif wall_clicked? +** Processing line: ~ state.click_and_drag = :remove_wall~ - Inside source: true *** True Line Result - [3899, 3277, 64, 64], -** Processing line: ~ [3951, 3222, 64, 64],~ + state.click_and_drag = :remove_wall +** Processing line: ~ elsif grid_clicked?~ - Inside source: true *** True Line Result - [3951, 3222, 64, 64], -** Processing line: ~ [3900, 3222, 64, 64],~ + elsif grid_clicked? +** Processing line: ~ state.click_and_drag = :add_wall~ - Inside source: true *** True Line Result - [3900, 3222, 64, 64], -** Processing line: ~ [4310, 2968, 64, 64],~ + state.click_and_drag = :add_wall +** Processing line: ~ elsif slider_clicked?~ - Inside source: true *** True Line Result - [4310, 2968, 64, 64], -** Processing line: ~ [4246, 2969, 64, 64],~ + elsif slider_clicked? +** Processing line: ~ state.click_and_drag = :slider~ - Inside source: true *** True Line Result - [4246, 2969, 64, 64], -** Processing line: ~ [4183, 2965, 64, 64],~ + state.click_and_drag = :slider +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4183, 2965, 64, 64], -** Processing line: ~ [4153, 2967, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4153, 2967, 64, 64], -** Processing line: ~ [4311, 2910, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [4311, 2910, 64, 64], -** Processing line: ~ [4308, 2856, 64, 64],~ + +** Processing line: ~ # Processes input based on what the user is currently dragging~ - Inside source: true *** True Line Result - [4308, 2856, 64, 64], -** Processing line: ~ [4251, 2855, 64, 64],~ + # Processes input based on what the user is currently dragging +** Processing line: ~ def process_click_and_drag~ - Inside source: true *** True Line Result - [4251, 2855, 64, 64], -** Processing line: ~ [4197, 2857, 64, 64],~ + def process_click_and_drag +** Processing line: ~ if state.click_and_drag == :slider~ - Inside source: true *** True Line Result - [4197, 2857, 64, 64], -** Processing line: ~ [5466, 3184, 64, 64],~ + if state.click_and_drag == :slider +** Processing line: ~ input_slider~ - Inside source: true *** True Line Result - [5466, 3184, 64, 64], -** Processing line: ~ [5466, 3158, 64, 64],~ + input_slider +** Processing line: ~ elsif state.click_and_drag == :star~ - Inside source: true *** True Line Result - [5466, 3158, 64, 64], -** Processing line: ~ [5404, 3184, 64, 64],~ + elsif state.click_and_drag == :star +** Processing line: ~ input_star~ - Inside source: true *** True Line Result - [5404, 3184, 64, 64], -** Processing line: ~ [5404, 3156, 64, 64],~ + input_star +** Processing line: ~ elsif state.click_and_drag == :remove_wall~ - Inside source: true *** True Line Result - [5404, 3156, 64, 64], -** Processing line: ~ [5343, 3185, 64, 64],~ + elsif state.click_and_drag == :remove_wall +** Processing line: ~ input_remove_wall~ - Inside source: true *** True Line Result - [5343, 3185, 64, 64], -** Processing line: ~ [5342, 3156, 64, 64],~ + input_remove_wall +** Processing line: ~ elsif state.click_and_drag == :add_wall~ - Inside source: true *** True Line Result - [5342, 3156, 64, 64], -** Processing line: ~ [5308, 3185, 64, 64],~ + elsif state.click_and_drag == :add_wall +** Processing line: ~ input_add_wall~ - Inside source: true *** True Line Result - [5308, 3185, 64, 64], -** Processing line: ~ [5307, 3154, 64, 64],~ + input_add_wall +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5307, 3154, 64, 64], -** Processing line: ~ [6163, 2950, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6163, 2950, 64, 64], -** Processing line: ~ [6111, 2952, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [6111, 2952, 64, 64], -** Processing line: ~ [6164, 2898, 64, 64],~ + +** Processing line: ~ # This method is called when the user is dragging the slider~ - Inside source: true *** True Line Result - [6164, 2898, 64, 64], -** Processing line: ~ [6113, 2897, 64, 64],~ + # This method is called when the user is dragging the slider +** Processing line: ~ # It moves the current animation step to the point represented by the slider~ - Inside source: true *** True Line Result - [6113, 2897, 64, 64], -** Processing line: ~ [7725, 3156, 64, 64],~ + # It moves the current animation step to the point represented by the slider +** Processing line: ~ def input_slider~ - Inside source: true *** True Line Result - [7725, 3156, 64, 64], -** Processing line: ~ [7661, 3157, 64, 64],~ + def input_slider +** Processing line: ~ mouse_x = inputs.mouse.point.x~ - Inside source: true *** True Line Result - [7661, 3157, 64, 64], -** Processing line: ~ [7598, 3157, 64, 64],~ + mouse_x = inputs.mouse.point.x +** Processing line: ~~ - Inside source: true *** True Line Result - [7598, 3157, 64, 64], -** Processing line: ~ [7533, 3156, 64, 64],~ + +** Processing line: ~ # Bounds the mouse_x to the closest x value on the slider line~ - Inside source: true *** True Line Result - [7533, 3156, 64, 64], -** Processing line: ~ [7468, 3156, 64, 64],~ + # Bounds the mouse_x to the closest x value on the slider line +** Processing line: ~ mouse_x = slider.x if mouse_x < slider.x~ - Inside source: true *** True Line Result - [7468, 3156, 64, 64], -** Processing line: ~ [7401, 3156, 64, 64],~ + mouse_x = slider.x if mouse_x < slider.x +** Processing line: ~ mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w~ - Inside source: true *** True Line Result - [7401, 3156, 64, 64], -** Processing line: ~ [7335, 3157, 64, 64],~ + mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w +** Processing line: ~~ - Inside source: true *** True Line Result - [7335, 3157, 64, 64], -** Processing line: ~ [7270, 3157, 64, 64],~ + +** Processing line: ~ # Sets the current search step to the one represented by the mouse x value~ - Inside source: true *** True Line Result - [7270, 3157, 64, 64], -** Processing line: ~ [7208, 3157, 64, 64],~ + # Sets the current search step to the one represented by the mouse x value +** Processing line: ~ # The slider's circle moves due to the render_slider method using anim_steps~ - Inside source: true *** True Line Result - [7208, 3157, 64, 64], -** Processing line: ~ [7146, 3157, 64, 64],~ + # The slider's circle moves due to the render_slider method using anim_steps +** Processing line: ~ state.anim_steps = ((mouse_x - slider.x) / slider.spacing).to_i~ - Inside source: true *** True Line Result - [7146, 3157, 64, 64], -** Processing line: ~ [7134, 3159, 64, 64],~ + state.anim_steps = ((mouse_x - slider.x) / slider.spacing).to_i +** Processing line: ~~ - Inside source: true *** True Line Result - [7134, 3159, 64, 64], -** Processing line: ~ [6685, 3726, 64, 64],~ + +** Processing line: ~ recalculate~ - Inside source: true *** True Line Result - [6685, 3726, 64, 64], -** Processing line: ~ [6685, 3663, 64, 64],~ + recalculate +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6685, 3663, 64, 64], -** Processing line: ~ [6683, 3602, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [6683, 3602, 64, 64], -** Processing line: ~ [6679, 3538, 64, 64],~ + +** Processing line: ~ # Moves the star to the grid closest to the mouse~ - Inside source: true *** True Line Result - [6679, 3538, 64, 64], -** Processing line: ~ [6680, 3474, 64, 64],~ + # Moves the star to the grid closest to the mouse +** Processing line: ~ # Only recalculates the search if the star changes position~ - Inside source: true *** True Line Result - [6680, 3474, 64, 64], -** Processing line: ~ [6682, 3413, 64, 64],~ + # Only recalculates the search if the star changes position +** Processing line: ~ # Called whenever the user is dragging the star~ - Inside source: true *** True Line Result - [6682, 3413, 64, 64], -** Processing line: ~ [6681, 3347, 64, 64],~ + # Called whenever the user is dragging the star +** Processing line: ~ def input_star~ - Inside source: true *** True Line Result - [6681, 3347, 64, 64], -** Processing line: ~ [6681, 3287, 64, 64],~ + def input_star +** Processing line: ~ old_star = state.star.clone~ - Inside source: true *** True Line Result - [6681, 3287, 64, 64], -** Processing line: ~ [6682, 3223, 64, 64],~ + old_star = state.star.clone +** Processing line: ~ state.star = cell_closest_to_mouse~ - Inside source: true *** True Line Result - [6682, 3223, 64, 64], -** Processing line: ~ [6683, 3161, 64, 64],~ + state.star = cell_closest_to_mouse +** Processing line: ~ unless old_star == state.star~ - Inside source: true *** True Line Result - [6683, 3161, 64, 64], -** Processing line: ~ [6682, 3102, 64, 64],~ + unless old_star == state.star +** Processing line: ~ recalculate~ - Inside source: true *** True Line Result - [6682, 3102, 64, 64], -** Processing line: ~ [6684, 3042, 64, 64],~ + recalculate +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6684, 3042, 64, 64], -** Processing line: ~ [6685, 2980, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6685, 2980, 64, 64], -** Processing line: ~ [6685, 2920, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [6685, 2920, 64, 64], -** Processing line: ~ [6683, 2859, 64, 64],~ + +** Processing line: ~ # Removes walls that are under the cursor~ - Inside source: true *** True Line Result - [6683, 2859, 64, 64], -** Processing line: ~ [6684, 2801, 64, 64],~ + # Removes walls that are under the cursor +** Processing line: ~ def input_remove_wall~ - Inside source: true *** True Line Result - [6684, 2801, 64, 64], -** Processing line: ~ [6686, 2743, 64, 64],~ + def input_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - [6686, 2743, 64, 64], -** Processing line: ~ [6683, 2683, 64, 64],~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - [6683, 2683, 64, 64], -** Processing line: ~ [6681, 2622, 64, 64],~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - [6681, 2622, 64, 64], -** Processing line: ~ [6682, 2559, 64, 64],~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if mouse_inside_grid?~ - Inside source: true *** True Line Result - [6682, 2559, 64, 64], -** Processing line: ~ [6683, 2498, 64, 64],~ + if mouse_inside_grid? +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - [6683, 2498, 64, 64], -** Processing line: ~ [6685, 2434, 64, 64],~ + if state.walls.has_key?(cell_closest_to_mouse) +** Processing line: ~ state.walls.delete(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - [6685, 2434, 64, 64], -** Processing line: ~ [6683, 2371, 64, 64],~ + state.walls.delete(cell_closest_to_mouse) +** Processing line: ~ recalculate~ - Inside source: true *** True Line Result - [6683, 2371, 64, 64], -** Processing line: ~ [6683, 2306, 64, 64],~ + recalculate +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6683, 2306, 64, 64], -** Processing line: ~ [6684, 2242, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6684, 2242, 64, 64], -** Processing line: ~ [6683, 2177, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6683, 2177, 64, 64], -** Processing line: ~ [6683, 2112, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [6683, 2112, 64, 64], -** Processing line: ~ [6683, 2049, 64, 64],~ + +** Processing line: ~ # Adds walls at cells under the cursor~ - Inside source: true *** True Line Result - [6683, 2049, 64, 64], -** Processing line: ~ [6683, 1985, 64, 64],~ + # Adds walls at cells under the cursor +** Processing line: ~ def input_add_wall~ - Inside source: true *** True Line Result - [6683, 1985, 64, 64], -** Processing line: ~ [6682, 1923, 64, 64],~ + def input_add_wall +** Processing line: ~ # Adds a wall to the hash~ - Inside source: true *** True Line Result - [6682, 1923, 64, 64], -** Processing line: ~ [6683, 1860, 64, 64],~ + # Adds a wall to the hash +** Processing line: ~ # We can use the grid closest to mouse, because the cursor is inside the grid~ - Inside source: true *** True Line Result - [6683, 1860, 64, 64], -** Processing line: ~ [6685, 1797, 64, 64],~ + # We can use the grid closest to mouse, because the cursor is inside the grid +** Processing line: ~ if mouse_inside_grid?~ - Inside source: true *** True Line Result - [6685, 1797, 64, 64], -** Processing line: ~ [6684, 1735, 64, 64],~ + if mouse_inside_grid? +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - [6684, 1735, 64, 64], -** Processing line: ~ [6685, 1724, 64, 64],~ + unless state.walls.has_key?(cell_closest_to_mouse) +** Processing line: ~ state.walls[cell_closest_to_mouse] = true~ - Inside source: true *** True Line Result - [6685, 1724, 64, 64], -** Processing line: ~ [7088, 1967, 64, 64],~ + state.walls[cell_closest_to_mouse] = true +** Processing line: ~ recalculate~ - Inside source: true *** True Line Result - [7088, 1967, 64, 64], -** Processing line: ~ [7026, 1966, 64, 64],~ + recalculate +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7026, 1966, 64, 64], -** Processing line: ~ [6964, 1967, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6964, 1967, 64, 64], -** Processing line: ~ [6900, 1965, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6900, 1965, 64, 64], -** Processing line: ~ [6869, 1969, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [6869, 1969, 64, 64], -** Processing line: ~ [6972, 1904, 64, 64],~ + +** Processing line: ~ # This method moves the search forward one step~ - Inside source: true *** True Line Result - [6972, 1904, 64, 64], -** Processing line: ~ [6974, 1840, 64, 64],~ + # This method moves the search forward one step +** Processing line: ~ # When the animation is playing it is called every tick~ - Inside source: true *** True Line Result - [6974, 1840, 64, 64], -** Processing line: ~ [6971, 1776, 64, 64],~ + # When the animation is playing it is called every tick +** Processing line: ~ # And called whenever the current step of the animation needs to be recalculated~ - Inside source: true *** True Line Result - [6971, 1776, 64, 64], -** Processing line: ~ [6971, 1716, 64, 64],~ + # And called whenever the current step of the animation needs to be recalculated +** Processing line: ~~ - Inside source: true *** True Line Result - [6971, 1716, 64, 64], -** Processing line: ~ [7168, 1979, 64, 64],~ + +** Processing line: ~ # Moves the search forward one step~ - Inside source: true *** True Line Result - [7168, 1979, 64, 64], -** Processing line: ~ [7170, 1919, 64, 64],~ + # Moves the search forward one step +** Processing line: ~ # Parameter called_from_tick is true if it is called from the tick method~ - Inside source: true *** True Line Result - [7170, 1919, 64, 64], -** Processing line: ~ [7169, 1882, 64, 64],~ + # Parameter called_from_tick is true if it is called from the tick method +** Processing line: ~ # It is false when the search is being recalculated after user editing the grid~ - Inside source: true *** True Line Result - [7169, 1882, 64, 64], -** Processing line: ~ [7115, 1880, 64, 64],~ + # It is false when the search is being recalculated after user editing the grid +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - [7115, 1880, 64, 64], -** Processing line: ~ [7086, 1881, 64, 64],~ + def calc +** Processing line: ~ # The setup to the search~ - Inside source: true *** True Line Result - [7086, 1881, 64, 64], -** Processing line: ~ [7725, 1837, 64, 64],~ + # The setup to the search +** Processing line: ~ # Runs once when the there is no frontier or visited cells~ - Inside source: true *** True Line Result - [7725, 1837, 64, 64], -** Processing line: ~ [7724, 1776, 64, 64],~ + # Runs once when the there is no frontier or visited cells +** Processing line: ~ if state.frontier.empty? && state.visited.empty?~ - Inside source: true *** True Line Result - [7724, 1776, 64, 64], -** Processing line: ~ [7724, 1728, 64, 64],~ + if state.frontier.empty? && state.visited.empty? +** Processing line: ~ state.frontier << state.star~ - Inside source: true *** True Line Result - [7724, 1728, 64, 64], -** Processing line: ~ [7661, 1727, 64, 64],~ + state.frontier << state.star +** Processing line: ~ state.visited[state.star] = true~ - Inside source: true *** True Line Result - [7661, 1727, 64, 64], -** Processing line: ~ [7603, 1728, 64, 64],~ + state.visited[state.star] = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7603, 1728, 64, 64], -** Processing line: ~ [7571, 1837, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [7571, 1837, 64, 64], -** Processing line: ~ [7570, 1774, 64, 64],~ + +** Processing line: ~ # A step in the search~ - Inside source: true *** True Line Result - [7570, 1774, 64, 64], -** Processing line: ~ [7572, 1725, 64, 64],~ + # A step in the search +** Processing line: ~ unless state.frontier.empty?~ - Inside source: true *** True Line Result - [7572, 1725, 64, 64], -** Processing line: ~ [7859, 2134, 64, 64],~ + unless state.frontier.empty? +** Processing line: ~ # Takes the next frontier cell~ - Inside source: true *** True Line Result - [7859, 2134, 64, 64], -** Processing line: ~ [7858, 2070, 64, 64],~ + # Takes the next frontier cell +** Processing line: ~ new_frontier = state.frontier.shift~ - Inside source: true *** True Line Result - [7858, 2070, 64, 64], -** Processing line: ~ [7858, 2008, 64, 64],~ + new_frontier = state.frontier.shift +** Processing line: ~ # For each of its neighbors~ - Inside source: true *** True Line Result - [7858, 2008, 64, 64], -** Processing line: ~ [7860, 1942, 64, 64],~ + # For each of its neighbors +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ - Inside source: true *** True Line Result - [7860, 1942, 64, 64], -** Processing line: ~ [7856, 1878, 64, 64],~ + adjacent_neighbors(new_frontier).each do |neighbor| +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - [7856, 1878, 64, 64], -** Processing line: ~ [7860, 1813, 64, 64],~ + # That have not been visited and are not walls +** Processing line: ~ unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - [7860, 1813, 64, 64], -** Processing line: ~ [7859, 1750, 64, 64],~ + unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited~ - Inside source: true *** True Line Result - [7859, 1750, 64, 64], -** Processing line: ~ [7856, 1724, 64, 64],~ + # Add them to the frontier and mark them as visited +** Processing line: ~ state.frontier << neighbor~ - Inside source: true *** True Line Result - [7856, 1724, 64, 64], -** Processing line: ~ [8155, 1837, 64, 64],~ + state.frontier << neighbor +** Processing line: ~ state.visited[neighbor] = true~ - Inside source: true *** True Line Result - [8155, 1837, 64, 64], -** Processing line: ~ [8092, 1839, 64, 64],~ + state.visited[neighbor] = true +** Processing line: ~~ - Inside source: true *** True Line Result - [8092, 1839, 64, 64], -** Processing line: ~ [8032, 1838, 64, 64],~ + +** Processing line: ~ # Also assign them a frontier number~ - Inside source: true *** True Line Result - [8032, 1838, 64, 64], -** Processing line: ~ [7999, 1839, 64, 64],~ + # Also assign them a frontier number +** Processing line: ~ state.cell_numbers << neighbor~ - Inside source: true *** True Line Result - [7999, 1839, 64, 64], -** Processing line: ~ [8153, 1773, 64, 64],~ + state.cell_numbers << neighbor +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8153, 1773, 64, 64], -** Processing line: ~ [8154, 1731, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8154, 1731, 64, 64], -** Processing line: ~ [8090, 1730, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8090, 1730, 64, 64], -** Processing line: ~ [8035, 1732, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8035, 1732, 64, 64], -** Processing line: ~ [8003, 1776, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [8003, 1776, 64, 64], -** Processing line: ~ [8003, 1730, 64, 64],~ + +** Processing line: ~~ - Inside source: true *** True Line Result - [8003, 1730, 64, 64], -** Processing line: ~ [8421, 1978, 64, 64],~ + +** Processing line: ~ # Returns a list of adjacent cells~ - Inside source: true *** True Line Result - [8421, 1978, 64, 64], -** Processing line: ~ [8420, 1917, 64, 64],~ + # Returns a list of adjacent cells +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ - Inside source: true *** True Line Result - [8420, 1917, 64, 64], -** Processing line: ~ [8505, 1878, 64, 64],~ + # Used to determine what the next cells to be added to the frontier are +** Processing line: ~ def adjacent_neighbors cell~ - Inside source: true *** True Line Result - [8505, 1878, 64, 64], -** Processing line: ~ [8443, 1881, 64, 64],~ + def adjacent_neighbors cell +** Processing line: ~ neighbors = []~ - Inside source: true *** True Line Result - [8443, 1881, 64, 64], -** Processing line: ~ [8420, 1882, 64, 64],~ + neighbors = [] +** Processing line: ~~ - Inside source: true *** True Line Result - [8420, 1882, 64, 64], -** Processing line: ~ [8847, 1908, 64, 64],~ + +** Processing line: ~ neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1~ - Inside source: true *** True Line Result - [8847, 1908, 64, 64], -** Processing line: ~ [8783, 1908, 64, 64],~ + neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1 +** Processing line: ~ neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1~ - Inside source: true *** True Line Result - [8783, 1908, 64, 64], -** Processing line: ~ [8718, 1910, 64, 64],~ + neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1 +** Processing line: ~ neighbors << [cell.x, cell.y - 1] unless cell.y == 0~ - Inside source: true *** True Line Result - [8718, 1910, 64, 64], -** Processing line: ~ [8654, 1910, 64, 64],~ + neighbors << [cell.x, cell.y - 1] unless cell.y == 0 +** Processing line: ~ neighbors << [cell.x - 1, cell.y] unless cell.x == 0~ - Inside source: true *** True Line Result - [8654, 1910, 64, 64], -** Processing line: ~ [8628, 1911, 64, 64],~ + neighbors << [cell.x - 1, cell.y] unless cell.x == 0 +** Processing line: ~~ - Inside source: true *** True Line Result - [8628, 1911, 64, 64], -** Processing line: ~ [8729, 1847, 64, 64],~ + +** Processing line: ~ neighbors~ - Inside source: true *** True Line Result - [8729, 1847, 64, 64], -** Processing line: ~ [8731, 1781, 64, 64],~ + neighbors +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8731, 1781, 64, 64], -** Processing line: ~ [8731, 1721, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [8731, 1721, 64, 64], -** Processing line: ~ [9058, 2135, 64, 64],~ + +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - [9058, 2135, 64, 64], -** Processing line: ~ [9056, 2073, 64, 64],~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - [9056, 2073, 64, 64], -** Processing line: ~ [9058, 2006, 64, 64],~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the grid closest to the mouse helps with this~ - Inside source: true *** True Line Result - [9058, 2006, 64, 64], -** Processing line: ~ [9057, 1939, 64, 64],~ + # Finding the grid closest to the mouse helps with this +** Processing line: ~ def cell_closest_to_mouse~ - Inside source: true *** True Line Result - [9057, 1939, 64, 64], -** Processing line: ~ [9058, 1876, 64, 64],~ + def cell_closest_to_mouse +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - [9058, 1876, 64, 64], -** Processing line: ~ [9056, 1810, 64, 64],~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - [9056, 1810, 64, 64], -** Processing line: ~ [9059, 1745, 64, 64],~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - [9059, 1745, 64, 64], -** Processing line: ~ [9060, 1722, 64, 64],~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - [9060, 1722, 64, 64], -** Processing line: ~ [9273, 1977, 64, 64],~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - [9273, 1977, 64, 64], -** Processing line: ~ [9273, 1912, 64, 64],~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9273, 1912, 64, 64], -** Processing line: ~ [9358, 1883, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [9358, 1883, 64, 64], -** Processing line: ~ [9298, 1881, 64, 64],~ + +** Processing line: ~~ - Inside source: true *** True Line Result - [9298, 1881, 64, 64], -** Processing line: ~ [9270, 1883, 64, 64],~ + +** Processing line: ~ # These methods detect when the buttons are clicked~ - Inside source: true *** True Line Result - [9270, 1883, 64, 64], -** Processing line: ~ [9699, 1910, 64, 64],~ + # These methods detect when the buttons are clicked +** Processing line: ~ def left_button_clicked?~ - Inside source: true *** True Line Result - [9699, 1910, 64, 64], -** Processing line: ~ [9637, 1910, 64, 64],~ + def left_button_clicked? +** Processing line: ~ (inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.left)) || inputs.keyboard.key_up.left~ - Inside source: true *** True Line Result - [9637, 1910, 64, 64], -** Processing line: ~ [9576, 1910, 64, 64],~ + (inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.left)) || inputs.keyboard.key_up.left +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9576, 1910, 64, 64], -** Processing line: ~ [9512, 1911, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [9512, 1911, 64, 64], -** Processing line: ~ [9477, 1912, 64, 64],~ + +** Processing line: ~ def right_button_clicked?~ - Inside source: true *** True Line Result - [9477, 1912, 64, 64], -** Processing line: ~ [9584, 1846, 64, 64],~ + def right_button_clicked? +** Processing line: ~ (inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.right)) || inputs.keyboard.key_up.right~ - Inside source: true *** True Line Result - [9584, 1846, 64, 64], -** Processing line: ~ [9585, 1783, 64, 64],~ + (inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.right)) || inputs.keyboard.key_up.right +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9585, 1783, 64, 64], -** Processing line: ~ [9586, 1719, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [9586, 1719, 64, 64], -** Processing line: ~ [8320, 2788, 64, 64],~ + +** Processing line: ~ # Signal that the user is going to be moving the slider~ - Inside source: true *** True Line Result - [8320, 2788, 64, 64], -** Processing line: ~ [8256, 2789, 64, 64],~ + # Signal that the user is going to be moving the slider +** Processing line: ~ def slider_clicked?~ - Inside source: true *** True Line Result - [8256, 2789, 64, 64], -** Processing line: ~ [8192, 2789, 64, 64],~ + def slider_clicked? +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing)~ - Inside source: true *** True Line Result - [8192, 2789, 64, 64], -** Processing line: ~ [8180, 2789, 64, 64],~ + circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing) +** Processing line: ~ circle_y = (slider.y - slider.offset)~ - Inside source: true *** True Line Result - [8180, 2789, 64, 64], -** Processing line: ~ [8319, 2730, 64, 64],~ + circle_y = (slider.y - slider.offset) +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ - Inside source: true *** True Line Result - [8319, 2730, 64, 64], -** Processing line: ~ [8319, 2671, 64, 64],~ + circle_rect = [circle_x, circle_y, 37, 37] +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(circle_rect)~ - Inside source: true *** True Line Result - [8319, 2671, 64, 64], -** Processing line: ~ [8319, 2639, 64, 64],~ + inputs.mouse.down && inputs.mouse.point.inside_rect?(circle_rect) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8319, 2639, 64, 64], -** Processing line: ~ [8259, 2639, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [8259, 2639, 64, 64], -** Processing line: ~ [8202, 2639, 64, 64],~ + +** Processing line: ~ # Signal that the user is going to be moving the star~ - Inside source: true *** True Line Result - [8202, 2639, 64, 64], -** Processing line: ~ [8179, 2727, 64, 64],~ + # Signal that the user is going to be moving the star +** Processing line: ~ def star_clicked?~ - Inside source: true *** True Line Result - [8179, 2727, 64, 64], -** Processing line: ~ [8178, 2665, 64, 64],~ + def star_clicked? +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star))~ - Inside source: true *** True Line Result - [8178, 2665, 64, 64], -** Processing line: ~ [8177, 2636, 64, 64],~ + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8177, 2636, 64, 64], -** Processing line: ~ [9360, 3138, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [9360, 3138, 64, 64], -** Processing line: ~ [9296, 3137, 64, 64],~ + +** Processing line: ~ # Signal that the user is going to be removing walls~ - Inside source: true *** True Line Result - [9296, 3137, 64, 64], -** Processing line: ~ [9235, 3139, 64, 64],~ + # Signal that the user is going to be removing walls +** Processing line: ~ def wall_clicked?~ - Inside source: true *** True Line Result - [9235, 3139, 64, 64], -** Processing line: ~ [9174, 3139, 64, 64],~ + def wall_clicked? +** Processing line: ~ inputs.mouse.down && mouse_inside_a_wall?~ - Inside source: true *** True Line Result - [9174, 3139, 64, 64], -** Processing line: ~ [9113, 3138, 64, 64],~ + inputs.mouse.down && mouse_inside_a_wall? +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9113, 3138, 64, 64], -** Processing line: ~ [9050, 3138, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [9050, 3138, 64, 64], -** Processing line: ~ [8988, 3138, 64, 64],~ + +** Processing line: ~ # Signal that the user is going to be adding walls~ - Inside source: true *** True Line Result - [8988, 3138, 64, 64], -** Processing line: ~ [8925, 3138, 64, 64],~ + # Signal that the user is going to be adding walls +** Processing line: ~ def grid_clicked?~ - Inside source: true *** True Line Result - [8925, 3138, 64, 64], -** Processing line: ~ [8860, 3136, 64, 64],~ + def grid_clicked? +** Processing line: ~ inputs.mouse.down && mouse_inside_grid?~ - Inside source: true *** True Line Result - [8860, 3136, 64, 64], -** Processing line: ~ [8797, 3136, 64, 64],~ + inputs.mouse.down && mouse_inside_grid? +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8797, 3136, 64, 64], -** Processing line: ~ [8770, 3138, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [8770, 3138, 64, 64], -** Processing line: ~ [8827, 4171, 64, 64],~ + +** Processing line: ~ # Returns whether the mouse is inside of a wall~ - Inside source: true *** True Line Result - [8827, 4171, 64, 64], -** Processing line: ~ [8827, 4107, 64, 64],~ + # Returns whether the mouse is inside of a wall +** Processing line: ~ # Part of the condition that checks whether the user is removing a wall~ - Inside source: true *** True Line Result - [8827, 4107, 64, 64], -** Processing line: ~ [8827, 4043, 64, 64],~ + # Part of the condition that checks whether the user is removing a wall +** Processing line: ~ def mouse_inside_a_wall?~ - Inside source: true *** True Line Result - [8827, 4043, 64, 64], -** Processing line: ~ [8827, 3978, 64, 64],~ + def mouse_inside_a_wall? +** Processing line: ~ state.walls.each_key do | wall |~ - Inside source: true *** True Line Result - [8827, 3978, 64, 64], -** Processing line: ~ [8825, 3914, 64, 64],~ + state.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(scale_up(wall))~ - Inside source: true *** True Line Result - [8825, 3914, 64, 64], -** Processing line: ~ [8824, 3858, 64, 64],~ + return true if inputs.mouse.point.inside_rect?(scale_up(wall)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8824, 3858, 64, 64], -** Processing line: ~ [9635, 4234, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [9635, 4234, 64, 64], -** Processing line: ~ [9584, 4235, 64, 64],~ + +** Processing line: ~ false~ - Inside source: true *** True Line Result - [9584, 4235, 64, 64], -** Processing line: ~ [9634, 4187, 64, 64],~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9634, 4187, 64, 64], -** Processing line: ~ [9582, 4183, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [9582, 4183, 64, 64], -** Processing line: ~ [9402, 5114, 64, 64],~ + +** Processing line: ~ # Returns whether the mouse is inside of a grid~ - Inside source: true *** True Line Result - [9402, 5114, 64, 64], -** Processing line: ~ [9402, 5087, 64, 64],~ + # Returns whether the mouse is inside of a grid +** Processing line: ~ # Part of the condition that checks whether the user is adding a wall~ - Inside source: true *** True Line Result - [9402, 5087, 64, 64], -** Processing line: ~ [9347, 5113, 64, 64],~ + # Part of the condition that checks whether the user is adding a wall +** Processing line: ~ def mouse_inside_grid?~ - Inside source: true *** True Line Result - [9347, 5113, 64, 64], -** Processing line: ~ [9345, 5086, 64, 64],~ + def mouse_inside_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up([0, 0, grid.width, grid.height]))~ - Inside source: true *** True Line Result - [9345, 5086, 64, 64], -** Processing line: ~ [9287, 5114, 64, 64],~ + inputs.mouse.point.inside_rect?(scale_up([0, 0, grid.width, grid.height])) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9287, 5114, 64, 64], -** Processing line: ~ [9285, 5085, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [9285, 5085, 64, 64], -** Processing line: ~ [9245, 5114, 64, 64],~ + +** Processing line: ~ # These methods provide handy aliases to colors~ - Inside source: true *** True Line Result - [9245, 5114, 64, 64], -** Processing line: ~ [9244, 5086, 64, 64],~ + # These methods provide handy aliases to colors +** Processing line: ~~ - Inside source: true *** True Line Result - [9244, 5086, 64, 64], -** Processing line: ~ [9336, 5445, 64, 64],~ + +** Processing line: ~ # Light brown~ - Inside source: true *** True Line Result - [9336, 5445, 64, 64], -** Processing line: ~ [9285, 5445, 64, 64],~ + # Light brown +** Processing line: ~ def unvisited_color~ - Inside source: true *** True Line Result - [9285, 5445, 64, 64], -** Processing line: ~ [9337, 5395, 64, 64],~ + def unvisited_color +** Processing line: ~ [221, 212, 213]~ - Inside source: true *** True Line Result - [9337, 5395, 64, 64], -** Processing line: ~ [9283, 5393, 64, 64],~ + [221, 212, 213] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [9283, 5393, 64, 64], -** Processing line: ~ [8884, 4968, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [8884, 4968, 64, 64], -** Processing line: ~ [8884, 4939, 64, 64],~ + +** Processing line: ~ # Black~ - Inside source: true *** True Line Result - [8884, 4939, 64, 64], -** Processing line: ~ [8822, 4967, 64, 64],~ + # Black +** Processing line: ~ def grid_line_color~ - Inside source: true *** True Line Result - [8822, 4967, 64, 64], -** Processing line: ~ [8823, 4940, 64, 64],~ + def grid_line_color +** Processing line: ~ [255, 255, 255]~ - Inside source: true *** True Line Result - [8823, 4940, 64, 64], -** Processing line: ~ [8765, 4967, 64, 64],~ + [255, 255, 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8765, 4967, 64, 64], -** Processing line: ~ [8762, 4937, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [8762, 4937, 64, 64], -** Processing line: ~ [8726, 4969, 64, 64],~ + +** Processing line: ~ # Dark Brown~ - Inside source: true *** True Line Result - [8726, 4969, 64, 64], -** Processing line: ~ [8727, 4939, 64, 64],~ + # Dark Brown +** Processing line: ~ def visited_color~ - Inside source: true *** True Line Result - [8727, 4939, 64, 64], -** Processing line: ~ [7946, 5248, 64, 64],~ + def visited_color +** Processing line: ~ [204, 191, 179]~ - Inside source: true *** True Line Result - [7946, 5248, 64, 64], -** Processing line: ~ [7945, 5220, 64, 64],~ + [204, 191, 179] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7945, 5220, 64, 64], -** Processing line: ~ [7887, 5248, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [7887, 5248, 64, 64], -** Processing line: ~ [7886, 5219, 64, 64],~ + +** Processing line: ~ # Blue~ - Inside source: true *** True Line Result - [7886, 5219, 64, 64], -** Processing line: ~ [7830, 5248, 64, 64],~ + # Blue +** Processing line: ~ def frontier_color~ - Inside source: true *** True Line Result - [7830, 5248, 64, 64], -** Processing line: ~ [7827, 5218, 64, 64],~ + def frontier_color +** Processing line: ~ [103, 136, 204]~ - Inside source: true *** True Line Result - [7827, 5218, 64, 64], -** Processing line: ~ [7781, 5248, 64, 64],~ + [103, 136, 204] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7781, 5248, 64, 64], -** Processing line: ~ [7781, 5216, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [7781, 5216, 64, 64], -** Processing line: ~ [6648, 4762, 64, 64],~ + +** Processing line: ~ # Camo Green~ - Inside source: true *** True Line Result - [6648, 4762, 64, 64], -** Processing line: ~ [6621, 4761, 64, 64],~ + # Camo Green +** Processing line: ~ def wall_color~ - Inside source: true *** True Line Result - [6621, 4761, 64, 64], -** Processing line: ~ [5011, 4446, 64, 64],~ + def wall_color +** Processing line: ~ [134, 134, 120]~ - Inside source: true *** True Line Result - [5011, 4446, 64, 64], -** Processing line: ~ [4982, 4444, 64, 64],~ + [134, 134, 120] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4982, 4444, 64, 64], -** Processing line: ~ [4146, 4641, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [4146, 4641, 64, 64], -** Processing line: ~ [4092, 4643, 64, 64],~ + +** Processing line: ~ # Next frontier to be expanded~ - Inside source: true *** True Line Result - [4092, 4643, 64, 64], -** Processing line: ~ [4145, 4589, 64, 64],~ + # Next frontier to be expanded +** Processing line: ~ def highlighter_yellow~ - Inside source: true *** True Line Result - [4145, 4589, 64, 64], -** Processing line: ~ [4091, 4590, 64, 64],~ + def highlighter_yellow +** Processing line: ~ [214, 231, 125]~ - Inside source: true *** True Line Result - [4091, 4590, 64, 64], -** Processing line: ~ [4139, 4497, 64, 64],~ + [214, 231, 125] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4139, 4497, 64, 64], -** Processing line: ~ [4135, 4437, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [4135, 4437, 64, 64], -** Processing line: ~ [4135, 4383, 64, 64],~ + +** Processing line: ~ # The neighbors of the next frontier to be expanded~ - Inside source: true *** True Line Result - [4135, 4383, 64, 64], -** Processing line: ~ [4078, 4495, 64, 64],~ + # The neighbors of the next frontier to be expanded +** Processing line: ~ def highlighter_green~ - Inside source: true *** True Line Result - [4078, 4495, 64, 64], -** Processing line: ~ [4014, 4494, 64, 64],~ + def highlighter_green +** Processing line: ~ [65, 191, 127]~ - Inside source: true *** True Line Result - [4014, 4494, 64, 64], -** Processing line: ~ [3979, 4496, 64, 64],~ + [65, 191, 127] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3979, 4496, 64, 64], -** Processing line: ~ [4074, 4384, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [4074, 4384, 64, 64], -** Processing line: ~ [4015, 4381, 64, 64],~ + +** Processing line: ~ # Button background~ - Inside source: true *** True Line Result - [4015, 4381, 64, 64], -** Processing line: ~ [3980, 4433, 64, 64],~ + # Button background +** Processing line: ~ def gray~ - Inside source: true *** True Line Result - [3980, 4433, 64, 64], -** Processing line: ~ [3981, 4384, 64, 64],~ + def gray +** Processing line: ~ [190, 190, 190]~ - Inside source: true *** True Line Result - [3981, 4384, 64, 64], -** Processing line: ~ [3276, 4279, 64, 64],~ + [190, 190, 190] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3276, 4279, 64, 64], -** Processing line: ~ [3275, 4218, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [3275, 4218, 64, 64], -** Processing line: ~ [3276, 4170, 64, 64],~ + +** Processing line: ~ # Button outline~ - Inside source: true *** True Line Result - [3276, 4170, 64, 64], -** Processing line: ~ [3211, 4164, 64, 64],~ + # Button outline +** Processing line: ~ def black~ - Inside source: true *** True Line Result - [3211, 4164, 64, 64], -** Processing line: ~ [3213, 4280, 64, 64],~ + def black +** Processing line: ~ [0, 0, 0]~ - Inside source: true *** True Line Result - [3213, 4280, 64, 64], -** Processing line: ~ [3156, 4278, 64, 64],~ + [0, 0, 0] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3156, 4278, 64, 64], -** Processing line: ~ [3120, 4278, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [3120, 4278, 64, 64], -** Processing line: ~ [3151, 4163, 64, 64],~ + +** Processing line: ~ # These methods make the code more concise~ - Inside source: true *** True Line Result - [3151, 4163, 64, 64], -** Processing line: ~ [3120, 4216, 64, 64],~ + # These methods make the code more concise +** Processing line: ~ def grid~ - Inside source: true *** True Line Result - [3120, 4216, 64, 64], -** Processing line: ~ [3120, 4161, 64, 64],~ + def grid +** Processing line: ~ state.grid~ - Inside source: true *** True Line Result - [3120, 4161, 64, 64], -** Processing line: ~ [1536, 4171, 64, 64],~ + state.grid +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1536, 4171, 64, 64], -** Processing line: ~ [1536, 4110, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [1536, 4110, 64, 64], -** Processing line: ~ [1535, 4051, 64, 64],~ + +** Processing line: ~ def buttons~ - Inside source: true *** True Line Result - [1535, 4051, 64, 64], -** Processing line: ~ [1536, 3991, 64, 64],~ + def buttons +** Processing line: ~ state.buttons~ - Inside source: true *** True Line Result - [1536, 3991, 64, 64], -** Processing line: ~ [1536, 3928, 64, 64],~ + state.buttons +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1536, 3928, 64, 64], -** Processing line: ~ [1536, 3863, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [1536, 3863, 64, 64], -** Processing line: ~ [1078, 4605, 64, 64],~ + +** Processing line: ~ def slider~ - Inside source: true *** True Line Result - [1078, 4605, 64, 64], -** Processing line: ~ [1076, 4577, 64, 64],~ + def slider +** Processing line: ~ state.slider~ - Inside source: true *** True Line Result - [1076, 4577, 64, 64], -** Processing line: ~ [1018, 4604, 64, 64],~ + state.slider +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1018, 4604, 64, 64], -** Processing line: ~ [1018, 4575, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1018, 4575, 64, 64], -** Processing line: ~ [957, 4606, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [957, 4606, 64, 64], -** Processing line: ~ [960, 4575, 64, 64],~ + +** Processing line: ~~ - Inside source: true *** True Line Result - [960, 4575, 64, 64], -** Processing line: ~ [918, 4602, 64, 64],~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - [918, 4602, 64, 64], -** Processing line: ~ [918, 4580, 64, 64],~ + def tick args +** Processing line: ~ # Pressing r resets the program~ - Inside source: true *** True Line Result - [918, 4580, 64, 64], -** Processing line: ~ [394, 4164, 64, 64],~ + # Pressing r resets the program +** Processing line: ~ if args.inputs.keyboard.key_down.r~ - Inside source: true *** True Line Result - [394, 4164, 64, 64], -** Processing line: ~ [335, 4163, 64, 64],~ + if args.inputs.keyboard.key_down.r +** Processing line: ~ args.gtk.reset~ - Inside source: true *** True Line Result - [335, 4163, 64, 64], -** Processing line: ~ [274, 4161, 64, 64],~ + args.gtk.reset +** Processing line: ~ reset~ - Inside source: true *** True Line Result - [274, 4161, 64, 64], -** Processing line: ~ [236, 4163, 64, 64],~ + reset +** Processing line: ~ return~ - Inside source: true *** True Line Result - [236, 4163, 64, 64], -** Processing line: ~ [394, 4140, 64, 64],~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - [394, 4140, 64, 64], -** Processing line: ~ [329, 4139, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [329, 4139, 64, 64], -** Processing line: ~ [268, 4139, 64, 64],~ + +** Processing line: ~ $detailed_breadth_first_search ||= DetailedBreadthFirstSearch.new(args)~ - Inside source: true *** True Line Result - [268, 4139, 64, 64], -** Processing line: ~ [239, 4139, 64, 64],~ + $detailed_breadth_first_search ||= DetailedBreadthFirstSearch.new(args) +** Processing line: ~ $detailed_breadth_first_search.args = args~ - Inside source: true *** True Line Result - [239, 4139, 64, 64], -** Processing line: ~ [4326, 5073, 64, 64],~ + $detailed_breadth_first_search.args = args +** Processing line: ~ $detailed_breadth_first_search.tick~ - Inside source: true *** True Line Result - [4326, 5073, 64, 64], -** Processing line: ~ [4324, 5042, 64, 64],~ + $detailed_breadth_first_search.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4324, 5042, 64, 64], -** Processing line: ~ [4265, 5074, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [4265, 5074, 64, 64], -** Processing line: ~ [4263, 5042, 64, 64],~ + +** Processing line: ~~ - Inside source: true *** True Line Result - [4263, 5042, 64, 64], -** Processing line: ~ [4214, 5072, 64, 64],~ + +** Processing line: ~ def reset~ - Inside source: true *** True Line Result - [4214, 5072, 64, 64], -** Processing line: ~ [4211, 5043, 64, 64],~ + def reset +** Processing line: ~ $detailed_breadth_first_search = nil~ - Inside source: true *** True Line Result - [4211, 5043, 64, 64], -** Processing line: ~ [4166, 5073, 64, 64],~ + $detailed_breadth_first_search = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4166, 5073, 64, 64], -** Processing line: ~ [4164, 5041, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [4164, 5041, 64, 64], -** Processing line: ~ [4844, 5216, 64, 64],~ + +** 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: ~*** Path Finding Algorithms - Breadcrumbs - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Path Finding Algorithms - Breadcrumbs - 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/13_path_finding_algorithms/03_breadcrumbs/app/main.rb~ - Inside source: true *** True Line Result - [4844, 5216, 64, 64], -** Processing line: ~ [4844, 5189, 64, 64],~ + # ./samples/13_path_finding_algorithms/03_breadcrumbs/app/main.rb +** Processing line: ~ class Breadcrumbs~ - Inside source: true *** True Line Result - [4844, 5189, 64, 64], -** Processing line: ~ [4785, 5217, 64, 64],~ + class Breadcrumbs +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - [4785, 5217, 64, 64], -** Processing line: ~ [4790, 5187, 64, 64],~ + attr_gtk +** Processing line: ~~ - Inside source: true *** True Line Result - [4790, 5187, 64, 64], -** Processing line: ~ [4726, 5219, 64, 64],~ + +** Processing line: ~ # This method is called every frame/tick~ - Inside source: true *** True Line Result - [4726, 5219, 64, 64], -** Processing line: ~ [4728, 5185, 64, 64],~ + # This method is called every frame/tick +** Processing line: ~ # Every tick, the current state of the search is rendered on the screen,~ - Inside source: true *** True Line Result - [4728, 5185, 64, 64], -** Processing line: ~ [4681, 5218, 64, 64],~ + # Every tick, the current state of the search is rendered on the screen, +** Processing line: ~ # User input is processed, and~ - Inside source: true *** True Line Result - [4681, 5218, 64, 64], -** Processing line: ~ [4684, 5186, 64, 64],~ + # User input is processed, and +** Processing line: ~ # The next step in the search is calculated~ - Inside source: true *** True Line Result - [4684, 5186, 64, 64], -** Processing line: ~ [4789, 4926, 64, 64],~ + # The next step in the search is calculated +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - [4789, 4926, 64, 64], -** Processing line: ~ [4734, 4928, 64, 64],~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - [4734, 4928, 64, 64], -** Processing line: ~ [4787, 4876, 64, 64],~ + defaults +** Processing line: ~ # If the grid has not been searched~ - Inside source: true *** True Line Result - [4787, 4876, 64, 64], -** Processing line: ~ [4738, 4874, 64, 64],~ + # If the grid has not been searched +** Processing line: ~ if search.came_from.empty?~ - Inside source: true *** True Line Result - [4738, 4874, 64, 64], -** Processing line: ~ [4775, 5548, 64, 64],~ + if search.came_from.empty? +** Processing line: ~ calc~ - Inside source: true *** True Line Result - [4775, 5548, 64, 64], -** Processing line: ~ [4775, 5495, 64, 64],~ + calc +** Processing line: ~ # Calc Path~ - Inside source: true *** True Line Result - [4775, 5495, 64, 64], -** Processing line: ~ [4723, 5550, 64, 64],~ + # Calc Path +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4723, 5550, 64, 64], -** Processing line: ~ [4725, 5494, 64, 64],~ + end +** Processing line: ~ render~ - Inside source: true *** True Line Result - [4725, 5494, 64, 64], -** Processing line: ~ [1360, 5269, 64, 64],~ + render +** Processing line: ~ input~ - Inside source: true *** True Line Result - [1360, 5269, 64, 64], -** Processing line: ~ [1362, 5218, 64, 64],~ + input +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1362, 5218, 64, 64], -** Processing line: ~ [1315, 5266, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [1315, 5266, 64, 64], -** Processing line: ~ [1282, 5266, 64, 64],~ + +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - [1282, 5266, 64, 64], -** Processing line: ~ [1246, 5311, 64, 64],~ + def defaults +** Processing line: ~ # Variables to edit the size and appearance of the grid~ - Inside source: true *** True Line Result - [1246, 5311, 64, 64], -** Processing line: ~ [1190, 5312, 64, 64],~ + # Variables to edit the size and appearance of the grid +** Processing line: ~ # Freely customizable to user's liking~ - Inside source: true *** True Line Result - [1190, 5312, 64, 64], -** Processing line: ~ [1136, 5310, 64, 64],~ + # Freely customizable to user's liking +** Processing line: ~ grid.width ||= 30~ - Inside source: true *** True Line Result - [1136, 5310, 64, 64], -** Processing line: ~ [1121, 5427, 64, 64],~ + grid.width ||= 30 +** Processing line: ~ grid.height ||= 15~ - Inside source: true *** True Line Result - [1121, 5427, 64, 64], -** Processing line: ~ [1121, 5370, 64, 64],~ + grid.height ||= 15 +** Processing line: ~ grid.cell_size ||= 40~ - Inside source: true *** True Line Result - [1121, 5370, 64, 64], -** Processing line: ~ [1074, 5427, 64, 64],~ + grid.cell_size ||= 40 +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ - Inside source: true *** True Line Result - [1074, 5427, 64, 64], -** Processing line: ~ [1064, 5423, 64, 64],~ + grid.rect ||= [0, 0, grid.width, grid.height] +** Processing line: ~~ - Inside source: true *** True Line Result - [1064, 5423, 64, 64], -** Processing line: ~ [1052, 5417, 64, 64],~ + +** Processing line: ~ # The location of the star and walls of the grid~ - Inside source: true *** True Line Result - [1052, 5417, 64, 64], -** Processing line: ~ [1050, 5368, 64, 64],~ + # The location of the star and walls of the grid +** Processing line: ~ # They can be modified to have a different initial grid~ - Inside source: true *** True Line Result - [1050, 5368, 64, 64], -** Processing line: ~ [1008, 5314, 64, 64],~ + # They can be modified to have a different initial grid +** Processing line: ~ # Walls are stored in a hash for quick look up when doing the search~ - Inside source: true *** True Line Result - [1008, 5314, 64, 64], -** Processing line: ~ [997, 5307, 64, 64],~ + # Walls are stored in a hash for quick look up when doing the search +** Processing line: ~ grid.star ||= [2, 8]~ - Inside source: true *** True Line Result - [997, 5307, 64, 64], -** Processing line: ~ [977, 5299, 64, 64],~ + grid.star ||= [2, 8] +** Processing line: ~ grid.target ||= [10, 5]~ - Inside source: true *** True Line Result - [977, 5299, 64, 64], -** Processing line: ~ [976, 5248, 64, 64],~ + grid.target ||= [10, 5] +** Processing line: ~ grid.walls ||= {~ - Inside source: true *** True Line Result - [976, 5248, 64, 64], -** Processing line: ~ [825, 5267, 64, 64],~ + grid.walls ||= { +** Processing line: ~ [3, 3] => true,~ - Inside source: true *** True Line Result - [825, 5267, 64, 64], -** Processing line: ~ [826, 5213, 64, 64],~ + [3, 3] => true, +** Processing line: ~ [3, 4] => true,~ - Inside source: true *** True Line Result - [826, 5213, 64, 64], -** Processing line: ~ [776, 5267, 64, 64],~ + [3, 4] => true, +** Processing line: ~ [3, 5] => true,~ - Inside source: true *** True Line Result - [776, 5267, 64, 64], -** Processing line: ~ [768, 5261, 64, 64],~ + [3, 5] => true, +** Processing line: ~ [3, 6] => true,~ - Inside source: true *** True Line Result - [768, 5261, 64, 64], -** Processing line: ~ [755, 5256, 64, 64],~ + [3, 6] => true, +** Processing line: ~ [3, 7] => true,~ - Inside source: true *** True Line Result - [755, 5256, 64, 64], -** Processing line: ~ [753, 5209, 64, 64],~ + [3, 7] => true, +** Processing line: ~ [3, 8] => true,~ - Inside source: true *** True Line Result - [753, 5209, 64, 64], -** Processing line: ~ [1299, 5206, 64, 64],~ + [3, 8] => true, +** Processing line: ~ [3, 9] => true,~ - Inside source: true *** True Line Result - [1299, 5206, 64, 64], -** Processing line: ~ [1238, 5204, 64, 64],~ + [3, 9] => true, +** Processing line: ~ [3, 10] => true,~ - Inside source: true *** True Line Result - [1238, 5204, 64, 64], -** Processing line: ~ [1178, 5203, 64, 64],~ + [3, 10] => true, +** Processing line: ~ [3, 11] => true,~ - Inside source: true *** True Line Result - [1178, 5203, 64, 64], -** Processing line: ~ [1124, 5204, 64, 64],~ + [3, 11] => true, +** Processing line: ~ [4, 3] => true,~ - Inside source: true *** True Line Result - [1124, 5204, 64, 64], -** Processing line: ~ [1065, 5206, 64, 64],~ + [4, 3] => true, +** Processing line: ~ [4, 4] => true,~ - Inside source: true *** True Line Result - [1065, 5206, 64, 64], -** Processing line: ~ [1008, 5203, 64, 64],~ + [4, 4] => true, +** Processing line: ~ [4, 5] => true,~ - Inside source: true *** True Line Result - [1008, 5203, 64, 64], -** Processing line: ~ [977, 5214, 64, 64],~ + [4, 5] => true, +** Processing line: ~ [4, 6] => true,~ - Inside source: true *** True Line Result - [977, 5214, 64, 64], -** Processing line: ~ [410, 5313, 64, 64],~ + [4, 6] => true, +** Processing line: ~ [4, 7] => true,~ - Inside source: true *** True Line Result - [410, 5313, 64, 64], -** Processing line: ~ [407, 5249, 64, 64],~ + [4, 7] => true, +** Processing line: ~ [4, 8] => true,~ - Inside source: true *** True Line Result - [407, 5249, 64, 64], -** Processing line: ~ [411, 5225, 64, 64],~ + [4, 8] => true, +** Processing line: ~ [4, 9] => true,~ - Inside source: true *** True Line Result - [411, 5225, 64, 64], -** Processing line: ~ [397, 5217, 64, 64],~ + [4, 9] => true, +** Processing line: ~ [4, 10] => true,~ - Inside source: true *** True Line Result - [397, 5217, 64, 64], -** Processing line: ~ [378, 5209, 64, 64],~ + [4, 10] => true, +** Processing line: ~ [4, 11] => true,~ - Inside source: true *** True Line Result - [378, 5209, 64, 64], -** Processing line: ~ [358, 5312, 64, 64],~ + [4, 11] => true, +** Processing line: ~ [13, 0] => true,~ - Inside source: true *** True Line Result - [358, 5312, 64, 64], -** Processing line: ~ [287, 5427, 64, 64],~ + [13, 0] => true, +** Processing line: ~ [13, 1] => true,~ - Inside source: true *** True Line Result - [287, 5427, 64, 64], -** Processing line: ~ [286, 5364, 64, 64],~ + [13, 1] => true, +** Processing line: ~ [13, 2] => true,~ - Inside source: true *** True Line Result - [286, 5364, 64, 64], -** Processing line: ~ [300, 5313, 64, 64],~ + [13, 2] => true, +** Processing line: ~ [13, 3] => true,~ - Inside source: true *** True Line Result - [300, 5313, 64, 64], -** Processing line: ~ [242, 5427, 64, 64],~ + [13, 3] => true, +** Processing line: ~ [13, 4] => true,~ - Inside source: true *** True Line Result - [242, 5427, 64, 64], -** Processing line: ~ [229, 5420, 64, 64],~ + [13, 4] => true, +** Processing line: ~ [13, 5] => true,~ - Inside source: true *** True Line Result - [229, 5420, 64, 64], -** Processing line: ~ [217, 5416, 64, 64],~ + [13, 5] => true, +** Processing line: ~ [13, 6] => true,~ - Inside source: true *** True Line Result - [217, 5416, 64, 64], -** Processing line: ~ [215, 5364, 64, 64],~ + [13, 6] => true, +** Processing line: ~ [13, 7] => true,~ - Inside source: true *** True Line Result - [215, 5364, 64, 64], -** Processing line: ~ [174, 5311, 64, 64],~ + [13, 7] => true, +** Processing line: ~ [13, 8] => true,~ - Inside source: true *** True Line Result - [174, 5311, 64, 64], -** Processing line: ~ [165, 5308, 64, 64],~ + [13, 8] => true, +** Processing line: ~ [13, 9] => true,~ - Inside source: true *** True Line Result - [165, 5308, 64, 64], -** Processing line: ~ [139, 5300, 64, 64],~ + [13, 9] => true, +** Processing line: ~ [13, 10] => true,~ - Inside source: true *** True Line Result - [139, 5300, 64, 64], -** Processing line: ~ [141, 5236, 64, 64],~ + [13, 10] => true, +** Processing line: ~ [14, 0] => true,~ - Inside source: true *** True Line Result - [141, 5236, 64, 64], -** Processing line: ~ [141, 5211, 64, 64],~ + [14, 0] => true, +** Processing line: ~ [14, 1] => true,~ - Inside source: true *** True Line Result - [141, 5211, 64, 64], -** Processing line: ~ [315, 5208, 64, 64],~ + [14, 1] => true, +** Processing line: ~ [14, 2] => true,~ - Inside source: true *** True Line Result - [315, 5208, 64, 64], -** Processing line: ~ [251, 5208, 64, 64],~ + [14, 2] => true, +** Processing line: ~ [14, 3] => true,~ - Inside source: true *** True Line Result - [251, 5208, 64, 64], -** Processing line: ~ [211, 5211, 64, 64],~ + [14, 3] => true, +** Processing line: ~ [14, 4] => true,~ - Inside source: true *** True Line Result - [211, 5211, 64, 64], -** Processing line: ~ [8050, 4060, 64, 64],~ + [14, 4] => true, +** Processing line: ~ [14, 5] => true,~ - Inside source: true *** True Line Result - [8050, 4060, 64, 64], -** Processing line: ~ [7992, 4060, 64, 64],~ + [14, 5] => true, +** Processing line: ~ [14, 6] => true,~ - Inside source: true *** True Line Result - [7992, 4060, 64, 64], -** Processing line: ~ [7929, 4060, 64, 64],~ + [14, 6] => true, +** Processing line: ~ [14, 7] => true,~ - Inside source: true *** True Line Result - [7929, 4060, 64, 64], -** Processing line: ~ [7866, 4061, 64, 64],~ + [14, 7] => true, +** Processing line: ~ [14, 8] => true,~ - Inside source: true *** True Line Result - [7866, 4061, 64, 64], -** Processing line: ~ [7828, 4063, 64, 64],~ + [14, 8] => true, +** Processing line: ~ [14, 9] => true,~ - Inside source: true *** True Line Result - [7828, 4063, 64, 64], -** Processing line: ~ [7934, 4001, 64, 64],~ + [14, 9] => true, +** Processing line: ~ [14, 10] => true,~ - Inside source: true *** True Line Result - [7934, 4001, 64, 64], -** Processing line: ~ [7935, 3936, 64, 64],~ + [14, 10] => true, +** Processing line: ~ [21, 8] => true,~ - Inside source: true *** True Line Result - [7935, 3936, 64, 64], -** Processing line: ~ [7935, 3875, 64, 64],~ + [21, 8] => true, +** Processing line: ~ [21, 9] => true,~ - Inside source: true *** True Line Result - [7935, 3875, 64, 64], -** Processing line: ~ [7622, 4111, 64, 64],~ + [21, 9] => true, +** Processing line: ~ [21, 10] => true,~ - Inside source: true *** True Line Result - [7622, 4111, 64, 64], -** Processing line: ~ [7623, 4049, 64, 64],~ + [21, 10] => true, +** Processing line: ~ [21, 11] => true,~ - Inside source: true *** True Line Result - [7623, 4049, 64, 64], -** Processing line: ~ [7707, 4018, 64, 64],~ + [21, 11] => true, +** Processing line: ~ [21, 12] => true,~ - Inside source: true *** True Line Result - [7707, 4018, 64, 64], -** Processing line: ~ [7663, 4019, 64, 64],~ + [21, 12] => true, +** Processing line: ~ [21, 13] => true,~ - Inside source: true *** True Line Result - [7663, 4019, 64, 64], -** Processing line: ~ [7623, 4017, 64, 64],~ + [21, 13] => true, +** Processing line: ~ [21, 14] => true,~ - Inside source: true *** True Line Result - [7623, 4017, 64, 64], -** Processing line: ~ [7193, 4060, 64, 64],~ + [21, 14] => true, +** Processing line: ~ [22, 8] => true,~ - Inside source: true *** True Line Result - [7193, 4060, 64, 64], -** Processing line: ~ [7131, 4059, 64, 64],~ + [22, 8] => true, +** Processing line: ~ [22, 9] => true,~ - Inside source: true *** True Line Result - [7131, 4059, 64, 64], -** Processing line: ~ [7070, 4057, 64, 64],~ + [22, 9] => true, +** Processing line: ~ [22, 10] => true,~ - Inside source: true *** True Line Result - [7070, 4057, 64, 64], -** Processing line: ~ [7008, 4060, 64, 64],~ + [22, 10] => true, +** Processing line: ~ [22, 11] => true,~ - Inside source: true *** True Line Result - [7008, 4060, 64, 64], -** Processing line: ~ [6977, 4060, 64, 64],~ + [22, 11] => true, +** Processing line: ~ [22, 12] => true,~ - Inside source: true *** True Line Result - [6977, 4060, 64, 64], -** Processing line: ~ [7080, 3998, 64, 64],~ + [22, 12] => true, +** Processing line: ~ [22, 13] => true,~ - Inside source: true *** True Line Result - [7080, 3998, 64, 64], -** Processing line: ~ [7081, 3935, 64, 64],~ + [22, 13] => true, +** Processing line: ~ [22, 14] => true,~ - Inside source: true *** True Line Result - [7081, 3935, 64, 64], -** Processing line: ~ [7080, 3873, 64, 64],~ -- Inside source: true -*** True Line Result - [7080, 3873, 64, 64], -** Processing line: ~ [6855, 4019, 64, 64],~ + [22, 14] => true, +** Processing line: ~ [23, 8] => true,~ - Inside source: true *** True Line Result - [6855, 4019, 64, 64], -** Processing line: ~ [6790, 4018, 64, 64],~ + [23, 8] => true, +** Processing line: ~ [23, 9] => true,~ - Inside source: true *** True Line Result - [6790, 4018, 64, 64], -** Processing line: ~ [6770, 4114, 64, 64],~ + [23, 9] => true, +** Processing line: ~ [24, 8] => true,~ - Inside source: true *** True Line Result - [6770, 4114, 64, 64], -** Processing line: ~ [6770, 4060, 64, 64],~ + [24, 8] => true, +** Processing line: ~ [24, 9] => true,~ - Inside source: true *** True Line Result - [6770, 4060, 64, 64], -** Processing line: ~ [6768, 4013, 64, 64],~ + [24, 9] => true, +** Processing line: ~ [25, 8] => true,~ - Inside source: true *** True Line Result - [6768, 4013, 64, 64], -** Processing line: ~ [6345, 4060, 64, 64],~ + [25, 8] => true, +** Processing line: ~ [25, 9] => true,~ - Inside source: true *** True Line Result - [6345, 4060, 64, 64], -** Processing line: ~ [6284, 4062, 64, 64],~ + [25, 9] => true, +** Processing line: ~ }~ - Inside source: true *** True Line Result - [6284, 4062, 64, 64], -** Processing line: ~ [6222, 4061, 64, 64],~ + } +** Processing line: ~~ - Inside source: true *** True Line Result - [6222, 4061, 64, 64], -** Processing line: ~ [6166, 4061, 64, 64],~ + +** Processing line: ~ # Variables that are used by the breadth first search~ - Inside source: true *** True Line Result - [6166, 4061, 64, 64], -** Processing line: ~ [6124, 4066, 64, 64],~ + # Variables that are used by the breadth first search +** Processing line: ~ # Storing cells that the search has visited, prevents unnecessary steps~ - Inside source: true *** True Line Result - [6124, 4066, 64, 64], -** Processing line: ~ [6226, 3995, 64, 64],~ + # Storing cells that the search has visited, prevents unnecessary steps +** Processing line: ~ # Expanding the frontier of the search in order makes the search expand~ - Inside source: true *** True Line Result - [6226, 3995, 64, 64], -** Processing line: ~ [6226, 3933, 64, 64],~ + # Expanding the frontier of the search in order makes the search expand +** Processing line: ~ # from the center outward~ - Inside source: true *** True Line Result - [6226, 3933, 64, 64], -** Processing line: ~ [6228, 3868, 64, 64],~ + # from the center outward +** Processing line: ~~ - Inside source: true *** True Line Result - [6228, 3868, 64, 64], -** Processing line: ~ [5916, 4113, 64, 64],~ + +** Processing line: ~ # The cells from which the search is to expand~ - Inside source: true *** True Line Result - [5916, 4113, 64, 64], -** Processing line: ~ [5918, 4052, 64, 64],~ + # The cells from which the search is to expand +** Processing line: ~ search.frontier ||= []~ - Inside source: true *** True Line Result - [5918, 4052, 64, 64], -** Processing line: ~ [6001, 4018, 64, 64],~ + search.frontier ||= [] +** Processing line: ~ # A hash of where each cell was expanded from~ - Inside source: true *** True Line Result - [6001, 4018, 64, 64], -** Processing line: ~ [5941, 4019, 64, 64],~ + # A hash of where each cell was expanded from +** Processing line: ~ # The key is a cell, and the value is the cell it came from~ - Inside source: true *** True Line Result - [5941, 4019, 64, 64], -** Processing line: ~ [5918, 4020, 64, 64],~ + # The key is a cell, and the value is the cell it came from +** Processing line: ~ search.came_from ||= {}~ - Inside source: true *** True Line Result - [5918, 4020, 64, 64], -** Processing line: ~ [5501, 4059, 64, 64],~ + search.came_from ||= {} +** Processing line: ~ # Cells that are part of the path from the target to the star~ - Inside source: true *** True Line Result - [5501, 4059, 64, 64], -** Processing line: ~ [5439, 4061, 64, 64],~ + # Cells that are part of the path from the target to the star +** Processing line: ~ search.path ||= {}~ - Inside source: true *** True Line Result - [5439, 4061, 64, 64], -** Processing line: ~ [5376, 4059, 64, 64],~ + search.path ||= {} +** Processing line: ~~ - Inside source: true *** True Line Result - [5376, 4059, 64, 64], -** Processing line: ~ [5312, 4058, 64, 64],~ + +** Processing line: ~ # What the user is currently editing on the grid~ - Inside source: true *** True Line Result - [5312, 4058, 64, 64], -** Processing line: ~ [5285, 4062, 64, 64],~ + # What the user is currently editing on the grid +** Processing line: ~ # We store this value, because we want to remember the value even when~ - Inside source: true *** True Line Result - [5285, 4062, 64, 64], -** Processing line: ~ [5388, 3999, 64, 64],~ + # We store this value, because we want to remember the value even when +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ - Inside source: true *** True Line Result - [5388, 3999, 64, 64], -** Processing line: ~ [5385, 3941, 64, 64],~ + # the user's cursor is no longer over what they're interacting with, but +** Processing line: ~ # they are still clicking down on the mouse.~ - Inside source: true *** True Line Result - [5385, 3941, 64, 64], -** Processing line: ~ [5384, 3874, 64, 64],~ + # they are still clicking down on the mouse. +** Processing line: ~ state.current_input ||= :none~ - Inside source: true *** True Line Result - [5384, 3874, 64, 64], -** Processing line: ~ [5075, 4112, 64, 64],~ + state.current_input ||= :none +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5075, 4112, 64, 64], -** Processing line: ~ [5074, 4051, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [5074, 4051, 64, 64], -** Processing line: ~ [5158, 4018, 64, 64],~ + +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - [5158, 4018, 64, 64], -** Processing line: ~ [5095, 4020, 64, 64],~ + def calc +** Processing line: ~ # Setup the search to start from the star~ - Inside source: true *** True Line Result - [5095, 4020, 64, 64], -** Processing line: ~ [5073, 4018, 64, 64],~ + # Setup the search to start from the star +** Processing line: ~ search.frontier << grid.star~ - Inside source: true *** True Line Result - [5073, 4018, 64, 64], -** Processing line: ~ [4549, 3998, 64, 64],~ + search.frontier << grid.star +** Processing line: ~ search.came_from[grid.star] = nil~ - Inside source: true *** True Line Result - [4549, 3998, 64, 64], -** Processing line: ~ [4393, 3996, 64, 64],~ + search.came_from[grid.star] = nil +** Processing line: ~~ - Inside source: true *** True Line Result - [4393, 3996, 64, 64], -** Processing line: ~ [4547, 3938, 64, 64],~ + +** Processing line: ~ # Until there are no more cells to expand from~ - Inside source: true *** True Line Result - [4547, 3938, 64, 64], -** Processing line: ~ [4547, 3886, 64, 64],~ + # Until there are no more cells to expand from +** Processing line: ~ until search.frontier.empty?~ - Inside source: true *** True Line Result - [4547, 3886, 64, 64], -** Processing line: ~ [4488, 3885, 64, 64],~ + until search.frontier.empty? +** Processing line: ~ # Takes the next frontier cell~ - Inside source: true *** True Line Result - [4488, 3885, 64, 64], -** Processing line: ~ [4427, 3885, 64, 64],~ + # Takes the next frontier cell +** Processing line: ~ new_frontier = search.frontier.shift~ - Inside source: true *** True Line Result - [4427, 3885, 64, 64], -** Processing line: ~ [4395, 3938, 64, 64],~ + new_frontier = search.frontier.shift +** Processing line: ~ # For each of its neighbors~ - Inside source: true *** True Line Result - [4395, 3938, 64, 64], -** Processing line: ~ [4395, 3885, 64, 64],~ + # For each of its neighbors +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ - Inside source: true *** True Line Result - [4395, 3885, 64, 64], -** Processing line: ~ [0, 0, 64, 64],~ + adjacent_neighbors(new_frontier).each do |neighbor| +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - [0, 0, 64, 64], -** Processing line: ~ [0, 1670, 64, 64],~ + # That have not been visited and are not walls +** Processing line: ~ unless search.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - [0, 1670, 64, 64], -** Processing line: ~ [6691, 1653, 64, 64],~ + unless search.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited in the first grid~ - Inside source: true *** True Line Result - [6691, 1653, 64, 64], -** Processing line: ~ [1521, 3792, 64, 64],~ + # Add them to the frontier and mark them as visited in the first grid +** Processing line: ~ # Unless the target has been visited~ - Inside source: true *** True Line Result - [1521, 3792, 64, 64], -** Processing line: ~ [0, 5137, 64, 64],~ + # Unless the target has been visited +** Processing line: ~ # Add the neighbor to the frontier and remember which cell it came from~ - Inside source: true *** True Line Result - [0, 5137, 64, 64], -** Processing line: ~ [0, 0, 64, 64],~ + # Add the neighbor to the frontier and remember which cell it came from +** Processing line: ~ search.frontier << neighbor~ - Inside source: true *** True Line Result - [0, 0, 64, 64], -** Processing line: ~ [0, 1670, 64, 64],~ + search.frontier << neighbor +** Processing line: ~ search.came_from[neighbor] = new_frontier~ - Inside source: true *** True Line Result - [0, 1670, 64, 64], -** Processing line: ~ [6691, 1653, 64, 64],~ + search.came_from[neighbor] = new_frontier +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6691, 1653, 64, 64], -** Processing line: ~ [1521, 3792, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1521, 3792, 64, 64], -** Processing line: ~ [0, 5137, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [0, 5137, 64, 64], -** Processing line: ~ [1215, 2421, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1215, 2421, 64, 64], -** Processing line: ~ [1214, 2360, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [1214, 2360, 64, 64], -** Processing line: ~ [1211, 2300, 64, 64],~ + +** Processing line: ~~ - Inside source: true *** True Line Result - [1211, 2300, 64, 64], -** Processing line: ~ [1211, 2291, 64, 64],~ + +** Processing line: ~ # Draws everything onto the screen~ - Inside source: true *** True Line Result - [1211, 2291, 64, 64], -** Processing line: ~ [1158, 2420, 64, 64],~ + # Draws everything onto the screen +** Processing line: ~ def render~ - Inside source: true *** True Line Result - [1158, 2420, 64, 64], -** Processing line: ~ [1156, 2358, 64, 64],~ + def render +** Processing line: ~ render_background~ - Inside source: true *** True Line Result - [1156, 2358, 64, 64], -** Processing line: ~ [1149, 2291, 64, 64],~ + render_background +** Processing line: ~ # render_heat_map~ - Inside source: true *** True Line Result - [1149, 2291, 64, 64], -** Processing line: ~ [1095, 2420, 64, 64],~ + # render_heat_map +** Processing line: ~ render_walls~ - Inside source: true *** True Line Result - [1095, 2420, 64, 64], -** Processing line: ~ [1030, 2418, 64, 64],~ + render_walls +** Processing line: ~ # render_path~ - Inside source: true *** True Line Result - [1030, 2418, 64, 64], -** Processing line: ~ [966, 2419, 64, 64],~ + # render_path +** Processing line: ~ # render_labels~ - Inside source: true *** True Line Result - [966, 2419, 64, 64], -** Processing line: ~ [903, 2419, 64, 64],~ + # render_labels +** Processing line: ~ render_arrows~ - Inside source: true *** True Line Result - [903, 2419, 64, 64], -** Processing line: ~ [852, 2419, 64, 64],~ + render_arrows +** Processing line: ~ render_star~ - Inside source: true *** True Line Result - [852, 2419, 64, 64], -** Processing line: ~ [1087, 2291, 64, 64],~ + render_star +** Processing line: ~ render_target~ - Inside source: true *** True Line Result - [1087, 2291, 64, 64], -** Processing line: ~ [1023, 2291, 64, 64],~ + render_target +** Processing line: ~ unless grid.walls.has_key?(grid.target)~ - Inside source: true *** True Line Result - [1023, 2291, 64, 64], -** Processing line: ~ [960, 2291, 64, 64],~ + unless grid.walls.has_key?(grid.target) +** Processing line: ~ render_trail~ - Inside source: true *** True Line Result - [960, 2291, 64, 64], -** Processing line: ~ [896, 2292, 64, 64],~ + render_trail +** Processing line: ~ end~ - Inside source: true *** True Line Result - [896, 2292, 64, 64], -** Processing line: ~ [854, 2355, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [854, 2355, 64, 64], -** Processing line: ~ [854, 2292, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [854, 2292, 64, 64], -** Processing line: ~ [675, 3017, 64, 64],~ + +** Processing line: ~ def render_trail(current_cell=grid.target)~ - Inside source: true *** True Line Result - [675, 3017, 64, 64], -** Processing line: ~ [622, 3017, 64, 64],~ + def render_trail(current_cell=grid.target) +** Processing line: ~ return if current_cell == grid.star~ - Inside source: true *** True Line Result - [622, 3017, 64, 64], -** Processing line: ~ [676, 2965, 64, 64],~ + return if current_cell == grid.star +** Processing line: ~ parent_cell = search.came_from[current_cell]~ - Inside source: true *** True Line Result - [676, 2965, 64, 64], -** Processing line: ~ [622, 2965, 64, 64],~ + parent_cell = search.came_from[current_cell] +** Processing line: ~ if current_cell && parent_cell~ - Inside source: true *** True Line Result - [622, 2965, 64, 64], -** Processing line: ~ [1560, 3212, 64, 64],~ + if current_cell && parent_cell +** Processing line: ~ outputs.lines << [(current_cell.x + 0.5) * grid.cell_size, (current_cell.y + 0.5) * grid.cell_size,~ - Inside source: true *** True Line Result - [1560, 3212, 64, 64], -** Processing line: ~ [1496, 3212, 64, 64],~ + outputs.lines << [(current_cell.x + 0.5) * grid.cell_size, (current_cell.y + 0.5) * grid.cell_size, +** Processing line: ~ (parent_cell.x + 0.5) * grid.cell_size, (parent_cell.y + 0.5) * grid.cell_size, purple]~ - Inside source: true *** True Line Result - [1496, 3212, 64, 64], -** Processing line: ~ [1430, 3211, 64, 64],~ + (parent_cell.x + 0.5) * grid.cell_size, (parent_cell.y + 0.5) * grid.cell_size, purple] +** Processing line: ~~ - Inside source: true *** True Line Result - [1430, 3211, 64, 64], -** Processing line: ~ [1346, 3214, 64, 64],~ + +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1346, 3214, 64, 64], -** Processing line: ~ [1410, 3213, 64, 64],~ + end +** Processing line: ~ render_trail(parent_cell)~ - Inside source: true *** True Line Result - [1410, 3213, 64, 64], -** Processing line: ~ [1560, 3147, 64, 64],~ + render_trail(parent_cell) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1560, 3147, 64, 64], -** Processing line: ~ [1559, 3105, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [1559, 3105, 64, 64], -** Processing line: ~ [1496, 3105, 64, 64],~ + +** Processing line: ~ def render_arrows~ - Inside source: true *** True Line Result - [1496, 3105, 64, 64], -** Processing line: ~ [1442, 3105, 64, 64],~ + def render_arrows +** Processing line: ~ search.came_from.each do |child, parent|~ - Inside source: true *** True Line Result - [1442, 3105, 64, 64], -** Processing line: ~ [1412, 3106, 64, 64],~ + search.came_from.each do |child, parent| +** Processing line: ~ if parent && child~ - Inside source: true *** True Line Result - [1412, 3106, 64, 64], -** Processing line: ~ [918, 4163, 64, 64],~ + if parent && child +** Processing line: ~ arrow_cell = [(child.x + parent.x) / 2, (child.y + parent.y) / 2]~ - Inside source: true *** True Line Result - [918, 4163, 64, 64], -** Processing line: ~ [854, 4161, 64, 64],~ + arrow_cell = [(child.x + parent.x) / 2, (child.y + parent.y) / 2] +** Processing line: ~ if parent.x > child.x # If the parent cell is to the right of the child cell~ - Inside source: true *** True Line Result - [854, 4161, 64, 64], -** Processing line: ~ [792, 4160, 64, 64],~ + if parent.x > child.x # If the parent cell is to the right of the child cell +** Processing line: ~ outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 0] # Point the arrow to the right~ - Inside source: true *** True Line Result - [792, 4160, 64, 64], -** Processing line: ~ [729, 4159, 64, 64],~ + outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 0] # Point the arrow to the right +** Processing line: ~ elsif parent.x < child.x # If the parent cell is to the right of the child cell~ - Inside source: true *** True Line Result - [729, 4159, 64, 64], -** Processing line: ~ [666, 4158, 64, 64],~ + elsif parent.x < child.x # If the parent cell is to the right of the child cell +** Processing line: ~ outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 180] # Point the arrow to the right~ - Inside source: true *** True Line Result - [666, 4158, 64, 64], -** Processing line: ~ [601, 4158, 64, 64],~ + outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 180] # Point the arrow to the right +** Processing line: ~ elsif parent.y > child.y # If the parent cell is to the right of the child cell~ - Inside source: true *** True Line Result - [601, 4158, 64, 64], -** Processing line: ~ [537, 4156, 64, 64],~ + elsif parent.y > child.y # If the parent cell is to the right of the child cell +** Processing line: ~ outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 90] # Point the arrow to the right~ - Inside source: true *** True Line Result - [537, 4156, 64, 64], -** Processing line: ~ [918, 4137, 64, 64],~ + outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 90] # Point the arrow to the right +** Processing line: ~ elsif parent.y < child.y # If the parent cell is to the right of the child cell~ - Inside source: true *** True Line Result - [918, 4137, 64, 64], -** Processing line: ~ [854, 4137, 64, 64],~ + elsif parent.y < child.y # If the parent cell is to the right of the child cell +** Processing line: ~ outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 270] # Point the arrow to the right~ - Inside source: true *** True Line Result - [854, 4137, 64, 64], -** Processing line: ~ [789, 4136, 64, 64],~ + outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 270] # Point the arrow to the right +** Processing line: ~ end~ - Inside source: true *** True Line Result - [789, 4136, 64, 64], -** Processing line: ~ [726, 4137, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [726, 4137, 64, 64], -** Processing line: ~ [661, 4137, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [661, 4137, 64, 64], -** Processing line: ~ [599, 4139, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [599, 4139, 64, 64], -** Processing line: ~ [538, 4137, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [538, 4137, 64, 64], -** Processing line: ~ [5378, 4254, 64, 64],~ + +** Processing line: ~ # The methods below subdivide the task of drawing everything to the screen~ - Inside source: true *** True Line Result - [5378, 4254, 64, 64], -** Processing line: ~ [5440, 4204, 64, 64],~ + # The methods below subdivide the task of drawing everything to the screen +** Processing line: ~~ - Inside source: true *** True Line Result - [5440, 4204, 64, 64], -** Processing line: ~ [5405, 4214, 64, 64],~ + +** Processing line: ~ # Draws what the grid looks like with nothing on it~ - Inside source: true *** True Line Result - [5405, 4214, 64, 64], -** Processing line: ~ [5350, 4254, 64, 64],~ + # Draws what the grid looks like with nothing on it +** Processing line: ~ def render_background~ - Inside source: true *** True Line Result - [5350, 4254, 64, 64], -** Processing line: ~ [5439, 4177, 64, 64],~ + def render_background +** Processing line: ~ render_unvisited~ - Inside source: true *** True Line Result - [5439, 4177, 64, 64], -** Processing line: ~ [5413, 4173, 64, 64],~ + render_unvisited +** Processing line: ~ render_grid_lines~ - Inside source: true *** True Line Result - [5413, 4173, 64, 64], -** Processing line: ~ [5399, 4128, 64, 64],~ + render_grid_lines +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5399, 4128, 64, 64], -** Processing line: ~ [5352, 4200, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [5352, 4200, 64, 64], -** Processing line: ~ [5352, 4158, 64, 64],~ + +** Processing line: ~ # Draws both grids~ - Inside source: true *** True Line Result - [5352, 4158, 64, 64], -** Processing line: ~ [5392, 4130, 64, 64],~ + # Draws both grids +** Processing line: ~ def render_unvisited~ - Inside source: true *** True Line Result - [5392, 4130, 64, 64], -** Processing line: ~ [6216, 4251, 64, 64],~ + def render_unvisited +** Processing line: ~ outputs.solids << [scale_up(grid.rect), unvisited_color]~ - Inside source: true *** True Line Result - [6216, 4251, 64, 64], -** Processing line: ~ [6190, 4251, 64, 64],~ + outputs.solids << [scale_up(grid.rect), unvisited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6190, 4251, 64, 64], -** Processing line: ~ [6279, 4200, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [6279, 4200, 64, 64], -** Processing line: ~ [6262, 4205, 64, 64],~ + +** Processing line: ~ # Draws grid lines to show the division of the grid into cells~ - Inside source: true *** True Line Result - [6262, 4205, 64, 64], -** Processing line: ~ [6233, 4214, 64, 64],~ + # Draws grid lines to show the division of the grid into cells +** Processing line: ~ def render_grid_lines~ - Inside source: true *** True Line Result - [6233, 4214, 64, 64], -** Processing line: ~ [6280, 4172, 64, 64],~ + def render_grid_lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - [6280, 4172, 64, 64], -** Processing line: ~ [6256, 4169, 64, 64],~ + for x in 0..grid.width +** Processing line: ~ outputs.lines << vertical_line(x)~ - Inside source: true *** True Line Result - [6256, 4169, 64, 64], -** Processing line: ~ [6239, 4128, 64, 64],~ + outputs.lines << vertical_line(x) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6239, 4128, 64, 64], -** Processing line: ~ [6231, 4128, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [6231, 4128, 64, 64], -** Processing line: ~ [6191, 4195, 64, 64],~ + +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - [6191, 4195, 64, 64], -** Processing line: ~ [6190, 4158, 64, 64],~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << horizontal_line(y)~ - Inside source: true *** True Line Result - [6190, 4158, 64, 64], -** Processing line: ~ [7072, 4250, 64, 64],~ + outputs.lines << horizontal_line(y) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7072, 4250, 64, 64], -** Processing line: ~ [7046, 4250, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7046, 4250, 64, 64], -** Processing line: ~ [7133, 4202, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [7133, 4202, 64, 64], -** Processing line: ~ [7107, 4209, 64, 64],~ + +** Processing line: ~ # Easy way to draw vertical lines given an index~ - Inside source: true *** True Line Result - [7107, 4209, 64, 64], -** Processing line: ~ [7086, 4214, 64, 64],~ + # Easy way to draw vertical lines given an index +** Processing line: ~ def vertical_line column~ - Inside source: true *** True Line Result - [7086, 4214, 64, 64], -** Processing line: ~ [7133, 4173, 64, 64],~ + def vertical_line column +** Processing line: ~ scale_up([column, 0, column, grid.height])~ - Inside source: true *** True Line Result - [7133, 4173, 64, 64], -** Processing line: ~ [7108, 4169, 64, 64],~ + scale_up([column, 0, column, grid.height]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7108, 4169, 64, 64], -** Processing line: ~ [7092, 4127, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [7092, 4127, 64, 64], -** Processing line: ~ [7084, 4128, 64, 64],~ + +** Processing line: ~ # Easy way to draw horizontal lines given an index~ - Inside source: true *** True Line Result - [7084, 4128, 64, 64], -** Processing line: ~ [7047, 4191, 64, 64],~ + # Easy way to draw horizontal lines given an index +** Processing line: ~ def horizontal_line row~ - Inside source: true *** True Line Result - [7047, 4191, 64, 64], -** Processing line: ~ [7047, 4156, 64, 64],~ + def horizontal_line row +** Processing line: ~ scale_up([0, row, grid.width, row])~ - Inside source: true *** True Line Result - [7047, 4156, 64, 64], -** Processing line: ~ [7926, 4252, 64, 64],~ + scale_up([0, row, grid.width, row]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7926, 4252, 64, 64], -** Processing line: ~ [7900, 4253, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [7900, 4253, 64, 64], -** Processing line: ~ [7987, 4202, 64, 64],~ + +** Processing line: ~ # Draws the walls on both grids~ - Inside source: true *** True Line Result - [7987, 4202, 64, 64], -** Processing line: ~ [7965, 4209, 64, 64],~ + # Draws the walls on both grids +** Processing line: ~ def render_walls~ - Inside source: true *** True Line Result - [7965, 4209, 64, 64], -** Processing line: ~ [7942, 4216, 64, 64],~ + def render_walls +** Processing line: ~ grid.walls.each_key do |wall|~ - Inside source: true *** True Line Result - [7942, 4216, 64, 64], -** Processing line: ~ [7989, 4174, 64, 64],~ + grid.walls.each_key do |wall| +** Processing line: ~ outputs.solids << [scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - [7989, 4174, 64, 64], -** Processing line: ~ [7970, 4170, 64, 64],~ + outputs.solids << [scale_up(wall), wall_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7970, 4170, 64, 64], -** Processing line: ~ [7949, 4126, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7949, 4126, 64, 64], -** Processing line: ~ [7901, 4196, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [7901, 4196, 64, 64], -** Processing line: ~ [7900, 4159, 64, 64],~ + +** Processing line: ~ # Renders the star on both grids~ - Inside source: true *** True Line Result - [7900, 4159, 64, 64], -** Processing line: ~ [7941, 4130, 64, 64],~ + # Renders the star on both grids +** Processing line: ~ def render_star~ - Inside source: true *** True Line Result - [7941, 4130, 64, 64], -** Processing line: ~ [2847, 379, 64, 64],~ + def render_star +** Processing line: ~ outputs.sprites << [scale_up(grid.star), 'star.png']~ - Inside source: true *** True Line Result - [2847, 379, 64, 64], -** Processing line: ~ [2825, 380, 64, 64],~ + outputs.sprites << [scale_up(grid.star), 'star.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2825, 380, 64, 64], -** Processing line: ~ [2845, 317, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [2845, 317, 64, 64], -** Processing line: ~ [2829, 316, 64, 64],~ + +** Processing line: ~ # Renders the target on both grids~ - Inside source: true *** True Line Result - [2829, 316, 64, 64], -** Processing line: ~ [2845, 255, 64, 64],~ + # Renders the target on both grids +** Processing line: ~ def render_target~ - Inside source: true *** True Line Result - [2845, 255, 64, 64], -** Processing line: ~ [2830, 257, 64, 64],~ + def render_target +** Processing line: ~ outputs.sprites << [scale_up(grid.target), 'target.png']~ - Inside source: true *** True Line Result - [2830, 257, 64, 64], -** Processing line: ~ [2845, 202, 64, 64],~ + outputs.sprites << [scale_up(grid.target), 'target.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2845, 202, 64, 64], -** Processing line: ~ [2829, 198, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [2829, 198, 64, 64], -** Processing line: ~ [2770, 169, 64, 64],~ + +** Processing line: ~ # Labels the grids~ - Inside source: true *** True Line Result - [2770, 169, 64, 64], -** Processing line: ~ [2708, 170, 64, 64],~ + # Labels the grids +** Processing line: ~ def render_labels~ - Inside source: true *** True Line Result - [2708, 170, 64, 64], -** Processing line: ~ [2646, 171, 64, 64],~ + def render_labels +** Processing line: ~ outputs.labels << [200, 625, "Without early exit"]~ - Inside source: true *** True Line Result - [2646, 171, 64, 64], -** Processing line: ~ [2582, 171, 64, 64],~ + outputs.labels << [200, 625, "Without early exit"] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2582, 171, 64, 64], -** Processing line: ~ [2518, 171, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [2518, 171, 64, 64], -** Processing line: ~ [2454, 171, 64, 64],~ + +** Processing line: ~ # Renders the path based off of the search.path hash~ - Inside source: true *** True Line Result - [2454, 171, 64, 64], -** Processing line: ~ [2391, 172, 64, 64],~ + # Renders the path based off of the search.path hash +** Processing line: ~ def render_path~ - Inside source: true *** True Line Result - [2391, 172, 64, 64], -** Processing line: ~ [2332, 379, 64, 64],~ + def render_path +** Processing line: ~ # If the star and target are disconnected there will only be one path~ - Inside source: true *** True Line Result - [2332, 379, 64, 64], -** Processing line: ~ [2315, 379, 64, 64],~ + # If the star and target are disconnected there will only be one path +** Processing line: ~ # The path should not render in that case~ - Inside source: true *** True Line Result - [2315, 379, 64, 64], -** Processing line: ~ [2334, 316, 64, 64],~ + # The path should not render in that case +** Processing line: ~ unless search.path.size == 1~ - Inside source: true *** True Line Result - [2334, 316, 64, 64], -** Processing line: ~ [2315, 317, 64, 64],~ + unless search.path.size == 1 +** Processing line: ~ search.path.each_key do | cell |~ - Inside source: true *** True Line Result - [2315, 317, 64, 64], -** Processing line: ~ [2332, 254, 64, 64],~ + search.path.each_key do | cell | +** Processing line: ~ # Renders path on both grids~ - Inside source: true *** True Line Result - [2332, 254, 64, 64], -** Processing line: ~ [2314, 254, 64, 64],~ + # Renders path on both grids +** Processing line: ~ outputs.solids << [scale_up(cell), path_color]~ - Inside source: true *** True Line Result - [2314, 254, 64, 64], -** Processing line: ~ [2335, 192, 64, 64],~ + outputs.solids << [scale_up(cell), path_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2335, 192, 64, 64], -** Processing line: ~ [2311, 192, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2311, 192, 64, 64], -** Processing line: ~ [2846, 142, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2846, 142, 64, 64], -** Processing line: ~ [2784, 140, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [2784, 140, 64, 64], -** Processing line: ~ [2846, 79, 64, 64],~ + +** Processing line: ~ # Calculates the path from the target to the star after the search is over~ - Inside source: true *** True Line Result - [2846, 79, 64, 64], -** Processing line: ~ [2847, 41, 64, 64],~ + # Calculates the path from the target to the star after the search is over +** Processing line: ~ # Relies on the came_from hash~ - Inside source: true *** True Line Result - [2847, 41, 64, 64], -** Processing line: ~ [2783, 80, 64, 64],~ + # Relies on the came_from hash +** Processing line: ~ # Fills the search.path hash, which is later rendered on screen~ - Inside source: true *** True Line Result - [2783, 80, 64, 64], -** Processing line: ~ [2790, 39, 64, 64],~ + # Fills the search.path hash, which is later rendered on screen +** Processing line: ~ def calc_path~ - Inside source: true *** True Line Result - [2790, 39, 64, 64], -** Processing line: ~ [2727, 41, 64, 64],~ + def calc_path +** Processing line: ~ endpoint = grid.target~ - Inside source: true *** True Line Result - [2727, 41, 64, 64], -** Processing line: ~ [2665, 43, 64, 64],~ + endpoint = grid.target +** Processing line: ~ while endpoint~ - Inside source: true *** True Line Result - [2665, 43, 64, 64], -** Processing line: ~ [2605, 43, 64, 64],~ + while endpoint +** Processing line: ~ search.path[endpoint] = true~ - Inside source: true *** True Line Result - [2605, 43, 64, 64], -** Processing line: ~ [2543, 44, 64, 64],~ + search.path[endpoint] = true +** Processing line: ~ endpoint = search.came_from[endpoint]~ - Inside source: true *** True Line Result - [2543, 44, 64, 64], -** Processing line: ~ [2480, 45, 64, 64],~ + endpoint = search.came_from[endpoint] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2480, 45, 64, 64], -** Processing line: ~ [2419, 45, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2419, 45, 64, 64], -** Processing line: ~ [2357, 44, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [2357, 44, 64, 64], -** Processing line: ~ [2313, 129, 64, 64],~ + +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ - Inside source: true *** True Line Result - [2313, 129, 64, 64], -** Processing line: ~ [2313, 70, 64, 64],~ + # In code, the cells are represented as 1x1 rectangles +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ - Inside source: true *** True Line Result - [2313, 70, 64, 64], -** Processing line: ~ [2314, 40, 64, 64],~ + # When drawn, the cells are larger than 1x1 rectangles +** Processing line: ~ # This method is used to scale up cells, and lines~ - Inside source: true *** True Line Result - [2314, 40, 64, 64], -** Processing line: ~ [2517, 2385, 64, 64],~ + # This method is used to scale up cells, and lines +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ - Inside source: true *** True Line Result - [2517, 2385, 64, 64], -** Processing line: ~ [2452, 2385, 64, 64],~ + # Objects are scaled up according to the grid.cell_size variable +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ - Inside source: true *** True Line Result - [2452, 2385, 64, 64], -** Processing line: ~ [2390, 2386, 64, 64],~ + # This allows for easy customization of the visual scale of the grid +** Processing line: ~ def scale_up(cell)~ - Inside source: true *** True Line Result - [2390, 2386, 64, 64], -** Processing line: ~ [2328, 2386, 64, 64],~ + def scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ - Inside source: true *** True Line Result - [2328, 2386, 64, 64], -** Processing line: ~ [2264, 2386, 64, 64],~ + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ - Inside source: true *** True Line Result - [2264, 2386, 64, 64], -** Processing line: ~ [2200, 2386, 64, 64],~ + cell = cell.clone +** Processing line: ~~ - Inside source: true *** True Line Result - [2200, 2386, 64, 64], -** Processing line: ~ [2137, 2387, 64, 64],~ + +** Processing line: ~ # If cell is just an x and y coordinate~ - Inside source: true *** True Line Result - [2137, 2387, 64, 64], -** Processing line: ~ [2071, 2385, 64, 64],~ + # If cell is just an x and y coordinate +** Processing line: ~ if cell.size == 2~ - Inside source: true *** True Line Result - [2071, 2385, 64, 64], -** Processing line: ~ [2016, 2389, 64, 64],~ + if cell.size == 2 +** Processing line: ~ # Add a width and height of 1~ - Inside source: true *** True Line Result - [2016, 2389, 64, 64], -** Processing line: ~ [2517, 2341, 64, 64],~ + # Add a width and height of 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - [2517, 2341, 64, 64], -** Processing line: ~ [2518, 2316, 64, 64],~ + cell << 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - [2518, 2316, 64, 64], -** Processing line: ~ [2456, 2316, 64, 64],~ + cell << 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2456, 2316, 64, 64], -** Processing line: ~ [2393, 2316, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [2393, 2316, 64, 64], -** Processing line: ~ [2328, 2317, 64, 64],~ + +** Processing line: ~ # Scale all the values up~ - Inside source: true *** True Line Result - [2328, 2317, 64, 64], -** Processing line: ~ [2264, 2316, 64, 64],~ + # Scale all the values up +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ - Inside source: true *** True Line Result - [2264, 2316, 64, 64], -** Processing line: ~ [2207, 2318, 64, 64],~ + cell.map! { |value| value * grid.cell_size } +** Processing line: ~~ - Inside source: true *** True Line Result - [2207, 2318, 64, 64], -** Processing line: ~ [2144, 2317, 64, 64],~ + +** Processing line: ~ # Returns the scaled up cell~ - Inside source: true *** True Line Result - [2144, 2317, 64, 64], -** Processing line: ~ [2081, 2316, 64, 64],~ + # Returns the scaled up cell +** Processing line: ~ cell~ - Inside source: true *** True Line Result - [2081, 2316, 64, 64], -** Processing line: ~ [2015, 2342, 64, 64],~ + cell +** Processing line: ~ end~ - Inside source: true *** True Line Result - [2015, 2342, 64, 64], -** Processing line: ~ [2016, 2315, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [2016, 2315, 64, 64], -** Processing line: ~ [869, 3709, 64, 64],~ + +** Processing line: ~ # This method processes user input every tick~ - Inside source: true *** True Line Result - [869, 3709, 64, 64], -** Processing line: ~ [819, 3710, 64, 64],~ + # This method processes user input every tick +** Processing line: ~ # Any method with "1" is related to the first grid~ - Inside source: true *** True Line Result - [819, 3710, 64, 64], -** Processing line: ~ [869, 3658, 64, 64],~ + # Any method with "1" is related to the first grid +** Processing line: ~ # Any method with "2" is related to the second grid~ - Inside source: true *** True Line Result - [869, 3658, 64, 64], -** Processing line: ~ [820, 3658, 64, 64],~ + # Any method with "2" is related to the second grid +** Processing line: ~ def input~ - Inside source: true *** True Line Result - [820, 3658, 64, 64], -** Processing line: ~ [0, 0, 64, 64],~ + def input +** Processing line: ~ # The program has to remember that the user is dragging an object~ - Inside source: true *** True Line Result - [0, 0, 64, 64], -** Processing line: ~ [0, 1670, 64, 64],~ + # The program has to remember that the user is dragging an object +** Processing line: ~ # even when the mouse is no longer over that object~ - Inside source: true *** True Line Result - [0, 1670, 64, 64], -** Processing line: ~ [6691, 1653, 64, 64],~ + # even when the mouse is no longer over that object +** Processing line: ~ # So detecting input and processing input is separate~ - Inside source: true *** True Line Result - [6691, 1653, 64, 64], -** Processing line: ~ [1521, 3792, 64, 64],~ + # So detecting input and processing input is separate +** Processing line: ~ # detect_input~ - Inside source: true *** True Line Result - [1521, 3792, 64, 64], -** Processing line: ~ [0, 5137, 64, 64],~ + # detect_input +** Processing line: ~ # process_input~ - Inside source: true *** True Line Result - [0, 5137, 64, 64], -** Processing line: ~ [3898, 2400, 64, 64],~ + # process_input +** Processing line: ~ if inputs.mouse.up~ - Inside source: true *** True Line Result - [3898, 2400, 64, 64], -** Processing line: ~ [3835, 2400, 64, 64],~ + if inputs.mouse.up +** Processing line: ~ state.current_input = :none~ - Inside source: true *** True Line Result - [3835, 2400, 64, 64], -** Processing line: ~ [3771, 2400, 64, 64],~ + state.current_input = :none +** Processing line: ~ elsif star_clicked?~ - Inside source: true *** True Line Result - [3771, 2400, 64, 64], -** Processing line: ~ [3708, 2401, 64, 64],~ + elsif star_clicked? +** Processing line: ~ state.current_input = :star~ - Inside source: true *** True Line Result - [3708, 2401, 64, 64], -** Processing line: ~ [3646, 2401, 64, 64],~ + state.current_input = :star +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3646, 2401, 64, 64], -** Processing line: ~ [3587, 2401, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [3587, 2401, 64, 64], -** Processing line: ~ [3530, 2401, 64, 64],~ + +** Processing line: ~ if mouse_inside_grid?~ - Inside source: true *** True Line Result - [3530, 2401, 64, 64], -** Processing line: ~ [3897, 2340, 64, 64],~ + if mouse_inside_grid? +** Processing line: ~ unless grid.target == cell_closest_to_mouse~ - Inside source: true *** True Line Result - [3897, 2340, 64, 64], -** Processing line: ~ [3897, 2295, 64, 64],~ + unless grid.target == cell_closest_to_mouse +** Processing line: ~ grid.target = cell_closest_to_mouse~ - Inside source: true *** True Line Result - [3897, 2295, 64, 64], -** Processing line: ~ [3834, 2296, 64, 64],~ + grid.target = cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3834, 2296, 64, 64], -** Processing line: ~ [3773, 2295, 64, 64],~ + end +** Processing line: ~ if state.current_input == :star~ - Inside source: true *** True Line Result - [3773, 2295, 64, 64], -** Processing line: ~ [3710, 2296, 64, 64],~ + if state.current_input == :star +** Processing line: ~ unless grid.star == cell_closest_to_mouse~ - Inside source: true *** True Line Result - [3710, 2296, 64, 64], -** Processing line: ~ [3656, 2295, 64, 64],~ + unless grid.star == cell_closest_to_mouse +** Processing line: ~ grid.star = cell_closest_to_mouse~ - Inside source: true *** True Line Result - [3656, 2295, 64, 64], -** Processing line: ~ [3593, 2294, 64, 64],~ + grid.star = cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3593, 2294, 64, 64], -** Processing line: ~ [3527, 2339, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3527, 2339, 64, 64], -** Processing line: ~ [3531, 2293, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [3531, 2293, 64, 64], -** Processing line: ~ [4152, 2903, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4152, 2903, 64, 64], -** Processing line: ~ [4155, 2858, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [4155, 2858, 64, 64], -** Processing line: ~ [3942, 1306, 64, 64],~ + +** Processing line: ~ # Determines what the user is editing and stores the value~ - Inside source: true *** True Line Result - [3942, 1306, 64, 64], -** Processing line: ~ [3942, 1279, 64, 64],~ + # Determines what the user is editing and stores the value +** Processing line: ~ # Storing the value allows the user to continue the same edit as long as the~ - Inside source: true *** True Line Result - [3942, 1279, 64, 64], -** Processing line: ~ [3879, 1306, 64, 64],~ + # Storing the value allows the user to continue the same edit as long as the +** Processing line: ~ # mouse left click is held~ - Inside source: true *** True Line Result - [3879, 1306, 64, 64], -** Processing line: ~ [3881, 1278, 64, 64],~ + # mouse left click is held +** Processing line: ~ def detect_input~ - Inside source: true *** True Line Result - [3881, 1278, 64, 64], -** Processing line: ~ [3819, 1305, 64, 64],~ + def detect_input +** Processing line: ~ # When the mouse is up, nothing is being edited~ - Inside source: true *** True Line Result - [3819, 1305, 64, 64], -** Processing line: ~ [3819, 1277, 64, 64],~ + # When the mouse is up, nothing is being edited +** Processing line: ~ if inputs.mouse.up~ - Inside source: true *** True Line Result - [3819, 1277, 64, 64], -** Processing line: ~ [3756, 1306, 64, 64],~ + if inputs.mouse.up +** Processing line: ~ state.current_input = :none~ - Inside source: true *** True Line Result - [3756, 1306, 64, 64], -** Processing line: ~ [3756, 1277, 64, 64],~ + state.current_input = :none +** Processing line: ~ # When the star in the no second grid is clicked~ - Inside source: true *** True Line Result - [3756, 1277, 64, 64], -** Processing line: ~ [3694, 1306, 64, 64],~ + # When the star in the no second grid is clicked +** Processing line: ~ elsif star_clicked?~ - Inside source: true *** True Line Result - [3694, 1306, 64, 64], -** Processing line: ~ [3695, 1277, 64, 64],~ + elsif star_clicked? +** Processing line: ~ state.current_input = :star~ - Inside source: true *** True Line Result - [3695, 1277, 64, 64], -** Processing line: ~ [3631, 1306, 64, 64],~ + state.current_input = :star +** Processing line: ~ # When the target in the no second grid is clicked~ - Inside source: true *** True Line Result - [3631, 1306, 64, 64], -** Processing line: ~ [3632, 1278, 64, 64],~ + # When the target in the no second grid is clicked +** Processing line: ~ elsif target_clicked?~ - Inside source: true *** True Line Result - [3632, 1278, 64, 64], -** Processing line: ~ [3565, 1306, 64, 64],~ + elsif target_clicked? +** Processing line: ~ state.current_input = :target~ - Inside source: true *** True Line Result - [3565, 1306, 64, 64], -** Processing line: ~ [3567, 1279, 64, 64],~ + state.current_input = :target +** Processing line: ~ # When a wall in the first grid is clicked~ - Inside source: true *** True Line Result - [3567, 1279, 64, 64], -** Processing line: ~ [4432, 1165, 64, 64],~ + # When a wall in the first grid is clicked +** Processing line: ~ elsif wall_clicked?~ - Inside source: true *** True Line Result - [4432, 1165, 64, 64], -** Processing line: ~ [4408, 1163, 64, 64],~ + elsif wall_clicked? +** Processing line: ~ state.current_input = :remove_wall~ - Inside source: true *** True Line Result - [4408, 1163, 64, 64], -** Processing line: ~ [5123, 1003, 64, 64],~ + state.current_input = :remove_wall +** Processing line: ~ # When the first grid is clicked~ - Inside source: true *** True Line Result - [5123, 1003, 64, 64], -** Processing line: ~ [5065, 1002, 64, 64],~ + # When the first grid is clicked +** Processing line: ~ elsif grid_clicked?~ - Inside source: true *** True Line Result - [5065, 1002, 64, 64], -** Processing line: ~ [5042, 1002, 64, 64],~ + elsif grid_clicked? +** Processing line: ~ state.current_input = :add_wall~ - Inside source: true *** True Line Result - [5042, 1002, 64, 64], -** Processing line: ~ [6020, 1780, 64, 64],~ + state.current_input = :add_wall +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6020, 1780, 64, 64], -** Processing line: ~ [6020, 1756, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6020, 1756, 64, 64], -** Processing line: ~ [5959, 1780, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [5959, 1780, 64, 64], -** Processing line: ~ [5959, 1752, 64, 64],~ + +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ - Inside source: true *** True Line Result - [5959, 1752, 64, 64], -** Processing line: ~ [5897, 1779, 64, 64],~ + # Processes click and drag based on what the user is currently dragging +** Processing line: ~ def process_input~ - Inside source: true *** True Line Result - [5897, 1779, 64, 64], -** Processing line: ~ [5899, 1752, 64, 64],~ + def process_input +** Processing line: ~ if state.current_input == :star~ - Inside source: true *** True Line Result - [5899, 1752, 64, 64], -** Processing line: ~ [5836, 1779, 64, 64],~ + if state.current_input == :star +** Processing line: ~ input_star~ - Inside source: true *** True Line Result - [5836, 1779, 64, 64], -** Processing line: ~ [5836, 1751, 64, 64],~ + input_star +** Processing line: ~ elsif state.current_input == :target~ - Inside source: true *** True Line Result - [5836, 1751, 64, 64], -** Processing line: ~ [5776, 1780, 64, 64],~ + elsif state.current_input == :target +** Processing line: ~ input_target~ - Inside source: true *** True Line Result - [5776, 1780, 64, 64], -** Processing line: ~ [5776, 1754, 64, 64],~ + input_target +** Processing line: ~ elsif state.current_input == :remove_wall~ - Inside source: true *** True Line Result - [5776, 1754, 64, 64], -** Processing line: ~ [5717, 1780, 64, 64],~ + elsif state.current_input == :remove_wall +** Processing line: ~ input_remove_wall~ - Inside source: true *** True Line Result - [5717, 1780, 64, 64], -** Processing line: ~ [5716, 1752, 64, 64],~ + input_remove_wall +** Processing line: ~ elsif state.current_input == :add_wall~ - Inside source: true *** True Line Result - [5716, 1752, 64, 64], -** Processing line: ~ [5658, 1781, 64, 64],~ + elsif state.current_input == :add_wall +** Processing line: ~ input_add_wall~ - Inside source: true *** True Line Result - [5658, 1781, 64, 64], -** Processing line: ~ [5658, 1755, 64, 64],~ + input_add_wall +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5658, 1755, 64, 64], -** Processing line: ~ [5640, 1781, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [5640, 1781, 64, 64], -** Processing line: ~ [5640, 1754, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [5640, 1754, 64, 64], -** Processing line: ~ [5832, 2095, 64, 64],~ + +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ - Inside source: true *** True Line Result - [5832, 2095, 64, 64], -** Processing line: ~ [5782, 2093, 64, 64],~ + # Moves the star to the cell closest to the mouse in the first grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - [5782, 2093, 64, 64], -** Processing line: ~ [5832, 2044, 64, 64],~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - [5832, 2044, 64, 64], -** Processing line: ~ [5777, 2043, 64, 64],~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def input_star~ - Inside source: true *** True Line Result - [5777, 2043, 64, 64], -** Processing line: ~ [4847, 2577, 64, 64],~ + def input_star +** Processing line: ~ old_star = grid.star.clone~ - Inside source: true *** True Line Result - [4847, 2577, 64, 64], -** Processing line: ~ [4795, 2577, 64, 64],~ + old_star = grid.star.clone +** Processing line: ~ grid.star = cell_closest_to_mouse~ - Inside source: true *** True Line Result - [4795, 2577, 64, 64], -** Processing line: ~ [4846, 2526, 64, 64],~ + grid.star = cell_closest_to_mouse +** Processing line: ~ unless old_star == grid.star~ - Inside source: true *** True Line Result - [4846, 2526, 64, 64], -** Processing line: ~ [4794, 2526, 64, 64],~ + unless old_star == grid.star +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - [4794, 2526, 64, 64], -** Processing line: ~ [8390, 923, 64, 64],~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8390, 923, 64, 64], -** Processing line: ~ [8363, 922, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8363, 922, 64, 64], -** Processing line: ~ [7585, 1084, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [7585, 1084, 64, 64], -** Processing line: ~ [7582, 1058, 64, 64],~ + +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ - Inside source: true *** True Line Result - [7582, 1058, 64, 64], -** Processing line: ~ [7525, 1084, 64, 64],~ + # Moves the target to the grid closest to the mouse in the first grid +** Processing line: ~ # Only reset_searchs the search if the target changes position~ - Inside source: true *** True Line Result - [7525, 1084, 64, 64], -** Processing line: ~ [7524, 1056, 64, 64],~ + # Only reset_searchs the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ - Inside source: true *** True Line Result - [7524, 1056, 64, 64], -** Processing line: ~ [7478, 1085, 64, 64],~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def input_target~ - Inside source: true *** True Line Result - [7478, 1085, 64, 64], -** Processing line: ~ [7476, 1055, 64, 64],~ + def input_target +** Processing line: ~ old_target = grid.target.clone~ - Inside source: true *** True Line Result - [7476, 1055, 64, 64], -** Processing line: ~ [7421, 1086, 64, 64],~ + old_target = grid.target.clone +** Processing line: ~ grid.target = cell_closest_to_mouse~ - Inside source: true *** True Line Result - [7421, 1086, 64, 64], -** Processing line: ~ [7421, 1052, 64, 64],~ + grid.target = cell_closest_to_mouse +** Processing line: ~ unless old_target == grid.target~ - Inside source: true *** True Line Result - [7421, 1052, 64, 64], -** Processing line: ~ [7362, 1085, 64, 64],~ + unless old_target == grid.target +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - [7362, 1085, 64, 64], -** Processing line: ~ [7361, 1053, 64, 64],~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7361, 1053, 64, 64], -** Processing line: ~ [7307, 1087, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7307, 1087, 64, 64], -** Processing line: ~ [7307, 1054, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [7307, 1054, 64, 64], -** Processing line: ~ [7258, 1086, 64, 64],~ + +** Processing line: ~ # Removes walls in the first grid that are under the cursor~ - Inside source: true *** True Line Result - [7258, 1086, 64, 64], -** Processing line: ~ [7255, 1058, 64, 64],~ + # Removes walls in the first grid that are under the cursor +** Processing line: ~ def input_remove_wall~ - Inside source: true *** True Line Result - [7255, 1058, 64, 64], -** Processing line: ~ [7203, 1083, 64, 64],~ + def input_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - [7203, 1083, 64, 64], -** Processing line: ~ [7203, 1055, 64, 64],~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - [7203, 1055, 64, 64], -** Processing line: ~ [7161, 1085, 64, 64],~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - [7161, 1085, 64, 64], -** Processing line: ~ [7158, 1057, 64, 64],~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if mouse_inside_grid?~ - Inside source: true *** True Line Result - [7158, 1057, 64, 64], -** Processing line: ~ [7100, 1083, 64, 64],~ + if mouse_inside_grid? +** Processing line: ~ if grid.walls.has_key?(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - [7100, 1083, 64, 64], -** Processing line: ~ [7099, 1058, 64, 64],~ + if grid.walls.has_key?(cell_closest_to_mouse) +** Processing line: ~ grid.walls.delete(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - [7099, 1058, 64, 64], -** Processing line: ~ [7038, 1082, 64, 64],~ + grid.walls.delete(cell_closest_to_mouse) +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - [7038, 1082, 64, 64], -** Processing line: ~ [7038, 1058, 64, 64],~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - [7038, 1058, 64, 64], -** Processing line: ~ [6982, 1083, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6982, 1083, 64, 64], -** Processing line: ~ [6984, 1057, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6984, 1057, 64, 64], -** Processing line: ~ [0, 0, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [0, 0, 64, 64], -** Processing line: ~ [0, 1670, 64, 64],~ + +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ - Inside source: true *** True Line Result - [0, 1670, 64, 64], -** Processing line: ~ [6691, 1653, 64, 64],~ + # Adds a wall in the first grid in the cell the mouse is over +** Processing line: ~ def input_add_wall~ - Inside source: true *** True Line Result - [6691, 1653, 64, 64], -** Processing line: ~ [1521, 3792, 64, 64],~ + def input_add_wall +** Processing line: ~ if mouse_inside_grid?~ - Inside source: true *** True Line Result - [1521, 3792, 64, 64], -** Processing line: ~ [0, 5137, 64, 64],~ + if mouse_inside_grid? +** Processing line: ~ unless grid.walls.has_key?(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - [0, 5137, 64, 64], -** Processing line: ~ [0, 0, 64, 64],~ + unless grid.walls.has_key?(cell_closest_to_mouse) +** Processing line: ~ grid.walls[cell_closest_to_mouse] = true~ - Inside source: true *** True Line Result - [0, 0, 64, 64], -** Processing line: ~ [0, 1670, 64, 64],~ + grid.walls[cell_closest_to_mouse] = true +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - [0, 1670, 64, 64], -** Processing line: ~ [6691, 1653, 64, 64],~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6691, 1653, 64, 64], -** Processing line: ~ [1521, 3792, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [1521, 3792, 64, 64], -** Processing line: ~ [0, 5137, 64, 64],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [0, 5137, 64, 64], -** Processing line: ~ [0, 0, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [0, 0, 64, 64], -** Processing line: ~ [0, 1670, 64, 64],~ + +** Processing line: ~~ - Inside source: true *** True Line Result - [0, 1670, 64, 64], -** Processing line: ~ [6691, 1653, 64, 64],~ + +** Processing line: ~ # Whenever the user edits the grid,~ - Inside source: true *** True Line Result - [6691, 1653, 64, 64], -** Processing line: ~ [1521, 3792, 64, 64],~ + # Whenever the user edits the grid, +** Processing line: ~ # The search has to be reset_searchd upto the current step~ - Inside source: true *** True Line Result - [1521, 3792, 64, 64], -** Processing line: ~ [0, 5137, 64, 64],~ + # The search has to be reset_searchd upto the current step +** Processing line: ~ # with the current grid as the initial state of the grid~ - Inside source: true *** True Line Result - [0, 5137, 64, 64], -** Processing line: ~ [8346, 424, 64, 64],~ + # with the current grid as the initial state of the grid +** Processing line: ~ def reset_search~ - Inside source: true *** True Line Result - [8346, 424, 64, 64], -** Processing line: ~ [8407, 376, 64, 64],~ + def reset_search +** Processing line: ~ # Reset_Searchs the search~ - Inside source: true *** True Line Result - [8407, 376, 64, 64], -** Processing line: ~ [8375, 386, 64, 64],~ + # Reset_Searchs the search +** Processing line: ~ search.frontier = []~ - Inside source: true *** True Line Result - [8375, 386, 64, 64], -** Processing line: ~ [8407, 347, 64, 64],~ + search.frontier = [] +** Processing line: ~ search.came_from = {}~ - Inside source: true *** True Line Result - [8407, 347, 64, 64], -** Processing line: ~ [8388, 343, 64, 64],~ + search.came_from = {} +** Processing line: ~ search.path = {}~ - Inside source: true *** True Line Result - [8388, 343, 64, 64], -** Processing line: ~ [8320, 423, 64, 64],~ + search.path = {} +** Processing line: ~ end~ - Inside source: true *** True Line Result - [8320, 423, 64, 64], -** Processing line: ~ [8319, 363, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [8319, 363, 64, 64], -** Processing line: ~ [8368, 303, 64, 64],~ + +** Processing line: ~~ - Inside source: true *** True Line Result - [8368, 303, 64, 64], -** Processing line: ~ [8359, 303, 64, 64],~ + +** Processing line: ~ # Returns a list of adjacent cells~ - Inside source: true *** True Line Result - [8359, 303, 64, 64], -** Processing line: ~ [8318, 330, 64, 64],~ + # Returns a list of adjacent cells +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ - Inside source: true *** True Line Result - [8318, 330, 64, 64], -** Processing line: ~ [9369, 425, 64, 64],~ + # Used to determine what the next cells to be added to the frontier are +** Processing line: ~ def adjacent_neighbors(cell)~ - Inside source: true *** True Line Result - [9369, 425, 64, 64], -** Processing line: ~ [9340, 425, 64, 64],~ + def adjacent_neighbors(cell) +** Processing line: ~ neighbors = []~ - Inside source: true *** True Line Result - [9340, 425, 64, 64], -** Processing line: ~ [9431, 376, 64, 64],~ + neighbors = [] +** Processing line: ~~ - Inside source: true *** True Line Result - [9431, 376, 64, 64], -** Processing line: ~ [9414, 382, 64, 64],~ + +** Processing line: ~ # Gets all the valid neighbors into the array~ - Inside source: true *** True Line Result - [9414, 382, 64, 64], -** Processing line: ~ [9387, 391, 64, 64],~ + # Gets all the valid neighbors into the array +** Processing line: ~ # From southern neighbor, clockwise~ - Inside source: true *** True Line Result - [9387, 391, 64, 64], -** Processing line: ~ [9431, 349, 64, 64],~ + # From southern neighbor, clockwise +** Processing line: ~ neighbors << [cell.x, cell.y - 1] unless cell.y == 0~ - Inside source: true *** True Line Result - [9431, 349, 64, 64], -** Processing line: ~ [9412, 344, 64, 64],~ + neighbors << [cell.x, cell.y - 1] unless cell.y == 0 +** Processing line: ~ neighbors << [cell.x - 1, cell.y] unless cell.x == 0~ - Inside source: true *** True Line Result - [9412, 344, 64, 64], -** Processing line: ~ [9392, 305, 64, 64],~ + neighbors << [cell.x - 1, cell.y] unless cell.x == 0 +** Processing line: ~ neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1~ - Inside source: true *** True Line Result - [9392, 305, 64, 64], -** Processing line: ~ [9339, 365, 64, 64],~ + neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1 +** Processing line: ~ neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1~ - Inside source: true *** True Line Result - [9339, 365, 64, 64], -** Processing line: ~ [9341, 333, 64, 64],~ + neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1 +** Processing line: ~~ - Inside source: true *** True Line Result - [9341, 333, 64, 64], -** Processing line: ~ [9384, 301, 64, 64],~ + +** Processing line: ~ # Sorts the neighbors so the rendered path is a zigzag path~ - Inside source: true *** True Line Result - [9384, 301, 64, 64], -** Processing line: ~ [7673, 1896, 64, 64],~ + # Sorts the neighbors so the rendered path is a zigzag path +** Processing line: ~ # Cells in a diagonal direction are given priority~ - Inside source: true *** True Line Result - [7673, 1896, 64, 64], -** Processing line: ~ [7642, 1834, 64, 64],~ + # Cells in a diagonal direction are given priority +** Processing line: ~ # Comment this line to see the difference~ - Inside source: true *** True Line Result - [7642, 1834, 64, 64], -** Processing line: ~ [7646, 1901, 64, 64],~ + # Comment this line to see the difference +** Processing line: ~ neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) }~ - Inside source: true *** True Line Result - [7646, 1901, 64, 64], -** Processing line: ~ [4500, 4054, 64, 64],~ + neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) } +** Processing line: ~~ - Inside source: true *** True Line Result - [4500, 4054, 64, 64], -** Processing line: ~ [4476, 4055, 64, 64],~ + +** Processing line: ~ neighbors~ - Inside source: true *** True Line Result - [4476, 4055, 64, 64], -** Processing line: ~ [4459, 3997, 64, 64],~ + neighbors +** Processing line: ~ end~ - Inside source: true *** True Line Result - [4459, 3997, 64, 64], -** Processing line: ~ [76, 5215, 64, 64],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [76, 5215, 64, 64], -** Processing line: ~ [39, 5217, 64, 64],~ + +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ - Inside source: true *** True Line Result - [39, 5217, 64, 64], -** Processing line: ~ ]~ + # Finds the vertical and horizontal distance of a cell from the star +** Processing line: ~ # and returns the larger value~ - Inside source: true *** True Line Result - ] -** Processing line: ~~ + # and returns the larger value +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ - Inside source: true *** True Line Result - -** Processing line: ~ $mugs = [~ + # This method is used to have a zigzag pattern in the rendered path +** Processing line: ~ # A cell that is [5, 5] from the star,~ - Inside source: true *** True Line Result - $mugs = [ -** Processing line: ~ [85, 87, 39, 43, "sprites/square-orange.png"],~ + # A cell that is [5, 5] from the star, +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ - Inside source: true *** True Line Result - [85, 87, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [958, 1967, 39, 43, "sprites/square-orange.png"],~ + # is explored before over a cell that is [0, 7] away. +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ - Inside source: true *** True Line Result - [958, 1967, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [2537, 1734, 39, 43, "sprites/square-orange.png"],~ + # So, if possible, the search tries to go diagonal (zigzag) first +** Processing line: ~ def proximity_to_star(x, y)~ - Inside source: true *** True Line Result - [2537, 1734, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [3755, 2464, 39, 43, "sprites/square-orange.png"],~ + def proximity_to_star(x, y) +** Processing line: ~ distance_x = (grid.star.x - x).abs~ - Inside source: true *** True Line Result - [3755, 2464, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [1548, 3273, 39, 43, "sprites/square-orange.png"],~ + distance_x = (grid.star.x - x).abs +** Processing line: ~ distance_y = (grid.star.y - y).abs~ - Inside source: true *** True Line Result - [1548, 3273, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [2050, 220, 39, 43, "sprites/square-orange.png"],~ + distance_y = (grid.star.y - y).abs +** Processing line: ~~ - Inside source: true *** True Line Result - [2050, 220, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [854, 297, 39, 43, "sprites/square-orange.png"],~ + +** Processing line: ~ if distance_x > distance_y~ - Inside source: true *** True Line Result - [854, 297, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [343, 526, 39, 43, "sprites/square-orange.png"],~ + if distance_x > distance_y +** Processing line: ~ return distance_x~ - Inside source: true *** True Line Result - [343, 526, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [3454, 772, 39, 43, "sprites/square-orange.png"],~ + return distance_x +** Processing line: ~ else~ - Inside source: true *** True Line Result - [3454, 772, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [5041, 298, 39, 43, "sprites/square-orange.png"],~ + else +** Processing line: ~ return distance_y~ - Inside source: true *** True Line Result - [5041, 298, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [6089, 300, 39, 43, "sprites/square-orange.png"],~ + return distance_y +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6089, 300, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [6518, 295, 39, 43, "sprites/square-orange.png"],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6518, 295, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [7661, 47, 39, 43, "sprites/square-orange.png"],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [7661, 47, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [9392, 1125, 39, 43, "sprites/square-orange.png"],~ + +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - [9392, 1125, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [7298, 1152, 39, 43, "sprites/square-orange.png"],~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - [7298, 1152, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [5816, 1843, 39, 43, "sprites/square-orange.png"],~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ - Inside source: true *** True Line Result - [5816, 1843, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [876, 3772, 39, 43, "sprites/square-orange.png"],~ + # Finding the cell closest to the mouse helps with this +** Processing line: ~ def cell_closest_to_mouse~ - Inside source: true *** True Line Result - [876, 3772, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [1029, 4667, 39, 43, "sprites/square-orange.png"],~ + def cell_closest_to_mouse +** Processing line: ~ # Closest cell to the mouse in the first grid~ - Inside source: true *** True Line Result - [1029, 4667, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [823, 5324, 39, 43, "sprites/square-orange.png"],~ + # Closest cell to the mouse in the first grid +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - [823, 5324, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [3251, 5220, 39, 43, "sprites/square-orange.png"],~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - [3251, 5220, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [4747, 5282, 39, 43, "sprites/square-orange.png"],~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Bound x and y to the grid~ - Inside source: true *** True Line Result - [4747, 5282, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [9325, 5178, 39, 43, "sprites/square-orange.png"],~ + # Bound x and y to the grid +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - [9325, 5178, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [9635, 4298, 39, 43, "sprites/square-orange.png"],~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - [9635, 4298, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [7837, 4127, 39, 43, "sprites/square-orange.png"],~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - [7837, 4127, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [8651, 1971, 39, 43, "sprites/square-orange.png"],~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - [8651, 1971, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [6892, 2031, 39, 43, "sprites/square-orange.png"],~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [6892, 2031, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [4626, 3882, 39, 43, "sprites/square-orange.png"],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [4626, 3882, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [4024, 4554, 39, 43, "sprites/square-orange.png"],~ + +** Processing line: ~ # Signal that the user is going to be moving the star from the first grid~ - Inside source: true *** True Line Result - [4024, 4554, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [3925, 3337, 39, 43, "sprites/square-orange.png"],~ + # Signal that the user is going to be moving the star from the first grid +** Processing line: ~ def star_clicked?~ - Inside source: true *** True Line Result - [3925, 3337, 39, 43, "sprites/square-orange.png"], -** Processing line: ~ [5064, 1064, 39, 43, "sprites/square-orange.png"]~ + def star_clicked? +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(grid.star))~ - Inside source: true *** True Line Result - [5064, 1064, 39, 43, "sprites/square-orange.png"] -** Processing line: ~ ]~ + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(grid.star)) +** 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. +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + # Signal that the user is going to be moving the target from the first grid +** Processing line: ~ def target_clicked?~ +- Inside source: true *** True Line Result - -** Processing line: ~* Platformer - Gorillas Basic - credits.txt~ -- Header detected. + def target_clicked? +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(grid.target))~ +- Inside source: true *** True Line Result - + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(grid.target)) +** Processing line: ~ end~ +- Inside source: true *** True Line Result -* Platformer - Gorillas Basic - credits.txt -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + end +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_platformer/gorillas_basic/CREDITS.txt~ + # Signal that the user is going to be adding walls from the first grid +** Processing line: ~ def grid_clicked?~ - Inside source: true *** True Line Result - # ./samples/99_genre_platformer/gorillas_basic/CREDITS.txt -** Processing line: ~ code: Amir Rajan, https://twitter.com/amirrajan~ + def grid_clicked? +** Processing line: ~ inputs.mouse.down && mouse_inside_grid?~ - Inside source: true *** True Line Result - code: Amir Rajan, https://twitter.com/amirrajan -** Processing line: ~ graphics: Nick Culbertson, https://twitter.com/MobyPixel~ + inputs.mouse.down && mouse_inside_grid? +** Processing line: ~ end~ - Inside source: true *** True Line Result - graphics: Nick Culbertson, https://twitter.com/MobyPixel + end ** Processing line: ~~ - Inside source: true *** True Line Result +** Processing line: ~ # Returns whether the mouse is inside of the first grid~ +- Inside source: true +*** True Line Result + # Returns whether the mouse is inside of the first grid +** Processing line: ~ # Part of the condition that checks whether the user is adding a wall~ +- Inside source: true +*** True Line Result + # Part of the condition that checks whether the user is adding a wall +** Processing line: ~ def mouse_inside_grid?~ +- Inside source: true +*** True Line Result + def mouse_inside_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up(grid.rect))~ +- Inside source: true +*** True Line Result + inputs.mouse.point.inside_rect?(scale_up(grid.rect)) +** 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. +** Processing line: ~ # These methods provide handy aliases to colors~ +- Inside source: true *** True Line Result -#+end_src + # These methods provide handy aliases to colors ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Platformer - Gorillas Basic - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Platformer - Gorillas Basic - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +** Processing line: ~ # Light brown~ +- Inside source: true *** True Line Result - + # Light brown +** Processing line: ~ def unvisited_color~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_platformer/gorillas_basic/app/main.rb~ + def unvisited_color +** Processing line: ~ [221, 212, 213]~ - Inside source: true *** True Line Result - # ./samples/99_genre_platformer/gorillas_basic/app/main.rb -** Processing line: ~ class YouSoBasicGorillas~ + [221, 212, 213] +** Processing line: ~ # [255, 255, 255]~ - Inside source: true *** True Line Result - class YouSoBasicGorillas -** Processing line: ~ attr_accessor :outputs, :grid, :state, :inputs~ + # [255, 255, 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_accessor :outputs, :grid, :state, :inputs + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick~ +** Processing line: ~ # Camo Green~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ defaults~ + # Camo Green +** Processing line: ~ def wall_color~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ render~ + def wall_color +** Processing line: ~ [134, 134, 120]~ - Inside source: true *** True Line Result - render -** Processing line: ~ calc~ + [134, 134, 120] +** Processing line: ~ end~ - Inside source: true *** True Line Result - calc -** Processing line: ~ process_inputs~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - process_inputs + +** Processing line: ~ # Pastel White~ +- Inside source: true +*** True Line Result + # Pastel White +** Processing line: ~ def path_color~ +- Inside source: true +*** True Line Result + def path_color +** Processing line: ~ [231, 230, 228]~ +- Inside source: true +*** True Line Result + [231, 230, 228] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -63727,110 +67224,114 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def defaults~ +** Processing line: ~ def red~ - Inside source: true *** True Line Result - def defaults -** Processing line: ~ outputs.background_color = [33, 32, 87]~ + def red +** Processing line: ~ [255, 0, 0]~ - Inside source: true *** True Line Result - outputs.background_color = [33, 32, 87] -** Processing line: ~ state.building_spacing = 1~ + [255, 0, 0] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.building_spacing = 1 -** Processing line: ~ state.building_room_spacing = 15~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.building_room_spacing = 15 -** Processing line: ~ state.building_room_width = 10~ + +** Processing line: ~ def purple~ - Inside source: true *** True Line Result - state.building_room_width = 10 -** Processing line: ~ state.building_room_height = 15~ + def purple +** Processing line: ~ [149, 64, 191]~ - Inside source: true *** True Line Result - state.building_room_height = 15 -** Processing line: ~ state.building_heights = [4, 4, 6, 8, 15, 20, 18]~ + [149, 64, 191] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.building_heights = [4, 4, 6, 8, 15, 20, 18] -** Processing line: ~ state.building_room_sizes = [5, 4, 6, 7]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.building_room_sizes = [5, 4, 6, 7] -** Processing line: ~ state.gravity = 0.25~ + +** Processing line: ~ # Makes code more concise~ - Inside source: true *** True Line Result - state.gravity = 0.25 -** Processing line: ~ state.first_strike ||= :player_1~ + # Makes code more concise +** Processing line: ~ def grid~ - Inside source: true *** True Line Result - state.first_strike ||= :player_1 -** Processing line: ~ state.buildings ||= []~ + def grid +** Processing line: ~ state.grid~ - Inside source: true *** True Line Result - state.buildings ||= [] -** Processing line: ~ state.holes ||= []~ + state.grid +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.holes ||= [] -** Processing line: ~ state.player_1_score ||= 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.player_1_score ||= 0 -** Processing line: ~ state.player_2_score ||= 0~ + +** Processing line: ~ def search~ - Inside source: true *** True Line Result - state.player_2_score ||= 0 -** Processing line: ~ state.wind ||= 0~ + def search +** Processing line: ~ state.search~ - Inside source: true *** True Line Result - state.wind ||= 0 + state.search ** 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~ +** Processing line: ~ # Method that is called by DragonRuby periodically~ - Inside source: true *** True Line Result - def render -** Processing line: ~ render_stage~ + # Method that is called by DragonRuby periodically +** Processing line: ~ # Used for updating animations and calculations~ - Inside source: true *** True Line Result - render_stage -** Processing line: ~ render_value_insertion~ + # Used for updating animations and calculations +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - render_value_insertion -** Processing line: ~ render_gorillas~ + def tick args +** Processing line: ~~ - Inside source: true *** True Line Result - render_gorillas -** Processing line: ~ render_holes~ + +** Processing line: ~ # Pressing r will reset the application~ - Inside source: true *** True Line Result - render_holes -** Processing line: ~ render_banana~ + # Pressing r will reset the application +** Processing line: ~ if args.inputs.keyboard.key_down.r~ - Inside source: true *** True Line Result - render_banana -** Processing line: ~ render_game_over~ + if args.inputs.keyboard.key_down.r +** Processing line: ~ args.gtk.reset~ - Inside source: true *** True Line Result - render_game_over -** Processing line: ~ render_score~ + args.gtk.reset +** Processing line: ~ reset~ - Inside source: true *** True Line Result - render_score -** Processing line: ~ render_wind~ + reset +** Processing line: ~ return~ - Inside source: true *** True Line Result - render_wind + return ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -63839,262 +67340,250 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render_score~ -- Inside source: true -*** True Line Result - def render_score -** Processing line: ~ outputs.primitives << [0, 0, 1280, 31, fancy_white].solid~ +** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ - Inside source: true *** True Line Result - outputs.primitives << [0, 0, 1280, 31, fancy_white].solid -** Processing line: ~ outputs.primitives << [1, 1, 1279, 29].solid~ + # Every tick, new args are passed, and the Breadth First Search tick is called +** Processing line: ~ $breadcrumbs ||= Breadcrumbs.new(args)~ - Inside source: true *** True Line Result - outputs.primitives << [1, 1, 1279, 29].solid -** Processing line: ~ outputs.labels << [ 10, 25, "Score: #{state.player_1_score}", 0, 0, fancy_white]~ + $breadcrumbs ||= Breadcrumbs.new(args) +** Processing line: ~ $breadcrumbs.args = args~ - Inside source: true *** True Line Result - outputs.labels << [ 10, 25, "Score: #{state.player_1_score}", 0, 0, fancy_white] -** Processing line: ~ outputs.labels << [1270, 25, "Score: #{state.player_2_score}", 0, 2, fancy_white]~ + $breadcrumbs.args = args +** Processing line: ~ $breadcrumbs.tick~ - Inside source: true *** True Line Result - outputs.labels << [1270, 25, "Score: #{state.player_2_score}", 0, 2, fancy_white] -** Processing line: ~ end~ + $breadcrumbs.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_wind~ +** Processing line: ~~ - Inside source: true *** True Line Result - def render_wind -** Processing line: ~ outputs.primitives << [640, 12, state.wind * 500 + state.wind * 10 * rand, 4, 35, 136, 162].solid~ + +** Processing line: ~ def reset~ - Inside source: true *** True Line Result - outputs.primitives << [640, 12, state.wind * 500 + state.wind * 10 * rand, 4, 35, 136, 162].solid -** Processing line: ~ outputs.lines << [640, 30, 640, 0, fancy_white]~ + def reset +** Processing line: ~ $breadcrumbs = nil~ - Inside source: true *** True Line Result - outputs.lines << [640, 30, 640, 0, fancy_white] -** Processing line: ~ end~ + $breadcrumbs = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_game_over~ -- Inside source: true -*** True Line Result - def render_game_over -** Processing line: ~ return unless state.over~ +** Processing line: ~ # # Representation of how far away visited cells are from the star~ - Inside source: true *** True Line Result - return unless state.over -** Processing line: ~ outputs.primitives << [grid.rect, 0, 0, 0, 200].solid~ + # # Representation of how far away visited cells are from the star +** Processing line: ~ # # Replaces the render_visited method~ - Inside source: true *** True Line Result - outputs.primitives << [grid.rect, 0, 0, 0, 200].solid -** Processing line: ~ outputs.primitives << [640, 370, "Game Over!!", 5, 1, fancy_white].label~ + # # Replaces the render_visited method +** Processing line: ~ # # Visually demonstrates the effectiveness of early exit for pathfinding~ - Inside source: true *** True Line Result - outputs.primitives << [640, 370, "Game Over!!", 5, 1, fancy_white].label -** Processing line: ~ if state.winner == :player_1~ + # # Visually demonstrates the effectiveness of early exit for pathfinding +** Processing line: ~ # def render_heat_map~ - Inside source: true *** True Line Result - if state.winner == :player_1 -** Processing line: ~ outputs.primitives << [640, 340, "Player 1 Wins!!", 5, 1, fancy_white].label~ + # def render_heat_map +** Processing line: ~ # # THIS CODE NEEDS SOME FIXING DUE TO REFACTORING~ - Inside source: true *** True Line Result - outputs.primitives << [640, 340, "Player 1 Wins!!", 5, 1, fancy_white].label -** Processing line: ~ else~ + # # THIS CODE NEEDS SOME FIXING DUE TO REFACTORING +** Processing line: ~ # search.came_from.each_key do | cell |~ - Inside source: true *** True Line Result - else -** Processing line: ~ outputs.primitives << [640, 340, "Player 2 Wins!!", 5, 1, fancy_white].label~ + # search.came_from.each_key do | cell | +** Processing line: ~ # distance = (grid.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs~ - Inside source: true *** True Line Result - outputs.primitives << [640, 340, "Player 2 Wins!!", 5, 1, fancy_white].label -** Processing line: ~ end~ + # distance = (grid.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs +** Processing line: ~ # max_distance = grid.width + grid.height~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # max_distance = grid.width + grid.height +** Processing line: ~ # alpha = 255.to_i * distance.to_i / max_distance.to_i~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # alpha = 255.to_i * distance.to_i / max_distance.to_i +** Processing line: ~ # outputs.solids << [scale_up(visited_cell), red, alpha]~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_stage~ + # outputs.solids << [scale_up(visited_cell), red, alpha] +** Processing line: ~ # # outputs.solids << [early_exit_scale_up(visited_cell), red, alpha]~ - Inside source: true *** True Line Result - def render_stage -** Processing line: ~ return unless state.stage_generated~ + # # outputs.solids << [early_exit_scale_up(visited_cell), red, alpha] +** Processing line: ~ # end~ - Inside source: true *** True Line Result - return unless state.stage_generated -** Processing line: ~ return if state.stage_rendered~ + # end +** Processing line: ~ # end~ - Inside source: true *** True Line Result - return if state.stage_rendered + # end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.static_solids << [grid.rect, 33, 32, 87]~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - outputs.static_solids << [grid.rect, 33, 32, 87] -** Processing line: ~ outputs.static_solids << state.buildings.map(&:solids)~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - outputs.static_solids << state.buildings.map(&:solids) -** Processing line: ~ state.stage_rendered = true~ -- Inside source: true + +** Processing line: ~*** Path Finding Algorithms - Early Exit - main.rb~ +- Header detected. *** True Line Result - state.stage_rendered = true -** Processing line: ~ end~ -- Inside source: true + *** True Line Result - end -** Processing line: ~~ -- Inside source: true +*** Path Finding Algorithms - Early Exit - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ def render_gorilla gorilla, id~ -- Inside source: true *** True Line Result - def render_gorilla gorilla, id -** Processing line: ~ return unless gorilla~ +#+begin_src ruby +** Processing line: ~ # ./samples/13_path_finding_algorithms/04_early_exit/app/main.rb~ - Inside source: true *** True Line Result - return unless gorilla -** Processing line: ~ if state.banana && state.banana.owner == gorilla~ + # ./samples/13_path_finding_algorithms/04_early_exit/app/main.rb +** Processing line: ~ # Comparison of a breadth first search with and without early exit~ - Inside source: true *** True Line Result - if state.banana && state.banana.owner == gorilla -** Processing line: ~ animation_index = state.banana.created_at.frame_index(3, 5, false)~ + # Comparison of a breadth first search with and without early exit +** Processing line: ~ # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ - Inside source: true *** True Line Result - animation_index = state.banana.created_at.frame_index(3, 5, false) -** Processing line: ~ end~ + # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ if !animation_index~ + +** Processing line: ~ # Demonstrates the exploration difference caused by early exit~ - Inside source: true *** True Line Result - if !animation_index -** Processing line: ~ outputs.sprites << [gorilla.solid, "sprites/#{id}-idle.png"]~ + # Demonstrates the exploration difference caused by early exit +** Processing line: ~ # Also demonstrates how breadth first search is used for path generation~ - Inside source: true *** True Line Result - outputs.sprites << [gorilla.solid, "sprites/#{id}-idle.png"] -** Processing line: ~ else~ + # Also demonstrates how breadth first search is used for path generation +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ outputs.sprites << [gorilla.solid, "sprites/#{id}-#{animation_index}.png"]~ + +** Processing line: ~ # The left grid is a breadth first search without early exit~ - Inside source: true *** True Line Result - outputs.sprites << [gorilla.solid, "sprites/#{id}-#{animation_index}.png"] -** Processing line: ~ end~ + # The left grid is a breadth first search without early exit +** Processing line: ~ # The right grid is a breadth first search with early exit~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # The right grid is a breadth first search with early exit +** Processing line: ~ # The red squares represent how far the search expanded~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # The red squares represent how far the search expanded +** Processing line: ~ # The darker the red, the farther the search proceeded~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_gorillas~ + # The darker the red, the farther the search proceeded +** Processing line: ~ # Comparison of the heat map reveals how much searching can be saved by early exit~ - Inside source: true *** True Line Result - def render_gorillas -** Processing line: ~ render_gorilla state.player_1, :left~ + # Comparison of the heat map reveals how much searching can be saved by early exit +** Processing line: ~ # The white path shows path generation via breadth first search~ - Inside source: true *** True Line Result - render_gorilla state.player_1, :left -** Processing line: ~ render_gorilla state.player_2, :right~ + # The white path shows path generation via breadth first search +** Processing line: ~ class EarlyExitBreadthFirstSearch~ - Inside source: true *** True Line Result - render_gorilla state.player_2, :right -** Processing line: ~ end~ + class EarlyExitBreadthFirstSearch +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - end + attr_gtk ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_value_insertion~ +** Processing line: ~ # This method is called every frame/tick~ - Inside source: true *** True Line Result - def render_value_insertion -** Processing line: ~ return if state.banana~ + # This method is called every frame/tick +** Processing line: ~ # Every tick, the current state of the search is rendered on the screen,~ - Inside source: true *** True Line Result - return if state.banana -** Processing line: ~ return if state.over~ + # Every tick, the current state of the search is rendered on the screen, +** Processing line: ~ # User input is processed, and~ - Inside source: true *** True Line Result - return if state.over -** Processing line: ~~ + # User input is processed, and +** Processing line: ~ # The next step in the search is calculated~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.current_turn == :player_1_angle~ + # The next step in the search is calculated +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - if state.current_turn == :player_1_angle -** Processing line: ~ outputs.labels << [ 10, 710, "Angle: #{state.player_1_angle}_", fancy_white]~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - outputs.labels << [ 10, 710, "Angle: #{state.player_1_angle}_", fancy_white] -** Processing line: ~ elsif state.current_turn == :player_1_velocity~ + defaults +** Processing line: ~ # If the grid has not been searched~ - Inside source: true *** True Line Result - elsif state.current_turn == :player_1_velocity -** Processing line: ~ outputs.labels << [ 10, 710, "Angle: #{state.player_1_angle}", fancy_white]~ + # If the grid has not been searched +** Processing line: ~ if state.visited.empty?~ - Inside source: true *** True Line Result - outputs.labels << [ 10, 710, "Angle: #{state.player_1_angle}", fancy_white] -** Processing line: ~ outputs.labels << [ 10, 690, "Velocity: #{state.player_1_velocity}_", fancy_white]~ + if state.visited.empty? +** Processing line: ~ # Complete the search~ - Inside source: true *** True Line Result - outputs.labels << [ 10, 690, "Velocity: #{state.player_1_velocity}_", fancy_white] -** Processing line: ~ elsif state.current_turn == :player_2_angle~ + # Complete the search +** Processing line: ~ state.max_steps.times { step }~ - Inside source: true *** True Line Result - elsif state.current_turn == :player_2_angle -** Processing line: ~ outputs.labels << [1120, 710, "Angle: #{state.player_2_angle}_", fancy_white]~ + state.max_steps.times { step } +** Processing line: ~ # And calculate the path~ - Inside source: true *** True Line Result - outputs.labels << [1120, 710, "Angle: #{state.player_2_angle}_", fancy_white] -** Processing line: ~ elsif state.current_turn == :player_2_velocity~ + # And calculate the path +** Processing line: ~ calc_path~ - Inside source: true *** True Line Result - elsif state.current_turn == :player_2_velocity -** Processing line: ~ outputs.labels << [1120, 710, "Angle: #{state.player_2_angle}", fancy_white]~ + calc_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.labels << [1120, 710, "Angle: #{state.player_2_angle}", fancy_white] -** Processing line: ~ outputs.labels << [1120, 690, "Velocity: #{state.player_2_velocity}_", fancy_white]~ + end +** Processing line: ~ render~ - Inside source: true *** True Line Result - outputs.labels << [1120, 690, "Velocity: #{state.player_2_velocity}_", fancy_white] -** Processing line: ~ end~ + render +** Processing line: ~ input~ - Inside source: true *** True Line Result - end + input ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -64103,210 +67592,226 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render_banana~ +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - def render_banana -** Processing line: ~ return unless state.banana~ + def defaults +** Processing line: ~ # Variables to edit the size and appearance of the grid~ - Inside source: true *** True Line Result - return unless state.banana -** Processing line: ~ rotation = state.tick_count.%(360) * 20~ + # Variables to edit the size and appearance of the grid +** Processing line: ~ # Freely customizable to user's liking~ - Inside source: true *** True Line Result - rotation = state.tick_count.%(360) * 20 -** Processing line: ~ rotation *= -1 if state.banana.dx > 0~ + # Freely customizable to user's liking +** Processing line: ~ grid.width ||= 15~ - Inside source: true *** True Line Result - rotation *= -1 if state.banana.dx > 0 -** Processing line: ~ outputs.sprites << [state.banana.x, state.banana.y, 15, 15, 'sprites/banana.png', rotation]~ + grid.width ||= 15 +** Processing line: ~ grid.height ||= 15~ - Inside source: true *** True Line Result - outputs.sprites << [state.banana.x, state.banana.y, 15, 15, 'sprites/banana.png', rotation] -** Processing line: ~ end~ + grid.height ||= 15 +** Processing line: ~ grid.cell_size ||= 40~ - Inside source: true *** True Line Result - end + grid.cell_size ||= 40 +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ +- Inside source: true +*** True Line Result + grid.rect ||= [0, 0, grid.width, grid.height] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_holes~ +** Processing line: ~ # At some step the animation will end,~ - Inside source: true *** True Line Result - def render_holes -** Processing line: ~ outputs.sprites << state.holes.map do |s|~ + # At some step the animation will end, +** Processing line: ~ # and further steps won't change anything (the whole grid.widthill be explored)~ - Inside source: true *** True Line Result - outputs.sprites << state.holes.map do |s| -** Processing line: ~ animation_index = s.created_at.frame_index(7, 3, false)~ + # and further steps won't change anything (the whole grid.widthill be explored) +** Processing line: ~ # This step is roughly the grid's width * height~ - Inside source: true *** True Line Result - animation_index = s.created_at.frame_index(7, 3, false) -** Processing line: ~ if animation_index~ + # This step is roughly the grid's width * height +** Processing line: ~ # When anim_steps equals max_steps no more calculations will occur~ - Inside source: true *** True Line Result - if animation_index -** Processing line: ~ [s.sprite, [s.sprite.rect, "sprites/explosion#{animation_index}.png" ]]~ + # When anim_steps equals max_steps no more calculations will occur +** Processing line: ~ # and the slider will be at the end~ - Inside source: true *** True Line Result - [s.sprite, [s.sprite.rect, "sprites/explosion#{animation_index}.png" ]] -** Processing line: ~ else~ + # and the slider will be at the end +** Processing line: ~ state.max_steps ||= args.state.grid.width * args.state.grid.height~ - Inside source: true *** True Line Result - else -** Processing line: ~ s.sprite~ + state.max_steps ||= args.state.grid.width * args.state.grid.height +** Processing line: ~~ - Inside source: true *** True Line Result - s.sprite -** Processing line: ~ end~ + +** Processing line: ~ # The location of the star and walls of the grid~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # The location of the star and walls of the grid +** Processing line: ~ # They can be modified to have a different initial grid~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # They can be modified to have a different initial grid +** Processing line: ~ # Walls are stored in a hash for quick look up when doing the search~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Walls are stored in a hash for quick look up when doing the search +** Processing line: ~ state.star ||= [2, 8]~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc~ + state.star ||= [2, 8] +** Processing line: ~ state.target ||= [10, 5]~ - Inside source: true *** True Line Result - def calc -** Processing line: ~ calc_generate_stage~ + state.target ||= [10, 5] +** Processing line: ~ state.walls ||= {}~ - Inside source: true *** True Line Result - calc_generate_stage -** Processing line: ~ calc_current_turn~ + state.walls ||= {} +** Processing line: ~~ - Inside source: true *** True Line Result - calc_current_turn -** Processing line: ~ calc_banana~ + +** Processing line: ~ # Variables that are used by the breadth first search~ - Inside source: true *** True Line Result - calc_banana -** Processing line: ~ end~ + # Variables that are used by the breadth first search +** Processing line: ~ # Storing cells that the search has visited, prevents unnecessary steps~ - Inside source: true *** True Line Result - end + # Storing cells that the search has visited, prevents unnecessary steps +** Processing line: ~ # Expanding the frontier of the search in order makes the search expand~ +- Inside source: true +*** True Line Result + # Expanding the frontier of the search in order makes the search expand +** Processing line: ~ # from the center outward~ +- Inside source: true +*** True Line Result + # from the center outward ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc_current_turn~ +** Processing line: ~ # Visited cells in the first grid~ - Inside source: true *** True Line Result - def calc_current_turn -** Processing line: ~ return if state.current_turn~ + # Visited cells in the first grid +** Processing line: ~ state.visited ||= {}~ - Inside source: true *** True Line Result - return if state.current_turn -** Processing line: ~~ + state.visited ||= {} +** Processing line: ~ # Visited cells in the second grid~ - Inside source: true *** True Line Result - -** Processing line: ~ state.current_turn = :player_1_angle~ + # Visited cells in the second grid +** Processing line: ~ state.early_exit_visited ||= {}~ - Inside source: true *** True Line Result - state.current_turn = :player_1_angle -** Processing line: ~ state.current_turn = :player_2_angle if state.first_strike == :player_2~ + state.early_exit_visited ||= {} +** Processing line: ~ # The cells from which the search is to expand~ - Inside source: true *** True Line Result - state.current_turn = :player_2_angle if state.first_strike == :player_2 -** Processing line: ~ end~ + # The cells from which the search is to expand +** Processing line: ~ state.frontier ||= []~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.frontier ||= [] +** Processing line: ~ # A hash of where each cell was expanded from~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_generate_stage~ + # A hash of where each cell was expanded from +** Processing line: ~ # The key is a cell, and the value is the cell it came from~ - Inside source: true *** True Line Result - def calc_generate_stage -** Processing line: ~ return if state.stage_generated~ + # The key is a cell, and the value is the cell it came from +** Processing line: ~ state.came_from ||= {}~ - Inside source: true *** True Line Result - return if state.stage_generated -** Processing line: ~~ + state.came_from ||= {} +** Processing line: ~ # Cells that are part of the path from the target to the star~ - Inside source: true *** True Line Result - -** Processing line: ~ state.buildings << building_prefab(state.building_spacing + -20, *random_building_size)~ + # Cells that are part of the path from the target to the star +** Processing line: ~ state.path ||= {}~ - Inside source: true *** True Line Result - state.buildings << building_prefab(state.building_spacing + -20, *random_building_size) -** Processing line: ~ 8.numbers.inject(state.buildings) do |buildings, i|~ + state.path ||= {} +** Processing line: ~~ - Inside source: true *** True Line Result - 8.numbers.inject(state.buildings) do |buildings, i| -** Processing line: ~ buildings <<~ + +** Processing line: ~ # What the user is currently editing on the grid~ - Inside source: true *** True Line Result - buildings << -** Processing line: ~ building_prefab(state.building_spacing +~ + # What the user is currently editing on the grid +** Processing line: ~ # We store this value, because we want to remember the value even when~ - Inside source: true *** True Line Result - building_prefab(state.building_spacing + -** Processing line: ~ state.buildings.last.right,~ + # We store this value, because we want to remember the value even when +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ - Inside source: true *** True Line Result - state.buildings.last.right, -** Processing line: ~ *random_building_size)~ + # the user's cursor is no longer over what they're interacting with, but +** Processing line: ~ # they are still clicking down on the mouse.~ - Inside source: true *** True Line Result - *random_building_size) -** Processing line: ~ end~ + # they are still clicking down on the mouse. +** Processing line: ~ state.current_input ||= :none~ - Inside source: true *** True Line Result - end + state.current_input ||= :none +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ building_two = state.buildings[1]~ +** Processing line: ~ # Draws everything onto the screen~ - Inside source: true *** True Line Result - building_two = state.buildings[1] -** Processing line: ~ state.player_1 = new_player(building_two.x + building_two.w.fdiv(2),~ + # Draws everything onto the screen +** Processing line: ~ def render~ - Inside source: true *** True Line Result - state.player_1 = new_player(building_two.x + building_two.w.fdiv(2), -** Processing line: ~ building_two.h)~ + def render +** Processing line: ~ render_background~ - Inside source: true *** True Line Result - building_two.h) -** Processing line: ~~ + render_background +** Processing line: ~ render_heat_map~ - Inside source: true *** True Line Result - -** Processing line: ~ building_nine = state.buildings[-3]~ + render_heat_map +** Processing line: ~ render_walls~ - Inside source: true *** True Line Result - building_nine = state.buildings[-3] -** Processing line: ~ state.player_2 = new_player(building_nine.x + building_nine.w.fdiv(2),~ + render_walls +** Processing line: ~ render_path~ - Inside source: true *** True Line Result - state.player_2 = new_player(building_nine.x + building_nine.w.fdiv(2), -** Processing line: ~ building_nine.h)~ + render_path +** Processing line: ~ render_star~ - Inside source: true *** True Line Result - building_nine.h) -** Processing line: ~ state.stage_generated = true~ + render_star +** Processing line: ~ render_target~ - Inside source: true *** True Line Result - state.stage_generated = true -** Processing line: ~ state.wind = 1.randomize(:ratio, :sign)~ + render_target +** Processing line: ~ render_labels~ - Inside source: true *** True Line Result - state.wind = 1.randomize(:ratio, :sign) + render_labels ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -64315,30 +67820,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 new_player x, y~ +** Processing line: ~ # The methods below subdivide the task of drawing everything to the screen~ - Inside source: true *** True Line Result - def new_player x, y -** Processing line: ~ state.new_entity(:gorilla) do |p|~ + # The methods below subdivide the task of drawing everything to the screen +** Processing line: ~~ - Inside source: true *** True Line Result - state.new_entity(:gorilla) do |p| -** Processing line: ~ p.x = x - 25~ + +** Processing line: ~ # Draws what the grid looks like with nothing on it~ - Inside source: true *** True Line Result - p.x = x - 25 -** Processing line: ~ p.y = y~ + # Draws what the grid looks like with nothing on it +** Processing line: ~ def render_background~ - Inside source: true *** True Line Result - p.y = y -** Processing line: ~ p.solid = [p.x, p.y, 50, 50]~ + def render_background +** Processing line: ~ render_unvisited~ - Inside source: true *** True Line Result - p.solid = [p.x, p.y, 50, 50] -** Processing line: ~ end~ + render_unvisited +** Processing line: ~ render_grid_lines~ - Inside source: true *** True Line Result - end + render_grid_lines ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -64347,174 +67852,186 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_banana~ +** Processing line: ~ # Draws both grids~ - Inside source: true *** True Line Result - def calc_banana -** Processing line: ~ return unless state.banana~ + # Draws both grids +** Processing line: ~ def render_unvisited~ - Inside source: true *** True Line Result - return unless state.banana -** Processing line: ~~ + def render_unvisited +** Processing line: ~ outputs.solids << [scale_up(grid.rect), unvisited_color]~ - Inside source: true *** True Line Result - -** Processing line: ~ state.banana.x += state.banana.dx~ + outputs.solids << [scale_up(grid.rect), unvisited_color] +** Processing line: ~ outputs.solids << [early_exit_scale_up(grid.rect), unvisited_color]~ - Inside source: true *** True Line Result - state.banana.x += state.banana.dx -** Processing line: ~ state.banana.dx += state.wind.fdiv(50)~ + outputs.solids << [early_exit_scale_up(grid.rect), unvisited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.banana.dx += state.wind.fdiv(50) -** Processing line: ~ state.banana.y += state.banana.dy~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.banana.y += state.banana.dy -** Processing line: ~ state.banana.dy -= state.gravity~ + +** Processing line: ~ # Draws grid lines to show the division of the grid into cells~ - Inside source: true *** True Line Result - state.banana.dy -= state.gravity -** Processing line: ~ banana_collision = [state.banana.x, state.banana.y, 10, 10]~ + # Draws grid lines to show the division of the grid into cells +** Processing line: ~ def render_grid_lines~ - Inside source: true *** True Line Result - banana_collision = [state.banana.x, state.banana.y, 10, 10] -** Processing line: ~~ + def render_grid_lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.player_1 && banana_collision.intersect_rect?(state.player_1.solid)~ + for x in 0..grid.width +** Processing line: ~ outputs.lines << vertical_line(x)~ - Inside source: true *** True Line Result - if state.player_1 && banana_collision.intersect_rect?(state.player_1.solid) -** Processing line: ~ state.over = true~ + outputs.lines << vertical_line(x) +** Processing line: ~ outputs.lines << early_exit_vertical_line(x)~ - Inside source: true *** True Line Result - state.over = true -** Processing line: ~ if state.banana.owner == state.player_2~ + outputs.lines << early_exit_vertical_line(x) +** Processing line: ~ end~ - Inside source: true *** True Line Result - if state.banana.owner == state.player_2 -** Processing line: ~ state.winner = :player_2~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.winner = :player_2 -** Processing line: ~ else~ + +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.winner = :player_1~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << horizontal_line(y)~ - Inside source: true *** True Line Result - state.winner = :player_1 -** Processing line: ~ end~ + outputs.lines << horizontal_line(y) +** Processing line: ~ outputs.lines << early_exit_horizontal_line(y)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.lines << early_exit_horizontal_line(y) +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ state.player_2_score += 1~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.player_2_score += 1 -** Processing line: ~ elsif state.player_2 && banana_collision.intersect_rect?(state.player_2.solid)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif state.player_2 && banana_collision.intersect_rect?(state.player_2.solid) -** Processing line: ~ state.over = true~ + +** Processing line: ~ # Easy way to draw vertical lines given an index~ - Inside source: true *** True Line Result - state.over = true -** Processing line: ~ if state.banana.owner == state.player_2~ + # Easy way to draw vertical lines given an index +** Processing line: ~ def vertical_line column~ - Inside source: true *** True Line Result - if state.banana.owner == state.player_2 -** Processing line: ~ state.winner = :player_1~ + def vertical_line column +** Processing line: ~ scale_up([column, 0, column, grid.height])~ - Inside source: true *** True Line Result - state.winner = :player_1 -** Processing line: ~ else~ + scale_up([column, 0, column, grid.height]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.winner = :player_2~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.winner = :player_2 -** Processing line: ~ end~ + +** Processing line: ~ # Easy way to draw horizontal lines given an index~ - Inside source: true *** True Line Result - end -** Processing line: ~ state.player_1_score += 1~ + # Easy way to draw horizontal lines given an index +** Processing line: ~ def horizontal_line row~ - Inside source: true *** True Line Result - state.player_1_score += 1 -** Processing line: ~ end~ + def horizontal_line row +** Processing line: ~ scale_up([0, row, grid.width, row])~ - Inside source: true *** True Line Result - end + scale_up([0, row, grid.width, row]) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.over~ +** Processing line: ~ # Easy way to draw vertical lines given an index~ - Inside source: true *** True Line Result - if state.over -** Processing line: ~ place_hole~ + # Easy way to draw vertical lines given an index +** Processing line: ~ def early_exit_vertical_line column~ - Inside source: true *** True Line Result - place_hole -** Processing line: ~ return~ + def early_exit_vertical_line column +** Processing line: ~ scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height])~ - Inside source: true *** True Line Result - return -** Processing line: ~ end~ + scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return if state.holes.any? do |h|~ +** Processing line: ~ # Easy way to draw horizontal lines given an index~ - Inside source: true *** True Line Result - return if state.holes.any? do |h| -** Processing line: ~ h.sprite.scale_rect(0.8, 0.5, 0.5).intersect_rect? [state.banana.x, state.banana.y, 10, 10]~ + # Easy way to draw horizontal lines given an index +** Processing line: ~ def early_exit_horizontal_line row~ - Inside source: true *** True Line Result - h.sprite.scale_rect(0.8, 0.5, 0.5).intersect_rect? [state.banana.x, state.banana.y, 10, 10] -** Processing line: ~ end~ + def early_exit_horizontal_line row +** Processing line: ~ scale_up([grid.width + 1, row, grid.width + grid.width + 1, row])~ - Inside source: true *** True Line Result - end + scale_up([grid.width + 1, row, grid.width + grid.width + 1, row]) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return unless state.banana.y < 0 || state.buildings.any? do |b|~ +** Processing line: ~ # Draws the walls on both grids~ - Inside source: true *** True Line Result - return unless state.banana.y < 0 || state.buildings.any? do |b| -** Processing line: ~ b.rect.intersect_rect? [state.banana.x, state.banana.y, 1, 1]~ + # Draws the walls on both grids +** Processing line: ~ def render_walls~ - Inside source: true *** True Line Result - b.rect.intersect_rect? [state.banana.x, state.banana.y, 1, 1] -** Processing line: ~ end~ + def render_walls +** Processing line: ~ state.walls.each_key do |wall|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.walls.each_key do |wall| +** Processing line: ~ outputs.solids << [scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - -** Processing line: ~ place_hole~ + outputs.solids << [scale_up(wall), wall_color] +** Processing line: ~ outputs.solids << [early_exit_scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - place_hole + outputs.solids << [early_exit_scale_up(wall), wall_color] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -64523,38 +68040,46 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def place_hole~ -- Inside source: true -*** True Line Result - def place_hole -** Processing line: ~ return unless state.banana~ +** Processing line: ~ # Renders the star on both grids~ - Inside source: true *** True Line Result - return unless state.banana -** Processing line: ~~ + # Renders the star on both grids +** Processing line: ~ def render_star~ - Inside source: true *** True Line Result - -** Processing line: ~ state.holes << state.new_entity(:banana) do |b|~ + def render_star +** Processing line: ~ outputs.sprites << [scale_up(state.star), 'star.png']~ - Inside source: true *** True Line Result - state.holes << state.new_entity(:banana) do |b| -** Processing line: ~ b.sprite = [state.banana.x - 20, state.banana.y - 20, 40, 40, 'sprites/hole.png']~ + outputs.sprites << [scale_up(state.star), 'star.png'] +** Processing line: ~ outputs.sprites << [early_exit_scale_up(state.star), 'star.png']~ - Inside source: true *** True Line Result - b.sprite = [state.banana.x - 20, state.banana.y - 20, 40, 40, 'sprites/hole.png'] -** Processing line: ~ end~ + outputs.sprites << [early_exit_scale_up(state.star), 'star.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.banana = nil~ +** Processing line: ~ # Renders the target on both grids~ - Inside source: true *** True Line Result - state.banana = nil + # Renders the target on both grids +** Processing line: ~ def render_target~ +- Inside source: true +*** True Line Result + def render_target +** Processing line: ~ outputs.sprites << [scale_up(state.target), 'target.png']~ +- Inside source: true +*** True Line Result + outputs.sprites << [scale_up(state.target), 'target.png'] +** Processing line: ~ outputs.sprites << [early_exit_scale_up(state.target), 'target.png']~ +- Inside source: true +*** True Line Result + outputs.sprites << [early_exit_scale_up(state.target), 'target.png'] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -64563,54 +68088,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 process_inputs_main~ +** Processing line: ~ # Labels the grids~ - Inside source: true *** True Line Result - def process_inputs_main -** Processing line: ~ return if state.banana~ + # Labels the grids +** Processing line: ~ def render_labels~ - Inside source: true *** True Line Result - return if state.banana -** Processing line: ~ return if state.over~ + def render_labels +** Processing line: ~ outputs.labels << [200, 625, "Without early exit"]~ - Inside source: true *** True Line Result - return if state.over + outputs.labels << [200, 625, "Without early exit"] +** Processing line: ~ outputs.labels << [875, 625, "With early exit"]~ +- Inside source: true +*** True Line Result + outputs.labels << [875, 625, "With early exit"] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if inputs.keyboard.key_down.enter~ +** Processing line: ~ # Renders the path based off of the state.path hash~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.enter -** Processing line: ~ input_execute_turn~ + # Renders the path based off of the state.path hash +** Processing line: ~ def render_path~ - Inside source: true *** True Line Result - input_execute_turn -** Processing line: ~ elsif inputs.keyboard.key_down.backspace~ + def render_path +** Processing line: ~ # If the star and target are disconnected there will only be one path~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_down.backspace -** Processing line: ~ state.as_hash[state.current_turn] ||= ""~ + # If the star and target are disconnected there will only be one path +** Processing line: ~ # The path should not render in that case~ - Inside source: true *** True Line Result - state.as_hash[state.current_turn] ||= "" -** Processing line: ~ state.as_hash[state.current_turn] = state.as_hash[state.current_turn][0..-2]~ + # The path should not render in that case +** Processing line: ~ unless state.path.size == 1~ - Inside source: true *** True Line Result - state.as_hash[state.current_turn] = state.as_hash[state.current_turn][0..-2] -** Processing line: ~ elsif inputs.keyboard.key_down.char~ + unless state.path.size == 1 +** Processing line: ~ state.path.each_key do | cell |~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_down.char -** Processing line: ~ state.as_hash[state.current_turn] ||= ""~ + state.path.each_key do | cell | +** Processing line: ~ # Renders path on both grids~ - Inside source: true *** True Line Result - state.as_hash[state.current_turn] ||= "" -** Processing line: ~ state.as_hash[state.current_turn] += inputs.keyboard.key_down.char~ + # Renders path on both grids +** Processing line: ~ outputs.solids << [scale_up(cell), path_color]~ - Inside source: true *** True Line Result - state.as_hash[state.current_turn] += inputs.keyboard.key_down.char + outputs.solids << [scale_up(cell), path_color] +** Processing line: ~ outputs.solids << [early_exit_scale_up(cell), path_color]~ +- Inside source: true +*** True Line Result + outputs.solids << [early_exit_scale_up(cell), path_color] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -64623,230 +68164,254 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def process_inputs_game_over~ +** Processing line: ~ # Calculates the path from the target to the star after the search is over~ - Inside source: true *** True Line Result - def process_inputs_game_over -** Processing line: ~ return unless state.over~ + # Calculates the path from the target to the star after the search is over +** Processing line: ~ # Relies on the came_from hash~ - Inside source: true *** True Line Result - return unless state.over -** Processing line: ~ return unless inputs.keyboard.key_down.truthy_keys.any?~ + # Relies on the came_from hash +** Processing line: ~ # Fills the state.path hash, which is later rendered on screen~ - Inside source: true *** True Line Result - return unless inputs.keyboard.key_down.truthy_keys.any? -** Processing line: ~ state.over = false~ + # Fills the state.path hash, which is later rendered on screen +** Processing line: ~ def calc_path~ - Inside source: true *** True Line Result - state.over = false -** Processing line: ~ outputs.static_solids.clear~ + def calc_path +** Processing line: ~ endpoint = state.target~ - Inside source: true *** True Line Result - outputs.static_solids.clear -** Processing line: ~ state.buildings.clear~ + endpoint = state.target +** Processing line: ~ while endpoint~ - Inside source: true *** True Line Result - state.buildings.clear -** Processing line: ~ state.holes.clear~ + while endpoint +** Processing line: ~ state.path[endpoint] = true~ - Inside source: true *** True Line Result - state.holes.clear -** Processing line: ~ state.stage_generated = false~ + state.path[endpoint] = true +** Processing line: ~ endpoint = state.came_from[endpoint]~ - Inside source: true *** True Line Result - state.stage_generated = false -** Processing line: ~ state.stage_rendered = false~ + endpoint = state.came_from[endpoint] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.stage_rendered = false -** Processing line: ~ if state.first_strike == :player_1~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - if state.first_strike == :player_1 -** Processing line: ~ state.first_strike = :player_2~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.first_strike = :player_2 -** Processing line: ~ else~ + +** Processing line: ~ # Representation of how far away visited cells are from the star~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.first_strike = :player_1~ + # Representation of how far away visited cells are from the star +** Processing line: ~ # Replaces the render_visited method~ - Inside source: true *** True Line Result - state.first_strike = :player_1 -** Processing line: ~ end~ + # Replaces the render_visited method +** Processing line: ~ # Visually demonstrates the effectiveness of early exit for pathfinding~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Visually demonstrates the effectiveness of early exit for pathfinding +** Processing line: ~ def render_heat_map~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def render_heat_map +** Processing line: ~ state.visited.each_key do | visited_cell |~ - Inside source: true *** True Line Result - -** Processing line: ~ def process_inputs~ + state.visited.each_key do | visited_cell | +** Processing line: ~ distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs~ - Inside source: true *** True Line Result - def process_inputs -** Processing line: ~ process_inputs_main~ + distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs +** Processing line: ~ max_distance = grid.width + grid.height~ - Inside source: true *** True Line Result - process_inputs_main -** Processing line: ~ process_inputs_game_over~ + max_distance = grid.width + grid.height +** Processing line: ~ alpha = 255.to_i * distance.to_i / max_distance.to_i~ - Inside source: true *** True Line Result - process_inputs_game_over -** Processing line: ~ end~ + alpha = 255.to_i * distance.to_i / max_distance.to_i +** Processing line: ~ outputs.solids << [scale_up(visited_cell), red, alpha]~ - Inside source: true *** True Line Result - end + outputs.solids << [scale_up(visited_cell), red, alpha] +** Processing line: ~ # outputs.solids << [early_exit_scale_up(visited_cell), red, alpha]~ +- Inside source: true +*** True Line Result + # outputs.solids << [early_exit_scale_up(visited_cell), red, alpha] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def input_execute_turn~ +** Processing line: ~ state.early_exit_visited.each_key do | visited_cell |~ - Inside source: true *** True Line Result - def input_execute_turn -** Processing line: ~ return if state.banana~ + state.early_exit_visited.each_key do | visited_cell | +** Processing line: ~ distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs~ - Inside source: true *** True Line Result - return if state.banana -** Processing line: ~~ + distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs +** Processing line: ~ max_distance = grid.width + grid.height~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.current_turn == :player_1_angle && parse_or_clear!(:player_1_angle)~ + max_distance = grid.width + grid.height +** Processing line: ~ alpha = 255.to_i * distance.to_i / max_distance.to_i~ - Inside source: true *** True Line Result - if state.current_turn == :player_1_angle && parse_or_clear!(:player_1_angle) -** Processing line: ~ state.current_turn = :player_1_velocity~ + alpha = 255.to_i * distance.to_i / max_distance.to_i +** Processing line: ~ outputs.solids << [early_exit_scale_up(visited_cell), red, alpha]~ - Inside source: true *** True Line Result - state.current_turn = :player_1_velocity -** Processing line: ~ elsif state.current_turn == :player_1_velocity && parse_or_clear!(:player_1_velocity)~ + outputs.solids << [early_exit_scale_up(visited_cell), red, alpha] +** Processing line: ~ end~ - Inside source: true *** True Line Result - elsif state.current_turn == :player_1_velocity && parse_or_clear!(:player_1_velocity) -** Processing line: ~ state.current_turn = :player_2_angle~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.current_turn = :player_2_angle -** Processing line: ~ state.banana =~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.banana = -** Processing line: ~ new_banana(state.player_1,~ + +** Processing line: ~ # Translates the given cell grid.width + 1 to the right and then scales up~ - Inside source: true *** True Line Result - new_banana(state.player_1, -** Processing line: ~ state.player_1.x + 25,~ + # Translates the given cell grid.width + 1 to the right and then scales up +** Processing line: ~ # Used to draw cells for the second grid~ - Inside source: true *** True Line Result - state.player_1.x + 25, -** Processing line: ~ state.player_1.y + 60,~ + # Used to draw cells for the second grid +** Processing line: ~ # This method does not work for lines,~ - Inside source: true *** True Line Result - state.player_1.y + 60, -** Processing line: ~ state.player_1_angle,~ + # This method does not work for lines, +** Processing line: ~ # so separate methods exist for the grid lines~ - Inside source: true *** True Line Result - state.player_1_angle, -** Processing line: ~ state.player_1_velocity)~ + # so separate methods exist for the grid lines +** Processing line: ~ def early_exit_scale_up(cell)~ - Inside source: true *** True Line Result - state.player_1_velocity) -** Processing line: ~ elsif state.current_turn == :player_2_angle && parse_or_clear!(:player_2_angle)~ + def early_exit_scale_up(cell) +** Processing line: ~ cell_clone = cell.clone~ - Inside source: true *** True Line Result - elsif state.current_turn == :player_2_angle && parse_or_clear!(:player_2_angle) -** Processing line: ~ state.current_turn = :player_2_velocity~ + cell_clone = cell.clone +** Processing line: ~ cell_clone.x += grid.width + 1~ - Inside source: true *** True Line Result - state.current_turn = :player_2_velocity -** Processing line: ~ elsif state.current_turn == :player_2_velocity && parse_or_clear!(:player_2_velocity)~ + cell_clone.x += grid.width + 1 +** Processing line: ~ scale_up(cell_clone)~ - Inside source: true *** True Line Result - elsif state.current_turn == :player_2_velocity && parse_or_clear!(:player_2_velocity) -** Processing line: ~ state.current_turn = :player_1_angle~ + scale_up(cell_clone) +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.current_turn = :player_1_angle -** Processing line: ~ state.banana =~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.banana = -** Processing line: ~ new_banana(state.player_2,~ + +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ - Inside source: true *** True Line Result - new_banana(state.player_2, -** Processing line: ~ state.player_2.x + 25,~ + # In code, the cells are represented as 1x1 rectangles +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ - Inside source: true *** True Line Result - state.player_2.x + 25, -** Processing line: ~ state.player_2.y + 60,~ + # When drawn, the cells are larger than 1x1 rectangles +** Processing line: ~ # This method is used to scale up cells, and lines~ - Inside source: true *** True Line Result - state.player_2.y + 60, -** Processing line: ~ 180 - state.player_2_angle,~ + # This method is used to scale up cells, and lines +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ - Inside source: true *** True Line Result - 180 - state.player_2_angle, -** Processing line: ~ state.player_2_velocity)~ + # Objects are scaled up according to the grid.cell_size variable +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ - Inside source: true *** True Line Result - state.player_2_velocity) -** Processing line: ~ end~ + # This allows for easy customization of the visual scale of the grid +** Processing line: ~ def scale_up(cell)~ - Inside source: true *** True Line Result - end + def scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ +- Inside source: true +*** True Line Result + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ +- Inside source: true +*** True Line Result + cell = cell.clone ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if state.banana~ +** Processing line: ~ # If cell is just an x and y coordinate~ - Inside source: true *** True Line Result - if state.banana -** Processing line: ~ state.player_1_angle = nil~ + # If cell is just an x and y coordinate +** Processing line: ~ if cell.size == 2~ - Inside source: true *** True Line Result - state.player_1_angle = nil -** Processing line: ~ state.player_1_velocity = nil~ + if cell.size == 2 +** Processing line: ~ # Add a width and height of 1~ - Inside source: true *** True Line Result - state.player_1_velocity = nil -** Processing line: ~ state.player_2_angle = nil~ + # Add a width and height of 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - state.player_2_angle = nil -** Processing line: ~ state.player_2_velocity = nil~ + cell << 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - state.player_2_velocity = nil + cell << 1 ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ +** Processing line: ~~ - Inside source: true *** True Line Result - end + +** Processing line: ~ # Scale all the values up~ +- Inside source: true +*** True Line Result + # Scale all the values up +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ +- Inside source: true +*** True Line Result + cell.map! { |value| value * grid.cell_size } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def random_building_size~ +** Processing line: ~ # Returns the scaled up cell~ - Inside source: true *** True Line Result - def random_building_size -** Processing line: ~ [state.building_heights.sample, state.building_room_sizes.sample]~ + # Returns the scaled up cell +** Processing line: ~ cell~ - Inside source: true *** True Line Result - [state.building_heights.sample, state.building_room_sizes.sample] + cell ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -64855,42 +68420,42 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def int? v~ +** Processing line: ~ # This method processes user input every tick~ - Inside source: true *** True Line Result - def int? v -** Processing line: ~ v.to_i.to_s == v.to_s~ + # This method processes user input every tick +** Processing line: ~ # Any method with "1" is related to the first grid~ - Inside source: true *** True Line Result - v.to_i.to_s == v.to_s -** Processing line: ~ end~ + # Any method with "1" is related to the first grid +** Processing line: ~ # Any method with "2" is related to the second grid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Any method with "2" is related to the second grid +** Processing line: ~ def input~ - Inside source: true *** True Line Result - -** Processing line: ~ def random_building_color~ + def input +** Processing line: ~ # The program has to remember that the user is dragging an object~ - Inside source: true *** True Line Result - def random_building_color -** Processing line: ~ [[ 99, 0, 107],~ + # The program has to remember that the user is dragging an object +** Processing line: ~ # even when the mouse is no longer over that object~ - Inside source: true *** True Line Result - [[ 99, 0, 107], -** Processing line: ~ [ 35, 64, 124],~ + # even when the mouse is no longer over that object +** Processing line: ~ # So detecting input and processing input is separate~ - Inside source: true *** True Line Result - [ 35, 64, 124], -** Processing line: ~ [ 35, 136, 162],~ + # So detecting input and processing input is separate +** Processing line: ~ detect_input~ - Inside source: true *** True Line Result - [ 35, 136, 162], -** Processing line: ~ ].sample~ + detect_input +** Processing line: ~ process_input~ - Inside source: true *** True Line Result - ].sample + process_input ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -64899,130 +68464,130 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def random_window_color~ +** Processing line: ~ # Determines what the user is editing and stores the value~ - Inside source: true *** True Line Result - def random_window_color -** Processing line: ~ [[ 88, 62, 104],~ + # Determines what the user is editing and stores the value +** Processing line: ~ # Storing the value allows the user to continue the same edit as long as the~ - Inside source: true *** True Line Result - [[ 88, 62, 104], -** Processing line: ~ [253, 224, 187]].sample~ + # Storing the value allows the user to continue the same edit as long as the +** Processing line: ~ # mouse left click is held~ - Inside source: true *** True Line Result - [253, 224, 187]].sample -** Processing line: ~ end~ + # mouse left click is held +** Processing line: ~ def detect_input~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def detect_input +** Processing line: ~ # When the mouse is up, nothing is being edited~ - Inside source: true *** True Line Result - -** Processing line: ~ def windows_for_building starting_x, floors, rooms~ + # When the mouse is up, nothing is being edited +** Processing line: ~ if inputs.mouse.up~ - Inside source: true *** True Line Result - def windows_for_building starting_x, floors, rooms -** Processing line: ~ floors.-(1).combinations(rooms - 1).map do |floor, room|~ + if inputs.mouse.up +** Processing line: ~ state.current_input = :none~ - Inside source: true *** True Line Result - floors.-(1).combinations(rooms - 1).map do |floor, room| -** Processing line: ~ [starting_x +~ + state.current_input = :none +** Processing line: ~ # When the star in the no second grid is clicked~ - Inside source: true *** True Line Result - [starting_x + -** Processing line: ~ state.building_room_width.*(room) +~ + # When the star in the no second grid is clicked +** Processing line: ~ elsif star_clicked?~ - Inside source: true *** True Line Result - state.building_room_width.*(room) + -** Processing line: ~ state.building_room_spacing.*(room + 1),~ + elsif star_clicked? +** Processing line: ~ state.current_input = :star~ - Inside source: true *** True Line Result - state.building_room_spacing.*(room + 1), -** Processing line: ~ state.building_room_height.*(floor) +~ + state.current_input = :star +** Processing line: ~ # When the star in the second grid is clicked~ - Inside source: true *** True Line Result - state.building_room_height.*(floor) + -** Processing line: ~ state.building_room_spacing.*(floor + 1),~ + # When the star in the second grid is clicked +** Processing line: ~ elsif star2_clicked?~ - Inside source: true *** True Line Result - state.building_room_spacing.*(floor + 1), -** Processing line: ~ state.building_room_width,~ + elsif star2_clicked? +** Processing line: ~ state.current_input = :star2~ - Inside source: true *** True Line Result - state.building_room_width, -** Processing line: ~ state.building_room_height,~ + state.current_input = :star2 +** Processing line: ~ # When the target in the no second grid is clicked~ - Inside source: true *** True Line Result - state.building_room_height, -** Processing line: ~ random_window_color]~ + # When the target in the no second grid is clicked +** Processing line: ~ elsif target_clicked?~ - Inside source: true *** True Line Result - random_window_color] -** Processing line: ~ end~ + elsif target_clicked? +** Processing line: ~ state.current_input = :target~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + state.current_input = :target +** Processing line: ~ # When the target in the second grid is clicked~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # When the target in the second grid is clicked +** Processing line: ~ elsif target2_clicked?~ - Inside source: true *** True Line Result - -** Processing line: ~ def building_prefab starting_x, floors, rooms~ + elsif target2_clicked? +** Processing line: ~ state.current_input = :target2~ - Inside source: true *** True Line Result - def building_prefab starting_x, floors, rooms -** Processing line: ~ state.new_entity(:building) do |b|~ + state.current_input = :target2 +** Processing line: ~ # When a wall in the first grid is clicked~ - Inside source: true *** True Line Result - state.new_entity(:building) do |b| -** Processing line: ~ b.x = starting_x~ + # When a wall in the first grid is clicked +** Processing line: ~ elsif wall_clicked?~ - Inside source: true *** True Line Result - b.x = starting_x -** Processing line: ~ b.y = 0~ + elsif wall_clicked? +** Processing line: ~ state.current_input = :remove_wall~ - Inside source: true *** True Line Result - b.y = 0 -** Processing line: ~ b.w = state.building_room_width.*(rooms) +~ + state.current_input = :remove_wall +** Processing line: ~ # When a wall in the second grid is clicked~ - Inside source: true *** True Line Result - b.w = state.building_room_width.*(rooms) + -** Processing line: ~ state.building_room_spacing.*(rooms + 1)~ + # When a wall in the second grid is clicked +** Processing line: ~ elsif wall2_clicked?~ - Inside source: true *** True Line Result - state.building_room_spacing.*(rooms + 1) -** Processing line: ~ b.h = state.building_room_height.*(floors) +~ + elsif wall2_clicked? +** Processing line: ~ state.current_input = :remove_wall2~ - Inside source: true *** True Line Result - b.h = state.building_room_height.*(floors) + -** Processing line: ~ state.building_room_spacing.*(floors + 1)~ + state.current_input = :remove_wall2 +** Processing line: ~ # When the first grid is clicked~ - Inside source: true *** True Line Result - state.building_room_spacing.*(floors + 1) -** Processing line: ~ b.right = b.x + b.w~ + # When the first grid is clicked +** Processing line: ~ elsif grid_clicked?~ - Inside source: true *** True Line Result - b.right = b.x + b.w -** Processing line: ~ b.rect = [b.x, b.y, b.w, b.h]~ + elsif grid_clicked? +** Processing line: ~ state.current_input = :add_wall~ - Inside source: true *** True Line Result - b.rect = [b.x, b.y, b.w, b.h] -** Processing line: ~ b.solids = [[b.x - 1, b.y, b.w + 2, b.h + 1, fancy_white],~ + state.current_input = :add_wall +** Processing line: ~ # When the second grid is clicked~ - Inside source: true *** True Line Result - b.solids = [[b.x - 1, b.y, b.w + 2, b.h + 1, fancy_white], -** Processing line: ~ [b.x, b.y, b.w, b.h, random_building_color],~ + # When the second grid is clicked +** Processing line: ~ elsif grid2_clicked?~ - Inside source: true *** True Line Result - [b.x, b.y, b.w, b.h, random_building_color], -** Processing line: ~ windows_for_building(b.x, floors, rooms)]~ + elsif grid2_clicked? +** Processing line: ~ state.current_input = :add_wall2~ - Inside source: true *** True Line Result - windows_for_building(b.x, floors, rooms)] + state.current_input = :add_wall2 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -65035,82 +68600,78 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def parse_or_clear! game_prop~ -- Inside source: true -*** True Line Result - def parse_or_clear! game_prop -** Processing line: ~ if int? state.as_hash[game_prop]~ +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ - Inside source: true *** True Line Result - if int? state.as_hash[game_prop] -** Processing line: ~ state.as_hash[game_prop] = state.as_hash[game_prop].to_i~ + # Processes click and drag based on what the user is currently dragging +** Processing line: ~ def process_input~ - Inside source: true *** True Line Result - state.as_hash[game_prop] = state.as_hash[game_prop].to_i -** Processing line: ~ return true~ + def process_input +** Processing line: ~ if state.current_input == :star~ - Inside source: true *** True Line Result - return true -** Processing line: ~ end~ + if state.current_input == :star +** Processing line: ~ input_star~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + input_star +** Processing line: ~ elsif state.current_input == :star2~ - Inside source: true *** True Line Result - -** Processing line: ~ state.as_hash[game_prop] = nil~ + elsif state.current_input == :star2 +** Processing line: ~ input_star2~ - Inside source: true *** True Line Result - state.as_hash[game_prop] = nil -** Processing line: ~ return false~ + input_star2 +** Processing line: ~ elsif state.current_input == :target~ - Inside source: true *** True Line Result - return false -** Processing line: ~ end~ + elsif state.current_input == :target +** Processing line: ~ input_target~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + input_target +** Processing line: ~ elsif state.current_input == :target2~ - Inside source: true *** True Line Result - -** Processing line: ~ def new_banana owner, x, y, angle, velocity~ + elsif state.current_input == :target2 +** Processing line: ~ input_target2~ - Inside source: true *** True Line Result - def new_banana owner, x, y, angle, velocity -** Processing line: ~ state.new_entity(:banana) do |b|~ + input_target2 +** Processing line: ~ elsif state.current_input == :remove_wall~ - Inside source: true *** True Line Result - state.new_entity(:banana) do |b| -** Processing line: ~ b.owner = owner~ + elsif state.current_input == :remove_wall +** Processing line: ~ input_remove_wall~ - Inside source: true *** True Line Result - b.owner = owner -** Processing line: ~ b.x = x~ + input_remove_wall +** Processing line: ~ elsif state.current_input == :remove_wall2~ - Inside source: true *** True Line Result - b.x = x -** Processing line: ~ b.y = y~ + elsif state.current_input == :remove_wall2 +** Processing line: ~ input_remove_wall2~ - Inside source: true *** True Line Result - b.y = y -** Processing line: ~ b.angle = angle % 360~ + input_remove_wall2 +** Processing line: ~ elsif state.current_input == :add_wall~ - Inside source: true *** True Line Result - b.angle = angle % 360 -** Processing line: ~ b.velocity = velocity / 5~ + elsif state.current_input == :add_wall +** Processing line: ~ input_add_wall~ - Inside source: true *** True Line Result - b.velocity = velocity / 5 -** Processing line: ~ b.dx = b.angle.vector_x(b.velocity)~ + input_add_wall +** Processing line: ~ elsif state.current_input == :add_wall2~ - Inside source: true *** True Line Result - b.dx = b.angle.vector_x(b.velocity) -** Processing line: ~ b.dy = b.angle.vector_y(b.velocity)~ + elsif state.current_input == :add_wall2 +** Processing line: ~ input_add_wall2~ - Inside source: true *** True Line Result - b.dy = b.angle.vector_y(b.velocity) + input_add_wall2 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -65123,258 +68684,226 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def fancy_white~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ - Inside source: true *** True Line Result - def fancy_white -** Processing line: ~ [253, 252, 253]~ + # Moves the star to the cell closest to the mouse in the first grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - [253, 252, 253] -** Processing line: ~ end~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def input_star~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def input_star +** Processing line: ~ old_star = state.star.clone~ - Inside source: true *** True Line Result - -** Processing line: ~ $you_so_basic_gorillas = YouSoBasicGorillas.new~ + old_star = state.star.clone +** Processing line: ~ state.star = cell_closest_to_mouse~ - Inside source: true *** True Line Result - $you_so_basic_gorillas = YouSoBasicGorillas.new -** Processing line: ~~ + state.star = cell_closest_to_mouse +** Processing line: ~ unless old_star == state.star~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + unless old_star == state.star +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ $you_so_basic_gorillas.outputs = args.outputs~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - $you_so_basic_gorillas.outputs = args.outputs -** Processing line: ~ $you_so_basic_gorillas.grid = args.grid~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - $you_so_basic_gorillas.grid = args.grid -** Processing line: ~ $you_so_basic_gorillas.state = args.state~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - $you_so_basic_gorillas.state = args.state -** Processing line: ~ $you_so_basic_gorillas.inputs = args.inputs~ + +** Processing line: ~ # Moves the star to the cell closest to the mouse in the second grid~ - Inside source: true *** True Line Result - $you_so_basic_gorillas.inputs = args.inputs -** Processing line: ~ $you_so_basic_gorillas.tick~ + # Moves the star to the cell closest to the mouse in the second grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - $you_so_basic_gorillas.tick -** Processing line: ~ end~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def input_star2~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. -*** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Platformer - Gorillas Basic - tests.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Platformer - Gorillas Basic - 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_platformer/gorillas_basic/app/tests.rb~ + def input_star2 +** Processing line: ~ old_star = state.star.clone~ - Inside source: true *** True Line Result - # ./samples/99_genre_platformer/gorillas_basic/app/tests.rb -** Processing line: ~ $gtk.reset 100~ + old_star = state.star.clone +** Processing line: ~ state.star = cell_closest_to_mouse2~ - Inside source: true *** True Line Result - $gtk.reset 100 -** Processing line: ~ $gtk.supress_framerate_warning = true~ + state.star = cell_closest_to_mouse2 +** Processing line: ~ unless old_star == state.star~ - Inside source: true *** True Line Result - $gtk.supress_framerate_warning = true -** Processing line: ~ $gtk.require 'app/tests/building_generation_tests.rb'~ + unless old_star == state.star +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - $gtk.require 'app/tests/building_generation_tests.rb' -** Processing line: ~ $gtk.tests.start~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - $gtk.tests.start -** Processing line: ~~ + end +** Processing line: ~ end~ - 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 + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Platformer - Gorillas Basic - Tests - building_generation_tests.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ +- Inside source: true *** True Line Result -* Platformer - Gorillas Basic - Tests - building_generation_tests.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # Moves the target to the grid closest to the mouse in the first grid +** Processing line: ~ # Only reset_searchs the search if the target changes position~ +- Inside source: true *** True Line Result - + # Only reset_searchs the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_platformer/gorillas_basic/app/tests/building_generation_tests.rb~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def input_target~ - Inside source: true *** True Line Result - # ./samples/99_genre_platformer/gorillas_basic/app/tests/building_generation_tests.rb -** Processing line: ~ def test_solids args, assert~ + def input_target +** Processing line: ~ old_target = state.target.clone~ - Inside source: true *** True Line Result - def test_solids args, assert -** Processing line: ~ game = YouSoBasicGorillas.new~ + old_target = state.target.clone +** Processing line: ~ state.target = cell_closest_to_mouse~ - Inside source: true *** True Line Result - game = YouSoBasicGorillas.new -** Processing line: ~ game.outputs = args.outputs~ + state.target = cell_closest_to_mouse +** Processing line: ~ unless old_target == state.target~ - Inside source: true *** True Line Result - game.outputs = args.outputs -** Processing line: ~ game.grid = args.grid~ + unless old_target == state.target +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - game.grid = args.grid -** Processing line: ~ game.state = args.state~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - game.state = args.state -** Processing line: ~ game.inputs = args.inputs~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - game.inputs = args.inputs -** Processing line: ~ game.tick~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - game.tick -** Processing line: ~ assert.true! args.state.stage_generated, "stage wasn't generated but it should have been"~ + +** Processing line: ~ # Moves the target to the cell closest to the mouse in the second grid~ - Inside source: true *** True Line Result - assert.true! args.state.stage_generated, "stage wasn't generated but it should have been" -** Processing line: ~ game.tick~ + # Moves the target to the cell closest to the mouse in the second grid +** Processing line: ~ # Only reset_searchs the search if the target changes position~ - Inside source: true *** True Line Result - game.tick -** Processing line: ~ assert.true! args.outputs.static_solids.length > 0, "stage wasn't rendered"~ + # Only reset_searchs the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ - Inside source: true *** True Line Result - assert.true! args.outputs.static_solids.length > 0, "stage wasn't rendered" -** Processing line: ~ number_of_building_components = (args.state.buildings.map { |b| 2 + b.solids[2].length }.inject do |sum, v| (sum || 0) + v end)~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def input_target2~ - Inside source: true *** True Line Result - number_of_building_components = (args.state.buildings.map { |b| 2 + b.solids[2].length }.inject do |sum, v| (sum || 0) + v end) -** Processing line: ~ the_only_background = 1~ + def input_target2 +** Processing line: ~ old_target = state.target.clone~ - Inside source: true *** True Line Result - the_only_background = 1 -** Processing line: ~ static_solids = args.outputs.static_solids.length~ + old_target = state.target.clone +** Processing line: ~ state.target = cell_closest_to_mouse2~ - Inside source: true *** True Line Result - static_solids = args.outputs.static_solids.length -** Processing line: ~ assert.true! static_solids == the_only_background.+(number_of_building_components), "not all parts of the buildings and background were rendered"~ + state.target = cell_closest_to_mouse2 +** Processing line: ~ unless old_target == state.target~ - Inside source: true *** True Line Result - assert.true! static_solids == the_only_background.+(number_of_building_components), "not all parts of the buildings and background were rendered" -** Processing line: ~ end~ + unless old_target == state.target +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + end +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Platformer - The Little Probe - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Platformer - The Little Probe - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +- Inside source: true *** True Line Result +** Processing line: ~ # Removes walls in the first grid that are under the cursor~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_platformer/the_little_probe/app/main.rb~ + # Removes walls in the first grid that are under the cursor +** Processing line: ~ def input_remove_wall~ - Inside source: true *** True Line Result - # ./samples/99_genre_platformer/the_little_probe/app/main.rb -** Processing line: ~ class FallingCircle~ + def input_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - class FallingCircle -** Processing line: ~ attr_gtk~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - attr_gtk -** Processing line: ~~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if mouse_inside_grid?~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ fiddle~ + if mouse_inside_grid? +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - fiddle -** Processing line: ~ defaults~ + if state.walls.has_key?(cell_closest_to_mouse) +** Processing line: ~ state.walls.delete(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ render~ + state.walls.delete(cell_closest_to_mouse) +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - render -** Processing line: ~ input~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - input -** Processing line: ~ calc~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - calc + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -65383,50 +68912,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def fiddle~ +** Processing line: ~ # Removes walls in the second grid that are under the cursor~ - Inside source: true *** True Line Result - def fiddle -** Processing line: ~ state.gravity = -0.02~ + # Removes walls in the second grid that are under the cursor +** Processing line: ~ def input_remove_wall2~ - Inside source: true *** True Line Result - state.gravity = -0.02 -** Processing line: ~ circle.radius = 15~ + def input_remove_wall2 +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - circle.radius = 15 -** Processing line: ~ circle.elasticity = 0.4~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - circle.elasticity = 0.4 -** Processing line: ~ camera.follow_speed = 0.4 * 0.4~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - camera.follow_speed = 0.4 * 0.4 -** Processing line: ~ end~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if mouse_inside_grid2?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if mouse_inside_grid2? +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse2)~ - Inside source: true *** True Line Result - -** Processing line: ~ def render~ + if state.walls.has_key?(cell_closest_to_mouse2) +** Processing line: ~ state.walls.delete(cell_closest_to_mouse2)~ - Inside source: true *** True Line Result - def render -** Processing line: ~ render_stage_editor~ + state.walls.delete(cell_closest_to_mouse2) +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - render_stage_editor -** Processing line: ~ render_debug~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - render_debug -** Processing line: ~ render_game~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - render_game + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -65435,390 +68964,422 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def defaults~ +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ - Inside source: true *** True Line Result - def defaults -** Processing line: ~ if state.tick_count == 0~ + # Adds a wall in the first grid in the cell the mouse is over +** Processing line: ~ def input_add_wall~ - Inside source: true *** True Line Result - if state.tick_count == 0 -** Processing line: ~ outputs.sounds << "sounds/bg.ogg"~ + def input_add_wall +** Processing line: ~ if mouse_inside_grid?~ - Inside source: true *** True Line Result - outputs.sounds << "sounds/bg.ogg" + if mouse_inside_grid? +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse)~ +- Inside source: true +*** True Line Result + unless state.walls.has_key?(cell_closest_to_mouse) +** Processing line: ~ state.walls[cell_closest_to_mouse] = true~ +- Inside source: true +*** True Line Result + state.walls[cell_closest_to_mouse] = true +** Processing line: ~ reset_search~ +- Inside source: true +*** True Line Result + reset_search +** 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: ~ state.storyline ||= [~ +** Processing line: ~~ - Inside source: true *** True Line Result - state.storyline ||= [ -** Processing line: ~ { text: "<- -> to aim, hold space to charge", distance_gate: 0 },~ + +** Processing line: ~ # Adds a wall in the second grid in the cell the mouse is over~ - Inside source: true *** True Line Result - { text: "<- -> to aim, hold space to charge", distance_gate: 0 }, -** Processing line: ~ { text: "the little probe - by @amirrajan, made with DragonRuby Game Toolkit", distance_gate: 0 },~ + # Adds a wall in the second grid in the cell the mouse is over +** Processing line: ~ def input_add_wall2~ - Inside source: true *** True Line Result - { text: "the little probe - by @amirrajan, made with DragonRuby Game Toolkit", distance_gate: 0 }, -** Processing line: ~ { text: "mission control, this is sasha. landing on europa successful.", distance_gate: 0 },~ + def input_add_wall2 +** Processing line: ~ if mouse_inside_grid2?~ - Inside source: true *** True Line Result - { text: "mission control, this is sasha. landing on europa successful.", distance_gate: 0 }, -** Processing line: ~ { text: "operation \"find earth 2.0\", initiated at 8-29-2036 14:00.", distance_gate: 0 },~ + if mouse_inside_grid2? +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse2)~ - Inside source: true *** True Line Result - { text: "operation \"find earth 2.0\", initiated at 8-29-2036 14:00.", distance_gate: 0 }, -** Processing line: ~ { text: "jupiter's sure is beautiful...", distance_gate: 4000 },~ + unless state.walls.has_key?(cell_closest_to_mouse2) +** Processing line: ~ state.walls[cell_closest_to_mouse2] = true~ - Inside source: true *** True Line Result - { text: "jupiter's sure is beautiful...", distance_gate: 4000 }, -** Processing line: ~ { text: "hmm, it seems there's some kind of anomoly in the sky", distance_gate: 7000 },~ + state.walls[cell_closest_to_mouse2] = true +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - { text: "hmm, it seems there's some kind of anomoly in the sky", distance_gate: 7000 }, -** Processing line: ~ { text: "dancing lights, i'll call them whisps.", distance_gate: 8000 },~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - { text: "dancing lights, i'll call them whisps.", distance_gate: 8000 }, -** Processing line: ~ { text: "#todo... look i ran out of time -_-", distance_gate: 9000 },~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - { text: "#todo... look i ran out of time -_-", distance_gate: 9000 }, -** Processing line: ~ { text: "there's never enough time", distance_gate: 9000 },~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - { text: "there's never enough time", distance_gate: 9000 }, -** Processing line: ~ { text: "the game jam was fun though ^_^", distance_gate: 10000 },~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - { text: "the game jam was fun though ^_^", distance_gate: 10000 }, -** Processing line: ~ ]~ + +** Processing line: ~ # Whenever the user edits the grid,~ - Inside source: true *** True Line Result - ] -** Processing line: ~~ + # Whenever the user edits the grid, +** Processing line: ~ # The search has to be reset_searchd upto the current step~ - Inside source: true *** True Line Result - -** Processing line: ~ load_level force: args.state.tick_count == 0~ + # The search has to be reset_searchd upto the current step +** Processing line: ~ # with the current grid as the initial state of the grid~ - Inside source: true *** True Line Result - load_level force: args.state.tick_count == 0 -** Processing line: ~ state.line_mode ||= :terrain~ + # with the current grid as the initial state of the grid +** Processing line: ~ def reset_search~ - Inside source: true *** True Line Result - state.line_mode ||= :terrain -** Processing line: ~~ + def reset_search +** Processing line: ~ # Reset_Searchs the search~ - Inside source: true *** True Line Result - -** Processing line: ~ state.sound_index ||= 1~ + # Reset_Searchs the search +** Processing line: ~ state.frontier = []~ - Inside source: true *** True Line Result - state.sound_index ||= 1 -** Processing line: ~ circle.potential_lift ||= 0~ + state.frontier = [] +** Processing line: ~ state.visited = {}~ - Inside source: true *** True Line Result - circle.potential_lift ||= 0 -** Processing line: ~ circle.angle ||= 90~ + state.visited = {} +** Processing line: ~ state.early_exit_visited = {}~ - Inside source: true *** True Line Result - circle.angle ||= 90 -** Processing line: ~ circle.check_point_at ||= -1000~ + state.early_exit_visited = {} +** Processing line: ~ state.came_from = {}~ - Inside source: true *** True Line Result - circle.check_point_at ||= -1000 -** Processing line: ~ circle.game_over_at ||= -1000~ + state.came_from = {} +** Processing line: ~ state.path = {}~ - Inside source: true *** True Line Result - circle.game_over_at ||= -1000 -** Processing line: ~ circle.x ||= -485~ + state.path = {} +** Processing line: ~ end~ - Inside source: true *** True Line Result - circle.x ||= -485 -** Processing line: ~ circle.y ||= 12226~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - circle.y ||= 12226 -** Processing line: ~ circle.check_point_x ||= circle.x~ + +** Processing line: ~ # Moves the search forward one step~ - Inside source: true *** True Line Result - circle.check_point_x ||= circle.x -** Processing line: ~ circle.check_point_y ||= circle.y~ + # Moves the search forward one step +** Processing line: ~ def step~ - Inside source: true *** True Line Result - circle.check_point_y ||= circle.y -** Processing line: ~ circle.dy ||= 0~ + def step +** Processing line: ~ # The setup to the search~ - Inside source: true *** True Line Result - circle.dy ||= 0 -** Processing line: ~ circle.dx ||= 0~ + # The setup to the search +** Processing line: ~ # Runs once when there are no visited cells~ - Inside source: true *** True Line Result - circle.dx ||= 0 -** Processing line: ~ circle.previous_dy ||= 0~ + # Runs once when there are no visited cells +** Processing line: ~ if state.visited.empty?~ - Inside source: true *** True Line Result - circle.previous_dy ||= 0 -** Processing line: ~ circle.previous_dx ||= 0~ + if state.visited.empty? +** Processing line: ~ state.visited[state.star] = true~ - Inside source: true *** True Line Result - circle.previous_dx ||= 0 -** Processing line: ~ circle.angle ||= 0~ + state.visited[state.star] = true +** Processing line: ~ state.early_exit_visited[state.star] = true~ - Inside source: true *** True Line Result - circle.angle ||= 0 -** Processing line: ~ circle.after_images ||= []~ + state.early_exit_visited[state.star] = true +** Processing line: ~ state.frontier << state.star~ - Inside source: true *** True Line Result - circle.after_images ||= [] -** Processing line: ~ circle.terrains_to_monitor ||= {}~ + state.frontier << state.star +** Processing line: ~ state.came_from[state.star] = nil~ - Inside source: true *** True Line Result - circle.terrains_to_monitor ||= {} -** Processing line: ~ circle.impact_history ||= []~ + state.came_from[state.star] = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - circle.impact_history ||= [] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ camera.x ||= 0~ +** Processing line: ~ # A step in the search~ - Inside source: true *** True Line Result - camera.x ||= 0 -** Processing line: ~ camera.y ||= 0~ + # A step in the search +** Processing line: ~ unless state.frontier.empty?~ - Inside source: true *** True Line Result - camera.y ||= 0 -** Processing line: ~ camera.target_x ||= 0~ + unless state.frontier.empty? +** Processing line: ~ # Takes the next frontier cell~ - Inside source: true *** True Line Result - camera.target_x ||= 0 -** Processing line: ~ camera.target_y ||= 0~ + # Takes the next frontier cell +** Processing line: ~ new_frontier = state.frontier.shift~ - Inside source: true *** True Line Result - camera.target_y ||= 0 -** Processing line: ~ state.snaps ||= { }~ + new_frontier = state.frontier.shift +** Processing line: ~ # For each of its neighbors~ - Inside source: true *** True Line Result - state.snaps ||= { } -** Processing line: ~ state.snap_number = 10~ + # For each of its neighbors +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ - Inside source: true *** True Line Result - state.snap_number = 10 -** Processing line: ~~ + adjacent_neighbors(new_frontier).each do |neighbor| +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.storyline_x ||= -1000~ + # That have not been visited and are not walls +** Processing line: ~ unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - args.state.storyline_x ||= -1000 -** Processing line: ~ args.state.storyline_y ||= -1000~ + unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited in the first grid~ - Inside source: true *** True Line Result - args.state.storyline_y ||= -1000 -** Processing line: ~ end~ + # Add them to the frontier and mark them as visited in the first grid +** Processing line: ~ state.visited[neighbor] = true~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.visited[neighbor] = true +** Processing line: ~ # Unless the target has been visited~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_game~ + # Unless the target has been visited +** Processing line: ~ unless state.visited.has_key?(state.target)~ - Inside source: true *** True Line Result - def render_game -** Processing line: ~ outputs.background_color = [0, 0, 0]~ + unless state.visited.has_key?(state.target) +** Processing line: ~ # Mark the neighbor as visited in the second grid as well~ - Inside source: true *** True Line Result - outputs.background_color = [0, 0, 0] -** Processing line: ~ outputs.sprites << [-circle.x + 1100,~ + # Mark the neighbor as visited in the second grid as well +** Processing line: ~ state.early_exit_visited[neighbor] = true~ - Inside source: true *** True Line Result - outputs.sprites << [-circle.x + 1100, -** Processing line: ~ -circle.y - 100,~ + state.early_exit_visited[neighbor] = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - -circle.y - 100, -** Processing line: ~ 2416 * 4,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2416 * 4, -** Processing line: ~ 3574 * 4,~ + +** Processing line: ~ # Add the neighbor to the frontier and remember which cell it came from~ - Inside source: true *** True Line Result - 3574 * 4, -** Processing line: ~ 'sprites/jupiter.png']~ + # Add the neighbor to the frontier and remember which cell it came from +** Processing line: ~ state.frontier << neighbor~ - Inside source: true *** True Line Result - 'sprites/jupiter.png'] -** Processing line: ~ outputs.sprites << [-circle.x,~ + state.frontier << neighbor +** Processing line: ~ state.came_from[neighbor] = new_frontier~ - Inside source: true *** True Line Result - outputs.sprites << [-circle.x, -** Processing line: ~ -circle.y,~ + state.came_from[neighbor] = new_frontier +** Processing line: ~ end~ - Inside source: true *** True Line Result - -circle.y, -** Processing line: ~ 2416 * 4,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2416 * 4, -** Processing line: ~ 3574 * 4,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3574 * 4, -** Processing line: ~ 'sprites/level.png']~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 'sprites/level.png'] -** Processing line: ~ outputs.sprites << state.whisp_queue~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.sprites << state.whisp_queue -** Processing line: ~ render_aiming_retical~ + +** Processing line: ~~ - Inside source: true *** True Line Result - render_aiming_retical -** Processing line: ~ render_circle~ + +** Processing line: ~ # Returns a list of adjacent cells~ - Inside source: true *** True Line Result - render_circle -** Processing line: ~ render_notification~ + # Returns a list of adjacent cells +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ - Inside source: true *** True Line Result - render_notification -** Processing line: ~ end~ + # Used to determine what the next cells to be added to the frontier are +** Processing line: ~ def adjacent_neighbors(cell)~ - Inside source: true *** True Line Result - end + def adjacent_neighbors(cell) +** Processing line: ~ neighbors = []~ +- Inside source: true +*** True Line Result + neighbors = [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_notification~ +** Processing line: ~ # Gets all the valid neighbors into the array~ - Inside source: true *** True Line Result - def render_notification -** Processing line: ~ toast_length = 500~ + # Gets all the valid neighbors into the array +** Processing line: ~ # From southern neighbor, clockwise~ - Inside source: true *** True Line Result - toast_length = 500 -** Processing line: ~ if circle.game_over_at.elapsed_time < toast_length~ + # From southern neighbor, clockwise +** Processing line: ~ neighbors << [cell.x, cell.y - 1] unless cell.y == 0~ - Inside source: true *** True Line Result - if circle.game_over_at.elapsed_time < toast_length -** Processing line: ~ label_text = "..."~ + neighbors << [cell.x, cell.y - 1] unless cell.y == 0 +** Processing line: ~ neighbors << [cell.x - 1, cell.y] unless cell.x == 0~ - Inside source: true *** True Line Result - label_text = "..." -** Processing line: ~ elsif circle.check_point_at.elapsed_time > toast_length~ + neighbors << [cell.x - 1, cell.y] unless cell.x == 0 +** Processing line: ~ neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1~ - Inside source: true *** True Line Result - elsif circle.check_point_at.elapsed_time > toast_length -** Processing line: ~ args.state.current_storyline = nil~ + neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1 +** Processing line: ~ neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1~ - Inside source: true *** True Line Result - args.state.current_storyline = nil -** Processing line: ~ return~ + neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1 +** Processing line: ~~ - Inside source: true *** True Line Result - return -** Processing line: ~ end~ + +** Processing line: ~ # Sorts the neighbors so the rendered path is a zigzag path~ - Inside source: true *** True Line Result - end -** Processing line: ~ if circle.check_point_at &&~ + # Sorts the neighbors so the rendered path is a zigzag path +** Processing line: ~ # Cells in a diagonal direction are given priority~ - Inside source: true *** True Line Result - if circle.check_point_at && -** Processing line: ~ circle.check_point_at.elapsed_time == 1 &&~ + # Cells in a diagonal direction are given priority +** Processing line: ~ # Comment this line to see the difference~ - Inside source: true *** True Line Result - circle.check_point_at.elapsed_time == 1 && -** Processing line: ~ !args.state.current_storyline~ + # Comment this line to see the difference +** Processing line: ~ neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) }~ - Inside source: true *** True Line Result - !args.state.current_storyline -** Processing line: ~ if args.state.storyline.length > 0 && args.state.distance_traveled > args.state.storyline[0][:distance_gate]~ + neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) } +** Processing line: ~~ - Inside source: true *** True Line Result - if args.state.storyline.length > 0 && args.state.distance_traveled > args.state.storyline[0][:distance_gate] -** Processing line: ~ args.state.current_storyline = args.state.storyline.shift[:text]~ + +** Processing line: ~ neighbors~ - Inside source: true *** True Line Result - args.state.current_storyline = args.state.storyline.shift[:text] -** Processing line: ~ args.state.distance_traveled ||= 0~ + neighbors +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.distance_traveled ||= 0 -** Processing line: ~ args.state.storyline_x = circle.x~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.storyline_x = circle.x -** Processing line: ~ args.state.storyline_y = circle.y~ + +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ - Inside source: true *** True Line Result - args.state.storyline_y = circle.y -** Processing line: ~ end~ + # Finds the vertical and horizontal distance of a cell from the star +** Processing line: ~ # and returns the larger value~ - Inside source: true *** True Line Result - end -** Processing line: ~ return unless args.state.current_storyline~ + # and returns the larger value +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ - Inside source: true *** True Line Result - return unless args.state.current_storyline -** Processing line: ~ end~ + # This method is used to have a zigzag pattern in the rendered path +** Processing line: ~ # A cell that is [5, 5] from the star,~ - Inside source: true *** True Line Result - end -** Processing line: ~ label_text = args.state.current_storyline~ + # A cell that is [5, 5] from the star, +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ - Inside source: true *** True Line Result - label_text = args.state.current_storyline -** Processing line: ~ return unless label_text~ + # is explored before over a cell that is [0, 7] away. +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ - Inside source: true *** True Line Result - return unless label_text -** Processing line: ~ x = circle.x + camera.x~ + # So, if possible, the search tries to go diagonal (zigzag) first +** Processing line: ~ def proximity_to_star(x, y)~ - Inside source: true *** True Line Result - x = circle.x + camera.x -** Processing line: ~ y = circle.y + camera.y - 40~ + def proximity_to_star(x, y) +** Processing line: ~ distance_x = (state.star.x - x).abs~ - Inside source: true *** True Line Result - y = circle.y + camera.y - 40 -** Processing line: ~ w = 900~ + distance_x = (state.star.x - x).abs +** Processing line: ~ distance_y = (state.star.y - y).abs~ - Inside source: true *** True Line Result - w = 900 -** Processing line: ~ h = 30~ + distance_y = (state.star.y - y).abs +** Processing line: ~~ - Inside source: true *** True Line Result - h = 30 -** Processing line: ~ outputs.primitives << [x - w.idiv(2), y - h, w, h, 255, 255, 255, 255].solid~ + +** Processing line: ~ if distance_x > distance_y~ - Inside source: true *** True Line Result - outputs.primitives << [x - w.idiv(2), y - h, w, h, 255, 255, 255, 255].solid -** Processing line: ~ outputs.primitives << [x - w.idiv(2), y - h, w, h, 0, 0, 0, 255].border~ + if distance_x > distance_y +** Processing line: ~ return distance_x~ - Inside source: true *** True Line Result - outputs.primitives << [x - w.idiv(2), y - h, w, h, 0, 0, 0, 255].border -** Processing line: ~ outputs.labels << [x, y - 4, label_text, 1, 1, 0, 0, 0, 255]~ + return distance_x +** Processing line: ~ else~ - Inside source: true *** True Line Result - outputs.labels << [x, y - 4, label_text, 1, 1, 0, 0, 0, 255] + else +** Processing line: ~ return distance_y~ +- Inside source: true +*** True Line Result + return distance_y +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -65827,54 +69388,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 render_aiming_retical~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - def render_aiming_retical -** Processing line: ~ outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.potential_lift * 10) - 5,~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.potential_lift * 10) - 5, -** Processing line: ~ state.camera.y + circle.y + circle.angle.vector_y(circle.potential_lift * 10) - 5,~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ - Inside source: true *** True Line Result - state.camera.y + circle.y + circle.angle.vector_y(circle.potential_lift * 10) - 5, -** Processing line: ~ 10, 10, 'sprites/circle-orange.png']~ + # Finding the cell closest to the mouse helps with this +** Processing line: ~ def cell_closest_to_mouse~ - Inside source: true *** True Line Result - 10, 10, 'sprites/circle-orange.png'] -** Processing line: ~ outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.radius * 3) - 5,~ + def cell_closest_to_mouse +** Processing line: ~ # Closest cell to the mouse in the first grid~ - Inside source: true *** True Line Result - outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.radius * 3) - 5, -** Processing line: ~ state.camera.y + circle.y + circle.angle.vector_y(circle.radius * 3) - 5,~ + # Closest cell to the mouse in the first grid +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - state.camera.y + circle.y + circle.angle.vector_y(circle.radius * 3) - 5, -** Processing line: ~ 10, 10, 'sprites/circle-orange.png', 0, 128]~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - 10, 10, 'sprites/circle-orange.png', 0, 128] -** Processing line: ~ if rand > 0.9~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Bound x and y to the grid~ - Inside source: true *** True Line Result - if rand > 0.9 -** Processing line: ~ outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.radius * 3) - 5,~ + # Bound x and y to the grid +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.radius * 3) - 5, -** Processing line: ~ state.camera.y + circle.y + circle.angle.vector_y(circle.radius * 3) - 5,~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - state.camera.y + circle.y + circle.angle.vector_y(circle.radius * 3) - 5, -** Processing line: ~ 10, 10, 'sprites/circle-white.png', 0, 128]~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - 10, 10, 'sprites/circle-white.png', 0, 128] -** Processing line: ~ end~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - end + [x, y] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -65883,62 +69444,62 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render_circle~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - def render_circle -** Processing line: ~ outputs.sprites << circle.after_images.map do |ai|~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - outputs.sprites << circle.after_images.map do |ai| -** Processing line: ~ ai.merge(x: ai.x + state.camera.x - circle.radius,~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse in the second grid helps with this~ - Inside source: true *** True Line Result - ai.merge(x: ai.x + state.camera.x - circle.radius, -** Processing line: ~ y: ai.y + state.camera.y - circle.radius,~ + # Finding the cell closest to the mouse in the second grid helps with this +** Processing line: ~ def cell_closest_to_mouse2~ - Inside source: true *** True Line Result - y: ai.y + state.camera.y - circle.radius, -** Processing line: ~ w: circle.radius * 2,~ + def cell_closest_to_mouse2 +** Processing line: ~ # Closest cell grid to the mouse in the second~ - Inside source: true *** True Line Result - w: circle.radius * 2, -** Processing line: ~ h: circle.radius * 2,~ + # Closest cell grid to the mouse in the second +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - h: circle.radius * 2, -** Processing line: ~ path: 'sprites/circle-white.png')~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - path: 'sprites/circle-white.png') -** Processing line: ~ end~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Translate the cell to the first grid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Translate the cell to the first grid +** Processing line: ~ x -= grid.width + 1~ - Inside source: true *** True Line Result - -** Processing line: ~ outputs.sprites << [(circle.x - circle.radius) + state.camera.x,~ + x -= grid.width + 1 +** Processing line: ~ # Bound x and y to the first grid~ - Inside source: true *** True Line Result - outputs.sprites << [(circle.x - circle.radius) + state.camera.x, -** Processing line: ~ (circle.y - circle.radius) + state.camera.y,~ + # Bound x and y to the first grid +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - (circle.y - circle.radius) + state.camera.y, -** Processing line: ~ circle.radius * 2,~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - circle.radius * 2, -** Processing line: ~ circle.radius * 2,~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - circle.radius * 2, -** Processing line: ~ 'sprites/probe.png']~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - 'sprites/probe.png'] + [x, y] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -65947,546 +69508,610 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render_debug~ +** Processing line: ~ # Signal that the user is going to be moving the star from the first grid~ - Inside source: true *** True Line Result - def render_debug -** Processing line: ~ return unless state.debug_mode~ + # Signal that the user is going to be moving the star from the first grid +** Processing line: ~ def star_clicked?~ - Inside source: true *** True Line Result - return unless state.debug_mode + def star_clicked? +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star))~ +- Inside source: true +*** True Line Result + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star)) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.labels << [10, 30, state.line_mode, 0, 0, 0, 0, 0]~ +** Processing line: ~ # Signal that the user is going to be moving the star from the second grid~ - Inside source: true *** True Line Result - outputs.labels << [10, 30, state.line_mode, 0, 0, 0, 0, 0] -** Processing line: ~ outputs.labels << [12, 32, state.line_mode, 0, 0, 255, 255, 255]~ + # Signal that the user is going to be moving the star from the second grid +** Processing line: ~ def star2_clicked?~ - Inside source: true *** True Line Result - outputs.labels << [12, 32, state.line_mode, 0, 0, 255, 255, 255] -** Processing line: ~~ + def star2_clicked? +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(early_exit_scale_up(state.star))~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.lines << trajectory(circle).line.to_hash.tap do |h|~ + inputs.mouse.down && inputs.mouse.point.inside_rect?(early_exit_scale_up(state.star)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.outputs.lines << trajectory(circle).line.to_hash.tap do |h| -** Processing line: ~ h[:x] += state.camera.x~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - h[:x] += state.camera.x -** Processing line: ~ h[:y] += state.camera.y~ + +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ - Inside source: true *** True Line Result - h[:y] += state.camera.y -** Processing line: ~ h[:x2] += state.camera.x~ + # Signal that the user is going to be moving the target from the first grid +** Processing line: ~ def target_clicked?~ - Inside source: true *** True Line Result - h[:x2] += state.camera.x -** Processing line: ~ h[:y2] += state.camera.y~ + def target_clicked? +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.target))~ - Inside source: true *** True Line Result - h[:y2] += state.camera.y -** Processing line: ~ end~ + inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.target)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.primitives << state.terrain.find_all do |t|~ +** Processing line: ~ # Signal that the user is going to be moving the target from the second grid~ - Inside source: true *** True Line Result - outputs.primitives << state.terrain.find_all do |t| -** Processing line: ~ circle.x.between?(t.x - 640, t.x2 + 640) || circle.y.between?(t.y - 360, t.y2 + 360)~ + # Signal that the user is going to be moving the target from the second grid +** Processing line: ~ def target2_clicked?~ - Inside source: true *** True Line Result - circle.x.between?(t.x - 640, t.x2 + 640) || circle.y.between?(t.y - 360, t.y2 + 360) -** Processing line: ~ end.map do |t|~ + def target2_clicked? +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(early_exit_scale_up(state.target))~ - Inside source: true *** True Line Result - end.map do |t| -** Processing line: ~ [~ + inputs.mouse.down && inputs.mouse.point.inside_rect?(early_exit_scale_up(state.target)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [ -** Processing line: ~ t.line.associate(r: 0, g: 255, b: 0) do |h|~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - t.line.associate(r: 0, g: 255, b: 0) do |h| -** Processing line: ~ h.x += state.camera.x~ + +** Processing line: ~ # Signal that the user is going to be removing walls from the first grid~ - Inside source: true *** True Line Result - h.x += state.camera.x -** Processing line: ~ h.y += state.camera.y~ + # Signal that the user is going to be removing walls from the first grid +** Processing line: ~ def wall_clicked?~ - Inside source: true *** True Line Result - h.y += state.camera.y -** Processing line: ~ h.x2 += state.camera.x~ + def wall_clicked? +** Processing line: ~ inputs.mouse.down && mouse_inside_wall?~ - Inside source: true *** True Line Result - h.x2 += state.camera.x -** Processing line: ~ h.y2 += state.camera.y~ + inputs.mouse.down && mouse_inside_wall? +** Processing line: ~ end~ - Inside source: true *** True Line Result - h.y2 += state.camera.y -** Processing line: ~ if circle.rect.intersect_rect? t[:rect]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - if circle.rect.intersect_rect? t[:rect] -** Processing line: ~ h[:r] = 255~ + +** Processing line: ~ # Signal that the user is going to be removing walls from the second grid~ - Inside source: true *** True Line Result - h[:r] = 255 -** Processing line: ~ h[:g] = 0~ + # Signal that the user is going to be removing walls from the second grid +** Processing line: ~ def wall2_clicked?~ - Inside source: true *** True Line Result - h[:g] = 0 -** Processing line: ~ end~ + def wall2_clicked? +** Processing line: ~ inputs.mouse.down && mouse_inside_wall2?~ - Inside source: true *** True Line Result - end -** Processing line: ~ h~ + inputs.mouse.down && mouse_inside_wall2? +** Processing line: ~ end~ - Inside source: true *** True Line Result - h -** Processing line: ~ end,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end, -** Processing line: ~ t[:rect].border.associate(r: 255, g: 0, b: 0) do |h|~ + +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ - Inside source: true *** True Line Result - t[:rect].border.associate(r: 255, g: 0, b: 0) do |h| -** Processing line: ~ h.x += state.camera.x~ + # Signal that the user is going to be adding walls from the first grid +** Processing line: ~ def grid_clicked?~ - Inside source: true *** True Line Result - h.x += state.camera.x -** Processing line: ~ h.y += state.camera.y~ + def grid_clicked? +** Processing line: ~ inputs.mouse.down && mouse_inside_grid?~ - Inside source: true *** True Line Result - h.y += state.camera.y -** Processing line: ~ h.b = 255 if line_near_rect? circle.rect, t~ + inputs.mouse.down && mouse_inside_grid? +** Processing line: ~ end~ - Inside source: true *** True Line Result - h.b = 255 if line_near_rect? circle.rect, t -** Processing line: ~ h~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - h -** Processing line: ~ end~ + +** Processing line: ~ # Signal that the user is going to be adding walls from the second grid~ - Inside source: true *** True Line Result - end -** Processing line: ~ ]~ + # Signal that the user is going to be adding walls from the second grid +** Processing line: ~ def grid2_clicked?~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + def grid2_clicked? +** Processing line: ~ inputs.mouse.down && mouse_inside_grid2?~ - Inside source: true *** True Line Result - end + inputs.mouse.down && mouse_inside_grid2? +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.primitives << state.lava.find_all do |t|~ +** Processing line: ~ # Returns whether the mouse is inside of a wall in the first grid~ - Inside source: true *** True Line Result - outputs.primitives << state.lava.find_all do |t| -** Processing line: ~ circle.x.between?(t.x - 640, t.x2 + 640) || circle.y.between?(t.y - 360, t.y2 + 360)~ + # Returns whether the mouse is inside of a wall in the first grid +** Processing line: ~ # Part of the condition that checks whether the user is removing a wall~ - Inside source: true *** True Line Result - circle.x.between?(t.x - 640, t.x2 + 640) || circle.y.between?(t.y - 360, t.y2 + 360) -** Processing line: ~ end.map do |t|~ + # Part of the condition that checks whether the user is removing a wall +** Processing line: ~ def mouse_inside_wall?~ - Inside source: true *** True Line Result - end.map do |t| -** Processing line: ~ [~ + def mouse_inside_wall? +** Processing line: ~ state.walls.each_key do | wall |~ - Inside source: true *** True Line Result - [ -** Processing line: ~ t.line.associate(r: 0, g: 0, b: 255) do |h|~ + state.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(scale_up(wall))~ - Inside source: true *** True Line Result - t.line.associate(r: 0, g: 0, b: 255) do |h| -** Processing line: ~ h.x += state.camera.x~ + return true if inputs.mouse.point.inside_rect?(scale_up(wall)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - h.x += state.camera.x -** Processing line: ~ h.y += state.camera.y~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - h.y += state.camera.y -** Processing line: ~ h.x2 += state.camera.x~ + +** Processing line: ~ false~ - Inside source: true *** True Line Result - h.x2 += state.camera.x -** Processing line: ~ h.y2 += state.camera.y~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - h.y2 += state.camera.y -** Processing line: ~ if circle.rect.intersect_rect? t[:rect]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - if circle.rect.intersect_rect? t[:rect] -** Processing line: ~ h[:r] = 255~ + +** Processing line: ~ # Returns whether the mouse is inside of a wall in the second grid~ - Inside source: true *** True Line Result - h[:r] = 255 -** Processing line: ~ h[:b] = 0~ + # Returns whether the mouse is inside of a wall in the second grid +** Processing line: ~ # Part of the condition that checks whether the user is removing a wall~ - Inside source: true *** True Line Result - h[:b] = 0 -** Processing line: ~ end~ + # Part of the condition that checks whether the user is removing a wall +** Processing line: ~ def mouse_inside_wall2?~ - Inside source: true *** True Line Result - end -** Processing line: ~ h~ + def mouse_inside_wall2? +** Processing line: ~ state.walls.each_key do | wall |~ - Inside source: true *** True Line Result - h -** Processing line: ~ end,~ + state.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(early_exit_scale_up(wall))~ - Inside source: true *** True Line Result - end, -** Processing line: ~ t[:rect].border.associate(r: 255, g: 0, b: 0) do |h|~ + return true if inputs.mouse.point.inside_rect?(early_exit_scale_up(wall)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - t[:rect].border.associate(r: 255, g: 0, b: 0) do |h| -** Processing line: ~ h.x += state.camera.x~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - h.x += state.camera.x -** Processing line: ~ h.y += state.camera.y~ + +** Processing line: ~ false~ - Inside source: true *** True Line Result - h.y += state.camera.y -** Processing line: ~ h.b = 255 if line_near_rect? circle.rect, t~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - h.b = 255 if line_near_rect? circle.rect, t -** Processing line: ~ h~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - h -** Processing line: ~ end~ + +** Processing line: ~ # Returns whether the mouse is inside of the first grid~ - Inside source: true *** True Line Result - end -** Processing line: ~ ]~ + # Returns whether the mouse is inside of the first grid +** Processing line: ~ # Part of the condition that checks whether the user is adding a wall~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + # Part of the condition that checks whether the user is adding a wall +** Processing line: ~ def mouse_inside_grid?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def mouse_inside_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up(grid.rect))~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.god_mode~ + inputs.mouse.point.inside_rect?(scale_up(grid.rect)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - if state.god_mode -** Processing line: ~ border = circle.rect.merge(x: circle.rect.x + state.camera.x,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - border = circle.rect.merge(x: circle.rect.x + state.camera.x, -** Processing line: ~ y: circle.rect.y + state.camera.y,~ + +** Processing line: ~ # Returns whether the mouse is inside of the second grid~ - Inside source: true *** True Line Result - y: circle.rect.y + state.camera.y, -** Processing line: ~ g: 255)~ + # Returns whether the mouse is inside of the second grid +** Processing line: ~ # Part of the condition that checks whether the user is adding a wall~ - Inside source: true *** True Line Result - g: 255) -** Processing line: ~ else~ + # Part of the condition that checks whether the user is adding a wall +** Processing line: ~ def mouse_inside_grid2?~ - Inside source: true *** True Line Result - else -** Processing line: ~ border = circle.rect.merge(x: circle.rect.x + state.camera.x,~ + def mouse_inside_grid2? +** Processing line: ~ inputs.mouse.point.inside_rect?(early_exit_scale_up(grid.rect))~ - Inside source: true *** True Line Result - border = circle.rect.merge(x: circle.rect.x + state.camera.x, -** Processing line: ~ y: circle.rect.y + state.camera.y,~ + inputs.mouse.point.inside_rect?(early_exit_scale_up(grid.rect)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - y: circle.rect.y + state.camera.y, -** Processing line: ~ b: 255)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - b: 255) -** Processing line: ~ end~ + +** Processing line: ~ # These methods provide handy aliases to colors~ - Inside source: true *** True Line Result - end + # These methods provide handy aliases to colors ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.borders << border~ +** Processing line: ~ # Light brown~ - Inside source: true *** True Line Result - outputs.borders << border -** Processing line: ~~ + # Light brown +** Processing line: ~ def unvisited_color~ - Inside source: true *** True Line Result - -** Processing line: ~ overlapping ||= {}~ + def unvisited_color +** Processing line: ~ [221, 212, 213]~ - Inside source: true *** True Line Result - overlapping ||= {} + [221, 212, 213] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ circle.impact_history.each do |h|~ +** Processing line: ~ # Camo Green~ - Inside source: true *** True Line Result - circle.impact_history.each do |h| -** Processing line: ~ label_mod = 300~ + # Camo Green +** Processing line: ~ def wall_color~ - Inside source: true *** True Line Result - label_mod = 300 -** Processing line: ~ x = (h[:body][:x].-(150).idiv(label_mod)) * label_mod + camera.x~ + def wall_color +** Processing line: ~ [134, 134, 120]~ - Inside source: true *** True Line Result - x = (h[:body][:x].-(150).idiv(label_mod)) * label_mod + camera.x -** Processing line: ~ y = (h[:body][:y].+(150).idiv(label_mod)) * label_mod + camera.y~ + [134, 134, 120] +** Processing line: ~ end~ - Inside source: true *** True Line Result - y = (h[:body][:y].+(150).idiv(label_mod)) * label_mod + camera.y -** Processing line: ~ 10.times do~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 10.times do -** Processing line: ~ if overlapping[x] && overlapping[x][y]~ + +** Processing line: ~ # Pastel White~ - Inside source: true *** True Line Result - if overlapping[x] && overlapping[x][y] -** Processing line: ~ y -= 52~ + # Pastel White +** Processing line: ~ def path_color~ - Inside source: true *** True Line Result - y -= 52 -** Processing line: ~ else~ + def path_color +** Processing line: ~ [231, 230, 228]~ - Inside source: true *** True Line Result - else -** Processing line: ~ break~ + [231, 230, 228] +** Processing line: ~ end~ - Inside source: true *** True Line Result - break -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ def red~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def red +** Processing line: ~ [255, 0, 0]~ - Inside source: true *** True Line Result - -** Processing line: ~ overlapping[x] ||= {}~ + [255, 0, 0] +** Processing line: ~ end~ - Inside source: true *** True Line Result - overlapping[x] ||= {} -** Processing line: ~ overlapping[x][y] ||= true~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - overlapping[x][y] ||= true -** Processing line: ~ outputs.primitives << [x, y - 25, 300, 50, 0, 0, 0, 128].solid~ + +** Processing line: ~ # Makes code more concise~ - Inside source: true *** True Line Result - outputs.primitives << [x, y - 25, 300, 50, 0, 0, 0, 128].solid -** Processing line: ~ outputs.labels << [x + 10, y + 24, "dy: %.2f" % h[:body][:new_dy], -2, 0, 255, 255, 255]~ + # Makes code more concise +** Processing line: ~ def grid~ - Inside source: true *** True Line Result - outputs.labels << [x + 10, y + 24, "dy: %.2f" % h[:body][:new_dy], -2, 0, 255, 255, 255] -** Processing line: ~ outputs.labels << [x + 10, y + 9, "dx: %.2f" % h[:body][:new_dx], -2, 0, 255, 255, 255]~ + def grid +** Processing line: ~ state.grid~ - Inside source: true *** True Line Result - outputs.labels << [x + 10, y + 9, "dx: %.2f" % h[:body][:new_dx], -2, 0, 255, 255, 255] -** Processing line: ~ outputs.labels << [x + 10, y - 5, " ?: #{h[:body][:new_reason]}", -2, 0, 255, 255, 255]~ + state.grid +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.labels << [x + 10, y - 5, " ?: #{h[:body][:new_reason]}", -2, 0, 255, 255, 255] + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.labels << [x + 100, y + 24, "angle: %.2f" % h[:impact][:angle], -2, 0, 255, 255, 255]~ +** Processing line: ~ # Method that is called by DragonRuby periodically~ - Inside source: true *** True Line Result - outputs.labels << [x + 100, y + 24, "angle: %.2f" % h[:impact][:angle], -2, 0, 255, 255, 255] -** Processing line: ~ outputs.labels << [x + 100, y + 9, "m(l): %.2f" % h[:terrain][:slope], -2, 0, 255, 255, 255]~ + # Method that is called by DragonRuby periodically +** Processing line: ~ # Used for updating animations and calculations~ - Inside source: true *** True Line Result - outputs.labels << [x + 100, y + 9, "m(l): %.2f" % h[:terrain][:slope], -2, 0, 255, 255, 255] -** Processing line: ~ outputs.labels << [x + 100, y - 5, "m(c): %.2f" % h[:body][:slope], -2, 0, 255, 255, 255]~ + # Used for updating animations and calculations +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - outputs.labels << [x + 100, y - 5, "m(c): %.2f" % h[:body][:slope], -2, 0, 255, 255, 255] + def tick args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ outputs.labels << [x + 200, y + 24, "ray: #{h[:impact][:ray]}", -2, 0, 255, 255, 255]~ +** Processing line: ~ # Pressing r will reset the application~ - Inside source: true *** True Line Result - outputs.labels << [x + 200, y + 24, "ray: #{h[:impact][:ray]}", -2, 0, 255, 255, 255] -** Processing line: ~ outputs.labels << [x + 200, y + 9, "nxt: #{h[:impact][:ray_next]}", -2, 0, 255, 255, 255]~ + # Pressing r will reset the application +** Processing line: ~ if args.inputs.keyboard.key_down.r~ - Inside source: true *** True Line Result - outputs.labels << [x + 200, y + 9, "nxt: #{h[:impact][:ray_next]}", -2, 0, 255, 255, 255] -** Processing line: ~ outputs.labels << [x + 200, y - 5, "typ: #{h[:impact][:type]}", -2, 0, 255, 255, 255]~ + if args.inputs.keyboard.key_down.r +** Processing line: ~ args.gtk.reset~ - Inside source: true *** True Line Result - outputs.labels << [x + 200, y - 5, "typ: #{h[:impact][:type]}", -2, 0, 255, 255, 255] -** Processing line: ~ end~ + args.gtk.reset +** Processing line: ~ reset~ - Inside source: true *** True Line Result - end + reset +** Processing line: ~ return~ +- Inside source: true +*** True Line Result + return +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if circle.floor~ +** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ - Inside source: true *** True Line Result - if circle.floor -** Processing line: ~ outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 100, "point: #{circle.floor_point.slice(:x, :y).values}", -2, 0]~ + # Every tick, new args are passed, and the Breadth First Search tick is called +** Processing line: ~ $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new(args)~ - Inside source: true *** True Line Result - outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 100, "point: #{circle.floor_point.slice(:x, :y).values}", -2, 0] -** Processing line: ~ outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 101, "point: #{circle.floor_point.slice(:x, :y).values}", -2, 0, 255, 255, 255]~ + $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new(args) +** Processing line: ~ $early_exit_breadth_first_search.args = args~ - Inside source: true *** True Line Result - outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 101, "point: #{circle.floor_point.slice(:x, :y).values}", -2, 0, 255, 255, 255] -** Processing line: ~ outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 85, "circle: #{circle.as_hash.slice(:x, :y).values}", -2, 0]~ + $early_exit_breadth_first_search.args = args +** Processing line: ~ $early_exit_breadth_first_search.tick~ - Inside source: true *** True Line Result - outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 85, "circle: #{circle.as_hash.slice(:x, :y).values}", -2, 0] -** Processing line: ~ outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 86, "circle: #{circle.as_hash.slice(:x, :y).values}", -2, 0, 255, 255, 255]~ + $early_exit_breadth_first_search.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 86, "circle: #{circle.as_hash.slice(:x, :y).values}", -2, 0, 255, 255, 255] -** Processing line: ~ outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 70, "rel: #{circle.floor_relative_x} #{circle.floor_relative_y}", -2, 0]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 70, "rel: #{circle.floor_relative_x} #{circle.floor_relative_y}", -2, 0] -** Processing line: ~ outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 71, "rel: #{circle.floor_relative_x} #{circle.floor_relative_y}", -2, 0, 255, 255, 255]~ + +** Processing line: ~~ - Inside source: true *** True Line Result - outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 71, "rel: #{circle.floor_relative_x} #{circle.floor_relative_y}", -2, 0, 255, 255, 255] -** Processing line: ~ end~ + +** Processing line: ~ def reset~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def reset +** Processing line: ~ $early_exit_breadth_first_search = nil~ - Inside source: true *** True Line Result - end + $early_exit_breadth_first_search = nil +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_stage_editor~ +** 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: ~*** Path Finding Algorithms - Dijkstra - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Path Finding Algorithms - Dijkstra - 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/13_path_finding_algorithms/05_dijkstra/app/main.rb~ - Inside source: true *** True Line Result - def render_stage_editor -** Processing line: ~ return unless state.god_mode~ + # ./samples/13_path_finding_algorithms/05_dijkstra/app/main.rb +** Processing line: ~ # Demonstrates how Dijkstra's Algorithm allows movement costs to be considered~ - Inside source: true *** True Line Result - return unless state.god_mode -** Processing line: ~ return unless state.point_one~ + # Demonstrates how Dijkstra's Algorithm allows movement costs to be considered +** Processing line: ~~ - Inside source: true *** True Line Result - return unless state.point_one -** Processing line: ~ args.lines << [state.point_one, inputs.mouse.point, 0, 255, 255]~ + +** Processing line: ~ # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ - Inside source: true *** True Line Result - args.lines << [state.point_one, inputs.mouse.point, 0, 255, 255] -** Processing line: ~ end~ + # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html +** Processing line: ~~ - Inside source: true *** True Line Result - end + +** Processing line: ~ # The first grid is a breadth first search with an early exit.~ +- Inside source: true +*** True Line Result + # The first grid is a breadth first search with an early exit. +** Processing line: ~ # It shows a heat map of all the cells that were visited by the search and their relative distance.~ +- Inside source: true +*** True Line Result + # It shows a heat map of all the cells that were visited by the search and their relative distance. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def trajectory body~ +** Processing line: ~ # The second grid is an implementation of Dijkstra's algorithm.~ - Inside source: true *** True Line Result - def trajectory body -** Processing line: ~ [body.x + body.dx,~ + # The second grid is an implementation of Dijkstra's algorithm. +** Processing line: ~ # Light green cells have 5 times the movement cost of regular cells.~ - Inside source: true *** True Line Result - [body.x + body.dx, -** Processing line: ~ body.y + body.dy,~ + # Light green cells have 5 times the movement cost of regular cells. +** Processing line: ~ # The heat map will darken based on movement cost.~ - Inside source: true *** True Line Result - body.y + body.dy, -** Processing line: ~ body.x + body.dx * 1000,~ + # The heat map will darken based on movement cost. +** Processing line: ~~ - Inside source: true *** True Line Result - body.x + body.dx * 1000, -** Processing line: ~ body.y + body.dy * 1000,~ + +** Processing line: ~ # Dark green cells are walls, and the search cannot go through them.~ - Inside source: true *** True Line Result - body.y + body.dy * 1000, -** Processing line: ~ 0, 255, 255]~ + # Dark green cells are walls, and the search cannot go through them. +** Processing line: ~ class Movement_Costs~ - Inside source: true *** True Line Result - 0, 255, 255] -** Processing line: ~ end~ + class Movement_Costs +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - end + attr_gtk ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def lengthen_line line, num~ +** Processing line: ~ # This method is called every frame/tick~ - Inside source: true *** True Line Result - def lengthen_line line, num -** Processing line: ~ line = normalize_line(line)~ + # This method is called every frame/tick +** Processing line: ~ # Every tick, the current state of the search is rendered on the screen,~ - Inside source: true *** True Line Result - line = normalize_line(line) -** Processing line: ~ slope = geometry.line_slope(line, replace_infinity: 10).abs~ + # Every tick, the current state of the search is rendered on the screen, +** Processing line: ~ # User input is processed, and~ - Inside source: true *** True Line Result - slope = geometry.line_slope(line, replace_infinity: 10).abs -** Processing line: ~ if slope < 2~ + # User input is processed, and +** Processing line: ~ # The next step in the search is calculated~ - Inside source: true *** True Line Result - if slope < 2 -** Processing line: ~ [line.x - num, line.y, line.x2 + num, line.y2].line.to_hash~ + # The next step in the search is calculated +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - [line.x - num, line.y, line.x2 + num, line.y2].line.to_hash -** Processing line: ~ else~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - else -** Processing line: ~ [line.x, line.y, line.x2, line.y2].line.to_hash~ + defaults +** Processing line: ~ render~ - Inside source: true *** True Line Result - [line.x, line.y, line.x2, line.y2].line.to_hash -** Processing line: ~ end~ + render +** Processing line: ~ input~ - Inside source: true *** True Line Result - end + input +** Processing line: ~ calc~ +- Inside source: true +*** True Line Result + calc ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -66495,354 +70120,366 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def normalize_line line~ +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - def normalize_line line -** Processing line: ~ if line.x > line.x2~ + def defaults +** Processing line: ~ # Variables to edit the size and appearance of the grid~ - Inside source: true *** True Line Result - if line.x > line.x2 -** Processing line: ~ x = line.x2~ + # Variables to edit the size and appearance of the grid +** Processing line: ~ # Freely customizable to user's liking~ - Inside source: true *** True Line Result - x = line.x2 -** Processing line: ~ y = line.y2~ + # Freely customizable to user's liking +** Processing line: ~ grid.width ||= 10~ - Inside source: true *** True Line Result - y = line.y2 -** Processing line: ~ x2 = line.x~ + grid.width ||= 10 +** Processing line: ~ grid.height ||= 10~ - Inside source: true *** True Line Result - x2 = line.x -** Processing line: ~ y2 = line.y~ + grid.height ||= 10 +** Processing line: ~ grid.cell_size ||= 60~ - Inside source: true *** True Line Result - y2 = line.y -** Processing line: ~ else~ + grid.cell_size ||= 60 +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ - Inside source: true *** True Line Result - else -** Processing line: ~ x = line.x~ + grid.rect ||= [0, 0, grid.width, grid.height] +** Processing line: ~~ - Inside source: true *** True Line Result - x = line.x -** Processing line: ~ y = line.y~ + +** Processing line: ~ # The location of the star and walls of the grid~ - Inside source: true *** True Line Result - y = line.y -** Processing line: ~ x2 = line.x2~ + # The location of the star and walls of the grid +** Processing line: ~ # They can be modified to have a different initial grid~ - Inside source: true *** True Line Result - x2 = line.x2 -** Processing line: ~ y2 = line.y2~ + # They can be modified to have a different initial grid +** Processing line: ~ # Walls are stored in a hash for quick look up when doing the search~ - Inside source: true *** True Line Result - y2 = line.y2 -** Processing line: ~ end~ + # Walls are stored in a hash for quick look up when doing the search +** Processing line: ~ state.star ||= [1, 5]~ - Inside source: true *** True Line Result - end -** Processing line: ~ [x, y, x2, y2]~ + state.star ||= [1, 5] +** Processing line: ~ state.target ||= [8, 4]~ - Inside source: true *** True Line Result - [x, y, x2, y2] -** Processing line: ~ end~ + state.target ||= [8, 4] +** Processing line: ~ state.walls ||= {[1, 1] => true, [2, 1] => true, [3, 1] => true, [1, 2] => true, [2, 2] => true, [3, 2] => true}~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.walls ||= {[1, 1] => true, [2, 1] => true, [3, 1] => true, [1, 2] => true, [2, 2] => true, [3, 2] => true} +** Processing line: ~ state.hills ||= {~ - Inside source: true *** True Line Result - -** Processing line: ~ def rect_for_line line~ + state.hills ||= { +** Processing line: ~ [4, 1] => true,~ - Inside source: true *** True Line Result - def rect_for_line line -** Processing line: ~ if line.x > line.x2~ + [4, 1] => true, +** Processing line: ~ [5, 1] => true,~ - Inside source: true *** True Line Result - if line.x > line.x2 -** Processing line: ~ x = line.x2~ + [5, 1] => true, +** Processing line: ~ [4, 2] => true,~ - Inside source: true *** True Line Result - x = line.x2 -** Processing line: ~ y = line.y2~ + [4, 2] => true, +** Processing line: ~ [5, 2] => true,~ - Inside source: true *** True Line Result - y = line.y2 -** Processing line: ~ x2 = line.x~ + [5, 2] => true, +** Processing line: ~ [6, 2] => true,~ - Inside source: true *** True Line Result - x2 = line.x -** Processing line: ~ y2 = line.y~ + [6, 2] => true, +** Processing line: ~ [4, 3] => true,~ - Inside source: true *** True Line Result - y2 = line.y -** Processing line: ~ else~ + [4, 3] => true, +** Processing line: ~ [5, 3] => true,~ - Inside source: true *** True Line Result - else -** Processing line: ~ x = line.x~ + [5, 3] => true, +** Processing line: ~ [6, 3] => true,~ - Inside source: true *** True Line Result - x = line.x -** Processing line: ~ y = line.y~ + [6, 3] => true, +** Processing line: ~ [3, 4] => true,~ - Inside source: true *** True Line Result - y = line.y -** Processing line: ~ x2 = line.x2~ + [3, 4] => true, +** Processing line: ~ [4, 4] => true,~ - Inside source: true *** True Line Result - x2 = line.x2 -** Processing line: ~ y2 = line.y2~ + [4, 4] => true, +** Processing line: ~ [5, 4] => true,~ - Inside source: true *** True Line Result - y2 = line.y2 -** Processing line: ~ end~ + [5, 4] => true, +** Processing line: ~ [6, 4] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6, 4] => true, +** Processing line: ~ [7, 4] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ w = x2 - x~ + [7, 4] => true, +** Processing line: ~ [3, 5] => true,~ - Inside source: true *** True Line Result - w = x2 - x -** Processing line: ~ h = y2 - y~ + [3, 5] => true, +** Processing line: ~ [4, 5] => true,~ - Inside source: true *** True Line Result - h = y2 - y -** Processing line: ~~ + [4, 5] => true, +** Processing line: ~ [5, 5] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ if h < 0~ + [5, 5] => true, +** Processing line: ~ [6, 5] => true,~ - Inside source: true *** True Line Result - if h < 0 -** Processing line: ~ y += h~ + [6, 5] => true, +** Processing line: ~ [7, 5] => true,~ - Inside source: true *** True Line Result - y += h -** Processing line: ~ h = h.abs~ + [7, 5] => true, +** Processing line: ~ [4, 6] => true,~ - Inside source: true *** True Line Result - h = h.abs -** Processing line: ~ end~ + [4, 6] => true, +** Processing line: ~ [5, 6] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [5, 6] => true, +** Processing line: ~ [6, 6] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ if w < circle.radius~ + [6, 6] => true, +** Processing line: ~ [7, 6] => true,~ - Inside source: true *** True Line Result - if w < circle.radius -** Processing line: ~ x -= circle.radius~ + [7, 6] => true, +** Processing line: ~ [4, 7] => true,~ - Inside source: true *** True Line Result - x -= circle.radius -** Processing line: ~ w = circle.radius * 2~ + [4, 7] => true, +** Processing line: ~ [5, 7] => true,~ - Inside source: true *** True Line Result - w = circle.radius * 2 -** Processing line: ~ end~ + [5, 7] => true, +** Processing line: ~ [6, 7] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6, 7] => true, +** Processing line: ~ [4, 8] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ if h < circle.radius~ + [4, 8] => true, +** Processing line: ~ [5, 8] => true,~ - Inside source: true *** True Line Result - if h < circle.radius -** Processing line: ~ y -= circle.radius~ + [5, 8] => true, +** Processing line: ~ }~ - Inside source: true *** True Line Result - y -= circle.radius -** Processing line: ~ h = circle.radius * 2~ + } +** Processing line: ~~ - Inside source: true *** True Line Result - h = circle.radius * 2 -** Processing line: ~ end~ + +** Processing line: ~ # What the user is currently editing on the grid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # What the user is currently editing on the grid +** Processing line: ~ # We store this value, because we want to remember the value even when~ - Inside source: true *** True Line Result - -** Processing line: ~ { x: x, y: y, w: w, h: h }~ + # We store this value, because we want to remember the value even when +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ - Inside source: true *** True Line Result - { x: x, y: y, w: w, h: h } -** Processing line: ~ end~ + # the user's cursor is no longer over what they're interacting with, but +** Processing line: ~ # they are still clicking down on the mouse.~ - Inside source: true *** True Line Result - end + # they are still clicking down on the mouse. +** Processing line: ~ state.user_input ||= :none~ +- Inside source: true +*** True Line Result + state.user_input ||= :none ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def snap_to_grid x, y, snaps~ +** Processing line: ~ # Values that are used for the breadth first search~ - Inside source: true *** True Line Result - def snap_to_grid x, y, snaps -** Processing line: ~ snap_number = 10~ + # Values that are used for the breadth first search +** Processing line: ~ # Keeping track of what cells were visited prevents counting cells multiple times~ - Inside source: true *** True Line Result - snap_number = 10 -** Processing line: ~ x = x.to_i~ + # Keeping track of what cells were visited prevents counting cells multiple times +** Processing line: ~ breadth_first_search.visited ||= {}~ - Inside source: true *** True Line Result - x = x.to_i -** Processing line: ~ y = y.to_i~ + breadth_first_search.visited ||= {} +** Processing line: ~ # The cells from which the breadth first search will expand~ - Inside source: true *** True Line Result - y = y.to_i -** Processing line: ~~ + # The cells from which the breadth first search will expand +** Processing line: ~ breadth_first_search.frontier ||= []~ - Inside source: true *** True Line Result - -** Processing line: ~ x_floor = x.idiv(snap_number) * snap_number~ + breadth_first_search.frontier ||= [] +** Processing line: ~ # Keeps track of which cell all cells were searched from~ - Inside source: true *** True Line Result - x_floor = x.idiv(snap_number) * snap_number -** Processing line: ~ x_mod = x % snap_number~ + # Keeps track of which cell all cells were searched from +** Processing line: ~ # Used to recreate the path from the target to the star~ - Inside source: true *** True Line Result - x_mod = x % snap_number -** Processing line: ~ x_ceil = (x.idiv(snap_number) + 1) * snap_number~ + # Used to recreate the path from the target to the star +** Processing line: ~ breadth_first_search.came_from ||= {}~ - Inside source: true *** True Line Result - x_ceil = (x.idiv(snap_number) + 1) * snap_number + breadth_first_search.came_from ||= {} ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ y_floor = y.idiv(snap_number) * snap_number~ +** Processing line: ~ # Keeps track of the movement cost so far to be at a cell~ - Inside source: true *** True Line Result - y_floor = y.idiv(snap_number) * snap_number -** Processing line: ~ y_mod = y % snap_number~ + # Keeps track of the movement cost so far to be at a cell +** Processing line: ~ # Allows the costs of new cells to be quickly calculated~ - Inside source: true *** True Line Result - y_mod = y % snap_number -** Processing line: ~ y_ceil = (y.idiv(snap_number) + 1) * snap_number~ + # Allows the costs of new cells to be quickly calculated +** Processing line: ~ # Also doubles as a way to check if cells have already been visited~ - Inside source: true *** True Line Result - y_ceil = (y.idiv(snap_number) + 1) * snap_number -** Processing line: ~~ + # Also doubles as a way to check if cells have already been visited +** Processing line: ~ dijkstra_search.cost_so_far ||= {}~ - Inside source: true *** True Line Result - -** Processing line: ~ if snaps[x_floor]~ + dijkstra_search.cost_so_far ||= {} +** Processing line: ~ # The cells from which the Dijkstra search will expand~ - Inside source: true *** True Line Result - if snaps[x_floor] -** Processing line: ~ x_result = x_floor~ + # The cells from which the Dijkstra search will expand +** Processing line: ~ dijkstra_search.frontier ||= []~ - Inside source: true *** True Line Result - x_result = x_floor -** Processing line: ~ elsif snaps[x_ceil]~ + dijkstra_search.frontier ||= [] +** Processing line: ~ # Keeps track of which cell all cells were searched from~ - Inside source: true *** True Line Result - elsif snaps[x_ceil] -** Processing line: ~ x_result = x_ceil~ + # Keeps track of which cell all cells were searched from +** Processing line: ~ # Used to recreate the path from the target to the star~ - Inside source: true *** True Line Result - x_result = x_ceil -** Processing line: ~ elsif x_mod < snap_number.idiv(2)~ + # Used to recreate the path from the target to the star +** Processing line: ~ dijkstra_search.came_from ||= {}~ - Inside source: true *** True Line Result - elsif x_mod < snap_number.idiv(2) -** Processing line: ~ x_result = x_floor~ + dijkstra_search.came_from ||= {} +** Processing line: ~ end~ - Inside source: true *** True Line Result - x_result = x_floor -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ x_result = x_ceil~ + +** Processing line: ~ # Draws everything onto the screen~ - Inside source: true *** True Line Result - x_result = x_ceil -** Processing line: ~ end~ + # Draws everything onto the screen +** Processing line: ~ def render~ - Inside source: true *** True Line Result - end + def render +** Processing line: ~ render_background~ +- Inside source: true +*** True Line Result + render_background ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ snaps[x_result] ||= {}~ +** Processing line: ~ render_heat_maps~ - Inside source: true *** True Line Result - snaps[x_result] ||= {} + render_heat_maps ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if snaps[x_result][y_floor]~ -- Inside source: true -*** True Line Result - if snaps[x_result][y_floor] -** Processing line: ~ y_result = y_floor~ +** Processing line: ~ render_star~ - Inside source: true *** True Line Result - y_result = y_floor -** Processing line: ~ elsif snaps[x_result][y_ceil]~ + render_star +** Processing line: ~ render_target~ - Inside source: true *** True Line Result - elsif snaps[x_result][y_ceil] -** Processing line: ~ y_result = y_ceil~ + render_target +** Processing line: ~ render_hills~ - Inside source: true *** True Line Result - y_result = y_ceil -** Processing line: ~ elsif y_mod < snap_number.idiv(2)~ + render_hills +** Processing line: ~ render_walls~ - Inside source: true *** True Line Result - elsif y_mod < snap_number.idiv(2) -** Processing line: ~ y_result = y_floor~ + render_walls +** Processing line: ~~ - Inside source: true *** True Line Result - y_result = y_floor -** Processing line: ~ else~ + +** Processing line: ~ render_paths~ - Inside source: true *** True Line Result - else -** Processing line: ~ y_result = y_ceil~ + render_paths +** Processing line: ~ end~ - Inside source: true *** True Line Result - y_result = y_ceil -** Processing line: ~ end~ + end +** Processing line: ~ # The methods below subdivide the task of drawing everything to the screen~ - Inside source: true *** True Line Result - end + # The methods below subdivide the task of drawing everything to the screen ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ snaps[x_result][y_result] = true~ +** Processing line: ~ # Draws what the grid looks like with nothing on it~ - Inside source: true *** True Line Result - snaps[x_result][y_result] = true -** Processing line: ~ return [x_result, y_result]~ + # Draws what the grid looks like with nothing on it +** Processing line: ~ def render_background~ - Inside source: true *** True Line Result - return [x_result, y_result] -** Processing line: ~~ + def render_background +** Processing line: ~ render_unvisited~ - Inside source: true *** True Line Result - + render_unvisited +** Processing line: ~ render_grid_lines~ +- Inside source: true +*** True Line Result + render_grid_lines +** Processing line: ~ render_labels~ +- Inside source: true +*** True Line Result + render_labels ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -66851,46 +70488,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 snap_line line~ +** Processing line: ~ # Draws two rectangles the size of the grid in the default cell color~ - Inside source: true *** True Line Result - def snap_line line -** Processing line: ~ x, y, x2, y2 = line~ + # Draws two rectangles the size of the grid in the default cell color +** Processing line: ~ # Used as part of the background~ - Inside source: true *** True Line Result - x, y, x2, y2 = line -** Processing line: ~ end~ + # Used as part of the background +** Processing line: ~ def render_unvisited~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def render_unvisited +** Processing line: ~ outputs.solids << [scale_up(grid.rect), unvisited_color]~ - Inside source: true *** True Line Result - -** Processing line: ~ def string_to_line s~ + outputs.solids << [scale_up(grid.rect), unvisited_color] +** Processing line: ~ outputs.solids << [move_and_scale_up(grid.rect), unvisited_color]~ - Inside source: true *** True Line Result - def string_to_line s -** Processing line: ~ x, y, x2, y2 = s.split(',').map(&:to_f)~ + outputs.solids << [move_and_scale_up(grid.rect), unvisited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - x, y, x2, y2 = s.split(',').map(&:to_f) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if x > x2~ +** Processing line: ~ # Draws grid lines to show the division of the grid into cells~ - Inside source: true *** True Line Result - if x > x2 -** Processing line: ~ x2, x = x, x2~ + # Draws grid lines to show the division of the grid into cells +** Processing line: ~ def render_grid_lines~ - Inside source: true *** True Line Result - x2, x = x, x2 -** Processing line: ~ y2, y = y, y2~ + def render_grid_lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - y2, y = y, y2 + for x in 0..grid.width +** Processing line: ~ outputs.lines << vertical_line(x)~ +- Inside source: true +*** True Line Result + outputs.lines << vertical_line(x) +** Processing line: ~ outputs.lines << shifted_vertical_line(x)~ +- Inside source: true +*** True Line Result + outputs.lines << shifted_vertical_line(x) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -66899,18 +70544,22 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ x, y = snap_to_grid x, y, state.snaps~ +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - x, y = snap_to_grid x, y, state.snaps -** Processing line: ~ x2, y2 = snap_to_grid x2, y2, state.snaps~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << horizontal_line(y)~ - Inside source: true *** True Line Result - x2, y2 = snap_to_grid x2, y2, state.snaps -** Processing line: ~ [x, y, x2, y2].line.to_hash~ + outputs.lines << horizontal_line(y) +** Processing line: ~ outputs.lines << shifted_horizontal_line(y)~ - Inside source: true *** True Line Result - [x, y, x2, y2].line.to_hash + outputs.lines << shifted_horizontal_line(y) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -66919,30 +70568,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 load_lines file~ +** Processing line: ~ # Easy way to draw vertical lines given an index for the first grid~ - Inside source: true *** True Line Result - def load_lines file -** Processing line: ~ data = gtk.read_file(file) || ""~ + # Easy way to draw vertical lines given an index for the first grid +** Processing line: ~ def vertical_line column~ - Inside source: true *** True Line Result - data = gtk.read_file(file) || "" -** Processing line: ~ data.each_line~ + def vertical_line column +** Processing line: ~ scale_up([column, 0, column, grid.height])~ - Inside source: true *** True Line Result - data.each_line -** Processing line: ~ .reject { |l| l.strip.length == 0 }~ + scale_up([column, 0, column, grid.height]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - .reject { |l| l.strip.length == 0 } -** Processing line: ~ .map { |l| string_to_line l }~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - .map { |l| string_to_line l } -** Processing line: ~ .map { |h| h.merge(rect: rect_for_line(h)) }~ + +** Processing line: ~ # Easy way to draw horizontal lines given an index for the second grid~ - Inside source: true *** True Line Result - .map { |h| h.merge(rect: rect_for_line(h)) } + # Easy way to draw horizontal lines given an index for the second grid +** Processing line: ~ def horizontal_line row~ +- Inside source: true +*** True Line Result + def horizontal_line row +** Processing line: ~ scale_up([0, row, grid.width, row])~ +- Inside source: true +*** True Line Result + scale_up([0, row, grid.width, row]) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -66951,14 +70608,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 load_terrain~ +** Processing line: ~ # Easy way to draw vertical lines given an index for the first grid~ - Inside source: true *** True Line Result - def load_terrain -** Processing line: ~ load_lines 'data/level.txt'~ + # Easy way to draw vertical lines given an index for the first grid +** Processing line: ~ def shifted_vertical_line column~ - Inside source: true *** True Line Result - load_lines 'data/level.txt' + def shifted_vertical_line column +** Processing line: ~ scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height])~ +- Inside source: true +*** True Line Result + scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height]) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -66967,14 +70628,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 load_lava~ +** Processing line: ~ # Easy way to draw horizontal lines given an index for the second grid~ - Inside source: true *** True Line Result - def load_lava -** Processing line: ~ load_lines 'data/level_lava.txt'~ + # Easy way to draw horizontal lines given an index for the second grid +** Processing line: ~ def shifted_horizontal_line row~ - Inside source: true *** True Line Result - load_lines 'data/level_lava.txt' + def shifted_horizontal_line row +** Processing line: ~ scale_up([grid.width + 1, row, grid.width + grid.width + 1, row])~ +- Inside source: true +*** True Line Result + scale_up([grid.width + 1, row, grid.width + grid.width + 1, row]) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -66983,42 +70648,42 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def load_level force: false~ +** Processing line: ~ # Labels the grids~ - Inside source: true *** True Line Result - def load_level force: false -** Processing line: ~ if force~ + # Labels the grids +** Processing line: ~ def render_labels~ - Inside source: true *** True Line Result - if force -** Processing line: ~ state.snaps = {}~ + def render_labels +** Processing line: ~ outputs.labels << [175, 650, "Number of steps", 3]~ - Inside source: true *** True Line Result - state.snaps = {} -** Processing line: ~ state.terrain = load_terrain~ + outputs.labels << [175, 650, "Number of steps", 3] +** Processing line: ~ outputs.labels << [925, 650, "Distance", 3]~ - Inside source: true *** True Line Result - state.terrain = load_terrain -** Processing line: ~ state.lava = load_lava~ + outputs.labels << [925, 650, "Distance", 3] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.lava = load_lava -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.terrain ||= load_terrain~ + +** Processing line: ~ def render_paths~ - Inside source: true *** True Line Result - state.terrain ||= load_terrain -** Processing line: ~ state.lava ||= load_lava~ + def render_paths +** Processing line: ~ render_breadth_first_search_path~ - Inside source: true *** True Line Result - state.lava ||= load_lava -** Processing line: ~ end~ + render_breadth_first_search_path +** Processing line: ~ render_dijkstra_path~ - Inside source: true *** True Line Result - end + render_dijkstra_path ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -67027,26 +70692,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 save_lines lines, file~ -- Inside source: true -*** True Line Result - def save_lines lines, file -** Processing line: ~ s = lines.map do |l|~ -- Inside source: true -*** True Line Result - s = lines.map do |l| -** Processing line: ~ "#{l.x1},#{l.y1},#{l.x2},#{l.y2}"~ +** Processing line: ~ def render_heat_maps~ - Inside source: true *** True Line Result - "#{l.x1},#{l.y1},#{l.x2},#{l.y2}" -** Processing line: ~ end.join("\n")~ + def render_heat_maps +** Processing line: ~ render_breadth_first_search_heat_map~ - Inside source: true *** True Line Result - end.join("\n") -** Processing line: ~ gtk.write_file(file, s)~ + render_breadth_first_search_heat_map +** Processing line: ~ render_dijkstra_heat_map~ - Inside source: true *** True Line Result - gtk.write_file(file, s) + render_dijkstra_heat_map ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -67055,22 +70712,14 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def save_level~ +** Processing line: ~ # Renders the breadth first search on the first grid~ - Inside source: true *** True Line Result - def save_level -** Processing line: ~ save_lines(state.terrain, 'level.txt')~ -- Inside source: true -*** True Line Result - save_lines(state.terrain, 'level.txt') -** Processing line: ~ save_lines(state.lava, 'level_lava.txt')~ -- Inside source: true -*** True Line Result - save_lines(state.lava, 'level_lava.txt') -** Processing line: ~ load_level force: true~ + # Renders the breadth first search on the first grid +** Processing line: ~ def render_breadth_first_search~ - Inside source: true *** True Line Result - load_level force: true + def render_breadth_first_search ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -67079,150 +70728,142 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def line_near_rect? rect, terrain~ -- Inside source: true -*** True Line Result - def line_near_rect? rect, terrain -** Processing line: ~ geometry.intersect_rect?(rect, terrain[:rect])~ -- Inside source: true -*** True Line Result - geometry.intersect_rect?(rect, terrain[:rect]) -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ +** Processing line: ~ # This heat map shows the cells explored by the breadth first search and how far they are from the star.~ - Inside source: true *** True Line Result - -** Processing line: ~ def point_within_line? point, line~ + # This heat map shows the cells explored by the breadth first search and how far they are from the star. +** Processing line: ~ def render_breadth_first_search_heat_map~ - Inside source: true *** True Line Result - def point_within_line? point, line -** Processing line: ~ return false if !point~ + def render_breadth_first_search_heat_map +** Processing line: ~ # For each cell explored~ - Inside source: true *** True Line Result - return false if !point -** Processing line: ~ return false if !line~ + # For each cell explored +** Processing line: ~ breadth_first_search.visited.each_key do | visited_cell |~ - Inside source: true *** True Line Result - return false if !line -** Processing line: ~ return true~ + breadth_first_search.visited.each_key do | visited_cell | +** Processing line: ~ # Find its distance from the star~ - Inside source: true *** True Line Result - return true -** Processing line: ~ end~ + # Find its distance from the star +** Processing line: ~ distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs +** Processing line: ~ max_distance = grid.width + grid.height~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_impacts x, dx, y, dy, radius~ + max_distance = grid.width + grid.height +** Processing line: ~ # Get it as a percent of the maximum distance and scale to 255 for use as an alpha value~ - Inside source: true *** True Line Result - def calc_impacts x, dx, y, dy, radius -** Processing line: ~ results = { }~ + # Get it as a percent of the maximum distance and scale to 255 for use as an alpha value +** Processing line: ~ alpha = 255.to_i * distance.to_i / max_distance.to_i~ - Inside source: true *** True Line Result - results = { } -** Processing line: ~ results[:x] = x~ + alpha = 255.to_i * distance.to_i / max_distance.to_i +** Processing line: ~ outputs.solids << [scale_up(visited_cell), red, alpha]~ - Inside source: true *** True Line Result - results[:x] = x -** Processing line: ~ results[:y] = y~ + outputs.solids << [scale_up(visited_cell), red, alpha] +** Processing line: ~ end~ - Inside source: true *** True Line Result - results[:y] = y -** Processing line: ~ results[:dx] = x~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - results[:dx] = x -** Processing line: ~ results[:dy] = y~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - results[:dy] = y -** Processing line: ~ results[:point] = { x: x, y: y }~ + +** Processing line: ~ def render_breadth_first_search_path~ - Inside source: true *** True Line Result - results[:point] = { x: x, y: y } -** Processing line: ~ results[:rect] = { x: x - radius, y: y - radius, w: radius * 2, h: radius * 2 }~ + def render_breadth_first_search_path +** Processing line: ~ # If the search found the target~ - Inside source: true *** True Line Result - results[:rect] = { x: x - radius, y: y - radius, w: radius * 2, h: radius * 2 } -** Processing line: ~ results[:trajectory] = trajectory(results)~ + # If the search found the target +** Processing line: ~ if breadth_first_search.visited.has_key?(state.target)~ - Inside source: true *** True Line Result - results[:trajectory] = trajectory(results) -** Processing line: ~ results[:impacts] = terrain.find_all { |t| line_near_rect? results[:rect], t }.map do |t|~ + if breadth_first_search.visited.has_key?(state.target) +** Processing line: ~ # Start from the target~ - Inside source: true *** True Line Result - results[:impacts] = terrain.find_all { |t| line_near_rect? results[:rect], t }.map do |t| -** Processing line: ~ {~ + # Start from the target +** Processing line: ~ endpoint = state.target~ - Inside source: true *** True Line Result - { -** Processing line: ~ terrain: t,~ + endpoint = state.target +** Processing line: ~ # And the cell it came from~ - Inside source: true *** True Line Result - terrain: t, -** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t),~ + # And the cell it came from +** Processing line: ~ next_endpoint = breadth_first_search.came_from[endpoint]~ - Inside source: true *** True Line Result - point: geometry.line_intersect(results[:trajectory], t), -** Processing line: ~ type: :terrain~ + next_endpoint = breadth_first_search.came_from[endpoint] +** Processing line: ~ while endpoint and next_endpoint~ - Inside source: true *** True Line Result - type: :terrain -** Processing line: ~ }~ + while endpoint and next_endpoint +** Processing line: ~ # Draw a path between these two cells~ - Inside source: true *** True Line Result - } -** Processing line: ~ end.reject { |t| !point_within_line? t[:point], t[:terrain] }~ + # Draw a path between these two cells +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ - Inside source: true *** True Line Result - end.reject { |t| !point_within_line? t[:point], t[:terrain] } -** Processing line: ~~ + path = get_path_between(endpoint, next_endpoint) +** Processing line: ~ outputs.solids << [scale_up(path), path_color]~ - Inside source: true *** True Line Result - -** Processing line: ~ results[:impacts] += lava.find_all { |t| line_near_rect? results[:rect], t }.map do |t|~ + outputs.solids << [scale_up(path), path_color] +** Processing line: ~ # And get the next pair of cells~ - Inside source: true *** True Line Result - results[:impacts] += lava.find_all { |t| line_near_rect? results[:rect], t }.map do |t| -** Processing line: ~ {~ + # And get the next pair of cells +** Processing line: ~ endpoint = next_endpoint~ - Inside source: true *** True Line Result - { -** Processing line: ~ terrain: t,~ + endpoint = next_endpoint +** Processing line: ~ next_endpoint = breadth_first_search.came_from[endpoint]~ - Inside source: true *** True Line Result - terrain: t, -** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t),~ + next_endpoint = breadth_first_search.came_from[endpoint] +** Processing line: ~ # Continue till there are no more cells~ - Inside source: true *** True Line Result - point: geometry.line_intersect(results[:trajectory], t), -** Processing line: ~ type: :lava~ + # Continue till there are no more cells +** Processing line: ~ end~ - Inside source: true *** True Line Result - type: :lava -** Processing line: ~ }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end.reject { |t| !point_within_line? t[:point], t[:terrain] }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end.reject { |t| !point_within_line? t[:point], t[:terrain] } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ results~ +** Processing line: ~ # Renders the Dijkstra search on the second grid~ - Inside source: true *** True Line Result - results + # Renders the Dijkstra search on the second grid +** Processing line: ~ def render_dijkstra~ +- Inside source: true +*** True Line Result + def render_dijkstra ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -67231,26 +70872,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 calc_potential_impacts~ +** Processing line: ~ def render_dijkstra_heat_map~ - Inside source: true *** True Line Result - def calc_potential_impacts -** Processing line: ~ impact_results = calc_impacts circle.x, circle.dx, circle.y, circle.dy, circle.radius~ + def render_dijkstra_heat_map +** Processing line: ~ dijkstra_search.cost_so_far.each do |visited_cell, cost|~ - Inside source: true *** True Line Result - impact_results = calc_impacts circle.x, circle.dx, circle.y, circle.dy, circle.radius -** Processing line: ~ circle.rect = impact_results[:rect]~ + dijkstra_search.cost_so_far.each do |visited_cell, cost| +** Processing line: ~ max_cost = (grid.width + grid.height) #* 5~ - Inside source: true *** True Line Result - circle.rect = impact_results[:rect] -** Processing line: ~ circle.trajectory = impact_results[:trajectory]~ + max_cost = (grid.width + grid.height) #* 5 +** Processing line: ~ alpha = 255.to_i * cost.to_i / max_cost.to_i~ - Inside source: true *** True Line Result - circle.trajectory = impact_results[:trajectory] -** Processing line: ~ circle.impacts = impact_results[:impacts]~ + alpha = 255.to_i * cost.to_i / max_cost.to_i +** Processing line: ~ outputs.solids << [move_and_scale_up(visited_cell), red, alpha]~ - Inside source: true *** True Line Result - circle.impacts = impact_results[:impacts] + outputs.solids << [move_and_scale_up(visited_cell), red, alpha] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -67259,58 +70904,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 calc_terrains_to_monitor~ +** Processing line: ~ def render_dijkstra_path~ - Inside source: true *** True Line Result - def calc_terrains_to_monitor -** Processing line: ~ circle.impact = nil~ + def render_dijkstra_path +** Processing line: ~ # If the search found the target~ - Inside source: true *** True Line Result - circle.impact = nil -** Processing line: ~ circle.impacts.each do |i|~ + # If the search found the target +** Processing line: ~ if dijkstra_search.came_from.has_key?(state.target)~ - Inside source: true *** True Line Result - circle.impacts.each do |i| -** Processing line: ~ circle.terrains_to_monitor[i[:terrain]] ||= {~ + if dijkstra_search.came_from.has_key?(state.target) +** Processing line: ~ # Get the target and the cell it came from~ - Inside source: true *** True Line Result - circle.terrains_to_monitor[i[:terrain]] ||= { -** Processing line: ~ ray_start: geometry.ray_test(circle, i[:terrain]),~ + # Get the target and the cell it came from +** Processing line: ~ endpoint = state.target~ - Inside source: true *** True Line Result - ray_start: geometry.ray_test(circle, i[:terrain]), -** Processing line: ~ }~ + endpoint = state.target +** Processing line: ~ next_endpoint = dijkstra_search.came_from[endpoint]~ - Inside source: true *** True Line Result - } -** Processing line: ~~ + next_endpoint = dijkstra_search.came_from[endpoint] +** Processing line: ~ while endpoint and next_endpoint~ - Inside source: true *** True Line Result - -** Processing line: ~ circle.terrains_to_monitor[i[:terrain]][:ray_current] = geometry.ray_test(circle, i[:terrain])~ + while endpoint and next_endpoint +** Processing line: ~ # Draw a path between them~ - Inside source: true *** True Line Result - circle.terrains_to_monitor[i[:terrain]][:ray_current] = geometry.ray_test(circle, i[:terrain]) -** Processing line: ~ if circle.terrains_to_monitor[i[:terrain]][:ray_start] != circle.terrains_to_monitor[i[:terrain]][:ray_current]~ + # Draw a path between them +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ - Inside source: true *** True Line Result - if circle.terrains_to_monitor[i[:terrain]][:ray_start] != circle.terrains_to_monitor[i[:terrain]][:ray_current] -** Processing line: ~ if circle.x.between?(i[:terrain].x, i[:terrain].x2) || circle.y.between?(i[:terrain].y, i[:terrain].y2)~ + path = get_path_between(endpoint, next_endpoint) +** Processing line: ~ outputs.solids << [move_and_scale_up(path), path_color]~ - Inside source: true *** True Line Result - if circle.x.between?(i[:terrain].x, i[:terrain].x2) || circle.y.between?(i[:terrain].y, i[:terrain].y2) -** Processing line: ~ circle.impact = i~ + outputs.solids << [move_and_scale_up(path), path_color] +** Processing line: ~~ - Inside source: true *** True Line Result - circle.impact = i -** Processing line: ~ circle.ray_current = circle.terrains_to_monitor[i[:terrain]][:ray_current]~ + +** Processing line: ~ # Shift one cell down the path~ - Inside source: true *** True Line Result - circle.ray_current = circle.terrains_to_monitor[i[:terrain]][:ray_current] -** Processing line: ~ end~ + # Shift one cell down the path +** Processing line: ~ endpoint = next_endpoint~ - Inside source: true *** True Line Result - end + endpoint = next_endpoint +** Processing line: ~ next_endpoint = dijkstra_search.came_from[endpoint]~ +- Inside source: true +*** True Line Result + next_endpoint = dijkstra_search.came_from[endpoint] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Repeat till the end of the path~ +- Inside source: true +*** True Line Result + # Repeat till the end of the path ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -67327,282 +70984,226 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def impact_result body, impact~ -- Inside source: true -*** True Line Result - def impact_result body, impact -** Processing line: ~ infinity_alias = 1000~ -- Inside source: true -*** True Line Result - infinity_alias = 1000 -** Processing line: ~ r = {~ +** Processing line: ~ # Renders the star on both grids~ - Inside source: true *** True Line Result - r = { -** Processing line: ~ body: {},~ + # Renders the star on both grids +** Processing line: ~ def render_star~ - Inside source: true *** True Line Result - body: {}, -** Processing line: ~ terrain: {},~ + def render_star +** Processing line: ~ outputs.sprites << [scale_up(state.star), 'star.png']~ - Inside source: true *** True Line Result - terrain: {}, -** Processing line: ~ impact: {}~ + outputs.sprites << [scale_up(state.star), 'star.png'] +** Processing line: ~ outputs.sprites << [move_and_scale_up(state.star), 'star.png']~ - Inside source: true *** True Line Result - impact: {} -** Processing line: ~ }~ + outputs.sprites << [move_and_scale_up(state.star), 'star.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ r[:body][:line] = body.trajectory.dup~ -- Inside source: true -*** True Line Result - r[:body][:line] = body.trajectory.dup -** Processing line: ~ r[:body][:slope] = geometry.line_slope(body.trajectory, replace_infinity: infinity_alias)~ -- Inside source: true -*** True Line Result - r[:body][:slope] = geometry.line_slope(body.trajectory, replace_infinity: infinity_alias) -** Processing line: ~ r[:body][:slope_sign] = r[:body][:slope].sign~ +** Processing line: ~ # Renders the target on both grids~ - Inside source: true *** True Line Result - r[:body][:slope_sign] = r[:body][:slope].sign -** Processing line: ~ r[:body][:x] = body.x~ + # Renders the target on both grids +** Processing line: ~ def render_target~ - Inside source: true *** True Line Result - r[:body][:x] = body.x -** Processing line: ~ r[:body][:y] = body.y~ + def render_target +** Processing line: ~ outputs.sprites << [scale_up(state.target), 'target.png']~ - Inside source: true *** True Line Result - r[:body][:y] = body.y -** Processing line: ~ r[:body][:dy] = body.dy~ + outputs.sprites << [scale_up(state.target), 'target.png'] +** Processing line: ~ outputs.sprites << [move_and_scale_up(state.target), 'target.png']~ - Inside source: true *** True Line Result - r[:body][:dy] = body.dy -** Processing line: ~ r[:body][:dx] = body.dx~ + outputs.sprites << [move_and_scale_up(state.target), 'target.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - r[:body][:dx] = body.dx + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ r[:terrain][:line] = impact[:terrain].dup~ +** Processing line: ~ def render_hills~ - Inside source: true *** True Line Result - r[:terrain][:line] = impact[:terrain].dup -** Processing line: ~ r[:terrain][:slope] = geometry.line_slope(impact[:terrain], replace_infinity: infinity_alias)~ + def render_hills +** Processing line: ~ state.hills.each_key do |hill|~ - Inside source: true *** True Line Result - r[:terrain][:slope] = geometry.line_slope(impact[:terrain], replace_infinity: infinity_alias) -** Processing line: ~ r[:terrain][:slope_sign] = r[:terrain][:slope].sign~ + state.hills.each_key do |hill| +** Processing line: ~ outputs.solids << [scale_up(hill), hill_color]~ - Inside source: true *** True Line Result - r[:terrain][:slope_sign] = r[:terrain][:slope].sign -** Processing line: ~~ + outputs.solids << [scale_up(hill), hill_color] +** Processing line: ~ outputs.solids << [move_and_scale_up(hill), hill_color]~ - Inside source: true *** True Line Result - -** Processing line: ~ r[:impact][:angle] = geometry.angle_between_lines(body.trajectory, impact[:terrain], replace_infinity: infinity_alias)~ + outputs.solids << [move_and_scale_up(hill), hill_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - r[:impact][:angle] = geometry.angle_between_lines(body.trajectory, impact[:terrain], replace_infinity: infinity_alias) -** Processing line: ~ r[:impact][:point] = { x: impact[:point].x, y: impact[:point].y }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - r[:impact][:point] = { x: impact[:point].x, y: impact[:point].y } -** Processing line: ~ r[:impact][:same_slope_sign] = r[:body][:slope_sign] == r[:terrain][:slope_sign]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - r[:impact][:same_slope_sign] = r[:body][:slope_sign] == r[:terrain][:slope_sign] -** Processing line: ~ r[:impact][:ray] = body.ray_current~ + +** Processing line: ~ # Draws the walls on both grids~ - Inside source: true *** True Line Result - r[:impact][:ray] = body.ray_current -** Processing line: ~ r[:body][:new_on_floor] = body.on_floor~ + # Draws the walls on both grids +** Processing line: ~ def render_walls~ - Inside source: true *** True Line Result - r[:body][:new_on_floor] = body.on_floor -** Processing line: ~ r[:body][:new_floor] = r[:terrain][:line]~ + def render_walls +** Processing line: ~ state.walls.each_key do |wall|~ - Inside source: true *** True Line Result - r[:body][:new_floor] = r[:terrain][:line] -** Processing line: ~~ + state.walls.each_key do |wall| +** Processing line: ~ outputs.solids << [scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - -** Processing line: ~ if r[:impact][:angle].abs < 90 && r[:terrain][:slope].abs < 3~ + outputs.solids << [scale_up(wall), wall_color] +** Processing line: ~ outputs.solids << [move_and_scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - if r[:impact][:angle].abs < 90 && r[:terrain][:slope].abs < 3 -** Processing line: ~ play_sound~ + outputs.solids << [move_and_scale_up(wall), wall_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - play_sound -** Processing line: ~ r[:body][:new_dy] = r[:body][:dy] * circle.elasticity * -1~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - r[:body][:new_dy] = r[:body][:dy] * circle.elasticity * -1 -** Processing line: ~ r[:body][:new_dx] = r[:body][:dx] * circle.elasticity~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - r[:body][:new_dx] = r[:body][:dx] * circle.elasticity -** Processing line: ~ r[:impact][:type] = :horizontal~ + +** Processing line: ~ def get_path_between(cell_one, cell_two)~ - Inside source: true *** True Line Result - r[:impact][:type] = :horizontal -** Processing line: ~ r[:body][:new_reason] = "-"~ + def get_path_between(cell_one, cell_two) +** Processing line: ~ path = nil~ - Inside source: true *** True Line Result - r[:body][:new_reason] = "-" -** Processing line: ~ elsif r[:impact][:angle].abs < 90 && r[:terrain][:slope].abs > 3~ + path = nil +** Processing line: ~ if cell_one.x == cell_two.x~ - Inside source: true *** True Line Result - elsif r[:impact][:angle].abs < 90 && r[:terrain][:slope].abs > 3 -** Processing line: ~ play_sound~ + if cell_one.x == cell_two.x +** Processing line: ~ if cell_one.y < cell_two.y~ - Inside source: true *** True Line Result - play_sound -** Processing line: ~ r[:body][:new_dy] = r[:body][:dy] * 1.1~ + if cell_one.y < cell_two.y +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4]~ - Inside source: true *** True Line Result - r[:body][:new_dy] = r[:body][:dy] * 1.1 -** Processing line: ~ r[:body][:new_dx] = r[:body][:dx] * -circle.elasticity~ + path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4] +** Processing line: ~ else~ - Inside source: true *** True Line Result - r[:body][:new_dx] = r[:body][:dx] * -circle.elasticity -** Processing line: ~ r[:impact][:type] = :vertical~ + else +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4]~ - Inside source: true *** True Line Result - r[:impact][:type] = :vertical -** Processing line: ~ r[:body][:new_reason] = "|"~ + path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4] +** Processing line: ~ end~ - Inside source: true *** True Line Result - r[:body][:new_reason] = "|" + end ** Processing line: ~ else~ - Inside source: true *** True Line Result else -** Processing line: ~ play_sound~ +** Processing line: ~ if cell_one.x < cell_two.x~ - Inside source: true *** True Line Result - play_sound -** Processing line: ~ r[:body][:new_dx] = r[:body][:dx] * -circle.elasticity~ + if cell_one.x < cell_two.x +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4]~ - Inside source: true *** True Line Result - r[:body][:new_dx] = r[:body][:dx] * -circle.elasticity -** Processing line: ~ r[:body][:new_dy] = r[:body][:dy] * -circle.elasticity~ + path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4] +** Processing line: ~ else~ - Inside source: true *** True Line Result - r[:body][:new_dy] = r[:body][:dy] * -circle.elasticity -** Processing line: ~ r[:impact][:type] = :slanted~ + else +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4]~ - Inside source: true *** True Line Result - r[:impact][:type] = :slanted -** Processing line: ~ r[:body][:new_reason] = "/"~ + path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4] +** Processing line: ~ end~ - Inside source: true *** True Line Result - r[:body][:new_reason] = "/" + end ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ path~ - Inside source: true *** True Line Result - -** Processing line: ~ r[:impact][:energy] = r[:body][:new_dx].abs + r[:body][:new_dy].abs~ + path +** Processing line: ~ end~ - Inside source: true *** True Line Result - r[:impact][:energy] = r[:body][:new_dx].abs + r[:body][:new_dy].abs + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if r[:impact][:energy] <= 0.3 && r[:terrain][:slope].abs < 4~ -- Inside source: true -*** True Line Result - if r[:impact][:energy] <= 0.3 && r[:terrain][:slope].abs < 4 -** Processing line: ~ r[:body][:new_dx] = 0~ -- Inside source: true -*** True Line Result - r[:body][:new_dx] = 0 -** Processing line: ~ r[:body][:new_dy] = 0~ -- Inside source: true -*** True Line Result - r[:body][:new_dy] = 0 -** Processing line: ~ r[:impact][:energy] = 0~ -- Inside source: true -*** True Line Result - r[:impact][:energy] = 0 -** Processing line: ~ r[:body][:new_on_floor] = true~ -- Inside source: true -*** True Line Result - r[:body][:new_on_floor] = true -** Processing line: ~ r[:body][:new_floor] = r[:terrain][:line]~ -- Inside source: true -*** True Line Result - r[:body][:new_floor] = r[:terrain][:line] -** Processing line: ~ r[:body][:new_reason] = "0"~ -- Inside source: true -*** True Line Result - r[:body][:new_reason] = "0" -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ +** Processing line: ~ # Representation of how far away visited cells are from the star~ - Inside source: true *** True Line Result - -** Processing line: ~ r[:impact][:ray_next] = geometry.ray_test({ x: r[:body][:x] - (r[:body][:dx] * 1.1) + r[:body][:new_dx],~ + # Representation of how far away visited cells are from the star +** Processing line: ~ # Replaces the render_visited method~ - Inside source: true *** True Line Result - r[:impact][:ray_next] = geometry.ray_test({ x: r[:body][:x] - (r[:body][:dx] * 1.1) + r[:body][:new_dx], -** Processing line: ~ y: r[:body][:y] - (r[:body][:dy] * 1.1) + r[:body][:new_dy] + state.gravity },~ + # Replaces the render_visited method +** Processing line: ~ # Visually demonstrates the effectiveness of early exit for pathfinding~ - Inside source: true *** True Line Result - y: r[:body][:y] - (r[:body][:dy] * 1.1) + r[:body][:new_dy] + state.gravity }, -** Processing line: ~ r[:terrain][:line])~ + # Visually demonstrates the effectiveness of early exit for pathfinding +** Processing line: ~ def render_breadth_first_search_heat_map~ - Inside source: true *** True Line Result - r[:terrain][:line]) -** Processing line: ~~ + def render_breadth_first_search_heat_map +** Processing line: ~ breadth_first_search.visited.each_key do | visited_cell |~ - Inside source: true *** True Line Result - -** Processing line: ~ if r[:impact][:ray_next] == r[:impact][:ray]~ + breadth_first_search.visited.each_key do | visited_cell | +** Processing line: ~ distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs~ - Inside source: true *** True Line Result - if r[:impact][:ray_next] == r[:impact][:ray] -** Processing line: ~ r[:body][:new_dx] *= -1~ + distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs +** Processing line: ~ max_distance = grid.width + grid.height~ - Inside source: true *** True Line Result - r[:body][:new_dx] *= -1 -** Processing line: ~ r[:body][:new_dy] *= -1~ + max_distance = grid.width + grid.height +** Processing line: ~ alpha = 255.to_i * distance.to_i / max_distance.to_i~ - Inside source: true *** True Line Result - r[:body][:new_dy] *= -1 -** Processing line: ~ r[:body][:new_reason] = "clip"~ + alpha = 255.to_i * distance.to_i / max_distance.to_i +** Processing line: ~ outputs.solids << [scale_up(visited_cell), red, alpha]~ - Inside source: true *** True Line Result - r[:body][:new_reason] = "clip" + outputs.solids << [scale_up(visited_cell), red, alpha] ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ r~ -- Inside source: true -*** True Line Result - r ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -67611,30 +71212,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 game_over!~ +** Processing line: ~ # Translates the given cell grid.width + 1 to the right and then scales up~ - Inside source: true *** True Line Result - def game_over! -** Processing line: ~ circle.x = circle.check_point_x~ + # Translates the given cell grid.width + 1 to the right and then scales up +** Processing line: ~ # Used to draw cells for the second grid~ - Inside source: true *** True Line Result - circle.x = circle.check_point_x -** Processing line: ~ circle.y = circle.check_point_y~ + # Used to draw cells for the second grid +** Processing line: ~ # This method does not work for lines,~ - Inside source: true *** True Line Result - circle.y = circle.check_point_y -** Processing line: ~ circle.dx = 0~ + # This method does not work for lines, +** Processing line: ~ # so separate methods exist for the grid lines~ - Inside source: true *** True Line Result - circle.dx = 0 -** Processing line: ~ circle.dy = 0~ + # so separate methods exist for the grid lines +** Processing line: ~ def move_and_scale_up(cell)~ - Inside source: true *** True Line Result - circle.dy = 0 -** Processing line: ~ circle.game_over_at = state.tick_count~ + def move_and_scale_up(cell) +** Processing line: ~ cell_clone = cell.clone~ - Inside source: true *** True Line Result - circle.game_over_at = state.tick_count + cell_clone = cell.clone +** Processing line: ~ cell_clone.x += grid.width + 1~ +- Inside source: true +*** True Line Result + cell_clone.x += grid.width + 1 +** Processing line: ~ scale_up(cell_clone)~ +- Inside source: true +*** True Line Result + scale_up(cell_clone) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -67643,58 +71252,62 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def not_game_over!~ +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ - Inside source: true *** True Line Result - def not_game_over! -** Processing line: ~ impact_history_entry = impact_result circle, circle.impact~ + # In code, the cells are represented as 1x1 rectangles +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ - Inside source: true *** True Line Result - impact_history_entry = impact_result circle, circle.impact -** Processing line: ~ circle.impact_history << impact_history_entry~ + # When drawn, the cells are larger than 1x1 rectangles +** Processing line: ~ # This method is used to scale up cells, and lines~ - Inside source: true *** True Line Result - circle.impact_history << impact_history_entry -** Processing line: ~ circle.x -= circle.dx * 1.1~ + # This method is used to scale up cells, and lines +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ - Inside source: true *** True Line Result - circle.x -= circle.dx * 1.1 -** Processing line: ~ circle.y -= circle.dy * 1.1~ + # Objects are scaled up according to the grid.cell_size variable +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ - Inside source: true *** True Line Result - circle.y -= circle.dy * 1.1 -** Processing line: ~ circle.dx = impact_history_entry[:body][:new_dx]~ + # This allows for easy customization of the visual scale of the grid +** Processing line: ~ def scale_up(cell)~ - Inside source: true *** True Line Result - circle.dx = impact_history_entry[:body][:new_dx] -** Processing line: ~ circle.dy = impact_history_entry[:body][:new_dy]~ + def scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ - Inside source: true *** True Line Result - circle.dy = impact_history_entry[:body][:new_dy] -** Processing line: ~ circle.on_floor = impact_history_entry[:body][:new_on_floor]~ + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ - Inside source: true *** True Line Result - circle.on_floor = impact_history_entry[:body][:new_on_floor] + cell = cell.clone ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if circle.on_floor~ +** Processing line: ~ # If cell is just an x and y coordinate~ - Inside source: true *** True Line Result - if circle.on_floor -** Processing line: ~ circle.check_point_at = state.tick_count~ + # If cell is just an x and y coordinate +** Processing line: ~ if cell.size == 2~ - Inside source: true *** True Line Result - circle.check_point_at = state.tick_count -** Processing line: ~ circle.check_point_x = circle.x~ + if cell.size == 2 +** Processing line: ~ # Add a width and height of 1~ - Inside source: true *** True Line Result - circle.check_point_x = circle.x -** Processing line: ~ circle.check_point_y = circle.y~ + # Add a width and height of 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - circle.check_point_y = circle.y + cell << 1 +** Processing line: ~ cell << 1~ +- Inside source: true +*** True Line Result + cell << 1 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -67703,94 +71316,94 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ circle.previous_floor = circle.floor || {}~ +** Processing line: ~ # Scale all the values up~ - Inside source: true *** True Line Result - circle.previous_floor = circle.floor || {} -** Processing line: ~ circle.floor = impact_history_entry[:body][:new_floor] || {}~ + # Scale all the values up +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ - Inside source: true *** True Line Result - circle.floor = impact_history_entry[:body][:new_floor] || {} -** Processing line: ~ circle.floor_point = impact_history_entry[:impact][:point]~ + cell.map! { |value| value * grid.cell_size } +** Processing line: ~~ - Inside source: true *** True Line Result - circle.floor_point = impact_history_entry[:impact][:point] -** Processing line: ~ if circle.floor.slice(:x, :y, :x2, :y2) != circle.previous_floor.slice(:x, :y, :x2, :y2)~ + +** Processing line: ~ # Returns the scaled up cell~ - Inside source: true *** True Line Result - if circle.floor.slice(:x, :y, :x2, :y2) != circle.previous_floor.slice(:x, :y, :x2, :y2) -** Processing line: ~ new_relative_x = if circle.dx > 0~ + # Returns the scaled up cell +** Processing line: ~ cell~ - Inside source: true *** True Line Result - new_relative_x = if circle.dx > 0 -** Processing line: ~ :right~ + cell +** Processing line: ~ end~ - Inside source: true *** True Line Result - :right -** Processing line: ~ elsif circle.dx < 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif circle.dx < 0 -** Processing line: ~ :left~ + +** Processing line: ~ # Handles user input every tick so the grid can be edited~ - Inside source: true *** True Line Result - :left -** Processing line: ~ else~ + # Handles user input every tick so the grid can be edited +** Processing line: ~ # Separate input detection and processing is needed~ - Inside source: true *** True Line Result - else -** Processing line: ~ nil~ + # Separate input detection and processing is needed +** Processing line: ~ # For example: Adding walls is started by clicking down on a hill,~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + # For example: Adding walls is started by clicking down on a hill, +** Processing line: ~ # but the mouse doesn't need to remain over hills to add walls~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # but the mouse doesn't need to remain over hills to add walls +** Processing line: ~ def input~ - Inside source: true *** True Line Result - -** Processing line: ~ new_relative_y = if circle.dy > 0~ + def input +** Processing line: ~ # If the mouse was lifted this tick~ - Inside source: true *** True Line Result - new_relative_y = if circle.dy > 0 -** Processing line: ~ :above~ + # If the mouse was lifted this tick +** Processing line: ~ if inputs.mouse.up~ - Inside source: true *** True Line Result - :above -** Processing line: ~ elsif circle.dy < 0~ + if inputs.mouse.up +** Processing line: ~ # Set current input to none~ - Inside source: true *** True Line Result - elsif circle.dy < 0 -** Processing line: ~ :below~ + # Set current input to none +** Processing line: ~ state.user_input = :none~ - Inside source: true *** True Line Result - :below -** Processing line: ~ else~ + state.user_input = :none +** Processing line: ~ end~ - Inside source: true *** True Line Result - else -** Processing line: ~ nil~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + +** Processing line: ~ # If the mouse was clicked this tick~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # If the mouse was clicked this tick +** Processing line: ~ if inputs.mouse.down~ - Inside source: true *** True Line Result - -** Processing line: ~ circle.floor_relative_x = new_relative_x~ + if inputs.mouse.down +** Processing line: ~ # Determine what the user is editing and edit the state.user_input variable~ - Inside source: true *** True Line Result - circle.floor_relative_x = new_relative_x -** Processing line: ~ circle.floor_relative_y = new_relative_y~ + # Determine what the user is editing and edit the state.user_input variable +** Processing line: ~ determine_input~ - Inside source: true *** True Line Result - circle.floor_relative_y = new_relative_y + determine_input ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -67799,14 +71412,14 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ circle.impact = nil~ +** Processing line: ~ # Process user input based on user_input variable and current mouse position~ - Inside source: true *** True Line Result - circle.impact = nil -** Processing line: ~ circle.terrains_to_monitor.clear~ + # Process user input based on user_input variable and current mouse position +** Processing line: ~ process_input~ - Inside source: true *** True Line Result - circle.terrains_to_monitor.clear + process_input ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -67815,642 +71428,674 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc_physics~ +** Processing line: ~ # Determines what the user is editing and stores the value~ - Inside source: true *** True Line Result - def calc_physics -** Processing line: ~ if args.state.god_mode~ + # Determines what the user is editing and stores the value +** Processing line: ~ # This method is called the tick the mouse is clicked~ - Inside source: true *** True Line Result - if args.state.god_mode -** Processing line: ~ calc_potential_impacts~ + # This method is called the tick the mouse is clicked +** Processing line: ~ # Storing the value allows the user to continue the same edit as long as the~ - Inside source: true *** True Line Result - calc_potential_impacts -** Processing line: ~ calc_terrains_to_monitor~ + # Storing the value allows the user to continue the same edit as long as the +** Processing line: ~ # mouse left click is held~ - Inside source: true *** True Line Result - calc_terrains_to_monitor -** Processing line: ~ return~ + # mouse left click is held +** Processing line: ~ def determine_input~ - Inside source: true *** True Line Result - return -** Processing line: ~ end~ + def determine_input +** Processing line: ~ # If the mouse is over the star in the first grid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # If the mouse is over the star in the first grid +** Processing line: ~ if mouse_over_star?~ - Inside source: true *** True Line Result - -** Processing line: ~ if circle.y < -700~ + if mouse_over_star? +** Processing line: ~ # The user is editing the star from the first grid~ - Inside source: true *** True Line Result - if circle.y < -700 -** Processing line: ~ game_over~ + # The user is editing the star from the first grid +** Processing line: ~ state.user_input = :star~ - Inside source: true *** True Line Result - game_over -** Processing line: ~ return~ + state.user_input = :star +** Processing line: ~ # If the mouse is over the star in the second grid~ - Inside source: true *** True Line Result - return -** Processing line: ~ end~ + # If the mouse is over the star in the second grid +** Processing line: ~ elsif mouse_over_star2?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif mouse_over_star2? +** Processing line: ~ # The user is editing the star from the second grid~ - Inside source: true *** True Line Result - -** Processing line: ~ return if state.game_over~ + # The user is editing the star from the second grid +** Processing line: ~ state.user_input = :star2~ - Inside source: true *** True Line Result - return if state.game_over -** Processing line: ~ return if circle.on_floor~ + state.user_input = :star2 +** Processing line: ~ # If the mouse is over the target in the first grid~ - Inside source: true *** True Line Result - return if circle.on_floor -** Processing line: ~ circle.previous_dy = circle.dy~ + # If the mouse is over the target in the first grid +** Processing line: ~ elsif mouse_over_target?~ - Inside source: true *** True Line Result - circle.previous_dy = circle.dy -** Processing line: ~ circle.previous_dx = circle.dx~ + elsif mouse_over_target? +** Processing line: ~ # The user is editing the target from the first grid~ - Inside source: true *** True Line Result - circle.previous_dx = circle.dx -** Processing line: ~ circle.x += circle.dx~ + # The user is editing the target from the first grid +** Processing line: ~ state.user_input = :target~ - Inside source: true *** True Line Result - circle.x += circle.dx -** Processing line: ~ circle.y += circle.dy~ + state.user_input = :target +** Processing line: ~ # If the mouse is over the target in the second grid~ - Inside source: true *** True Line Result - circle.y += circle.dy -** Processing line: ~ args.state.distance_traveled ||= 0~ + # If the mouse is over the target in the second grid +** Processing line: ~ elsif mouse_over_target2?~ - Inside source: true *** True Line Result - args.state.distance_traveled ||= 0 -** Processing line: ~ args.state.distance_traveled += circle.dx.abs + circle.dy.abs~ + elsif mouse_over_target2? +** Processing line: ~ # The user is editing the target from the second grid~ - Inside source: true *** True Line Result - args.state.distance_traveled += circle.dx.abs + circle.dy.abs -** Processing line: ~ circle.dy += state.gravity~ + # The user is editing the target from the second grid +** Processing line: ~ state.user_input = :target2~ - Inside source: true *** True Line Result - circle.dy += state.gravity -** Processing line: ~ calc_potential_impacts~ + state.user_input = :target2 +** Processing line: ~ # If the mouse is over a wall in the first grid~ - Inside source: true *** True Line Result - calc_potential_impacts -** Processing line: ~ calc_terrains_to_monitor~ + # If the mouse is over a wall in the first grid +** Processing line: ~ elsif mouse_over_wall?~ - Inside source: true *** True Line Result - calc_terrains_to_monitor -** Processing line: ~ return unless circle.impact~ + elsif mouse_over_wall? +** Processing line: ~ # The user is removing a wall from the first grid~ - Inside source: true *** True Line Result - return unless circle.impact -** Processing line: ~ if circle.impact && circle.impact[:type] == :lava~ + # The user is removing a wall from the first grid +** Processing line: ~ state.user_input = :remove_wall~ - Inside source: true *** True Line Result - if circle.impact && circle.impact[:type] == :lava -** Processing line: ~ game_over!~ + state.user_input = :remove_wall +** Processing line: ~ # If the mouse is over a wall in the second grid~ - Inside source: true *** True Line Result - game_over! -** Processing line: ~ else~ + # If the mouse is over a wall in the second grid +** Processing line: ~ elsif mouse_over_wall2?~ - Inside source: true *** True Line Result - else -** Processing line: ~ not_game_over!~ + elsif mouse_over_wall2? +** Processing line: ~ # The user is removing a wall from the second grid~ - Inside source: true *** True Line Result - not_game_over! -** Processing line: ~ end~ + # The user is removing a wall from the second grid +** Processing line: ~ state.user_input = :remove_wall2~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + state.user_input = :remove_wall2 +** Processing line: ~ # If the mouse is over a hill in the first grid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # If the mouse is over a hill in the first grid +** Processing line: ~ elsif mouse_over_hill?~ - Inside source: true *** True Line Result - -** Processing line: ~ def input_god_mode~ + elsif mouse_over_hill? +** Processing line: ~ # The user is adding a wall from the first grid~ - Inside source: true *** True Line Result - def input_god_mode -** Processing line: ~ state.debug_mode = !state.debug_mode if inputs.keyboard.key_down.forward_slash~ + # The user is adding a wall from the first grid +** Processing line: ~ state.user_input = :add_wall~ - Inside source: true *** True Line Result - state.debug_mode = !state.debug_mode if inputs.keyboard.key_down.forward_slash -** Processing line: ~~ + state.user_input = :add_wall +** Processing line: ~ # If the mouse is over a hill in the second grid~ - Inside source: true *** True Line Result - -** Processing line: ~ # toggle god mode~ + # If the mouse is over a hill in the second grid +** Processing line: ~ elsif mouse_over_hill2?~ - Inside source: true *** True Line Result - # toggle god mode -** Processing line: ~ if inputs.keyboard.key_down.g~ + elsif mouse_over_hill2? +** Processing line: ~ # The user is adding a wall from the second grid~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.g -** Processing line: ~ state.god_mode = !state.god_mode~ + # The user is adding a wall from the second grid +** Processing line: ~ state.user_input = :add_wall2~ - Inside source: true *** True Line Result - state.god_mode = !state.god_mode -** Processing line: ~ state.potential_lift = 0~ + state.user_input = :add_wall2 +** Processing line: ~ # If the mouse is over the first grid~ - Inside source: true *** True Line Result - state.potential_lift = 0 -** Processing line: ~ circle.floor = nil~ + # If the mouse is over the first grid +** Processing line: ~ elsif mouse_over_grid?~ - Inside source: true *** True Line Result - circle.floor = nil -** Processing line: ~ circle.floor_point = nil~ + elsif mouse_over_grid? +** Processing line: ~ # The user is adding a hill from the first grid~ - Inside source: true *** True Line Result - circle.floor_point = nil -** Processing line: ~ circle.floor_relative_x = nil~ + # The user is adding a hill from the first grid +** Processing line: ~ state.user_input = :add_hill~ - Inside source: true *** True Line Result - circle.floor_relative_x = nil -** Processing line: ~ circle.floor_relative_y = nil~ + state.user_input = :add_hill +** Processing line: ~ # If the mouse is over the second grid~ - Inside source: true *** True Line Result - circle.floor_relative_y = nil -** Processing line: ~ circle.impact = nil~ + # If the mouse is over the second grid +** Processing line: ~ elsif mouse_over_grid2?~ - Inside source: true *** True Line Result - circle.impact = nil -** Processing line: ~ circle.terrains_to_monitor.clear~ + elsif mouse_over_grid2? +** Processing line: ~ # The user is adding a hill from the second grid~ - Inside source: true *** True Line Result - circle.terrains_to_monitor.clear -** Processing line: ~ return~ + # The user is adding a hill from the second grid +** Processing line: ~ state.user_input = :add_hill2~ - Inside source: true *** True Line Result - return + state.user_input = :add_hill2 ** Processing line: ~ end~ - Inside source: true *** True Line Result end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return unless state.god_mode~ +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ - Inside source: true *** True Line Result - return unless state.god_mode -** Processing line: ~~ + # Processes click and drag based on what the user is currently dragging +** Processing line: ~ def process_input~ - Inside source: true *** True Line Result - -** Processing line: ~ circle.x = circle.x.to_i~ + def process_input +** Processing line: ~ if state.user_input == :star~ - Inside source: true *** True Line Result - circle.x = circle.x.to_i -** Processing line: ~ circle.y = circle.y.to_i~ + if state.user_input == :star +** Processing line: ~ input_star~ - Inside source: true *** True Line Result - circle.y = circle.y.to_i -** Processing line: ~~ + input_star +** Processing line: ~ elsif state.user_input == :star2~ - Inside source: true *** True Line Result - -** Processing line: ~ # move god circle~ + elsif state.user_input == :star2 +** Processing line: ~ input_star2~ - Inside source: true *** True Line Result - # move god circle -** Processing line: ~ if inputs.keyboard.left || inputs.keyboard.a~ + input_star2 +** Processing line: ~ elsif state.user_input == :target~ - Inside source: true *** True Line Result - if inputs.keyboard.left || inputs.keyboard.a -** Processing line: ~ circle.x -= 20~ + elsif state.user_input == :target +** Processing line: ~ input_target~ - Inside source: true *** True Line Result - circle.x -= 20 -** Processing line: ~ elsif inputs.keyboard.right || inputs.keyboard.d || inputs.keyboard.f~ + input_target +** Processing line: ~ elsif state.user_input == :target2~ - Inside source: true *** True Line Result - elsif inputs.keyboard.right || inputs.keyboard.d || inputs.keyboard.f -** Processing line: ~ circle.x += 20~ + elsif state.user_input == :target2 +** Processing line: ~ input_target2~ - Inside source: true *** True Line Result - circle.x += 20 -** Processing line: ~ end~ + input_target2 +** Processing line: ~ elsif state.user_input == :remove_wall~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif state.user_input == :remove_wall +** Processing line: ~ input_remove_wall~ - Inside source: true *** True Line Result - -** Processing line: ~ if inputs.keyboard.up || inputs.keyboard.w~ + input_remove_wall +** Processing line: ~ elsif state.user_input == :remove_wall2~ - Inside source: true *** True Line Result - if inputs.keyboard.up || inputs.keyboard.w -** Processing line: ~ circle.y += 20~ + elsif state.user_input == :remove_wall2 +** Processing line: ~ input_remove_wall2~ - Inside source: true *** True Line Result - circle.y += 20 -** Processing line: ~ elsif inputs.keyboard.down || inputs.keyboard.s~ + input_remove_wall2 +** Processing line: ~ elsif state.user_input == :add_hill~ - Inside source: true *** True Line Result - elsif inputs.keyboard.down || inputs.keyboard.s -** Processing line: ~ circle.y -= 20~ + elsif state.user_input == :add_hill +** Processing line: ~ input_add_hill~ - Inside source: true *** True Line Result - circle.y -= 20 -** Processing line: ~ end~ + input_add_hill +** Processing line: ~ elsif state.user_input == :add_hill2~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif state.user_input == :add_hill2 +** Processing line: ~ input_add_hill2~ - Inside source: true *** True Line Result - -** Processing line: ~ # delete terrain~ + input_add_hill2 +** Processing line: ~ elsif state.user_input == :add_wall~ - Inside source: true *** True Line Result - # delete terrain -** Processing line: ~ if inputs.keyboard.key_down.x~ + elsif state.user_input == :add_wall +** Processing line: ~ input_add_wall~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.x -** Processing line: ~ calc_terrains_to_monitor~ + input_add_wall +** Processing line: ~ elsif state.user_input == :add_wall2~ - Inside source: true *** True Line Result - calc_terrains_to_monitor -** Processing line: ~ state.terrain = state.terrain.reject do |t|~ + elsif state.user_input == :add_wall2 +** Processing line: ~ input_add_wall2~ - Inside source: true *** True Line Result - state.terrain = state.terrain.reject do |t| -** Processing line: ~ t[:rect].intersect_rect? circle.rect~ + input_add_wall2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - t[:rect].intersect_rect? circle.rect -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.lava = state.lava.reject do |t|~ +** Processing line: ~ # Calculates the two searches~ - Inside source: true *** True Line Result - state.lava = state.lava.reject do |t| -** Processing line: ~ t[:rect].intersect_rect? circle.rect~ + # Calculates the two searches +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - t[:rect].intersect_rect? circle.rect -** Processing line: ~ end~ + def calc +** Processing line: ~ # If the searches have not started~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # If the searches have not started +** Processing line: ~ if breadth_first_search.visited.empty?~ - Inside source: true *** True Line Result - -** Processing line: ~ calc_potential_impacts~ + if breadth_first_search.visited.empty? +** Processing line: ~ # Calculate the two searches~ - Inside source: true *** True Line Result - calc_potential_impacts -** Processing line: ~ save_level~ + # Calculate the two searches +** Processing line: ~ calc_breadth_first~ - Inside source: true *** True Line Result - save_level + calc_breadth_first +** Processing line: ~ calc_dijkstra~ +- Inside source: true +*** True Line Result + calc_dijkstra ** 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: ~ # change terrain type~ +** Processing line: ~~ - Inside source: true *** True Line Result - # change terrain type -** Processing line: ~ if inputs.keyboard.key_down.l~ + +** Processing line: ~ def calc_breadth_first~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.l -** Processing line: ~ if state.line_mode == :terrain~ + def calc_breadth_first +** Processing line: ~ # Sets up the Breadth First Search~ - Inside source: true *** True Line Result - if state.line_mode == :terrain -** Processing line: ~ state.line_mode = :lava~ + # Sets up the Breadth First Search +** Processing line: ~ breadth_first_search.visited[state.star] = true~ - Inside source: true *** True Line Result - state.line_mode = :lava -** Processing line: ~ else~ + breadth_first_search.visited[state.star] = true +** Processing line: ~ breadth_first_search.frontier << state.star~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.line_mode = :terrain~ + breadth_first_search.frontier << state.star +** Processing line: ~ breadth_first_search.came_from[state.star] = nil~ - Inside source: true *** True Line Result - state.line_mode = :terrain -** Processing line: ~ end~ + breadth_first_search.came_from[state.star] = nil +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ until breadth_first_search.frontier.empty?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + until breadth_first_search.frontier.empty? +** Processing line: ~ return if breadth_first_search.visited.has_key?(state.target)~ - Inside source: true *** True Line Result - -** Processing line: ~ if inputs.mouse.click && !state.point_one~ + return if breadth_first_search.visited.has_key?(state.target) +** Processing line: ~ # A step in the search~ - Inside source: true *** True Line Result - if inputs.mouse.click && !state.point_one -** Processing line: ~ state.point_one = inputs.mouse.click.point~ + # A step in the search +** Processing line: ~ # Takes the next frontier cell~ - Inside source: true *** True Line Result - state.point_one = inputs.mouse.click.point -** Processing line: ~ elsif inputs.mouse.click && state.point_one~ + # Takes the next frontier cell +** Processing line: ~ new_frontier = breadth_first_search.frontier.shift~ - Inside source: true *** True Line Result - elsif inputs.mouse.click && state.point_one -** Processing line: ~ l = [*state.point_one, *inputs.mouse.click.point]~ + new_frontier = breadth_first_search.frontier.shift +** Processing line: ~ # For each of its neighbors~ - Inside source: true *** True Line Result - l = [*state.point_one, *inputs.mouse.click.point] -** Processing line: ~ l = [l.x - state.camera.x,~ + # For each of its neighbors +** Processing line: ~ adjacent_neighbors(new_frontier).each do | neighbor |~ - Inside source: true *** True Line Result - l = [l.x - state.camera.x, -** Processing line: ~ l.y - state.camera.y,~ + adjacent_neighbors(new_frontier).each do | neighbor | +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - l.y - state.camera.y, -** Processing line: ~ l.x2 - state.camera.x,~ + # That have not been visited and are not walls +** Processing line: ~ unless breadth_first_search.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - l.x2 - state.camera.x, -** Processing line: ~ l.y2 - state.camera.y].line.to_hash~ + unless breadth_first_search.visited.has_key?(neighbor) || state.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited in the first grid~ - Inside source: true *** True Line Result - l.y2 - state.camera.y].line.to_hash -** Processing line: ~ l[:rect] = rect_for_line l~ + # Add them to the frontier and mark them as visited in the first grid +** Processing line: ~ breadth_first_search.visited[neighbor] = true~ - Inside source: true *** True Line Result - l[:rect] = rect_for_line l -** Processing line: ~ if state.line_mode == :terrain~ + breadth_first_search.visited[neighbor] = true +** Processing line: ~ breadth_first_search.frontier << neighbor~ - Inside source: true *** True Line Result - if state.line_mode == :terrain -** Processing line: ~ state.terrain << l~ + breadth_first_search.frontier << neighbor +** Processing line: ~ # Remember which cell the neighbor came from~ - Inside source: true *** True Line Result - state.terrain << l -** Processing line: ~ else~ + # Remember which cell the neighbor came from +** Processing line: ~ breadth_first_search.came_from[neighbor] = new_frontier~ - Inside source: true *** True Line Result - else -** Processing line: ~ state.lava << l~ + breadth_first_search.came_from[neighbor] = new_frontier +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.lava << l + end ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ save_level~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - save_level -** Processing line: ~ next_x = inputs.mouse.click.point.x - 640~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - next_x = inputs.mouse.click.point.x - 640 -** Processing line: ~ next_y = inputs.mouse.click.point.y - 360~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - next_y = inputs.mouse.click.point.y - 360 -** Processing line: ~ circle.x += next_x~ + +** Processing line: ~ # Calculates the Dijkstra Search from the beginning to the end~ - Inside source: true *** True Line Result - circle.x += next_x -** Processing line: ~ circle.y += next_y~ + # Calculates the Dijkstra Search from the beginning to the end +** Processing line: ~~ - Inside source: true *** True Line Result - circle.y += next_y -** Processing line: ~ state.point_one = nil~ + +** Processing line: ~ def calc_dijkstra~ - Inside source: true *** True Line Result - state.point_one = nil -** Processing line: ~ elsif inputs.keyboard.one~ + def calc_dijkstra +** Processing line: ~ # The initial values for the Dijkstra search~ - Inside source: true *** True Line Result - elsif inputs.keyboard.one -** Processing line: ~ state.point_one = [circle.x + camera.x, circle.y+ camera.y]~ + # The initial values for the Dijkstra search +** Processing line: ~ dijkstra_search.frontier << [state.star, 0]~ - Inside source: true *** True Line Result - state.point_one = [circle.x + camera.x, circle.y+ camera.y] -** Processing line: ~ end~ + dijkstra_search.frontier << [state.star, 0] +** Processing line: ~ dijkstra_search.came_from[state.star] = nil~ - Inside source: true *** True Line Result - end + dijkstra_search.came_from[state.star] = nil +** Processing line: ~ dijkstra_search.cost_so_far[state.star] = 0~ +- Inside source: true +*** True Line Result + dijkstra_search.cost_so_far[state.star] = 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # cancel chain lines~ +** Processing line: ~ # Until their are no more cells to be explored~ - Inside source: true *** True Line Result - # cancel chain lines -** Processing line: ~ if inputs.keyboard.key_down.nine || inputs.keyboard.key_down.escape || inputs.keyboard.key_up.six || inputs.keyboard.key_up.one~ + # Until their are no more cells to be explored +** Processing line: ~ until dijkstra_search.frontier.empty?~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.nine || inputs.keyboard.key_down.escape || inputs.keyboard.key_up.six || inputs.keyboard.key_up.one -** Processing line: ~ state.point_one = nil~ + until dijkstra_search.frontier.empty? +** Processing line: ~ # Get the next cell to be explored from~ - Inside source: true *** True Line Result - state.point_one = nil -** Processing line: ~ end~ + # Get the next cell to be explored from +** Processing line: ~ # We get the first element of the array which is the cell. The second element is the priority.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # We get the first element of the array which is the cell. The second element is the priority. +** Processing line: ~ current = dijkstra_search.frontier.shift[0]~ - Inside source: true *** True Line Result - end + current = dijkstra_search.frontier.shift[0] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def play_sound~ +** Processing line: ~ # Stop the search if we found the target~ - Inside source: true *** True Line Result - def play_sound -** Processing line: ~ return if state.sound_debounce > 0~ + # Stop the search if we found the target +** Processing line: ~ return if current == state.target~ - Inside source: true *** True Line Result - return if state.sound_debounce > 0 -** Processing line: ~ state.sound_debounce = 5~ + return if current == state.target +** Processing line: ~~ - Inside source: true *** True Line Result - state.sound_debounce = 5 -** Processing line: ~ outputs.sounds << "sounds/03#{"%02d" % state.sound_index}.wav"~ + +** Processing line: ~ # For each of the neighbors~ - Inside source: true *** True Line Result - outputs.sounds << "sounds/03#{"%02d" % state.sound_index}.wav" -** Processing line: ~ state.sound_index += 1~ + # For each of the neighbors +** Processing line: ~ adjacent_neighbors(current).each do | neighbor |~ - Inside source: true *** True Line Result - state.sound_index += 1 -** Processing line: ~ if state.sound_index > 21~ + adjacent_neighbors(current).each do | neighbor | +** Processing line: ~ # Unless this cell is a wall or has already been explored.~ - Inside source: true *** True Line Result - if state.sound_index > 21 -** Processing line: ~ state.sound_index = 1~ + # Unless this cell is a wall or has already been explored. +** Processing line: ~ unless dijkstra_search.came_from.has_key?(neighbor) or state.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - state.sound_index = 1 -** Processing line: ~ end~ + unless dijkstra_search.came_from.has_key?(neighbor) or state.walls.has_key?(neighbor) +** Processing line: ~ # Calculate the movement cost of getting to this cell and memo~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Calculate the movement cost of getting to this cell and memo +** Processing line: ~ new_cost = dijkstra_search.cost_so_far[current] + cost(neighbor)~ - Inside source: true *** True Line Result - end + new_cost = dijkstra_search.cost_so_far[current] + cost(neighbor) +** Processing line: ~ dijkstra_search.cost_so_far[neighbor] = new_cost~ +- Inside source: true +*** True Line Result + dijkstra_search.cost_so_far[neighbor] = new_cost ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def input_game~ +** Processing line: ~ # Add this neighbor to the cells too be explored~ - Inside source: true *** True Line Result - def input_game -** Processing line: ~ if inputs.keyboard.down || inputs.keyboard.space~ + # Add this neighbor to the cells too be explored +** Processing line: ~ dijkstra_search.frontier << [neighbor, new_cost]~ - Inside source: true *** True Line Result - if inputs.keyboard.down || inputs.keyboard.space -** Processing line: ~ circle.potential_lift += 0.03~ + dijkstra_search.frontier << [neighbor, new_cost] +** Processing line: ~ dijkstra_search.came_from[neighbor] = current~ - Inside source: true *** True Line Result - circle.potential_lift += 0.03 -** Processing line: ~ circle.potential_lift = circle.potential_lift.lesser(10)~ + dijkstra_search.came_from[neighbor] = current +** Processing line: ~ end~ - Inside source: true *** True Line Result - circle.potential_lift = circle.potential_lift.lesser(10) -** Processing line: ~ elsif inputs.keyboard.key_up.down || inputs.keyboard.key_up.space~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_up.down || inputs.keyboard.key_up.space -** Processing line: ~ play_sound~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - play_sound -** Processing line: ~ circle.dy += circle.angle.vector_y circle.potential_lift~ + +** Processing line: ~ # Sort the frontier so exploration occurs that have a low cost so far.~ - Inside source: true *** True Line Result - circle.dy += circle.angle.vector_y circle.potential_lift -** Processing line: ~ circle.dx += circle.angle.vector_x circle.potential_lift~ + # Sort the frontier so exploration occurs that have a low cost so far. +** Processing line: ~ # My implementation of a priority queue~ - Inside source: true *** True Line Result - circle.dx += circle.angle.vector_x circle.potential_lift + # My implementation of a priority queue +** Processing line: ~ dijkstra_search.frontier = dijkstra_search.frontier.sort_by {|cell, priority| priority}~ +- Inside source: true +*** True Line Result + dijkstra_search.frontier = dijkstra_search.frontier.sort_by {|cell, priority| priority} +** 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 circle.on_floor~ +** Processing line: ~ def cost(cell)~ - Inside source: true *** True Line Result - if circle.on_floor -** Processing line: ~ if circle.floor_relative_y == :above~ + def cost(cell) +** Processing line: ~ if state.hills.has_key?(cell)~ - Inside source: true *** True Line Result - if circle.floor_relative_y == :above -** Processing line: ~ circle.y += circle.potential_lift.abs * 2~ + if state.hills.has_key?(cell) +** Processing line: ~ return 5~ - Inside source: true *** True Line Result - circle.y += circle.potential_lift.abs * 2 -** Processing line: ~ elsif circle.floor_relative_y == :below~ + return 5 +** Processing line: ~ else~ - Inside source: true *** True Line Result - elsif circle.floor_relative_y == :below -** Processing line: ~ circle.y -= circle.potential_lift.abs * 2~ + else +** Processing line: ~ return 1~ - Inside source: true *** True Line Result - circle.y -= circle.potential_lift.abs * 2 -** Processing line: ~ end~ + return 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ circle.on_floor = false~ +** Processing line: ~~ - Inside source: true *** True Line Result - circle.on_floor = false -** Processing line: ~ circle.potential_lift = 0~ + +** Processing line: ~~ - Inside source: true *** True Line Result - circle.potential_lift = 0 -** Processing line: ~ circle.terrains_to_monitor.clear~ + +** Processing line: ~~ - Inside source: true *** True Line Result - circle.terrains_to_monitor.clear -** Processing line: ~ circle.impact_history.clear~ + +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ - Inside source: true *** True Line Result - circle.impact_history.clear -** Processing line: ~ circle.impact = nil~ + # Moves the star to the cell closest to the mouse in the first grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - circle.impact = nil -** Processing line: ~ calc_physics~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - calc_physics -** Processing line: ~ end~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def input_star~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def input_star +** Processing line: ~ old_star = state.star.clone~ - Inside source: true *** True Line Result - -** Processing line: ~ # aim probe~ + old_star = state.star.clone +** Processing line: ~ unless cell_closest_to_mouse == state.target~ - Inside source: true *** True Line Result - # aim probe -** Processing line: ~ if inputs.keyboard.right || inputs.keyboard.a~ + unless cell_closest_to_mouse == state.target +** Processing line: ~ state.star = cell_closest_to_mouse~ - Inside source: true *** True Line Result - if inputs.keyboard.right || inputs.keyboard.a -** Processing line: ~ circle.angle -= 2~ + state.star = cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - circle.angle -= 2 -** Processing line: ~ elsif inputs.keyboard.left || inputs.keyboard.d~ + end +** Processing line: ~ unless old_star == state.star~ - Inside source: true *** True Line Result - elsif inputs.keyboard.left || inputs.keyboard.d -** Processing line: ~ circle.angle += 2~ + unless old_star == state.star +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - circle.angle += 2 + reset_search ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -68463,54 +72108,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def input~ -- Inside source: true -*** True Line Result - def input -** Processing line: ~ input_god_mode~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the second grid~ - Inside source: true *** True Line Result - input_god_mode -** Processing line: ~ input_game~ + # Moves the star to the cell closest to the mouse in the second grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - input_game -** Processing line: ~ end~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def input_star2~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_camera~ + def input_star2 +** Processing line: ~ old_star = state.star.clone~ - Inside source: true *** True Line Result - def calc_camera -** Processing line: ~ state.camera.target_x = 640 - circle.x~ + old_star = state.star.clone +** Processing line: ~ unless cell_closest_to_mouse2 == state.target~ - Inside source: true *** True Line Result - state.camera.target_x = 640 - circle.x -** Processing line: ~ state.camera.target_y = 360 - circle.y~ + unless cell_closest_to_mouse2 == state.target +** Processing line: ~ state.star = cell_closest_to_mouse2~ - Inside source: true *** True Line Result - state.camera.target_y = 360 - circle.y -** Processing line: ~ xdiff = state.camera.target_x - state.camera.x~ + state.star = cell_closest_to_mouse2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - xdiff = state.camera.target_x - state.camera.x -** Processing line: ~ ydiff = state.camera.target_y - state.camera.y~ + end +** Processing line: ~ unless old_star == state.star~ - Inside source: true *** True Line Result - ydiff = state.camera.target_y - state.camera.y -** Processing line: ~ state.camera.x += xdiff * camera.follow_speed~ + unless old_star == state.star +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - state.camera.x += xdiff * camera.follow_speed -** Processing line: ~ state.camera.y += ydiff * camera.follow_speed~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.camera.y += ydiff * camera.follow_speed + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -68519,222 +72160,254 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def calc~ +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ - Inside source: true *** True Line Result - def calc -** Processing line: ~ state.sound_debounce ||= 0~ + # Moves the target to the grid closest to the mouse in the first grid +** Processing line: ~ # Only reset_searchs the search if the target changes position~ - Inside source: true *** True Line Result - state.sound_debounce ||= 0 -** Processing line: ~ state.sound_debounce -= 1~ + # Only reset_searchs the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ - Inside source: true *** True Line Result - state.sound_debounce -= 1 -** Processing line: ~ state.sound_debounce = 0 if state.sound_debounce < 0~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def input_target~ - Inside source: true *** True Line Result - state.sound_debounce = 0 if state.sound_debounce < 0 -** Processing line: ~ if state.god_mode~ + def input_target +** Processing line: ~ old_target = state.target.clone~ - Inside source: true *** True Line Result - if state.god_mode -** Processing line: ~ circle.dy *= 0.1~ + old_target = state.target.clone +** Processing line: ~ unless cell_closest_to_mouse == state.star~ - Inside source: true *** True Line Result - circle.dy *= 0.1 -** Processing line: ~ circle.dx *= 0.1~ + unless cell_closest_to_mouse == state.star +** Processing line: ~ state.target = cell_closest_to_mouse~ - Inside source: true *** True Line Result - circle.dx *= 0.1 + state.target = cell_closest_to_mouse ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ calc_camera~ -- Inside source: true -*** True Line Result - calc_camera -** Processing line: ~ state.whisp_queue ||= []~ +** Processing line: ~ unless old_target == state.target~ - Inside source: true *** True Line Result - state.whisp_queue ||= [] -** Processing line: ~ if state.tick_count.mod_zero?(4)~ + unless old_target == state.target +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - if state.tick_count.mod_zero?(4) -** Processing line: ~ state.whisp_queue << {~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.whisp_queue << { -** Processing line: ~ x: -300,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - x: -300, -** Processing line: ~ y: 1400 * rand,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - y: 1400 * rand, -** Processing line: ~ speed: 2.randomize(:ratio) + 3,~ + +** Processing line: ~ # Moves the target to the cell closest to the mouse in the second grid~ - Inside source: true *** True Line Result - speed: 2.randomize(:ratio) + 3, -** Processing line: ~ w: 20,~ + # Moves the target to the cell closest to the mouse in the second grid +** Processing line: ~ # Only reset_searchs the search if the target changes position~ - Inside source: true *** True Line Result - w: 20, -** Processing line: ~ h: 20, path: 'sprites/whisp.png',~ + # Only reset_searchs the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ - Inside source: true *** True Line Result - h: 20, path: 'sprites/whisp.png', -** Processing line: ~ a: 0,~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def input_target2~ - Inside source: true *** True Line Result - a: 0, -** Processing line: ~ created_at: state.tick_count,~ + def input_target2 +** Processing line: ~ old_target = state.target.clone~ - Inside source: true *** True Line Result - created_at: state.tick_count, -** Processing line: ~ angle: 0,~ + old_target = state.target.clone +** Processing line: ~ unless cell_closest_to_mouse2 == state.star~ - Inside source: true *** True Line Result - angle: 0, -** Processing line: ~ r: 100,~ + unless cell_closest_to_mouse2 == state.star +** Processing line: ~ state.target = cell_closest_to_mouse2~ - Inside source: true *** True Line Result - r: 100, -** Processing line: ~ g: 128 + 128 * rand,~ + state.target = cell_closest_to_mouse2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - g: 128 + 128 * rand, -** Processing line: ~ b: 128 + 128 * rand~ + end +** Processing line: ~ unless old_target == state.target~ - Inside source: true *** True Line Result - b: 128 + 128 * rand -** Processing line: ~ }~ + unless old_target == state.target +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - } + reset_search ** 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: ~ state.whisp_queue.each do |w|~ +** Processing line: ~ # Removes walls in the first grid that are under the cursor~ - Inside source: true *** True Line Result - state.whisp_queue.each do |w| -** Processing line: ~ w.x += w[:speed] * 2~ + # Removes walls in the first grid that are under the cursor +** Processing line: ~ def input_remove_wall~ - Inside source: true *** True Line Result - w.x += w[:speed] * 2 -** Processing line: ~ w.x -= circle.dx * 0.3~ + def input_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - w.x -= circle.dx * 0.3 -** Processing line: ~ w.y -= w[:speed]~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - w.y -= w[:speed] -** Processing line: ~ w.y -= circle.dy * 0.3~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - w.y -= circle.dy * 0.3 -** Processing line: ~ w.angle += w[:speed]~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if mouse_over_grid?~ - Inside source: true *** True Line Result - w.angle += w[:speed] -** Processing line: ~ w.a = w[:created_at].ease(30) * 255~ + if mouse_over_grid? +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse) or state.hills.has_key?(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - w.a = w[:created_at].ease(30) * 255 + if state.walls.has_key?(cell_closest_to_mouse) or state.hills.has_key?(cell_closest_to_mouse) +** Processing line: ~ state.walls.delete(cell_closest_to_mouse)~ +- Inside source: true +*** True Line Result + state.walls.delete(cell_closest_to_mouse) +** Processing line: ~ state.hills.delete(cell_closest_to_mouse)~ +- Inside source: true +*** True Line Result + state.hills.delete(cell_closest_to_mouse) +** Processing line: ~ reset_search~ +- Inside source: true +*** True Line Result + reset_search +** 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: ~ state.whisp_queue = state.whisp_queue.reject { |w| w[:x] > 1280 }~ +** Processing line: ~ # Removes walls in the second grid that are under the cursor~ - Inside source: true *** True Line Result - state.whisp_queue = state.whisp_queue.reject { |w| w[:x] > 1280 } -** Processing line: ~~ + # Removes walls in the second grid that are under the cursor +** Processing line: ~ def input_remove_wall2~ - Inside source: true *** True Line Result - -** Processing line: ~ if state.tick_count.mod_zero?(2) && (circle.dx != 0 || circle.dy != 0)~ + def input_remove_wall2 +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - if state.tick_count.mod_zero?(2) && (circle.dx != 0 || circle.dy != 0) -** Processing line: ~ circle.after_images << {~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - circle.after_images << { -** Processing line: ~ x: circle.x,~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - x: circle.x, -** Processing line: ~ y: circle.y,~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if mouse_over_grid2?~ - Inside source: true *** True Line Result - y: circle.y, -** Processing line: ~ w: circle.radius,~ + if mouse_over_grid2? +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse2) or state.hills.has_key?(cell_closest_to_mouse2)~ - Inside source: true *** True Line Result - w: circle.radius, -** Processing line: ~ h: circle.radius,~ + if state.walls.has_key?(cell_closest_to_mouse2) or state.hills.has_key?(cell_closest_to_mouse2) +** Processing line: ~ state.walls.delete(cell_closest_to_mouse2)~ - Inside source: true *** True Line Result - h: circle.radius, -** Processing line: ~ a: 255,~ + state.walls.delete(cell_closest_to_mouse2) +** Processing line: ~ state.hills.delete(cell_closest_to_mouse2)~ - Inside source: true *** True Line Result - a: 255, -** Processing line: ~ created_at: state.tick_count~ + state.hills.delete(cell_closest_to_mouse2) +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - created_at: state.tick_count -** Processing line: ~ }~ + reset_search +** 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: ~ circle.after_images.each do |ai|~ +** Processing line: ~ # Adds a hill in the first grid in the cell the mouse is over~ - Inside source: true *** True Line Result - circle.after_images.each do |ai| -** Processing line: ~ ai.a = ai[:created_at].ease(10, :flip) * 255~ + # Adds a hill in the first grid in the cell the mouse is over +** Processing line: ~ def input_add_hill~ - Inside source: true *** True Line Result - ai.a = ai[:created_at].ease(10, :flip) * 255 -** Processing line: ~ end~ + def input_add_hill +** Processing line: ~ if mouse_over_grid?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if mouse_over_grid? +** Processing line: ~ unless state.hills.has_key?(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - -** Processing line: ~ circle.after_images = circle.after_images.reject { |ai| ai[:created_at].elapsed_time > 10 }~ + unless state.hills.has_key?(cell_closest_to_mouse) +** Processing line: ~ state.hills[cell_closest_to_mouse] = true~ - Inside source: true *** True Line Result - circle.after_images = circle.after_images.reject { |ai| ai[:created_at].elapsed_time > 10 } -** Processing line: ~ calc_physics~ + state.hills[cell_closest_to_mouse] = true +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - calc_physics + reset_search +** 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 @@ -68743,30 +72416,42 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def circle~ +** Processing line: ~~ - Inside source: true *** True Line Result - def circle -** Processing line: ~ state.circle~ + +** Processing line: ~ # Adds a hill in the second grid in the cell the mouse is over~ - Inside source: true *** True Line Result - state.circle -** Processing line: ~ end~ + # Adds a hill in the second grid in the cell the mouse is over +** Processing line: ~ def input_add_hill2~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def input_add_hill2 +** Processing line: ~ if mouse_over_grid2?~ - Inside source: true *** True Line Result - -** Processing line: ~ def camera~ + if mouse_over_grid2? +** Processing line: ~ unless state.hills.has_key?(cell_closest_to_mouse2)~ - Inside source: true *** True Line Result - def camera -** Processing line: ~ state.camera~ + unless state.hills.has_key?(cell_closest_to_mouse2) +** Processing line: ~ state.hills[cell_closest_to_mouse2] = true~ - Inside source: true *** True Line Result - state.camera + state.hills[cell_closest_to_mouse2] = true +** Processing line: ~ reset_search~ +- Inside source: true +*** True Line Result + reset_search +** 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 @@ -68775,7410 +72460,7494 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def terrain~ +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ - Inside source: true *** True Line Result - def terrain -** Processing line: ~ state.terrain~ + # Adds a wall in the first grid in the cell the mouse is over +** Processing line: ~ def input_add_wall~ - Inside source: true *** True Line Result - state.terrain -** Processing line: ~ end~ + def input_add_wall +** Processing line: ~ if mouse_over_grid?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if mouse_over_grid? +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - -** Processing line: ~ def lava~ + unless state.walls.has_key?(cell_closest_to_mouse) +** Processing line: ~ state.hills.delete(cell_closest_to_mouse)~ - Inside source: true *** True Line Result - def lava -** Processing line: ~ state.lava~ + state.hills.delete(cell_closest_to_mouse) +** Processing line: ~ state.walls[cell_closest_to_mouse] = true~ - Inside source: true *** True Line Result - state.lava -** Processing line: ~ end~ + state.walls[cell_closest_to_mouse] = true +** Processing line: ~ reset_search~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + reset_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # $gtk.reset~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # $gtk.reset + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ # Adds a wall in the second grid in the cell the mouse is over~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ + # Adds a wall in the second grid in the cell the mouse is over +** Processing line: ~ def input_add_wall2~ - Inside source: true *** True Line Result - args.outputs.background_color = [0, 0, 0] -** Processing line: ~ if args.inputs.keyboard.r~ + def input_add_wall2 +** Processing line: ~ if mouse_over_grid2?~ - Inside source: true *** True Line Result - if args.inputs.keyboard.r -** Processing line: ~ args.gtk.reset~ + if mouse_over_grid2? +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse2)~ - Inside source: true *** True Line Result - args.gtk.reset -** Processing line: ~ return~ + unless state.walls.has_key?(cell_closest_to_mouse2) +** Processing line: ~ state.hills.delete(cell_closest_to_mouse2)~ - Inside source: true *** True Line Result - return + state.hills.delete(cell_closest_to_mouse2) +** Processing line: ~ state.walls[cell_closest_to_mouse2] = true~ +- Inside source: true +*** True Line Result + state.walls[cell_closest_to_mouse2] = true +** Processing line: ~ reset_search~ +- Inside source: true +*** True Line Result + reset_search +** 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: ~ # uncomment the line below to slow down the game so you~ +** Processing line: ~~ - Inside source: true *** True Line Result - # uncomment the line below to slow down the game so you -** Processing line: ~ # can see each tick as it passes~ + +** Processing line: ~ # Whenever the user edits the grid,~ - Inside source: true *** True Line Result - # can see each tick as it passes -** Processing line: ~ # args.gtk.slowmo! 30~ + # Whenever the user edits the grid, +** Processing line: ~ # The search has to be reset_searchd upto the current step~ - Inside source: true *** True Line Result - # args.gtk.slowmo! 30 -** Processing line: ~ $game ||= FallingCircle.new~ + # The search has to be reset_searchd upto the current step +** Processing line: ~ # with the current grid as the initial state of the grid~ - Inside source: true *** True Line Result - $game ||= FallingCircle.new -** Processing line: ~ $game.args = args~ + # with the current grid as the initial state of the grid +** Processing line: ~ def reset_search~ - Inside source: true *** True Line Result - $game.args = args -** Processing line: ~ $game.tick~ + def reset_search +** Processing line: ~ breadth_first_search.visited = {}~ - Inside source: true *** True Line Result - $game.tick -** Processing line: ~ end~ + breadth_first_search.visited = {} +** Processing line: ~ breadth_first_search.frontier = []~ - Inside source: true *** True Line Result - end + breadth_first_search.frontier = [] +** Processing line: ~ breadth_first_search.came_from = {}~ +- Inside source: true +*** True Line Result + breadth_first_search.came_from = {} ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def reset~ +** Processing line: ~ dijkstra_search.frontier = []~ - Inside source: true *** True Line Result - def reset -** Processing line: ~ $game = nil~ + dijkstra_search.frontier = [] +** Processing line: ~ dijkstra_search.came_from = {}~ - Inside source: true *** True Line Result - $game = nil -** Processing line: ~ end~ + dijkstra_search.came_from = {} +** Processing line: ~ dijkstra_search.cost_so_far = {}~ - Inside source: true *** True Line Result - end + dijkstra_search.cost_so_far = {} +** 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. +- Inside source: true *** True Line Result -** Processing line: ~* Platformer - The Little Probe - Data - level.txt~ -- Header detected. +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ # Returns a list of adjacent cells~ +- Inside source: true *** True Line Result -* Platformer - The Little Probe - Data - level.txt -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - + # Returns a list of adjacent cells +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_platformer/the_little_probe/data/level.txt~ + # Used to determine what the next cells to be added to the frontier are +** Processing line: ~ def adjacent_neighbors(cell)~ - Inside source: true *** True Line Result - # ./samples/99_genre_platformer/the_little_probe/data/level.txt -** Processing line: ~ 640,8840,1180,8840~ + def adjacent_neighbors(cell) +** Processing line: ~ neighbors = []~ - Inside source: true *** True Line Result - 640,8840,1180,8840 -** Processing line: ~ -60,10220,0,9960~ + neighbors = [] +** Processing line: ~~ - Inside source: true *** True Line Result - -60,10220,0,9960 -** Processing line: ~ -60,10220,0,10500~ + +** Processing line: ~ # Gets all the valid neighbors into the array~ - Inside source: true *** True Line Result - -60,10220,0,10500 -** Processing line: ~ 0,10500,0,10780~ + # Gets all the valid neighbors into the array +** Processing line: ~ # From southern neighbor, clockwise~ - Inside source: true *** True Line Result - 0,10500,0,10780 -** Processing line: ~ 0,10780,40,10900~ + # From southern neighbor, clockwise +** Processing line: ~ neighbors << [cell.x , cell.y - 1] unless cell.y == 0~ - Inside source: true *** True Line Result - 0,10780,40,10900 -** Processing line: ~ 500,10920,760,10960~ + neighbors << [cell.x , cell.y - 1] unless cell.y == 0 +** Processing line: ~ neighbors << [cell.x - 1, cell.y ] unless cell.x == 0~ - Inside source: true *** True Line Result - 500,10920,760,10960 -** Processing line: ~ 300,10560,820,10600~ + neighbors << [cell.x - 1, cell.y ] unless cell.x == 0 +** Processing line: ~ neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1~ - Inside source: true *** True Line Result - 300,10560,820,10600 -** Processing line: ~ 420,10320,700,10300~ + neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1 +** Processing line: ~ neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1~ - Inside source: true *** True Line Result - 420,10320,700,10300 -** Processing line: ~ 820,10600,1500,10600~ + neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1 +** Processing line: ~~ - Inside source: true *** True Line Result - 820,10600,1500,10600 -** Processing line: ~ 1500,10600,1940,10600~ + +** Processing line: ~ # Sorts the neighbors so the rendered path is a zigzag path~ - Inside source: true *** True Line Result - 1500,10600,1940,10600 -** Processing line: ~ 1940,10600,2380,10580~ + # Sorts the neighbors so the rendered path is a zigzag path +** Processing line: ~ # Cells in a diagonal direction are given priority~ - Inside source: true *** True Line Result - 1940,10600,2380,10580 -** Processing line: ~ 2380,10580,2800,10620~ + # Cells in a diagonal direction are given priority +** Processing line: ~ # Comment this line to see the difference~ - Inside source: true *** True Line Result - 2380,10580,2800,10620 -** Processing line: ~ 2240,11080,2480,11020~ + # Comment this line to see the difference +** Processing line: ~ neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) }~ - Inside source: true *** True Line Result - 2240,11080,2480,11020 -** Processing line: ~ 2000,11120,2240,11080~ + neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) } +** Processing line: ~~ - Inside source: true *** True Line Result - 2000,11120,2240,11080 -** Processing line: ~ 1760,11180,2000,11120~ + +** Processing line: ~ neighbors~ - Inside source: true *** True Line Result - 1760,11180,2000,11120 -** Processing line: ~ 1620,11180,1760,11180~ + neighbors +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1620,11180,1760,11180 -** Processing line: ~ 1500,11220,1620,11180~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1500,11220,1620,11180 -** Processing line: ~ 1180,11280,1340,11220~ + +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ - Inside source: true *** True Line Result - 1180,11280,1340,11220 -** Processing line: ~ 1040,11240,1180,11280~ + # Finds the vertical and horizontal distance of a cell from the star +** Processing line: ~ # and returns the larger value~ - Inside source: true *** True Line Result - 1040,11240,1180,11280 -** Processing line: ~ 840,11280,1040,11240~ + # and returns the larger value +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ - Inside source: true *** True Line Result - 840,11280,1040,11240 -** Processing line: ~ 640,11280,840,11280~ + # This method is used to have a zigzag pattern in the rendered path +** Processing line: ~ # A cell that is [5, 5] from the star,~ - Inside source: true *** True Line Result - 640,11280,840,11280 -** Processing line: ~ 500,11220,640,11280~ + # A cell that is [5, 5] from the star, +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ - Inside source: true *** True Line Result - 500,11220,640,11280 -** Processing line: ~ 420,11140,500,11220~ + # is explored before over a cell that is [0, 7] away. +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ - Inside source: true *** True Line Result - 420,11140,500,11220 -** Processing line: ~ 240,11100,420,11140~ + # So, if possible, the search tries to go diagonal (zigzag) first +** Processing line: ~ def proximity_to_star(x, y)~ - Inside source: true *** True Line Result - 240,11100,420,11140 -** Processing line: ~ 100,11120,240,11100~ + def proximity_to_star(x, y) +** Processing line: ~ distance_x = (state.star.x - x).abs~ - Inside source: true *** True Line Result - 100,11120,240,11100 -** Processing line: ~ 0,11180,100,11120~ + distance_x = (state.star.x - x).abs +** Processing line: ~ distance_y = (state.star.y - y).abs~ - Inside source: true *** True Line Result - 0,11180,100,11120 -** Processing line: ~ -160,11220,0,11180~ + distance_y = (state.star.y - y).abs +** Processing line: ~~ - Inside source: true *** True Line Result - -160,11220,0,11180 -** Processing line: ~ -260,11240,-160,11220~ + +** Processing line: ~ if distance_x > distance_y~ - Inside source: true *** True Line Result - -260,11240,-160,11220 -** Processing line: ~ 1340,11220,1500,11220~ + if distance_x > distance_y +** Processing line: ~ return distance_x~ - Inside source: true *** True Line Result - 1340,11220,1500,11220 -** Processing line: ~ 960,13300,1280,13060~ + return distance_x +** Processing line: ~ else~ - Inside source: true *** True Line Result - 960,13300,1280,13060 -** Processing line: ~ 1280,13060,1540,12860~ + else +** Processing line: ~ return distance_y~ - Inside source: true *** True Line Result - 1280,13060,1540,12860 -** Processing line: ~ 1540,12860,1820,12700~ + return distance_y +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1540,12860,1820,12700 -** Processing line: ~ 1820,12700,2080,12520~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1820,12700,2080,12520 -** Processing line: ~ 2080,12520,2240,12400~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2080,12520,2240,12400 -** Processing line: ~ 2240,12400,2240,12240~ + +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - 2240,12400,2240,12240 -** Processing line: ~ 2240,12240,2400,12080~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - 2240,12240,2400,12080 -** Processing line: ~ 2400,12080,2560,11920~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ - Inside source: true *** True Line Result - 2400,12080,2560,11920 -** Processing line: ~ 2560,11920,2640,11740~ + # Finding the cell closest to the mouse helps with this +** Processing line: ~ def cell_closest_to_mouse~ - Inside source: true *** True Line Result - 2560,11920,2640,11740 -** Processing line: ~ 2640,11740,2740,11580~ + def cell_closest_to_mouse +** Processing line: ~ # Closest cell to the mouse in the first grid~ - Inside source: true *** True Line Result - 2640,11740,2740,11580 -** Processing line: ~ 2740,11580,2800,11400~ + # Closest cell to the mouse in the first grid +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - 2740,11580,2800,11400 -** Processing line: ~ 2800,11400,2800,11240~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - 2800,11400,2800,11240 -** Processing line: ~ 2740,11140,2800,11240~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Bound x and y to the grid~ - Inside source: true *** True Line Result - 2740,11140,2800,11240 -** Processing line: ~ 2700,11040,2740,11140~ + # Bound x and y to the grid +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - 2700,11040,2740,11140 -** Processing line: ~ 2700,11040,2740,10960~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - 2700,11040,2740,10960 -** Processing line: ~ 2740,10960,2740,10920~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - 2740,10960,2740,10920 -** Processing line: ~ 2700,10900,2740,10920~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - 2700,10900,2740,10920 -** Processing line: ~ 2380,10900,2700,10900~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2380,10900,2700,10900 -** Processing line: ~ 2040,10920,2380,10900~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2040,10920,2380,10900 -** Processing line: ~ 1720,10940,2040,10920~ + +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - 1720,10940,2040,10920 -** Processing line: ~ 1380,11000,1720,10940~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - 1380,11000,1720,10940 -** Processing line: ~ 1180,10980,1380,11000~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse in the second grid helps with this~ - Inside source: true *** True Line Result - 1180,10980,1380,11000 -** Processing line: ~ 900,10980,1180,10980~ + # Finding the cell closest to the mouse in the second grid helps with this +** Processing line: ~ def cell_closest_to_mouse2~ - Inside source: true *** True Line Result - 900,10980,1180,10980 -** Processing line: ~ 760,10960,900,10980~ + def cell_closest_to_mouse2 +** Processing line: ~ # Closest cell grid to the mouse in the second~ - Inside source: true *** True Line Result - 760,10960,900,10980 -** Processing line: ~ 240,10960,500,10920~ + # Closest cell grid to the mouse in the second +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - 240,10960,500,10920 -** Processing line: ~ 40,10900,240,10960~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - 40,10900,240,10960 -** Processing line: ~ 0,9700,0,9960~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Translate the cell to the first grid~ - Inside source: true *** True Line Result - 0,9700,0,9960 -** Processing line: ~ -60,9500,0,9700~ + # Translate the cell to the first grid +** Processing line: ~ x -= grid.width + 1~ - Inside source: true *** True Line Result - -60,9500,0,9700 -** Processing line: ~ -60,9420,-60,9500~ + x -= grid.width + 1 +** Processing line: ~ # Bound x and y to the first grid~ - Inside source: true *** True Line Result - -60,9420,-60,9500 -** Processing line: ~ -60,9420,-60,9340~ + # Bound x and y to the first grid +** Processing line: ~ x = 0 if x < 0~ - Inside source: true *** True Line Result - -60,9420,-60,9340 -** Processing line: ~ -60,9340,-60,9280~ + x = 0 if x < 0 +** Processing line: ~ y = 0 if y < 0~ - Inside source: true *** True Line Result - -60,9340,-60,9280 -** Processing line: ~ -60,9120,-60,9280~ + y = 0 if y < 0 +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - -60,9120,-60,9280 -** Processing line: ~ -60,8940,-60,9120~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - -60,8940,-60,9120 -** Processing line: ~ -60,8940,-60,8780~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - -60,8940,-60,8780 -** Processing line: ~ -60,8780,0,8700~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - -60,8780,0,8700 -** Processing line: ~ 0,8700,40,8680~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 0,8700,40,8680 -** Processing line: ~ 40,8680,240,8700~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 40,8680,240,8700 -** Processing line: ~ 240,8700,360,8780~ + +** Processing line: ~ # Signal that the user is going to be moving the star from the first grid~ - Inside source: true *** True Line Result - 240,8700,360,8780 -** Processing line: ~ 360,8780,640,8840~ + # Signal that the user is going to be moving the star from the first grid +** Processing line: ~ def mouse_over_star?~ - Inside source: true *** True Line Result - 360,8780,640,8840 -** Processing line: ~ 1420,8400,1540,8480~ + def mouse_over_star? +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up(state.star))~ - Inside source: true *** True Line Result - 1420,8400,1540,8480 -** Processing line: ~ 1540,8480,1680,8500~ + inputs.mouse.point.inside_rect?(scale_up(state.star)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1540,8480,1680,8500 -** Processing line: ~ 1680,8500,1940,8460~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1680,8500,1940,8460 -** Processing line: ~ 1180,8840,1280,8880~ + +** Processing line: ~ # Signal that the user is going to be moving the star from the second grid~ - Inside source: true *** True Line Result - 1180,8840,1280,8880 -** Processing line: ~ 1280,8880,1340,8860~ + # Signal that the user is going to be moving the star from the second grid +** Processing line: ~ def mouse_over_star2?~ - Inside source: true *** True Line Result - 1280,8880,1340,8860 -** Processing line: ~ 1340,8860,1720,8860~ + def mouse_over_star2? +** Processing line: ~ inputs.mouse.point.inside_rect?(move_and_scale_up(state.star))~ - Inside source: true *** True Line Result - 1340,8860,1720,8860 -** Processing line: ~ 1720,8860,1820,8920~ + inputs.mouse.point.inside_rect?(move_and_scale_up(state.star)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1720,8860,1820,8920 -** Processing line: ~ 1820,8920,1820,9140~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1820,8920,1820,9140 -** Processing line: ~ 1820,9140,1820,9280~ + +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ - Inside source: true *** True Line Result - 1820,9140,1820,9280 -** Processing line: ~ 1820,9460,1820,9280~ + # Signal that the user is going to be moving the target from the first grid +** Processing line: ~ def mouse_over_target?~ - Inside source: true *** True Line Result - 1820,9460,1820,9280 -** Processing line: ~ 1760,9480,1820,9460~ + def mouse_over_target? +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up(state.target))~ - Inside source: true *** True Line Result - 1760,9480,1820,9460 -** Processing line: ~ 1640,9480,1760,9480~ + inputs.mouse.point.inside_rect?(scale_up(state.target)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1640,9480,1760,9480 -** Processing line: ~ 1540,9500,1640,9480~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1540,9500,1640,9480 -** Processing line: ~ 1340,9500,1540,9500~ + +** Processing line: ~ # Signal that the user is going to be moving the target from the second grid~ - Inside source: true *** True Line Result - 1340,9500,1540,9500 -** Processing line: ~ 1100,9500,1340,9500~ + # Signal that the user is going to be moving the target from the second grid +** Processing line: ~ def mouse_over_target2?~ - Inside source: true *** True Line Result - 1100,9500,1340,9500 -** Processing line: ~ 1040,9540,1100,9500~ + def mouse_over_target2? +** Processing line: ~ inputs.mouse.point.inside_rect?(move_and_scale_up(state.target))~ - Inside source: true *** True Line Result - 1040,9540,1100,9500 -** Processing line: ~ 960,9540,1040,9540~ + inputs.mouse.point.inside_rect?(move_and_scale_up(state.target)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 960,9540,1040,9540 -** Processing line: ~ 300,9420,360,9460~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 300,9420,360,9460 -** Processing line: ~ 240,9440,300,9420~ + +** Processing line: ~ # Signal that the user is going to be removing walls from the first grid~ - Inside source: true *** True Line Result - 240,9440,300,9420 -** Processing line: ~ 180,9600,240,9440~ + # Signal that the user is going to be removing walls from the first grid +** Processing line: ~ def mouse_over_wall?~ - Inside source: true *** True Line Result - 180,9600,240,9440 -** Processing line: ~ 120,9660,180,9600~ + def mouse_over_wall? +** Processing line: ~ state.walls.each_key do | wall |~ - Inside source: true *** True Line Result - 120,9660,180,9600 -** Processing line: ~ 100,9820,120,9660~ + state.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(scale_up(wall))~ - Inside source: true *** True Line Result - 100,9820,120,9660 -** Processing line: ~ 100,9820,120,9860~ + return true if inputs.mouse.point.inside_rect?(scale_up(wall)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 100,9820,120,9860 -** Processing line: ~ 120,9860,140,9900~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 120,9860,140,9900 -** Processing line: ~ 140,9900,140,10000~ + +** Processing line: ~ false~ - Inside source: true *** True Line Result - 140,9900,140,10000 -** Processing line: ~ 140,10440,180,10540~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - 140,10440,180,10540 -** Processing line: ~ 100,10080,140,10000~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 100,10080,140,10000 -** Processing line: ~ 100,10080,140,10100~ + +** Processing line: ~ # Signal that the user is going to be removing walls from the second grid~ - Inside source: true *** True Line Result - 100,10080,140,10100 -** Processing line: ~ 140,10100,140,10440~ + # Signal that the user is going to be removing walls from the second grid +** Processing line: ~ def mouse_over_wall2?~ - Inside source: true *** True Line Result - 140,10100,140,10440 -** Processing line: ~ 180,10540,300,10560~ + def mouse_over_wall2? +** Processing line: ~ state.walls.each_key do | wall |~ - Inside source: true *** True Line Result - 180,10540,300,10560 -** Processing line: ~ 2140,9560,2140,9640~ + state.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(move_and_scale_up(wall))~ - Inside source: true *** True Line Result - 2140,9560,2140,9640 -** Processing line: ~ 2140,9720,2140,9640~ + return true if inputs.mouse.point.inside_rect?(move_and_scale_up(wall)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2140,9720,2140,9640 -** Processing line: ~ 1880,9780,2140,9720~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1880,9780,2140,9720 -** Processing line: ~ 1720,9780,1880,9780~ + +** Processing line: ~ false~ - Inside source: true *** True Line Result - 1720,9780,1880,9780 -** Processing line: ~ 1620,9740,1720,9780~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1620,9740,1720,9780 -** Processing line: ~ 1500,9780,1620,9740~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1500,9780,1620,9740 -** Processing line: ~ 1380,9780,1500,9780~ + +** Processing line: ~ # Signal that the user is going to be removing hills from the first grid~ - Inside source: true *** True Line Result - 1380,9780,1500,9780 -** Processing line: ~ 1340,9820,1380,9780~ + # Signal that the user is going to be removing hills from the first grid +** Processing line: ~ def mouse_over_hill?~ - Inside source: true *** True Line Result - 1340,9820,1380,9780 -** Processing line: ~ 1200,9820,1340,9820~ + def mouse_over_hill? +** Processing line: ~ state.hills.each_key do | hill |~ - Inside source: true *** True Line Result - 1200,9820,1340,9820 -** Processing line: ~ 1100,9780,1200,9820~ + state.hills.each_key do | hill | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(scale_up(hill))~ - Inside source: true *** True Line Result - 1100,9780,1200,9820 -** Processing line: ~ 900,9780,1100,9780~ + return true if inputs.mouse.point.inside_rect?(scale_up(hill)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 900,9780,1100,9780 -** Processing line: ~ 820,9720,900,9780~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 820,9720,900,9780 -** Processing line: ~ 540,9720,820,9720~ + +** Processing line: ~ false~ - Inside source: true *** True Line Result - 540,9720,820,9720 -** Processing line: ~ 360,9840,540,9720~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - 360,9840,540,9720 -** Processing line: ~ 360,9840,360,9960~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 360,9840,360,9960 -** Processing line: ~ 360,9960,360,10080~ + +** Processing line: ~ # Signal that the user is going to be removing hills from the second grid~ - Inside source: true *** True Line Result - 360,9960,360,10080 -** Processing line: ~ 360,10140,360,10080~ + # Signal that the user is going to be removing hills from the second grid +** Processing line: ~ def mouse_over_hill2?~ - Inside source: true *** True Line Result - 360,10140,360,10080 -** Processing line: ~ 360,10140,360,10240~ + def mouse_over_hill2? +** Processing line: ~ state.hills.each_key do | hill |~ - Inside source: true *** True Line Result - 360,10140,360,10240 -** Processing line: ~ 360,10240,420,10320~ + state.hills.each_key do | hill | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(move_and_scale_up(hill))~ - Inside source: true *** True Line Result - 360,10240,420,10320 -** Processing line: ~ 700,10300,820,10280~ + return true if inputs.mouse.point.inside_rect?(move_and_scale_up(hill)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 700,10300,820,10280 -** Processing line: ~ 820,10280,820,10280~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 820,10280,820,10280 -** Processing line: ~ 820,10280,900,10320~ + +** Processing line: ~ false~ - Inside source: true *** True Line Result - 820,10280,900,10320 -** Processing line: ~ 900,10320,1040,10300~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - 900,10320,1040,10300 -** Processing line: ~ 1040,10300,1200,10320~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1040,10300,1200,10320 -** Processing line: ~ 1200,10320,1380,10280~ + +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ - Inside source: true *** True Line Result - 1200,10320,1380,10280 -** Processing line: ~ 1380,10280,1500,10300~ + # Signal that the user is going to be adding walls from the first grid +** Processing line: ~ def mouse_over_grid?~ - Inside source: true *** True Line Result - 1380,10280,1500,10300 -** Processing line: ~ 1500,10300,1760,10300~ + def mouse_over_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up(grid.rect))~ - Inside source: true *** True Line Result - 1500,10300,1760,10300 -** Processing line: ~ 2800,10620,2840,10600~ + inputs.mouse.point.inside_rect?(scale_up(grid.rect)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2800,10620,2840,10600 -** Processing line: ~ 2840,10600,2900,10600~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2840,10600,2900,10600 -** Processing line: ~ 2900,10600,3000,10620~ + +** Processing line: ~ # Signal that the user is going to be adding walls from the second grid~ - Inside source: true *** True Line Result - 2900,10600,3000,10620 -** Processing line: ~ 3000,10620,3080,10620~ + # Signal that the user is going to be adding walls from the second grid +** Processing line: ~ def mouse_over_grid2?~ - Inside source: true *** True Line Result - 3000,10620,3080,10620 -** Processing line: ~ 3080,10620,3140,10600~ + def mouse_over_grid2? +** Processing line: ~ inputs.mouse.point.inside_rect?(move_and_scale_up(grid.rect))~ - Inside source: true *** True Line Result - 3080,10620,3140,10600 -** Processing line: ~ 3140,10540,3140,10600~ + inputs.mouse.point.inside_rect?(move_and_scale_up(grid.rect)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3140,10540,3140,10600 -** Processing line: ~ 3140,10540,3140,10460~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3140,10540,3140,10460 -** Processing line: ~ 3140,10460,3140,10360~ + +** Processing line: ~ # These methods provide handy aliases to colors~ - Inside source: true *** True Line Result - 3140,10460,3140,10360 -** Processing line: ~ 3140,10360,3140,10260~ + # These methods provide handy aliases to colors +** Processing line: ~~ - Inside source: true *** True Line Result - 3140,10360,3140,10260 -** Processing line: ~ 3140,10260,3140,10140~ + +** Processing line: ~ # Light brown~ - Inside source: true *** True Line Result - 3140,10260,3140,10140 -** Processing line: ~ 3140,10140,3140,10000~ + # Light brown +** Processing line: ~ def unvisited_color~ - Inside source: true *** True Line Result - 3140,10140,3140,10000 -** Processing line: ~ 3140,10000,3140,9860~ + def unvisited_color +** Processing line: ~ [221, 212, 213]~ - Inside source: true *** True Line Result - 3140,10000,3140,9860 -** Processing line: ~ 3140,9860,3160,9720~ + [221, 212, 213] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3140,9860,3160,9720 -** Processing line: ~ 3160,9720,3160,9580~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3160,9720,3160,9580 -** Processing line: ~ 3160,9580,3160,9440~ + +** Processing line: ~ # Camo Green~ - Inside source: true *** True Line Result - 3160,9580,3160,9440 -** Processing line: ~ 3160,9300,3160,9440~ + # Camo Green +** Processing line: ~ def wall_color~ - Inside source: true *** True Line Result - 3160,9300,3160,9440 -** Processing line: ~ 3160,9300,3160,9140~ + def wall_color +** Processing line: ~ [134, 134, 120]~ - Inside source: true *** True Line Result - 3160,9300,3160,9140 -** Processing line: ~ 3160,9140,3160,8980~ + [134, 134, 120] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3160,9140,3160,8980 -** Processing line: ~ 3160,8980,3160,8820~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3160,8980,3160,8820 -** Processing line: ~ 3160,8820,3160,8680~ + +** Processing line: ~ # Pastel White~ - Inside source: true *** True Line Result - 3160,8820,3160,8680 -** Processing line: ~ 3160,8680,3160,8520~ + # Pastel White +** Processing line: ~ def path_color~ - Inside source: true *** True Line Result - 3160,8680,3160,8520 -** Processing line: ~ 1760,10300,1880,10300~ + def path_color +** Processing line: ~ [231, 230, 228]~ - Inside source: true *** True Line Result - 1760,10300,1880,10300 -** Processing line: ~ 660,9500,960,9540~ + [231, 230, 228] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 660,9500,960,9540 -** Processing line: ~ 640,9460,660,9500~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 640,9460,660,9500 -** Processing line: ~ 360,9460,640,9460~ + +** Processing line: ~ def red~ - Inside source: true *** True Line Result - 360,9460,640,9460 -** Processing line: ~ -480,10760,-440,10880~ + def red +** Processing line: ~ [255, 0, 0]~ - Inside source: true *** True Line Result - -480,10760,-440,10880 -** Processing line: ~ -480,11020,-440,10880~ + [255, 0, 0] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -480,11020,-440,10880 -** Processing line: ~ -480,11160,-260,11240~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -480,11160,-260,11240 -** Processing line: ~ -480,11020,-480,11160~ + +** Processing line: ~ # A Green~ - Inside source: true *** True Line Result - -480,11020,-480,11160 -** Processing line: ~ -600,11420,-380,11320~ + # A Green +** Processing line: ~ def hill_color~ - Inside source: true *** True Line Result - -600,11420,-380,11320 -** Processing line: ~ -380,11320,-200,11340~ + def hill_color +** Processing line: ~ [139, 173, 132]~ - Inside source: true *** True Line Result - -380,11320,-200,11340 -** Processing line: ~ -200,11340,0,11340~ + [139, 173, 132] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -200,11340,0,11340 -** Processing line: ~ 0,11340,180,11340~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 0,11340,180,11340 -** Processing line: ~ 960,13420,960,13300~ + +** Processing line: ~ # Makes code more concise~ - Inside source: true *** True Line Result - 960,13420,960,13300 -** Processing line: ~ 960,13420,960,13520~ + # Makes code more concise +** Processing line: ~ def grid~ - Inside source: true *** True Line Result - 960,13420,960,13520 -** Processing line: ~ 960,13520,1000,13560~ + def grid +** Processing line: ~ state.grid~ - Inside source: true *** True Line Result - 960,13520,1000,13560 -** Processing line: ~ 1000,13560,1040,13540~ + state.grid +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1000,13560,1040,13540 -** Processing line: ~ 1040,13540,1200,13440~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1040,13540,1200,13440 -** Processing line: ~ 1200,13440,1380,13380~ + +** Processing line: ~ def breadth_first_search~ - Inside source: true *** True Line Result - 1200,13440,1380,13380 -** Processing line: ~ 1380,13380,1620,13300~ + def breadth_first_search +** Processing line: ~ state.breadth_first_search~ - Inside source: true *** True Line Result - 1380,13380,1620,13300 -** Processing line: ~ 1620,13300,1820,13220~ + state.breadth_first_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1620,13300,1820,13220 -** Processing line: ~ 1820,13220,2000,13200~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1820,13220,2000,13200 -** Processing line: ~ 2000,13200,2240,13200~ + +** Processing line: ~ def dijkstra_search~ - Inside source: true *** True Line Result - 2000,13200,2240,13200 -** Processing line: ~ 2240,13200,2440,13160~ + def dijkstra_search +** Processing line: ~ state.dijkstra_search~ - Inside source: true *** True Line Result - 2240,13200,2440,13160 -** Processing line: ~ 2440,13160,2640,13040~ + state.dijkstra_search +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2440,13160,2640,13040 -** Processing line: ~ -480,10760,-440,10620~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -480,10760,-440,10620 -** Processing line: ~ -440,10620,-360,10560~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -440,10620,-360,10560 -** Processing line: ~ -380,10460,-360,10560~ + +** Processing line: ~ # Method that is called by DragonRuby periodically~ - Inside source: true *** True Line Result - -380,10460,-360,10560 -** Processing line: ~ -380,10460,-360,10300~ + # Method that is called by DragonRuby periodically +** Processing line: ~ # Used for updating animations and calculations~ - Inside source: true *** True Line Result - -380,10460,-360,10300 -** Processing line: ~ -380,10140,-360,10300~ + # Used for updating animations and calculations +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - -380,10140,-360,10300 -** Processing line: ~ -380,10140,-380,10040~ + def tick args +** Processing line: ~~ - Inside source: true *** True Line Result - -380,10140,-380,10040 -** Processing line: ~ -380,9880,-380,10040~ + +** Processing line: ~ # Pressing r will reset the application~ - Inside source: true *** True Line Result - -380,9880,-380,10040 -** Processing line: ~ -380,9720,-380,9880~ + # Pressing r will reset the application +** Processing line: ~ if args.inputs.keyboard.key_down.r~ - Inside source: true *** True Line Result - -380,9720,-380,9880 -** Processing line: ~ -380,9720,-380,9540~ + if args.inputs.keyboard.key_down.r +** Processing line: ~ args.gtk.reset~ - Inside source: true *** True Line Result - -380,9720,-380,9540 -** Processing line: ~ -380,9360,-380,9540~ + args.gtk.reset +** Processing line: ~ reset~ - Inside source: true *** True Line Result - -380,9360,-380,9540 -** Processing line: ~ -380,9180,-380,9360~ + reset +** Processing line: ~ return~ - Inside source: true *** True Line Result - -380,9180,-380,9360 -** Processing line: ~ -380,9180,-380,9000~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - -380,9180,-380,9000 -** Processing line: ~ -380,8840,-380,9000~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -380,8840,-380,9000 -** Processing line: ~ -380,8840,-380,8760~ + +** Processing line: ~ # Every tick, new args are passed, and the Dijkstra tick method is called~ - Inside source: true *** True Line Result - -380,8840,-380,8760 -** Processing line: ~ -380,8760,-380,8620~ + # Every tick, new args are passed, and the Dijkstra tick method is called +** Processing line: ~ $movement_costs ||= Movement_Costs.new(args)~ - Inside source: true *** True Line Result - -380,8760,-380,8620 -** Processing line: ~ -380,8620,-380,8520~ + $movement_costs ||= Movement_Costs.new(args) +** Processing line: ~ $movement_costs.args = args~ - Inside source: true *** True Line Result - -380,8620,-380,8520 -** Processing line: ~ -380,8520,-360,8400~ + $movement_costs.args = args +** Processing line: ~ $movement_costs.tick~ - Inside source: true *** True Line Result - -380,8520,-360,8400 -** Processing line: ~ -360,8400,-100,8400~ + $movement_costs.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - -360,8400,-100,8400 -** Processing line: ~ -100,8400,-60,8420~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -100,8400,-60,8420 -** Processing line: ~ -60,8420,240,8440~ + +** Processing line: ~~ - Inside source: true *** True Line Result - -60,8420,240,8440 -** Processing line: ~ 240,8440,240,8380~ + +** Processing line: ~ def reset~ - Inside source: true *** True Line Result - 240,8440,240,8380 -** Processing line: ~ 240,8380,500,8440~ + def reset +** Processing line: ~ $movement_costs = nil~ - Inside source: true *** True Line Result - 240,8380,500,8440 -** Processing line: ~ 500,8440,760,8460~ + $movement_costs = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - 500,8440,760,8460 -** Processing line: ~ 760,8460,1000,8400~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 760,8460,1000,8400 -** Processing line: ~ 1000,8400,1180,8420~ + +** 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: ~*** Path Finding Algorithms - Heuristic - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Path Finding Algorithms - Heuristic - 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/13_path_finding_algorithms/06_heuristic/app/main.rb~ - Inside source: true *** True Line Result - 1000,8400,1180,8420 -** Processing line: ~ 1180,8420,1420,8400~ + # ./samples/13_path_finding_algorithms/06_heuristic/app/main.rb +** Processing line: ~ # This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ - Inside source: true *** True Line Result - 1180,8420,1420,8400 -** Processing line: ~ 1940,8460,2140,8420~ + # This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html +** Processing line: ~~ - Inside source: true *** True Line Result - 1940,8460,2140,8420 -** Processing line: ~ 2140,8420,2200,8520~ + +** Processing line: ~ # This time the heuristic search still explored less of the grid, hence finishing faster.~ - Inside source: true *** True Line Result - 2140,8420,2200,8520 -** Processing line: ~ 2200,8680,2200,8520~ + # This time the heuristic search still explored less of the grid, hence finishing faster. +** Processing line: ~ # However, it did not find the shortest path between the star and the target.~ - Inside source: true *** True Line Result - 2200,8680,2200,8520 -** Processing line: ~ 2140,8840,2200,8680~ + # However, it did not find the shortest path between the star and the target. +** Processing line: ~~ - Inside source: true *** True Line Result - 2140,8840,2200,8680 -** Processing line: ~ 2140,8840,2140,9020~ + +** Processing line: ~ # The only difference between this app and Heuristic is the change of the starting position.~ - Inside source: true *** True Line Result - 2140,8840,2140,9020 -** Processing line: ~ 2140,9100,2140,9020~ + # The only difference between this app and Heuristic is the change of the starting position. +** Processing line: ~~ - Inside source: true *** True Line Result - 2140,9100,2140,9020 -** Processing line: ~ 2140,9200,2140,9100~ + +** Processing line: ~ class Heuristic_With_Walls~ - Inside source: true *** True Line Result - 2140,9200,2140,9100 -** Processing line: ~ 2140,9200,2200,9320~ + class Heuristic_With_Walls +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - 2140,9200,2200,9320 -** Processing line: ~ 2200,9320,2200,9440~ + attr_gtk +** Processing line: ~~ - Inside source: true *** True Line Result - 2200,9320,2200,9440 -** Processing line: ~ 2140,9560,2200,9440~ + +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - 2140,9560,2200,9440 -** Processing line: ~ 1880,10300,2200,10280~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - 1880,10300,2200,10280 -** Processing line: ~ 2200,10280,2480,10260~ + defaults +** Processing line: ~ render~ - Inside source: true *** True Line Result - 2200,10280,2480,10260 -** Processing line: ~ 2480,10260,2700,10240~ + render +** Processing line: ~ input~ - Inside source: true *** True Line Result - 2480,10260,2700,10240 -** Processing line: ~ 2700,10240,2840,10180~ + input +** Processing line: ~ # If animation is playing, and max steps have not been reached~ - Inside source: true *** True Line Result - 2700,10240,2840,10180 -** Processing line: ~ 2840,10180,2900,10060~ + # If animation is playing, and max steps have not been reached +** Processing line: ~ # Move the search a step forward~ - Inside source: true *** True Line Result - 2840,10180,2900,10060 -** Processing line: ~ 2900,9860,2900,10060~ + # Move the search a step forward +** Processing line: ~ if state.play && state.current_step < state.max_steps~ - Inside source: true *** True Line Result - 2900,9860,2900,10060 -** Processing line: ~ 2900,9640,2900,9860~ + if state.play && state.current_step < state.max_steps +** Processing line: ~ # Variable that tells the program what step to recalculate up to~ - Inside source: true *** True Line Result - 2900,9640,2900,9860 -** Processing line: ~ 2900,9640,2900,9500~ + # Variable that tells the program what step to recalculate up to +** Processing line: ~ state.current_step += 1~ - Inside source: true *** True Line Result - 2900,9640,2900,9500 -** Processing line: ~ 2900,9460,2900,9500~ + state.current_step += 1 +** Processing line: ~ move_searches_one_step_forward~ - Inside source: true *** True Line Result - 2900,9460,2900,9500 -** Processing line: ~ 2740,9460,2900,9460~ + move_searches_one_step_forward +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2740,9460,2900,9460 -** Processing line: ~ 2700,9460,2740,9460~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2700,9460,2740,9460 -** Processing line: ~ 2700,9360,2700,9460~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2700,9360,2700,9460 -** Processing line: ~ 2700,9320,2700,9360~ + +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - 2700,9320,2700,9360 -** Processing line: ~ 2600,9320,2700,9320~ + def defaults +** Processing line: ~ # Variables to edit the size and appearance of the grid~ - Inside source: true *** True Line Result - 2600,9320,2700,9320 -** Processing line: ~ 2600,9260,2600,9320~ + # Variables to edit the size and appearance of the grid +** Processing line: ~ # Freely customizable to user's liking~ - Inside source: true *** True Line Result - 2600,9260,2600,9320 -** Processing line: ~ 2600,9200,2600,9260~ + # Freely customizable to user's liking +** Processing line: ~ grid.width ||= 15~ - Inside source: true *** True Line Result - 2600,9200,2600,9260 -** Processing line: ~ 2480,9120,2600,9200~ + grid.width ||= 15 +** Processing line: ~ grid.height ||= 15~ - Inside source: true *** True Line Result - 2480,9120,2600,9200 -** Processing line: ~ 2440,9080,2480,9120~ + grid.height ||= 15 +** Processing line: ~ grid.cell_size ||= 40~ - Inside source: true *** True Line Result - 2440,9080,2480,9120 -** Processing line: ~ 2380,9080,2440,9080~ + grid.cell_size ||= 40 +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ - Inside source: true *** True Line Result - 2380,9080,2440,9080 -** Processing line: ~ 2320,9060,2380,9080~ + grid.rect ||= [0, 0, grid.width, grid.height] +** Processing line: ~~ - Inside source: true *** True Line Result - 2320,9060,2380,9080 -** Processing line: ~ 2320,8860,2320,9060~ + +** Processing line: ~ grid.star ||= [0, 2]~ - Inside source: true *** True Line Result - 2320,8860,2320,9060 -** Processing line: ~ 2320,8860,2380,8840~ + grid.star ||= [0, 2] +** Processing line: ~ grid.target ||= [14, 12]~ - Inside source: true *** True Line Result - 2320,8860,2380,8840 -** Processing line: ~ 2380,8840,2480,8860~ + grid.target ||= [14, 12] +** Processing line: ~ grid.walls ||= {}~ - Inside source: true *** True Line Result - 2380,8840,2480,8860 -** Processing line: ~ 2480,8860,2600,8840~ + grid.walls ||= {} +** Processing line: ~ # There are no hills in the Heuristic Search Demo~ - Inside source: true *** True Line Result - 2480,8860,2600,8840 -** Processing line: ~ 2600,8840,2740,8840~ + # There are no hills in the Heuristic Search Demo +** Processing line: ~~ - Inside source: true *** True Line Result - 2600,8840,2740,8840 -** Processing line: ~ 2740,8840,2840,8800~ + +** Processing line: ~ # What the user is currently editing on the grid~ - Inside source: true *** True Line Result - 2740,8840,2840,8800 -** Processing line: ~ 2840,8800,2900,8700~ + # What the user is currently editing on the grid +** Processing line: ~ # We store this value, because we want to remember the value even when~ - Inside source: true *** True Line Result - 2840,8800,2900,8700 -** Processing line: ~ 2900,8600,2900,8700~ + # We store this value, because we want to remember the value even when +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ - Inside source: true *** True Line Result - 2900,8600,2900,8700 -** Processing line: ~ 2900,8480,2900,8600~ + # the user's cursor is no longer over what they're interacting with, but +** Processing line: ~ # they are still clicking down on the mouse.~ - Inside source: true *** True Line Result - 2900,8480,2900,8600 -** Processing line: ~ 2900,8380,2900,8480~ + # they are still clicking down on the mouse. +** Processing line: ~ state.user_input ||= :none~ - Inside source: true *** True Line Result - 2900,8380,2900,8480 -** Processing line: ~ 2900,8380,2900,8260~ + state.user_input ||= :none +** Processing line: ~~ - Inside source: true *** True Line Result - 2900,8380,2900,8260 -** Processing line: ~ 2900,8260,2900,8140~ + +** Processing line: ~ # These variables allow the breadth first search to take place~ - Inside source: true *** True Line Result - 2900,8260,2900,8140 -** Processing line: ~ 2900,8140,2900,8020~ + # These variables allow the breadth first search to take place +** Processing line: ~ # 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.~ - Inside source: true *** True Line Result - 2900,8140,2900,8020 -** Processing line: ~ 2900,8020,2900,7900~ + # 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. +** Processing line: ~ # Used to prevent searching cells that have already been found~ - Inside source: true *** True Line Result - 2900,8020,2900,7900 -** Processing line: ~ 2900,7820,2900,7900~ + # Used to prevent searching cells that have already been found +** Processing line: ~ # and to trace a path from the target back to the starting point.~ - Inside source: true *** True Line Result - 2900,7820,2900,7900 -** Processing line: ~ 2900,7820,2900,7740~ + # and to trace a path from the target back to the starting point. +** Processing line: ~ # Frontier is an array of cells to expand the search from.~ - Inside source: true *** True Line Result - 2900,7820,2900,7740 -** Processing line: ~ 2900,7660,2900,7740~ + # Frontier is an array of cells to expand the search from. +** Processing line: ~ # The search is over when there are no more cells to search from.~ - Inside source: true *** True Line Result - 2900,7660,2900,7740 -** Processing line: ~ 2900,7560,2900,7660~ + # The search is over when there are no more cells to search from. +** Processing line: ~ # Path stores the path from the target to the star, once the target has been found~ - Inside source: true *** True Line Result - 2900,7560,2900,7660 -** Processing line: ~ 2900,7460,2900,7560~ + # Path stores the path from the target to the star, once the target has been found +** Processing line: ~ # It prevents calculating the path every tick.~ - Inside source: true *** True Line Result - 2900,7460,2900,7560 -** Processing line: ~ 2900,7460,2900,7360~ + # It prevents calculating the path every tick. +** Processing line: ~ bfs.came_from ||= {}~ - Inside source: true *** True Line Result - 2900,7460,2900,7360 -** Processing line: ~ 2900,7260,2900,7360~ + bfs.came_from ||= {} +** Processing line: ~ bfs.frontier ||= []~ - Inside source: true *** True Line Result - 2900,7260,2900,7360 -** Processing line: ~ 2840,7160,2900,7260~ + bfs.frontier ||= [] +** Processing line: ~ bfs.path ||= []~ - Inside source: true *** True Line Result - 2840,7160,2900,7260 -** Processing line: ~ 2800,7080,2840,7160~ + bfs.path ||= [] +** Processing line: ~~ - Inside source: true *** True Line Result - 2800,7080,2840,7160 -** Processing line: ~ 2700,7100,2800,7080~ + +** Processing line: ~ heuristic.came_from ||= {}~ - Inside source: true *** True Line Result - 2700,7100,2800,7080 -** Processing line: ~ 2560,7120,2700,7100~ + heuristic.came_from ||= {} +** Processing line: ~ heuristic.frontier ||= []~ - Inside source: true *** True Line Result - 2560,7120,2700,7100 -** Processing line: ~ 2400,7100,2560,7120~ + heuristic.frontier ||= [] +** Processing line: ~ heuristic.path ||= []~ - Inside source: true *** True Line Result - 2400,7100,2560,7120 -** Processing line: ~ 2320,7100,2400,7100~ + heuristic.path ||= [] +** Processing line: ~~ - Inside source: true *** True Line Result - 2320,7100,2400,7100 -** Processing line: ~ 2140,7100,2320,7100~ + +** Processing line: ~ # Stores which step of the animation is being rendered~ - Inside source: true *** True Line Result - 2140,7100,2320,7100 -** Processing line: ~ 2040,7080,2140,7100~ + # Stores which step of the animation is being rendered +** Processing line: ~ # When the user moves the star or messes with the walls,~ - Inside source: true *** True Line Result - 2040,7080,2140,7100 -** Processing line: ~ 1940,7080,2040,7080~ + # When the user moves the star or messes with the walls, +** Processing line: ~ # the searches are recalculated up to this step~ - Inside source: true *** True Line Result - 1940,7080,2040,7080 -** Processing line: ~ 1820,7140,1940,7080~ + # the searches are recalculated up to this step +** Processing line: ~~ - Inside source: true *** True Line Result - 1820,7140,1940,7080 -** Processing line: ~ 1680,7140,1820,7140~ + +** Processing line: ~ # Unless the current step has a value~ - Inside source: true *** True Line Result - 1680,7140,1820,7140 -** Processing line: ~ 1540,7140,1680,7140~ + # Unless the current step has a value +** Processing line: ~ unless state.current_step~ - Inside source: true *** True Line Result - 1540,7140,1680,7140 -** Processing line: ~ 1420,7220,1540,7140~ + unless state.current_step +** Processing line: ~ # Set the current step to 10~ - Inside source: true *** True Line Result - 1420,7220,1540,7140 -** Processing line: ~ 1280,7220,1380,7220~ + # Set the current step to 10 +** Processing line: ~ state.current_step = 10~ - Inside source: true *** True Line Result - 1280,7220,1380,7220 -** Processing line: ~ 1140,7200,1280,7220~ + state.current_step = 10 +** Processing line: ~ # And calculate the searches up to step 10~ - Inside source: true *** True Line Result - 1140,7200,1280,7220 -** Processing line: ~ 1000,7220,1140,7200~ + # And calculate the searches up to step 10 +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 1000,7220,1140,7200 -** Processing line: ~ 760,7280,900,7320~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 760,7280,900,7320 -** Processing line: ~ 540,7220,760,7280~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 540,7220,760,7280 -** Processing line: ~ 300,7180,540,7220~ + +** Processing line: ~ # At some step the animation will end,~ - Inside source: true *** True Line Result - 300,7180,540,7220 -** Processing line: ~ 180,7120,180,7160~ + # At some step the animation will end, +** Processing line: ~ # and further steps won't change anything (the whole grid will be explored)~ - Inside source: true *** True Line Result - 180,7120,180,7160 -** Processing line: ~ 40,7140,180,7120~ + # and further steps won't change anything (the whole grid will be explored) +** Processing line: ~ # This step is roughly the grid's width * height~ - Inside source: true *** True Line Result - 40,7140,180,7120 -** Processing line: ~ -60,7160,40,7140~ + # This step is roughly the grid's width * height +** Processing line: ~ # When anim_steps equals max_steps no more calculations will occur~ - Inside source: true *** True Line Result - -60,7160,40,7140 -** Processing line: ~ -200,7120,-60,7160~ + # When anim_steps equals max_steps no more calculations will occur +** Processing line: ~ # and the slider will be at the end~ - Inside source: true *** True Line Result - -200,7120,-60,7160 -** Processing line: ~ 180,7160,300,7180~ + # and the slider will be at the end +** Processing line: ~ state.max_steps = grid.width * grid.height~ - Inside source: true *** True Line Result - 180,7160,300,7180 -** Processing line: ~ -260,7060,-200,7120~ + state.max_steps = grid.width * grid.height +** Processing line: ~~ - Inside source: true *** True Line Result - -260,7060,-200,7120 -** Processing line: ~ -260,6980,-260,7060~ + +** Processing line: ~ # Whether the animation should play or not~ - Inside source: true *** True Line Result - -260,6980,-260,7060 -** Processing line: ~ -260,6880,-260,6980~ + # Whether the animation should play or not +** Processing line: ~ # If true, every tick moves anim_steps forward one~ - Inside source: true *** True Line Result - -260,6880,-260,6980 -** Processing line: ~ -260,6880,-260,6820~ + # If true, every tick moves anim_steps forward one +** Processing line: ~ # Pressing the stepwise animation buttons will pause the animation~ - Inside source: true *** True Line Result - -260,6880,-260,6820 -** Processing line: ~ -260,6820,-200,6760~ + # Pressing the stepwise animation buttons will pause the animation +** Processing line: ~ # An if statement instead of the ||= operator is used for assigning a boolean value.~ - Inside source: true *** True Line Result - -260,6820,-200,6760 -** Processing line: ~ -200,6760,-100,6740~ + # An if statement instead of the ||= operator is used for assigning a boolean value. +** Processing line: ~ # The || operator does not differentiate between nil and false.~ - Inside source: true *** True Line Result - -200,6760,-100,6740 -** Processing line: ~ -100,6740,-60,6740~ + # The || operator does not differentiate between nil and false. +** Processing line: ~ if state.play == nil~ - Inside source: true *** True Line Result - -100,6740,-60,6740 -** Processing line: ~ -60,6740,40,6740~ + if state.play == nil +** Processing line: ~ state.play = false~ - Inside source: true *** True Line Result - -60,6740,40,6740 -** Processing line: ~ 40,6740,300,6800~ + state.play = false +** Processing line: ~ end~ - Inside source: true *** True Line Result - 40,6740,300,6800 -** Processing line: ~ 300,6800,420,6760~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 300,6800,420,6760 -** Processing line: ~ 420,6760,500,6740~ + +** Processing line: ~ # Store the rects of the buttons that control the animation~ - Inside source: true *** True Line Result - 420,6760,500,6740 -** Processing line: ~ 500,6740,540,6760~ + # Store the rects of the buttons that control the animation +** Processing line: ~ # They are here for user customization~ - Inside source: true *** True Line Result - 500,6740,540,6760 -** Processing line: ~ 540,6760,540,6760~ + # They are here for user customization +** Processing line: ~ # Editing these might require recentering the text inside them~ - Inside source: true *** True Line Result - 540,6760,540,6760 -** Processing line: ~ 540,6760,640,6780~ + # Editing these might require recentering the text inside them +** Processing line: ~ # Those values can be found in the render_button methods~ - Inside source: true *** True Line Result - 540,6760,640,6780 -** Processing line: ~ 640,6660,640,6780~ + # Those values can be found in the render_button methods +** Processing line: ~ buttons.left = [470, 600, 50, 50]~ - Inside source: true *** True Line Result - 640,6660,640,6780 -** Processing line: ~ 580,6580,640,6660~ + buttons.left = [470, 600, 50, 50] +** Processing line: ~ buttons.center = [520, 600, 200, 50]~ - Inside source: true *** True Line Result - 580,6580,640,6660 -** Processing line: ~ 580,6440,580,6580~ + buttons.center = [520, 600, 200, 50] +** Processing line: ~ buttons.right = [720, 600, 50, 50]~ - Inside source: true *** True Line Result - 580,6440,580,6580 -** Processing line: ~ 580,6440,640,6320~ + buttons.right = [720, 600, 50, 50] +** Processing line: ~~ - Inside source: true *** True Line Result - 580,6440,640,6320 -** Processing line: ~ 640,6320,640,6180~ + +** Processing line: ~ # The variables below are related to the slider~ - Inside source: true *** True Line Result - 640,6320,640,6180 -** Processing line: ~ 580,6080,640,6180~ + # The variables below are related to the slider +** Processing line: ~ # They allow the user to customize them~ - Inside source: true *** True Line Result - 580,6080,640,6180 -** Processing line: ~ 580,6080,640,5960~ + # They allow the user to customize them +** Processing line: ~ # They also give a central location for the render and input methods to get~ - Inside source: true *** True Line Result - 580,6080,640,5960 -** Processing line: ~ 640,5960,640,5840~ + # They also give a central location for the render and input methods to get +** Processing line: ~ # information from~ - Inside source: true *** True Line Result - 640,5960,640,5840 -** Processing line: ~ 640,5840,640,5700~ + # information from +** Processing line: ~ # x & y are the coordinates of the leftmost part of the slider line~ - Inside source: true *** True Line Result - 640,5840,640,5700 -** Processing line: ~ 640,5700,660,5560~ + # x & y are the coordinates of the leftmost part of the slider line +** Processing line: ~ slider.x = 440~ - Inside source: true *** True Line Result - 640,5700,660,5560 -** Processing line: ~ 660,5560,660,5440~ + slider.x = 440 +** Processing line: ~ slider.y = 675~ - Inside source: true *** True Line Result - 660,5560,660,5440 -** Processing line: ~ 660,5440,660,5300~ + slider.y = 675 +** Processing line: ~ # This is the width of the line~ - Inside source: true *** True Line Result - 660,5440,660,5300 -** Processing line: ~ 660,5140,660,5300~ + # This is the width of the line +** Processing line: ~ slider.w = 360~ - Inside source: true *** True Line Result - 660,5140,660,5300 -** Processing line: ~ 660,5140,660,5000~ + slider.w = 360 +** Processing line: ~ # This is the offset for the circle~ - Inside source: true *** True Line Result - 660,5140,660,5000 -** Processing line: ~ 660,5000,660,4880~ + # This is the offset for the circle +** Processing line: ~ # Allows the center of the circle to be on the line,~ - Inside source: true *** True Line Result - 660,5000,660,4880 -** Processing line: ~ 660,4880,820,4860~ + # Allows the center of the circle to be on the line, +** Processing line: ~ # as opposed to the upper right corner~ - Inside source: true *** True Line Result - 660,4880,820,4860 -** Processing line: ~ 820,4860,1000,4840~ + # as opposed to the upper right corner +** Processing line: ~ slider.offset = 20~ - Inside source: true *** True Line Result - 820,4860,1000,4840 -** Processing line: ~ 1000,4840,1100,4860~ + slider.offset = 20 +** Processing line: ~ # This is the spacing between each of the notches on the slider~ - Inside source: true *** True Line Result - 1000,4840,1100,4860 -** Processing line: ~ 1100,4860,1280,4860~ + # This is the spacing between each of the notches on the slider +** Processing line: ~ # Notches are places where the circle can rest on the slider line~ - Inside source: true *** True Line Result - 1100,4860,1280,4860 -** Processing line: ~ 1280,4860,1420,4840~ + # Notches are places where the circle can rest on the slider line +** Processing line: ~ # There needs to be a notch for each step before the maximum number of steps~ - Inside source: true *** True Line Result - 1280,4860,1420,4840 -** Processing line: ~ 1420,4840,1580,4860~ + # There needs to be a notch for each step before the maximum number of steps +** Processing line: ~ slider.spacing = slider.w.to_f / state.max_steps.to_f~ - Inside source: true *** True Line Result - 1420,4840,1580,4860 -** Processing line: ~ 1580,4860,1720,4820~ + slider.spacing = slider.w.to_f / state.max_steps.to_f +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1580,4860,1720,4820 -** Processing line: ~ 1720,4820,1880,4860~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1720,4820,1880,4860 -** Processing line: ~ 1880,4860,2000,4840~ + +** Processing line: ~ # All methods with render draw stuff on the screen~ - Inside source: true *** True Line Result - 1880,4860,2000,4840 -** Processing line: ~ 2000,4840,2140,4840~ + # All methods with render draw stuff on the screen +** Processing line: ~ # UI has buttons, the slider, and labels~ - Inside source: true *** True Line Result - 2000,4840,2140,4840 -** Processing line: ~ 2140,4840,2320,4860~ + # UI has buttons, the slider, and labels +** Processing line: ~ # The search specific rendering occurs in the respective methods~ - Inside source: true *** True Line Result - 2140,4840,2320,4860 -** Processing line: ~ 2320,4860,2440,4880~ + # The search specific rendering occurs in the respective methods +** Processing line: ~ def render~ - Inside source: true *** True Line Result - 2320,4860,2440,4880 -** Processing line: ~ 2440,4880,2600,4880~ + def render +** Processing line: ~ render_ui~ - Inside source: true *** True Line Result - 2440,4880,2600,4880 -** Processing line: ~ 2600,4880,2800,4880~ + render_ui +** Processing line: ~ render_bfs~ - Inside source: true *** True Line Result - 2600,4880,2800,4880 -** Processing line: ~ 2800,4880,2900,4880~ + render_bfs +** Processing line: ~ render_heuristic~ - Inside source: true *** True Line Result - 2800,4880,2900,4880 -** Processing line: ~ 2900,4880,2900,4820~ + render_heuristic +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2900,4880,2900,4820 -** Processing line: ~ 2900,4740,2900,4820~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2900,4740,2900,4820 -** Processing line: ~ 2800,4700,2900,4740~ + +** Processing line: ~ def render_ui~ - Inside source: true *** True Line Result - 2800,4700,2900,4740 -** Processing line: ~ 2520,4680,2800,4700~ + def render_ui +** Processing line: ~ render_buttons~ - Inside source: true *** True Line Result - 2520,4680,2800,4700 -** Processing line: ~ 2240,4660,2520,4680~ + render_buttons +** Processing line: ~ render_slider~ - Inside source: true *** True Line Result - 2240,4660,2520,4680 -** Processing line: ~ 1940,4620,2240,4660~ + render_slider +** Processing line: ~ render_labels~ - Inside source: true *** True Line Result - 1940,4620,2240,4660 -** Processing line: ~ 1820,4580,1940,4620~ + render_labels +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1820,4580,1940,4620 -** Processing line: ~ 1820,4500,1820,4580~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1820,4500,1820,4580 -** Processing line: ~ 1820,4500,1880,4420~ + +** Processing line: ~ def render_buttons~ - Inside source: true *** True Line Result - 1820,4500,1880,4420 -** Processing line: ~ 1880,4420,2000,4420~ + def render_buttons +** Processing line: ~ render_left_button~ - Inside source: true *** True Line Result - 1880,4420,2000,4420 -** Processing line: ~ 2000,4420,2200,4420~ + render_left_button +** Processing line: ~ render_center_button~ - Inside source: true *** True Line Result - 2000,4420,2200,4420 -** Processing line: ~ 2200,4420,2400,4440~ + render_center_button +** Processing line: ~ render_right_button~ - Inside source: true *** True Line Result - 2200,4420,2400,4440 -** Processing line: ~ 2400,4440,2600,4440~ + render_right_button +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2400,4440,2600,4440 -** Processing line: ~ 2600,4440,2840,4440~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2600,4440,2840,4440 -** Processing line: ~ 2840,4440,2900,4400~ + +** Processing line: ~ def render_bfs~ - Inside source: true *** True Line Result - 2840,4440,2900,4400 -** Processing line: ~ 2740,4260,2900,4280~ + def render_bfs +** Processing line: ~ render_bfs_grid~ - Inside source: true *** True Line Result - 2740,4260,2900,4280 -** Processing line: ~ 2600,4240,2740,4260~ + render_bfs_grid +** Processing line: ~ render_bfs_star~ - Inside source: true *** True Line Result - 2600,4240,2740,4260 -** Processing line: ~ 2480,4280,2600,4240~ + render_bfs_star +** Processing line: ~ render_bfs_target~ - Inside source: true *** True Line Result - 2480,4280,2600,4240 -** Processing line: ~ 2320,4240,2480,4280~ + render_bfs_target +** Processing line: ~ render_bfs_visited~ - Inside source: true *** True Line Result - 2320,4240,2480,4280 -** Processing line: ~ 2140,4220,2320,4240~ + render_bfs_visited +** Processing line: ~ render_bfs_walls~ - Inside source: true *** True Line Result - 2140,4220,2320,4240 -** Processing line: ~ 1940,4220,2140,4220~ + render_bfs_walls +** Processing line: ~ render_bfs_frontier~ - Inside source: true *** True Line Result - 1940,4220,2140,4220 -** Processing line: ~ 1880,4160,1940,4220~ + render_bfs_frontier +** Processing line: ~ render_bfs_path~ - Inside source: true *** True Line Result - 1880,4160,1940,4220 -** Processing line: ~ 1880,4160,1880,4080~ + render_bfs_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1880,4160,1880,4080 -** Processing line: ~ 1880,4080,2040,4040~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1880,4080,2040,4040 -** Processing line: ~ 2040,4040,2240,4060~ + +** Processing line: ~ def render_heuristic~ - Inside source: true *** True Line Result - 2040,4040,2240,4060 -** Processing line: ~ 2240,4060,2400,4040~ + def render_heuristic +** Processing line: ~ render_heuristic_grid~ - Inside source: true *** True Line Result - 2240,4060,2400,4040 -** Processing line: ~ 2400,4040,2600,4060~ + render_heuristic_grid +** Processing line: ~ render_heuristic_star~ - Inside source: true *** True Line Result - 2400,4040,2600,4060 -** Processing line: ~ 2600,4060,2740,4020~ + render_heuristic_star +** Processing line: ~ render_heuristic_target~ - Inside source: true *** True Line Result - 2600,4060,2740,4020 -** Processing line: ~ 2740,4020,2840,3940~ + render_heuristic_target +** Processing line: ~ render_heuristic_visited~ - Inside source: true *** True Line Result - 2740,4020,2840,3940 -** Processing line: ~ 2840,3780,2840,3940~ + render_heuristic_visited +** Processing line: ~ render_heuristic_walls~ - Inside source: true *** True Line Result - 2840,3780,2840,3940 -** Processing line: ~ 2740,3660,2840,3780~ + render_heuristic_walls +** Processing line: ~ render_heuristic_frontier~ - Inside source: true *** True Line Result - 2740,3660,2840,3780 -** Processing line: ~ 2700,3680,2740,3660~ + render_heuristic_frontier +** Processing line: ~ render_heuristic_path~ - Inside source: true *** True Line Result - 2700,3680,2740,3660 -** Processing line: ~ 2520,3700,2700,3680~ + render_heuristic_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2520,3700,2700,3680 -** Processing line: ~ 2380,3700,2520,3700~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2380,3700,2520,3700 -** Processing line: ~ 2200,3720,2380,3700~ + +** Processing line: ~ # This method handles user input every tick~ - Inside source: true *** True Line Result - 2200,3720,2380,3700 -** Processing line: ~ 2040,3720,2200,3720~ + # This method handles user input every tick +** Processing line: ~ def input~ - Inside source: true *** True Line Result - 2040,3720,2200,3720 -** Processing line: ~ 1880,3700,2040,3720~ + def input +** Processing line: ~ # Check and handle button input~ - Inside source: true *** True Line Result - 1880,3700,2040,3720 -** Processing line: ~ 1820,3680,1880,3700~ + # Check and handle button input +** Processing line: ~ input_buttons~ - Inside source: true *** True Line Result - 1820,3680,1880,3700 -** Processing line: ~ 1760,3600,1820,3680~ + input_buttons +** Processing line: ~~ - Inside source: true *** True Line Result - 1760,3600,1820,3680 -** Processing line: ~ 1760,3600,1820,3480~ + +** Processing line: ~ # If the mouse was lifted this tick~ - Inside source: true *** True Line Result - 1760,3600,1820,3480 -** Processing line: ~ 1820,3480,1880,3440~ + # If the mouse was lifted this tick +** Processing line: ~ if inputs.mouse.up~ - Inside source: true *** True Line Result - 1820,3480,1880,3440 -** Processing line: ~ 1880,3440,1960,3460~ + if inputs.mouse.up +** Processing line: ~ # Set current input to none~ - Inside source: true *** True Line Result - 1880,3440,1960,3460 -** Processing line: ~ 1960,3460,2140,3460~ + # Set current input to none +** Processing line: ~ state.user_input = :none~ - Inside source: true *** True Line Result - 1960,3460,2140,3460 -** Processing line: ~ 2140,3460,2380,3460~ + state.user_input = :none +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2140,3460,2380,3460 -** Processing line: ~ 2380,3460,2640,3440~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2380,3460,2640,3440 -** Processing line: ~ 2640,3440,2900,3380~ + +** Processing line: ~ # If the mouse was clicked this tick~ - Inside source: true *** True Line Result - 2640,3440,2900,3380 -** Processing line: ~ 2840,3280,2900,3380~ + # If the mouse was clicked this tick +** Processing line: ~ if inputs.mouse.down~ - Inside source: true *** True Line Result - 2840,3280,2900,3380 -** Processing line: ~ 2840,3280,2900,3200~ + if inputs.mouse.down +** Processing line: ~ # Determine what the user is editing and appropriately edit the state.user_input variable~ - Inside source: true *** True Line Result - 2840,3280,2900,3200 -** Processing line: ~ 2900,3200,2900,3140~ + # Determine what the user is editing and appropriately edit the state.user_input variable +** Processing line: ~ determine_input~ - Inside source: true *** True Line Result - 2900,3200,2900,3140 -** Processing line: ~ 2840,3020,2900,3140~ + determine_input +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2840,3020,2900,3140 -** Processing line: ~ 2800,2960,2840,3020~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2800,2960,2840,3020 -** Processing line: ~ 2700,3000,2800,2960~ + +** Processing line: ~ # Process user input based on user_input variable and current mouse position~ - Inside source: true *** True Line Result - 2700,3000,2800,2960 -** Processing line: ~ 2600,2980,2700,3000~ + # Process user input based on user_input variable and current mouse position +** Processing line: ~ process_input~ - Inside source: true *** True Line Result - 2600,2980,2700,3000 -** Processing line: ~ 2380,3000,2600,2980~ + process_input +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2380,3000,2600,2980 -** Processing line: ~ 2140,3000,2380,3000~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2140,3000,2380,3000 -** Processing line: ~ 1880,3000,2140,3000~ + +** Processing line: ~ # Determines what the user is editing~ - Inside source: true *** True Line Result - 1880,3000,2140,3000 -** Processing line: ~ 1720,3040,1880,3000~ + # Determines what the user is editing +** Processing line: ~ # This method is called when the mouse is clicked down~ - Inside source: true *** True Line Result - 1720,3040,1880,3000 -** Processing line: ~ 1640,2960,1720,3040~ + # This method is called when the mouse is clicked down +** Processing line: ~ def determine_input~ - Inside source: true *** True Line Result - 1640,2960,1720,3040 -** Processing line: ~ 1500,2940,1640,2960~ + def determine_input +** Processing line: ~ if mouse_over_slider?~ - Inside source: true *** True Line Result - 1500,2940,1640,2960 -** Processing line: ~ 1340,3000,1500,2940~ + if mouse_over_slider? +** Processing line: ~ state.user_input = :slider~ - Inside source: true *** True Line Result - 1340,3000,1500,2940 -** Processing line: ~ 1240,3000,1340,3000~ + state.user_input = :slider +** Processing line: ~ # If the mouse is over the star in the first grid~ - Inside source: true *** True Line Result - 1240,3000,1340,3000 -** Processing line: ~ 1140,3020,1240,3000~ + # If the mouse is over the star in the first grid +** Processing line: ~ elsif bfs_mouse_over_star?~ - Inside source: true *** True Line Result - 1140,3020,1240,3000 -** Processing line: ~ 1040,3000,1140,3020~ + elsif bfs_mouse_over_star? +** Processing line: ~ # The user is editing the star from the first grid~ - Inside source: true *** True Line Result - 1040,3000,1140,3020 -** Processing line: ~ 960,2960,1040,3000~ + # The user is editing the star from the first grid +** Processing line: ~ state.user_input = :bfs_star~ - Inside source: true *** True Line Result - 960,2960,1040,3000 -** Processing line: ~ 900,2960,960,2960~ + state.user_input = :bfs_star +** Processing line: ~ # If the mouse is over the star in the second grid~ - Inside source: true *** True Line Result - 900,2960,960,2960 -** Processing line: ~ 840,2840,900,2960~ + # If the mouse is over the star in the second grid +** Processing line: ~ elsif heuristic_mouse_over_star?~ - Inside source: true *** True Line Result - 840,2840,900,2960 -** Processing line: ~ 700,2820,840,2840~ + elsif heuristic_mouse_over_star? +** Processing line: ~ # The user is editing the star from the second grid~ - Inside source: true *** True Line Result - 700,2820,840,2840 -** Processing line: ~ 540,2820,700,2820~ + # The user is editing the star from the second grid +** Processing line: ~ state.user_input = :heuristic_star~ - Inside source: true *** True Line Result - 540,2820,700,2820 -** Processing line: ~ 420,2820,540,2820~ + state.user_input = :heuristic_star +** Processing line: ~ # If the mouse is over the target in the first grid~ - Inside source: true *** True Line Result - 420,2820,540,2820 -** Processing line: ~ 180,2800,420,2820~ + # If the mouse is over the target in the first grid +** Processing line: ~ elsif bfs_mouse_over_target?~ - Inside source: true *** True Line Result - 180,2800,420,2820 -** Processing line: ~ 60,2780,180,2800~ + elsif bfs_mouse_over_target? +** Processing line: ~ # The user is editing the target from the first grid~ - Inside source: true *** True Line Result - 60,2780,180,2800 -** Processing line: ~ -60,2800,60,2780~ + # The user is editing the target from the first grid +** Processing line: ~ state.user_input = :bfs_target~ - Inside source: true *** True Line Result - -60,2800,60,2780 -** Processing line: ~ -160,2760,-60,2800~ + state.user_input = :bfs_target +** Processing line: ~ # If the mouse is over the target in the second grid~ - Inside source: true *** True Line Result - -160,2760,-60,2800 -** Processing line: ~ -260,2740,-160,2760~ + # If the mouse is over the target in the second grid +** Processing line: ~ elsif heuristic_mouse_over_target?~ - Inside source: true *** True Line Result - -260,2740,-160,2760 -** Processing line: ~ -300,2640,-260,2740~ + elsif heuristic_mouse_over_target? +** Processing line: ~ # The user is editing the target from the second grid~ - Inside source: true *** True Line Result - -300,2640,-260,2740 -** Processing line: ~ -360,2560,-300,2640~ + # The user is editing the target from the second grid +** Processing line: ~ state.user_input = :heuristic_target~ - Inside source: true *** True Line Result - -360,2560,-300,2640 -** Processing line: ~ -380,2460,-360,2560~ + state.user_input = :heuristic_target +** Processing line: ~ # If the mouse is over a wall in the first grid~ - Inside source: true *** True Line Result - -380,2460,-360,2560 -** Processing line: ~ -380,2460,-300,2380~ + # If the mouse is over a wall in the first grid +** Processing line: ~ elsif bfs_mouse_over_wall?~ - Inside source: true *** True Line Result - -380,2460,-300,2380 -** Processing line: ~ -300,2300,-300,2380~ + elsif bfs_mouse_over_wall? +** Processing line: ~ # The user is removing a wall from the first grid~ - Inside source: true *** True Line Result - -300,2300,-300,2380 -** Processing line: ~ -300,2300,-300,2220~ + # The user is removing a wall from the first grid +** Processing line: ~ state.user_input = :bfs_remove_wall~ - Inside source: true *** True Line Result - -300,2300,-300,2220 -** Processing line: ~ -300,2100,-300,2220~ + state.user_input = :bfs_remove_wall +** Processing line: ~ # If the mouse is over a wall in the second grid~ - Inside source: true *** True Line Result - -300,2100,-300,2220 -** Processing line: ~ -300,2100,-300,2040~ + # If the mouse is over a wall in the second grid +** Processing line: ~ elsif heuristic_mouse_over_wall?~ - Inside source: true *** True Line Result - -300,2100,-300,2040 -** Processing line: ~ -300,2040,-160,2040~ + elsif heuristic_mouse_over_wall? +** Processing line: ~ # The user is removing a wall from the second grid~ - Inside source: true *** True Line Result - -300,2040,-160,2040 -** Processing line: ~ -160,2040,-60,2040~ + # The user is removing a wall from the second grid +** Processing line: ~ state.user_input = :heuristic_remove_wall~ - Inside source: true *** True Line Result - -160,2040,-60,2040 -** Processing line: ~ -60,2040,60,2040~ + state.user_input = :heuristic_remove_wall +** Processing line: ~ # If the mouse is over the first grid~ - Inside source: true *** True Line Result - -60,2040,60,2040 -** Processing line: ~ 60,2040,180,2040~ + # If the mouse is over the first grid +** Processing line: ~ elsif bfs_mouse_over_grid?~ - Inside source: true *** True Line Result - 60,2040,180,2040 -** Processing line: ~ 180,2040,360,2040~ + elsif bfs_mouse_over_grid? +** Processing line: ~ # The user is adding a wall from the first grid~ - Inside source: true *** True Line Result - 180,2040,360,2040 -** Processing line: ~ 360,2040,540,2040~ + # The user is adding a wall from the first grid +** Processing line: ~ state.user_input = :bfs_add_wall~ - Inside source: true *** True Line Result - 360,2040,540,2040 -** Processing line: ~ 540,2040,700,2080~ + state.user_input = :bfs_add_wall +** Processing line: ~ # If the mouse is over the second grid~ - Inside source: true *** True Line Result - 540,2040,700,2080 -** Processing line: ~ 660,2160,700,2080~ + # If the mouse is over the second grid +** Processing line: ~ elsif heuristic_mouse_over_grid?~ - Inside source: true *** True Line Result - 660,2160,700,2080 -** Processing line: ~ 660,2160,700,2260~ + elsif heuristic_mouse_over_grid? +** Processing line: ~ # The user is adding a wall from the second grid~ - Inside source: true *** True Line Result - 660,2160,700,2260 -** Processing line: ~ 660,2380,700,2260~ + # The user is adding a wall from the second grid +** Processing line: ~ state.user_input = :heuristic_add_wall~ - Inside source: true *** True Line Result - 660,2380,700,2260 -** Processing line: ~ 500,2340,660,2380~ + state.user_input = :heuristic_add_wall +** Processing line: ~ end~ - Inside source: true *** True Line Result - 500,2340,660,2380 -** Processing line: ~ 360,2340,500,2340~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 360,2340,500,2340 -** Processing line: ~ 240,2340,360,2340~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 240,2340,360,2340 -** Processing line: ~ 40,2320,240,2340~ + +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ - Inside source: true *** True Line Result - 40,2320,240,2340 -** Processing line: ~ -60,2320,40,2320~ + # Processes click and drag based on what the user is currently dragging +** Processing line: ~ def process_input~ - Inside source: true *** True Line Result - -60,2320,40,2320 -** Processing line: ~ -100,2380,-60,2320~ + def process_input +** Processing line: ~ if state.user_input == :slider~ - Inside source: true *** True Line Result - -100,2380,-60,2320 -** Processing line: ~ -100,2380,-100,2460~ + if state.user_input == :slider +** Processing line: ~ process_input_slider~ - Inside source: true *** True Line Result - -100,2380,-100,2460 -** Processing line: ~ -100,2460,-100,2540~ + process_input_slider +** Processing line: ~ elsif state.user_input == :bfs_star~ - Inside source: true *** True Line Result - -100,2460,-100,2540 -** Processing line: ~ -100,2540,0,2560~ + elsif state.user_input == :bfs_star +** Processing line: ~ process_input_bfs_star~ - Inside source: true *** True Line Result - -100,2540,0,2560 -** Processing line: ~ 0,2560,140,2600~ + process_input_bfs_star +** Processing line: ~ elsif state.user_input == :heuristic_star~ - Inside source: true *** True Line Result - 0,2560,140,2600 -** Processing line: ~ 140,2600,300,2600~ + elsif state.user_input == :heuristic_star +** Processing line: ~ process_input_heuristic_star~ - Inside source: true *** True Line Result - 140,2600,300,2600 -** Processing line: ~ 300,2600,460,2600~ + process_input_heuristic_star +** Processing line: ~ elsif state.user_input == :bfs_target~ - Inside source: true *** True Line Result - 300,2600,460,2600 -** Processing line: ~ 460,2600,640,2600~ + elsif state.user_input == :bfs_target +** Processing line: ~ process_input_bfs_target~ - Inside source: true *** True Line Result - 460,2600,640,2600 -** Processing line: ~ 640,2600,760,2580~ + process_input_bfs_target +** Processing line: ~ elsif state.user_input == :heuristic_target~ - Inside source: true *** True Line Result - 640,2600,760,2580 -** Processing line: ~ 760,2580,820,2560~ + elsif state.user_input == :heuristic_target +** Processing line: ~ process_input_heuristic_target~ - Inside source: true *** True Line Result - 760,2580,820,2560 -** Processing line: ~ 820,2560,820,2500~ + process_input_heuristic_target +** Processing line: ~ elsif state.user_input == :bfs_remove_wall~ - Inside source: true *** True Line Result - 820,2560,820,2500 -** Processing line: ~ 820,2500,820,2400~ + elsif state.user_input == :bfs_remove_wall +** Processing line: ~ process_input_bfs_remove_wall~ - Inside source: true *** True Line Result - 820,2500,820,2400 -** Processing line: ~ 820,2400,840,2320~ + process_input_bfs_remove_wall +** Processing line: ~ elsif state.user_input == :heuristic_remove_wall~ - Inside source: true *** True Line Result - 820,2400,840,2320 -** Processing line: ~ 840,2320,840,2240~ + elsif state.user_input == :heuristic_remove_wall +** Processing line: ~ process_input_heuristic_remove_wall~ - Inside source: true *** True Line Result - 840,2320,840,2240 -** Processing line: ~ 820,2120,840,2240~ + process_input_heuristic_remove_wall +** Processing line: ~ elsif state.user_input == :bfs_add_wall~ - Inside source: true *** True Line Result - 820,2120,840,2240 -** Processing line: ~ 820,2020,820,2120~ + elsif state.user_input == :bfs_add_wall +** Processing line: ~ process_input_bfs_add_wall~ - Inside source: true *** True Line Result - 820,2020,820,2120 -** Processing line: ~ 820,1900,820,2020~ + process_input_bfs_add_wall +** Processing line: ~ elsif state.user_input == :heuristic_add_wall~ - Inside source: true *** True Line Result - 820,1900,820,2020 -** Processing line: ~ 760,1840,820,1900~ + elsif state.user_input == :heuristic_add_wall +** Processing line: ~ process_input_heuristic_add_wall~ - Inside source: true *** True Line Result - 760,1840,820,1900 -** Processing line: ~ 640,1840,760,1840~ + process_input_heuristic_add_wall +** Processing line: ~ end~ - Inside source: true *** True Line Result - 640,1840,760,1840 -** Processing line: ~ 500,1840,640,1840~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 500,1840,640,1840 -** Processing line: ~ 300,1860,420,1880~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 300,1860,420,1880 -** Processing line: ~ 180,1840,300,1860~ + +** Processing line: ~ def render_slider~ - Inside source: true *** True Line Result - 180,1840,300,1860 -** Processing line: ~ 420,1880,500,1840~ + def render_slider +** Processing line: ~ # Using primitives hides the line under the white circle of the slider~ - Inside source: true *** True Line Result - 420,1880,500,1840 -** Processing line: ~ 0,1840,180,1840~ + # Using primitives hides the line under the white circle of the slider +** Processing line: ~ # Draws the line~ - Inside source: true *** True Line Result - 0,1840,180,1840 -** Processing line: ~ -60,1860,0,1840~ + # Draws the line +** Processing line: ~ outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line~ - Inside source: true *** True Line Result - -60,1860,0,1840 -** Processing line: ~ -160,1840,-60,1860~ + outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line +** Processing line: ~ # The circle needs to be offset so that the center of the circle~ - Inside source: true *** True Line Result - -160,1840,-60,1860 -** Processing line: ~ -200,1800,-160,1840~ + # The circle needs to be offset so that the center of the circle +** Processing line: ~ # overlaps the line instead of the upper right corner of the circle~ - Inside source: true *** True Line Result - -200,1800,-160,1840 -** Processing line: ~ -260,1760,-200,1800~ + # overlaps the line instead of the upper right corner of the circle +** Processing line: ~ # The circle's x value is also moved based on the current seach step~ - Inside source: true *** True Line Result - -260,1760,-200,1800 -** Processing line: ~ -260,1680,-260,1760~ + # The circle's x value is also moved based on the current seach step +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing)~ - Inside source: true *** True Line Result - -260,1680,-260,1760 -** Processing line: ~ -260,1620,-260,1680~ + circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing) +** Processing line: ~ circle_y = (slider.y - slider.offset)~ - Inside source: true *** True Line Result - -260,1620,-260,1680 -** Processing line: ~ -260,1540,-260,1620~ + circle_y = (slider.y - slider.offset) +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ - Inside source: true *** True Line Result - -260,1540,-260,1620 -** Processing line: ~ -260,1540,-260,1460~ + circle_rect = [circle_x, circle_y, 37, 37] +** Processing line: ~ outputs.primitives << [circle_rect, 'circle-white.png'].sprite~ - Inside source: true *** True Line Result - -260,1540,-260,1460 -** Processing line: ~ -300,1420,-260,1460~ + outputs.primitives << [circle_rect, 'circle-white.png'].sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - -300,1420,-260,1460 -** Processing line: ~ -300,1420,-300,1340~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -300,1420,-300,1340 -** Processing line: ~ -300,1340,-260,1260~ + +** Processing line: ~ def render_labels~ - Inside source: true *** True Line Result - -300,1340,-260,1260 -** Processing line: ~ -260,1260,-260,1160~ + def render_labels +** Processing line: ~ outputs.labels << [205, 625, "Breadth First Search"]~ - Inside source: true *** True Line Result - -260,1260,-260,1160 -** Processing line: ~ -260,1060,-260,1160~ + outputs.labels << [205, 625, "Breadth First Search"] +** Processing line: ~ outputs.labels << [820, 625, "Heuristic Best-First Search"]~ - Inside source: true *** True Line Result - -260,1060,-260,1160 -** Processing line: ~ -260,1060,-260,960~ + outputs.labels << [820, 625, "Heuristic Best-First Search"] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -260,1060,-260,960 -** Processing line: ~ -260,880,-260,960~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -260,880,-260,960 -** Processing line: ~ -260,880,-260,780~ + +** Processing line: ~ def render_left_button~ - Inside source: true *** True Line Result - -260,880,-260,780 -** Processing line: ~ -260,780,-260,680~ + def render_left_button +** Processing line: ~ # Draws the button_color button, and a black border~ - Inside source: true *** True Line Result - -260,780,-260,680 -** Processing line: ~ -300,580,-260,680~ + # Draws the button_color button, and a black border +** Processing line: ~ # The border separates the buttons visually~ - Inside source: true *** True Line Result - -300,580,-260,680 -** Processing line: ~ -300,580,-300,480~ + # The border separates the buttons visually +** Processing line: ~ outputs.solids << [buttons.left, button_color]~ - Inside source: true *** True Line Result - -300,580,-300,480 -** Processing line: ~ -300,480,-260,400~ + outputs.solids << [buttons.left, button_color] +** Processing line: ~ outputs.borders << [buttons.left]~ - Inside source: true *** True Line Result - -300,480,-260,400 -** Processing line: ~ -300,320,-260,400~ + outputs.borders << [buttons.left] +** Processing line: ~~ - Inside source: true *** True Line Result - -300,320,-260,400 -** Processing line: ~ -300,320,-300,240~ + +** Processing line: ~ # Renders an explanatory label in the center of the button~ - Inside source: true *** True Line Result - -300,320,-300,240 -** Processing line: ~ -300,240,-200,220~ + # Renders an explanatory label in the center of the button +** Processing line: ~ # Explains to the user what the button does~ - Inside source: true *** True Line Result - -300,240,-200,220 -** Processing line: ~ -200,220,-200,160~ + # Explains to the user what the button does +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ - Inside source: true *** True Line Result - -200,220,-200,160 -** Processing line: ~ -200,160,-100,140~ + # If the button size is changed, the label might need to be edited as well +** Processing line: ~ # to keep the label in the center of the button~ - Inside source: true *** True Line Result - -200,160,-100,140 -** Processing line: ~ -100,140,0,120~ + # to keep the label in the center of the button +** Processing line: ~ label_x = buttons.left.x + 20~ - Inside source: true *** True Line Result - -100,140,0,120 -** Processing line: ~ 0,120,60,120~ + label_x = buttons.left.x + 20 +** Processing line: ~ label_y = buttons.left.y + 35~ - Inside source: true *** True Line Result - 0,120,60,120 -** Processing line: ~ 60,120,180,120~ + label_y = buttons.left.y + 35 +** Processing line: ~ outputs.labels << [label_x, label_y, "<"]~ - Inside source: true *** True Line Result - 60,120,180,120 -** Processing line: ~ 180,120,300,120~ + outputs.labels << [label_x, label_y, "<"] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 180,120,300,120 -** Processing line: ~ 300,120,420,140~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 300,120,420,140 -** Processing line: ~ 420,140,580,180~ + +** Processing line: ~ def render_center_button~ - Inside source: true *** True Line Result - 420,140,580,180 -** Processing line: ~ 580,180,760,180~ + def render_center_button +** Processing line: ~ # Draws the button_color button, and a black border~ - Inside source: true *** True Line Result - 580,180,760,180 -** Processing line: ~ 760,180,900,180~ + # Draws the button_color button, and a black border +** Processing line: ~ # The border separates the buttons visually~ - Inside source: true *** True Line Result - 760,180,900,180 -** Processing line: ~ 960,180,1100,180~ + # The border separates the buttons visually +** Processing line: ~ outputs.solids << [buttons.center, button_color]~ - Inside source: true *** True Line Result - 960,180,1100,180 -** Processing line: ~ 1100,180,1340,200~ + outputs.solids << [buttons.center, button_color] +** Processing line: ~ outputs.borders << [buttons.center]~ - Inside source: true *** True Line Result - 1100,180,1340,200 -** Processing line: ~ 1340,200,1580,200~ + outputs.borders << [buttons.center] +** Processing line: ~~ - Inside source: true *** True Line Result - 1340,200,1580,200 -** Processing line: ~ 1580,200,1720,180~ + +** Processing line: ~ # Renders an explanatory label in the center of the button~ - Inside source: true *** True Line Result - 1580,200,1720,180 -** Processing line: ~ 1720,180,2000,140~ + # Renders an explanatory label in the center of the button +** Processing line: ~ # Explains to the user what the button does~ - Inside source: true *** True Line Result - 1720,180,2000,140 -** Processing line: ~ 2000,140,2240,140~ + # Explains to the user what the button does +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ - Inside source: true *** True Line Result - 2000,140,2240,140 -** Processing line: ~ 2240,140,2480,140~ + # If the button size is changed, the label might need to be edited as well +** Processing line: ~ # to keep the label in the center of the button~ - Inside source: true *** True Line Result - 2240,140,2480,140 -** Processing line: ~ 2520,140,2800,160~ + # to keep the label in the center of the button +** Processing line: ~ label_x = buttons.center.x + 37~ - Inside source: true *** True Line Result - 2520,140,2800,160 -** Processing line: ~ 2800,160,3000,160~ + label_x = buttons.center.x + 37 +** Processing line: ~ label_y = buttons.center.y + 35~ - Inside source: true *** True Line Result - 2800,160,3000,160 -** Processing line: ~ 3000,160,3140,160~ + label_y = buttons.center.y + 35 +** Processing line: ~ label_text = state.play ? "Pause Animation" : "Play Animation"~ - Inside source: true *** True Line Result - 3000,160,3140,160 -** Processing line: ~ 3140,260,3140,160~ + label_text = state.play ? "Pause Animation" : "Play Animation" +** Processing line: ~ outputs.labels << [label_x, label_y, label_text]~ - Inside source: true *** True Line Result - 3140,260,3140,160 -** Processing line: ~ 3140,260,3140,380~ + outputs.labels << [label_x, label_y, label_text] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3140,260,3140,380 -** Processing line: ~ 3080,500,3140,380~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3080,500,3140,380 -** Processing line: ~ 3080,620,3080,500~ + +** Processing line: ~ def render_right_button~ - Inside source: true *** True Line Result - 3080,620,3080,500 -** Processing line: ~ 3080,620,3080,740~ + def render_right_button +** Processing line: ~ # Draws the button_color button, and a black border~ - Inside source: true *** True Line Result - 3080,620,3080,740 -** Processing line: ~ 3080,740,3080,840~ + # Draws the button_color button, and a black border +** Processing line: ~ # The border separates the buttons visually~ - Inside source: true *** True Line Result - 3080,740,3080,840 -** Processing line: ~ 3080,960,3080,840~ + # The border separates the buttons visually +** Processing line: ~ outputs.solids << [buttons.right, button_color]~ - Inside source: true *** True Line Result - 3080,960,3080,840 -** Processing line: ~ 3080,1080,3080,960~ + outputs.solids << [buttons.right, button_color] +** Processing line: ~ outputs.borders << [buttons.right]~ - Inside source: true *** True Line Result - 3080,1080,3080,960 -** Processing line: ~ 3080,1080,3080,1200~ + outputs.borders << [buttons.right] +** Processing line: ~~ - Inside source: true *** True Line Result - 3080,1080,3080,1200 -** Processing line: ~ 3080,1200,3080,1340~ + +** Processing line: ~ # Renders an explanatory label in the center of the button~ - Inside source: true *** True Line Result - 3080,1200,3080,1340 -** Processing line: ~ 3080,1340,3080,1460~ + # Renders an explanatory label in the center of the button +** Processing line: ~ # Explains to the user what the button does~ - Inside source: true *** True Line Result - 3080,1340,3080,1460 -** Processing line: ~ 3080,1580,3080,1460~ + # Explains to the user what the button does +** Processing line: ~ label_x = buttons.right.x + 20~ - Inside source: true *** True Line Result - 3080,1580,3080,1460 -** Processing line: ~ 3080,1700,3080,1580~ + label_x = buttons.right.x + 20 +** Processing line: ~ label_y = buttons.right.y + 35~ - Inside source: true *** True Line Result - 3080,1700,3080,1580 -** Processing line: ~ 3080,1700,3080,1760~ + label_y = buttons.right.y + 35 +** Processing line: ~ outputs.labels << [label_x, label_y, ">"]~ - Inside source: true *** True Line Result - 3080,1700,3080,1760 -** Processing line: ~ 3080,1760,3200,1760~ + outputs.labels << [label_x, label_y, ">"] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3080,1760,3200,1760 -** Processing line: ~ 3200,1760,3320,1760~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3200,1760,3320,1760 -** Processing line: ~ 3320,1760,3520,1760~ + +** Processing line: ~ def render_bfs_grid~ - Inside source: true *** True Line Result - 3320,1760,3520,1760 -** Processing line: ~ 3520,1760,3680,1740~ + def render_bfs_grid +** Processing line: ~ # A large rect the size of the grid~ - Inside source: true *** True Line Result - 3520,1760,3680,1740 -** Processing line: ~ 3680,1740,3780,1700~ + # A large rect the size of the grid +** Processing line: ~ outputs.solids << [bfs_scale_up(grid.rect), default_color]~ - Inside source: true *** True Line Result - 3680,1740,3780,1700 -** Processing line: ~ 3780,1700,3840,1620~ + outputs.solids << [bfs_scale_up(grid.rect), default_color] +** Processing line: ~~ - Inside source: true *** True Line Result - 3780,1700,3840,1620 -** Processing line: ~ 3840,1620,3840,1520~ + +** Processing line: ~ # The vertical grid lines~ - Inside source: true *** True Line Result - 3840,1620,3840,1520 -** Processing line: ~ 3840,1520,3840,1420~ + # The vertical grid lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - 3840,1520,3840,1420 -** Processing line: ~ 3840,1320,3840,1420~ + for x in 0..grid.width +** Processing line: ~ outputs.lines << bfs_vertical_line(x)~ - Inside source: true *** True Line Result - 3840,1320,3840,1420 -** Processing line: ~ 3840,1120,3840,1320~ + outputs.lines << bfs_vertical_line(x) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3840,1120,3840,1320 -** Processing line: ~ 3840,1120,3840,940~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3840,1120,3840,940 -** Processing line: ~ 3840,940,3840,760~ + +** Processing line: ~ # The horizontal grid lines~ - Inside source: true *** True Line Result - 3840,940,3840,760 -** Processing line: ~ 3780,600,3840,760~ + # The horizontal grid lines +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - 3780,600,3840,760 -** Processing line: ~ 3780,600,3780,440~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << bfs_horizontal_line(y)~ - Inside source: true *** True Line Result - 3780,600,3780,440 -** Processing line: ~ 3780,320,3780,440~ + outputs.lines << bfs_horizontal_line(y) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3780,320,3780,440 -** Processing line: ~ 3780,320,3780,160~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3780,320,3780,160 -** Processing line: ~ 3780,60,3780,160~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3780,60,3780,160 -** Processing line: ~ 3780,60,4020,60~ + +** Processing line: ~ def render_heuristic_grid~ - Inside source: true *** True Line Result - 3780,60,4020,60 -** Processing line: ~ 4020,60,4260,40~ + def render_heuristic_grid +** Processing line: ~ # A large rect the size of the grid~ - Inside source: true *** True Line Result - 4020,60,4260,40 -** Processing line: ~ 4260,40,4500,40~ + # A large rect the size of the grid +** Processing line: ~ outputs.solids << [heuristic_scale_up(grid.rect), default_color]~ - Inside source: true *** True Line Result - 4260,40,4500,40 -** Processing line: ~ 4500,40,4740,40~ + outputs.solids << [heuristic_scale_up(grid.rect), default_color] +** Processing line: ~~ - Inside source: true *** True Line Result - 4500,40,4740,40 -** Processing line: ~ 4740,40,4840,20~ + +** Processing line: ~ # The vertical grid lines~ - Inside source: true *** True Line Result - 4740,40,4840,20 -** Processing line: ~ 4840,20,4880,80~ + # The vertical grid lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - 4840,20,4880,80 -** Processing line: ~ 4880,80,5080,40~ + for x in 0..grid.width +** Processing line: ~ outputs.lines << heuristic_vertical_line(x)~ - Inside source: true *** True Line Result - 4880,80,5080,40 -** Processing line: ~ 5080,40,5280,20~ + outputs.lines << heuristic_vertical_line(x) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5080,40,5280,20 -** Processing line: ~ 5280,20,5500,0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5280,20,5500,0 -** Processing line: ~ 5500,0,5720,0~ + +** Processing line: ~ # The horizontal grid lines~ - Inside source: true *** True Line Result - 5500,0,5720,0 -** Processing line: ~ 5720,0,5940,60~ + # The horizontal grid lines +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - 5720,0,5940,60 -** Processing line: ~ 5940,60,6240,60~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << heuristic_horizontal_line(y)~ - Inside source: true *** True Line Result - 5940,60,6240,60 -** Processing line: ~ 6240,60,6540,20~ + outputs.lines << heuristic_horizontal_line(y) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6240,60,6540,20 -** Processing line: ~ 6540,20,6840,20~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6540,20,6840,20 -** Processing line: ~ 6840,20,7040,0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6840,20,7040,0 -** Processing line: ~ 7040,0,7140,0~ + +** Processing line: ~ # Returns a vertical line for a column of the first grid~ - Inside source: true *** True Line Result - 7040,0,7140,0 -** Processing line: ~ 7140,0,7400,20~ + # Returns a vertical line for a column of the first grid +** Processing line: ~ def bfs_vertical_line column~ - Inside source: true *** True Line Result - 7140,0,7400,20 -** Processing line: ~ 7400,20,7680,0~ + def bfs_vertical_line column +** Processing line: ~ bfs_scale_up([column, 0, column, grid.height])~ - Inside source: true *** True Line Result - 7400,20,7680,0 -** Processing line: ~ 7680,0,7940,0~ + bfs_scale_up([column, 0, column, grid.height]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7680,0,7940,0 -** Processing line: ~ 7940,0,8200,-20~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7940,0,8200,-20 -** Processing line: ~ 8200,-20,8360,20~ + +** Processing line: ~ # Returns a horizontal line for a column of the first grid~ - Inside source: true *** True Line Result - 8200,-20,8360,20 -** Processing line: ~ 8360,20,8560,-40~ + # Returns a horizontal line for a column of the first grid +** Processing line: ~ def bfs_horizontal_line row~ - Inside source: true *** True Line Result - 8360,20,8560,-40 -** Processing line: ~ 8560,-40,8760,0~ + def bfs_horizontal_line row +** Processing line: ~ bfs_scale_up([0, row, grid.width, row])~ - Inside source: true *** True Line Result - 8560,-40,8760,0 -** Processing line: ~ 8760,0,8880,40~ + bfs_scale_up([0, row, grid.width, row]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8760,0,8880,40 -** Processing line: ~ 8880,120,8880,40~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8880,120,8880,40 -** Processing line: ~ 8840,220,8840,120~ + +** Processing line: ~ # Returns a vertical line for a column of the second grid~ - Inside source: true *** True Line Result - 8840,220,8840,120 -** Processing line: ~ 8620,240,8840,220~ + # Returns a vertical line for a column of the second grid +** Processing line: ~ def heuristic_vertical_line column~ - Inside source: true *** True Line Result - 8620,240,8840,220 -** Processing line: ~ 8420,260,8620,240~ + def heuristic_vertical_line column +** Processing line: ~ bfs_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height])~ - Inside source: true *** True Line Result - 8420,260,8620,240 -** Processing line: ~ 8200,280,8420,260~ + bfs_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8200,280,8420,260 -** Processing line: ~ 7940,280,8200,280~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7940,280,8200,280 -** Processing line: ~ 7760,240,7940,280~ + +** Processing line: ~ # Returns a horizontal line for a column of the second grid~ - Inside source: true *** True Line Result - 7760,240,7940,280 -** Processing line: ~ 7560,220,7760,240~ + # Returns a horizontal line for a column of the second grid +** Processing line: ~ def heuristic_horizontal_line row~ - Inside source: true *** True Line Result - 7560,220,7760,240 -** Processing line: ~ 7360,280,7560,220~ + def heuristic_horizontal_line row +** Processing line: ~ bfs_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row])~ - Inside source: true *** True Line Result - 7360,280,7560,220 -** Processing line: ~ 7140,260,7360,280~ + bfs_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7140,260,7360,280 -** Processing line: ~ 6940,240,7140,260~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6940,240,7140,260 -** Processing line: ~ 6720,220,6940,240~ + +** Processing line: ~ # Renders the star on the first grid~ - Inside source: true *** True Line Result - 6720,220,6940,240 -** Processing line: ~ 6480,220,6720,220~ + # Renders the star on the first grid +** Processing line: ~ def render_bfs_star~ - Inside source: true *** True Line Result - 6480,220,6720,220 -** Processing line: ~ 6360,300,6480,220~ + def render_bfs_star +** Processing line: ~ outputs.sprites << [bfs_scale_up(grid.star), 'star.png']~ - Inside source: true *** True Line Result - 6360,300,6480,220 -** Processing line: ~ 6240,300,6360,300~ + outputs.sprites << [bfs_scale_up(grid.star), 'star.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6240,300,6360,300 -** Processing line: ~ 6200,500,6240,300~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6200,500,6240,300 -** Processing line: ~ 6200,500,6360,540~ + +** Processing line: ~ # Renders the star on the second grid~ - Inside source: true *** True Line Result - 6200,500,6360,540 -** Processing line: ~ 6360,540,6540,520~ + # Renders the star on the second grid +** Processing line: ~ def render_heuristic_star~ - Inside source: true *** True Line Result - 6360,540,6540,520 -** Processing line: ~ 6540,520,6720,480~ + def render_heuristic_star +** Processing line: ~ outputs.sprites << [heuristic_scale_up(grid.star), 'star.png']~ - Inside source: true *** True Line Result - 6540,520,6720,480 -** Processing line: ~ 6720,480,6880,460~ + outputs.sprites << [heuristic_scale_up(grid.star), 'star.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6720,480,6880,460 -** Processing line: ~ 6880,460,7080,500~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6880,460,7080,500 -** Processing line: ~ 7080,500,7320,500~ + +** Processing line: ~ # Renders the target on the first grid~ - Inside source: true *** True Line Result - 7080,500,7320,500 -** Processing line: ~ 7320,500,7680,500~ + # Renders the target on the first grid +** Processing line: ~ def render_bfs_target~ - Inside source: true *** True Line Result - 7320,500,7680,500 -** Processing line: ~ 7680,620,7680,500~ + def render_bfs_target +** Processing line: ~ outputs.sprites << [bfs_scale_up(grid.target), 'target.png']~ - Inside source: true *** True Line Result - 7680,620,7680,500 -** Processing line: ~ 7520,640,7680,620~ + outputs.sprites << [bfs_scale_up(grid.target), 'target.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7520,640,7680,620 -** Processing line: ~ 7360,640,7520,640~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7360,640,7520,640 -** Processing line: ~ 7200,640,7360,640~ + +** Processing line: ~ # Renders the target on the second grid~ - Inside source: true *** True Line Result - 7200,640,7360,640 -** Processing line: ~ 7040,660,7200,640~ + # Renders the target on the second grid +** Processing line: ~ def render_heuristic_target~ - Inside source: true *** True Line Result - 7040,660,7200,640 -** Processing line: ~ 6880,720,7040,660~ + def render_heuristic_target +** Processing line: ~ outputs.sprites << [heuristic_scale_up(grid.target), 'target.png']~ - Inside source: true *** True Line Result - 6880,720,7040,660 -** Processing line: ~ 6720,700,6880,720~ + outputs.sprites << [heuristic_scale_up(grid.target), 'target.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6720,700,6880,720 -** Processing line: ~ 6540,700,6720,700~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6540,700,6720,700 -** Processing line: ~ 6420,760,6540,700~ + +** Processing line: ~ # Renders the walls on the first grid~ - Inside source: true *** True Line Result - 6420,760,6540,700 -** Processing line: ~ 6280,740,6420,760~ + # Renders the walls on the first grid +** Processing line: ~ def render_bfs_walls~ - Inside source: true *** True Line Result - 6280,740,6420,760 -** Processing line: ~ 6240,760,6280,740~ + def render_bfs_walls +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - 6240,760,6280,740 -** Processing line: ~ 6200,920,6240,760~ + grid.walls.each_key do | wall | +** Processing line: ~ outputs.solids << [bfs_scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - 6200,920,6240,760 -** Processing line: ~ 6200,920,6360,960~ + outputs.solids << [bfs_scale_up(wall), wall_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6200,920,6360,960 -** Processing line: ~ 6360,960,6540,960~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6360,960,6540,960 -** Processing line: ~ 6540,960,6720,960~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6540,960,6720,960 -** Processing line: ~ 6720,960,6760,980~ + +** Processing line: ~ # Renders the walls on the second grid~ - Inside source: true *** True Line Result - 6720,960,6760,980 -** Processing line: ~ 6760,980,6880,940~ + # Renders the walls on the second grid +** Processing line: ~ def render_heuristic_walls~ - Inside source: true *** True Line Result - 6760,980,6880,940 -** Processing line: ~ 6880,940,7080,940~ + def render_heuristic_walls +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - 6880,940,7080,940 -** Processing line: ~ 7080,940,7280,940~ + grid.walls.each_key do | wall | +** Processing line: ~ outputs.solids << [heuristic_scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - 7080,940,7280,940 -** Processing line: ~ 7280,940,7520,920~ + outputs.solids << [heuristic_scale_up(wall), wall_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7280,940,7520,920 -** Processing line: ~ 7520,920,7760,900~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7520,920,7760,900 -** Processing line: ~ 7760,900,7980,860~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7760,900,7980,860 -** Processing line: ~ 7980,860,8100,880~ + +** Processing line: ~ # Renders the visited cells on the first grid~ - Inside source: true *** True Line Result - 7980,860,8100,880 -** Processing line: ~ 8100,880,8280,900~ + # Renders the visited cells on the first grid +** Processing line: ~ def render_bfs_visited~ - Inside source: true *** True Line Result - 8100,880,8280,900 -** Processing line: ~ 8280,900,8500,820~ + def render_bfs_visited +** Processing line: ~ bfs.came_from.each_key do | visited_cell |~ - Inside source: true *** True Line Result - 8280,900,8500,820 -** Processing line: ~ 8500,820,8700,820~ + bfs.came_from.each_key do | visited_cell | +** Processing line: ~ outputs.solids << [bfs_scale_up(visited_cell), visited_color]~ - Inside source: true *** True Line Result - 8500,820,8700,820 -** Processing line: ~ 8700,820,8760,840~ + outputs.solids << [bfs_scale_up(visited_cell), visited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8700,820,8760,840 -** Processing line: ~ 8760,960,8760,840~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8760,960,8760,840 -** Processing line: ~ 8700,1040,8760,960~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8700,1040,8760,960 -** Processing line: ~ 8560,1060,8700,1040~ + +** Processing line: ~ # Renders the visited cells on the second grid~ - Inside source: true *** True Line Result - 8560,1060,8700,1040 -** Processing line: ~ 8460,1080,8560,1060~ + # Renders the visited cells on the second grid +** Processing line: ~ def render_heuristic_visited~ - Inside source: true *** True Line Result - 8460,1080,8560,1060 -** Processing line: ~ 8360,1040,8460,1080~ + def render_heuristic_visited +** Processing line: ~ heuristic.came_from.each_key do | visited_cell |~ - Inside source: true *** True Line Result - 8360,1040,8460,1080 -** Processing line: ~ 8280,1080,8360,1040~ + heuristic.came_from.each_key do | visited_cell | +** Processing line: ~ outputs.solids << [heuristic_scale_up(visited_cell), visited_color]~ - Inside source: true *** True Line Result - 8280,1080,8360,1040 -** Processing line: ~ 8160,1120,8280,1080~ + outputs.solids << [heuristic_scale_up(visited_cell), visited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8160,1120,8280,1080 -** Processing line: ~ 8040,1120,8160,1120~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8040,1120,8160,1120 -** Processing line: ~ 7940,1100,8040,1120~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7940,1100,8040,1120 -** Processing line: ~ 7800,1120,7940,1100~ + +** Processing line: ~ # Renders the frontier cells on the first grid~ - Inside source: true *** True Line Result - 7800,1120,7940,1100 -** Processing line: ~ 7680,1120,7800,1120~ + # Renders the frontier cells on the first grid +** Processing line: ~ def render_bfs_frontier~ - Inside source: true *** True Line Result - 7680,1120,7800,1120 -** Processing line: ~ 7520,1100,7680,1120~ + def render_bfs_frontier +** Processing line: ~ bfs.frontier.each do | frontier_cell |~ - Inside source: true *** True Line Result - 7520,1100,7680,1120 -** Processing line: ~ 7360,1100,7520,1100~ + bfs.frontier.each do | frontier_cell | +** Processing line: ~ outputs.solids << [bfs_scale_up(frontier_cell), frontier_color, 200]~ - Inside source: true *** True Line Result - 7360,1100,7520,1100 -** Processing line: ~ 7200,1120,7360,1100~ + outputs.solids << [bfs_scale_up(frontier_cell), frontier_color, 200] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7200,1120,7360,1100 -** Processing line: ~ 7040,1180,7200,1120~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7040,1180,7200,1120 -** Processing line: ~ 6880,1160,7040,1180~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6880,1160,7040,1180 -** Processing line: ~ 6720,1160,6880,1160~ + +** Processing line: ~ # Renders the frontier cells on the second grid~ - Inside source: true *** True Line Result - 6720,1160,6880,1160 -** Processing line: ~ 6540,1160,6720,1160~ + # Renders the frontier cells on the second grid +** Processing line: ~ def render_heuristic_frontier~ - Inside source: true *** True Line Result - 6540,1160,6720,1160 -** Processing line: ~ 6360,1160,6540,1160~ + def render_heuristic_frontier +** Processing line: ~ heuristic.frontier.each do | frontier_cell |~ - Inside source: true *** True Line Result - 6360,1160,6540,1160 -** Processing line: ~ 6200,1160,6360,1160~ + heuristic.frontier.each do | frontier_cell | +** Processing line: ~ outputs.solids << [heuristic_scale_up(frontier_cell), frontier_color, 200]~ - Inside source: true *** True Line Result - 6200,1160,6360,1160 -** Processing line: ~ 6040,1220,6200,1160~ + outputs.solids << [heuristic_scale_up(frontier_cell), frontier_color, 200] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6040,1220,6200,1160 -** Processing line: ~ 6040,1220,6040,1400~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6040,1220,6040,1400 -** Processing line: ~ 6040,1400,6200,1440~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6040,1400,6200,1440 -** Processing line: ~ 6200,1440,6320,1440~ + +** Processing line: ~ # Renders the path found by the breadth first search on the first grid~ - Inside source: true *** True Line Result - 6200,1440,6320,1440 -** Processing line: ~ 6320,1440,6440,1440~ + # Renders the path found by the breadth first search on the first grid +** Processing line: ~ def render_bfs_path~ - Inside source: true *** True Line Result - 6320,1440,6440,1440 -** Processing line: ~ 6600,1440,6760,1440~ + def render_bfs_path +** Processing line: ~ bfs.path.each do | path |~ - Inside source: true *** True Line Result - 6600,1440,6760,1440 -** Processing line: ~ 6760,1440,6940,1420~ + bfs.path.each do | path | +** Processing line: ~ outputs.solids << [bfs_scale_up(path), path_color]~ - Inside source: true *** True Line Result - 6760,1440,6940,1420 -** Processing line: ~ 6440,1440,6600,1440~ + outputs.solids << [bfs_scale_up(path), path_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6440,1440,6600,1440 -** Processing line: ~ 6940,1420,7280,1400~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6940,1420,7280,1400 -** Processing line: ~ 7280,1400,7560,1400~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7280,1400,7560,1400 -** Processing line: ~ 7560,1400,7760,1400~ + +** Processing line: ~ # Renders the path found by the heuristic search on the second grid~ - Inside source: true *** True Line Result - 7560,1400,7760,1400 -** Processing line: ~ 7760,1400,7940,1360~ + # Renders the path found by the heuristic search on the second grid +** Processing line: ~ def render_heuristic_path~ - Inside source: true *** True Line Result - 7760,1400,7940,1360 -** Processing line: ~ 7940,1360,8100,1380~ + def render_heuristic_path +** Processing line: ~ heuristic.path.each do | path |~ - Inside source: true *** True Line Result - 7940,1360,8100,1380 -** Processing line: ~ 8100,1380,8280,1340~ + heuristic.path.each do | path | +** Processing line: ~ outputs.solids << [heuristic_scale_up(path), path_color]~ - Inside source: true *** True Line Result - 8100,1380,8280,1340 -** Processing line: ~ 8280,1340,8460,1320~ + outputs.solids << [heuristic_scale_up(path), path_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8280,1340,8460,1320 -** Processing line: ~ 8660,1300,8760,1360~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8660,1300,8760,1360 -** Processing line: ~ 8460,1320,8660,1300~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8460,1320,8660,1300 -** Processing line: ~ 8760,1360,8800,1500~ + +** Processing line: ~ # Returns the rect for the path between two cells based on their relative positions~ - Inside source: true *** True Line Result - 8760,1360,8800,1500 -** Processing line: ~ 8800,1660,8800,1500~ + # Returns the rect for the path between two cells based on their relative positions +** Processing line: ~ def get_path_between(cell_one, cell_two)~ - Inside source: true *** True Line Result - 8800,1660,8800,1500 -** Processing line: ~ 8800,1660,8800,1820~ + def get_path_between(cell_one, cell_two) +** Processing line: ~ path = nil~ - Inside source: true *** True Line Result - 8800,1660,8800,1820 -** Processing line: ~ 8700,1840,8800,1820~ + path = nil +** Processing line: ~~ - Inside source: true *** True Line Result - 8700,1840,8800,1820 -** Processing line: ~ 8620,1860,8700,1840~ + +** Processing line: ~ # If cell one is above cell two~ - Inside source: true *** True Line Result - 8620,1860,8700,1840 -** Processing line: ~ 8560,1800,8620,1860~ + # If cell one is above cell two +** Processing line: ~ if cell_one.x == cell_two.x and cell_one.y > cell_two.y~ - Inside source: true *** True Line Result - 8560,1800,8620,1860 -** Processing line: ~ 8560,1800,8620,1680~ + if cell_one.x == cell_two.x and cell_one.y > cell_two.y +** Processing line: ~ # Path starts from the center of cell two and moves upward to the center of cell one~ - Inside source: true *** True Line Result - 8560,1800,8620,1680 -** Processing line: ~ 8500,1640,8620,1680~ + # Path starts from the center of cell two and moves upward to the center of cell one +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4]~ - Inside source: true *** True Line Result - 8500,1640,8620,1680 -** Processing line: ~ 8420,1680,8500,1640~ + path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4] +** Processing line: ~ # If cell one is below cell two~ - Inside source: true *** True Line Result - 8420,1680,8500,1640 -** Processing line: ~ 8280,1680,8420,1680~ + # If cell one is below cell two +** Processing line: ~ elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y~ - Inside source: true *** True Line Result - 8280,1680,8420,1680 -** Processing line: ~ 8160,1680,8280,1680~ + elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y +** Processing line: ~ # Path starts from the center of cell one and moves upward to the center of cell two~ - Inside source: true *** True Line Result - 8160,1680,8280,1680 -** Processing line: ~ 7900,1680,8160,1680~ + # Path starts from the center of cell one and moves upward to the center of cell two +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4]~ - Inside source: true *** True Line Result - 7900,1680,8160,1680 -** Processing line: ~ 7680,1680,7900,1680~ + path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4] +** Processing line: ~ # If cell one is to the left of cell two~ - Inside source: true *** True Line Result - 7680,1680,7900,1680 -** Processing line: ~ 7400,1660,7680,1680~ + # If cell one is to the left of cell two +** Processing line: ~ elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y~ - Inside source: true *** True Line Result - 7400,1660,7680,1680 -** Processing line: ~ 7140,1680,7400,1660~ + elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y +** Processing line: ~ # Path starts from the center of cell two and moves rightward to the center of cell one~ - Inside source: true *** True Line Result - 7140,1680,7400,1660 -** Processing line: ~ 6880,1640,7140,1680~ + # Path starts from the center of cell two and moves rightward to the center of cell one +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4]~ - Inside source: true *** True Line Result - 6880,1640,7140,1680 -** Processing line: ~ 6040,1820,6320,1780~ + path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4] +** Processing line: ~ # If cell one is to the right of cell two~ - Inside source: true *** True Line Result - 6040,1820,6320,1780 -** Processing line: ~ 5900,1840,6040,1820~ + # If cell one is to the right of cell two +** Processing line: ~ elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y~ - Inside source: true *** True Line Result - 5900,1840,6040,1820 -** Processing line: ~ 6640,1700,6880,1640~ + elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y +** Processing line: ~ # Path starts from the center of cell one and moves rightward to the center of cell two~ - Inside source: true *** True Line Result - 6640,1700,6880,1640 -** Processing line: ~ 6320,1780,6640,1700~ + # Path starts from the center of cell one and moves rightward to the center of cell two +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4]~ - Inside source: true *** True Line Result - 6320,1780,6640,1700 -** Processing line: ~ 5840,2040,5900,1840~ + path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5840,2040,5900,1840 -** Processing line: ~ 5840,2040,5840,2220~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5840,2040,5840,2220 -** Processing line: ~ 5840,2220,5840,2320~ + +** Processing line: ~ path~ - Inside source: true *** True Line Result - 5840,2220,5840,2320 -** Processing line: ~ 5840,2460,5840,2320~ + path +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5840,2460,5840,2320 -** Processing line: ~ 5840,2560,5840,2460~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5840,2560,5840,2460 -** Processing line: ~ 5840,2560,5960,2620~ + +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ - Inside source: true *** True Line Result - 5840,2560,5960,2620 -** Processing line: ~ 5960,2620,6200,2620~ + # In code, the cells are represented as 1x1 rectangles +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ - Inside source: true *** True Line Result - 5960,2620,6200,2620 -** Processing line: ~ 6200,2620,6380,2600~ + # When drawn, the cells are larger than 1x1 rectangles +** Processing line: ~ # This method is used to scale up cells, and lines~ - Inside source: true *** True Line Result - 6200,2620,6380,2600 -** Processing line: ~ 6380,2600,6600,2580~ + # This method is used to scale up cells, and lines +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ - Inside source: true *** True Line Result - 6380,2600,6600,2580 -** Processing line: ~ 6600,2580,6800,2600~ + # Objects are scaled up according to the grid.cell_size variable +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ - Inside source: true *** True Line Result - 6600,2580,6800,2600 -** Processing line: ~ 6800,2600,7040,2580~ + # This allows for easy customization of the visual scale of the grid +** Processing line: ~ # This method scales up cells for the first grid~ - Inside source: true *** True Line Result - 6800,2600,7040,2580 -** Processing line: ~ 7040,2580,7280,2580~ + # This method scales up cells for the first grid +** Processing line: ~ def bfs_scale_up(cell)~ - Inside source: true *** True Line Result - 7040,2580,7280,2580 -** Processing line: ~ 7280,2580,7480,2560~ + def bfs_scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ - Inside source: true *** True Line Result - 7280,2580,7480,2560 -** Processing line: ~ 7760,2540,7980,2520~ + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ - Inside source: true *** True Line Result - 7760,2540,7980,2520 -** Processing line: ~ 7980,2520,8160,2500~ + cell = cell.clone +** Processing line: ~~ - Inside source: true *** True Line Result - 7980,2520,8160,2500 -** Processing line: ~ 7480,2560,7760,2540~ + +** Processing line: ~ # If cell is just an x and y coordinate~ - Inside source: true *** True Line Result - 7480,2560,7760,2540 -** Processing line: ~ 8160,2500,8160,2420~ + # If cell is just an x and y coordinate +** Processing line: ~ if cell.size == 2~ - Inside source: true *** True Line Result - 8160,2500,8160,2420 -** Processing line: ~ 8160,2420,8160,2320~ + if cell.size == 2 +** Processing line: ~ # Add a width and height of 1~ - Inside source: true *** True Line Result - 8160,2420,8160,2320 -** Processing line: ~ 8160,2180,8160,2320~ + # Add a width and height of 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - 8160,2180,8160,2320 -** Processing line: ~ 7980,2160,8160,2180~ + cell << 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - 7980,2160,8160,2180 -** Processing line: ~ 7800,2180,7980,2160~ + cell << 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7800,2180,7980,2160 -** Processing line: ~ 7600,2200,7800,2180~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7600,2200,7800,2180 -** Processing line: ~ 7400,2200,7600,2200~ + +** Processing line: ~ # Scale all the values up~ - Inside source: true *** True Line Result - 7400,2200,7600,2200 -** Processing line: ~ 6960,2200,7200,2200~ + # Scale all the values up +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ - Inside source: true *** True Line Result - 6960,2200,7200,2200 -** Processing line: ~ 7200,2200,7400,2200~ + cell.map! { |value| value * grid.cell_size } +** Processing line: ~~ - Inside source: true *** True Line Result - 7200,2200,7400,2200 -** Processing line: ~ 6720,2200,6960,2200~ + +** Processing line: ~ # Returns the scaled up cell~ - Inside source: true *** True Line Result - 6720,2200,6960,2200 -** Processing line: ~ 6540,2180,6720,2200~ + # Returns the scaled up cell +** Processing line: ~ cell~ - Inside source: true *** True Line Result - 6540,2180,6720,2200 -** Processing line: ~ 6320,2200,6540,2180~ + cell +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6320,2200,6540,2180 -** Processing line: ~ 6240,2160,6320,2200~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6240,2160,6320,2200 -** Processing line: ~ 6240,2160,6240,2040~ + +** Processing line: ~ # Translates the given cell grid.width + 1 to the right and then scales up~ - Inside source: true *** True Line Result - 6240,2160,6240,2040 -** Processing line: ~ 6240,2040,6240,1940~ + # Translates the given cell grid.width + 1 to the right and then scales up +** Processing line: ~ # Used to draw cells for the second grid~ - Inside source: true *** True Line Result - 6240,2040,6240,1940 -** Processing line: ~ 6240,1940,6440,1940~ + # Used to draw cells for the second grid +** Processing line: ~ # This method does not work for lines,~ - Inside source: true *** True Line Result - 6240,1940,6440,1940 -** Processing line: ~ 6440,1940,6720,1940~ + # This method does not work for lines, +** Processing line: ~ # so separate methods exist for the grid lines~ - Inside source: true *** True Line Result - 6440,1940,6720,1940 -** Processing line: ~ 6720,1940,6940,1920~ + # so separate methods exist for the grid lines +** Processing line: ~ def heuristic_scale_up(cell)~ - Inside source: true *** True Line Result - 6720,1940,6940,1920 -** Processing line: ~ 7520,1920,7760,1920~ + def heuristic_scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ - Inside source: true *** True Line Result - 7520,1920,7760,1920 -** Processing line: ~ 6940,1920,7280,1920~ + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ - Inside source: true *** True Line Result - 6940,1920,7280,1920 -** Processing line: ~ 7280,1920,7520,1920~ + cell = cell.clone +** Processing line: ~ # Translates the cell to the second grid equivalent~ - Inside source: true *** True Line Result - 7280,1920,7520,1920 -** Processing line: ~ 7760,1920,8100,1900~ + # Translates the cell to the second grid equivalent +** Processing line: ~ cell.x += grid.width + 1~ - Inside source: true *** True Line Result - 7760,1920,8100,1900 -** Processing line: ~ 8100,1900,8420,1900~ + cell.x += grid.width + 1 +** Processing line: ~ # Proceeds as if scaling up for the first grid~ - Inside source: true *** True Line Result - 8100,1900,8420,1900 -** Processing line: ~ 8420,1900,8460,1940~ + # Proceeds as if scaling up for the first grid +** Processing line: ~ bfs_scale_up(cell)~ - Inside source: true *** True Line Result - 8420,1900,8460,1940 -** Processing line: ~ 8460,2120,8460,1940~ + bfs_scale_up(cell) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8460,2120,8460,1940 -** Processing line: ~ 8460,2280,8460,2120~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8460,2280,8460,2120 -** Processing line: ~ 8460,2280,8560,2420~ + +** Processing line: ~ # Checks and handles input for the buttons~ - Inside source: true *** True Line Result - 8460,2280,8560,2420 -** Processing line: ~ 8560,2420,8660,2380~ + # Checks and handles input for the buttons +** Processing line: ~ # Called when the mouse is lifted~ - Inside source: true *** True Line Result - 8560,2420,8660,2380 -** Processing line: ~ 8660,2380,8800,2340~ + # Called when the mouse is lifted +** Processing line: ~ def input_buttons~ - Inside source: true *** True Line Result - 8660,2380,8800,2340 -** Processing line: ~ 8800,2340,8840,2400~ + def input_buttons +** Processing line: ~ input_left_button~ - Inside source: true *** True Line Result - 8800,2340,8840,2400 -** Processing line: ~ 8840,2520,8840,2400~ + input_left_button +** Processing line: ~ input_center_button~ - Inside source: true *** True Line Result - 8840,2520,8840,2400 -** Processing line: ~ 8800,2620,8840,2520~ + input_center_button +** Processing line: ~ input_right_button~ - Inside source: true *** True Line Result - 8800,2620,8840,2520 -** Processing line: ~ 8800,2740,8800,2620~ + input_right_button +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8800,2740,8800,2620 -** Processing line: ~ 8800,2860,8800,2740~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8800,2860,8800,2740 -** Processing line: ~ 8800,2940,8800,2860~ + +** Processing line: ~ # Checks if the previous step button is clicked~ - Inside source: true *** True Line Result - 8800,2940,8800,2860 -** Processing line: ~ 8760,2980,8800,2940~ + # Checks if the previous step button is clicked +** Processing line: ~ # If it is, it pauses the animation and moves the search one step backward~ - Inside source: true *** True Line Result - 8760,2980,8800,2940 -** Processing line: ~ 8660,2980,8760,2980~ + # If it is, it pauses the animation and moves the search one step backward +** Processing line: ~ def input_left_button~ - Inside source: true *** True Line Result - 8660,2980,8760,2980 -** Processing line: ~ 8620,2960,8660,2980~ + def input_left_button +** Processing line: ~ if left_button_clicked?~ - Inside source: true *** True Line Result - 8620,2960,8660,2980 -** Processing line: ~ 8560,2880,8620,2960~ + if left_button_clicked? +** Processing line: ~ state.play = false~ - Inside source: true *** True Line Result - 8560,2880,8620,2960 -** Processing line: ~ 8560,2880,8560,2780~ + state.play = false +** Processing line: ~ state.current_step -= 1~ - Inside source: true *** True Line Result - 8560,2880,8560,2780 -** Processing line: ~ 8500,2740,8560,2780~ + state.current_step -= 1 +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 8500,2740,8560,2780 -** Processing line: ~ 8420,2760,8500,2740~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8420,2760,8500,2740 -** Processing line: ~ 8420,2840,8420,2760~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8420,2840,8420,2760 -** Processing line: ~ 8420,2840,8420,2940~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8420,2840,8420,2940 -** Processing line: ~ 8420,3040,8420,2940~ + +** Processing line: ~ # Controls the play/pause button~ - Inside source: true *** True Line Result - 8420,3040,8420,2940 -** Processing line: ~ 8420,3160,8420,3040~ + # Controls the play/pause button +** Processing line: ~ # Inverses whether the animation is playing or not when clicked~ - Inside source: true *** True Line Result - 8420,3160,8420,3040 -** Processing line: ~ 8420,3280,8420,3380~ + # Inverses whether the animation is playing or not when clicked +** Processing line: ~ def input_center_button~ - Inside source: true *** True Line Result - 8420,3280,8420,3380 -** Processing line: ~ 8420,3280,8420,3160~ + def input_center_button +** Processing line: ~ if center_button_clicked? || inputs.keyboard.key_down.space~ - Inside source: true *** True Line Result - 8420,3280,8420,3160 -** Processing line: ~ 8420,3380,8620,3460~ + if center_button_clicked? || inputs.keyboard.key_down.space +** Processing line: ~ state.play = !state.play~ - Inside source: true *** True Line Result - 8420,3380,8620,3460 -** Processing line: ~ 8620,3460,8760,3460~ + state.play = !state.play +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8620,3460,8760,3460 -** Processing line: ~ 8760,3460,8840,3400~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8760,3460,8840,3400 -** Processing line: ~ 8840,3400,8960,3400~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8840,3400,8960,3400 -** Processing line: ~ 8960,3400,9000,3500~ + +** Processing line: ~ # Checks if the next step button is clicked~ - Inside source: true *** True Line Result - 8960,3400,9000,3500 -** Processing line: ~ 9000,3700,9000,3500~ + # Checks if the next step button is clicked +** Processing line: ~ # If it is, it pauses the animation and moves the search one step forward~ - Inside source: true *** True Line Result - 9000,3700,9000,3500 -** Processing line: ~ 9000,3900,9000,3700~ + # If it is, it pauses the animation and moves the search one step forward +** Processing line: ~ def input_right_button~ - Inside source: true *** True Line Result - 9000,3900,9000,3700 -** Processing line: ~ 9000,4080,9000,3900~ + def input_right_button +** Processing line: ~ if right_button_clicked?~ - Inside source: true *** True Line Result - 9000,4080,9000,3900 -** Processing line: ~ 9000,4280,9000,4080~ + if right_button_clicked? +** Processing line: ~ state.play = false~ - Inside source: true *** True Line Result - 9000,4280,9000,4080 -** Processing line: ~ 9000,4500,9000,4280~ + state.play = false +** Processing line: ~ state.current_step += 1~ - Inside source: true *** True Line Result - 9000,4500,9000,4280 -** Processing line: ~ 9000,4620,9000,4500~ + state.current_step += 1 +** Processing line: ~ move_searches_one_step_forward~ - Inside source: true *** True Line Result - 9000,4620,9000,4500 -** Processing line: ~ 9000,4780,9000,4620~ + move_searches_one_step_forward +** Processing line: ~ end~ - Inside source: true *** True Line Result - 9000,4780,9000,4620 -** Processing line: ~ 9000,4780,9000,4960~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 9000,4780,9000,4960 -** Processing line: ~ 9000,5120,9000,4960~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 9000,5120,9000,4960 -** Processing line: ~ 9000,5120,9000,5300~ + +** Processing line: ~ # These methods detect when the buttons are clicked~ - Inside source: true *** True Line Result - 9000,5120,9000,5300 -** Processing line: ~ 8960,5460,9000,5300~ + # These methods detect when the buttons are clicked +** Processing line: ~ def left_button_clicked?~ - Inside source: true *** True Line Result - 8960,5460,9000,5300 -** Processing line: ~ 8920,5620,8960,5460~ + def left_button_clicked? +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.left) && inputs.mouse.up~ - Inside source: true *** True Line Result - 8920,5620,8960,5460 -** Processing line: ~ 8920,5620,8920,5800~ + inputs.mouse.point.inside_rect?(buttons.left) && inputs.mouse.up +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8920,5620,8920,5800 -** Processing line: ~ 8920,5800,8920,5960~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8920,5800,8920,5960 -** Processing line: ~ 8920,5960,8920,6120~ + +** Processing line: ~ def center_button_clicked?~ - Inside source: true *** True Line Result - 8920,5960,8920,6120 -** Processing line: ~ 8920,6120,8960,6300~ + def center_button_clicked? +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.center) && inputs.mouse.up~ - Inside source: true *** True Line Result - 8920,6120,8960,6300 -** Processing line: ~ 8960,6300,8960,6480~ + inputs.mouse.point.inside_rect?(buttons.center) && inputs.mouse.up +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8960,6300,8960,6480 -** Processing line: ~ 8960,6660,8960,6480~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8960,6660,8960,6480 -** Processing line: ~ 8960,6860,8960,6660~ + +** Processing line: ~ def right_button_clicked?~ - Inside source: true *** True Line Result - 8960,6860,8960,6660 -** Processing line: ~ 8960,7040,8960,6860~ + def right_button_clicked? +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.right) && inputs.mouse.up~ - Inside source: true *** True Line Result - 8960,7040,8960,6860 -** Processing line: ~ 8920,7420,8920,7220~ + inputs.mouse.point.inside_rect?(buttons.right) && inputs.mouse.up +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8920,7420,8920,7220 -** Processing line: ~ 8920,7420,8960,7620~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8920,7420,8960,7620 -** Processing line: ~ 8960,7620,8960,7800~ + +** Processing line: ~~ - Inside source: true *** True Line Result - 8960,7620,8960,7800 -** Processing line: ~ 8960,7800,8960,8000~ + +** Processing line: ~ # Signal that the user is going to be moving the slider~ - Inside source: true *** True Line Result - 8960,7800,8960,8000 -** Processing line: ~ 8960,8000,8960,8180~ + # Signal that the user is going to be moving the slider +** Processing line: ~ # Is the mouse over the circle of the slider?~ - Inside source: true *** True Line Result - 8960,8000,8960,8180 -** Processing line: ~ 8960,8180,8960,8380~ + # Is the mouse over the circle of the slider? +** Processing line: ~ def mouse_over_slider?~ - Inside source: true *** True Line Result - 8960,8180,8960,8380 -** Processing line: ~ 8960,8580,8960,8380~ + def mouse_over_slider? +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing)~ - Inside source: true *** True Line Result - 8960,8580,8960,8380 -** Processing line: ~ 8920,8800,8960,8580~ + circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing) +** Processing line: ~ circle_y = (slider.y - slider.offset)~ - Inside source: true *** True Line Result - 8920,8800,8960,8580 -** Processing line: ~ 8880,9000,8920,8800~ + circle_y = (slider.y - slider.offset) +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ - Inside source: true *** True Line Result - 8880,9000,8920,8800 -** Processing line: ~ 8840,9180,8880,9000~ + circle_rect = [circle_x, circle_y, 37, 37] +** Processing line: ~ inputs.mouse.point.inside_rect?(circle_rect)~ - Inside source: true *** True Line Result - 8840,9180,8880,9000 -** Processing line: ~ 8800,9220,8840,9180~ + inputs.mouse.point.inside_rect?(circle_rect) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8800,9220,8840,9180 -** Processing line: ~ 8800,9220,8840,9340~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8800,9220,8840,9340 -** Processing line: ~ 8760,9380,8840,9340~ + +** Processing line: ~ # Signal that the user is going to be moving the star from the first grid~ - Inside source: true *** True Line Result - 8760,9380,8840,9340 -** Processing line: ~ 8560,9340,8760,9380~ + # Signal that the user is going to be moving the star from the first grid +** Processing line: ~ def bfs_mouse_over_star?~ - Inside source: true *** True Line Result - 8560,9340,8760,9380 -** Processing line: ~ 8360,9360,8560,9340~ + def bfs_mouse_over_star? +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.star))~ - Inside source: true *** True Line Result - 8360,9360,8560,9340 -** Processing line: ~ 8160,9360,8360,9360~ + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.star)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8160,9360,8360,9360 -** Processing line: ~ 8040,9340,8160,9360~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8040,9340,8160,9360 -** Processing line: ~ 7860,9360,8040,9340~ + +** Processing line: ~ # Signal that the user is going to be moving the star from the second grid~ - Inside source: true *** True Line Result - 7860,9360,8040,9340 -** Processing line: ~ 7680,9360,7860,9360~ + # Signal that the user is going to be moving the star from the second grid +** Processing line: ~ def heuristic_mouse_over_star?~ - Inside source: true *** True Line Result - 7680,9360,7860,9360 -** Processing line: ~ 7520,9360,7680,9360~ + def heuristic_mouse_over_star? +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.star))~ - Inside source: true *** True Line Result - 7520,9360,7680,9360 -** Processing line: ~ 7420,9260,7520,9360~ + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.star)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7420,9260,7520,9360 -** Processing line: ~ 7400,9080,7420,9260~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7400,9080,7420,9260 -** Processing line: ~ 7400,9080,7420,8860~ + +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ - Inside source: true *** True Line Result - 7400,9080,7420,8860 -** Processing line: ~ 7420,8860,7440,8720~ + # Signal that the user is going to be moving the target from the first grid +** Processing line: ~ def bfs_mouse_over_target?~ - Inside source: true *** True Line Result - 7420,8860,7440,8720 -** Processing line: ~ 7440,8720,7480,8660~ + def bfs_mouse_over_target? +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.target))~ - Inside source: true *** True Line Result - 7440,8720,7480,8660 -** Processing line: ~ 7480,8660,7520,8540~ + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.target)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7480,8660,7520,8540 -** Processing line: ~ 7520,8540,7600,8460~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7520,8540,7600,8460 -** Processing line: ~ 7600,8460,7800,8480~ + +** Processing line: ~ # Signal that the user is going to be moving the target from the second grid~ - Inside source: true *** True Line Result - 7600,8460,7800,8480 -** Processing line: ~ 7800,8480,8040,8480~ + # Signal that the user is going to be moving the target from the second grid +** Processing line: ~ def heuristic_mouse_over_target?~ - Inside source: true *** True Line Result - 7800,8480,8040,8480 -** Processing line: ~ 8040,8480,8280,8480~ + def heuristic_mouse_over_target? +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.target))~ - Inside source: true *** True Line Result - 8040,8480,8280,8480 -** Processing line: ~ 8280,8480,8500,8460~ + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.target)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8280,8480,8500,8460 -** Processing line: ~ 8500,8460,8620,8440~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8500,8460,8620,8440 -** Processing line: ~ 8620,8440,8660,8340~ + +** Processing line: ~ # Signal that the user is going to be removing walls from the first grid~ - Inside source: true *** True Line Result - 8620,8440,8660,8340 -** Processing line: ~ 8660,8340,8660,8220~ + # Signal that the user is going to be removing walls from the first grid +** Processing line: ~ def bfs_mouse_over_wall?~ - Inside source: true *** True Line Result - 8660,8340,8660,8220 -** Processing line: ~ 8660,8220,8700,8080~ + def bfs_mouse_over_wall? +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - 8660,8220,8700,8080 -** Processing line: ~ 8700,8080,8700,7920~ + grid.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(bfs_scale_up(wall))~ - Inside source: true *** True Line Result - 8700,8080,8700,7920 -** Processing line: ~ 8700,7920,8700,7760~ + return true if inputs.mouse.point.inside_rect?(bfs_scale_up(wall)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8700,7920,8700,7760 -** Processing line: ~ 8700,7760,8700,7620~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8700,7760,8700,7620 -** Processing line: ~ 8700,7480,8700,7620~ + +** Processing line: ~ false~ - Inside source: true *** True Line Result - 8700,7480,8700,7620 -** Processing line: ~ 8700,7480,8700,7320~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8700,7480,8700,7320 -** Processing line: ~ 8700,7160,8700,7320~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8700,7160,8700,7320 -** Processing line: ~ 8920,7220,8960,7040~ + +** Processing line: ~ # Signal that the user is going to be removing walls from the second grid~ - Inside source: true *** True Line Result - 8920,7220,8960,7040 -** Processing line: ~ 8660,7040,8700,7160~ + # Signal that the user is going to be removing walls from the second grid +** Processing line: ~ def heuristic_mouse_over_wall?~ - Inside source: true *** True Line Result - 8660,7040,8700,7160 -** Processing line: ~ 8660,7040,8700,6880~ + def heuristic_mouse_over_wall? +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - 8660,7040,8700,6880 -** Processing line: ~ 8660,6700,8700,6880~ + grid.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(heuristic_scale_up(wall))~ - Inside source: true *** True Line Result - 8660,6700,8700,6880 -** Processing line: ~ 8660,6700,8700,6580~ + return true if inputs.mouse.point.inside_rect?(heuristic_scale_up(wall)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8660,6700,8700,6580 -** Processing line: ~ 8700,6460,8700,6580~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8700,6460,8700,6580 -** Processing line: ~ 8700,6460,8700,6320~ + +** Processing line: ~ false~ - Inside source: true *** True Line Result - 8700,6460,8700,6320 -** Processing line: ~ 8700,6160,8700,6320~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8700,6160,8700,6320 -** Processing line: ~ 8700,6160,8760,6020~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8700,6160,8760,6020 -** Processing line: ~ 8760,6020,8760,5860~ + +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ - Inside source: true *** True Line Result - 8760,6020,8760,5860 -** Processing line: ~ 8760,5860,8760,5700~ + # Signal that the user is going to be adding walls from the first grid +** Processing line: ~ def bfs_mouse_over_grid?~ - Inside source: true *** True Line Result - 8760,5860,8760,5700 -** Processing line: ~ 8760,5700,8760,5540~ + def bfs_mouse_over_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.rect))~ - Inside source: true *** True Line Result - 8760,5700,8760,5540 -** Processing line: ~ 8760,5540,8760,5360~ + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.rect)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8760,5540,8760,5360 -** Processing line: ~ 8760,5360,8760,5180~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8760,5360,8760,5180 -** Processing line: ~ 8760,5000,8760,5180~ + +** Processing line: ~ # Signal that the user is going to be adding walls from the second grid~ - Inside source: true *** True Line Result - 8760,5000,8760,5180 -** Processing line: ~ 8700,4820,8760,5000~ + # Signal that the user is going to be adding walls from the second grid +** Processing line: ~ def heuristic_mouse_over_grid?~ - Inside source: true *** True Line Result - 8700,4820,8760,5000 -** Processing line: ~ 8560,4740,8700,4820~ + def heuristic_mouse_over_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.rect))~ - Inside source: true *** True Line Result - 8560,4740,8700,4820 -** Processing line: ~ 8420,4700,8560,4740~ + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.rect)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8420,4700,8560,4740 -** Processing line: ~ 8280,4700,8420,4700~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8280,4700,8420,4700 -** Processing line: ~ 8100,4700,8280,4700~ + +** Processing line: ~ # This method is called when the user is editing the slider~ - Inside source: true *** True Line Result - 8100,4700,8280,4700 -** Processing line: ~ 7980,4700,8100,4700~ + # This method is called when the user is editing the slider +** Processing line: ~ # It pauses the animation and moves the white circle to the closest integer point~ - Inside source: true *** True Line Result - 7980,4700,8100,4700 -** Processing line: ~ 7820,4740,7980,4700~ + # It pauses the animation and moves the white circle to the closest integer point +** Processing line: ~ # on the slider~ - Inside source: true *** True Line Result - 7820,4740,7980,4700 -** Processing line: ~ 7800,4920,7820,4740~ + # on the slider +** Processing line: ~ # Changes the step of the search to be animated~ - Inside source: true *** True Line Result - 7800,4920,7820,4740 -** Processing line: ~ 7800,4920,7900,4960~ + # Changes the step of the search to be animated +** Processing line: ~ def process_input_slider~ - Inside source: true *** True Line Result - 7800,4920,7900,4960 -** Processing line: ~ 7900,4960,8060,4980~ + def process_input_slider +** Processing line: ~ state.play = false~ - Inside source: true *** True Line Result - 7900,4960,8060,4980 -** Processing line: ~ 8060,4980,8220,5000~ + state.play = false +** Processing line: ~ mouse_x = inputs.mouse.point.x~ - Inside source: true *** True Line Result - 8060,4980,8220,5000 -** Processing line: ~ 8220,5000,8420,5040~ + mouse_x = inputs.mouse.point.x +** Processing line: ~~ - Inside source: true *** True Line Result - 8220,5000,8420,5040 -** Processing line: ~ 8420,5040,8460,5120~ + +** Processing line: ~ # Bounds the mouse_x to the closest x value on the slider line~ - Inside source: true *** True Line Result - 8420,5040,8460,5120 -** Processing line: ~ 8460,5180,8460,5120~ + # Bounds the mouse_x to the closest x value on the slider line +** Processing line: ~ mouse_x = slider.x if mouse_x < slider.x~ - Inside source: true *** True Line Result - 8460,5180,8460,5120 -** Processing line: ~ 8360,5200,8460,5180~ + mouse_x = slider.x if mouse_x < slider.x +** Processing line: ~ mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w~ - Inside source: true *** True Line Result - 8360,5200,8460,5180 -** Processing line: ~ 8360,5280,8360,5200~ + mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w +** Processing line: ~~ - Inside source: true *** True Line Result - 8360,5280,8360,5200 -** Processing line: ~ 8160,5300,8360,5280~ + +** Processing line: ~ # Sets the current search step to the one represented by the mouse x value~ - Inside source: true *** True Line Result - 8160,5300,8360,5280 -** Processing line: ~ 8040,5260,8160,5300~ + # Sets the current search step to the one represented by the mouse x value +** Processing line: ~ # The slider's circle moves due to the render_slider method using anim_steps~ - Inside source: true *** True Line Result - 8040,5260,8160,5300 -** Processing line: ~ 7860,5220,8040,5260~ + # The slider's circle moves due to the render_slider method using anim_steps +** Processing line: ~ state.current_step = ((mouse_x - slider.x) / slider.spacing).to_i~ - Inside source: true *** True Line Result - 7860,5220,8040,5260 -** Processing line: ~ 7720,5160,7860,5220~ + state.current_step = ((mouse_x - slider.x) / slider.spacing).to_i +** Processing line: ~~ - Inside source: true *** True Line Result - 7720,5160,7860,5220 -** Processing line: ~ 7640,5120,7720,5160~ + +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 7640,5120,7720,5160 -** Processing line: ~ 7480,5120,7640,5120~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7480,5120,7640,5120 -** Processing line: ~ 7240,5120,7480,5120~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7240,5120,7480,5120 -** Processing line: ~ 7000,5120,7240,5120~ + +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ - Inside source: true *** True Line Result - 7000,5120,7240,5120 -** Processing line: ~ 6800,5160,7000,5120~ + # Moves the star to the cell closest to the mouse in the first grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - 6800,5160,7000,5120 -** Processing line: ~ 6640,5220,6800,5160~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - 6640,5220,6800,5160 -** Processing line: ~ 6600,5360,6640,5220~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def process_input_bfs_star~ - Inside source: true *** True Line Result - 6600,5360,6640,5220 -** Processing line: ~ 6600,5460,6600,5360~ + def process_input_bfs_star +** Processing line: ~ old_star = grid.star.clone~ - Inside source: true *** True Line Result - 6600,5460,6600,5360 -** Processing line: ~ 6480,5520,6600,5460~ + old_star = grid.star.clone +** Processing line: ~ unless bfs_cell_closest_to_mouse == grid.target~ - Inside source: true *** True Line Result - 6480,5520,6600,5460 -** Processing line: ~ 6240,5540,6480,5520~ + unless bfs_cell_closest_to_mouse == grid.target +** Processing line: ~ grid.star = bfs_cell_closest_to_mouse~ - Inside source: true *** True Line Result - 6240,5540,6480,5520 -** Processing line: ~ 5980,5540,6240,5540~ + grid.star = bfs_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5980,5540,6240,5540 -** Processing line: ~ 5740,5540,5980,5540~ + end +** Processing line: ~ unless old_star == grid.star~ - Inside source: true *** True Line Result - 5740,5540,5980,5540 -** Processing line: ~ 5500,5520,5740,5540~ + unless old_star == grid.star +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 5500,5520,5740,5540 -** Processing line: ~ 5400,5520,5500,5520~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5400,5520,5500,5520 -** Processing line: ~ 5280,5540,5400,5520~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5280,5540,5400,5520 -** Processing line: ~ 5080,5540,5280,5540~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5080,5540,5280,5540 -** Processing line: ~ 4940,5540,5080,5540~ + +** Processing line: ~ # Moves the star to the cell closest to the mouse in the second grid~ - Inside source: true *** True Line Result - 4940,5540,5080,5540 -** Processing line: ~ 4760,5540,4940,5540~ + # Moves the star to the cell closest to the mouse in the second grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - 4760,5540,4940,5540 -** Processing line: ~ 4600,5540,4760,5540~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - 4600,5540,4760,5540 -** Processing line: ~ 4440,5560,4600,5540~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def process_input_heuristic_star~ - Inside source: true *** True Line Result - 4440,5560,4600,5540 -** Processing line: ~ 4040,5580,4120,5520~ + def process_input_heuristic_star +** Processing line: ~ old_star = grid.star.clone~ - Inside source: true *** True Line Result - 4040,5580,4120,5520 -** Processing line: ~ 4260,5540,4440,5560~ + old_star = grid.star.clone +** Processing line: ~ unless heuristic_cell_closest_to_mouse == grid.target~ - Inside source: true *** True Line Result - 4260,5540,4440,5560 -** Processing line: ~ 4120,5520,4260,5540~ + unless heuristic_cell_closest_to_mouse == grid.target +** Processing line: ~ grid.star = heuristic_cell_closest_to_mouse~ - Inside source: true *** True Line Result - 4120,5520,4260,5540 -** Processing line: ~ 4020,5720,4040,5580~ + grid.star = heuristic_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4020,5720,4040,5580 -** Processing line: ~ 4020,5840,4020,5720~ + end +** Processing line: ~ unless old_star == grid.star~ - Inside source: true *** True Line Result - 4020,5840,4020,5720 -** Processing line: ~ 4020,5840,4080,5940~ + unless old_star == grid.star +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 4020,5840,4080,5940 -** Processing line: ~ 4080,5940,4120,6040~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4080,5940,4120,6040 -** Processing line: ~ 4120,6040,4200,6080~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4120,6040,4200,6080 -** Processing line: ~ 4200,6080,4340,6080~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4200,6080,4340,6080 -** Processing line: ~ 4340,6080,4500,6060~ + +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ - Inside source: true *** True Line Result - 4340,6080,4500,6060 -** Processing line: ~ 4500,6060,4700,6060~ + # Moves the target to the grid closest to the mouse in the first grid +** Processing line: ~ # Only recalculate_searchess the search if the target changes position~ - Inside source: true *** True Line Result - 4500,6060,4700,6060 -** Processing line: ~ 4700,6060,4880,6060~ + # Only recalculate_searchess the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ - Inside source: true *** True Line Result - 4700,6060,4880,6060 -** Processing line: ~ 4880,6060,5080,6060~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def process_input_bfs_target~ - Inside source: true *** True Line Result - 4880,6060,5080,6060 -** Processing line: ~ 5080,6060,5280,6080~ + def process_input_bfs_target +** Processing line: ~ old_target = grid.target.clone~ - Inside source: true *** True Line Result - 5080,6060,5280,6080 -** Processing line: ~ 5280,6080,5440,6100~ + old_target = grid.target.clone +** Processing line: ~ unless bfs_cell_closest_to_mouse == grid.star~ - Inside source: true *** True Line Result - 5280,6080,5440,6100 -** Processing line: ~ 5440,6100,5660,6100~ + unless bfs_cell_closest_to_mouse == grid.star +** Processing line: ~ grid.target = bfs_cell_closest_to_mouse~ - Inside source: true *** True Line Result - 5440,6100,5660,6100 -** Processing line: ~ 5660,6100,5900,6080~ + grid.target = bfs_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5660,6100,5900,6080 -** Processing line: ~ 5900,6080,6120,6080~ + end +** Processing line: ~ unless old_target == grid.target~ - Inside source: true *** True Line Result - 5900,6080,6120,6080 -** Processing line: ~ 6120,6080,6360,6080~ + unless old_target == grid.target +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 6120,6080,6360,6080 -** Processing line: ~ 6360,6080,6480,6100~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6360,6080,6480,6100 -** Processing line: ~ 6480,6100,6540,6060~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6480,6100,6540,6060 -** Processing line: ~ 6540,6060,6720,6060~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6540,6060,6720,6060 -** Processing line: ~ 6720,6060,6940,6060~ + +** Processing line: ~ # Moves the target to the cell closest to the mouse in the second grid~ - Inside source: true *** True Line Result - 6720,6060,6940,6060 -** Processing line: ~ 6940,6060,7140,6060~ + # Moves the target to the cell closest to the mouse in the second grid +** Processing line: ~ # Only recalculate_searchess the search if the target changes position~ - Inside source: true *** True Line Result - 6940,6060,7140,6060 -** Processing line: ~ 7400,6060,7600,6060~ + # Only recalculate_searchess the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ - Inside source: true *** True Line Result - 7400,6060,7600,6060 -** Processing line: ~ 7140,6060,7400,6060~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def process_input_heuristic_target~ - Inside source: true *** True Line Result - 7140,6060,7400,6060 -** Processing line: ~ 7600,6060,7800,6060~ + def process_input_heuristic_target +** Processing line: ~ old_target = grid.target.clone~ - Inside source: true *** True Line Result - 7600,6060,7800,6060 -** Processing line: ~ 7800,6060,7860,6080~ + old_target = grid.target.clone +** Processing line: ~ unless heuristic_cell_closest_to_mouse == grid.star~ - Inside source: true *** True Line Result - 7800,6060,7860,6080 -** Processing line: ~ 7860,6080,8060,6080~ + unless heuristic_cell_closest_to_mouse == grid.star +** Processing line: ~ grid.target = heuristic_cell_closest_to_mouse~ - Inside source: true *** True Line Result - 7860,6080,8060,6080 -** Processing line: ~ 8060,6080,8220,6080~ + grid.target = heuristic_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8060,6080,8220,6080 -** Processing line: ~ 8220,6080,8320,6140~ + end +** Processing line: ~ unless old_target == grid.target~ - Inside source: true *** True Line Result - 8220,6080,8320,6140 -** Processing line: ~ 8320,6140,8360,6300~ + unless old_target == grid.target +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 8320,6140,8360,6300 -** Processing line: ~ 8320,6460,8360,6300~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8320,6460,8360,6300 -** Processing line: ~ 8320,6620,8320,6460~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8320,6620,8320,6460 -** Processing line: ~ 8320,6800,8320,6620~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8320,6800,8320,6620 -** Processing line: ~ 8320,6960,8320,6800~ + +** Processing line: ~ # Removes walls in the first grid that are under the cursor~ - Inside source: true *** True Line Result - 8320,6960,8320,6800 -** Processing line: ~ 8320,6960,8360,7120~ + # Removes walls in the first grid that are under the cursor +** Processing line: ~ def process_input_bfs_remove_wall~ - Inside source: true *** True Line Result - 8320,6960,8360,7120 -** Processing line: ~ 8320,7280,8360,7120~ + def process_input_bfs_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - 8320,7280,8360,7120 -** Processing line: ~ 8320,7440,8320,7280~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - 8320,7440,8320,7280 -** Processing line: ~ 8320,7600,8320,7440~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - 8320,7600,8320,7440 -** Processing line: ~ 8100,7580,8220,7600~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if bfs_mouse_over_grid?~ - Inside source: true *** True Line Result - 8100,7580,8220,7600 -** Processing line: ~ 8220,7600,8320,7600~ + if bfs_mouse_over_grid? +** Processing line: ~ if grid.walls.has_key?(bfs_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - 8220,7600,8320,7600 -** Processing line: ~ 7900,7560,8100,7580~ + if grid.walls.has_key?(bfs_cell_closest_to_mouse) +** Processing line: ~ grid.walls.delete(bfs_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - 7900,7560,8100,7580 -** Processing line: ~ 7680,7560,7900,7560~ + grid.walls.delete(bfs_cell_closest_to_mouse) +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 7680,7560,7900,7560 -** Processing line: ~ 7480,7580,7680,7560~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7480,7580,7680,7560 -** Processing line: ~ 7280,7580,7480,7580~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7280,7580,7480,7580 -** Processing line: ~ 7080,7580,7280,7580~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7080,7580,7280,7580 -** Processing line: ~ 7000,7600,7080,7580~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7000,7600,7080,7580 -** Processing line: ~ 6880,7600,7000,7600~ + +** Processing line: ~ # Removes walls in the second grid that are under the cursor~ - Inside source: true *** True Line Result - 6880,7600,7000,7600 -** Processing line: ~ 6800,7580,6880,7600~ + # Removes walls in the second grid that are under the cursor +** Processing line: ~ def process_input_heuristic_remove_wall~ - Inside source: true *** True Line Result - 6800,7580,6880,7600 -** Processing line: ~ 6640,7580,6800,7580~ + def process_input_heuristic_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - 6640,7580,6800,7580 -** Processing line: ~ 6540,7580,6640,7580~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - 6540,7580,6640,7580 -** Processing line: ~ 6380,7600,6540,7580~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - 6380,7600,6540,7580 -** Processing line: ~ 6280,7620,6380,7600~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if heuristic_mouse_over_grid?~ - Inside source: true *** True Line Result - 6280,7620,6380,7600 -** Processing line: ~ 6240,7700,6280,7620~ + if heuristic_mouse_over_grid? +** Processing line: ~ if grid.walls.has_key?(heuristic_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - 6240,7700,6280,7620 -** Processing line: ~ 6240,7700,6240,7800~ + if grid.walls.has_key?(heuristic_cell_closest_to_mouse) +** Processing line: ~ grid.walls.delete(heuristic_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - 6240,7700,6240,7800 -** Processing line: ~ 6240,7840,6240,7800~ + grid.walls.delete(heuristic_cell_closest_to_mouse) +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 6240,7840,6240,7800 -** Processing line: ~ 6080,7840,6240,7840~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6080,7840,6240,7840 -** Processing line: ~ 5960,7820,6080,7840~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5960,7820,6080,7840 -** Processing line: ~ 5660,7840,5800,7840~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5660,7840,5800,7840 -** Processing line: ~ 5500,7800,5660,7840~ + end +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ - Inside source: true *** True Line Result - 5500,7800,5660,7840 -** Processing line: ~ 5440,7700,5500,7800~ + # Adds a wall in the first grid in the cell the mouse is over +** Processing line: ~ def process_input_bfs_add_wall~ - Inside source: true *** True Line Result - 5440,7700,5500,7800 -** Processing line: ~ 5800,7840,5960,7820~ + def process_input_bfs_add_wall +** Processing line: ~ if bfs_mouse_over_grid?~ - Inside source: true *** True Line Result - 5800,7840,5960,7820 -** Processing line: ~ 5440,7540,5440,7700~ + if bfs_mouse_over_grid? +** Processing line: ~ unless grid.walls.has_key?(bfs_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - 5440,7540,5440,7700 -** Processing line: ~ 5440,7440,5440,7540~ + unless grid.walls.has_key?(bfs_cell_closest_to_mouse) +** Processing line: ~ grid.walls[bfs_cell_closest_to_mouse] = true~ - Inside source: true *** True Line Result - 5440,7440,5440,7540 -** Processing line: ~ 5440,7320,5440,7440~ + grid.walls[bfs_cell_closest_to_mouse] = true +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 5440,7320,5440,7440 -** Processing line: ~ 5400,7320,5440,7320~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5400,7320,5440,7320 -** Processing line: ~ 5340,7400,5400,7320~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5340,7400,5400,7320 -** Processing line: ~ 5340,7400,5340,7500~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5340,7400,5340,7500 -** Processing line: ~ 5340,7600,5340,7500~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5340,7600,5340,7500 -** Processing line: ~ 5340,7600,5340,7720~ + +** Processing line: ~ # Adds a wall in the second grid in the cell the mouse is over~ - Inside source: true *** True Line Result - 5340,7600,5340,7720 -** Processing line: ~ 5340,7720,5340,7860~ + # Adds a wall in the second grid in the cell the mouse is over +** Processing line: ~ def process_input_heuristic_add_wall~ - Inside source: true *** True Line Result - 5340,7720,5340,7860 -** Processing line: ~ 5340,7860,5340,7960~ + def process_input_heuristic_add_wall +** Processing line: ~ if heuristic_mouse_over_grid?~ - Inside source: true *** True Line Result - 5340,7860,5340,7960 -** Processing line: ~ 5340,7960,5440,8020~ + if heuristic_mouse_over_grid? +** Processing line: ~ unless grid.walls.has_key?(heuristic_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - 5340,7960,5440,8020 -** Processing line: ~ 5440,8020,5560,8020~ + unless grid.walls.has_key?(heuristic_cell_closest_to_mouse) +** Processing line: ~ grid.walls[heuristic_cell_closest_to_mouse] = true~ - Inside source: true *** True Line Result - 5440,8020,5560,8020 -** Processing line: ~ 5560,8020,5720,8040~ + grid.walls[heuristic_cell_closest_to_mouse] = true +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 5560,8020,5720,8040 -** Processing line: ~ 5720,8040,5900,8060~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5720,8040,5900,8060 -** Processing line: ~ 5900,8060,6080,8060~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5900,8060,6080,8060 -** Processing line: ~ 6080,8060,6240,8060~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6080,8060,6240,8060 -** Processing line: ~ 6720,8040,6840,8060~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6720,8040,6840,8060 -** Processing line: ~ 6240,8060,6480,8040~ + +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - 6240,8060,6480,8040 -** Processing line: ~ 6480,8040,6720,8040~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - 6480,8040,6720,8040 -** Processing line: ~ 6840,8060,6940,8060~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ - Inside source: true *** True Line Result - 6840,8060,6940,8060 -** Processing line: ~ 6940,8060,7080,8120~ + # Finding the cell closest to the mouse helps with this +** Processing line: ~ def bfs_cell_closest_to_mouse~ - Inside source: true *** True Line Result - 6940,8060,7080,8120 -** Processing line: ~ 7080,8120,7140,8180~ + def bfs_cell_closest_to_mouse +** Processing line: ~ # Closest cell to the mouse in the first grid~ - Inside source: true *** True Line Result - 7080,8120,7140,8180 -** Processing line: ~ 7140,8460,7140,8320~ + # Closest cell to the mouse in the first grid +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - 7140,8460,7140,8320 -** Processing line: ~ 7140,8620,7140,8460~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - 7140,8620,7140,8460 -** Processing line: ~ 7140,8620,7140,8740~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Bound x and y to the grid~ - Inside source: true *** True Line Result - 7140,8620,7140,8740 -** Processing line: ~ 7140,8860,7140,8740~ + # Bound x and y to the grid +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - 7140,8860,7140,8740 -** Processing line: ~ 7140,8960,7140,8860~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - 7140,8960,7140,8860 -** Processing line: ~ 7140,8960,7200,9080~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - 7140,8960,7200,9080 -** Processing line: ~ 7140,9200,7200,9080~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - 7140,9200,7200,9080 -** Processing line: ~ 7140,9200,7200,9320~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7140,9200,7200,9320 -** Processing line: ~ 7200,9320,7200,9460~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7200,9320,7200,9460 -** Processing line: ~ 7200,9760,7200,9900~ + +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - 7200,9760,7200,9900 -** Processing line: ~ 7200,9620,7200,9460~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - 7200,9620,7200,9460 -** Processing line: ~ 7200,9620,7200,9760~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse in the second grid helps with this~ - Inside source: true *** True Line Result - 7200,9620,7200,9760 -** Processing line: ~ 7200,9900,7200,10060~ + # Finding the cell closest to the mouse in the second grid helps with this +** Processing line: ~ def heuristic_cell_closest_to_mouse~ - Inside source: true *** True Line Result - 7200,9900,7200,10060 -** Processing line: ~ 7200,10220,7200,10060~ + def heuristic_cell_closest_to_mouse +** Processing line: ~ # Closest cell grid to the mouse in the second~ - Inside source: true *** True Line Result - 7200,10220,7200,10060 -** Processing line: ~ 7200,10360,7200,10220~ + # Closest cell grid to the mouse in the second +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - 7200,10360,7200,10220 -** Processing line: ~ 7140,10400,7200,10360~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - 7140,10400,7200,10360 -** Processing line: ~ 6880,10400,7140,10400~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Translate the cell to the first grid~ - Inside source: true *** True Line Result - 6880,10400,7140,10400 -** Processing line: ~ 6640,10360,6880,10400~ + # Translate the cell to the first grid +** Processing line: ~ x -= grid.width + 1~ - Inside source: true *** True Line Result - 6640,10360,6880,10400 -** Processing line: ~ 6420,10360,6640,10360~ + x -= grid.width + 1 +** Processing line: ~ # Bound x and y to the first grid~ - Inside source: true *** True Line Result - 6420,10360,6640,10360 -** Processing line: ~ 6160,10380,6420,10360~ + # Bound x and y to the first grid +** Processing line: ~ x = 0 if x < 0~ - Inside source: true *** True Line Result - 6160,10380,6420,10360 -** Processing line: ~ 5940,10340,6160,10380~ + x = 0 if x < 0 +** Processing line: ~ y = 0 if y < 0~ - Inside source: true *** True Line Result - 5940,10340,6160,10380 -** Processing line: ~ 5720,10320,5940,10340~ + y = 0 if y < 0 +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - 5720,10320,5940,10340 -** Processing line: ~ 5500,10340,5720,10320~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - 5500,10340,5720,10320 -** Processing line: ~ 5280,10300,5500,10340~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - 5280,10300,5500,10340 -** Processing line: ~ 5080,10300,5280,10300~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - 5080,10300,5280,10300 -** Processing line: ~ 4840,10280,5080,10300~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4840,10280,5080,10300 -** Processing line: ~ 4700,10280,4840,10280~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4700,10280,4840,10280 -** Processing line: ~ 4540,10280,4700,10280~ + +** Processing line: ~ def recalculate_searches~ - Inside source: true *** True Line Result - 4540,10280,4700,10280 -** Processing line: ~ 4360,10280,4540,10280~ + def recalculate_searches +** Processing line: ~ # Reset the searches~ - Inside source: true *** True Line Result - 4360,10280,4540,10280 -** Processing line: ~ 4200,10300,4360,10280~ + # Reset the searches +** Processing line: ~ bfs.came_from = {}~ - Inside source: true *** True Line Result - 4200,10300,4360,10280 -** Processing line: ~ 4040,10380,4200,10300~ + bfs.came_from = {} +** Processing line: ~ bfs.frontier = []~ - Inside source: true *** True Line Result - 4040,10380,4200,10300 -** Processing line: ~ 4020,10500,4040,10380~ + bfs.frontier = [] +** Processing line: ~ bfs.path = []~ - Inside source: true *** True Line Result - 4020,10500,4040,10380 -** Processing line: ~ 3980,10640,4020,10500~ + bfs.path = [] +** Processing line: ~ heuristic.came_from = {}~ - Inside source: true *** True Line Result - 3980,10640,4020,10500 -** Processing line: ~ 3980,10640,3980,10760~ + heuristic.came_from = {} +** Processing line: ~ heuristic.frontier = []~ - Inside source: true *** True Line Result - 3980,10640,3980,10760 -** Processing line: ~ 3980,10760,4020,10920~ + heuristic.frontier = [] +** Processing line: ~ heuristic.path = []~ - Inside source: true *** True Line Result - 3980,10760,4020,10920 -** Processing line: ~ 4020,10920,4080,11000~ + heuristic.path = [] +** Processing line: ~~ - Inside source: true *** True Line Result - 4020,10920,4080,11000 -** Processing line: ~ 4080,11000,4340,11020~ + +** Processing line: ~ # Move the searches forward to the current step~ - Inside source: true *** True Line Result - 4080,11000,4340,11020 -** Processing line: ~ 4340,11020,4600,11060~ + # Move the searches forward to the current step +** Processing line: ~ state.current_step.times { move_searches_one_step_forward }~ - Inside source: true *** True Line Result - 4340,11020,4600,11060 -** Processing line: ~ 4600,11060,4840,11040~ + state.current_step.times { move_searches_one_step_forward } +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4600,11060,4840,11040 -** Processing line: ~ 4840,11040,4880,10960~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4840,11040,4880,10960 -** Processing line: ~ 4880,10740,4880,10960~ + +** Processing line: ~ def move_searches_one_step_forward~ - Inside source: true *** True Line Result - 4880,10740,4880,10960 -** Processing line: ~ 4880,10740,4880,10600~ + def move_searches_one_step_forward +** Processing line: ~ bfs_one_step_forward~ - Inside source: true *** True Line Result - 4880,10740,4880,10600 -** Processing line: ~ 4880,10600,5080,10560~ + bfs_one_step_forward +** Processing line: ~ heuristic_one_step_forward~ - Inside source: true *** True Line Result - 4880,10600,5080,10560 -** Processing line: ~ 5080,10560,5340,10620~ + heuristic_one_step_forward +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5080,10560,5340,10620 -** Processing line: ~ 5340,10620,5660,10620~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5340,10620,5660,10620 -** Processing line: ~ 5660,10620,6040,10600~ + +** Processing line: ~ def bfs_one_step_forward~ - Inside source: true *** True Line Result - 5660,10620,6040,10600 -** Processing line: ~ 6040,10600,6120,10620~ + def bfs_one_step_forward +** Processing line: ~ return if bfs.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - 6040,10600,6120,10620 -** Processing line: ~ 6120,10620,6240,10720~ + return if bfs.came_from.has_key?(grid.target) +** Processing line: ~~ - Inside source: true *** True Line Result - 6120,10620,6240,10720 -** Processing line: ~ 6240,10720,6420,10740~ + +** Processing line: ~ # Only runs at the beginning of the search as setup.~ - Inside source: true *** True Line Result - 6240,10720,6420,10740 -** Processing line: ~ 6420,10740,6640,10760~ + # Only runs at the beginning of the search as setup. +** Processing line: ~ if bfs.came_from.empty?~ - Inside source: true *** True Line Result - 6420,10740,6640,10760 -** Processing line: ~ 6640,10760,6880,10780~ + if bfs.came_from.empty? +** Processing line: ~ bfs.frontier << grid.star~ - Inside source: true *** True Line Result - 6640,10760,6880,10780 -** Processing line: ~ 7140,10780,7400,10780~ + bfs.frontier << grid.star +** Processing line: ~ bfs.came_from[grid.star] = nil~ - Inside source: true *** True Line Result - 7140,10780,7400,10780 -** Processing line: ~ 6880,10780,7140,10780~ + bfs.came_from[grid.star] = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6880,10780,7140,10780 -** Processing line: ~ 7400,10780,7680,10780~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7400,10780,7680,10780 -** Processing line: ~ 7680,10780,8100,10760~ + +** Processing line: ~ # A step in the search~ - Inside source: true *** True Line Result - 7680,10780,8100,10760 -** Processing line: ~ 8100,10760,8460,10740~ + # A step in the search +** Processing line: ~ unless bfs.frontier.empty?~ - Inside source: true *** True Line Result - 8100,10760,8460,10740 -** Processing line: ~ 8460,10740,8700,10760~ + unless bfs.frontier.empty? +** Processing line: ~ # Takes the next frontier cell~ - Inside source: true *** True Line Result - 8460,10740,8700,10760 -** Processing line: ~ 8800,10840,8800,10980~ + # Takes the next frontier cell +** Processing line: ~ new_frontier = bfs.frontier.shift~ - Inside source: true *** True Line Result - 8800,10840,8800,10980 -** Processing line: ~ 8700,10760,8800,10840~ + new_frontier = bfs.frontier.shift +** Processing line: ~ # For each of its neighbors~ - Inside source: true *** True Line Result - 8700,10760,8800,10840 -** Processing line: ~ 8760,11200,8800,10980~ + # For each of its neighbors +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ - Inside source: true *** True Line Result - 8760,11200,8800,10980 -** Processing line: ~ 8760,11200,8760,11380~ + adjacent_neighbors(new_frontier).each do |neighbor| +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - 8760,11200,8760,11380 -** Processing line: ~ 8760,11380,8800,11560~ + # That have not been visited and are not walls +** Processing line: ~ unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - 8760,11380,8800,11560 -** Processing line: ~ 8760,11680,8800,11560~ + unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited~ - Inside source: true *** True Line Result - 8760,11680,8800,11560 -** Processing line: ~ 8760,11760,8760,11680~ + # Add them to the frontier and mark them as visited +** Processing line: ~ bfs.frontier << neighbor~ - Inside source: true *** True Line Result - 8760,11760,8760,11680 -** Processing line: ~ 8760,11760,8760,11920~ + bfs.frontier << neighbor +** Processing line: ~ bfs.came_from[neighbor] = new_frontier~ - Inside source: true *** True Line Result - 8760,11760,8760,11920 -** Processing line: ~ 8760,11920,8800,12080~ + bfs.came_from[neighbor] = new_frontier +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8760,11920,8800,12080 -** Processing line: ~ 8800,12200,8800,12080~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8800,12200,8800,12080 -** Processing line: ~ 8700,12240,8800,12200~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8700,12240,8800,12200 -** Processing line: ~ 8560,12220,8700,12240~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8560,12220,8700,12240 -** Processing line: ~ 8360,12220,8560,12220~ + +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ - Inside source: true *** True Line Result - 8360,12220,8560,12220 -** Processing line: ~ 8160,12240,8360,12220~ + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line +** Processing line: ~ # Comment this line and let a path generate to see the difference~ - Inside source: true *** True Line Result - 8160,12240,8360,12220 -** Processing line: ~ 7720,12220,7980,12220~ + # Comment this line and let a path generate to see the difference +** Processing line: ~ bfs.frontier = bfs.frontier.sort_by {| cell | proximity_to_star(cell) }~ - Inside source: true *** True Line Result - 7720,12220,7980,12220 -** Processing line: ~ 7980,12220,8160,12240~ + bfs.frontier = bfs.frontier.sort_by {| cell | proximity_to_star(cell) } +** Processing line: ~~ - Inside source: true *** True Line Result - 7980,12220,8160,12240 -** Processing line: ~ 7400,12200,7720,12220~ + +** Processing line: ~ # If the search found the target~ - Inside source: true *** True Line Result - 7400,12200,7720,12220 -** Processing line: ~ 7200,12180,7400,12200~ + # If the search found the target +** Processing line: ~ if bfs.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - 7200,12180,7400,12200 -** Processing line: ~ 7000,12160,7200,12180~ + if bfs.came_from.has_key?(grid.target) +** Processing line: ~ # Calculate the path between the target and star~ - Inside source: true *** True Line Result - 7000,12160,7200,12180 -** Processing line: ~ 6800,12160,7000,12160~ + # Calculate the path between the target and star +** Processing line: ~ bfs_calc_path~ - Inside source: true *** True Line Result - 6800,12160,7000,12160 -** Processing line: ~ 6280,12140,6380,12180~ + bfs_calc_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6280,12140,6380,12180 -** Processing line: ~ 6120,12180,6280,12140~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6120,12180,6280,12140 -** Processing line: ~ 6540,12180,6800,12160~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6540,12180,6800,12160 -** Processing line: ~ 6380,12180,6540,12180~ + +** Processing line: ~ # Calculates the path between the target and star for the breadth first search~ - Inside source: true *** True Line Result - 6380,12180,6540,12180 -** Processing line: ~ 5900,12200,6120,12180~ + # Calculates the path between the target and star for the breadth first search +** Processing line: ~ # Only called when the breadth first search finds the target~ - Inside source: true *** True Line Result - 5900,12200,6120,12180 -** Processing line: ~ 5620,12180,5900,12200~ + # Only called when the breadth first search finds the target +** Processing line: ~ def bfs_calc_path~ - Inside source: true *** True Line Result - 5620,12180,5900,12200 -** Processing line: ~ 5340,12120,5620,12180~ + def bfs_calc_path +** Processing line: ~ # Start from the target~ - Inside source: true *** True Line Result - 5340,12120,5620,12180 -** Processing line: ~ 5140,12100,5340,12120~ + # Start from the target +** Processing line: ~ endpoint = grid.target~ - Inside source: true *** True Line Result - 5140,12100,5340,12120 -** Processing line: ~ 4980,12120,5140,12100~ + endpoint = grid.target +** Processing line: ~ # And the cell it came from~ - Inside source: true *** True Line Result - 4980,12120,5140,12100 -** Processing line: ~ 4840,12120,4980,12120~ + # And the cell it came from +** Processing line: ~ next_endpoint = bfs.came_from[endpoint]~ - Inside source: true *** True Line Result - 4840,12120,4980,12120 -** Processing line: ~ 4700,12200,4840,12120~ + next_endpoint = bfs.came_from[endpoint] +** Processing line: ~ while endpoint and next_endpoint~ - Inside source: true *** True Line Result - 4700,12200,4840,12120 -** Processing line: ~ 4700,12380,4700,12200~ + while endpoint and next_endpoint +** Processing line: ~ # Draw a path between these two cells and store it~ - Inside source: true *** True Line Result - 4700,12380,4700,12200 -** Processing line: ~ 4740,12480,4940,12520~ + # Draw a path between these two cells and store it +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ - Inside source: true *** True Line Result - 4740,12480,4940,12520 -** Processing line: ~ 4700,12380,4740,12480~ + path = get_path_between(endpoint, next_endpoint) +** Processing line: ~ bfs.path << path~ - Inside source: true *** True Line Result - 4700,12380,4740,12480 -** Processing line: ~ 4940,12520,5160,12560~ + bfs.path << path +** Processing line: ~ # And get the next pair of cells~ - Inside source: true *** True Line Result - 4940,12520,5160,12560 -** Processing line: ~ 5160,12560,5340,12600~ + # And get the next pair of cells +** Processing line: ~ endpoint = next_endpoint~ - Inside source: true *** True Line Result - 5160,12560,5340,12600 -** Processing line: ~ 5340,12600,5400,12600~ + endpoint = next_endpoint +** Processing line: ~ next_endpoint = bfs.came_from[endpoint]~ - Inside source: true *** True Line Result - 5340,12600,5400,12600 -** Processing line: ~ 5400,12600,5500,12600~ + next_endpoint = bfs.came_from[endpoint] +** Processing line: ~ # Continue till there are no more cells~ - Inside source: true *** True Line Result - 5400,12600,5500,12600 -** Processing line: ~ 5500,12600,5620,12600~ + # Continue till there are no more cells +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5500,12600,5620,12600 -** Processing line: ~ 5620,12600,5720,12560~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5620,12600,5720,12560 -** Processing line: ~ 5720,12560,5800,12440~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5720,12560,5800,12440 -** Processing line: ~ 5800,12440,5900,12380~ + +** Processing line: ~ # Moves the heuristic search forward one step~ - Inside source: true *** True Line Result - 5800,12440,5900,12380 -** Processing line: ~ 5900,12380,6120,12420~ + # Moves the heuristic search forward one step +** Processing line: ~ # Can be called from tick while the animation is playing~ - Inside source: true *** True Line Result - 5900,12380,6120,12420 -** Processing line: ~ 6120,12420,6380,12440~ + # Can be called from tick while the animation is playing +** Processing line: ~ # Can also be called when recalculating the searches after the user edited the grid~ - Inside source: true *** True Line Result - 6120,12420,6380,12440 -** Processing line: ~ 6380,12440,6600,12460~ + # Can also be called when recalculating the searches after the user edited the grid +** Processing line: ~ def heuristic_one_step_forward~ - Inside source: true *** True Line Result - 6380,12440,6600,12460 -** Processing line: ~ 6720,12460,6840,12520~ + def heuristic_one_step_forward +** Processing line: ~ # Stop the search if the target has been found~ - Inside source: true *** True Line Result - 6720,12460,6840,12520 -** Processing line: ~ 6840,12520,6960,12520~ + # Stop the search if the target has been found +** Processing line: ~ return if heuristic.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - 6840,12520,6960,12520 -** Processing line: ~ 6600,12460,6720,12460~ + return if heuristic.came_from.has_key?(grid.target) +** Processing line: ~~ - Inside source: true *** True Line Result - 6600,12460,6720,12460 -** Processing line: ~ 6960,12520,7040,12500~ + +** Processing line: ~ # If the search has not begun~ - Inside source: true *** True Line Result - 6960,12520,7040,12500 -** Processing line: ~ 7040,12500,7140,12440~ + # If the search has not begun +** Processing line: ~ if heuristic.came_from.empty?~ - Inside source: true *** True Line Result - 7040,12500,7140,12440 -** Processing line: ~ 7200,12440,7360,12500~ + if heuristic.came_from.empty? +** Processing line: ~ # Setup the search to begin from the star~ - Inside source: true *** True Line Result - 7200,12440,7360,12500 -** Processing line: ~ 7360,12500,7600,12560~ + # Setup the search to begin from the star +** Processing line: ~ heuristic.frontier << grid.star~ - Inside source: true *** True Line Result - 7360,12500,7600,12560 -** Processing line: ~ 7600,12560,7860,12600~ + heuristic.frontier << grid.star +** Processing line: ~ heuristic.came_from[grid.star] = nil~ - Inside source: true *** True Line Result - 7600,12560,7860,12600 -** Processing line: ~ 7860,12600,8060,12500~ + heuristic.came_from[grid.star] = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7860,12600,8060,12500 -** Processing line: ~ 8100,12500,8200,12340~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8100,12500,8200,12340 -** Processing line: ~ 8200,12340,8360,12360~ + +** Processing line: ~ # One step in the heuristic search~ - Inside source: true *** True Line Result - 8200,12340,8360,12360 -** Processing line: ~ 8360,12360,8560,12400~ + # One step in the heuristic search +** Processing line: ~~ - Inside source: true *** True Line Result - 8360,12360,8560,12400 -** Processing line: ~ 8560,12400,8660,12420~ + +** Processing line: ~ # Unless there are no more cells to explore from~ - Inside source: true *** True Line Result - 8560,12400,8660,12420 -** Processing line: ~ 8660,12420,8840,12400~ + # Unless there are no more cells to explore from +** Processing line: ~ unless heuristic.frontier.empty?~ - Inside source: true *** True Line Result - 8660,12420,8840,12400 -** Processing line: ~ 8840,12400,9000,12360~ + unless heuristic.frontier.empty? +** Processing line: ~ # Get the next cell to explore from~ - Inside source: true *** True Line Result - 8840,12400,9000,12360 -** Processing line: ~ 9000,12360,9000,12360~ + # Get the next cell to explore from +** Processing line: ~ new_frontier = heuristic.frontier.shift~ - Inside source: true *** True Line Result - 9000,12360,9000,12360 -** Processing line: ~ 2900,4400,2900,4280~ + new_frontier = heuristic.frontier.shift +** Processing line: ~ # For each of its neighbors~ - Inside source: true *** True Line Result - 2900,4400,2900,4280 -** Processing line: ~ 900,7320,1000,7220~ + # For each of its neighbors +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ - Inside source: true *** True Line Result - 900,7320,1000,7220 -** Processing line: ~ 2640,13040,2900,12920~ + adjacent_neighbors(new_frontier).each do |neighbor| +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - 2640,13040,2900,12920 -** Processing line: ~ 2900,12920,3160,12840~ + # That have not been visited and are not walls +** Processing line: ~ unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - 2900,12920,3160,12840 -** Processing line: ~ 3480,12760,3780,12620~ + unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited~ - Inside source: true *** True Line Result - 3480,12760,3780,12620 -** Processing line: ~ 3780,12620,4020,12460~ + # Add them to the frontier and mark them as visited +** Processing line: ~ heuristic.frontier << neighbor~ - Inside source: true *** True Line Result - 3780,12620,4020,12460 -** Processing line: ~ 4300,12360,4440,12260~ + heuristic.frontier << neighbor +** Processing line: ~ heuristic.came_from[neighbor] = new_frontier~ - Inside source: true *** True Line Result - 4300,12360,4440,12260 -** Processing line: ~ 4020,12460,4300,12360~ + heuristic.came_from[neighbor] = new_frontier +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4020,12460,4300,12360 -** Processing line: ~ 3160,12840,3480,12760~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3160,12840,3480,12760 -** Processing line: ~ 4440,12080,4440,12260~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4440,12080,4440,12260 -** Processing line: ~ 4440,12080,4440,11880~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4440,12080,4440,11880 -** Processing line: ~ 4440,11880,4440,11720~ + +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ - Inside source: true *** True Line Result - 4440,11880,4440,11720 -** Processing line: ~ 4440,11720,4600,11720~ + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line +** Processing line: ~ heuristic.frontier = heuristic.frontier.sort_by {| cell | proximity_to_star(cell) }~ - Inside source: true *** True Line Result - 4440,11720,4600,11720 -** Processing line: ~ 4600,11720,4760,11740~ + heuristic.frontier = heuristic.frontier.sort_by {| cell | proximity_to_star(cell) } +** Processing line: ~ # Sort the frontier so cells that are close to the target are then prioritized~ - Inside source: true *** True Line Result - 4600,11720,4760,11740 -** Processing line: ~ 4760,11740,4980,11760~ + # Sort the frontier so cells that are close to the target are then prioritized +** Processing line: ~ heuristic.frontier = heuristic.frontier.sort_by {| cell | heuristic_heuristic(cell) }~ - Inside source: true *** True Line Result - 4760,11740,4980,11760 -** Processing line: ~ 4980,11760,5160,11760~ + heuristic.frontier = heuristic.frontier.sort_by {| cell | heuristic_heuristic(cell) } +** Processing line: ~~ - Inside source: true *** True Line Result - 4980,11760,5160,11760 -** Processing line: ~ 5160,11760,5340,11780~ + +** Processing line: ~ # If the search found the target~ - Inside source: true *** True Line Result - 5160,11760,5340,11780 -** Processing line: ~ 6000,11860,6120,11820~ + # If the search found the target +** Processing line: ~ if heuristic.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - 6000,11860,6120,11820 -** Processing line: ~ 5340,11780,5620,11820~ + if heuristic.came_from.has_key?(grid.target) +** Processing line: ~ # Calculate the path between the target and star~ - Inside source: true *** True Line Result - 5340,11780,5620,11820 -** Processing line: ~ 5620,11820,6000,11860~ + # Calculate the path between the target and star +** Processing line: ~ heuristic_calc_path~ - Inside source: true *** True Line Result - 5620,11820,6000,11860 -** Processing line: ~ 6120,11820,6360,11820~ + heuristic_calc_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6120,11820,6360,11820 -** Processing line: ~ 6360,11820,6640,11860~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6360,11820,6640,11860 -** Processing line: ~ 6940,11920,7240,11940~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6940,11920,7240,11940 -** Processing line: ~ 7240,11940,7520,11960~ + +** Processing line: ~ # Returns one-dimensional absolute distance between cell and target~ - Inside source: true *** True Line Result - 7240,11940,7520,11960 -** Processing line: ~ 7520,11960,7860,11960~ + # Returns one-dimensional absolute distance between cell and target +** Processing line: ~ # Returns a number to compare distances between cells and the target~ - Inside source: true *** True Line Result - 7520,11960,7860,11960 -** Processing line: ~ 7860,11960,8100,11920~ + # Returns a number to compare distances between cells and the target +** Processing line: ~ def heuristic_heuristic(cell)~ - Inside source: true *** True Line Result - 7860,11960,8100,11920 -** Processing line: ~ 8100,11920,8420,11940~ + def heuristic_heuristic(cell) +** Processing line: ~ (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs~ - Inside source: true *** True Line Result - 8100,11920,8420,11940 -** Processing line: ~ 8420,11940,8460,11960~ + (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8420,11940,8460,11960 -** Processing line: ~ 8460,11960,8500,11860~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8460,11960,8500,11860 -** Processing line: ~ 8460,11760,8500,11860~ + +** Processing line: ~ # Calculates the path between the target and star for the heuristic search~ - Inside source: true *** True Line Result - 8460,11760,8500,11860 -** Processing line: ~ 8320,11720,8460,11760~ + # Calculates the path between the target and star for the heuristic search +** Processing line: ~ # Only called when the heuristic search finds the target~ - Inside source: true *** True Line Result - 8320,11720,8460,11760 -** Processing line: ~ 8160,11720,8320,11720~ + # Only called when the heuristic search finds the target +** Processing line: ~ def heuristic_calc_path~ - Inside source: true *** True Line Result - 8160,11720,8320,11720 -** Processing line: ~ 7940,11720,8160,11720~ + def heuristic_calc_path +** Processing line: ~ # Start from the target~ - Inside source: true *** True Line Result - 7940,11720,8160,11720 -** Processing line: ~ 7720,11700,7940,11720~ + # Start from the target +** Processing line: ~ endpoint = grid.target~ - Inside source: true *** True Line Result - 7720,11700,7940,11720 -** Processing line: ~ 7520,11680,7720,11700~ + endpoint = grid.target +** Processing line: ~ # And the cell it came from~ - Inside source: true *** True Line Result - 7520,11680,7720,11700 -** Processing line: ~ 7320,11680,7520,11680~ + # And the cell it came from +** Processing line: ~ next_endpoint = heuristic.came_from[endpoint]~ - Inside source: true *** True Line Result - 7320,11680,7520,11680 -** Processing line: ~ 7200,11620,7320,11680~ + next_endpoint = heuristic.came_from[endpoint] +** Processing line: ~ while endpoint and next_endpoint~ - Inside source: true *** True Line Result - 7200,11620,7320,11680 -** Processing line: ~ 7200,11620,7200,11500~ + while endpoint and next_endpoint +** Processing line: ~ # Draw a path between these two cells and store it~ - Inside source: true *** True Line Result - 7200,11620,7200,11500 -** Processing line: ~ 7200,11500,7280,11440~ + # Draw a path between these two cells and store it +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ - Inside source: true *** True Line Result - 7200,11500,7280,11440 -** Processing line: ~ 7280,11440,7420,11440~ + path = get_path_between(endpoint, next_endpoint) +** Processing line: ~ heuristic.path << path~ - Inside source: true *** True Line Result - 7280,11440,7420,11440 -** Processing line: ~ 7420,11440,7600,11440~ + heuristic.path << path +** Processing line: ~ # And get the next pair of cells~ - Inside source: true *** True Line Result - 7420,11440,7600,11440 -** Processing line: ~ 7600,11440,7980,11460~ + # And get the next pair of cells +** Processing line: ~ endpoint = next_endpoint~ - Inside source: true *** True Line Result - 7600,11440,7980,11460 -** Processing line: ~ 7980,11460,8160,11460~ + endpoint = next_endpoint +** Processing line: ~ next_endpoint = heuristic.came_from[endpoint]~ - Inside source: true *** True Line Result - 7980,11460,8160,11460 -** Processing line: ~ 8160,11460,8360,11460~ + next_endpoint = heuristic.came_from[endpoint] +** Processing line: ~ # Continue till there are no more cells~ - Inside source: true *** True Line Result - 8160,11460,8360,11460 -** Processing line: ~ 8360,11460,8460,11400~ + # Continue till there are no more cells +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8360,11460,8460,11400 -** Processing line: ~ 8420,11060,8500,11200~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8420,11060,8500,11200 -** Processing line: ~ 8280,11040,8420,11060~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8280,11040,8420,11060 -** Processing line: ~ 8100,11060,8280,11040~ + +** Processing line: ~ # Returns a list of adjacent cells~ - Inside source: true *** True Line Result - 8100,11060,8280,11040 -** Processing line: ~ 8460,11400,8500,11200~ + # Returns a list of adjacent cells +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ - Inside source: true *** True Line Result - 8460,11400,8500,11200 -** Processing line: ~ 7800,11060,8100,11060~ + # Used to determine what the next cells to be added to the frontier are +** Processing line: ~ def adjacent_neighbors(cell)~ - Inside source: true *** True Line Result - 7800,11060,8100,11060 -** Processing line: ~ 7520,11060,7800,11060~ + def adjacent_neighbors(cell) +** Processing line: ~ neighbors = []~ - Inside source: true *** True Line Result - 7520,11060,7800,11060 -** Processing line: ~ 7240,11060,7520,11060~ + neighbors = [] +** Processing line: ~~ - Inside source: true *** True Line Result - 7240,11060,7520,11060 -** Processing line: ~ 6940,11040,7240,11060~ + +** Processing line: ~ # Gets all the valid neighbors into the array~ - Inside source: true *** True Line Result - 6940,11040,7240,11060 -** Processing line: ~ 6640,11000,6940,11040~ + # Gets all the valid neighbors into the array +** Processing line: ~ # From southern neighbor, clockwise~ - Inside source: true *** True Line Result - 6640,11000,6940,11040 -** Processing line: ~ 6420,10980,6640,11000~ + # From southern neighbor, clockwise +** Processing line: ~ neighbors << [cell.x , cell.y - 1] unless cell.y == 0~ - Inside source: true *** True Line Result - 6420,10980,6640,11000 -** Processing line: ~ 6360,11060,6420,10980~ + neighbors << [cell.x , cell.y - 1] unless cell.y == 0 +** Processing line: ~ neighbors << [cell.x - 1, cell.y ] unless cell.x == 0~ - Inside source: true *** True Line Result - 6360,11060,6420,10980 -** Processing line: ~ 6360,11180,6360,11060~ + neighbors << [cell.x - 1, cell.y ] unless cell.x == 0 +** Processing line: ~ neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1~ - Inside source: true *** True Line Result - 6360,11180,6360,11060 -** Processing line: ~ 6200,11280,6360,11180~ + neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1 +** Processing line: ~ neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1~ - Inside source: true *** True Line Result - 6200,11280,6360,11180 -** Processing line: ~ 5960,11300,6200,11280~ + neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1 +** Processing line: ~~ - Inside source: true *** True Line Result - 5960,11300,6200,11280 -** Processing line: ~ 5720,11280,5960,11300~ + +** Processing line: ~ neighbors~ - Inside source: true *** True Line Result - 5720,11280,5960,11300 -** Processing line: ~ 5500,11280,5720,11280~ + neighbors +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5500,11280,5720,11280 -** Processing line: ~ 4940,11300,5200,11280~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4940,11300,5200,11280 -** Processing line: ~ 4660,11260,4940,11300~ + +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ - Inside source: true *** True Line Result - 4660,11260,4940,11300 -** Processing line: ~ 4440,11280,4660,11260~ + # Finds the vertical and horizontal distance of a cell from the star +** Processing line: ~ # and returns the larger value~ - Inside source: true *** True Line Result - 4440,11280,4660,11260 -** Processing line: ~ 4260,11280,4440,11280~ + # and returns the larger value +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ - Inside source: true *** True Line Result - 4260,11280,4440,11280 -** Processing line: ~ 4220,11220,4260,11280~ + # This method is used to have a zigzag pattern in the rendered path +** Processing line: ~ # A cell that is [5, 5] from the star,~ - Inside source: true *** True Line Result - 4220,11220,4260,11280 -** Processing line: ~ 4080,11280,4220,11220~ + # A cell that is [5, 5] from the star, +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ - Inside source: true *** True Line Result - 4080,11280,4220,11220 -** Processing line: ~ 3980,11420,4080,11280~ + # is explored before over a cell that is [0, 7] away. +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ - Inside source: true *** True Line Result - 3980,11420,4080,11280 -** Processing line: ~ 3980,11420,4040,11620~ + # So, if possible, the search tries to go diagonal (zigzag) first +** Processing line: ~ def proximity_to_star(cell)~ - Inside source: true *** True Line Result - 3980,11420,4040,11620 -** Processing line: ~ 4040,11620,4040,11820~ + def proximity_to_star(cell) +** Processing line: ~ distance_x = (grid.star.x - cell.x).abs~ - Inside source: true *** True Line Result - 4040,11620,4040,11820 -** Processing line: ~ 3980,11960,4040,11820~ + distance_x = (grid.star.x - cell.x).abs +** Processing line: ~ distance_y = (grid.star.y - cell.y).abs~ - Inside source: true *** True Line Result - 3980,11960,4040,11820 -** Processing line: ~ 3840,12000,3980,11960~ + distance_y = (grid.star.y - cell.y).abs +** Processing line: ~~ - Inside source: true *** True Line Result - 3840,12000,3980,11960 -** Processing line: ~ 3720,11940,3840,12000~ + +** Processing line: ~ if distance_x > distance_y~ - Inside source: true *** True Line Result - 3720,11940,3840,12000 -** Processing line: ~ 3680,11800,3720,11940~ + if distance_x > distance_y +** Processing line: ~ return distance_x~ - Inside source: true *** True Line Result - 3680,11800,3720,11940 -** Processing line: ~ 3680,11580,3680,11800~ + return distance_x +** Processing line: ~ else~ - Inside source: true *** True Line Result - 3680,11580,3680,11800 -** Processing line: ~ 3680,11360,3680,11580~ + else +** Processing line: ~ return distance_y~ - Inside source: true *** True Line Result - 3680,11360,3680,11580 -** Processing line: ~ 3680,11360,3680,11260~ + return distance_y +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3680,11360,3680,11260 -** Processing line: ~ 3680,11080,3680,11260~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3680,11080,3680,11260 -** Processing line: ~ 3680,11080,3680,10880~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3680,11080,3680,10880 -** Processing line: ~ 3680,10700,3680,10880~ + +** Processing line: ~ # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored.~ - Inside source: true *** True Line Result - 3680,10700,3680,10880 -** Processing line: ~ 3680,10700,3680,10620~ + # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored. +** Processing line: ~ def grid~ - Inside source: true *** True Line Result - 3680,10700,3680,10620 -** Processing line: ~ 3680,10480,3680,10620~ + def grid +** Processing line: ~ state.grid~ - Inside source: true *** True Line Result - 3680,10480,3680,10620 -** Processing line: ~ 3680,10480,3680,10300~ + state.grid +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3680,10480,3680,10300 -** Processing line: ~ 3680,10300,3680,10100~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3680,10300,3680,10100 -** Processing line: ~ 3680,10100,3680,9940~ + +** Processing line: ~ def buttons~ - Inside source: true *** True Line Result - 3680,10100,3680,9940 -** Processing line: ~ 3680,9940,3720,9860~ + def buttons +** Processing line: ~ state.buttons~ - Inside source: true *** True Line Result - 3680,9940,3720,9860 -** Processing line: ~ 3720,9860,3920,9900~ + state.buttons +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3720,9860,3920,9900 -** Processing line: ~ 3920,9900,4220,9880~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3920,9900,4220,9880 -** Processing line: ~ 4980,9940,5340,9960~ + +** Processing line: ~ def slider~ - Inside source: true *** True Line Result - 4980,9940,5340,9960 -** Processing line: ~ 4220,9880,4540,9900~ + def slider +** Processing line: ~ state.slider~ - Inside source: true *** True Line Result - 4220,9880,4540,9900 -** Processing line: ~ 4540,9900,4980,9940~ + state.slider +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4540,9900,4980,9940 -** Processing line: ~ 5340,9960,5620,9960~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5340,9960,5620,9960 -** Processing line: ~ 5620,9960,5900,9960~ + +** Processing line: ~ def bfs~ - Inside source: true *** True Line Result - 5620,9960,5900,9960 -** Processing line: ~ 5900,9960,6160,10000~ + def bfs +** Processing line: ~ state.bfs~ - Inside source: true *** True Line Result - 5900,9960,6160,10000 -** Processing line: ~ 6160,10000,6480,10000~ + state.bfs +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6160,10000,6480,10000 -** Processing line: ~ 6480,10000,6720,10000~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6480,10000,6720,10000 -** Processing line: ~ 6720,10000,6880,9860~ + +** Processing line: ~ def heuristic~ - Inside source: true *** True Line Result - 6720,10000,6880,9860 -** Processing line: ~ 6880,9860,6880,9520~ + def heuristic +** Processing line: ~ state.heuristic~ - Inside source: true *** True Line Result - 6880,9860,6880,9520 -** Processing line: ~ 6880,9520,6940,9340~ + state.heuristic +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6880,9520,6940,9340 -** Processing line: ~ 6940,9120,6940,9340~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6940,9120,6940,9340 -** Processing line: ~ 6940,9120,6940,8920~ + +** Processing line: ~ # Descriptive aliases for colors~ - Inside source: true *** True Line Result - 6940,9120,6940,8920 -** Processing line: ~ 6940,8700,6940,8920~ + # Descriptive aliases for colors +** Processing line: ~ def default_color~ - Inside source: true *** True Line Result - 6940,8700,6940,8920 -** Processing line: ~ 6880,8500,6940,8700~ + def default_color +** Processing line: ~ [221, 212, 213] # Light Brown~ - Inside source: true *** True Line Result - 6880,8500,6940,8700 -** Processing line: ~ 6880,8320,6880,8500~ + [221, 212, 213] # Light Brown +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6880,8320,6880,8500 -** Processing line: ~ 7140,8320,7140,8180~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7140,8320,7140,8180 -** Processing line: ~ 6760,8260,6880,8320~ + +** Processing line: ~ def wall_color~ - Inside source: true *** True Line Result - 6760,8260,6880,8320 -** Processing line: ~ 6540,8240,6760,8260~ + def wall_color +** Processing line: ~ [134, 134, 120] # Camo Green~ - Inside source: true *** True Line Result - 6540,8240,6760,8260 -** Processing line: ~ 6420,8180,6540,8240~ + [134, 134, 120] # Camo Green +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6420,8180,6540,8240 -** Processing line: ~ 6280,8240,6420,8180~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6280,8240,6420,8180 -** Processing line: ~ 6160,8300,6280,8240~ + +** Processing line: ~ def visited_color~ - Inside source: true *** True Line Result - 6160,8300,6280,8240 -** Processing line: ~ 6120,8400,6160,8300~ + def visited_color +** Processing line: ~ [204, 191, 179] # Dark Brown~ - Inside source: true *** True Line Result - 6120,8400,6160,8300 -** Processing line: ~ 6080,8520,6120,8400~ + [204, 191, 179] # Dark Brown +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6080,8520,6120,8400 -** Processing line: ~ 5840,8480,6080,8520~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5840,8480,6080,8520 -** Processing line: ~ 5620,8500,5840,8480~ + +** Processing line: ~ def frontier_color~ - Inside source: true *** True Line Result - 5620,8500,5840,8480 -** Processing line: ~ 5500,8500,5620,8500~ + def frontier_color +** Processing line: ~ [103, 136, 204] # Blue~ - Inside source: true *** True Line Result - 5500,8500,5620,8500 -** Processing line: ~ 5340,8560,5500,8500~ + [103, 136, 204] # Blue +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5340,8560,5500,8500 -** Processing line: ~ 5160,8540,5340,8560~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5160,8540,5340,8560 -** Processing line: ~ 4620,8520,4880,8520~ + +** Processing line: ~ def path_color~ - Inside source: true *** True Line Result - 4620,8520,4880,8520 -** Processing line: ~ 4360,8480,4620,8520~ + def path_color +** Processing line: ~ [231, 230, 228] # Pastel White~ - Inside source: true *** True Line Result - 4360,8480,4620,8520 -** Processing line: ~ 4880,8520,5160,8540~ + [231, 230, 228] # Pastel White +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4880,8520,5160,8540 -** Processing line: ~ 4140,8440,4360,8480~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4140,8440,4360,8480 -** Processing line: ~ 3920,8460,4140,8440~ + +** Processing line: ~ def button_color~ - Inside source: true *** True Line Result - 3920,8460,4140,8440 -** Processing line: ~ 3720,8380,3920,8460~ + def button_color +** Processing line: ~ [190, 190, 190] # Gray~ - Inside source: true *** True Line Result - 3720,8380,3920,8460 -** Processing line: ~ 3680,8160,3720,8380~ + [190, 190, 190] # Gray +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3680,8160,3720,8380 -** Processing line: ~ 3680,8160,3720,7940~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3680,8160,3720,7940 -** Processing line: ~ 3720,7720,3720,7940~ + end +** Processing line: ~ # Method that is called by DragonRuby periodically~ - Inside source: true *** True Line Result - 3720,7720,3720,7940 -** Processing line: ~ 3680,7580,3720,7720~ + # Method that is called by DragonRuby periodically +** Processing line: ~ # Used for updating animations and calculations~ - Inside source: true *** True Line Result - 3680,7580,3720,7720 -** Processing line: ~ 3680,7580,3720,7440~ + # Used for updating animations and calculations +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - 3680,7580,3720,7440 -** Processing line: ~ 3720,7440,3720,7300~ + def tick args +** Processing line: ~~ - Inside source: true *** True Line Result - 3720,7440,3720,7300 -** Processing line: ~ 3720,7160,3720,7300~ + +** Processing line: ~ # Pressing r will reset the application~ - Inside source: true *** True Line Result - 3720,7160,3720,7300 -** Processing line: ~ 3720,7160,3720,7020~ + # Pressing r will reset the application +** Processing line: ~ if args.inputs.keyboard.key_down.r~ - Inside source: true *** True Line Result - 3720,7160,3720,7020 -** Processing line: ~ 3720,7020,3780,6900~ + if args.inputs.keyboard.key_down.r +** Processing line: ~ args.gtk.reset~ - Inside source: true *** True Line Result - 3720,7020,3780,6900 -** Processing line: ~ 3780,6900,4080,6940~ + args.gtk.reset +** Processing line: ~ reset~ - Inside source: true *** True Line Result - 3780,6900,4080,6940 -** Processing line: ~ 4080,6940,4340,6980~ + reset +** Processing line: ~ return~ - Inside source: true *** True Line Result - 4080,6940,4340,6980 -** Processing line: ~ 4340,6980,4600,6980~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4340,6980,4600,6980 -** Processing line: ~ 4600,6980,4880,6980~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4600,6980,4880,6980 -** Processing line: ~ 4880,6980,5160,6980~ + +** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ - Inside source: true *** True Line Result - 4880,6980,5160,6980 -** Processing line: ~ 5160,6980,5400,7000~ + # Every tick, new args are passed, and the Breadth First Search tick is called +** Processing line: ~ $heuristic_with_walls ||= Heuristic_With_Walls.new(args)~ - Inside source: true *** True Line Result - 5160,6980,5400,7000 -** Processing line: ~ 5400,7000,5560,7020~ + $heuristic_with_walls ||= Heuristic_With_Walls.new(args) +** Processing line: ~ $heuristic_with_walls.args = args~ - Inside source: true *** True Line Result - 5400,7000,5560,7020 -** Processing line: ~ 5560,7020,5660,7080~ + $heuristic_with_walls.args = args +** Processing line: ~ $heuristic_with_walls.tick~ - Inside source: true *** True Line Result - 5560,7020,5660,7080 -** Processing line: ~ 5660,7080,5660,7280~ + $heuristic_with_walls.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5660,7080,5660,7280 -** Processing line: ~ 5660,7280,5660,7440~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5660,7280,5660,7440 -** Processing line: ~ 5660,7440,5740,7520~ + +** Processing line: ~~ - Inside source: true *** True Line Result - 5660,7440,5740,7520 -** Processing line: ~ 5740,7520,5740,7600~ + +** Processing line: ~ def reset~ - Inside source: true *** True Line Result - 5740,7520,5740,7600 -** Processing line: ~ 5740,7600,5900,7600~ + def reset +** Processing line: ~ $heuristic_with_walls = nil~ - Inside source: true *** True Line Result - 5740,7600,5900,7600 -** Processing line: ~ 5900,7600,6040,7540~ + $heuristic_with_walls = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5900,7600,6040,7540 -** Processing line: ~ 6040,7540,6040,7320~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6040,7540,6040,7320 -** Processing line: ~ 6040,7320,6120,7200~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - 6040,7320,6120,7200 -** Processing line: ~ 6120,7200,6120,7040~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - 6120,7200,6120,7040 -** Processing line: ~ 6120,7040,6240,7000~ + +** Processing line: ~*** Path Finding Algorithms - Heuristic With Walls - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Path Finding Algorithms - Heuristic With Walls - 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/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb~ - Inside source: true *** True Line Result - 6120,7040,6240,7000 -** Processing line: ~ 6240,7000,6480,7060~ + # ./samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb +** Processing line: ~ # This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ - Inside source: true *** True Line Result - 6240,7000,6480,7060 -** Processing line: ~ 6480,7060,6800,7060~ + # This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html +** Processing line: ~ # The effectiveness of the Heuristic search algorithm is shown through this demonstration.~ - Inside source: true *** True Line Result - 6480,7060,6800,7060 -** Processing line: ~ 6800,7060,7080,7080~ + # The effectiveness of the Heuristic search algorithm is shown through this demonstration. +** Processing line: ~ # Notice that both searches find the shortest path~ - Inside source: true *** True Line Result - 6800,7060,7080,7080 -** Processing line: ~ 7080,7080,7320,7100~ + # Notice that both searches find the shortest path +** Processing line: ~ # The heuristic search, however, explores less of the grid, and is therefore faster.~ - Inside source: true *** True Line Result - 7080,7080,7320,7100 -** Processing line: ~ 7940,7100,7980,6920~ + # The heuristic search, however, explores less of the grid, and is therefore faster. +** Processing line: ~ # The heuristic search prioritizes searching cells that are closer to the target.~ - Inside source: true *** True Line Result - 7940,7100,7980,6920 -** Processing line: ~ 7860,6860,7980,6920~ + # The heuristic search prioritizes searching cells that are closer to the target. +** Processing line: ~ # Make sure to look at the Heuristic with walls program to see some of the downsides of the heuristic algorithm.~ - Inside source: true *** True Line Result - 7860,6860,7980,6920 -** Processing line: ~ 7640,6860,7860,6860~ + # Make sure to look at the Heuristic with walls program to see some of the downsides of the heuristic algorithm. +** Processing line: ~~ - Inside source: true *** True Line Result - 7640,6860,7860,6860 -** Processing line: ~ 7400,6840,7640,6860~ + +** Processing line: ~ class Heuristic~ - Inside source: true *** True Line Result - 7400,6840,7640,6860 -** Processing line: ~ 7320,7100,7560,7120~ + class Heuristic +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - 7320,7100,7560,7120 -** Processing line: ~ 7560,7120,7760,7120~ + attr_gtk +** Processing line: ~~ - Inside source: true *** True Line Result - 7560,7120,7760,7120 -** Processing line: ~ 7760,7120,7940,7100~ + +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - 7760,7120,7940,7100 -** Processing line: ~ 7200,6820,7400,6840~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - 7200,6820,7400,6840 -** Processing line: ~ 7040,6820,7200,6820~ + defaults +** Processing line: ~ render~ - Inside source: true *** True Line Result - 7040,6820,7200,6820 -** Processing line: ~ 6600,6840,6840,6840~ + render +** Processing line: ~ input~ - Inside source: true *** True Line Result - 6600,6840,6840,6840 -** Processing line: ~ 6380,6800,6600,6840~ + input +** Processing line: ~ # If animation is playing, and max steps have not been reached~ - Inside source: true *** True Line Result - 6380,6800,6600,6840 -** Processing line: ~ 6120,6800,6380,6800~ + # If animation is playing, and max steps have not been reached +** Processing line: ~ # Move the search a step forward~ - Inside source: true *** True Line Result - 6120,6800,6380,6800 -** Processing line: ~ 5900,6840,6120,6800~ + # Move the search a step forward +** Processing line: ~ if state.play && state.current_step < state.max_steps~ - Inside source: true *** True Line Result - 5900,6840,6120,6800 -** Processing line: ~ 5620,6820,5900,6840~ + if state.play && state.current_step < state.max_steps +** Processing line: ~ # Variable that tells the program what step to recalculate up to~ - Inside source: true *** True Line Result - 5620,6820,5900,6840 -** Processing line: ~ 5400,6800,5620,6820~ + # Variable that tells the program what step to recalculate up to +** Processing line: ~ state.current_step += 1~ - Inside source: true *** True Line Result - 5400,6800,5620,6820 -** Processing line: ~ 5140,6800,5400,6800~ + state.current_step += 1 +** Processing line: ~ move_searches_one_step_forward~ - Inside source: true *** True Line Result - 5140,6800,5400,6800 -** Processing line: ~ 4880,6780,5140,6800~ + move_searches_one_step_forward +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4880,6780,5140,6800 -** Processing line: ~ 4600,6760,4880,6780~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4600,6760,4880,6780 -** Processing line: ~ 4340,6760,4600,6760~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4340,6760,4600,6760 -** Processing line: ~ 4080,6760,4340,6760~ + +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - 4080,6760,4340,6760 -** Processing line: ~ 3840,6740,4080,6760~ + def defaults +** Processing line: ~ # Variables to edit the size and appearance of the grid~ - Inside source: true *** True Line Result - 3840,6740,4080,6760 -** Processing line: ~ 3680,6720,3840,6740~ + # Variables to edit the size and appearance of the grid +** Processing line: ~ # Freely customizable to user's liking~ - Inside source: true *** True Line Result - 3680,6720,3840,6740 -** Processing line: ~ 3680,6720,3680,6560~ + # Freely customizable to user's liking +** Processing line: ~ grid.width ||= 15~ - Inside source: true *** True Line Result - 3680,6720,3680,6560 -** Processing line: ~ 3680,6560,3720,6400~ + grid.width ||= 15 +** Processing line: ~ grid.height ||= 15~ - Inside source: true *** True Line Result - 3680,6560,3720,6400 -** Processing line: ~ 3720,6400,3720,6200~ + grid.height ||= 15 +** Processing line: ~ grid.cell_size ||= 40~ - Inside source: true *** True Line Result - 3720,6400,3720,6200 -** Processing line: ~ 3720,6200,3780,6000~ + grid.cell_size ||= 40 +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ - Inside source: true *** True Line Result - 3720,6200,3780,6000 -** Processing line: ~ 3720,5780,3780,6000~ + grid.rect ||= [0, 0, grid.width, grid.height] +** Processing line: ~~ - Inside source: true *** True Line Result - 3720,5780,3780,6000 -** Processing line: ~ 3720,5580,3720,5780~ + +** Processing line: ~ grid.star ||= [0, 2]~ - Inside source: true *** True Line Result - 3720,5580,3720,5780 -** Processing line: ~ 3720,5360,3720,5580~ + grid.star ||= [0, 2] +** Processing line: ~ grid.target ||= [14, 12]~ - Inside source: true *** True Line Result - 3720,5360,3720,5580 -** Processing line: ~ 3720,5360,3840,5240~ + grid.target ||= [14, 12] +** Processing line: ~ grid.walls ||= {~ - Inside source: true *** True Line Result - 3720,5360,3840,5240 -** Processing line: ~ 3840,5240,4200,5260~ + grid.walls ||= { +** Processing line: ~ [2, 2] => true,~ - Inside source: true *** True Line Result - 3840,5240,4200,5260 -** Processing line: ~ 4200,5260,4600,5280~ + [2, 2] => true, +** Processing line: ~ [3, 2] => true,~ - Inside source: true *** True Line Result - 4200,5260,4600,5280 -** Processing line: ~ 4600,5280,4880,5280~ + [3, 2] => true, +** Processing line: ~ [4, 2] => true,~ - Inside source: true *** True Line Result - 4600,5280,4880,5280 -** Processing line: ~ 4880,5280,5140,5200~ + [4, 2] => true, +** Processing line: ~ [5, 2] => true,~ - Inside source: true *** True Line Result - 4880,5280,5140,5200 -** Processing line: ~ 5140,5200,5220,5100~ + [5, 2] => true, +** Processing line: ~ [6, 2] => true,~ - Inside source: true *** True Line Result - 5140,5200,5220,5100 -** Processing line: ~ 5220,5100,5280,4900~ + [6, 2] => true, +** Processing line: ~ [7, 2] => true,~ - Inside source: true *** True Line Result - 5220,5100,5280,4900 -** Processing line: ~ 5280,4900,5340,4840~ + [7, 2] => true, +** Processing line: ~ [8, 2] => true,~ - Inside source: true *** True Line Result - 5280,4900,5340,4840 -** Processing line: ~ 5340,4840,5720,4880~ + [8, 2] => true, +** Processing line: ~ [9, 2] => true,~ - Inside source: true *** True Line Result - 5340,4840,5720,4880 -** Processing line: ~ 6120,4880,6480,4860~ + [9, 2] => true, +** Processing line: ~ [10, 2] => true,~ - Inside source: true *** True Line Result - 6120,4880,6480,4860 -** Processing line: ~ 6880,4840,7200,4860~ + [10, 2] => true, +** Processing line: ~ [11, 2] => true,~ - Inside source: true *** True Line Result - 6880,4840,7200,4860 -** Processing line: ~ 6480,4860,6880,4840~ + [11, 2] => true, +** Processing line: ~ [12, 2] => true,~ - Inside source: true *** True Line Result - 6480,4860,6880,4840 -** Processing line: ~ 7200,4860,7320,4860~ + [12, 2] => true, +** Processing line: ~ [12, 3] => true,~ - Inside source: true *** True Line Result - 7200,4860,7320,4860 -** Processing line: ~ 7320,4860,7360,4740~ + [12, 3] => true, +** Processing line: ~ [12, 4] => true,~ - Inside source: true *** True Line Result - 7320,4860,7360,4740 -** Processing line: ~ 7360,4600,7440,4520~ + [12, 4] => true, +** Processing line: ~ [12, 5] => true,~ - Inside source: true *** True Line Result - 7360,4600,7440,4520 -** Processing line: ~ 7360,4600,7360,4740~ + [12, 5] => true, +** Processing line: ~ [12, 6] => true,~ - Inside source: true *** True Line Result - 7360,4600,7360,4740 -** Processing line: ~ 7440,4520,7640,4520~ + [12, 6] => true, +** Processing line: ~ [12, 7] => true,~ - Inside source: true *** True Line Result - 7440,4520,7640,4520 -** Processing line: ~ 7640,4520,7800,4480~ + [12, 7] => true, +** Processing line: ~ [12, 8] => true,~ - Inside source: true *** True Line Result - 7640,4520,7800,4480 -** Processing line: ~ 7800,4480,7800,4280~ + [12, 8] => true, +** Processing line: ~ [12, 9] => true,~ - Inside source: true *** True Line Result - 7800,4480,7800,4280 -** Processing line: ~ 7800,4280,7800,4040~ + [12, 9] => true, +** Processing line: ~ [12, 10] => true,~ - Inside source: true *** True Line Result - 7800,4280,7800,4040 -** Processing line: ~ 7800,4040,7800,3780~ + [12, 10] => true, +** Processing line: ~ [12, 11] => true,~ - Inside source: true *** True Line Result - 7800,4040,7800,3780 -** Processing line: ~ 7800,3560,7800,3780~ + [12, 11] => true, +** Processing line: ~ [12, 12] => true,~ - Inside source: true *** True Line Result - 7800,3560,7800,3780 -** Processing line: ~ 7800,3560,7860,3440~ + [12, 12] => true, +** Processing line: ~ [2, 12] => true,~ - Inside source: true *** True Line Result - 7800,3560,7860,3440 -** Processing line: ~ 7860,3440,8060,3460~ + [2, 12] => true, +** Processing line: ~ [3, 12] => true,~ - Inside source: true *** True Line Result - 7860,3440,8060,3460 -** Processing line: ~ 8060,3460,8160,3340~ + [3, 12] => true, +** Processing line: ~ [4, 12] => true,~ - Inside source: true *** True Line Result - 8060,3460,8160,3340 -** Processing line: ~ 8160,3340,8160,3140~ + [4, 12] => true, +** Processing line: ~ [5, 12] => true,~ - Inside source: true *** True Line Result - 8160,3340,8160,3140 -** Processing line: ~ 8160,3140,8160,2960~ + [5, 12] => true, +** Processing line: ~ [6, 12] => true,~ - Inside source: true *** True Line Result - 8160,3140,8160,2960 -** Processing line: ~ 8000,2900,8160,2960~ + [6, 12] => true, +** Processing line: ~ [7, 12] => true,~ - Inside source: true *** True Line Result - 8000,2900,8160,2960 -** Processing line: ~ 7860,2900,8000,2900~ + [7, 12] => true, +** Processing line: ~ [8, 12] => true,~ - Inside source: true *** True Line Result - 7860,2900,8000,2900 -** Processing line: ~ 7640,2940,7860,2900~ + [8, 12] => true, +** Processing line: ~ [9, 12] => true,~ - Inside source: true *** True Line Result - 7640,2940,7860,2900 -** Processing line: ~ 7400,2980,7640,2940~ + [9, 12] => true, +** Processing line: ~ [10, 12] => true,~ - Inside source: true *** True Line Result - 7400,2980,7640,2940 -** Processing line: ~ 7100,2980,7400,2980~ + [10, 12] => true, +** Processing line: ~ [11, 12] => true,~ - Inside source: true *** True Line Result - 7100,2980,7400,2980 -** Processing line: ~ 6840,3000,7100,2980~ + [11, 12] => true, +** Processing line: ~ [12, 12] => true~ - Inside source: true *** True Line Result - 6840,3000,7100,2980 -** Processing line: ~ 5620,2980,5840,2980~ + [12, 12] => true +** Processing line: ~ }~ - Inside source: true *** True Line Result - 5620,2980,5840,2980 -** Processing line: ~ 5840,2980,6500,3000~ + } +** Processing line: ~ # There are no hills in the Heuristic Search Demo~ - Inside source: true *** True Line Result - 5840,2980,6500,3000 -** Processing line: ~ 6500,3000,6840,3000~ + # There are no hills in the Heuristic Search Demo +** Processing line: ~~ - Inside source: true *** True Line Result - 6500,3000,6840,3000 -** Processing line: ~ 5560,2780,5620,2980~ + +** Processing line: ~ # What the user is currently editing on the grid~ - Inside source: true *** True Line Result - 5560,2780,5620,2980 -** Processing line: ~ 5560,2780,5560,2580~ + # What the user is currently editing on the grid +** Processing line: ~ # We store this value, because we want to remember the value even when~ - Inside source: true *** True Line Result - 5560,2780,5560,2580 -** Processing line: ~ 5560,2580,5560,2380~ + # We store this value, because we want to remember the value even when +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ - Inside source: true *** True Line Result - 5560,2580,5560,2380 -** Processing line: ~ 5560,2140,5560,2380~ + # the user's cursor is no longer over what they're interacting with, but +** Processing line: ~ # they are still clicking down on the mouse.~ - Inside source: true *** True Line Result - 5560,2140,5560,2380 -** Processing line: ~ 5560,2140,5560,1900~ + # they are still clicking down on the mouse. +** Processing line: ~ state.user_input ||= :none~ - Inside source: true *** True Line Result - 5560,2140,5560,1900 -** Processing line: ~ 5560,1900,5620,1660~ + state.user_input ||= :none +** Processing line: ~~ - Inside source: true *** True Line Result - 5560,1900,5620,1660 -** Processing line: ~ 5620,1660,5660,1460~ + +** Processing line: ~ # These variables allow the breadth first search to take place~ - Inside source: true *** True Line Result - 5620,1660,5660,1460 -** Processing line: ~ 5660,1460,5660,1300~ + # These variables allow the breadth first search to take place +** Processing line: ~ # 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.~ - Inside source: true *** True Line Result - 5660,1460,5660,1300 -** Processing line: ~ 5500,1260,5660,1300~ + # 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. +** Processing line: ~ # Used to prevent searching cells that have already been found~ - Inside source: true *** True Line Result - 5500,1260,5660,1300 -** Processing line: ~ 5340,1260,5500,1260~ + # Used to prevent searching cells that have already been found +** Processing line: ~ # and to trace a path from the target back to the starting point.~ - Inside source: true *** True Line Result - 5340,1260,5500,1260 -** Processing line: ~ 4600,1220,4840,1240~ + # and to trace a path from the target back to the starting point. +** Processing line: ~ # Frontier is an array of cells to expand the search from.~ - Inside source: true *** True Line Result - 4600,1220,4840,1240 -** Processing line: ~ 4440,1220,4600,1220~ + # Frontier is an array of cells to expand the search from. +** Processing line: ~ # The search is over when there are no more cells to search from.~ - Inside source: true *** True Line Result - 4440,1220,4600,1220 -** Processing line: ~ 4440,1080,4440,1220~ + # The search is over when there are no more cells to search from. +** Processing line: ~ # Path stores the path from the target to the star, once the target has been found~ - Inside source: true *** True Line Result - 4440,1080,4440,1220 -** Processing line: ~ 4440,1080,4600,1020~ + # Path stores the path from the target to the star, once the target has been found +** Processing line: ~ # It prevents calculating the path every tick.~ - Inside source: true *** True Line Result - 4440,1080,4600,1020 -** Processing line: ~ 5080,1260,5340,1260~ + # It prevents calculating the path every tick. +** Processing line: ~ bfs.came_from ||= {}~ - Inside source: true *** True Line Result - 5080,1260,5340,1260 -** Processing line: ~ 4840,1240,5080,1260~ + bfs.came_from ||= {} +** Processing line: ~ bfs.frontier ||= []~ - Inside source: true *** True Line Result - 4840,1240,5080,1260 -** Processing line: ~ 4600,1020,4940,1020~ + bfs.frontier ||= [] +** Processing line: ~ bfs.path ||= []~ - Inside source: true *** True Line Result - 4600,1020,4940,1020 -** Processing line: ~ 4940,1020,5220,1020~ + bfs.path ||= [] +** Processing line: ~~ - Inside source: true *** True Line Result - 4940,1020,5220,1020 -** Processing line: ~ 5220,1020,5560,960~ + +** Processing line: ~ heuristic.came_from ||= {}~ - Inside source: true *** True Line Result - 5220,1020,5560,960 -** Processing line: ~ 5560,960,5660,860~ + heuristic.came_from ||= {} +** Processing line: ~ heuristic.frontier ||= []~ - Inside source: true *** True Line Result - 5560,960,5660,860 -** Processing line: ~ 5660,740,5660,860~ + heuristic.frontier ||= [] +** Processing line: ~ heuristic.path ||= []~ - Inside source: true *** True Line Result - 5660,740,5660,860 -** Processing line: ~ 5280,740,5660,740~ + heuristic.path ||= [] +** Processing line: ~~ - Inside source: true *** True Line Result - 5280,740,5660,740 -** Processing line: ~ 4940,780,5280,740~ + +** Processing line: ~ # Stores which step of the animation is being rendered~ - Inside source: true *** True Line Result - 4940,780,5280,740 -** Processing line: ~ 4660,760,4940,780~ + # Stores which step of the animation is being rendered +** Processing line: ~ # When the user moves the star or messes with the walls,~ - Inside source: true *** True Line Result - 4660,760,4940,780 -** Processing line: ~ 4500,700,4660,760~ + # When the user moves the star or messes with the walls, +** Processing line: ~ # the searches are recalculated up to this step~ - Inside source: true *** True Line Result - 4500,700,4660,760 -** Processing line: ~ 4500,520,4500,700~ + # the searches are recalculated up to this step +** Processing line: ~~ - Inside source: true *** True Line Result - 4500,520,4500,700 -** Processing line: ~ 4500,520,4700,460~ + +** Processing line: ~ # Unless the current step has a value~ - Inside source: true *** True Line Result - 4500,520,4700,460 -** Processing line: ~ 4700,460,5080,440~ + # Unless the current step has a value +** Processing line: ~ unless state.current_step~ - Inside source: true *** True Line Result - 4700,460,5080,440 -** Processing line: ~ 5440,420,5740,420~ + unless state.current_step +** Processing line: ~ # Set the current step to 10~ - Inside source: true *** True Line Result - 5440,420,5740,420 -** Processing line: ~ 5080,440,5440,420~ + # Set the current step to 10 +** Processing line: ~ state.current_step = 10~ - Inside source: true *** True Line Result - 5080,440,5440,420 -** Processing line: ~ 5740,420,5840,360~ + state.current_step = 10 +** Processing line: ~ # And calculate the searches up to step 10~ - Inside source: true *** True Line Result - 5740,420,5840,360 -** Processing line: ~ 5800,280,5840,360~ + # And calculate the searches up to step 10 +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 5800,280,5840,360 -** Processing line: ~ 5560,280,5800,280~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5560,280,5800,280 -** Processing line: ~ 4980,300,5280,320~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4980,300,5280,320 -** Processing line: ~ 4360,320,4660,300~ + +** Processing line: ~ # At some step the animation will end,~ - Inside source: true *** True Line Result - 4360,320,4660,300 -** Processing line: ~ 4200,360,4360,320~ + # At some step the animation will end, +** Processing line: ~ # and further steps won't change anything (the whole grid will be explored)~ - Inside source: true *** True Line Result - 4200,360,4360,320 -** Processing line: ~ 5280,320,5560,280~ + # and further steps won't change anything (the whole grid will be explored) +** Processing line: ~ # This step is roughly the grid's width * height~ - Inside source: true *** True Line Result - 5280,320,5560,280 -** Processing line: ~ 4660,300,4980,300~ + # This step is roughly the grid's width * height +** Processing line: ~ # When anim_steps equals max_steps no more calculations will occur~ - Inside source: true *** True Line Result - 4660,300,4980,300 -** Processing line: ~ 4140,480,4200,360~ + # When anim_steps equals max_steps no more calculations will occur +** Processing line: ~ # and the slider will be at the end~ - Inside source: true *** True Line Result - 4140,480,4200,360 -** Processing line: ~ 4140,480,4140,640~ + # and the slider will be at the end +** Processing line: ~ state.max_steps = grid.width * grid.height~ - Inside source: true *** True Line Result - 4140,480,4140,640 -** Processing line: ~ 4140,640,4200,780~ + state.max_steps = grid.width * grid.height +** Processing line: ~~ - Inside source: true *** True Line Result - 4140,640,4200,780 -** Processing line: ~ 4200,780,4200,980~ + +** Processing line: ~ # Whether the animation should play or not~ - Inside source: true *** True Line Result - 4200,780,4200,980 -** Processing line: ~ 4200,980,4220,1180~ + # Whether the animation should play or not +** Processing line: ~ # If true, every tick moves anim_steps forward one~ - Inside source: true *** True Line Result - 4200,980,4220,1180 -** Processing line: ~ 4220,1400,4220,1180~ + # If true, every tick moves anim_steps forward one +** Processing line: ~ # Pressing the stepwise animation buttons will pause the animation~ - Inside source: true *** True Line Result - 4220,1400,4220,1180 -** Processing line: ~ 4220,1400,4260,1540~ + # Pressing the stepwise animation buttons will pause the animation +** Processing line: ~ # An if statement instead of the ||= operator is used for assigning a boolean value.~ - Inside source: true *** True Line Result - 4220,1400,4260,1540 -** Processing line: ~ 4260,1540,4500,1540~ + # An if statement instead of the ||= operator is used for assigning a boolean value. +** Processing line: ~ # The || operator does not differentiate between nil and false.~ - Inside source: true *** True Line Result - 4260,1540,4500,1540 -** Processing line: ~ 4500,1540,4700,1520~ + # The || operator does not differentiate between nil and false. +** Processing line: ~ if state.play == nil~ - Inside source: true *** True Line Result - 4500,1540,4700,1520 -** Processing line: ~ 4700,1520,4980,1540~ + if state.play == nil +** Processing line: ~ state.play = false~ - Inside source: true *** True Line Result - 4700,1520,4980,1540 -** Processing line: ~ 5280,1560,5400,1560~ + state.play = false +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5280,1560,5400,1560 -** Processing line: ~ 4980,1540,5280,1560~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4980,1540,5280,1560 -** Processing line: ~ 5400,1560,5400,1700~ + +** Processing line: ~ # Store the rects of the buttons that control the animation~ - Inside source: true *** True Line Result - 5400,1560,5400,1700 -** Processing line: ~ 5400,1780,5400,1700~ + # Store the rects of the buttons that control the animation +** Processing line: ~ # They are here for user customization~ - Inside source: true *** True Line Result - 5400,1780,5400,1700 -** Processing line: ~ 5340,1900,5400,1780~ + # They are here for user customization +** Processing line: ~ # Editing these might require recentering the text inside them~ - Inside source: true *** True Line Result - 5340,1900,5400,1780 -** Processing line: ~ 5340,2020,5340,1900~ + # Editing these might require recentering the text inside them +** Processing line: ~ # Those values can be found in the render_button methods~ - Inside source: true *** True Line Result - 5340,2020,5340,1900 -** Processing line: ~ 5340,2220,5340,2020~ + # Those values can be found in the render_button methods +** Processing line: ~ buttons.left = [470, 600, 50, 50]~ - Inside source: true *** True Line Result - 5340,2220,5340,2020 -** Processing line: ~ 5340,2220,5340,2420~ + buttons.left = [470, 600, 50, 50] +** Processing line: ~ buttons.center = [520, 600, 200, 50]~ - Inside source: true *** True Line Result - 5340,2220,5340,2420 -** Processing line: ~ 5340,2420,5340,2520~ + buttons.center = [520, 600, 200, 50] +** Processing line: ~ buttons.right = [720, 600, 50, 50]~ - Inside source: true *** True Line Result - 5340,2420,5340,2520 -** Processing line: ~ 5080,2600,5220,2580~ + buttons.right = [720, 600, 50, 50] +** Processing line: ~~ - Inside source: true *** True Line Result - 5080,2600,5220,2580 -** Processing line: ~ 5220,2580,5340,2520~ + +** Processing line: ~ # The variables below are related to the slider~ - Inside source: true *** True Line Result - 5220,2580,5340,2520 -** Processing line: ~ 4900,2580,5080,2600~ + # The variables below are related to the slider +** Processing line: ~ # They allow the user to customize them~ - Inside source: true *** True Line Result - 4900,2580,5080,2600 -** Processing line: ~ 4700,2540,4900,2580~ + # They allow the user to customize them +** Processing line: ~ # They also give a central location for the render and input methods to get~ - Inside source: true *** True Line Result - 4700,2540,4900,2580 -** Processing line: ~ 4500,2540,4700,2540~ + # They also give a central location for the render and input methods to get +** Processing line: ~ # information from~ - Inside source: true *** True Line Result - 4500,2540,4700,2540 -** Processing line: ~ 4220,2580,4340,2540~ + # information from +** Processing line: ~ # x & y are the coordinates of the leftmost part of the slider line~ - Inside source: true *** True Line Result - 4220,2580,4340,2540 -** Processing line: ~ 4200,2700,4220,2580~ + # x & y are the coordinates of the leftmost part of the slider line +** Processing line: ~ slider.x = 440~ - Inside source: true *** True Line Result - 4200,2700,4220,2580 -** Processing line: ~ 4340,2540,4500,2540~ + slider.x = 440 +** Processing line: ~ slider.y = 675~ - Inside source: true *** True Line Result - 4340,2540,4500,2540 -** Processing line: ~ 3980,2740,4200,2700~ + slider.y = 675 +** Processing line: ~ # This is the width of the line~ - Inside source: true *** True Line Result - 3980,2740,4200,2700 -** Processing line: ~ 3840,2740,3980,2740~ + # This is the width of the line +** Processing line: ~ slider.w = 360~ - Inside source: true *** True Line Result - 3840,2740,3980,2740 -** Processing line: ~ 3780,2640,3840,2740~ + slider.w = 360 +** Processing line: ~ # This is the offset for the circle~ - Inside source: true *** True Line Result - 3780,2640,3840,2740 -** Processing line: ~ 3780,2640,3780,2460~ + # This is the offset for the circle +** Processing line: ~ # Allows the center of the circle to be on the line,~ - Inside source: true *** True Line Result - 3780,2640,3780,2460 -** Processing line: ~ 3780,2280,3780,2460~ + # Allows the center of the circle to be on the line, +** Processing line: ~ # as opposed to the upper right corner~ - Inside source: true *** True Line Result - 3780,2280,3780,2460 -** Processing line: ~ 3620,2020,3780,2100~ + # as opposed to the upper right corner +** Processing line: ~ slider.offset = 20~ - Inside source: true *** True Line Result - 3620,2020,3780,2100 -** Processing line: ~ 3780,2280,3780,2100~ + slider.offset = 20 +** Processing line: ~ # This is the spacing between each of the notches on the slider~ - Inside source: true *** True Line Result - 3780,2280,3780,2100 -** Processing line: ~ 3360,2040,3620,2020~ + # This is the spacing between each of the notches on the slider +** Processing line: ~ # Notches are places where the circle can rest on the slider line~ - Inside source: true *** True Line Result - 3360,2040,3620,2020 -** Processing line: ~ 3080,2040,3360,2040~ + # Notches are places where the circle can rest on the slider line +** Processing line: ~ # There needs to be a notch for each step before the maximum number of steps~ - Inside source: true *** True Line Result - 3080,2040,3360,2040 -** Processing line: ~ 2840,2020,3080,2040~ + # There needs to be a notch for each step before the maximum number of steps +** Processing line: ~ slider.spacing = slider.w.to_f / state.max_steps.to_f~ - Inside source: true *** True Line Result - 2840,2020,3080,2040 -** Processing line: ~ 2740,1940,2840,2020~ + slider.spacing = slider.w.to_f / state.max_steps.to_f +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2740,1940,2840,2020 -** Processing line: ~ 2740,1940,2800,1800~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2740,1940,2800,1800 -** Processing line: ~ 2800,1640,2800,1800~ + +** Processing line: ~ # All methods with render draw stuff on the screen~ - Inside source: true *** True Line Result - 2800,1640,2800,1800 -** Processing line: ~ 2800,1640,2800,1460~ + # All methods with render draw stuff on the screen +** Processing line: ~ # UI has buttons, the slider, and labels~ - Inside source: true *** True Line Result - 2800,1640,2800,1460 -** Processing line: ~ 2800,1300,2800,1460~ + # UI has buttons, the slider, and labels +** Processing line: ~ # The search specific rendering occurs in the respective methods~ - Inside source: true *** True Line Result - 2800,1300,2800,1460 -** Processing line: ~ 2700,1180,2800,1300~ + # The search specific rendering occurs in the respective methods +** Processing line: ~ def render~ - Inside source: true *** True Line Result - 2700,1180,2800,1300 -** Processing line: ~ 2480,1140,2700,1180~ + def render +** Processing line: ~ render_ui~ - Inside source: true *** True Line Result - 2480,1140,2700,1180 -** Processing line: ~ 1580,1200,1720,1200~ + render_ui +** Processing line: ~ render_bfs~ - Inside source: true *** True Line Result - 1580,1200,1720,1200 -** Processing line: ~ 2240,1180,2480,1140~ + render_bfs +** Processing line: ~ render_heuristic~ - Inside source: true *** True Line Result - 2240,1180,2480,1140 -** Processing line: ~ 1960,1180,2240,1180~ + render_heuristic +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1960,1180,2240,1180 -** Processing line: ~ 1720,1200,1960,1180~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1720,1200,1960,1180 -** Processing line: ~ 1500,1320,1580,1200~ + +** Processing line: ~ def render_ui~ - Inside source: true *** True Line Result - 1500,1320,1580,1200 -** Processing line: ~ 1500,1440,1500,1320~ + def render_ui +** Processing line: ~ render_buttons~ - Inside source: true *** True Line Result - 1500,1440,1500,1320 -** Processing line: ~ 1500,1440,1760,1480~ + render_buttons +** Processing line: ~ render_slider~ - Inside source: true *** True Line Result - 1500,1440,1760,1480 -** Processing line: ~ 1760,1480,1940,1480~ + render_slider +** Processing line: ~ render_labels~ - Inside source: true *** True Line Result - 1760,1480,1940,1480 -** Processing line: ~ 1940,1480,2140,1500~ + render_labels +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1940,1480,2140,1500 -** Processing line: ~ 2140,1500,2320,1520~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2140,1500,2320,1520 -** Processing line: ~ 2400,1560,2400,1700~ + +** Processing line: ~ def render_buttons~ - Inside source: true *** True Line Result - 2400,1560,2400,1700 -** Processing line: ~ 2280,1820,2380,1780~ + def render_buttons +** Processing line: ~ render_left_button~ - Inside source: true *** True Line Result - 2280,1820,2380,1780 -** Processing line: ~ 2320,1520,2400,1560~ + render_left_button +** Processing line: ~ render_center_button~ - Inside source: true *** True Line Result - 2320,1520,2400,1560 -** Processing line: ~ 2380,1780,2400,1700~ + render_center_button +** Processing line: ~ render_right_button~ - Inside source: true *** True Line Result - 2380,1780,2400,1700 -** Processing line: ~ 2080,1840,2280,1820~ + render_right_button +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2080,1840,2280,1820 -** Processing line: ~ 1720,1820,2080,1840~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1720,1820,2080,1840 -** Processing line: ~ 1420,1800,1720,1820~ + +** Processing line: ~ def render_bfs~ - Inside source: true *** True Line Result - 1420,1800,1720,1820 -** Processing line: ~ 1280,1800,1420,1800~ + def render_bfs +** Processing line: ~ render_bfs_grid~ - Inside source: true *** True Line Result - 1280,1800,1420,1800 -** Processing line: ~ 1240,1720,1280,1800~ + render_bfs_grid +** Processing line: ~ render_bfs_star~ - Inside source: true *** True Line Result - 1240,1720,1280,1800 -** Processing line: ~ 1240,1720,1240,1600~ + render_bfs_star +** Processing line: ~ render_bfs_target~ - Inside source: true *** True Line Result - 1240,1720,1240,1600 -** Processing line: ~ 1240,1600,1280,1480~ + render_bfs_target +** Processing line: ~ render_bfs_visited~ - Inside source: true *** True Line Result - 1240,1600,1280,1480 -** Processing line: ~ 1280,1340,1280,1480~ + render_bfs_visited +** Processing line: ~ render_bfs_walls~ - Inside source: true *** True Line Result - 1280,1340,1280,1480 -** Processing line: ~ 1180,1280,1280,1340~ + render_bfs_walls +** Processing line: ~ render_bfs_frontier~ - Inside source: true *** True Line Result - 1180,1280,1280,1340 -** Processing line: ~ 1000,1280,1180,1280~ + render_bfs_frontier +** Processing line: ~ render_bfs_path~ - Inside source: true *** True Line Result - 1000,1280,1180,1280 -** Processing line: ~ 760,1280,1000,1280~ + render_bfs_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - 760,1280,1000,1280 -** Processing line: ~ 360,1240,540,1260~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 360,1240,540,1260 -** Processing line: ~ 180,1220,360,1240~ + +** Processing line: ~ def render_heuristic~ - Inside source: true *** True Line Result - 180,1220,360,1240 -** Processing line: ~ 540,1260,760,1280~ + def render_heuristic +** Processing line: ~ render_heuristic_grid~ - Inside source: true *** True Line Result - 540,1260,760,1280 -** Processing line: ~ 180,1080,180,1220~ + render_heuristic_grid +** Processing line: ~ render_heuristic_star~ - Inside source: true *** True Line Result - 180,1080,180,1220 -** Processing line: ~ 180,1080,180,1000~ + render_heuristic_star +** Processing line: ~ render_heuristic_target~ - Inside source: true *** True Line Result - 180,1080,180,1000 -** Processing line: ~ 180,1000,360,940~ + render_heuristic_target +** Processing line: ~ render_heuristic_visited~ - Inside source: true *** True Line Result - 180,1000,360,940 -** Processing line: ~ 360,940,540,960~ + render_heuristic_visited +** Processing line: ~ render_heuristic_walls~ - Inside source: true *** True Line Result - 360,940,540,960 -** Processing line: ~ 540,960,820,980~ + render_heuristic_walls +** Processing line: ~ render_heuristic_frontier~ - Inside source: true *** True Line Result - 540,960,820,980 -** Processing line: ~ 1100,980,1200,920~ + render_heuristic_frontier +** Processing line: ~ render_heuristic_path~ - Inside source: true *** True Line Result - 1100,980,1200,920 -** Processing line: ~ 820,980,1100,980~ + render_heuristic_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - 820,980,1100,980 -** Processing line: ~ 6640,11860,6940,11920~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6640,11860,6940,11920 -** Processing line: ~ 5200,11280,5500,11280~ + +** Processing line: ~ # This method handles user input every tick~ - Inside source: true *** True Line Result - 5200,11280,5500,11280 -** Processing line: ~ 4120,7330,4120,7230~ + # This method handles user input every tick +** Processing line: ~ def input~ - Inside source: true *** True Line Result - 4120,7330,4120,7230 -** Processing line: ~ 4120,7230,4660,7250~ + def input +** Processing line: ~ # Check and handle button input~ - Inside source: true *** True Line Result - 4120,7230,4660,7250 -** Processing line: ~ 4660,7250,4940,7250~ + # Check and handle button input +** Processing line: ~ input_buttons~ - Inside source: true *** True Line Result - 4660,7250,4940,7250 -** Processing line: ~ 4940,7250,5050,7340~ + input_buttons +** Processing line: ~~ - Inside source: true *** True Line Result - 4940,7250,5050,7340 -** Processing line: ~ 5010,7400,5050,7340~ + +** Processing line: ~ # If the mouse was lifted this tick~ - Inside source: true *** True Line Result - 5010,7400,5050,7340 -** Processing line: ~ 4680,7380,5010,7400~ + # If the mouse was lifted this tick +** Processing line: ~ if inputs.mouse.up~ - Inside source: true *** True Line Result - 4680,7380,5010,7400 -** Processing line: ~ 4380,7370,4680,7380~ + if inputs.mouse.up +** Processing line: ~ # Set current input to none~ - Inside source: true *** True Line Result - 4380,7370,4680,7380 -** Processing line: ~ 4120,7330,4360,7370~ + # Set current input to none +** Processing line: ~ state.user_input = :none~ - Inside source: true *** True Line Result - 4120,7330,4360,7370 -** Processing line: ~ 4120,7670,4120,7760~ + state.user_input = :none +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4120,7670,4120,7760 -** Processing line: ~ 4120,7670,4280,7650~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4120,7670,4280,7650 -** Processing line: ~ 4280,7650,4540,7660~ + +** Processing line: ~ # If the mouse was clicked this tick~ - Inside source: true *** True Line Result - 4280,7650,4540,7660 -** Processing line: ~ 4550,7660,4820,7680~ + # If the mouse was clicked this tick +** Processing line: ~ if inputs.mouse.down~ - Inside source: true *** True Line Result - 4550,7660,4820,7680 -** Processing line: ~ 4820,7680,4900,7730~ + if inputs.mouse.down +** Processing line: ~ # Determine what the user is editing and appropriately edit the state.user_input variable~ - Inside source: true *** True Line Result - 4820,7680,4900,7730 -** Processing line: ~ 4880,7800,4900,7730~ + # Determine what the user is editing and appropriately edit the state.user_input variable +** Processing line: ~ determine_input~ - Inside source: true *** True Line Result - 4880,7800,4900,7730 -** Processing line: ~ 4620,7820,4880,7800~ + determine_input +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4620,7820,4880,7800 -** Processing line: ~ 4360,7790,4620,7820~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4360,7790,4620,7820 -** Processing line: ~ 4120,7760,4360,7790~ + +** Processing line: ~ # Process user input based on user_input variable and current mouse position~ - Inside source: true *** True Line Result - 4120,7760,4360,7790 -** Processing line: ~ 6840,6840,7040,6820~ + # Process user input based on user_input variable and current mouse position +** Processing line: ~ process_input~ - Inside source: true *** True Line Result - 6840,6840,7040,6820 -** Processing line: ~ 5720,4880,6120,4880~ + process_input +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5720,4880,6120,4880 -** Processing line: ~ 1200,920,1340,810~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1200,920,1340,810 -** Processing line: ~ 1340,810,1520,790~ + +** Processing line: ~ # Determines what the user is editing~ - Inside source: true *** True Line Result - 1340,810,1520,790 -** Processing line: ~ 1520,790,1770,800~ + # Determines what the user is editing +** Processing line: ~ # This method is called when the mouse is clicked down~ - Inside source: true *** True Line Result - 1520,790,1770,800 -** Processing line: ~ 2400,790,2600,750~ + # This method is called when the mouse is clicked down +** Processing line: ~ def determine_input~ - Inside source: true *** True Line Result - 2400,790,2600,750 -** Processing line: ~ 2600,750,2640,520~ + def determine_input +** Processing line: ~ if mouse_over_slider?~ - Inside source: true *** True Line Result - 2600,750,2640,520 -** Processing line: ~ 2520,470,2640,520~ + if mouse_over_slider? +** Processing line: ~ state.user_input = :slider~ - Inside source: true *** True Line Result - 2520,470,2640,520 -** Processing line: ~ 2140,470,2520,470~ + state.user_input = :slider +** Processing line: ~ # If the mouse is over the star in the first grid~ - Inside source: true *** True Line Result - 2140,470,2520,470 -** Processing line: ~ 1760,800,2090,800~ + # If the mouse is over the star in the first grid +** Processing line: ~ elsif bfs_mouse_over_star?~ - Inside source: true *** True Line Result - 1760,800,2090,800 -** Processing line: ~ 2080,800,2400,790~ + elsif bfs_mouse_over_star? +** Processing line: ~ # The user is editing the star from the first grid~ - Inside source: true *** True Line Result - 2080,800,2400,790 -** Processing line: ~ 1760,450,2140,470~ + # The user is editing the star from the first grid +** Processing line: ~ state.user_input = :bfs_star~ - Inside source: true *** True Line Result - 1760,450,2140,470 -** Processing line: ~ 1420,450,1760,450~ + state.user_input = :bfs_star +** Processing line: ~ # If the mouse is over the star in the second grid~ - Inside source: true *** True Line Result - 1420,450,1760,450 -** Processing line: ~ 1180,440,1420,450~ + # If the mouse is over the star in the second grid +** Processing line: ~ elsif heuristic_mouse_over_star?~ - Inside source: true *** True Line Result - 1180,440,1420,450 -** Processing line: ~ 900,480,1180,440~ + elsif heuristic_mouse_over_star? +** Processing line: ~ # The user is editing the star from the second grid~ - Inside source: true *** True Line Result - 900,480,1180,440 -** Processing line: ~ 640,450,900,480~ + # The user is editing the star from the second grid +** Processing line: ~ state.user_input = :heuristic_star~ - Inside source: true *** True Line Result - 640,450,900,480 -** Processing line: ~ 360,440,620,450~ + state.user_input = :heuristic_star +** Processing line: ~ # If the mouse is over the target in the first grid~ - Inside source: true *** True Line Result - 360,440,620,450 -** Processing line: ~ 120,430,360,440~ + # If the mouse is over the target in the first grid +** Processing line: ~ elsif bfs_mouse_over_target?~ - Inside source: true *** True Line Result - 120,430,360,440 -** Processing line: ~ 0,520,120,430~ + elsif bfs_mouse_over_target? +** Processing line: ~ # The user is editing the target from the first grid~ - Inside source: true *** True Line Result - 0,520,120,430 -** Processing line: ~ -20,780,0,520~ + # The user is editing the target from the first grid +** Processing line: ~ state.user_input = :bfs_target~ - Inside source: true *** True Line Result - -20,780,0,520 -** Processing line: ~ -20,780,-20,1020~ + state.user_input = :bfs_target +** Processing line: ~ # If the mouse is over the target in the second grid~ - Inside source: true *** True Line Result - -20,780,-20,1020 -** Processing line: ~ -20,1020,-20,1150~ + # If the mouse is over the target in the second grid +** Processing line: ~ elsif heuristic_mouse_over_target?~ - Inside source: true *** True Line Result - -20,1020,-20,1150 -** Processing line: ~ -20,1150,0,1300~ + elsif heuristic_mouse_over_target? +** Processing line: ~ # The user is editing the target from the second grid~ - Inside source: true *** True Line Result - -20,1150,0,1300 -** Processing line: ~ 0,1470,60,1530~ + # The user is editing the target from the second grid +** Processing line: ~ state.user_input = :heuristic_target~ - Inside source: true *** True Line Result - 0,1470,60,1530 -** Processing line: ~ 0,1300,0,1470~ + state.user_input = :heuristic_target +** Processing line: ~ # If the mouse is over a wall in the first grid~ - Inside source: true *** True Line Result - 0,1300,0,1470 -** Processing line: ~ 60,1530,360,1530~ + # If the mouse is over a wall in the first grid +** Processing line: ~ elsif bfs_mouse_over_wall?~ - Inside source: true *** True Line Result - 60,1530,360,1530 -** Processing line: ~ 360,1530,660,1520~ + elsif bfs_mouse_over_wall? +** Processing line: ~ # The user is removing a wall from the first grid~ - Inside source: true *** True Line Result - 360,1530,660,1520 -** Processing line: ~ 660,1520,980,1520~ + # The user is removing a wall from the first grid +** Processing line: ~ state.user_input = :bfs_remove_wall~ - Inside source: true *** True Line Result - 660,1520,980,1520 -** Processing line: ~ 980,1520,1040,1520~ + state.user_input = :bfs_remove_wall +** Processing line: ~ # If the mouse is over a wall in the second grid~ - Inside source: true *** True Line Result - 980,1520,1040,1520 -** Processing line: ~ 1040,1520,1070,1560~ + # If the mouse is over a wall in the second grid +** Processing line: ~ elsif heuristic_mouse_over_wall?~ - Inside source: true *** True Line Result - 1040,1520,1070,1560 -** Processing line: ~ 1070,1770,1070,1560~ + elsif heuristic_mouse_over_wall? +** Processing line: ~ # The user is removing a wall from the second grid~ - Inside source: true *** True Line Result - 1070,1770,1070,1560 -** Processing line: ~ 1070,1770,1100,2010~ + # The user is removing a wall from the second grid +** Processing line: ~ state.user_input = :heuristic_remove_wall~ - Inside source: true *** True Line Result - 1070,1770,1100,2010 -** Processing line: ~ 1070,2230,1100,2010~ + state.user_input = :heuristic_remove_wall +** Processing line: ~ # If the mouse is over the first grid~ - Inside source: true *** True Line Result - 1070,2230,1100,2010 -** Processing line: ~ 1070,2240,1180,2340~ + # If the mouse is over the first grid +** Processing line: ~ elsif bfs_mouse_over_grid?~ - Inside source: true *** True Line Result - 1070,2240,1180,2340 -** Processing line: ~ 1180,2340,1580,2340~ + elsif bfs_mouse_over_grid? +** Processing line: ~ # The user is adding a wall from the first grid~ - Inside source: true *** True Line Result - 1180,2340,1580,2340 -** Processing line: ~ 1580,2340,1940,2350~ + # The user is adding a wall from the first grid +** Processing line: ~ state.user_input = :bfs_add_wall~ - Inside source: true *** True Line Result - 1580,2340,1940,2350 -** Processing line: ~ 1940,2350,2440,2350~ + state.user_input = :bfs_add_wall +** Processing line: ~ # If the mouse is over the second grid~ - Inside source: true *** True Line Result - 1940,2350,2440,2350 -** Processing line: ~ 2440,2350,2560,2380~ + # If the mouse is over the second grid +** Processing line: ~ elsif heuristic_mouse_over_grid?~ - Inside source: true *** True Line Result - 2440,2350,2560,2380 -** Processing line: ~ 2560,2380,2600,2540~ + elsif heuristic_mouse_over_grid? +** Processing line: ~ # The user is adding a wall from the second grid~ - Inside source: true *** True Line Result - 2560,2380,2600,2540 -** Processing line: ~ 2810,2640,3140,2680~ + # The user is adding a wall from the second grid +** Processing line: ~ state.user_input = :heuristic_add_wall~ - Inside source: true *** True Line Result - 2810,2640,3140,2680 -** Processing line: ~ 2600,2540,2810,2640~ + state.user_input = :heuristic_add_wall +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2600,2540,2810,2640 -** Processing line: ~ 3140,2680,3230,2780~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3140,2680,3230,2780 -** Processing line: ~ 3230,2780,3260,2970~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3230,2780,3260,2970 -** Processing line: ~ 3230,3220,3260,2970~ + +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ - Inside source: true *** True Line Result - 3230,3220,3260,2970 -** Processing line: ~ 3200,3470,3230,3220~ + # Processes click and drag based on what the user is currently dragging +** Processing line: ~ def process_input~ - Inside source: true *** True Line Result - 3200,3470,3230,3220 -** Processing line: ~ 3200,3480,3210,3760~ + def process_input +** Processing line: ~ if state.user_input == :slider~ - Inside source: true *** True Line Result - 3200,3480,3210,3760 -** Processing line: ~ 3210,3760,3210,4040~ + if state.user_input == :slider +** Processing line: ~ process_input_slider~ - Inside source: true *** True Line Result - 3210,3760,3210,4040 -** Processing line: ~ 3200,4040,3230,4310~ + process_input_slider +** Processing line: ~ elsif state.user_input == :bfs_star~ - Inside source: true *** True Line Result - 3200,4040,3230,4310 -** Processing line: ~ 3210,4530,3230,4310~ + elsif state.user_input == :bfs_star +** Processing line: ~ process_input_bfs_star~ - Inside source: true *** True Line Result - 3210,4530,3230,4310 -** Processing line: ~ 3210,4530,3230,4730~ + process_input_bfs_star +** Processing line: ~ elsif state.user_input == :heuristic_star~ - Inside source: true *** True Line Result - 3210,4530,3230,4730 -** Processing line: ~ 3230,4960,3230,4730~ + elsif state.user_input == :heuristic_star +** Processing line: ~ process_input_heuristic_star~ - Inside source: true *** True Line Result - 3230,4960,3230,4730 -** Processing line: ~ 3230,4960,3260,5190~ + process_input_heuristic_star +** Processing line: ~ elsif state.user_input == :bfs_target~ - Inside source: true *** True Line Result - 3230,4960,3260,5190 -** Processing line: ~ 3170,5330,3260,5190~ + elsif state.user_input == :bfs_target +** Processing line: ~ process_input_bfs_target~ - Inside source: true *** True Line Result - 3170,5330,3260,5190 -** Processing line: ~ 2920,5330,3170,5330~ + process_input_bfs_target +** Processing line: ~ elsif state.user_input == :heuristic_target~ - Inside source: true *** True Line Result - 2920,5330,3170,5330 -** Processing line: ~ 2660,5360,2920,5330~ + elsif state.user_input == :heuristic_target +** Processing line: ~ process_input_heuristic_target~ - Inside source: true *** True Line Result - 2660,5360,2920,5330 -** Processing line: ~ 2420,5330,2660,5360~ + process_input_heuristic_target +** Processing line: ~ elsif state.user_input == :bfs_remove_wall~ - Inside source: true *** True Line Result - 2420,5330,2660,5360 -** Processing line: ~ 2200,5280,2400,5330~ + elsif state.user_input == :bfs_remove_wall +** Processing line: ~ process_input_bfs_remove_wall~ - Inside source: true *** True Line Result - 2200,5280,2400,5330 -** Processing line: ~ 2020,5280,2200,5280~ + process_input_bfs_remove_wall +** Processing line: ~ elsif state.user_input == :heuristic_remove_wall~ - Inside source: true *** True Line Result - 2020,5280,2200,5280 -** Processing line: ~ 1840,5260,2020,5280~ + elsif state.user_input == :heuristic_remove_wall +** Processing line: ~ process_input_heuristic_remove_wall~ - Inside source: true *** True Line Result - 1840,5260,2020,5280 -** Processing line: ~ 1660,5280,1840,5260~ + process_input_heuristic_remove_wall +** Processing line: ~ elsif state.user_input == :bfs_add_wall~ - Inside source: true *** True Line Result - 1660,5280,1840,5260 -** Processing line: ~ 1500,5300,1660,5280~ + elsif state.user_input == :bfs_add_wall +** Processing line: ~ process_input_bfs_add_wall~ - Inside source: true *** True Line Result - 1500,5300,1660,5280 -** Processing line: ~ 1360,5270,1500,5300~ + process_input_bfs_add_wall +** Processing line: ~ elsif state.user_input == :heuristic_add_wall~ - Inside source: true *** True Line Result - 1360,5270,1500,5300 -** Processing line: ~ 1200,5290,1340,5270~ + elsif state.user_input == :heuristic_add_wall +** Processing line: ~ process_input_heuristic_add_wall~ - Inside source: true *** True Line Result - 1200,5290,1340,5270 -** Processing line: ~ 1070,5400,1200,5290~ + process_input_heuristic_add_wall +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1070,5400,1200,5290 -** Processing line: ~ 1040,5630,1070,5400~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1040,5630,1070,5400 -** Processing line: ~ 1000,5900,1040,5630~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1000,5900,1040,5630 -** Processing line: ~ 980,6170,1000,5900~ + +** Processing line: ~ def render_slider~ - Inside source: true *** True Line Result - 980,6170,1000,5900 -** Processing line: ~ 980,6280,980,6170~ + def render_slider +** Processing line: ~ # Using primitives hides the line under the white circle of the slider~ - Inside source: true *** True Line Result - 980,6280,980,6170 -** Processing line: ~ 980,6540,980,6280~ + # Using primitives hides the line under the white circle of the slider +** Processing line: ~ # Draws the line~ - Inside source: true *** True Line Result - 980,6540,980,6280 -** Processing line: ~ 980,6540,1040,6720~ + # Draws the line +** Processing line: ~ outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line~ - Inside source: true *** True Line Result - 980,6540,1040,6720 -** Processing line: ~ 1040,6720,1360,6730~ + outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line +** Processing line: ~ # The circle needs to be offset so that the center of the circle~ - Inside source: true *** True Line Result - 1040,6720,1360,6730 -** Processing line: ~ 1360,6730,1760,6710~ + # The circle needs to be offset so that the center of the circle +** Processing line: ~ # overlaps the line instead of the upper right corner of the circle~ - Inside source: true *** True Line Result - 1360,6730,1760,6710 -** Processing line: ~ 2110,6720,2420,6730~ + # overlaps the line instead of the upper right corner of the circle +** Processing line: ~ # The circle's x value is also moved based on the current seach step~ - Inside source: true *** True Line Result - 2110,6720,2420,6730 -** Processing line: ~ 1760,6710,2110,6720~ + # The circle's x value is also moved based on the current seach step +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing)~ - Inside source: true *** True Line Result - 1760,6710,2110,6720 -** Processing line: ~ 2420,6730,2640,6720~ + circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing) +** Processing line: ~ circle_y = (slider.y - slider.offset)~ - Inside source: true *** True Line Result - 2420,6730,2640,6720 -** Processing line: ~ 2640,6720,2970,6720~ + circle_y = (slider.y - slider.offset) +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ - Inside source: true *** True Line Result - 2640,6720,2970,6720 -** Processing line: ~ 2970,6720,3160,6700~ + circle_rect = [circle_x, circle_y, 37, 37] +** Processing line: ~ outputs.primitives << [circle_rect, 'circle-white.png'].sprite~ - Inside source: true *** True Line Result - 2970,6720,3160,6700 -** Processing line: ~ 3160,6700,3240,6710~ + outputs.primitives << [circle_rect, 'circle-white.png'].sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3160,6700,3240,6710 -** Processing line: ~ 3240,6710,3260,6890~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3240,6710,3260,6890 -** Processing line: ~ 3260,7020,3260,6890~ + +** Processing line: ~ def render_labels~ - Inside source: true *** True Line Result - 3260,7020,3260,6890 -** Processing line: ~ 3230,7180,3260,7020~ + def render_labels +** Processing line: ~ outputs.labels << [205, 625, "Breadth First Search"]~ - Inside source: true *** True Line Result - 3230,7180,3260,7020 -** Processing line: ~ 3230,7350,3230,7180~ + outputs.labels << [205, 625, "Breadth First Search"] +** Processing line: ~ outputs.labels << [820, 625, "Heuristic Best-First Search"]~ - Inside source: true *** True Line Result - 3230,7350,3230,7180 -** Processing line: ~ 3210,7510,3230,7350~ + outputs.labels << [820, 625, "Heuristic Best-First Search"] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3210,7510,3230,7350 -** Processing line: ~ 3210,7510,3210,7690~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3210,7510,3210,7690 -** Processing line: ~ 3210,7870,3210,7690~ + +** Processing line: ~ def render_left_button~ - Inside source: true *** True Line Result - 3210,7870,3210,7690 -** Processing line: ~ 3210,7870,3210,7980~ + def render_left_button +** Processing line: ~ # Draws the button_color button, and a black border~ - Inside source: true *** True Line Result - 3210,7870,3210,7980 -** Processing line: ~ 3200,8120,3210,7980~ + # Draws the button_color button, and a black border +** Processing line: ~ # The border separates the buttons visually~ - Inside source: true *** True Line Result - 3200,8120,3210,7980 -** Processing line: ~ 3200,8330,3200,8120~ + # The border separates the buttons visually +** Processing line: ~ outputs.solids << [buttons.left, button_color]~ - Inside source: true *** True Line Result - 3200,8330,3200,8120 -** Processing line: ~ 3160,8520,3200,8330~ + outputs.solids << [buttons.left, button_color] +** Processing line: ~ outputs.borders << [buttons.left]~ - Inside source: true *** True Line Result - 3160,8520,3200,8330 -** Processing line: ~ 2460,11100,2480,11020~ + outputs.borders << [buttons.left] +** Processing line: ~~ - Inside source: true *** True Line Result - 2460,11100,2480,11020 -** Processing line: ~ 2200,11180,2460,11100~ + +** Processing line: ~ # Renders an explanatory label in the center of the button~ - Inside source: true *** True Line Result - 2200,11180,2460,11100 -** Processing line: ~ 1260,11350,1600,11320~ + # Renders an explanatory label in the center of the button +** Processing line: ~ # Explains to the user what the button does~ - Inside source: true *** True Line Result - 1260,11350,1600,11320 -** Processing line: ~ 600,11430,930,11400~ + # Explains to the user what the button does +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ - Inside source: true *** True Line Result - 600,11430,930,11400 -** Processing line: ~ 180,11340,620,11430~ + # If the button size is changed, the label might need to be edited as well +** Processing line: ~ # to keep the label in the center of the button~ - Inside source: true *** True Line Result - 180,11340,620,11430 -** Processing line: ~ 1600,11320,1910,11280~ + # to keep the label in the center of the button +** Processing line: ~ label_x = buttons.left.x + 20~ - Inside source: true *** True Line Result - 1600,11320,1910,11280 -** Processing line: ~ 1910,11280,2200,11180~ + label_x = buttons.left.x + 20 +** Processing line: ~ label_y = buttons.left.y + 35~ - Inside source: true *** True Line Result - 1910,11280,2200,11180 -** Processing line: ~ 923.0029599285435,11398.99893503157,1264.002959928544,11351.99893503157~ + label_y = buttons.left.y + 35 +** Processing line: ~ outputs.labels << [label_x, label_y, "<"]~ - Inside source: true *** True Line Result - 923.0029599285435,11398.99893503157,1264.002959928544,11351.99893503157 -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + outputs.labels << [label_x, label_y, "<"] +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Platformer - The Little Probe - Data - level_lava.txt~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ def render_center_button~ +- Inside source: true *** True Line Result -* Platformer - The Little Probe - Data - level_lava.txt -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + def render_center_button +** Processing line: ~ # Draws the button_color button, and a black border~ +- Inside source: true *** True Line Result - + # Draws the button_color button, and a black border +** Processing line: ~ # The border separates the buttons visually~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_platformer/the_little_probe/data/level_lava.txt~ + # The border separates the buttons visually +** Processing line: ~ outputs.solids << [buttons.center, button_color]~ - Inside source: true *** True Line Result - # ./samples/99_genre_platformer/the_little_probe/data/level_lava.txt -** Processing line: ~ 100,10740,500,10780~ + outputs.solids << [buttons.center, button_color] +** Processing line: ~ outputs.borders << [buttons.center]~ - Inside source: true *** True Line Result - 100,10740,500,10780 -** Processing line: ~ 500,10780,960,10760~ + outputs.borders << [buttons.center] +** Processing line: ~~ - Inside source: true *** True Line Result - 500,10780,960,10760 -** Processing line: ~ 960,10760,1340,10760~ + +** Processing line: ~ # Renders an explanatory label in the center of the button~ - Inside source: true *** True Line Result - 960,10760,1340,10760 -** Processing line: ~ 1380,10760,1820,10780~ + # Renders an explanatory label in the center of the button +** Processing line: ~ # Explains to the user what the button does~ - Inside source: true *** True Line Result - 1380,10760,1820,10780 -** Processing line: ~ 1820,10780,2240,10780~ + # Explains to the user what the button does +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ - Inside source: true *** True Line Result - 1820,10780,2240,10780 -** Processing line: ~ 2280,10780,2740,10740~ + # If the button size is changed, the label might need to be edited as well +** Processing line: ~ # to keep the label in the center of the button~ - Inside source: true *** True Line Result - 2280,10780,2740,10740 -** Processing line: ~ 2740,10740,3000,10780~ + # to keep the label in the center of the button +** Processing line: ~ label_x = buttons.center.x + 37~ - Inside source: true *** True Line Result - 2740,10740,3000,10780 -** Processing line: ~ 3000,10780,3140,11020~ + label_x = buttons.center.x + 37 +** Processing line: ~ label_y = buttons.center.y + 35~ - Inside source: true *** True Line Result - 3000,10780,3140,11020 -** Processing line: ~ -520,8820,-480,9160~ + label_y = buttons.center.y + 35 +** Processing line: ~ label_text = state.play ? "Pause Animation" : "Play Animation"~ - Inside source: true *** True Line Result - -520,8820,-480,9160 -** Processing line: ~ -520,8480,-520,8820~ + label_text = state.play ? "Pause Animation" : "Play Animation" +** Processing line: ~ outputs.labels << [label_x, label_y, label_text]~ - Inside source: true *** True Line Result - -520,8480,-520,8820 -** Processing line: ~ -520,8480,-480,8180~ + outputs.labels << [label_x, label_y, label_text] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -520,8480,-480,8180 -** Processing line: ~ -480,8180,-200,8120~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -480,8180,-200,8120 -** Processing line: ~ -200,8120,100,8220~ + +** Processing line: ~ def render_right_button~ - Inside source: true *** True Line Result - -200,8120,100,8220 -** Processing line: ~ 100,8220,420,8240~ + def render_right_button +** Processing line: ~ # Draws the button_color button, and a black border~ - Inside source: true *** True Line Result - 100,8220,420,8240 -** Processing line: ~ 420,8240,760,8260~ + # Draws the button_color button, and a black border +** Processing line: ~ # The border separates the buttons visually~ - Inside source: true *** True Line Result - 420,8240,760,8260 -** Processing line: ~ 760,8260,1140,8280~ + # The border separates the buttons visually +** Processing line: ~ outputs.solids << [buttons.right, button_color]~ - Inside source: true *** True Line Result - 760,8260,1140,8280 -** Processing line: ~ 1140,8280,1500,8200~ + outputs.solids << [buttons.right, button_color] +** Processing line: ~ outputs.borders << [buttons.right]~ - Inside source: true *** True Line Result - 1140,8280,1500,8200 -** Processing line: ~ 1500,8200,1880,8240~ + outputs.borders << [buttons.right] +** Processing line: ~~ - Inside source: true *** True Line Result - 1500,8200,1880,8240 -** Processing line: ~ 1880,8240,2240,8260~ + +** Processing line: ~ # Renders an explanatory label in the center of the button~ - Inside source: true *** True Line Result - 1880,8240,2240,8260 -** Processing line: ~ 2240,8260,2320,8480~ + # Renders an explanatory label in the center of the button +** Processing line: ~ # Explains to the user what the button does~ - Inside source: true *** True Line Result - 2240,8260,2320,8480 -** Processing line: ~ 2320,8480,2380,8680~ + # Explains to the user what the button does +** Processing line: ~ label_x = buttons.right.x + 20~ - Inside source: true *** True Line Result - 2320,8480,2380,8680 -** Processing line: ~ 2240,8860,2380,8680~ + label_x = buttons.right.x + 20 +** Processing line: ~ label_y = buttons.right.y + 35~ - Inside source: true *** True Line Result - 2240,8860,2380,8680 -** Processing line: ~ 2240,9080,2240,8860~ + label_y = buttons.right.y + 35 +** Processing line: ~ outputs.labels << [label_x, label_y, ">"]~ - Inside source: true *** True Line Result - 2240,9080,2240,8860 -** Processing line: ~ 2240,9080,2320,9260~ + outputs.labels << [label_x, label_y, ">"] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2240,9080,2320,9260 -** Processing line: ~ 2320,9260,2480,9440~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2320,9260,2480,9440 -** Processing line: ~ 2480,9440,2600,9640~ + +** Processing line: ~ def render_bfs_grid~ - Inside source: true *** True Line Result - 2480,9440,2600,9640 -** Processing line: ~ 2480,9840,2600,9640~ + def render_bfs_grid +** Processing line: ~ # A large rect the size of the grid~ - Inside source: true *** True Line Result - 2480,9840,2600,9640 -** Processing line: ~ 2400,10020,2480,9840~ + # A large rect the size of the grid +** Processing line: ~ outputs.solids << [bfs_scale_up(grid.rect), default_color]~ - Inside source: true *** True Line Result - 2400,10020,2480,9840 -** Processing line: ~ 2240,10080,2400,10020~ + outputs.solids << [bfs_scale_up(grid.rect), default_color] +** Processing line: ~~ - Inside source: true *** True Line Result - 2240,10080,2400,10020 -** Processing line: ~ 1960,10080,2240,10080~ + +** Processing line: ~ # The vertical grid lines~ - Inside source: true *** True Line Result - 1960,10080,2240,10080 -** Processing line: ~ 1720,10080,1960,10080~ + # The vertical grid lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - 1720,10080,1960,10080 -** Processing line: ~ 1460,10080,1720,10080~ + for x in 0..grid.width +** Processing line: ~ outputs.lines << bfs_vertical_line(x)~ - Inside source: true *** True Line Result - 1460,10080,1720,10080 -** Processing line: ~ 1180,10080,1420,10080~ + outputs.lines << bfs_vertical_line(x) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1180,10080,1420,10080 -** Processing line: ~ 900,10080,1180,10080~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 900,10080,1180,10080 -** Processing line: ~ 640,10080,900,10080~ + +** Processing line: ~ # The horizontal grid lines~ - Inside source: true *** True Line Result - 640,10080,900,10080 -** Processing line: ~ 640,10080,640,9900~ + # The horizontal grid lines +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - 640,10080,640,9900 -** Processing line: ~ 60,10520,100,10740~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << bfs_horizontal_line(y)~ - Inside source: true *** True Line Result - 60,10520,100,10740 -** Processing line: ~ 40,10240,60,10520~ + outputs.lines << bfs_horizontal_line(y) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 40,10240,60,10520 -** Processing line: ~ 40,10240,40,9960~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 40,10240,40,9960 -** Processing line: ~ 40,9960,40,9680~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 40,9960,40,9680 -** Processing line: ~ 40,9680,40,9360~ + +** Processing line: ~ def render_heuristic_grid~ - Inside source: true *** True Line Result - 40,9680,40,9360 -** Processing line: ~ 40,9360,60,9080~ + def render_heuristic_grid +** Processing line: ~ # A large rect the size of the grid~ - Inside source: true *** True Line Result - 40,9360,60,9080 -** Processing line: ~ 60,9080,100,8860~ + # A large rect the size of the grid +** Processing line: ~ outputs.solids << [heuristic_scale_up(grid.rect), default_color]~ - Inside source: true *** True Line Result - 60,9080,100,8860 -** Processing line: ~ 100,8860,460,9040~ + outputs.solids << [heuristic_scale_up(grid.rect), default_color] +** Processing line: ~~ - Inside source: true *** True Line Result - 100,8860,460,9040 -** Processing line: ~ 460,9040,760,9220~ + +** Processing line: ~ # The vertical grid lines~ - Inside source: true *** True Line Result - 460,9040,760,9220 -** Processing line: ~ 760,9220,1140,9220~ + # The vertical grid lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - 760,9220,1140,9220 -** Processing line: ~ 1140,9220,1720,9200~ + for x in 0..grid.width +** Processing line: ~ outputs.lines << heuristic_vertical_line(x)~ - Inside source: true *** True Line Result - 1140,9220,1720,9200 -** Processing line: ~ -660,11580,-600,11420~ + outputs.lines << heuristic_vertical_line(x) +** Processing line: ~ end~ - Inside source: true *** True Line Result - -660,11580,-600,11420 -** Processing line: ~ -660,11800,-660,11580~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -660,11800,-660,11580 -** Processing line: ~ -660,12000,-660,11800~ + +** Processing line: ~ # The horizontal grid lines~ - Inside source: true *** True Line Result - -660,12000,-660,11800 -** Processing line: ~ -660,12000,-600,12220~ + # The horizontal grid lines +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - -660,12000,-600,12220 -** Processing line: ~ -600,12220,-600,12440~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << heuristic_horizontal_line(y)~ - Inside source: true *** True Line Result - -600,12220,-600,12440 -** Processing line: ~ -600,12440,-600,12640~ + outputs.lines << heuristic_horizontal_line(y) +** Processing line: ~ end~ - Inside source: true *** True Line Result - -600,12440,-600,12640 -** Processing line: ~ -600,11240,-260,11280~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -600,11240,-260,11280 -** Processing line: ~ -260,11280,100,11240~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -260,11280,100,11240 -** Processing line: ~ 9000,12360,9020,12400~ + +** Processing line: ~ # Returns a vertical line for a column of the first grid~ - Inside source: true *** True Line Result - 9000,12360,9020,12400 -** Processing line: ~ 9020,12620,9020,12400~ + # Returns a vertical line for a column of the first grid +** Processing line: ~ def bfs_vertical_line column~ - Inside source: true *** True Line Result - 9020,12620,9020,12400 -** Processing line: ~ 9020,12840,9020,12620~ + def bfs_vertical_line column +** Processing line: ~ bfs_scale_up([column, 0, column, grid.height])~ - Inside source: true *** True Line Result - 9020,12840,9020,12620 -** Processing line: ~ 9020,13060,9020,12840~ + bfs_scale_up([column, 0, column, grid.height]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 9020,13060,9020,12840 -** Processing line: ~ 9020,13060,9020,13240~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 9020,13060,9020,13240 -** Processing line: ~ 9020,13240,9020,13420~ + +** Processing line: ~ # Returns a horizontal line for a column of the first grid~ - Inside source: true *** True Line Result - 9020,13240,9020,13420 -** Processing line: ~ 9020,13420,9020,13600~ + # Returns a horizontal line for a column of the first grid +** Processing line: ~ def bfs_horizontal_line row~ - Inside source: true *** True Line Result - 9020,13420,9020,13600 -** Processing line: ~ 9020,13600,9020,13780~ + def bfs_horizontal_line row +** Processing line: ~ bfs_scale_up([0, row, grid.width, row])~ - Inside source: true *** True Line Result - 9020,13600,9020,13780 -** Processing line: ~ 8880,13900,9020,13780~ + bfs_scale_up([0, row, grid.width, row]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 8880,13900,9020,13780 -** Processing line: ~ 8560,13800,8880,13900~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 8560,13800,8880,13900 -** Processing line: ~ 8220,13780,8560,13800~ + +** Processing line: ~ # Returns a vertical line for a column of the second grid~ - Inside source: true *** True Line Result - 8220,13780,8560,13800 -** Processing line: ~ 7860,13760,8220,13780~ + # Returns a vertical line for a column of the second grid +** Processing line: ~ def heuristic_vertical_line column~ - Inside source: true *** True Line Result - 7860,13760,8220,13780 -** Processing line: ~ 7640,13780,7860,13760~ + def heuristic_vertical_line column +** Processing line: ~ bfs_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height])~ - Inside source: true *** True Line Result - 7640,13780,7860,13760 -** Processing line: ~ 7360,13800,7640,13780~ + bfs_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7360,13800,7640,13780 -** Processing line: ~ 7100,13800,7360,13800~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7100,13800,7360,13800 -** Processing line: ~ 6540,13760,6800,13780~ + +** Processing line: ~ # Returns a horizontal line for a column of the second grid~ - Inside source: true *** True Line Result - 6540,13760,6800,13780 -** Processing line: ~ 6800,13780,7100,13800~ + # Returns a horizontal line for a column of the second grid +** Processing line: ~ def heuristic_horizontal_line row~ - Inside source: true *** True Line Result - 6800,13780,7100,13800 -** Processing line: ~ 6280,13760,6540,13760~ + def heuristic_horizontal_line row +** Processing line: ~ bfs_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row])~ - Inside source: true *** True Line Result - 6280,13760,6540,13760 -** Processing line: ~ 5760,13760,6280,13760~ + bfs_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5760,13760,6280,13760 -** Processing line: ~ 5220,13780,5760,13760~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5220,13780,5760,13760 -** Processing line: ~ 4700,13760,5220,13780~ + +** Processing line: ~ # Renders the star on the first grid~ - Inside source: true *** True Line Result - 4700,13760,5220,13780 -** Processing line: ~ 4200,13740,4700,13760~ + # Renders the star on the first grid +** Processing line: ~ def render_bfs_star~ - Inside source: true *** True Line Result - 4200,13740,4700,13760 -** Processing line: ~ 3680,13720,4200,13740~ + def render_bfs_star +** Processing line: ~ outputs.sprites << [bfs_scale_up(grid.star), 'star.png']~ - Inside source: true *** True Line Result - 3680,13720,4200,13740 -** Processing line: ~ 3140,13700,3680,13720~ + outputs.sprites << [bfs_scale_up(grid.star), 'star.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3140,13700,3680,13720 -** Processing line: ~ 2600,13680,3140,13700~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2600,13680,3140,13700 -** Processing line: ~ 2040,13940,2600,13680~ + +** Processing line: ~ # Renders the star on the second grid~ - Inside source: true *** True Line Result - 2040,13940,2600,13680 -** Processing line: ~ 1640,13940,2040,13940~ + # Renders the star on the second grid +** Processing line: ~ def render_heuristic_star~ - Inside source: true *** True Line Result - 1640,13940,2040,13940 -** Processing line: ~ 1200,13960,1640,13940~ + def render_heuristic_star +** Processing line: ~ outputs.sprites << [heuristic_scale_up(grid.star), 'star.png']~ - Inside source: true *** True Line Result - 1200,13960,1640,13940 -** Processing line: ~ 840,14000,1200,13960~ + outputs.sprites << [heuristic_scale_up(grid.star), 'star.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 840,14000,1200,13960 -** Processing line: ~ 300,13960,840,14000~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 300,13960,840,14000 -** Processing line: ~ -200,13900,300,13960~ + +** Processing line: ~ # Renders the target on the first grid~ - Inside source: true *** True Line Result - -200,13900,300,13960 -** Processing line: ~ -600,12840,-600,12640~ + # Renders the target on the first grid +** Processing line: ~ def render_bfs_target~ - Inside source: true *** True Line Result - -600,12840,-600,12640 -** Processing line: ~ -600,13140,-600,12840~ + def render_bfs_target +** Processing line: ~ outputs.sprites << [bfs_scale_up(grid.target), 'target.png']~ - Inside source: true *** True Line Result - -600,13140,-600,12840 -** Processing line: ~ -600,13140,-600,13420~ + outputs.sprites << [bfs_scale_up(grid.target), 'target.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -600,13140,-600,13420 -** Processing line: ~ -600,13700,-600,13420~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -600,13700,-600,13420 -** Processing line: ~ -600,13700,-600,13820~ + +** Processing line: ~ # Renders the target on the second grid~ - Inside source: true *** True Line Result - -600,13700,-600,13820 -** Processing line: ~ -600,13820,-200,13900~ + # Renders the target on the second grid +** Processing line: ~ def render_heuristic_target~ - Inside source: true *** True Line Result - -600,13820,-200,13900 -** Processing line: ~ -600,11240,-560,11000~ + def render_heuristic_target +** Processing line: ~ outputs.sprites << [heuristic_scale_up(grid.target), 'target.png']~ - Inside source: true *** True Line Result - -600,11240,-560,11000 -** Processing line: ~ -560,11000,-480,10840~ + outputs.sprites << [heuristic_scale_up(grid.target), 'target.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -560,11000,-480,10840 -** Processing line: ~ -520,10660,-480,10840~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -520,10660,-480,10840 -** Processing line: ~ -520,10660,-520,10480~ + +** Processing line: ~ # Renders the walls on the first grid~ - Inside source: true *** True Line Result - -520,10660,-520,10480 -** Processing line: ~ -520,10480,-520,10300~ + # Renders the walls on the first grid +** Processing line: ~ def render_bfs_walls~ - Inside source: true *** True Line Result - -520,10480,-520,10300 -** Processing line: ~ -520,10260,-480,10080~ + def render_bfs_walls +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - -520,10260,-480,10080 -** Processing line: ~ -480,9880,-440,10060~ + grid.walls.each_key do | wall | +** Processing line: ~ outputs.solids << [bfs_scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - -480,9880,-440,10060 -** Processing line: ~ -520,9680,-480,9880~ + outputs.solids << [bfs_scale_up(wall), wall_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -520,9680,-480,9880 -** Processing line: ~ -520,9680,-480,9400~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -520,9680,-480,9400 -** Processing line: ~ -480,9400,-480,9160~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - -480,9400,-480,9160 -** Processing line: ~ 1820,9880,2140,9800~ + +** Processing line: ~ # Renders the walls on the second grid~ - Inside source: true *** True Line Result - 1820,9880,2140,9800 -** Processing line: ~ 1540,9880,1820,9880~ + # Renders the walls on the second grid +** Processing line: ~ def render_heuristic_walls~ - Inside source: true *** True Line Result - 1540,9880,1820,9880 -** Processing line: ~ 1200,9920,1500,9880~ + def render_heuristic_walls +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - 1200,9920,1500,9880 -** Processing line: ~ 900,9880,1200,9920~ + grid.walls.each_key do | wall | +** Processing line: ~ outputs.solids << [heuristic_scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - 900,9880,1200,9920 -** Processing line: ~ 640,9900,840,9880~ + outputs.solids << [heuristic_scale_up(wall), wall_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 640,9900,840,9880 -** Processing line: ~ 2380,8760,2800,8760~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2380,8760,2800,8760 -** Processing line: ~ 2800,8760,2840,8660~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2800,8760,2840,8660 -** Processing line: ~ 2840,8660,2840,8420~ + +** Processing line: ~ # Renders the visited cells on the first grid~ - Inside source: true *** True Line Result - 2840,8660,2840,8420 -** Processing line: ~ 2840,8160,2840,8420~ + # Renders the visited cells on the first grid +** Processing line: ~ def render_bfs_visited~ - Inside source: true *** True Line Result - 2840,8160,2840,8420 -** Processing line: ~ 2800,7900,2840,8160~ + def render_bfs_visited +** Processing line: ~ bfs.came_from.each_key do | visited_cell |~ - Inside source: true *** True Line Result - 2800,7900,2840,8160 -** Processing line: ~ 2800,7900,2800,7720~ + bfs.came_from.each_key do | visited_cell | +** Processing line: ~ outputs.solids << [bfs_scale_up(visited_cell), visited_color]~ - Inside source: true *** True Line Result - 2800,7900,2800,7720 -** Processing line: ~ 2800,7540,2800,7720~ + outputs.solids << [bfs_scale_up(visited_cell), visited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2800,7540,2800,7720 -** Processing line: ~ 2800,7540,2800,7360~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2800,7540,2800,7360 -** Processing line: ~ 2700,7220,2800,7360~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2700,7220,2800,7360 -** Processing line: ~ 2400,7220,2700,7220~ + +** Processing line: ~ # Renders the visited cells on the second grid~ - Inside source: true *** True Line Result - 2400,7220,2700,7220 -** Processing line: ~ 2080,7240,2400,7220~ + # Renders the visited cells on the second grid +** Processing line: ~ def render_heuristic_visited~ - Inside source: true *** True Line Result - 2080,7240,2400,7220 -** Processing line: ~ 1760,7320,2080,7240~ + def render_heuristic_visited +** Processing line: ~ heuristic.came_from.each_key do | visited_cell |~ - Inside source: true *** True Line Result - 1760,7320,2080,7240 -** Processing line: ~ 1380,7360,1720,7320~ + heuristic.came_from.each_key do | visited_cell | +** Processing line: ~ outputs.solids << [heuristic_scale_up(visited_cell), visited_color]~ - Inside source: true *** True Line Result - 1380,7360,1720,7320 -** Processing line: ~ 1040,7400,1340,7360~ + outputs.solids << [heuristic_scale_up(visited_cell), visited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1040,7400,1340,7360 -** Processing line: ~ 640,7400,1000,7420~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 640,7400,1000,7420 -** Processing line: ~ 300,7380,640,7400~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 300,7380,640,7400 -** Processing line: ~ 0,7300,240,7380~ + +** Processing line: ~ # Renders the frontier cells on the first grid~ - Inside source: true *** True Line Result - 0,7300,240,7380 -** Processing line: ~ -300,7180,-60,7300~ + # Renders the frontier cells on the first grid +** Processing line: ~ def render_bfs_frontier~ - Inside source: true *** True Line Result - -300,7180,-60,7300 -** Processing line: ~ -380,6860,-360,7180~ + def render_bfs_frontier +** Processing line: ~ bfs.frontier.each do | frontier_cell |~ - Inside source: true *** True Line Result - -380,6860,-360,7180 -** Processing line: ~ -380,6880,-360,6700~ + bfs.frontier.each do | frontier_cell | +** Processing line: ~ outputs.solids << [bfs_scale_up(frontier_cell), frontier_color, 200]~ - Inside source: true *** True Line Result - -380,6880,-360,6700 -** Processing line: ~ -360,6700,-260,6540~ + outputs.solids << [bfs_scale_up(frontier_cell), frontier_color, 200] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -360,6700,-260,6540 -** Processing line: ~ -260,6540,0,6520~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -260,6540,0,6520 -** Processing line: ~ 0,6520,240,6640~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 0,6520,240,6640 -** Processing line: ~ 240,6640,460,6640~ + +** Processing line: ~ # Renders the frontier cells on the second grid~ - Inside source: true *** True Line Result - 240,6640,460,6640 -** Processing line: ~ 460,6640,500,6480~ + # Renders the frontier cells on the second grid +** Processing line: ~ def render_heuristic_frontier~ - Inside source: true *** True Line Result - 460,6640,500,6480 -** Processing line: ~ 500,6260,500,6480~ + def render_heuristic_frontier +** Processing line: ~ heuristic.frontier.each do | frontier_cell |~ - Inside source: true *** True Line Result - 500,6260,500,6480 -** Processing line: ~ 460,6060,500,6260~ + heuristic.frontier.each do | frontier_cell | +** Processing line: ~ outputs.solids << [heuristic_scale_up(frontier_cell), frontier_color, 200]~ - Inside source: true *** True Line Result - 460,6060,500,6260 -** Processing line: ~ 460,5860,460,6060~ + outputs.solids << [heuristic_scale_up(frontier_cell), frontier_color, 200] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 460,5860,460,6060 -** Processing line: ~ 460,5860,500,5640~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 460,5860,500,5640 -** Processing line: ~ 500,5640,540,5440~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 500,5640,540,5440 -** Processing line: ~ 540,5440,580,5220~ + +** Processing line: ~ # Renders the path found by the breadth first search on the first grid~ - Inside source: true *** True Line Result - 540,5440,580,5220 -** Processing line: ~ 580,5220,580,5000~ + # Renders the path found by the breadth first search on the first grid +** Processing line: ~ def render_bfs_path~ - Inside source: true *** True Line Result - 580,5220,580,5000 -** Processing line: ~ 580,4960,580,4740~ + def render_bfs_path +** Processing line: ~ bfs.path.each do | path |~ - Inside source: true *** True Line Result - 580,4960,580,4740 -** Processing line: ~ 580,4740,960,4700~ + bfs.path.each do | path | +** Processing line: ~ outputs.solids << [bfs_scale_up(path), path_color]~ - Inside source: true *** True Line Result - 580,4740,960,4700 -** Processing line: ~ 960,4700,1140,4760~ + outputs.solids << [bfs_scale_up(path), path_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 960,4700,1140,4760 -** Processing line: ~ 1140,4760,1420,4740~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1140,4760,1420,4740 -** Processing line: ~ 1420,4740,1720,4700~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 1420,4740,1720,4700 -** Processing line: ~ 1720,4700,2000,4740~ + +** Processing line: ~ # Renders the path found by the heuristic search on the second grid~ - Inside source: true *** True Line Result - 1720,4700,2000,4740 -** Processing line: ~ 2000,4740,2380,4760~ + # Renders the path found by the heuristic search on the second grid +** Processing line: ~ def render_heuristic_path~ - Inside source: true *** True Line Result - 2000,4740,2380,4760 -** Processing line: ~ 2380,4760,2700,4800~ + def render_heuristic_path +** Processing line: ~ heuristic.path.each do | path |~ - Inside source: true *** True Line Result - 2380,4760,2700,4800 -** Processing line: ~ 1720,4600,1760,4300~ + heuristic.path.each do | path | +** Processing line: ~ outputs.solids << [heuristic_scale_up(path), path_color]~ - Inside source: true *** True Line Result - 1720,4600,1760,4300 -** Processing line: ~ 1760,4300,2200,4340~ + outputs.solids << [heuristic_scale_up(path), path_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1760,4300,2200,4340 -** Processing line: ~ 2200,4340,2560,4340~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 2200,4340,2560,4340 -** Processing line: ~ 2560,4340,2740,4340~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 2560,4340,2740,4340 -** Processing line: ~ 2160,12580,2440,12400~ + +** Processing line: ~ # Returns the rect for the path between two cells based on their relative positions~ - Inside source: true *** True Line Result - 2160,12580,2440,12400 -** Processing line: ~ 1820,12840,2160,12580~ + # Returns the rect for the path between two cells based on their relative positions +** Processing line: ~ def get_path_between(cell_one, cell_two)~ - Inside source: true *** True Line Result - 1820,12840,2160,12580 -** Processing line: ~ 1500,13080,1820,12840~ + def get_path_between(cell_one, cell_two) +** Processing line: ~ path = []~ - Inside source: true *** True Line Result - 1500,13080,1820,12840 -** Processing line: ~ 1140,13340,1500,13080~ + path = [] +** Processing line: ~~ - Inside source: true *** True Line Result - 1140,13340,1500,13080 -** Processing line: ~ 1140,13340,1580,13220~ + +** Processing line: ~ # If cell one is above cell two~ - Inside source: true *** True Line Result - 1140,13340,1580,13220 -** Processing line: ~ 2110,13080,2520,13000~ + # If cell one is above cell two +** Processing line: ~ if cell_one.x == cell_two.x and cell_one.y > cell_two.y~ - Inside source: true *** True Line Result - 2110,13080,2520,13000 -** Processing line: ~ 2520,13000,2900,12800~ + if cell_one.x == cell_two.x and cell_one.y > cell_two.y +** Processing line: ~ # Path starts from the center of cell two and moves upward to the center of cell one~ - Inside source: true *** True Line Result - 2520,13000,2900,12800 -** Processing line: ~ 1580,13220,2110,13080~ + # Path starts from the center of cell two and moves upward to the center of cell one +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4]~ - Inside source: true *** True Line Result - 1580,13220,2110,13080 -** Processing line: ~ 2900,12800,3200,12680~ + path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4] +** Processing line: ~ # If cell one is below cell two~ - Inside source: true *** True Line Result - 2900,12800,3200,12680 -** Processing line: ~ 3200,12680,3440,12640~ + # If cell one is below cell two +** Processing line: ~ elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y~ - Inside source: true *** True Line Result - 3200,12680,3440,12640 -** Processing line: ~ 3440,12640,3720,12460~ + elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y +** Processing line: ~ # Path starts from the center of cell one and moves upward to the center of cell two~ - Inside source: true *** True Line Result - 3440,12640,3720,12460 -** Processing line: ~ 3720,12460,4040,12320~ + # Path starts from the center of cell one and moves upward to the center of cell two +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4]~ - Inside source: true *** True Line Result - 3720,12460,4040,12320 -** Processing line: ~ 4040,12320,4360,12200~ + path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4] +** Processing line: ~ # If cell one is to the left of cell two~ - Inside source: true *** True Line Result - 4040,12320,4360,12200 -** Processing line: ~ 4360,11940,4380,12180~ + # If cell one is to the left of cell two +** Processing line: ~ elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y~ - Inside source: true *** True Line Result - 4360,11940,4380,12180 -** Processing line: ~ 4360,11700,4360,11940~ + elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y +** Processing line: ~ # Path starts from the center of cell two and moves rightward to the center of cell one~ - Inside source: true *** True Line Result - 4360,11700,4360,11940 -** Processing line: ~ 4360,11700,4540,11500~ + # Path starts from the center of cell two and moves rightward to the center of cell one +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4]~ - Inside source: true *** True Line Result - 4360,11700,4540,11500 -** Processing line: ~ 4540,11500,4880,11540~ + path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4] +** Processing line: ~ # If cell one is to the right of cell two~ - Inside source: true *** True Line Result - 4540,11500,4880,11540 -** Processing line: ~ 6000,11660,6280,11640~ + # If cell one is to the right of cell two +** Processing line: ~ elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y~ - Inside source: true *** True Line Result - 6000,11660,6280,11640 -** Processing line: ~ 5440,11600,5720,11610~ + elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y +** Processing line: ~ # Path starts from the center of cell one and moves rightward to the center of cell two~ - Inside source: true *** True Line Result - 5440,11600,5720,11610 -** Processing line: ~ 5720,11610,6000,11660~ + # Path starts from the center of cell one and moves rightward to the center of cell two +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4]~ - Inside source: true *** True Line Result - 5720,11610,6000,11660 -** Processing line: ~ 6280,11640,6760,11720~ + path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6280,11640,6760,11720 -** Processing line: ~ 6760,11720,7060,11780~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 6760,11720,7060,11780 -** Processing line: ~ 7060,11780,7360,11810~ + +** Processing line: ~ path~ - Inside source: true *** True Line Result - 7060,11780,7360,11810 -** Processing line: ~ 7360,11810,7640,11840~ + path +** Processing line: ~ end~ - Inside source: true *** True Line Result - 7360,11810,7640,11840 -** Processing line: ~ 7640,11840,8000,11830~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7640,11840,8000,11830 -** Processing line: ~ 8000,11830,8320,11850~ + +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ - Inside source: true *** True Line Result - 8000,11830,8320,11850 -** Processing line: ~ 8320,11850,8390,11800~ + # In code, the cells are represented as 1x1 rectangles +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ - Inside source: true *** True Line Result - 8320,11850,8390,11800 -** Processing line: ~ 8330,11760,8390,11800~ + # When drawn, the cells are larger than 1x1 rectangles +** Processing line: ~ # This method is used to scale up cells, and lines~ - Inside source: true *** True Line Result - 8330,11760,8390,11800 -** Processing line: ~ 8160,11760,8330,11760~ + # This method is used to scale up cells, and lines +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ - Inside source: true *** True Line Result - 8160,11760,8330,11760 -** Processing line: ~ 7910,11750,8160,11760~ + # Objects are scaled up according to the grid.cell_size variable +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ - Inside source: true *** True Line Result - 7910,11750,8160,11760 -** Processing line: ~ 7660,11740,7900,11750~ + # This allows for easy customization of the visual scale of the grid +** Processing line: ~ # This method scales up cells for the first grid~ - Inside source: true *** True Line Result - 7660,11740,7900,11750 -** Processing line: ~ 7400,11730,7660,11740~ + # This method scales up cells for the first grid +** Processing line: ~ def bfs_scale_up(cell)~ - Inside source: true *** True Line Result - 7400,11730,7660,11740 -** Processing line: ~ 7160,11680,7400,11730~ + def bfs_scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ - Inside source: true *** True Line Result - 7160,11680,7400,11730 -** Processing line: ~ 7080,11570,7160,11680~ + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ - Inside source: true *** True Line Result - 7080,11570,7160,11680 -** Processing line: ~ 7080,11570,7100,11350~ + cell = cell.clone +** Processing line: ~~ - Inside source: true *** True Line Result - 7080,11570,7100,11350 -** Processing line: ~ 7100,11350,7440,11280~ + +** Processing line: ~ # If cell is just an x and y coordinate~ - Inside source: true *** True Line Result - 7100,11350,7440,11280 -** Processing line: ~ 7440,11280,7940,11280~ + # If cell is just an x and y coordinate +** Processing line: ~ if cell.size == 2~ - Inside source: true *** True Line Result - 7440,11280,7940,11280 -** Processing line: ~ 7960,11280,8360,11280~ + if cell.size == 2 +** Processing line: ~ # Add a width and height of 1~ - Inside source: true *** True Line Result - 7960,11280,8360,11280 -** Processing line: ~ 5840,11540,6650,11170~ + # Add a width and height of 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - 5840,11540,6650,11170 -** Processing line: ~ 4880,11540,5440,11600~ + cell << 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - 4880,11540,5440,11600 -** Processing line: ~ 3410,11830,3420,11300~ + cell << 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3410,11830,3420,11300 -** Processing line: ~ 3410,11260,3520,10920~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3410,11260,3520,10920 -** Processing line: ~ 3520,10590,3520,10920~ + +** Processing line: ~ # Scale all the values up~ - Inside source: true *** True Line Result - 3520,10590,3520,10920 -** Processing line: ~ 3520,10590,3540,10260~ + # Scale all the values up +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ - Inside source: true *** True Line Result - 3520,10590,3540,10260 -** Processing line: ~ 3520,9900,3540,10240~ + cell.map! { |value| value * grid.cell_size } +** Processing line: ~~ - Inside source: true *** True Line Result - 3520,9900,3540,10240 -** Processing line: ~ 3520,9900,3640,9590~ + +** Processing line: ~ # Returns the scaled up cell~ - Inside source: true *** True Line Result - 3520,9900,3640,9590 -** Processing line: ~ 3640,9570,4120,9590~ + # Returns the scaled up cell +** Processing line: ~ cell~ - Inside source: true *** True Line Result - 3640,9570,4120,9590 -** Processing line: ~ 4140,9590,4600,9680~ + cell +** Processing line: ~ end~ - Inside source: true *** True Line Result - 4140,9590,4600,9680 -** Processing line: ~ 4620,9680,5030,9730~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 4620,9680,5030,9730 -** Processing line: ~ 5120,9750,5520,9800~ + +** Processing line: ~ # Translates the given cell grid.width + 1 to the right and then scales up~ - Inside source: true *** True Line Result - 5120,9750,5520,9800 -** Processing line: ~ 5620,9820,6080,9800~ + # Translates the given cell grid.width + 1 to the right and then scales up +** Processing line: ~ # Used to draw cells for the second grid~ - Inside source: true *** True Line Result - 5620,9820,6080,9800 -** Processing line: ~ 6130,9810,6580,9820~ + # Used to draw cells for the second grid +** Processing line: ~ # This method does not work for lines,~ - Inside source: true *** True Line Result - 6130,9810,6580,9820 -** Processing line: ~ 6640,9820,6800,9700~ + # This method does not work for lines, +** Processing line: ~ # so separate methods exist for the grid lines~ - Inside source: true *** True Line Result - 6640,9820,6800,9700 -** Processing line: ~ 6780,9400,6800,9700~ + # so separate methods exist for the grid lines +** Processing line: ~ def heuristic_scale_up(cell)~ - Inside source: true *** True Line Result - 6780,9400,6800,9700 -** Processing line: ~ 6780,9400,6840,9140~ + def heuristic_scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ - Inside source: true *** True Line Result - 6780,9400,6840,9140 -** Processing line: ~ 6820,8860,6840,9120~ + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ - Inside source: true *** True Line Result - 6820,8860,6840,9120 -** Processing line: ~ 6780,8600,6820,8830~ + cell = cell.clone +** Processing line: ~ # Translates the cell to the second grid equivalent~ - Inside source: true *** True Line Result - 6780,8600,6820,8830 -** Processing line: ~ 6720,8350,6780,8570~ + # Translates the cell to the second grid equivalent +** Processing line: ~ cell.x += grid.width + 1~ - Inside source: true *** True Line Result - 6720,8350,6780,8570 -** Processing line: ~ 6480,8340,6720,8320~ + cell.x += grid.width + 1 +** Processing line: ~ # Proceeds as if scaling up for the first grid~ - Inside source: true *** True Line Result - 6480,8340,6720,8320 -** Processing line: ~ 6260,8400,6480,8340~ + # Proceeds as if scaling up for the first grid +** Processing line: ~ bfs_scale_up(cell)~ - Inside source: true *** True Line Result - 6260,8400,6480,8340 -** Processing line: ~ 6050,8580,6240,8400~ + bfs_scale_up(cell) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6050,8580,6240,8400 -** Processing line: ~ 5760,8630,6040,8590~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 5760,8630,6040,8590 -** Processing line: ~ 5520,8690,5740,8630~ + +** Processing line: ~ # Checks and handles input for the buttons~ - Inside source: true *** True Line Result - 5520,8690,5740,8630 -** Processing line: ~ 5120,8690,5450,8700~ + # Checks and handles input for the buttons +** Processing line: ~ # Called when the mouse is lifted~ - Inside source: true *** True Line Result - 5120,8690,5450,8700 -** Processing line: ~ 4570,8670,5080,8690~ + # Called when the mouse is lifted +** Processing line: ~ def input_buttons~ - Inside source: true *** True Line Result - 4570,8670,5080,8690 -** Processing line: ~ 4020,8610,4540,8670~ + def input_buttons +** Processing line: ~ input_left_button~ - Inside source: true *** True Line Result - 4020,8610,4540,8670 -** Processing line: ~ 3540,8480,4020,8610~ + input_left_button +** Processing line: ~ input_center_button~ - Inside source: true *** True Line Result - 3540,8480,4020,8610 -** Processing line: ~ 3520,8230,3520,8480~ + input_center_button +** Processing line: ~ input_right_button~ - Inside source: true *** True Line Result - 3520,8230,3520,8480 -** Processing line: ~ 3520,7930,3520,8230~ + input_right_button +** Processing line: ~ end~ - Inside source: true *** True Line Result - 3520,7930,3520,8230 -** Processing line: ~ 3520,7930,3540,7630~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3520,7930,3540,7630 -** Processing line: ~ 3480,7320,3540,7610~ + +** Processing line: ~ # Checks if the previous step button is clicked~ - Inside source: true *** True Line Result - 3480,7320,3540,7610 -** Processing line: ~ 3480,7280,3500,7010~ + # Checks if the previous step button is clicked +** Processing line: ~ # If it is, it pauses the animation and moves the search one step backward~ - Inside source: true *** True Line Result - 3480,7280,3500,7010 -** Processing line: ~ 3500,6980,3680,6850~ + # If it is, it pauses the animation and moves the search one step backward +** Processing line: ~ def input_left_button~ - Inside source: true *** True Line Result - 3500,6980,3680,6850 -** Processing line: ~ 3680,6850,4220,6840~ + def input_left_button +** Processing line: ~ if left_button_clicked?~ - Inside source: true *** True Line Result - 3680,6850,4220,6840 -** Processing line: ~ 4230,6840,4760,6850~ + if left_button_clicked? +** Processing line: ~ state.play = false~ - Inside source: true *** True Line Result - 4230,6840,4760,6850 -** Processing line: ~ 4780,6850,5310,6860~ + state.play = false +** Processing line: ~ state.current_step -= 1~ - Inside source: true *** True Line Result - 4780,6850,5310,6860 -** Processing line: ~ 5310,6860,5720,6940~ + state.current_step -= 1 +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - 5310,6860,5720,6940 -** Processing line: ~ 5720,6940,5880,7250~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5720,6940,5880,7250 -** Processing line: ~ 5880,7250,5900,7520~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 5880,7250,5900,7520 -** Processing line: ~ 100,11240,440,11300~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 100,11240,440,11300 -** Processing line: ~ 440,11300,760,11330~ + +** Processing line: ~ # Controls the play/pause button~ - Inside source: true *** True Line Result - 440,11300,760,11330 -** Processing line: ~ 1480,11280,1840,11230~ + # Controls the play/pause button +** Processing line: ~ # Inverses whether the animation is playing or not when clicked~ - Inside source: true *** True Line Result - 1480,11280,1840,11230 -** Processing line: ~ 2200,11130,2360,11090~ + # Inverses whether the animation is playing or not when clicked +** Processing line: ~ def input_center_button~ - Inside source: true *** True Line Result - 2200,11130,2360,11090 -** Processing line: ~ 1840,11230,2200,11130~ + def input_center_button +** Processing line: ~ if center_button_clicked? || inputs.keyboard.key_down.space~ - Inside source: true *** True Line Result - 1840,11230,2200,11130 -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + if center_button_clicked? || inputs.keyboard.key_down.space +** Processing line: ~ state.play = !state.play~ +- Inside source: true *** True Line Result -#+end_src + state.play = !state.play +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Rpg Narrative - Choose Your Own Adventure - decision.rb~ -- Header detected. +** Processing line: ~ # Checks if the next step button is clicked~ +- Inside source: true *** True Line Result - + # Checks if the next step button is clicked +** Processing line: ~ # If it is, it pauses the animation and moves the search one step forward~ +- Inside source: true *** True Line Result -* Rpg Narrative - Choose Your Own Adventure - decision.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # If it is, it pauses the animation and moves the search one step forward +** Processing line: ~ def input_right_button~ +- Inside source: true *** True Line Result - + def input_right_button +** Processing line: ~ if right_button_clicked?~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/decision.rb~ + if right_button_clicked? +** Processing line: ~ state.play = false~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/decision.rb -** Processing line: ~ # Hey there! Welcome to Four Decisions. Here is how you~ + state.play = false +** Processing line: ~ state.current_step += 1~ - Inside source: true *** True Line Result - # Hey there! Welcome to Four Decisions. Here is how you -** Processing line: ~ # create your decision tree. Remove =being and =end from the text to~ + state.current_step += 1 +** Processing line: ~ move_searches_one_step_forward~ - Inside source: true *** True Line Result - # create your decision tree. Remove =being and =end from the text to -** Processing line: ~ # enable the game (just save the file). Change stuff and see what happens!~ + move_searches_one_step_forward +** Processing line: ~ end~ - Inside source: true *** True Line Result - # enable the game (just save the file). Change stuff and see what happens! -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def game~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def game -** Processing line: ~ {~ + +** Processing line: ~ # These methods detect when the buttons are clicked~ - Inside source: true *** True Line Result - { -** Processing line: ~ starting_decision: :stormy_night,~ + # These methods detect when the buttons are clicked +** Processing line: ~ def left_button_clicked?~ - Inside source: true *** True Line Result - starting_decision: :stormy_night, -** Processing line: ~ decisions: {~ + def left_button_clicked? +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.left) && inputs.mouse.up~ - Inside source: true *** True Line Result - decisions: { -** Processing line: ~ stormy_night: {~ + inputs.mouse.point.inside_rect?(buttons.left) && inputs.mouse.up +** Processing line: ~ end~ - Inside source: true *** True Line Result - stormy_night: { -** Processing line: ~ description: 'It was a dark and stormy night. (storyline located in decision.rb)',~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - description: 'It was a dark and stormy night. (storyline located in decision.rb)', -** Processing line: ~ option_one: {~ + +** Processing line: ~ def center_button_clicked?~ - Inside source: true *** True Line Result - option_one: { -** Processing line: ~ description: 'Go to sleep.',~ + def center_button_clicked? +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.center) && inputs.mouse.up~ - Inside source: true *** True Line Result - description: 'Go to sleep.', -** Processing line: ~ decision: :nap~ + inputs.mouse.point.inside_rect?(buttons.center) && inputs.mouse.up +** Processing line: ~ end~ - Inside source: true *** True Line Result - decision: :nap -** Processing line: ~ },~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - }, -** Processing line: ~ option_two: {~ + +** Processing line: ~ def right_button_clicked?~ - Inside source: true *** True Line Result - option_two: { -** Processing line: ~ description: 'Watch a movie.',~ + def right_button_clicked? +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.right) && inputs.mouse.up~ - Inside source: true *** True Line Result - description: 'Watch a movie.', -** Processing line: ~ decision: :movie~ + inputs.mouse.point.inside_rect?(buttons.right) && inputs.mouse.up +** Processing line: ~ end~ - Inside source: true *** True Line Result - decision: :movie -** Processing line: ~ },~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - }, -** Processing line: ~ option_three: {~ + +** Processing line: ~~ - Inside source: true *** True Line Result - option_three: { -** Processing line: ~ description: 'Go outside.',~ + +** Processing line: ~ # Signal that the user is going to be moving the slider~ - Inside source: true *** True Line Result - description: 'Go outside.', -** Processing line: ~ decision: :go_outside~ + # Signal that the user is going to be moving the slider +** Processing line: ~ # Is the mouse over the circle of the slider?~ - Inside source: true *** True Line Result - decision: :go_outside -** Processing line: ~ },~ + # Is the mouse over the circle of the slider? +** Processing line: ~ def mouse_over_slider?~ - Inside source: true *** True Line Result - }, -** Processing line: ~ option_four: {~ + def mouse_over_slider? +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing)~ - Inside source: true *** True Line Result - option_four: { -** Processing line: ~ description: 'Get a snack.',~ + circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing) +** Processing line: ~ circle_y = (slider.y - slider.offset)~ - Inside source: true *** True Line Result - description: 'Get a snack.', -** Processing line: ~ decision: :get_a_snack~ + circle_y = (slider.y - slider.offset) +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ - Inside source: true *** True Line Result - decision: :get_a_snack -** Processing line: ~ }~ + circle_rect = [circle_x, circle_y, 37, 37] +** Processing line: ~ inputs.mouse.point.inside_rect?(circle_rect)~ - Inside source: true *** True Line Result - } -** Processing line: ~ },~ + inputs.mouse.point.inside_rect?(circle_rect) +** Processing line: ~ end~ - Inside source: true *** True Line Result - }, -** Processing line: ~ nap: {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - nap: { -** Processing line: ~ description: 'You took a nap. The end.',~ + +** Processing line: ~ # Signal that the user is going to be moving the star from the first grid~ - Inside source: true *** True Line Result - description: 'You took a nap. The end.', -** Processing line: ~ option_one: {~ + # Signal that the user is going to be moving the star from the first grid +** Processing line: ~ def bfs_mouse_over_star?~ - Inside source: true *** True Line Result - option_one: { -** Processing line: ~ description: 'Start over.',~ + def bfs_mouse_over_star? +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.star))~ - Inside source: true *** True Line Result - description: 'Start over.', -** Processing line: ~ decision: :stormy_night~ + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.star)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - decision: :stormy_night -** Processing line: ~ }~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - } -** Processing line: ~ }~ + +** Processing line: ~ # Signal that the user is going to be moving the star from the second grid~ - Inside source: true *** True Line Result - } -** Processing line: ~ }~ + # Signal that the user is going to be moving the star from the second grid +** Processing line: ~ def heuristic_mouse_over_star?~ - Inside source: true *** True Line Result - } -** Processing line: ~ }~ + def heuristic_mouse_over_star? +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.star))~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.star)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + # Signal that the user is going to be moving the target from the first grid +** Processing line: ~ def bfs_mouse_over_target?~ +- Inside source: true *** True Line Result - -** Processing line: ~* Rpg Narrative - Choose Your Own Adventure - main.rb~ -- Header detected. + def bfs_mouse_over_target? +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.target))~ +- Inside source: true *** True Line Result - + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.target)) +** Processing line: ~ end~ +- Inside source: true *** True Line Result -* Rpg Narrative - Choose Your Own Adventure - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + end +** Processing line: ~~ +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/main.rb~ +** Processing line: ~ # Signal that the user is going to be moving the target from the second grid~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/main.rb -** Processing line: ~ =begin~ + # Signal that the user is going to be moving the target from the second grid +** Processing line: ~ def heuristic_mouse_over_target?~ - Inside source: true *** True Line Result - =begin -** Processing line: ~~ + def heuristic_mouse_over_target? +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.target))~ - Inside source: true *** True Line Result - -** Processing line: ~ Reminders:~ + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.target)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - Reminders: + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The values can be found~ +** Processing line: ~ # Signal that the user is going to be removing walls from the first grid~ - Inside source: true *** True Line Result - - Hashes: Collection of unique keys and their corresponding values. The values can be found -** Processing line: ~ using their keys.~ + # Signal that the user is going to be removing walls from the first grid +** Processing line: ~ def bfs_mouse_over_wall?~ - Inside source: true *** True Line Result - using their keys. -** Processing line: ~~ + def bfs_mouse_over_wall? +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - -** Processing line: ~ In this sample app, the decisions needed for the game are stored in a hash. In fact, the~ + grid.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(bfs_scale_up(wall))~ - Inside source: true *** True Line Result - In this sample app, the decisions needed for the game are stored in a hash. In fact, the -** Processing line: ~ decision.rb file contains hashes inside of other hashes!~ + return true if inputs.mouse.point.inside_rect?(bfs_scale_up(wall)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - decision.rb file contains hashes inside of other hashes! + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Each option is a key in the first hash, but also contains a hash (description and~ -- Inside source: true -*** True Line Result - Each option is a key in the first hash, but also contains a hash (description and -** Processing line: ~ decision being its keys) as its value.~ +** Processing line: ~ false~ - Inside source: true *** True Line Result - decision being its keys) as its value. -** Processing line: ~ Go into the decision.rb file and take a look before diving into the code below.~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - Go into the decision.rb file and take a look before diving into the code below. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ +** Processing line: ~ # Signal that the user is going to be removing walls from the second grid~ - Inside source: true *** True Line Result - - args.outputs.labels: An array. The values generate a label. -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ + # Signal that the user is going to be removing walls from the second grid +** Processing line: ~ def heuristic_mouse_over_wall?~ - Inside source: true *** True Line Result - The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ + def heuristic_mouse_over_wall? +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - For more information about labels, go to mygame/documentation/02-labels.md. + grid.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(heuristic_scale_up(wall))~ +- Inside source: true +*** True Line Result + return true if inputs.mouse.point.inside_rect?(heuristic_scale_up(wall)) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - args.keyboard.key_down.KEY: Determines if a key is in the down state or pressed down.~ +** Processing line: ~ false~ - Inside source: true *** True Line Result - - args.keyboard.key_down.KEY: Determines if a key is in the down state or pressed down. -** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - For more information about the keyboard, go to mygame/documentation/06-keyboard.md. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated~ +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ - Inside source: true *** True Line Result - - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ + # Signal that the user is going to be adding walls from the first grid +** Processing line: ~ def bfs_mouse_over_grid?~ - Inside source: true *** True Line Result - as Ruby code, and the placeholder is replaced with its corresponding value or result. -** Processing line: ~~ + def bfs_mouse_over_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.rect))~ - Inside source: true *** True Line Result - -** Processing line: ~ =end~ + inputs.mouse.point.inside_rect?(bfs_scale_up(grid.rect)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - =end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # This sample app provides users with a story and multiple decisions that they can choose to make.~ +** Processing line: ~ # Signal that the user is going to be adding walls from the second grid~ - Inside source: true *** True Line Result - # This sample app provides users with a story and multiple decisions that they can choose to make. -** Processing line: ~ # Users can make a decision using their keyboard, and the story will move forward based on user choices.~ + # Signal that the user is going to be adding walls from the second grid +** Processing line: ~ def heuristic_mouse_over_grid?~ - Inside source: true *** True Line Result - # Users can make a decision using their keyboard, and the story will move forward based on user choices. + def heuristic_mouse_over_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.rect))~ +- Inside source: true +*** True Line Result + inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.rect)) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # The decisions available to users are stored in the decision.rb file.~ +** Processing line: ~ # This method is called when the user is editing the slider~ - Inside source: true *** True Line Result - # The decisions available to users are stored in the decision.rb file. -** Processing line: ~ # We must have access to it for the game to function properly.~ + # This method is called when the user is editing the slider +** Processing line: ~ # It pauses the animation and moves the white circle to the closest integer point~ - Inside source: true *** True Line Result - # We must have access to it for the game to function properly. -** Processing line: ~ GAME_FILE = 'app/decision.rb' # found in app folder~ + # It pauses the animation and moves the white circle to the closest integer point +** Processing line: ~ # on the slider~ - Inside source: true *** True Line Result - GAME_FILE = 'app/decision.rb' # found in app folder -** Processing line: ~~ + # on the slider +** Processing line: ~ # Changes the step of the search to be animated~ - Inside source: true *** True Line Result - -** Processing line: ~ require GAME_FILE # require used to load another file, import class/method definitions~ + # Changes the step of the search to be animated +** Processing line: ~ def process_input_slider~ - Inside source: true *** True Line Result - require GAME_FILE # require used to load another file, import class/method definitions + def process_input_slider +** Processing line: ~ state.play = false~ +- Inside source: true +*** True Line Result + state.play = false +** Processing line: ~ mouse_x = inputs.mouse.point.x~ +- Inside source: true +*** True Line Result + mouse_x = inputs.mouse.point.x ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Instructions are given using labels to users if they have not yet set up their story in the decision.rb file.~ +** Processing line: ~ # Bounds the mouse_x to the closest x value on the slider line~ - Inside source: true *** True Line Result - # Instructions are given using labels to users if they have not yet set up their story in the decision.rb file. -** Processing line: ~ # Otherwise, the game is run.~ + # Bounds the mouse_x to the closest x value on the slider line +** Processing line: ~ mouse_x = slider.x if mouse_x < slider.x~ - Inside source: true *** True Line Result - # Otherwise, the game is run. -** Processing line: ~ def tick args~ + mouse_x = slider.x if mouse_x < slider.x +** Processing line: ~ mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ if !args.state.loaded && !respond_to?(:game) # if game is not loaded and not responding to game symbol's method~ + mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w +** Processing line: ~~ - Inside source: true *** True Line Result - if !args.state.loaded && !respond_to?(:game) # if game is not loaded and not responding to game symbol's method -** Processing line: ~ args.labels << [640, 370, 'Hey there! Welcome to Four Decisions.', 0, 1] # a welcome label is shown~ + +** Processing line: ~ # Sets the current search step to the one represented by the mouse x value~ - Inside source: true *** True Line Result - args.labels << [640, 370, 'Hey there! Welcome to Four Decisions.', 0, 1] # a welcome label is shown -** Processing line: ~ args.labels << [640, 340, 'Go to the file called decision.rb and tell me your story.', 0, 1]~ + # Sets the current search step to the one represented by the mouse x value +** Processing line: ~ # The slider's circle moves due to the render_slider method using anim_steps~ - Inside source: true *** True Line Result - args.labels << [640, 340, 'Go to the file called decision.rb and tell me your story.', 0, 1] -** Processing line: ~ elsif respond_to?(:game) # otherwise, if responds to game~ + # The slider's circle moves due to the render_slider method using anim_steps +** Processing line: ~ state.current_step = ((mouse_x - slider.x) / slider.spacing).to_i~ - Inside source: true *** True Line Result - elsif respond_to?(:game) # otherwise, if responds to game -** Processing line: ~ args.state.loaded = true~ + state.current_step = ((mouse_x - slider.x) / slider.spacing).to_i +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.loaded = true -** Processing line: ~ tick_game args # calls tick_game method, runs game~ + +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - tick_game args # calls tick_game method, runs game + recalculate_searches ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -76187,162 +79956,154 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ if args.state.tick_count.mod_zero? 60 # update every 60 frames~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ - Inside source: true *** True Line Result - if args.state.tick_count.mod_zero? 60 # update every 60 frames -** Processing line: ~ t = args.gtk.ffi_file.mtime GAME_FILE # mtime returns modification time for named file~ + # Moves the star to the cell closest to the mouse in the first grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - t = args.gtk.ffi_file.mtime GAME_FILE # mtime returns modification time for named file -** Processing line: ~ if t != args.state.mtime~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - if t != args.state.mtime -** Processing line: ~ args.state.mtime = t~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def process_input_bfs_star~ - Inside source: true *** True Line Result - args.state.mtime = t -** Processing line: ~ require GAME_FILE # require used to load file~ + def process_input_bfs_star +** Processing line: ~ old_star = grid.star.clone~ - Inside source: true *** True Line Result - require GAME_FILE # require used to load file -** Processing line: ~ args.state.game_definition = nil # game definition and decision are empty~ + old_star = grid.star.clone +** Processing line: ~ unless bfs_cell_closest_to_mouse == grid.target~ - Inside source: true *** True Line Result - args.state.game_definition = nil # game definition and decision are empty -** Processing line: ~ args.state.decision_id = nil~ + unless bfs_cell_closest_to_mouse == grid.target +** Processing line: ~ grid.star = bfs_cell_closest_to_mouse~ - Inside source: true *** True Line Result - args.state.decision_id = nil + grid.star = bfs_cell_closest_to_mouse ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~ end~ +** Processing line: ~ unless old_star == grid.star~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + unless old_star == grid.star +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - -** Processing line: ~ # Runs methods needed for game to function properly~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Runs methods needed for game to function properly -** Processing line: ~ # Creates a rectangular border around the screen~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Creates a rectangular border around the screen -** Processing line: ~ def tick_game args~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def tick_game args -** Processing line: ~ defaults args~ + +** Processing line: ~ # Moves the star to the cell closest to the mouse in the second grid~ - Inside source: true *** True Line Result - defaults args -** Processing line: ~ args.borders << args.grid.rect~ + # Moves the star to the cell closest to the mouse in the second grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - args.borders << args.grid.rect -** Processing line: ~ render_decision args~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - render_decision args -** Processing line: ~ process_inputs args~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def process_input_heuristic_star~ - Inside source: true *** True Line Result - process_inputs args -** Processing line: ~ end~ + def process_input_heuristic_star +** Processing line: ~ old_star = grid.star.clone~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + old_star = grid.star.clone +** Processing line: ~ unless heuristic_cell_closest_to_mouse == grid.target~ - Inside source: true *** True Line Result - -** Processing line: ~ # Sets default values and uses decision.rb file to define game and decision_id~ + unless heuristic_cell_closest_to_mouse == grid.target +** Processing line: ~ grid.star = heuristic_cell_closest_to_mouse~ - Inside source: true *** True Line Result - # Sets default values and uses decision.rb file to define game and decision_id -** Processing line: ~ # variable using the starting decision~ + grid.star = heuristic_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - # variable using the starting decision -** Processing line: ~ def defaults args~ + end +** Processing line: ~ unless old_star == grid.star~ - Inside source: true *** True Line Result - def defaults args -** Processing line: ~ args.state.game_definition ||= game~ + unless old_star == grid.star +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - args.state.game_definition ||= game -** Processing line: ~ args.state.decision_id ||= args.state.game_definition[:starting_decision]~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.decision_id ||= args.state.game_definition[:starting_decision] -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Outputs the possible decision descriptions the user can choose onto the screen~ -- Inside source: true -*** True Line Result - # Outputs the possible decision descriptions the user can choose onto the screen -** Processing line: ~ # as well as what key to press on their keyboard to make their decision~ +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ - Inside source: true *** True Line Result - # as well as what key to press on their keyboard to make their decision -** Processing line: ~ def render_decision args~ + # Moves the target to the grid closest to the mouse in the first grid +** Processing line: ~ # Only recalculate_searchess the search if the target changes position~ - Inside source: true *** True Line Result - def render_decision args -** Processing line: ~ decision = current_decision args~ + # Only recalculate_searchess the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ - Inside source: true *** True Line Result - decision = current_decision args -** Processing line: ~ # text is either the value of decision's description key or warning that no description exists~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def process_input_bfs_target~ - Inside source: true *** True Line Result - # text is either the value of decision's description key or warning that no description exists -** Processing line: ~ args.labels << [640, 360, decision[:description] || "No definition found for #{args.state.decision_id}. Please update decision.rb.", 0, 1] # uses string interpolation~ + def process_input_bfs_target +** Processing line: ~ old_target = grid.target.clone~ - Inside source: true *** True Line Result - args.labels << [640, 360, decision[:description] || "No definition found for #{args.state.decision_id}. Please update decision.rb.", 0, 1] # uses string interpolation -** Processing line: ~~ + old_target = grid.target.clone +** Processing line: ~ unless bfs_cell_closest_to_mouse == grid.star~ - Inside source: true *** True Line Result - -** Processing line: ~ # All decisions are stored in a hash~ + unless bfs_cell_closest_to_mouse == grid.star +** Processing line: ~ grid.target = bfs_cell_closest_to_mouse~ - Inside source: true *** True Line Result - # All decisions are stored in a hash -** Processing line: ~ # The descriptions output onto the screen are the values for the description keys of the hash.~ + grid.target = bfs_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - # The descriptions output onto the screen are the values for the description keys of the hash. -** Processing line: ~ if decision[:option_one]~ + end +** Processing line: ~ unless old_target == grid.target~ - Inside source: true *** True Line Result - if decision[:option_one] -** Processing line: ~ args.labels << [10, 360, decision[:option_one][:description], 0, 0] # option one's description label~ + unless old_target == grid.target +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - args.labels << [10, 360, decision[:option_one][:description], 0, 0] # option one's description label -** Processing line: ~ args.labels << [10, 335, "(Press 'left' on the keyboard to select this decision)", -5, 0] # label of what key to press to select the decision~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.labels << [10, 335, "(Press 'left' on the keyboard to select this decision)", -5, 0] # label of what key to press to select the decision + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -76351,98 +80112,102 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ if decision[:option_two]~ +** Processing line: ~ # Moves the target to the cell closest to the mouse in the second grid~ - Inside source: true *** True Line Result - if decision[:option_two] -** Processing line: ~ args.labels << [1270, 360, decision[:option_two][:description], 0, 2] # option two's description~ + # Moves the target to the cell closest to the mouse in the second grid +** Processing line: ~ # Only recalculate_searchess the search if the target changes position~ - Inside source: true *** True Line Result - args.labels << [1270, 360, decision[:option_two][:description], 0, 2] # option two's description -** Processing line: ~ args.labels << [1270, 335, "(Press 'right' on the keyboard to select this decision)", -5, 2]~ + # Only recalculate_searchess the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ - Inside source: true *** True Line Result - args.labels << [1270, 335, "(Press 'right' on the keyboard to select this decision)", -5, 2] -** Processing line: ~ end~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def process_input_heuristic_target~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def process_input_heuristic_target +** Processing line: ~ old_target = grid.target.clone~ - Inside source: true *** True Line Result - -** Processing line: ~ if decision[:option_three]~ + old_target = grid.target.clone +** Processing line: ~ unless heuristic_cell_closest_to_mouse == grid.star~ - Inside source: true *** True Line Result - if decision[:option_three] -** Processing line: ~ args.labels << [640, 45, decision[:option_three][:description], 0, 1] # option three's description~ + unless heuristic_cell_closest_to_mouse == grid.star +** Processing line: ~ grid.target = heuristic_cell_closest_to_mouse~ - Inside source: true *** True Line Result - args.labels << [640, 45, decision[:option_three][:description], 0, 1] # option three's description -** Processing line: ~ args.labels << [640, 20, "(Press 'down' on the keyboard to select this decision)", -5, 1]~ + grid.target = heuristic_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.labels << [640, 20, "(Press 'down' on the keyboard to select this decision)", -5, 1] -** Processing line: ~ end~ + end +** Processing line: ~ unless old_target == grid.target~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + unless old_target == grid.target +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - -** Processing line: ~ if decision[:option_four]~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - if decision[:option_four] -** Processing line: ~ args.labels << [640, 700, decision[:option_four][:description], 0, 1] # option four's description~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.labels << [640, 700, decision[:option_four][:description], 0, 1] # option four's description -** Processing line: ~ args.labels << [640, 675, "(Press 'up' on the keyboard to select this decision)", -5, 1]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.labels << [640, 675, "(Press 'up' on the keyboard to select this decision)", -5, 1] -** Processing line: ~ end~ + +** Processing line: ~ # Removes walls in the first grid that are under the cursor~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Removes walls in the first grid that are under the cursor +** Processing line: ~ def process_input_bfs_remove_wall~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def process_input_bfs_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - -** Processing line: ~ # Uses keyboard input from the user to make a decision~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - # Uses keyboard input from the user to make a decision -** Processing line: ~ # Assigns the decision as the value of the decision_id variable~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - # Assigns the decision as the value of the decision_id variable -** Processing line: ~ def process_inputs args~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if bfs_mouse_over_grid?~ - Inside source: true *** True Line Result - def process_inputs args -** Processing line: ~ decision = current_decision args # calls current_decision method~ + if bfs_mouse_over_grid? +** Processing line: ~ if grid.walls.has_key?(bfs_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - decision = current_decision args # calls current_decision method -** Processing line: ~~ + if grid.walls.has_key?(bfs_cell_closest_to_mouse) +** Processing line: ~ grid.walls.delete(bfs_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - -** Processing line: ~ if args.keyboard.key_down.left! && decision[:option_one] # if left key pressed and option one exists~ + grid.walls.delete(bfs_cell_closest_to_mouse) +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - if args.keyboard.key_down.left! && decision[:option_one] # if left key pressed and option one exists -** Processing line: ~ args.state.decision_id = decision[:option_one][:decision] # value of option one's decision hash key is set to decision_id~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.decision_id = decision[:option_one][:decision] # value of option one's decision hash key is set to decision_id + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -76451,550 +80216,538 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ if args.keyboard.key_down.right! && decision[:option_two] # if right key pressed and option two exists~ +** Processing line: ~ # Removes walls in the second grid that are under the cursor~ - Inside source: true *** True Line Result - if args.keyboard.key_down.right! && decision[:option_two] # if right key pressed and option two exists -** Processing line: ~ args.state.decision_id = decision[:option_two][:decision] # value of option two's decision hash key is set to decision_id~ + # Removes walls in the second grid that are under the cursor +** Processing line: ~ def process_input_heuristic_remove_wall~ - Inside source: true *** True Line Result - args.state.decision_id = decision[:option_two][:decision] # value of option two's decision hash key is set to decision_id -** Processing line: ~ end~ + def process_input_heuristic_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - -** Processing line: ~ if args.keyboard.key_down.down! && decision[:option_three] # if down key pressed and option three exists~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - if args.keyboard.key_down.down! && decision[:option_three] # if down key pressed and option three exists -** Processing line: ~ args.state.decision_id = decision[:option_three][:decision] # value of option three's decision hash key is set to decision_id~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if heuristic_mouse_over_grid?~ - Inside source: true *** True Line Result - args.state.decision_id = decision[:option_three][:decision] # value of option three's decision hash key is set to decision_id -** Processing line: ~ end~ + if heuristic_mouse_over_grid? +** Processing line: ~ if grid.walls.has_key?(heuristic_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if grid.walls.has_key?(heuristic_cell_closest_to_mouse) +** Processing line: ~ grid.walls.delete(heuristic_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - -** Processing line: ~ if args.keyboard.key_down.up! && decision[:option_four] # if up key pressed and option four exists~ + grid.walls.delete(heuristic_cell_closest_to_mouse) +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - if args.keyboard.key_down.up! && decision[:option_four] # if up key pressed and option four exists -** Processing line: ~ args.state.decision_id = decision[:option_four][:decision] # value of option four's decision hash key is set to decision_id~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.decision_id = decision[:option_four][:decision] # value of option four's decision hash key is set to decision_id + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Adds a wall in the first grid in the cell the mouse is over +** Processing line: ~ def process_input_bfs_add_wall~ - Inside source: true *** True Line Result - -** Processing line: ~ # Uses decision_id's value to keep track of current decision being made~ + def process_input_bfs_add_wall +** Processing line: ~ if bfs_mouse_over_grid?~ - Inside source: true *** True Line Result - # Uses decision_id's value to keep track of current decision being made -** Processing line: ~ def current_decision args~ + if bfs_mouse_over_grid? +** Processing line: ~ unless grid.walls.has_key?(bfs_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - def current_decision args -** Processing line: ~ args.state.game_definition[:decisions][args.state.decision_id] || {} # either has value or is empty~ + unless grid.walls.has_key?(bfs_cell_closest_to_mouse) +** Processing line: ~ grid.walls[bfs_cell_closest_to_mouse] = true~ - Inside source: true *** True Line Result - args.state.game_definition[:decisions][args.state.decision_id] || {} # either has value or is empty -** Processing line: ~ end~ + grid.walls[bfs_cell_closest_to_mouse] = true +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # Resets the game.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Resets the game. -** Processing line: ~ $gtk.reset~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - $gtk.reset + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. -*** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Rpg Narrative - Return Of Serenity - lowrez_simulator.rb~ -- Header detected. +** Processing line: ~ # Adds a wall in the second grid in the cell the mouse is over~ +- Inside source: true *** True Line Result - + # Adds a wall in the second grid in the cell the mouse is over +** Processing line: ~ def process_input_heuristic_add_wall~ +- Inside source: true *** True Line Result -* Rpg Narrative - Return Of Serenity - lowrez_simulator.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + def process_input_heuristic_add_wall +** Processing line: ~ if heuristic_mouse_over_grid?~ +- Inside source: true *** True Line Result - + if heuristic_mouse_over_grid? +** Processing line: ~ unless grid.walls.has_key?(heuristic_cell_closest_to_mouse)~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/lowrez_simulator.rb~ + unless grid.walls.has_key?(heuristic_cell_closest_to_mouse) +** Processing line: ~ grid.walls[heuristic_cell_closest_to_mouse] = true~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/lowrez_simulator.rb -** Processing line: ~ ###################################################################################~ + grid.walls[heuristic_cell_closest_to_mouse] = true +** Processing line: ~ recalculate_searches~ - Inside source: true *** True Line Result - ################################################################################### -** Processing line: ~ # YOU CAN PLAY AROUND WITH THE CODE BELOW, BUT USE CAUTION AS THIS IS WHAT EMULATES~ + recalculate_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - # YOU CAN PLAY AROUND WITH THE CODE BELOW, BUT USE CAUTION AS THIS IS WHAT EMULATES -** Processing line: ~ # THE 64x64 CANVAS.~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # THE 64x64 CANVAS. -** Processing line: ~ ###################################################################################~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - ################################################################################### + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ TINY_RESOLUTION = 64~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - TINY_RESOLUTION = 64 -** Processing line: ~ TINY_SCALE = 720.fdiv(TINY_RESOLUTION + 5)~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - TINY_SCALE = 720.fdiv(TINY_RESOLUTION + 5) -** Processing line: ~ CENTER_OFFSET = 10~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ - Inside source: true *** True Line Result - CENTER_OFFSET = 10 -** Processing line: ~ EMULATED_FONT_SIZE = 20~ + # Finding the cell closest to the mouse helps with this +** Processing line: ~ def bfs_cell_closest_to_mouse~ - Inside source: true *** True Line Result - EMULATED_FONT_SIZE = 20 -** Processing line: ~ EMULATED_FONT_X_ZERO = 0~ + def bfs_cell_closest_to_mouse +** Processing line: ~ # Closest cell to the mouse in the first grid~ - Inside source: true *** True Line Result - EMULATED_FONT_X_ZERO = 0 -** Processing line: ~ EMULATED_FONT_Y_ZERO = 46~ + # Closest cell to the mouse in the first grid +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - EMULATED_FONT_Y_ZERO = 46 -** Processing line: ~~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Bound x and y to the grid~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ sprites = []~ + # Bound x and y to the grid +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - sprites = [] -** Processing line: ~ labels = []~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - labels = [] -** Processing line: ~ borders = []~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - borders = [] -** Processing line: ~ solids = []~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - solids = [] -** Processing line: ~ mouse = emulate_lowrez_mouse args~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - mouse = emulate_lowrez_mouse args -** Processing line: ~ args.state.show_gridlines = false~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.show_gridlines = false -** Processing line: ~ lowrez_tick args, sprites, labels, borders, solids, mouse~ + +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - lowrez_tick args, sprites, labels, borders, solids, mouse -** Processing line: ~ render_gridlines_if_needed args~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - render_gridlines_if_needed args -** Processing line: ~ render_mouse_crosshairs args, mouse~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse in the second grid helps with this~ - Inside source: true *** True Line Result - render_mouse_crosshairs args, mouse -** Processing line: ~ emulate_lowrez_scene args, sprites, labels, borders, solids, mouse~ + # Finding the cell closest to the mouse in the second grid helps with this +** Processing line: ~ def heuristic_cell_closest_to_mouse~ - Inside source: true *** True Line Result - emulate_lowrez_scene args, sprites, labels, borders, solids, mouse -** Processing line: ~ end~ + def heuristic_cell_closest_to_mouse +** Processing line: ~ # Closest cell grid to the mouse in the second~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Closest cell grid to the mouse in the second +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - -** Processing line: ~ def emulate_lowrez_mouse args~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - def emulate_lowrez_mouse args -** Processing line: ~ args.state.new_entity_strict(:lowrez_mouse) do |m|~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Translate the cell to the first grid~ - Inside source: true *** True Line Result - args.state.new_entity_strict(:lowrez_mouse) do |m| -** Processing line: ~ m.x = args.mouse.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1~ + # Translate the cell to the first grid +** Processing line: ~ x -= grid.width + 1~ - Inside source: true *** True Line Result - m.x = args.mouse.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1 -** Processing line: ~ m.y = args.mouse.y.idiv(TINY_SCALE)~ + x -= grid.width + 1 +** Processing line: ~ # Bound x and y to the first grid~ - Inside source: true *** True Line Result - m.y = args.mouse.y.idiv(TINY_SCALE) -** Processing line: ~ if args.mouse.click~ + # Bound x and y to the first grid +** Processing line: ~ x = 0 if x < 0~ - Inside source: true *** True Line Result - if args.mouse.click -** Processing line: ~ m.click = [~ + x = 0 if x < 0 +** Processing line: ~ y = 0 if y < 0~ - Inside source: true *** True Line Result - m.click = [ -** Processing line: ~ args.mouse.click.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1,~ + y = 0 if y < 0 +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - args.mouse.click.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1, -** Processing line: ~ args.mouse.click.point.y.idiv(TINY_SCALE)~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - args.mouse.click.point.y.idiv(TINY_SCALE) -** Processing line: ~ ]~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - ] -** Processing line: ~ m.down = m.click~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - m.down = m.click -** Processing line: ~ else~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - else -** Processing line: ~ m.click = nil~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - m.click = nil -** Processing line: ~ m.down = nil~ + +** Processing line: ~ def recalculate_searches~ - Inside source: true *** True Line Result - m.down = nil -** Processing line: ~ end~ + def recalculate_searches +** Processing line: ~ # Reset the searches~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Reset the searches +** Processing line: ~ bfs.came_from = {}~ - Inside source: true *** True Line Result - -** Processing line: ~ if args.mouse.up~ + bfs.came_from = {} +** Processing line: ~ bfs.frontier = []~ - Inside source: true *** True Line Result - if args.mouse.up -** Processing line: ~ m.up = [~ + bfs.frontier = [] +** Processing line: ~ bfs.path = []~ - Inside source: true *** True Line Result - m.up = [ -** Processing line: ~ args.mouse.up.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1,~ + bfs.path = [] +** Processing line: ~ heuristic.came_from = {}~ - Inside source: true *** True Line Result - args.mouse.up.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1, -** Processing line: ~ args.mouse.up.point.y.idiv(TINY_SCALE)~ + heuristic.came_from = {} +** Processing line: ~ heuristic.frontier = []~ - Inside source: true *** True Line Result - args.mouse.up.point.y.idiv(TINY_SCALE) -** Processing line: ~ ]~ + heuristic.frontier = [] +** Processing line: ~ heuristic.path = []~ - Inside source: true *** True Line Result - ] -** Processing line: ~ else~ + heuristic.path = [] +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ m.up = nil~ + +** Processing line: ~ # Move the searches forward to the current step~ - Inside source: true *** True Line Result - m.up = nil -** Processing line: ~ end~ + # Move the searches forward to the current step +** Processing line: ~ state.current_step.times { move_searches_one_step_forward }~ - Inside source: true *** True Line Result - end + state.current_step.times { move_searches_one_step_forward } ** 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_mouse_crosshairs args, mouse~ +** Processing line: ~ def move_searches_one_step_forward~ - Inside source: true *** True Line Result - def render_mouse_crosshairs args, mouse -** Processing line: ~ return unless args.state.show_gridlines~ + def move_searches_one_step_forward +** Processing line: ~ bfs_one_step_forward~ - Inside source: true *** True Line Result - return unless args.state.show_gridlines -** Processing line: ~ args.labels << [10, 25, "mouse: #{mouse.x} #{mouse.y}", 255, 255, 255]~ + bfs_one_step_forward +** Processing line: ~ heuristic_one_step_forward~ - Inside source: true *** True Line Result - args.labels << [10, 25, "mouse: #{mouse.x} #{mouse.y}", 255, 255, 255] -** Processing line: ~ end~ + heuristic_one_step_forward +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def emulate_lowrez_scene args, sprites, labels, borders, solids, mouse~ +** Processing line: ~ def bfs_one_step_forward~ - Inside source: true *** True Line Result - def emulate_lowrez_scene args, sprites, labels, borders, solids, mouse -** Processing line: ~ args.render_target(:lowrez).solids << [0, 0, 1280, 720]~ + def bfs_one_step_forward +** Processing line: ~ return if bfs.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - args.render_target(:lowrez).solids << [0, 0, 1280, 720] -** Processing line: ~ args.render_target(:lowrez).sprites << sprites~ + return if bfs.came_from.has_key?(grid.target) +** Processing line: ~~ - Inside source: true *** True Line Result - args.render_target(:lowrez).sprites << sprites -** Processing line: ~ args.render_target(:lowrez).borders << borders~ + +** Processing line: ~ # Only runs at the beginning of the search as setup.~ - Inside source: true *** True Line Result - args.render_target(:lowrez).borders << borders -** Processing line: ~ args.render_target(:lowrez).solids << solids~ + # Only runs at the beginning of the search as setup. +** Processing line: ~ if bfs.came_from.empty?~ - Inside source: true *** True Line Result - args.render_target(:lowrez).solids << solids -** Processing line: ~ args.outputs.primitives << labels.map do |l|~ + if bfs.came_from.empty? +** Processing line: ~ bfs.frontier << grid.star~ - Inside source: true *** True Line Result - args.outputs.primitives << labels.map do |l| -** Processing line: ~ as_label = l.label~ + bfs.frontier << grid.star +** Processing line: ~ bfs.came_from[grid.star] = nil~ - Inside source: true *** True Line Result - as_label = l.label -** Processing line: ~ l.text.each_char.each_with_index.map do |char, i|~ + bfs.came_from[grid.star] = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - l.text.each_char.each_with_index.map do |char, i| -** Processing line: ~ [CENTER_OFFSET + EMULATED_FONT_X_ZERO + (as_label.x * TINY_SCALE) + i * 5 * TINY_SCALE,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [CENTER_OFFSET + EMULATED_FONT_X_ZERO + (as_label.x * TINY_SCALE) + i * 5 * TINY_SCALE, -** Processing line: ~ EMULATED_FONT_Y_ZERO + (as_label.y * TINY_SCALE), char,~ + +** Processing line: ~ # A step in the search~ - Inside source: true *** True Line Result - EMULATED_FONT_Y_ZERO + (as_label.y * TINY_SCALE), char, -** Processing line: ~ EMULATED_FONT_SIZE, 0, as_label.r, as_label.g, as_label.b, as_label.a, 'fonts/dragonruby-gtk-4x4.ttf'].label~ + # A step in the search +** Processing line: ~ unless bfs.frontier.empty?~ - Inside source: true *** True Line Result - EMULATED_FONT_SIZE, 0, as_label.r, as_label.g, as_label.b, as_label.a, 'fonts/dragonruby-gtk-4x4.ttf'].label -** Processing line: ~ end~ + unless bfs.frontier.empty? +** Processing line: ~ # Takes the next frontier cell~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Takes the next frontier cell +** Processing line: ~ new_frontier = bfs.frontier.shift~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + new_frontier = bfs.frontier.shift +** Processing line: ~ # For each of its neighbors~ - Inside source: true *** True Line Result - -** Processing line: ~ args.sprites << [CENTER_OFFSET, 0, 1280 * TINY_SCALE, 720 * TINY_SCALE, :lowrez]~ + # For each of its neighbors +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ - Inside source: true *** True Line Result - args.sprites << [CENTER_OFFSET, 0, 1280 * TINY_SCALE, 720 * TINY_SCALE, :lowrez] -** Processing line: ~ end~ + adjacent_neighbors(new_frontier).each do |neighbor| +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # That have not been visited and are not walls +** Processing line: ~ unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_gridlines_if_needed args~ + unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited~ - Inside source: true *** True Line Result - def render_gridlines_if_needed args -** Processing line: ~ if args.state.show_gridlines && args.static_lines.length == 0~ + # Add them to the frontier and mark them as visited +** Processing line: ~ bfs.frontier << neighbor~ - Inside source: true *** True Line Result - if args.state.show_gridlines && args.static_lines.length == 0 -** Processing line: ~ args.static_lines << 65.times.map do |i|~ + bfs.frontier << neighbor +** Processing line: ~ bfs.came_from[neighbor] = new_frontier~ - Inside source: true *** True Line Result - args.static_lines << 65.times.map do |i| -** Processing line: ~ [~ + bfs.came_from[neighbor] = new_frontier +** Processing line: ~ end~ - Inside source: true *** True Line Result - [ -** Processing line: ~ [CENTER_OFFSET + i * TINY_SCALE + 1, 0,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [CENTER_OFFSET + i * TINY_SCALE + 1, 0, -** Processing line: ~ CENTER_OFFSET + i * TINY_SCALE + 1, 720, 128, 128, 128],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - CENTER_OFFSET + i * TINY_SCALE + 1, 720, 128, 128, 128], -** Processing line: ~ [CENTER_OFFSET + i * TINY_SCALE, 0,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [CENTER_OFFSET + i * TINY_SCALE, 0, -** Processing line: ~ CENTER_OFFSET + i * TINY_SCALE, 720, 128, 128, 128],~ + +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ - Inside source: true *** True Line Result - CENTER_OFFSET + i * TINY_SCALE, 720, 128, 128, 128], -** Processing line: ~ [CENTER_OFFSET, 0 + i * TINY_SCALE,~ + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line +** Processing line: ~ # Comment this line and let a path generate to see the difference~ - Inside source: true *** True Line Result - [CENTER_OFFSET, 0 + i * TINY_SCALE, -** Processing line: ~ CENTER_OFFSET + 720, 0 + i * TINY_SCALE, 128, 128, 128],~ + # Comment this line and let a path generate to see the difference +** Processing line: ~ bfs.frontier = bfs.frontier.sort_by {| cell | proximity_to_star(cell) }~ - Inside source: true *** True Line Result - CENTER_OFFSET + 720, 0 + i * TINY_SCALE, 128, 128, 128], -** Processing line: ~ [CENTER_OFFSET, 1 + i * TINY_SCALE,~ + bfs.frontier = bfs.frontier.sort_by {| cell | proximity_to_star(cell) } +** Processing line: ~~ - Inside source: true *** True Line Result - [CENTER_OFFSET, 1 + i * TINY_SCALE, -** Processing line: ~ CENTER_OFFSET + 720, 1 + i * TINY_SCALE, 128, 128, 128]~ + +** Processing line: ~ # If the search found the target~ - Inside source: true *** True Line Result - CENTER_OFFSET + 720, 1 + i * TINY_SCALE, 128, 128, 128] -** Processing line: ~ ]~ + # If the search found the target +** Processing line: ~ if bfs.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + if bfs.came_from.has_key?(grid.target) +** Processing line: ~ # Calculate the path between the target and star~ - Inside source: true *** True Line Result - end -** Processing line: ~ elsif !args.state.show_gridlines~ + # Calculate the path between the target and star +** Processing line: ~ bfs_calc_path~ - Inside source: true *** True Line Result - elsif !args.state.show_gridlines -** Processing line: ~ args.static_lines.clear~ + bfs_calc_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.static_lines.clear + end ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. -*** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Rpg Narrative - Return Of Serenity - main.rb~ -- Header detected. +** Processing line: ~ # Calculates the path between the target and star for the breadth first search~ +- Inside source: true *** True Line Result - + # Calculates the path between the target and star for the breadth first search +** Processing line: ~ # Only called when the breadth first search finds the target~ +- Inside source: true *** True Line Result -* Rpg Narrative - Return Of Serenity - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # Only called when the breadth first search finds the target +** Processing line: ~ def bfs_calc_path~ +- Inside source: true *** True Line Result - + def bfs_calc_path +** Processing line: ~ # Start from the target~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/main.rb~ + # Start from the target +** Processing line: ~ endpoint = grid.target~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/main.rb -** Processing line: ~ require 'app/require.rb'~ + endpoint = grid.target +** Processing line: ~ # And the cell it came from~ - Inside source: true *** True Line Result - require 'app/require.rb' -** Processing line: ~~ + # And the cell it came from +** Processing line: ~ next_endpoint = bfs.came_from[endpoint]~ - Inside source: true *** True Line Result - -** Processing line: ~ def defaults args~ + next_endpoint = bfs.came_from[endpoint] +** Processing line: ~ while endpoint and next_endpoint~ - Inside source: true *** True Line Result - def defaults args -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ + while endpoint and next_endpoint +** Processing line: ~ # Draw a path between these two cells and store it~ - Inside source: true *** True Line Result - args.outputs.background_color = [0, 0, 0] -** Processing line: ~ args.state.last_story_line_text ||= ""~ + # Draw a path between these two cells and store it +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ - Inside source: true *** True Line Result - args.state.last_story_line_text ||= "" -** Processing line: ~ args.state.scene_history ||= []~ + path = get_path_between(endpoint, next_endpoint) +** Processing line: ~ bfs.path << path~ - Inside source: true *** True Line Result - args.state.scene_history ||= [] -** Processing line: ~ args.state.storyline_history ||= []~ + bfs.path << path +** Processing line: ~ # And get the next pair of cells~ - Inside source: true *** True Line Result - args.state.storyline_history ||= [] -** Processing line: ~ args.state.word_delay ||= 8~ + # And get the next pair of cells +** Processing line: ~ endpoint = next_endpoint~ - Inside source: true *** True Line Result - args.state.word_delay ||= 8 -** Processing line: ~ if args.state.tick_count == 0~ + endpoint = next_endpoint +** Processing line: ~ next_endpoint = bfs.came_from[endpoint]~ - Inside source: true *** True Line Result - if args.state.tick_count == 0 -** Processing line: ~ args.gtk.stop_music~ + next_endpoint = bfs.came_from[endpoint] +** Processing line: ~ # Continue till there are no more cells~ - Inside source: true *** True Line Result - args.gtk.stop_music -** Processing line: ~ args.outputs.sounds << 'sounds/static-loop.ogg'~ + # Continue till there are no more cells +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.outputs.sounds << 'sounds/static-loop.ogg' + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -77003,142 +80756,122 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ if args.state.last_story_line_text~ +** Processing line: ~ # Moves the heuristic search forward one step~ - Inside source: true *** True Line Result - if args.state.last_story_line_text -** Processing line: ~ lines = args.state~ + # Moves the heuristic search forward one step +** Processing line: ~ # Can be called from tick while the animation is playing~ - Inside source: true *** True Line Result - lines = args.state -** Processing line: ~ .last_story_line_text~ + # Can be called from tick while the animation is playing +** Processing line: ~ # Can also be called when recalculating the searches after the user edited the grid~ - Inside source: true *** True Line Result - .last_story_line_text -** Processing line: ~ .gsub("-", "")~ + # Can also be called when recalculating the searches after the user edited the grid +** Processing line: ~ def heuristic_one_step_forward~ - Inside source: true *** True Line Result - .gsub("-", "") -** Processing line: ~ .gsub("~", "")~ + def heuristic_one_step_forward +** Processing line: ~ # Stop the search if the target has been found~ - Inside source: true *** True Line Result - .gsub("~", "") -** Processing line: ~ .wrapped_lines(50)~ + # Stop the search if the target has been found +** Processing line: ~ return if heuristic.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - .wrapped_lines(50) + return if heuristic.came_from.has_key?(grid.target) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.labels << lines.map_with_index { |l, i| [690, 200 - (i * 25), l, 1, 0, 255, 255, 255] }~ -- Inside source: true -*** True Line Result - args.outputs.labels << lines.map_with_index { |l, i| [690, 200 - (i * 25), l, 1, 0, 255, 255, 255] } -** Processing line: ~ elsif args.state.storyline_history[-1]~ +** Processing line: ~ # If the search has not begun~ - Inside source: true *** True Line Result - elsif args.state.storyline_history[-1] -** Processing line: ~ lines = args.state~ + # If the search has not begun +** Processing line: ~ if heuristic.came_from.empty?~ - Inside source: true *** True Line Result - lines = args.state -** Processing line: ~ .storyline_history[-1]~ + if heuristic.came_from.empty? +** Processing line: ~ # Setup the search to begin from the star~ - Inside source: true *** True Line Result - .storyline_history[-1] -** Processing line: ~ .gsub("-", "")~ + # Setup the search to begin from the star +** Processing line: ~ heuristic.frontier << grid.star~ - Inside source: true *** True Line Result - .gsub("-", "") -** Processing line: ~ .gsub("~", "")~ + heuristic.frontier << grid.star +** Processing line: ~ heuristic.came_from[grid.star] = nil~ - Inside source: true *** True Line Result - .gsub("~", "") -** Processing line: ~ .wrapped_lines(50)~ + heuristic.came_from[grid.star] = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - .wrapped_lines(50) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.labels << lines.map_with_index { |l, i| [690, 200 - (i * 25), l, 1, 0, 255, 255, 255] }~ -- Inside source: true -*** True Line Result - args.outputs.labels << lines.map_with_index { |l, i| [690, 200 - (i * 25), l, 1, 0, 255, 255, 255] } -** Processing line: ~ end~ +** Processing line: ~ # One step in the heuristic search~ - Inside source: true *** True Line Result - end + # One step in the heuristic search ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return if args.state.current_scene~ -- Inside source: true -*** True Line Result - return if args.state.current_scene -** Processing line: ~ set_scene(args, day_one_beginning(args))~ -- Inside source: true -*** True Line Result - set_scene(args, day_one_beginning(args)) -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ +** Processing line: ~ # Unless there are no more cells to explore from~ - Inside source: true *** True Line Result - -** Processing line: ~ def inputs_move_player args~ + # Unless there are no more cells to explore from +** Processing line: ~ unless heuristic.frontier.empty?~ - Inside source: true *** True Line Result - def inputs_move_player args -** Processing line: ~ if args.state.scene_changed_at.elapsed_time > 5~ + unless heuristic.frontier.empty? +** Processing line: ~ # Get the next cell to explore from~ - Inside source: true *** True Line Result - if args.state.scene_changed_at.elapsed_time > 5 -** Processing line: ~ if args.keyboard.down || args.keyboard.s || args.keyboard.j~ + # Get the next cell to explore from +** Processing line: ~ new_frontier = heuristic.frontier.shift~ - Inside source: true *** True Line Result - if args.keyboard.down || args.keyboard.s || args.keyboard.j -** Processing line: ~ args.state.player.y -= 0.25~ + new_frontier = heuristic.frontier.shift +** Processing line: ~ # For each of its neighbors~ - Inside source: true *** True Line Result - args.state.player.y -= 0.25 -** Processing line: ~ elsif args.keyboard.up || args.keyboard.w || args.keyboard.k~ + # For each of its neighbors +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ - Inside source: true *** True Line Result - elsif args.keyboard.up || args.keyboard.w || args.keyboard.k -** Processing line: ~ args.state.player.y += 0.25~ + adjacent_neighbors(new_frontier).each do |neighbor| +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - args.state.player.y += 0.25 -** Processing line: ~ end~ + # That have not been visited and are not walls +** Processing line: ~ unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited~ - Inside source: true *** True Line Result - -** Processing line: ~ if args.keyboard.left || args.keyboard.a || args.keyboard.h~ + # Add them to the frontier and mark them as visited +** Processing line: ~ heuristic.frontier << neighbor~ - Inside source: true *** True Line Result - if args.keyboard.left || args.keyboard.a || args.keyboard.h -** Processing line: ~ args.state.player.x -= 0.25~ + heuristic.frontier << neighbor +** Processing line: ~ heuristic.came_from[neighbor] = new_frontier~ - Inside source: true *** True Line Result - args.state.player.x -= 0.25 -** Processing line: ~ elsif args.keyboard.right || args.keyboard.d || args.keyboard.l~ + heuristic.came_from[neighbor] = new_frontier +** Processing line: ~ end~ - Inside source: true *** True Line Result - elsif args.keyboard.right || args.keyboard.d || args.keyboard.l -** Processing line: ~ args.state.player.x += 0.25~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.player.x += 0.25 + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -77147,70 +80880,70 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ args.state.player.y = 60 if args.state.player.y > 63~ -- Inside source: true -*** True Line Result - args.state.player.y = 60 if args.state.player.y > 63 -** Processing line: ~ args.state.player.y = 0 if args.state.player.y < -3~ -- Inside source: true -*** True Line Result - args.state.player.y = 0 if args.state.player.y < -3 -** Processing line: ~ args.state.player.x = 60 if args.state.player.x > 63~ +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ - Inside source: true *** True Line Result - args.state.player.x = 60 if args.state.player.x > 63 -** Processing line: ~ args.state.player.x = 0 if args.state.player.x < -3~ + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line +** Processing line: ~ heuristic.frontier = heuristic.frontier.sort_by {| cell | proximity_to_star(cell) }~ - Inside source: true *** True Line Result - args.state.player.x = 0 if args.state.player.x < -3 -** Processing line: ~ end~ + heuristic.frontier = heuristic.frontier.sort_by {| cell | proximity_to_star(cell) } +** Processing line: ~ # Sort the frontier so cells that are close to the target are then prioritized~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Sort the frontier so cells that are close to the target are then prioritized +** Processing line: ~ heuristic.frontier = heuristic.frontier.sort_by {| cell | heuristic_heuristic(cell) }~ - Inside source: true *** True Line Result - end + heuristic.frontier = heuristic.frontier.sort_by {| cell | heuristic_heuristic(cell) } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def null_or_empty? ary~ +** Processing line: ~ # If the search found the target~ - Inside source: true *** True Line Result - def null_or_empty? ary -** Processing line: ~ return true unless ary~ + # If the search found the target +** Processing line: ~ if heuristic.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - return true unless ary -** Processing line: ~ return true if ary.length == 0~ + if heuristic.came_from.has_key?(grid.target) +** Processing line: ~ # Calculate the path between the target and star~ - Inside source: true *** True Line Result - return true if ary.length == 0 -** Processing line: ~ return false~ + # Calculate the path between the target and star +** Processing line: ~ heuristic_calc_path~ - Inside source: true *** True Line Result - return false -** Processing line: ~ end~ + heuristic_calc_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc_storyline_hotspot args~ +** Processing line: ~ # Returns one-dimensional absolute distance between cell and target~ - Inside source: true *** True Line Result - def calc_storyline_hotspot args -** Processing line: ~ hotspots = args.state.storylines.find_all do |hs|~ + # Returns one-dimensional absolute distance between cell and target +** Processing line: ~ # Returns a number to compare distances between cells and the target~ - Inside source: true *** True Line Result - hotspots = args.state.storylines.find_all do |hs| -** Processing line: ~ args.state.player.inside_rect?(hs.shift_rect(-2, 0))~ + # Returns a number to compare distances between cells and the target +** Processing line: ~ def heuristic_heuristic(cell)~ - Inside source: true *** True Line Result - args.state.player.inside_rect?(hs.shift_rect(-2, 0)) + def heuristic_heuristic(cell) +** Processing line: ~ (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs~ +- Inside source: true +*** True Line Result + (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -77219,70 +80952,70 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ if !null_or_empty?(hotspots) && !args.state.inside_storyline_hotspot~ +** Processing line: ~ # Calculates the path between the target and star for the heuristic search~ - Inside source: true *** True Line Result - if !null_or_empty?(hotspots) && !args.state.inside_storyline_hotspot -** Processing line: ~ _, _, _, _, storyline = hotspots.first~ + # Calculates the path between the target and star for the heuristic search +** Processing line: ~ # Only called when the heuristic search finds the target~ - Inside source: true *** True Line Result - _, _, _, _, storyline = hotspots.first -** Processing line: ~ queue_storyline_text(args, storyline)~ + # Only called when the heuristic search finds the target +** Processing line: ~ def heuristic_calc_path~ - Inside source: true *** True Line Result - queue_storyline_text(args, storyline) -** Processing line: ~ args.state.inside_storyline_hotspot = true~ + def heuristic_calc_path +** Processing line: ~ # Start from the target~ - Inside source: true *** True Line Result - args.state.inside_storyline_hotspot = true -** Processing line: ~ elsif null_or_empty?(hotspots)~ + # Start from the target +** Processing line: ~ endpoint = grid.target~ - Inside source: true *** True Line Result - elsif null_or_empty?(hotspots) -** Processing line: ~ args.state.inside_storyline_hotspot = false~ + endpoint = grid.target +** Processing line: ~ # And the cell it came from~ - Inside source: true *** True Line Result - args.state.inside_storyline_hotspot = false -** Processing line: ~~ + # And the cell it came from +** Processing line: ~ next_endpoint = heuristic.came_from[endpoint]~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.storyline_queue_empty_at ||= args.state.tick_count~ + next_endpoint = heuristic.came_from[endpoint] +** Processing line: ~ while endpoint and next_endpoint~ - Inside source: true *** True Line Result - args.state.storyline_queue_empty_at ||= args.state.tick_count -** Processing line: ~ args.state.is_storyline_dialog_active = false~ + while endpoint and next_endpoint +** Processing line: ~ # Draw a path between these two cells and store it~ - Inside source: true *** True Line Result - args.state.is_storyline_dialog_active = false -** Processing line: ~ args.state.scene_storyline_queue.clear~ + # Draw a path between these two cells and store it +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ - Inside source: true *** True Line Result - args.state.scene_storyline_queue.clear -** Processing line: ~ end~ + path = get_path_between(endpoint, next_endpoint) +** Processing line: ~ heuristic.path << path~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + heuristic.path << path +** Processing line: ~ # And get the next pair of cells~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # And get the next pair of cells +** Processing line: ~ endpoint = next_endpoint~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_scenes args~ + endpoint = next_endpoint +** Processing line: ~ next_endpoint = heuristic.came_from[endpoint]~ - Inside source: true *** True Line Result - def calc_scenes args -** Processing line: ~ hotspots = args.state.scenes.find_all do |hs|~ + next_endpoint = heuristic.came_from[endpoint] +** Processing line: ~ # Continue till there are no more cells~ - Inside source: true *** True Line Result - hotspots = args.state.scenes.find_all do |hs| -** Processing line: ~ args.state.player.inside_rect?(hs.shift_rect(-2, 0))~ + # Continue till there are no more cells +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.player.inside_rect?(hs.shift_rect(-2, 0)) + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -77291,314 +81024,278 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ if !null_or_empty?(hotspots) && !args.state.inside_scene_hotspot~ +** Processing line: ~ # Returns a list of adjacent cells~ - Inside source: true *** True Line Result - if !null_or_empty?(hotspots) && !args.state.inside_scene_hotspot -** Processing line: ~ _, _, _, _, scene_method_or_hash = hotspots.first~ + # Returns a list of adjacent cells +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ - Inside source: true *** True Line Result - _, _, _, _, scene_method_or_hash = hotspots.first -** Processing line: ~ if scene_method_or_hash.is_a? Symbol~ + # Used to determine what the next cells to be added to the frontier are +** Processing line: ~ def adjacent_neighbors(cell)~ - Inside source: true *** True Line Result - if scene_method_or_hash.is_a? Symbol -** Processing line: ~ set_scene(args, send(scene_method_or_hash, args))~ + def adjacent_neighbors(cell) +** Processing line: ~ neighbors = []~ - Inside source: true *** True Line Result - set_scene(args, send(scene_method_or_hash, args)) -** Processing line: ~ args.state.last_hotspot_scene = scene_method_or_hash~ + neighbors = [] +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.last_hotspot_scene = scene_method_or_hash -** Processing line: ~ args.state.scene_history << scene_method_or_hash~ + +** Processing line: ~ # Gets all the valid neighbors into the array~ - Inside source: true *** True Line Result - args.state.scene_history << scene_method_or_hash -** Processing line: ~ else~ + # Gets all the valid neighbors into the array +** Processing line: ~ # From southern neighbor, clockwise~ - Inside source: true *** True Line Result - else -** Processing line: ~ set_scene(args, scene_method_or_hash)~ + # From southern neighbor, clockwise +** Processing line: ~ neighbors << [cell.x , cell.y - 1] unless cell.y == 0~ - Inside source: true *** True Line Result - set_scene(args, scene_method_or_hash) -** Processing line: ~ end~ + neighbors << [cell.x , cell.y - 1] unless cell.y == 0 +** Processing line: ~ neighbors << [cell.x - 1, cell.y ] unless cell.x == 0~ - Inside source: true *** True Line Result - end -** Processing line: ~ args.state.inside_scene_hotspot = true~ + neighbors << [cell.x - 1, cell.y ] unless cell.x == 0 +** Processing line: ~ neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1~ - Inside source: true *** True Line Result - args.state.inside_scene_hotspot = true -** Processing line: ~ elsif null_or_empty?(hotspots)~ + neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1 +** Processing line: ~ neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1~ - Inside source: true *** True Line Result - elsif null_or_empty?(hotspots) -** Processing line: ~ args.state.inside_scene_hotspot = false~ + neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1 +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.inside_scene_hotspot = false -** Processing line: ~ end~ + +** Processing line: ~ neighbors~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + neighbors +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def null_or_whitespace? word~ +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ - Inside source: true *** True Line Result - def null_or_whitespace? word -** Processing line: ~ return true if !word~ + # Finds the vertical and horizontal distance of a cell from the star +** Processing line: ~ # and returns the larger value~ - Inside source: true *** True Line Result - return true if !word -** Processing line: ~ return true if word.strip.length == 0~ + # and returns the larger value +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ - Inside source: true *** True Line Result - return true if word.strip.length == 0 -** Processing line: ~ return false~ + # This method is used to have a zigzag pattern in the rendered path +** Processing line: ~ # A cell that is [5, 5] from the star,~ - Inside source: true *** True Line Result - return false -** Processing line: ~ end~ + # A cell that is [5, 5] from the star, +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # is explored before over a cell that is [0, 7] away. +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_storyline_presentation args~ + # So, if possible, the search tries to go diagonal (zigzag) first +** Processing line: ~ def proximity_to_star(cell)~ - Inside source: true *** True Line Result - def calc_storyline_presentation args -** Processing line: ~ return unless args.state.tick_count > args.state.next_storyline~ + def proximity_to_star(cell) +** Processing line: ~ distance_x = (grid.star.x - cell.x).abs~ - Inside source: true *** True Line Result - return unless args.state.tick_count > args.state.next_storyline -** Processing line: ~ return unless args.state.scene_storyline_queue~ + distance_x = (grid.star.x - cell.x).abs +** Processing line: ~ distance_y = (grid.star.y - cell.y).abs~ - Inside source: true *** True Line Result - return unless args.state.scene_storyline_queue -** Processing line: ~ next_storyline = args.state.scene_storyline_queue.shift~ + distance_y = (grid.star.y - cell.y).abs +** Processing line: ~~ - Inside source: true *** True Line Result - next_storyline = args.state.scene_storyline_queue.shift -** Processing line: ~ if null_or_whitespace? next_storyline~ + +** Processing line: ~ if distance_x > distance_y~ - Inside source: true *** True Line Result - if null_or_whitespace? next_storyline -** Processing line: ~ args.state.storyline_queue_empty_at ||= args.state.tick_count~ + if distance_x > distance_y +** Processing line: ~ return distance_x~ - Inside source: true *** True Line Result - args.state.storyline_queue_empty_at ||= args.state.tick_count -** Processing line: ~ args.state.is_storyline_dialog_active = false~ + return distance_x +** Processing line: ~ else~ - Inside source: true *** True Line Result - args.state.is_storyline_dialog_active = false -** Processing line: ~ return~ + else +** Processing line: ~ return distance_y~ - Inside source: true *** True Line Result - return + return distance_y +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ args.state.storyline_to_show = next_storyline~ +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.storyline_to_show = next_storyline -** Processing line: ~ args.state.is_storyline_dialog_active = true~ + +** Processing line: ~ # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored.~ - Inside source: true *** True Line Result - args.state.is_storyline_dialog_active = true -** Processing line: ~ args.state.storyline_queue_empty_at = nil~ + # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored. +** Processing line: ~ def grid~ - Inside source: true *** True Line Result - args.state.storyline_queue_empty_at = nil -** Processing line: ~ if next_storyline.end_with?(".") || next_storyline.end_with?("!") || next_storyline.end_with?("?") || next_storyline.end_with?("\"")~ + def grid +** Processing line: ~ state.grid~ - Inside source: true *** True Line Result - if next_storyline.end_with?(".") || next_storyline.end_with?("!") || next_storyline.end_with?("?") || next_storyline.end_with?("\"") -** Processing line: ~ args.state.next_storyline += 60~ + state.grid +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.next_storyline += 60 -** Processing line: ~ elsif next_storyline.end_with?(",")~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif next_storyline.end_with?(",") -** Processing line: ~ args.state.next_storyline += 50~ + +** Processing line: ~ def buttons~ - Inside source: true *** True Line Result - args.state.next_storyline += 50 -** Processing line: ~ elsif next_storyline.end_with?(":")~ + def buttons +** Processing line: ~ state.buttons~ - Inside source: true *** True Line Result - elsif next_storyline.end_with?(":") -** Processing line: ~ args.state.next_storyline += 60~ + state.buttons +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.next_storyline += 60 -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ default_word_delay = 13 + args.state.word_delay - 8~ + +** Processing line: ~ def slider~ - Inside source: true *** True Line Result - default_word_delay = 13 + args.state.word_delay - 8 -** Processing line: ~ if next_storyline.gsub("-", "").gsub("~", "").length <= 4~ + def slider +** Processing line: ~ state.slider~ - Inside source: true *** True Line Result - if next_storyline.gsub("-", "").gsub("~", "").length <= 4 -** Processing line: ~ default_word_delay = 11 + args.state.word_delay - 8~ + state.slider +** Processing line: ~ end~ - Inside source: true *** True Line Result - default_word_delay = 11 + args.state.word_delay - 8 -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ number_of_syllabals = next_storyline.length - next_storyline.gsub("-", "").length~ + +** Processing line: ~ def bfs~ - Inside source: true *** True Line Result - number_of_syllabals = next_storyline.length - next_storyline.gsub("-", "").length -** Processing line: ~ args.state.next_storyline += default_word_delay + number_of_syllabals * (args.state.word_delay + 1)~ + def bfs +** Processing line: ~ state.bfs~ - Inside source: true *** True Line Result - args.state.next_storyline += default_word_delay + number_of_syllabals * (args.state.word_delay + 1) + state.bfs ** 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 inputs_reload_current_scene args~ -- Inside source: true -*** True Line Result - def inputs_reload_current_scene args -** Processing line: ~ return~ -- Inside source: true -*** True Line Result - return -** Processing line: ~ if args.inputs.keyboard.key_down.r!~ +** Processing line: ~ def heuristic~ - Inside source: true *** True Line Result - if args.inputs.keyboard.key_down.r! -** Processing line: ~ reload_current_scene~ + def heuristic +** Processing line: ~ state.heuristic~ - Inside source: true *** True Line Result - reload_current_scene + state.heuristic ** 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 inputs_dismiss_current_storyline args~ +** Processing line: ~ # Descriptive aliases for colors~ - Inside source: true *** True Line Result - def inputs_dismiss_current_storyline args -** Processing line: ~ if args.inputs.keyboard.key_down.x!~ + # Descriptive aliases for colors +** Processing line: ~ def default_color~ - Inside source: true *** True Line Result - if args.inputs.keyboard.key_down.x! -** Processing line: ~ args.state.scene_storyline_queue.clear~ + def default_color +** Processing line: ~ [221, 212, 213] # Light Brown~ - Inside source: true *** True Line Result - args.state.scene_storyline_queue.clear + [221, 212, 213] # Light Brown ** 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 inputs_restart_game args~ -- Inside source: true -*** True Line Result - def inputs_restart_game args -** Processing line: ~ if args.inputs.keyboard.exclamation_point~ +** Processing line: ~ def wall_color~ - Inside source: true *** True Line Result - if args.inputs.keyboard.exclamation_point -** Processing line: ~ args.gtk.reset_state~ + def wall_color +** Processing line: ~ [134, 134, 120] # Camo Green~ - Inside source: true *** True Line Result - args.gtk.reset_state + [134, 134, 120] # Camo Green ** 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 inputs_change_word_delay args~ -- Inside source: true -*** True Line Result - def inputs_change_word_delay args -** Processing line: ~ if args.inputs.keyboard.key_down.plus || args.inputs.keyboard.key_down.equal_sign~ -- Inside source: true -*** True Line Result - if args.inputs.keyboard.key_down.plus || args.inputs.keyboard.key_down.equal_sign -** Processing line: ~ args.state.word_delay -= 2~ -- Inside source: true -*** True Line Result - args.state.word_delay -= 2 -** Processing line: ~ if args.state.word_delay < 0~ +** Processing line: ~ def visited_color~ - Inside source: true *** True Line Result - if args.state.word_delay < 0 -** Processing line: ~ args.state.word_delay = 0~ + def visited_color +** Processing line: ~ [204, 191, 179] # Dark Brown~ - Inside source: true *** True Line Result - args.state.word_delay = 0 -** Processing line: ~ # queue_storyline_text args, "Text speed at MAXIMUM. Geez, how fast do you read?"~ + [204, 191, 179] # Dark Brown +** Processing line: ~ end~ - Inside source: true *** True Line Result - # queue_storyline_text args, "Text speed at MAXIMUM. Geez, how fast do you read?" -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ # queue_storyline_text args, "Text speed INCREASED."~ + +** Processing line: ~ def frontier_color~ - Inside source: true *** True Line Result - # queue_storyline_text args, "Text speed INCREASED." -** Processing line: ~ end~ + def frontier_color +** Processing line: ~ [103, 136, 204] # Blue~ - Inside source: true *** True Line Result - end + [103, 136, 204] # Blue ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -77607,42 +81304,30 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ if args.inputs.keyboard.key_down.hyphen || args.inputs.keyboard.key_down.underscore~ -- Inside source: true -*** True Line Result - if args.inputs.keyboard.key_down.hyphen || args.inputs.keyboard.key_down.underscore -** Processing line: ~ args.state.word_delay += 2~ +** Processing line: ~ def path_color~ - Inside source: true *** True Line Result - args.state.word_delay += 2 -** Processing line: ~ # queue_storyline_text args, "Text speed DECREASED."~ + def path_color +** Processing line: ~ [231, 230, 228] # Pastel White~ - Inside source: true *** True Line Result - # queue_storyline_text args, "Text speed DECREASED." + [231, 230, 228] # Pastel White ** 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 multiple_lines args, x, y, texts, size = 0, minimum_alpha = nil~ -- Inside source: true -*** True Line Result - def multiple_lines args, x, y, texts, size = 0, minimum_alpha = nil -** Processing line: ~ texts.each_with_index.map do |t, i|~ +** Processing line: ~ def button_color~ - Inside source: true *** True Line Result - texts.each_with_index.map do |t, i| -** Processing line: ~ [x, y - i * (25 + size * 2), t, size, 0, 255, 255, 255, adornments_alpha(args, 255, minimum_alpha)]~ + def button_color +** Processing line: ~ [190, 190, 190] # Gray~ - Inside source: true *** True Line Result - [x, y - i * (25 + size * 2), t, size, 0, 255, 255, 255, adornments_alpha(args, 255, minimum_alpha)] + [190, 190, 190] # Gray ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -77651,70 +81336,66 @@ 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 lowrez_tick args, lowrez_sprites, lowrez_labels, lowrez_borders, lowrez_solids, lowrez_mouse~ +** Processing line: ~ # Method that is called by DragonRuby periodically~ - Inside source: true *** True Line Result - def lowrez_tick args, lowrez_sprites, lowrez_labels, lowrez_borders, lowrez_solids, lowrez_mouse -** Processing line: ~ # args.state.show_gridlines = true~ + # Method that is called by DragonRuby periodically +** Processing line: ~ # Used for updating animations and calculations~ - Inside source: true *** True Line Result - # args.state.show_gridlines = true -** Processing line: ~ defaults args~ + # Used for updating animations and calculations +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - defaults args -** Processing line: ~ render_current_scene args, lowrez_sprites, lowrez_labels, lowrez_solids~ + def tick args +** Processing line: ~~ - Inside source: true *** True Line Result - render_current_scene args, lowrez_sprites, lowrez_labels, lowrez_solids -** Processing line: ~ render_controller args, lowrez_borders~ + +** Processing line: ~ # Pressing r will reset the application~ - Inside source: true *** True Line Result - render_controller args, lowrez_borders -** Processing line: ~ lowrez_solids << [0, 0, 64, 64, 0, 0, 0]~ + # Pressing r will reset the application +** Processing line: ~ if args.inputs.keyboard.key_down.r~ - Inside source: true *** True Line Result - lowrez_solids << [0, 0, 64, 64, 0, 0, 0] -** Processing line: ~ calc_storyline_presentation args~ + if args.inputs.keyboard.key_down.r +** Processing line: ~ args.gtk.reset~ - Inside source: true *** True Line Result - calc_storyline_presentation args -** Processing line: ~ calc_scenes args~ + args.gtk.reset +** Processing line: ~ reset~ - Inside source: true *** True Line Result - calc_scenes args -** Processing line: ~ calc_storyline_hotspot args~ + reset +** Processing line: ~ return~ - Inside source: true *** True Line Result - calc_storyline_hotspot args -** Processing line: ~ inputs_move_player args~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - inputs_move_player args -** Processing line: ~ inputs_print_mouse_rect args, lowrez_mouse~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - inputs_print_mouse_rect args, lowrez_mouse -** Processing line: ~ inputs_reload_current_scene args~ + +** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ - Inside source: true *** True Line Result - inputs_reload_current_scene args -** Processing line: ~ inputs_dismiss_current_storyline args~ + # Every tick, new args are passed, and the Breadth First Search tick is called +** Processing line: ~ $heuristic ||= Heuristic.new(args)~ - Inside source: true *** True Line Result - inputs_dismiss_current_storyline args -** Processing line: ~ inputs_change_word_delay args~ + $heuristic ||= Heuristic.new(args) +** Processing line: ~ $heuristic.args = args~ - Inside source: true *** True Line Result - inputs_change_word_delay args -** Processing line: ~ inputs_restart_game args~ + $heuristic.args = args +** Processing line: ~ $heuristic.tick~ - Inside source: true *** True Line Result - inputs_restart_game args + $heuristic.tick ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -77723,578 +81404,578 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def render_controller args, lowrez_borders~ +** Processing line: ~~ - Inside source: true *** True Line Result - def render_controller args, lowrez_borders -** Processing line: ~ args.state.up_button = [85, 40, 15, 15, 255, 255, 255]~ + +** Processing line: ~ def reset~ - Inside source: true *** True Line Result - args.state.up_button = [85, 40, 15, 15, 255, 255, 255] -** Processing line: ~ args.state.down_button = [85, 20, 15, 15, 255, 255, 255]~ + def reset +** Processing line: ~ $heuristic = nil~ - Inside source: true *** True Line Result - args.state.down_button = [85, 20, 15, 15, 255, 255, 255] -** Processing line: ~ args.state.left_button = [65, 20, 15, 15, 255, 255, 255]~ + $heuristic = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.left_button = [65, 20, 15, 15, 255, 255, 255] -** Processing line: ~ args.state.right_button = [105, 20, 15, 15, 255, 255, 255]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.right_button = [105, 20, 15, 15, 255, 255, 255] -** Processing line: ~ lowrez_borders << args.state.up_button~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - lowrez_borders << args.state.up_button -** Processing line: ~ lowrez_borders << args.state.down_button~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - lowrez_borders << args.state.down_button -** Processing line: ~ lowrez_borders << args.state.left_button~ -- Inside source: true + +** Processing line: ~*** Path Finding Algorithms - A Star - main.rb~ +- Header detected. *** True Line Result - lowrez_borders << args.state.left_button -** Processing line: ~ lowrez_borders << args.state.right_button~ + +*** True Line Result +*** Path Finding Algorithms - A Star - 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/13_path_finding_algorithms/08_a_star/app/main.rb~ - Inside source: true *** True Line Result - lowrez_borders << args.state.right_button -** Processing line: ~ end~ + # ./samples/13_path_finding_algorithms/08_a_star/app/main.rb +** Processing line: ~ # This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ - Inside source: true *** True Line Result - end + # This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def inputs_print_mouse_rect args, lowrez_mouse~ +** Processing line: ~ # The A* Search works by incorporating both the distance from the starting point~ - Inside source: true *** True Line Result - def inputs_print_mouse_rect args, lowrez_mouse -** Processing line: ~ if lowrez_mouse.up~ + # The A* Search works by incorporating both the distance from the starting point +** Processing line: ~ # and the distance from the target in its heurisitic.~ - Inside source: true *** True Line Result - if lowrez_mouse.up -** Processing line: ~ args.state.mouse_held = false~ + # and the distance from the target in its heurisitic. +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.mouse_held = false -** Processing line: ~ elsif lowrez_mouse.click~ + +** Processing line: ~ # It tends to find the correct (shortest) path even when the Greedy Best-First Search does not,~ - Inside source: true *** True Line Result - elsif lowrez_mouse.click -** Processing line: ~ mouse_rect = [lowrez_mouse.x, lowrez_mouse.y, 1, 1]~ + # It tends to find the correct (shortest) path even when the Greedy Best-First Search does not, +** Processing line: ~ # and it explores less of the grid, and is therefore faster, than Dijkstra's Search.~ - Inside source: true *** True Line Result - mouse_rect = [lowrez_mouse.x, lowrez_mouse.y, 1, 1] -** Processing line: ~ if args.state.up_button.intersect_rect? mouse_rect~ + # and it explores less of the grid, and is therefore faster, than Dijkstra's Search. +** Processing line: ~~ - Inside source: true *** True Line Result - if args.state.up_button.intersect_rect? mouse_rect -** Processing line: ~ args.state.player.y += 1~ + +** Processing line: ~ class A_Star_Algorithm~ - Inside source: true *** True Line Result - args.state.player.y += 1 -** Processing line: ~ end~ + class A_Star_Algorithm +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - end + attr_gtk ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if args.state.down_button.intersect_rect? mouse_rect~ +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - if args.state.down_button.intersect_rect? mouse_rect -** Processing line: ~ args.state.player.y -= 1~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - args.state.player.y -= 1 -** Processing line: ~ end~ + defaults +** Processing line: ~ render~ - Inside source: true *** True Line Result - end + render +** Processing line: ~ input~ +- Inside source: true +*** True Line Result + input ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if args.state.left_button.intersect_rect? mouse_rect~ +** Processing line: ~ if dijkstra.came_from.empty?~ - Inside source: true *** True Line Result - if args.state.left_button.intersect_rect? mouse_rect -** Processing line: ~ args.state.player.x -= 1~ + if dijkstra.came_from.empty? +** Processing line: ~ calc_searches~ - Inside source: true *** True Line Result - args.state.player.x -= 1 + calc_searches ** 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.right_button.intersect_rect? mouse_rect~ +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - if args.state.right_button.intersect_rect? mouse_rect -** Processing line: ~ args.state.player.x += 1~ + def defaults +** Processing line: ~ # Variables to edit the size and appearance of the grid~ - Inside source: true *** True Line Result - args.state.player.x += 1 -** Processing line: ~ end~ + # Variables to edit the size and appearance of the grid +** Processing line: ~ # Freely customizable to user's liking~ - Inside source: true *** True Line Result - end -** Processing line: ~ args.state.mouse_held = true~ + # Freely customizable to user's liking +** Processing line: ~ grid.width ||= 15~ - Inside source: true *** True Line Result - args.state.mouse_held = true -** Processing line: ~ elsif args.state.mouse_held~ + grid.width ||= 15 +** Processing line: ~ grid.height ||= 15~ - Inside source: true *** True Line Result - elsif args.state.mouse_held -** Processing line: ~ mouse_rect = [lowrez_mouse.x, lowrez_mouse.y, 1, 1]~ + grid.height ||= 15 +** Processing line: ~ grid.cell_size ||= 27~ - Inside source: true *** True Line Result - mouse_rect = [lowrez_mouse.x, lowrez_mouse.y, 1, 1] -** Processing line: ~ if args.state.up_button.intersect_rect? mouse_rect~ + grid.cell_size ||= 27 +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ - Inside source: true *** True Line Result - if args.state.up_button.intersect_rect? mouse_rect -** Processing line: ~ args.state.player.y += 0.25~ + grid.rect ||= [0, 0, grid.width, grid.height] +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.player.y += 0.25 -** Processing line: ~ end~ + +** Processing line: ~ grid.star ||= [0, 2]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + grid.star ||= [0, 2] +** Processing line: ~ grid.target ||= [11, 13]~ - Inside source: true *** True Line Result - -** Processing line: ~ if args.state.down_button.intersect_rect? mouse_rect~ + grid.target ||= [11, 13] +** Processing line: ~ grid.walls ||= {~ - Inside source: true *** True Line Result - if args.state.down_button.intersect_rect? mouse_rect -** Processing line: ~ args.state.player.y -= 0.25~ + grid.walls ||= { +** Processing line: ~ [2, 2] => true,~ - Inside source: true *** True Line Result - args.state.player.y -= 0.25 -** Processing line: ~ end~ + [2, 2] => true, +** Processing line: ~ [3, 2] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3, 2] => true, +** Processing line: ~ [4, 2] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ if args.state.left_button.intersect_rect? mouse_rect~ + [4, 2] => true, +** Processing line: ~ [5, 2] => true,~ - Inside source: true *** True Line Result - if args.state.left_button.intersect_rect? mouse_rect -** Processing line: ~ args.state.player.x -= 0.25~ + [5, 2] => true, +** Processing line: ~ [6, 2] => true,~ - Inside source: true *** True Line Result - args.state.player.x -= 0.25 -** Processing line: ~ end~ + [6, 2] => true, +** Processing line: ~ [7, 2] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7, 2] => true, +** Processing line: ~ [8, 2] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ if args.state.right_button.intersect_rect? mouse_rect~ + [8, 2] => true, +** Processing line: ~ [9, 2] => true,~ - Inside source: true *** True Line Result - if args.state.right_button.intersect_rect? mouse_rect -** Processing line: ~ args.state.player.x += 0.25~ + [9, 2] => true, +** Processing line: ~ [10, 2] => true,~ - Inside source: true *** True Line Result - args.state.player.x += 0.25 -** Processing line: ~ end~ + [10, 2] => true, +** Processing line: ~ [11, 2] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [11, 2] => true, +** Processing line: ~ [12, 2] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [12, 2] => true, +** Processing line: ~ [12, 3] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ if lowrez_mouse.click~ + [12, 3] => true, +** Processing line: ~ [12, 4] => true,~ - Inside source: true *** True Line Result - if lowrez_mouse.click -** Processing line: ~ dx = lowrez_mouse.click.x - args.state.previous_mouse_click.x~ + [12, 4] => true, +** Processing line: ~ [12, 5] => true,~ - Inside source: true *** True Line Result - dx = lowrez_mouse.click.x - args.state.previous_mouse_click.x -** Processing line: ~ dy = lowrez_mouse.click.y - args.state.previous_mouse_click.y~ + [12, 5] => true, +** Processing line: ~ [12, 6] => true,~ - Inside source: true *** True Line Result - dy = lowrez_mouse.click.y - args.state.previous_mouse_click.y -** Processing line: ~ x, y, w, h = args.state.previous_mouse_click.x, args.state.previous_mouse_click.y, dx, dy~ + [12, 6] => true, +** Processing line: ~ [12, 7] => true,~ - Inside source: true *** True Line Result - x, y, w, h = args.state.previous_mouse_click.x, args.state.previous_mouse_click.y, dx, dy -** Processing line: ~ puts "x #{lowrez_mouse.click.x}, y: #{lowrez_mouse.click.y}"~ + [12, 7] => true, +** Processing line: ~ [12, 8] => true,~ - Inside source: true *** True Line Result - puts "x #{lowrez_mouse.click.x}, y: #{lowrez_mouse.click.y}" -** Processing line: ~ if args.state.previous_mouse_click~ + [12, 8] => true, +** Processing line: ~ [12, 9] => true,~ - Inside source: true *** True Line Result - if args.state.previous_mouse_click -** Processing line: ~~ + [12, 9] => true, +** Processing line: ~ [12, 10] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ if dx < 0 && dx < 0~ + [12, 10] => true, +** Processing line: ~ [12, 11] => true,~ - Inside source: true *** True Line Result - if dx < 0 && dx < 0 -** Processing line: ~ x = x + w~ + [12, 11] => true, +** Processing line: ~ [12, 12] => true,~ - Inside source: true *** True Line Result - x = x + w -** Processing line: ~ w = w.abs~ + [12, 12] => true, +** Processing line: ~ [5, 12] => true,~ - Inside source: true *** True Line Result - w = w.abs -** Processing line: ~ y = y + h~ + [5, 12] => true, +** Processing line: ~ [6, 12] => true,~ - Inside source: true *** True Line Result - y = y + h -** Processing line: ~ h = h.abs~ + [6, 12] => true, +** Processing line: ~ [7, 12] => true,~ - Inside source: true *** True Line Result - h = h.abs -** Processing line: ~ end~ + [7, 12] => true, +** Processing line: ~ [8, 12] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8, 12] => true, +** Processing line: ~ [9, 12] => true,~ - Inside source: true *** True Line Result - -** Processing line: ~ w += 1~ + [9, 12] => true, +** Processing line: ~ [10, 12] => true,~ - Inside source: true *** True Line Result - w += 1 -** Processing line: ~ h += 1~ + [10, 12] => true, +** Processing line: ~ [11, 12] => true,~ - Inside source: true *** True Line Result - h += 1 -** Processing line: ~~ + [11, 12] => true, +** Processing line: ~ [12, 12] => true~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.previous_mouse_click = nil~ + [12, 12] => true +** Processing line: ~ }~ - Inside source: true *** True Line Result - args.state.previous_mouse_click = nil -** Processing line: ~ else~ + } +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ args.state.previous_mouse_click = lowrez_mouse.click~ + +** Processing line: ~ # What the user is currently editing on the grid~ - Inside source: true *** True Line Result - args.state.previous_mouse_click = lowrez_mouse.click -** Processing line: ~ square_x, square_y = lowrez_mouse.click~ + # What the user is currently editing on the grid +** Processing line: ~ # We store this value, because we want to remember the value even when~ - Inside source: true *** True Line Result - square_x, square_y = lowrez_mouse.click -** Processing line: ~ end~ + # We store this value, because we want to remember the value even when +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # the user's cursor is no longer over what they're interacting with, but +** Processing line: ~ # they are still clicking down on the mouse.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # they are still clicking down on the mouse. +** Processing line: ~ state.user_input ||= :none~ - Inside source: true *** True Line Result - end + state.user_input ||= :none ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def try_centering! word~ -- Inside source: true -*** True Line Result - def try_centering! word -** Processing line: ~ word ||= ""~ +** Processing line: ~ # These variables allow the breadth first search to take place~ - Inside source: true *** True Line Result - word ||= "" -** Processing line: ~ just_word = word.gsub("-", "").gsub(",", "").gsub(".", "").gsub("'", "").gsub('""', "\"-\"")~ + # These variables allow the breadth first search to take place +** Processing line: ~ # 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.~ - Inside source: true *** True Line Result - just_word = word.gsub("-", "").gsub(",", "").gsub(".", "").gsub("'", "").gsub('""', "\"-\"") -** Processing line: ~ return word if just_word.strip.length == 0~ + # 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. +** Processing line: ~ # Used to prevent searching cells that have already been found~ - Inside source: true *** True Line Result - return word if just_word.strip.length == 0 -** Processing line: ~ return word if just_word.include? "~"~ + # Used to prevent searching cells that have already been found +** Processing line: ~ # and to trace a path from the target back to the starting point.~ - Inside source: true *** True Line Result - return word if just_word.include? "~" -** Processing line: ~ return "~#{word}" if just_word.length <= 2~ + # and to trace a path from the target back to the starting point. +** Processing line: ~ # Frontier is an array of cells to expand the search from.~ - Inside source: true *** True Line Result - return "~#{word}" if just_word.length <= 2 -** Processing line: ~ if just_word.length.mod_zero? 2~ + # Frontier is an array of cells to expand the search from. +** Processing line: ~ # The search is over when there are no more cells to search from.~ - Inside source: true *** True Line Result - if just_word.length.mod_zero? 2 -** Processing line: ~ center_index = just_word.length.idiv(2) - 1~ + # The search is over when there are no more cells to search from. +** Processing line: ~ # Path stores the path from the target to the star, once the target has been found~ - Inside source: true *** True Line Result - center_index = just_word.length.idiv(2) - 1 -** Processing line: ~ else~ + # Path stores the path from the target to the star, once the target has been found +** Processing line: ~ # It prevents calculating the path every tick.~ - Inside source: true *** True Line Result - else -** Processing line: ~ center_index = (just_word.length - 1).idiv(2)~ + # It prevents calculating the path every tick. +** Processing line: ~ dijkstra.came_from ||= {}~ - Inside source: true *** True Line Result - center_index = (just_word.length - 1).idiv(2) -** Processing line: ~ end~ + dijkstra.came_from ||= {} +** Processing line: ~ dijkstra.cost_so_far ||= {}~ - Inside source: true *** True Line Result - end -** Processing line: ~ return "#{word[0..center_index - 1]}~#{word[center_index]}#{word[center_index + 1..-1]}"~ + dijkstra.cost_so_far ||= {} +** Processing line: ~ dijkstra.frontier ||= []~ - Inside source: true *** True Line Result - return "#{word[0..center_index - 1]}~#{word[center_index]}#{word[center_index + 1..-1]}" -** Processing line: ~ end~ + dijkstra.frontier ||= [] +** Processing line: ~ dijkstra.path ||= []~ - Inside source: true *** True Line Result - end + dijkstra.path ||= [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def queue_storyline args, scene~ +** Processing line: ~ greedy.came_from ||= {}~ - Inside source: true *** True Line Result - def queue_storyline args, scene -** Processing line: ~ queue_storyline_text args, scene[:storyline]~ + greedy.came_from ||= {} +** Processing line: ~ greedy.frontier ||= []~ - Inside source: true *** True Line Result - queue_storyline_text args, scene[:storyline] -** Processing line: ~ end~ + greedy.frontier ||= [] +** Processing line: ~ greedy.path ||= []~ - Inside source: true *** True Line Result - end + greedy.path ||= [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def queue_storyline_text args, text~ -- Inside source: true -*** True Line Result - def queue_storyline_text args, text -** Processing line: ~ args.state.last_story_line_text = text~ +** Processing line: ~ a_star.frontier ||= []~ - Inside source: true *** True Line Result - args.state.last_story_line_text = text -** Processing line: ~ args.state.storyline_history << text if text~ + a_star.frontier ||= [] +** Processing line: ~ a_star.came_from ||= {}~ - Inside source: true *** True Line Result - args.state.storyline_history << text if text -** Processing line: ~ words = (text || "").split(" ")~ + a_star.came_from ||= {} +** Processing line: ~ a_star.path ||= []~ - Inside source: true *** True Line Result - words = (text || "").split(" ") -** Processing line: ~ words = words.map { |w| try_centering! w }~ + a_star.path ||= [] +** Processing line: ~ end~ - Inside source: true *** True Line Result - words = words.map { |w| try_centering! w } -** Processing line: ~ args.state.scene_storyline_queue = words~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.scene_storyline_queue = words -** Processing line: ~ if args.state.scene_storyline_queue.length != 0~ + +** Processing line: ~ # All methods with render draw stuff on the screen~ - Inside source: true *** True Line Result - if args.state.scene_storyline_queue.length != 0 -** Processing line: ~ args.state.scene_storyline_queue.unshift "~$--"~ + # All methods with render draw stuff on the screen +** Processing line: ~ # UI has buttons, the slider, and labels~ - Inside source: true *** True Line Result - args.state.scene_storyline_queue.unshift "~$--" -** Processing line: ~ args.state.storyline_to_show = "~."~ + # UI has buttons, the slider, and labels +** Processing line: ~ # The search specific rendering occurs in the respective methods~ - Inside source: true *** True Line Result - args.state.storyline_to_show = "~." -** Processing line: ~ else~ + # The search specific rendering occurs in the respective methods +** Processing line: ~ def render~ - Inside source: true *** True Line Result - else -** Processing line: ~ args.state.storyline_to_show = ""~ + def render +** Processing line: ~ render_labels~ - Inside source: true *** True Line Result - args.state.storyline_to_show = "" -** Processing line: ~ end~ + render_labels +** Processing line: ~ render_dijkstra~ - Inside source: true *** True Line Result - end -** Processing line: ~ args.state.scene_storyline_queue << ""~ + render_dijkstra +** Processing line: ~ render_greedy~ - Inside source: true *** True Line Result - args.state.scene_storyline_queue << "" -** Processing line: ~ args.state.next_storyline = args.state.tick_count~ + render_greedy +** Processing line: ~ render_a_star~ - Inside source: true *** True Line Result - args.state.next_storyline = args.state.tick_count -** Processing line: ~ end~ + render_a_star +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def set_scene args, scene~ -- Inside source: true -*** True Line Result - def set_scene args, scene -** Processing line: ~ args.state.current_scene = scene~ +** Processing line: ~ def render_labels~ - Inside source: true *** True Line Result - args.state.current_scene = scene -** Processing line: ~ args.state.background = scene[:background] || 'sprites/todo.png'~ + def render_labels +** Processing line: ~ outputs.labels << [150, 450, "Dijkstra's"]~ - Inside source: true *** True Line Result - args.state.background = scene[:background] || 'sprites/todo.png' -** Processing line: ~ args.state.scene_fade = scene[:fade] || 0~ + outputs.labels << [150, 450, "Dijkstra's"] +** Processing line: ~ outputs.labels << [550, 450, "Greedy Best-First"]~ - Inside source: true *** True Line Result - args.state.scene_fade = scene[:fade] || 0 -** Processing line: ~ args.state.scenes = (scene[:scenes] || []).reject { |s| !s }~ + outputs.labels << [550, 450, "Greedy Best-First"] +** Processing line: ~ outputs.labels << [1025, 450, "A* Search"]~ - Inside source: true *** True Line Result - args.state.scenes = (scene[:scenes] || []).reject { |s| !s } -** Processing line: ~ args.state.scene_render_override = scene[:render_override]~ + outputs.labels << [1025, 450, "A* Search"] +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.scene_render_override = scene[:render_override] -** Processing line: ~ args.state.storylines = (scene[:storylines] || []).reject { |s| !s }~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.storylines = (scene[:storylines] || []).reject { |s| !s } -** Processing line: ~ args.state.scene_changed_at = args.state.tick_count~ + +** Processing line: ~ def render_dijkstra~ - Inside source: true *** True Line Result - args.state.scene_changed_at = args.state.tick_count -** Processing line: ~ if scene[:player]~ + def render_dijkstra +** Processing line: ~ render_dijkstra_grid~ - Inside source: true *** True Line Result - if scene[:player] -** Processing line: ~ args.state.player = scene[:player]~ + render_dijkstra_grid +** Processing line: ~ render_dijkstra_star~ - Inside source: true *** True Line Result - args.state.player = scene[:player] -** Processing line: ~ end~ + render_dijkstra_star +** Processing line: ~ render_dijkstra_target~ - Inside source: true *** True Line Result - end -** Processing line: ~ args.state.inside_scene_hotspot = false~ + render_dijkstra_target +** Processing line: ~ render_dijkstra_visited~ - Inside source: true *** True Line Result - args.state.inside_scene_hotspot = false -** Processing line: ~ args.state.inside_storyline_hotspot = false~ + render_dijkstra_visited +** Processing line: ~ render_dijkstra_walls~ - Inside source: true *** True Line Result - args.state.inside_storyline_hotspot = false -** Processing line: ~ queue_storyline args, scene~ + render_dijkstra_walls +** Processing line: ~ render_dijkstra_path~ - Inside source: true *** True Line Result - queue_storyline args, scene -** Processing line: ~ end~ + render_dijkstra_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def replay_storyline_rect~ +** Processing line: ~ def render_greedy~ - Inside source: true *** True Line Result - def replay_storyline_rect -** Processing line: ~ [26, -1, 7, 4]~ + def render_greedy +** Processing line: ~ render_greedy_grid~ - Inside source: true *** True Line Result - [26, -1, 7, 4] -** Processing line: ~ end~ + render_greedy_grid +** Processing line: ~ render_greedy_star~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + render_greedy_star +** Processing line: ~ render_greedy_target~ - Inside source: true *** True Line Result - -** Processing line: ~ def labels_for_word word~ + render_greedy_target +** Processing line: ~ render_greedy_visited~ - Inside source: true *** True Line Result - def labels_for_word word -** Processing line: ~ left_side_of_word = ""~ + render_greedy_visited +** Processing line: ~ render_greedy_walls~ - Inside source: true *** True Line Result - left_side_of_word = "" -** Processing line: ~ center_letter = ""~ + render_greedy_walls +** Processing line: ~ render_greedy_path~ - Inside source: true *** True Line Result - center_letter = "" -** Processing line: ~ right_side_of_word = ""~ + render_greedy_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - right_side_of_word = "" + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if word[0] == "~"~ -- Inside source: true -*** True Line Result - if word[0] == "~" -** Processing line: ~ left_side_of_word = ""~ +** Processing line: ~ def render_a_star~ - Inside source: true *** True Line Result - left_side_of_word = "" -** Processing line: ~ center_letter = word[1]~ + def render_a_star +** Processing line: ~ render_a_star_grid~ - Inside source: true *** True Line Result - center_letter = word[1] -** Processing line: ~ right_side_of_word = word[2..-1]~ + render_a_star_grid +** Processing line: ~ render_a_star_star~ - Inside source: true *** True Line Result - right_side_of_word = word[2..-1] -** Processing line: ~ elsif word.length > 0~ + render_a_star_star +** Processing line: ~ render_a_star_target~ - Inside source: true *** True Line Result - elsif word.length > 0 -** Processing line: ~ left_side_of_word, right_side_of_word = word.split("~")~ + render_a_star_target +** Processing line: ~ render_a_star_visited~ - Inside source: true *** True Line Result - left_side_of_word, right_side_of_word = word.split("~") -** Processing line: ~ center_letter = right_side_of_word[0]~ + render_a_star_visited +** Processing line: ~ render_a_star_walls~ - Inside source: true *** True Line Result - center_letter = right_side_of_word[0] -** Processing line: ~ right_side_of_word = right_side_of_word[1..-1]~ + render_a_star_walls +** Processing line: ~ render_a_star_path~ - Inside source: true *** True Line Result - right_side_of_word = right_side_of_word[1..-1] + render_a_star_path ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -78303,438 +81984,458 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ right_side_of_word = right_side_of_word.gsub("-", "")~ -- Inside source: true -*** True Line Result - right_side_of_word = right_side_of_word.gsub("-", "") -** Processing line: ~~ +** Processing line: ~ # This method handles user input every tick~ - Inside source: true *** True Line Result - -** Processing line: ~ {~ + # This method handles user input every tick +** Processing line: ~ def input~ - Inside source: true *** True Line Result - { -** Processing line: ~ left: [29 - left_side_of_word.length * 4 - 1 * left_side_of_word.length, 2, left_side_of_word],~ + def input +** Processing line: ~ # If the mouse was lifted this tick~ - Inside source: true *** True Line Result - left: [29 - left_side_of_word.length * 4 - 1 * left_side_of_word.length, 2, left_side_of_word], -** Processing line: ~ center: [29, 2, center_letter, 255, 0, 0],~ + # If the mouse was lifted this tick +** Processing line: ~ if inputs.mouse.up~ - Inside source: true *** True Line Result - center: [29, 2, center_letter, 255, 0, 0], -** Processing line: ~ right: [34, 2, right_side_of_word]~ + if inputs.mouse.up +** Processing line: ~ # Set current input to none~ - Inside source: true *** True Line Result - right: [34, 2, right_side_of_word] -** Processing line: ~ }~ + # Set current input to none +** Processing line: ~ state.user_input = :none~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + state.user_input = :none +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_scenes args, lowrez_sprites~ +** Processing line: ~ # If the mouse was clicked this tick~ - Inside source: true *** True Line Result - def render_scenes args, lowrez_sprites -** Processing line: ~ lowrez_sprites << args.state.scenes.flat_map do |hs|~ + # If the mouse was clicked this tick +** Processing line: ~ if inputs.mouse.down~ - Inside source: true *** True Line Result - lowrez_sprites << args.state.scenes.flat_map do |hs| -** Processing line: ~ hotspot_square args, hs.x, hs.y, hs.w, hs.h~ + if inputs.mouse.down +** Processing line: ~ # Determine what the user is editing and appropriately edit the state.user_input variable~ - Inside source: true *** True Line Result - hotspot_square args, hs.x, hs.y, hs.w, hs.h -** Processing line: ~ end~ + # Determine what the user is editing and appropriately edit the state.user_input variable +** Processing line: ~ determine_input~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + determine_input +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_storylines args, lowrez_sprites~ -- Inside source: true -*** True Line Result - def render_storylines args, lowrez_sprites -** Processing line: ~ lowrez_sprites << args.state.storylines.flat_map do |hs|~ +** Processing line: ~ # Process user input based on user_input variable and current mouse position~ - Inside source: true *** True Line Result - lowrez_sprites << args.state.storylines.flat_map do |hs| -** Processing line: ~ hotspot_square args, hs.x, hs.y, hs.w, hs.h~ + # Process user input based on user_input variable and current mouse position +** Processing line: ~ process_input~ - Inside source: true *** True Line Result - hotspot_square args, hs.x, hs.y, hs.w, hs.h + process_input ** 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 adornments_alpha args, target_alpha = nil, minimum_alpha = nil~ +** Processing line: ~ # Determines what the user is editing~ - Inside source: true *** True Line Result - def adornments_alpha args, target_alpha = nil, minimum_alpha = nil -** Processing line: ~ return (minimum_alpha || 80) unless args.state.storyline_queue_empty_at~ + # Determines what the user is editing +** Processing line: ~ # This method is called when the mouse is clicked down~ - Inside source: true *** True Line Result - return (minimum_alpha || 80) unless args.state.storyline_queue_empty_at -** Processing line: ~ target_alpha ||= 255~ + # This method is called when the mouse is clicked down +** Processing line: ~ def determine_input~ - Inside source: true *** True Line Result - target_alpha ||= 255 -** Processing line: ~ target_alpha * args.state.storyline_queue_empty_at.ease(60)~ + def determine_input +** Processing line: ~ # If the mouse is over the star in the first grid~ - Inside source: true *** True Line Result - target_alpha * args.state.storyline_queue_empty_at.ease(60) -** Processing line: ~ end~ + # If the mouse is over the star in the first grid +** Processing line: ~ if dijkstra_mouse_over_star?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if dijkstra_mouse_over_star? +** Processing line: ~ # The user is editing the star from the first grid~ - Inside source: true *** True Line Result - -** Processing line: ~ def hotspot_square args, x, y, w, h~ + # The user is editing the star from the first grid +** Processing line: ~ state.user_input = :dijkstra_star~ - Inside source: true *** True Line Result - def hotspot_square args, x, y, w, h -** Processing line: ~ if w >= 3 && h >= 3~ + state.user_input = :dijkstra_star +** Processing line: ~ # If the mouse is over the star in the second grid~ - Inside source: true *** True Line Result - if w >= 3 && h >= 3 -** Processing line: ~ [~ + # If the mouse is over the star in the second grid +** Processing line: ~ elsif greedy_mouse_over_star?~ - Inside source: true *** True Line Result - [ -** Processing line: ~ [x + w.idiv(2) + 1, y, w.idiv(2), h, 'sprites/label-background.png', 0, adornments_alpha(args, 50), 23, 23, 23],~ + elsif greedy_mouse_over_star? +** Processing line: ~ # The user is editing the star from the second grid~ - Inside source: true *** True Line Result - [x + w.idiv(2) + 1, y, w.idiv(2), h, 'sprites/label-background.png', 0, adornments_alpha(args, 50), 23, 23, 23], -** Processing line: ~ [x, y, w.idiv(2), h, 'sprites/label-background.png', 0, adornments_alpha(args, 100), 223, 223, 223],~ + # The user is editing the star from the second grid +** Processing line: ~ state.user_input = :greedy_star~ - Inside source: true *** True Line Result - [x, y, w.idiv(2), h, 'sprites/label-background.png', 0, adornments_alpha(args, 100), 223, 223, 223], -** Processing line: ~ [x + 1, y + 1, w - 2, h - 2, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 40, 140, 40],~ + state.user_input = :greedy_star +** Processing line: ~ # If the mouse is over the star in the third grid~ - Inside source: true *** True Line Result - [x + 1, y + 1, w - 2, h - 2, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 40, 140, 40], -** Processing line: ~ ]~ + # If the mouse is over the star in the third grid +** Processing line: ~ elsif a_star_mouse_over_star?~ - Inside source: true *** True Line Result - ] -** Processing line: ~ else~ + elsif a_star_mouse_over_star? +** Processing line: ~ # The user is editing the star from the third grid~ - Inside source: true *** True Line Result - else -** Processing line: ~ [~ + # The user is editing the star from the third grid +** Processing line: ~ state.user_input = :a_star_star~ - Inside source: true *** True Line Result - [ -** Processing line: ~ [x, y, w, h, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 0, 140, 0],~ + state.user_input = :a_star_star +** Processing line: ~ # If the mouse is over the target in the first grid~ - Inside source: true *** True Line Result - [x, y, w, h, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 0, 140, 0], -** Processing line: ~ ]~ + # If the mouse is over the target in the first grid +** Processing line: ~ elsif dijkstra_mouse_over_target?~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + elsif dijkstra_mouse_over_target? +** Processing line: ~ # The user is editing the target from the first grid~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # The user is editing the target from the first grid +** Processing line: ~ state.user_input = :dijkstra_target~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.user_input = :dijkstra_target +** Processing line: ~ # If the mouse is over the target in the second grid~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_storyline_dialog args, lowrez_labels, lowrez_sprites~ + # If the mouse is over the target in the second grid +** Processing line: ~ elsif greedy_mouse_over_target?~ - Inside source: true *** True Line Result - def render_storyline_dialog args, lowrez_labels, lowrez_sprites -** Processing line: ~ return unless args.state.is_storyline_dialog_active~ + elsif greedy_mouse_over_target? +** Processing line: ~ # The user is editing the target from the second grid~ - Inside source: true *** True Line Result - return unless args.state.is_storyline_dialog_active -** Processing line: ~ return unless args.state.storyline_to_show~ + # The user is editing the target from the second grid +** Processing line: ~ state.user_input = :greedy_target~ - Inside source: true *** True Line Result - return unless args.state.storyline_to_show -** Processing line: ~ labels = labels_for_word args.state.storyline_to_show~ + state.user_input = :greedy_target +** Processing line: ~ # If the mouse is over the target in the third grid~ - Inside source: true *** True Line Result - labels = labels_for_word args.state.storyline_to_show -** Processing line: ~ if true # high rez version~ + # If the mouse is over the target in the third grid +** Processing line: ~ elsif a_star_mouse_over_target?~ - Inside source: true *** True Line Result - if true # high rez version -** Processing line: ~ scale = 8.88~ + elsif a_star_mouse_over_target? +** Processing line: ~ # The user is editing the target from the third grid~ - Inside source: true *** True Line Result - scale = 8.88 -** Processing line: ~ offset = 45~ + # The user is editing the target from the third grid +** Processing line: ~ state.user_input = :a_star_target~ - Inside source: true *** True Line Result - offset = 45 -** Processing line: ~ size = 25~ + state.user_input = :a_star_target +** Processing line: ~ # If the mouse is over a wall in the first grid~ - Inside source: true *** True Line Result - size = 25 -** Processing line: ~ args.outputs.labels << [offset + labels[:left].x.-(1) * scale,~ + # If the mouse is over a wall in the first grid +** Processing line: ~ elsif dijkstra_mouse_over_wall?~ - Inside source: true *** True Line Result - args.outputs.labels << [offset + labels[:left].x.-(1) * scale, -** Processing line: ~ labels[:left].y * TINY_SCALE + 55,~ + elsif dijkstra_mouse_over_wall? +** Processing line: ~ # The user is removing a wall from the first grid~ - Inside source: true *** True Line Result - labels[:left].y * TINY_SCALE + 55, -** Processing line: ~ labels[:left].text, size, 0, 0, 0, 0, 255,~ + # The user is removing a wall from the first grid +** Processing line: ~ state.user_input = :dijkstra_remove_wall~ - Inside source: true *** True Line Result - labels[:left].text, size, 0, 0, 0, 0, 255, -** Processing line: ~ 'fonts/manaspc.ttf']~ + state.user_input = :dijkstra_remove_wall +** Processing line: ~ # If the mouse is over a wall in the second grid~ - Inside source: true *** True Line Result - 'fonts/manaspc.ttf'] -** Processing line: ~ center_text = labels[:center].text~ + # If the mouse is over a wall in the second grid +** Processing line: ~ elsif greedy_mouse_over_wall?~ - Inside source: true *** True Line Result - center_text = labels[:center].text -** Processing line: ~ center_text = "|" if center_text == "$"~ + elsif greedy_mouse_over_wall? +** Processing line: ~ # The user is removing a wall from the second grid~ - Inside source: true *** True Line Result - center_text = "|" if center_text == "$" -** Processing line: ~ args.outputs.labels << [offset + labels[:center].x * scale,~ + # The user is removing a wall from the second grid +** Processing line: ~ state.user_input = :greedy_remove_wall~ - Inside source: true *** True Line Result - args.outputs.labels << [offset + labels[:center].x * scale, -** Processing line: ~ labels[:center].y * TINY_SCALE + 55,~ + state.user_input = :greedy_remove_wall +** Processing line: ~ # If the mouse is over a wall in the third grid~ - Inside source: true *** True Line Result - labels[:center].y * TINY_SCALE + 55, -** Processing line: ~ center_text, size, 0, 255, 0, 0, 255,~ + # If the mouse is over a wall in the third grid +** Processing line: ~ elsif a_star_mouse_over_wall?~ - Inside source: true *** True Line Result - center_text, size, 0, 255, 0, 0, 255, -** Processing line: ~ 'fonts/manaspc.ttf']~ + elsif a_star_mouse_over_wall? +** Processing line: ~ # The user is removing a wall from the third grid~ - Inside source: true *** True Line Result - 'fonts/manaspc.ttf'] -** Processing line: ~ args.outputs.labels << [offset + labels[:right].x * scale,~ + # The user is removing a wall from the third grid +** Processing line: ~ state.user_input = :a_star_remove_wall~ - Inside source: true *** True Line Result - args.outputs.labels << [offset + labels[:right].x * scale, -** Processing line: ~ labels[:right].y * TINY_SCALE + 55,~ + state.user_input = :a_star_remove_wall +** Processing line: ~ # If the mouse is over the first grid~ - Inside source: true *** True Line Result - labels[:right].y * TINY_SCALE + 55, -** Processing line: ~ labels[:right].text, size, 0, 0, 0, 0, 255,~ + # If the mouse is over the first grid +** Processing line: ~ elsif dijkstra_mouse_over_grid?~ - Inside source: true *** True Line Result - labels[:right].text, size, 0, 0, 0, 0, 255, -** Processing line: ~ 'fonts/manaspc.ttf']~ + elsif dijkstra_mouse_over_grid? +** Processing line: ~ # The user is adding a wall from the first grid~ - Inside source: true *** True Line Result - 'fonts/manaspc.ttf'] -** Processing line: ~ else~ + # The user is adding a wall from the first grid +** Processing line: ~ state.user_input = :dijkstra_add_wall~ - Inside source: true *** True Line Result - else -** Processing line: ~ lowrez_labels << labels[:left]~ + state.user_input = :dijkstra_add_wall +** Processing line: ~ # If the mouse is over the second grid~ - Inside source: true *** True Line Result - lowrez_labels << labels[:left] -** Processing line: ~ lowrez_labels << labels[:center]~ + # If the mouse is over the second grid +** Processing line: ~ elsif greedy_mouse_over_grid?~ - Inside source: true *** True Line Result - lowrez_labels << labels[:center] -** Processing line: ~ lowrez_labels << labels[:right]~ + elsif greedy_mouse_over_grid? +** Processing line: ~ # The user is adding a wall from the second grid~ - Inside source: true *** True Line Result - lowrez_labels << labels[:right] -** Processing line: ~ end~ + # The user is adding a wall from the second grid +** Processing line: ~ state.user_input = :greedy_add_wall~ - Inside source: true *** True Line Result - end -** Processing line: ~ args.state.is_storyline_dialog_active = true~ + state.user_input = :greedy_add_wall +** Processing line: ~ # If the mouse is over the third grid~ - Inside source: true *** True Line Result - args.state.is_storyline_dialog_active = true -** Processing line: ~ render_player args, lowrez_sprites~ + # If the mouse is over the third grid +** Processing line: ~ elsif a_star_mouse_over_grid?~ - Inside source: true *** True Line Result - render_player args, lowrez_sprites -** Processing line: ~ lowrez_sprites << [0, 0, 64, 8, 'sprites/label-background.png']~ + elsif a_star_mouse_over_grid? +** Processing line: ~ # The user is adding a wall from the third grid~ - Inside source: true *** True Line Result - lowrez_sprites << [0, 0, 64, 8, 'sprites/label-background.png'] -** Processing line: ~ end~ + # The user is adding a wall from the third grid +** Processing line: ~ state.user_input = :a_star_add_wall~ - Inside source: true *** True Line Result - end + state.user_input = :a_star_add_wall +** 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_player args, lowrez_sprites~ +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ - Inside source: true *** True Line Result - def render_player args, lowrez_sprites -** Processing line: ~ lowrez_sprites << player_md_down(args, *args.state.player)~ + # Processes click and drag based on what the user is currently dragging +** Processing line: ~ def process_input~ - Inside source: true *** True Line Result - lowrez_sprites << player_md_down(args, *args.state.player) -** Processing line: ~ end~ + def process_input +** Processing line: ~ if state.user_input == :dijkstra_star~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if state.user_input == :dijkstra_star +** Processing line: ~ process_input_dijkstra_star~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_adornments args, lowrez_sprites~ + process_input_dijkstra_star +** Processing line: ~ elsif state.user_input == :greedy_star~ - Inside source: true *** True Line Result - def render_adornments args, lowrez_sprites -** Processing line: ~ render_scenes args, lowrez_sprites~ + elsif state.user_input == :greedy_star +** Processing line: ~ process_input_greedy_star~ - Inside source: true *** True Line Result - render_scenes args, lowrez_sprites -** Processing line: ~ render_storylines args, lowrez_sprites~ + process_input_greedy_star +** Processing line: ~ elsif state.user_input == :a_star_star~ - Inside source: true *** True Line Result - render_storylines args, lowrez_sprites -** Processing line: ~ return if args.state.is_storyline_dialog_active~ + elsif state.user_input == :a_star_star +** Processing line: ~ process_input_a_star_star~ - Inside source: true *** True Line Result - return if args.state.is_storyline_dialog_active -** Processing line: ~ lowrez_sprites << player_md_down(args, *args.state.player)~ + process_input_a_star_star +** Processing line: ~ elsif state.user_input == :dijkstra_target~ - Inside source: true *** True Line Result - lowrez_sprites << player_md_down(args, *args.state.player) -** Processing line: ~ end~ + elsif state.user_input == :dijkstra_target +** Processing line: ~ process_input_dijkstra_target~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + process_input_dijkstra_target +** Processing line: ~ elsif state.user_input == :greedy_target~ - Inside source: true *** True Line Result - -** Processing line: ~ def global_alpha_percentage args, max_alpha = 255~ + elsif state.user_input == :greedy_target +** Processing line: ~ process_input_greedy_target~ - Inside source: true *** True Line Result - def global_alpha_percentage args, max_alpha = 255 -** Processing line: ~ return 255 unless args.state.scene_changed_at~ + process_input_greedy_target +** Processing line: ~ elsif state.user_input == :a_star_target~ - Inside source: true *** True Line Result - return 255 unless args.state.scene_changed_at -** Processing line: ~ return 255 unless args.state.scene_fade~ + elsif state.user_input == :a_star_target +** Processing line: ~ process_input_a_star_target~ - Inside source: true *** True Line Result - return 255 unless args.state.scene_fade -** Processing line: ~ return 255 unless args.state.scene_fade > 0~ + process_input_a_star_target +** Processing line: ~ elsif state.user_input == :dijkstra_remove_wall~ - Inside source: true *** True Line Result - return 255 unless args.state.scene_fade > 0 -** Processing line: ~ return max_alpha * args.state.scene_changed_at.ease(args.state.scene_fade)~ + elsif state.user_input == :dijkstra_remove_wall +** Processing line: ~ process_input_dijkstra_remove_wall~ - Inside source: true *** True Line Result - return max_alpha * args.state.scene_changed_at.ease(args.state.scene_fade) -** Processing line: ~ end~ + process_input_dijkstra_remove_wall +** Processing line: ~ elsif state.user_input == :greedy_remove_wall~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif state.user_input == :greedy_remove_wall +** Processing line: ~ process_input_greedy_remove_wall~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_current_scene args, lowrez_sprites, lowrez_labels, lowrez_solids~ + process_input_greedy_remove_wall +** Processing line: ~ elsif state.user_input == :a_star_remove_wall~ - Inside source: true *** True Line Result - def render_current_scene args, lowrez_sprites, lowrez_labels, lowrez_solids -** Processing line: ~ lowrez_sprites << [0, 0, 64, 64, args.state.background, 0, (global_alpha_percentage args)]~ + elsif state.user_input == :a_star_remove_wall +** Processing line: ~ process_input_a_star_remove_wall~ - Inside source: true *** True Line Result - lowrez_sprites << [0, 0, 64, 64, args.state.background, 0, (global_alpha_percentage args)] -** Processing line: ~ if args.state.scene_render_override~ + process_input_a_star_remove_wall +** Processing line: ~ elsif state.user_input == :dijkstra_add_wall~ - Inside source: true *** True Line Result - if args.state.scene_render_override -** Processing line: ~ send args.state.scene_render_override, args, lowrez_sprites, lowrez_labels, lowrez_solids~ + elsif state.user_input == :dijkstra_add_wall +** Processing line: ~ process_input_dijkstra_add_wall~ - Inside source: true *** True Line Result - send args.state.scene_render_override, args, lowrez_sprites, lowrez_labels, lowrez_solids + process_input_dijkstra_add_wall +** Processing line: ~ elsif state.user_input == :greedy_add_wall~ +- Inside source: true +*** True Line Result + elsif state.user_input == :greedy_add_wall +** Processing line: ~ process_input_greedy_add_wall~ +- Inside source: true +*** True Line Result + process_input_greedy_add_wall +** Processing line: ~ elsif state.user_input == :a_star_add_wall~ +- Inside source: true +*** True Line Result + elsif state.user_input == :a_star_add_wall +** Processing line: ~ process_input_a_star_add_wall~ +- Inside source: true +*** True Line Result + process_input_a_star_add_wall +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ storyline_to_show = args.state.storyline_to_show || ""~ +** Processing line: ~~ - Inside source: true *** True Line Result - storyline_to_show = args.state.storyline_to_show || "" -** Processing line: ~ render_adornments args, lowrez_sprites~ + +** Processing line: ~ def render_dijkstra_grid~ - Inside source: true *** True Line Result - render_adornments args, lowrez_sprites -** Processing line: ~ render_storyline_dialog args, lowrez_labels, lowrez_sprites~ + def render_dijkstra_grid +** Processing line: ~ # A large rect the size of the grid~ - Inside source: true *** True Line Result - render_storyline_dialog args, lowrez_labels, lowrez_sprites + # A large rect the size of the grid +** Processing line: ~ outputs.solids << [dijkstra_scale_up(grid.rect), default_color]~ +- Inside source: true +*** True Line Result + outputs.solids << [dijkstra_scale_up(grid.rect), default_color] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if args.state.background == 'sprites/tribute-game-over.png'~ +** Processing line: ~ # The vertical grid lines~ - Inside source: true *** True Line Result - if args.state.background == 'sprites/tribute-game-over.png' -** Processing line: ~ lowrez_sprites << [0, 0, 64, 11, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 0, 0, 0]~ + # The vertical grid lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - lowrez_sprites << [0, 0, 64, 11, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 0, 0, 0] -** Processing line: ~ lowrez_labels << [9, 6, 'Return of', 255, 255, 255]~ + for x in 0..grid.width +** Processing line: ~ outputs.lines << dijkstra_vertical_line(x)~ - Inside source: true *** True Line Result - lowrez_labels << [9, 6, 'Return of', 255, 255, 255] -** Processing line: ~ lowrez_labels << [9, 1, ' Serenity', 255, 255, 255]~ + outputs.lines << dijkstra_vertical_line(x) +** Processing line: ~ end~ - Inside source: true *** True Line Result - lowrez_labels << [9, 1, ' Serenity', 255, 255, 255] -** Processing line: ~ if !args.state.ended~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - if !args.state.ended -** Processing line: ~ args.gtk.stop_music~ + +** Processing line: ~ # The horizontal grid lines~ - Inside source: true *** True Line Result - args.gtk.stop_music -** Processing line: ~ args.outputs.sounds << 'sounds/music-loop.ogg'~ + # The horizontal grid lines +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - args.outputs.sounds << 'sounds/music-loop.ogg' -** Processing line: ~ args.state.ended = true~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << dijkstra_horizontal_line(y)~ - Inside source: true *** True Line Result - args.state.ended = true + outputs.lines << dijkstra_horizontal_line(y) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -78743,2938 +82444,3030 @@ 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: ~ def player_md_right args, x, y~ +** Processing line: ~ def render_greedy_grid~ - Inside source: true *** True Line Result - def player_md_right args, x, y -** Processing line: ~ [x, y, 4, 11, 'sprites/player-right.png', 0, (global_alpha_percentage args)]~ + def render_greedy_grid +** Processing line: ~ # A large rect the size of the grid~ - Inside source: true *** True Line Result - [x, y, 4, 11, 'sprites/player-right.png', 0, (global_alpha_percentage args)] -** Processing line: ~ end~ + # A large rect the size of the grid +** Processing line: ~ outputs.solids << [greedy_scale_up(grid.rect), default_color]~ - Inside source: true *** True Line Result - end + outputs.solids << [greedy_scale_up(grid.rect), default_color] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def player_md_left args, x, y~ +** Processing line: ~ # The vertical grid lines~ - Inside source: true *** True Line Result - def player_md_left args, x, y -** Processing line: ~ [x, y, 4, 11, 'sprites/player-left.png', 0, (global_alpha_percentage args)]~ + # The vertical grid lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - [x, y, 4, 11, 'sprites/player-left.png', 0, (global_alpha_percentage args)] -** Processing line: ~ end~ + for x in 0..grid.width +** Processing line: ~ outputs.lines << greedy_vertical_line(x)~ - Inside source: true *** True Line Result - end + outputs.lines << greedy_vertical_line(x) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def player_md_up args, x, y~ +** Processing line: ~ # The horizontal grid lines~ - Inside source: true *** True Line Result - def player_md_up args, x, y -** Processing line: ~ [x, y, 4, 11, 'sprites/player-up.png', 0, (global_alpha_percentage args)]~ + # The horizontal grid lines +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - [x, y, 4, 11, 'sprites/player-up.png', 0, (global_alpha_percentage args)] -** Processing line: ~ end~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << greedy_horizontal_line(y)~ - Inside source: true *** True Line Result - end + outputs.lines << greedy_horizontal_line(y) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def player_md_down args, x, y~ +** Processing line: ~ def render_a_star_grid~ - Inside source: true *** True Line Result - def player_md_down args, x, y -** Processing line: ~ [x, y, 4, 11, 'sprites/player-down.png', 0, (global_alpha_percentage args)]~ + def render_a_star_grid +** Processing line: ~ # A large rect the size of the grid~ - Inside source: true *** True Line Result - [x, y, 4, 11, 'sprites/player-down.png', 0, (global_alpha_percentage args)] -** Processing line: ~ end~ + # A large rect the size of the grid +** Processing line: ~ outputs.solids << [a_star_scale_up(grid.rect), default_color]~ - Inside source: true *** True Line Result - end + outputs.solids << [a_star_scale_up(grid.rect), default_color] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def player_sm args, x, y~ +** Processing line: ~ # The vertical grid lines~ - Inside source: true *** True Line Result - def player_sm args, x, y -** Processing line: ~ [x, y, 3, 7, 'sprites/player-zoomed-out.png', 0, (global_alpha_percentage args)]~ + # The vertical grid lines +** Processing line: ~ for x in 0..grid.width~ - Inside source: true *** True Line Result - [x, y, 3, 7, 'sprites/player-zoomed-out.png', 0, (global_alpha_percentage args)] -** Processing line: ~ end~ + for x in 0..grid.width +** Processing line: ~ outputs.lines << a_star_vertical_line(x)~ - Inside source: true *** True Line Result - end + outputs.lines << a_star_vertical_line(x) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def player_xs args, x, y~ +** Processing line: ~ # The horizontal grid lines~ - Inside source: true *** True Line Result - def player_xs args, x, y -** Processing line: ~ [x, y, 1, 4, 'sprites/player-zoomed-out.png', 0, (global_alpha_percentage args)]~ + # The horizontal grid lines +** Processing line: ~ for y in 0..grid.height~ - Inside source: true *** True Line Result - [x, y, 1, 4, 'sprites/player-zoomed-out.png', 0, (global_alpha_percentage args)] -** Processing line: ~ end~ + for y in 0..grid.height +** Processing line: ~ outputs.lines << a_star_horizontal_line(y)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.lines << a_star_horizontal_line(y) +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + end +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Rpg Narrative - Return Of Serenity - require.rb~ -- Header detected. +** Processing line: ~ # Returns a vertical line for a column of the first grid~ +- Inside source: true *** True Line Result - + # Returns a vertical line for a column of the first grid +** Processing line: ~ def dijkstra_vertical_line column~ +- Inside source: true *** True Line Result -* Rpg Narrative - Return Of Serenity - require.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + def dijkstra_vertical_line column +** Processing line: ~ dijkstra_scale_up([column, 0, column, grid.height])~ +- Inside source: true +*** True Line Result + dijkstra_scale_up([column, 0, column, grid.height]) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ # Returns a horizontal line for a column of the first grid~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/require.rb~ + # Returns a horizontal line for a column of the first grid +** Processing line: ~ def dijkstra_horizontal_line row~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/require.rb -** Processing line: ~ require 'app/lowrez_simulator.rb'~ + def dijkstra_horizontal_line row +** Processing line: ~ dijkstra_scale_up([0, row, grid.width, row])~ - Inside source: true *** True Line Result - require 'app/lowrez_simulator.rb' -** Processing line: ~ require 'app/storyline_day_one.rb'~ + dijkstra_scale_up([0, row, grid.width, row]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - require 'app/storyline_day_one.rb' -** Processing line: ~ require 'app/storyline_blinking_light.rb'~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - require 'app/storyline_blinking_light.rb' -** Processing line: ~ require 'app/storyline_serenity_introduction.rb'~ + +** Processing line: ~ # Returns a vertical line for a column of the second grid~ - Inside source: true *** True Line Result - require 'app/storyline_serenity_introduction.rb' -** Processing line: ~ require 'app/storyline_speed_of_light.rb'~ + # Returns a vertical line for a column of the second grid +** Processing line: ~ def greedy_vertical_line column~ - Inside source: true *** True Line Result - require 'app/storyline_speed_of_light.rb' -** Processing line: ~ require 'app/storyline_serenity_alive.rb'~ + def greedy_vertical_line column +** Processing line: ~ dijkstra_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height])~ - Inside source: true *** True Line Result - require 'app/storyline_serenity_alive.rb' -** Processing line: ~ require 'app/storyline_serenity_bio.rb'~ + dijkstra_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - require 'app/storyline_serenity_bio.rb' -** Processing line: ~ require 'app/storyline_anka.rb'~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - require 'app/storyline_anka.rb' -** Processing line: ~ require 'app/storyline_final_message.rb'~ + +** Processing line: ~ # Returns a horizontal line for a column of the second grid~ - Inside source: true *** True Line Result - require 'app/storyline_final_message.rb' -** Processing line: ~ require 'app/storyline_final_decision.rb'~ + # Returns a horizontal line for a column of the second grid +** Processing line: ~ def greedy_horizontal_line row~ - Inside source: true *** True Line Result - require 'app/storyline_final_decision.rb' -** Processing line: ~ require 'app/storyline.rb'~ + def greedy_horizontal_line row +** Processing line: ~ dijkstra_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row])~ - Inside source: true *** True Line Result - require 'app/storyline.rb' + dijkstra_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row]) +** 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. +** Processing line: ~ # Returns a vertical line for a column of the third grid~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + # Returns a vertical line for a column of the third grid +** Processing line: ~ def a_star_vertical_line column~ +- Inside source: true *** True Line Result - -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline.rb~ -- Header detected. + def a_star_vertical_line column +** Processing line: ~ dijkstra_scale_up([column + (grid.width * 2) + 2, 0, column + (grid.width * 2) + 2, grid.height])~ +- Inside source: true *** True Line Result - + dijkstra_scale_up([column + (grid.width * 2) + 2, 0, column + (grid.width * 2) + 2, grid.height]) +** Processing line: ~ end~ +- Inside source: true *** True Line Result -* Rpg Narrative - Return Of Serenity - storyline.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + end +** Processing line: ~~ +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline.rb~ +** Processing line: ~ # Returns a horizontal line for a column of the third grid~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline.rb -** Processing line: ~ def hotspot_top~ + # Returns a horizontal line for a column of the third grid +** Processing line: ~ def a_star_horizontal_line row~ - Inside source: true *** True Line Result - def hotspot_top -** Processing line: ~ [4, 61, 56, 3]~ + def a_star_horizontal_line row +** Processing line: ~ dijkstra_scale_up([(grid.width * 2) + 2, row, (grid.width * 2) + grid.width + 2, row])~ - Inside source: true *** True Line Result - [4, 61, 56, 3] -** Processing line: ~ end~ + dijkstra_scale_up([(grid.width * 2) + 2, row, (grid.width * 2) + grid.width + 2, row]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def hotspot_bottom~ +** Processing line: ~ # Renders the star on the first grid~ - Inside source: true *** True Line Result - def hotspot_bottom -** Processing line: ~ [4, 0, 56, 3]~ + # Renders the star on the first grid +** Processing line: ~ def render_dijkstra_star~ - Inside source: true *** True Line Result - [4, 0, 56, 3] -** Processing line: ~ end~ + def render_dijkstra_star +** Processing line: ~ outputs.sprites << [dijkstra_scale_up(grid.star), 'star.png']~ - Inside source: true *** True Line Result - end + outputs.sprites << [dijkstra_scale_up(grid.star), 'star.png'] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def hotspot_top_right~ +** Processing line: ~ # Renders the star on the second grid~ - Inside source: true *** True Line Result - def hotspot_top_right -** Processing line: ~ [62, 35, 3, 25]~ + # Renders the star on the second grid +** Processing line: ~ def render_greedy_star~ - Inside source: true *** True Line Result - [62, 35, 3, 25] -** Processing line: ~ end~ + def render_greedy_star +** Processing line: ~ outputs.sprites << [greedy_scale_up(grid.star), 'star.png']~ - Inside source: true *** True Line Result - end + outputs.sprites << [greedy_scale_up(grid.star), 'star.png'] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def hotspot_bottom_right~ +** Processing line: ~ # Renders the star on the third grid~ - Inside source: true *** True Line Result - def hotspot_bottom_right -** Processing line: ~ [62, 0, 3, 25]~ + # Renders the star on the third grid +** Processing line: ~ def render_a_star_star~ - Inside source: true *** True Line Result - [62, 0, 3, 25] -** Processing line: ~ end~ + def render_a_star_star +** Processing line: ~ outputs.sprites << [a_star_scale_up(grid.star), 'star.png']~ - Inside source: true *** True Line Result - end + outputs.sprites << [a_star_scale_up(grid.star), 'star.png'] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def storyline_history_include? args, text~ +** Processing line: ~ # Renders the target on the first grid~ - Inside source: true *** True Line Result - def storyline_history_include? args, text -** Processing line: ~ args.state.storyline_history.any? { |s| s.gsub("-", "").gsub(" ", "").include? text.gsub("-", "").gsub(" ", "") }~ + # Renders the target on the first grid +** Processing line: ~ def render_dijkstra_target~ - Inside source: true *** True Line Result - args.state.storyline_history.any? { |s| s.gsub("-", "").gsub(" ", "").include? text.gsub("-", "").gsub(" ", "") } -** Processing line: ~ end~ + def render_dijkstra_target +** Processing line: ~ outputs.sprites << [dijkstra_scale_up(grid.target), 'target.png']~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.sprites << [dijkstra_scale_up(grid.target), 'target.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def blinking_light_side_of_home_render args, lowrez_sprites, lowrez_labels, lowrez_solids~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def blinking_light_side_of_home_render args, lowrez_sprites, lowrez_labels, lowrez_solids -** Processing line: ~ lowrez_sprites << [48, 44, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + +** Processing line: ~ # Renders the target on the second grid~ - Inside source: true *** True Line Result - lowrez_sprites << [48, 44, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ lowrez_sprites << [49, 45, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + # Renders the target on the second grid +** Processing line: ~ def render_greedy_target~ - Inside source: true *** True Line Result - lowrez_sprites << [49, 45, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ lowrez_sprites << [50, 46, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + def render_greedy_target +** Processing line: ~ outputs.sprites << [greedy_scale_up(grid.target), 'target.png']~ - Inside source: true *** True Line Result - lowrez_sprites << [50, 46, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ end~ + outputs.sprites << [greedy_scale_up(grid.target), 'target.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def blinking_light_mountain_pass_render args, lowrez_sprites, lowrez_labels, lowrez_solids~ -- Inside source: true -*** True Line Result - def blinking_light_mountain_pass_render args, lowrez_sprites, lowrez_labels, lowrez_solids -** Processing line: ~ lowrez_sprites << [18, 47, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +** Processing line: ~ # Renders the target on the third grid~ - Inside source: true *** True Line Result - lowrez_sprites << [18, 47, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ lowrez_sprites << [19, 48, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + # Renders the target on the third grid +** Processing line: ~ def render_a_star_target~ - Inside source: true *** True Line Result - lowrez_sprites << [19, 48, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ lowrez_sprites << [20, 49, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + def render_a_star_target +** Processing line: ~ outputs.sprites << [a_star_scale_up(grid.target), 'target.png']~ - Inside source: true *** True Line Result - lowrez_sprites << [20, 49, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ end~ + outputs.sprites << [a_star_scale_up(grid.target), 'target.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def blinking_light_path_to_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids~ +** Processing line: ~ # Renders the walls on the first grid~ - Inside source: true *** True Line Result - def blinking_light_path_to_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids -** Processing line: ~ lowrez_sprites << [0, 26, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + # Renders the walls on the first grid +** Processing line: ~ def render_dijkstra_walls~ - Inside source: true *** True Line Result - lowrez_sprites << [0, 26, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ lowrez_sprites << [1, 27, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + def render_dijkstra_walls +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - lowrez_sprites << [1, 27, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ lowrez_sprites << [2, 28, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + grid.walls.each_key do | wall | +** Processing line: ~ outputs.solids << [dijkstra_scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - lowrez_sprites << [2, 28, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ end~ + outputs.solids << [dijkstra_scale_up(wall), wall_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def blinking_light_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids~ +** Processing line: ~ # Renders the walls on the second grid~ - Inside source: true *** True Line Result - def blinking_light_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids -** Processing line: ~ lowrez_sprites << [23, 59, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + # Renders the walls on the second grid +** Processing line: ~ def render_greedy_walls~ - Inside source: true *** True Line Result - lowrez_sprites << [23, 59, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ lowrez_sprites << [24, 60, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + def render_greedy_walls +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - lowrez_sprites << [24, 60, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ lowrez_sprites << [25, 61, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + grid.walls.each_key do | wall | +** Processing line: ~ outputs.solids << [greedy_scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - lowrez_sprites << [25, 61, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ end~ + outputs.solids << [greedy_scale_up(wall), wall_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def blinking_light_inside_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids~ +** Processing line: ~ # Renders the walls on the third grid~ - Inside source: true *** True Line Result - def blinking_light_inside_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids -** Processing line: ~ lowrez_sprites << [30, 30, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + # Renders the walls on the third grid +** Processing line: ~ def render_a_star_walls~ - Inside source: true *** True Line Result - lowrez_sprites << [30, 30, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ lowrez_sprites << [31, 31, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + def render_a_star_walls +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - lowrez_sprites << [31, 31, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ lowrez_sprites << [32, 32, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ + grid.walls.each_key do | wall | +** Processing line: ~ outputs.solids << [a_star_scale_up(wall), wall_color]~ - Inside source: true *** True Line Result - lowrez_sprites << [32, 32, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] -** Processing line: ~ end~ + outputs.solids << [a_star_scale_up(wall), wall_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def decision_graph context_message, context_action, context_result_one, context_result_two, context_result_three = [], context_result_four = []~ +** Processing line: ~ # Renders the visited cells on the first grid~ - Inside source: true *** True Line Result - def decision_graph context_message, context_action, context_result_one, context_result_two, context_result_three = [], context_result_four = [] -** Processing line: ~ result_one_scene, result_one_label, result_one_text = context_result_one~ + # Renders the visited cells on the first grid +** Processing line: ~ def render_dijkstra_visited~ - Inside source: true *** True Line Result - result_one_scene, result_one_label, result_one_text = context_result_one -** Processing line: ~ result_two_scene, result_two_label, result_two_text = context_result_two~ + def render_dijkstra_visited +** Processing line: ~ dijkstra.came_from.each_key do | visited_cell |~ - Inside source: true *** True Line Result - result_two_scene, result_two_label, result_two_text = context_result_two -** Processing line: ~ result_three_scene, result_three_label, result_three_text = context_result_three~ + dijkstra.came_from.each_key do | visited_cell | +** Processing line: ~ outputs.solids << [dijkstra_scale_up(visited_cell), visited_color]~ - Inside source: true *** True Line Result - result_three_scene, result_three_label, result_three_text = context_result_three -** Processing line: ~ result_four_scene, result_four_label, result_four_text = context_result_four~ + outputs.solids << [dijkstra_scale_up(visited_cell), visited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - result_four_scene, result_four_label, result_four_text = context_result_four -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ top_level_hash = {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - top_level_hash = { -** Processing line: ~ background: 'sprites/decision.png',~ + +** Processing line: ~ # Renders the visited cells on the second grid~ - Inside source: true *** True Line Result - background: 'sprites/decision.png', -** Processing line: ~ fade: 60,~ + # Renders the visited cells on the second grid +** Processing line: ~ def render_greedy_visited~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [20, 36],~ + def render_greedy_visited +** Processing line: ~ greedy.came_from.each_key do | visited_cell |~ - Inside source: true *** True Line Result - player: [20, 36], -** Processing line: ~ storylines: [ ],~ + greedy.came_from.each_key do | visited_cell | +** Processing line: ~ outputs.solids << [greedy_scale_up(visited_cell), visited_color]~ - Inside source: true *** True Line Result - storylines: [ ], -** Processing line: ~ scenes: [ ]~ + outputs.solids << [greedy_scale_up(visited_cell), visited_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ ] -** Processing line: ~ }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ confirmation_result_one_hash = {~ +** Processing line: ~ # Renders the visited cells on the third grid~ - Inside source: true *** True Line Result - confirmation_result_one_hash = { -** Processing line: ~ background: 'sprites/decision.png',~ + # Renders the visited cells on the third grid +** Processing line: ~ def render_a_star_visited~ - Inside source: true *** True Line Result - background: 'sprites/decision.png', -** Processing line: ~ scenes: [ ],~ + def render_a_star_visited +** Processing line: ~ a_star.came_from.each_key do | visited_cell |~ - Inside source: true *** True Line Result - scenes: [ ], -** Processing line: ~ storylines: [ ]~ + a_star.came_from.each_key do | visited_cell | +** Processing line: ~ outputs.solids << [a_star_scale_up(visited_cell), visited_color]~ - Inside source: true *** True Line Result - storylines: [ ] -** Processing line: ~ }~ + outputs.solids << [a_star_scale_up(visited_cell), visited_color] +** 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: ~ confirmation_result_two_hash = {~ +** Processing line: ~ # Renders the path found by the breadth first search on the first grid~ - Inside source: true *** True Line Result - confirmation_result_two_hash = { -** Processing line: ~ background: 'sprites/decision.png',~ + # Renders the path found by the breadth first search on the first grid +** Processing line: ~ def render_dijkstra_path~ - Inside source: true *** True Line Result - background: 'sprites/decision.png', -** Processing line: ~ scenes: [ ],~ + def render_dijkstra_path +** Processing line: ~ dijkstra.path.each do | path |~ - Inside source: true *** True Line Result - scenes: [ ], -** Processing line: ~ storylines: [ ]~ + dijkstra.path.each do | path | +** Processing line: ~ outputs.solids << [dijkstra_scale_up(path), path_color]~ - Inside source: true *** True Line Result - storylines: [ ] -** Processing line: ~ }~ + outputs.solids << [dijkstra_scale_up(path), path_color] +** 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: ~ confirmation_result_three_hash = {~ +** Processing line: ~ # Renders the path found by the greedy search on the second grid~ - Inside source: true *** True Line Result - confirmation_result_three_hash = { -** Processing line: ~ background: 'sprites/decision.png',~ + # Renders the path found by the greedy search on the second grid +** Processing line: ~ def render_greedy_path~ - Inside source: true *** True Line Result - background: 'sprites/decision.png', -** Processing line: ~ scenes: [ ],~ + def render_greedy_path +** Processing line: ~ greedy.path.each do | path |~ - Inside source: true *** True Line Result - scenes: [ ], -** Processing line: ~ storylines: [ ]~ + greedy.path.each do | path | +** Processing line: ~ outputs.solids << [greedy_scale_up(path), path_color]~ - Inside source: true *** True Line Result - storylines: [ ] -** Processing line: ~ }~ + outputs.solids << [greedy_scale_up(path), path_color] +** 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: ~ confirmation_result_four_hash = {~ +** Processing line: ~ # Renders the path found by the a_star search on the third grid~ - Inside source: true *** True Line Result - confirmation_result_four_hash = { -** Processing line: ~ background: 'sprites/decision.png',~ + # Renders the path found by the a_star search on the third grid +** Processing line: ~ def render_a_star_path~ - Inside source: true *** True Line Result - background: 'sprites/decision.png', -** Processing line: ~ scenes: [ ],~ + def render_a_star_path +** Processing line: ~ a_star.path.each do | path |~ - Inside source: true *** True Line Result - scenes: [ ], -** Processing line: ~ storylines: [ ]~ + a_star.path.each do | path | +** Processing line: ~ outputs.solids << [a_star_scale_up(path), path_color]~ - Inside source: true *** True Line Result - storylines: [ ] -** Processing line: ~ }~ + outputs.solids << [a_star_scale_up(path), path_color] +** 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: ~ top_level_hash[:storylines] << [ 5, 35, 4, 4, context_message]~ +** Processing line: ~ # Returns the rect for the path between two cells based on their relative positions~ - Inside source: true *** True Line Result - top_level_hash[:storylines] << [ 5, 35, 4, 4, context_message] -** Processing line: ~ top_level_hash[:storylines] << [20, 35, 4, 4, context_action]~ + # Returns the rect for the path between two cells based on their relative positions +** Processing line: ~ def get_path_between(cell_one, cell_two)~ - Inside source: true *** True Line Result - top_level_hash[:storylines] << [20, 35, 4, 4, context_action] + def get_path_between(cell_one, cell_two) +** Processing line: ~ path = []~ +- Inside source: true +*** True Line Result + path = [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ confirmation_result_one_hash[:scenes] << [20, 35, 4, 4, top_level_hash]~ +** Processing line: ~ # If cell one is above cell two~ - Inside source: true *** True Line Result - confirmation_result_one_hash[:scenes] << [20, 35, 4, 4, top_level_hash] -** Processing line: ~ confirmation_result_one_hash[:scenes] << [60, 50, 4, 4, result_one_scene]~ + # If cell one is above cell two +** Processing line: ~ if cell_one.x == cell_two.x and cell_one.y > cell_two.y~ - Inside source: true *** True Line Result - confirmation_result_one_hash[:scenes] << [60, 50, 4, 4, result_one_scene] -** Processing line: ~ confirmation_result_one_hash[:storylines] << [40, 50, 4, 4, "#{result_one_label}: \"#{result_one_text}\""]~ + if cell_one.x == cell_two.x and cell_one.y > cell_two.y +** Processing line: ~ # Path starts from the center of cell two and moves upward to the center of cell one~ - Inside source: true *** True Line Result - confirmation_result_one_hash[:storylines] << [40, 50, 4, 4, "#{result_one_label}: \"#{result_one_text}\""] -** Processing line: ~ confirmation_result_one_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene~ + # Path starts from the center of cell two and moves upward to the center of cell one +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4]~ - Inside source: true *** True Line Result - confirmation_result_one_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene -** Processing line: ~ confirmation_result_one_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene~ + path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4] +** Processing line: ~ # If cell one is below cell two~ - Inside source: true *** True Line Result - confirmation_result_one_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene -** Processing line: ~ confirmation_result_one_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash]~ + # If cell one is below cell two +** Processing line: ~ elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y~ - Inside source: true *** True Line Result - confirmation_result_one_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash] -** Processing line: ~~ + elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y +** Processing line: ~ # Path starts from the center of cell one and moves upward to the center of cell two~ - Inside source: true *** True Line Result - -** Processing line: ~ confirmation_result_two_hash[:scenes] << [20, 35, 4, 4, top_level_hash]~ + # Path starts from the center of cell one and moves upward to the center of cell two +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4]~ - Inside source: true *** True Line Result - confirmation_result_two_hash[:scenes] << [20, 35, 4, 4, top_level_hash] -** Processing line: ~ confirmation_result_two_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash]~ + path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4] +** Processing line: ~ # If cell one is to the left of cell two~ - Inside source: true *** True Line Result - confirmation_result_two_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash] -** Processing line: ~ confirmation_result_two_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene~ + # If cell one is to the left of cell two +** Processing line: ~ elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y~ - Inside source: true *** True Line Result - confirmation_result_two_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene -** Processing line: ~ confirmation_result_two_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene~ + elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y +** Processing line: ~ # Path starts from the center of cell two and moves rightward to the center of cell one~ - Inside source: true *** True Line Result - confirmation_result_two_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene -** Processing line: ~ confirmation_result_two_hash[:scenes] << [60, 20, 4, 4, result_two_scene]~ + # Path starts from the center of cell two and moves rightward to the center of cell one +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4]~ - Inside source: true *** True Line Result - confirmation_result_two_hash[:scenes] << [60, 20, 4, 4, result_two_scene] -** Processing line: ~ confirmation_result_two_hash[:storylines] << [40, 20, 4, 4, "#{result_two_label}: \"#{result_two_text}\""]~ + path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4] +** Processing line: ~ # If cell one is to the right of cell two~ - Inside source: true *** True Line Result - confirmation_result_two_hash[:storylines] << [40, 20, 4, 4, "#{result_two_label}: \"#{result_two_text}\""] -** Processing line: ~~ + # If cell one is to the right of cell two +** Processing line: ~ elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y~ - Inside source: true *** True Line Result - -** Processing line: ~ confirmation_result_three_hash[:scenes] << [20, 35, 4, 4, top_level_hash]~ + elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y +** Processing line: ~ # Path starts from the center of cell one and moves rightward to the center of cell two~ - Inside source: true *** True Line Result - confirmation_result_three_hash[:scenes] << [20, 35, 4, 4, top_level_hash] -** Processing line: ~ confirmation_result_three_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash]~ + # Path starts from the center of cell one and moves rightward to the center of cell two +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4]~ - Inside source: true *** True Line Result - confirmation_result_three_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash] -** Processing line: ~ confirmation_result_three_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash]~ + path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4] +** Processing line: ~ end~ - Inside source: true *** True Line Result - confirmation_result_three_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] -** Processing line: ~ confirmation_result_three_hash[:scenes] << [60, 30, 4, 4, result_three_scene]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - confirmation_result_three_hash[:scenes] << [60, 30, 4, 4, result_three_scene] -** Processing line: ~ confirmation_result_three_hash[:storylines] << [40, 30, 4, 4, "#{result_three_label}: \"#{result_three_text}\""]~ + +** Processing line: ~ path~ - Inside source: true *** True Line Result - confirmation_result_three_hash[:storylines] << [40, 30, 4, 4, "#{result_three_label}: \"#{result_three_text}\""] -** Processing line: ~ confirmation_result_three_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash]~ + path +** Processing line: ~ end~ - Inside source: true *** True Line Result - confirmation_result_three_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ confirmation_result_four_hash[:scenes] << [20, 35, 4, 4, top_level_hash]~ +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ - Inside source: true *** True Line Result - confirmation_result_four_hash[:scenes] << [20, 35, 4, 4, top_level_hash] -** Processing line: ~ confirmation_result_four_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash]~ + # In code, the cells are represented as 1x1 rectangles +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ - Inside source: true *** True Line Result - confirmation_result_four_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash] -** Processing line: ~ confirmation_result_four_hash[:scenes] << [60, 40, 4, 4, result_four_scene]~ + # When drawn, the cells are larger than 1x1 rectangles +** Processing line: ~ # This method is used to scale up cells, and lines~ - Inside source: true *** True Line Result - confirmation_result_four_hash[:scenes] << [60, 40, 4, 4, result_four_scene] -** Processing line: ~ confirmation_result_four_hash[:storylines] << [40, 40, 4, 4, "#{result_four_label}: \"#{result_four_text}\""]~ + # This method is used to scale up cells, and lines +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ - Inside source: true *** True Line Result - confirmation_result_four_hash[:storylines] << [40, 40, 4, 4, "#{result_four_label}: \"#{result_four_text}\""] -** Processing line: ~ confirmation_result_four_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash]~ + # Objects are scaled up according to the grid.cell_size variable +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ - Inside source: true *** True Line Result - confirmation_result_four_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] -** Processing line: ~ confirmation_result_four_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash]~ + # This allows for easy customization of the visual scale of the grid +** Processing line: ~ # This method scales up cells for the first grid~ - Inside source: true *** True Line Result - confirmation_result_four_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash] -** Processing line: ~~ + # This method scales up cells for the first grid +** Processing line: ~ def dijkstra_scale_up(cell)~ - Inside source: true *** True Line Result - -** Processing line: ~ top_level_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash]~ + def dijkstra_scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ - Inside source: true *** True Line Result - top_level_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash] -** Processing line: ~ top_level_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene~ + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ - Inside source: true *** True Line Result - top_level_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene -** Processing line: ~ top_level_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene~ + cell = cell.clone +** Processing line: ~~ - Inside source: true *** True Line Result - top_level_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene -** Processing line: ~ top_level_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash]~ + +** Processing line: ~ # If cell is just an x and y coordinate~ - Inside source: true *** True Line Result - top_level_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash] -** Processing line: ~~ + # If cell is just an x and y coordinate +** Processing line: ~ if cell.size == 2~ - Inside source: true *** True Line Result - -** Processing line: ~ top_level_hash~ + if cell.size == 2 +** Processing line: ~ # Add a width and height of 1~ - Inside source: true *** True Line Result - top_level_hash -** Processing line: ~ end~ + # Add a width and height of 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + cell << 1 +** Processing line: ~ cell << 1~ - Inside source: true *** True Line Result - -** Processing line: ~ def ship_control_hotspot offset_x, offset_y, a, b, c, d~ + cell << 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - def ship_control_hotspot offset_x, offset_y, a, b, c, d -** Processing line: ~ results = []~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - results = [] -** Processing line: ~ results << [ 6 + offset_x, 0 + offset_y, 4, 4, a] if a~ + +** Processing line: ~ # Scale all the values up~ - Inside source: true *** True Line Result - results << [ 6 + offset_x, 0 + offset_y, 4, 4, a] if a -** Processing line: ~ results << [ 1 + offset_x, 5 + offset_y, 4, 4, b] if b~ + # Scale all the values up +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ - Inside source: true *** True Line Result - results << [ 1 + offset_x, 5 + offset_y, 4, 4, b] if b -** Processing line: ~ results << [ 6 + offset_x, 5 + offset_y, 4, 4, c] if c~ + cell.map! { |value| value * grid.cell_size } +** Processing line: ~~ - Inside source: true *** True Line Result - results << [ 6 + offset_x, 5 + offset_y, 4, 4, c] if c -** Processing line: ~ results << [ 11 + offset_x, 5 + offset_y, 4, 4, d] if d~ + +** Processing line: ~ # Returns the scaled up cell~ - Inside source: true *** True Line Result - results << [ 11 + offset_x, 5 + offset_y, 4, 4, d] if d -** Processing line: ~ results~ + # Returns the scaled up cell +** Processing line: ~ cell~ - Inside source: true *** True Line Result - results -** Processing line: ~ end~ + cell +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def reload_current_scene~ +** Processing line: ~ # Translates the given cell grid.width + 1 to the right and then scales up~ - Inside source: true *** True Line Result - def reload_current_scene -** Processing line: ~ if $gtk.args.state.last_hotspot_scene~ + # Translates the given cell grid.width + 1 to the right and then scales up +** Processing line: ~ # Used to draw cells for the second grid~ - Inside source: true *** True Line Result - if $gtk.args.state.last_hotspot_scene -** Processing line: ~ set_scene $gtk.args, send($gtk.args.state.last_hotspot_scene, $gtk.args)~ + # Used to draw cells for the second grid +** Processing line: ~ # This method does not work for lines,~ - Inside source: true *** True Line Result - set_scene $gtk.args, send($gtk.args.state.last_hotspot_scene, $gtk.args) -** Processing line: ~ tick $gtk.args~ + # This method does not work for lines, +** Processing line: ~ # so separate methods exist for the grid lines~ - Inside source: true *** True Line Result - tick $gtk.args -** Processing line: ~ elsif respond_to? :set_scene~ + # so separate methods exist for the grid lines +** Processing line: ~ def greedy_scale_up(cell)~ - Inside source: true *** True Line Result - elsif respond_to? :set_scene -** Processing line: ~ set_scene $gtk.args, (replied_to_serenity_alive_firmly $gtk.args)~ + def greedy_scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ - Inside source: true *** True Line Result - set_scene $gtk.args, (replied_to_serenity_alive_firmly $gtk.args) -** Processing line: ~ tick $gtk.args~ + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ - Inside source: true *** True Line Result - tick $gtk.args -** Processing line: ~ end~ + cell = cell.clone +** Processing line: ~ # Translates the cell to the second grid equivalent~ - Inside source: true *** True Line Result - end -** Processing line: ~ $gtk.console.close~ + # Translates the cell to the second grid equivalent +** Processing line: ~ cell.x += grid.width + 1~ - Inside source: true *** True Line Result - $gtk.console.close -** Processing line: ~ end~ + cell.x += grid.width + 1 +** Processing line: ~ # Proceeds as if scaling up for the first grid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Proceeds as if scaling up for the first grid +** Processing line: ~ dijkstra_scale_up(cell)~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + dijkstra_scale_up(cell) +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_anka.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Rpg Narrative - Return Of Serenity - storyline_anka.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +- Inside source: true *** True Line Result +** Processing line: ~ # Translates the given cell (grid.width + 1) * 2 to the right and then scales up~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_anka.rb~ + # Translates the given cell (grid.width + 1) * 2 to the right and then scales up +** Processing line: ~ # Used to draw cells for the third grid~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_anka.rb -** Processing line: ~ def anka_inside_room args~ + # Used to draw cells for the third grid +** Processing line: ~ # This method does not work for lines,~ - Inside source: true *** True Line Result - def anka_inside_room args -** Processing line: ~ {~ + # This method does not work for lines, +** Processing line: ~ # so separate methods exist for the grid lines~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-home.png',~ + # so separate methods exist for the grid lines +** Processing line: ~ def a_star_scale_up(cell)~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [34, 35],~ + def a_star_scale_up(cell) +** Processing line: ~ # Prevents the original value of cell from being edited~ - Inside source: true *** True Line Result - player: [34, 35], -** Processing line: ~ storylines: [~ + # Prevents the original value of cell from being edited +** Processing line: ~ cell = cell.clone~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [34, 34, 4, 4, "Ahhhh!!! Oh god, it was just- a nightmare."],~ + cell = cell.clone +** Processing line: ~ # Translates the cell to the second grid equivalent~ - Inside source: true *** True Line Result - [34, 34, 4, 4, "Ahhhh!!! Oh god, it was just- a nightmare."], -** Processing line: ~ ],~ + # Translates the cell to the second grid equivalent +** Processing line: ~ cell.x += grid.width + 1~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + cell.x += grid.width + 1 +** Processing line: ~ # Translates the cell to the third grid equivalent~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [32, -1, 8, 3, :anka_observatory]~ + # Translates the cell to the third grid equivalent +** Processing line: ~ cell.x += grid.width + 1~ - Inside source: true *** True Line Result - [32, -1, 8, 3, :anka_observatory] -** Processing line: ~ ]~ + cell.x += grid.width + 1 +** Processing line: ~ # Proceeds as if scaling up for the first grid~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + # Proceeds as if scaling up for the first grid +** Processing line: ~ dijkstra_scale_up(cell)~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + dijkstra_scale_up(cell) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def anka_observatory args~ +** Processing line: ~ # Signal that the user is going to be moving the star from the first grid~ - Inside source: true *** True Line Result - def anka_observatory args -** Processing line: ~ {~ + # Signal that the user is going to be moving the star from the first grid +** Processing line: ~ def dijkstra_mouse_over_star?~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + def dijkstra_mouse_over_star? +** Processing line: ~ inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.star))~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 60,~ + inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.star)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [51, 12],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - player: [51, 12], -** Processing line: ~ storylines: [~ + +** Processing line: ~ # Signal that the user is going to be moving the star from the second grid~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [50, 10, 4, 4, "Breathe, Hiro. Just see what's there... everything--- will- be okay."]~ + # Signal that the user is going to be moving the star from the second grid +** Processing line: ~ def greedy_mouse_over_star?~ - Inside source: true *** True Line Result - [50, 10, 4, 4, "Breathe, Hiro. Just see what's there... everything--- will- be okay."] -** Processing line: ~ ],~ + def greedy_mouse_over_star? +** Processing line: ~ inputs.mouse.point.inside_rect?(greedy_scale_up(grid.star))~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + inputs.mouse.point.inside_rect?(greedy_scale_up(grid.star)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 18, 5, 12, :anka_inside_mainframe]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [30, 18, 5, 12, :anka_inside_mainframe] -** Processing line: ~ ],~ + +** Processing line: ~ # Signal that the user is going to be moving the star from the third grid~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ + # Signal that the user is going to be moving the star from the third grid +** Processing line: ~ def a_star_mouse_over_star?~ - Inside source: true *** True Line Result - render_override: :blinking_light_inside_observatory_render -** Processing line: ~ }~ + def a_star_mouse_over_star? +** Processing line: ~ inputs.mouse.point.inside_rect?(a_star_scale_up(grid.star))~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + inputs.mouse.point.inside_rect?(a_star_scale_up(grid.star)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def anka_inside_mainframe args~ +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ - Inside source: true *** True Line Result - def anka_inside_mainframe args -** Processing line: ~ {~ + # Signal that the user is going to be moving the target from the first grid +** Processing line: ~ def dijkstra_mouse_over_target?~ - Inside source: true *** True Line Result - { -** Processing line: ~ player: [32, 4],~ + def dijkstra_mouse_over_target? +** Processing line: ~ inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.target))~ - Inside source: true *** True Line Result - player: [32, 4], -** Processing line: ~ background: 'sprites/mainframe.png',~ + inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.target)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - background: 'sprites/mainframe.png', -** Processing line: ~ fade: 60,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ storylines: [~ + +** Processing line: ~ # Signal that the user is going to be moving the target from the second grid~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [22, 45, 17, 4, (anka_last_reply args)],~ + # Signal that the user is going to be moving the target from the second grid +** Processing line: ~ def greedy_mouse_over_target?~ - Inside source: true *** True Line Result - [22, 45, 17, 4, (anka_last_reply args)], -** Processing line: ~ [45, 45, 4, 4, (anka_current_reply args)],~ + def greedy_mouse_over_target? +** Processing line: ~ inputs.mouse.point.inside_rect?(greedy_scale_up(grid.target))~ - Inside source: true *** True Line Result - [45, 45, 4, 4, (anka_current_reply args)], -** Processing line: ~ ],~ + inputs.mouse.point.inside_rect?(greedy_scale_up(grid.target)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_top_right, :reply_to_anka]~ + +** Processing line: ~ # Signal that the user is going to be moving the target from the third grid~ - Inside source: true *** True Line Result - [*hotspot_top_right, :reply_to_anka] -** Processing line: ~ ]~ + # Signal that the user is going to be moving the target from the third grid +** Processing line: ~ def a_star_mouse_over_target?~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + def a_star_mouse_over_target? +** Processing line: ~ inputs.mouse.point.inside_rect?(a_star_scale_up(grid.target))~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + inputs.mouse.point.inside_rect?(a_star_scale_up(grid.target)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def reply_to_anka args~ -- Inside source: true -*** True Line Result - def reply_to_anka args -** Processing line: ~ decision_graph anka_current_reply(args),~ +** Processing line: ~ # Signal that the user is going to be removing walls from the first grid~ - Inside source: true *** True Line Result - decision_graph anka_current_reply(args), -** Processing line: ~ "Matthew's-- wife is doing-- well. What's-- even-- better-- is that he's-- a dad, and he didn't-- even-- know it. Should- I- leave- out the part about-- the crew- being-- in hibernation-- for 20-- years? They- should- enter-- statis-- on a high- note... Right?",~ + # Signal that the user is going to be removing walls from the first grid +** Processing line: ~ def dijkstra_mouse_over_wall?~ - Inside source: true *** True Line Result - "Matthew's-- wife is doing-- well. What's-- even-- better-- is that he's-- a dad, and he didn't-- even-- know it. Should- I- leave- out the part about-- the crew- being-- in hibernation-- for 20-- years? They- should- enter-- statis-- on a high- note... Right?", -** Processing line: ~ [:replied_with_whole_truth, "Whole-- Truth--", anka_reply_whole_truth],~ + def dijkstra_mouse_over_wall? +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - [:replied_with_whole_truth, "Whole-- Truth--", anka_reply_whole_truth], -** Processing line: ~ [:replied_with_half_truth, "Half-- Truth--", anka_reply_half_truth]~ + grid.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(dijkstra_scale_up(wall))~ - Inside source: true *** True Line Result - [:replied_with_half_truth, "Half-- Truth--", anka_reply_half_truth] -** Processing line: ~ end~ + return true if inputs.mouse.point.inside_rect?(dijkstra_scale_up(wall)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def anka_last_reply args~ +** Processing line: ~ false~ - Inside source: true *** True Line Result - def anka_last_reply args -** Processing line: ~ if args.state.scene_history.include? :replied_to_serenity_alive_firmly~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - if args.state.scene_history.include? :replied_to_serenity_alive_firmly -** Processing line: ~ return "Buffer--: #{serenity_alive_firm_reply.quote}"~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - return "Buffer--: #{serenity_alive_firm_reply.quote}" -** Processing line: ~ else~ + +** Processing line: ~ # Signal that the user is going to be removing walls from the second grid~ - Inside source: true *** True Line Result - else -** Processing line: ~ return "Buffer--: #{serenity_alive_sugarcoated_reply.quote}"~ + # Signal that the user is going to be removing walls from the second grid +** Processing line: ~ def greedy_mouse_over_wall?~ - Inside source: true *** True Line Result - return "Buffer--: #{serenity_alive_sugarcoated_reply.quote}" -** Processing line: ~ end~ + def greedy_mouse_over_wall? +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + grid.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(greedy_scale_up(wall))~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + return true if inputs.mouse.point.inside_rect?(greedy_scale_up(wall)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def anka_reply_whole_truth~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def anka_reply_whole_truth -** Processing line: ~ "Matthew's wife is doing-- very-- well. In fact, she was pregnant. Matthew-- is a dad. He has a son. But, I need- all-- of-- you-- to brace-- yourselves. You've-- been in statis-- for 20 years. A lot has changed. Most of Earth's-- population--- didn't-- survive. Tell- Matthew-- that I'm-- sorry he didn't-- get to see- his- son grow- up."~ + +** Processing line: ~ false~ - Inside source: true *** True Line Result - "Matthew's wife is doing-- very-- well. In fact, she was pregnant. Matthew-- is a dad. He has a son. But, I need- all-- of-- you-- to brace-- yourselves. You've-- been in statis-- for 20 years. A lot has changed. Most of Earth's-- population--- didn't-- survive. Tell- Matthew-- that I'm-- sorry he didn't-- get to see- his- son grow- up." -** Processing line: ~ end~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def anka_reply_half_truth~ +** Processing line: ~ # Signal that the user is going to be removing walls from the third grid~ - Inside source: true *** True Line Result - def anka_reply_half_truth -** Processing line: ~ "Matthew's--- wife- is doing-- very-- well. In fact, she was pregnant. Matthew is a dad! It's a boy! Tell- Matthew-- congrats-- for me. Hope-- to see- all of you- soon."~ + # Signal that the user is going to be removing walls from the third grid +** Processing line: ~ def a_star_mouse_over_wall?~ - Inside source: true *** True Line Result - "Matthew's--- wife- is doing-- very-- well. In fact, she was pregnant. Matthew is a dad! It's a boy! Tell- Matthew-- congrats-- for me. Hope-- to see- all of you- soon." -** Processing line: ~ end~ + def a_star_mouse_over_wall? +** Processing line: ~ grid.walls.each_key do | wall |~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + grid.walls.each_key do | wall | +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(a_star_scale_up(wall))~ - Inside source: true *** True Line Result - -** Processing line: ~ def replied_with_whole_truth args~ + return true if inputs.mouse.point.inside_rect?(a_star_scale_up(wall)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - def replied_with_whole_truth args -** Processing line: ~ {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + +** Processing line: ~ false~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 60,~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [32, 21],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - player: [32, 21], -** Processing line: ~ scenes: [[60, 0, 4, 32, :replied_to_anka_back_home]],~ + +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ - Inside source: true *** True Line Result - scenes: [[60, 0, 4, 32, :replied_to_anka_back_home]], -** Processing line: ~ storylines: [~ + # Signal that the user is going to be adding walls from the first grid +** Processing line: ~ def dijkstra_mouse_over_grid?~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: #{anka_reply_whole_truth.quote}"],~ + def dijkstra_mouse_over_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.rect))~ - Inside source: true *** True Line Result - [30, 18, 5, 12, "Buffer-- has been set to: #{anka_reply_whole_truth.quote}"], -** Processing line: ~ [30, 10, 5, 4, "I- hope- I- did the right- thing- by laying-- it all- out- there."],~ + inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.rect)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [30, 10, 5, 4, "I- hope- I- did the right- thing- by laying-- it all- out- there."], -** Processing line: ~ ]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + +** Processing line: ~ # Signal that the user is going to be adding walls from the second grid~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + # Signal that the user is going to be adding walls from the second grid +** Processing line: ~ def greedy_mouse_over_grid?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def greedy_mouse_over_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(greedy_scale_up(grid.rect))~ - Inside source: true *** True Line Result - -** Processing line: ~ def replied_with_half_truth args~ + inputs.mouse.point.inside_rect?(greedy_scale_up(grid.rect)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - def replied_with_half_truth args -** Processing line: ~ {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + +** Processing line: ~ # Signal that the user is going to be adding walls from the third grid~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 60,~ + # Signal that the user is going to be adding walls from the third grid +** Processing line: ~ def a_star_mouse_over_grid?~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [32, 21],~ + def a_star_mouse_over_grid? +** Processing line: ~ inputs.mouse.point.inside_rect?(a_star_scale_up(grid.rect))~ - Inside source: true *** True Line Result - player: [32, 21], -** Processing line: ~ scenes: [[60, 0, 4, 32, :replied_to_anka_back_home]],~ + inputs.mouse.point.inside_rect?(a_star_scale_up(grid.rect)) +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [[60, 0, 4, 32, :replied_to_anka_back_home]], -** Processing line: ~ storylines: [~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: #{anka_reply_half_truth.quote}"],~ + +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ - Inside source: true *** True Line Result - [30, 18, 5, 12, "Buffer-- has been set to: #{anka_reply_half_truth.quote}"], -** Processing line: ~ [30, 10, 5, 4, "I- hope- I- did the right- thing- by not giving-- them- the whole- truth."],~ + # Moves the star to the cell closest to the mouse in the first grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - [30, 10, 5, 4, "I- hope- I- did the right- thing- by not giving-- them- the whole- truth."], -** Processing line: ~ ]~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def process_input_dijkstra_star~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + def process_input_dijkstra_star +** Processing line: ~ old_star = grid.star.clone~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + old_star = grid.star.clone +** Processing line: ~ unless dijkstra_cell_closest_to_mouse == grid.target~ - Inside source: true *** True Line Result - -** Processing line: ~ def anka_current_reply args~ + unless dijkstra_cell_closest_to_mouse == grid.target +** Processing line: ~ grid.star = dijkstra_cell_closest_to_mouse~ - Inside source: true *** True Line Result - def anka_current_reply args -** Processing line: ~ if args.state.scene_history.include? :replied_to_serenity_alive_firmly~ + grid.star = dijkstra_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - if args.state.scene_history.include? :replied_to_serenity_alive_firmly -** Processing line: ~ return "Hello. This is, Aanka. Sasha-- is still- trying-- to gather-- her wits about-- her, given- the gravity--- of your- last- reply. Thank- you- for being-- honest, and thank- you- for the help- with the ship- diagnostics. I was able-- to retrieve-- all of the navigation--- information---- after-- the battery--- swap. We- are ready-- to head back to Earth. Before-- we go- back- into-- statis, Matthew--- wanted-- to know- how his- wife- is doing. Please- reply-- as soon- as you can. He's-- not going-- to get- into-- the statis-- chamber-- until-- he knows- his wife is okay."~ + end +** Processing line: ~ unless old_star == grid.star~ - Inside source: true *** True Line Result - return "Hello. This is, Aanka. Sasha-- is still- trying-- to gather-- her wits about-- her, given- the gravity--- of your- last- reply. Thank- you- for being-- honest, and thank- you- for the help- with the ship- diagnostics. I was able-- to retrieve-- all of the navigation--- information---- after-- the battery--- swap. We- are ready-- to head back to Earth. Before-- we go- back- into-- statis, Matthew--- wanted-- to know- how his- wife- is doing. Please- reply-- as soon- as you can. He's-- not going-- to get- into-- the statis-- chamber-- until-- he knows- his wife is okay." -** Processing line: ~ else~ + unless old_star == grid.star +** Processing line: ~ reset_searches~ - Inside source: true *** True Line Result - else -** Processing line: ~ return "Hello. This is, Aanka. Thank- you for the help- with the ship's-- diagnostics. I was able-- to retrieve-- all of the navigation--- information--- after-- the battery-- swap. I- know-- that- you didn't-- tell- the whole truth- about-- how far we are from- Earth. Don't-- worry. I understand-- why you did it. We- are ready-- to head back to Earth. Before-- we go- back- into-- statis, Matthew--- wanted-- to know- how his- wife- is doing. Please- reply-- as soon- as you can. He's-- not going-- to get- into-- the statis-- chamber-- until-- he knows- his wife is okay."~ + reset_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - return "Hello. This is, Aanka. Thank- you for the help- with the ship's-- diagnostics. I was able-- to retrieve-- all of the navigation--- information--- after-- the battery-- swap. I- know-- that- you didn't-- tell- the whole truth- about-- how far we are from- Earth. Don't-- worry. I understand-- why you did it. We- are ready-- to head back to Earth. Before-- we go- back- into-- statis, Matthew--- wanted-- to know- how his- wife- is doing. Please- reply-- as soon- as you can. He's-- not going-- to get- into-- the statis-- chamber-- until-- he knows- his wife is okay." + 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 replied_to_anka_back_home args~ -- Inside source: true -*** True Line Result - def replied_to_anka_back_home args -** Processing line: ~ if args.state.scene_history.include? :replied_with_whole_truth~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the second grid~ - Inside source: true *** True Line Result - if args.state.scene_history.include? :replied_with_whole_truth -** Processing line: ~ return {~ + # Moves the star to the cell closest to the mouse in the second grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - return { -** Processing line: ~ fade: 60,~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/inside-home.png',~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def process_input_greedy_star~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [34, 4],~ + def process_input_greedy_star +** Processing line: ~ old_star = grid.star.clone~ - Inside source: true *** True Line Result - player: [34, 4], -** Processing line: ~ storylines: [~ + old_star = grid.star.clone +** Processing line: ~ unless greedy_cell_closest_to_mouse == grid.target~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [34, 4, 4, 4, "I- hope-- this pit in my stomach-- is gone-- by tomorrow---."],~ + unless greedy_cell_closest_to_mouse == grid.target +** Processing line: ~ grid.star = greedy_cell_closest_to_mouse~ - Inside source: true *** True Line Result - [34, 4, 4, 4, "I- hope-- this pit in my stomach-- is gone-- by tomorrow---."], -** Processing line: ~ ],~ + grid.star = greedy_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + end +** Processing line: ~ unless old_star == grid.star~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 38, 12, 13, :final_message_sad],~ + unless old_star == grid.star +** Processing line: ~ reset_searches~ - Inside source: true *** True Line Result - [30, 38, 12, 13, :final_message_sad], -** Processing line: ~ ]~ + reset_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ return {~ + +** Processing line: ~ # Moves the star to the cell closest to the mouse in the third grid~ - Inside source: true *** True Line Result - return { -** Processing line: ~ fade: 60,~ + # Moves the star to the cell closest to the mouse in the third grid +** Processing line: ~ # Only resets the search if the star changes position~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/inside-home.png',~ + # Only resets the search if the star changes position +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [34, 4],~ + # Called whenever the user is editing the star (puts mouse down on star) +** Processing line: ~ def process_input_a_star_star~ - Inside source: true *** True Line Result - player: [34, 4], -** Processing line: ~ storylines: [~ + def process_input_a_star_star +** Processing line: ~ old_star = grid.star.clone~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [34, 4, 4, 4, "I- get the feeling-- I'm going-- to sleep real well tonight--."],~ + old_star = grid.star.clone +** Processing line: ~ unless a_star_cell_closest_to_mouse == grid.target~ - Inside source: true *** True Line Result - [34, 4, 4, 4, "I- get the feeling-- I'm going-- to sleep real well tonight--."], -** Processing line: ~ ],~ + unless a_star_cell_closest_to_mouse == grid.target +** Processing line: ~ grid.star = a_star_cell_closest_to_mouse~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + grid.star = a_star_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 38, 12, 13, :final_message_happy],~ + end +** Processing line: ~ unless old_star == grid.star~ - Inside source: true *** True Line Result - [30, 38, 12, 13, :final_message_happy], -** Processing line: ~ ]~ + unless old_star == grid.star +** Processing line: ~ reset_searches~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + reset_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. -*** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb~ -- Header detected. -*** True Line Result - +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ +- Inside source: true *** True Line Result -* Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # Moves the target to the grid closest to the mouse in the first grid +** Processing line: ~ # Only reset_searchess the search if the target changes position~ +- Inside source: true *** True Line Result - + # Only reset_searchess the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_blinking_light.rb~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def process_input_dijkstra_target~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_blinking_light.rb -** Processing line: ~ def the_blinking_light args~ + def process_input_dijkstra_target +** Processing line: ~ old_target = grid.target.clone~ - Inside source: true *** True Line Result - def the_blinking_light args -** Processing line: ~ {~ + old_target = grid.target.clone +** Processing line: ~ unless dijkstra_cell_closest_to_mouse == grid.star~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 60,~ + unless dijkstra_cell_closest_to_mouse == grid.star +** Processing line: ~ grid.target = dijkstra_cell_closest_to_mouse~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/side-of-home.png',~ + grid.target = dijkstra_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - background: 'sprites/side-of-home.png', -** Processing line: ~ player: [16, 13],~ + end +** Processing line: ~ unless old_target == grid.target~ - Inside source: true *** True Line Result - player: [16, 13], -** Processing line: ~ scenes: [~ + unless old_target == grid.target +** Processing line: ~ reset_searches~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [52, 24, 11, 5, :blinking_light_mountain_pass],~ + reset_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - [52, 24, 11, 5, :blinking_light_mountain_pass], -** Processing line: ~ ],~ -- Inside source: true -*** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_side_of_home_render~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - render_override: :blinking_light_side_of_home_render -** Processing line: ~ }~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + +** Processing line: ~ # Moves the target to the cell closest to the mouse in the second grid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Moves the target to the cell closest to the mouse in the second grid +** Processing line: ~ # Only reset_searchess the search if the target changes position~ - Inside source: true *** True Line Result - -** Processing line: ~ def blinking_light_mountain_pass args~ + # Only reset_searchess the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ - Inside source: true *** True Line Result - def blinking_light_mountain_pass args -** Processing line: ~ {~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def process_input_greedy_target~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/mountain-pass-zoomed-out.png',~ + def process_input_greedy_target +** Processing line: ~ old_target = grid.target.clone~ - Inside source: true *** True Line Result - background: 'sprites/mountain-pass-zoomed-out.png', -** Processing line: ~ player: [4, 4],~ + old_target = grid.target.clone +** Processing line: ~ unless greedy_cell_closest_to_mouse == grid.star~ - Inside source: true *** True Line Result - player: [4, 4], -** Processing line: ~ scenes: [~ + unless greedy_cell_closest_to_mouse == grid.star +** Processing line: ~ grid.target = greedy_cell_closest_to_mouse~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [18, 47, 5, 5, :blinking_light_path_to_observatory]~ + grid.target = greedy_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - [18, 47, 5, 5, :blinking_light_path_to_observatory] -** Processing line: ~ ],~ + end +** Processing line: ~ unless old_target == grid.target~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_mountain_pass_render~ + unless old_target == grid.target +** Processing line: ~ reset_searches~ - Inside source: true *** True Line Result - render_override: :blinking_light_mountain_pass_render -** Processing line: ~ }~ + reset_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def blinking_light_path_to_observatory args~ +** Processing line: ~ # Moves the target to the cell closest to the mouse in the third grid~ - Inside source: true *** True Line Result - def blinking_light_path_to_observatory args -** Processing line: ~ {~ + # Moves the target to the cell closest to the mouse in the third grid +** Processing line: ~ # Only reset_searchess the search if the target changes position~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/path-to-observatory.png',~ + # Only reset_searchess the search if the target changes position +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ - Inside source: true *** True Line Result - background: 'sprites/path-to-observatory.png', -** Processing line: ~ player: [60, 4],~ + # Called whenever the user is editing the target (puts mouse down on target) +** Processing line: ~ def process_input_a_star_target~ - Inside source: true *** True Line Result - player: [60, 4], -** Processing line: ~ scenes: [~ + def process_input_a_star_target +** Processing line: ~ old_target = grid.target.clone~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [0, 26, 5, 5, :blinking_light_observatory]~ + old_target = grid.target.clone +** Processing line: ~ unless a_star_cell_closest_to_mouse == grid.star~ - Inside source: true *** True Line Result - [0, 26, 5, 5, :blinking_light_observatory] -** Processing line: ~ ],~ + unless a_star_cell_closest_to_mouse == grid.star +** Processing line: ~ grid.target = a_star_cell_closest_to_mouse~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_path_to_observatory_render~ + grid.target = a_star_cell_closest_to_mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - render_override: :blinking_light_path_to_observatory_render -** Processing line: ~ }~ + end +** Processing line: ~ unless old_target == grid.target~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + unless old_target == grid.target +** Processing line: ~ reset_searches~ - Inside source: true *** True Line Result - end + reset_searches +** 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 blinking_light_observatory args~ +** Processing line: ~ # Removes walls in the first grid that are under the cursor~ - Inside source: true *** True Line Result - def blinking_light_observatory args -** Processing line: ~ {~ + # Removes walls in the first grid that are under the cursor +** Processing line: ~ def process_input_dijkstra_remove_wall~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/observatory.png',~ + def process_input_dijkstra_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - background: 'sprites/observatory.png', -** Processing line: ~ player: [60, 2],~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - player: [60, 2], -** Processing line: ~ scenes: [~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [28, 39, 4, 10, :blinking_light_inside_observatory]~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if dijkstra_mouse_over_grid?~ - Inside source: true *** True Line Result - [28, 39, 4, 10, :blinking_light_inside_observatory] -** Processing line: ~ ],~ + if dijkstra_mouse_over_grid? +** Processing line: ~ if grid.walls.has_key?(dijkstra_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_observatory_render~ + if grid.walls.has_key?(dijkstra_cell_closest_to_mouse) +** Processing line: ~ grid.walls.delete(dijkstra_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - render_override: :blinking_light_observatory_render -** Processing line: ~ }~ + grid.walls.delete(dijkstra_cell_closest_to_mouse) +** Processing line: ~ reset_searches~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + reset_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def blinking_light_inside_observatory args~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - def blinking_light_inside_observatory args -** Processing line: ~ {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + +** Processing line: ~ # Removes walls in the second grid that are under the cursor~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ player: [60, 2],~ + # Removes walls in the second grid that are under the cursor +** Processing line: ~ def process_input_greedy_remove_wall~ - Inside source: true *** True Line Result - player: [60, 2], -** Processing line: ~ storylines: [~ + def process_input_greedy_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [50, 2, 4, 8, "That's weird. I thought- this- mainframe-- was broken--."]~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - [50, 2, 4, 8, "That's weird. I thought- this- mainframe-- was broken--."] -** Processing line: ~ ],~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if greedy_mouse_over_grid?~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 18, 5, 12, :blinking_light_inside_mainframe]~ + if greedy_mouse_over_grid? +** Processing line: ~ if grid.walls.has_key?(greedy_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - [30, 18, 5, 12, :blinking_light_inside_mainframe] -** Processing line: ~ ],~ + if grid.walls.has_key?(greedy_cell_closest_to_mouse) +** Processing line: ~ grid.walls.delete(greedy_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ + grid.walls.delete(greedy_cell_closest_to_mouse) +** Processing line: ~ reset_searches~ - Inside source: true *** True Line Result - render_override: :blinking_light_inside_observatory_render -** Processing line: ~ }~ + reset_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def blinking_light_inside_mainframe args~ +** Processing line: ~ # Removes walls in the third grid that are under the cursor~ - Inside source: true *** True Line Result - def blinking_light_inside_mainframe args -** Processing line: ~ {~ + # Removes walls in the third grid that are under the cursor +** Processing line: ~ def process_input_a_star_remove_wall~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/mainframe.png',~ + def process_input_a_star_remove_wall +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ - Inside source: true *** True Line Result - background: 'sprites/mainframe.png', -** Processing line: ~ fade: 60,~ + # The mouse needs to be inside the grid, because we only want to remove walls +** Processing line: ~ # the cursor is directly over~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [30, 4],~ + # the cursor is directly over +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ - Inside source: true *** True Line Result - player: [30, 4], -** Processing line: ~ scenes: [~ + # Recalculations should only occur when a wall is actually deleted +** Processing line: ~ if a_star_mouse_over_grid?~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [62, 32, 4, 32, :reply_to_introduction]~ + if a_star_mouse_over_grid? +** Processing line: ~ if grid.walls.has_key?(a_star_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - [62, 32, 4, 32, :reply_to_introduction] -** Processing line: ~ ],~ + if grid.walls.has_key?(a_star_cell_closest_to_mouse) +** Processing line: ~ grid.walls.delete(a_star_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + grid.walls.delete(a_star_cell_closest_to_mouse) +** Processing line: ~ reset_searches~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [43, 43, 8, 8, "\"Mission-- control--, your- main- comm-- channels-- seem-- to be down. My apologies-- for- using-- this low- level-- exploit--. What's-- going-- on down there? We are ready-- for reentry--.\" Message--- Timestamp---: 4- hours-- 23--- minutes-- ago--."],~ + reset_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - [43, 43, 8, 8, "\"Mission-- control--, your- main- comm-- channels-- seem-- to be down. My apologies-- for- using-- this low- level-- exploit--. What's-- going-- on down there? We are ready-- for reentry--.\" Message--- Timestamp---: 4- hours-- 23--- minutes-- ago--."], -** Processing line: ~ [30, 30, 4, 4, "There's-- a low- level-- message-- here... NANI.T.F?"],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [30, 30, 4, 4, "There's-- a low- level-- message-- here... NANI.T.F?"], -** Processing line: ~ [14, 10, 24, 4, "Oh interesting---. This transistor--- needed-- to be activated--- for the- mainframe-- to work."],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [14, 10, 24, 4, "Oh interesting---. This transistor--- needed-- to be activated--- for the- mainframe-- to work."], -** Processing line: ~ [14, 20, 24, 4, "What the heck activated--- this thing- though?"]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [14, 20, 24, 4, "What the heck activated--- this thing- though?"] -** Processing line: ~ ]~ + +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + # Adds a wall in the first grid in the cell the mouse is over +** Processing line: ~ def process_input_dijkstra_add_wall~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + def process_input_dijkstra_add_wall +** Processing line: ~ if dijkstra_mouse_over_grid?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if dijkstra_mouse_over_grid? +** Processing line: ~ unless grid.walls.has_key?(dijkstra_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + unless grid.walls.has_key?(dijkstra_cell_closest_to_mouse) +** Processing line: ~ grid.walls[dijkstra_cell_closest_to_mouse] = true~ +- Inside source: true *** True Line Result -#+end_src + grid.walls[dijkstra_cell_closest_to_mouse] = true +** Processing line: ~ reset_searches~ +- Inside source: true +*** True Line Result + reset_searches +** 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 of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_day_one.rb~ -- Header detected. +** Processing line: ~ # Adds a wall in the second grid in the cell the mouse is over~ +- Inside source: true *** True Line Result - + # Adds a wall in the second grid in the cell the mouse is over +** Processing line: ~ def process_input_greedy_add_wall~ +- Inside source: true *** True Line Result -* Rpg Narrative - Return Of Serenity - storyline_day_one.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + def process_input_greedy_add_wall +** Processing line: ~ if greedy_mouse_over_grid?~ +- Inside source: true *** True Line Result - + if greedy_mouse_over_grid? +** Processing line: ~ unless grid.walls.has_key?(greedy_cell_closest_to_mouse)~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_day_one.rb~ + unless grid.walls.has_key?(greedy_cell_closest_to_mouse) +** Processing line: ~ grid.walls[greedy_cell_closest_to_mouse] = true~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_day_one.rb -** Processing line: ~ def day_one_beginning args~ + grid.walls[greedy_cell_closest_to_mouse] = true +** Processing line: ~ reset_searches~ - Inside source: true *** True Line Result - def day_one_beginning args -** Processing line: ~ {~ + reset_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/side-of-home.png',~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - background: 'sprites/side-of-home.png', -** Processing line: ~ player: [16, 13],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - player: [16, 13], -** Processing line: ~ scenes: [~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [0, 0, 64, 2, :day_one_infront_of_home],~ + +** Processing line: ~ # Adds a wall in the third grid in the cell the mouse is over~ - Inside source: true *** True Line Result - [0, 0, 64, 2, :day_one_infront_of_home], -** Processing line: ~ ],~ + # Adds a wall in the third grid in the cell the mouse is over +** Processing line: ~ def process_input_a_star_add_wall~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + def process_input_a_star_add_wall +** Processing line: ~ if a_star_mouse_over_grid?~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [35, 10, 6, 6, "Man. Hard to believe- that today- is the 20th--- anniversary-- of The Impact."]~ + if a_star_mouse_over_grid? +** Processing line: ~ unless grid.walls.has_key?(a_star_cell_closest_to_mouse)~ - Inside source: true *** True Line Result - [35, 10, 6, 6, "Man. Hard to believe- that today- is the 20th--- anniversary-- of The Impact."] -** Processing line: ~ ]~ + unless grid.walls.has_key?(a_star_cell_closest_to_mouse) +** Processing line: ~ grid.walls[a_star_cell_closest_to_mouse] = true~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + grid.walls[a_star_cell_closest_to_mouse] = true +** Processing line: ~ reset_searches~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + reset_searches +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def day_one_infront_of_home args~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - def day_one_infront_of_home args -** Processing line: ~ {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/front-of-home.png',~ + +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - background: 'sprites/front-of-home.png', -** Processing line: ~ player: [56, 23],~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - player: [56, 23], -** Processing line: ~ scenes: [~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [43, 34, 10, 16, :day_one_home],~ + # Finding the cell closest to the mouse helps with this +** Processing line: ~ def dijkstra_cell_closest_to_mouse~ - Inside source: true *** True Line Result - [43, 34, 10, 16, :day_one_home], -** Processing line: ~ [62, 0, 3, 40, :day_one_beginning],~ + def dijkstra_cell_closest_to_mouse +** Processing line: ~ # Closest cell to the mouse in the first grid~ - Inside source: true *** True Line Result - [62, 0, 3, 40, :day_one_beginning], -** Processing line: ~ [0, 4, 3, 20, :day_one_ceremony]~ + # Closest cell to the mouse in the first grid +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - [0, 4, 3, 20, :day_one_ceremony] -** Processing line: ~ ],~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Bound x and y to the grid~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [40, 20, 4, 4, "It looks like everyone- is already- at the rememberance-- ceremony."],~ + # Bound x and y to the grid +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - [40, 20, 4, 4, "It looks like everyone- is already- at the rememberance-- ceremony."], -** Processing line: ~ ]~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def day_one_home args~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def day_one_home args -** Processing line: ~ {~ + +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-home.png',~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [34, 3],~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse in the second grid helps with this~ - Inside source: true *** True Line Result - player: [34, 3], -** Processing line: ~ scenes: [~ + # Finding the cell closest to the mouse in the second grid helps with this +** Processing line: ~ def greedy_cell_closest_to_mouse~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [28, 0, 12, 2, :day_one_infront_of_home]~ + def greedy_cell_closest_to_mouse +** Processing line: ~ # Closest cell grid to the mouse in the second~ - Inside source: true *** True Line Result - [28, 0, 12, 2, :day_one_infront_of_home] -** Processing line: ~ ],~ + # Closest cell grid to the mouse in the second +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Translate the cell to the first grid~ - Inside source: true *** True Line Result - [ -** Processing line: ~ 38, 4, 4, 4, "My mansion- in all its glory! Okay yea, it's just a shipping- container-. Apparently-, it's nothing- like the luxuries- of the 2040's. But it's- all we have- in- this day and age. And it'll suffice."~ + # Translate the cell to the first grid +** Processing line: ~ x -= grid.width + 1~ - Inside source: true *** True Line Result - 38, 4, 4, 4, "My mansion- in all its glory! Okay yea, it's just a shipping- container-. Apparently-, it's nothing- like the luxuries- of the 2040's. But it's- all we have- in- this day and age. And it'll suffice." -** Processing line: ~ ],~ + x -= grid.width + 1 +** Processing line: ~ # Bound x and y to the first grid~ - Inside source: true *** True Line Result - ], -** Processing line: ~ [~ + # Bound x and y to the first grid +** Processing line: ~ x = 0 if x < 0~ - Inside source: true *** True Line Result - [ -** Processing line: ~ 28, 7, 4, 7,~ + x = 0 if x < 0 +** Processing line: ~ y = 0 if y < 0~ - Inside source: true *** True Line Result - 28, 7, 4, 7, -** Processing line: ~ "Ahhh. My reading- couch. It's so comfortable--."~ + y = 0 if y < 0 +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - "Ahhh. My reading- couch. It's so comfortable--." -** Processing line: ~ ],~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - ], -** Processing line: ~ [~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - [ -** Processing line: ~ 38, 21, 4, 4,~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - 38, 21, 4, 4, -** Processing line: ~ "I'm- lucky- to have a computer--. I'm- one of the few people- with- the skills to put this- thing to good use."~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - "I'm- lucky- to have a computer--. I'm- one of the few people- with- the skills to put this- thing to good use." -** Processing line: ~ ],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - ], -** Processing line: ~ [~ + +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ - Inside source: true *** True Line Result - [ -** Processing line: ~ 45, 37, 4, 8,~ + # When the user grabs the star and puts their cursor to the far right +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ - Inside source: true *** True Line Result - 45, 37, 4, 8, -** Processing line: ~ "This corner- of my home- is always- warmer-. It's cause of the ref~lected-- light- from the solar-- panels--, just on the other- side- of this wall. It's hard- to believe- there was o~nce-- an unlimited- amount- of electricity--."~ + # and moves up and down, the star is supposed to move along the grid as well +** Processing line: ~ # Finding the cell closest to the mouse in the third grid helps with this~ - Inside source: true *** True Line Result - "This corner- of my home- is always- warmer-. It's cause of the ref~lected-- light- from the solar-- panels--, just on the other- side- of this wall. It's hard- to believe- there was o~nce-- an unlimited- amount- of electricity--." -** Processing line: ~ ],~ + # Finding the cell closest to the mouse in the third grid helps with this +** Processing line: ~ def a_star_cell_closest_to_mouse~ - Inside source: true *** True Line Result - ], -** Processing line: ~ [~ + def a_star_cell_closest_to_mouse +** Processing line: ~ # Closest cell grid to the mouse in the second~ - Inside source: true *** True Line Result - [ -** Processing line: ~ 32, 40, 8, 10,~ + # Closest cell grid to the mouse in the second +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ - Inside source: true *** True Line Result - 32, 40, 8, 10, -** Processing line: ~ "This isn't- a good time- to sleep. I- should probably- head to the ceremony-."~ + x = (inputs.mouse.point.x / grid.cell_size).to_i +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ - Inside source: true *** True Line Result - "This isn't- a good time- to sleep. I- should probably- head to the ceremony-." -** Processing line: ~ ],~ + y = (inputs.mouse.point.y / grid.cell_size).to_i +** Processing line: ~ # Translate the cell to the first grid~ - Inside source: true *** True Line Result - ], -** Processing line: ~ [~ + # Translate the cell to the first grid +** Processing line: ~ x -= (grid.width + 1) * 2~ - Inside source: true *** True Line Result - [ -** Processing line: ~ 25, 21, 5, 12,~ + x -= (grid.width + 1) * 2 +** Processing line: ~ # Bound x and y to the first grid~ - Inside source: true *** True Line Result - 25, 21, 5, 12, -** Processing line: ~ "Fifteen-- years- of computer-- science-- notes, neatly-- organized. Compiler--- Theory--, Linear--- Algebra---, Game-- Development---... Every-- subject-- imaginable--."~ + # Bound x and y to the first grid +** Processing line: ~ x = 0 if x < 0~ - Inside source: true *** True Line Result - "Fifteen-- years- of computer-- science-- notes, neatly-- organized. Compiler--- Theory--, Linear--- Algebra---, Game-- Development---... Every-- subject-- imaginable--." -** Processing line: ~ ]~ + x = 0 if x < 0 +** Processing line: ~ y = 0 if y < 0~ - Inside source: true *** True Line Result - ] -** Processing line: ~ ]~ + y = 0 if y < 0 +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + x = grid.width - 1 if x > grid.width - 1 +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + y = grid.height - 1 if y > grid.height - 1 +** Processing line: ~ # Return closest cell~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Return closest cell +** Processing line: ~ [x, y]~ - Inside source: true *** True Line Result - -** Processing line: ~ def day_one_ceremony args~ + [x, y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - def day_one_ceremony args -** Processing line: ~ {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/tribute.png',~ + +** Processing line: ~ def reset_searches~ - Inside source: true *** True Line Result - background: 'sprites/tribute.png', -** Processing line: ~ player: [57, 21],~ + def reset_searches +** Processing line: ~ # Reset the searches~ - Inside source: true *** True Line Result - player: [57, 21], -** Processing line: ~ scenes: [~ + # Reset the searches +** Processing line: ~ dijkstra.came_from = {}~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [62, 0, 2, 40, :day_one_infront_of_home],~ + dijkstra.came_from = {} +** Processing line: ~ dijkstra.cost_so_far = {}~ - Inside source: true *** True Line Result - [62, 0, 2, 40, :day_one_infront_of_home], -** Processing line: ~ [0, 24, 2, 40, :day_one_infront_of_library]~ + dijkstra.cost_so_far = {} +** Processing line: ~ dijkstra.frontier = []~ - Inside source: true *** True Line Result - [0, 24, 2, 40, :day_one_infront_of_library] -** Processing line: ~ ],~ + dijkstra.frontier = [] +** Processing line: ~ dijkstra.path = []~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + dijkstra.path = [] +** Processing line: ~~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [53, 12, 3, 8, "It's- been twenty- years since The Impact. Twenty- years, since Halley's-- Comet-- set Earth's- blue- sky on fire."],~ + +** Processing line: ~ greedy.came_from = {}~ - Inside source: true *** True Line Result - [53, 12, 3, 8, "It's- been twenty- years since The Impact. Twenty- years, since Halley's-- Comet-- set Earth's- blue- sky on fire."], -** Processing line: ~ [45, 12, 3, 8, "The space mission- sent to prevent- Earth's- total- destruction--, was a success. Only- 99.9%------ of the world's- population-- died-- that day. Hey, it's- better-- than 100%---- of humanity-- dying."],~ + greedy.came_from = {} +** Processing line: ~ greedy.frontier = []~ - Inside source: true *** True Line Result - [45, 12, 3, 8, "The space mission- sent to prevent- Earth's- total- destruction--, was a success. Only- 99.9%------ of the world's- population-- died-- that day. Hey, it's- better-- than 100%---- of humanity-- dying."], -** Processing line: ~ [20, 12, 23, 4, "The monument--- reads:---- Here- stands- the tribute-- to Space- Mission-- Serenity--- and- its- crew. You- have- given-- humanity--- a second-- chance."],~ + greedy.frontier = [] +** Processing line: ~ greedy.path = []~ - Inside source: true *** True Line Result - [20, 12, 23, 4, "The monument--- reads:---- Here- stands- the tribute-- to Space- Mission-- Serenity--- and- its- crew. You- have- given-- humanity--- a second-- chance."], -** Processing line: ~ [15, 12, 3, 8, "Rest- in- peace--- Matthew----, Sasha----, Aanka----"],~ + greedy.path = [] +** Processing line: ~ a_star.came_from = {}~ - Inside source: true *** True Line Result - [15, 12, 3, 8, "Rest- in- peace--- Matthew----, Sasha----, Aanka----"], -** Processing line: ~ ]~ + a_star.came_from = {} +** Processing line: ~ a_star.frontier = []~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + a_star.frontier = [] +** Processing line: ~ a_star.path = []~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + a_star.path = [] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def day_one_infront_of_library args~ +** Processing line: ~ def calc_searches~ - Inside source: true *** True Line Result - def day_one_infront_of_library args -** Processing line: ~ {~ + def calc_searches +** Processing line: ~ calc_dijkstra~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/outside-library.png',~ + calc_dijkstra +** Processing line: ~ calc_greedy~ - Inside source: true *** True Line Result - background: 'sprites/outside-library.png', -** Processing line: ~ player: [57, 21],~ + calc_greedy +** Processing line: ~ calc_a_star~ - Inside source: true *** True Line Result - player: [57, 21], -** Processing line: ~ scenes: [~ + calc_a_star +** Processing line: ~ # Move the searches forward to the current step~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [62, 0, 2, 40, :day_one_ceremony],~ + # Move the searches forward to the current step +** Processing line: ~ # state.current_step.times { move_searches_one_step_forward }~ - Inside source: true *** True Line Result - [62, 0, 2, 40, :day_one_ceremony], -** Processing line: ~ [49, 39, 6, 9, :day_one_library]~ + # state.current_step.times { move_searches_one_step_forward } +** Processing line: ~ end~ - Inside source: true *** True Line Result - [49, 39, 6, 9, :day_one_library] -** Processing line: ~ ],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + +** Processing line: ~ def calc_dijkstra~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [50, 20, 4, 8, "Shipping- containers-- as far- as the eye- can see. It's- rather- beautiful-- if you ask me. Even- though-- this- view- represents-- all- that's-- left- of humanity-."]~ + def calc_dijkstra +** Processing line: ~ # Sets up the search to begin from the star~ - Inside source: true *** True Line Result - [50, 20, 4, 8, "Shipping- containers-- as far- as the eye- can see. It's- rather- beautiful-- if you ask me. Even- though-- this- view- represents-- all- that's-- left- of humanity-."] -** Processing line: ~ ]~ + # Sets up the search to begin from the star +** Processing line: ~ dijkstra.frontier << grid.star~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + dijkstra.frontier << grid.star +** Processing line: ~ dijkstra.came_from[grid.star] = nil~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + dijkstra.came_from[grid.star] = nil +** Processing line: ~ dijkstra.cost_so_far[grid.star] = 0~ - Inside source: true *** True Line Result - end + dijkstra.cost_so_far[grid.star] = 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def day_one_library args~ +** Processing line: ~ # Until the target is found or there are no more cells to explore from~ - Inside source: true *** True Line Result - def day_one_library args -** Processing line: ~ {~ + # Until the target is found or there are no more cells to explore from +** Processing line: ~ until dijkstra.came_from.has_key?(grid.target) or dijkstra.frontier.empty?~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/library.png',~ + until dijkstra.came_from.has_key?(grid.target) or dijkstra.frontier.empty? +** Processing line: ~ # Take the next frontier cell. The first element is the cell, the second is the priority.~ - Inside source: true *** True Line Result - background: 'sprites/library.png', -** Processing line: ~ player: [27, 4],~ + # Take the next frontier cell. The first element is the cell, the second is the priority. +** Processing line: ~ new_frontier = dijkstra.frontier.shift#[0]~ - Inside source: true *** True Line Result - player: [27, 4], -** Processing line: ~ scenes: [~ + new_frontier = dijkstra.frontier.shift#[0] +** Processing line: ~ # For each of its neighbors~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [0, 0, 64, 2, :end_day_one_infront_of_library]~ + # For each of its neighbors +** Processing line: ~ adjacent_neighbors(new_frontier).each do | neighbor |~ - Inside source: true *** True Line Result - [0, 0, 64, 2, :end_day_one_infront_of_library] -** Processing line: ~ ],~ + adjacent_neighbors(new_frontier).each do | neighbor | +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + # That have not been visited and are not walls +** Processing line: ~ unless dijkstra.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [28, 22, 8, 4, "I grew- up- in this library. I've- read every- book- here. My favorites-- were- of course-- anything- computer-- related."],~ + unless dijkstra.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited~ - Inside source: true *** True Line Result - [28, 22, 8, 4, "I grew- up- in this library. I've- read every- book- here. My favorites-- were- of course-- anything- computer-- related."], -** Processing line: ~ [6, 32, 10, 6, "My favorite-- area--- of the library. The Science-- Section."]~ + # Add them to the frontier and mark them as visited +** Processing line: ~ dijkstra.frontier << neighbor~ - Inside source: true *** True Line Result - [6, 32, 10, 6, "My favorite-- area--- of the library. The Science-- Section."] -** Processing line: ~ ]~ + dijkstra.frontier << neighbor +** Processing line: ~ dijkstra.came_from[neighbor] = new_frontier~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + dijkstra.came_from[neighbor] = new_frontier +** Processing line: ~ dijkstra.cost_so_far[neighbor] = dijkstra.cost_so_far[new_frontier] + 1~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + dijkstra.cost_so_far[neighbor] = dijkstra.cost_so_far[new_frontier] + 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def end_day_one_infront_of_library args~ +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ - Inside source: true *** True Line Result - def end_day_one_infront_of_library args -** Processing line: ~ {~ + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line +** Processing line: ~ # Comment this line and let a path generate to see the difference~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/outside-library.png',~ + # Comment this line and let a path generate to see the difference +** Processing line: ~ dijkstra.frontier = dijkstra.frontier.sort_by {| cell | proximity_to_star(cell) }~ - Inside source: true *** True Line Result - background: 'sprites/outside-library.png', -** Processing line: ~ player: [51, 33],~ + dijkstra.frontier = dijkstra.frontier.sort_by {| cell | proximity_to_star(cell) } +** Processing line: ~ dijkstra.frontier = dijkstra.frontier.sort_by {| cell | dijkstra.cost_so_far[cell] }~ - Inside source: true *** True Line Result - player: [51, 33], -** Processing line: ~ scenes: [~ + dijkstra.frontier = dijkstra.frontier.sort_by {| cell | dijkstra.cost_so_far[cell] } +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [49, 39, 6, 9, :day_one_library],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [49, 39, 6, 9, :day_one_library], -** Processing line: ~ [62, 0, 2, 40, :end_day_one_monument],~ + +** Processing line: ~~ - Inside source: true *** True Line Result - [62, 0, 2, 40, :end_day_one_monument], -** Processing line: ~ ],~ + +** Processing line: ~ # If the search found the target~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + # If the search found the target +** Processing line: ~ if dijkstra.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [50, 27, 4, 4, "It's getting late. Better get some sleep."]~ + if dijkstra.came_from.has_key?(grid.target) +** Processing line: ~ # Calculate the path between the target and star~ - Inside source: true *** True Line Result - [50, 27, 4, 4, "It's getting late. Better get some sleep."] -** Processing line: ~ ]~ + # Calculate the path between the target and star +** Processing line: ~ dijkstra_calc_path~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + dijkstra_calc_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def end_day_one_monument args~ +** Processing line: ~ def calc_greedy~ - Inside source: true *** True Line Result - def end_day_one_monument args -** Processing line: ~ {~ + def calc_greedy +** Processing line: ~ # Sets up the search to begin from the star~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/tribute.png',~ + # Sets up the search to begin from the star +** Processing line: ~ greedy.frontier << grid.star~ - Inside source: true *** True Line Result - background: 'sprites/tribute.png', -** Processing line: ~ player: [2, 36],~ + greedy.frontier << grid.star +** Processing line: ~ greedy.came_from[grid.star] = nil~ - Inside source: true *** True Line Result - player: [2, 36], -** Processing line: ~ scenes: [~ + greedy.came_from[grid.star] = nil +** Processing line: ~~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [62, 0, 2, 40, :end_day_one_infront_of_home],~ + +** Processing line: ~ # Until the target is found or there are no more cells to explore from~ - Inside source: true *** True Line Result - [62, 0, 2, 40, :end_day_one_infront_of_home], -** Processing line: ~ ],~ + # Until the target is found or there are no more cells to explore from +** Processing line: ~ until greedy.came_from.has_key?(grid.target) or greedy.frontier.empty?~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + until greedy.came_from.has_key?(grid.target) or greedy.frontier.empty? +** Processing line: ~ # Take the next frontier cell~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [50, 27, 4, 4, "It's getting late. Better get some sleep."],~ + # Take the next frontier cell +** Processing line: ~ new_frontier = greedy.frontier.shift~ - Inside source: true *** True Line Result - [50, 27, 4, 4, "It's getting late. Better get some sleep."], -** Processing line: ~ ]~ + new_frontier = greedy.frontier.shift +** Processing line: ~ # For each of its neighbors~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + # For each of its neighbors +** Processing line: ~ adjacent_neighbors(new_frontier).each do | neighbor |~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + adjacent_neighbors(new_frontier).each do | neighbor | +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # That have not been visited and are not walls +** Processing line: ~ unless greedy.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - -** Processing line: ~ def end_day_one_infront_of_home args~ + unless greedy.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited~ - Inside source: true *** True Line Result - def end_day_one_infront_of_home args -** Processing line: ~ {~ + # Add them to the frontier and mark them as visited +** Processing line: ~ greedy.frontier << neighbor~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/front-of-home.png',~ + greedy.frontier << neighbor +** Processing line: ~ greedy.came_from[neighbor] = new_frontier~ - Inside source: true *** True Line Result - background: 'sprites/front-of-home.png', -** Processing line: ~ player: [1, 17],~ + greedy.came_from[neighbor] = new_frontier +** Processing line: ~ end~ - Inside source: true *** True Line Result - player: [1, 17], -** Processing line: ~ scenes: [~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [43, 34, 10, 16, :end_day_one_home],~ + end +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ - Inside source: true *** True Line Result - [43, 34, 10, 16, :end_day_one_home], -** Processing line: ~ ],~ + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line +** Processing line: ~ # Comment this line and let a path generate to see the difference~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + # Comment this line and let a path generate to see the difference +** Processing line: ~ greedy.frontier = greedy.frontier.sort_by {| cell | proximity_to_star(cell) }~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [20, 10, 4, 4, "It's getting late. Better get some sleep."],~ + greedy.frontier = greedy.frontier.sort_by {| cell | proximity_to_star(cell) } +** Processing line: ~ # Sort the frontier so cells that are close to the target are then prioritized~ - Inside source: true *** True Line Result - [20, 10, 4, 4, "It's getting late. Better get some sleep."], -** Processing line: ~ ]~ + # Sort the frontier so cells that are close to the target are then prioritized +** Processing line: ~ greedy.frontier = greedy.frontier.sort_by {| cell | greedy_heuristic(cell) }~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + greedy.frontier = greedy.frontier.sort_by {| cell | greedy_heuristic(cell) } +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def end_day_one_home args~ +** Processing line: ~ # If the search found the target~ - Inside source: true *** True Line Result - def end_day_one_home args -** Processing line: ~ {~ + # If the search found the target +** Processing line: ~ if greedy.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-home.png',~ + if greedy.came_from.has_key?(grid.target) +** Processing line: ~ # Calculate the path between the target and star~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [34, 3],~ + # Calculate the path between the target and star +** Processing line: ~ greedy_calc_path~ - Inside source: true *** True Line Result - player: [34, 3], -** Processing line: ~ scenes: [~ + greedy_calc_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [32, 40, 8, 10, :end_day_one_dream],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [32, 40, 8, 10, :end_day_one_dream], -** Processing line: ~ ],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + +** Processing line: ~ def calc_a_star~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [38, 4, 4, 4, "It's getting late. Better get some sleep."],~ + def calc_a_star +** Processing line: ~ # Setup the search to start from the star~ - Inside source: true *** True Line Result - [38, 4, 4, 4, "It's getting late. Better get some sleep."], -** Processing line: ~ ]~ + # Setup the search to start from the star +** Processing line: ~ a_star.came_from[grid.star] = nil~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + a_star.came_from[grid.star] = nil +** Processing line: ~ a_star.cost_so_far[grid.star] = 0~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + a_star.cost_so_far[grid.star] = 0 +** Processing line: ~ a_star.frontier << grid.star~ - Inside source: true *** True Line Result - end + a_star.frontier << grid.star ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def end_day_one_dream args~ +** Processing line: ~ # Until there are no more cells to explore from or the search has found the target~ - Inside source: true *** True Line Result - def end_day_one_dream args -** Processing line: ~ {~ + # Until there are no more cells to explore from or the search has found the target +** Processing line: ~ until a_star.frontier.empty? or a_star.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/dream.png',~ + until a_star.frontier.empty? or a_star.came_from.has_key?(grid.target) +** Processing line: ~ # Get the next cell to expand from~ - Inside source: true *** True Line Result - background: 'sprites/dream.png', -** Processing line: ~ fade: 60,~ + # Get the next cell to expand from +** Processing line: ~ current_frontier = a_star.frontier.shift~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [4, 4],~ + current_frontier = a_star.frontier.shift +** Processing line: ~~ - Inside source: true *** True Line Result - player: [4, 4], -** Processing line: ~ scenes: [~ + +** Processing line: ~ # For each of that cells neighbors~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [62, 0, 2, 64, :explaining_the_special_power]~ + # For each of that cells neighbors +** Processing line: ~ adjacent_neighbors(current_frontier).each do | neighbor |~ - Inside source: true *** True Line Result - [62, 0, 2, 64, :explaining_the_special_power] -** Processing line: ~ ],~ + adjacent_neighbors(current_frontier).each do | neighbor | +** Processing line: ~ # That have not been visited and are not walls~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + # That have not been visited and are not walls +** Processing line: ~ unless a_star.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [10, 10, 4, 4, "Why- does this- moment-- always- haunt- my dreams?"],~ + unless a_star.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor) +** Processing line: ~ # Add them to the frontier and mark them as visited~ - Inside source: true *** True Line Result - [10, 10, 4, 4, "Why- does this- moment-- always- haunt- my dreams?"], -** Processing line: ~ [20, 10, 4, 4, "This kid- reads these computer--- science--- books- nonstop-. What's- wrong with him?"],~ + # Add them to the frontier and mark them as visited +** Processing line: ~ a_star.frontier << neighbor~ - Inside source: true *** True Line Result - [20, 10, 4, 4, "This kid- reads these computer--- science--- books- nonstop-. What's- wrong with him?"], -** Processing line: ~ [30, 10, 4, 4, "There- is nothing-- wrong- with him. This behavior-- should be encouraged---! In fact-, I think- he's- special---. Have- you seen- him use- a computer---? It's-- almost-- as if he can- speak-- to it."]~ + a_star.frontier << neighbor +** Processing line: ~ a_star.came_from[neighbor] = current_frontier~ - Inside source: true *** True Line Result - [30, 10, 4, 4, "There- is nothing-- wrong- with him. This behavior-- should be encouraged---! In fact-, I think- he's- special---. Have- you seen- him use- a computer---? It's-- almost-- as if he can- speak-- to it."] -** Processing line: ~ ]~ + a_star.came_from[neighbor] = current_frontier +** Processing line: ~ a_star.cost_so_far[neighbor] = a_star.cost_so_far[current_frontier] + 1~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + a_star.cost_so_far[neighbor] = a_star.cost_so_far[current_frontier] + 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def explaining_the_special_power args~ +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ - Inside source: true *** True Line Result - def explaining_the_special_power args -** Processing line: ~ {~ + # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line +** Processing line: ~ # Comment this line and let a path generate to see the difference~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 60,~ + # Comment this line and let a path generate to see the difference +** Processing line: ~ a_star.frontier = a_star.frontier.sort_by {| cell | proximity_to_star(cell) }~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/inside-home.png',~ + a_star.frontier = a_star.frontier.sort_by {| cell | proximity_to_star(cell) } +** Processing line: ~ a_star.frontier = a_star.frontier.sort_by {| cell | a_star.cost_so_far[cell] + greedy_heuristic(cell) }~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [32, 30],~ + a_star.frontier = a_star.frontier.sort_by {| cell | a_star.cost_so_far[cell] + greedy_heuristic(cell) } +** Processing line: ~ end~ - Inside source: true *** True Line Result - player: [32, 30], -** Processing line: ~ scenes: [~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [~ + +** Processing line: ~ # If the search found the target~ - Inside source: true *** True Line Result - [ -** Processing line: ~ 38, 21, 4, 4, :explaining_the_special_power_inside_computer~ + # If the search found the target +** Processing line: ~ if a_star.came_from.has_key?(grid.target)~ - Inside source: true *** True Line Result - 38, 21, 4, 4, :explaining_the_special_power_inside_computer -** Processing line: ~ ],~ + if a_star.came_from.has_key?(grid.target) +** Processing line: ~ # Calculate the path between the target and star~ - Inside source: true *** True Line Result - ], -** Processing line: ~ ]~ + # Calculate the path between the target and star +** Processing line: ~ a_star_calc_path~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + a_star_calc_path +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def explaining_the_special_power_inside_computer args~ +** Processing line: ~ # Calculates the path between the target and star for the breadth first search~ - Inside source: true *** True Line Result - def explaining_the_special_power_inside_computer args -** Processing line: ~ {~ + # Calculates the path between the target and star for the breadth first search +** Processing line: ~ # Only called when the breadth first search finds the target~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/pc.png',~ + # Only called when the breadth first search finds the target +** Processing line: ~ def dijkstra_calc_path~ - Inside source: true *** True Line Result - background: 'sprites/pc.png', -** Processing line: ~ fade: 60,~ + def dijkstra_calc_path +** Processing line: ~ # Start from the target~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [34, 4],~ + # Start from the target +** Processing line: ~ endpoint = grid.target~ - Inside source: true *** True Line Result - player: [34, 4], -** Processing line: ~ scenes: [~ + endpoint = grid.target +** Processing line: ~ # And the cell it came from~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [0, 62, 64, 3, :the_blinking_light]~ + # And the cell it came from +** Processing line: ~ next_endpoint = dijkstra.came_from[endpoint]~ - Inside source: true *** True Line Result - [0, 62, 64, 3, :the_blinking_light] -** Processing line: ~ ],~ + next_endpoint = dijkstra.came_from[endpoint] +** Processing line: ~ while endpoint and next_endpoint~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + while endpoint and next_endpoint +** Processing line: ~ # Draw a path between these two cells and store it~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [14, 20, 24, 4, "So... I have a special-- power--. I don't-- need a mouse-, keyboard--, or even-- a monitor--- to control-- a computer--."],~ + # Draw a path between these two cells and store it +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ - Inside source: true *** True Line Result - [14, 20, 24, 4, "So... I have a special-- power--. I don't-- need a mouse-, keyboard--, or even-- a monitor--- to control-- a computer--."], -** Processing line: ~ [14, 25, 24, 4, "I only-- pretend-- to use peripherals---, so as not- to freak- anyone--- out."],~ + path = get_path_between(endpoint, next_endpoint) +** Processing line: ~ dijkstra.path << path~ - Inside source: true *** True Line Result - [14, 25, 24, 4, "I only-- pretend-- to use peripherals---, so as not- to freak- anyone--- out."], -** Processing line: ~ [14, 30, 24, 4, "Inside-- this silicon--- Universe---, is the only-- place I- feel- at peace."],~ + dijkstra.path << path +** Processing line: ~ # And get the next pair of cells~ - Inside source: true *** True Line Result - [14, 30, 24, 4, "Inside-- this silicon--- Universe---, is the only-- place I- feel- at peace."], -** Processing line: ~ [14, 35, 24, 4, "It's-- the only-- place where I don't-- feel alone."]~ + # And get the next pair of cells +** Processing line: ~ endpoint = next_endpoint~ - Inside source: true *** True Line Result - [14, 35, 24, 4, "It's-- the only-- place where I don't-- feel alone."] -** Processing line: ~ ]~ + endpoint = next_endpoint +** Processing line: ~ next_endpoint = dijkstra.came_from[endpoint]~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + next_endpoint = dijkstra.came_from[endpoint] +** Processing line: ~ # Continue till there are no more cells~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + # Continue till there are no more cells +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ end~ - 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 + end ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_final_decision.rb~ -- Header detected. +** Processing line: ~ # Returns one-dimensional absolute distance between cell and target~ +- Inside source: true *** True Line Result - + # Returns one-dimensional absolute distance between cell and target +** Processing line: ~ # Returns a number to compare distances between cells and the target~ +- Inside source: true *** True Line Result -* Rpg Narrative - Return Of Serenity - storyline_final_decision.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # Returns a number to compare distances between cells and the target +** Processing line: ~ def greedy_heuristic(cell)~ +- Inside source: true *** True Line Result - + def greedy_heuristic(cell) +** Processing line: ~ (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_decision.rb~ + (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs +** Processing line: ~ end~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_decision.rb -** Processing line: ~ def final_decision_side_of_home args~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def final_decision_side_of_home args -** Processing line: ~ {~ + +** Processing line: ~ # Calculates the path between the target and star for the greedy search~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 120,~ + # Calculates the path between the target and star for the greedy search +** Processing line: ~ # Only called when the greedy search finds the target~ - Inside source: true *** True Line Result - fade: 120, -** Processing line: ~ background: 'sprites/side-of-home.png',~ + # Only called when the greedy search finds the target +** Processing line: ~ def greedy_calc_path~ - Inside source: true *** True Line Result - background: 'sprites/side-of-home.png', -** Processing line: ~ player: [16, 13],~ + def greedy_calc_path +** Processing line: ~ # Start from the target~ - Inside source: true *** True Line Result - player: [16, 13], -** Processing line: ~ scenes: [~ + # Start from the target +** Processing line: ~ endpoint = grid.target~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [52, 24, 11, 5, :final_decision_mountain_pass],~ + endpoint = grid.target +** Processing line: ~ # And the cell it came from~ - Inside source: true *** True Line Result - [52, 24, 11, 5, :final_decision_mountain_pass], -** Processing line: ~ ],~ + # And the cell it came from +** Processing line: ~ next_endpoint = greedy.came_from[endpoint]~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_side_of_home_render,~ + next_endpoint = greedy.came_from[endpoint] +** Processing line: ~ while endpoint and next_endpoint~ - Inside source: true *** True Line Result - render_override: :blinking_light_side_of_home_render, -** Processing line: ~ storylines: [~ + while endpoint and next_endpoint +** Processing line: ~ # Draw a path between these two cells and store it~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [28, 13, 8, 4, "Man. Hard to believe- that today- is the 21st--- anniversary-- of The Impact. Serenity--- will- be- home- soon."]~ + # Draw a path between these two cells and store it +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ - Inside source: true *** True Line Result - [28, 13, 8, 4, "Man. Hard to believe- that today- is the 21st--- anniversary-- of The Impact. Serenity--- will- be- home- soon."] -** Processing line: ~ ]~ + path = get_path_between(endpoint, next_endpoint) +** Processing line: ~ greedy.path << path~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + greedy.path << path +** Processing line: ~ # And get the next pair of cells~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + # And get the next pair of cells +** Processing line: ~ endpoint = next_endpoint~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + endpoint = next_endpoint +** Processing line: ~ next_endpoint = greedy.came_from[endpoint]~ - Inside source: true *** True Line Result - -** Processing line: ~ def final_decision_mountain_pass args~ + next_endpoint = greedy.came_from[endpoint] +** Processing line: ~ # Continue till there are no more cells~ - Inside source: true *** True Line Result - def final_decision_mountain_pass args -** Processing line: ~ {~ + # Continue till there are no more cells +** Processing line: ~ end~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/mountain-pass-zoomed-out.png',~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - background: 'sprites/mountain-pass-zoomed-out.png', -** Processing line: ~ player: [4, 4],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - player: [4, 4], -** Processing line: ~ scenes: [~ + +** Processing line: ~ # Calculates the path between the target and star for the a_star search~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [18, 47, 5, 5, :final_decision_path_to_observatory]~ + # Calculates the path between the target and star for the a_star search +** Processing line: ~ # Only called when the a_star search finds the target~ - Inside source: true *** True Line Result - [18, 47, 5, 5, :final_decision_path_to_observatory] -** Processing line: ~ ],~ + # Only called when the a_star search finds the target +** Processing line: ~ def a_star_calc_path~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_mountain_pass_render~ + def a_star_calc_path +** Processing line: ~ # Start from the target~ - Inside source: true *** True Line Result - render_override: :blinking_light_mountain_pass_render -** Processing line: ~ }~ + # Start from the target +** Processing line: ~ endpoint = grid.target~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + endpoint = grid.target +** Processing line: ~ # And the cell it came from~ - Inside source: true *** True Line Result - end + # And the cell it came from +** Processing line: ~ next_endpoint = a_star.came_from[endpoint]~ +- Inside source: true +*** True Line Result + next_endpoint = a_star.came_from[endpoint] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def final_decision_path_to_observatory args~ +** Processing line: ~ while endpoint and next_endpoint~ - Inside source: true *** True Line Result - def final_decision_path_to_observatory args -** Processing line: ~ {~ + while endpoint and next_endpoint +** Processing line: ~ # Draw a path between these two cells and store it~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/path-to-observatory.png',~ + # Draw a path between these two cells and store it +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ - Inside source: true *** True Line Result - background: 'sprites/path-to-observatory.png', -** Processing line: ~ player: [60, 4],~ + path = get_path_between(endpoint, next_endpoint) +** Processing line: ~ a_star.path << path~ - Inside source: true *** True Line Result - player: [60, 4], -** Processing line: ~ scenes: [~ + a_star.path << path +** Processing line: ~ # And get the next pair of cells~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [0, 26, 5, 5, :final_decision_observatory]~ + # And get the next pair of cells +** Processing line: ~ endpoint = next_endpoint~ - Inside source: true *** True Line Result - [0, 26, 5, 5, :final_decision_observatory] -** Processing line: ~ ],~ + endpoint = next_endpoint +** Processing line: ~ next_endpoint = a_star.came_from[endpoint]~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_path_to_observatory_render~ + next_endpoint = a_star.came_from[endpoint] +** Processing line: ~ # Continue till there are no more cells~ - Inside source: true *** True Line Result - render_override: :blinking_light_path_to_observatory_render -** Processing line: ~ }~ + # Continue till there are no more cells +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def final_decision_observatory args~ +** Processing line: ~ # Returns a list of adjacent cells~ - Inside source: true *** True Line Result - def final_decision_observatory args -** Processing line: ~ {~ + # Returns a list of adjacent cells +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/observatory.png',~ + # Used to determine what the next cells to be added to the frontier are +** Processing line: ~ def adjacent_neighbors(cell)~ - Inside source: true *** True Line Result - background: 'sprites/observatory.png', -** Processing line: ~ player: [60, 2],~ + def adjacent_neighbors(cell) +** Processing line: ~ neighbors = []~ - Inside source: true *** True Line Result - player: [60, 2], -** Processing line: ~ scenes: [~ + neighbors = [] +** Processing line: ~~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [28, 39, 4, 10, :final_decision_inside_observatory]~ + +** Processing line: ~ # Gets all the valid neighbors into the array~ - Inside source: true *** True Line Result - [28, 39, 4, 10, :final_decision_inside_observatory] -** Processing line: ~ ],~ + # Gets all the valid neighbors into the array +** Processing line: ~ # From southern neighbor, clockwise~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_observatory_render~ + # From southern neighbor, clockwise +** Processing line: ~ neighbors << [cell.x , cell.y - 1] unless cell.y == 0~ - Inside source: true *** True Line Result - render_override: :blinking_light_observatory_render -** Processing line: ~ }~ + neighbors << [cell.x , cell.y - 1] unless cell.y == 0 +** Processing line: ~ neighbors << [cell.x - 1, cell.y ] unless cell.x == 0~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + neighbors << [cell.x - 1, cell.y ] unless cell.x == 0 +** Processing line: ~ neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1~ - Inside source: true *** True Line Result - end + neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1 +** Processing line: ~ neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1~ +- Inside source: true +*** True Line Result + neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def final_decision_inside_observatory args~ +** Processing line: ~ neighbors~ - Inside source: true *** True Line Result - def final_decision_inside_observatory args -** Processing line: ~ {~ + neighbors +** Processing line: ~ end~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ player: [60, 2],~ + +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ - Inside source: true *** True Line Result - player: [60, 2], -** Processing line: ~ storylines: [],~ + # Finds the vertical and horizontal distance of a cell from the star +** Processing line: ~ # and returns the larger value~ - Inside source: true *** True Line Result - storylines: [], -** Processing line: ~ scenes: [~ + # and returns the larger value +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 18, 5, 12, :final_decision_inside_mainframe]~ + # This method is used to have a zigzag pattern in the rendered path +** Processing line: ~ # A cell that is [5, 5] from the star,~ - Inside source: true *** True Line Result - [30, 18, 5, 12, :final_decision_inside_mainframe] -** Processing line: ~ ],~ + # A cell that is [5, 5] from the star, +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ + # is explored before over a cell that is [0, 7] away. +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ - Inside source: true *** True Line Result - render_override: :blinking_light_inside_observatory_render -** Processing line: ~ }~ + # So, if possible, the search tries to go diagonal (zigzag) first +** Processing line: ~ def proximity_to_star(cell)~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + def proximity_to_star(cell) +** Processing line: ~ distance_x = (grid.star.x - cell.x).abs~ - Inside source: true *** True Line Result - end + distance_x = (grid.star.x - cell.x).abs +** Processing line: ~ distance_y = (grid.star.y - cell.y).abs~ +- Inside source: true +*** True Line Result + distance_y = (grid.star.y - cell.y).abs ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def final_decision_inside_mainframe args~ +** Processing line: ~ if distance_x > distance_y~ - Inside source: true *** True Line Result - def final_decision_inside_mainframe args -** Processing line: ~ {~ + if distance_x > distance_y +** Processing line: ~ return distance_x~ - Inside source: true *** True Line Result - { -** Processing line: ~ player: [32, 4],~ + return distance_x +** Processing line: ~ else~ - Inside source: true *** True Line Result - player: [32, 4], -** Processing line: ~ background: 'sprites/mainframe.png',~ + else +** Processing line: ~ return distance_y~ - Inside source: true *** True Line Result - background: 'sprites/mainframe.png', -** Processing line: ~ storylines: [],~ + return distance_y +** Processing line: ~ end~ - Inside source: true *** True Line Result - storylines: [], -** Processing line: ~ scenes: [~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_top, :final_decision_ship_status],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [*hotspot_top, :final_decision_ship_status], -** Processing line: ~ ]~ + +** Processing line: ~ # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored.~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored. +** Processing line: ~ def grid~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + def grid +** Processing line: ~ state.grid~ - Inside source: true *** True Line Result - end + state.grid +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def final_decision_ship_status args~ +** Processing line: ~ def dijkstra~ - Inside source: true *** True Line Result - def final_decision_ship_status args -** Processing line: ~ {~ + def dijkstra +** Processing line: ~ state.dijkstra~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/serenity.png',~ + state.dijkstra +** Processing line: ~ end~ - Inside source: true *** True Line Result - background: 'sprites/serenity.png', -** Processing line: ~ fade: 60,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [30, 10],~ + +** Processing line: ~ def greedy~ - Inside source: true *** True Line Result - player: [30, 10], -** Processing line: ~ scenes: [~ + def greedy +** Processing line: ~ state.greedy~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_top_right, :final_decision]~ + state.greedy +** Processing line: ~ end~ - Inside source: true *** True Line Result - [*hotspot_top_right, :final_decision] -** Processing line: ~ ],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + +** Processing line: ~ def a_star~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 8, 4, 4, "????"],~ + def a_star +** Processing line: ~ state.a_star~ - Inside source: true *** True Line Result - [30, 8, 4, 4, "????"], -** Processing line: ~ *final_decision_ship_status_shared(args)~ + state.a_star +** Processing line: ~ end~ - Inside source: true *** True Line Result - *final_decision_ship_status_shared(args) -** Processing line: ~ ]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + +** Processing line: ~ # Descriptive aliases for colors~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + # Descriptive aliases for colors +** Processing line: ~ def default_color~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def default_color +** Processing line: ~ [221, 212, 213] # Light Brown~ - Inside source: true *** True Line Result - -** Processing line: ~ def final_decision args~ + [221, 212, 213] # Light Brown +** Processing line: ~ end~ - Inside source: true *** True Line Result - def final_decision args -** Processing line: ~ decision_graph "Stasis-- Chambers--: UNDERPOWERED, Life- forms-- will be terminated---- unless-- equilibrium----- is reached.",~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - decision_graph "Stasis-- Chambers--: UNDERPOWERED, Life- forms-- will be terminated---- unless-- equilibrium----- is reached.", -** Processing line: ~ "I CAN'T DO THIS... But... If-- I-- don't--- bring-- the- chambers--- to- equilibrium-----, they all die...",~ + +** Processing line: ~ def wall_color~ - Inside source: true *** True Line Result - "I CAN'T DO THIS... But... If-- I-- don't--- bring-- the- chambers--- to- equilibrium-----, they all die...", -** Processing line: ~ [:final_decision_game_over_noone, "Kill--- Everyone---", "DO--- NOTHING?"],~ + def wall_color +** Processing line: ~ [134, 134, 120] # Camo Green~ - Inside source: true *** True Line Result - [:final_decision_game_over_noone, "Kill--- Everyone---", "DO--- NOTHING?"], -** Processing line: ~ [:final_decision_game_over_matthew, "Kill--- Sasha---", "KILL--- SASHA?"],~ + [134, 134, 120] # Camo Green +** Processing line: ~ end~ - Inside source: true *** True Line Result - [:final_decision_game_over_matthew, "Kill--- Sasha---", "KILL--- SASHA?"], -** Processing line: ~ [:final_decision_game_over_anka, "Kill--- Aanka---", "KILL--- AANKA?"],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [:final_decision_game_over_anka, "Kill--- Aanka---", "KILL--- AANKA?"], -** Processing line: ~ [:final_decision_game_over_sasha, "Kill--- Matthew---", "KILL--- MATTHEW?"]~ + +** Processing line: ~ def visited_color~ - Inside source: true *** True Line Result - [:final_decision_game_over_sasha, "Kill--- Matthew---", "KILL--- MATTHEW?"] -** Processing line: ~ end~ + def visited_color +** Processing line: ~ [204, 191, 179] # Dark Brown~ - Inside source: true *** True Line Result - end + [204, 191, 179] # Dark Brown +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def final_decision_game_over_noone args~ +** Processing line: ~ def path_color~ - Inside source: true *** True Line Result - def final_decision_game_over_noone args -** Processing line: ~ {~ + def path_color +** Processing line: ~ [231, 230, 228] # Pastel White~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/tribute-game-over.png',~ + [231, 230, 228] # Pastel White +** Processing line: ~ end~ - Inside source: true *** True Line Result - background: 'sprites/tribute-game-over.png', -** Processing line: ~ player: [53, 14],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - player: [53, 14], -** Processing line: ~ fade: 600~ + +** Processing line: ~ def button_color~ - Inside source: true *** True Line Result - fade: 600 -** Processing line: ~ }~ + def button_color +** Processing line: ~ [190, 190, 190] # Gray~ - Inside source: true *** True Line Result - } + [190, 190, 190] # Gray +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -81683,62 +85476,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 final_decision_game_over_matthew args~ +** Processing line: ~~ - Inside source: true *** True Line Result - def final_decision_game_over_matthew args -** Processing line: ~ {~ + +** Processing line: ~ # Method that is called by DragonRuby periodically~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/tribute-game-over.png',~ + # Method that is called by DragonRuby periodically +** Processing line: ~ # Used for updating animations and calculations~ - Inside source: true *** True Line Result - background: 'sprites/tribute-game-over.png', -** Processing line: ~ player: [53, 14],~ + # Used for updating animations and calculations +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - player: [53, 14], -** Processing line: ~ fade: 600~ + def tick args +** Processing line: ~~ - Inside source: true *** True Line Result - fade: 600 -** Processing line: ~ }~ + +** Processing line: ~ # Pressing r will reset the application~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + # Pressing r will reset the application +** Processing line: ~ if args.inputs.keyboard.key_down.r~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if args.inputs.keyboard.key_down.r +** Processing line: ~ args.gtk.reset~ - Inside source: true *** True Line Result - -** Processing line: ~ def final_decision_game_over_anka args~ + args.gtk.reset +** Processing line: ~ reset~ - Inside source: true *** True Line Result - def final_decision_game_over_anka args -** Processing line: ~ {~ + reset +** Processing line: ~ return~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/tribute-game-over.png',~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - background: 'sprites/tribute-game-over.png', -** Processing line: ~ player: [53, 14],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - player: [53, 14], -** Processing line: ~ fade: 600~ + +** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ - Inside source: true *** True Line Result - fade: 600 -** Processing line: ~ }~ + # Every tick, new args are passed, and the Breadth First Search tick is called +** Processing line: ~ $a_star_algorithm ||= A_Star_Algorithm.new(args)~ - Inside source: true *** True Line Result - } + $a_star_algorithm ||= A_Star_Algorithm.new(args) +** Processing line: ~ $a_star_algorithm.args = args~ +- Inside source: true +*** True Line Result + $a_star_algorithm.args = args +** Processing line: ~ $a_star_algorithm.tick~ +- Inside source: true +*** True Line Result + $a_star_algorithm.tick ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -81747,70 +85548,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 final_decision_game_over_sasha args~ -- Inside source: true -*** True Line Result - def final_decision_game_over_sasha args -** Processing line: ~ {~ -- Inside source: true -*** True Line Result - { -** Processing line: ~ background: 'sprites/tribute-game-over.png',~ -- Inside source: true -*** True Line Result - background: 'sprites/tribute-game-over.png', -** Processing line: ~ player: [53, 14],~ -- Inside source: true -*** True Line Result - player: [53, 14], -** Processing line: ~ fade: 600~ -- Inside source: true -*** True Line Result - fade: 600 -** 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 final_decision_ship_status_shared args~ -- Inside source: true -*** True Line Result - def final_decision_ship_status_shared args -** Processing line: ~ [~ -- Inside source: true -*** True Line Result - [ -** Processing line: ~ *ship_control_hotspot(24, 22,~ -- Inside source: true -*** True Line Result - *ship_control_hotspot(24, 22, -** Processing line: ~ "Stasis-- Chambers--: UNDERPOWERED, Life- forms-- will be terminated---- unless-- equilibrium----- is reached. WHAT?! NO!",~ -- Inside source: true -*** True Line Result - "Stasis-- Chambers--: UNDERPOWERED, Life- forms-- will be terminated---- unless-- equilibrium----- is reached. WHAT?! NO!", -** Processing line: ~ "Matthew's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!",~ -- Inside source: true -*** True Line Result - "Matthew's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!", -** Processing line: ~ "Aanka's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!",~ -- Inside source: true -*** True Line Result - "Aanka's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!", -** Processing line: ~ "Sasha's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!"),~ +** Processing line: ~ def reset~ - Inside source: true *** True Line Result - "Sasha's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!"), -** Processing line: ~ ]~ + def reset +** Processing line: ~ $a_star_algorithm = nil~ - Inside source: true *** True Line Result - ] + $a_star_algorithm = nil ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -81827,70 +85576,62 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_final_message.rb~ +** Processing line: ~*** Path Finding Algorithms - Tower Defense - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rpg Narrative - Return Of Serenity - storyline_final_message.rb +*** Path Finding Algorithms - Tower Defense - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result *** True Line Result #+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_message.rb~ -- Inside source: true -*** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_message.rb -** Processing line: ~ def final_message_sad args~ -- Inside source: true -*** True Line Result - def final_message_sad args -** Processing line: ~ {~ +** Processing line: ~ # ./samples/13_path_finding_algorithms/09_tower_defense/app/main.rb~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 60,~ + # ./samples/13_path_finding_algorithms/09_tower_defense/app/main.rb +** Processing line: ~ # An example of some major components in a tower defence game~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/inside-home.png',~ + # An example of some major components in a tower defence game +** Processing line: ~ # The pathing of the tanks is determined by A* algorithm -- try editing the walls~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [34, 35],~ + # The pathing of the tanks is determined by A* algorithm -- try editing the walls +** Processing line: ~~ - Inside source: true *** True Line Result - player: [34, 35], -** Processing line: ~ storylines: [~ + +** Processing line: ~ # The turrets shoot bullets at the closest tank. The bullets are heat-seeking~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [34, 34, 4, 4, "Another-- sleepless-- night..."],~ + # The turrets shoot bullets at the closest tank. The bullets are heat-seeking +** Processing line: ~~ - Inside source: true *** True Line Result - [34, 34, 4, 4, "Another-- sleepless-- night..."], -** Processing line: ~ ],~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + def tick args +** Processing line: ~ $gtk.reset if args.inputs.keyboard.key_down.r~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [32, -1, 8, 3, :final_message_observatory]~ + $gtk.reset if args.inputs.keyboard.key_down.r +** Processing line: ~ defaults args~ - Inside source: true *** True Line Result - [32, -1, 8, 3, :final_message_observatory] -** Processing line: ~ ]~ + defaults args +** Processing line: ~ render args~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + render args +** Processing line: ~ calc args~ - Inside source: true *** True Line Result - } + calc args ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -81899,214 +85640,214 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def final_message_happy args~ +** Processing line: ~ def defaults args~ - Inside source: true *** True Line Result - def final_message_happy args -** Processing line: ~ {~ + def defaults args +** Processing line: ~ args.outputs.background_color = wall_color~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 60,~ + args.outputs.background_color = wall_color +** Processing line: ~ args.state.grid_size = 5~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/inside-home.png',~ + args.state.grid_size = 5 +** Processing line: ~ args.state.tile_size = 50~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [34, 35],~ + args.state.tile_size = 50 +** Processing line: ~ args.state.grid_start ||= [0, 0]~ - Inside source: true *** True Line Result - player: [34, 35], -** Processing line: ~ storylines: [~ + args.state.grid_start ||= [0, 0] +** Processing line: ~ args.state.grid_goal ||= [4, 4]~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [34, 34, 4, 4, "Oh man, I slept like rock!"],~ + args.state.grid_goal ||= [4, 4] +** Processing line: ~~ - Inside source: true *** True Line Result - [34, 34, 4, 4, "Oh man, I slept like rock!"], -** Processing line: ~ ],~ + +** Processing line: ~ # Try editing these walls to see the path change!~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + # Try editing these walls to see the path change! +** Processing line: ~ args.state.walls ||= {~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [32, -1, 8, 3, :final_message_observatory]~ + args.state.walls ||= { +** Processing line: ~ [0, 4] => true,~ - Inside source: true *** True Line Result - [32, -1, 8, 3, :final_message_observatory] -** Processing line: ~ ]~ + [0, 4] => true, +** Processing line: ~ [1, 3] => true,~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + [1, 3] => true, +** Processing line: ~ [3, 1] => true,~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [3, 1] => true, +** Processing line: ~ # [4, 0] => true,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # [4, 0] => true, +** Processing line: ~ }~ - Inside source: true *** True Line Result - -** Processing line: ~ def final_message_side_of_home args~ + } +** Processing line: ~~ - Inside source: true *** True Line Result - def final_message_side_of_home args -** Processing line: ~ {~ + +** Processing line: ~ args.state.a_star.frontier ||= []~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 60,~ + args.state.a_star.frontier ||= [] +** Processing line: ~ args.state.a_star.came_from ||= {}~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/side-of-home.png',~ + args.state.a_star.came_from ||= {} +** Processing line: ~ args.state.a_star.path ||= []~ - Inside source: true *** True Line Result - background: 'sprites/side-of-home.png', -** Processing line: ~ player: [16, 13],~ + args.state.a_star.path ||= [] +** Processing line: ~~ - Inside source: true *** True Line Result - player: [16, 13], -** Processing line: ~ scenes: [~ + +** Processing line: ~ args.state.tanks ||= []~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [52, 24, 11, 5, :final_message_mountain_pass],~ + args.state.tanks ||= [] +** Processing line: ~ args.state.tank_spawn_period ||= 60~ - Inside source: true *** True Line Result - [52, 24, 11, 5, :final_message_mountain_pass], -** Processing line: ~ ],~ + args.state.tank_spawn_period ||= 60 +** Processing line: ~ args.state.tank_sprite_path ||= 'sprites/circle/white.png'~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_side_of_home_render~ + args.state.tank_sprite_path ||= 'sprites/circle/white.png' +** Processing line: ~ args.state.tank_speed ||= 1~ - Inside source: true *** True Line Result - render_override: :blinking_light_side_of_home_render -** Processing line: ~ }~ + args.state.tank_speed ||= 1 +** Processing line: ~~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + +** Processing line: ~ args.state.turret_shoot_period = 10~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.turret_shoot_period = 10 +** Processing line: ~ # Turrets can be entered as [x, y] but are immediately mapped to hashes~ - Inside source: true *** True Line Result - -** Processing line: ~ def final_message_mountain_pass args~ + # Turrets can be entered as [x, y] but are immediately mapped to hashes +** Processing line: ~ # Walls are also added where the turrets are to prevent tanks from pathing over them~ - Inside source: true *** True Line Result - def final_message_mountain_pass args -** Processing line: ~ {~ + # Walls are also added where the turrets are to prevent tanks from pathing over them +** Processing line: ~ args.state.turrets ||= [~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/mountain-pass-zoomed-out.png',~ + args.state.turrets ||= [ +** Processing line: ~ [2, 2]~ - Inside source: true *** True Line Result - background: 'sprites/mountain-pass-zoomed-out.png', -** Processing line: ~ player: [4, 4],~ + [2, 2] +** Processing line: ~ ].each { |turret| args.state.walls[turret] = true}.map do |x, y|~ - Inside source: true *** True Line Result - player: [4, 4], -** Processing line: ~ scenes: [~ + ].each { |turret| args.state.walls[turret] = true}.map do |x, y| +** Processing line: ~ {~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [18, 47, 5, 5, :final_message_path_to_observatory],~ + { +** Processing line: ~ x: x * args.state.tile_size,~ - Inside source: true *** True Line Result - [18, 47, 5, 5, :final_message_path_to_observatory], -** Processing line: ~ ],~ + x: x * args.state.tile_size, +** Processing line: ~ y: y * args.state.tile_size,~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + y: y * args.state.tile_size, +** Processing line: ~ w: args.state.tile_size,~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [18, 13, 5, 5, "Hnnnnnnnggg. My legs-- are still sore- from yesterday."]~ + w: args.state.tile_size, +** Processing line: ~ h: args.state.tile_size,~ - Inside source: true *** True Line Result - [18, 13, 5, 5, "Hnnnnnnnggg. My legs-- are still sore- from yesterday."] -** Processing line: ~ ],~ + h: args.state.tile_size, +** Processing line: ~ path: 'sprites/circle/gray.png',~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_mountain_pass_render~ + path: 'sprites/circle/gray.png', +** Processing line: ~ range: 100~ - Inside source: true *** True Line Result - render_override: :blinking_light_mountain_pass_render -** Processing line: ~ }~ + range: 100 +** Processing line: ~ }~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def final_message_path_to_observatory args~ +** Processing line: ~ args.state.bullet_size ||= 25~ - Inside source: true *** True Line Result - def final_message_path_to_observatory args -** Processing line: ~ {~ + args.state.bullet_size ||= 25 +** Processing line: ~ args.state.bullets ||= []~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/path-to-observatory.png',~ + args.state.bullets ||= [] +** Processing line: ~ args.state.bullet_path ||= 'sprites/circle/orange.png'~ - Inside source: true *** True Line Result - background: 'sprites/path-to-observatory.png', -** Processing line: ~ player: [60, 4],~ + args.state.bullet_path ||= 'sprites/circle/orange.png' +** Processing line: ~ #~ - Inside source: true *** True Line Result - player: [60, 4], -** Processing line: ~ scenes: [~ + # +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [0, 26, 5, 5, :final_message_observatory]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [0, 26, 5, 5, :final_message_observatory] -** Processing line: ~ ],~ + +** Processing line: ~ def render args~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + def render args +** Processing line: ~ render_grid args~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [22, 20, 10, 10, "This spot--, on the mountain, right here, it's-- perfect. This- is where- I'll-- yeet-- the person-- who is playing-- this- prank- on me."]~ + render_grid args +** Processing line: ~ render_a_star args~ - Inside source: true *** True Line Result - [22, 20, 10, 10, "This spot--, on the mountain, right here, it's-- perfect. This- is where- I'll-- yeet-- the person-- who is playing-- this- prank- on me."] -** Processing line: ~ ],~ + render_a_star args +** Processing line: ~ args.outputs.sprites << args.state.tanks~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_path_to_observatory_render~ + args.outputs.sprites << args.state.tanks +** Processing line: ~ args.outputs.sprites << args.state.turrets~ - Inside source: true *** True Line Result - render_override: :blinking_light_path_to_observatory_render -** Processing line: ~ }~ + args.outputs.sprites << args.state.turrets +** Processing line: ~ args.outputs.sprites << args.state.bullets~ - Inside source: true *** True Line Result - } + args.outputs.sprites << args.state.bullets ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -82115,118 +85856,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 final_message_observatory args~ +** Processing line: ~ def render_grid args~ - Inside source: true *** True Line Result - def final_message_observatory args -** Processing line: ~ if args.state.scene_history.include? :replied_with_whole_truth~ + def render_grid args +** Processing line: ~ # Draw a square the size and color of the grid~ - Inside source: true *** True Line Result - if args.state.scene_history.include? :replied_with_whole_truth -** Processing line: ~ return {~ + # Draw a square the size and color of the grid +** Processing line: ~ args.outputs.solids << [~ - Inside source: true *** True Line Result - return { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + args.outputs.solids << [ +** Processing line: ~ 0,~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 60,~ + 0, +** Processing line: ~ 0,~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [51, 12],~ + 0, +** Processing line: ~ args.state.grid_size * args.state.tile_size,~ - Inside source: true *** True Line Result - player: [51, 12], -** Processing line: ~ storylines: [~ + args.state.grid_size * args.state.tile_size, +** Processing line: ~ args.state.grid_size * args.state.tile_size,~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [50, 10, 4, 4, "Here-- we- go..."]~ + args.state.grid_size * args.state.tile_size, +** Processing line: ~ grid_color~ - Inside source: true *** True Line Result - [50, 10, 4, 4, "Here-- we- go..."] -** Processing line: ~ ],~ + grid_color +** Processing line: ~ ]~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 18, 5, 12, :final_message_inside_mainframe]~ + +** Processing line: ~ # Draw lines across the grid to show tiles~ - Inside source: true *** True Line Result - [30, 18, 5, 12, :final_message_inside_mainframe] -** Processing line: ~ ],~ + # Draw lines across the grid to show tiles +** Processing line: ~ (args.state.grid_size + 1).times do | value |~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ + (args.state.grid_size + 1).times do | value | +** Processing line: ~ render_horizontal_line(args, value)~ - Inside source: true *** True Line Result - render_override: :blinking_light_inside_observatory_render -** Processing line: ~ }~ + render_horizontal_line(args, value) +** Processing line: ~ render_vertical_line(args, value)~ - Inside source: true *** True Line Result - } -** Processing line: ~ else~ + render_vertical_line(args, value) +** Processing line: ~ end~ - Inside source: true *** True Line Result - else -** Processing line: ~ return {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - return { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + +** Processing line: ~ # Render special tiles~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 60,~ + # Render special tiles +** Processing line: ~ render_tile(args, args.state.grid_start, start_color)~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [51, 12],~ + render_tile(args, args.state.grid_start, start_color) +** Processing line: ~ render_tile(args, args.state.grid_goal, goal_color)~ - Inside source: true *** True Line Result - player: [51, 12], -** Processing line: ~ storylines: [~ + render_tile(args, args.state.grid_goal, goal_color) +** Processing line: ~ args.state.walls.keys.each { |wall| render_tile(args, wall, wall_color) }~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [50, 10, 4, 4, "I feel like I'm-- walking-- on sunshine!"]~ + args.state.walls.keys.each { |wall| render_tile(args, wall, wall_color) } +** Processing line: ~ end~ - Inside source: true *** True Line Result - [50, 10, 4, 4, "I feel like I'm-- walking-- on sunshine!"] -** Processing line: ~ ],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + +** Processing line: ~ def render_vertical_line args, x~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 18, 5, 12, :final_message_inside_mainframe]~ + def render_vertical_line args, x +** Processing line: ~ args.outputs.lines << [~ - Inside source: true *** True Line Result - [30, 18, 5, 12, :final_message_inside_mainframe] -** Processing line: ~ ],~ + args.outputs.lines << [ +** Processing line: ~ x * args.state.tile_size,~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ + x * args.state.tile_size, +** Processing line: ~ 0,~ - Inside source: true *** True Line Result - render_override: :blinking_light_inside_observatory_render -** Processing line: ~ }~ + 0, +** Processing line: ~ x * args.state.tile_size,~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + x * args.state.tile_size, +** Processing line: ~ args.state.tile_size * args.state.grid_size,~ - Inside source: true *** True Line Result - end + args.state.tile_size * args.state.grid_size, +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -82235,34 +85980,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def final_message_inside_mainframe args~ +** Processing line: ~ def render_horizontal_line args, y~ - Inside source: true *** True Line Result - def final_message_inside_mainframe args -** Processing line: ~ {~ + def render_horizontal_line args, y +** Processing line: ~ args.outputs.lines << [~ - Inside source: true *** True Line Result - { -** Processing line: ~ player: [32, 4],~ + args.outputs.lines << [ +** Processing line: ~ 0,~ - Inside source: true *** True Line Result - player: [32, 4], -** Processing line: ~ background: 'sprites/mainframe.png',~ + 0, +** Processing line: ~ y * args.state.tile_size,~ - Inside source: true *** True Line Result - background: 'sprites/mainframe.png', -** Processing line: ~ fade: 60,~ + y * args.state.tile_size, +** Processing line: ~ args.state.tile_size * args.state.grid_size,~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ scenes: [[45, 45, 4, 4, :final_message_check_ship_status]]~ + args.state.tile_size * args.state.grid_size, +** Processing line: ~ y * args.state.tile_size,~ - Inside source: true *** True Line Result - scenes: [[45, 45, 4, 4, :final_message_check_ship_status]] -** Processing line: ~ }~ + y * args.state.tile_size, +** Processing line: ~ ]~ - Inside source: true *** True Line Result - } + ] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -82271,46 +86016,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 final_message_check_ship_status args~ -- Inside source: true -*** True Line Result - def final_message_check_ship_status args -** Processing line: ~ {~ -- Inside source: true -*** True Line Result - { -** Processing line: ~ background: 'sprites/mainframe.png',~ +** Processing line: ~ def render_tile args, tile, color~ - Inside source: true *** True Line Result - background: 'sprites/mainframe.png', -** Processing line: ~ storylines: [~ + def render_tile args, tile, color +** Processing line: ~ args.outputs.solids << [~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [45, 45, 4, 4, (final_message_current args)],~ + args.outputs.solids << [ +** Processing line: ~ tile.x * args.state.tile_size,~ - Inside source: true *** True Line Result - [45, 45, 4, 4, (final_message_current args)], -** Processing line: ~ ],~ + tile.x * args.state.tile_size, +** Processing line: ~ tile.y * args.state.tile_size,~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + tile.y * args.state.tile_size, +** Processing line: ~ args.state.tile_size,~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_top, :final_message_ship_status],~ + args.state.tile_size, +** Processing line: ~ args.state.tile_size,~ - Inside source: true *** True Line Result - [*hotspot_top, :final_message_ship_status], -** Processing line: ~ ]~ + args.state.tile_size, +** Processing line: ~ color~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + color +** Processing line: ~ ]~ - Inside source: true *** True Line Result - } + ] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -82319,258 +86056,250 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def final_message_ship_status args~ +** Processing line: ~ def calc args~ - Inside source: true *** True Line Result - def final_message_ship_status args -** Processing line: ~ {~ + def calc args +** Processing line: ~ calc_a_star args~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/serenity.png',~ + calc_a_star args +** Processing line: ~ calc_tanks args~ - Inside source: true *** True Line Result - background: 'sprites/serenity.png', -** Processing line: ~ fade: 60,~ + calc_tanks args +** Processing line: ~ calc_turrets args~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [30, 10],~ + calc_turrets args +** Processing line: ~ calc_bullets args~ - Inside source: true *** True Line Result - player: [30, 10], -** Processing line: ~ scenes: [~ + calc_bullets args +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 50, 4, 4, :final_message_ship_status_reviewed]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [30, 50, 4, 4, :final_message_ship_status_reviewed] -** Processing line: ~ ],~ + +** Processing line: ~ def calc_a_star args~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + def calc_a_star args +** Processing line: ~ # Only does this one time~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 8, 4, 4, "Let me make- sure- everything--- looks good. It'll-- give me peace- of mind."],~ + # Only does this one time +** Processing line: ~ return unless args.state.a_star.path.empty?~ - Inside source: true *** True Line Result - [30, 8, 4, 4, "Let me make- sure- everything--- looks good. It'll-- give me peace- of mind."], -** Processing line: ~ *final_message_ship_status_shared(args)~ + return unless args.state.a_star.path.empty? +** Processing line: ~~ - Inside source: true *** True Line Result - *final_message_ship_status_shared(args) -** Processing line: ~ ]~ + +** Processing line: ~ # Start the search from the grid start~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + # Start the search from the grid start +** Processing line: ~ args.state.a_star.frontier << args.state.grid_start~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + args.state.a_star.frontier << args.state.grid_start +** Processing line: ~ args.state.a_star.came_from[args.state.grid_start] = nil~ - Inside source: true *** True Line Result - end + args.state.a_star.came_from[args.state.grid_start] = nil ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def final_message_ship_status_reviewed args~ -- Inside source: true -*** True Line Result - def final_message_ship_status_reviewed args -** Processing line: ~ {~ -- Inside source: true -*** True Line Result - { -** Processing line: ~ background: 'sprites/serenity.png',~ +** Processing line: ~ # Until a path to the goal has been found or there are no more tiles to explore~ - Inside source: true *** True Line Result - background: 'sprites/serenity.png', -** Processing line: ~ fade: 60,~ + # Until a path to the goal has been found or there are no more tiles to explore +** Processing line: ~ until (args.state.a_star.came_from.has_key?(args.state.grid_goal)|| args.state.a_star.frontier.empty?)~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ scenes: [~ + until (args.state.a_star.came_from.has_key?(args.state.grid_goal)|| args.state.a_star.frontier.empty?) +** Processing line: ~ # For the first tile in the frontier~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_bottom, :final_message_summary]~ + # For the first tile in the frontier +** Processing line: ~ tile_to_expand_from = args.state.a_star.frontier.shift~ - Inside source: true *** True Line Result - [*hotspot_bottom, :final_message_summary] -** Processing line: ~ ],~ + tile_to_expand_from = args.state.a_star.frontier.shift +** Processing line: ~ # Add each of its neighbors to the frontier~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + # Add each of its neighbors to the frontier +** Processing line: ~ neighbors(args, tile_to_expand_from).each do | tile |~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [0, 62, 62, 3, "Whew. Everyone-- is in their- chambers. The engines-- are roaring-- and Serenity-- is coming-- home."],~ + neighbors(args, tile_to_expand_from).each do | tile | +** Processing line: ~ args.state.a_star.frontier << tile~ - Inside source: true *** True Line Result - [0, 62, 62, 3, "Whew. Everyone-- is in their- chambers. The engines-- are roaring-- and Serenity-- is coming-- home."], -** Processing line: ~ ]~ + args.state.a_star.frontier << tile +** Processing line: ~ args.state.a_star.came_from[tile] = tile_to_expand_from~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + args.state.a_star.came_from[tile] = tile_to_expand_from +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def final_message_ship_status_shared args~ +** Processing line: ~ # Stop calculating a path if the goal was never reached~ - Inside source: true *** True Line Result - def final_message_ship_status_shared args -** Processing line: ~ [~ + # Stop calculating a path if the goal was never reached +** Processing line: ~ return unless args.state.a_star.came_from.has_key? args.state.grid_goal~ - Inside source: true *** True Line Result - [ -** Processing line: ~ *ship_control_hotspot( 0, 50,~ + return unless args.state.a_star.came_from.has_key? args.state.grid_goal +** Processing line: ~~ - Inside source: true *** True Line Result - *ship_control_hotspot( 0, 50, -** Processing line: ~ "Stasis-- Chambers--: Online, All chambers-- are powered. Battery--- Allocation---: 3--- of-- 3--.",~ + +** Processing line: ~ # Fill path by tracing back from the goal~ - Inside source: true *** True Line Result - "Stasis-- Chambers--: Online, All chambers-- are powered. Battery--- Allocation---: 3--- of-- 3--.", -** Processing line: ~ "Matthew's--- Chamber--: OCCUPIED----",~ + # Fill path by tracing back from the goal +** Processing line: ~ current_cell = args.state.grid_goal~ - Inside source: true *** True Line Result - "Matthew's--- Chamber--: OCCUPIED----", -** Processing line: ~ "Aanka's--- Chamber--: OCCUPIED----",~ + current_cell = args.state.grid_goal +** Processing line: ~ while current_cell~ - Inside source: true *** True Line Result - "Aanka's--- Chamber--: OCCUPIED----", -** Processing line: ~ "Sasha's--- Chamber--: OCCUPIED----"),~ + while current_cell +** Processing line: ~ args.state.a_star.path.unshift current_cell~ - Inside source: true *** True Line Result - "Sasha's--- Chamber--: OCCUPIED----"), -** Processing line: ~ *ship_control_hotspot(12, 35,~ + args.state.a_star.path.unshift current_cell +** Processing line: ~ current_cell = args.state.a_star.came_from[current_cell]~ - Inside source: true *** True Line Result - *ship_control_hotspot(12, 35, -** Processing line: ~ "Life- Support--: Not-- Needed---",~ + current_cell = args.state.a_star.came_from[current_cell] +** Processing line: ~ end~ - Inside source: true *** True Line Result - "Life- Support--: Not-- Needed---", -** Processing line: ~ "O2--- Production---: OFF---",~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - "O2--- Production---: OFF---", -** Processing line: ~ "CO2--- Scrubbers---: OFF---",~ + +** Processing line: ~ puts "The path has been calculated"~ - Inside source: true *** True Line Result - "CO2--- Scrubbers---: OFF---", -** Processing line: ~ "H2O--- Production---: OFF---"),~ + puts "The path has been calculated" +** Processing line: ~ puts args.state.a_star.path~ - Inside source: true *** True Line Result - "H2O--- Production---: OFF---"), -** Processing line: ~ *ship_control_hotspot(24, 20,~ + puts args.state.a_star.path +** Processing line: ~ end~ - Inside source: true *** True Line Result - *ship_control_hotspot(24, 20, -** Processing line: ~ "Navigation: Offline---",~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - "Navigation: Offline---", -** Processing line: ~ "Sensor: OFF---",~ + +** Processing line: ~ def calc_tanks args~ - Inside source: true *** True Line Result - "Sensor: OFF---", -** Processing line: ~ "Heads- Up- Display: DAMAGED---",~ + def calc_tanks args +** Processing line: ~ spawn_tank args~ - Inside source: true *** True Line Result - "Heads- Up- Display: DAMAGED---", -** Processing line: ~ "Arithmetic--- Unit: DAMAGED----"),~ + spawn_tank args +** Processing line: ~ move_tanks args~ - Inside source: true *** True Line Result - "Arithmetic--- Unit: DAMAGED----"), -** Processing line: ~ *ship_control_hotspot(36, 35,~ + move_tanks args +** Processing line: ~ end~ - Inside source: true *** True Line Result - *ship_control_hotspot(36, 35, -** Processing line: ~ "COMM: Underpowered----",~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - "COMM: Underpowered----", -** Processing line: ~ "Text: ON---",~ + +** Processing line: ~ def move_tanks args~ - Inside source: true *** True Line Result - "Text: ON---", -** Processing line: ~ "Audio: SEGFAULT---",~ + def move_tanks args +** Processing line: ~ # Remove tanks that have reached the end of their path~ - Inside source: true *** True Line Result - "Audio: SEGFAULT---", -** Processing line: ~ "Video: DAMAGED---"),~ + # Remove tanks that have reached the end of their path +** Processing line: ~ args.state.tanks.reject! { |tank| tank[:a_star].empty? }~ - Inside source: true *** True Line Result - "Video: DAMAGED---"), -** Processing line: ~ *ship_control_hotspot(48, 50,~ + args.state.tanks.reject! { |tank| tank[:a_star].empty? } +** Processing line: ~~ - Inside source: true *** True Line Result - *ship_control_hotspot(48, 50, -** Processing line: ~ "Engine: Online, Coordinates--- Set- for Earth. Battery--- Allocation---: 3--- of-- 3---",~ + +** Processing line: ~ # Tanks have an array that has each tile it has to go to in order from a* path~ - Inside source: true *** True Line Result - "Engine: Online, Coordinates--- Set- for Earth. Battery--- Allocation---: 3--- of-- 3---", -** Processing line: ~ "Engine I: ON---",~ + # Tanks have an array that has each tile it has to go to in order from a* path +** Processing line: ~ args.state.tanks.each do | tank |~ - Inside source: true *** True Line Result - "Engine I: ON---", -** Processing line: ~ "Engine II: ON---",~ + args.state.tanks.each do | tank | +** Processing line: ~ destination = tank[:a_star][0]~ - Inside source: true *** True Line Result - "Engine II: ON---", -** Processing line: ~ "Engine III: ON---")~ + destination = tank[:a_star][0] +** Processing line: ~ # Move the tank towards the destination~ - Inside source: true *** True Line Result - "Engine III: ON---") -** Processing line: ~ ]~ + # Move the tank towards the destination +** Processing line: ~ tank[:x] += copy_sign(args.state.tank_speed, ((destination.x * args.state.tile_size) - tank[:x]))~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + tank[:x] += copy_sign(args.state.tank_speed, ((destination.x * args.state.tile_size) - tank[:x])) +** Processing line: ~ tank[:y] += copy_sign(args.state.tank_speed, ((destination.y * args.state.tile_size) - tank[:y]))~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + tank[:y] += copy_sign(args.state.tank_speed, ((destination.y * args.state.tile_size) - tank[:y])) +** Processing line: ~ # If the tank has reached its destination~ - Inside source: true *** True Line Result - -** Processing line: ~ def final_message_last_reply args~ + # If the tank has reached its destination +** Processing line: ~ if (destination.x * args.state.tile_size) == tank[:x] and~ - Inside source: true *** True Line Result - def final_message_last_reply args -** Processing line: ~ if args.state.scene_history.include? :replied_with_whole_truth~ + if (destination.x * args.state.tile_size) == tank[:x] and +** Processing line: ~ (destination.y * args.state.tile_size) == tank[:y]~ - Inside source: true *** True Line Result - if args.state.scene_history.include? :replied_with_whole_truth -** Processing line: ~ return "Buffer--: #{anka_reply_whole_truth.quote}"~ + (destination.y * args.state.tile_size) == tank[:y] +** Processing line: ~ # Set the destination to the next point in the path~ - Inside source: true *** True Line Result - return "Buffer--: #{anka_reply_whole_truth.quote}" -** Processing line: ~ else~ + # Set the destination to the next point in the path +** Processing line: ~ tank[:a_star].shift~ - Inside source: true *** True Line Result - else -** Processing line: ~ return "Buffer--: #{anka_reply_half_truth.quote}"~ + tank[:a_star].shift +** Processing line: ~ end~ - Inside source: true *** True Line Result - return "Buffer--: #{anka_reply_half_truth.quote}" + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -82583,122 +86312,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 final_message_current args~ -- Inside source: true -*** True Line Result - def final_message_current args -** Processing line: ~ if args.state.scene_history.include? :replied_with_whole_truth~ -- Inside source: true -*** True Line Result - if args.state.scene_history.include? :replied_with_whole_truth -** Processing line: ~ return "Hey... It's-- me Sasha. Aanka-- is trying-- her best to comfort-- Matthew. This- is the first- time- I've-- ever-- seen-- Matthew-- cry. We'll-- probably-- be in stasis-- by the time you get this message--. Thank- you- again-- for all your help. I look forward-- to meeting-- you in person."~ -- Inside source: true -*** True Line Result - return "Hey... It's-- me Sasha. Aanka-- is trying-- her best to comfort-- Matthew. This- is the first- time- I've-- ever-- seen-- Matthew-- cry. We'll-- probably-- be in stasis-- by the time you get this message--. Thank- you- again-- for all your help. I look forward-- to meeting-- you in person." -** Processing line: ~ else~ +** Processing line: ~ def calc_turrets args~ - Inside source: true *** True Line Result - else -** Processing line: ~ return "Hey! It's-- me Sasha! LOL! Aanka-- and Matthew-- are dancing-- around-- like- goofballs--! They- are both- so adorable! Only-- this- tiny-- little-- genius-- can make-- a battle-- hardened-- general--- put- on a tiara-- and dance- around-- like a fairy-- princess-- XD------ Anyways, we are heading-- back into-- the chambers--. I hope our welcome-- home- parade-- has fireworks!"~ + def calc_turrets args +** Processing line: ~ return unless args.state.tick_count.mod_zero? args.state.turret_shoot_period~ - Inside source: true *** True Line Result - return "Hey! It's-- me Sasha! LOL! Aanka-- and Matthew-- are dancing-- around-- like- goofballs--! They- are both- so adorable! Only-- this- tiny-- little-- genius-- can make-- a battle-- hardened-- general--- put- on a tiara-- and dance- around-- like a fairy-- princess-- XD------ Anyways, we are heading-- back into-- the chambers--. I hope our welcome-- home- parade-- has fireworks!" -** Processing line: ~ end~ + return unless args.state.tick_count.mod_zero? args.state.turret_shoot_period +** Processing line: ~ args.state.turrets.each do | turret |~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + args.state.turrets.each do | turret | +** Processing line: ~ # Finds the closest tank~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Finds the closest tank +** Processing line: ~ target = nil~ - Inside source: true *** True Line Result - -** Processing line: ~ def final_message_summary args~ + target = nil +** Processing line: ~ shortest_distance = turret[:range] + 1~ - Inside source: true *** True Line Result - def final_message_summary args -** Processing line: ~ if args.state.scene_history.include? :replied_with_whole_truth~ + shortest_distance = turret[:range] + 1 +** Processing line: ~ args.state.tanks.each do | tank |~ - Inside source: true *** True Line Result - if args.state.scene_history.include? :replied_with_whole_truth -** Processing line: ~ return {~ + args.state.tanks.each do | tank | +** Processing line: ~ distance = distance_between(turret[:x], turret[:y], tank[:x], tank[:y])~ - Inside source: true *** True Line Result - return { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + distance = distance_between(turret[:x], turret[:y], tank[:x], tank[:y]) +** Processing line: ~ if distance < shortest_distance~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 60,~ + if distance < shortest_distance +** Processing line: ~ target = tank~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [31, 11],~ + target = tank +** Processing line: ~ shortest_distance = distance~ - Inside source: true *** True Line Result - player: [31, 11], -** Processing line: ~ scenes: [[60, 0, 4, 32, :final_decision_side_of_home]],~ + shortest_distance = distance +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [[60, 0, 4, 32, :final_decision_side_of_home]], -** Processing line: ~ storylines: [~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 10, 5, 4, "I can't-- imagine-- what they are feeling-- right now. But at least- they- know everything---, and we can- concentrate-- on rebuilding--- this world-- right- off the bat. I can't-- wait to see the future-- they'll-- help- build."],~ + end +** Processing line: ~ # If there is a tank in range, fires a bullet~ - Inside source: true *** True Line Result - [30, 10, 5, 4, "I can't-- imagine-- what they are feeling-- right now. But at least- they- know everything---, and we can- concentrate-- on rebuilding--- this world-- right- off the bat. I can't-- wait to see the future-- they'll-- help- build."], -** Processing line: ~ ]~ + # If there is a tank in range, fires a bullet +** Processing line: ~ if target~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + if target +** Processing line: ~ args.state.bullets << {~ - Inside source: true *** True Line Result - } -** Processing line: ~ else~ + args.state.bullets << { +** Processing line: ~ x: turret[:x],~ - Inside source: true *** True Line Result - else -** Processing line: ~ return {~ + x: turret[:x], +** Processing line: ~ y: turret[:y],~ - Inside source: true *** True Line Result - return { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + y: turret[:y], +** Processing line: ~ w: args.state.bullet_size,~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 60,~ + w: args.state.bullet_size, +** Processing line: ~ h: args.state.bullet_size,~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [31, 11],~ + h: args.state.bullet_size, +** Processing line: ~ path: args.state.bullet_path,~ - Inside source: true *** True Line Result - player: [31, 11], -** Processing line: ~ scenes: [[60, 0, 4, 32, :final_decision_side_of_home]],~ + path: args.state.bullet_path, +** Processing line: ~ # Note that this makes it heat-seeking, because target is passed by reference~ - Inside source: true *** True Line Result - scenes: [[60, 0, 4, 32, :final_decision_side_of_home]], -** Processing line: ~ storylines: [~ + # Note that this makes it heat-seeking, because target is passed by reference +** Processing line: ~ # Could do target.clone to make the bullet go to where the tank initially was~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 10, 5, 4, "They all sounded-- so happy. I know- they'll-- be in for a tough- dose- of reality--- when they- arrive. But- at least- they'll-- be around-- all- of us. We'll-- help them- cope."],~ + # Could do target.clone to make the bullet go to where the tank initially was +** Processing line: ~ target: target~ - Inside source: true *** True Line Result - [30, 10, 5, 4, "They all sounded-- so happy. I know- they'll-- be in for a tough- dose- of reality--- when they- arrive. But- at least- they'll-- be around-- all- of us. We'll-- help them- cope."], -** Processing line: ~ ]~ + target: target +** Processing line: ~ }~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -82711,70 +86428,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. -*** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_alive.rb~ +** Processing line: ~ def calc_bullets args~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_alive.rb -** Processing line: ~ def serenity_alive_side_of_home args~ + def calc_bullets args +** Processing line: ~ # Bullets aim for the center of their targets~ - Inside source: true *** True Line Result - def serenity_alive_side_of_home args -** Processing line: ~ {~ + # Bullets aim for the center of their targets +** Processing line: ~ args.state.bullets.each { |bullet| move bullet, center_of(bullet[:target])}~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 60,~ + args.state.bullets.each { |bullet| move bullet, center_of(bullet[:target])} +** Processing line: ~ args.state.bullets.reject! { |b| b.intersect_rect? b[:target] }~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/side-of-home.png',~ + args.state.bullets.reject! { |b| b.intersect_rect? b[:target] } +** Processing line: ~ end~ - Inside source: true *** True Line Result - background: 'sprites/side-of-home.png', -** Processing line: ~ player: [16, 13],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - player: [16, 13], -** Processing line: ~ scenes: [~ + +** Processing line: ~ def center_of object~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [52, 24, 11, 5, :serenity_alive_mountain_pass],~ + def center_of object +** Processing line: ~ object = object.clone~ - Inside source: true *** True Line Result - [52, 24, 11, 5, :serenity_alive_mountain_pass], -** Processing line: ~ ],~ + object = object.clone +** Processing line: ~ object[:x] += 0.5~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_side_of_home_render~ + object[:x] += 0.5 +** Processing line: ~ object[:y] += 0.5~ - Inside source: true *** True Line Result - render_override: :blinking_light_side_of_home_render -** Processing line: ~ }~ + object[:y] += 0.5 +** Processing line: ~ object~ - Inside source: true *** True Line Result - } + object ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -82783,54 +86480,42 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def serenity_alive_mountain_pass args~ -- Inside source: true -*** True Line Result - def serenity_alive_mountain_pass args -** Processing line: ~ {~ -- Inside source: true -*** True Line Result - { -** Processing line: ~ background: 'sprites/mountain-pass-zoomed-out.png',~ -- Inside source: true -*** True Line Result - background: 'sprites/mountain-pass-zoomed-out.png', -** Processing line: ~ player: [4, 4],~ +** Processing line: ~ def render_a_star args~ - Inside source: true *** True Line Result - player: [4, 4], -** Processing line: ~ scenes: [~ + def render_a_star args +** Processing line: ~ args.state.a_star.path.map do |tile|~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [18, 47, 5, 5, :serenity_alive_path_to_observatory],~ + args.state.a_star.path.map do |tile| +** Processing line: ~ # Map each x, y coordinate to the center of the tile and scale up~ - Inside source: true *** True Line Result - [18, 47, 5, 5, :serenity_alive_path_to_observatory], -** Processing line: ~ ],~ + # Map each x, y coordinate to the center of the tile and scale up +** Processing line: ~ [(tile.x + 0.5) * args.state.tile_size, (tile.y + 0.5) * args.state.tile_size]~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + [(tile.x + 0.5) * args.state.tile_size, (tile.y + 0.5) * args.state.tile_size] +** Processing line: ~ end.inject do | point_a, point_b |~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [18, 13, 5, 5, "Hnnnnnnnggg. My legs-- are still sore- from yesterday."]~ + end.inject do | point_a, point_b | +** Processing line: ~ # Render the line between each point~ - Inside source: true *** True Line Result - [18, 13, 5, 5, "Hnnnnnnnggg. My legs-- are still sore- from yesterday."] -** Processing line: ~ ],~ + # Render the line between each point +** Processing line: ~ args.outputs.lines << [point_a.x, point_a.y, point_b.x, point_b.y, a_star_color]~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_mountain_pass_render~ + args.outputs.lines << [point_a.x, point_a.y, point_b.x, point_b.y, a_star_color] +** Processing line: ~ point_b~ - Inside source: true *** True Line Result - render_override: :blinking_light_mountain_pass_render -** Processing line: ~ }~ + point_b +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -82839,142 +86524,130 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def serenity_alive_path_to_observatory args~ -- Inside source: true -*** True Line Result - def serenity_alive_path_to_observatory args -** Processing line: ~ {~ -- Inside source: true -*** True Line Result - { -** Processing line: ~ background: 'sprites/path-to-observatory.png',~ -- Inside source: true -*** True Line Result - background: 'sprites/path-to-observatory.png', -** Processing line: ~ player: [60, 4],~ +** Processing line: ~ # Moves object to target at speed~ - Inside source: true *** True Line Result - player: [60, 4], -** Processing line: ~ scenes: [~ + # Moves object to target at speed +** Processing line: ~ def move object, target, speed = 1~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [0, 26, 5, 5, :serenity_alive_observatory]~ + def move object, target, speed = 1 +** Processing line: ~ if target.is_a? Hash~ - Inside source: true *** True Line Result - [0, 26, 5, 5, :serenity_alive_observatory] -** Processing line: ~ ],~ + if target.is_a? Hash +** Processing line: ~ object[:x] += copy_sign(speed, target[:x] - object[:x])~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + object[:x] += copy_sign(speed, target[:x] - object[:x]) +** Processing line: ~ object[:y] += copy_sign(speed, target[:y] - object[:y])~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [22, 20, 10, 10, "This spot--, on the mountain, right here, it's-- perfect. This- is where- I'll-- yeet-- the person-- who is playing-- this- prank- on me."]~ + object[:y] += copy_sign(speed, target[:y] - object[:y]) +** Processing line: ~ else~ - Inside source: true *** True Line Result - [22, 20, 10, 10, "This spot--, on the mountain, right here, it's-- perfect. This- is where- I'll-- yeet-- the person-- who is playing-- this- prank- on me."] -** Processing line: ~ ],~ + else +** Processing line: ~ object[:x] += copy_sign(speed, target.x - object[:x])~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_path_to_observatory_render~ + object[:x] += copy_sign(speed, target.x - object[:x]) +** Processing line: ~ object[:y] += copy_sign(speed, target.y - object[:y])~ - Inside source: true *** True Line Result - render_override: :blinking_light_path_to_observatory_render -** Processing line: ~ }~ + object[:y] += copy_sign(speed, target.y - object[:y]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ #~ - Inside source: true *** True Line Result - -** Processing line: ~ def serenity_alive_observatory args~ + # +** Processing line: ~ #~ - Inside source: true *** True Line Result - def serenity_alive_observatory args -** Processing line: ~ {~ + # +** Processing line: ~ def distance_between a_x, a_y, b_x, b_y~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/observatory.png',~ + def distance_between a_x, a_y, b_x, b_y +** Processing line: ~ (((b_x - a_x) ** 2) + ((b_y - a_y) ** 2)) ** 0.5~ - Inside source: true *** True Line Result - background: 'sprites/observatory.png', -** Processing line: ~ player: [60, 2],~ + (((b_x - a_x) ** 2) + ((b_y - a_y) ** 2)) ** 0.5 +** Processing line: ~ end~ - Inside source: true *** True Line Result - player: [60, 2], -** Processing line: ~ scenes: [~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [28, 39, 4, 10, :serenity_alive_inside_observatory]~ + +** Processing line: ~ def copy_sign value, sign~ - Inside source: true *** True Line Result - [28, 39, 4, 10, :serenity_alive_inside_observatory] -** Processing line: ~ ],~ + def copy_sign value, sign +** Processing line: ~ return 0 if sign == 0~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_observatory_render~ + return 0 if sign == 0 +** Processing line: ~ return value if sign > 0~ - Inside source: true *** True Line Result - render_override: :blinking_light_observatory_render -** Processing line: ~ }~ + return value if sign > 0 +** Processing line: ~ -value~ - Inside source: true *** True Line Result - } + -value ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ #~ - Inside source: true *** True Line Result - -** Processing line: ~ def serenity_alive_inside_observatory args~ + # +** Processing line: ~ def spawn_tank args~ - Inside source: true *** True Line Result - def serenity_alive_inside_observatory args -** Processing line: ~ {~ + def spawn_tank args +** Processing line: ~ return unless args.state.tick_count.mod_zero? args.state.tank_spawn_period~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + return unless args.state.tick_count.mod_zero? args.state.tank_spawn_period +** Processing line: ~ args.state.tanks << {~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ player: [60, 2],~ + args.state.tanks << { +** Processing line: ~ x: args.state.grid_start.x,~ - Inside source: true *** True Line Result - player: [60, 2], -** Processing line: ~ storylines: [],~ + x: args.state.grid_start.x, +** Processing line: ~ y: args.state.grid_start.y,~ - Inside source: true *** True Line Result - storylines: [], -** Processing line: ~ scenes: [~ + y: args.state.grid_start.y, +** Processing line: ~ w: args.state.tile_size,~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 18, 5, 12, :serenity_alive_inside_mainframe]~ + w: args.state.tile_size, +** Processing line: ~ h: args.state.tile_size,~ - Inside source: true *** True Line Result - [30, 18, 5, 12, :serenity_alive_inside_mainframe] -** Processing line: ~ ],~ + h: args.state.tile_size, +** Processing line: ~ path: args.state.tank_sprite_path,~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ + path: args.state.tank_sprite_path, +** Processing line: ~ a_star: args.state.a_star.path.clone~ - Inside source: true *** True Line Result - render_override: :blinking_light_inside_observatory_render + a_star: args.state.a_star.path.clone ** Processing line: ~ }~ - Inside source: true *** True Line Result @@ -82987,58 +86660,58 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def serenity_alive_inside_mainframe args~ +** Processing line: ~ def neighbors args, tile~ - Inside source: true *** True Line Result - def serenity_alive_inside_mainframe args -** Processing line: ~ {~ + def neighbors args, tile +** Processing line: ~ [[tile.x, tile.y - 1],~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/mainframe.png',~ + [[tile.x, tile.y - 1], +** Processing line: ~ [tile.x, tile.y + 1],~ - Inside source: true *** True Line Result - background: 'sprites/mainframe.png', -** Processing line: ~ fade: 60,~ + [tile.x, tile.y + 1], +** Processing line: ~ [tile.x + 1, tile.y],~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [30, 4],~ + [tile.x + 1, tile.y], +** Processing line: ~ [tile.x - 1, tile.y]].reject do | neighbor |~ - Inside source: true *** True Line Result - player: [30, 4], -** Processing line: ~ scenes: [~ + [tile.x - 1, tile.y]].reject do | neighbor | +** Processing line: ~ args.state.a_star.came_from.has_key?(neighbor) or~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_top, :serenity_alive_ship_status],~ + args.state.a_star.came_from.has_key?(neighbor) or +** Processing line: ~ tile_out_of_bounds?(args, neighbor) or~ - Inside source: true *** True Line Result - [*hotspot_top, :serenity_alive_ship_status], -** Processing line: ~ ],~ + tile_out_of_bounds?(args, neighbor) or +** Processing line: ~ args.state.walls.has_key? neighbor~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + args.state.walls.has_key? neighbor +** Processing line: ~ end~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [22, 45, 17, 4, (serenity_alive_last_reply args)],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [22, 45, 17, 4, (serenity_alive_last_reply args)], -** Processing line: ~ [45, 45, 4, 4, (serenity_alive_current_message args)],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [45, 45, 4, 4, (serenity_alive_current_message args)], -** Processing line: ~ ]~ + +** Processing line: ~ def tile_out_of_bounds? args, tile~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + def tile_out_of_bounds? args, tile +** Processing line: ~ tile.x < 0 or tile.y < 0 or tile.x >= args.state.grid_size or tile.y >= args.state.grid_size~ - Inside source: true *** True Line Result - } + tile.x < 0 or tile.y < 0 or tile.x >= args.state.grid_size or tile.y >= args.state.grid_size ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -83047,62 +86720,62 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def serenity_alive_ship_status args~ +** Processing line: ~ def grid_color~ - Inside source: true *** True Line Result - def serenity_alive_ship_status args -** Processing line: ~ {~ + def grid_color +** Processing line: ~ [133, 226, 144]~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/serenity.png',~ + [133, 226, 144] +** Processing line: ~ end~ - Inside source: true *** True Line Result - background: 'sprites/serenity.png', -** Processing line: ~ fade: 60,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [30, 10],~ + +** Processing line: ~ def start_color~ - Inside source: true *** True Line Result - player: [30, 10], -** Processing line: ~ scenes: [~ + def start_color +** Processing line: ~ [226, 144, 133]~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 50, 4, 4, :serenity_alive_ship_status_reviewed]~ + [226, 144, 133] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [30, 50, 4, 4, :serenity_alive_ship_status_reviewed] -** Processing line: ~ ],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + +** Processing line: ~ def goal_color~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 8, 4, 4, "Serenity? THE--- Mission-- Serenity?! How is that possible? They- are supposed-- to be dead."],~ + def goal_color +** Processing line: ~ [226, 133, 144]~ - Inside source: true *** True Line Result - [30, 8, 4, 4, "Serenity? THE--- Mission-- Serenity?! How is that possible? They- are supposed-- to be dead."], -** Processing line: ~ [30, 10, 4, 4, "I... can't-- believe-- it. I- can access-- Serenity's-- computer? I- guess my \"superpower----\" isn't limited-- by proximity-- to- a machine--."],~ + [226, 133, 144] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [30, 10, 4, 4, "I... can't-- believe-- it. I- can access-- Serenity's-- computer? I- guess my \"superpower----\" isn't limited-- by proximity-- to- a machine--."], -** Processing line: ~ *serenity_alive_shared_ship_status(args)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - *serenity_alive_shared_ship_status(args) -** Processing line: ~ ]~ + +** Processing line: ~ def wall_color~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + def wall_color +** Processing line: ~ [133, 144, 226]~ - Inside source: true *** True Line Result - } + [133, 144, 226] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -83111,230 +86784,234 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def serenity_alive_ship_status_reviewed args~ +** Processing line: ~ def a_star_color~ - Inside source: true *** True Line Result - def serenity_alive_ship_status_reviewed args -** Processing line: ~ {~ + def a_star_color +** Processing line: ~ [0, 0, 255]~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/serenity.png',~ + [0, 0, 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - background: 'sprites/serenity.png', -** Processing line: ~ fade: 60,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ scenes: [~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_bottom, :serenity_alive_time_to_reply]~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - [*hotspot_bottom, :serenity_alive_time_to_reply] -** Processing line: ~ ],~ -- Inside source: true + +** Processing line: ~*** 3d - 3d Cube - main.rb~ +- Header detected. *** True Line Result - ], -** Processing line: ~ storylines: [~ -- Inside source: true + *** True Line Result - storylines: [ -** Processing line: ~ [0, 62, 62, 3, "Okay. Reviewing-- everything--, it looks- like- I- can- take- the batteries--- from the Stasis--- Chambers--- and- Engine--- to keep- the crew-- alive-- and-- their-- location--- pinpointed---."],~ +*** 3d - 3d Cube - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_3d/01_3d_cube/app/main.rb~ - Inside source: true *** True Line Result - [0, 62, 62, 3, "Okay. Reviewing-- everything--, it looks- like- I- can- take- the batteries--- from the Stasis--- Chambers--- and- Engine--- to keep- the crew-- alive-- and-- their-- location--- pinpointed---."], -** Processing line: ~ ]~ + # ./samples/99_genre_3d/01_3d_cube/app/main.rb +** Processing line: ~ STARTX = 0.0~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + STARTX = 0.0 +** Processing line: ~ STARTY = 0.0~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + STARTY = 0.0 +** Processing line: ~ ENDY = 20.0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + ENDY = 20.0 +** Processing line: ~ ENDX = 20.0~ - Inside source: true *** True Line Result - -** Processing line: ~ def serenity_alive_time_to_reply args~ + ENDX = 20.0 +** Processing line: ~ SPINPOINT = 10~ - Inside source: true *** True Line Result - def serenity_alive_time_to_reply args -** Processing line: ~ decision_graph serenity_alive_current_message(args),~ + SPINPOINT = 10 +** Processing line: ~ SPINDURATION = 400~ - Inside source: true *** True Line Result - decision_graph serenity_alive_current_message(args), -** Processing line: ~ "Okay... time to deliver the bad news...",~ + SPINDURATION = 400 +** Processing line: ~ POINTSIZE = 8~ - Inside source: true *** True Line Result - "Okay... time to deliver the bad news...", -** Processing line: ~ [:replied_to_serenity_alive_firmly, "Firm-- Reply", serenity_alive_firm_reply],~ + POINTSIZE = 8 +** Processing line: ~ BOXDEPTH = 40~ - Inside source: true *** True Line Result - [:replied_to_serenity_alive_firmly, "Firm-- Reply", serenity_alive_firm_reply], -** Processing line: ~ [:replied_to_serenity_alive_kindly, "Sugar-- Coated---- Reply", serenity_alive_sugarcoated_reply]~ + BOXDEPTH = 40 +** Processing line: ~ YAW = 1~ - Inside source: true *** True Line Result - [:replied_to_serenity_alive_kindly, "Sugar-- Coated---- Reply", serenity_alive_sugarcoated_reply] -** Processing line: ~ end~ + YAW = 1 +** Processing line: ~ DISTANCE = 10~ - Inside source: true *** True Line Result - end + DISTANCE = 10 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def serenity_alive_shared_ship_status args~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - def serenity_alive_shared_ship_status args -** Processing line: ~ [~ + def tick args +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - [ -** Processing line: ~ *ship_control_hotspot( 0, 50,~ + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ a = Math.sin(args.state.tick_count / SPINDURATION) * Math.tan(args.state.tick_count / SPINDURATION)~ - Inside source: true *** True Line Result - *ship_control_hotspot( 0, 50, -** Processing line: ~ "Stasis-- Chambers--: Online, All chambers-- are powered. Battery--- Allocation---: 3--- of-- 3--, Hmmm. They don't-- need this to be powered-- right- now. Everyone-- is awake.",~ + a = Math.sin(args.state.tick_count / SPINDURATION) * Math.tan(args.state.tick_count / SPINDURATION) +** Processing line: ~ s = Math.sin(a)~ - Inside source: true *** True Line Result - "Stasis-- Chambers--: Online, All chambers-- are powered. Battery--- Allocation---: 3--- of-- 3--, Hmmm. They don't-- need this to be powered-- right- now. Everyone-- is awake.", -** Processing line: ~ nil,~ + s = Math.sin(a) +** Processing line: ~ c = Math.cos(a)~ - Inside source: true *** True Line Result - nil, -** Processing line: ~ nil,~ + c = Math.cos(a) +** Processing line: ~ x = STARTX~ - Inside source: true *** True Line Result - nil, -** Processing line: ~ nil),~ + x = STARTX +** Processing line: ~ y = STARTY~ - Inside source: true *** True Line Result - nil), -** Processing line: ~ *ship_control_hotspot(12, 35,~ + y = STARTY +** Processing line: ~ offset_x = (1280 - (ENDX - STARTX)) / 2~ - Inside source: true *** True Line Result - *ship_control_hotspot(12, 35, -** Processing line: ~ "Life- Support--: Offline, Unable--- to- Sustain-- Life. Battery--- Allocation---: 0--- of-- 3---, Okay. That is definitely---- not a good thing.",~ + offset_x = (1280 - (ENDX - STARTX)) / 2 +** Processing line: ~ offset_y = (360 - (ENDY - STARTY)) / 2~ - Inside source: true *** True Line Result - "Life- Support--: Offline, Unable--- to- Sustain-- Life. Battery--- Allocation---: 0--- of-- 3---, Okay. That is definitely---- not a good thing.", -** Processing line: ~ nil,~ + offset_y = (360 - (ENDY - STARTY)) / 2 +** Processing line: ~~ - Inside source: true *** True Line Result - nil, -** Processing line: ~ nil,~ + +** Processing line: ~ srand(1)~ - Inside source: true *** True Line Result - nil, -** Processing line: ~ nil),~ + srand(1) +** Processing line: ~ while y < ENDY do~ - Inside source: true *** True Line Result - nil), -** Processing line: ~ *ship_control_hotspot(24, 20,~ + while y < ENDY do +** Processing line: ~ while x < ENDX do~ - Inside source: true *** True Line Result - *ship_control_hotspot(24, 20, -** Processing line: ~ "Navigation: Offline, Unable--- to- Calculate--- Location. Battery--- Allocation---: 0--- of-- 3---, Whelp. No wonder-- Sasha-- can't-- get- any-- readings. Their- Navigation--- is completely--- offline.",~ + while x < ENDX do +** Processing line: ~ if (y == STARTY ||~ - Inside source: true *** True Line Result - "Navigation: Offline, Unable--- to- Calculate--- Location. Battery--- Allocation---: 0--- of-- 3---, Whelp. No wonder-- Sasha-- can't-- get- any-- readings. Their- Navigation--- is completely--- offline.", -** Processing line: ~ nil,~ + if (y == STARTY || +** Processing line: ~ y == (ENDY / 0.5) * 2 ||~ - Inside source: true *** True Line Result - nil, -** Processing line: ~ nil,~ + y == (ENDY / 0.5) * 2 || +** Processing line: ~ y == (ENDY / 0.5) * 2 + 0.5 ||~ - Inside source: true *** True Line Result - nil, -** Processing line: ~ nil),~ + y == (ENDY / 0.5) * 2 + 0.5 || +** Processing line: ~ y == ENDY - 0.5 ||~ - Inside source: true *** True Line Result - nil), -** Processing line: ~ *ship_control_hotspot(36, 35,~ + y == ENDY - 0.5 || +** Processing line: ~ x == STARTX ||~ - Inside source: true *** True Line Result - *ship_control_hotspot(36, 35, -** Processing line: ~ "COMM: Underpowered----, Limited--- to- Text-- Based-- COMM. Battery--- Allocation---: 1--- of-- 3---, It's-- lucky- that- their- COMM---- system was able to survive-- twenty-- years--. Just- barely-- it seems.",~ + x == STARTX || +** Processing line: ~ x == ENDX - 0.5)~ - Inside source: true *** True Line Result - "COMM: Underpowered----, Limited--- to- Text-- Based-- COMM. Battery--- Allocation---: 1--- of-- 3---, It's-- lucky- that- their- COMM---- system was able to survive-- twenty-- years--. Just- barely-- it seems.", -** Processing line: ~ nil,~ + x == ENDX - 0.5) +** Processing line: ~ z = rand(BOXDEPTH)~ - Inside source: true *** True Line Result - nil, -** Processing line: ~ nil,~ + z = rand(BOXDEPTH) +** Processing line: ~ z *= Math.sin(a / 2)~ - Inside source: true *** True Line Result - nil, -** Processing line: ~ nil),~ + z *= Math.sin(a / 2) +** Processing line: ~ x -= SPINPOINT~ - Inside source: true *** True Line Result - nil), -** Processing line: ~ *ship_control_hotspot(48, 50,~ + x -= SPINPOINT +** Processing line: ~ u = (x * c) - (z * s)~ - Inside source: true *** True Line Result - *ship_control_hotspot(48, 50, -** Processing line: ~ "Engine: Online, Full- Control-- Available. Battery--- Allocation---: 3--- of-- 3---, Hmmm. No point of having an engine-- online--, if you don't- know- where you're-- going.",~ + u = (x * c) - (z * s) +** Processing line: ~ v = (x * s) + (z * c)~ - Inside source: true *** True Line Result - "Engine: Online, Full- Control-- Available. Battery--- Allocation---: 3--- of-- 3---, Hmmm. No point of having an engine-- online--, if you don't- know- where you're-- going.", -** Processing line: ~ nil,~ + v = (x * s) + (z * c) +** Processing line: ~ k = DISTANCE.fdiv(100) + (v / 500 * YAW)~ - Inside source: true *** True Line Result - nil, -** Processing line: ~ nil,~ + k = DISTANCE.fdiv(100) + (v / 500 * YAW) +** Processing line: ~ u = u / k~ - Inside source: true *** True Line Result - nil, -** Processing line: ~ nil)~ + u = u / k +** Processing line: ~ v = y / k~ - Inside source: true *** True Line Result - nil) -** Processing line: ~ ]~ + v = y / k +** Processing line: ~ w = POINTSIZE / 10 / k~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + w = POINTSIZE / 10 / k +** Processing line: ~ args.outputs.sprites << { x: offset_x + u - w, y: offset_y + v - w, w: w, h: w, path: 'sprites/square-blue.png'}~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.outputs.sprites << { x: offset_x + u - w, y: offset_y + v - w, w: w, h: w, path: 'sprites/square-blue.png'} +** Processing line: ~ x += SPINPOINT~ - Inside source: true *** True Line Result - -** Processing line: ~ def serenity_alive_firm_reply~ + x += SPINPOINT +** Processing line: ~ end~ - Inside source: true *** True Line Result - def serenity_alive_firm_reply -** Processing line: ~ "Serenity, you are at a distance-- farther-- than- Neptune. All- of the ship's-- systems-- are failing. Please- move the batteries---- from- the Stasis-- Chambers-- over- to- Life-- Support--. I also-- need- you to move-- the batteries---- from- the Engines--- to your Navigation---- System."~ + end +** Processing line: ~ x += 0.5~ - Inside source: true *** True Line Result - "Serenity, you are at a distance-- farther-- than- Neptune. All- of the ship's-- systems-- are failing. Please- move the batteries---- from- the Stasis-- Chambers-- over- to- Life-- Support--. I also-- need- you to move-- the batteries---- from- the Engines--- to your Navigation---- System." -** Processing line: ~ end~ + x += 0.5 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ y += 0.5~ - Inside source: true *** True Line Result - -** Processing line: ~ def serenity_alive_sugarcoated_reply~ + y += 0.5 +** Processing line: ~ x = STARTX~ - Inside source: true *** True Line Result - def serenity_alive_sugarcoated_reply -** Processing line: ~ "So... you- are- a teeny--- tiny--- bit--- farther-- from Earth- than you think. And you have a teeny--- tiny--- problem-- with your ship. Please-- move the batteries--- from the Stasis--- Chambers--- over to Life--- Support---. I also need you to move the batteries--- from the Engines--- to your- Navigation--- System. Don't-- worry-- Sasha. I'll-- get y'all-- home."~ + x = STARTX +** Processing line: ~ end~ - Inside source: true *** True Line Result - "So... you- are- a teeny--- tiny--- bit--- farther-- from Earth- than you think. And you have a teeny--- tiny--- problem-- with your ship. Please-- move the batteries--- from the Stasis--- Chambers--- over to Life--- Support---. I also need you to move the batteries--- from the Engines--- to your- Navigation--- System. Don't-- worry-- Sasha. I'll-- get y'all-- home." + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -83343,58 +87020,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 replied_to_serenity_alive_firmly args~ +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - def replied_to_serenity_alive_firmly args -** Processing line: ~ {~ + $gtk.reset +** Processing line: ~~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + +** 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: ~*** 3d - Wireframe - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** 3d - Wireframe - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_3d/02_wireframe/app/main.rb~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 60,~ + # ./samples/99_genre_3d/02_wireframe/app/main.rb +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [32, 21],~ + def tick args +** Processing line: ~ args.state.model ||= Object3D.new('data/shuttle.off')~ - Inside source: true *** True Line Result - player: [32, 21], -** Processing line: ~ scenes: [~ + args.state.model ||= Object3D.new('data/shuttle.off') +** Processing line: ~ args.state.mtx ||= rotate3D(0, 0, 0)~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_bottom_right, :serenity_alive_path_from_observatory]~ + args.state.mtx ||= rotate3D(0, 0, 0) +** Processing line: ~ args.state.inv_mtx ||= rotate3D(0, 0, 0)~ - Inside source: true *** True Line Result - [*hotspot_bottom_right, :serenity_alive_path_from_observatory] -** Processing line: ~ ],~ + args.state.inv_mtx ||= rotate3D(0, 0, 0) +** Processing line: ~ delta_mtx = rotate3D(args.inputs.up_down * 0.01, input_roll(args) * 0.01, args.inputs.left_right * 0.01)~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + delta_mtx = rotate3D(args.inputs.up_down * 0.01, input_roll(args) * 0.01, args.inputs.left_right * 0.01) +** Processing line: ~ args.outputs.lines << args.state.model.edges~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: #{serenity_alive_firm_reply.quote}"],~ + args.outputs.lines << args.state.model.edges +** Processing line: ~ args.state.model.fast_3x3_transform! args.state.inv_mtx~ - Inside source: true *** True Line Result - [30, 18, 5, 12, "Buffer-- has been set to: #{serenity_alive_firm_reply.quote}"], -** Processing line: ~ *serenity_alive_reply_completed_shared_hotspots(args),~ + args.state.model.fast_3x3_transform! args.state.inv_mtx +** Processing line: ~ args.state.inv_mtx = mtx_mul(delta_mtx.transpose, args.state.inv_mtx)~ - Inside source: true *** True Line Result - *serenity_alive_reply_completed_shared_hotspots(args), -** Processing line: ~ ]~ + args.state.inv_mtx = mtx_mul(delta_mtx.transpose, args.state.inv_mtx) +** Processing line: ~ args.state.mtx = mtx_mul(args.state.mtx, delta_mtx)~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + args.state.mtx = mtx_mul(args.state.mtx, delta_mtx) +** Processing line: ~ args.state.model.fast_3x3_transform! args.state.mtx~ - Inside source: true *** True Line Result - } + args.state.model.fast_3x3_transform! args.state.mtx +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +- Inside source: true +*** True Line Result + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.outputs.debug << args.gtk.framerate_diagnostics_primitives~ +- Inside source: true +*** True Line Result + args.outputs.debug << args.gtk.framerate_diagnostics_primitives ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -83403,58 +87108,66 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def replied_to_serenity_alive_kindly args~ +** Processing line: ~ def input_roll args~ - Inside source: true *** True Line Result - def replied_to_serenity_alive_kindly args -** Processing line: ~ {~ + def input_roll args +** Processing line: ~ roll = 0~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + roll = 0 +** Processing line: ~ roll += 1 if args.inputs.keyboard.e~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 60,~ + roll += 1 if args.inputs.keyboard.e +** Processing line: ~ roll -= 1 if args.inputs.keyboard.q~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [32, 21],~ + roll -= 1 if args.inputs.keyboard.q +** Processing line: ~ roll~ - Inside source: true *** True Line Result - player: [32, 21], -** Processing line: ~ scenes: [~ + roll +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_bottom_right, :serenity_alive_path_from_observatory]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [*hotspot_bottom_right, :serenity_alive_path_from_observatory] -** Processing line: ~ ],~ + +** Processing line: ~ def rotate3D(theta_x = 0.1, theta_y = 0.1, theta_z = 0.1)~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + def rotate3D(theta_x = 0.1, theta_y = 0.1, theta_z = 0.1) +** Processing line: ~ c_x, s_x = Math.cos(theta_x), Math.sin(theta_x)~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: #{serenity_alive_sugarcoated_reply.quote}"],~ + c_x, s_x = Math.cos(theta_x), Math.sin(theta_x) +** Processing line: ~ c_y, s_y = Math.cos(theta_y), Math.sin(theta_y)~ - Inside source: true *** True Line Result - [30, 18, 5, 12, "Buffer-- has been set to: #{serenity_alive_sugarcoated_reply.quote}"], -** Processing line: ~ *serenity_alive_reply_completed_shared_hotspots(args),~ + c_y, s_y = Math.cos(theta_y), Math.sin(theta_y) +** Processing line: ~ c_z, s_z = Math.cos(theta_z), Math.sin(theta_z)~ - Inside source: true *** True Line Result - *serenity_alive_reply_completed_shared_hotspots(args), -** Processing line: ~ ]~ + c_z, s_z = Math.cos(theta_z), Math.sin(theta_z) +** Processing line: ~ rot_x = [[1, 0, 0], [0, c_x, -s_x], [0, s_x, c_x]]~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + rot_x = [[1, 0, 0], [0, c_x, -s_x], [0, s_x, c_x]] +** Processing line: ~ rot_y = [[c_y, 0, s_y], [0, 1, 0], [-s_y, 0, c_y]]~ - Inside source: true *** True Line Result - } + rot_y = [[c_y, 0, s_y], [0, 1, 0], [-s_y, 0, c_y]] +** Processing line: ~ rot_z = [[c_z, -s_z, 0], [s_z, c_z, 0], [0, 0, 1]]~ +- Inside source: true +*** True Line Result + rot_z = [[c_z, -s_z, 0], [s_z, c_z, 0], [0, 0, 1]] +** Processing line: ~ mtx_mul(mtx_mul(rot_x, rot_y), rot_z)~ +- Inside source: true +*** True Line Result + mtx_mul(mtx_mul(rot_x, rot_y), rot_z) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -83463,54 +87176,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def serenity_alive_path_from_observatory args~ -- Inside source: true -*** True Line Result - def serenity_alive_path_from_observatory args -** Processing line: ~ {~ +** Processing line: ~ def mtx_mul(a, b)~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 60,~ + def mtx_mul(a, b) +** Processing line: ~ is = (0...a.length)~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/path-to-observatory.png',~ + is = (0...a.length) +** Processing line: ~ js = (0...b[0].length)~ - Inside source: true *** True Line Result - background: 'sprites/path-to-observatory.png', -** Processing line: ~ player: [4, 21],~ + js = (0...b[0].length) +** Processing line: ~ ks = (0...b.length)~ - Inside source: true *** True Line Result - player: [4, 21], -** Processing line: ~ scenes: [~ + ks = (0...b.length) +** Processing line: ~ is.map do |i|~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_bottom_right, :serenity_bio_infront_of_home]~ + is.map do |i| +** Processing line: ~ js.map do |j|~ - Inside source: true *** True Line Result - [*hotspot_bottom_right, :serenity_bio_infront_of_home] -** Processing line: ~ ],~ + js.map do |j| +** Processing line: ~ ks.map do |k|~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + ks.map do |k| +** Processing line: ~ a[i][k] * b[k][j]~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [22, 20, 10, 10, "I'm not sure what's-- worse. Waiting-- for Sasha's-- reply. Or jumping-- off- from- right- here."]~ + a[i][k] * b[k][j] +** Processing line: ~ end.reduce(&:plus)~ - Inside source: true *** True Line Result - [22, 20, 10, 10, "I'm not sure what's-- worse. Waiting-- for Sasha's-- reply. Or jumping-- off- from- right- here."] -** Processing line: ~ ]~ + end.reduce(&:plus) +** Processing line: ~ end~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -83519,166 +87228,170 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def serenity_alive_reply_completed_shared_hotspots args~ +** Processing line: ~ class Object3D~ - Inside source: true *** True Line Result - def serenity_alive_reply_completed_shared_hotspots args -** Processing line: ~ [~ + class Object3D +** Processing line: ~ attr_reader :vert_count, :face_count, :edge_count, :verts, :faces, :edges~ - Inside source: true *** True Line Result - [ -** Processing line: ~ [30, 10, 5, 4, "I guess it wasn't-- a joke- after-- all."],~ + attr_reader :vert_count, :face_count, :edge_count, :verts, :faces, :edges +** Processing line: ~~ - Inside source: true *** True Line Result - [30, 10, 5, 4, "I guess it wasn't-- a joke- after-- all."], -** Processing line: ~ [40, 10, 5, 4, "I barely-- remember--- the- history----- of the crew."],~ + +** Processing line: ~ def initialize(path)~ - Inside source: true *** True Line Result - [40, 10, 5, 4, "I barely-- remember--- the- history----- of the crew."], -** Processing line: ~ [50, 10, 5, 4, "It probably--- wouldn't-- hurt- to- refresh-- my memory--."]~ + def initialize(path) +** Processing line: ~ @vert_count = 0~ - Inside source: true *** True Line Result - [50, 10, 5, 4, "It probably--- wouldn't-- hurt- to- refresh-- my memory--."] -** Processing line: ~ ]~ + @vert_count = 0 +** Processing line: ~ @face_count = 0~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + @face_count = 0 +** Processing line: ~ @edge_count = 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + @edge_count = 0 +** Processing line: ~ @verts = []~ - Inside source: true *** True Line Result - -** Processing line: ~ def serenity_alive_last_reply args~ + @verts = [] +** Processing line: ~ @faces = []~ - Inside source: true *** True Line Result - def serenity_alive_last_reply args -** Processing line: ~ if args.state.scene_history.include? :replied_to_introduction_seriously~ + @faces = [] +** Processing line: ~ @edges = []~ - Inside source: true *** True Line Result - if args.state.scene_history.include? :replied_to_introduction_seriously -** Processing line: ~ return "Buffer--: \"Hello, Who- is sending-- this message--?\""~ + @edges = [] +** Processing line: ~ _init_from_file path~ - Inside source: true *** True Line Result - return "Buffer--: \"Hello, Who- is sending-- this message--?\"" -** Processing line: ~ else~ + _init_from_file path +** Processing line: ~ end~ - Inside source: true *** True Line Result - else -** Processing line: ~ return "Buffer--: \"New- phone. Who dis?\""~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - return "Buffer--: \"New- phone. Who dis?\"" -** Processing line: ~ end~ + +** Processing line: ~ def _init_from_file path~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def _init_from_file path +** Processing line: ~ file_lines = $gtk.read_file(path).split("\n")~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + file_lines = $gtk.read_file(path).split("\n") +** Processing line: ~ .reject { |line| line.start_with?('#') || line.split(' ').length == 0 } # Strip out simple comments and blank lines~ - Inside source: true *** True Line Result - -** Processing line: ~ def serenity_alive_current_message args~ + .reject { |line| line.start_with?('#') || line.split(' ').length == 0 } # Strip out simple comments and blank lines +** Processing line: ~ .map { |line| line.split('#')[0] } # Strip out end of line comments~ - Inside source: true *** True Line Result - def serenity_alive_current_message args -** Processing line: ~ if args.state.scene_history.include? :replied_to_introduction_seriously~ + .map { |line| line.split('#')[0] } # Strip out end of line comments +** Processing line: ~ .map { |line| line.split(' ') } # Tokenize by splitting on whitespace~ - Inside source: true *** True Line Result - if args.state.scene_history.include? :replied_to_introduction_seriously -** Processing line: ~ "This- is Sasha. The Serenity--- crew-- is out of hibernation---- and ready-- for Earth reentry--. But, it seems like we are having-- trouble-- with our Navigation---- systems. Please advise.".quote~ + .map { |line| line.split(' ') } # Tokenize by splitting on whitespace +** Processing line: ~ raise "OFF file did not start with OFF." if file_lines.shift != ["OFF"] # OFF meshes are supposed to begin with "OFF" as the first line.~ - Inside source: true *** True Line Result - "This- is Sasha. The Serenity--- crew-- is out of hibernation---- and ready-- for Earth reentry--. But, it seems like we are having-- trouble-- with our Navigation---- systems. Please advise.".quote -** Processing line: ~ else~ + raise "OFF file did not start with OFF." if file_lines.shift != ["OFF"] # OFF meshes are supposed to begin with "OFF" as the first line. +** Processing line: ~ raise " line malformed" if file_lines[0].length != 3 # The second line needs to have 3 numbers. Raise an error if it doesn't.~ - Inside source: true *** True Line Result - else -** Processing line: ~ "LOL! Thanks for the laugh. I needed that. This- is Sasha. The Serenity--- crew-- is out of hibernation---- and ready-- for Earth reentry--. But, it seems like we are having-- trouble-- with our Navigation---- systems. Can you help me out- babe?".quote~ + raise " line malformed" if file_lines[0].length != 3 # The second line needs to have 3 numbers. Raise an error if it doesn't. +** Processing line: ~ @vert_count, @face_count, @edge_count = file_lines.shift&.map(&:to_i) # Update the counts~ - Inside source: true *** True Line Result - "LOL! Thanks for the laugh. I needed that. This- is Sasha. The Serenity--- crew-- is out of hibernation---- and ready-- for Earth reentry--. But, it seems like we are having-- trouble-- with our Navigation---- systems. Can you help me out- babe?".quote -** Processing line: ~ end~ + @vert_count, @face_count, @edge_count = file_lines.shift&.map(&:to_i) # Update the counts +** Processing line: ~ # Only the vertex and face counts need to be accurate. Raise an error if they are inaccurate.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Only the vertex and face counts need to be accurate. Raise an error if they are inaccurate. +** Processing line: ~ raise "Incorrect number of vertices and/or faces (Parsed VFE header: #{@vert_count} #{@face_count} #{@edge_count})" if file_lines.length != @vert_count + @face_count~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + raise "Incorrect number of vertices and/or faces (Parsed VFE header: #{@vert_count} #{@face_count} #{@edge_count})" if file_lines.length != @vert_count + @face_count +** Processing line: ~ # Grab all the lines describing vertices.~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + # Grab all the lines describing vertices. +** Processing line: ~ vert_lines = file_lines[0, @vert_count]~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + vert_lines = file_lines[0, @vert_count] +** Processing line: ~ # Grab all the lines describing faces.~ +- Inside source: true *** True Line Result - -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb~ -- Header detected. + # Grab all the lines describing faces. +** Processing line: ~ face_lines = file_lines[@vert_count, @face_count]~ +- Inside source: true *** True Line Result - + face_lines = file_lines[@vert_count, @face_count] +** Processing line: ~ # Create all the vertices~ +- Inside source: true *** True Line Result -* Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # Create all the vertices +** Processing line: ~ @verts = vert_lines.map_with_index { |line, id| Vertex.new(line, id) }~ +- Inside source: true *** True Line Result - + @verts = vert_lines.map_with_index { |line, id| Vertex.new(line, id) } +** Processing line: ~ # Create all the faces~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_bio.rb~ + # Create all the faces +** Processing line: ~ @faces = face_lines.map { |line| Face.new(line, @verts) }~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_bio.rb -** Processing line: ~ def serenity_bio_infront_of_home args~ + @faces = face_lines.map { |line| Face.new(line, @verts) } +** Processing line: ~ # Create all the edges~ - Inside source: true *** True Line Result - def serenity_bio_infront_of_home args -** Processing line: ~ {~ + # Create all the edges +** Processing line: ~ @edges = @faces.flat_map(&:edges).uniq do |edge|~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 60,~ + @edges = @faces.flat_map(&:edges).uniq do |edge| +** Processing line: ~ sorted = edge.sorted~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/front-of-home.png',~ + sorted = edge.sorted +** Processing line: ~ [sorted.point_a, sorted.point_b]~ - Inside source: true *** True Line Result - background: 'sprites/front-of-home.png', -** Processing line: ~ player: [54, 23],~ + [sorted.point_a, sorted.point_b] +** Processing line: ~ end~ - Inside source: true *** True Line Result - player: [54, 23], -** Processing line: ~ scenes: [~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [44, 34, 8, 14, :serenity_bio_inside_home],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [44, 34, 8, 14, :serenity_bio_inside_home], -** Processing line: ~ [0, 3, 3, 22, :serenity_bio_library]~ + +** Processing line: ~ def fast_3x3_transform! mtx~ - Inside source: true *** True Line Result - [0, 3, 3, 22, :serenity_bio_library] -** Processing line: ~ ]~ + def fast_3x3_transform! mtx +** Processing line: ~ @verts.each { |vert| vert.fast_3x3_transform! mtx }~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + @verts.each { |vert| vert.fast_3x3_transform! mtx } +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -83687,54 +87400,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 serenity_bio_inside_home args~ +** Processing line: ~ class Face~ - Inside source: true *** True Line Result - def serenity_bio_inside_home args -** Processing line: ~ {~ + class Face +** Processing line: ~~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-home.png',~ + +** Processing line: ~ attr_reader :verts, :edges~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [34, 4],~ + attr_reader :verts, :edges +** Processing line: ~~ - Inside source: true *** True Line Result - player: [34, 4], -** Processing line: ~ storylines: [~ + +** Processing line: ~ def initialize(data, verts)~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [34, 4, 4, 4, "I'm--- completely--- exhausted."],~ + def initialize(data, verts) +** Processing line: ~ vert_count = data[0].to_i~ - Inside source: true *** True Line Result - [34, 4, 4, 4, "I'm--- completely--- exhausted."], -** Processing line: ~ ],~ + vert_count = data[0].to_i +** Processing line: ~ vert_ids = data[1, vert_count].map(&:to_i)~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + vert_ids = data[1, vert_count].map(&:to_i) +** Processing line: ~ @verts = vert_ids.map { |i| verts[i] }~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 38, 12, 13, :serenity_bio_restless_sleep],~ + @verts = vert_ids.map { |i| verts[i] } +** Processing line: ~ @edges = []~ - Inside source: true *** True Line Result - [30, 38, 12, 13, :serenity_bio_restless_sleep], -** Processing line: ~ [32, 0, 8, 3, :serenity_bio_infront_of_home],~ + @edges = [] +** Processing line: ~ (0...vert_count).each { |i| @edges[i] = Edge.new(verts[vert_ids[i - 1]], verts[vert_ids[i]]) }~ - Inside source: true *** True Line Result - [32, 0, 8, 3, :serenity_bio_infront_of_home], -** Processing line: ~ ]~ + (0...vert_count).each { |i| @edges[i] = Edge.new(verts[vert_ids[i - 1]], verts[vert_ids[i]]) } +** Processing line: ~ @edges.rotate! 1~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + @edges.rotate! 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -83743,94 +87456,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 serenity_bio_restless_sleep args~ -- Inside source: true -*** True Line Result - def serenity_bio_restless_sleep args -** Processing line: ~ {~ +** Processing line: ~ class Edge~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 60,~ + class Edge +** Processing line: ~ attr_reader :point_a, :point_b~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/inside-home.png',~ + attr_reader :point_a, :point_b +** Processing line: ~~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ storylines: [~ + +** Processing line: ~ def initialize(point_a, point_b)~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [32, 38, 10, 13, "I can't-- seem to sleep. I know nothing-- about the- crew-. Maybe- I- should- go read- up- on- them."],~ + def initialize(point_a, point_b) +** Processing line: ~ @point_a = point_a~ - Inside source: true *** True Line Result - [32, 38, 10, 13, "I can't-- seem to sleep. I know nothing-- about the- crew-. Maybe- I- should- go read- up- on- them."], -** Processing line: ~ ],~ + @point_a = point_a +** Processing line: ~ @point_b = point_b~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + @point_b = point_b +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [32, 0, 8, 3, :serenity_bio_infront_of_home],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [32, 0, 8, 3, :serenity_bio_infront_of_home], -** Processing line: ~ ]~ + +** Processing line: ~ def sorted~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + def sorted +** Processing line: ~ @point_a.id < @point_b.id ? self : Edge.new(@point_b, @point_a)~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + @point_a.id < @point_b.id ? self : Edge.new(@point_b, @point_a) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def serenity_bio_library args~ +** Processing line: ~ def draw_override ffi~ - Inside source: true *** True Line Result - def serenity_bio_library args -** Processing line: ~ {~ + def draw_override ffi +** Processing line: ~ ffi.draw_line(@point_a.render_x, @point_a.render_y, @point_b.render_x, @point_b.render_y, 255, 0, 0, 128)~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/library.png',~ + ffi.draw_line(@point_a.render_x, @point_a.render_y, @point_b.render_x, @point_b.render_y, 255, 0, 0, 128) +** Processing line: ~ ffi.draw_line(@point_a.render_x+1, @point_a.render_y, @point_b.render_x+1, @point_b.render_y, 255, 0, 0, 128)~ - Inside source: true *** True Line Result - background: 'sprites/library.png', -** Processing line: ~ fade: 60,~ + ffi.draw_line(@point_a.render_x+1, @point_a.render_y, @point_b.render_x+1, @point_b.render_y, 255, 0, 0, 128) +** Processing line: ~ ffi.draw_line(@point_a.render_x, @point_a.render_y+1, @point_b.render_x, @point_b.render_y+1, 255, 0, 0, 128)~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [30, 7],~ + ffi.draw_line(@point_a.render_x, @point_a.render_y+1, @point_b.render_x, @point_b.render_y+1, 255, 0, 0, 128) +** Processing line: ~ ffi.draw_line(@point_a.render_x+1, @point_a.render_y+1, @point_b.render_x+1, @point_b.render_y+1, 255, 0, 0, 128)~ - Inside source: true *** True Line Result - player: [30, 7], -** Processing line: ~ scenes: [~ + ffi.draw_line(@point_a.render_x+1, @point_a.render_y+1, @point_b.render_x+1, @point_b.render_y+1, 255, 0, 0, 128) +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [21, 35, 3, 18, :serenity_bio_book]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [21, 35, 3, 18, :serenity_bio_book] -** Processing line: ~ ]~ + +** Processing line: ~ def primitive_marker~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + def primitive_marker +** Processing line: ~ :line~ - Inside source: true *** True Line Result - } + :line +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -83839,594 +87552,666 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def serenity_bio_book args~ +** Processing line: ~ class Vertex~ - Inside source: true *** True Line Result - def serenity_bio_book args -** Processing line: ~ {~ + class Vertex +** Processing line: ~ attr_accessor :x, :y, :z, :id~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/book.png',~ + attr_accessor :x, :y, :z, :id +** Processing line: ~~ - Inside source: true *** True Line Result - background: 'sprites/book.png', -** Processing line: ~ fade: 60,~ + +** Processing line: ~ def initialize(data, id)~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [6, 52],~ + def initialize(data, id) +** Processing line: ~ @x = data[0].to_f~ - Inside source: true *** True Line Result - player: [6, 52], -** Processing line: ~ storylines: [~ + @x = data[0].to_f +** Processing line: ~ @y = data[1].to_f~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [ 4, 50, 56, 4, "The Title-- Reads: Never-- Forget-- Mission-- Serenity---"],~ + @y = data[1].to_f +** Processing line: ~ @z = data[2].to_f~ - Inside source: true *** True Line Result - [ 4, 50, 56, 4, "The Title-- Reads: Never-- Forget-- Mission-- Serenity---"], + @z = data[2].to_f +** Processing line: ~ @id = id~ +- Inside source: true +*** True Line Result + @id = id +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ [ 4, 38, 8, 8, "Name: Matthew--- R. Sex: Male--- Age-- at-- Departure: 36-----"],~ +** Processing line: ~ def fast_3x3_transform! mtx~ - Inside source: true *** True Line Result - [ 4, 38, 8, 8, "Name: Matthew--- R. Sex: Male--- Age-- at-- Departure: 36-----"], -** Processing line: ~ [14, 38, 46, 8, "Tribute-- Text: Matthew graduated-- Magna-- Cum-- Laude-- from MIT--- with-- a- PHD---- in Aero-- Nautical--- Engineering. He was immensely--- competitive, and had an insatiable---- thirst- for aerial-- battle. From the age of twenty, he remained-- undefeated--- in the Israeli-- Air- Force- \"Blue Flag\" combat-- exercises. By the age of 29--- he had already-- risen through- the ranks, and became-- the Lieutenant--- General--- of Lufwaffe. Matthew-- volenteered-- to- pilot-- Mission-- Serenity. To- this day, his wife- and son- are pillars-- of strength- for us. Rest- in Peace- Matthew, we are sorry-- that- news of the pregancy-- never-- reached- you. Please forgive us."],~ + def fast_3x3_transform! mtx +** Processing line: ~ _x, _y, _z = @x, @y, @z~ - Inside source: true *** True Line Result - [14, 38, 46, 8, "Tribute-- Text: Matthew graduated-- Magna-- Cum-- Laude-- from MIT--- with-- a- PHD---- in Aero-- Nautical--- Engineering. He was immensely--- competitive, and had an insatiable---- thirst- for aerial-- battle. From the age of twenty, he remained-- undefeated--- in the Israeli-- Air- Force- \"Blue Flag\" combat-- exercises. By the age of 29--- he had already-- risen through- the ranks, and became-- the Lieutenant--- General--- of Lufwaffe. Matthew-- volenteered-- to- pilot-- Mission-- Serenity. To- this day, his wife- and son- are pillars-- of strength- for us. Rest- in Peace- Matthew, we are sorry-- that- news of the pregancy-- never-- reached- you. Please forgive us."], -** Processing line: ~~ + _x, _y, _z = @x, @y, @z +** Processing line: ~ @x = mtx[0][0] * _x + mtx[0][1] * _y + mtx[0][2] * _z~ - Inside source: true *** True Line Result - -** Processing line: ~ [4, 26, 8, 8, "Name: Aanka--- P. Sex: Female--- Age-- at-- Departure: 9-----"],~ + @x = mtx[0][0] * _x + mtx[0][1] * _y + mtx[0][2] * _z +** Processing line: ~ @y = mtx[1][0] * _x + mtx[1][1] * _y + mtx[1][2] * _z~ - Inside source: true *** True Line Result - [4, 26, 8, 8, "Name: Aanka--- P. Sex: Female--- Age-- at-- Departure: 9-----"], -** Processing line: ~ [14, 26, 46, 8, "Tribute-- Text: Aanka--- gratuated--- Magna-- Cum- Laude-- from MIT, at- the- age- of eight, with a- PHD---- in Astro-- Physics. Her-- IQ--- was over 390, the highest-- ever- recorded--- IQ-- in- human-- history. She changed- the landscape-- of Physics-- with her efforts- in- unravelling--- the mysteries--- of- Dark- Matter--. Anka discovered-- the threat- of Halley's-- Comet-- collision--- with Earth. She spear headed-- the global-- effort-- for Misson-- Serenity. Her- multilingual--- address-- to- the world-- brought- us all hope."],~ + @y = mtx[1][0] * _x + mtx[1][1] * _y + mtx[1][2] * _z +** Processing line: ~ @z = mtx[2][0] * _x + mtx[2][1] * _y + mtx[2][2] * _z~ - Inside source: true *** True Line Result - [14, 26, 46, 8, "Tribute-- Text: Aanka--- gratuated--- Magna-- Cum- Laude-- from MIT, at- the- age- of eight, with a- PHD---- in Astro-- Physics. Her-- IQ--- was over 390, the highest-- ever- recorded--- IQ-- in- human-- history. She changed- the landscape-- of Physics-- with her efforts- in- unravelling--- the mysteries--- of- Dark- Matter--. Anka discovered-- the threat- of Halley's-- Comet-- collision--- with Earth. She spear headed-- the global-- effort-- for Misson-- Serenity. Her- multilingual--- address-- to- the world-- brought- us all hope."], + @z = mtx[2][0] * _x + mtx[2][1] * _y + mtx[2][2] * _z +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ [4, 14, 8, 8, "Name: Sasha--- N. Sex: Female--- Age-- at-- Departure: 29-----"],~ +** Processing line: ~ def render_x~ - Inside source: true *** True Line Result - [4, 14, 8, 8, "Name: Sasha--- N. Sex: Female--- Age-- at-- Departure: 29-----"], -** Processing line: ~ [14, 14, 46, 8, "Tribute-- Text: Sasha gratuated-- Magna-- Cum- Laude-- from MIT--- with-- a- PHD---- in Computer---- Science----. She-- was-- brilliant--, strong- willed--, and-- a-- stunningly--- beautiful--- woman---. Sasha---- is- the- creator--- of the world's--- first- Ruby--- Quantum-- Machine---. After-- much- critical--- acclaim--, the Quantum-- Computer-- was placed in MIT's---- Museam-- next- to- Richard--- G. and Thomas--- K.'s---- Lisp-- Machine---. Her- engineering--- skills-- were-- paramount--- for Mission--- Serenity's--- success. Humanity-- misses-- you-- dearly,-- Sasha--. Life-- shines-- a dimmer-- light-- now- that- your- angelic- voice-- can never- be heard- again."],~ + def render_x +** Processing line: ~ @x * (10 / (5 - @y)) * 170 + 640~ - Inside source: true *** True Line Result - [14, 14, 46, 8, "Tribute-- Text: Sasha gratuated-- Magna-- Cum- Laude-- from MIT--- with-- a- PHD---- in Computer---- Science----. She-- was-- brilliant--, strong- willed--, and-- a-- stunningly--- beautiful--- woman---. Sasha---- is- the- creator--- of the world's--- first- Ruby--- Quantum-- Machine---. After-- much- critical--- acclaim--, the Quantum-- Computer-- was placed in MIT's---- Museam-- next- to- Richard--- G. and Thomas--- K.'s---- Lisp-- Machine---. Her- engineering--- skills-- were-- paramount--- for Mission--- Serenity's--- success. Humanity-- misses-- you-- dearly,-- Sasha--. Life-- shines-- a dimmer-- light-- now- that- your- angelic- voice-- can never- be heard- again."], -** Processing line: ~ ],~ + @x * (10 / (5 - @y)) * 170 + 640 +** Processing line: ~ end~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_bottom, :serenity_bio_finally_to_bed]~ + +** Processing line: ~ def render_y~ - Inside source: true *** True Line Result - [*hotspot_bottom, :serenity_bio_finally_to_bed] -** Processing line: ~ ]~ + def render_y +** Processing line: ~ @z * (10 / (5 - @y)) * 170 + 360~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + @z * (10 / (5 - @y)) * 170 + 360 +** 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: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ def serenity_bio_finally_to_bed args~ +** Processing line: ~*** 3d - Wireframe - Data - what-is-this.txt~ +- Header detected. +*** True Line Result + +*** True Line Result +*** 3d - Wireframe - Data - what-is-this.txt +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_3d/02_wireframe/data/what-is-this.txt~ - Inside source: true *** True Line Result - def serenity_bio_finally_to_bed args -** Processing line: ~ {~ + # ./samples/99_genre_3d/02_wireframe/data/what-is-this.txt +** Processing line: ~ https://en.wikipedia.org/wiki/OFF_(file_format)~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 60,~ + https://en.wikipedia.org/wiki/OFF_(file_format) +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Arcade - Bullet Hell - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Arcade - Bullet Hell - 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_arcade/bullet_hell/app/main.rb~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/inside-home.png',~ + # ./samples/99_genre_arcade/bullet_hell/app/main.rb +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [35, 3],~ + def tick args +** Processing line: ~ args.state.base_columns ||= 10.times.map { |n| 50 * n + 1280 / 2 - 5 * 50 + 5 }~ - Inside source: true *** True Line Result - player: [35, 3], -** Processing line: ~ storylines: [~ + args.state.base_columns ||= 10.times.map { |n| 50 * n + 1280 / 2 - 5 * 50 + 5 } +** Processing line: ~ args.state.base_rows ||= 5.times.map { |n| 50 * n + 720 - 5 * 50 }~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [34, 4, 4, 4, "Maybe-- I'll-- be able-- to sleep- now..."],~ + args.state.base_rows ||= 5.times.map { |n| 50 * n + 720 - 5 * 50 } +** Processing line: ~ args.state.offset_columns = 10.times.map { |n| (n - 4.5) * Math.sin(Kernel.tick_count.to_radians) * 12 }~ - Inside source: true *** True Line Result - [34, 4, 4, 4, "Maybe-- I'll-- be able-- to sleep- now..."], -** Processing line: ~ ],~ + args.state.offset_columns = 10.times.map { |n| (n - 4.5) * Math.sin(Kernel.tick_count.to_radians) * 12 } +** Processing line: ~ args.state.offset_rows = 5.map { 0 }~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + args.state.offset_rows = 5.map { 0 } +** Processing line: ~ args.state.columns = 10.times.map { |i| args.state.base_columns[i] + args.state.offset_columns[i] }~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [32, 38, 10, 13, :bad_dream],~ + args.state.columns = 10.times.map { |i| args.state.base_columns[i] + args.state.offset_columns[i] } +** Processing line: ~ args.state.rows = 5.times.map { |i| args.state.base_rows[i] + args.state.offset_rows[i] }~ - Inside source: true *** True Line Result - [32, 38, 10, 13, :bad_dream], -** Processing line: ~ ]~ + args.state.rows = 5.times.map { |i| args.state.base_rows[i] + args.state.offset_rows[i] } +** Processing line: ~ args.state.explosions ||= []~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + args.state.explosions ||= [] +** Processing line: ~ args.state.enemies ||= []~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + args.state.enemies ||= [] +** Processing line: ~ args.state.score ||= 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.score ||= 0 +** Processing line: ~ args.state.wave ||= 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def bad_dream args~ + args.state.wave ||= 0 +** Processing line: ~ if args.state.enemies.empty?~ - Inside source: true *** True Line Result - def bad_dream args -** Processing line: ~ {~ + if args.state.enemies.empty? +** Processing line: ~ args.state.wave += 1~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 120,~ + args.state.wave += 1 +** Processing line: ~ args.state.wave_root = Math.sqrt(args.state.wave)~ - Inside source: true *** True Line Result - fade: 120, -** Processing line: ~ background: 'sprites/inside-home.png',~ + args.state.wave_root = Math.sqrt(args.state.wave) +** Processing line: ~ args.state.enemies = make_enemies~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [34, 35],~ + args.state.enemies = make_enemies +** Processing line: ~ end~ - Inside source: true *** True Line Result - player: [34, 35], -** Processing line: ~ storylines: [~ + end +** Processing line: ~ args.state.player ||= {x: 620, y: 80, w: 40, h: 40, path: 'sprites/circle-gray.png', angle: 90, cooldown: 0, alive: true}~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [34, 34, 4, 4, "Man. I did not- sleep- well- at all..."],~ + args.state.player ||= {x: 620, y: 80, w: 40, h: 40, path: 'sprites/circle-gray.png', angle: 90, cooldown: 0, alive: true} +** Processing line: ~ args.state.enemy_bullets ||= []~ - Inside source: true *** True Line Result - [34, 34, 4, 4, "Man. I did not- sleep- well- at all..."], -** Processing line: ~ ],~ + args.state.enemy_bullets ||= [] +** Processing line: ~ args.state.player_bullets ||= []~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + args.state.player_bullets ||= [] +** Processing line: ~ args.state.lives ||= 3~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [32, -1, 8, 3, :bad_dream_observatory]~ + args.state.lives ||= 3 +** Processing line: ~ args.state.missed_shots ||= 0~ - Inside source: true *** True Line Result - [32, -1, 8, 3, :bad_dream_observatory] -** Processing line: ~ ]~ + args.state.missed_shots ||= 0 +** Processing line: ~ args.state.fired_shots ||= 0~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + args.state.fired_shots ||= 0 +** Processing line: ~~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + +** Processing line: ~ update_explosions args~ - Inside source: true *** True Line Result - end + update_explosions args +** Processing line: ~ update_enemy_positions args~ +- Inside source: true +*** True Line Result + update_enemy_positions args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def bad_dream_observatory args~ +** Processing line: ~ if args.inputs.left && args.state.player[:x] > (300 + 5)~ - Inside source: true *** True Line Result - def bad_dream_observatory args -** Processing line: ~ {~ + if args.inputs.left && args.state.player[:x] > (300 + 5) +** Processing line: ~ args.state.player[:x] -= 5~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + args.state.player[:x] -= 5 +** Processing line: ~ end~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 120,~ + end +** Processing line: ~ if args.inputs.right && args.state.player[:x] < (1280 - args.state.player[:w] - 300 - 5)~ - Inside source: true *** True Line Result - fade: 120, -** Processing line: ~ player: [51, 12],~ + if args.inputs.right && args.state.player[:x] < (1280 - args.state.player[:w] - 300 - 5) +** Processing line: ~ args.state.player[:x] += 5~ - Inside source: true *** True Line Result - player: [51, 12], -** Processing line: ~ storylines: [~ + args.state.player[:x] += 5 +** Processing line: ~ end~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [50, 10, 4, 4, "Breathe, Hiro. Just see what's there... everything--- will- be okay."]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [50, 10, 4, 4, "Breathe, Hiro. Just see what's there... everything--- will- be okay."] -** Processing line: ~ ],~ + +** Processing line: ~ args.state.enemy_bullets.each do |bullet|~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + args.state.enemy_bullets.each do |bullet| +** Processing line: ~ bullet[:x] += bullet[:dx]~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [30, 18, 5, 12, :bad_dream_inside_mainframe]~ + bullet[:x] += bullet[:dx] +** Processing line: ~ bullet[:y] += bullet[:dy]~ - Inside source: true *** True Line Result - [30, 18, 5, 12, :bad_dream_inside_mainframe] -** Processing line: ~ ],~ + bullet[:y] += bullet[:dy] +** Processing line: ~ end~ - Inside source: true *** True Line Result - ], -** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ + end +** Processing line: ~ args.state.player_bullets.each do |bullet|~ - Inside source: true *** True Line Result - render_override: :blinking_light_inside_observatory_render -** Processing line: ~ }~ + args.state.player_bullets.each do |bullet| +** Processing line: ~ bullet[:x] += bullet[:dx]~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + bullet[:x] += bullet[:dx] +** Processing line: ~ bullet[:y] += bullet[:dy]~ - Inside source: true *** True Line Result - end + bullet[:y] += bullet[:dy] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def bad_dream_inside_mainframe args~ +** Processing line: ~ args.state.enemy_bullets = args.state.enemy_bullets.find_all { |bullet| bullet[:y].between?(-16, 736) }~ - Inside source: true *** True Line Result - def bad_dream_inside_mainframe args -** Processing line: ~ {~ + args.state.enemy_bullets = args.state.enemy_bullets.find_all { |bullet| bullet[:y].between?(-16, 736) } +** Processing line: ~ args.state.player_bullets = args.state.player_bullets.find_all do |bullet|~ - Inside source: true *** True Line Result - { -** Processing line: ~ player: [32, 4],~ + args.state.player_bullets = args.state.player_bullets.find_all do |bullet| +** Processing line: ~ if bullet[:y].between?(-16, 736)~ - Inside source: true *** True Line Result - player: [32, 4], -** Processing line: ~ background: 'sprites/mainframe.png',~ + if bullet[:y].between?(-16, 736) +** Processing line: ~ true~ - Inside source: true *** True Line Result - background: 'sprites/mainframe.png', -** Processing line: ~ fade: 120,~ + true +** Processing line: ~ else~ - Inside source: true *** True Line Result - fade: 120, -** Processing line: ~ storylines: [~ + else +** Processing line: ~ args.state.missed_shots += 1~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [22, 45, 17, 4, (bad_dream_last_reply args)],~ + args.state.missed_shots += 1 +** Processing line: ~ false~ - Inside source: true *** True Line Result - [22, 45, 17, 4, (bad_dream_last_reply args)], -** Processing line: ~ ],~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [45, 45, 4, 4, :bad_dream_everyone_dead],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [45, 45, 4, 4, :bad_dream_everyone_dead], -** Processing line: ~ ]~ + +** Processing line: ~ args.state.enemies = args.state.enemies.reject do |enemy|~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + args.state.enemies = args.state.enemies.reject do |enemy| +** Processing line: ~ if args.state.player[:alive] && 1500 > (args.state.player[:x] - enemy[:x]) ** 2 + (args.state.player[:y] - enemy[:y]) ** 2~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + if args.state.player[:alive] && 1500 > (args.state.player[:x] - enemy[:x]) ** 2 + (args.state.player[:y] - enemy[:y]) ** 2 +** Processing line: ~ args.state.explosions << {x: enemy[:x] + 4, y: enemy[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0}~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.explosions << {x: enemy[:x] + 4, y: enemy[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} +** Processing line: ~ args.state.explosions << {x: args.state.player[:x] + 4, y: args.state.player[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0}~ - Inside source: true *** True Line Result - -** Processing line: ~ def bad_dream_everyone_dead args~ + args.state.explosions << {x: args.state.player[:x] + 4, y: args.state.player[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} +** Processing line: ~ args.state.player[:alive] = false~ - Inside source: true *** True Line Result - def bad_dream_everyone_dead args -** Processing line: ~ {~ + args.state.player[:alive] = false +** Processing line: ~ true~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/mainframe.png',~ + true +** Processing line: ~ else~ - Inside source: true *** True Line Result - background: 'sprites/mainframe.png', -** Processing line: ~ storylines: [~ + else +** Processing line: ~ false~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [22, 45, 17, 4, (bad_dream_last_reply args)],~ + false +** Processing line: ~ end~ - Inside source: true *** True Line Result - [22, 45, 17, 4, (bad_dream_last_reply args)], -** Processing line: ~ [45, 45, 4, 4, "Hi-- Hiro. This is Sasha. By the time- you get this- message, chances-- are we will- already-- be- dead. The batteries--- got- damaged-- during-- removal. And- we don't-- have enough-- power-- for Life-- Support. The air-- is- already--- starting-- to taste- bad. It... would- have been- nice... to go- on a date--- with- you-- when-- I- got- back- to Earth. Anyways, good-- bye-- Hiro-- XOXOXO----"],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - [45, 45, 4, 4, "Hi-- Hiro. This is Sasha. By the time- you get this- message, chances-- are we will- already-- be- dead. The batteries--- got- damaged-- during-- removal. And- we don't-- have enough-- power-- for Life-- Support. The air-- is- already--- starting-- to taste- bad. It... would- have been- nice... to go- on a date--- with- you-- when-- I- got- back- to Earth. Anyways, good-- bye-- Hiro-- XOXOXO----"], -** Processing line: ~ [22, 5, 17, 4, "Meh. Whatever, I didn't-- want to save them anyways. What- a pain- in my ass."],~ + end +** Processing line: ~ args.state.enemy_bullets.each do |bullet|~ - Inside source: true *** True Line Result - [22, 5, 17, 4, "Meh. Whatever, I didn't-- want to save them anyways. What- a pain- in my ass."], -** Processing line: ~ ],~ + args.state.enemy_bullets.each do |bullet| +** Processing line: ~ if args.state.player[:alive] && 400 > (args.state.player[:x] - bullet[:x] + 12) ** 2 + (args.state.player[:y] - bullet[:y] + 12) ** 2~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + if args.state.player[:alive] && 400 > (args.state.player[:x] - bullet[:x] + 12) ** 2 + (args.state.player[:y] - bullet[:y] + 12) ** 2 +** Processing line: ~ args.state.explosions << {x: args.state.player[:x] + 4, y: args.state.player[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0}~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [*hotspot_bottom, :anka_inside_room]~ + args.state.explosions << {x: args.state.player[:x] + 4, y: args.state.player[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} +** Processing line: ~ args.state.player[:alive] = false~ - Inside source: true *** True Line Result - [*hotspot_bottom, :anka_inside_room] -** Processing line: ~ ]~ + args.state.player[:alive] = false +** Processing line: ~ bullet[:despawn] = true~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + bullet[:despawn] = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ args.state.enemies = args.state.enemies.reject do |enemy|~ - Inside source: true *** True Line Result - -** Processing line: ~ def bad_dream_last_reply args~ + args.state.enemies = args.state.enemies.reject do |enemy| +** Processing line: ~ args.state.player_bullets.any? do |bullet|~ - Inside source: true *** True Line Result - def bad_dream_last_reply args -** Processing line: ~ if args.state.scene_history.include? :replied_to_serenity_alive_firmly~ + args.state.player_bullets.any? do |bullet| +** Processing line: ~ if 400 > (enemy[:x] - bullet[:x] + 12) ** 2 + (enemy[:y] - bullet[:y] + 12) ** 2~ - Inside source: true *** True Line Result - if args.state.scene_history.include? :replied_to_serenity_alive_firmly -** Processing line: ~ return "Buffer--: #{serenity_alive_firm_reply.quote}"~ + if 400 > (enemy[:x] - bullet[:x] + 12) ** 2 + (enemy[:y] - bullet[:y] + 12) ** 2 +** Processing line: ~ args.state.explosions << {x: enemy[:x] + 4, y: enemy[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0}~ - Inside source: true *** True Line Result - return "Buffer--: #{serenity_alive_firm_reply.quote}" -** Processing line: ~ else~ + args.state.explosions << {x: enemy[:x] + 4, y: enemy[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} +** Processing line: ~ bullet[:despawn] = true~ - Inside source: true *** True Line Result - else -** Processing line: ~ return "Buffer--: #{serenity_alive_sugarcoated_reply.quote}"~ + bullet[:despawn] = true +** Processing line: ~ args.state.score += 1000 * args.state.wave~ - Inside source: true *** True Line Result - return "Buffer--: #{serenity_alive_sugarcoated_reply.quote}" -** Processing line: ~ end~ + args.state.score += 1000 * args.state.wave +** Processing line: ~ true~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + true +** Processing line: ~ else~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + else +** Processing line: ~ false~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + false +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb~ -- Header detected. +** Processing line: ~ args.state.player_bullets = args.state.player_bullets.reject { |bullet| bullet[:despawn] }~ +- Inside source: true *** True Line Result - + args.state.player_bullets = args.state.player_bullets.reject { |bullet| bullet[:despawn] } +** Processing line: ~ args.state.enemy_bullets = args.state.enemy_bullets.reject { |bullet| bullet[:despawn] }~ +- Inside source: true *** True Line Result -* Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + args.state.enemy_bullets = args.state.enemy_bullets.reject { |bullet| bullet[:despawn] } +** Processing line: ~~ +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_introduction.rb~ +** Processing line: ~ args.state.player[:cooldown] -= 1~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_introduction.rb -** Processing line: ~ # decision_graph "Message from Sasha",~ + args.state.player[:cooldown] -= 1 +** Processing line: ~ if args.inputs.keyboard.key_held.space && args.state.player[:cooldown] <= 0 && args.state.player[:alive]~ - Inside source: true *** True Line Result - # decision_graph "Message from Sasha", -** Processing line: ~ # "I should reply.",~ + if args.inputs.keyboard.key_held.space && args.state.player[:cooldown] <= 0 && args.state.player[:alive] +** Processing line: ~ args.state.player_bullets << {x: args.state.player[:x] + 12, y: args.state.player[:y] + 28, w: 16, h: 16, path: 'sprites/star.png', dx: 0, dy: 8}.sprite~ - Inside source: true *** True Line Result - # "I should reply.", -** Processing line: ~ # [:replied_to_introduction_seriously, "Reply Seriously", "Who is this?"],~ + args.state.player_bullets << {x: args.state.player[:x] + 12, y: args.state.player[:y] + 28, w: 16, h: 16, path: 'sprites/star.png', dx: 0, dy: 8}.sprite +** Processing line: ~ args.state.fired_shots += 1~ - Inside source: true *** True Line Result - # [:replied_to_introduction_seriously, "Reply Seriously", "Who is this?"], -** Processing line: ~ # [:replied_to_introduction_humorously, "Reply Humorously", "New phone who dis?"]~ + args.state.fired_shots += 1 +** Processing line: ~ args.state.player[:cooldown] = 10 + 20 / args.state.wave~ - Inside source: true *** True Line Result - # [:replied_to_introduction_humorously, "Reply Humorously", "New phone who dis?"] -** Processing line: ~ def reply_to_introduction args~ + args.state.player[:cooldown] = 10 + 20 / args.state.wave +** Processing line: ~ end~ - Inside source: true *** True Line Result - def reply_to_introduction args -** Processing line: ~ decision_graph "\"Mission-- control--, your- main- comm-- channels-- seem-- to be down. My apologies-- for- using-- this low- level-- exploit--. What's-- going-- on down there? We are ready-- for reentry--.\" Message--- Timestamp---: 4- hours-- 23--- minutes-- ago--.",~ + end +** Processing line: ~ args.state.enemies.each do |enemy|~ - Inside source: true *** True Line Result - decision_graph "\"Mission-- control--, your- main- comm-- channels-- seem-- to be down. My apologies-- for- using-- this low- level-- exploit--. What's-- going-- on down there? We are ready-- for reentry--.\" Message--- Timestamp---: 4- hours-- 23--- minutes-- ago--.", -** Processing line: ~ "Whoever-- pulled- off this exploit-- knows their stuff. I should reply--.",~ + args.state.enemies.each do |enemy| +** Processing line: ~ if Math.rand < 0.0005 + 0.0005 * args.state.wave && args.state.player[:alive] && enemy[:move_state] == :normal~ - Inside source: true *** True Line Result - "Whoever-- pulled- off this exploit-- knows their stuff. I should reply--.", -** Processing line: ~ [:replied_to_introduction_seriously, "Serious Reply", "Hello, Who- is sending-- this message--?"],~ + if Math.rand < 0.0005 + 0.0005 * args.state.wave && args.state.player[:alive] && enemy[:move_state] == :normal +** Processing line: ~ args.state.enemy_bullets << {x: enemy[:x] + 12, y: enemy[:y] - 8, w: 16, h: 16, path: 'sprites/star.png', dx: 0, dy: -3 - args.state.wave_root}.sprite~ - Inside source: true *** True Line Result - [:replied_to_introduction_seriously, "Serious Reply", "Hello, Who- is sending-- this message--?"], -** Processing line: ~ [:replied_to_introduction_humorously, "Humorous Reply", "New phone, who dis?"]~ + args.state.enemy_bullets << {x: enemy[:x] + 12, y: enemy[:y] - 8, w: 16, h: 16, path: 'sprites/star.png', dx: 0, dy: -3 - args.state.wave_root}.sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - [:replied_to_introduction_humorously, "Humorous Reply", "New phone, who dis?"] -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def replied_to_introduction_seriously args~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - def replied_to_introduction_seriously args -** Processing line: ~ {~ + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.outputs.primitives << args.state.enemies.map do |enemy|~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + args.outputs.primitives << args.state.enemies.map do |enemy| +** Processing line: ~ [enemy[:x], enemy[:y], 40, 40, enemy[:path], -90].sprite~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 60,~ + [enemy[:x], enemy[:y], 40, 40, enemy[:path], -90].sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [32, 21],~ + end +** Processing line: ~ args.outputs.primitives << args.state.player if args.state.player[:alive]~ - Inside source: true *** True Line Result - player: [32, 21], -** Processing line: ~ scenes: [~ + args.outputs.primitives << args.state.player if args.state.player[:alive] +** Processing line: ~ args.outputs.primitives << args.state.explosions~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ *replied_to_introduction_shared_scenes(args)~ + args.outputs.primitives << args.state.explosions +** Processing line: ~ args.outputs.primitives << args.state.player_bullets~ - Inside source: true *** True Line Result - *replied_to_introduction_shared_scenes(args) -** Processing line: ~ ],~ + args.outputs.primitives << args.state.player_bullets +** Processing line: ~ args.outputs.primitives << args.state.enemy_bullets~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + args.outputs.primitives << args.state.enemy_bullets +** Processing line: ~ accuracy = args.state.fired_shots.zero? ? 1 : (args.state.fired_shots - args.state.missed_shots) / args.state.fired_shots~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: \"Hello, Who- is sending-- this message--?\""],~ + accuracy = args.state.fired_shots.zero? ? 1 : (args.state.fired_shots - args.state.missed_shots) / args.state.fired_shots +** Processing line: ~ args.outputs.primitives << [~ - Inside source: true *** True Line Result - [30, 18, 5, 12, "Buffer-- has been set to: \"Hello, Who- is sending-- this message--?\""], -** Processing line: ~ *replied_to_introduction_shared_storylines(args)~ + args.outputs.primitives << [ +** Processing line: ~ [0, 0, 300, 720, 96, 0, 0].solid,~ - Inside source: true *** True Line Result - *replied_to_introduction_shared_storylines(args) -** Processing line: ~ ]~ + [0, 0, 300, 720, 96, 0, 0].solid, +** Processing line: ~ [1280 - 300, 0, 300, 720, 96, 0, 0].solid,~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + [1280 - 300, 0, 300, 720, 96, 0, 0].solid, +** Processing line: ~ [1280 - 290, 60, "Wave #{args.state.wave}", 255, 255, 255].label,~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [1280 - 290, 60, "Wave #{args.state.wave}", 255, 255, 255].label, +** Processing line: ~ [1280 - 290, 40, "Accuracy #{(accuracy * 100).floor}%", 255, 255, 255].label,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [1280 - 290, 40, "Accuracy #{(accuracy * 100).floor}%", 255, 255, 255].label, +** Processing line: ~ [1280 - 290, 20, "Score #{(args.state.score * accuracy).floor}", 255, 255, 255].label,~ - Inside source: true *** True Line Result - -** Processing line: ~ def replied_to_introduction_humorously args~ + [1280 - 290, 20, "Score #{(args.state.score * accuracy).floor}", 255, 255, 255].label, +** Processing line: ~ ]~ - Inside source: true *** True Line Result - def replied_to_introduction_humorously args -** Processing line: ~ {~ + ] +** Processing line: ~ args.outputs.primitives << args.state.lives.times.map do |n|~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-observatory.png',~ + args.outputs.primitives << args.state.lives.times.map do |n| +** Processing line: ~ [1280 - 290 + 50 * n, 80, 40, 40, 'sprites/circle-gray.png', 90].sprite~ - Inside source: true *** True Line Result - background: 'sprites/inside-observatory.png', -** Processing line: ~ fade: 60,~ + [1280 - 290 + 50 * n, 80, 40, 40, 'sprites/circle-gray.png', 90].sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [32, 21],~ + end +** Processing line: ~ #args.outputs.debug << args.gtk.framerate_diagnostics_primitives~ - Inside source: true *** True Line Result - player: [32, 21], -** Processing line: ~ scenes: [~ + #args.outputs.debug << args.gtk.framerate_diagnostics_primitives +** Processing line: ~~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ *replied_to_introduction_shared_scenes(args)~ + +** Processing line: ~ if (!args.state.player[:alive]) && args.state.enemy_bullets.empty? && args.state.explosions.empty? && args.state.enemies.all? { |enemy| enemy[:move_state] == :normal }~ - Inside source: true *** True Line Result - *replied_to_introduction_shared_scenes(args) -** Processing line: ~ ],~ + if (!args.state.player[:alive]) && args.state.enemy_bullets.empty? && args.state.explosions.empty? && args.state.enemies.all? { |enemy| enemy[:move_state] == :normal } +** Processing line: ~ args.state.player[:alive] = true~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + args.state.player[:alive] = true +** Processing line: ~ args.state.player[:x] = 624~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: \"New- phone. Who dis?\""],~ + args.state.player[:x] = 624 +** Processing line: ~ args.state.player[:y] = 80~ - Inside source: true *** True Line Result - [30, 18, 5, 12, "Buffer-- has been set to: \"New- phone. Who dis?\""], -** Processing line: ~ *replied_to_introduction_shared_storylines(args)~ + args.state.player[:y] = 80 +** Processing line: ~ args.state.lives -= 1~ - Inside source: true *** True Line Result - *replied_to_introduction_shared_storylines(args) -** Processing line: ~ ]~ + args.state.lives -= 1 +** Processing line: ~ if args.state.lives == -1~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + if args.state.lives == -1 +** Processing line: ~ args.state.clear!~ - Inside source: true *** True Line Result - } + args.state.clear! +** 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 @@ -84435,30 +88220,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 replied_to_introduction_shared_storylines args~ +** Processing line: ~ def make_enemies~ - Inside source: true *** True Line Result - def replied_to_introduction_shared_storylines args -** Processing line: ~ [~ + def make_enemies +** Processing line: ~ enemies = []~ - Inside source: true *** True Line Result - [ -** Processing line: ~ [30, 10, 5, 4, "It's-- going-- to take a while-- for this reply-- to make it's-- way back."],~ + enemies = [] +** Processing line: ~ enemies += 10.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 0, col: n, path: 'sprites/circle-orange.png', move_state: :retreat} }~ - Inside source: true *** True Line Result - [30, 10, 5, 4, "It's-- going-- to take a while-- for this reply-- to make it's-- way back."], -** Processing line: ~ [40, 10, 5, 4, "4- hours-- to send a message-- at light speed?! How far away-- is the sender--?"],~ + enemies += 10.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 0, col: n, path: 'sprites/circle-orange.png', move_state: :retreat} } +** Processing line: ~ enemies += 10.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 1, col: n, path: 'sprites/circle-orange.png', move_state: :retreat} }~ - Inside source: true *** True Line Result - [40, 10, 5, 4, "4- hours-- to send a message-- at light speed?! How far away-- is the sender--?"], -** Processing line: ~ [50, 10, 5, 4, "I know- I've-- read about-- light- speed- travel-- before--. Maybe-- the library--- still has that- poster."]~ + enemies += 10.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 1, col: n, path: 'sprites/circle-orange.png', move_state: :retreat} } +** Processing line: ~ enemies += 8.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 2, col: n + 1, path: 'sprites/circle-blue.png', move_state: :retreat} }~ - Inside source: true *** True Line Result - [50, 10, 5, 4, "I know- I've-- read about-- light- speed- travel-- before--. Maybe-- the library--- still has that- poster."] -** Processing line: ~ ]~ + enemies += 8.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 2, col: n + 1, path: 'sprites/circle-blue.png', move_state: :retreat} } +** Processing line: ~ enemies += 8.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 3, col: n + 1, path: 'sprites/circle-blue.png', move_state: :retreat} }~ - Inside source: true *** True Line Result - ] + enemies += 8.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 3, col: n + 1, path: 'sprites/circle-blue.png', move_state: :retreat} } +** Processing line: ~ enemies += 4.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 4, col: n + 3, path: 'sprites/circle-green.png', move_state: :retreat} }~ +- Inside source: true +*** True Line Result + enemies += 4.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 4, col: n + 3, path: 'sprites/circle-green.png', move_state: :retreat} } +** Processing line: ~ enemies~ +- Inside source: true +*** True Line Result + enemies ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -84467,14 +88260,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 replied_to_introduction_shared_scenes args~ +** Processing line: ~ def update_explosions args~ - Inside source: true *** True Line Result - def replied_to_introduction_shared_scenes args -** Processing line: ~ [[60, 0, 4, 32, :replied_to_introduction_observatory]]~ + def update_explosions args +** Processing line: ~ args.state.explosions.each do |explosion|~ - Inside source: true *** True Line Result - [[60, 0, 4, 32, :replied_to_introduction_observatory]] + args.state.explosions.each do |explosion| +** Processing line: ~ explosion[:age] += 0.5~ +- Inside source: true +*** True Line Result + explosion[:age] += 0.5 +** Processing line: ~ explosion[:path] = "sprites/explosion-#{explosion[:age].floor}.png"~ +- Inside source: true +*** True Line Result + explosion[:path] = "sprites/explosion-#{explosion[:age].floor}.png" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ args.state.explosions = args.state.explosions.reject { |explosion| explosion[:age] >= 7 }~ +- Inside source: true +*** True Line Result + args.state.explosions = args.state.explosions.reject { |explosion| explosion[:age] >= 7 } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -84483,170 +88292,170 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def replied_to_introduction_observatory args~ +** Processing line: ~ def update_enemy_positions args~ - Inside source: true *** True Line Result - def replied_to_introduction_observatory args -** Processing line: ~ {~ + def update_enemy_positions args +** Processing line: ~ args.state.enemies.each do |enemy|~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/observatory.png',~ + args.state.enemies.each do |enemy| +** Processing line: ~ if enemy[:move_state] == :normal~ - Inside source: true *** True Line Result - background: 'sprites/observatory.png', -** Processing line: ~ player: [28, 39],~ + if enemy[:move_state] == :normal +** Processing line: ~ enemy[:x] = args.state.columns[enemy[:col]]~ - Inside source: true *** True Line Result - player: [28, 39], -** Processing line: ~ scenes: [~ + enemy[:x] = args.state.columns[enemy[:col]] +** Processing line: ~ enemy[:y] = args.state.rows[enemy[:row]]~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [60, 0, 4, 32, :replied_to_introduction_path_to_observatory]~ + enemy[:y] = args.state.rows[enemy[:row]] +** Processing line: ~ enemy[:move_state] = :dive if Math.rand < 0.0002 + 0.00005 * args.state.wave && args.state.player[:alive]~ - Inside source: true *** True Line Result - [60, 0, 4, 32, :replied_to_introduction_path_to_observatory] -** Processing line: ~ ]~ + enemy[:move_state] = :dive if Math.rand < 0.0002 + 0.00005 * args.state.wave && args.state.player[:alive] +** Processing line: ~ elsif enemy[:move_state] == :dive~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + elsif enemy[:move_state] == :dive +** Processing line: ~ enemy[:target_x] ||= args.state.player[:x]~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + enemy[:target_x] ||= args.state.player[:x] +** Processing line: ~ enemy[:target_y] ||= args.state.player[:y]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + enemy[:target_y] ||= args.state.player[:y] +** Processing line: ~ dx = enemy[:target_x] - enemy[:x]~ - Inside source: true *** True Line Result - -** Processing line: ~ def replied_to_introduction_path_to_observatory args~ + dx = enemy[:target_x] - enemy[:x] +** Processing line: ~ dy = enemy[:target_y] - enemy[:y]~ - Inside source: true *** True Line Result - def replied_to_introduction_path_to_observatory args -** Processing line: ~ {~ + dy = enemy[:target_y] - enemy[:y] +** Processing line: ~ vel = Math.sqrt(dx * dx + dy * dy)~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/path-to-observatory.png',~ + vel = Math.sqrt(dx * dx + dy * dy) +** Processing line: ~ speed_limit = 2 + args.state.wave_root~ - Inside source: true *** True Line Result - background: 'sprites/path-to-observatory.png', -** Processing line: ~ player: [0, 26],~ + speed_limit = 2 + args.state.wave_root +** Processing line: ~ if vel > speed_limit~ - Inside source: true *** True Line Result - player: [0, 26], -** Processing line: ~ scenes: [~ + if vel > speed_limit +** Processing line: ~ dx /= vel / speed_limit~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [60, 0, 4, 20, :replied_to_introduction_mountain_pass]~ + dx /= vel / speed_limit +** Processing line: ~ dy /= vel / speed_limit~ - Inside source: true *** True Line Result - [60, 0, 4, 20, :replied_to_introduction_mountain_pass] -** Processing line: ~ ],~ + dy /= vel / speed_limit +** Processing line: ~ end~ - Inside source: true *** True Line Result - ], -** Processing line: ~ }~ + end +** Processing line: ~ if vel < 1 || !args.state.player[:alive]~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + if vel < 1 || !args.state.player[:alive] +** Processing line: ~ enemy[:move_state] = :retreat~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + enemy[:move_state] = :retreat +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def replied_to_introduction_mountain_pass args~ + end +** Processing line: ~ enemy[:x] += dx~ - Inside source: true *** True Line Result - def replied_to_introduction_mountain_pass args -** Processing line: ~ {~ + enemy[:x] += dx +** Processing line: ~ enemy[:y] += dy~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/mountain-pass-zoomed-out.png',~ + enemy[:y] += dy +** Processing line: ~ elsif enemy[:move_state] == :retreat~ - Inside source: true *** True Line Result - background: 'sprites/mountain-pass-zoomed-out.png', -** Processing line: ~ player: [21, 48],~ + elsif enemy[:move_state] == :retreat +** Processing line: ~ enemy[:target_x] = args.state.columns[enemy[:col]]~ - Inside source: true *** True Line Result - player: [21, 48], -** Processing line: ~ scenes: [~ + enemy[:target_x] = args.state.columns[enemy[:col]] +** Processing line: ~ enemy[:target_y] = args.state.rows[enemy[:row]]~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [0, 0, 15, 4, :replied_to_introduction_side_of_home]~ + enemy[:target_y] = args.state.rows[enemy[:row]] +** Processing line: ~ dx = enemy[:target_x] - enemy[:x]~ - Inside source: true *** True Line Result - [0, 0, 15, 4, :replied_to_introduction_side_of_home] -** Processing line: ~ ],~ + dx = enemy[:target_x] - enemy[:x] +** Processing line: ~ dy = enemy[:target_y] - enemy[:y]~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + dy = enemy[:target_y] - enemy[:y] +** Processing line: ~ vel = Math.sqrt(dx * dx + dy * dy)~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [15, 28, 5, 3, "At least I'm-- getting-- my- exercise-- in- for- today--."]~ + vel = Math.sqrt(dx * dx + dy * dy) +** Processing line: ~ speed_limit = 2 + args.state.wave_root~ - Inside source: true *** True Line Result - [15, 28, 5, 3, "At least I'm-- getting-- my- exercise-- in- for- today--."] -** Processing line: ~ ]~ + speed_limit = 2 + args.state.wave_root +** Processing line: ~ if vel > speed_limit~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + if vel > speed_limit +** Processing line: ~ dx /= vel / speed_limit~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + dx /= vel / speed_limit +** Processing line: ~ dy /= vel / speed_limit~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + dy /= vel / speed_limit +** Processing line: ~ elsif vel < 1~ - Inside source: true *** True Line Result - -** Processing line: ~ def replied_to_introduction_side_of_home args~ + elsif vel < 1 +** Processing line: ~ enemy[:move_state] = :normal~ - Inside source: true *** True Line Result - def replied_to_introduction_side_of_home args -** Processing line: ~ {~ + enemy[:move_state] = :normal +** Processing line: ~ enemy[:target_x] = nil~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/side-of-home.png',~ + enemy[:target_x] = nil +** Processing line: ~ enemy[:target_y] = nil~ - Inside source: true *** True Line Result - background: 'sprites/side-of-home.png', -** Processing line: ~ player: [58, 29],~ + enemy[:target_y] = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - player: [58, 29], -** Processing line: ~ scenes: [~ + end +** Processing line: ~ enemy[:x] += dx~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [2, 0, 61, 2, :speed_of_light_front_of_home]~ + enemy[:x] += dx +** Processing line: ~ enemy[:y] += dy~ - Inside source: true *** True Line Result - [2, 0, 61, 2, :speed_of_light_front_of_home] -** Processing line: ~ ],~ + enemy[:y] += dy +** Processing line: ~ end~ - Inside source: true *** True Line Result - ], -** Processing line: ~ }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -84663,690 +88472,662 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb~ +** Processing line: ~*** Arcade - Dueling Starships - main.rb~ - Header detected. *** True Line Result *** True Line Result -* Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb +*** Arcade - Dueling Starships - main.rb ** Processing line: ~#+begin_src ruby~ - Line was identified as the beginning of a code block. *** True Line Result *** True Line Result #+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_speed_of_light.rb~ -- Inside source: true -*** True Line Result - # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_speed_of_light.rb -** Processing line: ~ def speed_of_light_front_of_home args~ +** Processing line: ~ # ./samples/99_genre_arcade/dueling_starships/app/main.rb~ - Inside source: true *** True Line Result - def speed_of_light_front_of_home args -** Processing line: ~ {~ + # ./samples/99_genre_arcade/dueling_starships/app/main.rb +** Processing line: ~ class DuelingSpaceships~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/front-of-home.png',~ + class DuelingSpaceships +** Processing line: ~ attr_accessor :state, :inputs, :outputs, :grid~ - Inside source: true *** True Line Result - background: 'sprites/front-of-home.png', -** Processing line: ~ player: [54, 23],~ + attr_accessor :state, :inputs, :outputs, :grid +** Processing line: ~~ - Inside source: true *** True Line Result - player: [54, 23], -** Processing line: ~ scenes: [~ + +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [44, 34, 8, 14, :speed_of_light_inside_home],~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - [44, 34, 8, 14, :speed_of_light_inside_home], -** Processing line: ~ [0, 3, 3, 22, :speed_of_light_outside_library]~ + defaults +** Processing line: ~ render~ - Inside source: true *** True Line Result - [0, 3, 3, 22, :speed_of_light_outside_library] -** Processing line: ~ ]~ + render +** Processing line: ~ calc~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + calc +** Processing line: ~ input~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + input +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def speed_of_light_inside_home args~ +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - def speed_of_light_inside_home args -** Processing line: ~ {~ + def defaults +** Processing line: ~ outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/inside-home.png',~ + outputs.background_color = [0, 0, 0] +** Processing line: ~ state.ship_blue ||= new_blue_ship~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [35, 4],~ + state.ship_blue ||= new_blue_ship +** Processing line: ~ state.ship_red ||= new_red_ship~ - Inside source: true *** True Line Result - player: [35, 4], -** Processing line: ~ storylines: [~ + state.ship_red ||= new_red_ship +** Processing line: ~ state.flames ||= []~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 38, 12, 13, "Can't- sleep right now. I have to- find- out- why- it took- over-- 4- hours-- to receive-- that message."]~ + state.flames ||= [] +** Processing line: ~ state.bullets ||= []~ - Inside source: true *** True Line Result - [30, 38, 12, 13, "Can't- sleep right now. I have to- find- out- why- it took- over-- 4- hours-- to receive-- that message."] -** Processing line: ~ ],~ + state.bullets ||= [] +** Processing line: ~ state.ship_blue_score ||= 0~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + state.ship_blue_score ||= 0 +** Processing line: ~ state.ship_red_score ||= 0~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [32, 0, 8, 3, :speed_of_light_front_of_home],~ + state.ship_red_score ||= 0 +** Processing line: ~ state.stars ||= 100.map do~ - Inside source: true *** True Line Result - [32, 0, 8, 3, :speed_of_light_front_of_home], -** Processing line: ~ ]~ + state.stars ||= 100.map do +** Processing line: ~ [rand.add(2).to_square(grid.w_half.randomize(:sign, :ratio),~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + [rand.add(2).to_square(grid.w_half.randomize(:sign, :ratio), +** Processing line: ~ grid.h_half.randomize(:sign, :ratio)),~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + grid.h_half.randomize(:sign, :ratio)), +** Processing line: ~ 128 + 128.randomize(:ratio), 255, 255]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 128 + 128.randomize(:ratio), 255, 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def speed_of_light_outside_library args~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - def speed_of_light_outside_library args -** Processing line: ~ {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/outside-library.png',~ + +** Processing line: ~ def default_ship x, y, angle, sprite_path, bullet_sprite_path, color~ - Inside source: true *** True Line Result - background: 'sprites/outside-library.png', -** Processing line: ~ player: [55, 19],~ + def default_ship x, y, angle, sprite_path, bullet_sprite_path, color +** Processing line: ~ state.new_entity(:ship,~ - Inside source: true *** True Line Result - player: [55, 19], -** Processing line: ~ scenes: [~ + state.new_entity(:ship, +** Processing line: ~ { x: x,~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [49, 39, 6, 10, :speed_of_light_library],~ + { x: x, +** Processing line: ~ y: y,~ - Inside source: true *** True Line Result - [49, 39, 6, 10, :speed_of_light_library], -** Processing line: ~ [61, 11, 3, 20, :speed_of_light_front_of_home]~ + y: y, +** Processing line: ~ dy: 0,~ - Inside source: true *** True Line Result - [61, 11, 3, 20, :speed_of_light_front_of_home] -** Processing line: ~ ]~ + dy: 0, +** Processing line: ~ dx: 0,~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + dx: 0, +** Processing line: ~ damage: 0,~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + damage: 0, +** Processing line: ~ dead: false,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + dead: false, +** Processing line: ~ angle: angle,~ - Inside source: true *** True Line Result - -** Processing line: ~ def speed_of_light_library args~ + angle: angle, +** Processing line: ~ max_alpha: 255,~ - Inside source: true *** True Line Result - def speed_of_light_library args -** Processing line: ~ {~ + max_alpha: 255, +** Processing line: ~ sprite_path: sprite_path,~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/library.png',~ + sprite_path: sprite_path, +** Processing line: ~ bullet_sprite_path: bullet_sprite_path,~ - Inside source: true *** True Line Result - background: 'sprites/library.png', -** Processing line: ~ player: [30, 7],~ + bullet_sprite_path: bullet_sprite_path, +** Processing line: ~ color: color })~ - Inside source: true *** True Line Result - player: [30, 7], -** Processing line: ~ scenes: [~ + color: color }) +** Processing line: ~ end~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [3, 50, 10, 3, :speed_of_light_celestial_bodies_diagram]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [3, 50, 10, 3, :speed_of_light_celestial_bodies_diagram] -** Processing line: ~ ]~ + +** Processing line: ~ def new_red_ship~ - 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 speed_of_light_celestial_bodies_diagram args~ + def new_red_ship +** Processing line: ~ default_ship(400, 250.randomize(:sign, :ratio),~ - Inside source: true *** True Line Result - def speed_of_light_celestial_bodies_diagram args -** Processing line: ~ {~ + default_ship(400, 250.randomize(:sign, :ratio), +** Processing line: ~ 180, 'sprites/ship_red.png', 'sprites/red_bullet.png',~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/planets.png',~ + 180, 'sprites/ship_red.png', 'sprites/red_bullet.png', +** Processing line: ~ [255, 90, 90])~ - Inside source: true *** True Line Result - background: 'sprites/planets.png', -** Processing line: ~ fade: 60,~ + [255, 90, 90]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ player: [30, 3],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - player: [30, 3], -** Processing line: ~ scenes: [~ + +** Processing line: ~ def new_blue_ship~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [56 - 2, 10, 5, 5, :speed_of_light_distance_discovered]~ + def new_blue_ship +** Processing line: ~ default_ship(-400, 250.randomize(:sign, :ratio),~ - Inside source: true *** True Line Result - [56 - 2, 10, 5, 5, :speed_of_light_distance_discovered] -** Processing line: ~ ],~ + default_ship(-400, 250.randomize(:sign, :ratio), +** Processing line: ~ 0, 'sprites/ship_blue.png', 'sprites/blue_bullet.png',~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + 0, 'sprites/ship_blue.png', 'sprites/blue_bullet.png', +** Processing line: ~ [110, 140, 255])~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [30, 2, 4, 4, "Here- it is! This is a diagram--- of the solar-- system--. It was printed-- over-- fifty-- years- ago. Geez-- that's-- old."],~ + [110, 140, 255]) +** Processing line: ~ end~ - Inside source: true *** True Line Result - [30, 2, 4, 4, "Here- it is! This is a diagram--- of the solar-- system--. It was printed-- over-- fifty-- years- ago. Geez-- that's-- old."], + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ [ 0 - 2, 10, 5, 5, "The label- reads: Sun. The length- of the Astronomical-------- Unit-- (AU), is the distance-- from the Sun- to the Earth. Which is about 150--- million--- kilometers----."],~ -- Inside source: true -*** True Line Result - [ 0 - 2, 10, 5, 5, "The label- reads: Sun. The length- of the Astronomical-------- Unit-- (AU), is the distance-- from the Sun- to the Earth. Which is about 150--- million--- kilometers----."], -** Processing line: ~ [ 7 - 2, 10, 5, 5, "The label- reads: Mercury. Distance from Sun: 0.39AU------------ or- 3----- light-- minutes--."],~ +** Processing line: ~ def render~ - Inside source: true *** True Line Result - [ 7 - 2, 10, 5, 5, "The label- reads: Mercury. Distance from Sun: 0.39AU------------ or- 3----- light-- minutes--."], -** Processing line: ~ [14 - 2, 10, 5, 5, "The label- reads: Venus. Distance from Sun: 0.72AU------------ or- 6----- light-- minutes--."],~ + def render +** Processing line: ~ render_instructions~ - Inside source: true *** True Line Result - [14 - 2, 10, 5, 5, "The label- reads: Venus. Distance from Sun: 0.72AU------------ or- 6----- light-- minutes--."], -** Processing line: ~ [21 - 2, 10, 5, 5, "The label- reads: Earth. Distance from Sun: 1.00AU------------ or- 8----- light-- minutes--."],~ + render_instructions +** Processing line: ~ render_score~ - Inside source: true *** True Line Result - [21 - 2, 10, 5, 5, "The label- reads: Earth. Distance from Sun: 1.00AU------------ or- 8----- light-- minutes--."], -** Processing line: ~ [28 - 2, 10, 5, 5, "The label- reads: Mars. Distance from Sun: 1.52AU------------ or- 12----- light-- minutes--."],~ + render_score +** Processing line: ~ render_universe~ - Inside source: true *** True Line Result - [28 - 2, 10, 5, 5, "The label- reads: Mars. Distance from Sun: 1.52AU------------ or- 12----- light-- minutes--."], -** Processing line: ~ [35 - 2, 10, 5, 5, "The label- reads: Jupiter. Distance from Sun: 5.20AU------------ or- 45----- light-- minutes--."],~ + render_universe +** Processing line: ~ render_flames~ - Inside source: true *** True Line Result - [35 - 2, 10, 5, 5, "The label- reads: Jupiter. Distance from Sun: 5.20AU------------ or- 45----- light-- minutes--."], -** Processing line: ~ [42 - 2, 10, 5, 5, "The label- reads: Saturn. Distance from Sun: 9.53AU------------ or- 79----- light-- minutes--."],~ + render_flames +** Processing line: ~ render_ships~ - Inside source: true *** True Line Result - [42 - 2, 10, 5, 5, "The label- reads: Saturn. Distance from Sun: 9.53AU------------ or- 79----- light-- minutes--."], -** Processing line: ~ [49 - 2, 10, 5, 5, "The label- reads: Uranus. Distance from Sun: 19.81AU------------ or- 159----- light-- minutes--."],~ + render_ships +** Processing line: ~ render_bullets~ - Inside source: true *** True Line Result - [49 - 2, 10, 5, 5, "The label- reads: Uranus. Distance from Sun: 19.81AU------------ or- 159----- light-- minutes--."], -** Processing line: ~ # [56 - 2, 15, 4, 4, "The label- reads: Neptune. Distance from Sun: 30.05AU------------ or- 4.1----- light-- hours--."],~ + render_bullets +** Processing line: ~ end~ - Inside source: true *** True Line Result - # [56 - 2, 15, 4, 4, "The label- reads: Neptune. Distance from Sun: 30.05AU------------ or- 4.1----- light-- hours--."], -** Processing line: ~ [63 - 2, 10, 5, 5, "The label- reads: Pluto. Wait. WTF? Pluto-- isn't-- a planet."],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [63 - 2, 10, 5, 5, "The label- reads: Pluto. Wait. WTF? Pluto-- isn't-- a planet."], -** Processing line: ~ ]~ + +** Processing line: ~ def render_ships~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + def render_ships +** Processing line: ~ update_ship_outputs(state.ship_blue)~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + update_ship_outputs(state.ship_blue) +** Processing line: ~ update_ship_outputs(state.ship_red)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + update_ship_outputs(state.ship_red) +** Processing line: ~ outputs.sprites << [state.ship_blue.sprite, state.ship_red.sprite]~ - Inside source: true *** True Line Result - -** Processing line: ~ def speed_of_light_distance_discovered args~ + outputs.sprites << [state.ship_blue.sprite, state.ship_red.sprite] +** Processing line: ~ outputs.labels << [state.ship_blue.label, state.ship_red.label]~ - Inside source: true *** True Line Result - def speed_of_light_distance_discovered args -** Processing line: ~ {~ + outputs.labels << [state.ship_blue.label, state.ship_red.label] +** Processing line: ~ end~ - Inside source: true *** True Line Result - { -** Processing line: ~ background: 'sprites/planets.png',~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - background: 'sprites/planets.png', -** Processing line: ~ scenes: [~ + +** Processing line: ~ def render_instructions~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [13, 0, 44, 3, :speed_of_light_end_of_day]~ + def render_instructions +** Processing line: ~ return if state.ship_blue.dx > 0 || state.ship_blue.dy > 0 ||~ - Inside source: true *** True Line Result - [13, 0, 44, 3, :speed_of_light_end_of_day] -** Processing line: ~ ],~ + return if state.ship_blue.dx > 0 || state.ship_blue.dy > 0 || +** Processing line: ~ state.ship_red.dx > 0 || state.ship_red.dy > 0 ||~ - Inside source: true *** True Line Result - ], -** Processing line: ~ storylines: [~ + state.ship_red.dx > 0 || state.ship_red.dy > 0 || +** Processing line: ~ state.flames.length > 0~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [ 0 - 2, 10, 5, 5, "The label- reads: Sun. The length- of the Astronomical-------- Unit-- (AU), is the distance-- from the Sun- to the Earth. Which is about 150--- million--- kilometers----."],~ + state.flames.length > 0 +** Processing line: ~~ - Inside source: true *** True Line Result - [ 0 - 2, 10, 5, 5, "The label- reads: Sun. The length- of the Astronomical-------- Unit-- (AU), is the distance-- from the Sun- to the Earth. Which is about 150--- million--- kilometers----."], -** Processing line: ~ [ 7 - 2, 10, 5, 5, "The label- reads: Mercury. Distance from Sun: 0.39AU------------ or- 3----- light-- minutes--."],~ + +** Processing line: ~ outputs.labels << [grid.left.shift_right(30),~ - Inside source: true *** True Line Result - [ 7 - 2, 10, 5, 5, "The label- reads: Mercury. Distance from Sun: 0.39AU------------ or- 3----- light-- minutes--."], -** Processing line: ~ [14 - 2, 10, 5, 5, "The label- reads: Venus. Distance from Sun: 0.72AU------------ or- 6----- light-- minutes--."],~ + outputs.labels << [grid.left.shift_right(30), +** Processing line: ~ grid.bottom.shift_up(30),~ - Inside source: true *** True Line Result - [14 - 2, 10, 5, 5, "The label- reads: Venus. Distance from Sun: 0.72AU------------ or- 6----- light-- minutes--."], -** Processing line: ~ [21 - 2, 10, 5, 5, "The label- reads: Earth. Distance from Sun: 1.00AU------------ or- 8----- light-- minutes--."],~ + grid.bottom.shift_up(30), +** Processing line: ~ "Two gamepads needed to play. R1 to accelerate. Left and right on D-PAD to turn ship. Hold A to shoot. Press B to drop mines.",~ - Inside source: true *** True Line Result - [21 - 2, 10, 5, 5, "The label- reads: Earth. Distance from Sun: 1.00AU------------ or- 8----- light-- minutes--."], -** Processing line: ~ [28 - 2, 10, 5, 5, "The label- reads: Mars. Distance from Sun: 1.52AU------------ or- 12----- light-- minutes--."],~ + "Two gamepads needed to play. R1 to accelerate. Left and right on D-PAD to turn ship. Hold A to shoot. Press B to drop mines.", +** Processing line: ~ 0, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - [28 - 2, 10, 5, 5, "The label- reads: Mars. Distance from Sun: 1.52AU------------ or- 12----- light-- minutes--."], -** Processing line: ~ [35 - 2, 10, 5, 5, "The label- reads: Jupiter. Distance from Sun: 5.20AU------------ or- 45----- light-- minutes--."],~ + 0, 0, 255, 255, 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - [35 - 2, 10, 5, 5, "The label- reads: Jupiter. Distance from Sun: 5.20AU------------ or- 45----- light-- minutes--."], -** Processing line: ~ [42 - 2, 10, 5, 5, "The label- reads: Saturn. Distance from Sun: 9.53AU------------ or- 79----- light-- minutes--."],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [42 - 2, 10, 5, 5, "The label- reads: Saturn. Distance from Sun: 9.53AU------------ or- 79----- light-- minutes--."], -** Processing line: ~ [49 - 2, 10, 5, 5, "The label- reads: Uranus. Distance from Sun: 19.81AU------------ or- 159----- light-- minutes--."],~ + +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - [49 - 2, 10, 5, 5, "The label- reads: Uranus. Distance from Sun: 19.81AU------------ or- 159----- light-- minutes--."], -** Processing line: ~ [56 - 2, 10, 5, 5, "The label- reads: Neptune. Distance from Sun: 30.05AU------------ or- 4.1----- light-- hours--. What?! The message--- I received-- was from a source-- farther-- than-- Neptune?!"],~ + def calc +** Processing line: ~ calc_thrusts~ - Inside source: true *** True Line Result - [56 - 2, 10, 5, 5, "The label- reads: Neptune. Distance from Sun: 30.05AU------------ or- 4.1----- light-- hours--. What?! The message--- I received-- was from a source-- farther-- than-- Neptune?!"], -** Processing line: ~ [63 - 2, 10, 5, 5, "The label- reads: Pluto. Dista- Wait... Pluto-- isn't-- a planet. People-- thought- Pluto-- was a planet-- back- then?--"],~ + calc_thrusts +** Processing line: ~ calc_ships~ - Inside source: true *** True Line Result - [63 - 2, 10, 5, 5, "The label- reads: Pluto. Dista- Wait... Pluto-- isn't-- a planet. People-- thought- Pluto-- was a planet-- back- then?--"], -** Processing line: ~ ]~ + calc_ships +** Processing line: ~ calc_bullets~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + calc_bullets +** Processing line: ~ calc_winner~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + calc_winner +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def speed_of_light_end_of_day args~ +** Processing line: ~ def input~ - Inside source: true *** True Line Result - def speed_of_light_end_of_day args -** Processing line: ~ {~ + def input +** Processing line: ~ input_accelerate~ - Inside source: true *** True Line Result - { -** Processing line: ~ fade: 60,~ + input_accelerate +** Processing line: ~ input_turn~ - Inside source: true *** True Line Result - fade: 60, -** Processing line: ~ background: 'sprites/inside-home.png',~ + input_turn +** Processing line: ~ input_bullets_and_mines~ - Inside source: true *** True Line Result - background: 'sprites/inside-home.png', -** Processing line: ~ player: [35, 0],~ + input_bullets_and_mines +** Processing line: ~ end~ - Inside source: true *** True Line Result - player: [35, 0], -** Processing line: ~ storylines: [~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - storylines: [ -** Processing line: ~ [35, 10, 4, 4, "Wonder-- what the reply-- will be. Who- the hell is contacting--- me from beyond-- Neptune? This- has to be some- kind- of- joke."]~ + +** Processing line: ~ def render_score~ - Inside source: true *** True Line Result - [35, 10, 4, 4, "Wonder-- what the reply-- will be. Who- the hell is contacting--- me from beyond-- Neptune? This- has to be some- kind- of- joke."] -** Processing line: ~ ],~ + def render_score +** Processing line: ~ outputs.labels << [grid.left.shift_right(80),~ - Inside source: true *** True Line Result - ], -** Processing line: ~ scenes: [~ + outputs.labels << [grid.left.shift_right(80), +** Processing line: ~ grid.top.shift_down(40),~ - Inside source: true *** True Line Result - scenes: [ -** Processing line: ~ [31, 38, 10, 12, :serenity_alive_side_of_home]~ + grid.top.shift_down(40), +** Processing line: ~ state.ship_blue_score, 30, 1, state.ship_blue.color]~ - Inside source: true *** True Line Result - [31, 38, 10, 12, :serenity_alive_side_of_home] -** Processing line: ~ ]~ + state.ship_blue_score, 30, 1, state.ship_blue.color] +** Processing line: ~~ - Inside source: true *** True Line Result - ] -** Processing line: ~ }~ + +** Processing line: ~ outputs.labels << [grid.right.shift_left(80),~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + outputs.labels << [grid.right.shift_left(80), +** Processing line: ~ grid.top.shift_down(40),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + grid.top.shift_down(40), +** Processing line: ~ state.ship_red_score, 30, 1, state.ship_red.color]~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + state.ship_red_score, 30, 1, state.ship_red.color] +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Rpg Roguelike - Roguelike Line Of Sight - constants.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Rpg Roguelike - Roguelike Line Of Sight - constants.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/constants.rb~ +** Processing line: ~ def render_universe~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/constants.rb -** Processing line: ~ SHOW_LEGEND = true~ + def render_universe +** Processing line: ~ return if outputs.static_solids.any?~ - Inside source: true *** True Line Result - SHOW_LEGEND = true -** Processing line: ~ SOURCE_TILE_SIZE = 16~ + return if outputs.static_solids.any? +** Processing line: ~ outputs.static_solids << grid.rect~ - Inside source: true *** True Line Result - SOURCE_TILE_SIZE = 16 -** Processing line: ~ DESTINATION_TILE_SIZE = 16~ + outputs.static_solids << grid.rect +** Processing line: ~ outputs.static_solids << state.stars~ - Inside source: true *** True Line Result - DESTINATION_TILE_SIZE = 16 -** Processing line: ~ TILE_SHEET_SIZE = 256~ + outputs.static_solids << state.stars +** Processing line: ~ end~ - Inside source: true *** True Line Result - TILE_SHEET_SIZE = 256 -** Processing line: ~ TILE_R = 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - TILE_R = 0 -** Processing line: ~ TILE_G = 0~ + +** Processing line: ~ def apply_round_finished_alpha entity~ - Inside source: true *** True Line Result - TILE_G = 0 -** Processing line: ~ TILE_B = 0~ + def apply_round_finished_alpha entity +** Processing line: ~ return entity unless state.round_finished_debounce~ - Inside source: true *** True Line Result - TILE_B = 0 -** Processing line: ~ TILE_A = 255~ + return entity unless state.round_finished_debounce +** Processing line: ~ entity.a *= state.round_finished_debounce.percentage_of(2.seconds)~ - Inside source: true *** True Line Result - TILE_A = 255 -** Processing line: ~~ + entity.a *= state.round_finished_debounce.percentage_of(2.seconds) +** Processing line: ~ return entity~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + return entity +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Rpg Roguelike - Roguelike Line Of Sight - legend.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ def update_ship_outputs ship, sprite_size = 66~ +- Inside source: true *** True Line Result -* Rpg Roguelike - Roguelike Line Of Sight - legend.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + def update_ship_outputs ship, sprite_size = 66 +** Processing line: ~ ship.sprite =~ +- Inside source: true *** True Line Result - + ship.sprite = +** Processing line: ~ apply_round_finished_alpha [sprite_size.to_square(ship.x, ship.y),~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/legend.rb~ + apply_round_finished_alpha [sprite_size.to_square(ship.x, ship.y), +** Processing line: ~ ship.sprite_path,~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/legend.rb -** Processing line: ~ def tick_legend args~ + ship.sprite_path, +** Processing line: ~ ship.angle,~ - Inside source: true *** True Line Result - def tick_legend args -** Processing line: ~ return unless SHOW_LEGEND~ + ship.angle, +** Processing line: ~ ship.dead ? 0 : 255 * ship.created_at.ease(2.seconds)].sprite~ - Inside source: true *** True Line Result - return unless SHOW_LEGEND -** Processing line: ~~ + ship.dead ? 0 : 255 * ship.created_at.ease(2.seconds)].sprite +** Processing line: ~ ship.label =~ - Inside source: true *** True Line Result - -** Processing line: ~ legend_padding = 16~ + ship.label = +** Processing line: ~ apply_round_finished_alpha [ship.x,~ - Inside source: true *** True Line Result - legend_padding = 16 -** Processing line: ~ legend_x = 1280 - TILE_SHEET_SIZE - legend_padding~ + apply_round_finished_alpha [ship.x, +** Processing line: ~ ship.y + 100,~ - Inside source: true *** True Line Result - legend_x = 1280 - TILE_SHEET_SIZE - legend_padding -** Processing line: ~ legend_y = 720 - TILE_SHEET_SIZE - legend_padding~ + ship.y + 100, +** Processing line: ~ "." * 5.minus(ship.damage).greater(0), 20, 1, ship.color, 255].label~ - Inside source: true *** True Line Result - legend_y = 720 - TILE_SHEET_SIZE - legend_padding -** Processing line: ~ tile_sheet_sprite = [legend_x,~ + "." * 5.minus(ship.damage).greater(0), 20, 1, ship.color, 255].label +** Processing line: ~ end~ - Inside source: true *** True Line Result - tile_sheet_sprite = [legend_x, -** Processing line: ~ legend_y,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - legend_y, -** Processing line: ~ TILE_SHEET_SIZE,~ + +** Processing line: ~ def render_flames sprite_size = 6~ - Inside source: true *** True Line Result - TILE_SHEET_SIZE, -** Processing line: ~ TILE_SHEET_SIZE,~ + def render_flames sprite_size = 6 +** Processing line: ~ outputs.sprites << state.flames.map do |p|~ - Inside source: true *** True Line Result - TILE_SHEET_SIZE, -** Processing line: ~ 'sprites/simple-mood-16x16.png', 0,~ + outputs.sprites << state.flames.map do |p| +** Processing line: ~ apply_round_finished_alpha [sprite_size.to_square(p.x, p.y),~ - Inside source: true *** True Line Result - 'sprites/simple-mood-16x16.png', 0, -** Processing line: ~ TILE_A,~ + apply_round_finished_alpha [sprite_size.to_square(p.x, p.y), +** Processing line: ~ 'sprites/flame.png', 0,~ - Inside source: true *** True Line Result - TILE_A, -** Processing line: ~ TILE_R,~ + 'sprites/flame.png', 0, +** Processing line: ~ p.max_alpha * p.created_at.ease(p.lifetime, :flip)].sprite~ - Inside source: true *** True Line Result - TILE_R, -** Processing line: ~ TILE_G,~ + p.max_alpha * p.created_at.ease(p.lifetime, :flip)].sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - TILE_G, -** Processing line: ~ TILE_B]~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - TILE_B] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if args.inputs.mouse.point.inside_rect? tile_sheet_sprite~ +** Processing line: ~ def render_bullets sprite_size = 10~ - Inside source: true *** True Line Result - if args.inputs.mouse.point.inside_rect? tile_sheet_sprite -** Processing line: ~ mouse_row = args.inputs.mouse.point.y.idiv(SOURCE_TILE_SIZE)~ + def render_bullets sprite_size = 10 +** Processing line: ~ outputs.sprites << state.bullets.map do |b|~ - Inside source: true *** True Line Result - mouse_row = args.inputs.mouse.point.y.idiv(SOURCE_TILE_SIZE) -** Processing line: ~ tile_row = 15 - (mouse_row - legend_y.idiv(SOURCE_TILE_SIZE))~ + outputs.sprites << state.bullets.map do |b| +** Processing line: ~ apply_round_finished_alpha [b.sprite_size.to_square(b.x, b.y),~ - Inside source: true *** True Line Result - tile_row = 15 - (mouse_row - legend_y.idiv(SOURCE_TILE_SIZE)) -** Processing line: ~~ + apply_round_finished_alpha [b.sprite_size.to_square(b.x, b.y), +** Processing line: ~ b.owner.bullet_sprite_path,~ - Inside source: true *** True Line Result - -** Processing line: ~ mouse_col = args.inputs.mouse.point.x.idiv(SOURCE_TILE_SIZE)~ + b.owner.bullet_sprite_path, +** Processing line: ~ 0, b.max_alpha].sprite~ - Inside source: true *** True Line Result - mouse_col = args.inputs.mouse.point.x.idiv(SOURCE_TILE_SIZE) -** Processing line: ~ tile_col = (mouse_col - legend_x.idiv(SOURCE_TILE_SIZE))~ + 0, b.max_alpha].sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - tile_col = (mouse_col - legend_x.idiv(SOURCE_TILE_SIZE)) + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.primitives << [legend_x - legend_padding * 2,~ +** Processing line: ~ def wrap_location! location~ - Inside source: true *** True Line Result - args.outputs.primitives << [legend_x - legend_padding * 2, -** Processing line: ~ mouse_row * SOURCE_TILE_SIZE, 256 + legend_padding * 2, 16, 128, 128, 128, 64].solid~ + def wrap_location! location +** Processing line: ~ location.x = grid.left if location.x > grid.right~ - Inside source: true *** True Line Result - mouse_row * SOURCE_TILE_SIZE, 256 + legend_padding * 2, 16, 128, 128, 128, 64].solid -** Processing line: ~~ + location.x = grid.left if location.x > grid.right +** Processing line: ~ location.x = grid.right if location.x < grid.left~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.primitives << [mouse_col * SOURCE_TILE_SIZE,~ + location.x = grid.right if location.x < grid.left +** Processing line: ~ location.y = grid.top if location.y < grid.bottom~ - Inside source: true *** True Line Result - args.outputs.primitives << [mouse_col * SOURCE_TILE_SIZE, -** Processing line: ~ legend_y - legend_padding * 2, 16, 256 + legend_padding * 2, 128, 128, 128, 64].solid~ + location.y = grid.top if location.y < grid.bottom +** Processing line: ~ location.y = grid.bottom if location.y > grid.top~ - Inside source: true *** True Line Result - legend_y - legend_padding * 2, 16, 256 + legend_padding * 2, 128, 128, 128, 64].solid -** Processing line: ~~ + location.y = grid.bottom if location.y > grid.top +** Processing line: ~ location~ - Inside source: true *** True Line Result - -** Processing line: ~ sprite_key = sprite_lookup.find { |k, v| v == [tile_row, tile_col] }~ + location +** Processing line: ~ end~ - Inside source: true *** True Line Result - sprite_key = sprite_lookup.find { |k, v| v == [tile_row, tile_col] } -** Processing line: ~ if sprite_key~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - if sprite_key -** Processing line: ~ member_name, _ = sprite_key~ + +** Processing line: ~ def calc_thrusts~ - Inside source: true *** True Line Result - member_name, _ = sprite_key -** Processing line: ~ member_name = member_name_as_code member_name~ + def calc_thrusts +** Processing line: ~ state.flames =~ - Inside source: true *** True Line Result - member_name = member_name_as_code member_name -** Processing line: ~ args.outputs.labels << [660, 70, "# CODE SAMPLE (place in the tick_game method located in main.rb)", -1, 0]~ + state.flames = +** Processing line: ~ state.flames~ - Inside source: true *** True Line Result - args.outputs.labels << [660, 70, "# CODE SAMPLE (place in the tick_game method located in main.rb)", -1, 0] -** Processing line: ~ args.outputs.labels << [660, 50, "# GRID_X, GRID_Y, TILE_KEY", -1, 0]~ + state.flames +** Processing line: ~ .reject(&:old?)~ - Inside source: true *** True Line Result - args.outputs.labels << [660, 50, "# GRID_X, GRID_Y, TILE_KEY", -1, 0] -** Processing line: ~ args.outputs.labels << [660, 30, "args.outputs.sprites << tile_in_game( 5, 6, #{member_name} )", -1, 0]~ + .reject(&:old?) +** Processing line: ~ .map do |p|~ - Inside source: true *** True Line Result - args.outputs.labels << [660, 30, "args.outputs.sprites << tile_in_game( 5, 6, #{member_name} )", -1, 0] -** Processing line: ~ else~ + .map do |p| +** Processing line: ~ p.speed *= 0.9~ - Inside source: true *** True Line Result - else -** Processing line: ~ args.outputs.labels << [660, 50, "Tile [#{tile_row}, #{tile_col}] not found. Add a key and value to app/sprite_lookup.rb:", -1, 0]~ + p.speed *= 0.9 +** Processing line: ~ p.y += p.angle.vector_y(p.speed)~ - Inside source: true *** True Line Result - args.outputs.labels << [660, 50, "Tile [#{tile_row}, #{tile_col}] not found. Add a key and value to app/sprite_lookup.rb:", -1, 0] -** Processing line: ~ args.outputs.labels << [660, 30, "{ \"some_string\" => [#{tile_row}, #{tile_col}] } OR { some_symbol: [#{tile_row}, #{tile_col}] }.", -1, 0]~ + p.y += p.angle.vector_y(p.speed) +** Processing line: ~ p.x += p.angle.vector_x(p.speed)~ - Inside source: true *** True Line Result - args.outputs.labels << [660, 30, "{ \"some_string\" => [#{tile_row}, #{tile_col}] } OR { some_symbol: [#{tile_row}, #{tile_col}] }.", -1, 0] -** Processing line: ~ end~ + p.x += p.angle.vector_x(p.speed) +** Processing line: ~ wrap_location! p~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + wrap_location! p +** Processing line: ~ end~ - Inside source: true *** True Line Result - + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -85355,318 +89136,302 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # render the sprite in the top right with a padding to the top and right so it's~ +** Processing line: ~ def all_ships~ - Inside source: true *** True Line Result - # render the sprite in the top right with a padding to the top and right so it's -** Processing line: ~ # not flush against the edge~ + def all_ships +** Processing line: ~ [state.ship_blue, state.ship_red]~ - Inside source: true *** True Line Result - # not flush against the edge -** Processing line: ~ args.outputs.sprites << tile_sheet_sprite~ + [state.ship_blue, state.ship_red] +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.outputs.sprites << tile_sheet_sprite + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # carefully place some ascii arrows to show the legend labels~ +** Processing line: ~ def alive_ships~ - Inside source: true *** True Line Result - # carefully place some ascii arrows to show the legend labels -** Processing line: ~ args.outputs.labels << [895, 707, "ROW --->"]~ + def alive_ships +** Processing line: ~ all_ships.reject { |s| s.dead }~ - Inside source: true *** True Line Result - args.outputs.labels << [895, 707, "ROW --->"] -** Processing line: ~ args.outputs.labels << [943, 412, " ^"]~ + all_ships.reject { |s| s.dead } +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.outputs.labels << [943, 412, " ^"] -** Processing line: ~ args.outputs.labels << [943, 412, " |"]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.outputs.labels << [943, 412, " |"] -** Processing line: ~ args.outputs.labels << [943, 394, "COL ---+"]~ + +** Processing line: ~ def calc_bullet bullet~ - Inside source: true *** True Line Result - args.outputs.labels << [943, 394, "COL ---+"] -** Processing line: ~~ + def calc_bullet bullet +** Processing line: ~ bullet.y += bullet.angle.vector_y(bullet.speed)~ - Inside source: true *** True Line Result - -** Processing line: ~ # use the tile sheet to print out row and column numbers~ + bullet.y += bullet.angle.vector_y(bullet.speed) +** Processing line: ~ bullet.x += bullet.angle.vector_x(bullet.speed)~ - Inside source: true *** True Line Result - # use the tile sheet to print out row and column numbers -** Processing line: ~ args.outputs.sprites << 16.map_with_index do |i|~ + bullet.x += bullet.angle.vector_x(bullet.speed) +** Processing line: ~ wrap_location! bullet~ - Inside source: true *** True Line Result - args.outputs.sprites << 16.map_with_index do |i| -** Processing line: ~ sprite_key = i % 10~ + wrap_location! bullet +** Processing line: ~ explode_bullet! bullet if bullet.old?~ - Inside source: true *** True Line Result - sprite_key = i % 10 -** Processing line: ~ [~ + explode_bullet! bullet if bullet.old? +** Processing line: ~ return if bullet.exploded~ - Inside source: true *** True Line Result - [ -** Processing line: ~ tile(1280 - TILE_SHEET_SIZE - legend_padding * 2 - SOURCE_TILE_SIZE,~ + return if bullet.exploded +** Processing line: ~ return if state.round_finished~ - Inside source: true *** True Line Result - tile(1280 - TILE_SHEET_SIZE - legend_padding * 2 - SOURCE_TILE_SIZE, -** Processing line: ~ 720 - legend_padding * 2 - (SOURCE_TILE_SIZE * i),~ + return if state.round_finished +** Processing line: ~ alive_ships.each do |s|~ - Inside source: true *** True Line Result - 720 - legend_padding * 2 - (SOURCE_TILE_SIZE * i), -** Processing line: ~ sprite(sprite_key)),~ + alive_ships.each do |s| +** Processing line: ~ if s != bullet.owner &&~ - Inside source: true *** True Line Result - sprite(sprite_key)), -** Processing line: ~ tile(1280 - TILE_SHEET_SIZE - SOURCE_TILE_SIZE + (SOURCE_TILE_SIZE * i),~ + if s != bullet.owner && +** Processing line: ~ s.sprite.intersect_rect?(bullet.sprite_size.to_square(bullet.x, bullet.y))~ - Inside source: true *** True Line Result - tile(1280 - TILE_SHEET_SIZE - SOURCE_TILE_SIZE + (SOURCE_TILE_SIZE * i), -** Processing line: ~ 720 - TILE_SHEET_SIZE - legend_padding * 3, sprite(sprite_key))~ + s.sprite.intersect_rect?(bullet.sprite_size.to_square(bullet.x, bullet.y)) +** Processing line: ~ explode_bullet! bullet, 10, 5, 30~ - Inside source: true *** True Line Result - 720 - TILE_SHEET_SIZE - legend_padding * 3, sprite(sprite_key)) -** Processing line: ~ ]~ + explode_bullet! bullet, 10, 5, 30 +** Processing line: ~ s.damage += 1~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + s.damage += 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ end~ - 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 + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* Rpg Roguelike - Roguelike Line Of Sight - main.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* Rpg Roguelike - Roguelike Line Of Sight - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/main.rb~ +** Processing line: ~ def calc_bullets~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/main.rb -** Processing line: ~ require 'app/constants.rb'~ + def calc_bullets +** Processing line: ~ state.bullets.each { |b| calc_bullet b }~ - Inside source: true *** True Line Result - require 'app/constants.rb' -** Processing line: ~ require 'app/sprite_lookup.rb'~ + state.bullets.each { |b| calc_bullet b } +** Processing line: ~ state.bullets.reject! { |b| b.exploded }~ - Inside source: true *** True Line Result - require 'app/sprite_lookup.rb' -** Processing line: ~ require 'app/legend.rb'~ + state.bullets.reject! { |b| b.exploded } +** Processing line: ~ end~ - Inside source: true *** True Line Result - require 'app/legend.rb' + 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: ~ tick_game args~ +** Processing line: ~ def create_explosion! type, entity, flame_count, max_speed, lifetime, max_alpha = 255~ - Inside source: true *** True Line Result - tick_game args -** Processing line: ~ tick_legend args~ + def create_explosion! type, entity, flame_count, max_speed, lifetime, max_alpha = 255 +** Processing line: ~ flame_count.times do~ - Inside source: true *** True Line Result - tick_legend args -** Processing line: ~ end~ + flame_count.times do +** Processing line: ~ state.flames << state.new_entity(type,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.flames << state.new_entity(type, +** Processing line: ~ { angle: 360.randomize(:ratio),~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick_game args~ + { angle: 360.randomize(:ratio), +** Processing line: ~ speed: max_speed.randomize(:ratio),~ - Inside source: true *** True Line Result - def tick_game args -** Processing line: ~ # setup the grid~ + speed: max_speed.randomize(:ratio), +** Processing line: ~ lifetime: lifetime,~ - Inside source: true *** True Line Result - # setup the grid -** Processing line: ~ args.state.grid.padding = 104~ + lifetime: lifetime, +** Processing line: ~ x: entity.x,~ - Inside source: true *** True Line Result - args.state.grid.padding = 104 -** Processing line: ~ args.state.grid.size = 512~ + x: entity.x, +** Processing line: ~ y: entity.y,~ - Inside source: true *** True Line Result - args.state.grid.size = 512 -** Processing line: ~~ + y: entity.y, +** Processing line: ~ max_alpha: max_alpha })~ - Inside source: true *** True Line Result - -** Processing line: ~ # set up your game~ + max_alpha: max_alpha }) +** Processing line: ~ end~ - Inside source: true *** True Line Result - # set up your game -** Processing line: ~ # initialize the game/game defaults. ||= means that you only initialize it if~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # initialize the game/game defaults. ||= means that you only initialize it if -** Processing line: ~ # the value isn't alread initialized~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # the value isn't alread initialized -** Processing line: ~ args.state.player.x ||= 0~ + +** Processing line: ~ def explode_bullet! bullet, flame_override = 5, max_speed = 5, lifetime = 10~ - Inside source: true *** True Line Result - args.state.player.x ||= 0 -** Processing line: ~ args.state.player.y ||= 0~ + def explode_bullet! bullet, flame_override = 5, max_speed = 5, lifetime = 10 +** Processing line: ~ bullet.exploded = true~ - Inside source: true *** True Line Result - args.state.player.y ||= 0 -** Processing line: ~~ + bullet.exploded = true +** Processing line: ~ create_explosion! :bullet_explosion,~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.enemies ||= [~ + create_explosion! :bullet_explosion, +** Processing line: ~ bullet,~ - Inside source: true *** True Line Result - args.state.enemies ||= [ -** Processing line: ~ { x: 10, y: 10, type: :goblin, tile_key: :G },~ + bullet, +** Processing line: ~ flame_override,~ - Inside source: true *** True Line Result - { x: 10, y: 10, type: :goblin, tile_key: :G }, -** Processing line: ~ { x: 15, y: 30, type: :rat, tile_key: :R }~ + flame_override, +** Processing line: ~ max_speed,~ - Inside source: true *** True Line Result - { x: 15, y: 30, type: :rat, tile_key: :R } -** Processing line: ~ ]~ + max_speed, +** Processing line: ~ lifetime,~ - Inside source: true *** True Line Result - ] -** Processing line: ~~ + lifetime, +** Processing line: ~ bullet.max_alpha~ - Inside source: true *** True Line Result - -** Processing line: ~ args.state.info_message ||= "Use arrow keys to move around."~ + bullet.max_alpha +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.state.info_message ||= "Use arrow keys to move around." + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # handle keyboard input~ +** Processing line: ~ def calc_ship ship~ - Inside source: true *** True Line Result - # handle keyboard input -** Processing line: ~ # keyboard input (arrow keys to move player)~ + def calc_ship ship +** Processing line: ~ ship.x += ship.dx~ - Inside source: true *** True Line Result - # keyboard input (arrow keys to move player) -** Processing line: ~ new_player_x = args.state.player.x~ + ship.x += ship.dx +** Processing line: ~ ship.y += ship.dy~ - Inside source: true *** True Line Result - new_player_x = args.state.player.x -** Processing line: ~ new_player_y = args.state.player.y~ + ship.y += ship.dy +** Processing line: ~ wrap_location! ship~ - Inside source: true *** True Line Result - new_player_y = args.state.player.y -** Processing line: ~ player_direction = ""~ + wrap_location! ship +** Processing line: ~ end~ - Inside source: true *** True Line Result - player_direction = "" -** Processing line: ~ player_moved = false~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - player_moved = false -** Processing line: ~ if args.inputs.keyboard.key_down.up~ + +** Processing line: ~ def calc_ships~ - Inside source: true *** True Line Result - if args.inputs.keyboard.key_down.up -** Processing line: ~ new_player_y += 1~ + def calc_ships +** Processing line: ~ all_ships.each { |s| calc_ship s }~ - Inside source: true *** True Line Result - new_player_y += 1 -** Processing line: ~ player_direction = "north"~ + all_ships.each { |s| calc_ship s } +** Processing line: ~ return if all_ships.any? { |s| s.dead }~ - Inside source: true *** True Line Result - player_direction = "north" -** Processing line: ~ player_moved = true~ + return if all_ships.any? { |s| s.dead } +** Processing line: ~ return if state.round_finished~ - Inside source: true *** True Line Result - player_moved = true -** Processing line: ~ elsif args.inputs.keyboard.key_down.down~ + return if state.round_finished +** Processing line: ~ return unless state.ship_blue.sprite.intersect_rect?(state.ship_red.sprite)~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.down -** Processing line: ~ new_player_y -= 1~ + return unless state.ship_blue.sprite.intersect_rect?(state.ship_red.sprite) +** Processing line: ~ state.ship_blue.damage = 5~ - Inside source: true *** True Line Result - new_player_y -= 1 -** Processing line: ~ player_direction = "south"~ + state.ship_blue.damage = 5 +** Processing line: ~ state.ship_red.damage = 5~ - Inside source: true *** True Line Result - player_direction = "south" -** Processing line: ~ player_moved = true~ + state.ship_red.damage = 5 +** Processing line: ~ end~ - Inside source: true *** True Line Result - player_moved = true -** Processing line: ~ elsif args.inputs.keyboard.key_down.right~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.right -** Processing line: ~ new_player_x += 1~ + +** Processing line: ~ def create_thruster_flames! ship~ - Inside source: true *** True Line Result - new_player_x += 1 -** Processing line: ~ player_direction = "east"~ + def create_thruster_flames! ship +** Processing line: ~ state.flames << state.new_entity(:ship_thruster,~ - Inside source: true *** True Line Result - player_direction = "east" -** Processing line: ~ player_moved = true~ + state.flames << state.new_entity(:ship_thruster, +** Processing line: ~ { angle: ship.angle + 180 + 60.randomize(:sign, :ratio),~ - Inside source: true *** True Line Result - player_moved = true -** Processing line: ~ elsif args.inputs.keyboard.key_down.left~ + { angle: ship.angle + 180 + 60.randomize(:sign, :ratio), +** Processing line: ~ speed: 5.randomize(:ratio),~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.left -** Processing line: ~ new_player_x -= 1~ + speed: 5.randomize(:ratio), +** Processing line: ~ max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds),~ - Inside source: true *** True Line Result - new_player_x -= 1 -** Processing line: ~ player_direction = "west"~ + max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), +** Processing line: ~ lifetime: 30,~ - Inside source: true *** True Line Result - player_direction = "west" -** Processing line: ~ player_moved = true~ + lifetime: 30, +** Processing line: ~ x: ship.x - ship.angle.vector_x(40) + 5.randomize(:sign, :ratio),~ - Inside source: true *** True Line Result - player_moved = true + x: ship.x - ship.angle.vector_x(40) + 5.randomize(:sign, :ratio), +** Processing line: ~ y: ship.y - ship.angle.vector_y(40) + 5.randomize(:sign, :ratio) })~ +- Inside source: true +*** True Line Result + y: ship.y - ship.angle.vector_y(40) + 5.randomize(:sign, :ratio) }) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -85675,62 +89440,54 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ #handle game logic~ -- Inside source: true -*** True Line Result - #handle game logic -** Processing line: ~ # determine if there is an enemy on that square,~ -- Inside source: true -*** True Line Result - # determine if there is an enemy on that square, -** Processing line: ~ # if so, don't let the player move there~ -- Inside source: true -*** True Line Result - # if so, don't let the player move there -** Processing line: ~ if player_moved~ +** Processing line: ~ def input_accelerate_ship should_move_ship, ship~ - Inside source: true *** True Line Result - if player_moved -** Processing line: ~ found_enemy = args.state.enemies.find do |e|~ + def input_accelerate_ship should_move_ship, ship +** Processing line: ~ return if ship.dead~ - Inside source: true *** True Line Result - found_enemy = args.state.enemies.find do |e| -** Processing line: ~ e[:x] == new_player_x && e[:y] == new_player_y~ + return if ship.dead +** Processing line: ~~ - Inside source: true *** True Line Result - e[:x] == new_player_x && e[:y] == new_player_y -** Processing line: ~ end~ + +** Processing line: ~ should_move_ship &&= (ship.dx + ship.dy).abs < 5~ - Inside source: true *** True Line Result - end + should_move_ship &&= (ship.dx + ship.dy).abs < 5 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if !found_enemy~ +** Processing line: ~ if should_move_ship~ - Inside source: true *** True Line Result - if !found_enemy -** Processing line: ~ args.state.player.x = new_player_x~ + if should_move_ship +** Processing line: ~ create_thruster_flames! ship~ - Inside source: true *** True Line Result - args.state.player.x = new_player_x -** Processing line: ~ args.state.player.y = new_player_y~ + create_thruster_flames! ship +** Processing line: ~ ship.dx += ship.angle.vector_x 0.050~ - Inside source: true *** True Line Result - args.state.player.y = new_player_y -** Processing line: ~ args.state.info_message = "You moved #{player_direction}."~ + ship.dx += ship.angle.vector_x 0.050 +** Processing line: ~ ship.dy += ship.angle.vector_y 0.050~ - Inside source: true *** True Line Result - args.state.info_message = "You moved #{player_direction}." + ship.dy += ship.angle.vector_y 0.050 ** Processing line: ~ else~ - Inside source: true *** True Line Result else -** Processing line: ~ args.state.info_message = "You cannot move into a square an enemy occupies."~ +** Processing line: ~ ship.dx *= 0.99~ - Inside source: true *** True Line Result - args.state.info_message = "You cannot move into a square an enemy occupies." + ship.dx *= 0.99 +** Processing line: ~ ship.dy *= 0.99~ +- Inside source: true +*** True Line Result + ship.dy *= 0.99 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -85743,34 +89500,34 @@ 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.sprites << tile_in_game(args.state.player.x,~ +** Processing line: ~ def input_accelerate~ - Inside source: true *** True Line Result - args.outputs.sprites << tile_in_game(args.state.player.x, -** Processing line: ~ args.state.player.y, '@')~ + def input_accelerate +** Processing line: ~ input_accelerate_ship inputs.controller_one.key_held.r1 || inputs.keyboard.up, state.ship_blue~ - Inside source: true *** True Line Result - args.state.player.y, '@') -** Processing line: ~~ + input_accelerate_ship inputs.controller_one.key_held.r1 || inputs.keyboard.up, state.ship_blue +** Processing line: ~ input_accelerate_ship inputs.controller_two.key_held.r1, state.ship_red~ - Inside source: true *** True Line Result - -** Processing line: ~ # render game~ + input_accelerate_ship inputs.controller_two.key_held.r1, state.ship_red +** Processing line: ~ end~ - Inside source: true *** True Line Result - # render game -** Processing line: ~ # render enemies at locations~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # render enemies at locations -** Processing line: ~ args.outputs.sprites << args.state.enemies.map do |e|~ + +** Processing line: ~ def input_turn_ship direction, ship~ - Inside source: true *** True Line Result - args.outputs.sprites << args.state.enemies.map do |e| -** Processing line: ~ tile_in_game(e[:x], e[:y], e[:tile_key])~ + def input_turn_ship direction, ship +** Processing line: ~ ship.angle -= 3 * direction~ - Inside source: true *** True Line Result - tile_in_game(e[:x], e[:y], e[:tile_key]) + ship.angle -= 3 * direction ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -85779,382 +89536,370 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # render the border~ +** Processing line: ~ def input_turn~ - Inside source: true *** True Line Result - # render the border -** Processing line: ~ border_x = args.state.grid.padding - DESTINATION_TILE_SIZE~ + def input_turn +** Processing line: ~ input_turn_ship inputs.controller_one.left_right + inputs.keyboard.left_right, state.ship_blue~ - Inside source: true *** True Line Result - border_x = args.state.grid.padding - DESTINATION_TILE_SIZE -** Processing line: ~ border_y = args.state.grid.padding - DESTINATION_TILE_SIZE~ + input_turn_ship inputs.controller_one.left_right + inputs.keyboard.left_right, state.ship_blue +** Processing line: ~ input_turn_ship inputs.controller_two.left_right, state.ship_red~ - Inside source: true *** True Line Result - border_y = args.state.grid.padding - DESTINATION_TILE_SIZE -** Processing line: ~ border_size = args.state.grid.size + DESTINATION_TILE_SIZE * 2~ + input_turn_ship inputs.controller_two.left_right, state.ship_red +** Processing line: ~ end~ - Inside source: true *** True Line Result - border_size = args.state.grid.size + DESTINATION_TILE_SIZE * 2 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.borders << [border_x,~ -- Inside source: true -*** True Line Result - args.outputs.borders << [border_x, -** Processing line: ~ border_y,~ +** Processing line: ~ def input_bullet create_bullet, ship~ - Inside source: true *** True Line Result - border_y, -** Processing line: ~ border_size,~ + def input_bullet create_bullet, ship +** Processing line: ~ return unless create_bullet~ - Inside source: true *** True Line Result - border_size, -** Processing line: ~ border_size]~ + return unless create_bullet +** Processing line: ~ return if ship.dead~ - Inside source: true *** True Line Result - border_size] + return if ship.dead ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # render label stuff~ +** Processing line: ~ state.bullets << state.new_entity(:ship_bullet,~ - Inside source: true *** True Line Result - # render label stuff -** Processing line: ~ args.outputs.labels << [border_x, border_y - 10, "Current player location is: #{args.state.player.x}, #{args.state.player.y}"]~ + state.bullets << state.new_entity(:ship_bullet, +** Processing line: ~ { owner: ship,~ - Inside source: true *** True Line Result - args.outputs.labels << [border_x, border_y - 10, "Current player location is: #{args.state.player.x}, #{args.state.player.y}"] -** Processing line: ~ args.outputs.labels << [border_x, border_y + 25 + border_size, args.state.info_message]~ + { owner: ship, +** Processing line: ~ angle: ship.angle,~ - Inside source: true *** True Line Result - args.outputs.labels << [border_x, border_y + 25 + border_size, args.state.info_message] -** Processing line: ~ end~ + angle: ship.angle, +** Processing line: ~ max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), +** Processing line: ~ speed: 5 + ship.dx.mult(ship.angle.vector_x) + ship.dy.mult(ship.angle.vector_y),~ - Inside source: true *** True Line Result - -** Processing line: ~ def tile_in_game x, y, tile_key~ + speed: 5 + ship.dx.mult(ship.angle.vector_x) + ship.dy.mult(ship.angle.vector_y), +** Processing line: ~ lifetime: 120,~ - Inside source: true *** True Line Result - def tile_in_game x, y, tile_key -** Processing line: ~ tile($gtk.args.state.grid.padding + x * DESTINATION_TILE_SIZE,~ + lifetime: 120, +** Processing line: ~ sprite_size: 10,~ - Inside source: true *** True Line Result - tile($gtk.args.state.grid.padding + x * DESTINATION_TILE_SIZE, -** Processing line: ~ $gtk.args.state.grid.padding + y * DESTINATION_TILE_SIZE,~ + sprite_size: 10, +** Processing line: ~ x: ship.x + ship.angle.vector_x * 32,~ - Inside source: true *** True Line Result - $gtk.args.state.grid.padding + y * DESTINATION_TILE_SIZE, -** Processing line: ~ tile_key)~ + x: ship.x + ship.angle.vector_x * 32, +** Processing line: ~ y: ship.y + ship.angle.vector_y * 32 })~ - Inside source: true *** True Line Result - tile_key) -** Processing line: ~ end~ + y: ship.y + ship.angle.vector_y * 32 }) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + 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. +** Processing line: ~ def input_mine create_mine, ship~ +- Inside source: true *** True Line Result - -** Processing line: ~* Rpg Roguelike - Roguelike Line Of Sight - sprite_lookup.rb~ -- Header detected. + def input_mine create_mine, ship +** Processing line: ~ return unless create_mine~ +- Inside source: true *** True Line Result - + return unless create_mine +** Processing line: ~ return if ship.dead~ +- Inside source: true *** True Line Result -* Rpg Roguelike - Roguelike Line Of Sight - sprite_lookup.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + return if ship.dead +** Processing line: ~~ +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/sprite_lookup.rb~ +** Processing line: ~ state.bullets << state.new_entity(:ship_bullet,~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/sprite_lookup.rb -** Processing line: ~ def sprite_lookup~ + state.bullets << state.new_entity(:ship_bullet, +** Processing line: ~ { owner: ship,~ - Inside source: true *** True Line Result - def sprite_lookup -** Processing line: ~ {~ + { owner: ship, +** Processing line: ~ angle: 360.randomize(:sign, :ratio),~ - Inside source: true *** True Line Result - { -** Processing line: ~ 0 => [3, 0],~ + angle: 360.randomize(:sign, :ratio), +** Processing line: ~ max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds),~ - Inside source: true *** True Line Result - 0 => [3, 0], -** Processing line: ~ 1 => [3, 1],~ + max_alpha: 255 * ship.created_at_elapsed.percentage_of(2.seconds), +** Processing line: ~ speed: 0.02,~ - Inside source: true *** True Line Result - 1 => [3, 1], -** Processing line: ~ 2 => [3, 2],~ + speed: 0.02, +** Processing line: ~ sprite_size: 10,~ - Inside source: true *** True Line Result - 2 => [3, 2], -** Processing line: ~ 3 => [3, 3],~ + sprite_size: 10, +** Processing line: ~ lifetime: 600,~ - Inside source: true *** True Line Result - 3 => [3, 3], -** Processing line: ~ 4 => [3, 4],~ + lifetime: 600, +** Processing line: ~ x: ship.x + ship.angle.vector_x * -50,~ - Inside source: true *** True Line Result - 4 => [3, 4], -** Processing line: ~ 5 => [3, 5],~ + x: ship.x + ship.angle.vector_x * -50, +** Processing line: ~ y: ship.y + ship.angle.vector_y * -50 })~ - Inside source: true *** True Line Result - 5 => [3, 5], -** Processing line: ~ 6 => [3, 6],~ + y: ship.y + ship.angle.vector_y * -50 }) +** Processing line: ~ end~ - Inside source: true *** True Line Result - 6 => [3, 6], -** Processing line: ~ 7 => [3, 7],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 7 => [3, 7], -** Processing line: ~ 8 => [3, 8],~ + +** Processing line: ~ def input_bullets_and_mines~ - Inside source: true *** True Line Result - 8 => [3, 8], -** Processing line: ~ 9 => [3, 9],~ + def input_bullets_and_mines +** Processing line: ~ return if state.bullets.length > 100~ - Inside source: true *** True Line Result - 9 => [3, 9], -** Processing line: ~ '@' => [4, 0],~ + return if state.bullets.length > 100 +** Processing line: ~~ - Inside source: true *** True Line Result - '@' => [4, 0], -** Processing line: ~ A: [ 4, 1],~ + +** Processing line: ~ [~ - Inside source: true *** True Line Result - A: [ 4, 1], -** Processing line: ~ B: [ 4, 2],~ + [ +** Processing line: ~ [inputs.controller_one.key_held.a || inputs.keyboard.key_held.space,~ - Inside source: true *** True Line Result - B: [ 4, 2], -** Processing line: ~ C: [ 4, 3],~ + [inputs.controller_one.key_held.a || inputs.keyboard.key_held.space, +** Processing line: ~ inputs.controller_one.key_down.b || inputs.keyboard.key_down.down,~ - Inside source: true *** True Line Result - C: [ 4, 3], -** Processing line: ~ D: [ 4, 4],~ -- Inside source: true -*** True Line Result - D: [ 4, 4], -** Processing line: ~ E: [ 4, 5],~ + inputs.controller_one.key_down.b || inputs.keyboard.key_down.down, +** Processing line: ~ state.ship_blue],~ - Inside source: true *** True Line Result - E: [ 4, 5], -** Processing line: ~ F: [ 4, 6],~ + state.ship_blue], +** Processing line: ~ [inputs.controller_two.key_held.a, inputs.controller_two.key_down.b, state.ship_red]~ - Inside source: true *** True Line Result - F: [ 4, 6], -** Processing line: ~ G: [ 4, 7],~ + [inputs.controller_two.key_held.a, inputs.controller_two.key_down.b, state.ship_red] +** Processing line: ~ ].each do |a_held, b_down, ship|~ - Inside source: true *** True Line Result - G: [ 4, 7], -** Processing line: ~ H: [ 4, 8],~ + ].each do |a_held, b_down, ship| +** Processing line: ~ input_bullet(a_held && state.tick_count.mod_zero?(10).or(a_held == 0), ship)~ - Inside source: true *** True Line Result - H: [ 4, 8], -** Processing line: ~ I: [ 4, 9],~ + input_bullet(a_held && state.tick_count.mod_zero?(10).or(a_held == 0), ship) +** Processing line: ~ input_mine(b_down, ship)~ - Inside source: true *** True Line Result - I: [ 4, 9], -** Processing line: ~ J: [ 4, 10],~ + input_mine(b_down, ship) +** Processing line: ~ end~ - Inside source: true *** True Line Result - J: [ 4, 10], -** Processing line: ~ K: [ 4, 11],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - K: [ 4, 11], -** Processing line: ~ L: [ 4, 12],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - L: [ 4, 12], -** Processing line: ~ M: [ 4, 13],~ + +** Processing line: ~ def calc_kill_ships~ - Inside source: true *** True Line Result - M: [ 4, 13], -** Processing line: ~ N: [ 4, 14],~ + def calc_kill_ships +** Processing line: ~ alive_ships.find_all { |s| s.damage >= 5 }.each do |s|~ - Inside source: true *** True Line Result - N: [ 4, 14], -** Processing line: ~ O: [ 4, 15],~ + alive_ships.find_all { |s| s.damage >= 5 }.each do |s| +** Processing line: ~ s.dead = true~ - Inside source: true *** True Line Result - O: [ 4, 15], -** Processing line: ~ P: [ 5, 0],~ + s.dead = true +** Processing line: ~ create_explosion! :ship_explosion, s, 20, 20, 30, s.max_alpha~ - Inside source: true *** True Line Result - P: [ 5, 0], -** Processing line: ~ Q: [ 5, 1],~ + create_explosion! :ship_explosion, s, 20, 20, 30, s.max_alpha +** Processing line: ~ end~ - Inside source: true *** True Line Result - Q: [ 5, 1], -** Processing line: ~ R: [ 5, 2],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - R: [ 5, 2], -** Processing line: ~ S: [ 5, 3],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - S: [ 5, 3], -** Processing line: ~ T: [ 5, 4],~ + +** Processing line: ~ def calc_score~ - Inside source: true *** True Line Result - T: [ 5, 4], -** Processing line: ~ U: [ 5, 5],~ + def calc_score +** Processing line: ~ return if state.round_finished~ - Inside source: true *** True Line Result - U: [ 5, 5], -** Processing line: ~ V: [ 5, 6],~ + return if state.round_finished +** Processing line: ~ return if alive_ships.length > 1~ - Inside source: true *** True Line Result - V: [ 5, 6], -** Processing line: ~ W: [ 5, 7],~ + return if alive_ships.length > 1 +** Processing line: ~~ - Inside source: true *** True Line Result - W: [ 5, 7], -** Processing line: ~ X: [ 5, 8],~ + +** Processing line: ~ if alive_ships.first == state.ship_red~ - Inside source: true *** True Line Result - X: [ 5, 8], -** Processing line: ~ Y: [ 5, 9],~ + if alive_ships.first == state.ship_red +** Processing line: ~ state.ship_red_score += 1~ - Inside source: true *** True Line Result - Y: [ 5, 9], -** Processing line: ~ Z: [ 5, 10],~ + state.ship_red_score += 1 +** Processing line: ~ elsif alive_ships.first == state.ship_blue~ - Inside source: true *** True Line Result - Z: [ 5, 10], -** Processing line: ~ a: [ 6, 1],~ + elsif alive_ships.first == state.ship_blue +** Processing line: ~ state.ship_blue_score += 1~ - Inside source: true *** True Line Result - a: [ 6, 1], -** Processing line: ~ b: [ 6, 2],~ + state.ship_blue_score += 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - b: [ 6, 2], -** Processing line: ~ c: [ 6, 3],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - c: [ 6, 3], -** Processing line: ~ d: [ 6, 4],~ + +** Processing line: ~ state.round_finished = true~ - Inside source: true *** True Line Result - d: [ 6, 4], -** Processing line: ~ e: [ 6, 5],~ + state.round_finished = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - e: [ 6, 5], -** Processing line: ~ f: [ 6, 6],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - f: [ 6, 6], -** Processing line: ~ g: [ 6, 7],~ + +** Processing line: ~ def calc_reset_ships~ - Inside source: true *** True Line Result - g: [ 6, 7], -** Processing line: ~ h: [ 6, 8],~ + def calc_reset_ships +** Processing line: ~ return unless state.round_finished~ - Inside source: true *** True Line Result - h: [ 6, 8], -** Processing line: ~ i: [ 6, 9],~ + return unless state.round_finished +** Processing line: ~ state.round_finished_debounce ||= 2.seconds~ - Inside source: true *** True Line Result - i: [ 6, 9], -** Processing line: ~ j: [ 6, 10],~ + state.round_finished_debounce ||= 2.seconds +** Processing line: ~ state.round_finished_debounce -= 1~ - Inside source: true *** True Line Result - j: [ 6, 10], -** Processing line: ~ k: [ 6, 11],~ + state.round_finished_debounce -= 1 +** Processing line: ~ return if state.round_finished_debounce > 0~ - Inside source: true *** True Line Result - k: [ 6, 11], -** Processing line: ~ l: [ 6, 12],~ + return if state.round_finished_debounce > 0 +** Processing line: ~ start_new_round!~ - Inside source: true *** True Line Result - l: [ 6, 12], -** Processing line: ~ m: [ 6, 13],~ + start_new_round! +** Processing line: ~ end~ - Inside source: true *** True Line Result - m: [ 6, 13], -** Processing line: ~ n: [ 6, 14],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - n: [ 6, 14], -** Processing line: ~ o: [ 6, 15],~ + +** Processing line: ~ def start_new_round!~ - Inside source: true *** True Line Result - o: [ 6, 15], -** Processing line: ~ p: [ 7, 0],~ + def start_new_round! +** Processing line: ~ state.ship_blue = new_blue_ship~ - Inside source: true *** True Line Result - p: [ 7, 0], -** Processing line: ~ q: [ 7, 1],~ + state.ship_blue = new_blue_ship +** Processing line: ~ state.ship_red = new_red_ship~ - Inside source: true *** True Line Result - q: [ 7, 1], -** Processing line: ~ r: [ 7, 2],~ + state.ship_red = new_red_ship +** Processing line: ~ state.round_finished = false~ - Inside source: true *** True Line Result - r: [ 7, 2], -** Processing line: ~ s: [ 7, 3],~ + state.round_finished = false +** Processing line: ~ state.round_finished_debounce = nil~ - Inside source: true *** True Line Result - s: [ 7, 3], -** Processing line: ~ t: [ 7, 4],~ + state.round_finished_debounce = nil +** Processing line: ~ state.flames.clear~ - Inside source: true *** True Line Result - t: [ 7, 4], -** Processing line: ~ u: [ 7, 5],~ + state.flames.clear +** Processing line: ~ state.bullets.clear~ - Inside source: true *** True Line Result - u: [ 7, 5], -** Processing line: ~ v: [ 7, 6],~ + state.bullets.clear +** Processing line: ~ end~ - Inside source: true *** True Line Result - v: [ 7, 6], -** Processing line: ~ w: [ 7, 7],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - w: [ 7, 7], -** Processing line: ~ x: [ 7, 8],~ + +** Processing line: ~ def calc_winner~ - Inside source: true *** True Line Result - x: [ 7, 8], -** Processing line: ~ y: [ 7, 9],~ + def calc_winner +** Processing line: ~ calc_kill_ships~ - Inside source: true *** True Line Result - y: [ 7, 9], -** Processing line: ~ z: [ 7, 10],~ + calc_kill_ships +** Processing line: ~ calc_score~ - Inside source: true *** True Line Result - z: [ 7, 10], -** Processing line: ~ '|' => [ 7, 12]~ + calc_score +** Processing line: ~ calc_reset_ships~ - Inside source: true *** True Line Result - '|' => [ 7, 12] -** Processing line: ~ }~ + calc_reset_ships +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -86163,62 +89908,42 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def sprite key~ -- Inside source: true -*** True Line Result - def sprite key -** Processing line: ~ $gtk.args.state.reserved.sprite_lookup[key]~ -- Inside source: true -*** True Line Result - $gtk.args.state.reserved.sprite_lookup[key] -** Processing line: ~ end~ +** Processing line: ~ $dueling_spaceship = DuelingSpaceships.new~ - Inside source: true *** True Line Result - end + $dueling_spaceship = DuelingSpaceships.new ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def member_name_as_code raw_member_name~ -- Inside source: true -*** True Line Result - def member_name_as_code raw_member_name -** Processing line: ~ if raw_member_name.is_a? Symbol~ -- Inside source: true -*** True Line Result - if raw_member_name.is_a? Symbol -** Processing line: ~ ":#{raw_member_name}"~ -- Inside source: true -*** True Line Result - ":#{raw_member_name}" -** Processing line: ~ elsif raw_member_name.is_a? String~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - elsif raw_member_name.is_a? String -** Processing line: ~ "'#{raw_member_name}'"~ + def tick args +** Processing line: ~ args.grid.origin_center!~ - Inside source: true *** True Line Result - "'#{raw_member_name}'" -** Processing line: ~ elsif raw_member_name.is_a? Fixnum~ + args.grid.origin_center! +** Processing line: ~ $dueling_spaceship.inputs = args.inputs~ - Inside source: true *** True Line Result - elsif raw_member_name.is_a? Fixnum -** Processing line: ~ "#{raw_member_name}"~ + $dueling_spaceship.inputs = args.inputs +** Processing line: ~ $dueling_spaceship.outputs = args.outputs~ - Inside source: true *** True Line Result - "#{raw_member_name}" -** Processing line: ~ else~ + $dueling_spaceship.outputs = args.outputs +** Processing line: ~ $dueling_spaceship.state = args.state~ - Inside source: true *** True Line Result - else -** Processing line: ~ "UNKNOWN: #{raw_member_name}"~ + $dueling_spaceship.state = args.state +** Processing line: ~ $dueling_spaceship.grid = args.grid~ - Inside source: true *** True Line Result - "UNKNOWN: #{raw_member_name}" -** Processing line: ~ end~ + $dueling_spaceship.grid = args.grid +** Processing line: ~ $dueling_spaceship.tick~ - Inside source: true *** True Line Result - end + $dueling_spaceship.tick ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -86227,66 +89952,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 tile x, y, tile_row_column_or_key~ +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** arcade/flappy dragon/credits.txt~ +- Header detected. +*** True Line Result + +*** True Line Result +*** arcade/flappy dragon/credits.txt +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_arcade/flappy_dragon/CREDITS.txt~ - Inside source: true *** True Line Result - def tile x, y, tile_row_column_or_key -** Processing line: ~ tile_extended x, y, DESTINATION_TILE_SIZE, DESTINATION_TILE_SIZE, TILE_R, TILE_G, TILE_B, TILE_A, tile_row_column_or_key~ + # ./samples/99_genre_arcade/flappy_dragon/CREDITS.txt +** Processing line: ~ code: Amir Rajan, https://twitter.com/amirrajan~ - Inside source: true *** True Line Result - tile_extended x, y, DESTINATION_TILE_SIZE, DESTINATION_TILE_SIZE, TILE_R, TILE_G, TILE_B, TILE_A, tile_row_column_or_key -** Processing line: ~ end~ + code: Amir Rajan, https://twitter.com/amirrajan +** Processing line: ~ graphics and audio: Nick Culbertson, https://twitter.com/MobyPixel~ - Inside source: true *** True Line Result - end + graphics and audio: Nick Culbertson, https://twitter.com/MobyPixel ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tile_extended x, y, w, h, r, g, b, a, tile_row_column_or_key~ +** Processing line: ~~ - Inside source: true *** True Line Result - def tile_extended x, y, w, h, r, g, b, a, tile_row_column_or_key -** Processing line: ~ row_or_key, column = tile_row_column_or_key~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - row_or_key, column = tile_row_column_or_key -** Processing line: ~ if !column~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - if !column -** Processing line: ~ row, column = sprite row_or_key~ -- Inside source: true + +** Processing line: ~*** arcade/flappy dragon/main.rb~ +- Header detected. *** True Line Result - row, column = sprite row_or_key -** Processing line: ~ else~ + +*** True Line Result +*** arcade/flappy dragon/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_arcade/flappy_dragon/app/main.rb~ - Inside source: true *** True Line Result - else -** Processing line: ~ row, column = row_or_key, column~ + # ./samples/99_genre_arcade/flappy_dragon/app/main.rb +** Processing line: ~ class FlappyDragon~ - Inside source: true *** True Line Result - row, column = row_or_key, column -** Processing line: ~ end~ + class FlappyDragon +** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs~ - Inside source: true *** True Line Result - end + attr_accessor :grid, :inputs, :state, :outputs ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if !row~ +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - if !row -** Processing line: ~ member_name = member_name_as_code tile_row_column_or_key~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - member_name = member_name_as_code tile_row_column_or_key -** Processing line: ~ raise "Unabled to find a sprite for #{member_name}. Make sure the value exists in app/sprite_lookup.rb."~ + defaults +** Processing line: ~ render~ - Inside source: true *** True Line Result - raise "Unabled to find a sprite for #{member_name}. Make sure the value exists in app/sprite_lookup.rb." + render +** Processing line: ~ calc~ +- Inside source: true +*** True Line Result + calc +** Processing line: ~ process_inputs~ +- Inside source: true +*** True Line Result + process_inputs ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -86295,282 +90056,290 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Sprite provided by Rogue Yun~ +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - # Sprite provided by Rogue Yun -** Processing line: ~ # http://www.bay12forums.com/smf/index.php?topic=144897.0~ + def defaults +** Processing line: ~ state.flap_power = 11~ - Inside source: true *** True Line Result - # http://www.bay12forums.com/smf/index.php?topic=144897.0 -** Processing line: ~ # License: Public Domain~ + state.flap_power = 11 +** Processing line: ~ state.gravity = 0.9~ - Inside source: true *** True Line Result - # License: Public Domain -** Processing line: ~~ + state.gravity = 0.9 +** Processing line: ~ state.ceiling = 600~ - Inside source: true *** True Line Result - -** Processing line: ~ {~ + state.ceiling = 600 +** Processing line: ~ state.ceiling_flap_power = 6~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: x,~ + state.ceiling_flap_power = 6 +** Processing line: ~ state.wall_countdown_length = 100~ - Inside source: true *** True Line Result - x: x, -** Processing line: ~ y: y,~ + state.wall_countdown_length = 100 +** Processing line: ~ state.wall_gap_size = 100~ - Inside source: true *** True Line Result - y: y, -** Processing line: ~ w: w,~ + state.wall_gap_size = 100 +** Processing line: ~ state.wall_countdown ||= 0~ - Inside source: true *** True Line Result - w: w, -** Processing line: ~ h: h,~ + state.wall_countdown ||= 0 +** Processing line: ~ state.hi_score ||= 0~ - Inside source: true *** True Line Result - h: h, -** Processing line: ~ tile_x: column * 16,~ + state.hi_score ||= 0 +** Processing line: ~ state.score ||= 0~ - Inside source: true *** True Line Result - tile_x: column * 16, -** Processing line: ~ tile_y: (row * 16),~ + state.score ||= 0 +** Processing line: ~ state.walls ||= []~ - Inside source: true *** True Line Result - tile_y: (row * 16), -** Processing line: ~ tile_w: 16,~ + state.walls ||= [] +** Processing line: ~ state.x ||= 50~ - Inside source: true *** True Line Result - tile_w: 16, -** Processing line: ~ tile_h: 16,~ + state.x ||= 50 +** Processing line: ~ state.y ||= 500~ - Inside source: true *** True Line Result - tile_h: 16, -** Processing line: ~ r: r,~ + state.y ||= 500 +** Processing line: ~ state.dy ||= 0~ - Inside source: true *** True Line Result - r: r, -** Processing line: ~ g: g,~ + state.dy ||= 0 +** Processing line: ~ state.scene ||= :menu~ - Inside source: true *** True Line Result - g: g, -** Processing line: ~ b: b,~ + state.scene ||= :menu +** Processing line: ~ state.scene_at ||= 0~ - Inside source: true *** True Line Result - b: b, -** Processing line: ~ a: a,~ + state.scene_at ||= 0 +** Processing line: ~ state.difficulty ||= :normal~ - Inside source: true *** True Line Result - a: a, -** Processing line: ~ path: 'sprites/simple-mood-16x16.png'~ + state.difficulty ||= :normal +** Processing line: ~ state.new_difficulty ||= :normal~ - Inside source: true *** True Line Result - path: 'sprites/simple-mood-16x16.png' -** Processing line: ~ }~ + state.new_difficulty ||= :normal +** Processing line: ~ state.countdown ||= 4.seconds~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + state.countdown ||= 4.seconds +** Processing line: ~ state.flash_at ||= 0~ - Inside source: true *** True Line Result - end + state.flash_at ||= 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ $gtk.args.state.reserved.sprite_lookup = sprite_lookup~ +** Processing line: ~ def render~ - Inside source: true *** True Line Result - $gtk.args.state.reserved.sprite_lookup = sprite_lookup -** Processing line: ~~ + def render +** Processing line: ~ outputs.sounds << "sounds/flappy-song.ogg" if state.tick_count == 1~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + outputs.sounds << "sounds/flappy-song.ogg" if state.tick_count == 1 +** Processing line: ~ render_score~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + render_score +** Processing line: ~ render_menu~ +- Inside source: true *** True Line Result - -** Processing line: ~* Rpg Roguelike - Roguelike Starting Point - main.rb~ -- Header detected. + render_menu +** Processing line: ~ render_game~ +- Inside source: true *** True Line Result - + render_game +** Processing line: ~ end~ +- Inside source: true *** True Line Result -* Rpg Roguelike - Roguelike Starting Point - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + end +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ def render_score~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_roguelike/roguelike_starting_point/app/main.rb~ + def render_score +** Processing line: ~ outputs.primitives << [10, 710, "HI SCORE: #{state.hi_score}", large_white_typeset].label~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_roguelike/roguelike_starting_point/app/main.rb -** Processing line: ~ =begin~ + outputs.primitives << [10, 710, "HI SCORE: #{state.hi_score}", large_white_typeset].label +** Processing line: ~ outputs.primitives << [10, 680, "SCORE: #{state.score}", large_white_typeset].label~ - Inside source: true *** True Line Result - =begin -** Processing line: ~~ + outputs.primitives << [10, 680, "SCORE: #{state.score}", large_white_typeset].label +** Processing line: ~ outputs.primitives << [10, 650, "DIFFICULTY: #{state.difficulty.upcase}", large_white_typeset].label~ - Inside source: true *** True Line Result - -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ + outputs.primitives << [10, 650, "DIFFICULTY: #{state.difficulty.upcase}", large_white_typeset].label +** Processing line: ~ end~ - Inside source: true *** True Line Result - APIs listing that haven't been encountered in previous sample apps: + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - lambda: A way to define a block and its parameters with special syntax.~ +** Processing line: ~ def render_menu~ - Inside source: true *** True Line Result - - lambda: A way to define a block and its parameters with special syntax. -** Processing line: ~ For example, the syntax of lambda looks like this:~ + def render_menu +** Processing line: ~ return unless state.scene == :menu~ - Inside source: true *** True Line Result - For example, the syntax of lambda looks like this: -** Processing line: ~ my_lambda = -> { puts "This is my lambda" }~ + return unless state.scene == :menu +** Processing line: ~ render_overlay~ - Inside source: true *** True Line Result - my_lambda = -> { puts "This is my lambda" } + render_overlay ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Reminders:~ -- Inside source: true -*** True Line Result - Reminders: -** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ +** Processing line: ~ outputs.labels << [640, 700, "Flappy Dragon", 50, 1, 255, 255, 255]~ - Inside source: true *** True Line Result - - args.outputs.labels: An array. The values generate a label. -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ + outputs.labels << [640, 700, "Flappy Dragon", 50, 1, 255, 255, 255] +** Processing line: ~ outputs.labels << [640, 500, "Instructions: Press Spacebar to flap. Don't die.", 4, 1, 255, 255, 255]~ - Inside source: true *** True Line Result - The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.~ + outputs.labels << [640, 500, "Instructions: Press Spacebar to flap. Don't die.", 4, 1, 255, 255, 255] +** Processing line: ~ outputs.labels << [430, 430, "[Tab] Change difficulty", 4, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - For more information about labels, go to mygame/documentation/02-labels. -** Processing line: ~~ + outputs.labels << [430, 430, "[Tab] Change difficulty", 4, 0, 255, 255, 255] +** Processing line: ~ outputs.labels << [430, 400, "[Enter] Start at New Difficulty ", 4, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - -** Processing line: ~ - ARRAY#inside_rect?: Returns whether or not the point is inside a rect.~ + outputs.labels << [430, 400, "[Enter] Start at New Difficulty ", 4, 0, 255, 255, 255] +** Processing line: ~ outputs.labels << [430, 370, "[Escape] Cancel/Resume ", 4, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - - ARRAY#inside_rect?: Returns whether or not the point is inside a rect. -** Processing line: ~~ + outputs.labels << [430, 370, "[Escape] Cancel/Resume ", 4, 0, 255, 255, 255] +** Processing line: ~ outputs.labels << [640, 300, "(mouse, touch, and game controllers work, too!) ", 4, 1, 255, 255, 255]~ - Inside source: true *** True Line Result - -** Processing line: ~ - product: Returns an array of all combinations of elements from all arrays.~ + outputs.labels << [640, 300, "(mouse, touch, and game controllers work, too!) ", 4, 1, 255, 255, 255] +** Processing line: ~ outputs.labels << [640, 200, "Difficulty: #{state.new_difficulty.capitalize}", 4, 1, 255, 255, 255]~ - Inside source: true *** True Line Result - - product: Returns an array of all combinations of elements from all arrays. + outputs.labels << [640, 200, "Difficulty: #{state.new_difficulty.capitalize}", 4, 1, 255, 255, 255] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - find: Finds all elements of a collection that meet requirements.~ +** Processing line: ~ outputs.labels << [10, 100, "Code: @amirrajan", 255, 255, 255]~ - Inside source: true *** True Line Result - - find: Finds all elements of a collection that meet requirements. -** Processing line: ~~ + outputs.labels << [10, 100, "Code: @amirrajan", 255, 255, 255] +** Processing line: ~ outputs.labels << [10, 80, "Art: @mobypixel", 255, 255, 255]~ - Inside source: true *** True Line Result - -** Processing line: ~ - abs: Returns the absolute value.~ + outputs.labels << [10, 80, "Art: @mobypixel", 255, 255, 255] +** Processing line: ~ outputs.labels << [10, 60, "Music: @mobypixel", 255, 255, 255]~ - Inside source: true *** True Line Result - - abs: Returns the absolute value. -** Processing line: ~~ + outputs.labels << [10, 60, "Music: @mobypixel", 255, 255, 255] +** Processing line: ~ outputs.labels << [10, 40, "Engine: DragonRuby GTK", 255, 255, 255]~ - Inside source: true *** True Line Result - -** Processing line: ~ =end~ + outputs.labels << [10, 40, "Engine: DragonRuby GTK", 255, 255, 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - =end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # This sample app allows the player to move around in the dungeon, which becomes more or less visible~ +** Processing line: ~ def render_overlay~ - Inside source: true *** True Line Result - # This sample app allows the player to move around in the dungeon, which becomes more or less visible -** Processing line: ~ # depending on the player's location, and also has enemies.~ + def render_overlay +** Processing line: ~ outputs.primitives << [grid.rect.scale_rect(1.1, 0, 0), 0, 0, 0, 230].solid~ - Inside source: true *** True Line Result - # depending on the player's location, and also has enemies. + outputs.primitives << [grid.rect.scale_rect(1.1, 0, 0), 0, 0, 0, 230].solid +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class Game~ +** Processing line: ~ def render_game~ - Inside source: true *** True Line Result - class Game -** Processing line: ~ attr_accessor :args, :state, :inputs, :outputs, :grid~ + def render_game +** Processing line: ~ render_game_over~ - Inside source: true *** True Line Result - attr_accessor :args, :state, :inputs, :outputs, :grid -** Processing line: ~~ + render_game_over +** Processing line: ~ render_background~ - Inside source: true *** True Line Result - -** Processing line: ~ # Calls all the methods needed for the game to run properly.~ + render_background +** Processing line: ~ render_walls~ - Inside source: true *** True Line Result - # Calls all the methods needed for the game to run properly. -** Processing line: ~ def tick~ + render_walls +** Processing line: ~ render_dragon~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ defaults~ + render_dragon +** Processing line: ~ render_flash~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ render_canvas~ + render_flash +** Processing line: ~ end~ - Inside source: true *** True Line Result - render_canvas -** Processing line: ~ render_dungeon~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - render_dungeon -** Processing line: ~ render_player~ + +** Processing line: ~ def render_game_over~ - Inside source: true *** True Line Result - render_player -** Processing line: ~ render_enemies~ + def render_game_over +** Processing line: ~ return unless state.scene == :game~ - Inside source: true *** True Line Result - render_enemies -** Processing line: ~ print_cell_coordinates~ + return unless state.scene == :game +** Processing line: ~ outputs.labels << [638, 358, score_text, 20, 1]~ - Inside source: true *** True Line Result - print_cell_coordinates -** Processing line: ~ calc_canvas~ + outputs.labels << [638, 358, score_text, 20, 1] +** Processing line: ~ outputs.labels << [635, 360, score_text, 20, 1, 255, 255, 255]~ - Inside source: true *** True Line Result - calc_canvas -** Processing line: ~ input_move~ + outputs.labels << [635, 360, score_text, 20, 1, 255, 255, 255] +** Processing line: ~ outputs.labels << [638, 428, countdown_text, 20, 1]~ - Inside source: true *** True Line Result - input_move -** Processing line: ~ input_click_map~ + outputs.labels << [638, 428, countdown_text, 20, 1] +** Processing line: ~ outputs.labels << [635, 430, countdown_text, 20, 1, 255, 255, 255]~ - Inside source: true *** True Line Result - input_click_map + outputs.labels << [635, 430, countdown_text, 20, 1, 255, 255, 255] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -86579,410 +90348,414 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Sets default values and initializes variables~ -- Inside source: true -*** True Line Result - # Sets default values and initializes variables -** Processing line: ~ def defaults~ +** Processing line: ~ def render_background~ - Inside source: true *** True Line Result - def defaults -** Processing line: ~ outputs.background_color = [0, 0, 0] # black background~ + def render_background +** Processing line: ~ outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']~ - Inside source: true *** True Line Result - outputs.background_color = [0, 0, 0] # black background + outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png'] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Initializes empty canvas, dungeon, and enemies collections.~ +** Processing line: ~ scroll_point_at = state.tick_count~ - Inside source: true *** True Line Result - # Initializes empty canvas, dungeon, and enemies collections. -** Processing line: ~ state.canvas ||= []~ + scroll_point_at = state.tick_count +** Processing line: ~ scroll_point_at = state.scene_at if state.scene == :menu~ - Inside source: true *** True Line Result - state.canvas ||= [] -** Processing line: ~ state.dungeon ||= []~ + scroll_point_at = state.scene_at if state.scene == :menu +** Processing line: ~ scroll_point_at = state.death_at if state.countdown > 0~ - Inside source: true *** True Line Result - state.dungeon ||= [] -** Processing line: ~ state.enemies ||= []~ + scroll_point_at = state.death_at if state.countdown > 0 +** Processing line: ~ scroll_point_at ||= 0~ - Inside source: true *** True Line Result - state.enemies ||= [] + scroll_point_at ||= 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # If state.area doesn't have value, load_area_one and derive_dungeon_from_area methods are called~ +** Processing line: ~ outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_back.png', 0.25)~ - Inside source: true *** True Line Result - # If state.area doesn't have value, load_area_one and derive_dungeon_from_area methods are called -** Processing line: ~ if !state.area~ + outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_back.png', 0.25) +** Processing line: ~ outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_middle.png', 0.50)~ - Inside source: true *** True Line Result - if !state.area -** Processing line: ~ load_area_one~ + outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_middle.png', 0.50) +** Processing line: ~ outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_front.png', 1.00, -80)~ - Inside source: true *** True Line Result - load_area_one -** Processing line: ~ derive_dungeon_from_area~ + outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_front.png', 1.00, -80) +** Processing line: ~ end~ - Inside source: true *** True Line Result - derive_dungeon_from_area + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Changing these values will change the position of player~ +** Processing line: ~ def render_walls~ - Inside source: true *** True Line Result - # Changing these values will change the position of player -** Processing line: ~ state.x = 7~ + def render_walls +** Processing line: ~ state.walls.each do |w|~ - Inside source: true *** True Line Result - state.x = 7 -** Processing line: ~ state.y = 5~ + state.walls.each do |w| +** Processing line: ~ w.sprites = [~ - Inside source: true *** True Line Result - state.y = 5 -** Processing line: ~~ + w.sprites = [ +** Processing line: ~ [w.x, w.bottom_height - 720, 100, 720, 'sprites/wall.png', 180],~ - Inside source: true *** True Line Result - -** Processing line: ~ # Creates new enemies, sets their values, and adds them to the enemies collection.~ + [w.x, w.bottom_height - 720, 100, 720, 'sprites/wall.png', 180], +** Processing line: ~ [w.x, w.top_y, 100, 720, 'sprites/wallbottom.png', 0]~ - Inside source: true *** True Line Result - # Creates new enemies, sets their values, and adds them to the enemies collection. -** Processing line: ~ state.enemies << state.new_entity(:enemy) do |e| # declares each enemy as new entity~ + [w.x, w.top_y, 100, 720, 'sprites/wallbottom.png', 0] +** Processing line: ~ ]~ - Inside source: true *** True Line Result - state.enemies << state.new_entity(:enemy) do |e| # declares each enemy as new entity -** Processing line: ~ e.x = 13 # position~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - e.x = 13 # position -** Processing line: ~ e.y = 5~ + end +** Processing line: ~ outputs.sprites << state.walls.map(&:sprites)~ - Inside source: true *** True Line Result - e.y = 5 -** Processing line: ~ e.previous_hp = 3~ + outputs.sprites << state.walls.map(&:sprites) +** Processing line: ~ end~ - Inside source: true *** True Line Result - e.previous_hp = 3 -** Processing line: ~ e.hp = 3~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - e.hp = 3 -** Processing line: ~ e.max_hp = 3~ + +** Processing line: ~ def render_dragon~ - Inside source: true *** True Line Result - e.max_hp = 3 -** Processing line: ~ e.is_dead = false # the enemy is alive~ + def render_dragon +** Processing line: ~ state.show_death = true if state.countdown == 3.seconds~ - Inside source: true *** True Line Result - e.is_dead = false # the enemy is alive -** Processing line: ~ end~ + state.show_death = true if state.countdown == 3.seconds +** Processing line: ~~ - Inside source: true *** True Line Result - end + +** Processing line: ~ render_debug_hitbox false~ +- Inside source: true +*** True Line Result + render_debug_hitbox false ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ update_line_of_sight # updates line of sight by adding newly visible cells~ +** Processing line: ~ if state.show_death == false || !state.death_at~ - Inside source: true *** True Line Result - update_line_of_sight # updates line of sight by adding newly visible cells -** Processing line: ~ end~ + if state.show_death == false || !state.death_at +** Processing line: ~ animation_index = state.flapped_at.frame_index 6, 2, false if state.flapped_at~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + animation_index = state.flapped_at.frame_index 6, 2, false if state.flapped_at +** Processing line: ~ sprite_name = "sprites/dragon_fly#{animation_index.or(0) + 1}.png"~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + sprite_name = "sprites/dragon_fly#{animation_index.or(0) + 1}.png" +** Processing line: ~ state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]~ - Inside source: true *** True Line Result - -** Processing line: ~ # Adds elements into the state.area collection~ + state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2] +** Processing line: ~ else~ - Inside source: true *** True Line Result - # Adds elements into the state.area collection -** Processing line: ~ # The dungeon is derived using the coordinates of this collection~ + else +** Processing line: ~ sprite_name = "sprites/dragon_die.png"~ - Inside source: true *** True Line Result - # The dungeon is derived using the coordinates of this collection -** Processing line: ~ def load_area_one~ + sprite_name = "sprites/dragon_die.png" +** Processing line: ~ state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]~ - Inside source: true *** True Line Result - def load_area_one -** Processing line: ~ state.area ||= []~ + state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2] +** Processing line: ~ sprite_changed_elapsed = state.death_at.elapsed_time - 1.seconds~ - Inside source: true *** True Line Result - state.area ||= [] -** Processing line: ~ state.area << [8, 6]~ + sprite_changed_elapsed = state.death_at.elapsed_time - 1.seconds +** Processing line: ~ state.dragon_sprite.angle += (sprite_changed_elapsed ** 1.3) * state.death_fall_direction * -1~ - Inside source: true *** True Line Result - state.area << [8, 6] -** Processing line: ~ state.area << [7, 6]~ + state.dragon_sprite.angle += (sprite_changed_elapsed ** 1.3) * state.death_fall_direction * -1 +** Processing line: ~ state.dragon_sprite.x += (sprite_changed_elapsed ** 1.2) * state.death_fall_direction~ - Inside source: true *** True Line Result - state.area << [7, 6] -** Processing line: ~ state.area << [7, 7]~ + state.dragon_sprite.x += (sprite_changed_elapsed ** 1.2) * state.death_fall_direction +** Processing line: ~ state.dragon_sprite.y += (sprite_changed_elapsed * 14 - sprite_changed_elapsed ** 1.6)~ - Inside source: true *** True Line Result - state.area << [7, 7] -** Processing line: ~ state.area << [8, 9]~ + state.dragon_sprite.y += (sprite_changed_elapsed * 14 - sprite_changed_elapsed ** 1.6) +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.area << [8, 9] -** Processing line: ~ state.area << [7, 8]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [7, 8] -** Processing line: ~ state.area << [7, 9]~ + +** Processing line: ~ outputs.sprites << state.dragon_sprite~ - Inside source: true *** True Line Result - state.area << [7, 9] -** Processing line: ~ state.area << [6, 4]~ + outputs.sprites << state.dragon_sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.area << [6, 4] -** Processing line: ~ state.area << [7, 3]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [7, 3] -** Processing line: ~ state.area << [7, 4]~ + +** Processing line: ~ def render_debug_hitbox show~ - Inside source: true *** True Line Result - state.area << [7, 4] -** Processing line: ~ state.area << [6, 5]~ + def render_debug_hitbox show +** Processing line: ~ return unless show~ - Inside source: true *** True Line Result - state.area << [6, 5] -** Processing line: ~ state.area << [7, 5]~ + return unless show +** Processing line: ~ outputs.borders << [dragon_collision_box.rect, 255, 0, 0] if state.dragon_sprite~ - Inside source: true *** True Line Result - state.area << [7, 5] -** Processing line: ~ state.area << [8, 5]~ + outputs.borders << [dragon_collision_box.rect, 255, 0, 0] if state.dragon_sprite +** Processing line: ~ outputs.borders << state.walls.flat_map do |w|~ - Inside source: true *** True Line Result - state.area << [8, 5] -** Processing line: ~ state.area << [8, 4]~ + outputs.borders << state.walls.flat_map do |w| +** Processing line: ~ w.sprites.map { |s| [s.rect, 255, 0, 0] }~ - Inside source: true *** True Line Result - state.area << [8, 4] -** Processing line: ~ state.area << [1, 1]~ + w.sprites.map { |s| [s.rect, 255, 0, 0] } +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.area << [1, 1] -** Processing line: ~ state.area << [0, 1]~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.area << [0, 1] -** Processing line: ~ state.area << [0, 2]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [0, 2] -** Processing line: ~ state.area << [1, 2]~ + +** Processing line: ~ def render_flash~ - Inside source: true *** True Line Result - state.area << [1, 2] -** Processing line: ~ state.area << [2, 2]~ + def render_flash +** Processing line: ~ return unless state.flash_at~ - Inside source: true *** True Line Result - state.area << [2, 2] -** Processing line: ~ state.area << [2, 1]~ + return unless state.flash_at +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [2, 1] -** Processing line: ~ state.area << [2, 3]~ + +** Processing line: ~ outputs.primitives << [grid.rect,~ - Inside source: true *** True Line Result - state.area << [2, 3] -** Processing line: ~ state.area << [1, 3]~ + outputs.primitives << [grid.rect, +** Processing line: ~ white,~ - Inside source: true *** True Line Result - state.area << [1, 3] -** Processing line: ~ state.area << [1, 4]~ + white, +** Processing line: ~ 255 * state.flash_at.ease(20, :flip)].solid~ - Inside source: true *** True Line Result - state.area << [1, 4] -** Processing line: ~ state.area << [2, 4]~ + 255 * state.flash_at.ease(20, :flip)].solid +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [2, 4] -** Processing line: ~ state.area << [2, 5]~ + +** Processing line: ~ state.flash_at = 0 if state.flash_at.elapsed_time > 20~ - Inside source: true *** True Line Result - state.area << [2, 5] -** Processing line: ~ state.area << [1, 5]~ + state.flash_at = 0 if state.flash_at.elapsed_time > 20 +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.area << [1, 5] -** Processing line: ~ state.area << [2, 6]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [2, 6] -** Processing line: ~ state.area << [3, 6]~ + +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - state.area << [3, 6] -** Processing line: ~ state.area << [4, 6]~ + def calc +** Processing line: ~ return unless state.scene == :game~ - Inside source: true *** True Line Result - state.area << [4, 6] -** Processing line: ~ state.area << [4, 7]~ + return unless state.scene == :game +** Processing line: ~ reset_game if state.countdown == 1~ - Inside source: true *** True Line Result - state.area << [4, 7] -** Processing line: ~ state.area << [4, 8]~ + reset_game if state.countdown == 1 +** Processing line: ~ state.countdown -= 1 and return if state.countdown > 0~ - Inside source: true *** True Line Result - state.area << [4, 8] -** Processing line: ~ state.area << [5, 8]~ + state.countdown -= 1 and return if state.countdown > 0 +** Processing line: ~ calc_walls~ - Inside source: true *** True Line Result - state.area << [5, 8] -** Processing line: ~ state.area << [5, 9]~ + calc_walls +** Processing line: ~ calc_flap~ - Inside source: true *** True Line Result - state.area << [5, 9] -** Processing line: ~ state.area << [6, 9]~ + calc_flap +** Processing line: ~ calc_game_over~ - Inside source: true *** True Line Result - state.area << [6, 9] -** Processing line: ~ state.area << [7, 10]~ + calc_game_over +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.area << [7, 10] -** Processing line: ~ state.area << [7, 11]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [7, 11] -** Processing line: ~ state.area << [7, 12]~ + +** Processing line: ~ def calc_walls~ - Inside source: true *** True Line Result - state.area << [7, 12] -** Processing line: ~ state.area << [7, 12]~ + def calc_walls +** Processing line: ~ state.walls.each { |w| w.x -= 8 }~ - Inside source: true *** True Line Result - state.area << [7, 12] -** Processing line: ~ state.area << [7, 13]~ + state.walls.each { |w| w.x -= 8 } +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [7, 13] -** Processing line: ~ state.area << [8, 13]~ + +** Processing line: ~ walls_count_before_removal = state.walls.length~ - Inside source: true *** True Line Result - state.area << [8, 13] -** Processing line: ~ state.area << [9, 13]~ + walls_count_before_removal = state.walls.length +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [9, 13] -** Processing line: ~ state.area << [10, 13]~ + +** Processing line: ~ state.walls.reject! { |w| w.x < -100 }~ - Inside source: true *** True Line Result - state.area << [10, 13] -** Processing line: ~ state.area << [11, 13]~ + state.walls.reject! { |w| w.x < -100 } +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [11, 13] -** Processing line: ~ state.area << [12, 13]~ + +** Processing line: ~ state.score += 1 if state.walls.count < walls_count_before_removal~ - Inside source: true *** True Line Result - state.area << [12, 13] -** Processing line: ~ state.area << [12, 12]~ + state.score += 1 if state.walls.count < walls_count_before_removal +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [12, 12] -** Processing line: ~ state.area << [8, 12]~ + +** Processing line: ~ state.wall_countdown -= 1 and return if state.wall_countdown > 0~ - Inside source: true *** True Line Result - state.area << [8, 12] -** Processing line: ~ state.area << [9, 12]~ + state.wall_countdown -= 1 and return if state.wall_countdown > 0 +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [9, 12] -** Processing line: ~ state.area << [10, 12]~ + +** Processing line: ~ state.walls << state.new_entity(:wall) do |w|~ - Inside source: true *** True Line Result - state.area << [10, 12] -** Processing line: ~ state.area << [11, 12]~ + state.walls << state.new_entity(:wall) do |w| +** Processing line: ~ w.x = grid.right~ - Inside source: true *** True Line Result - state.area << [11, 12] -** Processing line: ~ state.area << [12, 11]~ + w.x = grid.right +** Processing line: ~ w.opening = grid.top~ - Inside source: true *** True Line Result - state.area << [12, 11] -** Processing line: ~ state.area << [13, 11]~ + w.opening = grid.top +** Processing line: ~ .randomize(:ratio)~ - Inside source: true *** True Line Result - state.area << [13, 11] -** Processing line: ~ state.area << [13, 10]~ + .randomize(:ratio) +** Processing line: ~ .greater(200)~ - Inside source: true *** True Line Result - state.area << [13, 10] -** Processing line: ~ state.area << [13, 9]~ + .greater(200) +** Processing line: ~ .lesser(520)~ - Inside source: true *** True Line Result - state.area << [13, 9] -** Processing line: ~ state.area << [13, 8]~ + .lesser(520) +** Processing line: ~ w.bottom_height = w.opening - state.wall_gap_size~ - Inside source: true *** True Line Result - state.area << [13, 8] -** Processing line: ~ state.area << [13, 7]~ + w.bottom_height = w.opening - state.wall_gap_size +** Processing line: ~ w.top_y = w.opening + state.wall_gap_size~ - Inside source: true *** True Line Result - state.area << [13, 7] -** Processing line: ~ state.area << [13, 6]~ + w.top_y = w.opening + state.wall_gap_size +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.area << [13, 6] -** Processing line: ~ state.area << [12, 6]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [12, 6] -** Processing line: ~ state.area << [14, 6]~ + +** Processing line: ~ state.wall_countdown = state.wall_countdown_length~ - Inside source: true *** True Line Result - state.area << [14, 6] -** Processing line: ~ state.area << [14, 5]~ + state.wall_countdown = state.wall_countdown_length +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.area << [14, 5] -** Processing line: ~ state.area << [13, 5]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.area << [13, 5] -** Processing line: ~ state.area << [12, 5]~ + +** Processing line: ~ def calc_flap~ - Inside source: true *** True Line Result - state.area << [12, 5] -** Processing line: ~ state.area << [12, 4]~ + def calc_flap +** Processing line: ~ state.y += state.dy~ - Inside source: true *** True Line Result - state.area << [12, 4] -** Processing line: ~ state.area << [13, 4]~ + state.y += state.dy +** Processing line: ~ state.dy = state.dy.lesser state.flap_power~ - Inside source: true *** True Line Result - state.area << [13, 4] -** Processing line: ~ state.area << [14, 4]~ + state.dy = state.dy.lesser state.flap_power +** Processing line: ~ state.dy -= state.gravity~ - Inside source: true *** True Line Result - state.area << [14, 4] -** Processing line: ~ state.area << [1, 6]~ + state.dy -= state.gravity +** Processing line: ~ return if state.y < state.ceiling~ - Inside source: true *** True Line Result - state.area << [1, 6] -** Processing line: ~ state.area << [6, 6]~ + return if state.y < state.ceiling +** Processing line: ~ state.y = state.ceiling~ - Inside source: true *** True Line Result - state.area << [6, 6] + state.y = state.ceiling +** Processing line: ~ state.dy = state.dy.lesser state.ceiling_flap_power~ +- Inside source: true +*** True Line Result + state.dy = state.dy.lesser state.ceiling_flap_power ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -86991,82 +90764,62 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Starts with an empty dungeon collection, and adds dungeon cells into it.~ -- Inside source: true -*** True Line Result - # Starts with an empty dungeon collection, and adds dungeon cells into it. -** Processing line: ~ def derive_dungeon_from_area~ +** Processing line: ~ def calc_game_over~ - Inside source: true *** True Line Result - def derive_dungeon_from_area -** Processing line: ~ state.dungeon = [] # starts as empty collection~ + def calc_game_over +** Processing line: ~ return unless game_over?~ - Inside source: true *** True Line Result - state.dungeon = [] # starts as empty collection + return unless game_over? ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ state.area.each do |a| # for each element of the area collection~ +** Processing line: ~ state.death_at = state.tick_count~ - Inside source: true *** True Line Result - state.area.each do |a| # for each element of the area collection -** Processing line: ~ state.dungeon << state.new_entity(:dungeon_cell) do |d| # declares each dungeon cell as new entity~ -- Inside source: true -*** True Line Result - state.dungeon << state.new_entity(:dungeon_cell) do |d| # declares each dungeon cell as new entity -** Processing line: ~ d.x = a.x # dungeon cell position using coordinates from area~ -- Inside source: true -*** True Line Result - d.x = a.x # dungeon cell position using coordinates from area -** Processing line: ~ d.y = a.y~ -- Inside source: true -*** True Line Result - d.y = a.y -** Processing line: ~ d.is_visible = false # cell is not visible~ -- Inside source: true -*** True Line Result - d.is_visible = false # cell is not visible -** Processing line: ~ d.alpha = 0 # not transparent at all~ + state.death_at = state.tick_count +** Processing line: ~ state.death_from = state.walls.first~ - Inside source: true *** True Line Result - d.alpha = 0 # not transparent at all -** Processing line: ~ d.border = [left_margin + a.x * grid_size,~ + state.death_from = state.walls.first +** Processing line: ~ state.death_fall_direction = -1~ - Inside source: true *** True Line Result - d.border = [left_margin + a.x * grid_size, -** Processing line: ~ bottom_margin + a.y * grid_size,~ + state.death_fall_direction = -1 +** Processing line: ~ state.death_fall_direction = 1 if state.x > state.death_from.x~ - Inside source: true *** True Line Result - bottom_margin + a.y * grid_size, -** Processing line: ~ grid_size,~ + state.death_fall_direction = 1 if state.x > state.death_from.x +** Processing line: ~ outputs.sounds << "sounds/hit-sound.wav"~ - Inside source: true *** True Line Result - grid_size, -** Processing line: ~ grid_size,~ + outputs.sounds << "sounds/hit-sound.wav" +** Processing line: ~ begin_countdown~ - Inside source: true *** True Line Result - grid_size, -** Processing line: ~ *blue,~ + begin_countdown +** Processing line: ~ end~ - Inside source: true *** True Line Result - *blue, -** Processing line: ~ 255] # sets border definition for dungeon cell~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 255] # sets border definition for dungeon cell -** Processing line: ~ d # returns dungeon cell~ + +** Processing line: ~ def process_inputs~ - Inside source: true *** True Line Result - d # returns dungeon cell -** Processing line: ~ end~ + def process_inputs +** Processing line: ~ process_inputs_menu~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + process_inputs_menu +** Processing line: ~ process_inputs_game~ - Inside source: true *** True Line Result - end + process_inputs_game ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87075,166 +90828,150 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def left_margin~ -- Inside source: true -*** True Line Result - def left_margin -** Processing line: ~ 40 # sets left margin~ +** Processing line: ~ def process_inputs_menu~ - Inside source: true *** True Line Result - 40 # sets left margin -** Processing line: ~ end~ + def process_inputs_menu +** Processing line: ~ return unless state.scene == :menu~ - Inside source: true *** True Line Result - end + return unless state.scene == :menu ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def bottom_margin~ +** Processing line: ~ changediff = inputs.keyboard.key_down.tab || inputs.controller_one.key_down.select~ - Inside source: true *** True Line Result - def bottom_margin -** Processing line: ~ 60 # sets bottom margin~ + changediff = inputs.keyboard.key_down.tab || inputs.controller_one.key_down.select +** Processing line: ~ if inputs.mouse.click~ - Inside source: true *** True Line Result - 60 # sets bottom margin -** Processing line: ~ end~ + if inputs.mouse.click +** Processing line: ~ p = inputs.mouse.click.point~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + p = inputs.mouse.click.point +** Processing line: ~ if (p.y >= 165) && (p.y < 200) && (p.x >= 500) && (p.x < 800)~ - Inside source: true *** True Line Result - -** Processing line: ~ def grid_size~ + if (p.y >= 165) && (p.y < 200) && (p.x >= 500) && (p.x < 800) +** Processing line: ~ changediff = true~ - Inside source: true *** True Line Result - def grid_size -** Processing line: ~ 40 # sets size of grid square~ + changediff = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - 40 # sets size of grid square -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Updates the line of sight by calling the thick_line_of_sight method and~ -- Inside source: true -*** True Line Result - # Updates the line of sight by calling the thick_line_of_sight method and -** Processing line: ~ # adding dungeon cells to the newly_visible collection~ +** Processing line: ~ if changediff~ - Inside source: true *** True Line Result - # adding dungeon cells to the newly_visible collection -** Processing line: ~ def update_line_of_sight~ + if changediff +** Processing line: ~ case state.new_difficulty~ - Inside source: true *** True Line Result - def update_line_of_sight -** Processing line: ~ variations = [-1, 0, 1]~ + case state.new_difficulty +** Processing line: ~ when :easy~ - Inside source: true *** True Line Result - variations = [-1, 0, 1] -** Processing line: ~ # creates collection of newly visible dungeon cells~ + when :easy +** Processing line: ~ state.new_difficulty = :normal~ - Inside source: true *** True Line Result - # creates collection of newly visible dungeon cells -** Processing line: ~ newly_visible = variations.product(variations).flat_map do |rise, run| # combo of all elements~ + state.new_difficulty = :normal +** Processing line: ~ when :normal~ - Inside source: true *** True Line Result - newly_visible = variations.product(variations).flat_map do |rise, run| # combo of all elements -** Processing line: ~ thick_line_of_sight state.x, state.y, rise, run, 15, # calls thick_line_of_sight method~ + when :normal +** Processing line: ~ state.new_difficulty = :hard~ - Inside source: true *** True Line Result - thick_line_of_sight state.x, state.y, rise, run, 15, # calls thick_line_of_sight method -** Processing line: ~ lambda { |x, y| dungeon_cell_exists? x, y } # checks whether or not cell exists~ + state.new_difficulty = :hard +** Processing line: ~ when :hard~ - Inside source: true *** True Line Result - lambda { |x, y| dungeon_cell_exists? x, y } # checks whether or not cell exists -** Processing line: ~ end.uniq# removes duplicates~ + when :hard +** Processing line: ~ state.new_difficulty = :flappy~ - Inside source: true *** True Line Result - end.uniq# removes duplicates -** Processing line: ~~ + state.new_difficulty = :flappy +** Processing line: ~ when :flappy~ - Inside source: true *** True Line Result - -** Processing line: ~ state.dungeon.each do |d| # perform action on each element of dungeons collection~ + when :flappy +** Processing line: ~ state.new_difficulty = :easy~ - Inside source: true *** True Line Result - state.dungeon.each do |d| # perform action on each element of dungeons collection -** Processing line: ~ d.is_visible = newly_visible.find { |v| v.x == d.x && v.y == d.y } # finds match inside newly_visible collection~ + state.new_difficulty = :easy +** Processing line: ~ end~ - Inside source: true *** True Line Result - d.is_visible = newly_visible.find { |v| v.x == d.x && v.y == d.y } # finds match inside newly_visible collection + 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: ~ #Returns a boolean value~ -- Inside source: true -*** True Line Result - #Returns a boolean value -** Processing line: ~ def dungeon_cell_exists? x, y~ +** Processing line: ~ if inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start || inputs.controller_one.key_down.a~ - Inside source: true *** True Line Result - def dungeon_cell_exists? x, y -** Processing line: ~ # Finds cell coordinates inside dungeon collection to determine if dungeon cell exists~ + if inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start || inputs.controller_one.key_down.a +** Processing line: ~ state.difficulty = state.new_difficulty~ - Inside source: true *** True Line Result - # Finds cell coordinates inside dungeon collection to determine if dungeon cell exists -** Processing line: ~ state.dungeon.find { |d| d.x == x && d.y == y }~ + state.difficulty = state.new_difficulty +** Processing line: ~ change_to_scene :game~ - Inside source: true *** True Line Result - state.dungeon.find { |d| d.x == x && d.y == y } -** Processing line: ~ end~ + change_to_scene :game +** Processing line: ~ reset_game false~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + reset_game false +** Processing line: ~ state.hi_score = 0~ - Inside source: true *** True Line Result - -** Processing line: ~ # Calls line_of_sight method to add elements to result collection~ + state.hi_score = 0 +** Processing line: ~ begin_countdown~ - Inside source: true *** True Line Result - # Calls line_of_sight method to add elements to result collection -** Processing line: ~ def thick_line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda~ + begin_countdown +** Processing line: ~ end~ - Inside source: true *** True Line Result - def thick_line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda -** Processing line: ~ result = []~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - result = [] -** Processing line: ~ result += line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda~ + +** Processing line: ~ if inputs.keyboard.key_down.escape || (inputs.mouse.click && !changediff) || inputs.controller_one.key_down.b~ - Inside source: true *** True Line Result - result += line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda -** Processing line: ~ result += line_of_sight start_x - 1, start_y, rise, run, distance, cell_exists_lambda # one left~ + if inputs.keyboard.key_down.escape || (inputs.mouse.click && !changediff) || inputs.controller_one.key_down.b +** Processing line: ~ state.new_difficulty = state.difficulty~ - Inside source: true *** True Line Result - result += line_of_sight start_x - 1, start_y, rise, run, distance, cell_exists_lambda # one left -** Processing line: ~ result += line_of_sight start_x + 1, start_y, rise, run, distance, cell_exists_lambda # one right~ + state.new_difficulty = state.difficulty +** Processing line: ~ change_to_scene :game~ - Inside source: true *** True Line Result - result += line_of_sight start_x + 1, start_y, rise, run, distance, cell_exists_lambda # one right -** Processing line: ~ result~ + change_to_scene :game +** Processing line: ~ end~ - Inside source: true *** True Line Result - result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87243,46 +90980,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Adds points to the result collection to create the player's line of sight~ -- Inside source: true -*** True Line Result - # Adds points to the result collection to create the player's line of sight -** Processing line: ~ def line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda~ -- Inside source: true -*** True Line Result - def line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda -** Processing line: ~ result = [] # starts as empty collection~ -- Inside source: true -*** True Line Result - result = [] # starts as empty collection -** Processing line: ~ points = points_on_line start_x, start_y, rise, run, distance # calls points_on_line method~ +** Processing line: ~ def process_inputs_game~ - Inside source: true *** True Line Result - points = points_on_line start_x, start_y, rise, run, distance # calls points_on_line method -** Processing line: ~ points.each do |p| # for each point in collection~ + def process_inputs_game +** Processing line: ~ return unless state.scene == :game~ - Inside source: true *** True Line Result - points.each do |p| # for each point in collection -** Processing line: ~ if cell_exists_lambda.call(p.x, p.y) # if the cell exists~ + return unless state.scene == :game +** Processing line: ~~ - Inside source: true *** True Line Result - if cell_exists_lambda.call(p.x, p.y) # if the cell exists -** Processing line: ~ result << p # add it to result collection~ + +** Processing line: ~ clicked_menu = false~ - Inside source: true *** True Line Result - result << p # add it to result collection -** Processing line: ~ else # if cell does not exist~ + clicked_menu = false +** Processing line: ~ if inputs.mouse.click~ - Inside source: true *** True Line Result - else # if cell does not exist -** Processing line: ~ return result # return result collection as it is~ + if inputs.mouse.click +** Processing line: ~ p = inputs.mouse.click.point~ - Inside source: true *** True Line Result - return result # return result collection as it is -** Processing line: ~ end~ + p = inputs.mouse.click.point +** Processing line: ~ clicked_menu = (p.y >= 620) && (p.x < 275)~ - Inside source: true *** True Line Result - end + clicked_menu = (p.y >= 620) && (p.x < 275) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87291,34 +91016,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ result # return result collection~ +** Processing line: ~ if clicked_menu || inputs.keyboard.key_down.escape || inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start~ - Inside source: true *** True Line Result - result # return result collection -** Processing line: ~ end~ + if clicked_menu || inputs.keyboard.key_down.escape || inputs.keyboard.key_down.enter || inputs.controller_one.key_down.start +** Processing line: ~ change_to_scene :menu~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + change_to_scene :menu +** Processing line: ~ elsif (inputs.mouse.down || inputs.mouse.click || inputs.keyboard.key_down.space || inputs.controller_one.key_down.a) && state.countdown == 0~ - Inside source: true *** True Line Result - -** Processing line: ~ # Finds the coordinates of the points on the line by performing calculations~ + elsif (inputs.mouse.down || inputs.mouse.click || inputs.keyboard.key_down.space || inputs.controller_one.key_down.a) && state.countdown == 0 +** Processing line: ~ state.dy = 0~ - Inside source: true *** True Line Result - # Finds the coordinates of the points on the line by performing calculations -** Processing line: ~ def points_on_line start_x, start_y, rise, run, distance~ + state.dy = 0 +** Processing line: ~ state.dy += state.flap_power~ - Inside source: true *** True Line Result - def points_on_line start_x, start_y, rise, run, distance -** Processing line: ~ distance.times.map do |i| # perform an action~ + state.dy += state.flap_power +** Processing line: ~ state.flapped_at = state.tick_count~ - Inside source: true *** True Line Result - distance.times.map do |i| # perform an action -** Processing line: ~ [start_x + run * i, start_y + rise * i] # definition of point~ + state.flapped_at = state.tick_count +** Processing line: ~ outputs.sounds << "sounds/fly-sound.wav"~ - Inside source: true *** True Line Result - [start_x + run * i, start_y + rise * i] # definition of point + outputs.sounds << "sounds/fly-sound.wav" ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87331,26 +91056,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 render_canvas~ +** Processing line: ~ def scrolling_background at, path, rate, y = 0~ - Inside source: true *** True Line Result - def render_canvas -** Processing line: ~ return~ + def scrolling_background at, path, rate, y = 0 +** Processing line: ~ [~ - Inside source: true *** True Line Result - return -** Processing line: ~ outputs.borders << state.canvas.map do |c| # on each element of canvas collection~ + [ +** Processing line: ~ [ 0 - at.*(rate) % 1440, y, 1440, 720, path],~ - Inside source: true *** True Line Result - outputs.borders << state.canvas.map do |c| # on each element of canvas collection -** Processing line: ~ c.border # outputs border~ + [ 0 - at.*(rate) % 1440, y, 1440, 720, path], +** Processing line: ~ [1440 - at.*(rate) % 1440, y, 1440, 720, path]~ - Inside source: true *** True Line Result - c.border # outputs border -** Processing line: ~ end~ + [1440 - at.*(rate) % 1440, y, 1440, 720, path] +** Processing line: ~ ]~ - Inside source: true *** True Line Result - end + ] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87359,62 +91084,74 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Outputs the dungeon cells.~ +** Processing line: ~ def white~ - Inside source: true *** True Line Result - # Outputs the dungeon cells. -** Processing line: ~ def render_dungeon~ + def white +** Processing line: ~ [255, 255, 255]~ - Inside source: true *** True Line Result - def render_dungeon -** Processing line: ~ outputs.solids << [0, 0, grid.w, grid.h] # outputs black background for grid~ + [255, 255, 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.solids << [0, 0, grid.w, grid.h] # outputs black background for grid + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets the alpha value (opacity) for each dungeon cell and calls the cell_border method.~ +** Processing line: ~ def large_white_typeset~ - Inside source: true *** True Line Result - # Sets the alpha value (opacity) for each dungeon cell and calls the cell_border method. -** Processing line: ~ outputs.borders << state.dungeon.map do |d| # for each element in dungeon collection~ + def large_white_typeset +** Processing line: ~ [5, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - outputs.borders << state.dungeon.map do |d| # for each element in dungeon collection -** Processing line: ~ d.alpha += if d.is_visible # if cell is visible~ + [5, 0, 255, 255, 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - d.alpha += if d.is_visible # if cell is visible -** Processing line: ~ 255.fdiv(30) # increment opacity (transparency)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 255.fdiv(30) # increment opacity (transparency) -** Processing line: ~ else # if cell is not visible~ + +** Processing line: ~ def at_beginning?~ - Inside source: true *** True Line Result - else # if cell is not visible -** Processing line: ~ 255.fdiv(600) * -1 # decrease opacity~ + def at_beginning? +** Processing line: ~ state.walls.count == 0~ - Inside source: true *** True Line Result - 255.fdiv(600) * -1 # decrease opacity -** Processing line: ~ end~ + state.walls.count == 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ d.alpha = d.alpha.cap_min_max(0, 255)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - d.alpha = d.alpha.cap_min_max(0, 255) -** Processing line: ~ cell_border d.x, d.y, [*blue, d.alpha] # sets blue border using alpha value~ + +** Processing line: ~ def dragon_collision_box~ - Inside source: true *** True Line Result - cell_border d.x, d.y, [*blue, d.alpha] # sets blue border using alpha value -** Processing line: ~ end.reject_nil~ + def dragon_collision_box +** Processing line: ~ state.dragon_sprite~ - Inside source: true *** True Line Result - end.reject_nil + state.dragon_sprite +** Processing line: ~ .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)~ +- Inside source: true +*** True Line Result + .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5) +** Processing line: ~ .rect_shift_right(10)~ +- Inside source: true +*** True Line Result + .rect_shift_right(10) +** Processing line: ~ .rect_shift_up(state.dy * 2)~ +- Inside source: true +*** True Line Result + .rect_shift_up(state.dy * 2) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87423,34 +91160,38 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Sets definition of a cell border using the parameters~ +** Processing line: ~ def game_over?~ - Inside source: true *** True Line Result - # Sets definition of a cell border using the parameters -** Processing line: ~ def cell_border x, y, color = nil~ + def game_over? +** Processing line: ~ return true if state.y <= 0.-(500 * collision_forgiveness) && !at_beginning?~ - Inside source: true *** True Line Result - def cell_border x, y, color = nil -** Processing line: ~ [left_margin + x * grid_size,~ + return true if state.y <= 0.-(500 * collision_forgiveness) && !at_beginning? +** Processing line: ~~ - Inside source: true *** True Line Result - [left_margin + x * grid_size, -** Processing line: ~ bottom_margin + y * grid_size,~ + +** Processing line: ~ state.walls~ - Inside source: true *** True Line Result - bottom_margin + y * grid_size, -** Processing line: ~ grid_size,~ + state.walls +** Processing line: ~ .flat_map { |w| w.sprites }~ - Inside source: true *** True Line Result - grid_size, -** Processing line: ~ grid_size,~ + .flat_map { |w| w.sprites } +** Processing line: ~ .any? do |s|~ - Inside source: true *** True Line Result - grid_size, -** Processing line: ~ *color]~ + .any? do |s| +** Processing line: ~ s.intersect_rect?(dragon_collision_box)~ - Inside source: true *** True Line Result - *color] + s.intersect_rect?(dragon_collision_box) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87459,62 +91200,58 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Sets the values for the player and outputs it as a label~ -- Inside source: true -*** True Line Result - # Sets the values for the player and outputs it as a label -** Processing line: ~ def render_player~ +** Processing line: ~ def collision_forgiveness~ - Inside source: true *** True Line Result - def render_player -** Processing line: ~ outputs.labels << [grid_x(state.x) + 20, # positions "@" text in center of grid square~ + def collision_forgiveness +** Processing line: ~ case state.difficulty~ - Inside source: true *** True Line Result - outputs.labels << [grid_x(state.x) + 20, # positions "@" text in center of grid square -** Processing line: ~ grid_y(state.y) + 35,~ + case state.difficulty +** Processing line: ~ when :easy~ - Inside source: true *** True Line Result - grid_y(state.y) + 35, -** Processing line: ~ "@", # player is represented by a white "@" character~ + when :easy +** Processing line: ~ 0.9~ - Inside source: true *** True Line Result - "@", # player is represented by a white "@" character -** Processing line: ~ 1, 1, *white]~ + 0.9 +** Processing line: ~ when :normal~ - Inside source: true *** True Line Result - 1, 1, *white] -** Processing line: ~ end~ + when :normal +** Processing line: ~ 0.7~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 0.7 +** Processing line: ~ when :hard~ - Inside source: true *** True Line Result - -** Processing line: ~ def grid_x x~ + when :hard +** Processing line: ~ 0.5~ - Inside source: true *** True Line Result - def grid_x x -** Processing line: ~ left_margin + x * grid_size # positions horizontally on grid~ + 0.5 +** Processing line: ~ when :flappy~ - Inside source: true *** True Line Result - left_margin + x * grid_size # positions horizontally on grid -** Processing line: ~ end~ + when :flappy +** Processing line: ~ 0.3~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 0.3 +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ def grid_y y~ + else +** Processing line: ~ 0.9~ - Inside source: true *** True Line Result - def grid_y y -** Processing line: ~ bottom_margin + y * grid_size # positions vertically on grid~ + 0.9 +** Processing line: ~ end~ - Inside source: true *** True Line Result - bottom_margin + y * grid_size # positions vertically on grid + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87523,66 +91260,78 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Outputs enemies onto the screen.~ +** Processing line: ~ def countdown_text~ - Inside source: true *** True Line Result - # Outputs enemies onto the screen. -** Processing line: ~ def render_enemies~ + def countdown_text +** Processing line: ~ state.countdown ||= -1~ - Inside source: true *** True Line Result - def render_enemies -** Processing line: ~ state.enemies.map do |e| # for each enemy in the collection~ + state.countdown ||= -1 +** Processing line: ~ return "" if state.countdown == 0~ - Inside source: true *** True Line Result - state.enemies.map do |e| # for each enemy in the collection -** Processing line: ~ alpha = 255 # set opacity (full transparency)~ + return "" if state.countdown == 0 +** Processing line: ~ return "GO!" if state.countdown.idiv(60) == 0~ - Inside source: true *** True Line Result - alpha = 255 # set opacity (full transparency) -** Processing line: ~~ + return "GO!" if state.countdown.idiv(60) == 0 +** Processing line: ~ return "GAME OVER" if state.death_at~ - Inside source: true *** True Line Result - -** Processing line: ~ # Outputs an enemy using a label.~ + return "GAME OVER" if state.death_at +** Processing line: ~ return "READY?"~ - Inside source: true *** True Line Result - # Outputs an enemy using a label. -** Processing line: ~ outputs.labels << [~ + return "READY?" +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.labels << [ -** Processing line: ~ left_margin + 20 + e.x * grid_size, # positions enemy's "r" text in center of grid square~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - left_margin + 20 + e.x * grid_size, # positions enemy's "r" text in center of grid square -** Processing line: ~ bottom_margin + 35 + e.y * grid_size,~ + +** Processing line: ~ def begin_countdown~ - Inside source: true *** True Line Result - bottom_margin + 35 + e.y * grid_size, -** Processing line: ~ "r", # enemy's text~ + def begin_countdown +** Processing line: ~ state.countdown = 4.seconds~ - Inside source: true *** True Line Result - "r", # enemy's text -** Processing line: ~ 1, 1, *white, alpha]~ + state.countdown = 4.seconds +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1, 1, *white, alpha] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Creates a red border around an enemy.~ +** Processing line: ~ def score_text~ - Inside source: true *** True Line Result - # Creates a red border around an enemy. -** Processing line: ~ outputs.borders << [grid_x(e.x), grid_y(e.y), grid_size, grid_size, *red]~ + def score_text +** Processing line: ~ return "" unless state.countdown > 1.seconds~ - Inside source: true *** True Line Result - outputs.borders << [grid_x(e.x), grid_y(e.y), grid_size, grid_size, *red] -** Processing line: ~ end~ + return "" unless state.countdown > 1.seconds +** Processing line: ~ return "" unless state.death_at~ - Inside source: true *** True Line Result - end + return "" unless state.death_at +** Processing line: ~ return "SCORE: 0 (LOL)" if state.score == 0~ +- Inside source: true +*** True Line Result + return "SCORE: 0 (LOL)" if state.score == 0 +** Processing line: ~ return "HI SCORE: #{state.score}" if state.score == state.hi_score~ +- Inside source: true +*** True Line Result + return "HI SCORE: #{state.score}" if state.score == state.hi_score +** Processing line: ~ return "SCORE: #{state.score}"~ +- Inside source: true +*** True Line Result + return "SCORE: #{state.score}" ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87591,42 +91340,46 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ #White labels are output for the cell coordinates of each element in the dungeon collection.~ +** Processing line: ~ def reset_game set_flash = true~ - Inside source: true *** True Line Result - #White labels are output for the cell coordinates of each element in the dungeon collection. -** Processing line: ~ def print_cell_coordinates~ + def reset_game set_flash = true +** Processing line: ~ state.flash_at = state.tick_count if set_flash~ - Inside source: true *** True Line Result - def print_cell_coordinates -** Processing line: ~ return unless state.debug~ + state.flash_at = state.tick_count if set_flash +** Processing line: ~ state.walls = []~ - Inside source: true *** True Line Result - return unless state.debug -** Processing line: ~ state.dungeon.each do |d|~ + state.walls = [] +** Processing line: ~ state.y = 500~ - Inside source: true *** True Line Result - state.dungeon.each do |d| -** Processing line: ~ outputs.labels << [grid_x(d.x) + 2,~ + state.y = 500 +** Processing line: ~ state.dy = 0~ - Inside source: true *** True Line Result - outputs.labels << [grid_x(d.x) + 2, -** Processing line: ~ grid_y(d.y) - 2,~ + state.dy = 0 +** Processing line: ~ state.hi_score = state.hi_score.greater(state.score)~ - Inside source: true *** True Line Result - grid_y(d.y) - 2, -** Processing line: ~ "#{d.x},#{d.y}",~ + state.hi_score = state.hi_score.greater(state.score) +** Processing line: ~ state.score = 0~ - Inside source: true *** True Line Result - "#{d.x},#{d.y}", -** Processing line: ~ -2, 0, *white]~ + state.score = 0 +** Processing line: ~ state.wall_countdown = state.wall_countdown_length.fdiv(2)~ - Inside source: true *** True Line Result - -2, 0, *white] -** Processing line: ~ end~ + state.wall_countdown = state.wall_countdown_length.fdiv(2) +** Processing line: ~ state.show_death = false~ - Inside source: true *** True Line Result - end + state.show_death = false +** Processing line: ~ state.death_at = nil~ +- Inside source: true +*** True Line Result + state.death_at = nil ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87635,234 +91388,242 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Adds new elements into the canvas collection and sets their values.~ +** Processing line: ~ def change_to_scene scene~ - Inside source: true *** True Line Result - # Adds new elements into the canvas collection and sets their values. -** Processing line: ~ def calc_canvas~ + def change_to_scene scene +** Processing line: ~ state.scene = scene~ - Inside source: true *** True Line Result - def calc_canvas -** Processing line: ~ return if state.canvas.length > 0 # return if canvas collection has at least one element~ + state.scene = scene +** Processing line: ~ state.scene_at = state.tick_count~ - Inside source: true *** True Line Result - return if state.canvas.length > 0 # return if canvas collection has at least one element -** Processing line: ~ 15.times do |x| # 15 times perform an action~ + state.scene_at = state.tick_count +** Processing line: ~ inputs.keyboard.clear~ - Inside source: true *** True Line Result - 15.times do |x| # 15 times perform an action -** Processing line: ~ 15.times do |y|~ + inputs.keyboard.clear +** Processing line: ~ inputs.controller_one.clear~ - Inside source: true *** True Line Result - 15.times do |y| -** Processing line: ~ state.canvas << state.new_entity(:canvas) do |c| # declare canvas element as new entity~ + inputs.controller_one.clear +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.canvas << state.new_entity(:canvas) do |c| # declare canvas element as new entity -** Processing line: ~ c.x = x # set position~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - c.x = x # set position -** Processing line: ~ c.y = y~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - c.y = y -** Processing line: ~ c.border = [left_margin + x * grid_size,~ + +** Processing line: ~ $flappy_dragon = FlappyDragon.new~ - Inside source: true *** True Line Result - c.border = [left_margin + x * grid_size, -** Processing line: ~ bottom_margin + y * grid_size,~ + $flappy_dragon = FlappyDragon.new +** Processing line: ~~ - Inside source: true *** True Line Result - bottom_margin + y * grid_size, -** Processing line: ~ grid_size,~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - grid_size, -** Processing line: ~ grid_size,~ + def tick args +** Processing line: ~ $flappy_dragon.grid = args.grid~ - Inside source: true *** True Line Result - grid_size, -** Processing line: ~ *white, 30] # sets border definition~ + $flappy_dragon.grid = args.grid +** Processing line: ~ $flappy_dragon.inputs = args.inputs~ - Inside source: true *** True Line Result - *white, 30] # sets border definition -** Processing line: ~ end~ + $flappy_dragon.inputs = args.inputs +** Processing line: ~ $flappy_dragon.state = args.state~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + $flappy_dragon.state = args.state +** Processing line: ~ $flappy_dragon.outputs = args.outputs~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + $flappy_dragon.outputs = args.outputs +** Processing line: ~ $flappy_dragon.tick~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + $flappy_dragon.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Updates x and y values of the player, and updates player's line of sight~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - # Updates x and y values of the player, and updates player's line of sight -** Processing line: ~ def input_move~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - def input_move -** Processing line: ~ x, y, x_diff, y_diff = input_target_cell~ -- Inside source: true + +** Processing line: ~*** Arcade - Pong - main.rb~ +- Header detected. *** True Line Result - x, y, x_diff, y_diff = input_target_cell -** Processing line: ~~ -- Inside source: true + +*** True Line Result +*** Arcade - Pong - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ return unless dungeon_cell_exists? x, y # player can't move there if a dungeon cell doesn't exist in that location~ +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_arcade/pong/app/main.rb~ - Inside source: true *** True Line Result - return unless dungeon_cell_exists? x, y # player can't move there if a dungeon cell doesn't exist in that location -** Processing line: ~ return if enemy_at x, y # player can't move there if there is an enemy in that location~ + # ./samples/99_genre_arcade/pong/app/main.rb +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - return if enemy_at x, y # player can't move there if there is an enemy in that location -** Processing line: ~~ + def tick args +** Processing line: ~ defaults args~ - Inside source: true *** True Line Result - -** Processing line: ~ state.x += x_diff # increments x by x_diff (so player moves left or right)~ + defaults args +** Processing line: ~ render args~ - Inside source: true *** True Line Result - state.x += x_diff # increments x by x_diff (so player moves left or right) -** Processing line: ~ state.y += y_diff # same with y and y_diff ( so player moves up or down)~ + render args +** Processing line: ~ calc args~ - Inside source: true *** True Line Result - state.y += y_diff # same with y and y_diff ( so player moves up or down) -** Processing line: ~ update_line_of_sight # updates visible cells~ + calc args +** Processing line: ~ input args~ - Inside source: true *** True Line Result - update_line_of_sight # updates visible cells -** Processing line: ~ end~ + input args +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def enemy_at x, y~ +** Processing line: ~ def defaults args~ - Inside source: true *** True Line Result - def enemy_at x, y -** Processing line: ~ # Finds if coordinates exist in enemies collection and enemy is not dead~ + def defaults args +** Processing line: ~ args.state.ball.debounce ||= 3 * 60~ - Inside source: true *** True Line Result - # Finds if coordinates exist in enemies collection and enemy is not dead -** Processing line: ~ state.enemies.find { |e| e.x == x && e.y == y && !e.is_dead }~ + args.state.ball.debounce ||= 3 * 60 +** Processing line: ~ args.state.ball.size ||= 10~ - Inside source: true *** True Line Result - state.enemies.find { |e| e.x == x && e.y == y && !e.is_dead } -** Processing line: ~ end~ + args.state.ball.size ||= 10 +** Processing line: ~ args.state.ball.size_half ||= args.state.ball.size / 2~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.ball.size_half ||= args.state.ball.size / 2 +** Processing line: ~ args.state.ball.x ||= 640~ - Inside source: true *** True Line Result - -** Processing line: ~ #M oves the user based on their keyboard input and sets values for target cell~ + args.state.ball.x ||= 640 +** Processing line: ~ args.state.ball.y ||= 360~ - Inside source: true *** True Line Result - #M oves the user based on their keyboard input and sets values for target cell -** Processing line: ~ def input_target_cell~ + args.state.ball.y ||= 360 +** Processing line: ~ args.state.ball.dx ||= 5.randomize(:sign)~ - Inside source: true *** True Line Result - def input_target_cell -** Processing line: ~ if inputs.keyboard.key_down.up # if "up" key is in "down" state~ + args.state.ball.dx ||= 5.randomize(:sign) +** Processing line: ~ args.state.ball.dy ||= 5.randomize(:sign)~ - Inside source: true *** True Line Result - if inputs.keyboard.key_down.up # if "up" key is in "down" state -** Processing line: ~ [state.x, state.y + 1, 0, 1] # user moves up~ + args.state.ball.dy ||= 5.randomize(:sign) +** Processing line: ~ args.state.left_paddle.y ||= 360~ - Inside source: true *** True Line Result - [state.x, state.y + 1, 0, 1] # user moves up -** Processing line: ~ elsif inputs.keyboard.key_down.down # if "down" key is pressed~ + args.state.left_paddle.y ||= 360 +** Processing line: ~ args.state.right_paddle.y ||= 360~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_down.down # if "down" key is pressed -** Processing line: ~ [state.x, state.y - 1, 0, -1] # user moves down~ + args.state.right_paddle.y ||= 360 +** Processing line: ~ args.state.paddle.h ||= 120~ - Inside source: true *** True Line Result - [state.x, state.y - 1, 0, -1] # user moves down -** Processing line: ~ elsif inputs.keyboard.key_down.left # if "left" key is pressed~ + args.state.paddle.h ||= 120 +** Processing line: ~ args.state.paddle.w ||= 10~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_down.left # if "left" key is pressed -** Processing line: ~ [state.x - 1, state.y, -1, 0] # user moves left~ + args.state.paddle.w ||= 10 +** Processing line: ~ args.state.left_paddle.score ||= 0~ - Inside source: true *** True Line Result - [state.x - 1, state.y, -1, 0] # user moves left -** Processing line: ~ elsif inputs.keyboard.key_down.right # if "right" key is pressed~ + args.state.left_paddle.score ||= 0 +** Processing line: ~ args.state.right_paddle.score ||= 0~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_down.right # if "right" key is pressed -** Processing line: ~ [state.x + 1, state.y, 1, 0] # user moves right~ + args.state.right_paddle.score ||= 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - [state.x + 1, state.y, 1, 0] # user moves right -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ nil # otherwise, empty~ + +** Processing line: ~ def render args~ - Inside source: true *** True Line Result - nil # otherwise, empty -** Processing line: ~ end~ + def render args +** Processing line: ~ render_center_line args~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + render_center_line args +** Processing line: ~ render_scores args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + render_scores args +** Processing line: ~ render_countdown args~ - Inside source: true *** True Line Result - -** Processing line: ~ # Goes through the canvas collection to find if the mouse was clicked inside of the borders of an element.~ + render_countdown args +** Processing line: ~ render_ball args~ - Inside source: true *** True Line Result - # Goes through the canvas collection to find if the mouse was clicked inside of the borders of an element. -** Processing line: ~ def input_click_map~ + render_ball args +** Processing line: ~ render_paddles args~ - Inside source: true *** True Line Result - def input_click_map -** Processing line: ~ return unless inputs.mouse.click # return unless the mouse is clicked~ + render_paddles args +** Processing line: ~ render_instructions args~ - Inside source: true *** True Line Result - return unless inputs.mouse.click # return unless the mouse is clicked -** Processing line: ~ canvas_entry = state.canvas.find do |c| # find element from canvas collection that meets requirements~ + render_instructions args +** Processing line: ~ end~ - Inside source: true *** True Line Result - canvas_entry = state.canvas.find do |c| # find element from canvas collection that meets requirements -** Processing line: ~ inputs.mouse.click.inside_rect? c.border # find border that mouse was clicked inside of~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - inputs.mouse.click.inside_rect? c.border # find border that mouse was clicked inside of -** Processing line: ~ end~ + +** Processing line: ~ begin :render_methods~ - Inside source: true *** True Line Result - end -** Processing line: ~ puts canvas_entry # prints canvas_entry value~ + begin :render_methods +** Processing line: ~ def render_center_line args~ - Inside source: true *** True Line Result - puts canvas_entry # prints canvas_entry value + def render_center_line args +** Processing line: ~ args.outputs.lines << [640, 0, 640, 720]~ +- Inside source: true +*** True Line Result + args.outputs.lines << [640, 0, 640, 720] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87871,22 +91632,26 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Sets the definition of a label using the parameters.~ +** Processing line: ~ def render_scores args~ - Inside source: true *** True Line Result - # Sets the definition of a label using the parameters. -** Processing line: ~ def label text, x, y, color = nil~ + def render_scores args +** Processing line: ~ args.outputs.labels << [~ - Inside source: true *** True Line Result - def label text, x, y, color = nil -** Processing line: ~ color ||= white # color is initialized to white~ + args.outputs.labels << [ +** Processing line: ~ [320, 650, args.state.left_paddle.score, 10, 1],~ - Inside source: true *** True Line Result - color ||= white # color is initialized to white -** Processing line: ~ [x, y, text, 1, 1, *color] # sets label definition~ + [320, 650, args.state.left_paddle.score, 10, 1], +** Processing line: ~ [960, 650, args.state.right_paddle.score, 10, 1]~ - Inside source: true *** True Line Result - [x, y, text, 1, 1, *color] # sets label definition + [960, 650, args.state.right_paddle.score, 10, 1] +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87895,14 +91660,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 green~ +** Processing line: ~ def render_countdown args~ - Inside source: true *** True Line Result - def green -** Processing line: ~ [60, 200, 100] # sets color saturation to shade of green~ + def render_countdown args +** Processing line: ~ return unless args.state.ball.debounce > 0~ - Inside source: true *** True Line Result - [60, 200, 100] # sets color saturation to shade of green + return unless args.state.ball.debounce > 0 +** Processing line: ~ args.outputs.labels << [640, 360, "%.2f" % args.state.ball.debounce.fdiv(60), 10, 1]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [640, 360, "%.2f" % args.state.ball.debounce.fdiv(60), 10, 1] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87911,14 +91680,14 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def blue~ +** Processing line: ~ def render_ball args~ - Inside source: true *** True Line Result - def blue -** Processing line: ~ [50, 50, 210] # sets color saturation to shade of blue~ + def render_ball args +** Processing line: ~ args.outputs.solids << solid_ball(args)~ - Inside source: true *** True Line Result - [50, 50, 210] # sets color saturation to shade of blue + args.outputs.solids << solid_ball(args) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87927,14 +91696,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 white~ +** Processing line: ~ def render_paddles args~ - Inside source: true *** True Line Result - def white -** Processing line: ~ [255, 255, 255] # sets color saturation to white~ + def render_paddles args +** Processing line: ~ args.outputs.solids << solid_left_paddle(args)~ - Inside source: true *** True Line Result - [255, 255, 255] # sets color saturation to white + args.outputs.solids << solid_left_paddle(args) +** Processing line: ~ args.outputs.solids << solid_right_paddle(args)~ +- Inside source: true +*** True Line Result + args.outputs.solids << solid_right_paddle(args) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -87943,62 +91716,78 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def red~ +** Processing line: ~ def render_instructions args~ - Inside source: true *** True Line Result - def red -** Processing line: ~ [230, 80, 80] # sets color saturation to shade of red~ + def render_instructions args +** Processing line: ~ args.outputs.labels << [320, 30, "W and S keys to move left paddle.", 0, 1]~ - Inside source: true *** True Line Result - [230, 80, 80] # sets color saturation to shade of red + args.outputs.labels << [320, 30, "W and S keys to move left paddle.", 0, 1] +** Processing line: ~ args.outputs.labels << [920, 30, "O and L keys to move right paddle.", 0, 1]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [920, 30, "O and L keys to move right paddle.", 0, 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 orange~ +** Processing line: ~ def calc args~ - Inside source: true *** True Line Result - def orange -** Processing line: ~ [255, 80, 60] # sets color saturation to shade of orange~ + def calc args +** Processing line: ~ args.state.ball.debounce -= 1 and return if args.state.ball.debounce > 0~ - Inside source: true *** True Line Result - [255, 80, 60] # sets color saturation to shade of orange -** Processing line: ~ end~ + args.state.ball.debounce -= 1 and return if args.state.ball.debounce > 0 +** Processing line: ~ calc_move_ball args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + calc_move_ball args +** Processing line: ~ calc_collision_with_left_paddle args~ - Inside source: true *** True Line Result - -** Processing line: ~ def pink~ + calc_collision_with_left_paddle args +** Processing line: ~ calc_collision_with_right_paddle args~ - Inside source: true *** True Line Result - def pink -** Processing line: ~ [255, 0, 200] # sets color saturation to shade of pink~ + calc_collision_with_right_paddle args +** Processing line: ~ calc_collision_with_walls args~ - Inside source: true *** True Line Result - [255, 0, 200] # sets color saturation to shade of pink -** Processing line: ~ end~ + calc_collision_with_walls args +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def gray~ +** Processing line: ~ begin :calc_methods~ - Inside source: true *** True Line Result - def gray -** Processing line: ~ [75, 75, 75] # sets color saturation to shade of gray~ + begin :calc_methods +** Processing line: ~ def calc_move_ball args~ - Inside source: true *** True Line Result - [75, 75, 75] # sets color saturation to shade of gray + def calc_move_ball args +** Processing line: ~ args.state.ball.x += args.state.ball.dx~ +- Inside source: true +*** True Line Result + args.state.ball.x += args.state.ball.dx +** Processing line: ~ args.state.ball.y += args.state.ball.dy~ +- Inside source: true +*** True Line Result + args.state.ball.y += args.state.ball.dy ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -88007,30 +91796,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Recolors the border using the parameters.~ +** Processing line: ~ def calc_collision_with_left_paddle args~ - Inside source: true *** True Line Result - # Recolors the border using the parameters. -** Processing line: ~ def recolor_border border, r, g, b~ + def calc_collision_with_left_paddle args +** Processing line: ~ if solid_left_paddle(args).intersect_rect? solid_ball(args)~ - Inside source: true *** True Line Result - def recolor_border border, r, g, b -** Processing line: ~ border[4] = r~ + if solid_left_paddle(args).intersect_rect? solid_ball(args) +** Processing line: ~ args.state.ball.dx *= -1~ - Inside source: true *** True Line Result - border[4] = r -** Processing line: ~ border[5] = g~ + args.state.ball.dx *= -1 +** Processing line: ~ elsif args.state.ball.x < 0~ - Inside source: true *** True Line Result - border[5] = g -** Processing line: ~ border[6] = b~ + elsif args.state.ball.x < 0 +** Processing line: ~ args.state.right_paddle.score += 1~ - Inside source: true *** True Line Result - border[6] = b -** Processing line: ~ border~ + args.state.right_paddle.score += 1 +** Processing line: ~ calc_reset_round args~ - Inside source: true *** True Line Result - border + calc_reset_round args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -88039,22 +91832,34 @@ 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 boolean value.~ +** Processing line: ~ def calc_collision_with_right_paddle args~ - Inside source: true *** True Line Result - # Returns a boolean value. -** Processing line: ~ def visible? cell~ + def calc_collision_with_right_paddle args +** Processing line: ~ if solid_right_paddle(args).intersect_rect? solid_ball(args)~ - Inside source: true *** True Line Result - def visible? cell -** Processing line: ~ # finds cell's coordinates inside visible_cells collections to determine if cell is visible~ + if solid_right_paddle(args).intersect_rect? solid_ball(args) +** Processing line: ~ args.state.ball.dx *= -1~ - Inside source: true *** True Line Result - # finds cell's coordinates inside visible_cells collections to determine if cell is visible -** Processing line: ~ state.visible_cells.find { |c| c.x == cell.x && c.y == cell.y}~ + args.state.ball.dx *= -1 +** Processing line: ~ elsif args.state.ball.x > 1280~ - Inside source: true *** True Line Result - state.visible_cells.find { |c| c.x == cell.x && c.y == cell.y} + elsif args.state.ball.x > 1280 +** Processing line: ~ args.state.left_paddle.score += 1~ +- Inside source: true +*** True Line Result + args.state.left_paddle.score += 1 +** Processing line: ~ calc_reset_round args~ +- Inside source: true +*** True Line Result + calc_reset_round args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -88063,22 +91868,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Exports dungeon by printing dungeon cell coordinates~ +** Processing line: ~ def calc_collision_with_walls args~ - Inside source: true *** True Line Result - # Exports dungeon by printing dungeon cell coordinates -** Processing line: ~ def export_dungeon~ + def calc_collision_with_walls args +** Processing line: ~ if args.state.ball.y + args.state.ball.size_half > 720~ - Inside source: true *** True Line Result - def export_dungeon -** Processing line: ~ state.dungeon.each do |d| # on each element of dungeon collection~ + if args.state.ball.y + args.state.ball.size_half > 720 +** Processing line: ~ args.state.ball.y = 720 - args.state.ball.size_half~ - Inside source: true *** True Line Result - state.dungeon.each do |d| # on each element of dungeon collection -** Processing line: ~ puts "state.dungeon << [#{d.x}, #{d.y}]" # prints cell coordinates~ + args.state.ball.y = 720 - args.state.ball.size_half +** Processing line: ~ args.state.ball.dy *= -1~ - Inside source: true *** True Line Result - puts "state.dungeon << [#{d.x}, #{d.y}]" # prints cell coordinates + args.state.ball.dy *= -1 +** Processing line: ~ elsif args.state.ball.y - args.state.ball.size_half < 0~ +- Inside source: true +*** True Line Result + elsif args.state.ball.y - args.state.ball.size_half < 0 +** Processing line: ~ args.state.ball.y = args.state.ball.size_half~ +- Inside source: true +*** True Line Result + args.state.ball.y = args.state.ball.size_half +** Processing line: ~ args.state.ball.dy *= -1~ +- Inside source: true +*** True Line Result + args.state.ball.dy *= -1 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -88091,30 +91908,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 distance_to_cell cell~ +** Processing line: ~ def calc_reset_round args~ - Inside source: true *** True Line Result - def distance_to_cell cell -** Processing line: ~ distance_to state.x, cell.x, state.y, cell.y # calls distance_to method~ + def calc_reset_round args +** Processing line: ~ args.state.ball.x = 640~ - Inside source: true *** True Line Result - distance_to state.x, cell.x, state.y, cell.y # calls distance_to method -** Processing line: ~ end~ + args.state.ball.x = 640 +** Processing line: ~ args.state.ball.y = 360~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.ball.y = 360 +** Processing line: ~ args.state.ball.dx = 5.randomize(:sign)~ - Inside source: true *** True Line Result - -** Processing line: ~ def distance_to from_x, x, from_y, y~ + args.state.ball.dx = 5.randomize(:sign) +** Processing line: ~ args.state.ball.dy = 5.randomize(:sign)~ - Inside source: true *** True Line Result - def distance_to from_x, x, from_y, y -** Processing line: ~ (from_x - x).abs + (from_y - y).abs # finds distance between two cells using coordinates~ + args.state.ball.dy = 5.randomize(:sign) +** Processing line: ~ args.state.ball.debounce = 3 * 60~ - Inside source: true *** True Line Result - (from_x - x).abs + (from_y - y).abs # finds distance between two cells using coordinates + args.state.ball.debounce = 3 * 60 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -88127,262 +91944,306 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ $game = Game.new~ +** Processing line: ~ def input args~ - Inside source: true *** True Line Result - $game = Game.new -** Processing line: ~~ + def input args +** Processing line: ~ input_left_paddle args~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + input_left_paddle args +** Processing line: ~ input_right_paddle args~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ $game.args = args~ + input_right_paddle args +** Processing line: ~ end~ - Inside source: true *** True Line Result - $game.args = args -** Processing line: ~ $game.state = args.state~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - $game.state = args.state -** Processing line: ~ $game.inputs = args.inputs~ + +** Processing line: ~ begin :input_methods~ - Inside source: true *** True Line Result - $game.inputs = args.inputs -** Processing line: ~ $game.outputs = args.outputs~ + begin :input_methods +** Processing line: ~ def input_left_paddle args~ - Inside source: true *** True Line Result - $game.outputs = args.outputs -** Processing line: ~ $game.grid = args.grid~ + def input_left_paddle args +** Processing line: ~ if args.inputs.controller_one.key_down.down || args.inputs.keyboard.key_down.s~ - Inside source: true *** True Line Result - $game.grid = args.grid -** Processing line: ~ $game.tick~ + if args.inputs.controller_one.key_down.down || args.inputs.keyboard.key_down.s +** Processing line: ~ args.state.left_paddle.y -= 40~ - Inside source: true *** True Line Result - $game.tick -** Processing line: ~ end~ + args.state.left_paddle.y -= 40 +** Processing line: ~ elsif args.inputs.controller_one.key_down.up || args.inputs.keyboard.key_down.w~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif args.inputs.controller_one.key_down.up || args.inputs.keyboard.key_down.w +** Processing line: ~ args.state.left_paddle.y += 40~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + args.state.left_paddle.y += 40 +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Rpg Tactical - Hexagonal Grid - main.rb~ -- Header detected. +** Processing line: ~ def input_right_paddle args~ +- Inside source: true *** True Line Result - + def input_right_paddle args +** Processing line: ~ if args.inputs.controller_two.key_down.down || args.inputs.keyboard.key_down.l~ +- Inside source: true *** True Line Result -* Rpg Tactical - Hexagonal Grid - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + if args.inputs.controller_two.key_down.down || args.inputs.keyboard.key_down.l +** Processing line: ~ args.state.right_paddle.y -= 40~ +- Inside source: true *** True Line Result - + args.state.right_paddle.y -= 40 +** Processing line: ~ elsif args.inputs.controller_two.key_down.up || args.inputs.keyboard.key_down.o~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_tactical/hexagonal_grid/app/main.rb~ + elsif args.inputs.controller_two.key_down.up || args.inputs.keyboard.key_down.o +** Processing line: ~ args.state.right_paddle.y += 40~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_tactical/hexagonal_grid/app/main.rb -** Processing line: ~ class HexagonTileGame~ + args.state.right_paddle.y += 40 +** Processing line: ~ end~ - Inside source: true *** True Line Result - class HexagonTileGame -** Processing line: ~ attr_gtk~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_gtk + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def defaults~ +** Processing line: ~ begin :assets~ - Inside source: true *** True Line Result - def defaults -** Processing line: ~ state.tile_scale = 1.3~ + begin :assets +** Processing line: ~ def solid_ball args~ - Inside source: true *** True Line Result - state.tile_scale = 1.3 -** Processing line: ~ state.tile_size = 80~ + def solid_ball args +** Processing line: ~ centered_rect args.state.ball.x, args.state.ball.y, args.state.ball.size, args.state.ball.size~ - Inside source: true *** True Line Result - state.tile_size = 80 -** Processing line: ~ state.tile_w = Math.sqrt(3) * state.tile_size.half~ + centered_rect args.state.ball.x, args.state.ball.y, args.state.ball.size, args.state.ball.size +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.tile_w = Math.sqrt(3) * state.tile_size.half -** Processing line: ~ state.tile_h = state.tile_size * 3/4~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.tile_h = state.tile_size * 3/4 -** Processing line: ~ state.tiles_x_count = 1280.idiv(state.tile_w) - 1~ + +** Processing line: ~ def solid_left_paddle args~ - Inside source: true *** True Line Result - state.tiles_x_count = 1280.idiv(state.tile_w) - 1 -** Processing line: ~ state.tiles_y_count = 720.idiv(state.tile_h) - 1~ + def solid_left_paddle args +** Processing line: ~ centered_rect_vertically 0, args.state.left_paddle.y, args.state.paddle.w, args.state.paddle.h~ - Inside source: true *** True Line Result - state.tiles_y_count = 720.idiv(state.tile_h) - 1 -** Processing line: ~ state.world_width_px = state.tiles_x_count * state.tile_w~ + centered_rect_vertically 0, args.state.left_paddle.y, args.state.paddle.w, args.state.paddle.h +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.world_width_px = state.tiles_x_count * state.tile_w -** Processing line: ~ state.world_height_px = state.tiles_y_count * state.tile_h~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.world_height_px = state.tiles_y_count * state.tile_h -** Processing line: ~ state.world_x_offset = (1280 - state.world_width_px).half~ + +** Processing line: ~ def solid_right_paddle args~ - Inside source: true *** True Line Result - state.world_x_offset = (1280 - state.world_width_px).half -** Processing line: ~ state.world_y_offset = (720 - state.world_height_px).half~ + def solid_right_paddle args +** Processing line: ~ centered_rect_vertically 1280 - args.state.paddle.w, args.state.right_paddle.y, args.state.paddle.w, args.state.paddle.h~ - Inside source: true *** True Line Result - state.world_y_offset = (720 - state.world_height_px).half -** Processing line: ~ state.tiles ||= state.tiles_x_count.map_with_ys(state.tiles_y_count) do |ordinal_x, ordinal_y|~ + centered_rect_vertically 1280 - args.state.paddle.w, args.state.right_paddle.y, args.state.paddle.w, args.state.paddle.h +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.tiles ||= state.tiles_x_count.map_with_ys(state.tiles_y_count) do |ordinal_x, ordinal_y| -** Processing line: ~ {~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - { -** Processing line: ~ ordinal_x: ordinal_x,~ + +** Processing line: ~ def centered_rect x, y, w, h~ - Inside source: true *** True Line Result - ordinal_x: ordinal_x, -** Processing line: ~ ordinal_y: ordinal_y,~ + def centered_rect x, y, w, h +** Processing line: ~ [x - w / 2, y - h / 2, w, h]~ - Inside source: true *** True Line Result - ordinal_y: ordinal_y, -** Processing line: ~ offset_x: (ordinal_y.even?) ?~ + [x - w / 2, y - h / 2, w, h] +** Processing line: ~ end~ - Inside source: true *** True Line Result - offset_x: (ordinal_y.even?) ? -** Processing line: ~ (state.world_x_offset + state.tile_w.half.half) :~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - (state.world_x_offset + state.tile_w.half.half) : -** Processing line: ~ (state.world_x_offset - state.tile_w.half.half),~ + +** Processing line: ~ def centered_rect_vertically x, y, w, h~ - Inside source: true *** True Line Result - (state.world_x_offset - state.tile_w.half.half), -** Processing line: ~ offset_y: state.world_y_offset,~ + def centered_rect_vertically x, y, w, h +** Processing line: ~ [x, y - h / 2, w, h]~ - Inside source: true *** True Line Result - offset_y: state.world_y_offset, -** Processing line: ~ w: state.tile_w,~ + [x, y - h / 2, w, h] +** Processing line: ~ end~ - Inside source: true *** True Line Result - w: state.tile_w, -** Processing line: ~ h: state.tile_h,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - h: state.tile_h, -** Processing line: ~ type: :blank,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - type: :blank, -** Processing line: ~ path: "sprites/hexagon-gray.png",~ + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Arcade - Snakemoji - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Arcade - Snakemoji - 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_arcade/snakemoji/app/main.rb~ - Inside source: true *** True Line Result - path: "sprites/hexagon-gray.png", -** Processing line: ~ a: 20~ + # ./samples/99_genre_arcade/snakemoji/app/main.rb +** Processing line: ~ # coding: utf-8~ - Inside source: true *** True Line Result - a: 20 -** Processing line: ~ }.associate do |h|~ + # coding: utf-8 +** Processing line: ~ ################################~ - Inside source: true *** True Line Result - }.associate do |h| -** Processing line: ~ h.merge(x: h[:offset_x] + h[:ordinal_x] * h[:w],~ + ################################ +** Processing line: ~ # So I was working on a snake game while~ - Inside source: true *** True Line Result - h.merge(x: h[:offset_x] + h[:ordinal_x] * h[:w], -** Processing line: ~ y: h[:offset_y] + h[:ordinal_y] * h[:h]).scale_rect(state.tile_scale)~ + # So I was working on a snake game while +** Processing line: ~ # learning DragonRuby, and at some point I had a thought~ - Inside source: true *** True Line Result - y: h[:offset_y] + h[:ordinal_y] * h[:h]).scale_rect(state.tile_scale) -** Processing line: ~ end.associate do |h|~ + # learning DragonRuby, and at some point I had a thought +** Processing line: ~ # what if I use "😀" as a function name, surely it wont work right...?~ - Inside source: true *** True Line Result - end.associate do |h| -** Processing line: ~ h.merge(center: {~ + # what if I use "😀" as a function name, surely it wont work right...? +** Processing line: ~ # RIGHT....?~ - Inside source: true *** True Line Result - h.merge(center: { -** Processing line: ~ x: h[:x] + h[:w].half,~ + # RIGHT....? +** Processing line: ~ # BUT IT DID, IT WORKED~ - Inside source: true *** True Line Result - x: h[:x] + h[:w].half, -** Processing line: ~ y: h[:y] + h[:h].half~ + # BUT IT DID, IT WORKED +** Processing line: ~ # it all went downhill from then~ - Inside source: true *** True Line Result - y: h[:y] + h[:h].half -** Processing line: ~ }, radius: [h[:w].half, h[:h].half].max)~ + # it all went downhill from then +** Processing line: ~ # Created by Anton K. (ai Doge)~ - Inside source: true *** True Line Result - }, radius: [h[:w].half, h[:h].half].max) -** Processing line: ~ end~ + # Created by Anton K. (ai Doge) +** Processing line: ~ # https://gist.github.com/scorp200~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # https://gist.github.com/scorp200 +** Processing line: ~ #############LICENSE############~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + #############LICENSE############ +** Processing line: ~ # Feel free to use this anywhere and however you want~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Feel free to use this anywhere and however you want +** Processing line: ~ # You can sell this to EA for $1,000,000 if you want, its completely free.~ - Inside source: true *** True Line Result - -** Processing line: ~ def input~ + # You can sell this to EA for $1,000,000 if you want, its completely free. +** Processing line: ~ # Just rememeber you are helping this... thing... to spread...~ - Inside source: true *** True Line Result - def input -** Processing line: ~ if inputs.click~ + # Just rememeber you are helping this... thing... to spread... +** Processing line: ~ # ALSO! I am not liable for any mental, physical or financial damage caused.~ - Inside source: true *** True Line Result - if inputs.click -** Processing line: ~ tile = state.tiles.find { |t| inputs.click.point_inside_circle? t[:center], t[:radius] }~ + # ALSO! I am not liable for any mental, physical or financial damage caused. +** Processing line: ~ #############LICENSE############~ - Inside source: true *** True Line Result - tile = state.tiles.find { |t| inputs.click.point_inside_circle? t[:center], t[:radius] } -** Processing line: ~ if tile~ + #############LICENSE############ +** Processing line: ~~ - Inside source: true *** True Line Result - if tile -** Processing line: ~ tile[:a] = 255~ + +** Processing line: ~~ - Inside source: true *** True Line Result - tile[:a] = 255 -** Processing line: ~ tile[:path] = "sprites/hexagon-black.png"~ + +** Processing line: ~ class Array~ - Inside source: true *** True Line Result - tile[:path] = "sprites/hexagon-black.png" -** Processing line: ~ end~ + class Array +** Processing line: ~ #Helper function~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + #Helper function +** Processing line: ~ def move! vector~ - Inside source: true *** True Line Result - end + def move! vector +** Processing line: ~ self.x += vector.x~ +- Inside source: true +*** True Line Result + self.x += vector.x +** Processing line: ~ self.y += vector.y~ +- Inside source: true +*** True Line Result + self.y += vector.y +** Processing line: ~ return self~ +- Inside source: true +*** True Line Result + return self ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -88391,22 +92252,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 tick~ -- Inside source: true -*** True Line Result - def tick -** Processing line: ~ defaults~ +** Processing line: ~ #Helper function to draw snake body~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ input~ + #Helper function to draw snake body +** Processing line: ~ def draw! 🎮, 📺, color~ - Inside source: true *** True Line Result - input -** Processing line: ~ render~ + def draw! 🎮, 📺, color +** Processing line: ~ translate 📺.solids, 🎮.⛓, [self.x * 🎮.⚖️ + 🎮.🛶 / 2, self.y * 🎮.⚖️ + 🎮.🛶 / 2, 🎮.⚖️ - 🎮.🛶, 🎮.⚖️ - 🎮.🛶, color]~ - Inside source: true *** True Line Result - render + translate 📺.solids, 🎮.⛓, [self.x * 🎮.⚖️ + 🎮.🛶 / 2, self.y * 🎮.⚖️ + 🎮.🛶 / 2, 🎮.⚖️ - 🎮.🛶, 🎮.⚖️ - 🎮.🛶, color] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -88415,14 +92272,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 render~ +** Processing line: ~ #This is where it all started, I was trying to find good way to multiply a map by a number, * is already used so is **~ - Inside source: true *** True Line Result - def render -** Processing line: ~ outputs.sprites << state.tiles~ + #This is where it all started, I was trying to find good way to multiply a map by a number, * is already used so is ** +** Processing line: ~ #I kept trying different combinations of symbols, when suddenly...~ - Inside source: true *** True Line Result - outputs.sprites << state.tiles + #I kept trying different combinations of symbols, when suddenly... +** Processing line: ~ def 😀 value~ +- Inside source: true +*** True Line Result + def 😀 value +** Processing line: ~ self.map {|d| d * value}~ +- Inside source: true +*** True Line Result + self.map {|d| d * value} ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -88435,26 +92300,26 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ $game = HexagonTileGame.new~ +** Processing line: ~ #Draw stuff with an offset~ - Inside source: true *** True Line Result - $game = HexagonTileGame.new -** Processing line: ~~ + #Draw stuff with an offset +** Processing line: ~ def translate output_collection, ⛓, what~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick args~ + def translate output_collection, ⛓, what +** Processing line: ~ what.x += ⛓.x~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ $game.args = args~ + what.x += ⛓.x +** Processing line: ~ what.y += ⛓.y~ - Inside source: true *** True Line Result - $game.args = args -** Processing line: ~ $game.tick~ + what.y += ⛓.y +** Processing line: ~ output_collection << what~ - Inside source: true *** True Line Result - $game.tick + output_collection << what ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -88463,1298 +92328,1338 @@ 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~ +** Processing line: ~ BLUE = [33, 150, 243]~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~~ + BLUE = [33, 150, 243] +** Processing line: ~ RED = [244, 67, 54]~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + RED = [244, 67, 54] +** Processing line: ~ GOLD = [255, 193, 7]~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + GOLD = [255, 193, 7] +** Processing line: ~ LAST = 0~ +- Inside source: true *** True Line Result - -** Processing line: ~* Rpg Tactical - Isometric Grid - main.rb~ -- Header detected. + LAST = 0 +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ def tick args~ +- Inside source: true *** True Line Result -* Rpg Tactical - Isometric Grid - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + def tick args +** Processing line: ~ defaults args.state~ +- Inside source: true *** True Line Result - + defaults args.state +** Processing line: ~ render args.state, args.outputs~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_tactical/isometric_grid/app/main.rb~ + render args.state, args.outputs +** Processing line: ~ input args.state, args.inputs~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_tactical/isometric_grid/app/main.rb -** Processing line: ~ class Isometric~ + input args.state, args.inputs +** Processing line: ~ update args.state~ - Inside source: true *** True Line Result - class Isometric -** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs~ + update args.state +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_accessor :grid, :inputs, :state, :outputs + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick~ +** Processing line: ~ def update 🎮~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ defaults~ + def update 🎮 +** Processing line: ~ #Update every 10 frames~ - Inside source: true *** True Line Result - defaults -** Processing line: ~ render~ + #Update every 10 frames +** Processing line: ~ if 🎮.tick_count.mod_zero? 10~ - Inside source: true *** True Line Result - render -** Processing line: ~ calc~ + if 🎮.tick_count.mod_zero? 10 +** Processing line: ~ #Add new snake body piece at head's location~ - Inside source: true *** True Line Result - calc -** Processing line: ~ process_inputs~ + #Add new snake body piece at head's location +** Processing line: ~ 🎮.🐍 << [*🎮.🤖]~ - Inside source: true *** True Line Result - process_inputs -** Processing line: ~ end~ + 🎮.🐍 << [*🎮.🤖] +** Processing line: ~ #Assign Next Direction to Direction~ - Inside source: true *** True Line Result - end + #Assign Next Direction to Direction +** Processing line: ~ 🎮.🚗 = *🎮.🚦~ +- Inside source: true +*** True Line Result + 🎮.🚗 = *🎮.🚦 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def defaults~ +** Processing line: ~ #Trim the snake a bit if its longer than current size~ - Inside source: true *** True Line Result - def defaults -** Processing line: ~ state.quantity ||= 6 #Size of grid~ + #Trim the snake a bit if its longer than current size +** Processing line: ~ if 🎮.🐍.length > 🎮.🛒~ - Inside source: true *** True Line Result - state.quantity ||= 6 #Size of grid -** Processing line: ~ state.tileSize ||= [262 / 2, 194 / 2] #width and heigth of orange tiles~ + if 🎮.🐍.length > 🎮.🛒 +** Processing line: ~ 🎮.🐍 = 🎮.🐍[-🎮.🛒..-1]~ - Inside source: true *** True Line Result - state.tileSize ||= [262 / 2, 194 / 2] #width and heigth of orange tiles -** Processing line: ~ state.tileGrid ||= [] #Holds ordering of tiles~ + 🎮.🐍 = 🎮.🐍[-🎮.🛒..-1] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.tileGrid ||= [] #Holds ordering of tiles -** Processing line: ~ state.currentSpriteLocation ||= -1 #Current Sprite hovering location~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.currentSpriteLocation ||= -1 #Current Sprite hovering location -** Processing line: ~ state.tileCords ||= [] #Physical, rendering cordinates~ + +** Processing line: ~ #Move the head in the Direction~ - Inside source: true *** True Line Result - state.tileCords ||= [] #Physical, rendering cordinates -** Processing line: ~ state.initCords ||= [640 - (state.quantity / 2 * state.tileSize[0]), 330] #Location of tile (0, 0)~ + #Move the head in the Direction +** Processing line: ~ 🎮.🤖.move! 🎮.🚗~ - Inside source: true *** True Line Result - state.initCords ||= [640 - (state.quantity / 2 * state.tileSize[0]), 330] #Location of tile (0, 0) -** Processing line: ~ state.sideSize ||= [state.tileSize[0] / 2, 242 / 2] #Purple & green cube face size~ + 🎮.🤖.move! 🎮.🚗 +** Processing line: ~~ - Inside source: true *** True Line Result - state.sideSize ||= [state.tileSize[0] / 2, 242 / 2] #Purple & green cube face size -** Processing line: ~ state.mode ||= :delete #Switches between :delete and :insert~ + +** Processing line: ~ #If Head is outside the playing field, or inside snake's body restart game~ - Inside source: true *** True Line Result - state.mode ||= :delete #Switches between :delete and :insert -** Processing line: ~ state.spriteSelection ||= [['river', 0, 0, 262 / 2, 194 / 2],~ + #If Head is outside the playing field, or inside snake's body restart game +** Processing line: ~ if 🎮.🤖.x < 0 || 🎮.🤖.x >= 🎮.🗺.x || 🎮.🤖.y < 0 || 🎮.🤖.y >= 🎮.🗺.y || 🎮.🚗 != [0, 0] && 🎮.🐍.any? {|s| s == 🎮.🤖}~ - Inside source: true *** True Line Result - state.spriteSelection ||= [['river', 0, 0, 262 / 2, 194 / 2], -** Processing line: ~ ['mountain', 0, 0, 262 / 2, 245 / 2],~ + if 🎮.🤖.x < 0 || 🎮.🤖.x >= 🎮.🗺.x || 🎮.🤖.y < 0 || 🎮.🤖.y >= 🎮.🗺.y || 🎮.🚗 != [0, 0] && 🎮.🐍.any? {|s| s == 🎮.🤖} +** Processing line: ~ LAST = 🎮.💰~ - Inside source: true *** True Line Result - ['mountain', 0, 0, 262 / 2, 245 / 2], -** Processing line: ~ ['ocean', 0, 0, 262 / 2, 194 / 2]] #Storage for sprite information~ + LAST = 🎮.💰 +** Processing line: ~ 🎮.as_hash.clear~ - Inside source: true *** True Line Result - ['ocean', 0, 0, 262 / 2, 194 / 2]] #Storage for sprite information -** Processing line: ~ #['name', deltaX, deltaY, sizeW, sizeH]~ + 🎮.as_hash.clear +** Processing line: ~ return~ - Inside source: true *** True Line Result - #['name', deltaX, deltaY, sizeW, sizeH] -** Processing line: ~ #^delta refers to distance from tile cords~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - #^delta refers to distance from tile cords + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ #Orders tiles based on tile placement and fancy math. Very left: 0,0. Very bottom: quantity-1, 0, etc~ -- Inside source: true -*** True Line Result - #Orders tiles based on tile placement and fancy math. Very left: 0,0. Very bottom: quantity-1, 0, etc -** Processing line: ~ if state.tileGrid == []~ -- Inside source: true -*** True Line Result - if state.tileGrid == [] -** Processing line: ~ tempX = 0~ -- Inside source: true -*** True Line Result - tempX = 0 -** Processing line: ~ tempY = 0~ +** Processing line: ~ #If head lands on food add size and score~ - Inside source: true *** True Line Result - tempY = 0 -** Processing line: ~ tempLeft = false~ + #If head lands on food add size and score +** Processing line: ~ if 🎮.🤖 == 🎮.🍎~ - Inside source: true *** True Line Result - tempLeft = false -** Processing line: ~ tempRight = false~ + if 🎮.🤖 == 🎮.🍎 +** Processing line: ~ 🎮.🛒 += 1~ - Inside source: true *** True Line Result - tempRight = false -** Processing line: ~ count = 0~ + 🎮.🛒 += 1 +** Processing line: ~ 🎮.💰 += (🎮.🛒 * 0.8).floor.to_i + 5~ - Inside source: true *** True Line Result - count = 0 -** Processing line: ~ (state.quantity * state.quantity).times do~ + 🎮.💰 += (🎮.🛒 * 0.8).floor.to_i + 5 +** Processing line: ~ spawn_🍎 🎮~ - Inside source: true *** True Line Result - (state.quantity * state.quantity).times do -** Processing line: ~ if tempY == 0~ + spawn_🍎 🎮 +** Processing line: ~ puts 🎮.🍎~ - Inside source: true *** True Line Result - if tempY == 0 -** Processing line: ~ tempLeft = true~ + puts 🎮.🍎 +** Processing line: ~ end~ - Inside source: true *** True Line Result - tempLeft = true -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ if tempX == (state.quantity - 1)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - if tempX == (state.quantity - 1) -** Processing line: ~ tempRight = true~ + +** Processing line: ~ #Every second remove 1 point~ - Inside source: true *** True Line Result - tempRight = true -** Processing line: ~ end~ + #Every second remove 1 point +** Processing line: ~ if 🎮.💰 > 0 && 🎮.tick_count.mod_zero?(60)~ - Inside source: true *** True Line Result - end -** Processing line: ~ state.tileGrid.push([tempX, tempY, true, tempLeft, tempRight, count])~ + if 🎮.💰 > 0 && 🎮.tick_count.mod_zero?(60) +** Processing line: ~ 🎮.💰 -= 1~ - Inside source: true *** True Line Result - state.tileGrid.push([tempX, tempY, true, tempLeft, tempRight, count]) -** Processing line: ~ #orderX, orderY, exists?, leftSide, rightSide, order~ + 🎮.💰 -= 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - #orderX, orderY, exists?, leftSide, rightSide, order -** Processing line: ~ tempX += 1~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - tempX += 1 -** Processing line: ~ if tempX == state.quantity~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - if tempX == state.quantity -** Processing line: ~ tempX = 0~ + +** Processing line: ~ def spawn_🍎 🎮~ - Inside source: true *** True Line Result - tempX = 0 -** Processing line: ~ tempY += 1~ + def spawn_🍎 🎮 +** Processing line: ~ #Food~ - Inside source: true *** True Line Result - tempY += 1 -** Processing line: ~ end~ + #Food +** Processing line: ~ 🎮.🍎 ||= [*🎮.🤖]~ - Inside source: true *** True Line Result - end -** Processing line: ~ tempLeft = false~ + 🎮.🍎 ||= [*🎮.🤖] +** Processing line: ~ #Randomly spawns food inside the playing field, keep doing this if the food keeps landing on the snake's body~ - Inside source: true *** True Line Result - tempLeft = false -** Processing line: ~ tempRight = false~ + #Randomly spawns food inside the playing field, keep doing this if the food keeps landing on the snake's body +** Processing line: ~ while 🎮.🐍.any? {|s| s == 🎮.🍎} || 🎮.🍎 == 🎮.🤖 do~ - Inside source: true *** True Line Result - tempRight = false -** Processing line: ~ count += 1~ + while 🎮.🐍.any? {|s| s == 🎮.🍎} || 🎮.🍎 == 🎮.🤖 do +** Processing line: ~ 🎮.🍎 = [rand(🎮.🗺.x), rand(🎮.🗺.y)]~ - Inside source: true *** True Line Result - count += 1 -** Processing line: ~ end~ + 🎮.🍎 = [rand(🎮.🗺.x), rand(🎮.🗺.y)] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ #Calculates physical cordinates for tiles~ +** Processing line: ~ def render 🎮, 📺~ - Inside source: true *** True Line Result - #Calculates physical cordinates for tiles -** Processing line: ~ if state.tileCords == []~ + def render 🎮, 📺 +** Processing line: ~ #Paint the background black~ - Inside source: true *** True Line Result - if state.tileCords == [] -** Processing line: ~ state.tileCords = state.tileGrid.map do~ + #Paint the background black +** Processing line: ~ 📺.solids << [0, 0, 1280, 720, 0, 0, 0, 255]~ - Inside source: true *** True Line Result - state.tileCords = state.tileGrid.map do -** Processing line: ~ |val|~ + 📺.solids << [0, 0, 1280, 720, 0, 0, 0, 255] +** Processing line: ~ #Draw a border for the playing field~ - Inside source: true *** True Line Result - |val| -** Processing line: ~ x = (state.initCords[0]) + ((val[0] + val[1]) * state.tileSize[0] / 2)~ + #Draw a border for the playing field +** Processing line: ~ translate 📺.borders, 🎮.⛓, [0, 0, 🎮.🗺.x * 🎮.⚖️, 🎮.🗺.y * 🎮.⚖️, 255, 255, 255]~ - Inside source: true *** True Line Result - x = (state.initCords[0]) + ((val[0] + val[1]) * state.tileSize[0] / 2) -** Processing line: ~ y = (state.initCords[1]) + (-1 * val[0] * state.tileSize[1] / 2) + (val[1] * state.tileSize[1] / 2)~ + translate 📺.borders, 🎮.⛓, [0, 0, 🎮.🗺.x * 🎮.⚖️, 🎮.🗺.y * 🎮.⚖️, 255, 255, 255] +** Processing line: ~~ - Inside source: true *** True Line Result - y = (state.initCords[1]) + (-1 * val[0] * state.tileSize[1] / 2) + (val[1] * state.tileSize[1] / 2) -** Processing line: ~ [x, y, val[2], val[3], val[4], val[5], -1] #-1 represents sprite on top of tile. -1 for now~ + +** Processing line: ~ #Draw the snake's body~ - Inside source: true *** True Line Result - [x, y, val[2], val[3], val[4], val[5], -1] #-1 represents sprite on top of tile. -1 for now -** Processing line: ~ end~ + #Draw the snake's body +** Processing line: ~ 🎮.🐍.map do |🐍| 🐍.draw! 🎮, 📺, BLUE end~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 🎮.🐍.map do |🐍| 🐍.draw! 🎮, 📺, BLUE end +** Processing line: ~ #Draw the head~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #Draw the head +** Processing line: ~ 🎮.🤖.draw! 🎮, 📺, BLUE~ - Inside source: true *** True Line Result - -** Processing line: ~ end~ + 🎮.🤖.draw! 🎮, 📺, BLUE +** Processing line: ~ #Draw the food~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #Draw the food +** Processing line: ~ 🎮.🍎.draw! 🎮, 📺, RED~ - Inside source: true *** True Line Result - -** Processing line: ~ def render~ + 🎮.🍎.draw! 🎮, 📺, RED +** Processing line: ~~ - Inside source: true *** True Line Result - def render -** Processing line: ~ renderBackground~ + +** Processing line: ~ #Draw current score~ - Inside source: true *** True Line Result - renderBackground -** Processing line: ~ renderLeft~ + #Draw current score +** Processing line: ~ translate 📺.labels, 🎮.⛓, [5, 715, "Score: #{🎮.💰}", GOLD]~ - Inside source: true *** True Line Result - renderLeft -** Processing line: ~ renderRight~ + translate 📺.labels, 🎮.⛓, [5, 715, "Score: #{🎮.💰}", GOLD] +** Processing line: ~ #Draw your last score, if any~ - Inside source: true *** True Line Result - renderRight -** Processing line: ~ renderTiles~ + #Draw your last score, if any +** Processing line: ~ translate 📺.labels, 🎮.⛓, [[*🎮.🤖.😀(🎮.⚖️)].move!([0, 🎮.⚖️ * 2]), "Your Last score is #{LAST}", 0, 1, GOLD] unless LAST == 0 || 🎮.🚗 != [0, 0]~ - Inside source: true *** True Line Result - renderTiles -** Processing line: ~ renderObjects~ + translate 📺.labels, 🎮.⛓, [[*🎮.🤖.😀(🎮.⚖️)].move!([0, 🎮.⚖️ * 2]), "Your Last score is #{LAST}", 0, 1, GOLD] unless LAST == 0 || 🎮.🚗 != [0, 0] +** Processing line: ~ #Draw starting message, only if Direction is 0~ - Inside source: true *** True Line Result - renderObjects -** Processing line: ~ renderLabels~ + #Draw starting message, only if Direction is 0 +** Processing line: ~ translate 📺.labels, 🎮.⛓, [🎮.🤖.😀(🎮.⚖️), "Press any Arrow key to start", 0, 1, GOLD] unless 🎮.🚗 != [0, 0]~ - Inside source: true *** True Line Result - renderLabels -** Processing line: ~ end~ + translate 📺.labels, 🎮.⛓, [🎮.🤖.😀(🎮.⚖️), "Press any Arrow key to start", 0, 1, GOLD] unless 🎮.🚗 != [0, 0] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def renderBackground~ +** Processing line: ~ def input 🎮, 🕹~ - Inside source: true *** True Line Result - def renderBackground -** Processing line: ~ outputs.solids << [0, 0, 1280, 720, 0, 0, 0] #Background color~ + def input 🎮, 🕹 +** Processing line: ~ #Left and Right keyboard input, only change if X direction is 0~ - Inside source: true *** True Line Result - outputs.solids << [0, 0, 1280, 720, 0, 0, 0] #Background color -** Processing line: ~ end~ + #Left and Right keyboard input, only change if X direction is 0 +** Processing line: ~ if 🕹.keyboard.key_held.left && 🎮.🚗.x == 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if 🕹.keyboard.key_held.left && 🎮.🚗.x == 0 +** Processing line: ~ 🎮.🚦 = [-1, 0]~ - Inside source: true *** True Line Result - -** Processing line: ~ def renderLeft~ + 🎮.🚦 = [-1, 0] +** Processing line: ~ elsif 🕹.keyboard.key_held.right && 🎮.🚗.x == 0~ - Inside source: true *** True Line Result - def renderLeft -** Processing line: ~ #Shows the pink left cube face~ + elsif 🕹.keyboard.key_held.right && 🎮.🚗.x == 0 +** Processing line: ~ 🎮.🚦 = [1, 0]~ - Inside source: true *** True Line Result - #Shows the pink left cube face -** Processing line: ~ outputs.sprites << state.tileCords.map do~ + 🎮.🚦 = [1, 0] +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs.sprites << state.tileCords.map do -** Processing line: ~ |val|~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - |val| -** Processing line: ~ if val[2] == true && val[3] == true #Checks if the tile exists and right face needs to be rendered~ + +** Processing line: ~ #Up and Down keyboard input, only change if Y direction is 0~ - Inside source: true *** True Line Result - if val[2] == true && val[3] == true #Checks if the tile exists and right face needs to be rendered -** Processing line: ~ [val[0], val[1] + (state.tileSize[1] / 2) - state.sideSize[1], state.sideSize[0],~ + #Up and Down keyboard input, only change if Y direction is 0 +** Processing line: ~ if 🕹.keyboard.key_held.up && 🎮.🚗.y == 0~ - Inside source: true *** True Line Result - [val[0], val[1] + (state.tileSize[1] / 2) - state.sideSize[1], state.sideSize[0], -** Processing line: ~ state.sideSize[1], 'sprites/leftSide.png']~ + if 🕹.keyboard.key_held.up && 🎮.🚗.y == 0 +** Processing line: ~ 🎮.🚦 = [0, 1]~ - Inside source: true *** True Line Result - state.sideSize[1], 'sprites/leftSide.png'] -** Processing line: ~ end~ + 🎮.🚦 = [0, 1] +** Processing line: ~ elsif 🕹.keyboard.key_held.down && 🎮.🚗.y == 0~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + elsif 🕹.keyboard.key_held.down && 🎮.🚗.y == 0 +** Processing line: ~ 🎮.🚦 = [0, -1]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 🎮.🚦 = [0, -1] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def renderRight~ +** Processing line: ~ def defaults 🎮~ - Inside source: true *** True Line Result - def renderRight -** Processing line: ~ #Shows the green right cube face~ + def defaults 🎮 +** Processing line: ~ #Playing field size~ - Inside source: true *** True Line Result - #Shows the green right cube face -** Processing line: ~ outputs.sprites << state.tileCords.map do~ + #Playing field size +** Processing line: ~ 🎮.🗺 ||= [20, 20]~ - Inside source: true *** True Line Result - outputs.sprites << state.tileCords.map do -** Processing line: ~ |val|~ + 🎮.🗺 ||= [20, 20] +** Processing line: ~ #Scale for drawing, screen height / Field height~ - Inside source: true *** True Line Result - |val| -** Processing line: ~ if val[2] == true && val[4] == true #Checks if it exists & checks if right face needs to be rendered~ + #Scale for drawing, screen height / Field height +** Processing line: ~ 🎮.⚖️ ||= 720 / 🎮.🗺.y~ - Inside source: true *** True Line Result - if val[2] == true && val[4] == true #Checks if it exists & checks if right face needs to be rendered -** Processing line: ~ [val[0] + state.tileSize[0] / 2, val[1] + (state.tileSize[1] / 2) - state.sideSize[1], state.sideSize[0],~ + 🎮.⚖️ ||= 720 / 🎮.🗺.y +** Processing line: ~ #Offset, offset all rendering to the center of the screen~ - Inside source: true *** True Line Result - [val[0] + state.tileSize[0] / 2, val[1] + (state.tileSize[1] / 2) - state.sideSize[1], state.sideSize[0], -** Processing line: ~ state.sideSize[1], 'sprites/rightSide.png']~ + #Offset, offset all rendering to the center of the screen +** Processing line: ~ 🎮.⛓ ||= [(1280 - 720).fdiv(2), 0]~ - Inside source: true *** True Line Result - state.sideSize[1], 'sprites/rightSide.png'] -** Processing line: ~ end~ + 🎮.⛓ ||= [(1280 - 720).fdiv(2), 0] +** Processing line: ~ #Padding, make the snake body slightly smaller than the scale~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + #Padding, make the snake body slightly smaller than the scale +** Processing line: ~ 🎮.🛶 ||= (🎮.⚖️ * 0.2).to_i~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 🎮.🛶 ||= (🎮.⚖️ * 0.2).to_i +** Processing line: ~ #Snake Size~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + #Snake Size +** Processing line: ~ 🎮.🛒 ||= 3~ - Inside source: true *** True Line Result - -** Processing line: ~ def renderTiles~ + 🎮.🛒 ||= 3 +** Processing line: ~ #Snake head, the only part we are actually controlling~ - Inside source: true *** True Line Result - def renderTiles -** Processing line: ~ #Shows the tile itself. Important that it's rendered after the two above!~ + #Snake head, the only part we are actually controlling +** Processing line: ~ 🎮.🤖 ||= [🎮.🗺.x / 2, 🎮.🗺.y / 2]~ - Inside source: true *** True Line Result - #Shows the tile itself. Important that it's rendered after the two above! -** Processing line: ~ outputs.sprites << state.tileCords.map do~ + 🎮.🤖 ||= [🎮.🗺.x / 2, 🎮.🗺.y / 2] +** Processing line: ~ #Snake body map, follows the head~ - Inside source: true *** True Line Result - outputs.sprites << state.tileCords.map do -** Processing line: ~ |val|~ + #Snake body map, follows the head +** Processing line: ~ 🎮.🐍 ||= []~ - Inside source: true *** True Line Result - |val| -** Processing line: ~ if val[2] == true #Chcekcs if tile needs to be rendered~ + 🎮.🐍 ||= [] +** Processing line: ~ #Direction the head moves to~ - Inside source: true *** True Line Result - if val[2] == true #Chcekcs if tile needs to be rendered -** Processing line: ~ if val[5] == state.currentSpriteLocation~ + #Direction the head moves to +** Processing line: ~ 🎮.🚗 ||= [0, 0]~ - Inside source: true *** True Line Result - if val[5] == state.currentSpriteLocation -** Processing line: ~ [val[0], val[1], state.tileSize[0], state.tileSize[1], 'sprites/selectedTile.png']~ + 🎮.🚗 ||= [0, 0] +** Processing line: ~ #Next_Direction, during input check only change this variable and then when game updates asign this to Direction~ - Inside source: true *** True Line Result - [val[0], val[1], state.tileSize[0], state.tileSize[1], 'sprites/selectedTile.png'] -** Processing line: ~ else~ + #Next_Direction, during input check only change this variable and then when game updates asign this to Direction +** Processing line: ~ 🎮.🚦 ||= [*🎮.🚗]~ - Inside source: true *** True Line Result - else -** Processing line: ~ [val[0], val[1], state.tileSize[0], state.tileSize[1], 'sprites/tile.png']~ + 🎮.🚦 ||= [*🎮.🚗] +** Processing line: ~ #Your score~ - Inside source: true *** True Line Result - [val[0], val[1], state.tileSize[0], state.tileSize[1], 'sprites/tile.png'] -** Processing line: ~ end~ + #Your score +** Processing line: ~ 🎮.💰 ||= 0~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 🎮.💰 ||= 0 +** Processing line: ~ #Spawns Food randomly~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + #Spawns Food randomly +** Processing line: ~ spawn_🍎(🎮) unless 🎮.🍎?~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + spawn_🍎(🎮) unless 🎮.🍎? +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def renderObjects~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - def renderObjects -** Processing line: ~ #Renders the sprites on top of the tiles. Order of rendering: top corner to right corner and cascade down until left corner~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - #Renders the sprites on top of the tiles. Order of rendering: top corner to right corner and cascade down until left corner -** Processing line: ~ #to bottom corner.~ -- Inside source: true + +** Processing line: ~*** Arcade - Solar System - main.rb~ +- Header detected. *** True Line Result - #to bottom corner. -** Processing line: ~ a = (state.quantity * state.quantity) - state.quantity~ + +*** True Line Result +*** Arcade - Solar System - 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_arcade/solar_system/app/main.rb~ - Inside source: true *** True Line Result - a = (state.quantity * state.quantity) - state.quantity -** Processing line: ~ iter = 0~ + # ./samples/99_genre_arcade/solar_system/app/main.rb +** Processing line: ~ # Focused tutorial video: https://s3.amazonaws.com/s3.dragonruby.org/dragonruby-nddnug-workshop.mp4~ - Inside source: true *** True Line Result - iter = 0 -** Processing line: ~ loop do~ + # Focused tutorial video: https://s3.amazonaws.com/s3.dragonruby.org/dragonruby-nddnug-workshop.mp4 +** Processing line: ~ # Workshop/Presentation which provides motivation for creating a game engine: https://www.youtube.com/watch?v=S3CFce1arC8~ - Inside source: true *** True Line Result - loop do -** Processing line: ~ if state.tileCords[a][2] == true && state.tileCords[a][6] != -1~ + # Workshop/Presentation which provides motivation for creating a game engine: https://www.youtube.com/watch?v=S3CFce1arC8 +** Processing line: ~~ - Inside source: true *** True Line Result - if state.tileCords[a][2] == true && state.tileCords[a][6] != -1 -** Processing line: ~ outputs.sprites << [state.tileCords[a][0] + state.spriteSelection[state.tileCords[a][6]][1],~ + +** Processing line: ~ def defaults args~ - Inside source: true *** True Line Result - outputs.sprites << [state.tileCords[a][0] + state.spriteSelection[state.tileCords[a][6]][1], -** Processing line: ~ state.tileCords[a][1] + state.spriteSelection[state.tileCords[a][6]][2],~ + def defaults args +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - state.tileCords[a][1] + state.spriteSelection[state.tileCords[a][6]][2], -** Processing line: ~ state.spriteSelection[state.tileCords[a][6]][3], state.spriteSelection[state.tileCords[a][6]][4],~ + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.state.x ||= 640~ - Inside source: true *** True Line Result - state.spriteSelection[state.tileCords[a][6]][3], state.spriteSelection[state.tileCords[a][6]][4], -** Processing line: ~ 'sprites/' + state.spriteSelection[state.tileCords[a][6]][0] + '.png']~ + args.state.x ||= 640 +** Processing line: ~ args.state.y ||= 360~ - Inside source: true *** True Line Result - 'sprites/' + state.spriteSelection[state.tileCords[a][6]][0] + '.png'] -** Processing line: ~ end~ + args.state.y ||= 360 +** Processing line: ~ args.state.stars ||= 100.map do~ - Inside source: true *** True Line Result - end -** Processing line: ~ iter += 1~ + args.state.stars ||= 100.map do +** Processing line: ~ [1280 * rand, 720 * rand, rand.fdiv(10), 255 * rand, 255 * rand, 255 * rand]~ - Inside source: true *** True Line Result - iter += 1 -** Processing line: ~ a += 1~ + [1280 * rand, 720 * rand, rand.fdiv(10), 255 * rand, 255 * rand, 255 * rand] +** Processing line: ~ end~ - Inside source: true *** True Line Result - a += 1 -** Processing line: ~ a -= state.quantity * 2 if iter == state.quantity~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - a -= state.quantity * 2 if iter == state.quantity -** Processing line: ~ iter = 0 if iter == state.quantity~ + +** Processing line: ~ args.state.sun ||= args.state.new_entity(:sun) do |s|~ - Inside source: true *** True Line Result - iter = 0 if iter == state.quantity -** Processing line: ~ break if a < 0~ + args.state.sun ||= args.state.new_entity(:sun) do |s| +** Processing line: ~ s.s = 100~ - Inside source: true *** True Line Result - break if a < 0 -** Processing line: ~ end~ + s.s = 100 +** Processing line: ~ s.path = 'sprites/sun.png'~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + s.path = 'sprites/sun.png' +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def renderLabels~ +** Processing line: ~ args.state.planets = [~ - Inside source: true *** True Line Result - def renderLabels -** Processing line: ~ #Labels~ + args.state.planets = [ +** Processing line: ~ [:mercury, 65, 5, 88],~ - Inside source: true *** True Line Result - #Labels -** Processing line: ~ outputs.labels << [50, 680, 'Click to delete!', 5, 0, 255, 255, 255, 255] if state.mode == :delete~ + [:mercury, 65, 5, 88], +** Processing line: ~ [:venus, 100, 10, 225],~ - Inside source: true *** True Line Result - outputs.labels << [50, 680, 'Click to delete!', 5, 0, 255, 255, 255, 255] if state.mode == :delete -** Processing line: ~ outputs.labels << [50, 640, 'Press \'i\' for insert mode!', 5, 0, 255, 255, 255, 255] if state.mode == :delete~ + [:venus, 100, 10, 225], +** Processing line: ~ [:earth, 120, 10, 365],~ - Inside source: true *** True Line Result - outputs.labels << [50, 640, 'Press \'i\' for insert mode!', 5, 0, 255, 255, 255, 255] if state.mode == :delete -** Processing line: ~ outputs.labels << [50, 680, 'Click to insert!', 5, 0, 255, 255, 255, 255] if state.mode == :insert~ + [:earth, 120, 10, 365], +** Processing line: ~ [:mars, 140, 8, 687],~ - Inside source: true *** True Line Result - outputs.labels << [50, 680, 'Click to insert!', 5, 0, 255, 255, 255, 255] if state.mode == :insert -** Processing line: ~ outputs.labels << [50, 640, 'Press \'d\' for delete mode!', 5, 0, 255, 255, 255, 255] if state.mode == :insert~ + [:mars, 140, 8, 687], +** Processing line: ~ [:jupiter, 280, 30, 365 * 11.8],~ - Inside source: true *** True Line Result - outputs.labels << [50, 640, 'Press \'d\' for delete mode!', 5, 0, 255, 255, 255, 255] if state.mode == :insert -** Processing line: ~ end~ + [:jupiter, 280, 30, 365 * 11.8], +** Processing line: ~ [:saturn, 350, 20, 365 * 29.5],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [:saturn, 350, 20, 365 * 29.5], +** Processing line: ~ [:uranus, 400, 15, 365 * 84],~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc~ + [:uranus, 400, 15, 365 * 84], +** Processing line: ~ [:neptune, 440, 15, 365 * 164.8],~ - Inside source: true *** True Line Result - def calc -** Processing line: ~ calcCurrentHover~ + [:neptune, 440, 15, 365 * 164.8], +** Processing line: ~ [:pluto, 480, 5, 365 * 247.8],~ - Inside source: true *** True Line Result - calcCurrentHover -** Processing line: ~ end~ + [:pluto, 480, 5, 365 * 247.8], +** Processing line: ~ ].map do |name, distance, size, year_in_days|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + ].map do |name, distance, size, year_in_days| +** Processing line: ~ args.state.new_entity(name) do |p|~ - Inside source: true *** True Line Result - -** Processing line: ~ def calcCurrentHover~ + args.state.new_entity(name) do |p| +** Processing line: ~ p.path = "sprites/#{name}.png"~ - Inside source: true *** True Line Result - def calcCurrentHover -** Processing line: ~ #This determines what tile the mouse is hovering (or last hovering) over~ + p.path = "sprites/#{name}.png" +** Processing line: ~ p.distance = distance * 0.7~ - Inside source: true *** True Line Result - #This determines what tile the mouse is hovering (or last hovering) over -** Processing line: ~ x = inputs.mouse.position.x~ + p.distance = distance * 0.7 +** Processing line: ~ p.s = size * 0.7~ - Inside source: true *** True Line Result - x = inputs.mouse.position.x -** Processing line: ~ y = inputs.mouse.position.y~ + p.s = size * 0.7 +** Processing line: ~ p.year_in_days = year_in_days~ - Inside source: true *** True Line Result - y = inputs.mouse.position.y -** Processing line: ~ m = (state.tileSize[1] / state.tileSize[0]) #slope~ + p.year_in_days = year_in_days +** Processing line: ~ end~ - Inside source: true *** True Line Result - m = (state.tileSize[1] / state.tileSize[0]) #slope -** Processing line: ~ state.tileCords.map do~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.tileCords.map do -** Processing line: ~ |val|~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - |val| -** Processing line: ~ #Conditions that makes runtime faster. Checks if the mouse click was between tile dimensions (rectangle collision)~ + +** Processing line: ~ args.state.ship ||= args.state.new_entity(:ship) do |s|~ - Inside source: true *** True Line Result - #Conditions that makes runtime faster. Checks if the mouse click was between tile dimensions (rectangle collision) -** Processing line: ~ next unless val[0] < x && x < val[0] + state.tileSize[0]~ + args.state.ship ||= args.state.new_entity(:ship) do |s| +** Processing line: ~ s.x = 1280 * rand~ - Inside source: true *** True Line Result - next unless val[0] < x && x < val[0] + state.tileSize[0] -** Processing line: ~ next unless val[1] < y && y < val[1] + state.tileSize[1]~ + s.x = 1280 * rand +** Processing line: ~ s.y = 720 * rand~ - Inside source: true *** True Line Result - next unless val[1] < y && y < val[1] + state.tileSize[1] -** Processing line: ~ next unless val[2] == true~ + s.y = 720 * rand +** Processing line: ~ s.angle = 0~ - Inside source: true *** True Line Result - next unless val[2] == true -** Processing line: ~ tempBool = false~ + s.angle = 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - tempBool = false -** Processing line: ~ if x == val[0] + (state.tileSize[0] / 2)~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - if x == val[0] + (state.tileSize[0] / 2) -** Processing line: ~ #The height of a diamond is the height of the diamond, so if x equals that exact point, it must be inside the diamond~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - #The height of a diamond is the height of the diamond, so if x equals that exact point, it must be inside the diamond -** Processing line: ~ tempBool = true~ + +** Processing line: ~ def to_sprite args, entity~ - Inside source: true *** True Line Result - tempBool = true -** Processing line: ~ elsif x < state.tileSize[0] / 2 + val[0]~ + def to_sprite args, entity +** Processing line: ~ x = 0~ - Inside source: true *** True Line Result - elsif x < state.tileSize[0] / 2 + val[0] -** Processing line: ~ #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the left half of diamond~ + x = 0 +** Processing line: ~ y = 0~ - Inside source: true *** True Line Result - #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the left half of diamond -** Processing line: ~ tempY1 = (m * (x - val[0])) + val[1] + (state.tileSize[1] / 2)~ + y = 0 +** Processing line: ~~ - Inside source: true *** True Line Result - tempY1 = (m * (x - val[0])) + val[1] + (state.tileSize[1] / 2) -** Processing line: ~ tempY2 = (-1 * m * (x - val[0])) + val[1] + (state.tileSize[1] / 2)~ + +** Processing line: ~ if entity.year_in_days~ - Inside source: true *** True Line Result - tempY2 = (-1 * m * (x - val[0])) + val[1] + (state.tileSize[1] / 2) -** Processing line: ~ #Checks to see if the mouse click y value is between those temp y values~ + if entity.year_in_days +** Processing line: ~ day = args.state.tick_count~ - Inside source: true *** True Line Result - #Checks to see if the mouse click y value is between those temp y values -** Processing line: ~ tempBool = true if y < tempY1 && y > tempY2~ + day = args.state.tick_count +** Processing line: ~ day_in_year = day % entity.year_in_days~ - Inside source: true *** True Line Result - tempBool = true if y < tempY1 && y > tempY2 -** Processing line: ~ elsif x > state.tileSize[0] / 2 + val[0]~ + day_in_year = day % entity.year_in_days +** Processing line: ~ entity.random_start_day ||= day_in_year * rand~ - Inside source: true *** True Line Result - elsif x > state.tileSize[0] / 2 + val[0] -** Processing line: ~ #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the right half of diamond~ + entity.random_start_day ||= day_in_year * rand +** Processing line: ~ percentage_of_year = day_in_year.fdiv(entity.year_in_days)~ - Inside source: true *** True Line Result - #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the right half of diamond -** Processing line: ~ tempY1 = (m * (x - val[0] - (state.tileSize[0] / 2))) + val[1]~ -- Inside source: true -*** True Line Result - tempY1 = (m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] -** Processing line: ~ tempY2 = (-1 * m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] + state.tileSize[1]~ + percentage_of_year = day_in_year.fdiv(entity.year_in_days) +** Processing line: ~ angle = 365 * percentage_of_year~ - Inside source: true *** True Line Result - tempY2 = (-1 * m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] + state.tileSize[1] -** Processing line: ~ #Checks to see if the mouse click y value is between those temp y values~ + angle = 365 * percentage_of_year +** Processing line: ~ x = angle.vector_x(entity.distance)~ - Inside source: true *** True Line Result - #Checks to see if the mouse click y value is between those temp y values -** Processing line: ~ tempBool = true if y > tempY1 && y < tempY2~ + x = angle.vector_x(entity.distance) +** Processing line: ~ y = angle.vector_y(entity.distance)~ - Inside source: true *** True Line Result - tempBool = true if y > tempY1 && y < tempY2 -** Processing line: ~ end~ + y = angle.vector_y(entity.distance) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if tempBool == true~ +** Processing line: ~ [640 + x - entity.s.half, 360 + y - entity.s.half, entity.s, entity.s, entity.path]~ - Inside source: true *** True Line Result - if tempBool == true -** Processing line: ~ state.currentSpriteLocation = val[5] #Current sprite location set to the order value~ + [640 + x - entity.s.half, 360 + y - entity.s.half, entity.s, entity.s, entity.path] +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.currentSpriteLocation = val[5] #Current sprite location set to the order value -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ def render args~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def render args +** Processing line: ~ args.outputs.solids << [0, 0, 1280, 720]~ - Inside source: true *** True Line Result - end + args.outputs.solids << [0, 0, 1280, 720] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def process_inputs~ +** Processing line: ~ args.outputs.sprites << args.state.stars.map do |x, y, _, r, g, b|~ - Inside source: true *** True Line Result - def process_inputs -** Processing line: ~ #Makes development much faster and easier~ + args.outputs.sprites << args.state.stars.map do |x, y, _, r, g, b| +** Processing line: ~ [x, y, 10, 10, 'sprites/star.png', 0, 100, r, g, b]~ - Inside source: true *** True Line Result - #Makes development much faster and easier -** Processing line: ~ if inputs.keyboard.key_up.r~ + [x, y, 10, 10, 'sprites/star.png', 0, 100, r, g, b] +** Processing line: ~ end~ - Inside source: true *** True Line Result - if inputs.keyboard.key_up.r -** Processing line: ~ $dragon.reset~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - $dragon.reset -** Processing line: ~ end~ + +** Processing line: ~ args.outputs.sprites << to_sprite(args, args.state.sun)~ - Inside source: true *** True Line Result - end -** Processing line: ~ checkTileSelected~ + args.outputs.sprites << to_sprite(args, args.state.sun) +** Processing line: ~ args.outputs.sprites << args.state.planets.map { |p| to_sprite args, p }~ - Inside source: true *** True Line Result - checkTileSelected -** Processing line: ~ switchModes~ + args.outputs.sprites << args.state.planets.map { |p| to_sprite args, p } +** Processing line: ~ args.outputs.sprites << [args.state.ship.x, args.state.ship.y, 20, 20, 'sprites/ship.png', args.state.ship.angle]~ - Inside source: true *** True Line Result - switchModes -** Processing line: ~ end~ + args.outputs.sprites << [args.state.ship.x, args.state.ship.y, 20, 20, 'sprites/ship.png', args.state.ship.angle] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def checkTileSelected~ +** Processing line: ~ def calc args~ - Inside source: true *** True Line Result - def checkTileSelected -** Processing line: ~ if inputs.mouse.down~ + def calc args +** Processing line: ~ args.state.stars = args.state.stars.map do |x, y, speed, r, g, b|~ - Inside source: true *** True Line Result - if inputs.mouse.down -** Processing line: ~ x = inputs.mouse.down.point.x~ + args.state.stars = args.state.stars.map do |x, y, speed, r, g, b| +** Processing line: ~ x += speed~ - Inside source: true *** True Line Result - x = inputs.mouse.down.point.x -** Processing line: ~ y = inputs.mouse.down.point.y~ + x += speed +** Processing line: ~ y += speed~ - Inside source: true *** True Line Result - y = inputs.mouse.down.point.y -** Processing line: ~ m = (state.tileSize[1] / state.tileSize[0]) #slope~ + y += speed +** Processing line: ~ x = 0 if x > 1280~ - Inside source: true *** True Line Result - m = (state.tileSize[1] / state.tileSize[0]) #slope -** Processing line: ~ state.tileCords.map do~ + x = 0 if x > 1280 +** Processing line: ~ y = 0 if y > 720~ - Inside source: true *** True Line Result - state.tileCords.map do -** Processing line: ~ |val|~ + y = 0 if y > 720 +** Processing line: ~ [x, y, speed, r, g, b]~ - Inside source: true *** True Line Result - |val| -** Processing line: ~ #Conditions that makes runtime faster. Checks if the mouse click was between tile dimensions (rectangle collision)~ + [x, y, speed, r, g, b] +** Processing line: ~ end~ - Inside source: true *** True Line Result - #Conditions that makes runtime faster. Checks if the mouse click was between tile dimensions (rectangle collision) -** Processing line: ~ next unless val[0] < x && x < val[0] + state.tileSize[0]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - next unless val[0] < x && x < val[0] + state.tileSize[0] -** Processing line: ~ next unless val[1] < y && y < val[1] + state.tileSize[1]~ + +** Processing line: ~ if args.state.tick_count == 0~ - Inside source: true *** True Line Result - next unless val[1] < y && y < val[1] + state.tileSize[1] -** Processing line: ~ next unless val[2] == true~ + if args.state.tick_count == 0 +** Processing line: ~ args.outputs.sounds << 'sounds/bg.ogg'~ - Inside source: true *** True Line Result - next unless val[2] == true -** Processing line: ~ tempBool = false~ + args.outputs.sounds << 'sounds/bg.ogg' +** Processing line: ~ end~ - Inside source: true *** True Line Result - tempBool = false -** Processing line: ~ if x == val[0] + (state.tileSize[0] / 2)~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - if x == val[0] + (state.tileSize[0] / 2) -** Processing line: ~ #The height of a diamond is the height of the diamond, so if x equals that exact point, it must be inside the diamond~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - #The height of a diamond is the height of the diamond, so if x equals that exact point, it must be inside the diamond -** Processing line: ~ tempBool = true~ + +** Processing line: ~ def process_inputs args~ - Inside source: true *** True Line Result - tempBool = true -** Processing line: ~ elsif x < state.tileSize[0] / 2 + val[0]~ + def process_inputs args +** Processing line: ~ if args.inputs.keyboard.left || args.inputs.controller_one.key_held.left~ - Inside source: true *** True Line Result - elsif x < state.tileSize[0] / 2 + val[0] -** Processing line: ~ #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the left half of diamond~ + if args.inputs.keyboard.left || args.inputs.controller_one.key_held.left +** Processing line: ~ args.state.ship.angle += 1~ - Inside source: true *** True Line Result - #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the left half of diamond -** Processing line: ~ tempY1 = (m * (x - val[0])) + val[1] + (state.tileSize[1] / 2)~ + args.state.ship.angle += 1 +** Processing line: ~ elsif args.inputs.keyboard.right || args.inputs.controller_one.key_held.right~ - Inside source: true *** True Line Result - tempY1 = (m * (x - val[0])) + val[1] + (state.tileSize[1] / 2) -** Processing line: ~ tempY2 = (-1 * m * (x - val[0])) + val[1] + (state.tileSize[1] / 2)~ + elsif args.inputs.keyboard.right || args.inputs.controller_one.key_held.right +** Processing line: ~ args.state.ship.angle -= 1~ - Inside source: true *** True Line Result - tempY2 = (-1 * m * (x - val[0])) + val[1] + (state.tileSize[1] / 2) -** Processing line: ~ #Checks to see if the mouse click y value is between those temp y values~ + args.state.ship.angle -= 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - #Checks to see if the mouse click y value is between those temp y values -** Processing line: ~ tempBool = true if y < tempY1 && y > tempY2~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - tempBool = true if y < tempY1 && y > tempY2 -** Processing line: ~ elsif x > state.tileSize[0] / 2 + val[0]~ + +** Processing line: ~ if args.inputs.keyboard.up || args.inputs.controller_one.key_held.a~ - Inside source: true *** True Line Result - elsif x > state.tileSize[0] / 2 + val[0] -** Processing line: ~ #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the right half of diamond~ + if args.inputs.keyboard.up || args.inputs.controller_one.key_held.a +** Processing line: ~ args.state.ship.x += args.state.ship.angle.x_vector~ - Inside source: true *** True Line Result - #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the right half of diamond -** Processing line: ~ tempY1 = (m * (x - val[0] - (state.tileSize[0] / 2))) + val[1]~ + args.state.ship.x += args.state.ship.angle.x_vector +** Processing line: ~ args.state.ship.y += args.state.ship.angle.y_vector~ - Inside source: true *** True Line Result - tempY1 = (m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] -** Processing line: ~ tempY2 = (-1 * m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] + state.tileSize[1]~ + args.state.ship.y += args.state.ship.angle.y_vector +** Processing line: ~ end~ - Inside source: true *** True Line Result - tempY2 = (-1 * m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] + state.tileSize[1] -** Processing line: ~ #Checks to see if the mouse click y value is between those temp y values~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - #Checks to see if the mouse click y value is between those temp y values -** Processing line: ~ tempBool = true if y > tempY1 && y < tempY2~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - tempBool = true if y > tempY1 && y < tempY2 -** Processing line: ~ end~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def tick args +** Processing line: ~ defaults args~ - Inside source: true *** True Line Result - -** Processing line: ~ if tempBool == true~ + defaults args +** Processing line: ~ render args~ - Inside source: true *** True Line Result - if tempBool == true -** Processing line: ~ if state.mode == :delete~ + render args +** Processing line: ~ calc args~ - Inside source: true *** True Line Result - if state.mode == :delete -** Processing line: ~ val[2] = false~ + calc args +** Processing line: ~ process_inputs args~ - Inside source: true *** True Line Result - val[2] = false -** Processing line: ~ state.tileGrid[val[5]][2] = false #Unnecessary because never used again but eh, I like consistency~ + process_inputs args +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.tileGrid[val[5]][2] = false #Unnecessary because never used again but eh, I like consistency -** Processing line: ~ state.tileCords[val[5]][2] = false #Ensures that the tile isn't rendered~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - state.tileCords[val[5]][2] = false #Ensures that the tile isn't rendered -** Processing line: ~ unless state.tileGrid[val[5]][0] == 0 #If tile is the left most tile in the row, right doesn't get rendered~ + +** Processing line: ~ def r~ - Inside source: true *** True Line Result - unless state.tileGrid[val[5]][0] == 0 #If tile is the left most tile in the row, right doesn't get rendered -** Processing line: ~ state.tileGrid[val[5] - 1][4] = true #Why the order value is amazing~ + def r +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - state.tileGrid[val[5] - 1][4] = true #Why the order value is amazing -** Processing line: ~ state.tileCords[val[5] - 1][4] = true~ + $gtk.reset +** Processing line: ~ end~ - Inside source: true *** True Line Result - state.tileCords[val[5] - 1][4] = true -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ unless state.tileGrid[val[5]][1] == state.quantity - 1 #Same but left side~ + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Arcade - Sound Golf - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Arcade - Sound Golf - 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_arcade/sound_golf/app/main.rb~ - Inside source: true *** True Line Result - unless state.tileGrid[val[5]][1] == state.quantity - 1 #Same but left side -** Processing line: ~ state.tileGrid[val[5] + state.quantity][3] = true~ + # ./samples/99_genre_arcade/sound_golf/app/main.rb +** Processing line: ~ =begin~ - Inside source: true *** True Line Result - state.tileGrid[val[5] + state.quantity][3] = true -** Processing line: ~ state.tileCords[val[5] + state.quantity][3] = true~ + =begin +** Processing line: ~~ - Inside source: true *** True Line Result - state.tileCords[val[5] + state.quantity][3] = true -** Processing line: ~ end~ + +** Processing line: ~ APIs Listing that haven't been encountered in previous sample apps:~ - Inside source: true *** True Line Result - end -** Processing line: ~ elsif state.mode == :insert~ + APIs Listing that haven't been encountered in previous sample apps: +** Processing line: ~~ - Inside source: true *** True Line Result - elsif state.mode == :insert -** Processing line: ~ #adds the current sprite value selected to tileCords. (changes from the -1 earlier)~ + +** Processing line: ~ - sample: Chooses random element from array.~ - Inside source: true *** True Line Result - #adds the current sprite value selected to tileCords. (changes from the -1 earlier) -** Processing line: ~ val[6] = rand(state.spriteSelection.length)~ + - sample: Chooses random element from array. +** Processing line: ~ In this sample app, the target note is set by taking a sample from the collection~ - Inside source: true *** True Line Result - val[6] = rand(state.spriteSelection.length) -** Processing line: ~ end~ + In this sample app, the target note is set by taking a sample from the collection +** Processing line: ~ of available notes.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + of available notes. +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ Reminders:~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + Reminders: +** Processing line: ~ - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual +** Processing line: ~ 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).~ - Inside source: true *** True Line Result - end + 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720). ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def switchModes~ +** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ - Inside source: true *** True Line Result - def switchModes -** Processing line: ~ #Switches between insert and delete modes~ + - args.state.new_entity: Used when we want to create a new object, like a sprite or button. +** Processing line: ~ For example, if we want to create a new button, we would declare it as a new entity and~ - Inside source: true *** True Line Result - #Switches between insert and delete modes -** Processing line: ~ if inputs.keyboard.key_up.i && state.mode == :delete~ + For example, if we want to create a new button, we would declare it as a new entity and +** Processing line: ~ then define its properties.~ - Inside source: true *** True Line Result - if inputs.keyboard.key_up.i && state.mode == :delete -** Processing line: ~ state.mode = :insert~ + then define its properties. +** Processing line: ~~ - Inside source: true *** True Line Result - state.mode = :insert -** Processing line: ~ inputs.keyboard.clear~ + +** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ - Inside source: true *** True Line Result - inputs.keyboard.clear -** Processing line: ~ elsif inputs.keyboard.key_up.d && state.mode == :insert~ + - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ - Inside source: true *** True Line Result - elsif inputs.keyboard.key_up.d && state.mode == :insert -** Processing line: ~ state.mode = :delete~ + as Ruby code, and the placeholder is replaced with its corresponding value or result. +** Processing line: ~~ - Inside source: true *** True Line Result - state.mode = :delete -** Processing line: ~ inputs.keyboard.clear~ + +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ - Inside source: true *** True Line Result - inputs.keyboard.clear -** Processing line: ~ end~ + - args.outputs.labels: An array. The values generate a label. +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ - Inside source: true *** True Line Result - end + For more information about labels, go to mygame/documentation/02-labels.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ end~ +** Processing line: ~ - find_all: Finds all elements from a collection that meet a certain requirements (and excludes the ones that don't).~ - Inside source: true *** True Line Result - end + - find_all: Finds all elements from a collection that meet a certain requirements (and excludes the ones that don't). ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ $isometric = Isometric.new~ +** Processing line: ~ - first: Returns the first element of an array.~ - Inside source: true *** True Line Result - $isometric = Isometric.new + - first: Returns the first element of an array. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ -- Inside source: true -*** True Line Result - def tick args -** Processing line: ~ $isometric.grid = args.grid~ +** Processing line: ~ - inside_rect: Returns true or false depending on if the point is inside the rect.~ - Inside source: true *** True Line Result - $isometric.grid = args.grid -** Processing line: ~ $isometric.inputs = args.inputs~ + - inside_rect: Returns true or false depending on if the point is inside the rect. +** Processing line: ~~ - Inside source: true *** True Line Result - $isometric.inputs = args.inputs -** Processing line: ~ $isometric.state = args.state~ + +** Processing line: ~ - to_sym: Returns symbol corresponding to string. Will create a symbol if it does~ - Inside source: true *** True Line Result - $isometric.state = args.state -** Processing line: ~ $isometric.outputs = args.outputs~ + - to_sym: Returns symbol corresponding to string. Will create a symbol if it does +** Processing line: ~ not already exist.~ - Inside source: true *** True Line Result - $isometric.outputs = args.outputs -** Processing line: ~ $isometric.tick~ + not already exist. +** Processing line: ~~ - Inside source: true *** True Line Result - $isometric.tick -** Processing line: ~ end~ + +** Processing line: ~ =end~ - Inside source: true *** True Line Result - end + =end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. +** Processing line: ~ # This sample app allows users to test their musical skills by matching the piano sound that plays in each~ +- Inside source: true *** True Line Result -#+end_src + # This sample app allows users to test their musical skills by matching the piano sound that plays in each +** Processing line: ~ # level to the correct note.~ +- Inside source: true +*** True Line Result + # level to the correct note. ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* Rpg Topdown - Topdown Starting Point - main.rb~ -- Header detected. +** Processing line: ~ # Runs all the methods necessary for the game to function properly.~ +- Inside source: true *** True Line Result - + # Runs all the methods necessary for the game to function properly. +** Processing line: ~ def tick args~ +- Inside source: true *** True Line Result -* Rpg Topdown - Topdown Starting Point - main.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + 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 -#+begin_src ruby -** Processing line: ~ # ./samples/99_genre_rpg_topdown/topdown_starting_point/app/main.rb~ + render args +** Processing line: ~ calc args~ - Inside source: true *** True Line Result - # ./samples/99_genre_rpg_topdown/topdown_starting_point/app/main.rb -** Processing line: ~ =begin~ + calc args +** Processing line: ~ input_mouse args~ - Inside source: true *** True Line Result - =begin -** Processing line: ~~ + input_mouse args +** Processing line: ~ tick_instructions args, "Sample app shows how to play sounds. args.outputs.sounds << \"path_to_wav.wav\""~ - Inside source: true *** True Line Result - -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ + tick_instructions args, "Sample app shows how to play sounds. args.outputs.sounds << \"path_to_wav.wav\"" +** Processing line: ~ end~ - Inside source: true *** True Line Result - APIs listing that haven't been encountered in previous sample apps: + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - reverse: Returns a new string with the characters from original string in reverse order.~ +** Processing line: ~ # Sets default values and creates empty collections~ - Inside source: true *** True Line Result - - reverse: Returns a new string with the characters from original string in reverse order. -** Processing line: ~ For example, the command~ + # Sets default values and creates empty collections +** Processing line: ~ # Initialization happens in the first frame only~ - Inside source: true *** True Line Result - For example, the command -** Processing line: ~ "dragonruby".reverse~ + # Initialization happens in the first frame only +** Processing line: ~ def defaults args~ - Inside source: true *** True Line Result - "dragonruby".reverse -** Processing line: ~ would return the string~ + def defaults args +** Processing line: ~ args.state.notes ||= []~ - Inside source: true *** True Line Result - would return the string -** Processing line: ~ "yburnogard".~ + args.state.notes ||= [] +** Processing line: ~ args.state.click_feedbacks ||= []~ - Inside source: true *** True Line Result - "yburnogard". -** Processing line: ~ Reverse is not only limited to strings, but can be applied to arrays and other collections.~ + args.state.click_feedbacks ||= [] +** Processing line: ~ args.state.current_level ||= 1~ - Inside source: true *** True Line Result - Reverse is not only limited to strings, but can be applied to arrays and other collections. -** Processing line: ~~ + args.state.current_level ||= 1 +** Processing line: ~ args.state.times_wrong ||= 0 # when game starts, user hasn't guessed wrong yet~ - Inside source: true *** True Line Result - -** Processing line: ~ Reminders:~ + args.state.times_wrong ||= 0 # when game starts, user hasn't guessed wrong yet +** Processing line: ~ end~ - Inside source: true *** True Line Result - Reminders: + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect.~ +** Processing line: ~ # Uses a label to display current level, and shows the score~ - Inside source: true *** True Line Result - - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect. -** Processing line: ~~ + # Uses a label to display current level, and shows the score +** Processing line: ~ # Creates a button to play the sample note, and displays the available notes that could be a potential match~ - Inside source: true *** True Line Result - -** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ + # Creates a button to play the sample note, and displays the available notes that could be a potential match +** Processing line: ~ def render args~ - Inside source: true *** True Line Result - - args.outputs.labels: An array. The values generate a label. -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ + def render args +** Processing line: ~~ - Inside source: true *** True Line Result - The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ + +** Processing line: ~ # grid.w_half positions the label in the horizontal center of the screen.~ - Inside source: true *** True Line Result - For more information about labels, go to mygame/documentation/02-labels.md. + # grid.w_half positions the label in the horizontal center of the screen. +** Processing line: ~ args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(40), "Hole #{args.state.current_level} of 9", 0, 1, 0, 0, 0]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(40), "Hole #{args.state.current_level} of 9", 0, 1, 0, 0, 0] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ =end~ +** Processing line: ~ render_score args # shows score on screen~ - Inside source: true *** True Line Result - =end + render_score args # shows score on screen ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # This code shows a maze and uses input from the keyboard to move the user around the screen.~ +** Processing line: ~ args.state.play_again_button ||= { x: 560, y: args.grid.h * 3 / 4 - 40, w: 160, h: 60, label: 'again' } # array definition, text/title~ - Inside source: true *** True Line Result - # This code shows a maze and uses input from the keyboard to move the user around the screen. -** Processing line: ~ # The objective is to reach the goal.~ + args.state.play_again_button ||= { x: 560, y: args.grid.h * 3 / 4 - 40, w: 160, h: 60, label: 'again' } # array definition, text/title +** Processing line: ~ args.state.play_note_button ||= { x: 560, y: args.grid.h * 3 / 4 - 40, w: 160, h: 60, label: 'play' }~ - Inside source: true *** True Line Result - # The objective is to reach the goal. + args.state.play_note_button ||= { x: 560, y: args.grid.h * 3 / 4 - 40, w: 160, h: 60, label: 'play' } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets values of tile size and player's movement speed~ +** Processing line: ~ if args.state.game_over # if game is over, a "play again" button is shown~ - Inside source: true *** True Line Result - # Sets values of tile size and player's movement speed -** Processing line: ~ # Also creates tile or box for player and generates map~ + if args.state.game_over # if game is over, a "play again" button is shown +** Processing line: ~ # Calculations ensure that Play Again label is displayed in center of border~ - Inside source: true *** True Line Result - # Also creates tile or box for player and generates map -** Processing line: ~ def tick args~ + # Calculations ensure that Play Again label is displayed in center of border +** Processing line: ~ # Remove calculations from y parameters and see what happens to border and label placement~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ args.state.tile_size = 80~ + # Remove calculations from y parameters and see what happens to border and label placement +** Processing line: ~ args.outputs.labels << [args.grid.w_half, args.grid.h * 3 / 4, "Play Again", 0, 1, 0, 0, 0] # outputs label~ - Inside source: true *** True Line Result - args.state.tile_size = 80 -** Processing line: ~ args.state.player_speed = 4~ + args.outputs.labels << [args.grid.w_half, args.grid.h * 3 / 4, "Play Again", 0, 1, 0, 0, 0] # outputs label +** Processing line: ~ args.outputs.borders << args.state.play_again_button # outputs border~ - Inside source: true *** True Line Result - args.state.player_speed = 4 -** Processing line: ~ args.state.player ||= tile(args, 7, 3, 0, 128, 180)~ + args.outputs.borders << args.state.play_again_button # outputs border +** Processing line: ~ else # otherwise, if game is not over~ - Inside source: true *** True Line Result - args.state.player ||= tile(args, 7, 3, 0, 128, 180) -** Processing line: ~ generate_map args~ + else # otherwise, if game is not over +** Processing line: ~ # Calculations ensure that label appears in center of border~ - Inside source: true *** True Line Result - generate_map args -** Processing line: ~~ + # Calculations ensure that label appears in center of border +** Processing line: ~ args.outputs.labels << [args.grid.w_half, args.grid.h * 3 / 4, "Play Note ##{args.state.current_level}", 0, 1, 0, 0, 0] # outputs label~ - Inside source: true *** True Line Result - -** Processing line: ~ # Adds walls, goal, and player to args.outputs.solids so they appear on screen~ + args.outputs.labels << [args.grid.w_half, args.grid.h * 3 / 4, "Play Note ##{args.state.current_level}", 0, 1, 0, 0, 0] # outputs label +** Processing line: ~ args.outputs.borders << args.state.play_note_button # outputs border~ - Inside source: true *** True Line Result - # Adds walls, goal, and player to args.outputs.solids so they appear on screen -** Processing line: ~ args.outputs.solids << args.state.walls~ + args.outputs.borders << args.state.play_note_button # outputs border +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.outputs.solids << args.state.walls -** Processing line: ~ args.outputs.solids << args.state.goal~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.outputs.solids << args.state.goal -** Processing line: ~ args.outputs.solids << args.state.player~ + +** Processing line: ~ return if args.state.game_over # return if game is over~ - Inside source: true *** True Line Result - args.outputs.solids << args.state.player + return if args.state.game_over # return if game is over ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # If player's box intersects with goal, a label is output onto the screen~ +** Processing line: ~ args.outputs.labels << [args.grid.w_half, 400, "I think the note is a(n)...", 0, 1, 0, 0, 0] # outputs label~ - Inside source: true *** True Line Result - # If player's box intersects with goal, a label is output onto the screen -** Processing line: ~ if args.state.player.intersect_rect? args.state.goal~ + args.outputs.labels << [args.grid.w_half, 400, "I think the note is a(n)...", 0, 1, 0, 0, 0] # outputs label +** Processing line: ~~ - Inside source: true *** True Line Result - if args.state.player.intersect_rect? args.state.goal -** Processing line: ~ args.outputs.labels << [30, 720 - 30, "You're a wizard Harry!!"] # 30 pixels lower than top of screen~ + +** Processing line: ~ # Shows all of the available notes that can be potential matches.~ - Inside source: true *** True Line Result - args.outputs.labels << [30, 720 - 30, "You're a wizard Harry!!"] # 30 pixels lower than top of screen -** Processing line: ~ end~ + # Shows all of the available notes that can be potential matches. +** Processing line: ~ available_notes.each_with_index do |note, i|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + available_notes.each_with_index do |note, i| +** Processing line: ~ args.state.notes[i] ||= piano_button(args, note, i + 1) # calls piano_button method on each note (creates label and border)~ - 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~ + args.state.notes[i] ||= piano_button(args, note, i + 1) # calls piano_button method on each note (creates label and border) +** Processing line: ~ args.outputs.labels << args.state.notes[i].label # outputs note on screen with a label and a border~ - 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~ + args.outputs.labels << args.state.notes[i].label # outputs note on screen with a label and a border +** Processing line: ~ args.outputs.borders << args.state.notes[i].border~ - 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~ + args.outputs.borders << args.state.notes[i].border +** Processing line: ~ end~ - 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~ + end +** Processing line: ~~ - 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: ~ # Shows whether or not the user is correct by filling the screen with either red or green~ +- Inside source: true +*** True Line Result + # Shows whether or not the user is correct by filling the screen with either red or green +** Processing line: ~ args.outputs.solids << args.state.click_feedbacks.map { |c| c.solid }~ +- Inside source: true +*** True Line Result + args.outputs.solids << args.state.click_feedbacks.map { |c| c.solid } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -89763,34 +93668,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Sets position, size, and color of the tile~ +** Processing line: ~ # Shows the score (number of times the user guesses wrong) onto the screen using labels.~ - Inside source: true *** True Line Result - # Sets position, size, and color of the tile -** Processing line: ~ def tile args, x, y, *color~ + # Shows the score (number of times the user guesses wrong) onto the screen using labels. +** Processing line: ~ def render_score args~ - 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~ + def render_score args +** Processing line: ~ if args.state.times_wrong == 0 # if the user has guessed wrong zero times, the score is par~ - 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~ + if args.state.times_wrong == 0 # if the user has guessed wrong zero times, the score is par +** Processing line: ~ args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: PAR", 0, 1, 0, 0, 0]~ - 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,~ + args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: PAR", 0, 1, 0, 0, 0] +** Processing line: ~ else # otherwise, number of times the user has guessed wrong is shown~ - Inside source: true *** True Line Result - args.state.tile_size, -** Processing line: ~ args.state.tile_size,~ + else # otherwise, number of times the user has guessed wrong is shown +** Processing line: ~ args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: +#{args.state.times_wrong}", 0, 1, 0, 0, 0] # shows score using string interpolation~ - Inside source: true *** True Line Result - args.state.tile_size, -** Processing line: ~ *color]~ + args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: +#{args.state.times_wrong}", 0, 1, 0, 0, 0] # shows score using string interpolation +** Processing line: ~ end~ - Inside source: true *** True Line Result - *color] + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -89799,206 +93704,206 @@ Follows is a source code listing for all files that have been open sourced. This - 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~ +** Processing line: ~ # Sets the target note for the level and performs calculations on click_feedbacks.~ - Inside source: true *** True Line Result - def generate_map args -** Processing line: ~ return if args.state.area~ + # Sets the target note for the level and performs calculations on click_feedbacks. +** Processing line: ~ def calc args~ - Inside source: true *** True Line Result - return if args.state.area -** Processing line: ~~ + def calc args +** Processing line: ~ args.state.target_note ||= available_notes.sample # chooses a note from available_notes collection as target note~ - Inside source: true *** True Line Result - -** Processing line: ~ # Creates the area of the map. There are 9 rows running horizontally across the screen~ + args.state.target_note ||= available_notes.sample # chooses a note from available_notes collection as target note +** Processing line: ~ args.state.click_feedbacks.each { |c| c.solid[-1] -= 5 } # remove this line and solid color will remain on screen indefinitely~ - 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~ + args.state.click_feedbacks.each { |c| c.solid[-1] -= 5 } # remove this line and solid color will remain on screen indefinitely +** Processing line: ~ # comment this line out and the solid color will keep flashing on screen instead of being removed from click_feedbacks collection~ - 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~ + # comment this line out and the solid color will keep flashing on screen instead of being removed from click_feedbacks collection +** Processing line: ~ args.state.click_feedbacks.reject! { |c| c.solid[-1] <= 0 }~ - 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.~ + args.state.click_feedbacks.reject! { |c| c.solid[-1] <= 0 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - # for the player to move in. -** Processing line: ~ args.state.area = [~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.state.area = [ -** Processing line: ~ [1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1,],~ + +** Processing line: ~ # Uses input from the user to play the target note, as well as the other notes that could be a potential match.~ - Inside source: true *** True Line Result - [1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1,], -** Processing line: ~ [1, 1, 1, 2, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1,], # the "2" represents the goal~ + # Uses input from the user to play the target note, as well as the other notes that could be a potential match. +** Processing line: ~ def input_mouse args~ - Inside source: true *** True Line Result - [1, 1, 1, 2, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1,], # the "2" represents the goal -** Processing line: ~ [1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,],~ + def input_mouse args +** Processing line: ~ return unless args.inputs.mouse.click # return unless the mouse is clicked~ - Inside source: true *** True Line Result - [1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,], -** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,],~ + return unless args.inputs.mouse.click # return unless the mouse is clicked +** Processing line: ~~ - Inside source: true *** True Line Result - [1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,], -** Processing line: ~ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],~ + +** Processing line: ~ # finds button that was clicked by user~ - Inside source: true *** True Line Result - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,], -** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,],~ + # finds button that was clicked by user +** Processing line: ~ button_clicked = args.outputs.borders.find_all do |b| # go through borders collection to find all borders that meet requirements~ - Inside source: true *** True Line Result - [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,], -** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,],~ + button_clicked = args.outputs.borders.find_all do |b| # go through borders collection to find all borders that meet requirements +** Processing line: ~ args.inputs.mouse.click.point.inside_rect? b # find button border that mouse was clicked inside of~ - Inside source: true *** True Line Result - [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,], -** Processing line: ~ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,],~ + args.inputs.mouse.click.point.inside_rect? b # find button border that mouse was clicked inside of +** Processing line: ~ end.find_all { |b| b.is_a? Hash }.first # reject, return first element~ - 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 ],~ + end.find_all { |b| b.is_a? Hash }.first # reject, return first element +** Processing line: ~~ - 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~ + +** Processing line: ~ return unless button_clicked # return unless button_clicked as a value (a button was clicked)~ - Inside source: true *** True Line Result - ].reverse # reverses the order of the area collection + return unless button_clicked # return unless button_clicked as a value (a button was clicked) ** 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~ +** Processing line: ~ queue_click_feedback args, # calls queue_click_feedback method on the button that was clicked~ - 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.~ + queue_click_feedback args, # calls queue_click_feedback method on the button that was clicked +** Processing line: ~ button_clicked.x,~ - Inside source: true *** True Line Result - # on the screen in the game. If we did not reverse, the map would appear inverted. -** Processing line: ~~ + button_clicked.x, +** Processing line: ~ button_clicked.y,~ - Inside source: true *** True Line Result - -** Processing line: ~ #The wall starts off with no tiles.~ + button_clicked.y, +** Processing line: ~ button_clicked.w,~ - Inside source: true *** True Line Result - #The wall starts off with no tiles. -** Processing line: ~ args.state.walls = []~ + button_clicked.w, +** Processing line: ~ button_clicked.h,~ - Inside source: true *** True Line Result - args.state.walls = [] -** Processing line: ~~ + button_clicked.h, +** Processing line: ~ 150, 100, 200 # sets color of button to shade of purple~ - Inside source: true *** True Line Result - -** Processing line: ~ # If v is 1, a green tile is added to args.state.walls.~ + 150, 100, 200 # sets color of button to shade of purple +** Processing line: ~~ - 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.~ + +** Processing line: ~ if button_clicked[:label] == 'play' # if "play note" button is pressed~ - 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|~ + if button_clicked[:label] == 'play' # if "play note" button is pressed +** Processing line: ~ args.outputs.sounds << "sounds/#{args.state.target_note}.wav" # sound of target note is output~ - Inside source: true *** True Line Result - args.state.area.map_2d do |y, x, v| -** Processing line: ~ if v == 1~ + args.outputs.sounds << "sounds/#{args.state.target_note}.wav" # sound of target note is output +** Processing line: ~ elsif button_clicked[:label] == 'again' # if "play game again" button is pressed~ - Inside source: true *** True Line Result - if v == 1 -** Processing line: ~ args.state.walls << tile(args, x, y, 0, 255, 0) # green tile~ + elsif button_clicked[:label] == 'again' # if "play game again" button is pressed +** Processing line: ~ args.state.target_note = nil # no target note~ - Inside source: true *** True Line Result - args.state.walls << tile(args, x, y, 0, 255, 0) # green tile -** Processing line: ~ elsif v == 2 # notice there is only one "2" above because there is only one single goal~ + args.state.target_note = nil # no target note +** Processing line: ~ args.state.current_level = 1 # starts at level 1 again~ - Inside source: true *** True Line Result - elsif v == 2 # notice there is only one "2" above because there is only one single goal -** Processing line: ~ args.state.goal = tile(args, x, y, 0, 0, 0) # black tile~ + args.state.current_level = 1 # starts at level 1 again +** Processing line: ~ args.state.times_wrong = 0 # starts off with 0 wrong guesses~ - Inside source: true *** True Line Result - args.state.goal = tile(args, x, y, 0, 0, 0) # black tile -** Processing line: ~ end~ + args.state.times_wrong = 0 # starts off with 0 wrong guesses +** Processing line: ~ args.state.game_over = false # the game is not over (because it has just been restarted)~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + args.state.game_over = false # the game is not over (because it has just been restarted) +** Processing line: ~ else # otherwise if neither of those buttons were pressed~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + else # otherwise if neither of those buttons were pressed +** Processing line: ~ args.outputs.sounds << "sounds/#{button_clicked[:label]}.wav" # sound of clicked note is played~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.outputs.sounds << "sounds/#{button_clicked[:label]}.wav" # sound of clicked note is played +** Processing line: ~ if button_clicked[:label] == args.state.target_note # if clicked note is target note~ - Inside source: true *** True Line Result - -** Processing line: ~ # Allows the player to move their box around the screen~ + if button_clicked[:label] == args.state.target_note # if clicked note is target note +** Processing line: ~ args.state.target_note = nil # target note is emptied~ - Inside source: true *** True Line Result - # Allows the player to move their box around the screen -** Processing line: ~ def move_player args, *vector~ + args.state.target_note = nil # target note is emptied +** Processing line: ~~ - 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~ + +** Processing line: ~ if args.state.current_level < 9 # if game hasn't reached level 9~ - Inside source: true *** True Line Result - box = args.state.player.shift_rect(vector) # box is able to move at an angle -** Processing line: ~~ + if args.state.current_level < 9 # if game hasn't reached level 9 +** Processing line: ~ args.state.current_level += 1 # game goes to next level~ - 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~ + args.state.current_level += 1 # game goes to next level +** Processing line: ~ else # otherwise, if game has reached level 9~ - 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~ + else # otherwise, if game has reached level 9 +** Processing line: ~ args.state.game_over = true # the game is over~ - Inside source: true *** True Line Result - return if args.state.walls -** Processing line: ~ .any_intersect_rect?(box)~ + args.state.game_over = true # the game is over +** Processing line: ~ end~ - Inside source: true *** True Line Result - .any_intersect_rect?(box) + end ** 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~ +** Processing line: ~ queue_click_feedback args, 0, 0, args.grid.w, args.grid.h, 100, 200, 100 # green shown if user guesses correctly~ - 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 =~ + queue_click_feedback args, 0, 0, args.grid.w, args.grid.h, 100, 200, 100 # green shown if user guesses correctly +** Processing line: ~ else # otherwise, if clicked note is not target note~ - Inside source: true *** True Line Result - args.state.player = -** Processing line: ~ args.state.player~ + else # otherwise, if clicked note is not target note +** Processing line: ~ args.state.times_wrong += 1 # increments times user guessed wrong~ - 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~ + args.state.times_wrong += 1 # increments times user guessed wrong +** Processing line: ~ queue_click_feedback args, 0, 0, args.grid.w, args.grid.h, 200, 100, 100 # red shown is user guesses wrong~ - 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~ + queue_click_feedback args, 0, 0, args.grid.w, args.grid.h, 200, 100, 100 # red shown is user guesses wrong +** Processing line: ~ end~ - Inside source: true *** True Line Result - vector.y * args.state.player_speed) # the box will move extremely slow + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -90007,1466 +93912,1458 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. -*** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* args.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* args.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/args.rb~ -- Inside source: true -*** True Line Result - # ./dragon/args.rb -** Processing line: ~ # coding: utf-8~ +** Processing line: ~ # Creates a collection of all of the available notes as symbols~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + # Creates a collection of all of the available notes as symbols +** Processing line: ~ def available_notes~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + def available_notes +** Processing line: ~ [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4]~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # args.rb has been released under MIT (*only this file*).~ + [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4] +** Processing line: ~ end~ - Inside source: true *** True Line Result - # args.rb has been released under MIT (*only this file*). + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ # Creates buttons for each note, and sets a label (the note's name) and border for each note's button.~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ # This class is the one you'll interact with the most. It's~ + # Creates buttons for each note, and sets a label (the note's name) and border for each note's button. +** Processing line: ~ def piano_button args, note, position~ - Inside source: true *** True Line Result - # This class is the one you'll interact with the most. It's -** Processing line: ~ # constructed by the DragonRuby Runtime and is provided to you on~ + def piano_button args, note, position +** Processing line: ~ args.state.new_entity(:button) do |b| # declares button as new entity~ - Inside source: true *** True Line Result - # constructed by the DragonRuby Runtime and is provided to you on -** Processing line: ~ # each tick.~ + args.state.new_entity(:button) do |b| # declares button as new entity +** Processing line: ~ b.label = [460 + 40.mult(position), args.grid.h * 0.4, "#{note}", 0, 1, 0, 0, 0] # label definition~ - Inside source: true *** True Line Result - # each tick. -** Processing line: ~ class Args~ + b.label = [460 + 40.mult(position), args.grid.h * 0.4, "#{note}", 0, 1, 0, 0, 0] # label definition +** Processing line: ~ b.border = { x: 460 + 40.mult(position) - 20, y: args.grid.h * 0.4 - 32, w: 40, h: 40, label: note } # border definition, text/title; 20 subtracted so label is in center of border~ - Inside source: true *** True Line Result - class Args -** Processing line: ~ include ArgsDeprecated~ + b.border = { x: 460 + 40.mult(position) - 20, y: args.grid.h * 0.4 - 32, w: 40, h: 40, label: note } # border definition, text/title; 20 subtracted so label is in center of border +** Processing line: ~ end~ - Inside source: true *** True Line Result - include ArgsDeprecated -** Processing line: ~ include Serialize~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - include Serialize + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Contains information related to input devices and input events.~ +** Processing line: ~ # Color of click feedback changes depending on what button was clicked, and whether the guess is right or wrong~ - Inside source: true *** True Line Result - # Contains information related to input devices and input events. -** Processing line: ~ #~ + # Color of click feedback changes depending on what button was clicked, and whether the guess is right or wrong +** Processing line: ~ # If a button is clicked, the inside of button is purple (see input_mouse method)~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Inputs]~ + # If a button is clicked, the inside of button is purple (see input_mouse method) +** Processing line: ~ # If correct note is clicked, screen turns green~ - Inside source: true *** True Line Result - # @return [Inputs] -** Processing line: ~ attr_accessor :inputs~ + # If correct note is clicked, screen turns green +** Processing line: ~ # If incorrect note is clicked, screen turns red (again, see input_mouse method)~ - Inside source: true *** True Line Result - attr_accessor :inputs -** Processing line: ~~ + # If incorrect note is clicked, screen turns red (again, see input_mouse method) +** Processing line: ~ def queue_click_feedback args, x, y, w, h, *color~ - Inside source: true *** True Line Result - -** Processing line: ~ # Contains the means to interact with output devices such as the screen.~ + def queue_click_feedback args, x, y, w, h, *color +** Processing line: ~ args.state.click_feedbacks << args.state.new_entity(:click_feedback) do |c| # declares feedback as new entity~ - Inside source: true *** True Line Result - # Contains the means to interact with output devices such as the screen. -** Processing line: ~ #~ + args.state.click_feedbacks << args.state.new_entity(:click_feedback) do |c| # declares feedback as new entity +** Processing line: ~ c.solid = [x, y, w, h, *color, 255] # sets color~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Outputs]~ + c.solid = [x, y, w, h, *color, 255] # sets color +** Processing line: ~ end~ - Inside source: true *** True Line Result - # @return [Outputs] -** Processing line: ~ attr_accessor :outputs~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_accessor :outputs + end ** 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: ~ #~ +** Processing line: ~ def tick_instructions args, text, y = 715~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Hash]~ + def tick_instructions args, text, y = 715 +** Processing line: ~ return if args.state.key_event_occurred~ - Inside source: true *** True Line Result - # @return [Hash] -** Processing line: ~ attr_accessor :audio~ + return if args.state.key_event_occurred +** Processing line: ~ if args.inputs.mouse.click ||~ - Inside source: true *** True Line Result - attr_accessor :audio -** Processing line: ~~ + if args.inputs.mouse.click || +** Processing line: ~ args.inputs.keyboard.directional_vector ||~ - Inside source: true *** True Line Result - -** Processing line: ~ # Contains display size information to assist in positioning things on the screen.~ + args.inputs.keyboard.directional_vector || +** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ - Inside source: true *** True Line Result - # Contains display size information to assist in positioning things on the screen. -** Processing line: ~ #~ + args.inputs.keyboard.key_down.enter || +** Processing line: ~ args.inputs.keyboard.key_down.escape~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Grid]~ + args.inputs.keyboard.key_down.escape +** Processing line: ~ args.state.key_event_occurred = true~ - Inside source: true *** True Line Result - # @return [Grid] -** Processing line: ~ attr_accessor :grid~ + args.state.key_event_occurred = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_accessor :grid + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Provides access to game play recording facilities within Game Toolkit.~ +** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ - Inside source: true *** True Line Result - # Provides access to game play recording facilities within Game Toolkit. -** 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~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Recording]~ + 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 - # @return [Recording] -** Processing line: ~ attr_accessor :recording~ + 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 - attr_accessor :recording + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Gives you access to geometry related functions.~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - # Gives you access to geometry related functions. -** Processing line: ~ #~ +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Arcade - Twinstick - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Arcade - Twinstick - 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_arcade/twinstick/app/main.rb~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Geometry]~ + # ./samples/99_genre_arcade/twinstick/app/main.rb +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - # @return [Geometry] -** Processing line: ~ attr_accessor :geometry~ + def tick args +** Processing line: ~ 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}~ - Inside source: true *** True Line Result - attr_accessor :geometry -** Processing line: ~~ + 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} +** Processing line: ~ args.state.enemies ||= []~ - Inside source: true *** True Line Result - -** Processing line: ~ # This is where you'll put state associated with your video game.~ + args.state.enemies ||= [] +** Processing line: ~ args.state.player_bullets ||= []~ - Inside source: true *** True Line Result - # This is where you'll put state associated with your video game. -** Processing line: ~ #~ + args.state.player_bullets ||= [] +** Processing line: ~ args.state.tick_count ||= -1~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [OpenEntity]~ + args.state.tick_count ||= -1 +** Processing line: ~ args.state.tick_count += 1~ - Inside source: true *** True Line Result - # @return [OpenEntity] -** Processing line: ~ attr_accessor :state~ + args.state.tick_count += 1 +** Processing line: ~ spawn_enemies args~ - Inside source: true *** True Line Result - attr_accessor :state -** Processing line: ~~ + spawn_enemies args +** Processing line: ~ kill_enemies args~ - Inside source: true *** True Line Result - -** Processing line: ~ # Gives you access to the top level DragonRuby runtime.~ + kill_enemies args +** Processing line: ~ move_enemies args~ - Inside source: true *** True Line Result - # Gives you access to the top level DragonRuby runtime. -** Processing line: ~ #~ + move_enemies args +** Processing line: ~ move_bullets args~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Runtime]~ + move_bullets args +** Processing line: ~ move_player args~ - Inside source: true *** True Line Result - # @return [Runtime] -** Processing line: ~ attr_accessor :runtime~ + move_player args +** Processing line: ~ fire_player args~ - Inside source: true *** True Line Result - attr_accessor :runtime -** Processing line: ~ alias_method :gtk, :runtime~ + fire_player args +** Processing line: ~ args.state.player[:r] = args.state.player[:g] = args.state.player[:b] = (args.state.player[:health] * 25.5).clamp(0, 255)~ - Inside source: true *** True Line Result - alias_method :gtk, :runtime -** Processing line: ~~ + args.state.player[:r] = args.state.player[:g] = args.state.player[:b] = (args.state.player[:health] * 25.5).clamp(0, 255) +** Processing line: ~ label_color = args.state.player[:health] <= 5 ? 255 : 0~ - Inside source: true *** True Line Result - -** Processing line: ~ attr_accessor :passes~ + label_color = args.state.player[:health] <= 5 ? 255 : 0 +** Processing line: ~ args.outputs.labels << [~ - Inside source: true *** True Line Result - attr_accessor :passes -** Processing line: ~~ + args.outputs.labels << [ +** Processing line: ~ {~ - Inside source: true *** True Line Result - -** Processing line: ~ attr_accessor :wizards~ + { +** Processing line: ~ x: args.state.player.x + 40, y: args.state.player.y + 60, alignment_enum: 1, text: "#{args.state.player[:health]} HP",~ - Inside source: true *** True Line Result - attr_accessor :wizards -** Processing line: ~~ + x: args.state.player.x + 40, y: args.state.player.y + 60, alignment_enum: 1, text: "#{args.state.player[:health]} HP", +** Processing line: ~ r: label_color, g: label_color, b: label_color~ - Inside source: true *** True Line Result - -** Processing line: ~ attr_accessor :layout~ + r: label_color, g: label_color, b: label_color +** Processing line: ~ }, {~ - Inside source: true *** True Line Result - attr_accessor :layout -** Processing line: ~~ + }, { +** Processing line: ~ x: args.state.player.x + 40, y: args.state.player.y + 40, alignment_enum: 1, text: "#{args.state.player[:score]} PTS",~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize runtime, recording~ + x: args.state.player.x + 40, y: args.state.player.y + 40, alignment_enum: 1, text: "#{args.state.player[:score]} PTS", +** Processing line: ~ r: label_color, g: label_color, b: label_color, size_enum: 2 - args.state.player[:score].to_s.length,~ - Inside source: true *** True Line Result - def initialize runtime, recording -** Processing line: ~ @inputs = Inputs.new~ + r: label_color, g: label_color, b: label_color, size_enum: 2 - args.state.player[:score].to_s.length, +** Processing line: ~ }~ - Inside source: true *** True Line Result - @inputs = Inputs.new -** Processing line: ~ @outputs = Outputs.new args: self~ + } +** Processing line: ~ ]~ - Inside source: true *** True Line Result - @outputs = Outputs.new args: self -** Processing line: ~ @audio = {}~ + ] +** Processing line: ~ args.outputs.sprites << [args.state.player, args.state.enemies, args.state.player_bullets]~ - Inside source: true *** True Line Result - @audio = {} -** Processing line: ~ @passes = []~ + args.outputs.sprites << [args.state.player, args.state.enemies, args.state.player_bullets] +** Processing line: ~ args.state.clear! if args.state.player[:health] < 0 # Reset the game if the player's health drops below zero~ - Inside source: true *** True Line Result - @passes = [] -** Processing line: ~ @state = OpenEntity.new~ + args.state.clear! if args.state.player[:health] < 0 # Reset the game if the player's health drops below zero +** Processing line: ~ end~ - Inside source: true *** True Line Result - @state = OpenEntity.new -** Processing line: ~ @state.tick_count = -1~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @state.tick_count = -1 -** Processing line: ~ @runtime = runtime~ + +** Processing line: ~ def spawn_enemies args~ - Inside source: true *** True Line Result - @runtime = runtime -** Processing line: ~ @recording = recording~ + def spawn_enemies args +** Processing line: ~ # Spawn enemies more frequently as the player's score increases.~ - Inside source: true *** True Line Result - @recording = recording -** Processing line: ~ @grid = Grid.new runtime~ + # Spawn enemies more frequently as the player's score increases. +** Processing line: ~ if rand < (100+args.state.player[:score])/(10000 + args.state.player[:score]) || args.state.tick_count.zero?~ - Inside source: true *** True Line Result - @grid = Grid.new runtime -** Processing line: ~ @render_targets = {}~ + if rand < (100+args.state.player[:score])/(10000 + args.state.player[:score]) || args.state.tick_count.zero? +** Processing line: ~ theta = rand * Math::PI * 2~ - Inside source: true *** True Line Result - @render_targets = {} -** Processing line: ~ @pixel_arrays = {}~ + theta = rand * Math::PI * 2 +** Processing line: ~ args.state.enemies << {~ - Inside source: true *** True Line Result - @pixel_arrays = {} -** Processing line: ~ @all_tests = []~ + args.state.enemies << { +** Processing line: ~ x: 600 + Math.cos(theta) * 800, y: 320 + Math.sin(theta) * 800, w: 80, h: 80, path: 'sprites/circle-white.png',~ - Inside source: true *** True Line Result - @all_tests = [] -** Processing line: ~ @geometry = GTK::Geometry~ + x: 600 + Math.cos(theta) * 800, y: 320 + Math.sin(theta) * 800, w: 80, h: 80, path: 'sprites/circle-white.png', +** Processing line: ~ r: (256 * rand).floor, g: (256 * rand).floor, b: (256 * rand).floor~ - Inside source: true *** True Line Result - @geometry = GTK::Geometry -** Processing line: ~ @wizards = Wizards.new~ + r: (256 * rand).floor, g: (256 * rand).floor, b: (256 * rand).floor +** Processing line: ~ }~ - Inside source: true *** True Line Result - @wizards = Wizards.new -** Processing line: ~ @layout = GTK::Layout.new @grid.w, @grid.h~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - @layout = GTK::Layout.new @grid.w, @grid.h -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~~ +** Processing line: ~ def kill_enemies args~ - Inside source: true *** True Line Result - -** Processing line: ~ # The number of ticks since the start of the game.~ + def kill_enemies args +** Processing line: ~ args.state.enemies.reject! do |enemy|~ - Inside source: true *** True Line Result - # The number of ticks since the start of the game. -** Processing line: ~ #~ + args.state.enemies.reject! do |enemy| +** Processing line: ~ # Check if enemy and player are within 80 pixels of each other (i.e. overlapping)~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Integer]~ + # Check if enemy and player are within 80 pixels of each other (i.e. overlapping) +** Processing line: ~ if 6400 > (enemy.x - args.state.player.x) ** 2 + (enemy.y - args.state.player.y) ** 2~ - Inside source: true *** True Line Result - # @return [Integer] -** Processing line: ~ def tick_count~ + if 6400 > (enemy.x - args.state.player.x) ** 2 + (enemy.y - args.state.player.y) ** 2 +** Processing line: ~ # Enemy is touching player. Kill enemy, and reduce player HP by 1.~ - Inside source: true *** True Line Result - def tick_count -** Processing line: ~ @state.tick_count~ + # Enemy is touching player. Kill enemy, and reduce player HP by 1. +** Processing line: ~ args.state.player[:health] -= 1~ - Inside source: true *** True Line Result - @state.tick_count -** Processing line: ~ end~ + args.state.player[:health] -= 1 +** Processing line: ~ else~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + else +** Processing line: ~ args.state.player_bullets.any? do |bullet|~ - Inside source: true *** True Line Result - -** Processing line: ~ def tick_count= value~ + args.state.player_bullets.any? do |bullet| +** Processing line: ~ # Check if enemy and bullet are within 50 pixels of each other (i.e. overlapping)~ - Inside source: true *** True Line Result - def tick_count= value -** Processing line: ~ @state.tick_count = value~ + # Check if enemy and bullet are within 50 pixels of each other (i.e. overlapping) +** Processing line: ~ if 2500 > (enemy.x - bullet.x + 30) ** 2 + (enemy.y - bullet.y + 30) ** 2~ - Inside source: true *** True Line Result - @state.tick_count = value -** Processing line: ~ end~ + if 2500 > (enemy.x - bullet.x + 30) ** 2 + (enemy.y - bullet.y + 30) ** 2 +** Processing line: ~ # Increase player health by one for each enemy killed by a bullet after the first enemy, up to a maximum of 10 HP~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Increase player health by one for each enemy killed by a bullet after the first enemy, up to a maximum of 10 HP +** Processing line: ~ args.state.player[:health] += 1 if args.state.player[:health] < 10 && bullet[:kills] > 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def serialize~ + args.state.player[:health] += 1 if args.state.player[:health] < 10 && bullet[:kills] > 0 +** Processing line: ~ # Keep track of how many enemies have been killed by this particular bullet~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ {~ + # Keep track of how many enemies have been killed by this particular bullet +** Processing line: ~ bullet[:kills] += 1~ - Inside source: true *** True Line Result - { -** Processing line: ~ state: state.as_hash,~ + bullet[:kills] += 1 +** Processing line: ~ # Earn more points by killing multiple enemies with one shot.~ - Inside source: true *** True Line Result - state: state.as_hash, -** Processing line: ~ inputs: inputs.serialize,~ + # Earn more points by killing multiple enemies with one shot. +** Processing line: ~ args.state.player[:score] += bullet[:kills]~ - Inside source: true *** True Line Result - inputs: inputs.serialize, -** Processing line: ~ passes: passes.serialize,~ + args.state.player[:score] += bullet[:kills] +** Processing line: ~ end~ - Inside source: true *** True Line Result - passes: passes.serialize, -** Processing line: ~ outputs: outputs.serialize,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - outputs: outputs.serialize, -** Processing line: ~ grid: grid.serialize~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - grid: grid.serialize -** Processing line: ~ }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def destructure~ +** Processing line: ~ def move_enemies args~ - Inside source: true *** True Line Result - def destructure -** Processing line: ~ [grid, inputs, state, outputs, runtime, passes]~ + def move_enemies args +** Processing line: ~ args.state.enemies.each do |enemy|~ - Inside source: true *** True Line Result - [grid, inputs, state, outputs, runtime, passes] -** Processing line: ~ end~ + args.state.enemies.each do |enemy| +** Processing line: ~ # Get the angle from the enemy to the player~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Get the angle from the enemy to the player +** Processing line: ~ theta = Math.atan2(enemy.y - args.state.player.y, enemy.x - args.state.player.x)~ - Inside source: true *** True Line Result - -** Processing line: ~ def clear_pixel_arrays~ + theta = Math.atan2(enemy.y - args.state.player.y, enemy.x - args.state.player.x) +** Processing line: ~ # Convert the angle to a vector pointing at the player~ - Inside source: true *** True Line Result - def clear_pixel_arrays -** Processing line: ~ pixel_arrays_clear~ + # Convert the angle to a vector pointing at the player +** Processing line: ~ dx, dy = theta.to_degrees.vector 5~ - Inside source: true *** True Line Result - pixel_arrays_clear -** Processing line: ~ end~ + dx, dy = theta.to_degrees.vector 5 +** Processing line: ~ # Move the enemy towards thr player~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Move the enemy towards thr player +** Processing line: ~ enemy.x -= dx~ - Inside source: true *** True Line Result - -** Processing line: ~ def pixel_arrays_clear~ + enemy.x -= dx +** Processing line: ~ enemy.y -= dy~ - Inside source: true *** True Line Result - def pixel_arrays_clear -** Processing line: ~ @pixel_arrays = {}~ + enemy.y -= dy +** Processing line: ~ end~ - Inside source: true *** True Line Result - @pixel_arrays = {} -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def pixel_arrays~ +** Processing line: ~ def move_bullets args~ - Inside source: true *** True Line Result - def pixel_arrays -** Processing line: ~ @pixel_arrays~ + def move_bullets args +** Processing line: ~ args.state.player_bullets.each do |bullet|~ - Inside source: true *** True Line Result - @pixel_arrays -** Processing line: ~ end~ + args.state.player_bullets.each do |bullet| +** Processing line: ~ # Move the bullets according to the bullet's velocity~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Move the bullets according to the bullet's velocity +** Processing line: ~ bullet.x += bullet[:vx]~ - Inside source: true *** True Line Result - -** Processing line: ~ def pixel_array name~ + bullet.x += bullet[:vx] +** Processing line: ~ bullet.y += bullet[:vy]~ - Inside source: true *** True Line Result - def pixel_array name -** Processing line: ~ name = name.to_s~ + bullet.y += bullet[:vy] +** Processing line: ~ end~ - Inside source: true *** True Line Result - name = name.to_s -** Processing line: ~ if !@pixel_arrays[name]~ + end +** Processing line: ~ args.state.player_bullets.reject! do |bullet|~ - Inside source: true *** True Line Result - if !@pixel_arrays[name] -** Processing line: ~ @pixel_arrays[name] = PixelArray.new~ + args.state.player_bullets.reject! do |bullet| +** Processing line: ~ # Despawn bullets that are outside the screen area~ - Inside source: true *** True Line Result - @pixel_arrays[name] = PixelArray.new -** Processing line: ~ end~ + # Despawn bullets that are outside the screen area +** Processing line: ~ bullet.x < -20 || bullet.y < -20 || bullet.x > 1300 || bullet.y > 740~ - Inside source: true *** True Line Result - end -** Processing line: ~ @pixel_arrays[name]~ + bullet.x < -20 || bullet.y < -20 || bullet.x > 1300 || bullet.y > 740 +** Processing line: ~ end~ - Inside source: true *** True Line Result - @pixel_arrays[name] -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def clear_render_targets~ +** Processing line: ~ def move_player args~ - Inside source: true *** True Line Result - def clear_render_targets -** Processing line: ~ render_targets_clear~ + def move_player args +** Processing line: ~ # Get the currently held direction.~ - Inside source: true *** True Line Result - render_targets_clear -** Processing line: ~ end~ + # Get the currently held direction. +** Processing line: ~ dx, dy = move_directional_vector args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + dx, dy = move_directional_vector args +** Processing line: ~ # Take the weighted average of the old velocities and the desired velocities.~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_targets_clear~ + # Take the weighted average of the old velocities and the desired velocities. +** Processing line: ~ # Since move_directional_vector returns values between -1 and 1,~ - Inside source: true *** True Line Result - def render_targets_clear -** Processing line: ~ @render_targets = {}~ + # Since move_directional_vector returns values between -1 and 1, +** Processing line: ~ # and we want to limit the speed to 7.5, we multiply dx and dy by 7.5*0.1 to get 0.75~ - Inside source: true *** True Line Result - @render_targets = {} -** Processing line: ~ end~ + # and we want to limit the speed to 7.5, we multiply dx and dy by 7.5*0.1 to get 0.75 +** Processing line: ~ args.state.player[:vx] = args.state.player[:vx] * 0.9 + dx * 0.75~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.player[:vx] = args.state.player[:vx] * 0.9 + dx * 0.75 +** Processing line: ~ args.state.player[:vy] = args.state.player[:vy] * 0.9 + dy * 0.75~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_targets~ + args.state.player[:vy] = args.state.player[:vy] * 0.9 + dy * 0.75 +** Processing line: ~ # Move the player~ - Inside source: true *** True Line Result - def render_targets -** Processing line: ~ @render_targets~ + # Move the player +** Processing line: ~ args.state.player.x += args.state.player[:vx]~ - Inside source: true *** True Line Result - @render_targets -** Processing line: ~ end~ + args.state.player.x += args.state.player[:vx] +** Processing line: ~ args.state.player.y += args.state.player[:vy]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.player.y += args.state.player[:vy] +** Processing line: ~ # If the player is about to go out of bounds, put them back in bounds.~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_target name~ + # If the player is about to go out of bounds, put them back in bounds. +** Processing line: ~ args.state.player.x = args.state.player.x.clamp(0, 1201)~ - Inside source: true *** True Line Result - def render_target name -** Processing line: ~ name = name.to_s~ + args.state.player.x = args.state.player.x.clamp(0, 1201) +** Processing line: ~ args.state.player.y = args.state.player.y.clamp(0, 640)~ - Inside source: true *** True Line Result - name = name.to_s -** Processing line: ~ if !@render_targets[name]~ + args.state.player.y = args.state.player.y.clamp(0, 640) +** Processing line: ~ end~ - Inside source: true *** True Line Result - if !@render_targets[name] -** Processing line: ~ @render_targets[name] = Outputs.new(args: self, target: name, background_color_override: [255, 255, 255, 0])~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @render_targets[name] = Outputs.new(args: self, target: name, background_color_override: [255, 255, 255, 0]) -** Processing line: ~ @passes << @render_targets[name]~ + +** Processing line: ~~ - Inside source: true *** True Line Result - @passes << @render_targets[name] -** Processing line: ~ end~ + +** Processing line: ~ def fire_player args~ - Inside source: true *** True Line Result - end -** Processing line: ~ @render_targets[name]~ + def fire_player args +** Processing line: ~ # Reduce the firing cooldown each tick~ - Inside source: true *** True Line Result - @render_targets[name] -** Processing line: ~ end~ + # Reduce the firing cooldown each tick +** Processing line: ~ args.state.player[:cooldown] -= 1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.player[:cooldown] -= 1 +** Processing line: ~ # If the player is allowed to fire~ - Inside source: true *** True Line Result - -** Processing line: ~ def solids~ + # If the player is allowed to fire +** Processing line: ~ if args.state.player[:cooldown] <= 0~ - Inside source: true *** True Line Result - def solids -** Processing line: ~ @outputs.solids~ + if args.state.player[:cooldown] <= 0 +** Processing line: ~ dx, dy = shoot_directional_vector args # Get the bullet velocity~ - Inside source: true *** True Line Result - @outputs.solids -** Processing line: ~ end~ + dx, dy = shoot_directional_vector args # Get the bullet velocity +** Processing line: ~ return if dx == 0 && dy == 0 # If the velocity is zero, the player doesn't want to fire. Therefore, we just return early.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + return if dx == 0 && dy == 0 # If the velocity is zero, the player doesn't want to fire. Therefore, we just return early. +** Processing line: ~ # Add a new bullet to the list of player bullets.~ - Inside source: true *** True Line Result - -** Processing line: ~ def static_solids~ + # Add a new bullet to the list of player bullets. +** Processing line: ~ args.state.player_bullets << {~ - Inside source: true *** True Line Result - def static_solids -** Processing line: ~ @outputs.static_solids~ + args.state.player_bullets << { +** Processing line: ~ x: args.state.player.x + 30 + 40 * dx,~ - Inside source: true *** True Line Result - @outputs.static_solids -** Processing line: ~ end~ + x: args.state.player.x + 30 + 40 * dx, +** Processing line: ~ y: args.state.player.y + 30 + 40 * dy,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + y: args.state.player.y + 30 + 40 * dy, +** Processing line: ~ w: 20, h: 20,~ - Inside source: true *** True Line Result - -** Processing line: ~ def sprites~ + w: 20, h: 20, +** Processing line: ~ path: 'sprites/circle-white.png',~ - Inside source: true *** True Line Result - def sprites -** Processing line: ~ @outputs.sprites~ + path: 'sprites/circle-white.png', +** Processing line: ~ r: 0, g: 0, b: 0,~ - Inside source: true *** True Line Result - @outputs.sprites -** Processing line: ~ end~ + r: 0, g: 0, b: 0, +** Processing line: ~ vx: 10 * dx + args.state.player[:vx] / 7.5, vy: 10 * dy + args.state.player[:vy] / 7.5, # Factor in a bit of the player's velocity~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + vx: 10 * dx + args.state.player[:vx] / 7.5, vy: 10 * dy + args.state.player[:vy] / 7.5, # Factor in a bit of the player's velocity +** Processing line: ~ kills: 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def static_sprites~ + kills: 0 +** Processing line: ~ }~ - Inside source: true *** True Line Result - def static_sprites -** Processing line: ~ @outputs.static_sprites~ + } +** Processing line: ~ args.state.player[:cooldown] = 30 # Reset the cooldown~ - Inside source: true *** True Line Result - @outputs.static_sprites -** Processing line: ~ end~ + args.state.player[:cooldown] = 30 # Reset the cooldown +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def labels~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def labels -** Processing line: ~ @outputs.labels~ + +** Processing line: ~ # Custom function for getting a directional vector just for movement using WASD~ - Inside source: true *** True Line Result - @outputs.labels -** Processing line: ~ end~ + # Custom function for getting a directional vector just for movement using WASD +** Processing line: ~ def move_directional_vector args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def move_directional_vector args +** Processing line: ~ dx = 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def static_labels~ + dx = 0 +** Processing line: ~ dx += 1 if args.inputs.keyboard.d~ - Inside source: true *** True Line Result - def static_labels -** Processing line: ~ @outputs.static_labels~ + dx += 1 if args.inputs.keyboard.d +** Processing line: ~ dx -= 1 if args.inputs.keyboard.a~ - Inside source: true *** True Line Result - @outputs.static_labels -** Processing line: ~ end~ + dx -= 1 if args.inputs.keyboard.a +** Processing line: ~ dy = 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + dy = 0 +** Processing line: ~ dy += 1 if args.inputs.keyboard.w~ - Inside source: true *** True Line Result - -** Processing line: ~ def lines~ + dy += 1 if args.inputs.keyboard.w +** Processing line: ~ dy -= 1 if args.inputs.keyboard.s~ - Inside source: true *** True Line Result - def lines -** Processing line: ~ @outputs.lines~ + dy -= 1 if args.inputs.keyboard.s +** Processing line: ~ if dx != 0 && dy != 0~ - Inside source: true *** True Line Result - @outputs.lines -** Processing line: ~ end~ + if dx != 0 && dy != 0 +** Processing line: ~ dx *= 0.7071~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + dx *= 0.7071 +** Processing line: ~ dy *= 0.7071~ - Inside source: true *** True Line Result - -** Processing line: ~ def static_lines~ + dy *= 0.7071 +** Processing line: ~ end~ - Inside source: true *** True Line Result - def static_lines -** Processing line: ~ @outputs.static_lines~ + end +** Processing line: ~ [dx, dy]~ - Inside source: true *** True Line Result - @outputs.static_lines -** Processing line: ~ end~ + [dx, dy] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def borders~ +** Processing line: ~ # Custom function for getting a directional vector just for shooting using the arrow keys~ - Inside source: true *** True Line Result - def borders -** Processing line: ~ @outputs.borders~ + # Custom function for getting a directional vector just for shooting using the arrow keys +** Processing line: ~ def shoot_directional_vector args~ - Inside source: true *** True Line Result - @outputs.borders -** Processing line: ~ end~ + def shoot_directional_vector args +** Processing line: ~ dx = 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + dx = 0 +** Processing line: ~ dx += 1 if args.inputs.keyboard.key_down.right || args.inputs.keyboard.key_held.right~ - Inside source: true *** True Line Result - -** Processing line: ~ def static_borders~ + dx += 1 if args.inputs.keyboard.key_down.right || args.inputs.keyboard.key_held.right +** Processing line: ~ dx -= 1 if args.inputs.keyboard.key_down.left || args.inputs.keyboard.key_held.left~ - Inside source: true *** True Line Result - def static_borders -** Processing line: ~ @outputs.static_borders~ + dx -= 1 if args.inputs.keyboard.key_down.left || args.inputs.keyboard.key_held.left +** Processing line: ~ dy = 0~ - Inside source: true *** True Line Result - @outputs.static_borders -** Processing line: ~ end~ + dy = 0 +** Processing line: ~ dy += 1 if args.inputs.keyboard.key_down.up || args.inputs.keyboard.key_held.up~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + dy += 1 if args.inputs.keyboard.key_down.up || args.inputs.keyboard.key_held.up +** Processing line: ~ dy -= 1 if args.inputs.keyboard.key_down.down || args.inputs.keyboard.key_held.down~ - Inside source: true *** True Line Result - -** Processing line: ~ def primitives~ + dy -= 1 if args.inputs.keyboard.key_down.down || args.inputs.keyboard.key_held.down +** Processing line: ~ if dx != 0 && dy != 0~ - Inside source: true *** True Line Result - def primitives -** Processing line: ~ @outputs.primitives~ + if dx != 0 && dy != 0 +** Processing line: ~ dx *= 0.7071~ - Inside source: true *** True Line Result - @outputs.primitives -** Processing line: ~ end~ + dx *= 0.7071 +** Processing line: ~ dy *= 0.7071~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + dy *= 0.7071 +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def static_primitives~ + end +** Processing line: ~ [dx, dy]~ - Inside source: true *** True Line Result - def static_primitives -** Processing line: ~ @outputs.static_primitives~ + [dx, dy] +** Processing line: ~ end~ - Inside source: true *** True Line Result - @outputs.static_primitives -** Processing line: ~ end~ -- Inside source: true + end +** 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: ~ def keyboard~ +** Processing line: ~*** Crafting - Craft Game Starting Point - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Crafting - Craft 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/craft_game_starting_point/app/main.rb~ - Inside source: true *** True Line Result - def keyboard -** Processing line: ~ @inputs.keyboard~ + # ./samples/99_genre_crafting/craft_game_starting_point/app/main.rb +** Processing line: ~ # ==================================================~ - Inside source: true *** True Line Result - @inputs.keyboard -** Processing line: ~ end~ + # ================================================== +** Processing line: ~ # A NOTE TO JAM CRAFT PARTICIPANTS:~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # A NOTE TO JAM CRAFT PARTICIPANTS: +** Processing line: ~ # The comments and code in here are just as small piece of DragonRuby's capabilities.~ - Inside source: true *** True Line Result - -** Processing line: ~ def click~ + # The comments and code in here are just as small piece of DragonRuby's capabilities. +** Processing line: ~ # Be sure to check out the rest of the sample apps. Start with README.txt and go from there!~ - Inside source: true *** True Line Result - def click -** Processing line: ~ return nil unless @inputs.mouse.click~ + # Be sure to check out the rest of the sample apps. Start with README.txt and go from there! +** Processing line: ~ # ==================================================~ - Inside source: true *** True Line Result - return nil unless @inputs.mouse.click + # ================================================== ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @inputs.mouse.click.point~ +** Processing line: ~ # def tick args is the entry point into your game. This function is called at~ - Inside source: true *** True Line Result - @inputs.mouse.click.point -** Processing line: ~ end~ + # def tick args is the entry point into your game. This function is called at +** Processing line: ~ # a fixed update time of 60hz (60 fps).~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # a fixed update time of 60hz (60 fps). +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - -** Processing line: ~ def click_at~ + def tick args +** Processing line: ~ # The defaults function intitializes the game.~ - Inside source: true *** True Line Result - def click_at -** Processing line: ~ return nil unless @inputs.mouse.click~ + # The defaults function intitializes the game. +** Processing line: ~ defaults args~ - Inside source: true *** True Line Result - return nil unless @inputs.mouse.click + defaults args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @inputs.mouse.click.created_at~ +** Processing line: ~ # After the game is initialized, render it.~ - Inside source: true *** True Line Result - @inputs.mouse.click.created_at -** Processing line: ~ end~ + # After the game is initialized, render it. +** Processing line: ~ render args~ - Inside source: true *** True Line Result - end + render args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def mouse~ -- Inside source: true -*** True Line Result - def mouse -** Processing line: ~ @inputs.mouse~ +** Processing line: ~ # After rendering the player should be able to respond to input.~ - Inside source: true *** True Line Result - @inputs.mouse -** Processing line: ~ end~ + # After rendering the player should be able to respond to input. +** Processing line: ~ input args~ - Inside source: true *** True Line Result - end + input args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @see Inputs#controller_one~ -- Inside source: true -*** True Line Result - # @see Inputs#controller_one -** Processing line: ~ # @return (see Inputs#controller_one)~ -- Inside source: true -*** True Line Result - # @return (see Inputs#controller_one) -** Processing line: ~ def controller_one~ +** Processing line: ~ # After responding to input, the game performs any additional calculations.~ - Inside source: true *** True Line Result - def controller_one -** Processing line: ~ @inputs.controller_one~ + # After responding to input, the game performs any additional calculations. +** Processing line: ~ calc args~ - Inside source: true *** True Line Result - @inputs.controller_one -** Processing line: ~ end~ + calc args +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @see Inputs#controller_two~ -- Inside source: true -*** True Line Result - # @see Inputs#controller_two -** Processing line: ~ # @return (see Inputs#controller_two)~ +** Processing line: ~ def defaults args~ - Inside source: true *** True Line Result - # @return (see Inputs#controller_two) -** Processing line: ~ def controller_two~ + def defaults args +** Processing line: ~ # hide the mouse cursor for this game, we are going to render our own cursor~ - Inside source: true *** True Line Result - def controller_two -** Processing line: ~ @inputs.controller_two~ + # hide the mouse cursor for this game, we are going to render our own cursor +** Processing line: ~ if args.state.tick_count == 0~ - Inside source: true *** True Line Result - @inputs.controller_two -** Processing line: ~ end~ + if args.state.tick_count == 0 +** Processing line: ~ args.gtk.hide_cursor~ - Inside source: true *** True Line Result - end + args.gtk.hide_cursor ** 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. +** Processing line: ~ args.state.click_ripples ||= []~ +- Inside source: true *** True Line Result -#+end_src + args.state.click_ripples ||= [] ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* assert.rb~ -- Header detected. +** Processing line: ~ # everything is on a 1280x720 virtual canvas, so you can~ +- Inside source: true *** True Line Result - + # everything is on a 1280x720 virtual canvas, so you can +** Processing line: ~ # hardcode locations~ +- Inside source: true *** True Line Result -* assert.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # hardcode locations +** Processing line: ~~ +- Inside source: true *** True Line Result -*** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/assert.rb~ +** Processing line: ~ # define the borders for where the inventory is located~ - Inside source: true *** True Line Result - # ./dragon/assert.rb -** Processing line: ~ # coding: utf-8~ + # define the borders for where the inventory is located +** Processing line: ~ # args.state is a data structure that accepts any arbitrary parameters~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + # args.state is a data structure that accepts any arbitrary parameters +** Processing line: ~ # so you can create an object graph without having to create any classes.~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + # so you can create an object graph without having to create any classes. +** Processing line: ~~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # assert.rb has been released under MIT (*only this file*).~ + +** Processing line: ~ # Bottom left is 0, 0. Top right is 1280, 720.~ - Inside source: true *** True Line Result - # assert.rb has been released under MIT (*only this file*). -** Processing line: ~~ + # Bottom left is 0, 0. Top right is 1280, 720. +** Processing line: ~ # The inventory area is at the top of the screen~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + # The inventory area is at the top of the screen +** Processing line: ~ # the number 80 is the size of all the sprites, so that is what is being~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ =begin~ + # the number 80 is the size of all the sprites, so that is what is being +** Processing line: ~ # used to decide the with and height~ - Inside source: true *** True Line Result - =begin -** Processing line: ~ This is a tiny assertion api for the unit testing portion of Game Toolkit.~ + # used to decide the with and height +** Processing line: ~ args.state.sprite_size = 80~ - Inside source: true *** True Line Result - This is a tiny assertion api for the unit testing portion of Game Toolkit. + args.state.sprite_size = 80 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @example~ +** Processing line: ~ args.state.inventory_border.w = args.state.sprite_size * 10~ - Inside source: true *** True Line Result - @example -** Processing line: ~~ + args.state.inventory_border.w = args.state.sprite_size * 10 +** Processing line: ~ args.state.inventory_border.h = args.state.sprite_size * 3~ - Inside source: true *** True Line Result - -** Processing line: ~ 1. Create a file called tests.rb under mygame.~ + args.state.inventory_border.h = args.state.sprite_size * 3 +** Processing line: ~ args.state.inventory_border.x = 10~ - Inside source: true *** True Line Result - 1. Create a file called tests.rb under mygame. -** Processing line: ~ 2. Any method that begins with the word test_ will be considered a test.~ + args.state.inventory_border.x = 10 +** Processing line: ~ args.state.inventory_border.y = 710 - args.state.inventory_border.h~ - Inside source: true *** True Line Result - 2. Any method that begins with the word test_ will be considered a test. + args.state.inventory_border.y = 710 - args.state.inventory_border.h ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_this_works args, assert~ -- Inside source: true -*** True Line Result - def test_this_works args, assert -** Processing line: ~ assert.equal! 1, 1~ +** Processing line: ~ # define the borders for where the crafting area is located~ - Inside source: true *** True Line Result - assert.equal! 1, 1 -** Processing line: ~ end~ + # define the borders for where the crafting area is located +** Processing line: ~ # the crafting area is below the inventory area~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # the crafting area is below the inventory area +** Processing line: ~ # the number 80 is the size of all the sprites, so that is what is being~ - Inside source: true *** True Line Result - -** Processing line: ~ 3. To run a test, save the file while the game is running.~ + # the number 80 is the size of all the sprites, so that is what is being +** Processing line: ~ # used to decide the with and height~ - Inside source: true *** True Line Result - 3. To run a test, save the file while the game is running. -** Processing line: ~~ + # used to decide the with and height +** Processing line: ~ args.state.craft_border.x = 10~ - Inside source: true *** True Line Result - -** Processing line: ~ @example~ + args.state.craft_border.x = 10 +** Processing line: ~ args.state.craft_border.y = 220~ - Inside source: true *** True Line Result - @example -** Processing line: ~~ + args.state.craft_border.y = 220 +** Processing line: ~ args.state.craft_border.w = args.state.sprite_size * 3~ - Inside source: true *** True Line Result - -** Processing line: ~ To add an assertion open up this class and write:~ + args.state.craft_border.w = args.state.sprite_size * 3 +** Processing line: ~ args.state.craft_border.h = args.state.sprite_size * 3~ - Inside source: true *** True Line Result - To add an assertion open up this class and write: + args.state.craft_border.h = args.state.sprite_size * 3 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class Assert~ +** Processing line: ~ # define the area where results are located~ - Inside source: true *** True Line Result - class Assert -** Processing line: ~ def custom_assertion actual, expected, message = nil~ + # define the area where results are located +** Processing line: ~ # the crafting result is to the right of the craft area~ - 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).~ + # the crafting result is to the right of the craft area +** Processing line: ~ args.state.result_border.x = 10 + args.state.sprite_size * 3 + args.state.sprite_size~ - Inside source: true *** True Line Result - # this tell Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive). -** Processing line: ~ @assertion_performed = true~ + args.state.result_border.x = 10 + args.state.sprite_size * 3 + args.state.sprite_size +** Processing line: ~ args.state.result_border.y = 220 + args.state.sprite_size~ - Inside source: true *** True Line Result - @assertion_performed = true -** Processing line: ~~ + args.state.result_border.y = 220 + args.state.sprite_size +** Processing line: ~ args.state.result_border.w = args.state.sprite_size~ - Inside source: true *** True Line Result - -** Processing line: ~ # perform your custom logic here and rais an exception to denote a failure.~ + args.state.result_border.w = args.state.sprite_size +** Processing line: ~ args.state.result_border.h = args.state.sprite_size~ - Inside source: true *** True Line Result - # perform your custom logic here and rais an exception to denote a failure. + args.state.result_border.h = args.state.sprite_size ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ raise "Some Error. #{message}."~ +** Processing line: ~ # initialize items for the first time if they are nil~ - Inside source: true *** True Line Result - raise "Some Error. #{message}." -** Processing line: ~ end~ + # initialize items for the first time if they are nil +** Processing line: ~ # you start with 15 wood, 1 chest, and 5 plank~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # you start with 15 wood, 1 chest, and 5 plank +** Processing line: ~ # Ruby has built in syntax for dictionaries (they look a lot like json objects).~ - Inside source: true *** True Line Result - end -** Processing line: ~ =end~ + # Ruby has built in syntax for dictionaries (they look a lot like json objects). +** Processing line: ~ # Ruby also has a special type called a Symbol denoted with a : followed by a word.~ - Inside source: true *** True Line Result - =end -** Processing line: ~ class Assert~ + # Ruby also has a special type called a Symbol denoted with a : followed by a word. +** Processing line: ~ # Symbols are nice because they remove the need for magic strings.~ - Inside source: true *** True Line Result - class Assert -** Processing line: ~ attr :assertion_performed~ + # Symbols are nice because they remove the need for magic strings. +** Processing line: ~ if !args.state.items~ - Inside source: true *** True Line Result - attr :assertion_performed -** Processing line: ~~ + if !args.state.items +** Processing line: ~ args.state.items = [~ - Inside source: true *** True Line Result - -** Processing line: ~ =begin~ + args.state.items = [ +** Processing line: ~ {~ - 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: ~ id: :wood, # :wood is a Symbol, this is better than using "wood" for the id~ - 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). -** Processing line: ~ =end~ + id: :wood, # :wood is a Symbol, this is better than using "wood" for the id +** Processing line: ~ quantity: 15,~ - Inside source: true *** True Line Result - =end -** Processing line: ~ def ok!~ + quantity: 15, +** Processing line: ~ path: 'sprites/wood.png',~ - Inside source: true *** True Line Result - def ok! -** Processing line: ~ @assertion_performed = true~ + path: 'sprites/wood.png', +** Processing line: ~ location: :inventory,~ - Inside source: true *** True Line Result - @assertion_performed = true -** Processing line: ~ end~ + location: :inventory, +** Processing line: ~ ordinal_x: 0, ordinal_y: 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + ordinal_x: 0, ordinal_y: 0 +** Processing line: ~ },~ - Inside source: true *** True Line Result - -** Processing line: ~ =begin~ + }, +** Processing line: ~ {~ - 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: ~ id: :chest,~ - 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. -** Processing line: ~~ + id: :chest, +** Processing line: ~ quantity: 1,~ - Inside source: true *** True Line Result - -** Processing line: ~ @example~ + quantity: 1, +** Processing line: ~ path: 'sprites/chest.png',~ - Inside source: true *** True Line Result - @example -** Processing line: ~~ + path: 'sprites/chest.png', +** Processing line: ~ location: :inventory,~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_does_this_work args, assert~ + location: :inventory, +** Processing line: ~ ordinal_x: 1, ordinal_y: 0~ - Inside source: true *** True Line Result - def test_does_this_work args, assert -** Processing line: ~ some_result = Person.new~ + ordinal_x: 1, ordinal_y: 0 +** Processing line: ~ },~ - Inside source: true *** True Line Result - some_result = Person.new -** Processing line: ~ assert.true! some_result~ + }, +** Processing line: ~ {~ - Inside source: true *** True Line Result - assert.true! some_result -** Processing line: ~ # OR~ + { +** Processing line: ~ id: :plank,~ - Inside source: true *** True Line Result - # OR -** Processing line: ~ assert.true! some_result, "Person was not created."~ + id: :plank, +** Processing line: ~ quantity: 5,~ - Inside source: true *** True Line Result - assert.true! some_result, "Person was not created." -** Processing line: ~ end~ + quantity: 5, +** Processing line: ~ path: 'sprites/plank.png',~ - Inside source: true *** True Line Result - end -** Processing line: ~ =end~ + path: 'sprites/plank.png', +** Processing line: ~ location: :inventory,~ - Inside source: true *** True Line Result - =end -** Processing line: ~ def true! value, message = nil~ + location: :inventory, +** Processing line: ~ ordinal_x: 2, ordinal_y: 0~ - Inside source: true *** True Line Result - def true! value, message = nil -** Processing line: ~ @assertion_performed = true~ + ordinal_x: 2, ordinal_y: 0 +** Processing line: ~ },~ - Inside source: true *** True Line Result - @assertion_performed = true -** Processing line: ~ if !value~ + }, +** Processing line: ~ ]~ - Inside source: true *** True Line Result - if !value -** Processing line: ~ message = "#{value} was not truthy.\n#{message}"~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - message = "#{value} was not truthy.\n#{message}" -** Processing line: ~ raise "#{message}"~ + +** Processing line: ~ # after initializing the oridinal positions, derive the pixel~ - Inside source: true *** True Line Result - raise "#{message}" -** Processing line: ~ end~ + # after initializing the oridinal positions, derive the pixel +** Processing line: ~ # locations assuming that the width and height are 80~ - Inside source: true *** True Line Result - end -** Processing line: ~ nil~ + # locations assuming that the width and height are 80 +** Processing line: ~ args.state.items.each { |item| set_inventory_position args, item }~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + args.state.items.each { |item| set_inventory_position args, item } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ =begin~ -- Inside source: true -*** True Line Result - =begin -** Processing line: ~ Assert if a value is a falsey value.~ +** Processing line: ~ # define all the oridinal positions of the inventory slots~ - Inside source: true *** True Line Result - Assert if a value is a falsey value. -** Processing line: ~~ + # define all the oridinal positions of the inventory slots +** Processing line: ~ if !args.state.inventory_area~ - Inside source: true *** True Line Result - -** Processing line: ~ @example~ + if !args.state.inventory_area +** Processing line: ~ args.state.inventory_area = [~ - Inside source: true *** True Line Result - @example -** Processing line: ~~ + args.state.inventory_area = [ +** Processing line: ~ { ordinal_x: 0, ordinal_y: 0 },~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_does_this_work args, assert~ + { ordinal_x: 0, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 1, ordinal_y: 0 },~ - Inside source: true *** True Line Result - def test_does_this_work args, assert -** Processing line: ~ some_result = nil~ + { ordinal_x: 1, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 2, ordinal_y: 0 },~ - Inside source: true *** True Line Result - some_result = nil -** Processing line: ~ assert.false! some_result~ + { ordinal_x: 2, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 3, ordinal_y: 0 },~ - Inside source: true *** True Line Result - assert.false! some_result -** Processing line: ~ end~ + { ordinal_x: 3, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 4, ordinal_y: 0 },~ - Inside source: true *** True Line Result - end -** Processing line: ~ =end~ + { ordinal_x: 4, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 5, ordinal_y: 0 },~ - Inside source: true *** True Line Result - =end -** Processing line: ~ def false! value, message = nil~ + { ordinal_x: 5, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 6, ordinal_y: 0 },~ - Inside source: true *** True Line Result - def false! value, message = nil -** Processing line: ~ @assertion_performed = true~ + { ordinal_x: 6, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 7, ordinal_y: 0 },~ - Inside source: true *** True Line Result - @assertion_performed = true -** Processing line: ~ if value~ + { ordinal_x: 7, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 8, ordinal_y: 0 },~ - Inside source: true *** True Line Result - if value -** Processing line: ~ message = "#{value} was not falsey.\n#{message}"~ + { ordinal_x: 8, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 9, ordinal_y: 0 },~ - Inside source: true *** True Line Result - message = "#{value} was not falsey.\n#{message}" -** Processing line: ~ raise message~ + { ordinal_x: 9, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 0, ordinal_y: 1 },~ - Inside source: true *** True Line Result - raise message -** Processing line: ~ end~ + { ordinal_x: 0, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 1, ordinal_y: 1 },~ - Inside source: true *** True Line Result - end -** Processing line: ~ nil~ + { ordinal_x: 1, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 2, ordinal_y: 1 },~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + { ordinal_x: 2, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 3, ordinal_y: 1 },~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + { ordinal_x: 3, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 4, ordinal_y: 1 },~ - Inside source: true *** True Line Result - -** Processing line: ~ =begin~ + { ordinal_x: 4, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 5, ordinal_y: 1 },~ - Inside source: true *** True Line Result - =begin -** Processing line: ~ Assert if two values are equal.~ + { ordinal_x: 5, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 6, ordinal_y: 1 },~ - Inside source: true *** True Line Result - Assert if two values are equal. -** Processing line: ~~ + { ordinal_x: 6, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 7, ordinal_y: 1 },~ - Inside source: true *** True Line Result - -** Processing line: ~ @example~ + { ordinal_x: 7, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 8, ordinal_y: 1 },~ - Inside source: true *** True Line Result - @example -** Processing line: ~~ + { ordinal_x: 8, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 9, ordinal_y: 1 },~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_does_this_work args, assert~ + { ordinal_x: 9, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 0, ordinal_y: 2 },~ - Inside source: true *** True Line Result - def test_does_this_work args, assert -** Processing line: ~ a = 1~ + { ordinal_x: 0, ordinal_y: 2 }, +** Processing line: ~ { ordinal_x: 1, ordinal_y: 2 },~ - Inside source: true *** True Line Result - a = 1 -** Processing line: ~ b = 1~ + { ordinal_x: 1, ordinal_y: 2 }, +** Processing line: ~ { ordinal_x: 2, ordinal_y: 2 },~ - Inside source: true *** True Line Result - b = 1 -** Processing line: ~ assert.equal! a, b~ + { ordinal_x: 2, ordinal_y: 2 }, +** Processing line: ~ { ordinal_x: 3, ordinal_y: 2 },~ - Inside source: true *** True Line Result - assert.equal! a, b -** Processing line: ~ end~ + { ordinal_x: 3, ordinal_y: 2 }, +** Processing line: ~ { ordinal_x: 4, ordinal_y: 2 },~ - Inside source: true *** True Line Result - end -** Processing line: ~ =end~ + { ordinal_x: 4, ordinal_y: 2 }, +** Processing line: ~ { ordinal_x: 5, ordinal_y: 2 },~ - Inside source: true *** True Line Result - =end -** Processing line: ~ def equal! actual, expected, message = nil~ + { ordinal_x: 5, ordinal_y: 2 }, +** Processing line: ~ { ordinal_x: 6, ordinal_y: 2 },~ - Inside source: true *** True Line Result - def equal! actual, expected, message = nil -** Processing line: ~ @assertion_performed = true~ + { ordinal_x: 6, ordinal_y: 2 }, +** Processing line: ~ { ordinal_x: 7, ordinal_y: 2 },~ - Inside source: true *** True Line Result - @assertion_performed = true -** Processing line: ~ if actual != expected~ + { ordinal_x: 7, ordinal_y: 2 }, +** Processing line: ~ { ordinal_x: 8, ordinal_y: 2 },~ - Inside source: true *** True Line Result - if actual != expected -** Processing line: ~ actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip~ + { ordinal_x: 8, ordinal_y: 2 }, +** Processing line: ~ { ordinal_x: 9, ordinal_y: 2 },~ - 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}"~ + { ordinal_x: 9, ordinal_y: 2 }, +** Processing line: ~ ]~ - Inside source: true *** True Line Result - message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}.\n#{message}" -** Processing line: ~ raise message~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - raise message -** Processing line: ~ end~ + +** Processing line: ~ # after initializing the oridinal positions, derive the pixel~ - Inside source: true *** True Line Result - end -** Processing line: ~ nil~ + # after initializing the oridinal positions, derive the pixel +** Processing line: ~ # locations assuming that the width and height are 80~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + # locations assuming that the width and height are 80 +** Processing line: ~ args.state.inventory_area.each { |i| set_inventory_position args, i }~ - Inside source: true *** True Line Result - end + args.state.inventory_area.each { |i| set_inventory_position args, i } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ =begin~ +** Processing line: ~ # if you want to see the result you can use the Ruby function called "puts".~ - Inside source: true *** True Line Result - =begin -** Processing line: ~ Assert if a value is explicitly nil (not false).~ + # if you want to see the result you can use the Ruby function called "puts". +** Processing line: ~ # Uncomment this line to see the value.~ - Inside source: true *** True Line Result - Assert if a value is explicitly nil (not false). + # Uncomment this line to see the value. +** Processing line: ~ # puts args.state.inventory_area~ +- Inside source: true +*** True Line Result + # puts args.state.inventory_area ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @example~ +** Processing line: ~ # You can see all things written via puts in DragonRuby's Console, or under logs/log.txt.~ - Inside source: true *** True Line Result - @example + # You can see all things written via puts in DragonRuby's Console, or under logs/log.txt. +** Processing line: ~ # To bring up DragonRuby's Console, press the ~ key within the game.~ +- Inside source: true +*** True Line Result + # To bring up DragonRuby's Console, press the ~ key within the game. +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def test_does_this_work args, assert~ +** Processing line: ~ # define all the oridinal positions of the craft slots~ - Inside source: true *** True Line Result - def test_does_this_work args, assert -** Processing line: ~ a = nil~ + # define all the oridinal positions of the craft slots +** Processing line: ~ if !args.state.craft_area~ - Inside source: true *** True Line Result - a = nil -** Processing line: ~ b = false~ + if !args.state.craft_area +** Processing line: ~ args.state.craft_area = [~ - Inside source: true *** True Line Result - b = false -** Processing line: ~ assert.nil! a # this will pass~ + args.state.craft_area = [ +** Processing line: ~ { ordinal_x: 0, ordinal_y: 0 },~ - Inside source: true *** True Line Result - assert.nil! a # this will pass -** Processing line: ~ assert.nil! b # this will throw an exception.~ + { ordinal_x: 0, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 0, ordinal_y: 1 },~ - Inside source: true *** True Line Result - assert.nil! b # this will throw an exception. -** Processing line: ~ end~ + { ordinal_x: 0, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 0, ordinal_y: 2 },~ - Inside source: true *** True Line Result - end -** Processing line: ~ =end~ + { ordinal_x: 0, ordinal_y: 2 }, +** Processing line: ~ { ordinal_x: 1, ordinal_y: 0 },~ - Inside source: true *** True Line Result - =end -** Processing line: ~ def nil! value, message = nil~ + { ordinal_x: 1, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 1, ordinal_y: 1 },~ - Inside source: true *** True Line Result - def nil! value, message = nil -** Processing line: ~ @assertion_performed = true~ + { ordinal_x: 1, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 1, ordinal_y: 2 },~ - Inside source: true *** True Line Result - @assertion_performed = true -** Processing line: ~ if !value.nil?~ + { ordinal_x: 1, ordinal_y: 2 }, +** Processing line: ~ { ordinal_x: 2, ordinal_y: 0 },~ - Inside source: true *** True Line Result - if !value.nil? -** Processing line: ~ message = "#{value} was supposed to be nil, but wasn't.\n#{message}"~ + { ordinal_x: 2, ordinal_y: 0 }, +** Processing line: ~ { ordinal_x: 2, ordinal_y: 1 },~ - Inside source: true *** True Line Result - message = "#{value} was supposed to be nil, but wasn't.\n#{message}" -** Processing line: ~ raise message~ + { ordinal_x: 2, ordinal_y: 1 }, +** Processing line: ~ { ordinal_x: 2, ordinal_y: 2 },~ - Inside source: true *** True Line Result - raise message -** Processing line: ~ end~ + { ordinal_x: 2, ordinal_y: 2 }, +** Processing line: ~ ]~ - Inside source: true *** True Line Result - end -** Processing line: ~ nil~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + +** Processing line: ~ # after initializing the oridinal positions, derive the pixel~ - Inside source: true *** True Line Result - end + # after initializing the oridinal positions, derive the pixel +** Processing line: ~ # locations assuming that the width and height are 80~ +- Inside source: true +*** True Line Result + # locations assuming that the width and height are 80 +** Processing line: ~ args.state.craft_area.each { |c| set_craft_position args, c }~ +- Inside source: true +*** True Line Result + args.state.craft_area.each { |c| set_craft_position args, c } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -91479,90 +95376,78 @@ Follows is a source code listing for all files that have been open sourced. This - 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: ~* attr_gtk.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ def render args~ +- Inside source: true *** True Line Result -* attr_gtk.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - + def render args +** Processing line: ~ # for the results area, create a sprite that show its boundaries~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/attr_gtk.rb~ + # for the results area, create a sprite that show its boundaries +** Processing line: ~ args.outputs.primitives << { x: args.state.result_border.x,~ - Inside source: true *** True Line Result - # ./dragon/attr_gtk.rb -** Processing line: ~ # coding: utf-8~ + args.outputs.primitives << { x: args.state.result_border.x, +** Processing line: ~ y: args.state.result_border.y,~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + y: args.state.result_border.y, +** Processing line: ~ w: args.state.result_border.w,~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + w: args.state.result_border.w, +** Processing line: ~ h: args.state.result_border.h,~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # attr_gtk.rb has been released under MIT (*only this file*).~ + h: args.state.result_border.h, +** Processing line: ~ path: 'sprites/border-black.png' }~ - Inside source: true *** True Line Result - # attr_gtk.rb has been released under MIT (*only this file*). + path: 'sprites/border-black.png' } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @private~ -- Inside source: true -*** True Line Result - # @private -** Processing line: ~ module AttrGTK~ +** Processing line: ~ # for each inventory spot, create a sprite~ - Inside source: true *** True Line Result - module AttrGTK -** Processing line: ~ attr_accessor :args~ + # for each inventory spot, create a sprite +** Processing line: ~ # args.outputs.primitives is how DragonRuby performs a render.~ - Inside source: true *** True Line Result - attr_accessor :args -** Processing line: ~~ + # args.outputs.primitives is how DragonRuby performs a render. +** Processing line: ~ # Adding a single hash or multiple hashes to this array will tell~ - Inside source: true *** True Line Result - -** Processing line: ~ def keyboard~ + # Adding a single hash or multiple hashes to this array will tell +** Processing line: ~ # DragonRuby to render those primitives on that frame.~ - Inside source: true *** True Line Result - def keyboard -** Processing line: ~ args.inputs.keyboard~ + # DragonRuby to render those primitives on that frame. +** Processing line: ~~ - Inside source: true *** True Line Result - args.inputs.keyboard -** Processing line: ~ end~ + +** Processing line: ~ # The .map function on Array is used instead of any kind of looping.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # The .map function on Array is used instead of any kind of looping. +** Processing line: ~ # .map returns a new object for every object within an Array.~ - Inside source: true *** True Line Result - -** Processing line: ~ def grid~ + # .map returns a new object for every object within an Array. +** Processing line: ~ args.outputs.primitives << args.state.inventory_area.map do |a|~ - Inside source: true *** True Line Result - def grid -** Processing line: ~ args.grid~ + args.outputs.primitives << args.state.inventory_area.map do |a| +** Processing line: ~ { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' }~ - Inside source: true *** True Line Result - args.grid + { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -91571,14 +95456,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 state~ +** Processing line: ~ # for each craft spot, create a sprite~ - Inside source: true *** True Line Result - def state -** Processing line: ~ args.state~ + # for each craft spot, create a sprite +** Processing line: ~ args.outputs.primitives << args.state.craft_area.map do |a|~ - Inside source: true *** True Line Result - args.state + args.outputs.primitives << args.state.craft_area.map do |a| +** Processing line: ~ { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' }~ +- Inside source: true +*** True Line Result + { x: a.x, y: a.y, w: a.w, h: a.h, path: 'sprites/border-black.png' } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -91587,62 +95476,66 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def inputs~ +** Processing line: ~ # after the borders have been rendered, render the~ - Inside source: true *** True Line Result - def inputs -** Processing line: ~ args.inputs~ + # after the borders have been rendered, render the +** Processing line: ~ # items within those slots (and allow for highlighting)~ - Inside source: true *** True Line Result - args.inputs -** Processing line: ~ end~ + # items within those slots (and allow for highlighting) +** Processing line: ~ # if an item isn't currently being held~ - Inside source: true *** True Line Result - end + # if an item isn't currently being held +** Processing line: ~ allow_inventory_highlighting = !args.state.held_item~ +- Inside source: true +*** True Line Result + allow_inventory_highlighting = !args.state.held_item ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def outputs~ +** Processing line: ~ # go through each item and render them~ - Inside source: true *** True Line Result - def outputs -** Processing line: ~ args.outputs~ + # go through each item and render them +** Processing line: ~ # use Array's find_all method to remove any items that are currently being held~ - Inside source: true *** True Line Result - args.outputs -** Processing line: ~ end~ + # use Array's find_all method to remove any items that are currently being held +** Processing line: ~ args.state.items.find_all { |item| item[:location] != :held }.map do |item|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.items.find_all { |item| item[:location] != :held }.map do |item| +** Processing line: ~ # if an item is currently being held, don't render it in it's spot within the~ - Inside source: true *** True Line Result - -** Processing line: ~ def gtk~ + # if an item is currently being held, don't render it in it's spot within the +** Processing line: ~ # inventory or craft area (this is handled via the find_all method).~ - Inside source: true *** True Line Result - def gtk -** Processing line: ~ args.gtk~ + # inventory or craft area (this is handled via the find_all method). +** Processing line: ~~ - Inside source: true *** True Line Result - args.gtk -** Processing line: ~ end~ + +** Processing line: ~ # the item_prefab returns a hash containing all the visual components of an item.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # the item_prefab returns a hash containing all the visual components of an item. +** Processing line: ~ # the main sprite, the black background, the quantity text, and a hover indication~ - Inside source: true *** True Line Result - -** Processing line: ~ def passes~ + # the main sprite, the black background, the quantity text, and a hover indication +** Processing line: ~ # if the mouse is currently hovering over the item.~ - Inside source: true *** True Line Result - def passes -** Processing line: ~ args.passes~ + # if the mouse is currently hovering over the item. +** Processing line: ~ args.outputs.primitives << item_prefab(args, item, allow_inventory_highlighting, args.inputs.mouse)~ - Inside source: true *** True Line Result - args.passes + args.outputs.primitives << item_prefab(args, item, allow_inventory_highlighting, args.inputs.mouse) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -91651,34 +95544,34 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def pixel_arrays~ -- Inside source: true -*** True Line Result - def pixel_arrays -** Processing line: ~ args.pixel_arrays~ +** Processing line: ~ # The last thing we want to render is the item currently being held.~ - Inside source: true *** True Line Result - args.pixel_arrays -** Processing line: ~ end~ + # The last thing we want to render is the item currently being held. +** Processing line: ~ args.outputs.primitives << item_prefab(args, args.state.held_item, allow_inventory_highlighting, args.inputs.mouse)~ - Inside source: true *** True Line Result - end + args.outputs.primitives << item_prefab(args, args.state.held_item, allow_inventory_highlighting, args.inputs.mouse) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def geometry~ +** Processing line: ~ args.outputs.primitives << args.state.click_ripples~ - Inside source: true *** True Line Result - def geometry -** Processing line: ~ args.geometry~ + args.outputs.primitives << args.state.click_ripples +** Processing line: ~~ - Inside source: true *** True Line Result - args.geometry -** Processing line: ~ end~ + +** Processing line: ~ # render a mouse cursor since we have the OS cursor hidden~ - Inside source: true *** True Line Result - end + # render a mouse cursor since we have the OS cursor hidden +** Processing line: ~ args.outputs.primitives << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 }~ +- Inside source: true +*** True Line Result + args.outputs.primitives << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -91687,1258 +95580,1238 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. +** Processing line: ~ # Alrighty! This is where all the fun happens~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + # Alrighty! This is where all the fun happens +** Processing line: ~ def input args~ +- Inside source: true *** True Line Result - -** Processing line: ~* attr_sprite.rb~ -- Header detected. + def input args +** Processing line: ~ # if the mouse is clicked and not item is currently being held~ +- Inside source: true *** True Line Result - + # if the mouse is clicked and not item is currently being held +** Processing line: ~ # args.state.held_item is nil when the game starts.~ +- Inside source: true *** True Line Result -* attr_sprite.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # args.state.held_item is nil when the game starts. +** Processing line: ~ # If the player clicks, the property args.inputs.mouse.click will~ +- Inside source: true *** True Line Result - + # If the player clicks, the property args.inputs.mouse.click will +** Processing line: ~ # be a non nil value, we don't want to process any of the code here~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/attr_sprite.rb~ + # be a non nil value, we don't want to process any of the code here +** Processing line: ~ # if the mouse hasn't been clicked~ - Inside source: true *** True Line Result - # ./dragon/attr_sprite.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + # if the mouse hasn't been clicked +** Processing line: ~ return if !args.inputs.mouse.click~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + return if !args.inputs.mouse.click +** Processing line: ~~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # attr_sprite.rb has been released under MIT (*only this file*).~ + +** Processing line: ~ # if a click occurred, add a ripple to the ripple queue~ - Inside source: true *** True Line Result - # attr_sprite.rb has been released under MIT (*only this file*). + # if a click occurred, add a ripple to the ripple queue +** Processing line: ~ args.state.click_ripples << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 }~ +- Inside source: true +*** True Line Result + args.state.click_ripples << { x: args.inputs.mouse.x - 5, y: args.inputs.mouse.y - 5, w: 10, h: 10, path: 'sprites/circle-gray.png', a: 128 } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @private~ +** Processing line: ~ # if the mouse has been clicked, and no item is currently held...~ - Inside source: true *** True Line Result - # @private -** Processing line: ~ module AttrRect~ + # if the mouse has been clicked, and no item is currently held... +** Processing line: ~ if !args.state.held_item~ - Inside source: true *** True Line Result - module AttrRect -** Processing line: ~ def left~ + if !args.state.held_item +** Processing line: ~ # see if any of the items intersect the pointer using the inside_rect? method~ - Inside source: true *** True Line Result - def left -** Processing line: ~ @x~ + # see if any of the items intersect the pointer using the inside_rect? method +** Processing line: ~ # the find method will either return the first object that returns true~ - Inside source: true *** True Line Result - @x -** Processing line: ~ end~ + # the find method will either return the first object that returns true +** Processing line: ~ # for the match clause, or it'll return nil if nothing matches the match clause~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # for the match clause, or it'll return nil if nothing matches the match clause +** Processing line: ~ found = args.state.items.find do |item|~ - Inside source: true *** True Line Result - -** Processing line: ~ def right~ + found = args.state.items.find do |item| +** Processing line: ~ # for each item in args.state.items, run the following boolean check~ - Inside source: true *** True Line Result - def right -** Processing line: ~ @x + @w~ + # for each item in args.state.items, run the following boolean check +** Processing line: ~ args.inputs.mouse.click.point.inside_rect?(item)~ - Inside source: true *** True Line Result - @x + @w -** Processing line: ~ end~ + args.inputs.mouse.click.point.inside_rect?(item) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def bottom~ +** Processing line: ~ # if an item intersects the mouse pointer, then set the item's location to :held and~ - Inside source: true *** True Line Result - def bottom -** Processing line: ~ @y~ + # if an item intersects the mouse pointer, then set the item's location to :held and +** Processing line: ~ # set args.state.held_item to the item for later reference~ - Inside source: true *** True Line Result - @y -** Processing line: ~ end~ + # set args.state.held_item to the item for later reference +** Processing line: ~ if found~ - Inside source: true *** True Line Result - end + if found +** Processing line: ~ args.state.held_item = found~ +- Inside source: true +*** True Line Result + args.state.held_item = found +** Processing line: ~ found[:location] = :held~ +- Inside source: true +*** True Line Result + found[:location] = :held +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def top~ +** Processing line: ~ # if the mouse is clicked and an item is currently beign held....~ - Inside source: true *** True Line Result - def top -** Processing line: ~ @y + @h~ + # if the mouse is clicked and an item is currently beign held.... +** Processing line: ~ elsif args.state.held_item~ - Inside source: true *** True Line Result - @y + @h -** Processing line: ~ end~ + elsif args.state.held_item +** Processing line: ~ # determine if a slot within the craft area was clicked~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # determine if a slot within the craft area was clicked +** Processing line: ~ craft_area = args.state.craft_area.find { |a| args.inputs.mouse.click.point.inside_rect? a }~ - Inside source: true *** True Line Result - end + craft_area = args.state.craft_area.find { |a| args.inputs.mouse.click.point.inside_rect? a } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module AttrSprite~ -- Inside source: true -*** True Line Result - module AttrSprite -** Processing line: ~ include AttrRect~ +** Processing line: ~ # also determine if a slot within the inventory area was clicked~ - Inside source: true *** True Line Result - include AttrRect -** Processing line: ~ include GTK::Geometry~ + # also determine if a slot within the inventory area was clicked +** Processing line: ~ inventory_area = args.state.inventory_area.find { |a| args.inputs.mouse.click.point.inside_rect? a }~ - Inside source: true *** True Line Result - include GTK::Geometry + inventory_area = args.state.inventory_area.find { |a| args.inputs.mouse.click.point.inside_rect? a } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :tile_x,~ +** Processing line: ~ # if the click was within a craft area~ - Inside source: true *** True Line Result - attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :tile_x, -** Processing line: ~ :tile_y, :tile_w, :tile_h, :flip_horizontally,~ + # if the click was within a craft area +** Processing line: ~ if craft_area~ - Inside source: true *** True Line Result - :tile_y, :tile_w, :tile_h, :flip_horizontally, -** Processing line: ~ :flip_vertically, :angle_anchor_x, :angle_anchor_y, :id,~ + if craft_area +** Processing line: ~ # check to see if an item is already there and ignore the click if an item is found~ - 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~ + # check to see if an item is already there and ignore the click if an item is found +** Processing line: ~ # item_at_craft_slot is a helper method that returns an item or nil for a given oridinal~ - Inside source: true *** True Line Result - :source_x, :source_y, :source_w, :source_h + # item_at_craft_slot is a helper method that returns an item or nil for a given oridinal +** Processing line: ~ # position~ +- Inside source: true +*** True Line Result + # position +** Processing line: ~ item_already_there = item_at_craft_slot args, craft_area[:ordinal_x], craft_area[:ordinal_y]~ +- Inside source: true +*** True Line Result + item_already_there = item_at_craft_slot args, craft_area[:ordinal_x], craft_area[:ordinal_y] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def primitive_marker~ +** Processing line: ~ # if an item *doesn't* exist in the craft area~ - Inside source: true *** True Line Result - def primitive_marker -** Processing line: ~ :sprite~ + # if an item *doesn't* exist in the craft area +** Processing line: ~ if !item_already_there~ - Inside source: true *** True Line Result - :sprite -** Processing line: ~ end~ + if !item_already_there +** Processing line: ~ # if the quantity they are currently holding is greater than 1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # if the quantity they are currently holding is greater than 1 +** Processing line: ~ if args.state.held_item[:quantity] > 1~ - Inside source: true *** True Line Result - -** Processing line: ~ def sprite~ + if args.state.held_item[:quantity] > 1 +** Processing line: ~ # remove one item (creating a seperate item of the same type), and place it~ - Inside source: true *** True Line Result - def sprite -** Processing line: ~ self~ + # remove one item (creating a seperate item of the same type), and place it +** Processing line: ~ # at the oridinal position and location of the craft area~ - Inside source: true *** True Line Result - self -** Processing line: ~ end~ + # at the oridinal position and location of the craft area +** Processing line: ~ # the .merge method on Hash creates a new Hash, but updates any values~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # the .merge method on Hash creates a new Hash, but updates any values +** Processing line: ~ # passed as arguments to merge~ - Inside source: true *** True Line Result - -** Processing line: ~ def x1~ + # passed as arguments to merge +** Processing line: ~ new_item = args.state.held_item.merge(quantity: 1,~ - Inside source: true *** True Line Result - def x1 -** Processing line: ~ @x~ + new_item = args.state.held_item.merge(quantity: 1, +** Processing line: ~ location: :craft,~ - Inside source: true *** True Line Result - @x -** Processing line: ~ end~ + location: :craft, +** Processing line: ~ ordinal_x: craft_area[:ordinal_x],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + ordinal_x: craft_area[:ordinal_x], +** Processing line: ~ ordinal_y: craft_area[:ordinal_y])~ - Inside source: true *** True Line Result - -** Processing line: ~ def x1= value~ + ordinal_y: craft_area[:ordinal_y]) +** Processing line: ~~ - Inside source: true *** True Line Result - def x1= value -** Processing line: ~ @x = value~ + +** Processing line: ~ # after the item is crated, place it into the args.state.items collection~ - Inside source: true *** True Line Result - @x = value -** Processing line: ~ end~ + # after the item is crated, place it into the args.state.items collection +** Processing line: ~ args.state.items << new_item~ - Inside source: true *** True Line Result - end + args.state.items << new_item ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def y1~ -- Inside source: true -*** True Line Result - def y1 -** Processing line: ~ @y~ +** Processing line: ~ # then subtract one from the held item~ - Inside source: true *** True Line Result - @y -** Processing line: ~ end~ + # then subtract one from the held item +** Processing line: ~ args.state.held_item[:quantity] -= 1~ - Inside source: true *** True Line Result - end + args.state.held_item[:quantity] -= 1 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def y1= value~ +** Processing line: ~ # if the craft area is available and there is only one item being held~ - Inside source: true *** True Line Result - def y1= value -** Processing line: ~ @y = value~ + # if the craft area is available and there is only one item being held +** Processing line: ~ elsif args.state.held_item[:quantity] == 1~ - Inside source: true *** True Line Result - @y = value -** Processing line: ~ end~ + elsif args.state.held_item[:quantity] == 1 +** Processing line: ~ # instead of creating any new items just set the location of the held item~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # instead of creating any new items just set the location of the held item +** Processing line: ~ # to the oridinal position of the craft area, and then nil out the~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # to the oridinal position of the craft area, and then nil out the +** Processing line: ~ # held item state so that a new item can be picked up~ - 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: ~* console.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* console.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # held item state so that a new item can be picked up +** Processing line: ~ args.state.held_item[:location] = :craft~ +- Inside source: true *** True Line Result - + args.state.held_item[:location] = :craft +** Processing line: ~ args.state.held_item[:ordinal_x] = craft_area[:ordinal_x]~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/console.rb~ + args.state.held_item[:ordinal_x] = craft_area[:ordinal_x] +** Processing line: ~ args.state.held_item[:ordinal_y] = craft_area[:ordinal_y]~ - Inside source: true *** True Line Result - # ./dragon/console.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + args.state.held_item[:ordinal_y] = craft_area[:ordinal_y] +** Processing line: ~ args.state.held_item = nil~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + args.state.held_item = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # console.rb has been released under MIT (*only this file*).~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # console.rb has been released under MIT (*only this file*). + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright:~ +** Processing line: ~ # if the selected area is an inventory area (as opposed to within the craft area)~ - Inside source: true *** True Line Result - # Contributors outside of DragonRuby who also hold Copyright: -** Processing line: ~ # - Kevin Fischer: https://github.com/kfischer-okarin~ + # if the selected area is an inventory area (as opposed to within the craft area) +** Processing line: ~ elsif inventory_area~ - Inside source: true *** True Line Result - # - Kevin Fischer: https://github.com/kfischer-okarin + elsif inventory_area ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ # check to see if there is already an item in that inventory slot~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Console~ + # check to see if there is already an item in that inventory slot +** Processing line: ~ # the item_at_inventory_slot helper method returns an item or nil~ - Inside source: true *** True Line Result - class Console -** Processing line: ~ include ConsoleDeprecated~ + # the item_at_inventory_slot helper method returns an item or nil +** Processing line: ~ item_already_there = item_at_inventory_slot args, inventory_area[:ordinal_x], inventory_area[:ordinal_y]~ - Inside source: true *** True Line Result - include ConsoleDeprecated + item_already_there = item_at_inventory_slot args, inventory_area[:ordinal_x], inventory_area[:ordinal_y] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ attr_accessor :show_reason, :log, :logo, :background_color,~ +** Processing line: ~ # if there is already an item there, and the item types/id match~ - Inside source: true *** True Line Result - attr_accessor :show_reason, :log, :logo, :background_color, -** Processing line: ~ :text_color, :animation_duration,~ + # if there is already an item there, and the item types/id match +** Processing line: ~ if item_already_there && item_already_there[:id] == args.state.held_item[:id]~ - Inside source: true *** True Line Result - :text_color, :animation_duration, -** Processing line: ~ :max_log_lines, :max_history, :log,~ + if item_already_there && item_already_there[:id] == args.state.held_item[:id] +** Processing line: ~ # then merge the item quantities~ - Inside source: true *** True Line Result - :max_log_lines, :max_history, :log, -** Processing line: ~ :last_command_errored, :last_command, :error_color, :shown_at,~ + # then merge the item quantities +** Processing line: ~ held_quantity = args.state.held_item[:quantity]~ - Inside source: true *** True Line Result - :last_command_errored, :last_command, :error_color, :shown_at, -** Processing line: ~ :header_color, :archived_log, :last_log_lines, :last_log_lines_count,~ + held_quantity = args.state.held_item[:quantity] +** Processing line: ~ item_already_there[:quantity] += held_quantity~ - Inside source: true *** True Line Result - :header_color, :archived_log, :last_log_lines, :last_log_lines_count, -** Processing line: ~ :suppress_left_arrow_behavior, :command_set_at,~ + item_already_there[:quantity] += held_quantity +** Processing line: ~~ - Inside source: true *** True Line Result - :suppress_left_arrow_behavior, :command_set_at, -** Processing line: ~ :toast_ids, :bottom,~ + +** Processing line: ~ # remove the item being held from the items collection (since it's quantity is now 0)~ - Inside source: true *** True Line Result - :toast_ids, :bottom, -** Processing line: ~ :font_style, :menu~ + # remove the item being held from the items collection (since it's quantity is now 0) +** Processing line: ~ args.state.items.reject! { |i| i[:location] == :held }~ - Inside source: true *** True Line Result - :font_style, :menu + args.state.items.reject! { |i| i[:location] == :held } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def initialize~ +** Processing line: ~ # nil out the held_item so a new item can be picked up~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1, line_height: 1.1)~ + # nil out the held_item so a new item can be picked up +** Processing line: ~ args.state.held_item = nil~ - Inside source: true *** True Line Result - @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1, line_height: 1.1) -** Processing line: ~ @menu = Menu.new self~ + args.state.held_item = nil +** Processing line: ~~ - Inside source: true *** True Line Result - @menu = Menu.new self -** Processing line: ~ @disabled = false~ + +** Processing line: ~ # if there currently isn't an item there, then put the held item in the slot~ - Inside source: true *** True Line Result - @disabled = false -** Processing line: ~ @log_offset = 0~ + # if there currently isn't an item there, then put the held item in the slot +** Processing line: ~ elsif !item_already_there~ - Inside source: true *** True Line Result - @log_offset = 0 -** Processing line: ~ @visible = false~ + elsif !item_already_there +** Processing line: ~ args.state.held_item[:location] = :inventory~ - Inside source: true *** True Line Result - @visible = false -** Processing line: ~ @toast_ids = []~ + args.state.held_item[:location] = :inventory +** Processing line: ~ args.state.held_item[:ordinal_x] = inventory_area[:ordinal_x]~ - Inside source: true *** True Line Result - @toast_ids = [] -** Processing line: ~ @archived_log = []~ + args.state.held_item[:ordinal_x] = inventory_area[:ordinal_x] +** Processing line: ~ args.state.held_item[:ordinal_y] = inventory_area[:ordinal_y]~ - Inside source: true *** True Line Result - @archived_log = [] -** Processing line: ~ @log = [ 'Console ready.' ]~ + args.state.held_item[:ordinal_y] = inventory_area[:ordinal_y] +** Processing line: ~~ - Inside source: true *** True Line Result - @log = [ 'Console ready.' ] -** Processing line: ~ @max_log_lines = 1000 # I guess...?~ + +** Processing line: ~ # nil out the held_item so a new item can be picked up~ - Inside source: true *** True Line Result - @max_log_lines = 1000 # I guess...? -** Processing line: ~ @max_history = 1000 # I guess...?~ + # nil out the held_item so a new item can be picked up +** Processing line: ~ args.state.held_item = nil~ - Inside source: true *** True Line Result - @max_history = 1000 # I guess...? -** Processing line: ~ @log_invocation_count = 0~ + args.state.held_item = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - @log_invocation_count = 0 -** Processing line: ~ @command_history = []~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - @command_history = [] -** Processing line: ~ @command_history_index = -1~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - @command_history_index = -1 -** Processing line: ~ @nonhistory_input = ''~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - @nonhistory_input = '' -** Processing line: ~ @logo = 'console-logo.png'~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @logo = 'console-logo.png' -** Processing line: ~ @history_fname = 'console_history.txt'~ + +** Processing line: ~ # the calc method is executed after input~ - Inside source: true *** True Line Result - @history_fname = 'console_history.txt' -** Processing line: ~ @background_color = Color.new [0, 0, 0, 224]~ + # the calc method is executed after input +** Processing line: ~ def calc args~ - Inside source: true *** True Line Result - @background_color = Color.new [0, 0, 0, 224] -** Processing line: ~ @text_color = Color.new [255, 255, 255]~ + def calc args +** Processing line: ~ # make sure that the real position of the inventory~ - Inside source: true *** True Line Result - @text_color = Color.new [255, 255, 255] -** Processing line: ~ @error_color = Color.new [200, 50, 50]~ + # make sure that the real position of the inventory +** Processing line: ~ # items are updated every frame to ensure that they~ - Inside source: true *** True Line Result - @error_color = Color.new [200, 50, 50] -** Processing line: ~ @header_color = Color.new [100, 200, 220]~ + # items are updated every frame to ensure that they +** Processing line: ~ # are placed correctly given their location and oridinal positions~ - Inside source: true *** True Line Result - @header_color = Color.new [100, 200, 220] -** Processing line: ~ @animation_duration = 1.seconds~ + # are placed correctly given their location and oridinal positions +** Processing line: ~ # instead of using .map, here we use .each (since we are not returning a new item and just updating the items in place)~ - Inside source: true *** True Line Result - @animation_duration = 1.seconds -** Processing line: ~ @shown_at = -1~ + # instead of using .map, here we use .each (since we are not returning a new item and just updating the items in place) +** Processing line: ~ args.state.items.each do |item|~ - Inside source: true *** True Line Result - @shown_at = -1 -** Processing line: ~ load_history~ + args.state.items.each do |item| +** Processing line: ~ # based on the location of the item, invoke the correct pixel conversion method~ - Inside source: true *** True Line Result - load_history -** Processing line: ~ end~ + # based on the location of the item, invoke the correct pixel conversion method +** Processing line: ~ if item[:location] == :inventory~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if item[:location] == :inventory +** Processing line: ~ set_inventory_position args, item~ - Inside source: true *** True Line Result - -** Processing line: ~ def console_text_width~ + set_inventory_position args, item +** Processing line: ~ elsif item[:location] == :craft~ - Inside source: true *** True Line Result - def console_text_width -** Processing line: ~ @console_text_width ||= ($gtk.logical_width - 20).idiv(font_style.letter_size.x)~ + elsif item[:location] == :craft +** Processing line: ~ set_craft_position args, item~ - Inside source: true *** True Line Result - @console_text_width ||= ($gtk.logical_width - 20).idiv(font_style.letter_size.x) -** Processing line: ~ end~ + set_craft_position args, item +** Processing line: ~ elsif item[:location] == :held~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif item[:location] == :held +** Processing line: ~ # if the item is held, center the item around the mouse pointer~ - Inside source: true *** True Line Result - -** Processing line: ~ def save_history~ + # if the item is held, center the item around the mouse pointer +** Processing line: ~ args.state.held_item.x = args.inputs.mouse.x - args.state.held_item.w.half~ - Inside source: true *** True Line Result - def save_history -** Processing line: ~ $gtk.ffi_file.write_root @history_fname, (@command_history.reverse.join "\n")~ + args.state.held_item.x = args.inputs.mouse.x - args.state.held_item.w.half +** Processing line: ~ args.state.held_item.y = args.inputs.mouse.y - args.state.held_item.h.half~ - Inside source: true *** True Line Result - $gtk.ffi_file.write_root @history_fname, (@command_history.reverse.join "\n") + args.state.held_item.y = args.inputs.mouse.y - args.state.held_item.h.half ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ def load_history~ -- Inside source: true -*** True Line Result - def load_history -** Processing line: ~ @command_history.clear~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - @command_history.clear -** Processing line: ~ str = $gtk.ffi_file.read @history_fname~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - str = $gtk.ffi_file.read @history_fname -** Processing line: ~ return if str.nil? # no history to load.~ + +** Processing line: ~ # for each hash/sprite in the click ripples queue,~ - Inside source: true *** True Line Result - return if str.nil? # no history to load. -** Processing line: ~~ + # for each hash/sprite in the click ripples queue, +** Processing line: ~ # expand its size by 20 percent and decrease its alpha~ - Inside source: true *** True Line Result - -** Processing line: ~ str.chomp!("\n") # Don't let endlines at the end cause extra blank line.~ + # expand its size by 20 percent and decrease its alpha +** Processing line: ~ # by 10.~ - Inside source: true *** True Line Result - str.chomp!("\n") # Don't let endlines at the end cause extra blank line. -** Processing line: ~ str.chomp!("\r")~ + # by 10. +** Processing line: ~ args.state.click_ripples.each do |ripple|~ - Inside source: true *** True Line Result - str.chomp!("\r") -** Processing line: ~ str.each_line { |s|~ + args.state.click_ripples.each do |ripple| +** Processing line: ~ delta_w = ripple.w * 1.2 - ripple.w~ - Inside source: true *** True Line Result - str.each_line { |s| -** Processing line: ~ s.chomp!("\n")~ + delta_w = ripple.w * 1.2 - ripple.w +** Processing line: ~ delta_h = ripple.h * 1.2 - ripple.h~ - Inside source: true *** True Line Result - s.chomp!("\n") -** Processing line: ~ s.chomp!("\r")~ + delta_h = ripple.h * 1.2 - ripple.h +** Processing line: ~ ripple.x -= delta_w.half~ - Inside source: true *** True Line Result - s.chomp!("\r") -** Processing line: ~ if s.length > 0~ + ripple.x -= delta_w.half +** Processing line: ~ ripple.y -= delta_h.half~ - Inside source: true *** True Line Result - if s.length > 0 -** Processing line: ~ @command_history.unshift s~ + ripple.y -= delta_h.half +** Processing line: ~ ripple.w += delta_w~ - Inside source: true *** True Line Result - @command_history.unshift s -** Processing line: ~ break if @command_history.length >= @max_history~ + ripple.w += delta_w +** Processing line: ~ ripple.h += delta_h~ - Inside source: true *** True Line Result - break if @command_history.length >= @max_history -** Processing line: ~ end~ + ripple.h += delta_h +** Processing line: ~ ripple.a -= 10~ - Inside source: true *** True Line Result - end -** Processing line: ~ }~ + ripple.a -= 10 +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @command_history.uniq!~ -- Inside source: true -*** True Line Result - @command_history.uniq! -** Processing line: ~ end~ +** Processing line: ~ # remove any items from the collection where the alpha value is less than equal to~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # remove any items from the collection where the alpha value is less than equal to +** Processing line: ~ # zero using the reject! method (reject with an exclamation point at the end changes the~ - Inside source: true *** True Line Result - -** Processing line: ~ def disable~ + # zero using the reject! method (reject with an exclamation point at the end changes the +** Processing line: ~ # array value in place, while reject without the exclamation point returns a new array).~ - Inside source: true *** True Line Result - def disable -** Processing line: ~ @disabled = true~ + # array value in place, while reject without the exclamation point returns a new array). +** Processing line: ~ args.state.click_ripples.reject! { |ripple| ripple.a <= 0 }~ - Inside source: true *** True Line Result - @disabled = true -** Processing line: ~ end~ + args.state.click_ripples.reject! { |ripple| ripple.a <= 0 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def enable~ +** Processing line: ~ # helper function for finding an item at a craft slot~ - Inside source: true *** True Line Result - def enable -** Processing line: ~ @disabled = false~ + # helper function for finding an item at a craft slot +** Processing line: ~ def item_at_craft_slot args, ordinal_x, ordinal_y~ - Inside source: true *** True Line Result - @disabled = false -** Processing line: ~ end~ + def item_at_craft_slot args, ordinal_x, ordinal_y +** Processing line: ~ args.state.items.find { |i| i[:location] == :craft && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y }~ - Inside source: true *** True Line Result - end + args.state.items.find { |i| i[:location] == :craft && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def add_sprite obj~ +** Processing line: ~ # helper function for finding an item at an inventory slot~ - Inside source: true *** True Line Result - def add_sprite obj -** Processing line: ~ @log_invocation_count += 1~ + # helper function for finding an item at an inventory slot +** Processing line: ~ def item_at_inventory_slot args, ordinal_x, ordinal_y~ - Inside source: true *** True Line Result - @log_invocation_count += 1 -** Processing line: ~ obj[:id] ||= "id_#{obj[:path]}_#{Time.now.to_i}".to_sym~ + def item_at_inventory_slot args, ordinal_x, ordinal_y +** Processing line: ~ args.state.items.find { |i| i[:location] == :inventory && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y }~ - Inside source: true *** True Line Result - obj[:id] ||= "id_#{obj[:path]}_#{Time.now.to_i}".to_sym + args.state.items.find { |i| i[:location] == :inventory && i[:ordinal_x] == ordinal_x && i[:ordinal_y] == ordinal_y } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if @last_line_log_index &&~ +** Processing line: ~ # helper function that creates a visual representation of an item~ - Inside source: true *** True Line Result - if @last_line_log_index && -** Processing line: ~ @last_sprite_line.is_a?(Hash) &&~ + # helper function that creates a visual representation of an item +** Processing line: ~ def item_prefab args, item, should_highlight, mouse~ - Inside source: true *** True Line Result - @last_sprite_line.is_a?(Hash) && -** Processing line: ~ @last_sprite_line[:id] == obj[:id]~ + def item_prefab args, item, should_highlight, mouse +** Processing line: ~ return nil unless item~ - Inside source: true *** True Line Result - @last_sprite_line[:id] == obj[:id] + return nil unless item ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @log[@last_line_log_index] = obj~ -- Inside source: true -*** True Line Result - @log[@last_line_log_index] = obj -** Processing line: ~ return~ -- Inside source: true -*** True Line Result - return -** Processing line: ~ end~ +** Processing line: ~ overlay = nil~ - Inside source: true *** True Line Result - end + overlay = nil ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @log << obj~ -- Inside source: true -*** True Line Result - @log << obj -** Processing line: ~ @last_line_log_index = @log.length - 1~ +** Processing line: ~ x = item.x~ - Inside source: true *** True Line Result - @last_line_log_index = @log.length - 1 -** Processing line: ~ @last_sprite_line = obj~ + x = item.x +** Processing line: ~ y = item.y~ - Inside source: true *** True Line Result - @last_sprite_line = obj -** Processing line: ~ nil~ + y = item.y +** Processing line: ~ w = item.w~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + w = item.w +** Processing line: ~ h = item.h~ - Inside source: true *** True Line Result - end + h = item.h ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def add_primitive obj~ -- Inside source: true -*** True Line Result - def add_primitive obj -** Processing line: ~ if obj.is_a? Hash~ +** Processing line: ~ if should_highlight && mouse.point.inside_rect?(item)~ - Inside source: true *** True Line Result - if obj.is_a? Hash -** Processing line: ~ add_sprite obj~ + if should_highlight && mouse.point.inside_rect?(item) +** Processing line: ~ overlay = { x: x, y: y, w: w, h: h, path: "sprites/square-blue.png", a: 130, }~ - Inside source: true *** True Line Result - add_sprite obj -** Processing line: ~ else~ + overlay = { x: x, y: y, w: w, h: h, path: "sprites/square-blue.png", a: 130, } +** Processing line: ~ end~ - Inside source: true *** True Line Result - else -** Processing line: ~ add_text obj~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - add_text obj -** Processing line: ~ end~ + +** Processing line: ~ [~ - Inside source: true *** True Line Result - end -** Processing line: ~ nil~ + [ +** Processing line: ~ # sprites are hashes with a path property, this is the main sprite~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + # sprites are hashes with a path property, this is the main sprite +** Processing line: ~ { x: x, y: y, w: args.state.sprite_size, h: args.state.sprite_size, path: item[:path], },~ - Inside source: true *** True Line Result - end + { x: x, y: y, w: args.state.sprite_size, h: args.state.sprite_size, path: item[:path], }, ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def add_text obj~ +** Processing line: ~ # this represents the black area in the bottom right corner of the main sprite so that the~ - Inside source: true *** True Line Result - def add_text obj -** Processing line: ~ @last_log_lines_count ||= 1~ + # this represents the black area in the bottom right corner of the main sprite so that the +** Processing line: ~ # quantity is visible~ - Inside source: true *** True Line Result - @last_log_lines_count ||= 1 -** Processing line: ~ @log_invocation_count += 1~ + # quantity is visible +** Processing line: ~ { x: x + 55, y: y, w: 25, h: 25, path: "sprites/square-black.png", }, # sprites are hashes with a path property~ - Inside source: true *** True Line Result - @log_invocation_count += 1 + { x: x + 55, y: y, w: 25, h: 25, path: "sprites/square-black.png", }, # sprites are hashes with a path property ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ str = obj.to_s~ -- Inside source: true -*** True Line Result - str = obj.to_s -** Processing line: ~~ +** Processing line: ~ # labels are hashes with a text property~ - Inside source: true *** True Line Result - -** Processing line: ~ log_lines = []~ + # labels are hashes with a text property +** Processing line: ~ { x: x + 56, y: y + 22, text: "#{item[:quantity]}", r: 255, g: 255, b: 255, },~ - Inside source: true *** True Line Result - log_lines = [] + { x: x + 56, y: y + 22, text: "#{item[:quantity]}", r: 255, g: 255, b: 255, }, ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ str.each_line do |s|~ -- Inside source: true -*** True Line Result - str.each_line do |s| -** Processing line: ~ s.wrapped_lines(self.console_text_width).each do |l|~ +** Processing line: ~ # this is the mouse overlay, if the overlay isn't applicable, then this value will be nil (nil values will not be rendered)~ - Inside source: true *** True Line Result - s.wrapped_lines(self.console_text_width).each do |l| -** Processing line: ~ log_lines << l~ + # this is the mouse overlay, if the overlay isn't applicable, then this value will be nil (nil values will not be rendered) +** Processing line: ~ overlay~ - Inside source: true *** True Line Result - log_lines << l -** Processing line: ~ end~ + overlay +** Processing line: ~ ]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if log_lines == @last_log_lines~ +** Processing line: ~ # helper function for deriving the position of an item within inventory~ - Inside source: true *** True Line Result - if log_lines == @last_log_lines -** Processing line: ~ @last_log_lines_count += 1~ + # helper function for deriving the position of an item within inventory +** Processing line: ~ def set_inventory_position args, item~ - Inside source: true *** True Line Result - @last_log_lines_count += 1 -** Processing line: ~ new_log_line_with_count = @last_log_lines.last + " (#{@last_log_lines_count})"~ + def set_inventory_position args, item +** Processing line: ~ item.x = args.state.inventory_border.x + item[:ordinal_x] * 80~ - Inside source: true *** True Line Result - new_log_line_with_count = @last_log_lines.last + " (#{@last_log_lines_count})" -** Processing line: ~ if log_lines.length > 1~ + item.x = args.state.inventory_border.x + item[:ordinal_x] * 80 +** Processing line: ~ item.y = (args.state.inventory_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80~ - Inside source: true *** True Line Result - if log_lines.length > 1 -** Processing line: ~ @log = @log[0..-(@log.length - log_lines.length)] + log_lines[0..-2] + [new_log_line_with_count]~ + item.y = (args.state.inventory_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80 +** Processing line: ~ item.w = 80~ - Inside source: true *** True Line Result - @log = @log[0..-(@log.length - log_lines.length)] + log_lines[0..-2] + [new_log_line_with_count] -** Processing line: ~ else~ + item.w = 80 +** Processing line: ~ item.h = 80~ - Inside source: true *** True Line Result - else -** Processing line: ~ @log = @log[0..-2] + [new_log_line_with_count]~ + item.h = 80 +** Processing line: ~ end~ - Inside source: true *** True Line Result - @log = @log[0..-2] + [new_log_line_with_count] -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ return~ + +** Processing line: ~ # helper function for deriving the position of an item within the craft area~ - Inside source: true *** True Line Result - return -** Processing line: ~ end~ + # helper function for deriving the position of an item within the craft area +** Processing line: ~ def set_craft_position args, item~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def set_craft_position args, item +** Processing line: ~ item.x = args.state.craft_border.x + item[:ordinal_x] * 80~ - Inside source: true *** True Line Result - -** Processing line: ~ log_lines.each do |l|~ + item.x = args.state.craft_border.x + item[:ordinal_x] * 80 +** Processing line: ~ item.y = (args.state.craft_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80~ - Inside source: true *** True Line Result - log_lines.each do |l| -** Processing line: ~ @log.shift if @log.length > @max_log_lines~ + item.y = (args.state.craft_border.y + args.state.inventory_border.h - 80) - item[:ordinal_y] * 80 +** Processing line: ~ item.w = 80~ - Inside source: true *** True Line Result - @log.shift if @log.length > @max_log_lines -** Processing line: ~ @log << l~ + item.w = 80 +** Processing line: ~ item.h = 80~ - Inside source: true *** True Line Result - @log << l -** Processing line: ~ end~ + item.h = 80 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @last_log_lines_count = 1~ +** Processing line: ~ # Any lines outside of a function will be executed when the file is reloaded.~ - Inside source: true *** True Line Result - @last_log_lines_count = 1 -** Processing line: ~ @last_log_lines = log_lines~ + # Any lines outside of a function will be executed when the file is reloaded. +** Processing line: ~ # So every time you save main.rb, the game will be reset.~ - Inside source: true *** True Line Result - @last_log_lines = log_lines -** Processing line: ~ nil~ + # So every time you save main.rb, the game will be reset. +** Processing line: ~ # Comment out the line below if you don't want this to happen.~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + # Comment out the line below if you don't want this to happen. +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - end + $gtk.reset ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def ready?~ -- Inside source: true -*** True Line Result - def ready? -** Processing line: ~ visible? && @toggled_at.elapsed?(@animation_duration, Kernel.global_tick_count)~ -- Inside source: true -*** True Line Result - visible? && @toggled_at.elapsed?(@animation_duration, Kernel.global_tick_count) -** 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: ~ def hidden?~ -- Inside source: true -*** True Line Result - def hidden? -** Processing line: ~ !@visible~ -- Inside source: true +** Processing line: ~*** Dev Tools - Add Buttons To Console - main.rb~ +- Header detected. *** True Line Result - !@visible -** Processing line: ~ end~ -- Inside source: true + *** True Line Result - end -** Processing line: ~~ -- Inside source: true +*** Dev Tools - Add Buttons To Console - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ def visible?~ -- Inside source: true *** True Line Result - def visible? -** Processing line: ~ @visible~ +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_dev_tools/add_buttons_to_console/app/main.rb~ - Inside source: true *** True Line Result - @visible -** Processing line: ~ end~ + # ./samples/99_genre_dev_tools/add_buttons_to_console/app/main.rb +** Processing line: ~ # You can customize the buttons that show up in the Console.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # You can customize the buttons that show up in the Console. +** Processing line: ~ class GTK::Console::Menu~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + class GTK::Console::Menu +** Processing line: ~ # STEP 1: Override the custom_buttons function.~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def show reason = nil~ + # STEP 1: Override the custom_buttons function. +** Processing line: ~ def custom_buttons~ - Inside source: true *** True Line Result - def show reason = nil -** Processing line: ~ @shown_at = Kernel.global_tick_count~ + def custom_buttons +** Processing line: ~ [~ - Inside source: true *** True Line Result - @shown_at = Kernel.global_tick_count -** Processing line: ~ @show_reason = reason~ + [ +** Processing line: ~ (button id: :yay,~ - Inside source: true *** True Line Result - @show_reason = reason -** Processing line: ~ toggle if hidden?~ + (button id: :yay, +** Processing line: ~ # row for button~ - Inside source: true *** True Line Result - toggle if hidden? -** Processing line: ~ end~ + # row for button +** Processing line: ~ row: 3,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + row: 3, +** Processing line: ~ # column for button~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + # column for button +** Processing line: ~ col: 10,~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def hide~ + col: 10, +** Processing line: ~ # text~ - Inside source: true *** True Line Result - def hide -** Processing line: ~ if visible?~ + # text +** Processing line: ~ text: "I AM CUSTOM",~ - Inside source: true *** True Line Result - if visible? -** Processing line: ~ toggle~ + text: "I AM CUSTOM", +** Processing line: ~ # when clicked call the custom_button_clicked function~ - Inside source: true *** True Line Result - toggle -** Processing line: ~ @archived_log += @log~ + # when clicked call the custom_button_clicked function +** Processing line: ~ method: :custom_button_clicked),~ - Inside source: true *** True Line Result - @archived_log += @log -** Processing line: ~ if @archived_log.length > @max_log_lines~ + method: :custom_button_clicked), +** Processing line: ~~ - Inside source: true *** True Line Result - if @archived_log.length > @max_log_lines -** Processing line: ~ @archived_log = @archived_log.drop(@archived_log.length - @max_log_lines)~ + +** Processing line: ~ (button id: :yay,~ - Inside source: true *** True Line Result - @archived_log = @archived_log.drop(@archived_log.length - @max_log_lines) -** Processing line: ~ end~ + (button id: :yay, +** Processing line: ~ # row for button~ - Inside source: true *** True Line Result - end -** Processing line: ~ @log.clear~ + # row for button +** Processing line: ~ row: 3,~ - Inside source: true *** True Line Result - @log.clear -** Processing line: ~ @show_reason = nil~ + row: 3, +** Processing line: ~ # column for button~ - Inside source: true *** True Line Result - @show_reason = nil -** Processing line: ~ clear_toast~ + # column for button +** Processing line: ~ col: 9,~ - Inside source: true *** True Line Result - clear_toast -** Processing line: ~ end~ + col: 9, +** Processing line: ~ # text~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # text +** Processing line: ~ text: "CUSTOM ALSO",~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + text: "CUSTOM ALSO", +** Processing line: ~ # when clicked call the custom_button_also_clicked function~ - Inside source: true *** True Line Result - -** Processing line: ~ def close~ + # when clicked call the custom_button_also_clicked function +** Processing line: ~ method: :custom_button_also_clicked)~ - Inside source: true *** True Line Result - def close -** Processing line: ~ hide~ + method: :custom_button_also_clicked) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - hide -** Processing line: ~ end~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def clear_toast~ +** Processing line: ~ # STEP 2: Define the function that should be called.~ - Inside source: true *** True Line Result - def clear_toast -** Processing line: ~ @toasted_at = nil~ + # STEP 2: Define the function that should be called. +** Processing line: ~ def custom_button_clicked~ - Inside source: true *** True Line Result - @toasted_at = nil -** Processing line: ~ @toast_duration = 0~ + def custom_button_clicked +** Processing line: ~ log "* INFO: I AM CUSTOM was clicked!"~ - Inside source: true *** True Line Result - @toast_duration = 0 -** Processing line: ~ end~ + log "* INFO: I AM CUSTOM was clicked!" +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def toggle~ -- Inside source: true -*** True Line Result - def toggle -** Processing line: ~ @visible = !@visible~ -- Inside source: true -*** True Line Result - @visible = !@visible -** Processing line: ~ @toggled_at = Kernel.global_tick_count~ +** Processing line: ~ def custom_button_also_clicked~ - Inside source: true *** True Line Result - @toggled_at = Kernel.global_tick_count -** Processing line: ~ end~ + def custom_button_also_clicked +** Processing line: ~ log "* INFO: Custom Button Clicked at #{Kernel.global_tick_count}!"~ - Inside source: true *** True Line Result - end + log "* INFO: Custom Button Clicked at #{Kernel.global_tick_count}!" ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def currently_toasting?~ +** Processing line: ~ all_buttons_as_string = $gtk.console.menu.buttons.map do |b|~ - Inside source: true *** True Line Result - def currently_toasting? -** Processing line: ~ return false if hidden?~ + all_buttons_as_string = $gtk.console.menu.buttons.map do |b| +** Processing line: ~ <<-S.strip~ - Inside source: true *** True Line Result - return false if hidden? -** Processing line: ~ return false unless @show_reason == :toast~ + <<-S.strip +** Processing line: ~ ** id: #{b[:id]}~ - Inside source: true *** True Line Result - return false unless @show_reason == :toast -** Processing line: ~ return false unless @toasted_at~ + ** id: #{b[:id]} +** Processing line: ~ :PROPERTIES:~ - Inside source: true *** True Line Result - return false unless @toasted_at -** Processing line: ~ return false if @toasted_at.elapsed?(5.seconds, Kernel.global_tick_count)~ + :PROPERTIES: +** Processing line: ~ :id: :#{b[:id]}~ - Inside source: true *** True Line Result - return false if @toasted_at.elapsed?(5.seconds, Kernel.global_tick_count) -** Processing line: ~ return true~ + :id: :#{b[:id]} +** Processing line: ~ :method: :#{b[:method]}~ - Inside source: true *** True Line Result - return true -** Processing line: ~ end~ + :method: :#{b[:method]} +** Processing line: ~ :text: #{b[:text]}~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + :text: #{b[:text]} +** Processing line: ~ :END:~ - Inside source: true *** True Line Result - -** Processing line: ~ def toast_extended id = nil, duration = nil, *messages~ + :END: +** Processing line: ~ S~ - Inside source: true *** True Line Result - def toast_extended id = nil, duration = nil, *messages -** Processing line: ~ if !id.is_a?(Symbol)~ + S +** Processing line: ~ end.join("\n")~ - Inside source: true *** True Line Result - if !id.is_a?(Symbol) -** Processing line: ~ raise <<-S~ + end.join("\n") +** Processing line: ~~ - Inside source: true *** True Line Result - raise <<-S -** Processing line: ~ * ERROR:~ + +** Processing line: ~ log <<-S~ - Inside source: true *** True Line Result - * ERROR: -** Processing line: ~ args.gtk.console.toast has the following signature:~ + log <<-S +** Processing line: ~ * INFO: Here are all the buttons:~ - Inside source: true *** True Line Result - args.gtk.console.toast has the following signature: -** Processing line: ~~ + * INFO: Here are all the buttons: +** Processing line: ~ #{all_buttons_as_string}~ - Inside source: true *** True Line Result - -** Processing line: ~ def toast id, *messages~ + #{all_buttons_as_string} +** Processing line: ~ S~ - Inside source: true *** True Line Result - def toast id, *messages + 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: ~ The id property uniquely defines the message and must be~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - The id property uniquely defines the message and must be -** Processing line: ~ a symbol.~ + def tick args +** Processing line: ~ args.outputs.labels << [args.grid.center.x, args.grid.center.y,~ - Inside source: true *** True Line Result - a symbol. -** Processing line: ~~ + args.outputs.labels << [args.grid.center.x, args.grid.center.y, +** Processing line: ~ "Open the DragonRuby Console to see the custom menu items.",~ - Inside source: true *** True Line Result - -** Processing line: ~ After that, you can provide all the objects you want to~ + "Open the DragonRuby Console to see the custom menu items.", +** Processing line: ~ 0, 1]~ - Inside source: true *** True Line Result - After that, you can provide all the objects you want to -** Processing line: ~ look at.~ + 0, 1] +** Processing line: ~ end~ - Inside source: true *** True Line Result - look at. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Example:~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - Example: +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ args.gtk.console.toast :say_hello,~ +** Processing line: ~*** Dev Tools - Animation Creator Starting Point - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Dev Tools - Animation Creator 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_dev_tools/animation_creator_starting_point/app/main.rb~ - Inside source: true *** True Line Result - args.gtk.console.toast :say_hello, -** Processing line: ~ \"Hello world.\",~ + # ./samples/99_genre_dev_tools/animation_creator_starting_point/app/main.rb +** Processing line: ~ class OneBitLowrezPaint~ - Inside source: true *** True Line Result - \"Hello world.\", -** Processing line: ~ args.state.tick_count~ + class OneBitLowrezPaint +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - args.state.tick_count + attr_gtk ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Toast messages autohide after 5 seconds.~ +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - Toast messages autohide after 5 seconds. -** Processing line: ~~ + def tick +** Processing line: ~ outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - -** Processing line: ~ If you need to look at something for longer, use~ + outputs.background_color = [0, 0, 0] +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - If you need to look at something for longer, use -** Processing line: ~ args.gtk.console.perma_toast instead (which you can manually dismiss).~ + defaults +** Processing line: ~ render_instructions~ - Inside source: true *** True Line Result - args.gtk.console.perma_toast instead (which you can manually dismiss). -** Processing line: ~~ + render_instructions +** Processing line: ~ render_canvas~ - Inside source: true *** True Line Result - -** Processing line: ~ S~ + render_canvas +** Processing line: ~ render_buttons_frame_selection~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + render_buttons_frame_selection +** Processing line: ~ render_animation_frame_thumbnails~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + render_animation_frame_thumbnails +** Processing line: ~ render_animation~ - Inside source: true *** True Line Result - -** Processing line: ~ return if currently_toasting?~ + render_animation +** Processing line: ~ input_mouse_click~ - Inside source: true *** True Line Result - return if currently_toasting? -** Processing line: ~ return if @toast_ids.include? id~ + input_mouse_click +** Processing line: ~ input_keyboard~ - Inside source: true *** True Line Result - return if @toast_ids.include? id -** Processing line: ~ @toasted_at = Kernel.global_tick_count~ + input_keyboard +** Processing line: ~ calc_auto_export~ - Inside source: true *** True Line Result - @toasted_at = Kernel.global_tick_count -** Processing line: ~ log_once_info :perma_toast_tip, "Use console.perma_toast to show the toast for longer."~ + calc_auto_export +** Processing line: ~ calc_buttons_frame_selection~ - Inside source: true *** True Line Result - log_once_info :perma_toast_tip, "Use console.perma_toast to show the toast for longer." -** Processing line: ~ dwim_duration = 5.seconds~ + calc_buttons_frame_selection +** Processing line: ~ calc_animation_frames~ - Inside source: true *** True Line Result - dwim_duration = 5.seconds -** Processing line: ~ add_text "* toast :#{id}"~ + calc_animation_frames +** Processing line: ~ process_queue_create_sprite~ - Inside source: true *** True Line Result - add_text "* toast :#{id}" -** Processing line: ~ puts "* TOAST: :#{id}"~ + process_queue_create_sprite +** Processing line: ~ process_queue_reset_sprite~ - Inside source: true *** True Line Result - puts "* TOAST: :#{id}" -** Processing line: ~ messages.each do |message|~ + process_queue_reset_sprite +** Processing line: ~ process_queue_update_rt_animation_frame~ - Inside source: true *** True Line Result - messages.each do |message| -** Processing line: ~ lines = message.to_s.wrapped_lines(self.console_text_width)~ + process_queue_update_rt_animation_frame +** Processing line: ~ end~ - Inside source: true *** True Line Result - lines = message.to_s.wrapped_lines(self.console_text_width) -** Processing line: ~ dwim_duration += lines.length.seconds~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - dwim_duration += lines.length.seconds -** Processing line: ~ add_text "** #{message}"~ + +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - add_text "** #{message}" -** Processing line: ~ puts "** #{message}"~ + def defaults +** Processing line: ~ state.animation_frames_per_second = 12~ - Inside source: true *** True Line Result - puts "** #{message}" -** Processing line: ~ end~ + state.animation_frames_per_second = 12 +** Processing line: ~ queues.create_sprite ||= []~ - Inside source: true *** True Line Result - end -** Processing line: ~ show :toast~ + queues.create_sprite ||= [] +** Processing line: ~ queues.reset_sprite ||= []~ - Inside source: true *** True Line Result - show :toast -** Processing line: ~ @toast_duration += duration || dwim_duration~ + queues.reset_sprite ||= [] +** Processing line: ~ queues.update_rt_animation_frame ||= []~ - Inside source: true *** True Line Result - @toast_duration += duration || dwim_duration -** Processing line: ~ @toast_ids << id~ + queues.update_rt_animation_frame ||= [] +** Processing line: ~~ - Inside source: true *** True Line Result - @toast_ids << id -** Processing line: ~ set_command "$gtk.console.hide"~ + +** Processing line: ~ if !state.animation_frames~ - Inside source: true *** True Line Result - set_command "$gtk.console.hide" + if !state.animation_frames +** Processing line: ~ state.animation_frames ||= []~ +- Inside source: true +*** True Line Result + state.animation_frames ||= [] +** Processing line: ~ add_animation_frame_to_end~ +- Inside source: true +*** True Line Result + add_animation_frame_to_end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -92947,366 +96820,378 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def perma_toast id = nil, messages~ -- Inside source: true -*** True Line Result - def perma_toast id = nil, messages -** Processing line: ~ toast_extended id, 600.seconds, *messages~ +** Processing line: ~ state.last_mouse_down ||= 0~ - Inside source: true *** True Line Result - toast_extended id, 600.seconds, *messages -** Processing line: ~ end~ + state.last_mouse_down ||= 0 +** Processing line: ~ state.last_mouse_up ||= 0~ - Inside source: true *** True Line Result - end + state.last_mouse_up ||= 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def toast id = nil, *messages~ +** Processing line: ~ state.buttons_frame_selection.left = 10~ - Inside source: true *** True Line Result - def toast id = nil, *messages -** Processing line: ~ toast_extended id, nil, *messages~ + state.buttons_frame_selection.left = 10 +** Processing line: ~ state.buttons_frame_selection.top = grid.top - 10~ - Inside source: true *** True Line Result - toast_extended id, nil, *messages -** Processing line: ~ end~ + state.buttons_frame_selection.top = grid.top - 10 +** Processing line: ~ state.buttons_frame_selection.size = 20~ - Inside source: true *** True Line Result - end + state.buttons_frame_selection.size = 20 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def console_toggle_keys~ +** Processing line: ~ defaults_canvas_sprite~ - Inside source: true *** True Line Result - def console_toggle_keys -** Processing line: ~ [~ + defaults_canvas_sprite +** Processing line: ~~ - Inside source: true *** True Line Result - [ -** Processing line: ~ :backtick!,~ + +** Processing line: ~ state.edit_mode ||= :drawing~ - Inside source: true *** True Line Result - :backtick!, -** Processing line: ~ :tilde!,~ + state.edit_mode ||= :drawing +** Processing line: ~ end~ - Inside source: true *** True Line Result - :tilde!, -** Processing line: ~ :superscript_two!,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - :superscript_two!, -** Processing line: ~ :section_sign!,~ + +** Processing line: ~ def defaults_canvas_sprite~ - Inside source: true *** True Line Result - :section_sign!, -** Processing line: ~ :ordinal_indicator!,~ + def defaults_canvas_sprite +** Processing line: ~ rt_canvas.size = 16~ - Inside source: true *** True Line Result - :ordinal_indicator!, -** Processing line: ~ :circumflex!,~ + rt_canvas.size = 16 +** Processing line: ~ rt_canvas.zoom = 30~ - Inside source: true *** True Line Result - :circumflex!, -** Processing line: ~ ]~ + rt_canvas.zoom = 30 +** Processing line: ~ rt_canvas.width = rt_canvas.size * rt_canvas.zoom~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + rt_canvas.width = rt_canvas.size * rt_canvas.zoom +** Processing line: ~ rt_canvas.height = rt_canvas.size * rt_canvas.zoom~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + rt_canvas.height = rt_canvas.size * rt_canvas.zoom +** Processing line: ~ rt_canvas.sprite = { x: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ def console_toggle_key_down? args~ + rt_canvas.sprite = { x: 0, +** Processing line: ~ y: 0,~ - Inside source: true *** True Line Result - def console_toggle_key_down? args -** Processing line: ~ args.inputs.keyboard.key_down.any? console_toggle_keys~ + y: 0, +** Processing line: ~ w: rt_canvas.width,~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.any? console_toggle_keys -** Processing line: ~ end~ + w: rt_canvas.width, +** Processing line: ~ h: rt_canvas.height,~ - Inside source: true *** True Line Result - end + h: rt_canvas.height, +** Processing line: ~ path: :rt_canvas }.center_inside_rect(x: 0, y: 0, w: 640, h: 720)~ +- Inside source: true +*** True Line Result + path: :rt_canvas }.center_inside_rect(x: 0, y: 0, w: 640, h: 720) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def try_search_docs exception~ +** Processing line: ~ return unless state.tick_count == 1~ - Inside source: true *** True Line Result - def try_search_docs exception -** Processing line: ~ string_e = "#{exception}"~ + return unless state.tick_count == 1 +** Processing line: ~~ - Inside source: true *** True Line Result - string_e = "#{exception}" -** Processing line: ~ @last_command_errored = true~ + +** Processing line: ~ outputs[:rt_canvas].width = rt_canvas.width~ - Inside source: true *** True Line Result - @last_command_errored = true -** Processing line: ~~ + outputs[:rt_canvas].width = rt_canvas.width +** Processing line: ~ outputs[:rt_canvas].height = rt_canvas.height~ - Inside source: true *** True Line Result - -** Processing line: ~ if (string_e.include? "wrong number of arguments")~ + outputs[:rt_canvas].height = rt_canvas.height +** Processing line: ~ outputs[:rt_canvas].sprites << (rt_canvas.size + 1).map_with_index do |x|~ - Inside source: true *** True Line Result - if (string_e.include? "wrong number of arguments") -** Processing line: ~ method_name = ((string_e.split ":")[0].gsub "'", "")~ + outputs[:rt_canvas].sprites << (rt_canvas.size + 1).map_with_index do |x| +** Processing line: ~ (rt_canvas.size + 1).map_with_index do |y|~ - Inside source: true *** True Line Result - method_name = ((string_e.split ":")[0].gsub "'", "") -** Processing line: ~ if !(method_name.include? " ")~ + (rt_canvas.size + 1).map_with_index do |y| +** Processing line: ~ path = 'sprites/square-white.png'~ - Inside source: true *** True Line Result - if !(method_name.include? " ") -** Processing line: ~ results = (Kernel.__docs_search_results__ method_name)~ + path = 'sprites/square-white.png' +** Processing line: ~ path = 'sprites/square-blue.png' if x == 7 || x == 8~ - Inside source: true *** True Line Result - results = (Kernel.__docs_search_results__ method_name) -** Processing line: ~ if !results.include? "* DOCS: No results found."~ + path = 'sprites/square-blue.png' if x == 7 || x == 8 +** Processing line: ~ { x: x * rt_canvas.zoom,~ - Inside source: true *** True Line Result - if !results.include? "* DOCS: No results found." -** Processing line: ~ puts (results.join "\n")~ + { x: x * rt_canvas.zoom, +** Processing line: ~ y: y * rt_canvas.zoom,~ - Inside source: true *** True Line Result - puts (results.join "\n") -** Processing line: ~ puts <<-S~ + y: y * rt_canvas.zoom, +** Processing line: ~ w: rt_canvas.zoom,~ - Inside source: true *** True Line Result - puts <<-S -** Processing line: ~ * INFO: #{results.length} matches(s) found in DOCS for ~#{method_name}~ (see above).~ + w: rt_canvas.zoom, +** Processing line: ~ h: rt_canvas.zoom,~ - Inside source: true *** True Line Result - * INFO: #{results.length} matches(s) found in DOCS for ~#{method_name}~ (see above). -** Processing line: ~ You can search the documentation yourself using the following command in the Console:~ + h: rt_canvas.zoom, +** Processing line: ~ path: path,~ - Inside source: true *** True Line Result - You can search the documentation yourself using the following command in the Console: -** Processing line: ~ #+begin_src ruby~ + path: path, +** Processing line: ~ a: 50 }~ - Inside source: true *** True Line Result - #+begin_src ruby -** Processing line: ~ docs_search \"#{method_name}\"~ + a: 50 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - docs_search \"#{method_name}\" -** Processing line: ~ #+end_src~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - #+end_src -** Processing line: ~ S~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - S -** Processing line: ~ log_once_info :exported_search_results, "The search results above has been seen in logs/puts.txt and docs/search_results.txt."~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - log_once_info :exported_search_results, "The search results above has been seen in logs/puts.txt and docs/search_results.txt." -** Processing line: ~ end~ + +** Processing line: ~ def render_instructions~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def render_instructions +** Processing line: ~ instructions = [~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + instructions = [ +** Processing line: ~ "* Hotkeys:",~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => se~ + "* Hotkeys:", +** Processing line: ~ "- d: hold to erase, release to draw.",~ - Inside source: true *** True Line Result - rescue Exception => se -** Processing line: ~ puts <<-S~ + "- d: hold to erase, release to draw.", +** Processing line: ~ "- a: add frame.",~ - Inside source: true *** True Line Result - puts <<-S -** Processing line: ~ * FATAL: ~GTK::Console#try_search_docs~~ + "- a: add frame.", +** Processing line: ~ "- c: copy frame.",~ - Inside source: true *** True Line Result - * FATAL: ~GTK::Console#try_search_docs~ -** Processing line: ~ There was an exception searching for docs (~GTK::Console#try_search_docs~). You might want to let DragonRuby know about this.~ + "- c: copy frame.", +** Processing line: ~ "- v: paste frame.",~ - Inside source: true *** True Line Result - There was an exception searching for docs (~GTK::Console#try_search_docs~). You might want to let DragonRuby know about this. -** Processing line: ~ ** INNER EXCEPTION~ + "- v: paste frame.", +** Processing line: ~ "- x: delete frame.",~ - Inside source: true *** True Line Result - ** INNER EXCEPTION -** Processing line: ~ #{se}~ + "- x: delete frame.", +** Processing line: ~ "- b: go to previous frame.",~ - Inside source: true *** True Line Result - #{se} -** Processing line: ~ S~ + "- b: go to previous frame.", +** Processing line: ~ "- f: go to next frame.",~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + "- f: go to next frame.", +** Processing line: ~ "- w: save to ./canvas directory.",~ - Inside source: true *** True Line Result - end + "- w: save to ./canvas directory.", +** Processing line: ~ "- l: load from ./canvas."~ +- Inside source: true +*** True Line Result + "- l: load from ./canvas." +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def eval_the_set_command~ +** Processing line: ~ instructions.each.with_index do |l, i|~ - Inside source: true *** True Line Result - def eval_the_set_command -** Processing line: ~ cmd = current_input_str.strip~ + instructions.each.with_index do |l, i| +** Processing line: ~ outputs.labels << { x: 840, y: 500 - (i * 20), text: "#{l}",~ - Inside source: true *** True Line Result - cmd = current_input_str.strip -** Processing line: ~ if cmd.length != 0~ + outputs.labels << { x: 840, y: 500 - (i * 20), text: "#{l}", +** Processing line: ~ r: 180, g: 180, b: 180, size_enum: 0 }~ - Inside source: true *** True Line Result - if cmd.length != 0 -** Processing line: ~ @log_offset = 0~ + r: 180, g: 180, b: 180, size_enum: 0 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - @log_offset = 0 -** Processing line: ~ prompt.clear~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - prompt.clear + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @command_history.pop while @command_history.length >= @max_history~ +** Processing line: ~ def render_canvas~ - Inside source: true *** True Line Result - @command_history.pop while @command_history.length >= @max_history -** Processing line: ~ @command_history.unshift cmd~ + def render_canvas +** Processing line: ~ return if state.tick_count.zero?~ - Inside source: true *** True Line Result - @command_history.unshift cmd -** Processing line: ~ @command_history_index = -1~ + return if state.tick_count.zero? +** Processing line: ~ outputs.sprites << rt_canvas.sprite~ - Inside source: true *** True Line Result - @command_history_index = -1 -** Processing line: ~ @nonhistory_input = ''~ + outputs.sprites << rt_canvas.sprite +** Processing line: ~ end~ - Inside source: true *** True Line Result - @nonhistory_input = '' + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if cmd == 'quit' || cmd == ':wq' || cmd == ':q!' || cmd == ':q' || cmd == ':wqa'~ +** Processing line: ~ def render_buttons_frame_selection~ - Inside source: true *** True Line Result - if cmd == 'quit' || cmd == ':wq' || cmd == ':q!' || cmd == ':q' || cmd == ':wqa' -** Processing line: ~ $gtk.request_quit~ + def render_buttons_frame_selection +** Processing line: ~ args.outputs.primitives << state.buttons_frame_selection.items.map_with_index do |b, i|~ - Inside source: true *** True Line Result - $gtk.request_quit -** Processing line: ~ else~ + args.outputs.primitives << state.buttons_frame_selection.items.map_with_index do |b, i| +** Processing line: ~ label = { x: b.x + state.buttons_frame_selection.size.half,~ - Inside source: true *** True Line Result - else -** Processing line: ~ puts "-> #{cmd}"~ + label = { x: b.x + state.buttons_frame_selection.size.half, +** Processing line: ~ y: b.y,~ - Inside source: true *** True Line Result - puts "-> #{cmd}" -** Processing line: ~ begin~ + y: b.y, +** Processing line: ~ text: "#{i + 1}", r: 180, g: 180, b: 180,~ - Inside source: true *** True Line Result - begin -** Processing line: ~ @last_command = cmd~ + text: "#{i + 1}", r: 180, g: 180, b: 180, +** Processing line: ~ size_enum: -4, alignment_enum: 1 }.label~ - Inside source: true *** True Line Result - @last_command = cmd -** Processing line: ~ Kernel.eval("$results = (#{cmd})")~ + size_enum: -4, alignment_enum: 1 }.label +** Processing line: ~~ - Inside source: true *** True Line Result - Kernel.eval("$results = (#{cmd})") -** Processing line: ~ if $results.nil?~ + +** Processing line: ~ selection_border = b.merge(r: 40, g: 40, b: 40).border~ - Inside source: true *** True Line Result - if $results.nil? -** Processing line: ~ puts "=> nil"~ + selection_border = b.merge(r: 40, g: 40, b: 40).border +** Processing line: ~~ - Inside source: true *** True Line Result - puts "=> nil" -** Processing line: ~ elsif $results == :console_silent_eval~ + +** Processing line: ~ if i == state.animation_frames_selected_index~ - Inside source: true *** True Line Result - elsif $results == :console_silent_eval -** Processing line: ~ else~ + if i == state.animation_frames_selected_index +** Processing line: ~ selection_border = b.merge(r: 40, g: 230, b: 200).border~ - Inside source: true *** True Line Result - else -** Processing line: ~ puts "=> #{$results}"~ + selection_border = b.merge(r: 40, g: 230, b: 200).border +** Processing line: ~ end~ - Inside source: true *** True Line Result - puts "=> #{$results}" -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ @last_command_errored = false~ + +** Processing line: ~ [selection_border, label]~ - Inside source: true *** True Line Result - @last_command_errored = false -** Processing line: ~ rescue Exception => e~ + [selection_border, label] +** Processing line: ~ end~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ try_search_docs e~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - try_search_docs e -** Processing line: ~ puts "* EXCEPTION: #{e}"~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - puts "* EXCEPTION: #{e}" -** Processing line: ~ end~ + +** Processing line: ~ def render_animation_frame_thumbnails~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def render_animation_frame_thumbnails +** Processing line: ~ return if state.tick_count.zero?~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + return if state.tick_count.zero? +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ outputs[:current_animation_frame].width = rt_canvas.size~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs[:current_animation_frame].width = rt_canvas.size +** Processing line: ~ outputs[:current_animation_frame].height = rt_canvas.size~ - Inside source: true *** True Line Result - -** Processing line: ~ def inputs_scroll_up_full? args~ + outputs[:current_animation_frame].height = rt_canvas.size +** Processing line: ~ outputs[:current_animation_frame].solids << selected_animation_frame[:pixels].map_with_index do |f, i|~ - Inside source: true *** True Line Result - def inputs_scroll_up_full? args -** Processing line: ~ return false if @disabled~ + outputs[:current_animation_frame].solids << selected_animation_frame[:pixels].map_with_index do |f, i| +** Processing line: ~ { x: f.x,~ - Inside source: true *** True Line Result - return false if @disabled -** Processing line: ~ args.inputs.keyboard.key_down.pageup ||~ + { x: f.x, +** Processing line: ~ y: f.y,~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.pageup || -** Processing line: ~ (args.inputs.keyboard.key_up.b && args.inputs.keyboard.key_up.control)~ + y: f.y, +** Processing line: ~ w: 1,~ - Inside source: true *** True Line Result - (args.inputs.keyboard.key_up.b && args.inputs.keyboard.key_up.control) + w: 1, +** Processing line: ~ h: 1, r: 255, g: 255, b: 255 }~ +- Inside source: true +*** True Line Result + h: 1, r: 255, g: 255, b: 255 } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -93315,158 +97200,178 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def scroll_to_bottom~ -- Inside source: true -*** True Line Result - def scroll_to_bottom -** Processing line: ~ @log_offset = 0~ -- Inside source: true -*** True Line Result - @log_offset = 0 -** Processing line: ~ end~ +** Processing line: ~ outputs.sprites << rt_canvas.sprite.merge(path: :current_animation_frame)~ - Inside source: true *** True Line Result - end + outputs.sprites << rt_canvas.sprite.merge(path: :current_animation_frame) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def scroll_up_full~ +** Processing line: ~ state.animation_frames.map_with_index do |animation_frame, animation_frame_index|~ - Inside source: true *** True Line Result - def scroll_up_full -** Processing line: ~ @log_offset += lines_on_one_page~ + state.animation_frames.map_with_index do |animation_frame, animation_frame_index| +** Processing line: ~ outputs.sprites << state.buttons_frame_selection[:items][animation_frame_index][:inner_rect]~ - Inside source: true *** True Line Result - @log_offset += lines_on_one_page -** Processing line: ~ @log_offset = @log.size if @log_offset > @log.size~ + outputs.sprites << state.buttons_frame_selection[:items][animation_frame_index][:inner_rect] +** Processing line: ~ .merge(path: animation_frame[:rt_name])~ - Inside source: true *** True Line Result - @log_offset = @log.size if @log_offset > @log.size + .merge(path: animation_frame[:rt_name]) ** 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 inputs_scroll_up_half? args~ +** Processing line: ~ def render_animation~ - Inside source: true *** True Line Result - def inputs_scroll_up_half? args -** Processing line: ~ return false if @disabled~ + def render_animation +** Processing line: ~ sprite_index = 0.frame_index count: state.animation_frames.length,~ - Inside source: true *** True Line Result - return false if @disabled -** Processing line: ~ args.inputs.keyboard.ctrl_u~ + sprite_index = 0.frame_index count: state.animation_frames.length, +** Processing line: ~ hold_for: 60 / state.animation_frames_per_second,~ - Inside source: true *** True Line Result - args.inputs.keyboard.ctrl_u -** Processing line: ~ end~ + hold_for: 60 / state.animation_frames_per_second, +** Processing line: ~ repeat: true~ - Inside source: true *** True Line Result - end + repeat: true ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def scroll_up_half~ +** Processing line: ~ args.outputs.sprites << { x: 700 - 8,~ - Inside source: true *** True Line Result - def scroll_up_half -** Processing line: ~ @log_offset += lines_on_one_page.idiv(2)~ + args.outputs.sprites << { x: 700 - 8, +** Processing line: ~ y: 120,~ - Inside source: true *** True Line Result - @log_offset += lines_on_one_page.idiv(2) -** Processing line: ~ @log_offset = @log.size if @log_offset > @log.size~ + y: 120, +** Processing line: ~ w: 16,~ - Inside source: true *** True Line Result - @log_offset = @log.size if @log_offset > @log.size -** Processing line: ~ end~ + w: 16, +** Processing line: ~ h: 16,~ - Inside source: true *** True Line Result - end + h: 16, +** Processing line: ~ path: (sprite_path sprite_index) }~ +- Inside source: true +*** True Line Result + path: (sprite_path sprite_index) } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def inputs_scroll_down_full? args~ +** Processing line: ~ args.outputs.sprites << { x: 700 - 16,~ - Inside source: true *** True Line Result - def inputs_scroll_down_full? args -** Processing line: ~ return false if @disabled~ + args.outputs.sprites << { x: 700 - 16, +** Processing line: ~ y: 230,~ - Inside source: true *** True Line Result - return false if @disabled -** Processing line: ~ args.inputs.keyboard.key_down.pagedown ||~ + y: 230, +** Processing line: ~ w: 32,~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.pagedown || -** Processing line: ~ (args.inputs.keyboard.key_up.f && args.inputs.keyboard.key_up.control)~ + w: 32, +** Processing line: ~ h: 32,~ - Inside source: true *** True Line Result - (args.inputs.keyboard.key_up.f && args.inputs.keyboard.key_up.control) -** Processing line: ~ end~ + h: 32, +** Processing line: ~ path: (sprite_path sprite_index) }~ - Inside source: true *** True Line Result - end + path: (sprite_path sprite_index) } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def scroll_down_full~ +** Processing line: ~ args.outputs.sprites << { x: 700 - 32,~ - Inside source: true *** True Line Result - def scroll_down_full -** Processing line: ~ @log_offset -= lines_on_one_page~ + args.outputs.sprites << { x: 700 - 32, +** Processing line: ~ y: 360,~ - Inside source: true *** True Line Result - @log_offset -= lines_on_one_page -** Processing line: ~ @log_offset = 0 if @log_offset < 0~ + y: 360, +** Processing line: ~ w: 64,~ - Inside source: true *** True Line Result - @log_offset = 0 if @log_offset < 0 -** Processing line: ~ end~ + w: 64, +** Processing line: ~ h: 64,~ - Inside source: true *** True Line Result - end + h: 64, +** Processing line: ~ path: (sprite_path sprite_index) }~ +- Inside source: true +*** True Line Result + path: (sprite_path sprite_index) } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def inputs_scroll_down_half? args~ +** Processing line: ~ args.outputs.sprites << { x: 700 - 64,~ - Inside source: true *** True Line Result - def inputs_scroll_down_half? args -** Processing line: ~ return false if @disabled~ + args.outputs.sprites << { x: 700 - 64, +** Processing line: ~ y: 520,~ - Inside source: true *** True Line Result - return false if @disabled -** Processing line: ~ args.inputs.keyboard.ctrl_d~ + y: 520, +** Processing line: ~ w: 128,~ - Inside source: true *** True Line Result - args.inputs.keyboard.ctrl_d -** Processing line: ~ end~ + w: 128, +** Processing line: ~ h: 128,~ - Inside source: true *** True Line Result - end + h: 128, +** Processing line: ~ path: (sprite_path sprite_index) }~ +- Inside source: true +*** True Line Result + path: (sprite_path sprite_index) } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def inputs_clear_command? args~ +** Processing line: ~ def input_mouse_click~ - Inside source: true *** True Line Result - def inputs_clear_command? args -** Processing line: ~ return false if @disabled~ + def input_mouse_click +** Processing line: ~ if inputs.mouse.up~ - Inside source: true *** True Line Result - return false if @disabled -** Processing line: ~ args.inputs.keyboard.escape || args.inputs.keyboard.ctrl_g~ + if inputs.mouse.up +** Processing line: ~ state.last_mouse_up = state.tick_count~ - Inside source: true *** True Line Result - args.inputs.keyboard.escape || args.inputs.keyboard.ctrl_g + state.last_mouse_up = state.tick_count +** Processing line: ~ elsif inputs.mouse.moved && user_is_editing?~ +- Inside source: true +*** True Line Result + elsif inputs.mouse.moved && user_is_editing? +** Processing line: ~ edit_current_animation_frame inputs.mouse.point~ +- Inside source: true +*** True Line Result + edit_current_animation_frame inputs.mouse.point ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -93475,18 +97380,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 scroll_down_half~ +** Processing line: ~ return unless inputs.mouse.click~ - Inside source: true *** True Line Result - def scroll_down_half -** Processing line: ~ @log_offset -= lines_on_one_page.idiv(2)~ + return unless inputs.mouse.click +** Processing line: ~~ - Inside source: true *** True Line Result - @log_offset -= lines_on_one_page.idiv(2) -** Processing line: ~ @log_offset = 0 if @log_offset < 0~ + +** Processing line: ~ clicked_frame_button = state.buttons_frame_selection.items.find do |b|~ - Inside source: true *** True Line Result - @log_offset = 0 if @log_offset < 0 + clicked_frame_button = state.buttons_frame_selection.items.find do |b| +** Processing line: ~ inputs.mouse.point.inside_rect? b~ +- Inside source: true +*** True Line Result + inputs.mouse.point.inside_rect? b ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -93495,138 +97404,154 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def mouse_wheel_scroll args~ +** Processing line: ~ if (clicked_frame_button)~ - Inside source: true *** True Line Result - def mouse_wheel_scroll args -** Processing line: ~ @inertia ||= 0~ + if (clicked_frame_button) +** Processing line: ~ state.animation_frames_selected_index = clicked_frame_button[:index]~ - Inside source: true *** True Line Result - @inertia ||= 0 + state.animation_frames_selected_index = clicked_frame_button[:index] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if args.inputs.mouse.wheel && args.inputs.mouse.wheel.y > 0~ +** Processing line: ~ if (inputs.mouse.point.inside_rect? rt_canvas.sprite)~ - Inside source: true *** True Line Result - if args.inputs.mouse.wheel && args.inputs.mouse.wheel.y > 0 -** Processing line: ~ @inertia = 1~ + if (inputs.mouse.point.inside_rect? rt_canvas.sprite) +** Processing line: ~ state.last_mouse_down = state.tick_count~ - Inside source: true *** True Line Result - @inertia = 1 -** Processing line: ~ elsif args.inputs.mouse.wheel && args.inputs.mouse.wheel.y < 0~ + state.last_mouse_down = state.tick_count +** Processing line: ~ edit_current_animation_frame inputs.mouse.point~ - Inside source: true *** True Line Result - elsif args.inputs.mouse.wheel && args.inputs.mouse.wheel.y < 0 -** Processing line: ~ @inertia = -1~ + edit_current_animation_frame inputs.mouse.point +** Processing line: ~ end~ - Inside source: true *** True Line Result - @inertia = -1 -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if args.inputs.mouse.click~ +** Processing line: ~ def input_keyboard~ - Inside source: true *** True Line Result - if args.inputs.mouse.click -** Processing line: ~ @inertia = 0~ + def input_keyboard +** Processing line: ~ # w to save~ - Inside source: true *** True Line Result - @inertia = 0 -** Processing line: ~ end~ + # w to save +** Processing line: ~ if inputs.keyboard.key_down.w~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if inputs.keyboard.key_down.w +** Processing line: ~ t = Time.now~ - Inside source: true *** True Line Result - -** Processing line: ~ return if @inertia == 0~ + t = Time.now +** Processing line: ~ state.save_description = "Time: #{t} (#{t.to_i})"~ - Inside source: true *** True Line Result - return if @inertia == 0 -** Processing line: ~~ + state.save_description = "Time: #{t} (#{t.to_i})" +** Processing line: ~ gtk.serialize_state 'canvas/state.txt', state~ - Inside source: true *** True Line Result - -** Processing line: ~ if @inertia != 0~ + gtk.serialize_state 'canvas/state.txt', state +** Processing line: ~ gtk.serialize_state "tmp/canvas_backups/#{t.to_i}/state.txt", state~ - Inside source: true *** True Line Result - if @inertia != 0 -** Processing line: ~ @inertia = (@inertia * 0.7)~ + gtk.serialize_state "tmp/canvas_backups/#{t.to_i}/state.txt", state +** Processing line: ~ animation_frames.each_with_index do |animation_frame, i|~ - Inside source: true *** True Line Result - @inertia = (@inertia * 0.7) -** Processing line: ~ if @inertia > 0~ + animation_frames.each_with_index do |animation_frame, i| +** Processing line: ~ queues.update_rt_animation_frame << { index: i,~ - Inside source: true *** True Line Result - if @inertia > 0 -** Processing line: ~ @log_offset -= 1~ + queues.update_rt_animation_frame << { index: i, +** Processing line: ~ at: state.tick_count + i,~ - Inside source: true *** True Line Result - @log_offset -= 1 -** Processing line: ~ elsif @inertia < 0~ + at: state.tick_count + i, +** Processing line: ~ queue_sprite_creation: true }~ - Inside source: true *** True Line Result - elsif @inertia < 0 -** Processing line: ~ @log_offset += 1~ + queue_sprite_creation: true } +** Processing line: ~ queues.create_sprite << { index: i,~ - Inside source: true *** True Line Result - @log_offset += 1 -** Processing line: ~ end~ + queues.create_sprite << { index: i, +** Processing line: ~ at: state.tick_count + animation_frames.length + i,~ - Inside source: true *** True Line Result - end + at: state.tick_count + animation_frames.length + i, +** Processing line: ~ path_override: "tmp/canvas_backups/#{t.to_i}/sprite-#{i}.png" }~ +- Inside source: true +*** True Line Result + path_override: "tmp/canvas_backups/#{t.to_i}/sprite-#{i}.png" } ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ gtk.notify! "Canvas saved."~ - Inside source: true *** True Line Result - -** Processing line: ~ if @inertia.abs < 0.01~ + gtk.notify! "Canvas saved." +** Processing line: ~ end~ - Inside source: true *** True Line Result - if @inertia.abs < 0.01 -** Processing line: ~ @inertia = 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @inertia = 0 -** Processing line: ~ end~ + +** Processing line: ~ # l to load~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # l to load +** Processing line: ~ if inputs.keyboard.key_down.l~ - Inside source: true *** True Line Result - -** Processing line: ~ if @log_offset > @log.size~ + if inputs.keyboard.key_down.l +** Processing line: ~ args.state = gtk.deserialize_state 'canvas/state.txt'~ - Inside source: true *** True Line Result - if @log_offset > @log.size -** Processing line: ~ @log_offset = @log.size~ + args.state = gtk.deserialize_state 'canvas/state.txt' +** Processing line: ~ animation_frames.each_with_index do |a, i|~ - Inside source: true *** True Line Result - @log_offset = @log.size -** Processing line: ~ elsif @log_offset < 0~ + animation_frames.each_with_index do |a, i| +** Processing line: ~ queues.update_rt_animation_frame << { index: i,~ - Inside source: true *** True Line Result - elsif @log_offset < 0 -** Processing line: ~ @log_offset = 0~ + queues.update_rt_animation_frame << { index: i, +** Processing line: ~ at: state.tick_count + i,~ - Inside source: true *** True Line Result - @log_offset = 0 + at: state.tick_count + i, +** Processing line: ~ queue_sprite_creation: true }~ +- Inside source: true +*** True Line Result + queue_sprite_creation: true } ** Processing line: ~ end~ - Inside source: true *** True Line Result end +** Processing line: ~ gtk.notify! "Canvas loaded."~ +- Inside source: true +*** True Line Result + gtk.notify! "Canvas loaded." ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -93635,1266 +97560,1306 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def process_inputs args~ +** Processing line: ~ # d to go into delete mode, release to paint~ - Inside source: true *** True Line Result - def process_inputs args -** Processing line: ~ if console_toggle_key_down? args~ + # d to go into delete mode, release to paint +** Processing line: ~ if inputs.keyboard.key_held.d~ - Inside source: true *** True Line Result - if console_toggle_key_down? args -** Processing line: ~ args.inputs.text.clear~ + if inputs.keyboard.key_held.d +** Processing line: ~ state.edit_mode = :erasing~ - Inside source: true *** True Line Result - args.inputs.text.clear -** Processing line: ~ toggle~ + state.edit_mode = :erasing +** Processing line: ~ gtk.notify! "Erasing." if inputs.keyboard.key_held.d == (state.tick_count - 1)~ - Inside source: true *** True Line Result - toggle -** Processing line: ~ end~ + gtk.notify! "Erasing." if inputs.keyboard.key_held.d == (state.tick_count - 1) +** Processing line: ~ elsif inputs.keyboard.key_up.d~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif inputs.keyboard.key_up.d +** Processing line: ~ state.edit_mode = :drawing~ - Inside source: true *** True Line Result - -** Processing line: ~ return unless visible?~ + state.edit_mode = :drawing +** Processing line: ~ gtk.notify! "Drawing."~ - Inside source: true *** True Line Result - return unless visible? -** Processing line: ~~ + gtk.notify! "Drawing." +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ args.inputs.text.each { |str| prompt << str }~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - args.inputs.text.each { |str| prompt << str } -** Processing line: ~ args.inputs.text.clear~ + +** Processing line: ~ # a to add a frame to the end~ - Inside source: true *** True Line Result - args.inputs.text.clear -** Processing line: ~ mouse_wheel_scroll args~ + # a to add a frame to the end +** Processing line: ~ if inputs.keyboard.key_down.a~ - Inside source: true *** True Line Result - mouse_wheel_scroll args -** Processing line: ~~ + if inputs.keyboard.key_down.a +** Processing line: ~ queues.create_sprite << { index: state.animation_frames_selected_index,~ - Inside source: true *** True Line Result - -** Processing line: ~ @log_offset = 0 if @log_offset < 0~ + queues.create_sprite << { index: state.animation_frames_selected_index, +** Processing line: ~ at: state.tick_count }~ - Inside source: true *** True Line Result - @log_offset = 0 if @log_offset < 0 -** Processing line: ~~ + at: state.tick_count } +** Processing line: ~ queues.create_sprite << { index: state.animation_frames_selected_index + 1,~ - Inside source: true *** True Line Result - -** Processing line: ~ if args.inputs.keyboard.key_down.enter~ + queues.create_sprite << { index: state.animation_frames_selected_index + 1, +** Processing line: ~ at: state.tick_count }~ - Inside source: true *** True Line Result - if args.inputs.keyboard.key_down.enter -** Processing line: ~ eval_the_set_command~ + at: state.tick_count } +** Processing line: ~ add_animation_frame_to_end~ - Inside source: true *** True Line Result - eval_the_set_command -** Processing line: ~ elsif args.inputs.keyboard.key_down.v~ + add_animation_frame_to_end +** Processing line: ~ gtk.notify! "Frame added to end."~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.v -** Processing line: ~ if args.inputs.keyboard.key_down.control || args.inputs.keyboard.key_down.meta~ + gtk.notify! "Frame added to end." +** Processing line: ~ end~ - Inside source: true *** True Line Result - if args.inputs.keyboard.key_down.control || args.inputs.keyboard.key_down.meta -** Processing line: ~ prompt << $gtk.ffi_misc.getclipboard~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - prompt << $gtk.ffi_misc.getclipboard -** Processing line: ~ end~ + +** Processing line: ~ # c or t to copy~ - Inside source: true *** True Line Result - end -** Processing line: ~ elsif args.inputs.keyboard.key_down.up~ + # c or t to copy +** Processing line: ~ if (inputs.keyboard.key_down.c || inputs.keyboard.key_down.t)~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.up -** Processing line: ~ if @command_history_index == -1~ + if (inputs.keyboard.key_down.c || inputs.keyboard.key_down.t) +** Processing line: ~ state.clipboard = [selected_animation_frame[:pixels]].flatten~ - Inside source: true *** True Line Result - if @command_history_index == -1 -** Processing line: ~ @nonhistory_input = current_input_str~ + state.clipboard = [selected_animation_frame[:pixels]].flatten +** Processing line: ~ gtk.notify! "Current frame copied."~ - Inside source: true *** True Line Result - @nonhistory_input = current_input_str -** Processing line: ~ end~ + gtk.notify! "Current frame copied." +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ if @command_history_index < (@command_history.length - 1)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - if @command_history_index < (@command_history.length - 1) -** Processing line: ~ @command_history_index += 1~ + +** Processing line: ~ # v or q to paste~ - Inside source: true *** True Line Result - @command_history_index += 1 -** Processing line: ~ self.current_input_str = @command_history[@command_history_index].dup~ + # v or q to paste +** Processing line: ~ if (inputs.keyboard.key_down.v || inputs.keyboard.key_down.q) && state.clipboard~ - Inside source: true *** True Line Result - self.current_input_str = @command_history[@command_history_index].dup -** Processing line: ~ end~ + if (inputs.keyboard.key_down.v || inputs.keyboard.key_down.q) && state.clipboard +** Processing line: ~ selected_animation_frame[:pixels] = [state.clipboard].flatten~ - Inside source: true *** True Line Result - end -** Processing line: ~ elsif args.inputs.keyboard.key_down.down~ + selected_animation_frame[:pixels] = [state.clipboard].flatten +** Processing line: ~ queues.update_rt_animation_frame << { index: state.animation_frames_selected_index,~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.down -** Processing line: ~ if @command_history_index == 0~ + queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, +** Processing line: ~ at: state.tick_count,~ - Inside source: true *** True Line Result - if @command_history_index == 0 -** Processing line: ~ @command_history_index = -1~ + at: state.tick_count, +** Processing line: ~ queue_sprite_creation: true }~ - Inside source: true *** True Line Result - @command_history_index = -1 -** Processing line: ~ self.current_input_str = @nonhistory_input~ + queue_sprite_creation: true } +** Processing line: ~ gtk.notify! "Pasted."~ - Inside source: true *** True Line Result - self.current_input_str = @nonhistory_input -** Processing line: ~ @nonhistory_input = ''~ + gtk.notify! "Pasted." +** Processing line: ~ end~ - Inside source: true *** True Line Result - @nonhistory_input = '' -** Processing line: ~ elsif @command_history_index > 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif @command_history_index > 0 -** Processing line: ~ @command_history_index -= 1~ + +** Processing line: ~ # f to go forward/next frame~ - Inside source: true *** True Line Result - @command_history_index -= 1 -** Processing line: ~ self.current_input_str = @command_history[@command_history_index].dup~ + # f to go forward/next frame +** Processing line: ~ if (inputs.keyboard.key_down.f)~ - Inside source: true *** True Line Result - self.current_input_str = @command_history[@command_history_index].dup -** Processing line: ~ end~ + if (inputs.keyboard.key_down.f) +** Processing line: ~ if (state.animation_frames_selected_index == (state.animation_frames.length - 1))~ - Inside source: true *** True Line Result - end -** Processing line: ~ elsif args.inputs.keyboard.key_down.left~ + if (state.animation_frames_selected_index == (state.animation_frames.length - 1)) +** Processing line: ~ state.animation_frames_selected_index = 0~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.left -** Processing line: ~ prompt.move_cursor_left~ + state.animation_frames_selected_index = 0 +** Processing line: ~ else~ - Inside source: true *** True Line Result - prompt.move_cursor_left -** Processing line: ~ elsif args.inputs.keyboard.key_down.right~ + else +** Processing line: ~ state.animation_frames_selected_index += 1~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.right -** Processing line: ~ prompt.move_cursor_right~ + state.animation_frames_selected_index += 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - prompt.move_cursor_right -** Processing line: ~ elsif inputs_scroll_up_full? args~ + end +** Processing line: ~ gtk.notify! "Next frame."~ - Inside source: true *** True Line Result - elsif inputs_scroll_up_full? args -** Processing line: ~ scroll_up_full~ + gtk.notify! "Next frame." +** Processing line: ~ end~ - Inside source: true *** True Line Result - scroll_up_full -** Processing line: ~ elsif inputs_scroll_down_full? args~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif inputs_scroll_down_full? args -** Processing line: ~ scroll_down_full~ + +** Processing line: ~ # b to go back/previous frame~ - Inside source: true *** True Line Result - scroll_down_full -** Processing line: ~ elsif inputs_scroll_up_half? args~ + # b to go back/previous frame +** Processing line: ~ if (inputs.keyboard.key_down.b)~ - Inside source: true *** True Line Result - elsif inputs_scroll_up_half? args -** Processing line: ~ scroll_up_half~ + if (inputs.keyboard.key_down.b) +** Processing line: ~ if (state.animation_frames_selected_index == 0)~ - Inside source: true *** True Line Result - scroll_up_half -** Processing line: ~ elsif inputs_scroll_down_half? args~ + if (state.animation_frames_selected_index == 0) +** Processing line: ~ state.animation_frames_selected_index = state.animation_frames.length - 1~ - Inside source: true *** True Line Result - elsif inputs_scroll_down_half? args -** Processing line: ~ scroll_down_half~ + state.animation_frames_selected_index = state.animation_frames.length - 1 +** Processing line: ~ else~ - Inside source: true *** True Line Result - scroll_down_half -** Processing line: ~ elsif inputs_clear_command? args~ + else +** Processing line: ~ state.animation_frames_selected_index -= 1~ - Inside source: true *** True Line Result - elsif inputs_clear_command? args -** Processing line: ~ prompt.clear~ + state.animation_frames_selected_index -= 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - prompt.clear -** Processing line: ~ @command_history_index = -1~ + end +** Processing line: ~ gtk.notify! "Previous frame."~ - Inside source: true *** True Line Result - @command_history_index = -1 -** Processing line: ~ @nonhistory_input = ''~ + gtk.notify! "Previous frame." +** Processing line: ~ end~ - Inside source: true *** True Line Result - @nonhistory_input = '' -** Processing line: ~ elsif args.inputs.keyboard.key_down.backspace || args.inputs.keyboard.key_down.delete~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.backspace || args.inputs.keyboard.key_down.delete -** Processing line: ~ prompt.backspace~ + +** Processing line: ~ # x to delete frame~ - Inside source: true *** True Line Result - prompt.backspace -** Processing line: ~ elsif args.inputs.keyboard.key_down.tab~ + # x to delete frame +** Processing line: ~ if (inputs.keyboard.key_down.x) && animation_frames.length > 1~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.tab -** Processing line: ~ prompt.autocomplete~ + if (inputs.keyboard.key_down.x) && animation_frames.length > 1 +** Processing line: ~ state.clipboard = selected_animation_frame[:pixels]~ - Inside source: true *** True Line Result - prompt.autocomplete -** Processing line: ~ end~ + state.clipboard = selected_animation_frame[:pixels] +** Processing line: ~ state.animation_frames = animation_frames.find_all { |v| v[:index] != state.animation_frames_selected_index }~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.animation_frames = animation_frames.find_all { |v| v[:index] != state.animation_frames_selected_index } +** Processing line: ~ if state.animation_frames_selected_index >= state.animation_frames.length~ - Inside source: true *** True Line Result - -** Processing line: ~ args.inputs.keyboard.key_down.clear~ + if state.animation_frames_selected_index >= state.animation_frames.length +** Processing line: ~ state.animation_frames_selected_index = state.animation_frames.length - 1~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_down.clear -** Processing line: ~ args.inputs.keyboard.key_up.clear~ + state.animation_frames_selected_index = state.animation_frames.length - 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_up.clear -** Processing line: ~ args.inputs.keyboard.key_held.clear~ + end +** Processing line: ~ gtk.notify! "Frame deleted."~ - Inside source: true *** True Line Result - args.inputs.keyboard.key_held.clear + gtk.notify! "Frame deleted." ** 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 write_primitive_and_return_offset(args, left, y, str, archived: false)~ +** Processing line: ~ def calc_auto_export~ - Inside source: true *** True Line Result - def write_primitive_and_return_offset(args, left, y, str, archived: false) -** Processing line: ~ if str.is_a?(Hash)~ + def calc_auto_export +** Processing line: ~ return if user_is_editing?~ - Inside source: true *** True Line Result - if str.is_a?(Hash) -** Processing line: ~ padding = 10~ + return if user_is_editing? +** Processing line: ~ return if state.last_mouse_up.elapsed_time != 30~ - Inside source: true *** True Line Result - padding = 10 -** Processing line: ~ args.outputs.reserved << [left + 10, y + 5, str[:w], str[:h], str[:path]].sprite~ + return if state.last_mouse_up.elapsed_time != 30 +** Processing line: ~ # auto export current animation frame if there is no editing for 30 ticks~ - Inside source: true *** True Line Result - args.outputs.reserved << [left + 10, y + 5, str[:w], str[:h], str[:path]].sprite -** Processing line: ~ return str[:h] + padding~ + # auto export current animation frame if there is no editing for 30 ticks +** Processing line: ~ queues.create_sprite << { index: state.animation_frames_selected_index,~ - Inside source: true *** True Line Result - return str[:h] + padding -** Processing line: ~ else~ + queues.create_sprite << { index: state.animation_frames_selected_index, +** Processing line: ~ at: state.tick_count }~ - Inside source: true *** True Line Result - else -** Processing line: ~ write_line args, left, y, str, archived: archived~ + at: state.tick_count } +** Processing line: ~ end~ - Inside source: true *** True Line Result - write_line args, left, y, str, archived: archived -** Processing line: ~ return line_height_px~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - return line_height_px -** Processing line: ~ end~ + +** Processing line: ~ def calc_buttons_frame_selection~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def calc_buttons_frame_selection +** Processing line: ~ state.buttons_frame_selection.items = animation_frames.length.map_with_index do |i|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.buttons_frame_selection.items = animation_frames.length.map_with_index do |i| +** Processing line: ~ { x: state.buttons_frame_selection.left + i * state.buttons_frame_selection.size,~ - Inside source: true *** True Line Result - -** Processing line: ~ def write_line(args, left, y, str, archived: false)~ + { x: state.buttons_frame_selection.left + i * state.buttons_frame_selection.size, +** Processing line: ~ y: state.buttons_frame_selection.top - state.buttons_frame_selection.size,~ - Inside source: true *** True Line Result - def write_line(args, left, y, str, archived: false) -** Processing line: ~ color = color_for_log_entry(str)~ + y: state.buttons_frame_selection.top - state.buttons_frame_selection.size, +** Processing line: ~ inner_rect: {~ - Inside source: true *** True Line Result - color = color_for_log_entry(str) -** Processing line: ~ color = color.mult_alpha(0.5) if archived~ + inner_rect: { +** Processing line: ~ x: (state.buttons_frame_selection.left + 2) + i * state.buttons_frame_selection.size,~ - Inside source: true *** True Line Result - color = color.mult_alpha(0.5) if archived -** Processing line: ~~ + x: (state.buttons_frame_selection.left + 2) + i * state.buttons_frame_selection.size, +** Processing line: ~ y: (state.buttons_frame_selection.top - state.buttons_frame_selection.size + 2),~ - Inside source: true *** True Line Result - -** Processing line: ~ args.outputs.reserved << font_style.label(x: left.shift_right(10), y: y, text: str, color: color)~ + y: (state.buttons_frame_selection.top - state.buttons_frame_selection.size + 2), +** Processing line: ~ w: 16,~ - Inside source: true *** True Line Result - args.outputs.reserved << font_style.label(x: left.shift_right(10), y: y, text: str, color: color) + w: 16, +** Processing line: ~ h: 16,~ +- Inside source: true +*** True Line Result + h: 16, +** Processing line: ~ },~ +- Inside source: true +*** True Line Result + }, +** Processing line: ~ w: state.buttons_frame_selection.size,~ +- Inside source: true +*** True Line Result + w: state.buttons_frame_selection.size, +** Processing line: ~ h: state.buttons_frame_selection.size,~ +- Inside source: true +*** True Line Result + h: state.buttons_frame_selection.size, +** Processing line: ~ index: i }~ +- Inside source: true +*** True Line Result + index: i } ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def should_tick?~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def should_tick? -** Processing line: ~ return false if !@toggled_at~ + +** Processing line: ~ def calc_animation_frames~ - Inside source: true *** True Line Result - return false if !@toggled_at -** Processing line: ~ return false if slide_progress == 0~ + def calc_animation_frames +** Processing line: ~ animation_frames.each_with_index do |animation_frame, i|~ - Inside source: true *** True Line Result - return false if slide_progress == 0 -** Processing line: ~ return false if @disabled~ + animation_frames.each_with_index do |animation_frame, i| +** Processing line: ~ animation_frame[:index] = i~ - Inside source: true *** True Line Result - return false if @disabled -** Processing line: ~ return visible?~ + animation_frame[:index] = i +** Processing line: ~ animation_frame[:rt_name] = "animation_frame_#{i}"~ - Inside source: true *** True Line Result - return visible? + animation_frame[:rt_name] = "animation_frame_#{i}" ** Processing line: ~ end~ - Inside source: true *** True Line Result end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render args~ +** Processing line: ~ def process_queue_create_sprite~ - Inside source: true *** True Line Result - def render args -** Processing line: ~ return if !@toggled_at~ + def process_queue_create_sprite +** Processing line: ~ sprites_to_create = queues.create_sprite~ - Inside source: true *** True Line Result - return if !@toggled_at -** Processing line: ~ return if slide_progress == 0~ + sprites_to_create = queues.create_sprite +** Processing line: ~ .find_all { |h| h[:at].elapsed? }~ - Inside source: true *** True Line Result - return if slide_progress == 0 + .find_all { |h| h[:at].elapsed? } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @bottom = top - (h * slide_progress)~ +** Processing line: ~ queues.create_sprite = queues.create_sprite - sprites_to_create~ - Inside source: true *** True Line Result - @bottom = top - (h * slide_progress) -** Processing line: ~ args.outputs.reserved << [left, @bottom, w, h, *@background_color.mult_alpha(slide_progress)].solid~ + queues.create_sprite = queues.create_sprite - sprites_to_create +** Processing line: ~~ - Inside source: true *** True Line Result - args.outputs.reserved << [left, @bottom, w, h, *@background_color.mult_alpha(slide_progress)].solid -** Processing line: ~ args.outputs.reserved << [right.shift_left(110), @bottom.shift_up(630), 100, 100, @logo, 0, (80.0 * slide_progress).to_i].sprite~ + +** Processing line: ~ sprites_to_create.each do |h|~ - Inside source: true *** True Line Result - args.outputs.reserved << [right.shift_left(110), @bottom.shift_up(630), 100, 100, @logo, 0, (80.0 * slide_progress).to_i].sprite -** Processing line: ~~ + sprites_to_create.each do |h| +** Processing line: ~ export_animation_frame h[:index], h[:path_override]~ - Inside source: true *** True Line Result - -** Processing line: ~ y = @bottom + 2 # just give us a little padding at the bottom.~ + export_animation_frame h[:index], h[:path_override] +** Processing line: ~ end~ - Inside source: true *** True Line Result - y = @bottom + 2 # just give us a little padding at the bottom. -** Processing line: ~ prompt.render args, x: left.shift_right(10), y: y~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - prompt.render args, x: left.shift_right(10), y: y -** Processing line: ~ y += line_height_px * 1.5~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - y += line_height_px * 1.5 -** Processing line: ~ args.outputs.reserved << line(y: y, color: @text_color.mult_alpha(slide_progress))~ + +** Processing line: ~ def process_queue_reset_sprite~ - Inside source: true *** True Line Result - args.outputs.reserved << line(y: y, color: @text_color.mult_alpha(slide_progress)) -** Processing line: ~ y += line_height_px.to_f / 2.0~ + def process_queue_reset_sprite +** Processing line: ~ sprites_to_reset = queues.reset_sprite~ - Inside source: true *** True Line Result - y += line_height_px.to_f / 2.0 -** Processing line: ~~ + sprites_to_reset = queues.reset_sprite +** Processing line: ~ .find_all { |h| h[:at].elapsed? }~ - Inside source: true *** True Line Result - -** Processing line: ~ ((@log.size - @log_offset) - 1).downto(0) do |idx|~ + .find_all { |h| h[:at].elapsed? } +** Processing line: ~~ - Inside source: true *** True Line Result - ((@log.size - @log_offset) - 1).downto(0) do |idx| -** Processing line: ~ offset_after_write = write_primitive_and_return_offset args, left, y, @log[idx]~ + +** Processing line: ~ queues.reset_sprite -= sprites_to_reset~ - Inside source: true *** True Line Result - offset_after_write = write_primitive_and_return_offset args, left, y, @log[idx] -** Processing line: ~ y += offset_after_write~ + queues.reset_sprite -= sprites_to_reset +** Processing line: ~~ - Inside source: true *** True Line Result - y += offset_after_write -** Processing line: ~ break if y > top~ + +** Processing line: ~ sprites_to_reset.each { |h| gtk.reset_sprite (sprite_path h[:index]) }~ - Inside source: true *** True Line Result - break if y > top -** Processing line: ~ end~ + sprites_to_reset.each { |h| gtk.reset_sprite (sprite_path h[:index]) } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # past log separator~ +** Processing line: ~ def process_queue_update_rt_animation_frame~ - Inside source: true *** True Line Result - # past log separator -** Processing line: ~ args.outputs.reserved << line(y: y + line_height_px.half, color: @text_color.mult_alpha(0.25 * slide_progress))~ + def process_queue_update_rt_animation_frame +** Processing line: ~ animation_frames_to_update = queues.update_rt_animation_frame~ - Inside source: true *** True Line Result - args.outputs.reserved << line(y: y + line_height_px.half, color: @text_color.mult_alpha(0.25 * slide_progress)) + animation_frames_to_update = queues.update_rt_animation_frame +** Processing line: ~ .find_all { |h| h[:at].elapsed? }~ +- Inside source: true +*** True Line Result + .find_all { |h| h[:at].elapsed? } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ y += line_height_px~ +** Processing line: ~ queues.update_rt_animation_frame -= animation_frames_to_update~ - Inside source: true *** True Line Result - y += line_height_px + queues.update_rt_animation_frame -= animation_frames_to_update ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ ((@archived_log.size - @log_offset) - 1).downto(0) do |idx|~ +** Processing line: ~ animation_frames_to_update.each do |h|~ - Inside source: true *** True Line Result - ((@archived_log.size - @log_offset) - 1).downto(0) do |idx| -** Processing line: ~ offset_after_write = write_primitive_and_return_offset args, left, y, @archived_log[idx], archived: true~ + animation_frames_to_update.each do |h| +** Processing line: ~ update_animation_frame_render_target animation_frames[h[:index]]~ - Inside source: true *** True Line Result - offset_after_write = write_primitive_and_return_offset args, left, y, @archived_log[idx], archived: true -** Processing line: ~ y += offset_after_write~ + update_animation_frame_render_target animation_frames[h[:index]] +** Processing line: ~~ - Inside source: true *** True Line Result - y += offset_after_write -** Processing line: ~ break if y > top~ + +** Processing line: ~ if h[:queue_sprite_creation]~ - Inside source: true *** True Line Result - break if y > top -** Processing line: ~ end~ + if h[:queue_sprite_creation] +** Processing line: ~ queues.create_sprite << { index: h[:index],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + queues.create_sprite << { index: h[:index], +** Processing line: ~ at: state.tick_count + 1 }~ - Inside source: true *** True Line Result - -** Processing line: ~ render_log_offset args~ + at: state.tick_count + 1 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - render_log_offset args + 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 render_log_offset args~ +** Processing line: ~ def update_animation_frame_render_target animation_frame~ - Inside source: true *** True Line Result - def render_log_offset args -** Processing line: ~ return if @log_offset <= 0~ + def update_animation_frame_render_target animation_frame +** Processing line: ~ return if !animation_frame~ - Inside source: true *** True Line Result - return if @log_offset <= 0 -** Processing line: ~ args.outputs.reserved << font_style.label(~ + return if !animation_frame +** Processing line: ~~ - Inside source: true *** True Line Result - args.outputs.reserved << font_style.label( -** Processing line: ~ x: right.shift_left(5),~ + +** Processing line: ~ outputs[animation_frame[:rt_name]].width = state.rt_canvas.size~ - Inside source: true *** True Line Result - x: right.shift_left(5), -** Processing line: ~ y: top.shift_down(5 + line_height_px),~ + outputs[animation_frame[:rt_name]].width = state.rt_canvas.size +** Processing line: ~ outputs[animation_frame[:rt_name]].height = state.rt_canvas.size~ - Inside source: true *** True Line Result - y: top.shift_down(5 + line_height_px), -** Processing line: ~ text: "[#{@log_offset}/#{@log.size}]",~ + outputs[animation_frame[:rt_name]].height = state.rt_canvas.size +** Processing line: ~ outputs[animation_frame[:rt_name]].solids << animation_frame[:pixels].map do |f|~ - Inside source: true *** True Line Result - text: "[#{@log_offset}/#{@log.size}]", -** Processing line: ~ color: @text_color,~ + outputs[animation_frame[:rt_name]].solids << animation_frame[:pixels].map do |f| +** Processing line: ~ { x: f.x,~ - Inside source: true *** True Line Result - color: @text_color, -** Processing line: ~ alignment_enum: 2~ + { x: f.x, +** Processing line: ~ y: f.y,~ - Inside source: true *** True Line Result - alignment_enum: 2 -** Processing line: ~ )~ + y: f.y, +** Processing line: ~ w: 1,~ - Inside source: true *** True Line Result - ) + w: 1, +** Processing line: ~ h: 1, r: 255, g: 255, b: 255 }~ +- Inside source: true +*** True Line Result + h: 1, r: 255, g: 255, b: 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: ~ def include_error_marker? text~ +** Processing line: ~ def animation_frames~ - Inside source: true *** True Line Result - def include_error_marker? text -** Processing line: ~ include_any_words?(text.gsub('OutputsDeprecated', ''), error_markers)~ + def animation_frames +** Processing line: ~ state.animation_frames~ - Inside source: true *** True Line Result - include_any_words?(text.gsub('OutputsDeprecated', ''), error_markers) -** Processing line: ~ end~ + state.animation_frames +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def error_markers~ -- Inside source: true -*** True Line Result - def error_markers -** Processing line: ~ ["exception", "error", "undefined method", "failed", "syntax", "deprecated"]~ +** Processing line: ~ def add_animation_frame_to_end~ - Inside source: true *** True Line Result - ["exception", "error", "undefined method", "failed", "syntax", "deprecated"] -** Processing line: ~ end~ + def add_animation_frame_to_end +** Processing line: ~ animation_frames << {~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + animation_frames << { +** Processing line: ~ index: animation_frames.length,~ - Inside source: true *** True Line Result - -** Processing line: ~ def include_subdued_markers? text~ + index: animation_frames.length, +** Processing line: ~ pixels: [],~ - Inside source: true *** True Line Result - def include_subdued_markers? text -** Processing line: ~ include_any_words? text, subdued_markers~ + pixels: [], +** Processing line: ~ rt_name: "animation_frame_#{animation_frames.length}"~ - Inside source: true *** True Line Result - include_any_words? text, subdued_markers -** Processing line: ~ end~ + rt_name: "animation_frame_#{animation_frames.length}" +** Processing line: ~ }~ - Inside source: true *** True Line Result - end + } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def include_any_words? text, words~ -- Inside source: true -*** True Line Result - def include_any_words? text, words -** Processing line: ~ words.any? { |w| text.downcase.include?(w) && !text.downcase.include?(":#{w}") }~ -- Inside source: true -*** True Line Result - words.any? { |w| text.downcase.include?(w) && !text.downcase.include?(":#{w}") } -** Processing line: ~ end~ +** Processing line: ~ state.animation_frames_selected_index = (animation_frames.length - 1)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.animation_frames_selected_index = (animation_frames.length - 1) +** Processing line: ~ queues.update_rt_animation_frame << { index: state.animation_frames_selected_index,~ - Inside source: true *** True Line Result - -** Processing line: ~ def subdued_markers~ + queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, +** Processing line: ~ at: state.tick_count,~ - Inside source: true *** True Line Result - def subdued_markers -** Processing line: ~ ["reloaded", "exported the"]~ + at: state.tick_count, +** Processing line: ~ queue_sprite_creation: true }~ - Inside source: true *** True Line Result - ["reloaded", "exported the"] -** Processing line: ~ end~ + queue_sprite_creation: true } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc args~ -- Inside source: true -*** True Line Result - def calc args -** Processing line: ~ if visible? &&~ +** Processing line: ~ def sprite_path i~ - Inside source: true *** True Line Result - if visible? && -** Processing line: ~ @show_reason == :toast &&~ + def sprite_path i +** Processing line: ~ "canvas/sprite-#{i}.png"~ - Inside source: true *** True Line Result - @show_reason == :toast && -** Processing line: ~ @toasted_at &&~ + "canvas/sprite-#{i}.png" +** Processing line: ~ end~ - Inside source: true *** True Line Result - @toasted_at && -** Processing line: ~ @toasted_at.elapsed?(@toast_duration, Kernel.global_tick_count)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @toasted_at.elapsed?(@toast_duration, Kernel.global_tick_count) -** Processing line: ~ hide~ + +** Processing line: ~ def export_animation_frame i, path_override = nil~ - Inside source: true *** True Line Result - hide -** Processing line: ~ end~ + def export_animation_frame i, path_override = nil +** Processing line: ~ return if !state.animation_frames[i]~ - Inside source: true *** True Line Result - end + return if !state.animation_frames[i] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if !$gtk.paused? && visible? && (show_reason == :exception || show_reason == :exception_on_load)~ +** Processing line: ~ outputs.screenshots << state.buttons_frame_selection~ - Inside source: true *** True Line Result - if !$gtk.paused? && visible? && (show_reason == :exception || show_reason == :exception_on_load) -** Processing line: ~ hide~ + outputs.screenshots << state.buttons_frame_selection +** Processing line: ~ .items[i][:inner_rect]~ - Inside source: true *** True Line Result - hide -** Processing line: ~ end~ + .items[i][:inner_rect] +** Processing line: ~ .merge(path: path_override || (sprite_path i))~ - Inside source: true *** True Line Result - end + .merge(path: path_override || (sprite_path i)) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if $gtk.files_reloaded.length > 0~ -- Inside source: true -*** True Line Result - if $gtk.files_reloaded.length > 0 -** Processing line: ~ clear_toast~ -- Inside source: true -*** True Line Result - clear_toast -** Processing line: ~ @toast_ids.clear~ +** Processing line: ~ outputs.screenshots << state.buttons_frame_selection~ - Inside source: true *** True Line Result - @toast_ids.clear -** Processing line: ~ end~ + outputs.screenshots << state.buttons_frame_selection +** Processing line: ~ .items[i][:inner_rect]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + .items[i][:inner_rect] +** Processing line: ~ .merge(path: "tmp/sprite_backups/#{Time.now.to_i}-sprite-#{i}.png")~ - Inside source: true *** True Line Result - end + .merge(path: "tmp/sprite_backups/#{Time.now.to_i}-sprite-#{i}.png") ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ queues.reset_sprite << { index: i, at: state.tick_count }~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ begin~ + queues.reset_sprite << { index: i, at: state.tick_count } +** Processing line: ~ end~ - Inside source: true *** True Line Result - begin -** Processing line: ~ return if @disabled~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - return if @disabled -** Processing line: ~ render args~ + +** Processing line: ~ def selected_animation_frame~ - Inside source: true *** True Line Result - render args -** Processing line: ~ process_inputs args~ + def selected_animation_frame +** Processing line: ~ state.animation_frames[state.animation_frames_selected_index]~ - Inside source: true *** True Line Result - process_inputs args -** Processing line: ~ return unless should_tick?~ + state.animation_frames[state.animation_frames_selected_index] +** Processing line: ~ end~ - Inside source: true *** True Line Result - return unless should_tick? -** Processing line: ~ calc args~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - calc args -** Processing line: ~ prompt.tick~ + +** Processing line: ~ def edit_current_animation_frame point~ - Inside source: true *** True Line Result - prompt.tick -** Processing line: ~ menu.tick args~ + def edit_current_animation_frame point +** Processing line: ~ draw_area_point = (to_draw_area point)~ - Inside source: true *** True Line Result - menu.tick args -** Processing line: ~ rescue Exception => e~ + draw_area_point = (to_draw_area point) +** Processing line: ~ if state.edit_mode == :drawing && (!selected_animation_frame[:pixels].include? draw_area_point)~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ begin~ + if state.edit_mode == :drawing && (!selected_animation_frame[:pixels].include? draw_area_point) +** Processing line: ~ selected_animation_frame[:pixels] << draw_area_point~ - Inside source: true *** True Line Result - begin -** Processing line: ~ puts "#{e}"~ + selected_animation_frame[:pixels] << draw_area_point +** Processing line: ~ queues.update_rt_animation_frame << { index: state.animation_frames_selected_index,~ - Inside source: true *** True Line Result - puts "#{e}" -** Processing line: ~ puts "* FATAL: The GTK::Console console threw an unhandled exception and has been reset. You should report this exception (along with reproduction steps) to DragonRuby."~ + queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, +** Processing line: ~ at: state.tick_count,~ - Inside source: true *** True Line Result - puts "* FATAL: The GTK::Console console threw an unhandled exception and has been reset. You should report this exception (along with reproduction steps) to DragonRuby." -** Processing line: ~ rescue~ + at: state.tick_count, +** Processing line: ~ queue_sprite_creation: !user_is_editing? }~ - Inside source: true *** True Line Result - rescue -** Processing line: ~ end~ + queue_sprite_creation: !user_is_editing? } +** Processing line: ~ elsif state.edit_mode == :erasing && (selected_animation_frame[:pixels].include? draw_area_point)~ - Inside source: true *** True Line Result - end -** Processing line: ~ @disabled = true~ + elsif state.edit_mode == :erasing && (selected_animation_frame[:pixels].include? draw_area_point) +** Processing line: ~ selected_animation_frame[:pixels] = selected_animation_frame[:pixels].reject { |p| p == draw_area_point }~ - Inside source: true *** True Line Result - @disabled = true -** Processing line: ~ $stdout.puts e~ + selected_animation_frame[:pixels] = selected_animation_frame[:pixels].reject { |p| p == draw_area_point } +** Processing line: ~ queues.update_rt_animation_frame << { index: state.animation_frames_selected_index,~ - Inside source: true *** True Line Result - $stdout.puts e -** Processing line: ~ $stdout.puts "* FATAL: The GTK::Console console threw an unhandled exception and has been reset. You should report this exception (along with reproduction steps) to DragonRuby."~ + queues.update_rt_animation_frame << { index: state.animation_frames_selected_index, +** Processing line: ~ at: state.tick_count,~ - Inside source: true *** True Line Result - $stdout.puts "* FATAL: The GTK::Console console threw an unhandled exception and has been reset. You should report this exception (along with reproduction steps) to DragonRuby." -** Processing line: ~ end~ + at: state.tick_count, +** Processing line: ~ queue_sprite_creation: !user_is_editing? }~ - Inside source: true *** True Line Result - end + queue_sprite_creation: !user_is_editing? } ** 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 set_command_with_history_silent command, histories, show_reason = nil~ +** Processing line: ~ def user_is_editing?~ - Inside source: true *** True Line Result - def set_command_with_history_silent command, histories, show_reason = nil -** Processing line: ~ set_command_extended command: command, histories: histories, show_reason: show_reason~ + def user_is_editing? +** Processing line: ~ state.last_mouse_down > state.last_mouse_up~ - Inside source: true *** True Line Result - set_command_extended command: command, histories: histories, show_reason: show_reason -** Processing line: ~ end~ + state.last_mouse_down > state.last_mouse_up +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def defaults_set_command_extended~ -- Inside source: true -*** True Line Result - def defaults_set_command_extended -** Processing line: ~ {~ +** Processing line: ~ def to_draw_area point~ - Inside source: true *** True Line Result - { -** Processing line: ~ command: "puts 'Hello World'",~ + def to_draw_area point +** Processing line: ~ x, y = point~ - Inside source: true *** True Line Result - command: "puts 'Hello World'", -** Processing line: ~ histories: [],~ + x, y = point +** Processing line: ~ x -= rt_canvas.sprite.x~ - Inside source: true *** True Line Result - histories: [], -** Processing line: ~ show_reason: nil,~ + x -= rt_canvas.sprite.x +** Processing line: ~ y -= rt_canvas.sprite.y~ - Inside source: true *** True Line Result - show_reason: nil, -** Processing line: ~ force: false~ + y -= rt_canvas.sprite.y +** Processing line: ~ { x: x.idiv(rt_canvas.zoom),~ - Inside source: true *** True Line Result - force: false -** Processing line: ~ }~ + { x: x.idiv(rt_canvas.zoom), +** Processing line: ~ y: y.idiv(rt_canvas.zoom) }~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + y: y.idiv(rt_canvas.zoom) } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def set_command_extended opts~ +** Processing line: ~ def rt_canvas~ - Inside source: true *** True Line Result - def set_command_extended opts -** Processing line: ~ opts = defaults_set_command_extended.merge opts~ + def rt_canvas +** Processing line: ~ state.rt_canvas ||= state.new_entity(:rt_canvas)~ - Inside source: true *** True Line Result - opts = defaults_set_command_extended.merge opts -** Processing line: ~ @command_history.concat opts[:histories]~ + state.rt_canvas ||= state.new_entity(:rt_canvas) +** Processing line: ~ end~ - Inside source: true *** True Line Result - @command_history.concat opts[:histories] -** Processing line: ~ @command_history << opts[:command] if @command_history[-1] != opts[:command]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @command_history << opts[:command] if @command_history[-1] != opts[:command] -** Processing line: ~ self.current_input_str = opts[:command] if @command_set_at != Kernel.global_tick_count || opts[:force]~ + +** Processing line: ~ def queues~ - Inside source: true *** True Line Result - self.current_input_str = opts[:command] if @command_set_at != Kernel.global_tick_count || opts[:force] -** Processing line: ~ @command_set_at = Kernel.global_tick_count~ + def queues +** Processing line: ~ state.queues ||= state.new_entity(:queues)~ - Inside source: true *** True Line Result - @command_set_at = Kernel.global_tick_count -** Processing line: ~ @command_history_index = -1~ + state.queues ||= state.new_entity(:queues) +** Processing line: ~ end~ - Inside source: true *** True Line Result - @command_history_index = -1 -** Processing line: ~ save_history~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - save_history -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end + +** Processing line: ~ $game = OneBitLowrezPaint.new~ +- Inside source: true +*** True Line Result + $game = OneBitLowrezPaint.new ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def set_command_with_history command, histories, show_reason = nil~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - def set_command_with_history command, histories, show_reason = nil -** Processing line: ~ set_command_with_history_silent command, histories, show_reason~ + def tick args +** Processing line: ~ $game.args = args~ - Inside source: true *** True Line Result - set_command_with_history_silent command, histories, show_reason -** Processing line: ~ show show_reason~ + $game.args = args +** Processing line: ~ $game.tick~ - Inside source: true *** True Line Result - show show_reason -** Processing line: ~ end~ + $game.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ # $gtk.reset~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def set_command command, show_reason = nil~ + # $gtk.reset +** Processing line: ~~ - Inside source: true *** True Line Result - def set_command command, show_reason = nil -** Processing line: ~ set_command_silent command, show_reason~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - set_command_silent command, show_reason -** Processing line: ~ show show_reason~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - show show_reason -** Processing line: ~ end~ -- Inside source: true + +** Processing line: ~*** Dev Tools - Tile Editor Starting Point - main.rb~ +- Header detected. *** True Line Result - end -** Processing line: ~~ -- Inside source: true + +*** True Line Result +*** Dev Tools - Tile Editor Starting Point - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ def set_command_silent command, show_reason = nil~ -- Inside source: true *** True Line Result - def set_command_silent command, show_reason = nil -** Processing line: ~ set_command_with_history_silent command, [], show_reason~ +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_dev_tools/tile_editor_starting_point/app/main.rb~ - Inside source: true *** True Line Result - set_command_with_history_silent command, [], show_reason -** Processing line: ~ end~ + # ./samples/99_genre_dev_tools/tile_editor_starting_point/app/main.rb +** Processing line: ~ =begin~ - Inside source: true *** True Line Result - end + =begin ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def set_system_command command, show_reason = nil~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ - Inside source: true *** True Line Result - def set_system_command command, show_reason = nil -** Processing line: ~ if $gtk.platform == "Mac OS X"~ + APIs listing that haven't been encountered in previous sample apps: +** Processing line: ~~ - Inside source: true *** True Line Result - if $gtk.platform == "Mac OS X" -** Processing line: ~ set_command_silent "$gtk.system \"open #{command}\""~ + +** Processing line: ~ - to_s: Returns a string representation of an object.~ - Inside source: true *** True Line Result - set_command_silent "$gtk.system \"open #{command}\"" -** Processing line: ~ else~ + - to_s: Returns a string representation of an object. +** Processing line: ~ For example, if we had~ - Inside source: true *** True Line Result - else -** Processing line: ~ set_command_silent "$gtk.system \"start #{command}\""~ + For example, if we had +** Processing line: ~ 500.to_s~ - Inside source: true *** True Line Result - set_command_silent "$gtk.system \"start #{command}\"" -** Processing line: ~ end~ + 500.to_s +** Processing line: ~ the string "500" would be returned.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + the string "500" would be returned. +** Processing line: ~ Similar to to_i, which returns an integer representation of an object.~ - Inside source: true *** True Line Result - end + Similar to to_i, which returns an integer representation of an object. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def system_command~ -- Inside source: true -*** True Line Result - def system_command -** Processing line: ~ if $gtk.platform == "Mac OS X"~ +** Processing line: ~ - Ceil: Returns an integer number greater than or equal to the original~ - Inside source: true *** True Line Result - if $gtk.platform == "Mac OS X" -** Processing line: ~ "open"~ + - Ceil: Returns an integer number greater than or equal to the original +** Processing line: ~ with no decimal.~ - Inside source: true *** True Line Result - "open" -** Processing line: ~ else~ + with no decimal. +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ "start"~ + +** Processing line: ~ Reminders:~ - Inside source: true *** True Line Result - "start" -** Processing line: ~ end~ + Reminders: +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ - ARRAY#inside_rect?: Returns true or false depending on if the point is inside a rect.~ - Inside source: true *** True Line Result - end + - ARRAY#inside_rect?: Returns true or false depending on if the point is inside a rect. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ private~ +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ - Inside source: true *** True Line Result - private + - args.outputs.labels: An array. The values generate a label. +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +- Inside source: true +*** True Line Result + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +- Inside source: true +*** True Line Result + For more information about labels, go to mygame/documentation/02-labels.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def w~ +** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ - Inside source: true *** True Line Result - def w -** Processing line: ~ $gtk.logical_width~ + - args.outputs.sprites: An array. The values generate a sprite. +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, IMAGE PATH]~ - Inside source: true *** True Line Result - $gtk.logical_width -** Processing line: ~ end~ + The parameters are [X, Y, WIDTH, HEIGHT, IMAGE PATH] +** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ - Inside source: true *** True Line Result - end + For more information about sprites, go to mygame/documentation/05-sprites.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def h~ +** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ - Inside source: true *** True Line Result - def h -** Processing line: ~ $gtk.logical_height~ + - args.outputs.solids: An array. The values generate a solid. +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ - Inside source: true *** True Line Result - $gtk.logical_height -** Processing line: ~ end~ + The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE] +** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ - Inside source: true *** True Line Result - end + For more information about solids, go to mygame/documentation/03-solids-and-borders.md. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # methods top; left; right~ +** Processing line: ~ - args.outputs.lines: An array. The values generate a line.~ - Inside source: true *** True Line Result - # methods top; left; right -** Processing line: ~ # Forward to grid~ + - args.outputs.lines: An array. The values generate a line. +** Processing line: ~ The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE]~ - Inside source: true *** True Line Result - # Forward to grid -** Processing line: ~ %i[top left right].each do |method|~ + The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE] +** Processing line: ~ For more information about lines, go to mygame/documentation/04-lines.md.~ - Inside source: true *** True Line Result - %i[top left right].each do |method| -** Processing line: ~ define_method method do~ + For more information about lines, go to mygame/documentation/04-lines.md. +** Processing line: ~~ - Inside source: true *** True Line Result - define_method method do -** Processing line: ~ $gtk.args.grid.send(method)~ + +** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ - Inside source: true *** True Line Result - $gtk.args.grid.send(method) -** Processing line: ~ end~ + - args.state.new_entity: Used when we want to create a new object, like a sprite or button. +** Processing line: ~ In this sample app, new_entity is used to create a new button that clears the grid.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + In this sample app, new_entity is used to create a new button that clears the grid. +** Processing line: ~ (Remember, you can use state to define ANY property and it will be retained across frames.)~ - Inside source: true *** True Line Result - end + (Remember, you can use state to define ANY property and it will be retained across frames.) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def line_height_px~ +** Processing line: ~ =end~ - Inside source: true *** True Line Result - def line_height_px -** Processing line: ~ font_style.line_height_px~ + =end +** Processing line: ~~ - Inside source: true *** True Line Result - font_style.line_height_px -** Processing line: ~ end~ + +** Processing line: ~ # This sample app shows an empty grid that the user can paint in. There are different image tiles that~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # This sample app shows an empty grid that the user can paint in. There are different image tiles that +** Processing line: ~ # the user can use to fill the grid, and the "Clear" button can be pressed to clear the grid boxes.~ - Inside source: true *** True Line Result - -** Processing line: ~ def lines_on_one_page~ + # the user can use to fill the grid, and the "Clear" button can be pressed to clear the grid boxes. +** Processing line: ~~ - Inside source: true *** True Line Result - def lines_on_one_page -** Processing line: ~ (h - 4).idiv(line_height_px)~ + +** Processing line: ~ class TileEditor~ - Inside source: true *** True Line Result - (h - 4).idiv(line_height_px) -** Processing line: ~ end~ + class TileEditor +** Processing line: ~ attr_accessor :inputs, :state, :outputs, :grid, :args~ - Inside source: true *** True Line Result - end + attr_accessor :inputs, :state, :outputs, :grid, :args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def line(y:, color:)~ +** Processing line: ~ # Runs all the methods necessary for the game to function properly.~ - Inside source: true *** True Line Result - def line(y:, color:) -** Processing line: ~ [left, y, right, y, *color].line~ + # Runs all the methods necessary for the game to function properly. +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - [left, y, right, y, *color].line -** Processing line: ~ end~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + defaults +** Processing line: ~ render~ - Inside source: true *** True Line Result - -** Processing line: ~ def include_row_marker? log_entry~ + render +** Processing line: ~ check_click~ - Inside source: true *** True Line Result - def include_row_marker? log_entry -** Processing line: ~ log_entry[0] == "|"~ + check_click +** Processing line: ~ draw_buttons~ - Inside source: true *** True Line Result - log_entry[0] == "|" -** Processing line: ~ end~ + draw_buttons +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def include_header_marker? log_entry~ +** Processing line: ~ # Sets default values~ - Inside source: true *** True Line Result - def include_header_marker? log_entry -** Processing line: ~ return false if (log_entry.strip.include? ".rb")~ + # Sets default values +** Processing line: ~ # Initialization only happens in the first frame~ - Inside source: true *** True Line Result - return false if (log_entry.strip.include? ".rb") -** Processing line: ~ (log_entry.start_with? "* ") ||~ + # Initialization only happens in the first frame +** Processing line: ~ # NOTE: The values of some of these variables may seem confusingly large at first.~ - Inside source: true *** True Line Result - (log_entry.start_with? "* ") || -** Processing line: ~ (log_entry.start_with? "** ") ||~ + # NOTE: The values of some of these variables may seem confusingly large at first. +** Processing line: ~ # The gridSize is 1600 but it seems a lot smaller on the screen, for example.~ - Inside source: true *** True Line Result - (log_entry.start_with? "** ") || -** Processing line: ~ (log_entry.start_with? "*** ") ||~ + # The gridSize is 1600 but it seems a lot smaller on the screen, for example. +** Processing line: ~ # But keep in mind that by using the "W", "A", "S", and "D" keys, you can~ - Inside source: true *** True Line Result - (log_entry.start_with? "*** ") || -** Processing line: ~ (log_entry.start_with? "**** ")~ + # But keep in mind that by using the "W", "A", "S", and "D" keys, you can +** Processing line: ~ # move the grid's view in all four directions for more grid spaces.~ - Inside source: true *** True Line Result - (log_entry.start_with? "**** ") -** Processing line: ~ end~ + # move the grid's view in all four directions for more grid spaces. +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def defaults +** Processing line: ~ state.tileCords ||= []~ - Inside source: true *** True Line Result - -** Processing line: ~ def color_for_log_entry(log_entry)~ + state.tileCords ||= [] +** Processing line: ~ state.tileQuantity ||= 6~ - Inside source: true *** True Line Result - def color_for_log_entry(log_entry) -** Processing line: ~ if include_row_marker? log_entry~ + state.tileQuantity ||= 6 +** Processing line: ~ state.tileSize ||= 50~ - Inside source: true *** True Line Result - if include_row_marker? log_entry -** Processing line: ~ @text_color~ + state.tileSize ||= 50 +** Processing line: ~ state.tileSelected ||= 1~ - Inside source: true *** True Line Result - @text_color -** Processing line: ~ elsif include_error_marker? log_entry~ + state.tileSelected ||= 1 +** Processing line: ~ state.tempX ||= 50~ - Inside source: true *** True Line Result - elsif include_error_marker? log_entry -** Processing line: ~ @error_color~ + state.tempX ||= 50 +** Processing line: ~ state.tempY ||= 500~ - Inside source: true *** True Line Result - @error_color -** Processing line: ~ elsif include_subdued_markers? log_entry~ + state.tempY ||= 500 +** Processing line: ~ state.speed ||= 4~ - Inside source: true *** True Line Result - elsif include_subdued_markers? log_entry -** Processing line: ~ @text_color.mult_alpha(0.5)~ + state.speed ||= 4 +** Processing line: ~ state.centerX ||= 4000~ - Inside source: true *** True Line Result - @text_color.mult_alpha(0.5) -** Processing line: ~ elsif include_header_marker? log_entry~ + state.centerX ||= 4000 +** Processing line: ~ state.centerY ||= 4000~ - Inside source: true *** True Line Result - elsif include_header_marker? log_entry -** Processing line: ~ @header_color~ + state.centerY ||= 4000 +** Processing line: ~ state.originalCenter ||= [state.centerX, state.centerY]~ - Inside source: true *** True Line Result - @header_color -** Processing line: ~ elsif log_entry.start_with?("====")~ + state.originalCenter ||= [state.centerX, state.centerY] +** Processing line: ~ state.gridSize ||= 1600~ - Inside source: true *** True Line Result - elsif log_entry.start_with?("====") -** Processing line: ~ @header_color~ + state.gridSize ||= 1600 +** Processing line: ~ state.lineQuantity ||= 50~ - Inside source: true *** True Line Result - @header_color -** Processing line: ~ else~ + state.lineQuantity ||= 50 +** Processing line: ~ state.increment ||= state.gridSize / state.lineQuantity~ - Inside source: true *** True Line Result - else -** Processing line: ~ @text_color~ + state.increment ||= state.gridSize / state.lineQuantity +** Processing line: ~ state.gridX ||= []~ - Inside source: true *** True Line Result - @text_color -** Processing line: ~ end~ + state.gridX ||= [] +** Processing line: ~ state.gridY ||= []~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + state.gridY ||= [] +** Processing line: ~ state.filled_squares ||= []~ - Inside source: true *** True Line Result - end + state.filled_squares ||= [] +** Processing line: ~ state.grid_border ||= [390, 140, 500, 500]~ +- Inside source: true +*** True Line Result + state.grid_border ||= [390, 140, 500, 500] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def prompt~ +** Processing line: ~ get_grid unless state.tempX == 0 # calls get_grid in the first frame only~ - Inside source: true *** True Line Result - def prompt -** Processing line: ~ @prompt ||= Prompt.new(font_style: font_style, text_color: @text_color, console_text_width: console_text_width)~ + get_grid unless state.tempX == 0 # calls get_grid in the first frame only +** Processing line: ~ determineTileCords unless state.tempX == 0 # calls determineTileCords in first frame~ - Inside source: true *** True Line Result - @prompt ||= Prompt.new(font_style: font_style, text_color: @text_color, console_text_width: console_text_width) -** Processing line: ~ end~ + determineTileCords unless state.tempX == 0 # calls determineTileCords in first frame +** Processing line: ~ state.tempX = 0 # sets tempX to 0; the two methods aren't called again~ - Inside source: true *** True Line Result - end + state.tempX = 0 # sets tempX to 0; the two methods aren't called again +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def current_input_str~ +** Processing line: ~ # Calculates the placement of lines or separators in the grid~ - Inside source: true *** True Line Result - def current_input_str -** Processing line: ~ prompt.current_input_str~ + # Calculates the placement of lines or separators in the grid +** Processing line: ~ def get_grid~ - Inside source: true *** True Line Result - prompt.current_input_str -** Processing line: ~ end~ + def get_grid +** Processing line: ~ curr_x = state.centerX - (state.gridSize / 2) # starts at left of grid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + curr_x = state.centerX - (state.gridSize / 2) # starts at left of grid +** Processing line: ~ deltaX = state.gridSize / state.lineQuantity # finds distance to place vertical lines evenly through width of grid~ - Inside source: true *** True Line Result - -** Processing line: ~ def current_input_str=(str)~ + deltaX = state.gridSize / state.lineQuantity # finds distance to place vertical lines evenly through width of grid +** Processing line: ~ (state.lineQuantity + 2).times do~ - Inside source: true *** True Line Result - def current_input_str=(str) -** Processing line: ~ prompt.current_input_str = str~ + (state.lineQuantity + 2).times do +** Processing line: ~ state.gridX << curr_x # adds curr_x to gridX collection~ - Inside source: true *** True Line Result - prompt.current_input_str = str + state.gridX << curr_x # adds curr_x to gridX collection +** Processing line: ~ curr_x += deltaX # increment curr_x by the distance between vertical lines~ +- Inside source: true +*** True Line Result + curr_x += deltaX # increment curr_x by the distance between vertical lines ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -94903,66 +98868,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 clear~ +** Processing line: ~ curr_y = state.centerY - (state.gridSize / 2) # starts at bottom of grid~ - Inside source: true *** True Line Result - def clear -** Processing line: ~ @archived_log.clear~ + curr_y = state.centerY - (state.gridSize / 2) # starts at bottom of grid +** Processing line: ~ deltaY = state.gridSize / state.lineQuantity # finds distance to place horizontal lines evenly through height of grid~ - Inside source: true *** True Line Result - @archived_log.clear -** Processing line: ~ @log.clear~ + deltaY = state.gridSize / state.lineQuantity # finds distance to place horizontal lines evenly through height of grid +** Processing line: ~ (state.lineQuantity + 2).times do~ - Inside source: true *** True Line Result - @log.clear -** Processing line: ~ @prompt.clear~ + (state.lineQuantity + 2).times do +** Processing line: ~ state.gridY << curr_y # adds curr_y to gridY collection~ - Inside source: true *** True Line Result - @prompt.clear -** Processing line: ~ :console_silent_eval~ + state.gridY << curr_y # adds curr_y to gridY collection +** Processing line: ~ curr_y += deltaY # increments curr_y to distance between horizontal lines~ - Inside source: true *** True Line Result - :console_silent_eval + curr_y += deltaY # increments curr_y to distance between horizontal lines ** 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 slide_progress~ +** Processing line: ~ # Determines coordinate positions of patterned tiles (on the left side of the grid)~ - Inside source: true *** True Line Result - def slide_progress -** Processing line: ~ return 0 if !@toggled_at~ + # Determines coordinate positions of patterned tiles (on the left side of the grid) +** Processing line: ~ def determineTileCords~ - Inside source: true *** True Line Result - return 0 if !@toggled_at -** Processing line: ~ if visible?~ + def determineTileCords +** Processing line: ~ state.tempCounter ||= 1 # initializes tempCounter to 1~ - Inside source: true *** True Line Result - if visible? -** Processing line: ~ @slide_progress = @toggled_at.global_ease(@animation_duration, :flip, :quint, :flip)~ + state.tempCounter ||= 1 # initializes tempCounter to 1 +** Processing line: ~ state.tileQuantity.times do # there are 6 different kinds of tiles~ - Inside source: true *** True Line Result - @slide_progress = @toggled_at.global_ease(@animation_duration, :flip, :quint, :flip) -** Processing line: ~ else~ + state.tileQuantity.times do # there are 6 different kinds of tiles +** Processing line: ~ state.tileCords += [[state.tempX, state.tempY, state.tempCounter]] # adds tile definition to collection~ - Inside source: true *** True Line Result - else -** Processing line: ~ @slide_progress = @toggled_at.global_ease(@animation_duration, :flip, :quint)~ + state.tileCords += [[state.tempX, state.tempY, state.tempCounter]] # adds tile definition to collection +** Processing line: ~ state.tempX += 75 # increments tempX to put horizontal space between the patterned tiles~ - Inside source: true *** True Line Result - @slide_progress = @toggled_at.global_ease(@animation_duration, :flip, :quint) -** Processing line: ~ end~ + state.tempX += 75 # increments tempX to put horizontal space between the patterned tiles +** Processing line: ~ state.tempCounter += 1 # increments tempCounter~ - Inside source: true *** True Line Result - end -** Processing line: ~ @slide_progress~ + state.tempCounter += 1 # increments tempCounter +** Processing line: ~ if state.tempX > 200 # if tempX exceeds 200 pixels~ - Inside source: true *** True Line Result - @slide_progress + if state.tempX > 200 # if tempX exceeds 200 pixels +** Processing line: ~ state.tempX = 50 # a new row of patterned tiles begins~ +- Inside source: true +*** True Line Result + state.tempX = 50 # a new row of patterned tiles begins +** Processing line: ~ state.tempY -= 75 # the new row is 75 pixels lower than the previous row~ +- Inside source: true +*** True Line Result + state.tempY -= 75 # the new row is 75 pixels lower than the previous row +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -94971,998 +98952,1002 @@ 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. +** Processing line: ~ # Outputs objects (grid, tiles, etc) onto the screen~ +- Inside source: true *** True Line Result - -** Processing line: ~* console_color.rb~ -- Header detected. + # Outputs objects (grid, tiles, etc) onto the screen +** Processing line: ~ def render~ +- Inside source: true *** True Line Result - + def render +** Processing line: ~ outputs.sprites << state.tileCords.map do # outputs tileCords collection using images in sprites folder~ +- Inside source: true *** True Line Result -* console_color.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + outputs.sprites << state.tileCords.map do # outputs tileCords collection using images in sprites folder +** Processing line: ~ |x, y, order|~ +- Inside source: true *** True Line Result - + |x, y, order| +** Processing line: ~ [x, y, state.tileSize, state.tileSize, 'sprites/image' + order.to_s + ".png"]~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/console_color.rb~ + [x, y, state.tileSize, state.tileSize, 'sprites/image' + order.to_s + ".png"] +** Processing line: ~ end~ - Inside source: true *** True Line Result - # ./dragon/console_color.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + end +** Processing line: ~ outputs.solids << [0, 0, 1280, 720, 255, 255, 255] # outputs white background~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + outputs.solids << [0, 0, 1280, 720, 255, 255, 255] # outputs white background +** Processing line: ~ add_grid # outputs grid~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # console_color.rb has been released under MIT (*only this file*).~ + add_grid # outputs grid +** Processing line: ~ print_title # outputs title and current tile pattern~ - Inside source: true *** True Line Result - # console_color.rb has been released under MIT (*only this file*). + print_title # outputs title and current tile pattern +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright:~ +** Processing line: ~ # Creates a grid by outputting vertical and horizontal grid lines onto the screen.~ - Inside source: true *** True Line Result - # Contributors outside of DragonRuby who also hold Copyright: -** Processing line: ~ # - Kevin Fischer: https://github.com/kfischer-okarin~ + # Creates a grid by outputting vertical and horizontal grid lines onto the screen. +** Processing line: ~ # Outputs sprites for the filled_squares collection onto the screen.~ - Inside source: true *** True Line Result - # - Kevin Fischer: https://github.com/kfischer-okarin -** Processing line: ~~ + # Outputs sprites for the filled_squares collection onto the screen. +** Processing line: ~ def add_grid~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + def add_grid +** Processing line: ~~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Console~ + +** Processing line: ~ # Outputs the grid's border.~ - Inside source: true *** True Line Result - class Console -** Processing line: ~ class Color~ + # Outputs the grid's border. +** Processing line: ~ outputs.borders << state.grid_border~ - Inside source: true *** True Line Result - class Color -** Processing line: ~ def initialize(color)~ + outputs.borders << state.grid_border +** Processing line: ~ temp = 0~ - Inside source: true *** True Line Result - def initialize(color) -** Processing line: ~ @color = color~ + temp = 0 +** Processing line: ~~ - Inside source: true *** True Line Result - @color = color -** Processing line: ~ @color << 255 if @color.size == 3~ + +** Processing line: ~ # Before looking at the code that outputs the vertical and horizontal lines in the~ - Inside source: true *** True Line Result - @color << 255 if @color.size == 3 -** Processing line: ~ end~ + # Before looking at the code that outputs the vertical and horizontal lines in the +** Processing line: ~ # grid, take note of the fact that:~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # grid, take note of the fact that: +** Processing line: ~ # grid_border[1] refers to the border's bottom line (running horizontally),~ - Inside source: true *** True Line Result - -** Processing line: ~ def mult_alpha(alpha_modifier)~ + # grid_border[1] refers to the border's bottom line (running horizontally), +** Processing line: ~ # grid_border[2] refers to the border's top line (running (horizontally),~ - Inside source: true *** True Line Result - def mult_alpha(alpha_modifier) -** Processing line: ~ Color.new [@color[0], @color[1], @color[2], (@color[3].to_f * alpha_modifier).to_i]~ + # grid_border[2] refers to the border's top line (running (horizontally), +** Processing line: ~ # grid_border[0] refers to the border's left line (running vertically),~ - Inside source: true *** True Line Result - Color.new [@color[0], @color[1], @color[2], (@color[3].to_f * alpha_modifier).to_i] -** Processing line: ~ end~ + # grid_border[0] refers to the border's left line (running vertically), +** Processing line: ~ # and grid_border[3] refers to the border's right line (running vertically).~ - Inside source: true *** True Line Result - end + # and grid_border[3] refers to the border's right line (running vertically). ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Support splat operator~ +** Processing line: ~ # [2]~ - Inside source: true *** True Line Result - # Support splat operator -** Processing line: ~ def to_a~ + # [2] +** Processing line: ~ # ----------~ - Inside source: true *** True Line Result - def to_a -** Processing line: ~ @color~ + # ---------- +** Processing line: ~ # | |~ - Inside source: true *** True Line Result - @color -** Processing line: ~ end~ + # | | +** Processing line: ~ # [0] | | [3]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # [0] | | [3] +** Processing line: ~ # | |~ - Inside source: true *** True Line Result - -** Processing line: ~ def to_h~ + # | | +** Processing line: ~ # ----------~ - Inside source: true *** True Line Result - def to_h -** Processing line: ~ { r: @color[0], g: @color[1], b: @color[2], a: @color[3] }~ + # ---------- +** Processing line: ~ # [1]~ - Inside source: true *** True Line Result - { r: @color[0], g: @color[1], b: @color[2], a: @color[3] } -** Processing line: ~ end~ + # [1] +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ # Calculates the positions and outputs the x grid lines in the color gray.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Calculates the positions and outputs the x grid lines in the color gray. +** Processing line: ~ state.gridX.map do # perform an action on all elements of the gridX collection~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + state.gridX.map do # perform an action on all elements of the gridX collection +** Processing line: ~ |x|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + |x| +** Processing line: ~ temp += 1 # increment temp~ - 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 + temp += 1 # increment temp ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* console_font_style.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ # if x's value is greater than (or equal to) the x value of the border's left side~ +- Inside source: true *** True Line Result -* console_font_style.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # if x's value is greater than (or equal to) the x value of the border's left side +** Processing line: ~ # and less than (or equal to) the x value of the border's right side~ +- Inside source: true *** True Line Result - + # and less than (or equal to) the x value of the border's right side +** Processing line: ~ if x >= state.centerX - (state.grid_border[2] / 2) && x <= state.centerX + (state.grid_border[2] / 2)~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/console_font_style.rb~ + if x >= state.centerX - (state.grid_border[2] / 2) && x <= state.centerX + (state.grid_border[2] / 2) +** Processing line: ~ delta = state.centerX - 640~ - Inside source: true *** True Line Result - # ./dragon/console_font_style.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + delta = state.centerX - 640 +** Processing line: ~ # vertical lines have the same starting and ending x positions~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + # vertical lines have the same starting and ending x positions +** Processing line: ~ # starting y and ending y positions lead from the bottom of the border to the top of the border~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # console_font_style.rb has been released under MIT (*only this file*).~ + # starting y and ending y positions lead from the bottom of the border to the top of the border +** Processing line: ~ outputs.lines << [x - delta, state.grid_border[1], x - delta, state.grid_border[1] + state.grid_border[2], 150, 150, 150] # sets definition of vertical line and outputs it~ - Inside source: true *** True Line Result - # console_font_style.rb has been released under MIT (*only this file*). -** Processing line: ~~ + outputs.lines << [x - delta, state.grid_border[1], x - delta, state.grid_border[1] + state.grid_border[2], 150, 150, 150] # sets definition of vertical line and outputs it +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright:~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Contributors outside of DragonRuby who also hold Copyright: -** Processing line: ~ # - Kevin Fischer: https://github.com/kfischer-okarin~ + end +** Processing line: ~ temp = 0~ - Inside source: true *** True Line Result - # - Kevin Fischer: https://github.com/kfischer-okarin + temp = 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ # Calculates the positions and outputs the y grid lines in the color gray.~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Console~ + # Calculates the positions and outputs the y grid lines in the color gray. +** Processing line: ~ state.gridY.map do # perform an action on all elements of the gridY collection~ - Inside source: true *** True Line Result - class Console -** Processing line: ~ class FontStyle~ + state.gridY.map do # perform an action on all elements of the gridY collection +** Processing line: ~ |y|~ - Inside source: true *** True Line Result - class FontStyle -** Processing line: ~ attr_reader :font, :size_enum, :line_height~ + |y| +** Processing line: ~ temp += 1 # increment temp~ - Inside source: true *** True Line Result - attr_reader :font, :size_enum, :line_height + temp += 1 # increment temp ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def initialize(font:, size_enum:, line_height:)~ -- Inside source: true -*** True Line Result - def initialize(font:, size_enum:, line_height:) -** Processing line: ~ @font = font~ +** Processing line: ~ # if y's value is greater than (or equal to) the y value of the border's bottom side~ - Inside source: true *** True Line Result - @font = font -** Processing line: ~ @size_enum = size_enum~ + # if y's value is greater than (or equal to) the y value of the border's bottom side +** Processing line: ~ # and less than (or equal to) the y value of the border's top side~ - Inside source: true *** True Line Result - @size_enum = size_enum -** Processing line: ~ @line_height = line_height~ + # and less than (or equal to) the y value of the border's top side +** Processing line: ~ if y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2)~ - Inside source: true *** True Line Result - @line_height = line_height -** Processing line: ~ end~ + if y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2) +** Processing line: ~ delta = state.centerY - 393~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + delta = state.centerY - 393 +** Processing line: ~ # horizontal lines have the same starting and ending y positions~ - Inside source: true *** True Line Result - -** Processing line: ~ def letter_size~ + # horizontal lines have the same starting and ending y positions +** Processing line: ~ # starting x and ending x positions lead from the left side of the border to the right side of the border~ - Inside source: true *** True Line Result - def letter_size -** Processing line: ~ @letter_size ||= $gtk.calcstringbox 'W', size_enum, font~ + # starting x and ending x positions lead from the left side of the border to the right side of the border +** Processing line: ~ outputs.lines << [state.grid_border[0], y - delta, state.grid_border[0] + state.grid_border[3], y - delta, 150, 150, 150] # sets definition of horizontal line and outputs it~ - Inside source: true *** True Line Result - @letter_size ||= $gtk.calcstringbox 'W', size_enum, font + outputs.lines << [state.grid_border[0], y - delta, state.grid_border[0] + state.grid_border[3], y - delta, 150, 150, 150] # sets definition of horizontal line and outputs it ** 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 line_height_px~ +** Processing line: ~ # Sets values and outputs sprites for the filled_squares collection.~ - Inside source: true *** True Line Result - def line_height_px -** Processing line: ~ @line_height_px ||= letter_size.y * line_height~ + # Sets values and outputs sprites for the filled_squares collection. +** Processing line: ~ state.filled_squares.map do # perform an action on every element of the filled_squares collection~ - Inside source: true *** True Line Result - @line_height_px ||= letter_size.y * line_height -** Processing line: ~ end~ + state.filled_squares.map do # perform an action on every element of the filled_squares collection +** Processing line: ~ |x, y, w, h, sprite|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + |x, y, w, h, sprite| +** Processing line: ~ # if x's value is greater than (or equal to) the x value of 17 pixels to the left of the border's left side~ - Inside source: true *** True Line Result - -** Processing line: ~ def label(x:, y:, text:, color:, alignment_enum: 0)~ + # if x's value is greater than (or equal to) the x value of 17 pixels to the left of the border's left side +** Processing line: ~ # and less than (or equal to) the x value of the border's right side~ - Inside source: true *** True Line Result - def label(x:, y:, text:, color:, alignment_enum: 0) -** Processing line: ~ {~ + # and less than (or equal to) the x value of the border's right side +** Processing line: ~ # and y's value is greater than (or equal to) the y value of the border's bottom side~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: x,~ + # and y's value is greater than (or equal to) the y value of the border's bottom side +** Processing line: ~ # and less than (or equal to) the y value of 25 pixels above the border's top side~ - Inside source: true *** True Line Result - x: x, -** Processing line: ~ y: y.shift_up(line_height_px), # !!! FIXME: remove .shift_up(line_height_px) when we fix coordinate origin on labels.~ + # and less than (or equal to) the y value of 25 pixels above the border's top side +** Processing line: ~ # NOTE: The allowance of 17 pixels and 25 pixels is due to the fact that a grid box may be slightly cut off or~ - Inside source: true *** True Line Result - y: y.shift_up(line_height_px), # !!! FIXME: remove .shift_up(line_height_px) when we fix coordinate origin on labels. -** Processing line: ~ text: text,~ + # NOTE: The allowance of 17 pixels and 25 pixels is due to the fact that a grid box may be slightly cut off or +** Processing line: ~ # not entirely visible in the grid's view (until it is moved using "W", "A", "S", "D")~ - Inside source: true *** True Line Result - text: text, -** Processing line: ~ font: font,~ + # not entirely visible in the grid's view (until it is moved using "W", "A", "S", "D") +** Processing line: ~ if x >= state.centerX - (state.grid_border[2] / 2) - 17 && x <= state.centerX + (state.grid_border[2] / 2) &&~ - Inside source: true *** True Line Result - font: font, -** Processing line: ~ size_enum: size_enum,~ + if x >= state.centerX - (state.grid_border[2] / 2) - 17 && x <= state.centerX + (state.grid_border[2] / 2) && +** Processing line: ~ y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2) + 25~ - Inside source: true *** True Line Result - size_enum: size_enum, -** Processing line: ~ alignment_enum: alignment_enum,~ + y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2) + 25 +** Processing line: ~ # calculations done to place sprites in grid spaces that are meant to filled in~ - Inside source: true *** True Line Result - alignment_enum: alignment_enum, -** Processing line: ~ **color.to_h,~ + # calculations done to place sprites in grid spaces that are meant to filled in +** Processing line: ~ # mess around with the x and y values and see how the sprite placement changes~ - Inside source: true *** True Line Result - **color.to_h, -** Processing line: ~ }.label~ + # mess around with the x and y values and see how the sprite placement changes +** Processing line: ~ outputs.sprites << [x - state.centerX + 630, y - state.centerY + 360, w, h, sprite]~ - Inside source: true *** True Line Result - }.label + outputs.sprites << [x - state.centerX + 630, y - state.centerY + 360, w, h, sprite] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ # outputs a white solid along the left side of the grid (change the color and you'll be able to see it against the white background)~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # outputs a white solid along the left side of the grid (change the color and you'll be able to see it against the white background) +** Processing line: ~ # state.increment subtracted in x parameter because solid's position is denoted by bottom left corner~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # state.increment subtracted in x parameter because solid's position is denoted by bottom left corner +** Processing line: ~ # state.increment subtracted in y parameter to avoid covering the title label~ - 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. + # state.increment subtracted in y parameter to avoid covering the title label +** Processing line: ~ outputs.primitives << [state.grid_border[0] - state.increment,~ +- Inside source: true *** True Line Result - -** Processing line: ~* console_menu.rb~ -- Header detected. + outputs.primitives << [state.grid_border[0] - state.increment, +** Processing line: ~ state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2),~ +- Inside source: true *** True Line Result - + state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2), +** Processing line: ~ 255, 255, 255].solid~ +- Inside source: true *** True Line Result -* console_menu.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + 255, 255, 255].solid +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ # outputs a white solid along the right side of the grid~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/console_menu.rb~ + # outputs a white solid along the right side of the grid +** Processing line: ~ # state.increment subtracted from y parameter to avoid covering title label~ - Inside source: true *** True Line Result - # ./dragon/console_menu.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + # state.increment subtracted from y parameter to avoid covering title label +** Processing line: ~ outputs.primitives << [state.grid_border[0] + state.grid_border[2],~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + outputs.primitives << [state.grid_border[0] + state.grid_border[2], +** Processing line: ~ state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2),~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # console_menu.rb has been released under MIT (*only this file*).~ + state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2), +** Processing line: ~ 255, 255, 255].solid~ - Inside source: true *** True Line Result - # console_menu.rb has been released under MIT (*only this file*). + 255, 255, 255].solid ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ # outputs a white solid along the bottom of the grid~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Console~ + # outputs a white solid along the bottom of the grid +** Processing line: ~ # state.increment subtracted from y parameter to avoid covering last row of grid boxes~ - Inside source: true *** True Line Result - class Console -** Processing line: ~ class Menu~ + # state.increment subtracted from y parameter to avoid covering last row of grid boxes +** Processing line: ~ outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] - state.increment,~ - Inside source: true *** True Line Result - class Menu -** Processing line: ~ attr_accessor :buttons~ + outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] - state.increment, +** Processing line: ~ state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid~ - Inside source: true *** True Line Result - attr_accessor :buttons + state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def initialize console~ +** Processing line: ~ # outputs a white solid along the top of the grid~ - Inside source: true *** True Line Result - def initialize console -** Processing line: ~ @console = console~ + # outputs a white solid along the top of the grid +** Processing line: ~ outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] + state.grid_border[3],~ - Inside source: true *** True Line Result - @console = console -** Processing line: ~ end~ + outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] + state.grid_border[3], +** Processing line: ~ state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid~ - Inside source: true *** True Line Result - end + state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def record_clicked~ -- Inside source: true -*** True Line Result - def record_clicked -** Processing line: ~ $recording.start 100~ -- Inside source: true -*** True Line Result - $recording.start 100 -** Processing line: ~ end~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def replay_clicked~ +** Processing line: ~ # Outputs title and current tile pattern~ - Inside source: true *** True Line Result - def replay_clicked -** Processing line: ~ $replay.start 'replay.txt'~ + # Outputs title and current tile pattern +** Processing line: ~ def print_title~ - Inside source: true *** True Line Result - $replay.start 'replay.txt' -** Processing line: ~ end~ + def print_title +** Processing line: ~ outputs.labels << [640, 700, 'Mouse to Place Tile, WASD to Move Around', 7, 1] # title label~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.labels << [640, 700, 'Mouse to Place Tile, WASD to Move Around', 7, 1] # title label +** Processing line: ~ outputs.lines << horizontal_separator(660, 0, 1280) # outputs horizontal separator~ - Inside source: true *** True Line Result - -** Processing line: ~ def reset_clicked~ + outputs.lines << horizontal_separator(660, 0, 1280) # outputs horizontal separator +** Processing line: ~ outputs.labels << [1050, 500, 'Current:', 3, 1] # outputs Current label~ - Inside source: true *** True Line Result - def reset_clicked -** Processing line: ~ $gtk.reset~ + outputs.labels << [1050, 500, 'Current:', 3, 1] # outputs Current label +** Processing line: ~ outputs.sprites << [1110, 474, state.tileSize / 2, state.tileSize / 2, 'sprites/image' + state.tileSelected.to_s + ".png"] # outputs sprite of current tile pattern using images in sprites folder; output is half the size of a tile~ - Inside source: true *** True Line Result - $gtk.reset -** Processing line: ~ end~ + outputs.sprites << [1110, 474, state.tileSize / 2, state.tileSize / 2, 'sprites/image' + state.tileSelected.to_s + ".png"] # outputs sprite of current tile pattern using images in sprites folder; output is half the size of a tile +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def scroll_up_clicked~ -- Inside source: true -*** True Line Result - def scroll_up_clicked -** Processing line: ~ @console.scroll_up_half~ +** Processing line: ~ # Sets the starting position, ending position, and color for the horizontal separator.~ - Inside source: true *** True Line Result - @console.scroll_up_half -** Processing line: ~ end~ + # Sets the starting position, ending position, and color for the horizontal separator. +** Processing line: ~ def horizontal_separator y, x, x2~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def horizontal_separator y, x, x2 +** Processing line: ~ [x, y, x2, y, 150, 150, 150] # definition of separator; horizontal line means same starting/ending y~ - Inside source: true *** True Line Result - -** Processing line: ~ def scroll_down_clicked~ + [x, y, x2, y, 150, 150, 150] # definition of separator; horizontal line means same starting/ending y +** Processing line: ~ end~ - Inside source: true *** True Line Result - def scroll_down_clicked -** Processing line: ~ @console.scroll_down_half~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @console.scroll_down_half -** Processing line: ~ end~ + +** Processing line: ~ # Checks if the mouse is being clicked or dragged~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Checks if the mouse is being clicked or dragged +** Processing line: ~ def check_click~ - Inside source: true *** True Line Result - -** Processing line: ~ def show_menu_clicked~ + def check_click +** Processing line: ~ if inputs.keyboard.key_down.r # if the "r" key is pressed down~ - Inside source: true *** True Line Result - def show_menu_clicked -** Processing line: ~ @menu_shown = :visible~ + if inputs.keyboard.key_down.r # if the "r" key is pressed down +** Processing line: ~ $dragon.reset~ - Inside source: true *** True Line Result - @menu_shown = :visible -** Processing line: ~ end~ + $dragon.reset +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def close_clicked~ +** Processing line: ~ if inputs.mouse.down #is mouse up or down?~ - Inside source: true *** True Line Result - def close_clicked -** Processing line: ~ @menu_shown = :hidden~ + if inputs.mouse.down #is mouse up or down? +** Processing line: ~ state.mouse_held = true~ - Inside source: true *** True Line Result - @menu_shown = :hidden -** Processing line: ~ @console.hide~ + state.mouse_held = true +** Processing line: ~ if inputs.mouse.position.x < state.grid_border[0] # if mouse's x position is inside the grid's borders~ - Inside source: true *** True Line Result - @console.hide -** Processing line: ~ end~ + if inputs.mouse.position.x < state.grid_border[0] # if mouse's x position is inside the grid's borders +** Processing line: ~ state.tileCords.map do # perform action on all elements of tileCords collection~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.tileCords.map do # perform action on all elements of tileCords collection +** Processing line: ~ |x, y, order|~ - Inside source: true *** True Line Result - -** Processing line: ~ def hide_menu_clicked~ + |x, y, order| +** Processing line: ~ # if mouse's x position is greater than (or equal to) the starting x position of a tile~ - Inside source: true *** True Line Result - def hide_menu_clicked -** Processing line: ~ @menu_shown = :hidden~ + # if mouse's x position is greater than (or equal to) the starting x position of a tile +** Processing line: ~ # and the mouse's x position is also less than (or equal to) the ending x position of that tile,~ - Inside source: true *** True Line Result - @menu_shown = :hidden -** Processing line: ~ end~ + # and the mouse's x position is also less than (or equal to) the ending x position of that tile, +** Processing line: ~ # and the mouse's y position is greater than (or equal to) the starting y position of that tile,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # and the mouse's y position is greater than (or equal to) the starting y position of that tile, +** Processing line: ~ # and the mouse's y position is also less than (or equal to) the ending y position of that tile,~ - Inside source: true *** True Line Result - -** Processing line: ~ def framerate_diagnostics_clicked~ + # and the mouse's y position is also less than (or equal to) the ending y position of that tile, +** Processing line: ~ # (BASICALLY, IF THE MOUSE'S POSITION IS WITHIN THE STARTING AND ENDING POSITIONS OF A TILE)~ - Inside source: true *** True Line Result - def framerate_diagnostics_clicked -** Processing line: ~ @console.scroll_to_bottom~ + # (BASICALLY, IF THE MOUSE'S POSITION IS WITHIN THE STARTING AND ENDING POSITIONS OF A TILE) +** Processing line: ~ if inputs.mouse.position.x >= x && inputs.mouse.position.x <= x + state.tileSize &&~ - Inside source: true *** True Line Result - @console.scroll_to_bottom -** Processing line: ~ $gtk.framerate_diagnostics~ + if inputs.mouse.position.x >= x && inputs.mouse.position.x <= x + state.tileSize && +** Processing line: ~ inputs.mouse.position.y >= y && inputs.mouse.position.y <= y + state.tileSize~ - Inside source: true *** True Line Result - $gtk.framerate_diagnostics -** Processing line: ~ end~ + inputs.mouse.position.y >= y && inputs.mouse.position.y <= y + state.tileSize +** Processing line: ~ state.tileSelected = order # that tile is selected~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.tileSelected = order # that tile is selected +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def itch_wizard_clicked~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - def itch_wizard_clicked -** Processing line: ~ @console.scroll_to_bottom~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - @console.scroll_to_bottom -** Processing line: ~ $wizards.itch.start~ + end +** Processing line: ~ elsif inputs.mouse.up # otherwise, if the mouse is in the "up" state~ - Inside source: true *** True Line Result - $wizards.itch.start -** Processing line: ~ end~ + elsif inputs.mouse.up # otherwise, if the mouse is in the "up" state +** Processing line: ~ state.mouse_held = false # mouse is not held down or dragged~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.mouse_held = false # mouse is not held down or dragged +** Processing line: ~ state.mouse_dragging = false~ - Inside source: true *** True Line Result - -** Processing line: ~ def docs_clicked~ + state.mouse_dragging = false +** Processing line: ~ end~ - Inside source: true *** True Line Result - def docs_clicked -** Processing line: ~ @console.scroll_to_bottom~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @console.scroll_to_bottom -** Processing line: ~ log Kernel.docs_classes~ + +** Processing line: ~ if state.mouse_held && # mouse needs to be down~ - Inside source: true *** True Line Result - log Kernel.docs_classes -** Processing line: ~ end~ + if state.mouse_held && # mouse needs to be down +** Processing line: ~ !inputs.mouse.click && # must not be first click~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + !inputs.mouse.click && # must not be first click +** Processing line: ~ ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15 ||~ - Inside source: true *** True Line Result - -** Processing line: ~ def scroll_end_clicked~ + ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15 || +** Processing line: ~ (inputs.mouse.previous_click.point.y - inputs.mouse.position.y).abs > 15) # Need to move 15 pixels before "drag"~ - Inside source: true *** True Line Result - def scroll_end_clicked -** Processing line: ~ @console.scroll_to_bottom~ + (inputs.mouse.previous_click.point.y - inputs.mouse.position.y).abs > 15) # Need to move 15 pixels before "drag" +** Processing line: ~ state.mouse_dragging = true~ - Inside source: true *** True Line Result - @console.scroll_to_bottom -** Processing line: ~ end~ + state.mouse_dragging = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def custom_buttons~ +** Processing line: ~ # if mouse is clicked inside grid's border, search_lines method is called with click input type~ - Inside source: true *** True Line Result - def custom_buttons -** Processing line: ~ []~ + # if mouse is clicked inside grid's border, search_lines method is called with click input type +** Processing line: ~ if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border))~ - Inside source: true *** True Line Result - [] -** Processing line: ~ end~ + if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border)) +** Processing line: ~ search_lines(inputs.mouse.click.point, :click)~ - Inside source: true *** True Line Result - end + search_lines(inputs.mouse.click.point, :click) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ # if mouse is dragged inside grid's border, search_lines method is called with drag input type~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ return unless @console.visible?~ + # if mouse is dragged inside grid's border, search_lines method is called with drag input type +** Processing line: ~ elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border))~ - Inside source: true *** True Line Result - return unless @console.visible? + elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border)) +** Processing line: ~ search_lines(inputs.mouse.position, :drag)~ +- Inside source: true +*** True Line Result + search_lines(inputs.mouse.position, :drag) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @menu_shown ||= :hidden~ +** Processing line: ~ # Changes grid's position on screen by moving it up, down, left, or right.~ - Inside source: true *** True Line Result - @menu_shown ||= :hidden + # Changes grid's position on screen by moving it up, down, left, or right. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if $gtk.production~ +** Processing line: ~ # centerX is incremented by speed if the "d" key is pressed and if that sum is less than~ - Inside source: true *** True Line Result - if $gtk.production -** Processing line: ~ @buttons = [~ + # centerX is incremented by speed if the "d" key is pressed and if that sum is less than +** Processing line: ~ # the original left side of the center plus half the grid, minus half the top border of grid.~ - Inside source: true *** True Line Result - @buttons = [ -** Processing line: ~ (button id: :record, row: 0, col: 9, text: "record gameplay", method: :record_clicked),~ + # the original left side of the center plus half the grid, minus half the top border of grid. +** Processing line: ~ # MOVES GRID RIGHT (increasing x)~ - Inside source: true *** True Line Result - (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),~ + # MOVES GRID RIGHT (increasing x) +** Processing line: ~ state.centerX += state.speed if inputs.keyboard.key_held.d &&~ - Inside source: true *** True Line Result - (button id: :replay, row: 0, col: 10, text: "start replay", method: :replay_clicked), -** Processing line: ~ ]~ + state.centerX += state.speed if inputs.keyboard.key_held.d && +** Processing line: ~ (state.centerX + state.speed) < state.originalCenter[0] + (state.gridSize / 2) - (state.grid_border[2] / 2)~ - Inside source: true *** True Line Result - ] -** Processing line: ~ elsif @menu_shown == :hidden~ + (state.centerX + state.speed) < state.originalCenter[0] + (state.gridSize / 2) - (state.grid_border[2] / 2) +** Processing line: ~ # centerX is decremented by speed if the "a" key is pressed and if that difference is greater than~ - Inside source: true *** True Line Result - elsif @menu_shown == :hidden -** Processing line: ~ @buttons = [~ + # centerX is decremented by speed if the "a" key is pressed and if that difference is greater than +** Processing line: ~ # the original left side of the center minus half the grid, plus half the top border of grid.~ - Inside source: true *** True Line Result - @buttons = [ -** Processing line: ~ (button id: :show_menu, row: 0, col: 10, text: "show menu", method: :show_menu_clicked),~ + # the original left side of the center minus half the grid, plus half the top border of grid. +** Processing line: ~ # MOVES GRID LEFT (decreasing x)~ - Inside source: true *** True Line Result - (button id: :show_menu, row: 0, col: 10, text: "show menu", method: :show_menu_clicked), -** Processing line: ~ ]~ + # MOVES GRID LEFT (decreasing x) +** Processing line: ~ state.centerX -= state.speed if inputs.keyboard.key_held.a &&~ - Inside source: true *** True Line Result - ] -** Processing line: ~ else~ + state.centerX -= state.speed if inputs.keyboard.key_held.a && +** Processing line: ~ (state.centerX - state.speed) > state.originalCenter[0] - (state.gridSize / 2) + (state.grid_border[2] / 2)~ - Inside source: true *** True Line Result - else -** Processing line: ~ @buttons = [~ + (state.centerX - state.speed) > state.originalCenter[0] - (state.gridSize / 2) + (state.grid_border[2] / 2) +** Processing line: ~ # centerY is incremented by speed if the "w" key is pressed and if that sum is less than~ - Inside source: true *** True Line Result - @buttons = [ -** Processing line: ~ (button id: :scroll_up, row: 0, col: 6, text: "scroll up", method: :scroll_up_clicked),~ + # centerY is incremented by speed if the "w" key is pressed and if that sum is less than +** Processing line: ~ # the original bottom of the center plus half the grid, minus half the right border of grid.~ - Inside source: true *** True Line Result - (button id: :scroll_up, row: 0, col: 6, text: "scroll up", method: :scroll_up_clicked), -** Processing line: ~ (button id: :scroll_down, row: 0, col: 7, text: "scroll down", method: :scroll_down_clicked),~ + # the original bottom of the center plus half the grid, minus half the right border of grid. +** Processing line: ~ # MOVES GRID UP (increasing y)~ - Inside source: true *** True Line Result - (button id: :scroll_down, row: 0, col: 7, text: "scroll down", method: :scroll_down_clicked), -** Processing line: ~ (button id: :scroll_down, row: 0, col: 8, text: "scroll end", method: :scroll_end_clicked),~ + # MOVES GRID UP (increasing y) +** Processing line: ~ state.centerY += state.speed if inputs.keyboard.key_held.w &&~ - Inside source: true *** True Line Result - (button id: :scroll_down, row: 0, col: 8, text: "scroll end", method: :scroll_end_clicked), -** Processing line: ~ (button id: :close, row: 0, col: 9, text: "close console", method: :close_clicked),~ + state.centerY += state.speed if inputs.keyboard.key_held.w && +** Processing line: ~ (state.centerY + state.speed) < state.originalCenter[1] + (state.gridSize / 2) - (state.grid_border[3] / 2)~ - Inside source: true *** True Line Result - (button id: :close, row: 0, col: 9, text: "close console", method: :close_clicked), -** Processing line: ~ (button id: :hide, row: 0, col: 10, text: "hide menu", method: :hide_menu_clicked),~ + (state.centerY + state.speed) < state.originalCenter[1] + (state.gridSize / 2) - (state.grid_border[3] / 2) +** Processing line: ~ # centerY is decremented by speed if the "s" key is pressed and if the difference is greater than~ - Inside source: true *** True Line Result - (button id: :hide, row: 0, col: 10, text: "hide menu", method: :hide_menu_clicked), -** Processing line: ~~ + # centerY is decremented by speed if the "s" key is pressed and if the difference is greater than +** Processing line: ~ # the original bottom of the center minus half the grid, plus half the right border of grid.~ - Inside source: true *** True Line Result - -** Processing line: ~ (button id: :record, row: 1, col: 7, text: "record gameplay", method: :record_clicked),~ + # the original bottom of the center minus half the grid, plus half the right border of grid. +** Processing line: ~ # MOVES GRID DOWN (decreasing y)~ - Inside source: true *** True Line Result - (button id: :record, row: 1, col: 7, text: "record gameplay", method: :record_clicked), -** Processing line: ~ (button id: :replay, row: 1, col: 8, text: "start replay", method: :replay_clicked),~ + # MOVES GRID DOWN (decreasing y) +** Processing line: ~ state.centerY -= state.speed if inputs.keyboard.key_held.s &&~ - Inside source: true *** True Line Result - (button id: :replay, row: 1, col: 8, text: "start replay", method: :replay_clicked), -** Processing line: ~ (button id: :record, row: 1, col: 9, text: "framerate diagnostics", method: :framerate_diagnostics_clicked),~ + state.centerY -= state.speed if inputs.keyboard.key_held.s && +** Processing line: ~ (state.centerY - state.speed) > state.originalCenter[1] - (state.gridSize / 2) + (state.grid_border[3] / 2)~ - Inside source: true *** True Line Result - (button id: :record, row: 1, col: 9, text: "framerate diagnostics", method: :framerate_diagnostics_clicked), -** Processing line: ~ (button id: :reset, row: 1, col: 10, text: "reset game", method: :reset_clicked),~ + (state.centerY - state.speed) > state.originalCenter[1] - (state.gridSize / 2) + (state.grid_border[3] / 2) +** Processing line: ~ end~ - Inside source: true *** True Line Result - (button id: :reset, row: 1, col: 10, text: "reset game", method: :reset_clicked), + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ (button id: :reset, row: 2, col: 10, text: "docs", method: :docs_clicked),~ +** Processing line: ~ # Performs calculations on the gridX and gridY collections, and sets values.~ - Inside source: true *** True Line Result - (button id: :reset, row: 2, col: 10, text: "docs", method: :docs_clicked), -** Processing line: ~ (button id: :reset, row: 2, col: 9, text: "itch wizard", method: :itch_wizard_clicked),~ + # Performs calculations on the gridX and gridY collections, and sets values. +** Processing line: ~ # Sets the definition of a grid box, including the image that it is filled with.~ - Inside source: true *** True Line Result - (button id: :reset, row: 2, col: 9, text: "itch wizard", method: :itch_wizard_clicked), -** Processing line: ~ *custom_buttons~ + # Sets the definition of a grid box, including the image that it is filled with. +** Processing line: ~ def search_lines (point, input_type)~ - Inside source: true *** True Line Result - *custom_buttons -** Processing line: ~ ]~ + def search_lines (point, input_type) +** Processing line: ~ point.x += state.centerX - 630 # increments x and y~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + point.x += state.centerX - 630 # increments x and y +** Processing line: ~ point.y += state.centerY - 360~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + point.y += state.centerY - 360 +** Processing line: ~ findX = 0~ - Inside source: true *** True Line Result - -** Processing line: ~ # render~ + findX = 0 +** Processing line: ~ findY = 0~ - Inside source: true *** True Line Result - # render -** Processing line: ~ args.outputs.reserved << @buttons.map { |b| b[:primitives] }~ + findY = 0 +** Processing line: ~ increment = state.gridSize / state.lineQuantity # divides grid by number of separators~ - Inside source: true *** True Line Result - args.outputs.reserved << @buttons.map { |b| b[:primitives] } + increment = state.gridSize / state.lineQuantity # divides grid by number of separators ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # inputs~ +** Processing line: ~ state.gridX.map do # perform an action on every element of collection~ - Inside source: true *** True Line Result - # inputs -** Processing line: ~ if args.inputs.mouse.click~ + state.gridX.map do # perform an action on every element of collection +** Processing line: ~ |x|~ - Inside source: true *** True Line Result - if args.inputs.mouse.click -** Processing line: ~ clicked = @buttons.find { |b| args.inputs.mouse.inside_rect? b[:rect] }~ + |x| +** Processing line: ~ # findX increments x by 10 if point.x is less than that sum and findX is currently 0~ - Inside source: true *** True Line Result - clicked = @buttons.find { |b| args.inputs.mouse.inside_rect? b[:rect] } -** Processing line: ~ if clicked~ + # findX increments x by 10 if point.x is less than that sum and findX is currently 0 +** Processing line: ~ findX = x + 10 if point.x < (x + 10) && findX == 0~ - Inside source: true *** True Line Result - if clicked -** Processing line: ~ args.inputs.mouse.click = nil~ + findX = x + 10 if point.x < (x + 10) && findX == 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.inputs.mouse.click = nil -** Processing line: ~ send clicked[:method]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - send clicked[:method] -** Processing line: ~ end~ + +** Processing line: ~ state.gridY.map do~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + state.gridY.map do +** Processing line: ~ |y|~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + |y| +** Processing line: ~ # findY is set to y if point.y is less than that value and findY is currently 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # findY is set to y if point.y is less than that value and findY is currently 0 +** Processing line: ~ findY = y if point.y < (y) && findY == 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def rect_for_layout row, col~ + findY = y if point.y < (y) && findY == 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - def rect_for_layout row, col -** Processing line: ~ col_width = 100~ + end +** Processing line: ~ # position of a box is denoted by bottom left corner, which is why the increment is being subtracted~ - Inside source: true *** True Line Result - col_width = 100 -** Processing line: ~ row_height = 50~ + # position of a box is denoted by bottom left corner, which is why the increment is being subtracted +** Processing line: ~ grid_box = [findX - (increment.ceil), findY - (increment.ceil), increment.ceil, increment.ceil,~ - Inside source: true *** True Line Result - row_height = 50 -** Processing line: ~ col_margin = 5~ + grid_box = [findX - (increment.ceil), findY - (increment.ceil), increment.ceil, increment.ceil, +** Processing line: ~ "sprites/image" + state.tileSelected.to_s + ".png"] # sets sprite definition~ - Inside source: true *** True Line Result - col_margin = 5 -** Processing line: ~ row_margin = 5~ + "sprites/image" + state.tileSelected.to_s + ".png"] # sets sprite definition +** Processing line: ~~ - Inside source: true *** True Line Result - row_margin = 5 -** Processing line: ~ x = (col_margin + (col * col_width) + (col * col_margin))~ + +** Processing line: ~ if input_type == :click # if user clicks their mouse~ - Inside source: true *** True Line Result - x = (col_margin + (col * col_width) + (col * col_margin)) -** Processing line: ~ y = (row_margin + (row * row_height) + (row * row_margin) + row_height).from_top~ + if input_type == :click # if user clicks their mouse +** Processing line: ~ if state.filled_squares.include? grid_box # if grid box is already filled in~ - Inside source: true *** True Line Result - y = (row_margin + (row * row_height) + (row * row_margin) + row_height).from_top -** Processing line: ~ { x: x, y: y, w: col_width, h: row_height }~ + if state.filled_squares.include? grid_box # if grid box is already filled in +** Processing line: ~ state.filled_squares.delete grid_box # box is cleared and removed from filled_squares~ - Inside source: true *** True Line Result - { x: x, y: y, w: col_width, h: row_height } + state.filled_squares.delete grid_box # box is cleared and removed from filled_squares +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares~ +- Inside source: true +*** True Line Result + state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ elsif input_type == :drag # if user drags mouse~ - Inside source: true *** True Line Result - -** Processing line: ~ def button args~ + elsif input_type == :drag # if user drags mouse +** Processing line: ~ unless state.filled_squares.include? grid_box # unless grid box dragged over is already filled in~ - Inside source: true *** True Line Result - def button args -** Processing line: ~ id, row, col, text, method = args[:id], args[:row], args[:col], args[:text], args[:method]~ + unless state.filled_squares.include? grid_box # unless grid box dragged over is already filled in +** Processing line: ~ state.filled_squares << grid_box # box is filled in and added to filled_squares~ - Inside source: true *** True Line Result - id, row, col, text, method = args[:id], args[:row], args[:col], args[:text], args[:method] -** Processing line: ~~ + state.filled_squares << grid_box # box is filled in and added to filled_squares +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ font_height = @console.font_style.line_height_px.half~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - font_height = @console.font_style.line_height_px.half -** Processing line: ~ {~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - { -** Processing line: ~ id: id,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - id: id, -** Processing line: ~ rect: (rect_for_layout row, col),~ + +** Processing line: ~ # Creates a "Clear" button using labels and borders.~ - Inside source: true *** True Line Result - rect: (rect_for_layout row, col), -** Processing line: ~ text: text,~ + # Creates a "Clear" button using labels and borders. +** Processing line: ~ def draw_buttons~ - Inside source: true *** True Line Result - text: text, -** Processing line: ~ method: method~ + def draw_buttons +** Processing line: ~ x, y, w, h = 390, 50, 240, 50~ - Inside source: true *** True Line Result - method: method -** Processing line: ~ }.let do |entity|~ + x, y, w, h = 390, 50, 240, 50 +** Processing line: ~ state.clear_button ||= state.new_entity(:button_with_fade)~ - Inside source: true *** True Line Result - }.let do |entity| -** Processing line: ~ primitives = []~ + state.clear_button ||= state.new_entity(:button_with_fade) +** Processing line: ~~ - Inside source: true *** True Line Result - primitives = [] -** Processing line: ~ primitives << entity[:rect].merge(a: 164).solid~ + +** Processing line: ~ # x and y positions are set to display "Clear" label in center of the button~ - 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~ + # x and y positions are set to display "Clear" label in center of the button +** Processing line: ~ # Try changing first two parameters to simply x, y and see what happens to the text placement~ - Inside source: true *** True Line Result - primitives << entity[:rect].merge(r: 255, g: 255, b: 255).border -** Processing line: ~ primitives << text.wrapped_lines(5)~ + # Try changing first two parameters to simply x, y and see what happens to the text placement +** Processing line: ~ state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1]~ - Inside source: true *** True Line Result - primitives << text.wrapped_lines(5) -** Processing line: ~ .map_with_index do |l, i|~ + state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] +** Processing line: ~ state.clear_button.border ||= [x, y, w, h] # definition of button's border~ - Inside source: true *** True Line Result - .map_with_index do |l, i| -** Processing line: ~ [~ + state.clear_button.border ||= [x, y, w, h] # definition of button's border +** Processing line: ~~ - Inside source: true *** True Line Result - [ -** Processing line: ~ entity[:rect][:x] + entity[:rect][:w].half,~ + +** Processing line: ~ # If the mouse is clicked inside the borders of the clear button~ - Inside source: true *** True Line Result - entity[:rect][:x] + entity[:rect][:w].half, -** Processing line: ~ entity[:rect][:y] + entity[:rect][:h].half + font_height - (i * (font_height + 2)),~ + # If the mouse is clicked inside the borders of the clear button +** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border)~ - Inside source: true *** True Line Result - entity[:rect][:y] + entity[:rect][:h].half + font_height - (i * (font_height + 2)), -** Processing line: ~ l, -3, 1, 255, 255, 255~ + if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border) +** Processing line: ~ state.clear_button.clicked_at = inputs.mouse.click.created_at # value is frame of mouse click~ - Inside source: true *** True Line Result - l, -3, 1, 255, 255, 255 -** Processing line: ~ ]~ + state.clear_button.clicked_at = inputs.mouse.click.created_at # value is frame of mouse click +** Processing line: ~ state.filled_squares.clear # filled squares collection is emptied (squares are cleared)~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end.labels~ + state.filled_squares.clear # filled squares collection is emptied (squares are cleared) +** Processing line: ~ inputs.mouse.previous_click = nil # no previous click~ - Inside source: true *** True Line Result - end.labels -** Processing line: ~~ + inputs.mouse.previous_click = nil # no previous click +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ entity.merge(primitives: primitives)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - entity.merge(primitives: primitives) -** Processing line: ~ end~ + +** Processing line: ~ outputs.labels << state.clear_button.label # outputs clear button~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + outputs.labels << state.clear_button.label # outputs clear button +** Processing line: ~ outputs.borders << state.clear_button.border~ - Inside source: true *** True Line Result - end + outputs.borders << state.clear_button.border ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def serialize~ +** Processing line: ~ # When the clear button is clicked, the color of the button changes~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ {~ + # When the clear button is clicked, the color of the button changes +** Processing line: ~ # and the transparency changes, as well. If you change the time from~ - Inside source: true *** True Line Result - { -** Processing line: ~ not_supported: "#{self}"~ + # and the transparency changes, as well. If you change the time from +** Processing line: ~ # 0.25.seconds to 1.25.seconds or more, the change will last longer.~ - Inside source: true *** True Line Result - not_supported: "#{self}" -** Processing line: ~ }~ + # 0.25.seconds to 1.25.seconds or more, the change will last longer. +** Processing line: ~ if state.clear_button.clicked_at~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + if state.clear_button.clicked_at +** Processing line: ~ outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)]~ - Inside source: true *** True Line Result - end + outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -95979,894 +99964,886 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. +** Processing line: ~ $tile_editor = TileEditor.new~ +- Inside source: true *** True Line Result -#+end_src + $tile_editor = TileEditor.new ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* console_prompt.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ def tick args~ +- Inside source: true *** True Line Result -* console_prompt.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - + def tick args +** Processing line: ~ $tile_editor.inputs = args.inputs~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/console_prompt.rb~ + $tile_editor.inputs = args.inputs +** Processing line: ~ $tile_editor.grid = args.grid~ - Inside source: true *** True Line Result - # ./dragon/console_prompt.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + $tile_editor.grid = args.grid +** Processing line: ~ $tile_editor.args = args~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + $tile_editor.args = args +** Processing line: ~ $tile_editor.outputs = args.outputs~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # console_prompt.rb has been released under MIT (*only this file*).~ + $tile_editor.outputs = args.outputs +** Processing line: ~ $tile_editor.state = args.state~ - Inside source: true *** True Line Result - # console_prompt.rb has been released under MIT (*only this file*). -** Processing line: ~~ + $tile_editor.state = args.state +** Processing line: ~ $tile_editor.tick~ - Inside source: true *** True Line Result - -** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright:~ + $tile_editor.tick +** Processing line: ~ tick_instructions args, "Roll your own tile editor. CLICK to select a sprite. CLICK in grid to place sprite. WASD to move around."~ - Inside source: true *** True Line Result - # Contributors outside of DragonRuby who also hold Copyright: -** Processing line: ~ # - Kevin Fischer: https://github.com/kfischer-okarin~ + tick_instructions args, "Roll your own tile editor. CLICK to select a sprite. CLICK in grid to place sprite. WASD to move around." +** Processing line: ~ end~ - Inside source: true *** True Line Result - # - Kevin Fischer: https://github.com/kfischer-okarin + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ def tick_instructions args, text, y = 715~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Console~ + def tick_instructions args, text, y = 715 +** Processing line: ~ return if args.state.key_event_occurred~ - Inside source: true *** True Line Result - class Console -** Processing line: ~ class Prompt~ + return if args.state.key_event_occurred +** Processing line: ~ if args.inputs.mouse.click ||~ - Inside source: true *** True Line Result - class Prompt -** Processing line: ~ attr_accessor :current_input_str, :font_style, :console_text_width, :last_input_str, :last_input_str_changed~ + if args.inputs.mouse.click || +** Processing line: ~ args.inputs.keyboard.directional_vector ||~ - Inside source: true *** True Line Result - attr_accessor :current_input_str, :font_style, :console_text_width, :last_input_str, :last_input_str_changed -** Processing line: ~~ + args.inputs.keyboard.directional_vector || +** Processing line: ~ args.inputs.keyboard.key_down.enter ||~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize(font_style:, text_color:, console_text_width:)~ + args.inputs.keyboard.key_down.enter || +** Processing line: ~ args.inputs.keyboard.key_down.escape~ - Inside source: true *** True Line Result - def initialize(font_style:, text_color:, console_text_width:) -** Processing line: ~ @prompt = '-> '~ + args.inputs.keyboard.key_down.escape +** Processing line: ~ args.state.key_event_occurred = true~ - Inside source: true *** True Line Result - @prompt = '-> ' -** Processing line: ~ @current_input_str = ''~ + args.state.key_event_occurred = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - @current_input_str = '' -** Processing line: ~ @font_style = font_style~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @font_style = font_style -** Processing line: ~ @text_color = text_color~ + +** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ - Inside source: true *** True Line Result - @text_color = text_color -** Processing line: ~ @cursor_color = Color.new [187, 21, 6]~ + 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 - @cursor_color = Color.new [187, 21, 6] -** Processing line: ~ @console_text_width = console_text_width~ + 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 - @console_text_width = console_text_width + 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: ~ @cursor_position = 0~ -- Inside source: true -*** True Line Result - @cursor_position = 0 -** Processing line: ~ update_cursor_position_px~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - update_cursor_position_px +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ @last_autocomplete_prefix = nil~ -- Inside source: true +** Processing line: ~*** Lowrez - Nokia 3310 - main.rb~ +- Header detected. *** True Line Result - @last_autocomplete_prefix = nil -** Processing line: ~ @next_candidate_index = 0~ + +*** True Line Result +*** Lowrez - Nokia 3310 - 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_lowrez/nokia_3310/app/main.rb~ - Inside source: true *** True Line Result - @next_candidate_index = 0 -** Processing line: ~ end~ + # ./samples/99_genre_lowrez/nokia_3310/app/main.rb +** Processing line: ~ require 'app/nokia.rb'~ - Inside source: true *** True Line Result - end + require 'app/nokia.rb' ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def update_cursor_position_px~ -- Inside source: true -*** True Line Result - def update_cursor_position_px -** Processing line: ~ @cursor_position_px = ($gtk.calcstringbox (@prompt + @current_input_str[0...@cursor_position]), @font_style.size_enum, @font_style.font).x~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - @cursor_position_px = ($gtk.calcstringbox (@prompt + @current_input_str[0...@cursor_position]), @font_style.size_enum, @font_style.font).x -** Processing line: ~ end~ + def tick args +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # ======================================================================= +** Processing line: ~ # ==== HELLO WORLD ======================================================~ - Inside source: true *** True Line Result - -** Processing line: ~ def current_input_str=(str)~ + # ==== HELLO WORLD ====================================================== +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - def current_input_str=(str) -** Processing line: ~ @current_input_str = str~ + # ======================================================================= +** Processing line: ~ # Steps to get started:~ - Inside source: true *** True Line Result - @current_input_str = str -** Processing line: ~ @cursor_position = str.length~ + # Steps to get started: +** Processing line: ~ # 1. ~def tick args~ is the entry point for your game.~ - Inside source: true *** True Line Result - @cursor_position = str.length -** Processing line: ~ end~ + # 1. ~def tick args~ is the entry point for your game. +** Processing line: ~ # 2. There are quite a few code samples below, remove the "##"~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # 2. There are quite a few code samples below, remove the "##" +** Processing line: ~ # before each line and save the file to see the changes.~ - Inside source: true *** True Line Result - -** Processing line: ~ def <<(str)~ + # before each line and save the file to see the changes. +** Processing line: ~ # 3. 0, 0 is in bottom left and 83, 47 is in top right corner.~ - Inside source: true *** True Line Result - def <<(str) -** Processing line: ~ @current_input_str = @current_input_str[0...@cursor_position] + str + @current_input_str[@cursor_position..-1]~ + # 3. 0, 0 is in bottom left and 83, 47 is in top right corner. +** Processing line: ~ # 4. Be sure to come to the discord channel if you need~ - Inside source: true *** True Line Result - @current_input_str = @current_input_str[0...@cursor_position] + str + @current_input_str[@cursor_position..-1] -** Processing line: ~ @cursor_position += str.length~ + # 4. Be sure to come to the discord channel if you need +** Processing line: ~ # more help: [[http://discord.dragonruby.org]].~ - Inside source: true *** True Line Result - @cursor_position += str.length -** Processing line: ~ update_cursor_position_px~ + # more help: [[http://discord.dragonruby.org]]. +** Processing line: ~~ - Inside source: true *** True Line Result - update_cursor_position_px -** Processing line: ~ @current_input_changed_at = Kernel.global_tick_count~ + +** Processing line: ~ # Commenting and uncommenting code:~ - Inside source: true *** True Line Result - @current_input_changed_at = Kernel.global_tick_count -** Processing line: ~ reset_autocomplete~ + # Commenting and uncommenting code: +** Processing line: ~ # - Add a "#" infront of lines to comment out code~ - Inside source: true *** True Line Result - reset_autocomplete -** Processing line: ~ end~ + # - Add a "#" infront of lines to comment out code +** Processing line: ~ # - Remove the "#" infront of lines to comment out code~ - Inside source: true *** True Line Result - end + # - Remove the "#" infront of lines to comment out code ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def backspace~ +** Processing line: ~ # Invoke the hello_world subroutine/method~ - Inside source: true *** True Line Result - def backspace -** Processing line: ~ return if current_input_str.length.zero? || @cursor_position.zero?~ + # Invoke the hello_world subroutine/method +** Processing line: ~ hello_world args # <---- add a "#" to the beginning of the line to stop running this subroutine/method.~ - Inside source: true *** True Line Result - return if current_input_str.length.zero? || @cursor_position.zero? + hello_world args # <---- add a "#" to the beginning of the line to stop running this subroutine/method. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @current_input_str = @current_input_str[0...(@cursor_position - 1)] + @current_input_str[@cursor_position..-1]~ +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - @current_input_str = @current_input_str[0...(@cursor_position - 1)] + @current_input_str[@cursor_position..-1] -** Processing line: ~ @cursor_position -= 1~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO RENDER A LABEL ============================================~ - Inside source: true *** True Line Result - @cursor_position -= 1 -** Processing line: ~ update_cursor_position_px~ + # ==== HOW TO RENDER A LABEL ============================================ +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - update_cursor_position_px -** Processing line: ~ reset_autocomplete~ + # ======================================================================= +** Processing line: ~~ - Inside source: true *** True Line Result - reset_autocomplete -** Processing line: ~ end~ + +** Processing line: ~ # Uncomment the line below to invoke the how_to_render_a_label subroutine/method.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Uncomment the line below to invoke the how_to_render_a_label subroutine/method. +** Processing line: ~ # Note: The method is defined in this file with the signature ~def how_to_render_a_label args~~ - Inside source: true *** True Line Result - -** Processing line: ~ def move_cursor_left~ + # Note: The method is defined in this file with the signature ~def how_to_render_a_label args~ +** Processing line: ~ # Scroll down to the method to see the details.~ - Inside source: true *** True Line Result - def move_cursor_left -** Processing line: ~ @cursor_position -= 1 if @cursor_position > 0~ + # Scroll down to the method to see the details. +** Processing line: ~~ - Inside source: true *** True Line Result - @cursor_position -= 1 if @cursor_position > 0 -** Processing line: ~ update_cursor_position_px~ + +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - update_cursor_position_px -** Processing line: ~ end~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_render_a_label args # <---- remove the "#" at the beginning of this line to run the method~ - Inside source: true *** True Line Result - end + # how_to_render_a_label args # <---- remove the "#" at the beginning of this line to run the method ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def move_cursor_right~ +** Processing line: ~~ - Inside source: true *** True Line Result - def move_cursor_right -** Processing line: ~ @cursor_position += 1 if @cursor_position < current_input_str.length~ + +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - @cursor_position += 1 if @cursor_position < current_input_str.length -** Processing line: ~ update_cursor_position_px~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO RENDER A FILLED SQUARE (SOLID) ============================~ - Inside source: true *** True Line Result - update_cursor_position_px -** Processing line: ~ end~ + # ==== HOW TO RENDER A FILLED SQUARE (SOLID) ============================ +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - end + # ======================================================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ +- Inside source: true +*** True Line Result + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_render_solids args~ +- Inside source: true +*** True Line Result + # how_to_render_solids args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def clear~ +** Processing line: ~~ - Inside source: true *** True Line Result - def clear -** Processing line: ~ @current_input_str = ''~ + +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - @current_input_str = '' -** Processing line: ~ @cursor_position = 0~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO RENDER AN UNFILLED SQUARE (BORDER) ========================~ - Inside source: true *** True Line Result - @cursor_position = 0 -** Processing line: ~ update_cursor_position_px~ + # ==== HOW TO RENDER AN UNFILLED SQUARE (BORDER) ======================== +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - update_cursor_position_px -** Processing line: ~ reset_autocomplete~ + # ======================================================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - reset_autocomplete -** Processing line: ~ end~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_render_borders args~ - Inside source: true *** True Line Result - end + # how_to_render_borders args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def autocomplete~ +** Processing line: ~~ - Inside source: true *** True Line Result - def autocomplete -** Processing line: ~ if !@last_autocomplete_prefix~ + +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - if !@last_autocomplete_prefix -** Processing line: ~ @last_autocomplete_prefix = calc_autocomplete_prefix~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO RENDER A LINE =============================================~ - Inside source: true *** True Line Result - @last_autocomplete_prefix = calc_autocomplete_prefix -** Processing line: ~~ + # ==== HOW TO RENDER A LINE ============================================= +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - -** Processing line: ~ puts "* AUTOCOMPLETE CANDIDATES: #{current_input_str}.."~ + # ======================================================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - puts "* AUTOCOMPLETE CANDIDATES: #{current_input_str}.." -** Processing line: ~ pretty_print_strings_as_table method_candidates(@last_autocomplete_prefix)~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_render_lines args~ - Inside source: true *** True Line Result - pretty_print_strings_as_table method_candidates(@last_autocomplete_prefix) -** Processing line: ~ else~ + # how_to_render_lines args +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ candidates = method_candidates(@last_autocomplete_prefix)~ + +** Processing line: ~~ - Inside source: true *** True Line Result - candidates = method_candidates(@last_autocomplete_prefix) -** Processing line: ~ return if candidates.empty?~ + +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - return if candidates.empty? -** Processing line: ~~ + # ======================================================================= +** Processing line: ~ # == HOW TO RENDER A SPRITE =============================================~ - Inside source: true *** True Line Result - -** Processing line: ~ candidate = candidates[@next_candidate_index]~ + # == HOW TO RENDER A SPRITE ============================================= +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - candidate = candidates[@next_candidate_index] -** Processing line: ~ candidate = candidate[0..-2] + " = " if candidate.end_with? '='~ + # ======================================================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - candidate = candidate[0..-2] + " = " if candidate.end_with? '=' -** Processing line: ~ @next_candidate_index += 1~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_render_sprites args~ - Inside source: true *** True Line Result - @next_candidate_index += 1 -** Processing line: ~ @next_candidate_index = 0 if @next_candidate_index >= candidates.length~ + # how_to_render_sprites args +** Processing line: ~~ - Inside source: true *** True Line Result - @next_candidate_index = 0 if @next_candidate_index >= candidates.length -** Processing line: ~ self.current_input_str = display_autocomplete_candidate(candidate)~ + +** Processing line: ~~ - Inside source: true *** True Line Result - self.current_input_str = display_autocomplete_candidate(candidate) -** Processing line: ~ update_cursor_position_px~ + +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - update_cursor_position_px -** Processing line: ~ end~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO MOVE A SPRITE BASED OFF OF USER INPUT =====================~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + # ==== HOW TO MOVE A SPRITE BASED OFF OF USER INPUT ===================== +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ puts "* BUG: Tab autocompletion failed. Let us know about this.\n#{e}"~ + # ======================================================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - puts "* BUG: Tab autocompletion failed. Let us know about this.\n#{e}" -** Processing line: ~ end~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_move_a_sprite args~ - Inside source: true *** True Line Result - end + # how_to_move_a_sprite args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def pretty_print_strings_as_table items~ +** Processing line: ~~ - Inside source: true *** True Line Result - def pretty_print_strings_as_table items -** Processing line: ~ if items.length == 0~ + +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - if items.length == 0 -** Processing line: ~ puts <<-S.strip~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================~ - Inside source: true *** True Line Result - puts <<-S.strip -** Processing line: ~ +--------+~ + # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ========================== +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - +--------+ -** Processing line: ~ | (none) |~ + # ======================================================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - | (none) | -** Processing line: ~ +--------+~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_animate_a_sprite args~ - Inside source: true *** True Line Result - +--------+ -** Processing line: ~ S~ + # how_to_animate_a_sprite args +** Processing line: ~~ - Inside source: true *** True Line Result - S -** Processing line: ~ else~ + +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ # figure out the largest string~ + +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - # figure out the largest string -** Processing line: ~ string_width = items.sort_by { |c| -c.to_s.length }.first~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) ===========================~ - Inside source: true *** True Line Result - string_width = items.sort_by { |c| -c.to_s.length }.first -** Processing line: ~~ + # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) =========================== +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - -** Processing line: ~ # add spacing to each side of the string which represents the cell width~ + # ======================================================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - # add spacing to each side of the string which represents the cell width -** Processing line: ~ cell_width = string_width.length + 2~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_animate_a_sprite_sheet args~ - Inside source: true *** True Line Result - cell_width = string_width.length + 2 + # how_to_animate_a_sprite_sheet args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # add spacing to each side of the cell to represent the column width~ +** Processing line: ~~ - Inside source: true *** True Line Result - # add spacing to each side of the cell to represent the column width -** Processing line: ~ column_width = cell_width + 2~ + +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - column_width = cell_width + 2 -** Processing line: ~~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO DETERMINE COLLISION =============================================~ - Inside source: true *** True Line Result - -** Processing line: ~ # determine the max number of columns that can fit on the screen~ + # ==== HOW TO DETERMINE COLLISION ============================================= +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - # determine the max number of columns that can fit on the screen -** Processing line: ~ columns = @console_text_width.idiv column_width~ + # ======================================================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - columns = @console_text_width.idiv column_width -** Processing line: ~ columns = items.length if items.length < columns~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_determine_collision args~ - Inside source: true *** True Line Result - columns = items.length if items.length < columns + # how_to_determine_collision args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # partition the original list of items into a string to be printed~ +** Processing line: ~~ - Inside source: true *** True Line Result - # partition the original list of items into a string to be printed -** Processing line: ~ items.each_slice(columns).each_with_index do |cells, i|~ + +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - items.each_slice(columns).each_with_index do |cells, i| -** Processing line: ~ pretty_print_row_seperator string_width, cell_width, column_width, columns~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO CREATE BUTTONS ==================================================~ - Inside source: true *** True Line Result - pretty_print_row_seperator string_width, cell_width, column_width, columns -** Processing line: ~ pretty_print_row cells, string_width, cell_width, column_width, columns~ + # ==== HOW TO CREATE BUTTONS ================================================== +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - pretty_print_row cells, string_width, cell_width, column_width, columns -** Processing line: ~ end~ + # ======================================================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - end + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_create_buttons args~ +- Inside source: true +*** True Line Result + # how_to_create_buttons args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ pretty_print_row_seperator string_width, cell_width, column_width, columns~ +** Processing line: ~ # ==== The line below renders a debug grid, mouse information, and current tick~ - Inside source: true *** True Line Result - pretty_print_row_seperator string_width, cell_width, column_width, columns -** Processing line: ~ end~ + # ==== The line below renders a debug grid, mouse information, and current tick +** Processing line: ~ # render_debug args~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # render_debug args +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def pretty_print_row cells, string_width, cell_width, column_width, columns~ +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - def pretty_print_row cells, string_width, cell_width, column_width, columns -** Processing line: ~ # if the number of cells doesn't match the number of columns, then pad the array with empty values~ + # ======================================================================= +** Processing line: ~ # ==== HELLO WORLD ======================================================~ - Inside source: true *** True Line Result - # if the number of cells doesn't match the number of columns, then pad the array with empty values -** Processing line: ~ cells += (columns - cells.length).map { "" }~ + # ==== HELLO WORLD ====================================================== +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - cells += (columns - cells.length).map { "" } -** Processing line: ~~ + # ======================================================================= +** Processing line: ~ def hello_world args~ - Inside source: true *** True Line Result - -** Processing line: ~ # right align each cell value~ + def hello_world args +** Processing line: ~ args.nokia.solids << { x: 0, y: 64, w: 10, h: 10, r: 255 }~ - Inside source: true *** True Line Result - # right align each cell value -** Processing line: ~ formated_row = "|" + cells.map do |c|~ + args.nokia.solids << { x: 0, y: 64, w: 10, h: 10, r: 255 } +** Processing line: ~~ - Inside source: true *** True Line Result - formated_row = "|" + cells.map do |c| -** Processing line: ~ "#{" " * (string_width.length - c.length) } #{c} |"~ + +** Processing line: ~ args.nokia.labels << {~ - Inside source: true *** True Line Result - "#{" " * (string_width.length - c.length) } #{c} |" -** Processing line: ~ end.join~ + args.nokia.labels << { +** Processing line: ~ x: 42,~ - Inside source: true *** True Line Result - end.join -** Processing line: ~~ + x: 42, +** Processing line: ~ y: 46,~ - Inside source: true *** True Line Result - -** Processing line: ~ # remove seperators between empty values~ + y: 46, +** Processing line: ~ text: "nokia 3310 jam 3",~ - Inside source: true *** True Line Result - # remove seperators between empty values -** Processing line: ~ formated_row = formated_row.gsub(" | ", " ")~ + text: "nokia 3310 jam 3", +** Processing line: ~ size_enum: NOKIA_FONT_SM,~ - Inside source: true *** True Line Result - formated_row = formated_row.gsub(" | ", " ") -** Processing line: ~~ + size_enum: NOKIA_FONT_SM, +** Processing line: ~ alignment_enum: 1,~ - Inside source: true *** True Line Result - -** Processing line: ~ puts formated_row~ + alignment_enum: 1, +** Processing line: ~ r: 0,~ - Inside source: true *** True Line Result - puts formated_row -** Processing line: ~ end~ + r: 0, +** Processing line: ~ g: 0,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + g: 0, +** Processing line: ~ b: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ def pretty_print_row_seperator string_width, cell_width, column_width, columns~ + b: 0, +** Processing line: ~ a: 255,~ - Inside source: true *** True Line Result - def pretty_print_row_seperator string_width, cell_width, column_width, columns -** Processing line: ~ # this is a joint: +--------~ + a: 255, +** Processing line: ~ font: NOKIA_FONT_PATH~ - Inside source: true *** True Line Result - # this is a joint: +-------- -** Processing line: ~ column_joint = "+#{"-" * cell_width}"~ + font: NOKIA_FONT_PATH +** Processing line: ~ }~ - Inside source: true *** True Line Result - column_joint = "+#{"-" * cell_width}" + } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # multiple joints create a row seperator: +----+----+~ +** Processing line: ~ args.nokia.sprites << {~ - Inside source: true *** True Line Result - # multiple joints create a row seperator: +----+----+ -** Processing line: ~ puts (column_joint * columns) + "+"~ + args.nokia.sprites << { +** Processing line: ~ x: 42 - 10,~ - Inside source: true *** True Line Result - puts (column_joint * columns) + "+" -** Processing line: ~ end~ + x: 42 - 10, +** Processing line: ~ y: 26 - 10,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + y: 26 - 10, +** Processing line: ~ w: 20,~ - Inside source: true *** True Line Result - -** Processing line: ~ def render(args, x:, y:)~ + w: 20, +** Processing line: ~ h: 20,~ - Inside source: true *** True Line Result - def render(args, x:, y:) -** Processing line: ~ args.outputs.reserved << font_style.label(x: x, y: y, text: "#{@prompt}#{current_input_str}", color: @text_color)~ + h: 20, +** Processing line: ~ path: 'sprites/monochrome-ship.png',~ - Inside source: true *** True Line Result - args.outputs.reserved << font_style.label(x: x, y: y, text: "#{@prompt}#{current_input_str}", color: @text_color) -** Processing line: ~ args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 0.5,~ + path: 'sprites/monochrome-ship.png', +** Processing line: ~ a: 255,~ - Inside source: true *** True Line Result - args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 0.5, -** Processing line: ~ y: y + 5,~ + a: 255, +** Processing line: ~ angle: args.state.tick_count % 360~ - Inside source: true *** True Line Result - y: y + 5, -** Processing line: ~ x2: x + @cursor_position_px + 0.5,~ + angle: args.state.tick_count % 360 +** Processing line: ~ }~ - 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: ~ end~ - Inside source: true *** True Line Result - y2: y + @font_style.letter_size.y + 5) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 1,~ +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 1, -** Processing line: ~ y: y + 5,~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO RENDER A LABEL ============================================~ - Inside source: true *** True Line Result - y: y + 5, -** Processing line: ~ x2: x + @cursor_position_px + 1,~ + # ==== HOW TO RENDER A LABEL ============================================ +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - x2: x + @cursor_position_px + 1, -** Processing line: ~ y2: y + @font_style.letter_size.y + 5)~ + # ======================================================================= +** Processing line: ~ def how_to_render_a_label args~ - Inside source: true *** True Line Result - y2: y + @font_style.letter_size.y + 5) -** Processing line: ~~ + def how_to_render_a_label args +** Processing line: ~ # NOTE: Text is aligned from the TOP LEFT corner~ - Inside source: true *** True Line Result - -** Processing line: ~ # debugging rectangle for string~ + # NOTE: Text is aligned from the TOP LEFT corner +** Processing line: ~~ - Inside source: true *** True Line Result - # debugging rectangle for string -** Processing line: ~ # args.outputs.reserved << (@cursor_color.to_h.merge x: x,~ + +** Processing line: ~ # Render an EXTRA LARGE/XL label (remove the "#" in front of each line below)~ - Inside source: true *** True Line Result - # args.outputs.reserved << (@cursor_color.to_h.merge x: x, -** Processing line: ~ # y: y + 5,~ + # Render an EXTRA LARGE/XL label (remove the "#" in front of each line below) +** Processing line: ~ args.nokia.labels << { x: 0, y: 46, text: "Hello World",~ - Inside source: true *** True Line Result - # y: y + 5, -** Processing line: ~ # w: @cursor_position_px,~ + args.nokia.labels << { x: 0, y: 46, text: "Hello World", +** Processing line: ~ size_enum: NOKIA_FONT_XL,~ - Inside source: true *** True Line Result - # w: @cursor_position_px, -** Processing line: ~ # h: @font_style.letter_size.y).border~ + size_enum: NOKIA_FONT_XL, +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ - Inside source: true *** True Line Result - # h: @font_style.letter_size.y).border -** Processing line: ~ end~ + r: 0, g: 0, b: 0, a: 255, +** Processing line: ~ font: NOKIA_FONT_PATH }~ - Inside source: true *** True Line Result - end + font: NOKIA_FONT_PATH } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick~ +** Processing line: ~ # Render a LARGE/LG label (remove the "#" in front of each line below)~ - Inside source: true *** True Line Result - def tick -** Processing line: ~ if (@current_input_changed_at) &&~ + # Render a LARGE/LG label (remove the "#" in front of each line below) +** Processing line: ~ args.nokia.labels << { x: 0, y: 29, text: "Hello World",~ - Inside source: true *** True Line Result - if (@current_input_changed_at) && -** Processing line: ~ (@current_input_changed_at < Kernel.global_tick_count) &&~ + args.nokia.labels << { x: 0, y: 29, text: "Hello World", +** Processing line: ~ size_enum: NOKIA_FONT_LG,~ - Inside source: true *** True Line Result - (@current_input_changed_at < Kernel.global_tick_count) && -** Processing line: ~ (@last_input_str != @current_input_str)~ + size_enum: NOKIA_FONT_LG, +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ - Inside source: true *** True Line Result - (@last_input_str != @current_input_str) -** Processing line: ~ @last_input_str_changed = true~ + r: 0, g: 0, b: 0, a: 255, +** Processing line: ~ font: NOKIA_FONT_PATH }~ - Inside source: true *** True Line Result - @last_input_str_changed = true -** Processing line: ~ @last_input_str = "#{@current_input_str}"~ + font: NOKIA_FONT_PATH } +** Processing line: ~~ - Inside source: true *** True Line Result - @last_input_str = "#{@current_input_str}" -** Processing line: ~ @current_input_changed_at = nil~ + +** Processing line: ~ # Render a MEDIUM/MD label (remove the "#" in front of each line below)~ - Inside source: true *** True Line Result - @current_input_changed_at = nil -** Processing line: ~ else~ + # Render a MEDIUM/MD label (remove the "#" in front of each line below) +** Processing line: ~ args.nokia.labels << { x: 0, y: 16, text: "Hello World",~ - Inside source: true *** True Line Result - else -** Processing line: ~ @last_input_str_changed = false~ + args.nokia.labels << { x: 0, y: 16, text: "Hello World", +** Processing line: ~ size_enum: NOKIA_FONT_MD,~ - Inside source: true *** True Line Result - @last_input_str_changed = false -** Processing line: ~ end~ + size_enum: NOKIA_FONT_MD, +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + r: 0, g: 0, b: 0, a: 255, +** Processing line: ~ font: NOKIA_FONT_PATH }~ - Inside source: true *** True Line Result - end + font: NOKIA_FONT_PATH } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ private~ +** Processing line: ~ # Render a SMALL/SM label (remove the "#" in front of each line below)~ - Inside source: true *** True Line Result - private -** Processing line: ~~ + # Render a SMALL/SM label (remove the "#" in front of each line below) +** Processing line: ~ args.nokia.labels << { x: 0, y: 7, text: "Hello World",~ - Inside source: true *** True Line Result - -** Processing line: ~ def last_period_index~ + args.nokia.labels << { x: 0, y: 7, text: "Hello World", +** Processing line: ~ size_enum: NOKIA_FONT_SM,~ - Inside source: true *** True Line Result - def last_period_index -** Processing line: ~ current_input_str.rindex('.')~ + size_enum: NOKIA_FONT_SM, +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ - Inside source: true *** True Line Result - current_input_str.rindex('.') -** Processing line: ~ end~ + r: 0, g: 0, b: 0, a: 255, +** Processing line: ~ font: NOKIA_FONT_PATH }~ - Inside source: true *** True Line Result - end + font: NOKIA_FONT_PATH } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def calc_autocomplete_prefix~ -- Inside source: true -*** True Line Result - def calc_autocomplete_prefix -** Processing line: ~ if last_period_index~ +** Processing line: ~ # You are provided args.nokia.default_label which returns a Hash that you~ - Inside source: true *** True Line Result - if last_period_index -** Processing line: ~ current_input_str[(last_period_index + 1)..-1]~ + # You are provided args.nokia.default_label which returns a Hash that you +** Processing line: ~ # can ~merge~ properties with~ - Inside source: true *** True Line Result - current_input_str[(last_period_index + 1)..-1] -** Processing line: ~ else~ + # can ~merge~ properties with +** Processing line: ~ # Example 1~ - Inside source: true *** True Line Result - else -** Processing line: ~ current_input_str~ + # Example 1 +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - current_input_str -** Processing line: ~ end~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + .default_label +** Processing line: ~ .merge(text: "Default")~ - Inside source: true *** True Line Result - end + .merge(text: "Default") ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def current_object~ -- Inside source: true -*** True Line Result - def current_object -** Processing line: ~ return Kernel unless last_period_index~ +** Processing line: ~ # Example 2~ - Inside source: true *** True Line Result - return Kernel unless last_period_index -** Processing line: ~~ + # Example 2 +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - -** Processing line: ~ Kernel.eval(current_input_str[0...last_period_index])~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - Kernel.eval(current_input_str[0...last_period_index]) -** Processing line: ~ rescue NameError~ + .default_label +** Processing line: ~ .merge(x: 31,~ - Inside source: true *** True Line Result - rescue NameError -** Processing line: ~ nil~ + .merge(x: 31, +** Processing line: ~ text: "Default")~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + text: "Default") +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def method_candidates(prefix)~ -- Inside source: true -*** True Line Result - def method_candidates(prefix) -** Processing line: ~ current_object.autocomplete_methods.map(&:to_s).select { |m| m.start_with? prefix }~ -- Inside source: true -*** True Line Result - current_object.autocomplete_methods.map(&:to_s).select { |m| m.start_with? prefix } -** Processing line: ~ end~ +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # ============================================================================= +** Processing line: ~ # ==== HOW TO RENDER FILLED SQUARES (SOLIDS) ==================================~ - Inside source: true *** True Line Result - -** Processing line: ~ def display_autocomplete_candidate(candidate)~ + # ==== HOW TO RENDER FILLED SQUARES (SOLIDS) ================================== +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - def display_autocomplete_candidate(candidate) -** Processing line: ~ if last_period_index~ + # ============================================================================= +** Processing line: ~ def how_to_render_solids args~ - Inside source: true *** True Line Result - if last_period_index -** Processing line: ~ @current_input_str[0..last_period_index] + candidate.to_s~ + def how_to_render_solids args +** Processing line: ~ # Render a square at 0, 0 with a width and height of 1~ - Inside source: true *** True Line Result - @current_input_str[0..last_period_index] + candidate.to_s -** Processing line: ~ else~ + # Render a square at 0, 0 with a width and height of 1 +** Processing line: ~ args.nokia.solids << { x: 0, y: 0, w: 1, h: 1 }~ - Inside source: true *** True Line Result - else -** Processing line: ~ candidate.to_s~ + args.nokia.solids << { x: 0, y: 0, w: 1, h: 1 } +** Processing line: ~~ - Inside source: true *** True Line Result - candidate.to_s -** Processing line: ~ end~ + +** Processing line: ~ # Render a square at 1, 1 with a width and height of 2~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Render a square at 1, 1 with a width and height of 2 +** Processing line: ~ args.nokia.solids << { x: 1, y: 1, w: 2, h: 2 }~ - Inside source: true *** True Line Result - end + args.nokia.solids << { x: 1, y: 1, w: 2, h: 2 } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def reset_autocomplete~ -- Inside source: true -*** True Line Result - def reset_autocomplete -** Processing line: ~ @last_autocomplete_prefix = nil~ +** Processing line: ~ # Render a square at 3, 3 with a width and height of 3~ - Inside source: true *** True Line Result - @last_autocomplete_prefix = nil -** Processing line: ~ @next_candidate_index = 0~ + # Render a square at 3, 3 with a width and height of 3 +** Processing line: ~ args.nokia.solids << { x: 3, y: 3, w: 3, h: 3 }~ - Inside source: true *** True Line Result - @next_candidate_index = 0 -** Processing line: ~ end~ + args.nokia.solids << { x: 3, y: 3, w: 3, h: 3 } +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + +** Processing line: ~ # Render a square at 6, 6 with a width and height of 4~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # Render a square at 6, 6 with a width and height of 4 +** Processing line: ~ args.nokia.solids << { x: 6, y: 6, w: 4, h: 4 }~ - Inside source: true *** True Line Result - end + args.nokia.solids << { x: 6, y: 6, w: 4, h: 4 } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -96875,2342 +100852,2350 @@ Follows is a source code listing for all files that have been open sourced. This - 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: ~* controller.rb~ -- Header detected. +** Processing line: ~ # =============================================================================~ +- Inside source: true *** True Line Result - + # ============================================================================= +** Processing line: ~ # ==== HOW TO RENDER UNFILLED SQUARES (BORDERS) ===============================~ +- Inside source: true *** True Line Result -* controller.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + # ==== HOW TO RENDER UNFILLED SQUARES (BORDERS) =============================== +** Processing line: ~ # =============================================================================~ +- Inside source: true *** True Line Result - + # ============================================================================= +** Processing line: ~ def how_to_render_borders args~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/controller.rb~ + def how_to_render_borders args +** Processing line: ~ # Render a square at 0, 0 with a width and height of 3~ - Inside source: true *** True Line Result - # ./dragon/controller.rb -** Processing line: ~ # coding: utf-8~ + # Render a square at 0, 0 with a width and height of 3 +** Processing line: ~ args.nokia.borders << { x: 0, y: 0, w: 3, h: 3, a: 255 }~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + args.nokia.borders << { x: 0, y: 0, w: 3, h: 3, a: 255 } +** Processing line: ~~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + +** Processing line: ~ # Render a square at 3, 3 with a width and height of 3~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # controller.rb has been released under MIT (*only this file*).~ + # Render a square at 3, 3 with a width and height of 3 +** Processing line: ~ args.nokia.borders << { x: 3, y: 3, w: 4, h: 4, a: 255 }~ - Inside source: true *** True Line Result - # controller.rb has been released under MIT (*only this file*). + args.nokia.borders << { x: 3, y: 3, w: 4, h: 4, a: 255 } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ # Render a square at 5, 5 with a width and height of 4~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ # @gtk~ + # Render a square at 5, 5 with a width and height of 4 +** Processing line: ~ args.nokia.borders << { x: 7, y: 7, w: 5, h: 5, a: 255 }~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ class Controller~ + args.nokia.borders << { x: 7, y: 7, w: 5, h: 5, a: 255 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - class Controller -** Processing line: ~ # Access to keys that have been pressed down.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # Access to keys that have been pressed down. -** Processing line: ~ #~ + +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Controller::Keys]~ + # ============================================================================= +** Processing line: ~ # ==== HOW TO RENDER A LINE ===================================================~ - Inside source: true *** True Line Result - # @return [Controller::Keys] -** Processing line: ~ # @gtk~ + # ==== HOW TO RENDER A LINE =================================================== +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_reader :key_down~ + # ============================================================================= +** Processing line: ~ def how_to_render_lines args~ - Inside source: true *** True Line Result - attr_reader :key_down + def how_to_render_lines args +** Processing line: ~ # Render a horizontal line at the bottom~ +- Inside source: true +*** True Line Result + # Render a horizontal line at the bottom +** Processing line: ~ args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 0 }~ +- Inside source: true +*** True Line Result + args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 0 } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Access to keys that have been released up.~ +** Processing line: ~ # Render a vertical line at the left~ - Inside source: true *** True Line Result - # Access to keys that have been released up. -** Processing line: ~ #~ + # Render a vertical line at the left +** Processing line: ~ args.nokia.lines << { x: 0, y: 0, x2: 0, y2: 47 }~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Controller::Keys]~ + args.nokia.lines << { x: 0, y: 0, x2: 0, y2: 47 } +** Processing line: ~~ - Inside source: true *** True Line Result - # @return [Controller::Keys] -** Processing line: ~ # @gtk~ + +** Processing line: ~ # Render a diagonal line starting from the bottom left and going to the top right~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_reader :key_up~ + # Render a diagonal line starting from the bottom left and going to the top right +** Processing line: ~ args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 47 }~ - Inside source: true *** True Line Result - attr_reader :key_up + args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 47 } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Access to keys that have been held down.~ +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - # Access to keys that have been held down. -** Processing line: ~ #~ + # ============================================================================= +** Processing line: ~ # == HOW TO RENDER A SPRITE ===================================================~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Controller::Keys]~ + # == HOW TO RENDER A SPRITE =================================================== +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - # @return [Controller::Keys] -** Processing line: ~ # @gtk~ + # ============================================================================= +** Processing line: ~ def how_to_render_sprites args~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_reader :key_held~ + def how_to_render_sprites args +** Processing line: ~ # Loop 10 times and create 10 sprites in 10 positions~ - Inside source: true *** True Line Result - attr_reader :key_held -** Processing line: ~~ + # Loop 10 times and create 10 sprites in 10 positions +** Processing line: ~ # Render a sprite at the bottom left with a width and height of 5 and a path of 'sprites/monochrome-ship.png'~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + # Render a sprite at the bottom left with a width and height of 5 and a path of 'sprites/monochrome-ship.png' +** Processing line: ~ 10.times do |i|~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_accessor :left_analog_x_raw,~ + 10.times do |i| +** Processing line: ~ args.nokia.sprites << {~ - Inside source: true *** True Line Result - attr_accessor :left_analog_x_raw, -** Processing line: ~ :left_analog_y_raw,~ + args.nokia.sprites << { +** Processing line: ~ x: i * 8.4,~ - Inside source: true *** True Line Result - :left_analog_y_raw, -** Processing line: ~ :left_analog_x_perc,~ + x: i * 8.4, +** Processing line: ~ y: i * 4.8,~ - Inside source: true *** True Line Result - :left_analog_x_perc, -** Processing line: ~ :left_analog_y_perc,~ + y: i * 4.8, +** Processing line: ~ w: 5,~ - Inside source: true *** True Line Result - :left_analog_y_perc, -** Processing line: ~ :right_analog_x_raw,~ + w: 5, +** Processing line: ~ h: 5,~ - Inside source: true *** True Line Result - :right_analog_x_raw, -** Processing line: ~ :right_analog_y_raw,~ + h: 5, +** Processing line: ~ path: 'sprites/monochrome-ship.png'~ - Inside source: true *** True Line Result - :right_analog_y_raw, -** Processing line: ~ :right_analog_x_perc,~ + path: 'sprites/monochrome-ship.png' +** Processing line: ~ }~ - Inside source: true *** True Line Result - :right_analog_x_perc, -** Processing line: ~ :right_analog_y_perc~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - :right_analog_y_perc + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~~ +** Processing line: ~ # Given an array of positions create sprites~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize~ + # Given an array of positions create sprites +** Processing line: ~ positions = [~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @key_down = Controller::Keys.new~ + positions = [ +** Processing line: ~ { x: 20, y: 32 },~ - Inside source: true *** True Line Result - @key_down = Controller::Keys.new -** Processing line: ~ @key_up = Controller::Keys.new~ + { x: 20, y: 32 }, +** Processing line: ~ { x: 45, y: 15 },~ - Inside source: true *** True Line Result - @key_up = Controller::Keys.new -** Processing line: ~ @key_held = Controller::Keys.new~ + { x: 45, y: 15 }, +** Processing line: ~ { x: 72, y: 23 },~ - Inside source: true *** True Line Result - @key_held = Controller::Keys.new -** Processing line: ~ @left_analog_x_raw = 0~ + { x: 72, y: 23 }, +** Processing line: ~ ]~ - Inside source: true *** True Line Result - @left_analog_x_raw = 0 -** Processing line: ~ @left_analog_y_raw = 0~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - @left_analog_y_raw = 0 -** Processing line: ~ @left_analog_x_perc = 0~ + +** Processing line: ~ positions.each do |position|~ - Inside source: true *** True Line Result - @left_analog_x_perc = 0 -** Processing line: ~ @left_analog_y_perc = 0~ + positions.each do |position| +** Processing line: ~ # use Ruby's ~Hash#merge~ function to create a sprite~ - Inside source: true *** True Line Result - @left_analog_y_perc = 0 -** Processing line: ~ @right_analog_x_raw = 0~ + # use Ruby's ~Hash#merge~ function to create a sprite +** Processing line: ~ args.nokia.sprites << position.merge(path: 'sprites/monochrome-ship.png',~ - Inside source: true *** True Line Result - @right_analog_x_raw = 0 -** Processing line: ~ @right_analog_y_raw = 0~ + args.nokia.sprites << position.merge(path: 'sprites/monochrome-ship.png', +** Processing line: ~ w: 5,~ - Inside source: true *** True Line Result - @right_analog_y_raw = 0 -** Processing line: ~ @right_analog_x_perc = 0~ + w: 5, +** Processing line: ~ h: 5)~ - Inside source: true *** True Line Result - @right_analog_x_perc = 0 -** Processing line: ~ @right_analog_y_perc = 0~ + h: 5) +** Processing line: ~ end~ - Inside source: true *** True Line Result - @right_analog_y_perc = 0 -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def serialize~ -- Inside source: true -*** True Line Result - def serialize -** Processing line: ~ {~ +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - { -** Processing line: ~ key_down: @key_down.serialize,~ + # ============================================================================= +** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================~ - Inside source: true *** True Line Result - key_down: @key_down.serialize, -** Processing line: ~ key_held: @key_held.serialize,~ + # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ========================== +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - key_held: @key_held.serialize, -** Processing line: ~ key_up: @key_up.serialize~ + # ============================================================================= +** Processing line: ~ def how_to_animate_a_sprite args~ - Inside source: true *** True Line Result - key_up: @key_up.serialize -** Processing line: ~ }~ + def how_to_animate_a_sprite args +** Processing line: ~ # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds +** Processing line: ~ start_animation_on_tick = 180~ - Inside source: true *** True Line Result - end + start_animation_on_tick = 180 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Clear all current key presses.~ +** Processing line: ~ # STEP 2: Get the frame_index given the start tick.~ - Inside source: true *** True Line Result - # Clear all current key presses. -** Processing line: ~ #~ + # STEP 2: Get the frame_index given the start tick. +** Processing line: ~ sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites?~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [void]~ + sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites? +** Processing line: ~ hold_for: 8, # how long to hold each sprite?~ - Inside source: true *** True Line Result - # @return [void] -** Processing line: ~ def clear~ + hold_for: 8, # how long to hold each sprite? +** Processing line: ~ repeat: true # should it repeat?~ - Inside source: true *** True Line Result - def clear -** Processing line: ~ @key_down.clear~ + repeat: true # should it repeat? +** Processing line: ~~ - Inside source: true *** True Line Result - @key_down.clear -** Processing line: ~ @key_up.clear~ + +** Processing line: ~ # STEP 3: frame_index will return nil if the frame hasn't arrived yet~ - Inside source: true *** True Line Result - @key_up.clear -** Processing line: ~ @key_held.clear~ + # STEP 3: frame_index will return nil if the frame hasn't arrived yet +** Processing line: ~ if sprite_index~ - Inside source: true *** True Line Result - @key_held.clear -** Processing line: ~ end~ + if sprite_index +** Processing line: ~ # if the sprite_index is populated, use it to determine the sprite path and render it~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # if the sprite_index is populated, use it to determine the sprite path and render it +** Processing line: ~ sprite_path = "sprites/explosion-#{sprite_index}.png"~ - Inside source: true *** True Line Result - -** Processing line: ~ def up~ + sprite_path = "sprites/explosion-#{sprite_index}.png" +** Processing line: ~ args.nokia.sprites << { x: 42 - 16,~ - Inside source: true *** True Line Result - def up -** Processing line: ~ @key_up.up || @key_held.up~ + args.nokia.sprites << { x: 42 - 16, +** Processing line: ~ y: 47 - 32,~ - Inside source: true *** True Line Result - @key_up.up || @key_held.up -** Processing line: ~ end~ + y: 47 - 32, +** Processing line: ~ w: 32,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + w: 32, +** Processing line: ~ h: 32,~ - Inside source: true *** True Line Result - -** Processing line: ~ def down~ + h: 32, +** Processing line: ~ path: sprite_path }~ - Inside source: true *** True Line Result - def down -** Processing line: ~ @key_up.down || @key_held.down~ + path: sprite_path } +** Processing line: ~ else~ - Inside source: true *** True Line Result - @key_up.down || @key_held.down -** Processing line: ~ end~ + else +** Processing line: ~ # if the sprite_index is nil, render a countdown instead~ - Inside source: true *** True Line Result - end + # if the sprite_index is nil, render a countdown instead +** Processing line: ~ countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1)~ +- Inside source: true +*** True Line Result + countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def left~ +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - def left -** Processing line: ~ @key_up.left || @key_held.left~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - @key_up.left || @key_held.left -** Processing line: ~ end~ + .default_label +** Processing line: ~ .merge(x: 0,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + .merge(x: 0, +** Processing line: ~ y: 18,~ - Inside source: true *** True Line Result - -** Processing line: ~ def right~ + y: 18, +** Processing line: ~ text: "Count Down: #{countdown_in_seconds.to_sf}",~ - Inside source: true *** True Line Result - def right -** Processing line: ~ @key_up.right || @key_held.right~ + text: "Count Down: #{countdown_in_seconds.to_sf}", +** Processing line: ~ alignment_enum: 0)~ - Inside source: true *** True Line Result - @key_up.right || @key_held.right -** Processing line: ~ end~ + alignment_enum: 0) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Activates a key into the down position.~ +** Processing line: ~ # render the current tick and the resolved sprite index~ - Inside source: true *** True Line Result - # Activates a key into the down position. -** Processing line: ~ #~ + # render the current tick and the resolved sprite index +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @param key [Symbol] The key to press down.~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - # @param key [Symbol] The key to press down. -** Processing line: ~ #~ + .default_label +** Processing line: ~ .merge(x: 0,~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [void]~ + .merge(x: 0, +** Processing line: ~ y: 11,~ - Inside source: true *** True Line Result - # @return [void] -** Processing line: ~ def activate_down(key)~ + y: 11, +** Processing line: ~ text: "Tick: #{args.state.tick_count}")~ - Inside source: true *** True Line Result - def activate_down(key) -** Processing line: ~ key_down.activate(key)~ + text: "Tick: #{args.state.tick_count}") +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - key_down.activate(key) -** Processing line: ~ key_held.deactivate(key)~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - key_held.deactivate(key) -** Processing line: ~ key_up.deactivate(key)~ + .default_label +** Processing line: ~ .merge(x: 0,~ - Inside source: true *** True Line Result - key_up.deactivate(key) -** Processing line: ~ end~ + .merge(x: 0, +** Processing line: ~ y: 5,~ - Inside source: true *** True Line Result - end + y: 5, +** Processing line: ~ text: "sprite_index: #{sprite_index}")~ +- Inside source: true +*** True Line Result + text: "sprite_index: #{sprite_index}") +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Activates a key into the held down position.~ +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - # Activates a key into the held down position. -** Processing line: ~ #~ + # ============================================================================= +** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) =================================~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @param key [Symbol] The key to hold down.~ + # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) ================================= +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - # @param key [Symbol] The key to hold down. -** Processing line: ~ #~ + # ============================================================================= +** Processing line: ~ def how_to_animate_a_sprite_sheet args~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [void]~ + def how_to_animate_a_sprite_sheet args +** Processing line: ~ # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds~ - Inside source: true *** True Line Result - # @return [void] -** Processing line: ~ def activate_held(key)~ + # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds +** Processing line: ~ start_animation_on_tick = 180~ - Inside source: true *** True Line Result - def activate_held(key) -** Processing line: ~ key_down.deactivate(key)~ + start_animation_on_tick = 180 +** Processing line: ~~ - Inside source: true *** True Line Result - key_down.deactivate(key) -** Processing line: ~ key_held.activate(key) unless key_held.send(key)~ + +** Processing line: ~ # STEP 2: Get the frame_index given the start tick.~ - Inside source: true *** True Line Result - key_held.activate(key) unless key_held.send(key) -** Processing line: ~ key_up.deactivate(key)~ + # STEP 2: Get the frame_index given the start tick. +** Processing line: ~ sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites?~ - Inside source: true *** True Line Result - key_up.deactivate(key) -** Processing line: ~ end~ + sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites? +** Processing line: ~ hold_for: 8, # how long to hold each sprite?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + hold_for: 8, # how long to hold each sprite? +** Processing line: ~ repeat: true # should it repeat?~ - Inside source: true *** True Line Result - + repeat: true # should it repeat? ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Activates a key release into the up position.~ +** Processing line: ~ # STEP 3: frame_index will return nil if the frame hasn't arrived yet~ - Inside source: true *** True Line Result - # Activates a key release into the up position. -** Processing line: ~ #~ + # STEP 3: frame_index will return nil if the frame hasn't arrived yet +** Processing line: ~ if sprite_index~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @param key [Symbol] The key release up.~ + if sprite_index +** Processing line: ~ # if the sprite_index is populated, use it to determine the source rectangle and render it~ - Inside source: true *** True Line Result - # @param key [Symbol] The key release up. -** Processing line: ~ #~ + # if the sprite_index is populated, use it to determine the source rectangle and render it +** Processing line: ~ args.nokia.sprites << {~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [void]~ + args.nokia.sprites << { +** Processing line: ~ x: 42 - 16,~ - Inside source: true *** True Line Result - # @return [void] -** Processing line: ~ def activate_up(key)~ + x: 42 - 16, +** Processing line: ~ y: 47 - 32,~ - Inside source: true *** True Line Result - def activate_up(key) -** Processing line: ~ key_down.deactivate(key)~ + y: 47 - 32, +** Processing line: ~ w: 32,~ - Inside source: true *** True Line Result - key_down.deactivate(key) -** Processing line: ~ key_held.deactivate(key)~ + w: 32, +** Processing line: ~ h: 32,~ - Inside source: true *** True Line Result - key_held.deactivate(key) -** Processing line: ~ key_up.activate(key)~ + h: 32, +** Processing line: ~ path: "sprites/explosion-sheet.png",~ - Inside source: true *** True Line Result - key_up.activate(key) -** Processing line: ~ end~ + path: "sprites/explosion-sheet.png", +** Processing line: ~ source_x: 32 * sprite_index,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + source_x: 32 * sprite_index, +** Processing line: ~ source_y: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ include DirectionalInputHelperMethods~ + source_y: 0, +** Processing line: ~ source_w: 32,~ - Inside source: true *** True Line Result - include DirectionalInputHelperMethods -** Processing line: ~ end~ + source_w: 32, +** Processing line: ~ source_h: 32~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + source_h: 32 +** Processing line: ~ }~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + } +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~~ + else +** Processing line: ~ # if the sprite_index is nil, render a countdown instead~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + # if the sprite_index is nil, render a countdown instead +** Processing line: ~ countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1)~ +- Inside source: true *** True Line Result -#+end_src + countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1) ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* controller/config.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ args.nokia.labels << args.nokia~ +- Inside source: true *** True Line Result -* controller/config.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/controller/config.rb~ + .default_label +** Processing line: ~ .merge(x: 0,~ - Inside source: true *** True Line Result - # ./dragon/controller/config.rb -** Processing line: ~ # coding: utf-8~ + .merge(x: 0, +** Processing line: ~ y: 18,~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + y: 18, +** Processing line: ~ text: "Count Down: #{countdown_in_seconds.to_sf}",~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + text: "Count Down: #{countdown_in_seconds.to_sf}", +** Processing line: ~ alignment_enum: 0)~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # controller/config.rb has been released under MIT (*only this file*).~ + alignment_enum: 0) +** Processing line: ~ end~ - Inside source: true *** True Line Result - # controller/config.rb has been released under MIT (*only this file*). + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # !!! FIXME: add console command to forget custom binding(s)~ +** Processing line: ~ # render the current tick and the resolved sprite index~ - Inside source: true *** True Line Result - # !!! FIXME: add console command to forget custom binding(s) -** Processing line: ~ # !!! FIXME: add console command to forget replace existing binding(s)~ + # render the current tick and the resolved sprite index +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - # !!! FIXME: add console command to forget replace existing binding(s) -** Processing line: ~ # !!! FIXME: add console command go into play_around mode to make sure controller isn't wonky.~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - # !!! FIXME: add console command go into play_around mode to make sure controller isn't wonky. -** Processing line: ~~ + .default_label +** Processing line: ~ .merge(x: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + .merge(x: 0, +** Processing line: ~ y: 11,~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Controller~ + y: 11, +** Processing line: ~ text: "tick: #{args.state.tick_count}")~ - Inside source: true *** True Line Result - class Controller -** Processing line: ~ class Config~ + text: "tick: #{args.state.tick_count}") +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - class Config -** Processing line: ~ def initialize runtime~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - def initialize runtime -** Processing line: ~ @runtime = runtime~ + .default_label +** Processing line: ~ .merge(x: 0,~ - Inside source: true *** True Line Result - @runtime = runtime -** Processing line: ~ @raw_joysticks = {} # things that aren't game controllers to try to configure.~ + .merge(x: 0, +** Processing line: ~ y: 5,~ - Inside source: true *** True Line Result - @raw_joysticks = {} # things that aren't game controllers to try to configure. -** Processing line: ~ @target = nil~ + y: 5, +** Processing line: ~ text: "sprite_index: #{sprite_index}")~ - Inside source: true *** True Line Result - @target = nil -** Processing line: ~ @animation_duration = (1.5).seconds~ + text: "sprite_index: #{sprite_index}") +** Processing line: ~ end~ - Inside source: true *** True Line Result - @animation_duration = (1.5).seconds -** Processing line: ~ @toggled_at = 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @toggled_at = 0 -** Processing line: ~ @fading = 0~ + +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - @fading = 0 -** Processing line: ~ @current_part = 0~ + # ============================================================================= +** Processing line: ~ # ==== HOW TO STORE STATE, ACCEPT INPUT, AND RENDER SPRITE BASED OFF OF STATE =~ - Inside source: true *** True Line Result - @current_part = 0 -** Processing line: ~ @part_alpha = 0~ + # ==== HOW TO STORE STATE, ACCEPT INPUT, AND RENDER SPRITE BASED OFF OF STATE = +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - @part_alpha = 0 -** Processing line: ~ @part_alpha_increment = 10~ + # ============================================================================= +** Processing line: ~ def how_to_move_a_sprite args~ - Inside source: true *** True Line Result - @part_alpha_increment = 10 -** Processing line: ~ @joystick_state = {}~ + def how_to_move_a_sprite args +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - @joystick_state = {} -** Processing line: ~ @playing_around = false~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - @playing_around = false -** Processing line: ~ @used_bindings = {}~ + .default_label +** Processing line: ~ .merge(x: 42,~ - Inside source: true *** True Line Result - @used_bindings = {} -** Processing line: ~ @bindings = []~ + .merge(x: 42, +** Processing line: ~ y: 46, text: "Use Arrow Keys",~ - Inside source: true *** True Line Result - @bindings = [] -** Processing line: ~ @parts = [~ + y: 46, text: "Use Arrow Keys", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - @parts = [ -** Processing line: ~ [ 919, 282, 'A button', 'a' ],~ + alignment_enum: 1) +** Processing line: ~~ - Inside source: true *** True Line Result - [ 919, 282, 'A button', 'a' ], -** Processing line: ~ [ 960, 323, 'B button', 'b' ],~ + +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - [ 960, 323, 'B button', 'b' ], -** Processing line: ~ [ 878, 323, 'X button', 'x' ],~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - [ 878, 323, 'X button', 'x' ], -** Processing line: ~ [ 919, 365, 'Y button', 'y' ],~ + .default_label +** Processing line: ~ .merge(x: 42,~ - Inside source: true *** True Line Result - [ 919, 365, 'Y button', 'y' ], -** Processing line: ~ [ 433, 246, 'left stick left', '-leftx' ],~ + .merge(x: 42, +** Processing line: ~ y: 41, text: "Or WASD",~ - Inside source: true *** True Line Result - [ 433, 246, 'left stick left', '-leftx' ], -** Processing line: ~ [ 497, 246, 'left stick right', '+leftx' ],~ + y: 41, text: "Or WASD", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - [ 497, 246, 'left stick right', '+leftx' ], -** Processing line: ~ [ 466, 283, 'left stick up', '-lefty' ],~ + alignment_enum: 1) +** Processing line: ~~ - Inside source: true *** True Line Result - [ 466, 283, 'left stick up', '-lefty' ], -** Processing line: ~ [ 466, 218, 'left stick down', '+lefty' ],~ + +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - [ 466, 218, 'left stick down', '+lefty' ], -** Processing line: ~ [ 466, 246, 'left stick button', 'leftstick' ],~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - [ 466, 246, 'left stick button', 'leftstick' ], -** Processing line: ~ [ 741, 246, 'right stick left', '-rightx' ],~ + .default_label +** Processing line: ~ .merge(x: 42,~ - Inside source: true *** True Line Result - [ 741, 246, 'right stick left', '-rightx' ], -** Processing line: ~ [ 802, 246, 'right stick right', '+rightx' ],~ + .merge(x: 42, +** Processing line: ~ y: 36, text: "Or Click",~ - Inside source: true *** True Line Result - [ 802, 246, 'right stick right', '+rightx' ], -** Processing line: ~ [ 773, 283, 'right stick up', '-righty' ],~ + y: 36, text: "Or Click", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - [ 773, 283, 'right stick up', '-righty' ], -** Processing line: ~ [ 773, 218, 'right stick down', '+righty' ],~ + alignment_enum: 1) +** Processing line: ~~ - Inside source: true *** True Line Result - [ 773, 218, 'right stick down', '+righty' ], -** Processing line: ~ [ 772, 246, 'right stick button', 'rightstick' ],~ + +** Processing line: ~ # set the initial values for x and y using ||= ("or equal operator")~ - Inside source: true *** True Line Result - [ 772, 246, 'right stick button', 'rightstick' ], -** Processing line: ~ [ 263, 465, 'left shoulder button', 'leftshoulder' ],~ + # set the initial values for x and y using ||= ("or equal operator") +** Processing line: ~ args.state.ship.x ||= 0~ - Inside source: true *** True Line Result - [ 263, 465, 'left shoulder button', 'leftshoulder' ], -** Processing line: ~ [ 263, 503, 'left trigger', 'lefttrigger' ],~ + args.state.ship.x ||= 0 +** Processing line: ~ args.state.ship.y ||= 0~ - Inside source: true *** True Line Result - [ 263, 503, 'left trigger', 'lefttrigger' ], -** Processing line: ~ [ 977, 465, 'right shoulder button', 'rightshoulder' ],~ + args.state.ship.y ||= 0 +** Processing line: ~~ - Inside source: true *** True Line Result - [ 977, 465, 'right shoulder button', 'rightshoulder' ], -** Processing line: ~ [ 977, 503, 'right trigger', 'righttrigger' ],~ + +** Processing line: ~ # if a mouse click occurs, update the ship's x and y to be the location of the click~ - Inside source: true *** True Line Result - [ 977, 503, 'right trigger', 'righttrigger' ], -** Processing line: ~ [ 318, 365, 'D-pad up', 'dpup' ],~ + # if a mouse click occurs, update the ship's x and y to be the location of the click +** Processing line: ~ if args.nokia.mouse_click~ - Inside source: true *** True Line Result - [ 318, 365, 'D-pad up', 'dpup' ], -** Processing line: ~ [ 360, 322, 'D-pad right', 'dpright' ],~ + if args.nokia.mouse_click +** Processing line: ~ args.state.ship.x = args.nokia.mouse_click.x~ - Inside source: true *** True Line Result - [ 360, 322, 'D-pad right', 'dpright' ], -** Processing line: ~ [ 318, 280, 'D-pad down', 'dpdown' ],~ + args.state.ship.x = args.nokia.mouse_click.x +** Processing line: ~ args.state.ship.y = args.nokia.mouse_click.y~ - Inside source: true *** True Line Result - [ 318, 280, 'D-pad down', 'dpdown' ], -** Processing line: ~ [ 275, 322, 'D-pad left', 'dpleft' ],~ + args.state.ship.y = args.nokia.mouse_click.y +** Processing line: ~ end~ - Inside source: true *** True Line Result - [ 275, 322, 'D-pad left', 'dpleft' ], -** Processing line: ~ [ 570, 402, 'select/back button', 'back'],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - [ 570, 402, 'select/back button', 'back'], -** Processing line: ~ [ 619, 448, 'guide/home button', 'guide' ],~ + +** Processing line: ~ # if a or left arrow is pressed/held, decrement the ships x position~ - Inside source: true *** True Line Result - [ 619, 448, 'guide/home button', 'guide' ], -** Processing line: ~ [ 669, 402, 'start button', 'start' ],~ + # if a or left arrow is pressed/held, decrement the ships x position +** Processing line: ~ if args.nokia.keyboard.left~ - Inside source: true *** True Line Result - [ 669, 402, 'start button', 'start' ], -** Processing line: ~ ]~ + if args.nokia.keyboard.left +** Processing line: ~ args.state.ship.x -= 1~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + args.state.ship.x -= 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def rawjoystick_connected jid, joystickname, guid~ +** Processing line: ~ # if d or right arrow is pressed/held, increment the ships x position~ - Inside source: true *** True Line Result - def rawjoystick_connected jid, joystickname, guid -** Processing line: ~ return if jid < 0~ + # if d or right arrow is pressed/held, increment the ships x position +** Processing line: ~ if args.nokia.keyboard.right~ - Inside source: true *** True Line Result - return if jid < 0 -** Processing line: ~ @raw_joysticks[jid] = { name: joystickname, guid: guid }~ + if args.nokia.keyboard.right +** Processing line: ~ args.state.ship.x += 1~ - Inside source: true *** True Line Result - @raw_joysticks[jid] = { name: joystickname, guid: guid } -** Processing line: ~ end~ + args.state.ship.x += 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def rawjoystick_disconnected jid~ +** Processing line: ~ # if s or down arrow is pressed/held, decrement the ships y position~ - Inside source: true *** True Line Result - def rawjoystick_disconnected jid -** Processing line: ~ return if jid < 0~ + # if s or down arrow is pressed/held, decrement the ships y position +** Processing line: ~ if args.nokia.keyboard.down~ - Inside source: true *** True Line Result - return if jid < 0 -** Processing line: ~ if @raw_joysticks[jid] != nil~ + if args.nokia.keyboard.down +** Processing line: ~ args.state.ship.y -= 1~ - Inside source: true *** True Line Result - if @raw_joysticks[jid] != nil -** Processing line: ~ @raw_joysticks.delete(jid)~ + args.state.ship.y -= 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - @raw_joysticks.delete(jid) -** Processing line: ~ @runtime.ffi_misc.close_raw_joystick(jid)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @runtime.ffi_misc.close_raw_joystick(jid) -** Processing line: ~ # Fade out the config screen if we were literally configuring this controller right now.~ + +** Processing line: ~ # if w or up arrow is pressed/held, increment the ships y position~ - Inside source: true *** True Line Result - # Fade out the config screen if we were literally configuring this controller right now. -** Processing line: ~ if !@target.nil? && @target[0] == jid~ + # if w or up arrow is pressed/held, increment the ships y position +** Processing line: ~ if args.nokia.keyboard.up~ - Inside source: true *** True Line Result - if !@target.nil? && @target[0] == jid -** Processing line: ~ @target[0] = nil~ + if args.nokia.keyboard.up +** Processing line: ~ args.state.ship.y += 1~ - Inside source: true *** True Line Result - @target[0] = nil -** Processing line: ~ @toggled_at = Kernel.global_tick_count~ + args.state.ship.y += 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - @toggled_at = Kernel.global_tick_count -** Processing line: ~ @fading = -1~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @fading = -1 -** Processing line: ~ end~ + +** Processing line: ~ # render the sprite to the screen using the position stored in args.state.ship~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # render the sprite to the screen using the position stored in args.state.ship +** Processing line: ~ args.nokia.sprites << {~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + args.nokia.sprites << { +** Processing line: ~ x: args.state.ship.x,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x: args.state.ship.x, +** Processing line: ~ y: args.state.ship.y,~ - Inside source: true *** True Line Result - -** Processing line: ~ def build_binding_string~ + y: args.state.ship.y, +** Processing line: ~ w: 5,~ - Inside source: true *** True Line Result - def build_binding_string -** Processing line: ~ bindingstr = ''~ + w: 5, +** Processing line: ~ h: 5,~ - Inside source: true *** True Line Result - bindingstr = '' -** Processing line: ~ skip = false~ + h: 5, +** Processing line: ~ path: 'sprites/monochrome-ship.png',~ - Inside source: true *** True Line Result - skip = false -** Processing line: ~~ + path: 'sprites/monochrome-ship.png', +** Processing line: ~ # parameters beyond this point are optional~ - Inside source: true *** True Line Result - -** Processing line: ~ for i in 0..@parts.length-1~ + # parameters beyond this point are optional +** Processing line: ~ angle: 0, # Note: rotation angle is denoted in degrees NOT radians~ - Inside source: true *** True Line Result - for i in 0..@parts.length-1 -** Processing line: ~ if skip ; skip = false ; next ; end~ + angle: 0, # Note: rotation angle is denoted in degrees NOT radians +** Processing line: ~ r: 255,~ - Inside source: true *** True Line Result - if skip ; skip = false ; next ; end -** Processing line: ~~ + r: 255, +** Processing line: ~ g: 255,~ - Inside source: true *** True Line Result - -** Processing line: ~ binding = @bindings[i]~ + g: 255, +** Processing line: ~ b: 255,~ - Inside source: true *** True Line Result - binding = @bindings[i] -** Processing line: ~ next if binding.nil?~ + b: 255, +** Processing line: ~ a: 255~ - Inside source: true *** True Line Result - next if binding.nil? -** Processing line: ~~ + a: 255 +** Processing line: ~ }~ - Inside source: true *** True Line Result - -** Processing line: ~ part = @parts[i][3]~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - part = @parts[i][3] + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # clean up string:~ +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - # clean up string: -** Processing line: ~ # if axis uses -a0 for negative and +a0 for positive, just make it "leftx:a0" instead of "-leftx:-a0,+leftx:+a0"~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO DETERMINE COLLISION =======================================~ - Inside source: true *** True Line Result - # if axis uses -a0 for negative and +a0 for positive, just make it "leftx:a0" instead of "-leftx:-a0,+leftx:+a0" -** Processing line: ~ # if axis uses +a0 for negative and -a0 for positive, just make it "leftx:a0~" instead of "-leftx:+a0,+leftx:-a0"~ + # ==== HOW TO DETERMINE COLLISION ======================================= +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - # if axis uses +a0 for negative and -a0 for positive, just make it "leftx:a0~" instead of "-leftx:+a0,+leftx:-a0" -** Processing line: ~ if part == '-leftx' || part == '-lefty' || part == '-rightx' || part == '-righty'~ + # ======================================================================= +** Processing line: ~ def how_to_determine_collision args~ - Inside source: true *** True Line Result - if part == '-leftx' || part == '-lefty' || part == '-rightx' || part == '-righty' -** Processing line: ~ nextbinding = @bindings[i+1]~ + def how_to_determine_collision args +** Processing line: ~ # Render the instructions~ - Inside source: true *** True Line Result - nextbinding = @bindings[i+1] -** Processing line: ~ if binding.start_with?('-a') && nextbinding.start_with?('+a') && binding[2..-1] == nextbinding[2..-1]~ + # Render the instructions +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - if binding.start_with?('-a') && nextbinding.start_with?('+a') && binding[2..-1] == nextbinding[2..-1] -** Processing line: ~ skip = true~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - skip = true -** Processing line: ~ part = part[1..-1]~ + .default_label +** Processing line: ~ .merge(x: 42,~ - Inside source: true *** True Line Result - part = part[1..-1] -** Processing line: ~ binding = binding[1..-1]~ + .merge(x: 42, +** Processing line: ~ y: 46, text: "Click Anywhere",~ - Inside source: true *** True Line Result - binding = binding[1..-1] -** Processing line: ~ elsif binding.start_with?('+a') && nextbinding.start_with?('-a') && binding[2..-1] == nextbinding[2..-1]~ + y: 46, text: "Click Anywhere", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - elsif binding.start_with?('+a') && nextbinding.start_with?('-a') && binding[2..-1] == nextbinding[2..-1] -** Processing line: ~ skip = true~ + alignment_enum: 1) +** Processing line: ~~ - Inside source: true *** True Line Result - skip = true -** Processing line: ~ part = part[1..-1]~ + +** Processing line: ~ # if a mouse click occurs:~ - Inside source: true *** True Line Result - part = part[1..-1] -** Processing line: ~ binding = "#{binding[1..-1]}~"~ + # if a mouse click occurs: +** Processing line: ~ # - set ship_one if it isn't set~ - Inside source: true *** True Line Result - binding = "#{binding[1..-1]}~" -** Processing line: ~ end~ + # - set ship_one if it isn't set +** Processing line: ~ # - set ship_two if it isn't set~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # - set ship_two if it isn't set +** Processing line: ~ # - otherwise reset ship one and ship two~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # - otherwise reset ship one and ship two +** Processing line: ~ if args.nokia.mouse_click~ - Inside source: true *** True Line Result - -** Processing line: ~ bindingstr += "#{!bindingstr.empty? ? ',' : ''}#{part}:#{binding}"~ + if args.nokia.mouse_click +** Processing line: ~ # is ship_one set?~ - Inside source: true *** True Line Result - bindingstr += "#{!bindingstr.empty? ? ',' : ''}#{part}:#{binding}" -** Processing line: ~ end~ + # is ship_one set? +** Processing line: ~ if !args.state.ship_one~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if !args.state.ship_one +** Processing line: ~ args.state.ship_one = { x: args.nokia.mouse_click.x - 5,~ - Inside source: true *** True Line Result - -** Processing line: ~ details = @target[1]~ + args.state.ship_one = { x: args.nokia.mouse_click.x - 5, +** Processing line: ~ y: args.nokia.mouse_click.y - 5,~ - Inside source: true *** True Line Result - details = @target[1] -** Processing line: ~~ + y: args.nokia.mouse_click.y - 5, +** Processing line: ~ w: 10,~ - Inside source: true *** True Line Result - -** Processing line: ~ # !!! FIXME: no String.delete in mRuby?!?! Maybe so when upgrading.~ + w: 10, +** Processing line: ~ h: 10 }~ - Inside source: true *** True Line Result - # !!! FIXME: no String.delete in mRuby?!?! Maybe so when upgrading. -** Processing line: ~ #name = details[:name].delete(',')~ + h: 10 } +** Processing line: ~ # is ship_one set?~ - Inside source: true *** True Line Result - #name = details[:name].delete(',') -** Processing line: ~ # !!! FIXME: ...no regexp either... :/~ + # is ship_one set? +** Processing line: ~ elsif !args.state.ship_two~ - Inside source: true *** True Line Result - # !!! FIXME: ...no regexp either... :/ -** Processing line: ~ #name = details[:name].gsub(/,/, ' ') # !!! FIXME: will SDL let you escape these instead?~ + elsif !args.state.ship_two +** Processing line: ~ args.state.ship_two = { x: args.nokia.mouse_click.x - 5,~ - Inside source: true *** True Line Result - #name = details[:name].gsub(/,/, ' ') # !!! FIXME: will SDL let you escape these instead? -** Processing line: ~ unescaped = details[:name]~ + args.state.ship_two = { x: args.nokia.mouse_click.x - 5, +** Processing line: ~ y: args.nokia.mouse_click.y - 5,~ - Inside source: true *** True Line Result - unescaped = details[:name] -** Processing line: ~ name = ''~ + y: args.nokia.mouse_click.y - 5, +** Processing line: ~ w: 10,~ - Inside source: true *** True Line Result - name = '' -** Processing line: ~ for i in 0..unescaped.length-1~ + w: 10, +** Processing line: ~ h: 10 }~ - Inside source: true *** True Line Result - for i in 0..unescaped.length-1 -** Processing line: ~ ch = unescaped[i]~ + h: 10 } +** Processing line: ~ # should we reset?~ - Inside source: true *** True Line Result - ch = unescaped[i] -** Processing line: ~ name += (ch == ',') ? ' ' : ch~ + # should we reset? +** Processing line: ~ else~ - Inside source: true *** True Line Result - name += (ch == ',') ? ' ' : ch -** Processing line: ~ end~ + else +** Processing line: ~ args.state.ship_one = nil~ - Inside source: true *** True Line Result - end -** Processing line: ~ return "#{details[:guid]},#{name},platform:#{@runtime.platform},#{bindingstr}"~ + args.state.ship_one = nil +** Processing line: ~ args.state.ship_two = nil~ - Inside source: true *** True Line Result - return "#{details[:guid]},#{name},platform:#{@runtime.platform},#{bindingstr}" -** Processing line: ~ end~ + args.state.ship_two = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def move_to_different_part part~ +** Processing line: ~ # render ship one if it's set~ - Inside source: true *** True Line Result - def move_to_different_part part -** Processing line: ~ if !@joystick_state[:axes].nil?~ + # render ship one if it's set +** Processing line: ~ if args.state.ship_one~ - Inside source: true *** True Line Result - if !@joystick_state[:axes].nil? -** Processing line: ~ @joystick_state[:axes].each { |i| i[:farthestval] = i[:startingval] if !i.nil? }~ + if args.state.ship_one +** Processing line: ~ # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha~ - Inside source: true *** True Line Result - @joystick_state[:axes].each { |i| i[:farthestval] = i[:startingval] if !i.nil? } -** Processing line: ~ end~ + # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha +** Processing line: ~ # render ship one~ - Inside source: true *** True Line Result - end -** Processing line: ~ @current_part = part~ + # render ship one +** Processing line: ~ args.nokia.sprites << args.state.ship_one.merge(path: 'sprites/monochrome-ship.png')~ - Inside source: true *** True Line Result - @current_part = part -** Processing line: ~ end~ + args.nokia.sprites << args.state.ship_one.merge(path: 'sprites/monochrome-ship.png') +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def previous_part~ +** Processing line: ~ if args.state.ship_two~ - Inside source: true *** True Line Result - def previous_part -** Processing line: ~ if @current_part > 0~ + if args.state.ship_two +** Processing line: ~ # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha~ - Inside source: true *** True Line Result - if @current_part > 0 -** Processing line: ~ # remove the binding that we previous had here so it can be reused.~ + # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha +** Processing line: ~ # render ship two~ - Inside source: true *** True Line Result - # remove the binding that we previous had here so it can be reused. -** Processing line: ~ bindstr = @bindings[@current_part - 1]~ + # render ship two +** Processing line: ~ args.nokia.sprites << args.state.ship_two.merge(path: 'sprites/monochrome-ship.png')~ - Inside source: true *** True Line Result - bindstr = @bindings[@current_part - 1] -** Processing line: ~ @bindings[@current_part - 1] = nil~ + args.nokia.sprites << args.state.ship_two.merge(path: 'sprites/monochrome-ship.png') +** Processing line: ~ end~ - Inside source: true *** True Line Result - @bindings[@current_part - 1] = nil -** Processing line: ~ @used_bindings[bindstr] = nil~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @used_bindings[bindstr] = nil -** Processing line: ~ move_to_different_part @current_part - 1~ + +** Processing line: ~ # if both ship one and ship two are set, then determine collision~ - Inside source: true *** True Line Result - move_to_different_part @current_part - 1 -** Processing line: ~ end~ + # if both ship one and ship two are set, then determine collision +** Processing line: ~ if args.state.ship_one && args.state.ship_two~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + if args.state.ship_one && args.state.ship_two +** Processing line: ~ # collision is determined using the intersect_rect? method~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # collision is determined using the intersect_rect? method +** Processing line: ~ if args.state.ship_one.intersect_rect? args.state.ship_two~ - Inside source: true *** True Line Result - -** Processing line: ~ def next_part~ + if args.state.ship_one.intersect_rect? args.state.ship_two +** Processing line: ~ # if collision occurred, render the words collision!~ - Inside source: true *** True Line Result - def next_part -** Processing line: ~ if @current_part < (@parts.length - 1)~ + # if collision occurred, render the words collision! +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - if @current_part < (@parts.length - 1) -** Processing line: ~ move_to_different_part @current_part + 1~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - move_to_different_part @current_part + 1 -** Processing line: ~ else~ + .default_label +** Processing line: ~ .merge(x: 42,~ - Inside source: true *** True Line Result - else -** Processing line: ~ @playing_around = true~ + .merge(x: 42, +** Processing line: ~ y: 5,~ - Inside source: true *** True Line Result - @playing_around = true -** Processing line: ~ end~ + y: 5, +** Processing line: ~ text: "Collision!",~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + text: "Collision!", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + alignment_enum: 1) +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ def set_binding bindstr~ + else +** Processing line: ~ # if collision occurred, render the words no collision.~ - Inside source: true *** True Line Result - def set_binding bindstr -** Processing line: ~ return false if !@used_bindings[bindstr].nil?~ + # if collision occurred, render the words no collision. +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - return false if !@used_bindings[bindstr].nil? -** Processing line: ~ @used_bindings[bindstr] = @current_part~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - @used_bindings[bindstr] = @current_part -** Processing line: ~ @bindings[@current_part] = bindstr~ + .default_label +** Processing line: ~ .merge(x: 42,~ - Inside source: true *** True Line Result - @bindings[@current_part] = bindstr -** Processing line: ~ return true~ + .merge(x: 42, +** Processing line: ~ y: 5,~ - Inside source: true *** True Line Result - return true -** Processing line: ~ end~ + y: 5, +** Processing line: ~ text: "No Collision.",~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + text: "No Collision.", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - -** Processing line: ~ # Called when a lowlevel joystick moves an axis.~ + alignment_enum: 1) +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Called when a lowlevel joystick moves an axis. -** Processing line: ~ def rawjoystick_axis jid, axis, value~ + end +** Processing line: ~ else~ - Inside source: true *** True Line Result - def rawjoystick_axis jid, axis, value -** Processing line: ~ return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick.~ + else +** Processing line: ~ # if both ship one and ship two aren't set, then render --~ - Inside source: true *** True Line Result - return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick. -** Processing line: ~~ + # if both ship one and ship two aren't set, then render -- +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - -** Processing line: ~ @joystick_state[:axes] ||= []~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - @joystick_state[:axes] ||= [] -** Processing line: ~ @joystick_state[:axes][axis] ||= {~ + .default_label +** Processing line: ~ .merge(x: 42,~ - Inside source: true *** True Line Result - @joystick_state[:axes][axis] ||= { -** Processing line: ~ moving: false,~ + .merge(x: 42, +** Processing line: ~ y: 6,~ - Inside source: true *** True Line Result - moving: false, -** Processing line: ~ startingval: 0,~ + y: 6, +** Processing line: ~ text: "--",~ - Inside source: true *** True Line Result - startingval: 0, -** Processing line: ~ currentval: 0,~ + text: "--", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - currentval: 0, -** Processing line: ~ farthestval: 0~ + alignment_enum: 1) +** Processing line: ~ end~ - Inside source: true *** True Line Result - farthestval: 0 -** Processing line: ~ }~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # this is the logic from SDL's controllermap.c, more or less, since this is hard to get right from scratch.~ +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - # this is the logic from SDL's controllermap.c, more or less, since this is hard to get right from scratch. -** Processing line: ~ state = @joystick_state[:axes][axis]~ + # ============================================================================= +** Processing line: ~ # ==== HOW TO CREATE BUTTONS ==================================================~ - Inside source: true *** True Line Result - state = @joystick_state[:axes][axis] -** Processing line: ~ state[:currentval] = value~ + # ==== HOW TO CREATE BUTTONS ================================================== +** Processing line: ~ # =============================================================================~ - Inside source: true *** True Line Result - state[:currentval] = value -** Processing line: ~ if !state[:moving]~ + # ============================================================================= +** Processing line: ~ def how_to_create_buttons args~ - Inside source: true *** True Line Result - if !state[:moving] -** Processing line: ~ state[:moving] = true~ + def how_to_create_buttons args +** Processing line: ~ # Define a button style~ - Inside source: true *** True Line Result - state[:moving] = true -** Processing line: ~ state[:startingval] = value~ + # Define a button style +** Processing line: ~ args.state.button_style = { w: 82, h: 10, }~ - Inside source: true *** True Line Result - state[:startingval] = value -** Processing line: ~ state[:farthestval] = value~ + args.state.button_style = { w: 82, h: 10, } +** Processing line: ~~ - Inside source: true *** True Line Result - state[:farthestval] = value -** Processing line: ~ end~ + +** Processing line: ~ # Render instructions~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Render instructions +** Processing line: ~ args.state.button_message ||= "Press a Button!"~ - Inside source: true *** True Line Result - -** Processing line: ~ current_distance = (value - state[:startingval]).abs~ + args.state.button_message ||= "Press a Button!" +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - current_distance = (value - state[:startingval]).abs -** Processing line: ~ farthest_distance = (state[:farthestval] - state[:startingval]).abs~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - farthest_distance = (state[:farthestval] - state[:startingval]).abs -** Processing line: ~ if current_distance > farthest_distance~ + .default_label +** Processing line: ~ .merge(x: 42,~ - Inside source: true *** True Line Result - if current_distance > farthest_distance -** Processing line: ~ state[:farthestval] = value~ + .merge(x: 42, +** Processing line: ~ y: 82,~ - Inside source: true *** True Line Result - state[:farthestval] = value -** Processing line: ~ farthest_distance = (state[:farthestval] - state[:startingval]).abs~ + y: 82, +** Processing line: ~ text: args.state.button_message,~ - Inside source: true *** True Line Result - farthest_distance = (state[:farthestval] - state[:startingval]).abs -** Processing line: ~ end~ + text: args.state.button_message, +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - end + alignment_enum: 1) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # If we've gone out far enough and started to come back, let's bind this axis~ +** Processing line: ~~ - Inside source: true *** True Line Result - # If we've gone out far enough and started to come back, let's bind this axis -** Processing line: ~ if (farthest_distance >= 16000) && (current_distance <= 10000)~ + +** Processing line: ~ # Creates button one using a border and a label~ - Inside source: true *** True Line Result - if (farthest_distance >= 16000) && (current_distance <= 10000) -** Processing line: ~ next_part if set_binding("#{(state[:farthestval] < 0) ? '-' : '+'}a#{axis}")~ + # Creates button one using a border and a label +** Processing line: ~ args.state.button_one_border = args.state.button_style.merge( x: 1, y: 32)~ - Inside source: true *** True Line Result - next_part if set_binding("#{(state[:farthestval] < 0) ? '-' : '+'}a#{axis}") -** Processing line: ~ end~ + args.state.button_one_border = args.state.button_style.merge( x: 1, y: 32) +** Processing line: ~ args.nokia.borders << args.state.button_one_border~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + args.nokia.borders << args.state.button_one_border +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - -** Processing line: ~ # Called when a lowlevel joystick moves a hat.~ + .default_label +** Processing line: ~ .merge(x: args.state.button_one_border.x + 2,~ - Inside source: true *** True Line Result - # Called when a lowlevel joystick moves a hat. -** Processing line: ~ def rawjoystick_hat jid, hat, value~ + .merge(x: args.state.button_one_border.x + 2, +** Processing line: ~ y: args.state.button_one_border.y + NOKIA_FONT_SM_HEIGHT + 2,~ - Inside source: true *** True Line Result - def rawjoystick_hat jid, hat, value -** Processing line: ~ return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick.~ + y: args.state.button_one_border.y + NOKIA_FONT_SM_HEIGHT + 2, +** Processing line: ~ text: "Button One")~ - Inside source: true *** True Line Result - return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick. + text: "Button One") ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @joystick_state[:hats] ||= []~ +** Processing line: ~ # Creates button two using a border and a label~ - Inside source: true *** True Line Result - @joystick_state[:hats] ||= [] -** Processing line: ~ @joystick_state[:hats][hat] = value~ + # Creates button two using a border and a label +** Processing line: ~ args.state.button_two_border = args.state.button_style.merge( x: 1, y: 20)~ - Inside source: true *** True Line Result - @joystick_state[:hats][hat] = value + args.state.button_two_border = args.state.button_style.merge( x: 1, y: 20) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return if value == 0 # 0 == centered, skip it~ -- Inside source: true -*** True Line Result - return if value == 0 # 0 == centered, skip it -** Processing line: ~ next_part if set_binding("h#{hat}.#{value}")~ +** Processing line: ~ args.nokia.borders << args.state.button_two_border~ - Inside source: true *** True Line Result - next_part if set_binding("h#{hat}.#{value}") -** Processing line: ~ end~ + args.nokia.borders << args.state.button_two_border +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - -** Processing line: ~ # Called when a lowlevel joystick moves a button.~ + .default_label +** Processing line: ~ .merge(x: args.state.button_two_border.x + 2,~ - Inside source: true *** True Line Result - # Called when a lowlevel joystick moves a button. -** Processing line: ~ def rawjoystick_button jid, button, pressed~ + .merge(x: args.state.button_two_border.x + 2, +** Processing line: ~ y: args.state.button_two_border.y + NOKIA_FONT_SM_HEIGHT + 2,~ - Inside source: true *** True Line Result - def rawjoystick_button jid, button, pressed -** Processing line: ~ return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick.~ + y: args.state.button_two_border.y + NOKIA_FONT_SM_HEIGHT + 2, +** Processing line: ~ text: "Button Two")~ - Inside source: true *** True Line Result - return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick. + text: "Button Two") ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @joystick_state[:buttons] ||= []~ +** Processing line: ~ # Initialize the state variable that tracks which button was clicked to "" (empty stringI~ - Inside source: true *** True Line Result - @joystick_state[:buttons] ||= [] -** Processing line: ~ @joystick_state[:buttons][button] = pressed~ + # Initialize the state variable that tracks which button was clicked to "" (empty stringI +** Processing line: ~ args.state.last_button_clicked ||= "--"~ - Inside source: true *** True Line Result - @joystick_state[:buttons][button] = pressed + args.state.last_button_clicked ||= "--" ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return if !pressed~ -- Inside source: true -*** True Line Result - return if !pressed -** Processing line: ~ next_part if set_binding("b#{button}")~ -- Inside source: true -*** True Line Result - next_part if set_binding("b#{button}") -** Processing line: ~ end~ +** Processing line: ~ # If a click occurs, check to see if either button one, or button two was clicked~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # If a click occurs, check to see if either button one, or button two was clicked +** Processing line: ~ # using the inside_rect? method of the mouse~ - Inside source: true *** True Line Result - -** Processing line: ~ def calc_fading~ + # using the inside_rect? method of the mouse +** Processing line: ~ # set args.state.last_button_clicked accordingly~ - Inside source: true *** True Line Result - def calc_fading -** Processing line: ~ if @fading == 0~ + # set args.state.last_button_clicked accordingly +** Processing line: ~ if args.nokia.mouse_click~ - Inside source: true *** True Line Result - if @fading == 0 -** Processing line: ~ return 255~ + if args.nokia.mouse_click +** Processing line: ~ if args.nokia.mouse_click.inside_rect? args.state.button_one_border~ - Inside source: true *** True Line Result - return 255 -** Processing line: ~ elsif @fading > 0 # fading in~ + if args.nokia.mouse_click.inside_rect? args.state.button_one_border +** Processing line: ~ args.state.last_button_clicked = "One Clicked!"~ - Inside source: true *** True Line Result - elsif @fading > 0 # fading in -** Processing line: ~ percent = @toggled_at.global_ease(@animation_duration, :flip, :quint, :flip)~ + args.state.last_button_clicked = "One Clicked!" +** Processing line: ~ elsif args.nokia.mouse_click.inside_rect? args.state.button_two_border~ - Inside source: true *** True Line Result - percent = @toggled_at.global_ease(@animation_duration, :flip, :quint, :flip) -** Processing line: ~ if percent >= 1.0~ + elsif args.nokia.mouse_click.inside_rect? args.state.button_two_border +** Processing line: ~ args.state.last_button_clicked = "Two Clicked!"~ - Inside source: true *** True Line Result - if percent >= 1.0 -** Processing line: ~ percent = 1.0~ + args.state.last_button_clicked = "Two Clicked!" +** Processing line: ~ else~ - Inside source: true *** True Line Result - percent = 1.0 -** Processing line: ~ @fading = 0~ + else +** Processing line: ~ args.state.last_button_clicked = "--"~ - Inside source: true *** True Line Result - @fading = 0 -** Processing line: ~ end~ + args.state.last_button_clicked = "--" +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ else # fading out~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - else # fading out -** Processing line: ~ percent = @toggled_at.global_ease(@animation_duration, :flip, :quint)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - percent = @toggled_at.global_ease(@animation_duration, :flip, :quint) -** Processing line: ~ if percent <= 0.0~ + +** Processing line: ~ # Render the current value of args.state.last_button_clicked~ - Inside source: true *** True Line Result - if percent <= 0.0 -** Processing line: ~ percent = 0.0~ + # Render the current value of args.state.last_button_clicked +** Processing line: ~ args.nokia.labels << args.nokia~ - Inside source: true *** True Line Result - percent = 0.0 -** Processing line: ~ @fading = 0~ + args.nokia.labels << args.nokia +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - @fading = 0 -** Processing line: ~ end~ + .default_label +** Processing line: ~ .merge(x: 42,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + .merge(x: 42, +** Processing line: ~ y: 5,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + y: 5, +** Processing line: ~ text: args.state.last_button_clicked,~ - Inside source: true *** True Line Result - -** Processing line: ~ return (percent * 255.0).to_i~ + text: args.state.last_button_clicked, +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - return (percent * 255.0).to_i -** Processing line: ~ end~ + alignment_enum: 1) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_basics args, msg, fade=255~ +** Processing line: ~ def render_debug args~ - Inside source: true *** True Line Result - def render_basics args, msg, fade=255 -** Processing line: ~ joystickname = @target[1][:name]~ + def render_debug args +** Processing line: ~ if !args.state.grid_rendered~ - Inside source: true *** True Line Result - joystickname = @target[1][:name] -** Processing line: ~ args.outputs.primitives << [0, 0, $gtk.logical_width, $gtk.logical_height, 255, 255, 255, fade].solid~ + if !args.state.grid_rendered +** Processing line: ~ (NOKIA_HEIGHT + 1).map_with_index do |i|~ - Inside source: true *** True Line Result - args.outputs.primitives << [0, 0, $gtk.logical_width, $gtk.logical_height, 255, 255, 255, fade].solid -** Processing line: ~ args.outputs.primitives << [0, 0, $gtk.logical_width, $gtk.logical_height, 'dragonruby-controller.png', 0, fade, 255, 255, 255].sprite~ + (NOKIA_HEIGHT + 1).map_with_index do |i| +** Processing line: ~ args.outputs.static_debug << {~ - Inside source: true *** True Line Result - args.outputs.primitives << [0, 0, $gtk.logical_width, $gtk.logical_height, 'dragonruby-controller.png', 0, fade, 255, 255, 255].sprite -** Processing line: ~ args.outputs.primitives << [$gtk.logical_width / 2, 700, joystickname, 2, 1, 0, 0, 0, fade].label~ + args.outputs.static_debug << { +** Processing line: ~ x: NOKIA_X_OFFSET,~ - Inside source: true *** True Line Result - args.outputs.primitives << [$gtk.logical_width / 2, 700, joystickname, 2, 1, 0, 0, 0, fade].label -** Processing line: ~ args.outputs.primitives << [$gtk.logical_height / 2, 650, msg, 0, 1, 0, 0, 0, 255].label if !msg.empty?~ + x: NOKIA_X_OFFSET, +** Processing line: ~ y: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM),~ - Inside source: true *** True Line Result - args.outputs.primitives << [$gtk.logical_height / 2, 650, msg, 0, 1, 0, 0, 0, 255].label if !msg.empty? -** Processing line: ~ end~ + y: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), +** Processing line: ~ x2: NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x2: NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH, +** Processing line: ~ y2: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM),~ - Inside source: true *** True Line Result - -** Processing line: ~ def render_part_highlight args, part, alpha=255~ + y2: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), +** Processing line: ~ r: 128,~ - Inside source: true *** True Line Result - def render_part_highlight args, part, alpha=255 -** Processing line: ~ partsize = 41~ + r: 128, +** Processing line: ~ g: 128,~ - Inside source: true *** True Line Result - partsize = 41 -** Processing line: ~ args.outputs.primitives << [part[0], part[1], partsize, partsize, 255, 0, 0, alpha].border~ + g: 128, +** Processing line: ~ b: 128,~ - Inside source: true *** True Line Result - args.outputs.primitives << [part[0], part[1], partsize, partsize, 255, 0, 0, alpha].border -** Processing line: ~ args.outputs.primitives << [part[0]-1, part[1]-1, partsize+2, partsize+2, 255, 0, 0, alpha].border~ + b: 128, +** Processing line: ~ a: 80~ - Inside source: true *** True Line Result - args.outputs.primitives << [part[0]-1, part[1]-1, partsize+2, partsize+2, 255, 0, 0, alpha].border -** Processing line: ~ args.outputs.primitives << [part[0]-2, part[1]-2, partsize+4, partsize+4, 255, 0, 0, alpha].border~ + a: 80 +** Processing line: ~ }.line~ - Inside source: true *** True Line Result - args.outputs.primitives << [part[0]-2, part[1]-2, partsize+4, partsize+4, 255, 0, 0, alpha].border -** Processing line: ~ end~ + }.line +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def choose_target~ -- Inside source: true -*** True Line Result - def choose_target -** Processing line: ~ if @target.nil?~ +** Processing line: ~ (NOKIA_WIDTH + 1).map_with_index do |i|~ - Inside source: true *** True Line Result - if @target.nil? -** Processing line: ~ while !@raw_joysticks.empty?~ + (NOKIA_WIDTH + 1).map_with_index do |i| +** Processing line: ~ args.outputs.static_debug << {~ - Inside source: true *** True Line Result - while !@raw_joysticks.empty? -** Processing line: ~ t = @raw_joysticks.shift # see if there's a joystick waiting on us.~ + args.outputs.static_debug << { +** Processing line: ~ x: NOKIA_X_OFFSET + (i * NOKIA_ZOOM),~ - Inside source: true *** True Line Result - t = @raw_joysticks.shift # see if there's a joystick waiting on us. -** Processing line: ~ next if t[0] < 0 # just in case.~ + x: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), +** Processing line: ~ y: NOKIA_Y_OFFSET,~ - Inside source: true *** True Line Result - next if t[0] < 0 # just in case. -** Processing line: ~ next if t[1][:guid].nil? # did we already handle this guid? Dump it.~ + y: NOKIA_Y_OFFSET, +** Processing line: ~ x2: NOKIA_X_OFFSET + (i * NOKIA_ZOOM),~ - Inside source: true *** True Line Result - next if t[1][:guid].nil? # did we already handle this guid? Dump it. -** Processing line: ~ @target = t~ + x2: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), +** Processing line: ~ y2: NOKIA_Y_OFFSET + NOKIA_ZOOMED_HEIGHT,~ - Inside source: true *** True Line Result - @target = t -** Processing line: ~ break~ + y2: NOKIA_Y_OFFSET + NOKIA_ZOOMED_HEIGHT, +** Processing line: ~ r: 128,~ - Inside source: true *** True Line Result - break -** Processing line: ~ end~ + r: 128, +** Processing line: ~ g: 128,~ - Inside source: true *** True Line Result - end -** Processing line: ~ return false if @target.nil? # nothing to configure at the moment.~ + g: 128, +** Processing line: ~ b: 128,~ - Inside source: true *** True Line Result - return false if @target.nil? # nothing to configure at the moment. -** Processing line: ~ @toggled_at = Kernel.global_tick_count~ + b: 128, +** Processing line: ~ a: 80~ - Inside source: true *** True Line Result - @toggled_at = Kernel.global_tick_count -** Processing line: ~ @fading = 1~ + a: 80 +** Processing line: ~ }.line~ - Inside source: true *** True Line Result - @fading = 1 -** Processing line: ~ @current_part = 0~ + }.line +** Processing line: ~ end~ - Inside source: true *** True Line Result - @current_part = 0 -** Processing line: ~ @part_alpha = 0~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - @part_alpha = 0 -** Processing line: ~ @part_alpha_increment = 10~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @part_alpha_increment = 10 -** Processing line: ~ @joystick_state = {}~ + +** Processing line: ~ args.state.grid_rendered = true~ - Inside source: true *** True Line Result - @joystick_state = {} -** Processing line: ~ @used_bindings = {}~ + args.state.grid_rendered = true +** Processing line: ~~ - Inside source: true *** True Line Result - @used_bindings = {} -** Processing line: ~ @playing_around = false~ + +** Processing line: ~ args.state.last_click ||= 0~ - Inside source: true *** True Line Result - @playing_around = false -** Processing line: ~ @bindings = []~ + args.state.last_click ||= 0 +** Processing line: ~ args.state.last_up ||= 0~ - Inside source: true *** True Line Result - @bindings = [] -** Processing line: ~ end~ + args.state.last_up ||= 0 +** Processing line: ~ args.state.last_click = args.state.tick_count if args.nokia.mouse_down # you can also use args.nokia.click~ - Inside source: true *** True Line Result - end -** Processing line: ~ return true~ + args.state.last_click = args.state.tick_count if args.nokia.mouse_down # you can also use args.nokia.click +** Processing line: ~ args.state.last_up = args.state.tick_count if args.nokia.mouse_up~ - Inside source: true *** True Line Result - return true -** Processing line: ~ end~ + args.state.last_up = args.state.tick_count if args.nokia.mouse_up +** Processing line: ~ args.state.label_style = { size_enum: -1.5 }~ - Inside source: true *** True Line Result - end + args.state.label_style = { size_enum: -1.5 } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def render_part_highlight_from_bindstr args, bindstr, alpha=255~ -- Inside source: true -*** True Line Result - def render_part_highlight_from_bindstr args, bindstr, alpha=255 -** Processing line: ~ partidx = @used_bindings[bindstr]~ -- Inside source: true -*** True Line Result - partidx = @used_bindings[bindstr] -** Processing line: ~ return if partidx.nil?~ +** Processing line: ~ args.state.watch_list = [~ - Inside source: true *** True Line Result - return if partidx.nil? -** Processing line: ~ render_part_highlight args, @parts[partidx], alpha~ + args.state.watch_list = [ +** Processing line: ~ "args.state.tick_count is: #{args.state.tick_count}",~ - Inside source: true *** True Line Result - render_part_highlight args, @parts[partidx], alpha -** Processing line: ~ end~ + "args.state.tick_count is: #{args.state.tick_count}", +** Processing line: ~ "args.nokia.mouse_position is: #{args.nokia.mouse_position.x}, #{args.nokia.mouse_position.y}",~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + "args.nokia.mouse_position is: #{args.nokia.mouse_position.x}, #{args.nokia.mouse_position.y}", +** Processing line: ~ "args.nokia.mouse_down tick: #{args.state.last_click || "never"}",~ - Inside source: true *** True Line Result - -** Processing line: ~ def play_around args~ + "args.nokia.mouse_down tick: #{args.state.last_click || "never"}", +** Processing line: ~ "args.nokia.mouse_up tick: #{args.state.last_up || "false"}",~ - Inside source: true *** True Line Result - def play_around args -** Processing line: ~ return false if !@playing_around~ + "args.nokia.mouse_up tick: #{args.state.last_up || "false"}", +** Processing line: ~ ]~ - Inside source: true *** True Line Result - return false if !@playing_around + ] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if args.inputs.keyboard.key_down.escape~ +** Processing line: ~ args.outputs.debug << args.state~ - Inside source: true *** True Line Result - if args.inputs.keyboard.key_down.escape -** Processing line: ~ @current_part = 0~ + args.outputs.debug << args.state +** Processing line: ~ .watch_list~ - Inside source: true *** True Line Result - @current_part = 0 -** Processing line: ~ @part_alpha = 0~ + .watch_list +** Processing line: ~ .map_with_index do |text, i|~ - Inside source: true *** True Line Result - @part_alpha = 0 -** Processing line: ~ @part_alpha_increment = 10~ + .map_with_index do |text, i| +** Processing line: ~ {~ - Inside source: true *** True Line Result - @part_alpha_increment = 10 -** Processing line: ~ @used_bindings = {}~ + { +** Processing line: ~ x: 5,~ - Inside source: true *** True Line Result - @used_bindings = {} -** Processing line: ~ @playing_around = false~ + x: 5, +** Processing line: ~ y: 720 - (i * 18),~ - Inside source: true *** True Line Result - @playing_around = false -** Processing line: ~ @bindings = []~ + y: 720 - (i * 18), +** Processing line: ~ text: text,~ - Inside source: true *** True Line Result - @bindings = [] -** Processing line: ~ elsif args.inputs.keyboard.key_down.space~ + text: text, +** Processing line: ~ size_enum: -1.5,~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.space -** Processing line: ~ jid = @target[0]~ + size_enum: -1.5, +** Processing line: ~ r: 255, g: 255, b: 255~ - Inside source: true *** True Line Result - jid = @target[0] -** Processing line: ~ bindingstr = build_binding_string~ + r: 255, g: 255, b: 255 +** Processing line: ~ }.label~ - Inside source: true *** True Line Result - bindingstr = build_binding_string -** Processing line: ~ #puts("new controller binding: '#{bindingstr}'")~ + }.label +** Processing line: ~ end~ - Inside source: true *** True Line Result - #puts("new controller binding: '#{bindingstr}'") -** Processing line: ~ @runtime.ffi_misc.add_controller_config bindingstr~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @runtime.ffi_misc.add_controller_config bindingstr -** Processing line: ~ @runtime.ffi_misc.convert_rawjoystick_to_controller jid~ + +** Processing line: ~ args.outputs.debug << {~ - Inside source: true *** True Line Result - @runtime.ffi_misc.convert_rawjoystick_to_controller jid -** Processing line: ~ @target[0] = -1 # Conversion closes the raw joystick.~ + args.outputs.debug << { +** Processing line: ~ x: 640,~ - Inside source: true *** True Line Result - @target[0] = -1 # Conversion closes the raw joystick. -** Processing line: ~~ + x: 640, +** Processing line: ~ y: 25,~ - Inside source: true *** True Line Result - -** Processing line: ~ # Handle any other pending joysticks that have the same GUID (so if you plug in four of the same model, we're already done!)~ + y: 25, +** 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.",~ - Inside source: true *** True Line Result - # Handle any other pending joysticks that have the same GUID (so if you plug in four of the same model, we're already done!) -** Processing line: ~ guid = @target[1][:guid]~ + 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,~ - Inside source: true *** True Line Result - guid = @target[1][:guid] -** Processing line: ~ @raw_joysticks.each { |jid, details|~ + size_enum: -0.5, +** Processing line: ~ alignment_enum: 1,~ - Inside source: true *** True Line Result - @raw_joysticks.each { |jid, details| -** Processing line: ~ if details[:guid] == guid~ + alignment_enum: 1, +** Processing line: ~ r: 255, g: 255, b: 255~ - Inside source: true *** True Line Result - if details[:guid] == guid -** Processing line: ~ @runtime.ffi_misc.convert_rawjoystick_to_controller jid~ + r: 255, g: 255, b: 255 +** Processing line: ~ }.label~ - Inside source: true *** True Line Result - @runtime.ffi_misc.convert_rawjoystick_to_controller jid -** Processing line: ~ details[:guid] = nil~ + }.label +** Processing line: ~ end~ - Inside source: true *** True Line Result - details[:guid] = nil -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ }~ + +** Processing line: ~ def snake_demo args~ - Inside source: true *** True Line Result - } + def snake_demo args ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Done with this guy.~ -- Inside source: true -*** True Line Result - # Done with this guy. -** Processing line: ~ @playing_around = false~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - @playing_around = false -** Processing line: ~ @toggled_at = Kernel.global_tick_count~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @toggled_at = Kernel.global_tick_count -** Processing line: ~ @fading = -1~ + +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - @fading = -1 -** Processing line: ~ return false~ + $gtk.reset +** Processing line: ~~ - Inside source: true *** True Line Result - return false -** 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: ~ render_basics args, 'Now play around with the controller, and make sure it feels right!'~ -- Inside source: true +** Processing line: ~*** Lowrez - Nokia 3310 - nokia.rb~ +- Header detected. *** True Line Result - render_basics args, 'Now play around with the controller, and make sure it feels right!' -** Processing line: ~ args.outputs.primitives << [$gtk.logical_width / 2, 90, '[ESCAPE]: Reconfigure, [SPACE]: Save this configuration', 0, 1, 0, 0, 0, 255].label~ + +*** True Line Result +*** Lowrez - Nokia 3310 - nokia.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_lowrez/nokia_3310/app/nokia.rb~ - Inside source: true *** True Line Result - args.outputs.primitives << [$gtk.logical_width / 2, 90, '[ESCAPE]: Reconfigure, [SPACE]: Save this configuration', 0, 1, 0, 0, 0, 255].label -** Processing line: ~~ + # ./samples/99_genre_lowrez/nokia_3310/app/nokia.rb +** Processing line: ~ # Emulation of a 64x64 canvas. Don't change this file unless you know what you're doing :-)~ - Inside source: true *** True Line Result - -** Processing line: ~ axes = @joystick_state[:axes]~ + # Emulation of a 64x64 canvas. Don't change this file unless you know what you're doing :-) +** Processing line: ~ # Head over to main.rb and study the code there.~ - Inside source: true *** True Line Result - axes = @joystick_state[:axes] -** Processing line: ~ if !axes.nil?~ + # Head over to main.rb and study the code there. +** Processing line: ~~ - Inside source: true *** True Line Result - if !axes.nil? -** Processing line: ~ for i in 0..axes.length-1~ + +** Processing line: ~ NOKIA_WIDTH = 84~ - Inside source: true *** True Line Result - for i in 0..axes.length-1 -** Processing line: ~ next if axes[i].nil?~ + NOKIA_WIDTH = 84 +** Processing line: ~ NOKIA_HEIGHT = 48~ - Inside source: true *** True Line Result - next if axes[i].nil? -** Processing line: ~ value = axes[i][:currentval]~ + NOKIA_HEIGHT = 48 +** Processing line: ~ NOKIA_ZOOM = 12~ - Inside source: true *** True Line Result - value = axes[i][:currentval] -** Processing line: ~ next if value.nil? || (value.abs < 16000)~ + NOKIA_ZOOM = 12 +** Processing line: ~ NOKIA_ZOOMED_WIDTH = NOKIA_WIDTH * NOKIA_ZOOM~ - Inside source: true *** True Line Result - next if value.nil? || (value.abs < 16000) -** Processing line: ~ render_part_highlight_from_bindstr args, "#{value < 0 ? '-' : '+'}a#{i}"~ + NOKIA_ZOOMED_WIDTH = NOKIA_WIDTH * NOKIA_ZOOM +** Processing line: ~ NOKIA_ZOOMED_HEIGHT = NOKIA_HEIGHT * NOKIA_ZOOM~ - Inside source: true *** True Line Result - render_part_highlight_from_bindstr args, "#{value < 0 ? '-' : '+'}a#{i}" -** Processing line: ~ end~ + NOKIA_ZOOMED_HEIGHT = NOKIA_HEIGHT * NOKIA_ZOOM +** Processing line: ~ NOKIA_X_OFFSET = (1280 - NOKIA_ZOOMED_WIDTH).half~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + NOKIA_X_OFFSET = (1280 - NOKIA_ZOOMED_WIDTH).half +** Processing line: ~ NOKIA_Y_OFFSET = ( 720 - NOKIA_ZOOMED_HEIGHT).half~ - Inside source: true *** True Line Result - end + NOKIA_Y_OFFSET = ( 720 - NOKIA_ZOOMED_HEIGHT).half ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ hats = @joystick_state[:hats]~ +** Processing line: ~ NOKIA_FONT_XL = -1~ - Inside source: true *** True Line Result - hats = @joystick_state[:hats] -** Processing line: ~ if !hats.nil?~ + NOKIA_FONT_XL = -1 +** Processing line: ~ NOKIA_FONT_XL_HEIGHT = 20~ - Inside source: true *** True Line Result - if !hats.nil? -** Processing line: ~ for i in 0..hats.length-1~ + NOKIA_FONT_XL_HEIGHT = 20 +** Processing line: ~~ - Inside source: true *** True Line Result - for i in 0..hats.length-1 -** Processing line: ~ value = hats[i]~ + +** Processing line: ~ NOKIA_FONT_LG = -3.5~ - Inside source: true *** True Line Result - value = hats[i] -** Processing line: ~ next if value.nil? || (value == 0)~ + NOKIA_FONT_LG = -3.5 +** Processing line: ~ NOKIA_FONT_LG_HEIGHT = 15~ - Inside source: true *** True Line Result - next if value.nil? || (value == 0) -** Processing line: ~ render_part_highlight_from_bindstr args, "h#{i}.#{value}"~ + NOKIA_FONT_LG_HEIGHT = 15 +** Processing line: ~~ - Inside source: true *** True Line Result - render_part_highlight_from_bindstr args, "h#{i}.#{value}" -** Processing line: ~ end~ + +** Processing line: ~ NOKIA_FONT_MD = -6~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + NOKIA_FONT_MD = -6 +** Processing line: ~ NOKIA_FONT_MD_HEIGHT = 10~ - Inside source: true *** True Line Result - end + NOKIA_FONT_MD_HEIGHT = 10 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ buttons = @joystick_state[:buttons]~ +** Processing line: ~ NOKIA_FONT_SM = -8.5~ - Inside source: true *** True Line Result - buttons = @joystick_state[:buttons] -** Processing line: ~ if !buttons.nil?~ + NOKIA_FONT_SM = -8.5 +** Processing line: ~ NOKIA_FONT_SM_HEIGHT = 5~ - Inside source: true *** True Line Result - if !buttons.nil? -** Processing line: ~ for i in 0..buttons.length-1~ + NOKIA_FONT_SM_HEIGHT = 5 +** Processing line: ~~ - Inside source: true *** True Line Result - for i in 0..buttons.length-1 -** Processing line: ~ value = buttons[i]~ + +** Processing line: ~ NOKIA_FONT_PATH = 'fonts/lowrez.ttf'~ - Inside source: true *** True Line Result - value = buttons[i] -** Processing line: ~ next if value.nil? || !value~ + NOKIA_FONT_PATH = 'fonts/lowrez.ttf' +** Processing line: ~~ - Inside source: true *** True Line Result - next if value.nil? || !value -** Processing line: ~ render_part_highlight_from_bindstr args, "b#{i}"~ + +** Processing line: ~~ - Inside source: true *** True Line Result - render_part_highlight_from_bindstr args, "b#{i}" -** Processing line: ~ end~ + +** Processing line: ~ class NokiaOutputs~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + class NokiaOutputs +** Processing line: ~ attr_accessor :width, :height~ - Inside source: true *** True Line Result - end + attr_accessor :width, :height ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return true~ +** Processing line: ~ def initialize args~ - Inside source: true *** True Line Result - return true -** Processing line: ~ end~ + def initialize args +** Processing line: ~ @args = args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + @args = args +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def should_tick?~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def should_tick? -** Processing line: ~ return true if @play_around~ + +** Processing line: ~ def outputs_nokia~ - Inside source: true *** True Line Result - return true if @play_around -** Processing line: ~ return true if @target~ + def outputs_nokia +** Processing line: ~ return @args.outputs if @args.state.tick_count <= 0~ - Inside source: true *** True Line Result - return true if @target -** Processing line: ~ return false~ + return @args.outputs if @args.state.tick_count <= 0 +** Processing line: ~ return @args.outputs[:nokia]~ - Inside source: true *** True Line Result - return false -** Processing line: ~ end~ + return @args.outputs[:nokia] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def tick args~ +** Processing line: ~ def solids~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ return true if play_around args~ + def solids +** Processing line: ~ outputs_nokia.solids~ - Inside source: true *** True Line Result - return true if play_around args -** Processing line: ~ return false if !choose_target~ + outputs_nokia.solids +** Processing line: ~ end~ - Inside source: true *** True Line Result - return false if !choose_target + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ jid = @target[0]~ +** Processing line: ~ def borders~ - Inside source: true *** True Line Result - jid = @target[0] -** Processing line: ~~ + def borders +** Processing line: ~ outputs_nokia.borders~ - Inside source: true *** True Line Result - -** Processing line: ~ if @fading == 0~ + outputs_nokia.borders +** Processing line: ~ end~ - Inside source: true *** True Line Result - if @fading == 0 -** Processing line: ~ # Cancel config?~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # Cancel config? -** Processing line: ~ if args.inputs.keyboard.key_down.escape~ + +** Processing line: ~ def sprites~ - Inside source: true *** True Line Result - if args.inputs.keyboard.key_down.escape -** Processing line: ~ # !!! FIXME: prompt to ignore this joystick forever or just this run~ + def sprites +** Processing line: ~ outputs_nokia.sprites~ - Inside source: true *** True Line Result - # !!! FIXME: prompt to ignore this joystick forever or just this run -** Processing line: ~ @toggled_at = Kernel.global_tick_count~ + outputs_nokia.sprites +** Processing line: ~ end~ - Inside source: true *** True Line Result - @toggled_at = Kernel.global_tick_count -** Processing line: ~ @fading = -1~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @fading = -1 -** Processing line: ~ end~ + +** Processing line: ~ def labels~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def labels +** Processing line: ~ outputs_nokia.labels~ - Inside source: true *** True Line Result - end + outputs_nokia.labels +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if @fading == 0~ +** Processing line: ~ def default_label~ - Inside source: true *** True Line Result - if @fading == 0 -** Processing line: ~ if args.inputs.keyboard.key_down.backspace~ + def default_label +** Processing line: ~ {~ - Inside source: true *** True Line Result - if args.inputs.keyboard.key_down.backspace -** Processing line: ~ previous_part~ + { +** Processing line: ~ x: 0,~ - Inside source: true *** True Line Result - previous_part -** Processing line: ~ elsif args.inputs.keyboard.key_down.space~ + x: 0, +** Processing line: ~ y: 63,~ - Inside source: true *** True Line Result - elsif args.inputs.keyboard.key_down.space -** Processing line: ~ next_part~ + y: 63, +** Processing line: ~ text: "",~ - Inside source: true *** True Line Result - next_part -** Processing line: ~ end~ + text: "", +** Processing line: ~ size_enum: NOKIA_FONT_SM,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + size_enum: NOKIA_FONT_SM, +** Processing line: ~ alignment_enum: 0,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + alignment_enum: 0, +** Processing line: ~ r: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ fade = calc_fading~ + r: 0, +** Processing line: ~ g: 0,~ - Inside source: true *** True Line Result - fade = calc_fading -** Processing line: ~ if (@fading < 0) && (fade == 0)~ + g: 0, +** Processing line: ~ b: 0,~ - Inside source: true *** True Line Result - if (@fading < 0) && (fade == 0) -** Processing line: ~ @runtime.ffi_misc.close_raw_joystick(jid) if jid >= 0~ + b: 0, +** Processing line: ~ a: 255,~ - Inside source: true *** True Line Result - @runtime.ffi_misc.close_raw_joystick(jid) if jid >= 0 -** Processing line: ~ @target = nil # done with this controller~ + a: 255, +** Processing line: ~ font: NOKIA_FONT_PATH~ - Inside source: true *** True Line Result - @target = nil # done with this controller -** Processing line: ~ return false~ + font: NOKIA_FONT_PATH +** Processing line: ~ }~ - Inside source: true *** True Line Result - return false -** Processing line: ~ end~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ render_basics args, (@fading >= 0) ? "We don't recognize this controller, so tell us about it!" : '', fade~ +** Processing line: ~ def lines~ - Inside source: true *** True Line Result - render_basics args, (@fading >= 0) ? "We don't recognize this controller, so tell us about it!" : '', fade -** Processing line: ~~ + def lines +** Processing line: ~ outputs_nokia.lines~ - Inside source: true *** True Line Result - -** Processing line: ~ return true if fade < 255 # all done for now~ + outputs_nokia.lines +** Processing line: ~ end~ - Inside source: true *** True Line Result - return true if fade < 255 # all done for now + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ part = @parts[@current_part]~ -- Inside source: true -*** True Line Result - part = @parts[@current_part] -** Processing line: ~ args.outputs.primitives << [$gtk.logical_width / 2, 575, "Please press the #{part[2]}.", 0, 1, 0, 0, 0, 255].label~ +** Processing line: ~ def primitives~ - Inside source: true *** True Line Result - args.outputs.primitives << [$gtk.logical_width / 2, 575, "Please press the #{part[2]}.", 0, 1, 0, 0, 0, 255].label -** Processing line: ~ render_part_highlight args, part, @part_alpha~ + def primitives +** Processing line: ~ outputs_nokia.primitives~ - Inside source: true *** True Line Result - render_part_highlight args, part, @part_alpha -** Processing line: ~ args.outputs.primitives << [$gtk.logical_width / 2, 90, '[ESCAPE]: Ignore controller, [BACKSPACE]: Go back one button, [SPACE]: Skip this button', 0, 1, 0, 0, 0, 255].label~ + outputs_nokia.primitives +** Processing line: ~ end~ - Inside source: true *** True Line Result - args.outputs.primitives << [$gtk.logical_width / 2, 90, '[ESCAPE]: Ignore controller, [BACKSPACE]: Go back one button, [SPACE]: Skip this button', 0, 1, 0, 0, 0, 255].label + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @part_alpha += @part_alpha_increment~ +** Processing line: ~ def click~ - Inside source: true *** True Line Result - @part_alpha += @part_alpha_increment -** Processing line: ~ if (@part_alpha_increment > 0) && (@part_alpha >= 255)~ + def click +** Processing line: ~ return nil unless @args.inputs.mouse.click~ - Inside source: true *** True Line Result - if (@part_alpha_increment > 0) && (@part_alpha >= 255) -** Processing line: ~ @part_alpha = 255~ + return nil unless @args.inputs.mouse.click +** Processing line: ~ mouse~ - Inside source: true *** True Line Result - @part_alpha = 255 -** Processing line: ~ @part_alpha_increment = -10~ + mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - @part_alpha_increment = -10 -** Processing line: ~ elsif (@part_alpha_increment < 0) && (@part_alpha <= 0)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif (@part_alpha_increment < 0) && (@part_alpha <= 0) -** Processing line: ~ @part_alpha = 0~ + +** Processing line: ~ def mouse_click~ - Inside source: true *** True Line Result - @part_alpha = 0 -** Processing line: ~ @part_alpha_increment = 10~ + def mouse_click +** Processing line: ~ click~ - Inside source: true *** True Line Result - @part_alpha_increment = 10 -** Processing line: ~ end~ + click +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ return true~ -- Inside source: true -*** True Line Result - return true -** Processing line: ~ end~ +** Processing line: ~ def mouse_down~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def mouse_down +** Processing line: ~ @args.inputs.mouse.down~ - Inside source: true *** True Line Result - end + @args.inputs.mouse.down ** 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. +** Processing line: ~ def mouse_up~ +- Inside source: true *** True Line Result -#+end_src + def mouse_up +** Processing line: ~ @args.inputs.mouse.up~ +- Inside source: true +*** True Line Result + @args.inputs.mouse.up +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* controller/keys.rb~ -- Header detected. +** Processing line: ~ def mouse~ +- Inside source: true *** True Line Result - + def mouse +** Processing line: ~ [~ +- Inside source: true *** True Line Result -* controller/keys.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + [ +** Processing line: ~ ((@args.inputs.mouse.x - NOKIA_X_OFFSET).idiv(NOKIA_ZOOM)),~ +- Inside source: true *** True Line Result - + ((@args.inputs.mouse.x - NOKIA_X_OFFSET).idiv(NOKIA_ZOOM)), +** Processing line: ~ ((@args.inputs.mouse.y - NOKIA_Y_OFFSET).idiv(NOKIA_ZOOM))~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/controller/keys.rb~ + ((@args.inputs.mouse.y - NOKIA_Y_OFFSET).idiv(NOKIA_ZOOM)) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - # ./dragon/controller/keys.rb -** Processing line: ~ # coding: utf-8~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + +** Processing line: ~ def mouse_position~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # controller/keys.rb has been released under MIT (*only this file*).~ + def mouse_position +** Processing line: ~ mouse~ - Inside source: true *** True Line Result - # controller/keys.rb has been released under MIT (*only this file*). + mouse +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ def keyboard~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Controller~ + def keyboard +** Processing line: ~ @args.inputs.keyboard~ - Inside source: true *** True Line Result - class Controller -** Processing line: ~ class Keys~ + @args.inputs.keyboard +** Processing line: ~ end~ - Inside source: true *** True Line Result - class Keys -** Processing line: ~ include Serialize~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - include Serialize + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ LABELS = [~ +** Processing line: ~ class GTK::Args~ - Inside source: true *** True Line Result - LABELS = [ -** Processing line: ~ :up, :down, :left, :right,~ + class GTK::Args +** Processing line: ~ def init_nokia~ - Inside source: true *** True Line Result - :up, :down, :left, :right, -** Processing line: ~ :a, :b, :x, :y,~ + def init_nokia +** Processing line: ~ return if @nokia~ - Inside source: true *** True Line Result - :a, :b, :x, :y, -** Processing line: ~ :l1, :r1,~ + return if @nokia +** Processing line: ~ @nokia = NokiaOutputs.new self~ - Inside source: true *** True Line Result - :l1, :r1, -** Processing line: ~ :l2, :r2,~ + @nokia = NokiaOutputs.new self +** Processing line: ~ end~ - Inside source: true *** True Line Result - :l2, :r2, -** Processing line: ~ :l3, :r3,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - :l3, :r3, -** Processing line: ~ :start, :select,~ + +** Processing line: ~ def nokia~ - Inside source: true *** True Line Result - :start, :select, -** Processing line: ~ :directional_up, :directional_down, :directional_left, :directional_right~ + def nokia +** Processing line: ~ @nokia~ - Inside source: true *** True Line Result - :directional_up, :directional_down, :directional_left, :directional_right -** Processing line: ~ ].freeze~ + @nokia +** Processing line: ~ end~ - Inside source: true *** True Line Result - ].freeze + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ LABELS.each do |label|~ +** Processing line: ~ module GTK~ - Inside source: true *** True Line Result - LABELS.each do |label| -** Processing line: ~ attr_reader label~ + module GTK +** Processing line: ~ class Runtime~ - Inside source: true *** True Line Result - attr_reader label -** Processing line: ~ end~ + class Runtime +** Processing line: ~ alias_method :__original_tick_core__, :tick_core unless Runtime.instance_methods.include?(:__original_tick_core__)~ - Inside source: true *** True Line Result - end + alias_method :__original_tick_core__, :tick_core unless Runtime.instance_methods.include?(:__original_tick_core__) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Activate a key.~ +** Processing line: ~ def tick_core~ - Inside source: true *** True Line Result - # Activate a key. -** Processing line: ~ #~ + def tick_core +** Processing line: ~ @args.init_nokia~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [void]~ + @args.init_nokia +** Processing line: ~~ - Inside source: true *** True Line Result - # @return [void] -** Processing line: ~ def activate key~ + +** Processing line: ~ __original_tick_core__~ - Inside source: true *** True Line Result - def activate key -** Processing line: ~ instance_variable_set("@#{key}", Kernel.tick_count + 1)~ + __original_tick_core__ +** Processing line: ~~ - Inside source: true *** True Line Result - instance_variable_set("@#{key}", Kernel.tick_count + 1) -** Processing line: ~ end~ + +** Processing line: ~ return if @args.state.tick_count <= 0~ - Inside source: true *** True Line Result - end + return if @args.state.tick_count <= 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Deactivate a key.~ +** Processing line: ~ @args.render_target(:nokia)~ - Inside source: true *** True Line Result - # Deactivate a key. -** Processing line: ~ #~ + @args.render_target(:nokia) +** Processing line: ~ .labels~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [void]~ + .labels +** Processing line: ~ .each do |l|~ - Inside source: true *** True Line Result - # @return [void] -** Processing line: ~ def deactivate key~ + .each do |l| +** Processing line: ~ l.y += 1~ - Inside source: true *** True Line Result - def deactivate key -** Processing line: ~ instance_variable_set("@#{key}", nil)~ + l.y += 1 +** Processing line: ~ if (l.a || 255) > 128~ - Inside source: true *** True Line Result - instance_variable_set("@#{key}", nil) -** Processing line: ~ end~ + if (l.a || 255) > 128 +** Processing line: ~ l.r = 67~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + l.r = 67 +** Processing line: ~ l.g = 82~ - Inside source: true *** True Line Result - -** Processing line: ~ # Clear all key inputs.~ + l.g = 82 +** Processing line: ~ l.b = 61~ - Inside source: true *** True Line Result - # Clear all key inputs. -** Processing line: ~ #~ + l.b = 61 +** Processing line: ~ l.a = 255~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [void]~ + l.a = 255 +** Processing line: ~ else~ - Inside source: true *** True Line Result - # @return [void] -** Processing line: ~ def clear~ + else +** Processing line: ~ l.a = 0~ - Inside source: true *** True Line Result - def clear -** Processing line: ~ LABELS.each { |label| deactivate(label) }~ + l.a = 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - LABELS.each { |label| deactivate(label) } + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -99219,370 +103204,378 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def truthy_keys~ +** Processing line: ~ @args.render_target(:nokia)~ - Inside source: true *** True Line Result - def truthy_keys -** Processing line: ~ LABELS.select { |label| send(label) }~ + @args.render_target(:nokia) +** Processing line: ~ .sprites~ - Inside source: true *** True Line Result - LABELS.select { |label| send(label) } -** Processing line: ~ end~ + .sprites +** Processing line: ~ .each do |s|~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + .each do |s| +** Processing line: ~ if (s.a || 255) > 128~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + if (s.a || 255) > 128 +** Processing line: ~ s.a = 255~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + s.a = 255 +** Processing line: ~ else~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + else +** Processing line: ~ s.a = 0~ - 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: ~* directional_input_helper_methods.rb~ -- Header detected. + s.a = 0 +** Processing line: ~ end~ +- Inside source: true *** True Line Result - + end +** Processing line: ~ end~ +- Inside source: true *** True Line Result -* directional_input_helper_methods.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + end +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ @args.render_target(:nokia)~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/directional_input_helper_methods.rb~ + @args.render_target(:nokia) +** Processing line: ~ .solids~ - Inside source: true *** True Line Result - # ./dragon/directional_input_helper_methods.rb -** Processing line: ~ # coding: utf-8~ + .solids +** Processing line: ~ .each do |s|~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + .each do |s| +** Processing line: ~ if (s.a || 255) > 128~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + if (s.a || 255) > 128 +** Processing line: ~ s.r = 67~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # directional_input_helper_methods.rb has been released under MIT (*only this file*).~ + s.r = 67 +** Processing line: ~ s.g = 82~ - Inside source: true *** True Line Result - # directional_input_helper_methods.rb has been released under MIT (*only this file*). -** Processing line: ~~ + s.g = 82 +** Processing line: ~ s.b = 61~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + s.b = 61 +** Processing line: ~ s.a = 255~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ # This is a module that contains normalization of behavior related to `up`|`down`|`left`|`right` on keyboards and controllers.~ + s.a = 255 +** Processing line: ~ else~ - Inside source: true *** True Line Result - # This is a module that contains normalization of behavior related to `up`|`down`|`left`|`right` on keyboards and controllers. -** Processing line: ~ module DirectionalInputHelperMethods~ + else +** Processing line: ~ s.a = 0~ - Inside source: true *** True Line Result - module DirectionalInputHelperMethods -** Processing line: ~ def self.included klass~ + s.a = 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - def self.included klass -** Processing line: ~ key_state_methods = [:key_held, :key_down]~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - key_state_methods = [:key_held, :key_down] -** Processing line: ~ directional_methods = [:up, :down, :left, :right]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - directional_methods = [:up, :down, :left, :right] -** Processing line: ~ method_results = (directional_methods + key_state_methods).map {|m| [m, klass.instance_methods.include?(m)] }~ + +** Processing line: ~ @args.render_target(:nokia)~ - Inside source: true *** True Line Result - method_results = (directional_methods + key_state_methods).map {|m| [m, klass.instance_methods.include?(m)] } -** Processing line: ~~ + @args.render_target(:nokia) +** Processing line: ~ .borders~ - Inside source: true *** True Line Result - -** Processing line: ~ error_message = <<-S~ + .borders +** Processing line: ~ .each do |s|~ - Inside source: true *** True Line Result - error_message = <<-S -** Processing line: ~ * ERROR~ + .each do |s| +** Processing line: ~ if (s.a || 255) > 128~ - 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:~ + if (s.a || 255) > 128 +** Processing line: ~ s.r = 67~ - Inside source: true *** True Line Result - The GTK::DirectionalKeys module should only be included in objects that respond to the following api heirarchy: -** Processing line: ~~ + s.r = 67 +** Processing line: ~ s.g = 82~ - Inside source: true *** True Line Result - -** Processing line: ~ - (#{ directional_methods.join("|") })~ + s.g = 82 +** Processing line: ~ s.b = 61~ - Inside source: true *** True Line Result - - (#{ directional_methods.join("|") }) -** Processing line: ~ - key_held.(#{ directional_methods.join("|") })~ + s.b = 61 +** Processing line: ~ s.a = 255~ - Inside source: true *** True Line Result - - key_held.(#{ directional_methods.join("|") }) -** Processing line: ~ - key_down.(#{ directional_methods.join("|") })~ + s.a = 255 +** Processing line: ~ else~ - Inside source: true *** True Line Result - - key_down.(#{ directional_methods.join("|") }) -** Processing line: ~~ + else +** Processing line: ~ s.a = 0~ - Inside source: true *** True Line Result - -** Processing line: ~ #{klass} does not respond to all of these methods (here is the diagnostics):~ + s.a = 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - #{klass} does not respond to all of these methods (here is the diagnostics): -** Processing line: ~ #{method_results.map {|m, r| "- #{m}: #{r}"}.join("\n")}~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - #{method_results.map {|m, r| "- #{m}: #{r}"}.join("\n")} + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Please implement the methods that returned false inthe list above.~ +** Processing line: ~ @args.render_target(:nokia)~ - Inside source: true *** True Line Result - Please implement the methods that returned false inthe list above. -** Processing line: ~ S~ + @args.render_target(:nokia) +** Processing line: ~ .lines~ - Inside source: true *** True Line Result - S -** Processing line: ~ unless method_results.map {|m, result| result}.all?~ + .lines +** Processing line: ~ .each do |l|~ - Inside source: true *** True Line Result - unless method_results.map {|m, result| result}.all? -** Processing line: ~ raise error_message~ + .each do |l| +** Processing line: ~ l.y += 1~ - Inside source: true *** True Line Result - raise error_message -** Processing line: ~ end~ + l.y += 1 +** Processing line: ~ l.y2 += 1~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + l.y2 += 1 +** Processing line: ~ l.y2 += 1 if l.y1 != l.y2~ - Inside source: true *** True Line Result - end + l.y2 += 1 if l.y1 != l.y2 +** Processing line: ~ l.x2 += 1 if l.x1 != l.x2~ +- Inside source: true +*** True Line Result + l.x2 += 1 if l.x1 != l.x2 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns a signal indicating left (`-1`), right (`1`), or neither ('0').~ +** Processing line: ~ if (l.a || 255) > 128~ - Inside source: true *** True Line Result - # Returns a signal indicating left (`-1`), right (`1`), or neither ('0'). -** Processing line: ~ #~ + if (l.a || 255) > 128 +** Processing line: ~ l.r = 67~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Integer]~ + l.r = 67 +** Processing line: ~ l.g = 82~ - Inside source: true *** True Line Result - # @return [Integer] -** Processing line: ~ def left_right~ + l.g = 82 +** Processing line: ~ l.b = 61~ - Inside source: true *** True Line Result - def left_right -** Processing line: ~ return -1 if self.left~ + l.b = 61 +** Processing line: ~ l.a = 255~ - Inside source: true *** True Line Result - return -1 if self.left -** Processing line: ~ return 1 if self.right~ + l.a = 255 +** Processing line: ~ else~ - Inside source: true *** True Line Result - return 1 if self.right -** Processing line: ~ return 0~ + else +** Processing line: ~ l.a = 0~ - Inside source: true *** True Line Result - return 0 -** Processing line: ~ end~ + l.a = 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns a signal indicating up (`1`), down (`-1`), or neither ('0').~ +** Processing line: ~ @args.outputs.borders << {~ - Inside source: true *** True Line Result - # Returns a signal indicating up (`1`), down (`-1`), or neither ('0'). -** Processing line: ~ #~ + @args.outputs.borders << { +** Processing line: ~ x: NOKIA_X_OFFSET - 1,~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Integer]~ + x: NOKIA_X_OFFSET - 1, +** Processing line: ~ y: NOKIA_Y_OFFSET - 1,~ - Inside source: true *** True Line Result - # @return [Integer] -** Processing line: ~ def up_down~ + y: NOKIA_Y_OFFSET - 1, +** Processing line: ~ w: NOKIA_ZOOMED_WIDTH + 2,~ - Inside source: true *** True Line Result - def up_down -** Processing line: ~ return 1 if self.up~ + w: NOKIA_ZOOMED_WIDTH + 2, +** Processing line: ~ h: NOKIA_ZOOMED_HEIGHT + 2,~ - Inside source: true *** True Line Result - return 1 if self.up -** Processing line: ~ return -1 if self.down~ + h: NOKIA_ZOOMED_HEIGHT + 2, +** Processing line: ~ r: 128, g: 128, b: 128~ - Inside source: true *** True Line Result - return -1 if self.down -** Processing line: ~ return 0~ + r: 128, g: 128, b: 128 +** Processing line: ~ }~ - Inside source: true *** True Line Result - return 0 -** Processing line: ~ end~ + } +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns a normal vector (in the form of an Array with two values). If no directionals are held/down, the function returns nil.~ +** Processing line: ~ @args.outputs.background_color = [199, 240, 216]~ - Inside source: true *** True Line Result - # Returns a normal vector (in the form of an Array with two values). If no directionals are held/down, the function returns nil. -** Processing line: ~ #~ + @args.outputs.background_color = [199, 240, 216] +** Processing line: ~~ - Inside source: true *** True Line Result - # -** Processing line: ~ # The possible results are:~ + +** Processing line: ~ @args.outputs.solids << [0, 0, NOKIA_X_OFFSET, 720]~ - Inside source: true *** True Line Result - # The possible results are: -** Processing line: ~ #~ + @args.outputs.solids << [0, 0, NOKIA_X_OFFSET, 720] +** Processing line: ~ @args.outputs.solids << [0, 0, 1280, NOKIA_Y_OFFSET]~ - Inside source: true *** True Line Result - # -** Processing line: ~ # - ~nil~ which denotes that no directional input exists.~ + @args.outputs.solids << [0, 0, 1280, NOKIA_Y_OFFSET] +** Processing line: ~ @args.outputs.solids << [NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH, 0, NOKIA_X_OFFSET, 720]~ - Inside source: true *** True Line Result - # - ~nil~ which denotes that no directional input exists. -** Processing line: ~ # - ~[ 0, 1]~ which denotes that only up is being held/pressed.~ + @args.outputs.solids << [NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH, 0, NOKIA_X_OFFSET, 720] +** Processing line: ~ @args.outputs.solids << [0, NOKIA_Y_OFFSET.from_top, 1280, NOKIA_Y_OFFSET]~ - Inside source: true *** True Line Result - # - ~[ 0, 1]~ which denotes that only up is being held/pressed. -** Processing line: ~ # - ~[ 0, -1]~ which denotes that only down is being held/pressed.~ + @args.outputs.solids << [0, NOKIA_Y_OFFSET.from_top, 1280, NOKIA_Y_OFFSET] +** Processing line: ~~ - Inside source: true *** True Line Result - # - ~[ 0, -1]~ which denotes that only down is being held/pressed. -** Processing line: ~ # - ~[ 0.5, 0.5]~ which denotes that right and up are being pressed/held.~ + +** Processing line: ~ @args.outputs~ - Inside source: true *** True Line Result - # - ~[ 0.5, 0.5]~ which denotes that right and up are being pressed/held. -** Processing line: ~ # - ~[-0.5, -0.5]~ which denotes that left and down are being pressed/held.~ + @args.outputs +** Processing line: ~ .sprites << { x: NOKIA_X_OFFSET,~ - Inside source: true *** True Line Result - # - ~[-0.5, -0.5]~ which denotes that left and down are being pressed/held. -** Processing line: ~ #~ + .sprites << { x: NOKIA_X_OFFSET, +** Processing line: ~ y: NOKIA_Y_OFFSET,~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + y: NOKIA_Y_OFFSET, +** Processing line: ~ w: NOKIA_ZOOMED_WIDTH,~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def directional_vector~ + w: NOKIA_ZOOMED_WIDTH, +** Processing line: ~ h: NOKIA_ZOOMED_HEIGHT,~ - Inside source: true *** True Line Result - def directional_vector -** Processing line: ~ lr, ud = [self.left_right, self.up_down]~ + h: NOKIA_ZOOMED_HEIGHT, +** Processing line: ~ source_x: 0,~ - Inside source: true *** True Line Result - lr, ud = [self.left_right, self.up_down] -** Processing line: ~~ + source_x: 0, +** Processing line: ~ source_y: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ if lr == 0 && ud == 0~ + source_y: 0, +** Processing line: ~ source_w: NOKIA_WIDTH,~ - Inside source: true *** True Line Result - if lr == 0 && ud == 0 -** Processing line: ~ return nil~ + source_w: NOKIA_WIDTH, +** Processing line: ~ source_h: NOKIA_HEIGHT,~ - Inside source: true *** True Line Result - return nil -** Processing line: ~ elsif lr.abs == ud.abs~ + source_h: NOKIA_HEIGHT, +** Processing line: ~ path: :nokia }~ - Inside source: true *** True Line Result - elsif lr.abs == ud.abs -** Processing line: ~ return [lr.half, ud.half]~ + path: :nokia } +** Processing line: ~~ - Inside source: true *** True Line Result - return [lr.half, ud.half] -** Processing line: ~ else~ + +** Processing line: ~ if !@args.state.overlay_rendered~ - Inside source: true *** True Line Result - else -** Processing line: ~ return [lr, ud]~ + if !@args.state.overlay_rendered +** Processing line: ~ (NOKIA_HEIGHT + 1).map_with_index do |i|~ - Inside source: true *** True Line Result - return [lr, ud] -** Processing line: ~ end~ + (NOKIA_HEIGHT + 1).map_with_index do |i| +** Processing line: ~ @args.outputs.static_lines << {~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + @args.outputs.static_lines << { +** Processing line: ~ x: NOKIA_X_OFFSET,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x: NOKIA_X_OFFSET, +** Processing line: ~ y: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM),~ - Inside source: true *** True Line Result - -** Processing line: ~ def method_missing m, *args~ + y: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), +** Processing line: ~ x2: NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH,~ - Inside source: true *** True Line Result - def method_missing m, *args -** Processing line: ~ # combine the key with ctrl_~ + x2: NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH, +** Processing line: ~ y2: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM),~ - Inside source: true *** True Line Result - # combine the key with ctrl_ -** Processing line: ~ if m.to_s.start_with?("ctrl_")~ + y2: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), +** Processing line: ~ r: 199,~ - Inside source: true *** True Line Result - if m.to_s.start_with?("ctrl_") -** Processing line: ~ other_key = m.to_s.split("_").last~ + r: 199, +** Processing line: ~ g: 240,~ - Inside source: true *** True Line Result - other_key = m.to_s.split("_").last -** Processing line: ~ define_singleton_method(m) do~ + g: 240, +** Processing line: ~ b: 216,~ - Inside source: true *** True Line Result - define_singleton_method(m) do -** Processing line: ~ return self.key_up.send(other_key.to_sym) && self.key_up.control~ + b: 216, +** Processing line: ~ a: 100~ - Inside source: true *** True Line Result - return self.key_up.send(other_key.to_sym) && self.key_up.control + a: 100 +** Processing line: ~ }.line~ +- Inside source: true +*** True Line Result + }.line ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -99591,26 +103584,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ return send(m)~ +** Processing line: ~ (NOKIA_WIDTH + 1).map_with_index do |i|~ - Inside source: true *** True Line Result - return send(m) -** Processing line: ~ else~ + (NOKIA_WIDTH + 1).map_with_index do |i| +** Processing line: ~ @args.outputs.static_lines << {~ - Inside source: true *** True Line Result - else -** Processing line: ~ # see if the key is either held or down~ + @args.outputs.static_lines << { +** Processing line: ~ x: NOKIA_X_OFFSET + (i * NOKIA_ZOOM),~ - Inside source: true *** True Line Result - # see if the key is either held or down -** Processing line: ~ define_singleton_method(m) do~ + x: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), +** Processing line: ~ y: NOKIA_Y_OFFSET,~ - Inside source: true *** True Line Result - define_singleton_method(m) do -** Processing line: ~ self.key_down.send(m) || self.key_held.send(m)~ + y: NOKIA_Y_OFFSET, +** Processing line: ~ x2: NOKIA_X_OFFSET + (i * NOKIA_ZOOM),~ - Inside source: true *** True Line Result - self.key_down.send(m) || self.key_held.send(m) + x2: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), +** Processing line: ~ y2: NOKIA_Y_OFFSET + NOKIA_ZOOMED_HEIGHT,~ +- Inside source: true +*** True Line Result + y2: NOKIA_Y_OFFSET + NOKIA_ZOOMED_HEIGHT, +** Processing line: ~ r: 199,~ +- Inside source: true +*** True Line Result + r: 199, +** Processing line: ~ g: 240,~ +- Inside source: true +*** True Line Result + g: 240, +** Processing line: ~ b: 216,~ +- Inside source: true +*** True Line Result + b: 216, +** Processing line: ~ a: 100~ +- Inside source: true +*** True Line Result + a: 100 +** Processing line: ~ }.line~ +- Inside source: true +*** True Line Result + }.line ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -99619,10 +103636,10 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ return send(m)~ +** Processing line: ~ @args.state.overlay_rendered = true~ - Inside source: true *** True Line Result - return send(m) + @args.state.overlay_rendered = true ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -99651,3358 +103668,3270 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* easing.rb~ +** Processing line: ~*** Lowrez - Resolution 64x64 - lowrez.rb~ - Header detected. *** True Line Result *** True Line Result -* easing.rb +*** Lowrez - Resolution 64x64 - lowrez.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/easing.rb~ -- Inside source: true -*** True Line Result - # ./dragon/easing.rb -** Processing line: ~ # coding: utf-8~ -- Inside source: true -*** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +** Processing line: ~ # ./samples/99_genre_lowrez/resolution_64x64/app/lowrez.rb~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + # ./samples/99_genre_lowrez/resolution_64x64/app/lowrez.rb +** Processing line: ~ # Emulation of a 64x64 canvas. Don't change this file unless you know what you're doing :-)~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # easing.rb has been released under MIT (*only this file*).~ + # Emulation of a 64x64 canvas. Don't change this file unless you know what you're doing :-) +** Processing line: ~ # Head over to main.rb and study the code there.~ - Inside source: true *** True Line Result - # easing.rb has been released under MIT (*only this file*). + # Head over to main.rb and study the code there. ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ LOWREZ_SIZE = 64~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ module Easing~ + LOWREZ_SIZE = 64 +** Processing line: ~ LOWREZ_ZOOM = 10~ - Inside source: true *** True Line Result - module Easing -** Processing line: ~ def self.ease_extended start_tick, current_tick, end_tick, default_before, default_after, *definitions~ + LOWREZ_ZOOM = 10 +** Processing line: ~ LOWREZ_ZOOMED_SIZE = LOWREZ_SIZE * LOWREZ_ZOOM~ - Inside source: true *** True Line Result - def self.ease_extended start_tick, current_tick, end_tick, default_before, default_after, *definitions -** Processing line: ~ definitions.flatten!~ + LOWREZ_ZOOMED_SIZE = LOWREZ_SIZE * LOWREZ_ZOOM +** Processing line: ~ LOWREZ_X_OFFSET = (1280 - LOWREZ_ZOOMED_SIZE).half~ - Inside source: true *** True Line Result - definitions.flatten! -** Processing line: ~ definitions = [:identity] if definitions.length == 0~ + LOWREZ_X_OFFSET = (1280 - LOWREZ_ZOOMED_SIZE).half +** Processing line: ~ LOWREZ_Y_OFFSET = ( 720 - LOWREZ_ZOOMED_SIZE).half~ - Inside source: true *** True Line Result - definitions = [:identity] if definitions.length == 0 -** Processing line: ~ duration = end_tick - start_tick~ + LOWREZ_Y_OFFSET = ( 720 - LOWREZ_ZOOMED_SIZE).half +** Processing line: ~~ - Inside source: true *** True Line Result - duration = end_tick - start_tick -** Processing line: ~ elapsed = current_tick - start_tick~ + +** Processing line: ~ LOWREZ_FONT_XL = -1~ - Inside source: true *** True Line Result - elapsed = current_tick - start_tick -** Processing line: ~ y = elapsed.percentage_of(duration).cap_min_max(0, 1)~ + LOWREZ_FONT_XL = -1 +** Processing line: ~ LOWREZ_FONT_XL_HEIGHT = 20~ - Inside source: true *** True Line Result - y = elapsed.percentage_of(duration).cap_min_max(0, 1) + LOWREZ_FONT_XL_HEIGHT = 20 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ definitions.map do |definition|~ -- Inside source: true -*** True Line Result - definitions.map do |definition| -** Processing line: ~ y = Easing.exec_definition(definition, start_tick, duration, y)~ +** Processing line: ~ LOWREZ_FONT_LG = -3.5~ - Inside source: true *** True Line Result - y = Easing.exec_definition(definition, start_tick, duration, y) -** Processing line: ~ end~ + LOWREZ_FONT_LG = -3.5 +** Processing line: ~ LOWREZ_FONT_LG_HEIGHT = 15~ - Inside source: true *** True Line Result - end + LOWREZ_FONT_LG_HEIGHT = 15 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ y~ +** Processing line: ~ LOWREZ_FONT_MD = -6~ - Inside source: true *** True Line Result - y -** Processing line: ~ end~ + LOWREZ_FONT_MD = -6 +** Processing line: ~ LOWREZ_FONT_MD_HEIGHT = 10~ - Inside source: true *** True Line Result - end + LOWREZ_FONT_MD_HEIGHT = 10 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.ease_spline_extended start_tick, current_tick, end_tick, spline~ -- Inside source: true -*** True Line Result - def self.ease_spline_extended start_tick, current_tick, end_tick, spline -** Processing line: ~ duration = end_tick - start_tick~ +** Processing line: ~ LOWREZ_FONT_SM = -8.5~ - Inside source: true *** True Line Result - duration = end_tick - start_tick -** Processing line: ~ t = (current_tick - start_tick).fdiv duration~ + LOWREZ_FONT_SM = -8.5 +** Processing line: ~ LOWREZ_FONT_SM_HEIGHT = 5~ - Inside source: true *** True Line Result - t = (current_tick - start_tick).fdiv duration -** Processing line: ~ time_allocation_per_curve = 1.fdiv(spline.length)~ + LOWREZ_FONT_SM_HEIGHT = 5 +** Processing line: ~~ - Inside source: true *** True Line Result - time_allocation_per_curve = 1.fdiv(spline.length) -** Processing line: ~ curve_index, curve_t = t.fdiv(time_allocation_per_curve).let do |spline_t|~ + +** Processing line: ~ LOWREZ_FONT_PATH = 'fonts/lowrez.ttf'~ - Inside source: true *** True Line Result - curve_index, curve_t = t.fdiv(time_allocation_per_curve).let do |spline_t| -** Processing line: ~ [spline_t.to_i, spline_t - spline_t.to_i]~ + LOWREZ_FONT_PATH = 'fonts/lowrez.ttf' +** Processing line: ~~ - Inside source: true *** True Line Result - [spline_t.to_i, spline_t - spline_t.to_i] -** Processing line: ~ end~ + +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ Geometry.cubic_bezier curve_t, *spline[curve_index]~ + +** Processing line: ~ class LowrezOutputs~ - Inside source: true *** True Line Result - Geometry.cubic_bezier curve_t, *spline[curve_index] -** Processing line: ~ end~ + class LowrezOutputs +** Processing line: ~ attr_accessor :width, :height~ - Inside source: true *** True Line Result - end + attr_accessor :width, :height ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.initial_value *definitions~ +** Processing line: ~ def initialize args~ - Inside source: true *** True Line Result - def self.initial_value *definitions -** Processing line: ~ definitions.flatten!~ + def initialize args +** Processing line: ~ @args = args~ - Inside source: true *** True Line Result - definitions.flatten! -** Processing line: ~ return Easing.exec_definition (definitions.value(-1) || :identity), 0, 10, 0~ + @args = args +** Processing line: ~ @background_color ||= [0, 0, 0]~ - Inside source: true *** True Line Result - return Easing.exec_definition (definitions.value(-1) || :identity), 0, 10, 0 -** Processing line: ~ end~ + @background_color ||= [0, 0, 0] +** Processing line: ~ @args.outputs.background_color = @background_color~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + @args.outputs.background_color = @background_color +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.final_value *definitions~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def self.final_value *definitions -** Processing line: ~ definitions.flatten!~ + +** Processing line: ~ def background_color~ - Inside source: true *** True Line Result - definitions.flatten! -** Processing line: ~ return Easing.exec_definition (definitions.value(-1) || :identity), 0, 10, 1.0~ + def background_color +** Processing line: ~ @background_color ||= [0, 0, 0]~ - Inside source: true *** True Line Result - return Easing.exec_definition (definitions.value(-1) || :identity), 0, 10, 1.0 -** Processing line: ~ end~ + @background_color ||= [0, 0, 0] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.exec_definition definition, start_tick, duration, x~ +** Processing line: ~ def background_color= opts~ - Inside source: true *** True Line Result - def self.exec_definition definition, start_tick, duration, x -** Processing line: ~ if definition.is_a? Symbol~ + def background_color= opts +** Processing line: ~ @background_color = opts~ - Inside source: true *** True Line Result - if definition.is_a? Symbol -** Processing line: ~ return Easing.send(definition, x).cap_min_max(0, 1)~ + @background_color = opts +** Processing line: ~ @args.outputs.background_color = @background_color~ - Inside source: true *** True Line Result - return Easing.send(definition, x).cap_min_max(0, 1) -** Processing line: ~ elsif definition.is_a? Proc~ + @args.outputs.background_color = @background_color +** Processing line: ~~ - Inside source: true *** True Line Result - elsif definition.is_a? Proc -** Processing line: ~ return definition.call(x, start_tick, duration).cap_min_max(0, 1)~ + +** Processing line: ~ outputs_lowrez.solids << [0, 0, LOWREZ_SIZE, LOWREZ_SIZE, @background_color]~ - Inside source: true *** True Line Result - return definition.call(x, start_tick, duration).cap_min_max(0, 1) -** Processing line: ~ end~ + outputs_lowrez.solids << [0, 0, LOWREZ_SIZE, LOWREZ_SIZE, @background_color] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ raise <<-S~ +** Processing line: ~ def outputs_lowrez~ - Inside source: true *** True Line Result - raise <<-S -** Processing line: ~ * ERROR:~ + def outputs_lowrez +** Processing line: ~ return @args.outputs if @args.state.tick_count <= 0~ - Inside source: true *** True Line Result - * ERROR: -** Processing line: ~ I don't know how to execute easing function with definition #{definition}.~ + return @args.outputs if @args.state.tick_count <= 0 +** Processing line: ~ return @args.outputs[:lowrez]~ - Inside source: true *** True Line Result - I don't know how to execute easing function with definition #{definition}. + return @args.outputs[:lowrez] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ S~ +** Processing line: ~ def solids~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + def solids +** Processing line: ~ outputs_lowrez.solids~ - Inside source: true *** True Line Result - end + outputs_lowrez.solids +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.identity x~ +** Processing line: ~ def borders~ - Inside source: true *** True Line Result - def self.identity x -** Processing line: ~ x~ + def borders +** Processing line: ~ outputs_lowrez.borders~ - Inside source: true *** True Line Result - x -** Processing line: ~ end~ + outputs_lowrez.borders +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.flip x~ +** Processing line: ~ def sprites~ - Inside source: true *** True Line Result - def self.flip x -** Processing line: ~ 1 - x~ + def sprites +** Processing line: ~ outputs_lowrez.sprites~ - Inside source: true *** True Line Result - 1 - x -** Processing line: ~ end~ + outputs_lowrez.sprites +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.quad x~ +** Processing line: ~ def labels~ - Inside source: true *** True Line Result - def self.quad x -** Processing line: ~ x * x~ + def labels +** Processing line: ~ outputs_lowrez.labels~ - Inside source: true *** True Line Result - x * x -** Processing line: ~ end~ + outputs_lowrez.labels +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.cube x~ +** Processing line: ~ def default_label~ - Inside source: true *** True Line Result - def self.cube x -** Processing line: ~ x * x * x~ + def default_label +** Processing line: ~ {~ - Inside source: true *** True Line Result - x * x * x -** Processing line: ~ end~ + { +** Processing line: ~ x: 0,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x: 0, +** Processing line: ~ y: 63,~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.quart x~ + y: 63, +** Processing line: ~ text: "",~ - Inside source: true *** True Line Result - def self.quart x -** Processing line: ~ x * x * x * x * x~ + text: "", +** Processing line: ~ size_enum: LOWREZ_FONT_SM,~ - Inside source: true *** True Line Result - x * x * x * x * x -** Processing line: ~ end~ + size_enum: LOWREZ_FONT_SM, +** Processing line: ~ alignment_enum: 0,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + alignment_enum: 0, +** Processing line: ~ r: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.quint x~ + r: 0, +** Processing line: ~ g: 0,~ - Inside source: true *** True Line Result - def self.quint x -** Processing line: ~ x * x * x * x * x * x~ + g: 0, +** Processing line: ~ b: 0,~ - Inside source: true *** True Line Result - x * x * x * x * x * x -** Processing line: ~ end~ + b: 0, +** Processing line: ~ a: 255,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + a: 255, +** Processing line: ~ font: LOWREZ_FONT_PATH~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + font: LOWREZ_FONT_PATH +** Processing line: ~ }~ - 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: ~ Easing = GTK::Easing~ +** Processing line: ~ def lines~ - Inside source: true *** True Line Result - Easing = GTK::Easing -** Processing line: ~~ + def lines +** Processing line: ~ outputs_lowrez.lines~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + outputs_lowrez.lines +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+end_src + end ** Processing line: ~~ -- End of paragraph detected. +- Inside source: true *** True Line Result -** Processing line: ~* geometry.rb~ -- Header detected. +** Processing line: ~ def primitives~ +- Inside source: true *** True Line Result - -*** True Line Result -* geometry.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + def primitives +** Processing line: ~ outputs_lowrez.primitives~ +- Inside source: true *** True Line Result - + outputs_lowrez.primitives +** Processing line: ~ end~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/geometry.rb~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # ./dragon/geometry.rb -** Processing line: ~ # coding: utf-8~ + +** Processing line: ~ def click~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + def click +** Processing line: ~ return nil unless @args.inputs.mouse.click~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + return nil unless @args.inputs.mouse.click +** Processing line: ~ mouse~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # geometry.rb has been released under MIT (*only this file*).~ + mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - # geometry.rb has been released under MIT (*only this file*). + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ def mouse_click~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ module Geometry~ + def mouse_click +** Processing line: ~ click~ - Inside source: true *** True Line Result - module Geometry -** Processing line: ~ # Returns f(t) for a cubic Bezier curve.~ + click +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Returns f(t) for a cubic Bezier curve. -** Processing line: ~ def self.cubic_bezier t, a, b, c, d~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def self.cubic_bezier t, a, b, c, d -** Processing line: ~ s = 1 - t~ + +** Processing line: ~ def mouse_down~ - Inside source: true *** True Line Result - s = 1 - t -** Processing line: ~ s0 = 1~ + def mouse_down +** Processing line: ~ @args.inputs.mouse.down~ - Inside source: true *** True Line Result - s0 = 1 -** Processing line: ~ s1 = s~ + @args.inputs.mouse.down +** Processing line: ~ end~ - Inside source: true *** True Line Result - s1 = s -** Processing line: ~ s2 = s * s~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - s2 = s * s -** Processing line: ~ s3 = s * s * s~ + +** Processing line: ~ def mouse_up~ - Inside source: true *** True Line Result - s3 = s * s * s + def mouse_up +** Processing line: ~ @args.inputs.mouse.up~ +- Inside source: true +*** True Line Result + @args.inputs.mouse.up +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ t0 = 1~ +** Processing line: ~ def mouse~ - Inside source: true *** True Line Result - t0 = 1 -** Processing line: ~ t1 = t~ + def mouse +** Processing line: ~ [~ - Inside source: true *** True Line Result - t1 = t -** Processing line: ~ t2 = t * t~ + [ +** Processing line: ~ ((@args.inputs.mouse.x - LOWREZ_X_OFFSET).idiv(LOWREZ_ZOOM)),~ - Inside source: true *** True Line Result - t2 = t * t -** Processing line: ~ t3 = t * t * t~ + ((@args.inputs.mouse.x - LOWREZ_X_OFFSET).idiv(LOWREZ_ZOOM)), +** Processing line: ~ ((@args.inputs.mouse.y - LOWREZ_Y_OFFSET).idiv(LOWREZ_ZOOM))~ - Inside source: true *** True Line Result - t3 = t * t * t -** Processing line: ~~ + ((@args.inputs.mouse.y - LOWREZ_Y_OFFSET).idiv(LOWREZ_ZOOM)) +** Processing line: ~ ]~ - Inside source: true *** True Line Result - -** Processing line: ~ 1 * s3 * t0 * a +~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - 1 * s3 * t0 * a + -** Processing line: ~ 3 * s2 * t1 * b +~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 3 * s2 * t1 * b + -** Processing line: ~ 3 * s1 * t2 * c +~ + +** Processing line: ~ def mouse_position~ - Inside source: true *** True Line Result - 3 * s1 * t2 * c + -** Processing line: ~ 1 * s0 * t3 * d~ + def mouse_position +** Processing line: ~ mouse~ - Inside source: true *** True Line Result - 1 * s0 * t3 * d -** Processing line: ~ end~ + mouse +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns true if a primitive's rectangle is entirely inside another primitive's rectangle.~ -- Inside source: true -*** True Line Result - # Returns true if a primitive's rectangle is entirely inside another primitive's rectangle. -** Processing line: ~ # @gtk~ +** Processing line: ~ def keyboard~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def inside_rect? outer~ + def keyboard +** Processing line: ~ @args.inputs.keyboard~ - Inside source: true *** True Line Result - def inside_rect? outer -** Processing line: ~ Geometry.inside_rect? self, outer~ + @args.inputs.keyboard +** Processing line: ~ end~ - Inside source: true *** True Line Result - Geometry.inside_rect? self, outer -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns true if a primitive's rectangle overlaps another primitive's rectangle.~ +** Processing line: ~ class GTK::Args~ - Inside source: true *** True Line Result - # Returns true if a primitive's rectangle overlaps another primitive's rectangle. -** Processing line: ~ # @gtk~ + class GTK::Args +** Processing line: ~ def init_lowrez~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def intersect_rect? other, tolerance = 0.1~ + def init_lowrez +** Processing line: ~ return if @lowrez~ - Inside source: true *** True Line Result - def intersect_rect? other, tolerance = 0.1 -** Processing line: ~ Geometry.intersect_rect? self, other, tolerance~ + return if @lowrez +** Processing line: ~ @lowrez = LowrezOutputs.new self~ - Inside source: true *** True Line Result - Geometry.intersect_rect? self, other, tolerance -** Processing line: ~ end~ + @lowrez = LowrezOutputs.new self +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def intersects_rect? *args~ +** Processing line: ~ def lowrez~ - Inside source: true *** True Line Result - def intersects_rect? *args -** Processing line: ~ Geometry.intersects_rect?(*args)~ + def lowrez +** Processing line: ~ @lowrez~ - Inside source: true *** True Line Result - Geometry.intersects_rect?(*args) -** Processing line: ~ end~ + @lowrez +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def scale_rect_extended percentage_x: percentage_x,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def scale_rect_extended percentage_x: percentage_x, -** Processing line: ~ percentage_y: percentage_y,~ + +** Processing line: ~ module GTK~ - Inside source: true *** True Line Result - percentage_y: percentage_y, -** Processing line: ~ anchor_x: anchor_x,~ + module GTK +** Processing line: ~ class Runtime~ - Inside source: true *** True Line Result - anchor_x: anchor_x, -** Processing line: ~ anchor_y: anchor_y~ + class Runtime +** Processing line: ~ alias_method :__original_tick_core__, :tick_core unless Runtime.instance_methods.include?(:__original_tick_core__)~ - Inside source: true *** True Line Result - anchor_y: anchor_y + alias_method :__original_tick_core__, :tick_core unless Runtime.instance_methods.include?(:__original_tick_core__) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Geometry.scale_rect_extended self,~ -- Inside source: true -*** True Line Result - Geometry.scale_rect_extended self, -** Processing line: ~ percentage_x: percentage_x,~ +** Processing line: ~ def tick_core~ - Inside source: true *** True Line Result - percentage_x: percentage_x, -** Processing line: ~ percentage_y: percentage_y,~ + def tick_core +** Processing line: ~ @args.init_lowrez~ - Inside source: true *** True Line Result - percentage_y: percentage_y, -** Processing line: ~ anchor_x: anchor_x,~ + @args.init_lowrez +** Processing line: ~ __original_tick_core__~ - Inside source: true *** True Line Result - anchor_x: anchor_x, -** Processing line: ~ anchor_y: anchor_y~ + __original_tick_core__ +** Processing line: ~~ - Inside source: true *** True Line Result - anchor_y: anchor_y -** Processing line: ~ end~ + +** Processing line: ~ return if @args.state.tick_count <= 0~ - Inside source: true *** True Line Result - end + return if @args.state.tick_count <= 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Scales a primitive rect by a percentage.~ +** Processing line: ~ @args.render_target(:lowrez)~ - Inside source: true *** True Line Result - # Scales a primitive rect by a percentage. -** Processing line: ~ # @gtk~ + @args.render_target(:lowrez) +** Processing line: ~ .labels~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def scale_rect percentage, *anchors~ + .labels +** Processing line: ~ .each do |l|~ - Inside source: true *** True Line Result - def scale_rect percentage, *anchors -** Processing line: ~ Geometry.scale_rect self, percentage, *anchors~ + .each do |l| +** Processing line: ~ l.y += 1~ - Inside source: true *** True Line Result - Geometry.scale_rect self, percentage, *anchors -** Processing line: ~ end~ + l.y += 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns the angle from one primitive to another primitive.~ +** Processing line: ~ @args.render_target(:lowrez)~ - Inside source: true *** True Line Result - # Returns the angle from one primitive to another primitive. -** Processing line: ~ # @gtk~ + @args.render_target(:lowrez) +** Processing line: ~ .lines~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def angle_to other_point~ + .lines +** Processing line: ~ .each do |l|~ - Inside source: true *** True Line Result - def angle_to other_point -** Processing line: ~ Geometry.angle_to self, other_point~ + .each do |l| +** Processing line: ~ l.y += 1~ - Inside source: true *** True Line Result - Geometry.angle_to self, other_point -** Processing line: ~ end~ + l.y += 1 +** Processing line: ~ l.y2 += 1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + l.y2 += 1 +** Processing line: ~ l.y2 += 1 if l.y1 != l.y2~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns the angle to one primitive from another primitive.~ + l.y2 += 1 if l.y1 != l.y2 +** Processing line: ~ l.x2 += 1 if l.x1 != l.x2~ - Inside source: true *** True Line Result - # Returns the angle to one primitive from another primitive. -** Processing line: ~ # @gtk~ + l.x2 += 1 if l.x1 != l.x2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def angle_from other_point~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def angle_from other_point -** Processing line: ~ Geometry.angle_from self, other_point~ + +** Processing line: ~ @args.outputs~ - Inside source: true *** True Line Result - Geometry.angle_from self, other_point -** Processing line: ~ end~ + @args.outputs +** Processing line: ~ .sprites << { x: 320,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + .sprites << { x: 320, +** Processing line: ~ y: 40,~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns true if a primitive is within a circle specified by the circle's center and radius.~ + y: 40, +** Processing line: ~ w: 640,~ - Inside source: true *** True Line Result - # Returns true if a primitive is within a circle specified by the circle's center and radius. -** Processing line: ~ # @gtk~ + w: 640, +** Processing line: ~ h: 640,~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def point_inside_circle? circle_center_point, radius~ + h: 640, +** Processing line: ~ source_x: 0,~ - Inside source: true *** True Line Result - def point_inside_circle? circle_center_point, radius -** Processing line: ~ Geometry.point_inside_circle? self, circle_center_point, radius~ + source_x: 0, +** Processing line: ~ source_y: 0,~ - Inside source: true *** True Line Result - Geometry.point_inside_circle? self, circle_center_point, radius -** Processing line: ~ end~ + source_y: 0, +** Processing line: ~ source_w: 64,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + source_w: 64, +** Processing line: ~ source_h: 64,~ - Inside source: true *** True Line Result - -** Processing line: ~ def center_inside_rect other_rect~ + source_h: 64, +** Processing line: ~ path: :lowrez }~ - Inside source: true *** True Line Result - def center_inside_rect other_rect -** Processing line: ~ offset_x = (other_rect.w - w).half~ + path: :lowrez } +** Processing line: ~ end~ - Inside source: true *** True Line Result - offset_x = (other_rect.w - w).half -** Processing line: ~ offset_y = (other_rect.h - h).half~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - offset_y = (other_rect.h - h).half -** Processing line: ~ new_rect = self.shift_rect(0, 0)~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - new_rect = self.shift_rect(0, 0) -** Processing line: ~ new_rect.x = other_rect.x + offset_x~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - new_rect.x = other_rect.x + offset_x -** Processing line: ~ new_rect.y = other_rect.y + offset_y~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - new_rect.y = other_rect.y + offset_y -** Processing line: ~ new_rect~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - new_rect -** Processing line: ~ rescue Exception => e~ -- Inside source: true + +** Processing line: ~*** Lowrez - Resolution 64x64 - main.rb~ +- Header detected. *** True Line Result - rescue Exception => e -** Processing line: ~ raise e, <<-S~ -- Inside source: true + *** True Line Result - raise e, <<-S -** Processing line: ~ * ERROR:~ -- Inside source: true +*** Lowrez - Resolution 64x64 - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - * ERROR: -** Processing line: ~ center_inside_rect for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.~ -- Inside source: true + *** True Line Result - center_inside_rect for self #{self} and other_rect #{other_rect}. Failed with exception #{e}. -** Processing line: ~ S~ +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_lowrez/resolution_64x64/app/main.rb~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + # ./samples/99_genre_lowrez/resolution_64x64/app/main.rb +** Processing line: ~ require 'app/lowrez.rb'~ - Inside source: true *** True Line Result - end + require 'app/lowrez.rb' ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def center_inside_rect_y other_rect~ -- Inside source: true -*** True Line Result - def center_inside_rect_y other_rect -** Processing line: ~ offset_y = (other_rect.h - h).half~ -- Inside source: true -*** True Line Result - offset_y = (other_rect.h - h).half -** Processing line: ~ new_rect = self.shift_rect(0, 0)~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - new_rect = self.shift_rect(0, 0) -** Processing line: ~ new_rect.y = other_rect.y + offset_y~ + def tick args +** Processing line: ~ # How to set the background color~ - Inside source: true *** True Line Result - new_rect.y = other_rect.y + offset_y -** Processing line: ~ new_rect~ + # How to set the background color +** Processing line: ~ args.lowrez.background_color = [255, 255, 255]~ - Inside source: true *** True Line Result - new_rect -** Processing line: ~ rescue Exception => e~ + args.lowrez.background_color = [255, 255, 255] +** Processing line: ~~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise e, <<-S~ + +** Processing line: ~ # ==== HELLO WORLD ======================================================~ - Inside source: true *** True Line Result - raise e, <<-S -** Processing line: ~ * ERROR:~ + # ==== HELLO WORLD ====================================================== +** Processing line: ~ # Steps to get started:~ - 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}.~ + # Steps to get started: +** Processing line: ~ # 1. ~def tick args~ is the entry point for your game.~ - Inside source: true *** True Line Result - center_inside_rect_y for self #{self} and other_rect #{other_rect}. Failed with exception #{e}. -** Processing line: ~ S~ + # 1. ~def tick args~ is the entry point for your game. +** Processing line: ~ # 2. There are quite a few code samples below, remove the "##"~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + # 2. There are quite a few code samples below, remove the "##" +** Processing line: ~ # before each line and save the file to see the changes.~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # before each line and save the file to see the changes. +** Processing line: ~ # 3. 0, 0 is in bottom left and 63, 63 is in top right corner.~ - Inside source: true *** True Line Result - -** Processing line: ~ def center_inside_rect_x other_rect~ + # 3. 0, 0 is in bottom left and 63, 63 is in top right corner. +** Processing line: ~ # 4. Be sure to come to the discord channel if you need~ - Inside source: true *** True Line Result - def center_inside_rect_x other_rect -** Processing line: ~ offset_x = (other_rect.w - w).half~ + # 4. Be sure to come to the discord channel if you need +** Processing line: ~ # more help: [[http://discord.dragonruby.org]].~ - Inside source: true *** True Line Result - offset_x = (other_rect.w - w).half -** Processing line: ~ new_rect = self.shift_rect(0, 0)~ + # more help: [[http://discord.dragonruby.org]]. +** Processing line: ~~ - Inside source: true *** True Line Result - new_rect = self.shift_rect(0, 0) -** Processing line: ~ new_rect.x = other_rect.x + offset_x~ + +** Processing line: ~ # Commenting and uncommenting code:~ - Inside source: true *** True Line Result - new_rect.x = other_rect.x + offset_x -** Processing line: ~ new_rect~ + # Commenting and uncommenting code: +** Processing line: ~ # - Add a "#" infront of lines to comment out code~ - Inside source: true *** True Line Result - new_rect -** Processing line: ~ rescue Exception => e~ + # - Add a "#" infront of lines to comment out code +** Processing line: ~ # - Remove the "#" infront of lines to comment out code~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise e, <<-S~ + # - Remove the "#" infront of lines to comment out code +** Processing line: ~~ - Inside source: true *** True Line Result - raise e, <<-S -** Processing line: ~ * ERROR:~ + +** Processing line: ~ # Invoke the hello_world subroutine/method~ - 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}.~ + # Invoke the hello_world subroutine/method +** Processing line: ~ hello_world args # <---- add a "#" to the beginning of the line to stop running this subroutine/method.~ - Inside source: true *** True Line Result - center_inside_rect_x for self #{self} and other_rect #{other_rect}. Failed with exception #{e}. -** Processing line: ~ S~ + hello_world args # <---- add a "#" to the beginning of the line to stop running this subroutine/method. +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + # ======================================================================= +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns a primitive that is anchored/repositioned based off its retangle.~ +** Processing line: ~ # ==== HOW TO RENDER A LABEL ============================================~ - Inside source: true *** True Line Result - # Returns a primitive that is anchored/repositioned based off its retangle. -** Processing line: ~ # @gtk~ + # ==== HOW TO RENDER A LABEL ============================================ +** Processing line: ~ # Uncomment the line below to invoke the how_to_render_a_label subroutine/method.~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def anchor_rect anchor_x, anchor_y~ + # Uncomment the line below to invoke the how_to_render_a_label subroutine/method. +** Processing line: ~ # Note: The method is defined in this file with the signature ~def how_to_render_a_label args~~ - Inside source: true *** True Line Result - def anchor_rect anchor_x, anchor_y -** Processing line: ~ current_w = self.w~ + # Note: The method is defined in this file with the signature ~def how_to_render_a_label args~ +** Processing line: ~ # Scroll down to the method to see the details.~ - Inside source: true *** True Line Result - current_w = self.w -** Processing line: ~ current_h = self.h~ + # Scroll down to the method to see the details. +** Processing line: ~~ - Inside source: true *** True Line Result - current_h = self.h -** Processing line: ~ delta_x = -1 * (anchor_x * current_w)~ + +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - delta_x = -1 * (anchor_x * current_w) -** Processing line: ~ delta_y = -1 * (anchor_y * current_h)~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_render_a_label args # <---- remove the "#" at the begging of this line to run the method~ - Inside source: true *** True Line Result - delta_y = -1 * (anchor_y * current_h) -** Processing line: ~ self.shift_rect(delta_x, delta_y)~ + # how_to_render_a_label args # <---- remove the "#" at the begging of this line to run the method +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - self.shift_rect(delta_x, delta_y) -** Processing line: ~ end~ + # ======================================================================= +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def angle_given_point other_point~ +** Processing line: ~ # ==== HOW TO RENDER A FILLED SQUARE (SOLID) ============================~ - Inside source: true *** True Line Result - def angle_given_point other_point -** Processing line: ~ raise ":angle_given_point has been deprecated use :angle_from instead."~ + # ==== HOW TO RENDER A FILLED SQUARE (SOLID) ============================ +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - raise ":angle_given_point has been deprecated use :angle_from instead." -** Processing line: ~ end~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_render_solids args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # how_to_render_solids args +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + # ======================================================================= +** Processing line: ~~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.shift_line line, x, y~ + +** Processing line: ~~ - Inside source: true *** True Line Result - def self.shift_line line, x, y -** Processing line: ~ if line.is_a?(Array) || line.is_a?(Hash)~ + +** Processing line: ~ # ==== HOW TO RENDER AN UNFILLED SQUARE (BORDER) ========================~ - Inside source: true *** True Line Result - if line.is_a?(Array) || line.is_a?(Hash) -** Processing line: ~ new_line = line.dup~ + # ==== HOW TO RENDER AN UNFILLED SQUARE (BORDER) ======================== +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - new_line = line.dup -** Processing line: ~ new_line.x += x~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_render_borders args~ - Inside source: true *** True Line Result - new_line.x += x -** Processing line: ~ new_line.x2 += x~ + # how_to_render_borders args +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - new_line.x2 += x -** Processing line: ~ new_line.y += y~ + # ======================================================================= +** Processing line: ~~ - Inside source: true *** True Line Result - new_line.y += y -** Processing line: ~ new_line.y2 += y~ + +** Processing line: ~~ - Inside source: true *** True Line Result - new_line.y2 += y -** Processing line: ~ new_line~ + +** Processing line: ~ # ==== HOW TO RENDER A LINE =============================================~ - Inside source: true *** True Line Result - new_line -** Processing line: ~ else~ + # ==== HOW TO RENDER A LINE ============================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - else -** Processing line: ~ raise "shift_line for #{line} is not supported."~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_render_lines args~ - Inside source: true *** True Line Result - raise "shift_line for #{line} is not supported." -** Processing line: ~ end~ + # how_to_render_lines args +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # ======================================================================= +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.intersects_rect? *args~ +** Processing line: ~ # == HOW TO RENDER A SPRITE =============================================~ - Inside source: true *** True Line Result - def self.intersects_rect? *args -** Processing line: ~ raise <<-S~ + # == HOW TO RENDER A SPRITE ============================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - raise <<-S -** Processing line: ~ intersects_rect? (with an \"s\") has been deprecated.~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_render_sprites args~ - Inside source: true *** True Line Result - intersects_rect? (with an \"s\") has been deprecated. -** Processing line: ~ Use intersect_rect? instead (remove the \"s\").~ + # how_to_render_sprites args +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - Use intersect_rect? instead (remove the \"s\"). + # ======================================================================= ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ * NOTE:~ +** Processing line: ~~ - Inside source: true *** True Line Result - * NOTE: -** Processing line: ~ Ruby's naming convention is to *never* include the \"s\" for~ + +** Processing line: ~ # ==== HOW TO MOVE A SPRITE BASED OFF OF USER INPUT =====================~ - Inside source: true *** True Line Result - Ruby's naming convention is to *never* include the \"s\" for -** Processing line: ~ interrogative method names (methods that end with a ?). It~ + # ==== HOW TO MOVE A SPRITE BASED OFF OF USER INPUT ===================== +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - interrogative method names (methods that end with a ?). It -** Processing line: ~ doesn't sound grammatically correct, but that has been the~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_move_a_sprite args~ - Inside source: true *** True Line Result - doesn't sound grammatically correct, but that has been the -** Processing line: ~ rule for a long time (and why intersects_rect? has been deprecated).~ + # how_to_move_a_sprite args +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - rule for a long time (and why intersects_rect? has been deprecated). + # ======================================================================= ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ S~ -- Inside source: true -*** True Line Result - S -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.line_y_intercept line~ + # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ========================== +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - def self.line_y_intercept line -** Processing line: ~ line.y - line_slope(line) * line.x~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_animate_a_sprite args~ - Inside source: true *** True Line Result - line.y - line_slope(line) * line.x -** Processing line: ~ end~ + # how_to_animate_a_sprite args +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - end + # ======================================================================= ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.angle_between_lines line_one, line_two, replace_infinity: nil~ + +** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) ===========================~ - Inside source: true *** True Line Result - def self.angle_between_lines line_one, line_two, replace_infinity: nil -** Processing line: ~ m_line_one = line_slope line_one, replace_infinity: replace_infinity~ + # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) =========================== +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - m_line_one = line_slope line_one, replace_infinity: replace_infinity -** Processing line: ~ m_line_two = line_slope line_two, replace_infinity: replace_infinity~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_animate_a_sprite_sheet args~ - Inside source: true *** True Line Result - m_line_two = line_slope line_two, replace_infinity: replace_infinity -** Processing line: ~ Math.atan((m_line_one - m_line_two) / (1 + m_line_two * m_line_one)).to_degrees~ + # how_to_animate_a_sprite_sheet args +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - Math.atan((m_line_one - m_line_two) / (1 + m_line_two * m_line_one)).to_degrees -** Processing line: ~ end~ + # ======================================================================= +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ # ==== HOW TO DETERMINE COLLISION =============================================~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.line_slope line, replace_infinity: nil~ + # ==== HOW TO DETERMINE COLLISION ============================================= +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - def self.line_slope line, replace_infinity: nil -** Processing line: ~ (line.y2 - line.y).fdiv(line.x2 - line.x)~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_determine_collision args~ - Inside source: true *** True Line Result - (line.y2 - line.y).fdiv(line.x2 - line.x) -** Processing line: ~ .replace_infinity(replace_infinity)~ + # how_to_determine_collision args +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - .replace_infinity(replace_infinity) -** Processing line: ~ end~ + # ======================================================================= +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ # ==== HOW TO CREATE BUTTONS ==================================================~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.ray_test point, line~ + # ==== HOW TO CREATE BUTTONS ================================================== +** Processing line: ~ # Remove the "#" at the beginning of the line below~ - Inside source: true *** True Line Result - def self.ray_test point, line -** Processing line: ~ slope = (line.y2 - line.y).fdiv(line.x2 - line.x)~ + # Remove the "#" at the beginning of the line below +** Processing line: ~ # how_to_create_buttons args~ - Inside source: true *** True Line Result - slope = (line.y2 - line.y).fdiv(line.x2 - line.x) + # how_to_create_buttons args +** Processing line: ~ # =======================================================================~ +- Inside source: true +*** True Line Result + # ======================================================================= ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if line.x > line.x2~ +** Processing line: ~~ - Inside source: true *** True Line Result - if line.x > line.x2 -** Processing line: ~ point_two, point_one = [point_one, point_two]~ + +** Processing line: ~ # ==== The line below renders a debug grid, mouse information, and current tick~ - Inside source: true *** True Line Result - point_two, point_one = [point_one, point_two] -** Processing line: ~ end~ + # ==== The line below renders a debug grid, mouse information, and current tick +** Processing line: ~ render_debug args~ - Inside source: true *** True Line Result - end + render_debug args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ r = ((line.x2 - line.x) * (point.y - line.y) -~ +** Processing line: ~ def hello_world args~ - Inside source: true *** True Line Result - r = ((line.x2 - line.x) * (point.y - line.y) - -** Processing line: ~ (point.x - line.x) * (line.y2 - line.y))~ + def hello_world args +** Processing line: ~ args.lowrez.solids << { x: 0, y: 64, w: 10, h: 10, r: 255 }~ - Inside source: true *** True Line Result - (point.x - line.x) * (line.y2 - line.y)) + args.lowrez.solids << { x: 0, y: 64, w: 10, h: 10, r: 255 } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if r == 0~ -- Inside source: true -*** True Line Result - if r == 0 -** Processing line: ~ return :on~ +** Processing line: ~ args.lowrez.labels << {~ - Inside source: true *** True Line Result - return :on -** Processing line: ~ elsif r < 0~ + args.lowrez.labels << { +** Processing line: ~ x: 32,~ - Inside source: true *** True Line Result - elsif r < 0 -** Processing line: ~ return :right if slope >= 0~ + x: 32, +** Processing line: ~ y: 63,~ - Inside source: true *** True Line Result - return :right if slope >= 0 -** Processing line: ~ return :left~ + y: 63, +** Processing line: ~ text: "lowrezjam 2020",~ - Inside source: true *** True Line Result - return :left -** Processing line: ~ elsif r > 0~ + text: "lowrezjam 2020", +** Processing line: ~ size_enum: LOWREZ_FONT_SM,~ - Inside source: true *** True Line Result - elsif r > 0 -** Processing line: ~ return :left if slope >= 0~ + size_enum: LOWREZ_FONT_SM, +** Processing line: ~ alignment_enum: 1,~ - Inside source: true *** True Line Result - return :left if slope >= 0 -** Processing line: ~ return :right~ + alignment_enum: 1, +** Processing line: ~ r: 0,~ - Inside source: true *** True Line Result - return :right -** Processing line: ~ end~ + r: 0, +** Processing line: ~ g: 0,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + g: 0, +** Processing line: ~ b: 0,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + b: 0, +** Processing line: ~ a: 255,~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + a: 255, +** Processing line: ~ font: LOWREZ_FONT_PATH~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.line_rect line~ + font: LOWREZ_FONT_PATH +** Processing line: ~ }~ - Inside source: true *** True Line Result - def self.line_rect line -** Processing line: ~ if line.x > line.x2~ + } +** Processing line: ~~ - Inside source: true *** True Line Result - if line.x > line.x2 -** Processing line: ~ x = line.x2~ + +** Processing line: ~ args.lowrez.sprites << {~ - Inside source: true *** True Line Result - x = line.x2 -** Processing line: ~ y = line.y2~ + args.lowrez.sprites << { +** Processing line: ~ x: 32 - 10,~ - Inside source: true *** True Line Result - y = line.y2 -** Processing line: ~ x2 = line.x~ + x: 32 - 10, +** Processing line: ~ y: 32 - 10,~ - Inside source: true *** True Line Result - x2 = line.x -** Processing line: ~ y2 = line.y~ + y: 32 - 10, +** Processing line: ~ w: 20,~ - Inside source: true *** True Line Result - y2 = line.y -** Processing line: ~ else~ + w: 20, +** Processing line: ~ h: 20,~ - Inside source: true *** True Line Result - else -** Processing line: ~ x = line.x~ + h: 20, +** Processing line: ~ path: 'sprites/lowrez-ship-blue.png',~ - Inside source: true *** True Line Result - x = line.x -** Processing line: ~ y = line.y~ + path: 'sprites/lowrez-ship-blue.png', +** Processing line: ~ a: args.state.tick_count % 255,~ - Inside source: true *** True Line Result - y = line.y -** Processing line: ~ x2 = line.x2~ + a: args.state.tick_count % 255, +** Processing line: ~ angle: args.state.tick_count % 360~ - Inside source: true *** True Line Result - x2 = line.x2 -** Processing line: ~ y2 = line.y2~ + angle: args.state.tick_count % 360 +** Processing line: ~ }~ - Inside source: true *** True Line Result - y2 = line.y2 -** Processing line: ~ end~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ w = x2 - x~ -- Inside source: true -*** True Line Result - w = x2 - x -** Processing line: ~ h = y2 - y~ -- Inside source: true -*** True Line Result - h = y2 - y ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ { x: x, y: y, w: w, h: h }~ +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - { x: x, y: y, w: w, h: h } -** Processing line: ~ end~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO RENDER A LABEL ============================================~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # ==== HOW TO RENDER A LABEL ============================================ +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + # ======================================================================= +** Processing line: ~ def how_to_render_a_label args~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.line_intersect line_one, line_two~ + def how_to_render_a_label args +** Processing line: ~ # NOTE: Text is aligned from the TOP LEFT corner~ - Inside source: true *** True Line Result - def self.line_intersect line_one, line_two -** Processing line: ~ m1 = line_slope(line_one)~ + # NOTE: Text is aligned from the TOP LEFT corner +** Processing line: ~~ - Inside source: true *** True Line Result - m1 = line_slope(line_one) -** Processing line: ~ m2 = line_slope(line_two)~ + +** Processing line: ~ # Render an EXTRA LARGE/XL label (remove the "#" in front of each line below)~ - Inside source: true *** True Line Result - m2 = line_slope(line_two) -** Processing line: ~ b1 = line_y_intercept(line_one)~ + # Render an EXTRA LARGE/XL label (remove the "#" in front of each line below) +** Processing line: ~ args.lowrez.labels << { x: 0, y: 57, text: "Hello World",~ - Inside source: true *** True Line Result - b1 = line_y_intercept(line_one) -** Processing line: ~ b2 = line_y_intercept(line_two)~ + args.lowrez.labels << { x: 0, y: 57, text: "Hello World", +** Processing line: ~ size_enum: LOWREZ_FONT_XL,~ - Inside source: true *** True Line Result - b2 = line_y_intercept(line_two) -** Processing line: ~ x = (b1 - b2) / (m2 - m1)~ + size_enum: LOWREZ_FONT_XL, +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ - Inside source: true *** True Line Result - x = (b1 - b2) / (m2 - m1) -** Processing line: ~ y = (-b2.fdiv(m2) + b1.fdiv(m1)).fdiv(1.fdiv(m1) - 1.fdiv(m2))~ + r: 0, g: 0, b: 0, a: 255, +** Processing line: ~ font: LOWREZ_FONT_PATH }~ - Inside source: true *** True Line Result - y = (-b2.fdiv(m2) + b1.fdiv(m1)).fdiv(1.fdiv(m1) - 1.fdiv(m2)) -** Processing line: ~ [x, y]~ + font: LOWREZ_FONT_PATH } +** Processing line: ~~ - Inside source: true *** True Line Result - [x, y] -** Processing line: ~ end~ + +** Processing line: ~ # Render a LARGE/LG label (remove the "#" in front of each line below)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Render a LARGE/LG label (remove the "#" in front of each line below) +** Processing line: ~ args.lowrez.labels << { x: 0, y: 36, text: "Hello World",~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.contract_intersect_rect?~ + args.lowrez.labels << { x: 0, y: 36, text: "Hello World", +** Processing line: ~ size_enum: LOWREZ_FONT_LG,~ - Inside source: true *** True Line Result - def self.contract_intersect_rect? -** Processing line: ~ [:left, :right, :top, :bottom]~ + size_enum: LOWREZ_FONT_LG, +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ - Inside source: true *** True Line Result - [:left, :right, :top, :bottom] -** Processing line: ~ end~ + r: 0, g: 0, b: 0, a: 255, +** Processing line: ~ font: LOWREZ_FONT_PATH }~ - Inside source: true *** True Line Result - end + font: LOWREZ_FONT_PATH } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ # Render a MEDIUM/MD label (remove the "#" in front of each line below)~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.intersect_rect? rect_one, rect_two, tolerance = 0.1~ + # Render a MEDIUM/MD label (remove the "#" in front of each line below) +** Processing line: ~ args.lowrez.labels << { x: 0, y: 20, text: "Hello World",~ - 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~ + args.lowrez.labels << { x: 0, y: 20, text: "Hello World", +** Processing line: ~ size_enum: LOWREZ_FONT_MD,~ - 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~ + size_enum: LOWREZ_FONT_MD, +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ - 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~ + r: 0, g: 0, b: 0, a: 255, +** Processing line: ~ font: LOWREZ_FONT_PATH }~ - 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~ + font: LOWREZ_FONT_PATH } +** Processing line: ~~ - Inside source: true *** True Line Result - return false if rect_one.bottom + tolerance > rect_two.top - tolerance -** Processing line: ~ return true~ + +** Processing line: ~ # Render a SMALL/SM label (remove the "#" in front of each line below)~ - Inside source: true *** True Line Result - return true -** Processing line: ~ rescue Exception => e~ + # Render a SMALL/SM label (remove the "#" in front of each line below) +** Processing line: ~ args.lowrez.labels << { x: 0, y: 9, text: "Hello World",~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ context_help_rect_one = (rect_one.help_contract_implementation contract_intersect_rect?)[:not_implemented_methods]~ + args.lowrez.labels << { x: 0, y: 9, text: "Hello World", +** Processing line: ~ size_enum: LOWREZ_FONT_SM,~ - Inside source: true *** True Line Result - context_help_rect_one = (rect_one.help_contract_implementation contract_intersect_rect?)[:not_implemented_methods] -** Processing line: ~ context_help_rect_two = (rect_two.help_contract_implementation contract_intersect_rect?)[:not_implemented_methods]~ + size_enum: LOWREZ_FONT_SM, +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ - Inside source: true *** True Line Result - context_help_rect_two = (rect_two.help_contract_implementation contract_intersect_rect?)[:not_implemented_methods] -** Processing line: ~ context_help = ""~ + r: 0, g: 0, b: 0, a: 255, +** Processing line: ~ font: LOWREZ_FONT_PATH }~ - Inside source: true *** True Line Result - context_help = "" -** Processing line: ~ if context_help_rect_one && context_help_rect_one.length > 0~ + font: LOWREZ_FONT_PATH } +** Processing line: ~~ - Inside source: true *** True Line Result - if context_help_rect_one && context_help_rect_one.length > 0 -** Processing line: ~ context_help += <<-S~ + +** Processing line: ~ # You are provided args.lowrez.default_label which returns a Hash that you~ - Inside source: true *** True Line Result - context_help += <<-S -** Processing line: ~ rect_one needs to implement the following methods: #{context_help_rect_one}~ + # You are provided args.lowrez.default_label which returns a Hash that you +** Processing line: ~ # can ~merge~ properties with~ - Inside source: true *** True Line Result - rect_one needs to implement the following methods: #{context_help_rect_one} -** Processing line: ~~ + # can ~merge~ properties with +** Processing line: ~ # Example 1~ - Inside source: true *** True Line Result - -** Processing line: ~ You may want to try include the ~AttrRect~ module which will give you these methods.~ + # Example 1 +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - You may want to try include the ~AttrRect~ module which will give you these methods. -** Processing line: ~ S~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + .default_label +** Processing line: ~ .merge(text: "Default")~ - Inside source: true *** True Line Result - end + .merge(text: "Default") ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if context_help_rect_two && context_help_rect_two.length > 0~ +** Processing line: ~ # Example 2~ - Inside source: true *** True Line Result - if context_help_rect_two && context_help_rect_two.length > 0 -** Processing line: ~ context_help += <<-S~ + # Example 2 +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - context_help += <<-S -** Processing line: ~ * FAILURE REASON:~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - * FAILURE REASON: -** Processing line: ~ rect_two needs to implement the following methods: #{context_help_rect_two}~ + .default_label +** Processing line: ~ .merge(x: 31,~ - Inside source: true *** True Line Result - rect_two needs to implement the following methods: #{context_help_rect_two} -** Processing line: ~ NOTE: You may want to try include the ~GTK::Geometry~ module which will give you these methods.~ + .merge(x: 31, +** Processing line: ~ text: "Default",~ - Inside source: true *** True Line Result - NOTE: You may want to try include the ~GTK::Geometry~ module which will give you these methods. -** Processing line: ~ S~ + text: "Default", +** Processing line: ~ r: 128,~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + r: 128, +** Processing line: ~ g: 128,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + g: 128, +** Processing line: ~ b: 128)~ - Inside source: true *** True Line Result - -** Processing line: ~ raise e, <<-S~ + b: 128) +** Processing line: ~ end~ - Inside source: true *** True Line Result - raise e, <<-S -** Processing line: ~ * ERROR:~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - * ERROR: -** Processing line: ~ :intersect_rect? failed for~ + +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - :intersect_rect? failed for -** Processing line: ~ - rect_one: #{rect_one}~ + ## # ============================================================================= +** Processing line: ~ ## # ==== HOW TO RENDER FILLED SQUARES (SOLIDS) ==================================~ - Inside source: true *** True Line Result - - rect_one: #{rect_one} -** Processing line: ~ - rect_two: #{rect_two}~ + ## # ==== HOW TO RENDER FILLED SQUARES (SOLIDS) ================================== +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - - rect_two: #{rect_two} -** Processing line: ~ #{context_help}~ + ## # ============================================================================= +** Processing line: ~ def how_to_render_solids args~ - Inside source: true *** True Line Result - #{context_help} -** Processing line: ~ S~ + def how_to_render_solids args +** Processing line: ~ # Render a red square at 0, 0 with a width and height of 1~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + # Render a red square at 0, 0 with a width and height of 1 +** Processing line: ~ args.lowrez.solids << { x: 0, y: 0, w: 1, h: 1, r: 255, g: 0, b: 0, a: 255 }~ - Inside source: true *** True Line Result - end + args.lowrez.solids << { x: 0, y: 0, w: 1, h: 1, r: 255, g: 0, b: 0, a: 255 } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ # Render a red square at 1, 1 with a width and height of 2~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.to_square size, x, y, anchor_x = 0.5, anchor_y = nil~ + # Render a red square at 1, 1 with a width and height of 2 +** Processing line: ~ args.lowrez.solids << { x: 1, y: 1, w: 2, h: 2, r: 255, g: 0, b: 0, a: 255 }~ - Inside source: true *** True Line Result - def self.to_square size, x, y, anchor_x = 0.5, anchor_y = nil -** Processing line: ~ anchor_y ||= anchor_x~ + args.lowrez.solids << { x: 1, y: 1, w: 2, h: 2, r: 255, g: 0, b: 0, a: 255 } +** Processing line: ~~ - Inside source: true *** True Line Result - anchor_y ||= anchor_x -** Processing line: ~ x = x.shift_left(size * anchor_x)~ + +** Processing line: ~ # Render a red square at 3, 3 with a width and height of 3~ - Inside source: true *** True Line Result - x = x.shift_left(size * anchor_x) -** Processing line: ~ y = y.shift_down(size * anchor_y)~ + # Render a red square at 3, 3 with a width and height of 3 +** Processing line: ~ args.lowrez.solids << { x: 3, y: 3, w: 3, h: 3, r: 255, g: 0, b: 0 }~ - Inside source: true *** True Line Result - y = y.shift_down(size * anchor_y) -** Processing line: ~ [x, y, size, size]~ + args.lowrez.solids << { x: 3, y: 3, w: 3, h: 3, r: 255, g: 0, b: 0 } +** Processing line: ~~ - Inside source: true *** True Line Result - [x, y, size, size] -** Processing line: ~ rescue Exception => e~ + +** Processing line: ~ # Render a red square at 6, 6 with a width and height of 4~ - 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}."~ + # Render a red square at 6, 6 with a width and height of 4 +** Processing line: ~ args.lowrez.solids << { x: 6, y: 6, w: 4, h: 4, r: 255, g: 0, b: 0 }~ - 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}." -** Processing line: ~ end~ + args.lowrez.solids << { x: 6, y: 6, w: 4, h: 4, r: 255, g: 0, b: 0 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.distance point_one, point_two~ + ## # ============================================================================= +** Processing line: ~ ## # ==== HOW TO RENDER UNFILLED SQUARES (BORDERS) ===============================~ - Inside source: true *** True Line Result - 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)~ + ## # ==== HOW TO RENDER UNFILLED SQUARES (BORDERS) =============================== +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - Math.sqrt((point_two.x - point_one.x)**2 + (point_two.y - point_one.y)**2) -** Processing line: ~ rescue Exception => e~ + ## # ============================================================================= +** Processing line: ~ def how_to_render_borders args~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}."~ + def how_to_render_borders args +** Processing line: ~ # Render a red square at 0, 0 with a width and height of 3~ - Inside source: true *** True Line Result - raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}." -** Processing line: ~ end~ + # Render a red square at 0, 0 with a width and height of 3 +** Processing line: ~ args.lowrez.borders << { x: 0, y: 0, w: 3, h: 3, r: 255, g: 0, b: 0, a: 255 }~ - Inside source: true *** True Line Result - end + args.lowrez.borders << { x: 0, y: 0, w: 3, h: 3, r: 255, g: 0, b: 0, a: 255 } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ -- Inside source: true -*** True Line Result - # @gtk -** Processing line: ~ def self.angle_from start_point, end_point~ -- Inside source: true -*** True Line Result - def self.angle_from start_point, end_point -** Processing line: ~ d_y = end_point.y - start_point.y~ +** Processing line: ~ # Render a red square at 3, 3 with a width and height of 3~ - Inside source: true *** True Line Result - d_y = end_point.y - start_point.y -** Processing line: ~ d_x = end_point.x - start_point.x~ + # Render a red square at 3, 3 with a width and height of 3 +** Processing line: ~ args.lowrez.borders << { x: 3, y: 3, w: 4, h: 4, r: 255, g: 0, b: 0, a: 255 }~ - Inside source: true *** True Line Result - d_x = end_point.x - start_point.x -** Processing line: ~ Math::PI.+(Math.atan2(d_y, d_x)).to_degrees~ + args.lowrez.borders << { x: 3, y: 3, w: 4, h: 4, r: 255, g: 0, b: 0, a: 255 } +** Processing line: ~~ - Inside source: true *** True Line Result - Math::PI.+(Math.atan2(d_y, d_x)).to_degrees -** Processing line: ~ rescue Exception => e~ + +** Processing line: ~ # Render a red square at 5, 5 with a width and height of 4~ - 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}."~ + # Render a red square at 5, 5 with a width and height of 4 +** Processing line: ~ args.lowrez.borders << { x: 7, y: 7, w: 5, h: 5, r: 255, g: 0, b: 0, a: 255 }~ - Inside source: true *** True Line Result - raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}." -** Processing line: ~ end~ + args.lowrez.borders << { x: 7, y: 7, w: 5, h: 5, r: 255, g: 0, b: 0, a: 255 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.angle_to start_point, end_point~ + ## # ============================================================================= +** Processing line: ~ ## # ==== HOW TO RENDER A LINE ===================================================~ - Inside source: true *** True Line Result - def self.angle_to start_point, end_point -** Processing line: ~ angle_from end_point, start_point~ + ## # ==== HOW TO RENDER A LINE =================================================== +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - angle_from end_point, start_point -** Processing line: ~ rescue Exception => e~ + ## # ============================================================================= +** Processing line: ~ def how_to_render_lines args~ - 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}."~ + def how_to_render_lines args +** Processing line: ~ # Render a horizontal line at the bottom~ - Inside source: true *** True Line Result - raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}." -** Processing line: ~ end~ + # Render a horizontal line at the bottom +** Processing line: ~ args.lowrez.lines << { x: 0, y: 0, x2: 63, y2: 0, r: 255 }~ - Inside source: true *** True Line Result - end + args.lowrez.lines << { x: 0, y: 0, x2: 63, y2: 0, r: 255 } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ # Render a vertical line at the left~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.point_inside_circle? point, circle_center_point, radius~ + # Render a vertical line at the left +** Processing line: ~ args.lowrez.lines << { x: 0, y: 0, x2: 0, y2: 63, r: 255 }~ - Inside source: true *** True Line Result - 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~ + args.lowrez.lines << { x: 0, y: 0, x2: 0, y2: 63, r: 255 } +** Processing line: ~~ - Inside source: true *** True Line Result - (point.x - circle_center_point.x) ** 2 + (point.y - circle_center_point.y) ** 2 < radius ** 2 -** Processing line: ~ rescue Exception => e~ + +** Processing line: ~ # Render a diagonal line starting from the bottom left and going to the top right~ - 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}"~ + # Render a diagonal line starting from the bottom left and going to the top right +** Processing line: ~ args.lowrez.lines << { x: 0, y: 0, x2: 63, y2: 63, r: 255 }~ - Inside source: true *** True Line Result - raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}" -** Processing line: ~ end~ + args.lowrez.lines << { x: 0, y: 0, x2: 63, y2: 63, r: 255 } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ -- Inside source: true -*** True Line Result - # @gtk -** Processing line: ~ def self.inside_rect? inner_rect, outer_rect~ -- Inside source: true -*** True Line Result - def self.inside_rect? inner_rect, outer_rect -** Processing line: ~ inner_rect.x >= outer_rect.x &&~ +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - inner_rect.x >= outer_rect.x && -** Processing line: ~ inner_rect.right <= outer_rect.right &&~ + ## # ============================================================================= +** Processing line: ~ ## # == HOW TO RENDER A SPRITE ===================================================~ - Inside source: true *** True Line Result - inner_rect.right <= outer_rect.right && -** Processing line: ~ inner_rect.y >= outer_rect.y &&~ + ## # == HOW TO RENDER A SPRITE =================================================== +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - inner_rect.y >= outer_rect.y && -** Processing line: ~ inner_rect.top <= outer_rect.top~ + ## # ============================================================================= +** Processing line: ~ def how_to_render_sprites args~ - Inside source: true *** True Line Result - inner_rect.top <= outer_rect.top -** Processing line: ~ rescue Exception => e~ + def how_to_render_sprites args +** Processing line: ~ # Loop 10 times and create 10 sprites in 10 positions~ - 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}."~ + # Loop 10 times and create 10 sprites in 10 positions +** Processing line: ~ # Render a sprite at the bottom left with a width and height of 5 and a path of 'sprites/lowrez-ship-blue.png'~ - Inside source: true *** True Line Result - raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}." -** Processing line: ~ end~ + # Render a sprite at the bottom left with a width and height of 5 and a path of 'sprites/lowrez-ship-blue.png' +** Processing line: ~ 10.times do |i|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 10.times do |i| +** Processing line: ~ args.lowrez.sprites << {~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + args.lowrez.sprites << { +** Processing line: ~ x: i * 5,~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.scale_rect_extended rect,~ + x: i * 5, +** Processing line: ~ y: i * 5,~ - Inside source: true *** True Line Result - def self.scale_rect_extended rect, -** Processing line: ~ percentage_x: percentage_x,~ + y: i * 5, +** Processing line: ~ w: 5,~ - Inside source: true *** True Line Result - percentage_x: percentage_x, -** Processing line: ~ percentage_y: percentage_y,~ + w: 5, +** Processing line: ~ h: 5,~ - Inside source: true *** True Line Result - percentage_y: percentage_y, -** Processing line: ~ anchor_x: anchor_x,~ + h: 5, +** Processing line: ~ path: 'sprites/lowrez-ship-blue.png'~ - Inside source: true *** True Line Result - anchor_x: anchor_x, -** Processing line: ~ anchor_y: anchor_y~ + path: 'sprites/lowrez-ship-blue.png' +** Processing line: ~ }~ - Inside source: true *** True Line Result - anchor_y: anchor_y -** Processing line: ~ anchor_x ||= 0.0~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - anchor_x ||= 0.0 -** Processing line: ~ anchor_y ||= 0.0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - anchor_y ||= 0.0 -** Processing line: ~ percentage_x ||= 1.0~ + +** Processing line: ~ # Given an array of positions create sprites~ - Inside source: true *** True Line Result - percentage_x ||= 1.0 -** Processing line: ~ percentage_y ||= 1.0~ + # Given an array of positions create sprites +** Processing line: ~ positions = [~ - Inside source: true *** True Line Result - percentage_y ||= 1.0 -** Processing line: ~ new_w = rect.w * percentage_x~ + positions = [ +** Processing line: ~ { x: 10, y: 42 },~ - Inside source: true *** True Line Result - new_w = rect.w * percentage_x -** Processing line: ~ new_h = rect.h * percentage_y~ + { x: 10, y: 42 }, +** Processing line: ~ { x: 15, y: 45 },~ - Inside source: true *** True Line Result - new_h = rect.h * percentage_y -** Processing line: ~ new_x = rect.x + (rect.w - new_w) * anchor_x~ + { x: 15, y: 45 }, +** Processing line: ~ { x: 22, y: 33 },~ - Inside source: true *** True Line Result - new_x = rect.x + (rect.w - new_w) * anchor_x -** Processing line: ~ new_y = rect.y + (rect.h - new_h) * anchor_y~ + { x: 22, y: 33 }, +** Processing line: ~ ]~ - Inside source: true *** True Line Result - new_y = rect.y + (rect.h - new_h) * anchor_y -** Processing line: ~ if rect.is_a? Array~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - if rect.is_a? Array -** Processing line: ~ return [~ + +** Processing line: ~ positions.each do |position|~ - Inside source: true *** True Line Result - return [ -** Processing line: ~ new_x,~ + positions.each do |position| +** Processing line: ~ # use Ruby's ~Hash#merge~ function to create a sprite~ - Inside source: true *** True Line Result - new_x, -** Processing line: ~ new_y,~ + # use Ruby's ~Hash#merge~ function to create a sprite +** Processing line: ~ args.lowrez.sprites << position.merge(path: 'sprites/lowrez-ship-red.png',~ - Inside source: true *** True Line Result - new_y, -** Processing line: ~ new_w,~ + args.lowrez.sprites << position.merge(path: 'sprites/lowrez-ship-red.png', +** Processing line: ~ w: 5,~ - Inside source: true *** True Line Result - new_w, -** Processing line: ~ new_h,~ + w: 5, +** Processing line: ~ h: 5)~ - Inside source: true *** True Line Result - new_h, -** Processing line: ~ *rect[4..-1]~ + h: 5) +** Processing line: ~ end~ - Inside source: true *** True Line Result - *rect[4..-1] -** Processing line: ~ ]~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - ] -** Processing line: ~ elsif rect.is_a? Hash~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif rect.is_a? Hash -** Processing line: ~ return rect.merge(x: new_x, y: new_y, w: new_w, h: new_h)~ + +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - return rect.merge(x: new_x, y: new_y, w: new_w, h: new_h) -** Processing line: ~ else~ + ## # ============================================================================= +** Processing line: ~ ## # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================~ - Inside source: true *** True Line Result - else -** Processing line: ~ rect.x = new_x~ + ## # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ========================== +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - rect.x = new_x -** Processing line: ~ rect.y = new_y~ + ## # ============================================================================= +** Processing line: ~ def how_to_animate_a_sprite args~ - Inside source: true *** True Line Result - rect.y = new_y -** Processing line: ~ rect.w = new_w~ + def how_to_animate_a_sprite args +** Processing line: ~ # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds~ - Inside source: true *** True Line Result - rect.w = new_w -** Processing line: ~ rect.h = new_h~ + # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds +** Processing line: ~ start_animation_on_tick = 180~ - Inside source: true *** True Line Result - rect.h = new_h -** Processing line: ~ return rect~ + start_animation_on_tick = 180 +** Processing line: ~~ - Inside source: true *** True Line Result - return rect -** Processing line: ~ end~ + +** Processing line: ~ # STEP 2: Get the frame_index given the start tick.~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + # STEP 2: Get the frame_index given the start tick. +** Processing line: ~ sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites?~ - 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}."~ + sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites? +** Processing line: ~ hold_for: 4, # how long to hold each sprite?~ - 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}." -** Processing line: ~ end~ + hold_for: 4, # how long to hold each sprite? +** Processing line: ~ repeat: true # should it repeat?~ - Inside source: true *** True Line Result - end + repeat: true # should it repeat? ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ # STEP 3: frame_index will return nil if the frame hasn't arrived yet~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.scale_rect rect, percentage, *anchors~ + # STEP 3: frame_index will return nil if the frame hasn't arrived yet +** Processing line: ~ if sprite_index~ - Inside source: true *** True Line Result - def self.scale_rect rect, percentage, *anchors -** Processing line: ~ anchor_x, anchor_y = *anchors.flatten~ + if sprite_index +** Processing line: ~ # if the sprite_index is populated, use it to determine the sprite path and render it~ - Inside source: true *** True Line Result - anchor_x, anchor_y = *anchors.flatten -** Processing line: ~ anchor_x ||= 0~ + # if the sprite_index is populated, use it to determine the sprite path and render it +** Processing line: ~ sprite_path = "sprites/explosion-#{sprite_index}.png"~ - Inside source: true *** True Line Result - anchor_x ||= 0 -** Processing line: ~ anchor_y ||= anchor_x~ + sprite_path = "sprites/explosion-#{sprite_index}.png" +** Processing line: ~ args.lowrez.sprites << { x: 0, y: 0, w: 64, h: 64, path: sprite_path }~ - Inside source: true *** True Line Result - anchor_y ||= anchor_x -** Processing line: ~ Geometry.scale_rect_extended rect,~ + args.lowrez.sprites << { x: 0, y: 0, w: 64, h: 64, path: sprite_path } +** Processing line: ~ else~ - Inside source: true *** True Line Result - Geometry.scale_rect_extended rect, -** Processing line: ~ percentage_x: percentage,~ + else +** Processing line: ~ # if the sprite_index is nil, render a countdown instead~ - Inside source: true *** True Line Result - percentage_x: percentage, -** Processing line: ~ percentage_y: percentage,~ + # if the sprite_index is nil, render a countdown instead +** Processing line: ~ countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1)~ - Inside source: true *** True Line Result - percentage_y: percentage, -** Processing line: ~ anchor_x: anchor_x,~ + countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1) +** Processing line: ~~ - Inside source: true *** True Line Result - anchor_x: anchor_x, -** Processing line: ~ anchor_y: anchor_y~ + +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - anchor_y: anchor_y -** Processing line: ~ rescue Exception => e~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - 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)]."~ + .default_label +** Processing line: ~ .merge(x: 32,~ - Inside source: true *** True Line Result - raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)]." -** Processing line: ~ end~ + .merge(x: 32, +** Processing line: ~ y: 32,~ - Inside source: true *** True Line Result - end -** Processing line: ~ end # module Geometry~ + y: 32, +** Processing line: ~ text: "Count Down: #{countdown_in_seconds}",~ - Inside source: true *** True Line Result - end # module Geometry -** Processing line: ~ end # module GTK~ + text: "Count Down: #{countdown_in_seconds}", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - end # module GTK -** Processing line: ~~ + alignment_enum: 1) +** Processing line: ~ end~ - 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 + end ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* grid.rb~ -- Header detected. +- Inside source: true *** True Line Result +** Processing line: ~ # render the current tick and the resolved sprite index~ +- Inside source: true *** True Line Result -* grid.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - + # render the current tick and the resolved sprite index +** Processing line: ~ args.lowrez.labels << args.lowrez~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/grid.rb~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - # ./dragon/grid.rb -** Processing line: ~ # coding: utf-8~ + .default_label +** Processing line: ~ .merge(x: 0,~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + .merge(x: 0, +** Processing line: ~ y: 11,~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + y: 11, +** Processing line: ~ text: "Tick: #{args.state.tick_count}")~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # grid.rb has been released under MIT (*only this file*).~ + text: "Tick: #{args.state.tick_count}") +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - # grid.rb has been released under MIT (*only this file*). -** Processing line: ~~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + .default_label +** Processing line: ~ .merge(x: 0,~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Grid~ + .merge(x: 0, +** Processing line: ~ y: 5,~ - Inside source: true *** True Line Result - class Grid -** Processing line: ~ include Serialize~ + y: 5, +** Processing line: ~ text: "sprite_index: #{sprite_index}")~ - Inside source: true *** True Line Result - include Serialize -** Processing line: ~ SCREEN_Y_DIRECTION = -1.0~ + text: "sprite_index: #{sprite_index}") +** Processing line: ~ end~ - Inside source: true *** True Line Result - SCREEN_Y_DIRECTION = -1.0 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # The coordinate system currently in use.~ +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - # The coordinate system currently in use. -** Processing line: ~ #~ + ## # ============================================================================= +** Processing line: ~ ## # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) =================================~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Symbol] `:bottom_left` or `:center`~ + ## # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) ================================= +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - # @return [Symbol] `:bottom_left` or `:center` -** Processing line: ~ attr_accessor :name~ + ## # ============================================================================= +** Processing line: ~ def how_to_animate_a_sprite_sheet args~ - Inside source: true *** True Line Result - attr_accessor :name + def how_to_animate_a_sprite_sheet args +** Processing line: ~ # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds~ +- Inside source: true +*** True Line Result + # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds +** Processing line: ~ start_animation_on_tick = 180~ +- Inside source: true +*** True Line Result + start_animation_on_tick = 180 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns the "x" coordinate indicating the bottom of the screen.~ +** Processing line: ~ # STEP 2: Get the frame_index given the start tick.~ - Inside source: true *** True Line Result - # Returns the "x" coordinate indicating the bottom of the screen. -** Processing line: ~ #~ + # STEP 2: Get the frame_index given the start tick. +** Processing line: ~ sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites?~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites? +** Processing line: ~ hold_for: 4, # how long to hold each sprite?~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ attr_accessor :bottom~ + hold_for: 4, # how long to hold each sprite? +** Processing line: ~ repeat: true # should it repeat?~ - Inside source: true *** True Line Result - attr_accessor :bottom + repeat: true # should it repeat? ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns the "x" coordinate indicating the top of the screen.~ +** Processing line: ~ # STEP 3: frame_index will return nil if the frame hasn't arrived yet~ - Inside source: true *** True Line Result - # Returns the "x" coordinate indicating the top of the screen. -** Processing line: ~ #~ + # STEP 3: frame_index will return nil if the frame hasn't arrived yet +** Processing line: ~ if sprite_index~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + if sprite_index +** Processing line: ~ # if the sprite_index is populated, use it to determine the source rectangle and render it~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ attr_accessor :top~ + # if the sprite_index is populated, use it to determine the source rectangle and render it +** Processing line: ~ args.lowrez.sprites << {~ - Inside source: true *** True Line Result - attr_accessor :top -** Processing line: ~~ + args.lowrez.sprites << { +** Processing line: ~ x: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns the "y" coordinate indicating the left of the screen.~ + x: 0, +** Processing line: ~ y: 0,~ - Inside source: true *** True Line Result - # Returns the "y" coordinate indicating the left of the screen. -** Processing line: ~ #~ + y: 0, +** Processing line: ~ w: 64,~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + w: 64, +** Processing line: ~ h: 64,~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ attr_accessor :left~ + h: 64, +** Processing line: ~ path: "sprites/explosion-sheet.png",~ - Inside source: true *** True Line Result - attr_accessor :left -** Processing line: ~~ + path: "sprites/explosion-sheet.png", +** Processing line: ~ source_x: 32 * sprite_index,~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns the "y" coordinate indicating the right of the screen.~ + source_x: 32 * sprite_index, +** Processing line: ~ source_y: 0,~ - Inside source: true *** True Line Result - # Returns the "y" coordinate indicating the right of the screen. -** Processing line: ~ #~ + source_y: 0, +** Processing line: ~ source_w: 32,~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + source_w: 32, +** Processing line: ~ source_h: 32~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ attr_accessor :right~ + source_h: 32 +** Processing line: ~ }~ - Inside source: true *** True Line Result - attr_accessor :right -** Processing line: ~~ + } +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns the "x" coordinate indicating the center of the screen.~ + else +** Processing line: ~ # if the sprite_index is nil, render a countdown instead~ - Inside source: true *** True Line Result - # Returns the "x" coordinate indicating the center of the screen. -** Processing line: ~ #~ + # if the sprite_index is nil, render a countdown instead +** Processing line: ~ countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1)~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1) +** Processing line: ~~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ attr_accessor :center_x~ + +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - attr_accessor :center_x -** Processing line: ~~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns the "y" coordinate indicating the center of the screen.~ + .default_label +** Processing line: ~ .merge(x: 32,~ - Inside source: true *** True Line Result - # Returns the "y" coordinate indicating the center of the screen. -** Processing line: ~ #~ + .merge(x: 32, +** Processing line: ~ y: 32,~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + y: 32, +** Processing line: ~ text: "Count Down: #{countdown_in_seconds}",~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ attr_accessor :center_y~ + text: "Count Down: #{countdown_in_seconds}", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - attr_accessor :center_y + alignment_enum: 1) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns the bottom left and top right coordinates in a single list.~ +** Processing line: ~ # render the current tick and the resolved sprite index~ - Inside source: true *** True Line Result - # Returns the bottom left and top right coordinates in a single list. -** Processing line: ~ #~ + # render the current tick and the resolved sprite index +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [[Float, Float, Float, Float]]~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - # @return [[Float, Float, Float, Float]] -** Processing line: ~ attr_accessor :rect~ + .default_label +** Processing line: ~ .merge(x: 0,~ - Inside source: true *** True Line Result - attr_accessor :rect -** Processing line: ~~ + .merge(x: 0, +** Processing line: ~ y: 11,~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns the "x" coordinate of the origin.~ + y: 11, +** Processing line: ~ text: "tick: #{args.state.tick_count}")~ - Inside source: true *** True Line Result - # Returns the "x" coordinate of the origin. -** Processing line: ~ #~ + text: "tick: #{args.state.tick_count}") +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ attr_accessor :origin_x~ + .default_label +** Processing line: ~ .merge(x: 0,~ - Inside source: true *** True Line Result - attr_accessor :origin_x -** Processing line: ~~ + .merge(x: 0, +** Processing line: ~ y: 5,~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns the "y" coordinate of the origin.~ + y: 5, +** Processing line: ~ text: "sprite_index: #{sprite_index}")~ - Inside source: true *** True Line Result - # Returns the "y" coordinate of the origin. -** Processing line: ~ #~ + text: "sprite_index: #{sprite_index}") +** Processing line: ~ end~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ attr_accessor :origin_y~ + +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - attr_accessor :origin_y -** Processing line: ~~ + ## # ============================================================================= +** Processing line: ~ ## # ==== HOW TO STORE STATE, ACCEPT INPUT, AND RENDER SPRITE BASED OFF OF STATE =~ - Inside source: true *** True Line Result - -** Processing line: ~ attr_accessor :left_margin, :bottom_margin~ + ## # ==== HOW TO STORE STATE, ACCEPT INPUT, AND RENDER SPRITE BASED OFF OF STATE = +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - attr_accessor :left_margin, :bottom_margin -** Processing line: ~~ + ## # ============================================================================= +** Processing line: ~ def how_to_move_a_sprite args~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize runtime~ + def how_to_move_a_sprite args +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - def initialize runtime -** Processing line: ~ @runtime = runtime~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - @runtime = runtime -** Processing line: ~ @ffi_draw = runtime.ffi_draw~ + .default_label +** Processing line: ~ .merge(x: 32,~ - Inside source: true *** True Line Result - @ffi_draw = runtime.ffi_draw -** Processing line: ~ origin_bottom_left!~ + .merge(x: 32, +** Processing line: ~ y: 62, text: "Use Arrow Keys",~ - Inside source: true *** True Line Result - origin_bottom_left! -** Processing line: ~ end~ + y: 62, text: "Use Arrow Keys", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - end + alignment_enum: 1) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns `x` plus the origin "x".~ -- Inside source: true -*** True Line Result - # Returns `x` plus the origin "x". -** Processing line: ~ #~ +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ def transform_x x~ + .default_label +** Processing line: ~ .merge(x: 32,~ - Inside source: true *** True Line Result - def transform_x x -** Processing line: ~ @origin_x + x~ + .merge(x: 32, +** Processing line: ~ y: 56, text: "Use WASD",~ - Inside source: true *** True Line Result - @origin_x + x -** Processing line: ~ end~ + y: 56, text: "Use WASD", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - end + alignment_enum: 1) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns `x` minus the origin "x".~ -- Inside source: true -*** True Line Result - # Returns `x` minus the origin "x". -** Processing line: ~ #~ +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ def untransform_x x~ + .default_label +** Processing line: ~ .merge(x: 32,~ - Inside source: true *** True Line Result - def untransform_x x -** Processing line: ~ x - @origin_x~ + .merge(x: 32, +** Processing line: ~ y: 50, text: "Or Click",~ - Inside source: true *** True Line Result - x - @origin_x -** Processing line: ~ end~ + y: 50, text: "Or Click", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - end + alignment_enum: 1) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns `y` plus the origin "y".~ +** Processing line: ~ # set the initial values for x and y using ||= ("or equal operator")~ - Inside source: true *** True Line Result - # Returns `y` plus the origin "y". -** Processing line: ~ #~ + # set the initial values for x and y using ||= ("or equal operator") +** Processing line: ~ args.state.ship.x ||= 0~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + args.state.ship.x ||= 0 +** Processing line: ~ args.state.ship.y ||= 0~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ def transform_y y~ + args.state.ship.y ||= 0 +** Processing line: ~~ - Inside source: true *** True Line Result - def transform_y y -** Processing line: ~ @origin_y + y * SCREEN_Y_DIRECTION~ + +** Processing line: ~ # if a mouse click occurs, update the ship's x and y to be the location of the click~ - Inside source: true *** True Line Result - @origin_y + y * SCREEN_Y_DIRECTION -** Processing line: ~ end~ + # if a mouse click occurs, update the ship's x and y to be the location of the click +** Processing line: ~ if args.lowrez.mouse_click~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if args.lowrez.mouse_click +** Processing line: ~ args.state.ship.x = args.lowrez.mouse_click.x~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns `y` minus the origin "y".~ + args.state.ship.x = args.lowrez.mouse_click.x +** Processing line: ~ args.state.ship.y = args.lowrez.mouse_click.y~ - Inside source: true *** True Line Result - # Returns `y` minus the origin "y". -** Processing line: ~ #~ + args.state.ship.y = args.lowrez.mouse_click.y +** Processing line: ~ end~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ def untransform_y y~ + +** Processing line: ~ # if a or left arrow is pressed/held, decrement the ships x position~ - Inside source: true *** True Line Result - def untransform_y y -** Processing line: ~ @origin_y + y * SCREEN_Y_DIRECTION~ + # if a or left arrow is pressed/held, decrement the ships x position +** Processing line: ~ if args.lowrez.keyboard.left~ - Inside source: true *** True Line Result - @origin_y + y * SCREEN_Y_DIRECTION -** Processing line: ~ end~ + if args.lowrez.keyboard.left +** Processing line: ~ args.state.ship.x -= 1~ - Inside source: true *** True Line Result - end + args.state.ship.x -= 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def ffi_draw~ +** Processing line: ~ # if d or right arrow is pressed/held, increment the ships x position~ - Inside source: true *** True Line Result - def ffi_draw -** Processing line: ~ @ffi_draw~ + # if d or right arrow is pressed/held, increment the ships x position +** Processing line: ~ if args.lowrez.keyboard.right~ - Inside source: true *** True Line Result - @ffi_draw -** Processing line: ~ end~ + if args.lowrez.keyboard.right +** Processing line: ~ args.state.ship.x += 1~ - Inside source: true *** True Line Result - end + args.state.ship.x += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def ffi_draw= value~ +** Processing line: ~ # if s or down arrow is pressed/held, decrement the ships y position~ - Inside source: true *** True Line Result - def ffi_draw= value -** Processing line: ~ @ffi_draw = value~ + # if s or down arrow is pressed/held, decrement the ships y position +** Processing line: ~ if args.lowrez.keyboard.down~ - Inside source: true *** True Line Result - @ffi_draw = value -** Processing line: ~ end~ + if args.lowrez.keyboard.down +** Processing line: ~ args.state.ship.y -= 1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.ship.y -= 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # Sets the rendering coordinate system to have its origin in the bottom left.~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # Sets the rendering coordinate system to have its origin in the bottom left. -** Processing line: ~ #~ + +** Processing line: ~ # if w or up arrow is pressed/held, increment the ships y position~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [void]~ + # if w or up arrow is pressed/held, increment the ships y position +** Processing line: ~ if args.lowrez.keyboard.up~ - Inside source: true *** True Line Result - # @return [void] -** Processing line: ~ # @gtk~ + if args.lowrez.keyboard.up +** Processing line: ~ args.state.ship.y += 1~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def origin_bottom_left!~ + args.state.ship.y += 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - def origin_bottom_left! -** Processing line: ~ return if @name == :bottom_left~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - return if @name == :bottom_left -** Processing line: ~ @name = :bottom_left~ + +** Processing line: ~ # render the sprite to the screen using the position stored in args.state.ship~ - Inside source: true *** True Line Result - @name = :bottom_left -** Processing line: ~ @origin_x = 0.0~ + # render the sprite to the screen using the position stored in args.state.ship +** Processing line: ~ args.lowrez.sprites << {~ - Inside source: true *** True Line Result - @origin_x = 0.0 -** Processing line: ~ @origin_y = @runtime.logical_height~ + args.lowrez.sprites << { +** Processing line: ~ x: args.state.ship.x,~ - Inside source: true *** True Line Result - @origin_y = @runtime.logical_height -** Processing line: ~ @left = 0.0~ + x: args.state.ship.x, +** Processing line: ~ y: args.state.ship.y,~ - Inside source: true *** True Line Result - @left = 0.0 -** Processing line: ~ @right = @runtime.logical_width~ + y: args.state.ship.y, +** Processing line: ~ w: 5,~ - Inside source: true *** True Line Result - @right = @runtime.logical_width -** Processing line: ~ @top = @runtime.logical_height~ + w: 5, +** Processing line: ~ h: 5,~ - Inside source: true *** True Line Result - @top = @runtime.logical_height -** Processing line: ~ @bottom = 0.0~ + h: 5, +** Processing line: ~ path: 'sprites/lowrez-ship-blue.png',~ - Inside source: true *** True Line Result - @bottom = 0.0 -** Processing line: ~ @left_margin = 0.0~ + path: 'sprites/lowrez-ship-blue.png', +** Processing line: ~ # parameters beyond this point are optional~ - Inside source: true *** True Line Result - @left_margin = 0.0 -** Processing line: ~ @bottom_margin = 0.0~ + # parameters beyond this point are optional +** Processing line: ~ angle: 0, # Note: rotation angle is denoted in degrees NOT radians~ - Inside source: true *** True Line Result - @bottom_margin = 0.0 -** Processing line: ~ @center_x = @runtime.logical_width.half~ + angle: 0, # Note: rotation angle is denoted in degrees NOT radians +** Processing line: ~ r: 255,~ - Inside source: true *** True Line Result - @center_x = @runtime.logical_width.half -** Processing line: ~ @center_y = @runtime.logical_height.half~ + r: 255, +** Processing line: ~ g: 255,~ - Inside source: true *** True Line Result - @center_y = @runtime.logical_height.half -** Processing line: ~ @rect = [@left, @bottom, @runtime.logical_width, @runtime.logical_height].rect~ + g: 255, +** Processing line: ~ b: 255,~ - Inside source: true *** True Line Result - @rect = [@left, @bottom, @runtime.logical_width, @runtime.logical_height].rect -** Processing line: ~ @center = [@center_x, @center_y].point~ + b: 255, +** Processing line: ~ a: 255~ - Inside source: true *** True Line Result - @center = [@center_x, @center_y].point -** Processing line: ~ @ffi_draw.set_grid @origin_x, @origin_y, SCREEN_Y_DIRECTION~ + a: 255 +** Processing line: ~ }~ - Inside source: true *** True Line Result - @ffi_draw.set_grid @origin_x, @origin_y, SCREEN_Y_DIRECTION -** Processing line: ~ end~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Sets the rendering coordinate system to have its origin in the center.~ +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - # Sets the rendering coordinate system to have its origin in the center. -** Processing line: ~ #~ + # ======================================================================= +** Processing line: ~ # ==== HOW TO DETERMINE COLLISION =======================================~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [void]~ + # ==== HOW TO DETERMINE COLLISION ======================================= +** Processing line: ~ # =======================================================================~ - Inside source: true *** True Line Result - # @return [void] -** Processing line: ~ # @gtk~ + # ======================================================================= +** Processing line: ~ def how_to_determine_collision args~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def origin_center!~ + def how_to_determine_collision args +** Processing line: ~ # Render the instructions~ - Inside source: true *** True Line Result - def origin_center! -** Processing line: ~ return if @name == :center~ + # Render the instructions +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - return if @name == :center -** Processing line: ~ @name = :center~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - @name = :center -** Processing line: ~ @origin_x = @runtime.logical_width.half~ + .default_label +** Processing line: ~ .merge(x: 32,~ - Inside source: true *** True Line Result - @origin_x = @runtime.logical_width.half -** Processing line: ~ @origin_y = @runtime.logical_height.half~ + .merge(x: 32, +** Processing line: ~ y: 62, text: "Click Anywhere",~ - Inside source: true *** True Line Result - @origin_y = @runtime.logical_height.half -** Processing line: ~ @left = -@runtime.logical_width.half~ + y: 62, text: "Click Anywhere", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - @left = -@runtime.logical_width.half -** Processing line: ~ @right = @runtime.logical_width.half~ + alignment_enum: 1) +** Processing line: ~~ - Inside source: true *** True Line Result - @right = @runtime.logical_width.half -** Processing line: ~ @top = @runtime.logical_height.half~ + +** Processing line: ~ # if a mouse click occurs:~ - Inside source: true *** True Line Result - @top = @runtime.logical_height.half -** Processing line: ~ @bottom = -@runtime.logical_height.half~ + # if a mouse click occurs: +** Processing line: ~ # - set ship_one if it isn't set~ - Inside source: true *** True Line Result - @bottom = -@runtime.logical_height.half -** Processing line: ~ @center_x = 0.0~ + # - set ship_one if it isn't set +** Processing line: ~ # - set ship_two if it isn't set~ - Inside source: true *** True Line Result - @center_x = 0.0 -** Processing line: ~ @center_y = 0.0~ + # - set ship_two if it isn't set +** Processing line: ~ # - otherwise reset ship one and ship two~ - Inside source: true *** True Line Result - @center_y = 0.0 -** Processing line: ~ @rect = [@left, @bottom, @runtime.logical_width, @runtime.logical_height].rect~ + # - otherwise reset ship one and ship two +** Processing line: ~ if args.lowrez.mouse_click~ - Inside source: true *** True Line Result - @rect = [@left, @bottom, @runtime.logical_width, @runtime.logical_height].rect -** Processing line: ~ @center = [@center_x, @center_y].point~ + if args.lowrez.mouse_click +** Processing line: ~ # is ship_one set?~ - Inside source: true *** True Line Result - @center = [@center_x, @center_y].point -** Processing line: ~ @ffi_draw.set_grid @origin_x, @origin_y, SCREEN_Y_DIRECTION~ + # is ship_one set? +** Processing line: ~ if !args.state.ship_one~ - Inside source: true *** True Line Result - @ffi_draw.set_grid @origin_x, @origin_y, SCREEN_Y_DIRECTION -** Processing line: ~ end~ + if !args.state.ship_one +** Processing line: ~ args.state.ship_one = { x: args.lowrez.mouse_click.x - 10,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.ship_one = { x: args.lowrez.mouse_click.x - 10, +** Processing line: ~ y: args.lowrez.mouse_click.y - 10,~ - Inside source: true *** True Line Result - -** Processing line: ~ # The logical width used for rendering.~ + y: args.lowrez.mouse_click.y - 10, +** Processing line: ~ w: 20,~ - Inside source: true *** True Line Result - # The logical width used for rendering. -** Processing line: ~ #~ + w: 20, +** Processing line: ~ h: 20 }~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + h: 20 } +** Processing line: ~ # is ship_one set?~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ def w~ + # is ship_one set? +** Processing line: ~ elsif !args.state.ship_two~ - Inside source: true *** True Line Result - def w -** Processing line: ~ @runtime.logical_width~ + elsif !args.state.ship_two +** Processing line: ~ args.state.ship_two = { x: args.lowrez.mouse_click.x - 10,~ - Inside source: true *** True Line Result - @runtime.logical_width -** Processing line: ~ end~ + args.state.ship_two = { x: args.lowrez.mouse_click.x - 10, +** Processing line: ~ y: args.lowrez.mouse_click.y - 10,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + y: args.lowrez.mouse_click.y - 10, +** Processing line: ~ w: 20,~ - Inside source: true *** True Line Result - -** Processing line: ~ # Half the logical width used for rendering.~ + w: 20, +** Processing line: ~ h: 20 }~ - Inside source: true *** True Line Result - # Half the logical width used for rendering. -** Processing line: ~ #~ + h: 20 } +** Processing line: ~ # should we reset?~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + # should we reset? +** Processing line: ~ else~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ def w_half~ + else +** Processing line: ~ args.state.ship_one = nil~ - Inside source: true *** True Line Result - def w_half -** Processing line: ~ w.half~ + args.state.ship_one = nil +** Processing line: ~ args.state.ship_two = nil~ - Inside source: true *** True Line Result - w.half + args.state.ship_two = nil ** 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: ~ # The logical height used for rendering.~ +** Processing line: ~ # render ship one if it's set~ - Inside source: true *** True Line Result - # The logical height used for rendering. -** Processing line: ~ #~ + # render ship one if it's set +** Processing line: ~ if args.state.ship_one~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + if args.state.ship_one +** Processing line: ~ # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ def h~ + # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha +** Processing line: ~ # render ship one~ - Inside source: true *** True Line Result - def h -** Processing line: ~ @runtime.logical_height~ + # render ship one +** Processing line: ~ args.lowrez.sprites << args.state.ship_one.merge(path: 'sprites/lowrez-ship-blue.png', a: 100)~ - Inside source: true *** True Line Result - @runtime.logical_height -** Processing line: ~ end~ + args.lowrez.sprites << args.state.ship_one.merge(path: 'sprites/lowrez-ship-blue.png', a: 100) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Half the logical height used for rendering.~ -- Inside source: true -*** True Line Result - # Half the logical height used for rendering. -** Processing line: ~ #~ +** Processing line: ~ if args.state.ship_two~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float]~ + if args.state.ship_two +** Processing line: ~ # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha~ - Inside source: true *** True Line Result - # @return [Float] -** Processing line: ~ def h_half~ + # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha +** Processing line: ~ # render ship two~ - Inside source: true *** True Line Result - def h_half -** Processing line: ~ h.half~ + # render ship two +** Processing line: ~ args.lowrez.sprites << args.state.ship_two.merge(path: 'sprites/lowrez-ship-red.png', a: 100)~ - Inside source: true *** True Line Result - h.half -** Processing line: ~ end~ + args.lowrez.sprites << args.state.ship_two.merge(path: 'sprites/lowrez-ship-red.png', a: 100) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns the coordinates indicating the center of the screen.~ +** Processing line: ~ # if both ship one and ship two are set, then determine collision~ - Inside source: true *** True Line Result - # Returns the coordinates indicating the center of the screen. -** Processing line: ~ #~ -- Inside source: true -*** True Line Result - # -** Processing line: ~ # @return [[Float, Float]]~ + # if both ship one and ship two are set, then determine collision +** Processing line: ~ if args.state.ship_one && args.state.ship_two~ - Inside source: true *** True Line Result - # @return [[Float, Float]] -** Processing line: ~ def center~ + if args.state.ship_one && args.state.ship_two +** Processing line: ~ # collision is determined using the intersect_rect? method~ - Inside source: true *** True Line Result - def center -** Processing line: ~ @center~ + # collision is determined using the intersect_rect? method +** Processing line: ~ if args.state.ship_one.intersect_rect? args.state.ship_two~ - Inside source: true *** True Line Result - @center -** Processing line: ~ end~ + if args.state.ship_one.intersect_rect? args.state.ship_two +** Processing line: ~ # if collision occurred, render the words collision!~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # if collision occurred, render the words collision! +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns the coordinates indicating the bottom right of the screen.~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - # Returns the coordinates indicating the bottom right of the screen. -** Processing line: ~ #~ + .default_label +** Processing line: ~ .merge(x: 31,~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [[Float, Float]]~ + .merge(x: 31, +** Processing line: ~ y: 5,~ - Inside source: true *** True Line Result - # @return [[Float, Float]] -** Processing line: ~ def bottom_right~ + y: 5, +** Processing line: ~ text: "Collision!",~ - Inside source: true *** True Line Result - def bottom_right -** Processing line: ~ [@right, @bottom].point~ + text: "Collision!", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - [@right, @bottom].point -** Processing line: ~ end~ + alignment_enum: 1) +** Processing line: ~ else~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + else +** Processing line: ~ # if collision occurred, render the words no collision.~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + # if collision occurred, render the words no collision. +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - 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: ~* inputs.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* inputs.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/inputs.rb~ + .default_label +** Processing line: ~ .merge(x: 31,~ - Inside source: true *** True Line Result - # ./dragon/inputs.rb -** Processing line: ~ # coding: utf-8~ + .merge(x: 31, +** Processing line: ~ y: 5,~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + y: 5, +** Processing line: ~ text: "No Collision.",~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + text: "No Collision.", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # inputs.rb has been released under MIT (*only this file*).~ + alignment_enum: 1) +** Processing line: ~ end~ - Inside source: true *** True Line Result - # inputs.rb has been released under MIT (*only this file*). -** Processing line: ~~ + end +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + else +** Processing line: ~ # if both ship one and ship two aren't set, then render --~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ # Represents all the keys available on the keyboard.~ + # if both ship one and ship two aren't set, then render -- +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - # Represents all the keys available on the keyboard. -** Processing line: ~ # @gtk~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ class KeyboardKeys~ + .default_label +** Processing line: ~ .merge(x: 31,~ - Inside source: true *** True Line Result - class KeyboardKeys -** Processing line: ~ include Serialize~ + .merge(x: 31, +** Processing line: ~ y: 6,~ - Inside source: true *** True Line Result - include Serialize -** Processing line: ~~ + y: 6, +** Processing line: ~ text: "--",~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + text: "--", +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_accessor :exclamation_point,~ + alignment_enum: 1) +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_accessor :exclamation_point, -** Processing line: ~ :zero, :one, :two, :three, :four,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - :zero, :one, :two, :three, :four, -** Processing line: ~ :five, :six, :seven, :eight, :nine,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - :five, :six, :seven, :eight, :nine, -** Processing line: ~ :backspace, :delete, :escape, :enter, :tab,~ + +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - :backspace, :delete, :escape, :enter, :tab, -** Processing line: ~ :open_round_brace, :close_round_brace,~ + ## # ============================================================================= +** Processing line: ~ ## # ==== HOW TO CREATE BUTTONS ==================================================~ - Inside source: true *** True Line Result - :open_round_brace, :close_round_brace, -** Processing line: ~ :open_curly_brace, :close_curly_brace,~ + ## # ==== HOW TO CREATE BUTTONS ================================================== +** Processing line: ~ ## # =============================================================================~ - Inside source: true *** True Line Result - :open_curly_brace, :close_curly_brace, -** Processing line: ~ :open_square_brace, :close_square_brace,~ + ## # ============================================================================= +** Processing line: ~ def how_to_create_buttons args~ - Inside source: true *** True Line Result - :open_square_brace, :close_square_brace, -** Processing line: ~ :colon, :semicolon, :equal_sign,~ + def how_to_create_buttons args +** Processing line: ~ # Define a button style~ - Inside source: true *** True Line Result - :colon, :semicolon, :equal_sign, -** Processing line: ~ :hyphen, :space, :dollar_sign,~ + # Define a button style +** Processing line: ~ args.state.button_style = { w: 62, h: 10, r: 80, g: 80, b: 80 }~ - Inside source: true *** True Line Result - :hyphen, :space, :dollar_sign, -** Processing line: ~ :double_quotation_mark,~ + args.state.button_style = { w: 62, h: 10, r: 80, g: 80, b: 80 } +** Processing line: ~ args.state.label_style = { r: 80, g: 80, b: 80 }~ - Inside source: true *** True Line Result - :double_quotation_mark, -** Processing line: ~ :single_quotation_mark,~ + args.state.label_style = { r: 80, g: 80, b: 80 } +** Processing line: ~~ - Inside source: true *** True Line Result - :single_quotation_mark, -** Processing line: ~ :backtick,~ + +** Processing line: ~ # Render instructions~ - Inside source: true *** True Line Result - :backtick, -** Processing line: ~ :tilde, :period, :comma, :pipe,~ + # Render instructions +** Processing line: ~ args.state.button_message ||= "Press a Button!"~ - Inside source: true *** True Line Result - :tilde, :period, :comma, :pipe, -** Processing line: ~ :underscore,~ + args.state.button_message ||= "Press a Button!" +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - :underscore, -** Processing line: ~ :a, :b, :c, :d, :e, :f, :g, :h,~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - :a, :b, :c, :d, :e, :f, :g, :h, -** Processing line: ~ :i, :j, :k, :l, :m, :n, :o, :p,~ + .default_label +** Processing line: ~ .merge(args.state.label_style)~ - Inside source: true *** True Line Result - :i, :j, :k, :l, :m, :n, :o, :p, -** Processing line: ~ :q, :r, :s, :t, :u, :v, :w, :x,~ + .merge(args.state.label_style) +** Processing line: ~ .merge(x: 32,~ - Inside source: true *** True Line Result - :q, :r, :s, :t, :u, :v, :w, :x, -** Processing line: ~ :y, :z,~ + .merge(x: 32, +** Processing line: ~ y: 62,~ - Inside source: true *** True Line Result - :y, :z, -** Processing line: ~ :shift, :control, :alt, :meta,~ + y: 62, +** Processing line: ~ text: args.state.button_message,~ - Inside source: true *** True Line Result - :shift, :control, :alt, :meta, -** Processing line: ~ :left, :right, :up, :down, :pageup, :pagedown,~ + text: args.state.button_message, +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - :left, :right, :up, :down, :pageup, :pagedown, -** Processing line: ~ :char, :plus, :at, :forward_slash, :back_slash, :asterisk,~ + alignment_enum: 1) +** Processing line: ~~ - Inside source: true *** True Line Result - :char, :plus, :at, :forward_slash, :back_slash, :asterisk, -** Processing line: ~ :less_than, :greater_than, :carat, :ampersand, :superscript_two,~ + +** Processing line: ~~ - Inside source: true *** True Line Result - :less_than, :greater_than, :carat, :ampersand, :superscript_two, -** Processing line: ~ :circumflex,~ + +** Processing line: ~ # Creates button one using a border and a label~ - Inside source: true *** True Line Result - :circumflex, -** Processing line: ~ :question_mark, :section_sign, :ordinal_indicator,~ + # Creates button one using a border and a label +** Processing line: ~ args.state.button_one_border = args.state.button_style.merge( x: 1, y: 32)~ - Inside source: true *** True Line Result - :question_mark, :section_sign, :ordinal_indicator, -** Processing line: ~ :raw_key~ + args.state.button_one_border = args.state.button_style.merge( x: 1, y: 32) +** Processing line: ~ args.lowrez.borders << args.state.button_one_border~ - Inside source: true *** True Line Result - :raw_key -** Processing line: ~~ + args.lowrez.borders << args.state.button_one_border +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.sdl_to_key raw_key, modifier~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - def self.sdl_to_key raw_key, modifier -** Processing line: ~ return nil unless (raw_key >= 0 && raw_key <= 255) ||~ + .default_label +** Processing line: ~ .merge(args.state.label_style)~ - Inside source: true *** True Line Result - return nil unless (raw_key >= 0 && raw_key <= 255) || -** Processing line: ~ raw_key == 1073741903 ||~ + .merge(args.state.label_style) +** Processing line: ~ .merge(x: args.state.button_one_border.x + 2,~ - Inside source: true *** True Line Result - raw_key == 1073741903 || -** Processing line: ~ raw_key == 1073741904 ||~ + .merge(x: args.state.button_one_border.x + 2, +** Processing line: ~ y: args.state.button_one_border.y + LOWREZ_FONT_SM_HEIGHT + 2,~ - Inside source: true *** True Line Result - raw_key == 1073741904 || -** Processing line: ~ raw_key == 1073741905 ||~ + y: args.state.button_one_border.y + LOWREZ_FONT_SM_HEIGHT + 2, +** Processing line: ~ text: "Button One")~ - Inside source: true *** True Line Result - raw_key == 1073741905 || -** Processing line: ~ raw_key == 1073741906 ||~ + text: "Button One") +** Processing line: ~~ - Inside source: true *** True Line Result - raw_key == 1073741906 || -** Processing line: ~ raw_key == 1073741899 ||~ + +** Processing line: ~ # Creates button two using a border and a label~ - Inside source: true *** True Line Result - raw_key == 1073741899 || -** Processing line: ~ raw_key == 1073741902~ + # Creates button two using a border and a label +** Processing line: ~ args.state.button_two_border = args.state.button_style.merge( x: 1, y: 20)~ - Inside source: true *** True Line Result - raw_key == 1073741902 + args.state.button_two_border = args.state.button_style.merge( x: 1, y: 20) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ char = KeyboardKeys.char_with_shift raw_key, modifier~ -- Inside source: true -*** True Line Result - char = KeyboardKeys.char_with_shift raw_key, modifier -** Processing line: ~ names = KeyboardKeys.char_to_method char, raw_key~ +** Processing line: ~ args.lowrez.borders << args.state.button_two_border~ - Inside source: true *** True Line Result - names = KeyboardKeys.char_to_method char, raw_key -** Processing line: ~ names << :alt if (modifier & (256|512)) != 0 # alt key~ + args.lowrez.borders << args.state.button_two_border +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - names << :alt if (modifier & (256|512)) != 0 # alt key -** Processing line: ~ names << :meta if (modifier & (1024|2048)) != 0 # meta key (command/apple/windows key)~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - names << :meta if (modifier & (1024|2048)) != 0 # meta key (command/apple/windows key) -** Processing line: ~ names << :control if (modifier & (64|128)) != 0 # ctrl key~ + .default_label +** Processing line: ~ .merge(args.state.label_style)~ - Inside source: true *** True Line Result - names << :control if (modifier & (64|128)) != 0 # ctrl key -** Processing line: ~ names << :shift if (modifier & (1|2)) != 0 # shift key~ + .merge(args.state.label_style) +** Processing line: ~ .merge(x: args.state.button_two_border.x + 2,~ - Inside source: true *** True Line Result - names << :shift if (modifier & (1|2)) != 0 # shift key -** Processing line: ~ names~ + .merge(x: args.state.button_two_border.x + 2, +** Processing line: ~ y: args.state.button_two_border.y + LOWREZ_FONT_SM_HEIGHT + 2,~ - Inside source: true *** True Line Result - names -** Processing line: ~ end~ + y: args.state.button_two_border.y + LOWREZ_FONT_SM_HEIGHT + 2, +** Processing line: ~ text: "Button Two")~ - Inside source: true *** True Line Result - end + text: "Button Two") ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.utf_8_char raw_key~ -- Inside source: true -*** True Line Result - def self.utf_8_char raw_key -** Processing line: ~ return "²" if raw_key == 178~ -- Inside source: true -*** True Line Result - return "²" if raw_key == 178 -** Processing line: ~ return "§" if raw_key == 167~ -- Inside source: true -*** True Line Result - return "§" if raw_key == 167 -** Processing line: ~ return "º" if raw_key == 186~ -- Inside source: true -*** True Line Result - return "º" if raw_key == 186 -** Processing line: ~ return raw_key.chr~ +** Processing line: ~ # Initialize the state variable that tracks which button was clicked to "" (empty stringI~ - Inside source: true *** True Line Result - return raw_key.chr -** Processing line: ~ end~ + # Initialize the state variable that tracks which button was clicked to "" (empty stringI +** Processing line: ~ args.state.last_button_clicked ||= "--"~ - Inside source: true *** True Line Result - end + args.state.last_button_clicked ||= "--" ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.char_with_shift raw_key, modifier~ +** Processing line: ~ # If a click occurs, check to see if either button one, or button two was clicked~ - Inside source: true *** True Line Result - def self.char_with_shift raw_key, modifier -** Processing line: ~ return nil unless raw_key >= 0 && raw_key <= 255~ + # If a click occurs, check to see if either button one, or button two was clicked +** Processing line: ~ # using the inside_rect? method of the mouse~ - Inside source: true *** True Line Result - return nil unless raw_key >= 0 && raw_key <= 255 -** Processing line: ~ if modifier != 1 && modifier != 2 && modifier != 3~ + # using the inside_rect? method of the mouse +** Processing line: ~ # set args.state.last_button_clicked accordingly~ - Inside source: true *** True Line Result - if modifier != 1 && modifier != 2 && modifier != 3 -** Processing line: ~ return utf_8_char raw_key~ + # set args.state.last_button_clicked accordingly +** Processing line: ~ if args.lowrez.mouse_click~ - Inside source: true *** True Line Result - return utf_8_char raw_key -** Processing line: ~ else~ + if args.lowrez.mouse_click +** Processing line: ~ if args.lowrez.mouse_click.inside_rect? args.state.button_one_border~ - Inside source: true *** True Line Result - else -** Processing line: ~ @shift_keys ||= {~ + if args.lowrez.mouse_click.inside_rect? args.state.button_one_border +** Processing line: ~ args.state.last_button_clicked = "One Clicked!"~ - Inside source: true *** True Line Result - @shift_keys ||= { -** Processing line: ~ '`' => '~', '-' => '_', "'" => '"', "1" => '!',~ + args.state.last_button_clicked = "One Clicked!" +** Processing line: ~ elsif args.lowrez.mouse_click.inside_rect? args.state.button_two_border~ - Inside source: true *** True Line Result - '`' => '~', '-' => '_', "'" => '"', "1" => '!', -** Processing line: ~ "2" => '@', "3" => '#', "4" => '$', "5" => '%',~ + elsif args.lowrez.mouse_click.inside_rect? args.state.button_two_border +** Processing line: ~ args.state.last_button_clicked = "Two Clicked!"~ - Inside source: true *** True Line Result - "2" => '@', "3" => '#', "4" => '$', "5" => '%', -** Processing line: ~ "6" => '^', "7" => '&', "8" => '*', "9" => '(',~ + args.state.last_button_clicked = "Two Clicked!" +** Processing line: ~ else~ - Inside source: true *** True Line Result - "6" => '^', "7" => '&', "8" => '*', "9" => '(', -** Processing line: ~ "0" => ')', ";" => ":", "=" => "+", "[" => "{",~ + else +** Processing line: ~ args.state.last_button_clicked = "--"~ - Inside source: true *** True Line Result - "0" => ')', ";" => ":", "=" => "+", "[" => "{", -** Processing line: ~ "]" => "}", '\\'=> "|", '/' => "?", '.' => ">",~ + args.state.last_button_clicked = "--" +** Processing line: ~ end~ - Inside source: true *** True Line Result - "]" => "}", '\\'=> "|", '/' => "?", '.' => ">", -** Processing line: ~ ',' => "<", 'a' => 'A', 'b' => 'B', 'c' => 'C',~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - ',' => "<", 'a' => 'A', 'b' => 'B', 'c' => 'C', -** Processing line: ~ 'd' => 'D', 'e' => 'E', 'f' => 'F', 'g' => 'G',~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 'd' => 'D', 'e' => 'E', 'f' => 'F', 'g' => 'G', -** Processing line: ~ 'h' => 'H', 'i' => 'I', 'j' => 'J', 'k' => 'K',~ + +** Processing line: ~ # Render the current value of args.state.last_button_clicked~ - Inside source: true *** True Line Result - 'h' => 'H', 'i' => 'I', 'j' => 'J', 'k' => 'K', -** Processing line: ~ 'l' => 'L', 'm' => 'M', 'n' => 'N', 'o' => 'O',~ + # Render the current value of args.state.last_button_clicked +** Processing line: ~ args.lowrez.labels << args.lowrez~ - Inside source: true *** True Line Result - 'l' => 'L', 'm' => 'M', 'n' => 'N', 'o' => 'O', -** Processing line: ~ 'p' => 'P', 'q' => 'Q', 'r' => 'R', 's' => 'S',~ + args.lowrez.labels << args.lowrez +** Processing line: ~ .default_label~ - Inside source: true *** True Line Result - 'p' => 'P', 'q' => 'Q', 'r' => 'R', 's' => 'S', -** Processing line: ~ 't' => 'T', 'u' => 'U', 'v' => 'V', 'w' => 'W',~ + .default_label +** Processing line: ~ .merge(args.state.label_style)~ - Inside source: true *** True Line Result - 't' => 'T', 'u' => 'U', 'v' => 'V', 'w' => 'W', -** Processing line: ~ 'x' => 'X', 'y' => 'Y', 'z' => 'Z'~ + .merge(args.state.label_style) +** Processing line: ~ .merge(x: 32,~ - Inside source: true *** True Line Result - 'x' => 'X', 'y' => 'Y', 'z' => 'Z' -** Processing line: ~ }~ + .merge(x: 32, +** Processing line: ~ y: 5,~ - Inside source: true *** True Line Result - } -** Processing line: ~~ + y: 5, +** Processing line: ~ text: args.state.last_button_clicked,~ - Inside source: true *** True Line Result - -** Processing line: ~ @shift_keys[raw_key.chr.to_s] || raw_key.chr.to_s~ + text: args.state.last_button_clicked, +** Processing line: ~ alignment_enum: 1)~ - Inside source: true *** True Line Result - @shift_keys[raw_key.chr.to_s] || raw_key.chr.to_s -** Processing line: ~ end~ + alignment_enum: 1) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end + ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.char_to_method_hash~ +** Processing line: ~ def render_debug args~ - Inside source: true *** True Line Result - def self.char_to_method_hash -** Processing line: ~ @char_to_method ||= {~ + def render_debug args +** Processing line: ~ if !args.state.grid_rendered~ - Inside source: true *** True Line Result - @char_to_method ||= { -** Processing line: ~ 'A' => [:a, :shift],~ + if !args.state.grid_rendered +** Processing line: ~ 65.map_with_index do |i|~ - Inside source: true *** True Line Result - 'A' => [:a, :shift], -** Processing line: ~ 'B' => [:b, :shift],~ + 65.map_with_index do |i| +** Processing line: ~ args.outputs.static_debug << {~ - Inside source: true *** True Line Result - 'B' => [:b, :shift], -** Processing line: ~ 'C' => [:c, :shift],~ + args.outputs.static_debug << { +** Processing line: ~ x: LOWREZ_X_OFFSET,~ - Inside source: true *** True Line Result - 'C' => [:c, :shift], -** Processing line: ~ 'D' => [:d, :shift],~ + x: LOWREZ_X_OFFSET, +** Processing line: ~ y: LOWREZ_Y_OFFSET + (i * 10),~ - Inside source: true *** True Line Result - 'D' => [:d, :shift], -** Processing line: ~ 'E' => [:e, :shift],~ + y: LOWREZ_Y_OFFSET + (i * 10), +** Processing line: ~ x2: LOWREZ_X_OFFSET + LOWREZ_ZOOMED_SIZE,~ - Inside source: true *** True Line Result - 'E' => [:e, :shift], -** Processing line: ~ 'F' => [:f, :shift],~ + x2: LOWREZ_X_OFFSET + LOWREZ_ZOOMED_SIZE, +** Processing line: ~ y2: LOWREZ_Y_OFFSET + (i * 10),~ - Inside source: true *** True Line Result - 'F' => [:f, :shift], -** Processing line: ~ 'G' => [:g, :shift],~ + y2: LOWREZ_Y_OFFSET + (i * 10), +** Processing line: ~ r: 128,~ - Inside source: true *** True Line Result - 'G' => [:g, :shift], -** Processing line: ~ 'H' => [:h, :shift],~ + r: 128, +** Processing line: ~ g: 128,~ - Inside source: true *** True Line Result - 'H' => [:h, :shift], -** Processing line: ~ 'I' => [:i, :shift],~ + g: 128, +** Processing line: ~ b: 128,~ - Inside source: true *** True Line Result - 'I' => [:i, :shift], -** Processing line: ~ 'J' => [:j, :shift],~ + b: 128, +** Processing line: ~ a: 80~ - Inside source: true *** True Line Result - 'J' => [:j, :shift], -** Processing line: ~ 'K' => [:k, :shift],~ + a: 80 +** Processing line: ~ }.line~ - Inside source: true *** True Line Result - 'K' => [:k, :shift], -** Processing line: ~ 'L' => [:l, :shift],~ + }.line +** Processing line: ~~ - Inside source: true *** True Line Result - 'L' => [:l, :shift], -** Processing line: ~ 'M' => [:m, :shift],~ + +** Processing line: ~ args.outputs.static_debug << {~ - Inside source: true *** True Line Result - 'M' => [:m, :shift], -** Processing line: ~ 'N' => [:n, :shift],~ + args.outputs.static_debug << { +** Processing line: ~ x: LOWREZ_X_OFFSET + (i * 10),~ - Inside source: true *** True Line Result - 'N' => [:n, :shift], -** Processing line: ~ 'O' => [:o, :shift],~ + x: LOWREZ_X_OFFSET + (i * 10), +** Processing line: ~ y: LOWREZ_Y_OFFSET,~ - Inside source: true *** True Line Result - 'O' => [:o, :shift], -** Processing line: ~ 'P' => [:p, :shift],~ + y: LOWREZ_Y_OFFSET, +** Processing line: ~ x2: LOWREZ_X_OFFSET + (i * 10),~ - Inside source: true *** True Line Result - 'P' => [:p, :shift], -** Processing line: ~ 'Q' => [:q, :shift],~ + x2: LOWREZ_X_OFFSET + (i * 10), +** Processing line: ~ y2: LOWREZ_Y_OFFSET + LOWREZ_ZOOMED_SIZE,~ - Inside source: true *** True Line Result - 'Q' => [:q, :shift], -** Processing line: ~ 'R' => [:r, :shift],~ + y2: LOWREZ_Y_OFFSET + LOWREZ_ZOOMED_SIZE, +** Processing line: ~ r: 128,~ - Inside source: true *** True Line Result - 'R' => [:r, :shift], -** Processing line: ~ 'S' => [:s, :shift],~ + r: 128, +** Processing line: ~ g: 128,~ - Inside source: true *** True Line Result - 'S' => [:s, :shift], -** Processing line: ~ 'T' => [:t, :shift],~ + g: 128, +** Processing line: ~ b: 128,~ - Inside source: true *** True Line Result - 'T' => [:t, :shift], -** Processing line: ~ 'U' => [:u, :shift],~ + b: 128, +** Processing line: ~ a: 80~ - Inside source: true *** True Line Result - 'U' => [:u, :shift], -** Processing line: ~ 'V' => [:v, :shift],~ + a: 80 +** Processing line: ~ }.line~ - Inside source: true *** True Line Result - 'V' => [:v, :shift], -** Processing line: ~ 'W' => [:w, :shift],~ + }.line +** Processing line: ~ end~ - Inside source: true *** True Line Result - 'W' => [:w, :shift], -** Processing line: ~ 'X' => [:x, :shift],~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - 'X' => [:x, :shift], -** Processing line: ~ 'Y' => [:y, :shift],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - 'Y' => [:y, :shift], -** Processing line: ~ 'Z' => [:z, :shift],~ + +** Processing line: ~ args.state.grid_rendered = true~ - Inside source: true *** True Line Result - 'Z' => [:z, :shift], -** Processing line: ~ "!" => [:exclamation_point],~ + args.state.grid_rendered = true +** Processing line: ~~ - Inside source: true *** True Line Result - "!" => [:exclamation_point], -** Processing line: ~ "0" => [:zero],~ + +** Processing line: ~ args.state.last_click ||= 0~ - Inside source: true *** True Line Result - "0" => [:zero], -** Processing line: ~ "1" => [:one],~ + args.state.last_click ||= 0 +** Processing line: ~ args.state.last_up ||= 0~ - Inside source: true *** True Line Result - "1" => [:one], -** Processing line: ~ "2" => [:two],~ + args.state.last_up ||= 0 +** Processing line: ~ args.state.last_click = args.state.tick_count if args.lowrez.mouse_down # you can also use args.lowrez.click~ - Inside source: true *** True Line Result - "2" => [:two], -** Processing line: ~ "3" => [:three],~ + args.state.last_click = args.state.tick_count if args.lowrez.mouse_down # you can also use args.lowrez.click +** Processing line: ~ args.state.last_up = args.state.tick_count if args.lowrez.mouse_up~ - Inside source: true *** True Line Result - "3" => [:three], -** Processing line: ~ "4" => [:four],~ + args.state.last_up = args.state.tick_count if args.lowrez.mouse_up +** Processing line: ~ args.state.label_style = { size_enum: -1.5 }~ - Inside source: true *** True Line Result - "4" => [:four], -** Processing line: ~ "5" => [:five],~ + args.state.label_style = { size_enum: -1.5 } +** Processing line: ~~ - Inside source: true *** True Line Result - "5" => [:five], -** Processing line: ~ "6" => [:six],~ + +** Processing line: ~ args.state.watch_list = [~ - Inside source: true *** True Line Result - "6" => [:six], -** Processing line: ~ "7" => [:seven],~ + args.state.watch_list = [ +** Processing line: ~ "args.state.tick_count is: #{args.state.tick_count}",~ - Inside source: true *** True Line Result - "7" => [:seven], -** Processing line: ~ "8" => [:eight],~ + "args.state.tick_count is: #{args.state.tick_count}", +** Processing line: ~ "args.lowrez.mouse_position is: #{args.lowrez.mouse_position.x}, #{args.lowrez.mouse_position.y}",~ - Inside source: true *** True Line Result - "8" => [:eight], -** Processing line: ~ "9" => [:nine],~ + "args.lowrez.mouse_position is: #{args.lowrez.mouse_position.x}, #{args.lowrez.mouse_position.y}", +** Processing line: ~ "args.lowrez.mouse_down tick: #{args.state.last_click || "never"}",~ - Inside source: true *** True Line Result - "9" => [:nine], -** Processing line: ~ "\b" => [:backspace],~ + "args.lowrez.mouse_down tick: #{args.state.last_click || "never"}", +** Processing line: ~ "args.lowrez.mouse_up tick: #{args.state.last_up || "false"}",~ - Inside source: true *** True Line Result - "\b" => [:backspace], -** Processing line: ~ "\e" => [:escape],~ + "args.lowrez.mouse_up tick: #{args.state.last_up || "false"}", +** Processing line: ~ ]~ - Inside source: true *** True Line Result - "\e" => [:escape], -** Processing line: ~ "\r" => [:enter],~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - "\r" => [:enter], -** Processing line: ~ "\t" => [:tab],~ + +** Processing line: ~ args.outputs.debug << args.state~ - Inside source: true *** True Line Result - "\t" => [:tab], -** Processing line: ~ "(" => [:open_round_brace],~ + args.outputs.debug << args.state +** Processing line: ~ .watch_list~ - Inside source: true *** True Line Result - "(" => [:open_round_brace], -** Processing line: ~ ")" => [:close_round_brace],~ + .watch_list +** Processing line: ~ .map_with_index do |text, i|~ - Inside source: true *** True Line Result - ")" => [:close_round_brace], -** Processing line: ~ "{" => [:open_curly_brace],~ + .map_with_index do |text, i| +** Processing line: ~ {~ - Inside source: true *** True Line Result - "{" => [:open_curly_brace], -** Processing line: ~ "}" => [:close_curly_brace],~ + { +** Processing line: ~ x: 5,~ - Inside source: true *** True Line Result - "}" => [:close_curly_brace], -** Processing line: ~ "[" => [:open_square_brace],~ + x: 5, +** Processing line: ~ y: 720 - (i * 20),~ - Inside source: true *** True Line Result - "[" => [:open_square_brace], -** Processing line: ~ "]" => [:close_square_brace],~ + y: 720 - (i * 20), +** Processing line: ~ text: text,~ - Inside source: true *** True Line Result - "]" => [:close_square_brace], -** Processing line: ~ ":" => [:colon],~ + text: text, +** Processing line: ~ size_enum: -1.5~ - Inside source: true *** True Line Result - ":" => [:colon], -** Processing line: ~ ";" => [:semicolon],~ + size_enum: -1.5 +** Processing line: ~ }.label~ - Inside source: true *** True Line Result - ";" => [:semicolon], -** Processing line: ~ "=" => [:equal_sign],~ + }.label +** Processing line: ~ end~ - Inside source: true *** True Line Result - "=" => [:equal_sign], -** Processing line: ~ "-" => [:hyphen],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - "-" => [:hyphen], -** Processing line: ~ " " => [:space],~ + +** Processing line: ~ args.outputs.debug << {~ - Inside source: true *** True Line Result - " " => [:space], -** Processing line: ~ "$" => [:dollar_sign],~ + args.outputs.debug << { +** Processing line: ~ x: 640,~ - Inside source: true *** True Line Result - "$" => [:dollar_sign], -** Processing line: ~ "\"" => [:double_quotation_mark],~ + x: 640, +** Processing line: ~ y: 25,~ - Inside source: true *** True Line Result - "\"" => [:double_quotation_mark], -** Processing line: ~ "'" => [:single_quotation_mark],~ + y: 25, +** 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.",~ - Inside source: true *** True Line Result - "'" => [:single_quotation_mark], -** Processing line: ~ "`" => [:backtick],~ + 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,~ - Inside source: true *** True Line Result - "`" => [:backtick], -** Processing line: ~ "~" => [:tilde],~ + size_enum: -0.5, +** Processing line: ~ alignment_enum: 1~ - Inside source: true *** True Line Result - "~" => [:tilde], -** Processing line: ~ "." => [:period],~ + alignment_enum: 1 +** Processing line: ~ }.label~ - Inside source: true *** True Line Result - "." => [:period], -** Processing line: ~ "," => [:comma],~ + }.label +** Processing line: ~ end~ - Inside source: true *** True Line Result - "," => [:comma], -** Processing line: ~ "|" => [:pipe],~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - "|" => [:pipe], -** Processing line: ~ "_" => [:underscore],~ + +** Processing line: ~ $gtk.reset~ - Inside source: true *** True Line Result - "_" => [:underscore], -** Processing line: ~ "#" => [:hash],~ + $gtk.reset +** Processing line: ~~ - Inside source: true *** True Line Result - "#" => [:hash], -** Processing line: ~ "+" => [:plus],~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - "+" => [:plus], -** Processing line: ~ "@" => [:at],~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - "@" => [:at], -** Processing line: ~ "/" => [:forward_slash],~ -- Inside source: true + +** Processing line: ~*** Platformer - Clepto Frog - main.rb~ +- Header detected. *** True Line Result - "/" => [:forward_slash], -** Processing line: ~ "\\" => [:back_slash],~ -- Inside source: true + *** True Line Result - "\\" => [:back_slash], -** Processing line: ~ "*" => [:asterisk],~ -- Inside source: true +*** Platformer - Clepto Frog - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - "*" => [:asterisk], -** Processing line: ~ "<" => [:less_than],~ -- Inside source: true + *** True Line Result - "<" => [:less_than], -** Processing line: ~ ">" => [:greater_than],~ +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_platformer/clepto_frog/app/main.rb~ - Inside source: true *** True Line Result - ">" => [:greater_than], -** Processing line: ~ "^" => [:circumflex],~ + # ./samples/99_genre_platformer/clepto_frog/app/main.rb +** Processing line: ~ MAP_FILE_PATH = 'app/map.txt'~ - Inside source: true *** True Line Result - "^" => [:circumflex], -** Processing line: ~ "&" => [:ampersand],~ + MAP_FILE_PATH = 'app/map.txt' +** Processing line: ~~ - Inside source: true *** True Line Result - "&" => [:ampersand], -** Processing line: ~ "²" => [:superscript_two],~ + +** Processing line: ~ require 'app/map.rb'~ - Inside source: true *** True Line Result - "²" => [:superscript_two], -** Processing line: ~ "§" => [:section_sign],~ + require 'app/map.rb' +** Processing line: ~~ - Inside source: true *** True Line Result - "§" => [:section_sign], -** Processing line: ~ "?" => [:question_mark],~ + +** Processing line: ~ class CleptoFrog~ - Inside source: true *** True Line Result - "?" => [:question_mark], -** Processing line: ~ '%' => [:percent_sign],~ + class CleptoFrog +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - '%' => [:percent_sign], -** Processing line: ~ "º" => [:ordinal_indicator],~ + attr_gtk +** Processing line: ~~ - Inside source: true *** True Line Result - "º" => [:ordinal_indicator], -** Processing line: ~ 1073741903 => [:right],~ + +** Processing line: ~ def render_ending~ - Inside source: true *** True Line Result - 1073741903 => [:right], -** Processing line: ~ 1073741904 => [:left],~ + def render_ending +** Processing line: ~ state.game_over_at ||= state.tick_count~ - Inside source: true *** True Line Result - 1073741904 => [:left], -** Processing line: ~ 1073741905 => [:down],~ + state.game_over_at ||= state.tick_count +** Processing line: ~~ - Inside source: true *** True Line Result - 1073741905 => [:down], -** Processing line: ~ 1073741906 => [:up],~ + +** Processing line: ~ outputs.labels << [640, 700, "Clepto Frog", 4, 1]~ - Inside source: true *** True Line Result - 1073741906 => [:up], -** Processing line: ~ 1073741899 => [:pageup],~ + outputs.labels << [640, 700, "Clepto Frog", 4, 1] +** Processing line: ~~ - Inside source: true *** True Line Result - 1073741899 => [:pageup], -** Processing line: ~ 1073741902 => [:pagedown],~ + +** Processing line: ~ if state.tick_count >= (state.game_over_at + 120)~ - Inside source: true *** True Line Result - 1073741902 => [:pagedown], -** Processing line: ~ 127 => [:delete]~ + if state.tick_count >= (state.game_over_at + 120) +** Processing line: ~ outputs.labels << [640, 620, "\"I... I.... don't believe it.\" - New Guy",~ - Inside source: true *** True Line Result - 127 => [:delete] -** Processing line: ~ }~ + outputs.labels << [640, 620, "\"I... I.... don't believe it.\" - New Guy", +** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 120).ease(60)]~ - Inside source: true *** True Line Result - } + 4, 1, 0, 0, 0, 255 * (state.game_over_at + 120).ease(60)] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -103011,14 +106940,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 self.char_to_method char, int = nil~ +** Processing line: ~ if state.tick_count >= (state.game_over_at + 240)~ - Inside source: true *** True Line Result - def self.char_to_method char, int = nil -** Processing line: ~ char_to_method_hash[char] || char_to_method_hash[int] || [char.to_sym || int]~ + if state.tick_count >= (state.game_over_at + 240) +** Processing line: ~ outputs.labels << [640, 580, "\"He actually stole all the mugs?\" - New Guy",~ +- Inside source: true +*** True Line Result + outputs.labels << [640, 580, "\"He actually stole all the mugs?\" - New Guy", +** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 240).ease(60)]~ - Inside source: true *** True Line Result - char_to_method_hash[char] || char_to_method_hash[int] || [char.to_sym || int] + 4, 1, 0, 0, 0, 255 * (state.game_over_at + 240).ease(60)] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -103027,18 +106960,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 clear~ +** Processing line: ~ if state.tick_count >= (state.game_over_at + 360)~ - Inside source: true *** True Line Result - def clear -** Processing line: ~ set truthy_keys, false~ + if state.tick_count >= (state.game_over_at + 360) +** Processing line: ~ outputs.labels << [640, 540, "\"Kind of feel bad STARTING HIM WITH NOTHING again.\" - New Guy",~ - Inside source: true *** True Line Result - set truthy_keys, false -** Processing line: ~ @scrubbed_ivars = nil~ + outputs.labels << [640, 540, "\"Kind of feel bad STARTING HIM WITH NOTHING again.\" - New Guy", +** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 360).ease(60)]~ - Inside source: true *** True Line Result - @scrubbed_ivars = nil + 4, 1, 0, 0, 0, 255 * (state.game_over_at + 360).ease(60)] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -103047,142 +106980,130 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ -- Inside source: true -*** True Line Result - # @gtk -** Processing line: ~ def left_right~ -- Inside source: true -*** True Line Result - def left_right -** Processing line: ~ return -1 if self.left~ -- Inside source: true -*** True Line Result - return -1 if self.left -** Processing line: ~ return 1 if self.right~ -- Inside source: true -*** True Line Result - return 1 if self.right -** Processing line: ~ return 0~ +** Processing line: ~ outputs.sprites << [640 - 50, 360 - 50, 100, 100,~ - Inside source: true *** True Line Result - return 0 -** Processing line: ~ end~ + outputs.sprites << [640 - 50, 360 - 50, 100, 100, +** Processing line: ~ "sprites/square-green.png"]~ - Inside source: true *** True Line Result - end + "sprites/square-green.png"] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ outputs.labels << [640, 300, "Current Time: #{"%.2f" % state.stuff_time}", 4, 1]~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def up_down~ + outputs.labels << [640, 300, "Current Time: #{"%.2f" % state.stuff_time}", 4, 1] +** Processing line: ~ outputs.labels << [640, 270, "Best Time: #{"%.2f" % state.stuff_best_time}", 4, 1]~ - Inside source: true *** True Line Result - def up_down -** Processing line: ~ return 1 if self.up~ + outputs.labels << [640, 270, "Best Time: #{"%.2f" % state.stuff_best_time}", 4, 1] +** Processing line: ~~ - Inside source: true *** True Line Result - return 1 if self.up -** Processing line: ~ return -1 if self.down~ + +** Processing line: ~ if state.tick_count >= (state.game_over_at + 550)~ - Inside source: true *** True Line Result - return -1 if self.down -** Processing line: ~ return 0~ + if state.tick_count >= (state.game_over_at + 550) +** Processing line: ~ restart_game~ - Inside source: true *** True Line Result - return 0 + restart_game ** Processing line: ~ end~ - Inside source: true *** True Line Result end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ def restart_game~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def truthy_keys~ + def restart_game +** Processing line: ~ state.world = nil~ - Inside source: true *** True Line Result - def truthy_keys -** Processing line: ~ get(all).find_all { |_, v| v }~ + state.world = nil +** Processing line: ~ state.x = nil~ - Inside source: true *** True Line Result - get(all).find_all { |_, v| v } -** Processing line: ~ .map { |k, _| k.to_sym }~ + state.x = nil +** Processing line: ~ state.y = nil~ - Inside source: true *** True Line Result - .map { |k, _| k.to_sym } -** Processing line: ~ end~ + state.y = nil +** Processing line: ~ state.dx = nil~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.dx = nil +** Processing line: ~ state.dy = nil~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + state.dy = nil +** Processing line: ~ state.stuff_score = 0~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def all? keys~ + state.stuff_score = 0 +** Processing line: ~ state.stuff_time = 0~ - Inside source: true *** True Line Result - def all? keys -** Processing line: ~ values = get(keys.map { |k| k.without_ending_bang })~ + state.stuff_time = 0 +** Processing line: ~ state.intro_tick_count = nil~ - Inside source: true *** True Line Result - values = get(keys.map { |k| k.without_ending_bang }) -** Processing line: ~ all_true = values.all? do |k, v|~ + state.intro_tick_count = nil +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - all_true = values.all? do |k, v| -** Processing line: ~ v~ + defaults +** Processing line: ~ state.game_start_at = state.tick_count~ - Inside source: true *** True Line Result - v -** Processing line: ~ end~ + state.game_start_at = state.tick_count +** Processing line: ~ state.scene = :game~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.scene = :game +** Processing line: ~ state.game_over_at = nil~ - Inside source: true *** True Line Result - -** Processing line: ~ if all_true~ + state.game_over_at = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - if all_true -** Processing line: ~ keys.each do |k|~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - keys.each do |k| -** Processing line: ~ clear_key k if k.end_with_bang?~ + +** Processing line: ~ def render_intro~ - Inside source: true *** True Line Result - clear_key k if k.end_with_bang? -** Processing line: ~ end~ + def render_intro +** Processing line: ~ outputs.labels << [640, 700, "Clepto Frog", 4, 1]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + outputs.labels << [640, 700, "Clepto Frog", 4, 1] +** Processing line: ~ if state.tick_count >= 120~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if state.tick_count >= 120 +** Processing line: ~ outputs.labels << [640, 620, "\"Uh... your office has a pet frog?\" - New Guy",~ - Inside source: true *** True Line Result - -** Processing line: ~ all_true~ + outputs.labels << [640, 620, "\"Uh... your office has a pet frog?\" - New Guy", +** Processing line: ~ 4, 1, 0, 0, 0, 255 * 120.ease(60)]~ - Inside source: true *** True Line Result - all_true + 4, 1, 0, 0, 0, 255 * 120.ease(60)] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -103191,62 +107112,58 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ -- Inside source: true -*** True Line Result - # @gtk -** Processing line: ~ def any? keys~ -- Inside source: true -*** True Line Result - def any? keys -** Processing line: ~ values = get(keys.map { |k| k.without_ending_bang })~ +** Processing line: ~ if state.tick_count >= 240~ - Inside source: true *** True Line Result - values = get(keys.map { |k| k.without_ending_bang }) -** Processing line: ~ any_true = values.any? do |k, v|~ + if state.tick_count >= 240 +** Processing line: ~ outputs.labels << [640, 580, "\"Yep! His name is Clepto.\" - Jim",~ - Inside source: true *** True Line Result - any_true = values.any? do |k, v| -** Processing line: ~ v~ + outputs.labels << [640, 580, "\"Yep! His name is Clepto.\" - Jim", +** Processing line: ~ 4, 1, 0, 0, 0, 255 * 240.ease(60)]~ - Inside source: true *** True Line Result - v -** Processing line: ~ end~ + 4, 1, 0, 0, 0, 255 * 240.ease(60)] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if any_true~ -- Inside source: true -*** True Line Result - if any_true -** Processing line: ~ keys.each do |k|~ +** Processing line: ~ if state.tick_count >= 360~ - Inside source: true *** True Line Result - keys.each do |k| -** Processing line: ~ clear_key k if k.end_with_bang?~ + if state.tick_count >= 360 +** Processing line: ~ outputs.labels << [640, 540, "\"Uh...\" - New Guy",~ - Inside source: true *** True Line Result - clear_key k if k.end_with_bang? -** Processing line: ~ end~ + outputs.labels << [640, 540, "\"Uh...\" - New Guy", +** Processing line: ~ 4, 1, 0, 0, 0, 255 * 360.ease(60)]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 4, 1, 0, 0, 0, 255 * 360.ease(60)] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ any_true~ +** Processing line: ~ if state.tick_count >= 480~ - Inside source: true *** True Line Result - any_true + if state.tick_count >= 480 +** Processing line: ~ outputs.labels << [640, 500, "\"He steals mugs while we're away...\" - Jim",~ +- Inside source: true +*** True Line Result + outputs.labels << [640, 500, "\"He steals mugs while we're away...\" - Jim", +** Processing line: ~ 4, 1, 0, 0, 0, 255 * 480.ease(60)]~ +- Inside source: true +*** True Line Result + 4, 1, 0, 0, 0, 255 * 480.ease(60)] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -103255,22 +107172,18 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ -- Inside source: true -*** True Line Result - # @gtk -** Processing line: ~ def clear_key key~ +** Processing line: ~ if state.tick_count >= 600~ - Inside source: true *** True Line Result - def clear_key key -** Processing line: ~ @scrubbed_ivars = nil~ + if state.tick_count >= 600 +** Processing line: ~ outputs.labels << [640, 460, "\"It's not a big deal, we take them back in the morning.\" - Jim",~ - Inside source: true *** True Line Result - @scrubbed_ivars = nil -** Processing line: ~ self.instance_variable_set("@#{key.without_ending_bang}", false)~ + outputs.labels << [640, 460, "\"It's not a big deal, we take them back in the morning.\" - Jim", +** Processing line: ~ 4, 1, 0, 0, 0, 255 * 600.ease(60)]~ - Inside source: true *** True Line Result - self.instance_variable_set("@#{key.without_ending_bang}", false) + 4, 1, 0, 0, 0, 255 * 600.ease(60)] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -103279,410 +107192,438 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ -- Inside source: true -*** True Line Result - # @gtk -** Processing line: ~ def all~ +** Processing line: ~ outputs.sprites << [640 - 50, 360 - 50, 100, 100,~ - Inside source: true *** True Line Result - def all -** Processing line: ~ @scrubbed_ivars ||= self.instance_variables~ + outputs.sprites << [640 - 50, 360 - 50, 100, 100, +** Processing line: ~ "sprites/square-green.png"]~ - Inside source: true *** True Line Result - @scrubbed_ivars ||= self.instance_variables -** Processing line: ~ .reject { |i| i == :@all || i == :@scrubbed_ivars }~ + "sprites/square-green.png"] +** Processing line: ~~ - Inside source: true *** True Line Result - .reject { |i| i == :@all || i == :@scrubbed_ivars } -** Processing line: ~ .map { |i| i.to_s.gsub("@", "") }~ + +** Processing line: ~ if state.tick_count == 800~ - Inside source: true *** True Line Result - .map { |i| i.to_s.gsub("@", "") } -** Processing line: ~~ + if state.tick_count == 800 +** Processing line: ~ state.scene = :game~ - Inside source: true *** True Line Result - -** Processing line: ~ get(@scrubbed_ivars).map { |k, _| k }~ + state.scene = :game +** Processing line: ~ state.game_start_at = state.tick_count~ - Inside source: true *** True Line Result - get(@scrubbed_ivars).map { |k, _| k } + state.game_start_at = state.tick_count ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def get collection~ + +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - def get collection -** Processing line: ~ return [] if collection.length == 0~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - return [] if collection.length == 0 -** Processing line: ~ collection.map do |m|~ + defaults +** Processing line: ~ if state.scene == :intro && state.tick_count <= 800~ - Inside source: true *** True Line Result - collection.map do |m| -** Processing line: ~ if m.end_with_bang?~ + if state.scene == :intro && state.tick_count <= 800 +** Processing line: ~ render_intro~ - Inside source: true *** True Line Result - if m.end_with_bang? -** Processing line: ~ clear_after_return = true~ + render_intro +** Processing line: ~ elsif state.scene == :ending~ - Inside source: true *** True Line Result - clear_after_return = true -** Processing line: ~ end~ + elsif state.scene == :ending +** Processing line: ~ render_ending~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + render_ending +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ value = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)~ + else +** Processing line: ~ render~ - Inside source: true *** True Line Result - value = self.instance_variable_get("@#{m.without_ending_bang}".to_sym) -** Processing line: ~ clear_key m if clear_after_return~ + render +** Processing line: ~ end~ - Inside source: true *** True Line Result - clear_key m if clear_after_return -** Processing line: ~ [m.without_ending_bang, value]~ + end +** Processing line: ~ calc~ - Inside source: true *** True Line Result - [m.without_ending_bang, value] -** Processing line: ~ end~ + calc +** Processing line: ~ process_inputs~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + process_inputs +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def set collection, value = true~ + def defaults +** Processing line: ~ state.scene ||= :intro~ - Inside source: true *** True Line Result - def set collection, value = true -** Processing line: ~ return if collection.length == 0~ + state.scene ||= :intro +** Processing line: ~ state.stuff_score ||= 0~ - Inside source: true *** True Line Result - return if collection.length == 0 -** Processing line: ~ @scrubbed_ivars = nil~ + state.stuff_score ||= 0 +** Processing line: ~ state.stuff_time ||= 0~ - Inside source: true *** True Line Result - @scrubbed_ivars = nil -** Processing line: ~ value = Kernel.tick_count if value~ + state.stuff_time ||= 0 +** Processing line: ~ state.stuff_best_time ||= nil~ - Inside source: true *** True Line Result - value = Kernel.tick_count if value -** Processing line: ~~ + state.stuff_best_time ||= nil +** Processing line: ~ state.camera_x ||= 0~ - Inside source: true *** True Line Result - -** Processing line: ~ collection.each do |m|~ + state.camera_x ||= 0 +** Processing line: ~ state.camera_y ||= 0~ - Inside source: true *** True Line Result - collection.each do |m| -** Processing line: ~ self.instance_variable_set("@#{m.to_s}".to_sym, value)~ + state.camera_y ||= 0 +** Processing line: ~ state.target_camera_scale ||= 1~ - Inside source: true *** True Line Result - self.instance_variable_set("@#{m.to_s}".to_sym, value) -** Processing line: ~ rescue Exception => e~ + state.target_camera_scale ||= 1 +** Processing line: ~ state.camera_scale ||= 1~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise e, <<-S~ + state.camera_scale ||= 1 +** Processing line: ~ state.tongue_length ||= 100~ - Inside source: true *** True Line Result - raise e, <<-S -** Processing line: ~ * ERROR:~ + state.tongue_length ||= 100 +** Processing line: ~ state.dev_action ||= :collision_mode~ - Inside source: true *** True Line Result - * ERROR: -** Processing line: ~ Attempted to set the a key on the DragonRuby GTK's Keyboard data~ + state.dev_action ||= :collision_mode +** Processing line: ~ state.action ||= :aiming~ - Inside source: true *** True Line Result - Attempted to set the a key on the DragonRuby GTK's Keyboard data -** Processing line: ~ structure, but the property isn't available for raw_key #{raw_key} #{m}.~ + state.action ||= :aiming +** Processing line: ~ state.tongue_angle ||= 90~ - Inside source: true *** True Line Result - structure, but the property isn't available for raw_key #{raw_key} #{m}. -** Processing line: ~~ + state.tongue_angle ||= 90 +** Processing line: ~ state.tile_size = 64~ - Inside source: true *** True Line Result - -** Processing line: ~ You should contact DragonRuby and tell them to associate the raw_key #{raw_key}~ + state.tile_size = 64 +** Processing line: ~ state.gravity = -0.1~ - Inside source: true *** True Line Result - You should contact DragonRuby and tell them to associate the raw_key #{raw_key} -** Processing line: ~ with a friendly property name (we are open to suggestions if you have any).~ + state.gravity = -0.1 +** Processing line: ~ state.air = -0.01~ - Inside source: true *** True Line Result - with a friendly property name (we are open to suggestions if you have any). -** Processing line: ~ [GTK::KeyboardKeys#set, GTK::KeyboardKeys#char_to_method]~ + state.air = -0.01 +** Processing line: ~ state.player_width = 60~ - Inside source: true *** True Line Result - [GTK::KeyboardKeys#set, GTK::KeyboardKeys#char_to_method] -** Processing line: ~~ + state.player_width = 60 +** Processing line: ~ state.player_height = 60~ - Inside source: true *** True Line Result - -** Processing line: ~ S~ + state.player_height = 60 +** Processing line: ~ state.collision_tolerance = 0.0~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + state.collision_tolerance = 0.0 +** Processing line: ~ state.previous_tile_size ||= state.tile_size~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + state.previous_tile_size ||= state.tile_size +** Processing line: ~ state.x ||= 2400~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.x ||= 2400 +** Processing line: ~ state.y ||= 200~ - Inside source: true *** True Line Result - -** Processing line: ~ def method_missing m, *args~ + state.y ||= 200 +** Processing line: ~ state.dy ||= 0~ - Inside source: true *** True Line Result - def method_missing m, *args -** Processing line: ~ begin~ + state.dy ||= 0 +** Processing line: ~ state.dx ||= 0~ - Inside source: true *** True Line Result - begin -** Processing line: ~ define_singleton_method(m) do~ + state.dx ||= 0 +** Processing line: ~ attempt_load_world_from_file~ - Inside source: true *** True Line Result - define_singleton_method(m) do -** Processing line: ~ r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)~ + attempt_load_world_from_file +** Processing line: ~ state.world_lookup ||= { }~ - Inside source: true *** True Line Result - r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym) -** Processing line: ~ clear_key m~ + state.world_lookup ||= { } +** Processing line: ~ state.world_collision_rects ||= []~ - Inside source: true *** True Line Result - clear_key m -** Processing line: ~ return r~ + state.world_collision_rects ||= [] +** Processing line: ~ state.mode ||= :creating~ - Inside source: true *** True Line Result - return r -** Processing line: ~ end~ + state.mode ||= :creating +** Processing line: ~ state.select_menu ||= [0, 720, 1280, 720]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.select_menu ||= [0, 720, 1280, 720] +** Processing line: ~ state.sprite_quantity ||= 20~ - Inside source: true *** True Line Result - -** Processing line: ~ return self.send m~ + state.sprite_quantity ||= 20 +** Processing line: ~ state.sprite_coords ||= []~ - Inside source: true *** True Line Result - return self.send m -** Processing line: ~ rescue Exception => e~ + state.sprite_coords ||= [] +** Processing line: ~ state.banner_coords ||= [640, 680 + 720]~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ log_important "#{e}"~ + state.banner_coords ||= [640, 680 + 720] +** Processing line: ~ state.sprite_selected ||= 1~ - Inside source: true *** True Line Result - log_important "#{e}" -** Processing line: ~ end~ + state.sprite_selected ||= 1 +** Processing line: ~ state.map_saved_at ||= 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.map_saved_at ||= 0 +** Processing line: ~ state.intro_tick_count ||= state.tick_count~ - Inside source: true *** True Line Result - -** Processing line: ~ raise <<-S~ + state.intro_tick_count ||= state.tick_count +** Processing line: ~ if state.sprite_coords == []~ - Inside source: true *** True Line Result - raise <<-S -** Processing line: ~ * ERROR:~ + if state.sprite_coords == [] +** Processing line: ~ count = 1~ - 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:~ + count = 1 +** Processing line: ~ temp_x = 165~ - 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: -** Processing line: ~~ + temp_x = 165 +** Processing line: ~ temp_y = 500 + 720~ - Inside source: true *** True Line Result - -** Processing line: ~ #{KeyboardKeys.char_to_method_hash.map { |k, v| "[#{k} => #{v.join(",")}]" }.join(" ")}~ + temp_y = 500 + 720 +** Processing line: ~ state.sprite_quantity.times do~ - Inside source: true *** True Line Result - #{KeyboardKeys.char_to_method_hash.map { |k, v| "[#{k} => #{v.join(",")}]" }.join(" ")} -** Processing line: ~~ + state.sprite_quantity.times do +** Processing line: ~ state.sprite_coords += [[temp_x, temp_y, count]]~ - Inside source: true *** True Line Result - -** Processing line: ~ S~ + state.sprite_coords += [[temp_x, temp_y, count]] +** Processing line: ~ temp_x += 100~ - Inside source: true *** True Line Result - S + temp_x += 100 +** Processing line: ~ count += 1~ +- Inside source: true +*** True Line Result + count += 1 +** Processing line: ~ if temp_x > 1280 - (165 + 50)~ +- Inside source: true +*** True Line Result + if temp_x > 1280 - (165 + 50) +** Processing line: ~ temp_x = 165~ +- Inside source: true +*** True Line Result + temp_x = 165 +** Processing line: ~ temp_y -= 75~ +- Inside source: true +*** True Line Result + temp_y -= 75 +** 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 serialize~ +** Processing line: ~ def start_of_tongue x = nil, y = nil~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ hash = super~ + def start_of_tongue x = nil, y = nil +** Processing line: ~ x ||= state.x~ - Inside source: true *** True Line Result - hash = super -** Processing line: ~ hash.delete(:scrubbed_ivars)~ + x ||= state.x +** Processing line: ~ y ||= state.y~ - Inside source: true *** True Line Result - hash.delete(:scrubbed_ivars) -** Processing line: ~ hash[:truthy_keys] = self.truthy_keys~ + y ||= state.y +** Processing line: ~ [~ - Inside source: true *** True Line Result - hash[:truthy_keys] = self.truthy_keys -** Processing line: ~ hash~ + [ +** Processing line: ~ x + state.player_width.half,~ - Inside source: true *** True Line Result - hash -** Processing line: ~ end~ + x + state.player_width.half, +** Processing line: ~ y + state.player_height.half~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + y + state.player_height.half +** Processing line: ~ ]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + ] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ def stage_definition~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ # @gtk~ + def stage_definition +** Processing line: ~ outputs.sprites << [vx(0), vy(0), vw(10000), vw(5875), 'sprites/level-map.png']~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ class Keyboard~ + outputs.sprites << [vx(0), vy(0), vw(10000), vw(5875), 'sprites/level-map.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - class Keyboard + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @return [KeyboardKeys]~ +** Processing line: ~ def render~ - Inside source: true *** True Line Result - # @return [KeyboardKeys] -** Processing line: ~ # @gtk~ + def render +** Processing line: ~ stage_definition~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_accessor :key_up~ + stage_definition +** Processing line: ~ start_of_tongue_render = [vx(start_of_tongue.x), vy(start_of_tongue.y)]~ - Inside source: true *** True Line Result - attr_accessor :key_up + start_of_tongue_render = [vx(start_of_tongue.x), vy(start_of_tongue.y)] +** Processing line: ~ end_of_tongue_render = [vx(end_of_tongue.x), vy(end_of_tongue.y)]~ +- Inside source: true +*** True Line Result + end_of_tongue_render = [vx(end_of_tongue.x), vy(end_of_tongue.y)] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @return [KeyboardKeys]~ +** Processing line: ~ if state.anchor_point~ - Inside source: true *** True Line Result - # @return [KeyboardKeys] -** Processing line: ~ # @gtk~ + if state.anchor_point +** Processing line: ~ anchor_point_render = [vx(state.anchor_point.x), vy(state.anchor_point.y)]~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_accessor :key_held~ + anchor_point_render = [vx(state.anchor_point.x), vy(state.anchor_point.y)] +** Processing line: ~ outputs.sprites << { x: start_of_tongue_render.x,~ - Inside source: true *** True Line Result - attr_accessor :key_held -** Processing line: ~~ + outputs.sprites << { x: start_of_tongue_render.x, +** Processing line: ~ y: start_of_tongue_render.y,~ - Inside source: true *** True Line Result - -** Processing line: ~ # @return [KeyboardKeys]~ + y: start_of_tongue_render.y, +** Processing line: ~ w: vw(2),~ - Inside source: true *** True Line Result - # @return [KeyboardKeys] -** Processing line: ~ # @gtk~ + w: vw(2), +** Processing line: ~ h: args.geometry.distance(start_of_tongue_render, anchor_point_render),~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_accessor :key_down~ + h: args.geometry.distance(start_of_tongue_render, anchor_point_render), +** Processing line: ~ path: 'sprites/square-pink.png',~ - Inside source: true *** True Line Result - attr_accessor :key_down -** Processing line: ~~ + path: 'sprites/square-pink.png', +** Processing line: ~ angle_anchor_y: 0,~ - Inside source: true *** True Line Result - -** Processing line: ~ # @return [Boolean]~ + angle_anchor_y: 0, +** Processing line: ~ angle: state.tongue_angle - 90 }~ - Inside source: true *** True Line Result - # @return [Boolean] -** Processing line: ~ # @gtk~ + angle: state.tongue_angle - 90 } +** Processing line: ~ else~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_accessor :has_focus~ + else +** Processing line: ~ outputs.sprites << { x: vx(start_of_tongue.x),~ - Inside source: true *** True Line Result - attr_accessor :has_focus -** Processing line: ~~ + outputs.sprites << { x: vx(start_of_tongue.x), +** Processing line: ~ y: vy(start_of_tongue.y),~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize~ + y: vy(start_of_tongue.y), +** Processing line: ~ w: vw(2),~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @key_up = KeyboardKeys.new~ + w: vw(2), +** Processing line: ~ h: vh(state.tongue_length),~ - Inside source: true *** True Line Result - @key_up = KeyboardKeys.new -** Processing line: ~ @key_held = KeyboardKeys.new~ + h: vh(state.tongue_length), +** Processing line: ~ path: 'sprites/square-pink.png',~ - Inside source: true *** True Line Result - @key_held = KeyboardKeys.new -** Processing line: ~ @key_down = KeyboardKeys.new~ + path: 'sprites/square-pink.png', +** Processing line: ~ angle_anchor_y: 0,~ - Inside source: true *** True Line Result - @key_down = KeyboardKeys.new -** Processing line: ~ @has_focus = false~ + angle_anchor_y: 0, +** Processing line: ~ angle: state.tongue_angle - 90 }~ - Inside source: true *** True Line Result - @has_focus = false + angle: state.tongue_angle - 90 } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -103691,70 +107632,78 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def p~ +** Processing line: ~ outputs.sprites << state.objects.map { |o| [vx(o.x), vy(o.y), vw(o.w), vh(o.h), o.path] }~ - Inside source: true *** True Line Result - def p -** Processing line: ~ @key_down.p || @key_held.p~ + outputs.sprites << state.objects.map { |o| [vx(o.x), vy(o.y), vw(o.w), vh(o.h), o.path] } +** Processing line: ~~ - Inside source: true *** True Line Result - @key_down.p || @key_held.p -** Processing line: ~ end~ + +** Processing line: ~ if state.god_mode~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if state.god_mode +** Processing line: ~ # SHOW HIDE COLLISIONS~ - Inside source: true *** True Line Result - -** Processing line: ~ # The left arrow or "a" was pressed.~ + # SHOW HIDE COLLISIONS +** Processing line: ~ outputs.sprites << state.world.map do |x, y, w, h|~ - Inside source: true *** True Line Result - # The left arrow or "a" was pressed. -** Processing line: ~ #~ + outputs.sprites << state.world.map do |x, y, w, h| +** Processing line: ~ x = vx(x)~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Boolean]~ + x = vx(x) +** Processing line: ~ y = vy(y)~ - Inside source: true *** True Line Result - # @return [Boolean] -** Processing line: ~ def left~ + y = vy(y) +** Processing line: ~ if x > -80 && x < 1280 && y > -80 && y < 720~ - Inside source: true *** True Line Result - def left -** Processing line: ~ @key_up.left || @key_held.left || a~ + if x > -80 && x < 1280 && y > -80 && y < 720 +** Processing line: ~ {~ - Inside source: true *** True Line Result - @key_up.left || @key_held.left || a -** Processing line: ~ end~ + { +** Processing line: ~ x: x,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x: x, +** Processing line: ~ y: y,~ - Inside source: true *** True Line Result - -** Processing line: ~ # The right arrow or "d" was pressed.~ + y: y, +** Processing line: ~ w: vw(w || state.tile_size),~ - Inside source: true *** True Line Result - # The right arrow or "d" was pressed. -** Processing line: ~ #~ + w: vw(w || state.tile_size), +** Processing line: ~ h: vh(h || state.tile_size),~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Boolean]~ + h: vh(h || state.tile_size), +** Processing line: ~ path: 'sprites/square-gray.png',~ - Inside source: true *** True Line Result - # @return [Boolean] -** Processing line: ~ def right~ + path: 'sprites/square-gray.png', +** Processing line: ~ a: 128~ - Inside source: true *** True Line Result - def right -** Processing line: ~ @key_up.right || @key_held.right || d~ + a: 128 +** Processing line: ~ }~ - Inside source: true *** True Line Result - @key_up.right || @key_held.right || d + } +** 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 @@ -103763,54 +107712,74 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # The up arrow or "w" was pressed.~ +** Processing line: ~ render_player~ - Inside source: true *** True Line Result - # The up arrow or "w" was pressed. -** Processing line: ~ #~ + render_player +** Processing line: ~ outputs.sprites << [vx(2315), vy(45), vw(569), vh(402), 'sprites/square-blue.png', 0, 40]~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Boolean]~ + outputs.sprites << [vx(2315), vy(45), vw(569), vh(402), 'sprites/square-blue.png', 0, 40] +** Processing line: ~~ - Inside source: true *** True Line Result - # @return [Boolean] -** Processing line: ~ def up~ + +** Processing line: ~ # Label in top left of the screen~ - Inside source: true *** True Line Result - def up -** Processing line: ~ @key_up.up || @key_held.up || w~ + # Label in top left of the screen +** Processing line: ~ outputs.primitives << [20, 640, 180, 70, 255, 255, 255, 128].solid~ - Inside source: true *** True Line Result - @key_up.up || @key_held.up || w -** Processing line: ~ end~ + outputs.primitives << [20, 640, 180, 70, 255, 255, 255, 128].solid +** Processing line: ~ outputs.primitives << [30, 700, "Stuff: #{state.stuff_score} of #{$mugs.count}", 1].label~ - Inside source: true *** True Line Result - end + outputs.primitives << [30, 700, "Stuff: #{state.stuff_score} of #{$mugs.count}", 1].label +** Processing line: ~ outputs.primitives << [30, 670, "Time: #{"%.2f" % state.stuff_time}", 1].label~ +- Inside source: true +*** True Line Result + outputs.primitives << [30, 670, "Time: #{"%.2f" % state.stuff_time}", 1].label ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # The down arrow or "s" was pressed.~ +** Processing line: ~ if state.god_mode~ - Inside source: true *** True Line Result - # The down arrow or "s" was pressed. -** Processing line: ~ #~ + if state.god_mode +** Processing line: ~ if state.map_saved_at > 0 && state.map_saved_at.elapsed_time < 120~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Boolean]~ + if state.map_saved_at > 0 && state.map_saved_at.elapsed_time < 120 +** Processing line: ~ outputs.primitives << [920, 670, 'Map has been exported!', 1, 0, 50, 100, 50].label~ - Inside source: true *** True Line Result - # @return [Boolean] -** Processing line: ~ def down~ + outputs.primitives << [920, 670, 'Map has been exported!', 1, 0, 50, 100, 50].label +** Processing line: ~ end~ - Inside source: true *** True Line Result - def down -** Processing line: ~ @key_up.down || @key_held.down || s~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @key_up.down || @key_held.down || s + +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Creates sprite following mouse to help indicate which sprite you have selected~ +- Inside source: true +*** True Line Result + # Creates sprite following mouse to help indicate which sprite you have selected +** Processing line: ~ outputs.primitives << [inputs.mouse.position.x, inputs.mouse.position.y,~ +- Inside source: true +*** True Line Result + outputs.primitives << [inputs.mouse.position.x, inputs.mouse.position.y, +** Processing line: ~ state.tile_size, state.tile_size, 'sprites/square-indigo.png', 0, 100].sprite~ +- Inside source: true +*** True Line Result + state.tile_size, state.tile_size, 'sprites/square-indigo.png', 0, 100].sprite ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -103819,270 +107788,310 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Clear all current key presses.~ +** Processing line: ~ render_mini_map~ - Inside source: true *** True Line Result - # Clear all current key presses. -** Processing line: ~ #~ + render_mini_map +** Processing line: ~ outputs.primitives << [0, 0, 1280, 720, 255, 255, 255, 255 * state.game_start_at.ease(60, :flip)].solid~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [void]~ + outputs.primitives << [0, 0, 1280, 720, 255, 255, 255, 255 * state.game_start_at.ease(60, :flip)].solid +** Processing line: ~ end~ - Inside source: true *** True Line Result - # @return [void] -** Processing line: ~ def clear~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def clear -** Processing line: ~ @key_up.clear~ + +** Processing line: ~ def render_mini_map~ - Inside source: true *** True Line Result - @key_up.clear -** Processing line: ~ @key_held.clear~ + def render_mini_map +** Processing line: ~ x, y = 1170, 10~ - Inside source: true *** True Line Result - @key_held.clear -** Processing line: ~ @key_down.clear~ + x, y = 1170, 10 +** Processing line: ~ outputs.primitives << [x, y, 100, 58, 0, 0, 0, 200].solid~ - Inside source: true *** True Line Result - @key_down.clear -** Processing line: ~ end~ + outputs.primitives << [x, y, 100, 58, 0, 0, 0, 200].solid +** Processing line: ~ outputs.primitives << [x + args.state.x.fdiv(100) - 1, y + args.state.y.fdiv(100) - 1, 2, 2, 0, 255, 0].solid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.primitives << [x + args.state.x.fdiv(100) - 1, y + args.state.y.fdiv(100) - 1, 2, 2, 0, 255, 0].solid +** Processing line: ~ t_start = start_of_tongue~ - Inside source: true *** True Line Result - -** Processing line: ~ def serialize~ + t_start = start_of_tongue +** Processing line: ~ t_end = end_of_tongue~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ {~ + t_end = end_of_tongue +** Processing line: ~ outputs.primitives << [~ - Inside source: true *** True Line Result - { -** Processing line: ~ key_up: @key_up.serialize,~ + outputs.primitives << [ +** Processing line: ~ x + t_start.x.fdiv(100), y + t_start.y.fdiv(100),~ - Inside source: true *** True Line Result - key_up: @key_up.serialize, -** Processing line: ~ key_held: @key_held.serialize,~ + x + t_start.x.fdiv(100), y + t_start.y.fdiv(100), +** Processing line: ~ x + t_end.x.fdiv(100), y + t_end.y.fdiv(100),~ - Inside source: true *** True Line Result - key_held: @key_held.serialize, -** Processing line: ~ key_down: @key_down.serialize,~ + x + t_end.x.fdiv(100), y + t_end.y.fdiv(100), +** Processing line: ~ 255, 255, 255~ - Inside source: true *** True Line Result - key_down: @key_down.serialize, -** Processing line: ~ has_focus: @has_focus~ + 255, 255, 255 +** Processing line: ~ ].line~ - Inside source: true *** True Line Result - has_focus: @has_focus -** Processing line: ~ }~ + ].line +** Processing line: ~~ - Inside source: true *** True Line Result - } + +** Processing line: ~ state.objects.each do |o|~ +- Inside source: true +*** True Line Result + state.objects.each do |o| +** Processing line: ~ outputs.primitives << [x + o.x.fdiv(100) - 1, y + o.y.fdiv(100) - 1, 2, 2, 200, 200, 0].solid~ +- Inside source: true +*** True Line Result + outputs.primitives << [x + o.x.fdiv(100) - 1, y + o.y.fdiv(100) - 1, 2, 2, 200, 200, 0].solid ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ alias_method :inspect, :serialize~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - alias_method :inspect, :serialize + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @return [String]~ +** Processing line: ~ def calc_camera percentage_override = nil~ - Inside source: true *** True Line Result - # @return [String] -** Processing line: ~ def to_s~ + def calc_camera percentage_override = nil +** Processing line: ~ percentage = percentage_override || (0.2 * state.camera_scale)~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ serialize.to_s~ + percentage = percentage_override || (0.2 * state.camera_scale) +** Processing line: ~ target_scale = state.target_camera_scale~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + target_scale = state.target_camera_scale +** Processing line: ~ distance_scale = target_scale - state.camera_scale~ - Inside source: true *** True Line Result - end + distance_scale = target_scale - state.camera_scale +** Processing line: ~ state.camera_scale += distance_scale * percentage~ +- Inside source: true +*** True Line Result + state.camera_scale += distance_scale * percentage ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def key~ +** Processing line: ~ target_x = state.x * state.target_camera_scale~ - Inside source: true *** True Line Result - def key -** Processing line: ~ {~ + target_x = state.x * state.target_camera_scale +** Processing line: ~ target_y = state.y * state.target_camera_scale~ - Inside source: true *** True Line Result - { -** Processing line: ~ down: @key_down.truthy_keys,~ + target_y = state.y * state.target_camera_scale +** Processing line: ~~ - Inside source: true *** True Line Result - down: @key_down.truthy_keys, -** Processing line: ~ held: @key_held.truthy_keys,~ + +** Processing line: ~ distance_x = target_x - (state.camera_x + 640)~ - Inside source: true *** True Line Result - held: @key_held.truthy_keys, -** Processing line: ~ down_or_held: (@key_down.truthy_keys + @key_held.truthy_keys).uniq,~ + distance_x = target_x - (state.camera_x + 640) +** Processing line: ~ distance_y = target_y - (state.camera_y + 360)~ - Inside source: true *** True Line Result - down_or_held: (@key_down.truthy_keys + @key_held.truthy_keys).uniq, -** Processing line: ~ up: @key_up.truthy_keys,~ + distance_y = target_y - (state.camera_y + 360) +** Processing line: ~ state.camera_x += distance_x * percentage if distance_x.abs > 1~ - Inside source: true *** True Line Result - up: @key_up.truthy_keys, -** Processing line: ~ }~ + state.camera_x += distance_x * percentage if distance_x.abs > 1 +** Processing line: ~ state.camera_y += distance_y * percentage if distance_y.abs > 1~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + state.camera_y += distance_y * percentage if distance_y.abs > 1 +** Processing line: ~ state.camera_x = 0 if state.camera_x < 0~ - Inside source: true *** True Line Result - end -** Processing line: ~ alias_method :keys, :key~ + state.camera_x = 0 if state.camera_x < 0 +** Processing line: ~ state.camera_y = 0 if state.camera_y < 0~ - Inside source: true *** True Line Result - alias_method :keys, :key + state.camera_y = 0 if state.camera_y < 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ include DirectionalInputHelperMethods~ +** Processing line: ~ def vx x~ - Inside source: true *** True Line Result - include DirectionalInputHelperMethods + def vx x +** Processing line: ~ (x * state.camera_scale) - state.camera_x~ +- Inside source: true +*** True Line Result + (x * state.camera_scale) - state.camera_x ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ +** Processing line: ~~ - Inside source: true *** True Line Result - end + +** Processing line: ~ def vy y~ +- Inside source: true +*** True Line Result + def vy y +** Processing line: ~ (y * state.camera_scale) - state.camera_y~ +- Inside source: true +*** True Line Result + (y * state.camera_scale) - state.camera_y +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ def vw w~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class MousePoint~ + def vw w +** Processing line: ~ w * state.camera_scale~ - Inside source: true *** True Line Result - class MousePoint -** Processing line: ~ include GTK::Geometry~ + w * state.camera_scale +** Processing line: ~ end~ - Inside source: true *** True Line Result - include GTK::Geometry + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ def vh h~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_accessor :x, :y, :point, :created_at, :global_created_at~ + def vh h +** Processing line: ~ h * state.camera_scale~ - Inside source: true *** True Line Result - attr_accessor :x, :y, :point, :created_at, :global_created_at + h * state.camera_scale +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def initialize x, y~ +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - def initialize x, y -** Processing line: ~ @x = x~ + def calc +** Processing line: ~ calc_camera~ - Inside source: true *** True Line Result - @x = x -** Processing line: ~ @y = y~ + calc_camera +** Processing line: ~ calc_world_lookup~ - Inside source: true *** True Line Result - @y = y -** Processing line: ~ @point = [x, y]~ + calc_world_lookup +** Processing line: ~ calc_player~ - Inside source: true *** True Line Result - @point = [x, y] -** Processing line: ~ @created_at = Kernel.tick_count~ + calc_player +** Processing line: ~ calc_on_floor~ - Inside source: true *** True Line Result - @created_at = Kernel.tick_count -** Processing line: ~ @global_created_at = Kernel.global_tick_count~ + calc_on_floor +** Processing line: ~ calc_score~ - Inside source: true *** True Line Result - @global_created_at = Kernel.global_tick_count -** Processing line: ~ end~ + calc_score +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def w; 0; end~ +** Processing line: ~ def set_camera_scale v = nil~ - Inside source: true *** True Line Result - def w; 0; end -** Processing line: ~ def h; 0; end~ + def set_camera_scale v = nil +** Processing line: ~ return if v < 0.1~ - Inside source: true *** True Line Result - def h; 0; end -** Processing line: ~ def left; x; end~ + return if v < 0.1 +** Processing line: ~ state.target_camera_scale = v~ - Inside source: true *** True Line Result - def left; x; end -** Processing line: ~ def right; x; end~ + state.target_camera_scale = v +** Processing line: ~ end~ - Inside source: true *** True Line Result - def right; x; end -** Processing line: ~ def top; y; end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def top; y; end -** Processing line: ~ def bottom; y; end~ + +** Processing line: ~ def process_inputs_god_mode~ - Inside source: true *** True Line Result - def bottom; y; end + def process_inputs_god_mode +** Processing line: ~ return unless state.god_mode~ +- Inside source: true +*** True Line Result + return unless state.god_mode ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def created_at_elapsed~ +** Processing line: ~ if inputs.keyboard.key_down.equal_sign || (inputs.keyboard.equal_sign && state.tick_count.mod_zero?(10))~ - Inside source: true *** True Line Result - def created_at_elapsed -** Processing line: ~ @created_at.elapsed_time~ + if inputs.keyboard.key_down.equal_sign || (inputs.keyboard.equal_sign && state.tick_count.mod_zero?(10)) +** Processing line: ~ set_camera_scale state.camera_scale + 0.1~ - Inside source: true *** True Line Result - @created_at.elapsed_time -** Processing line: ~ end~ + set_camera_scale state.camera_scale + 0.1 +** Processing line: ~ elsif inputs.keyboard.key_down.hyphen || (inputs.keyboard.hyphen && state.tick_count.mod_zero?(10))~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif inputs.keyboard.key_down.hyphen || (inputs.keyboard.hyphen && state.tick_count.mod_zero?(10)) +** Processing line: ~ set_camera_scale state.camera_scale - 0.1~ - Inside source: true *** True Line Result - -** Processing line: ~ def to_hash~ + set_camera_scale state.camera_scale - 0.1 +** Processing line: ~ elsif inputs.keyboard.eight || inputs.keyboard.zero~ - Inside source: true *** True Line Result - def to_hash -** Processing line: ~ serialize~ + elsif inputs.keyboard.eight || inputs.keyboard.zero +** Processing line: ~ set_camera_scale 1~ - Inside source: true *** True Line Result - serialize + set_camera_scale 1 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -104091,34 +108100,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 serialize~ -- Inside source: true -*** True Line Result - def serialize -** Processing line: ~ {~ +** Processing line: ~ if input_up?~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: @x,~ + if input_up? +** Processing line: ~ state.y += 10~ - Inside source: true *** True Line Result - x: @x, -** Processing line: ~ y: @y,~ + state.y += 10 +** Processing line: ~ state.dy = 0~ - Inside source: true *** True Line Result - y: @y, -** Processing line: ~ created_at: @created_at,~ + state.dy = 0 +** Processing line: ~ elsif input_down?~ - Inside source: true *** True Line Result - created_at: @created_at, -** Processing line: ~ global_created_at: @global_created_at~ + elsif input_down? +** Processing line: ~ state.y -= 10~ - Inside source: true *** True Line Result - global_created_at: @global_created_at -** Processing line: ~ }~ + state.y -= 10 +** Processing line: ~ state.dy = 0~ - Inside source: true *** True Line Result - } + state.dy = 0 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -104127,30 +108132,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 inspect~ +** Processing line: ~ if input_left?~ - Inside source: true *** True Line Result - def inspect -** Processing line: ~ serialize.to_s~ + if input_left? +** Processing line: ~ state.x -= 10~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + state.x -= 10 +** Processing line: ~ state.dx = 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.dx = 0 +** Processing line: ~ elsif input_right?~ - Inside source: true *** True Line Result - -** Processing line: ~ def to_s~ + elsif input_right? +** Processing line: ~ state.x += 10~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ serialize.to_s~ + state.x += 10 +** Processing line: ~ state.dx = 0~ - Inside source: true *** True Line Result - serialize.to_s + state.dx = 0 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -104163,238 +108168,226 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Provides access to the mouse.~ -- Inside source: true -*** True Line Result - # Provides access to the mouse. -** Processing line: ~ #~ -- Inside source: true -*** True Line Result - # -** Processing line: ~ # @gtk~ +** Processing line: ~ def process_inputs~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ class Mouse~ + def process_inputs +** Processing line: ~ if state.scene == :game~ - Inside source: true *** True Line Result - class Mouse -** Processing line: ~~ + if state.scene == :game +** Processing line: ~ process_inputs_player_movement~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + process_inputs_player_movement +** Processing line: ~ process_inputs_god_mode~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_accessor :moved,~ + process_inputs_god_mode +** Processing line: ~ elsif state.scene == :intro~ - Inside source: true *** True Line Result - attr_accessor :moved, -** Processing line: ~ :moved_at,~ + elsif state.scene == :intro +** Processing line: ~ if args.inputs.keyboard.key_down.enter || args.inputs.keyboard.key_down.space~ - Inside source: true *** True Line Result - :moved_at, -** Processing line: ~ :global_moved_at,~ + if args.inputs.keyboard.key_down.enter || args.inputs.keyboard.key_down.space +** Processing line: ~ if Kernel.tick_count < 600~ - Inside source: true *** True Line Result - :global_moved_at, -** Processing line: ~ :up, :has_focus,~ + if Kernel.tick_count < 600 +** Processing line: ~ Kernel.tick_count = 600~ - Inside source: true *** True Line Result - :up, :has_focus, -** Processing line: ~ :button_bits, :button_left,~ + Kernel.tick_count = 600 +** Processing line: ~ end~ - Inside source: true *** True Line Result - :button_bits, :button_left, -** Processing line: ~ :button_middle, :button_right,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - :button_middle, :button_right, -** Processing line: ~ :button_x1, :button_x2,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - :button_x1, :button_x2, -** Processing line: ~ :wheel~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - :wheel + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ attr_accessor :click~ -- Inside source: true -*** True Line Result - attr_accessor :click -** Processing line: ~ attr_accessor :previous_click~ +** Processing line: ~ def input_up?~ - Inside source: true *** True Line Result - attr_accessor :previous_click -** Processing line: ~ attr_accessor :x~ + def input_up? +** Processing line: ~ inputs.keyboard.w || inputs.keyboard.up || inputs.keyboard.k~ - Inside source: true *** True Line Result - attr_accessor :x -** Processing line: ~ attr_accessor :y~ + inputs.keyboard.w || inputs.keyboard.up || inputs.keyboard.k +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_accessor :y + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def initialize~ -- Inside source: true -*** True Line Result - def initialize -** Processing line: ~ @x = 0~ +** Processing line: ~ def input_up_released?~ - Inside source: true *** True Line Result - @x = 0 -** Processing line: ~ @y = 0~ + def input_up_released? +** Processing line: ~ inputs.keyboard.key_up.w ||~ - Inside source: true *** True Line Result - @y = 0 -** Processing line: ~ @has_focus = false~ + inputs.keyboard.key_up.w || +** Processing line: ~ inputs.keyboard.key_up.up ||~ - Inside source: true *** True Line Result - @has_focus = false -** Processing line: ~ @button_bits = 0~ + inputs.keyboard.key_up.up || +** Processing line: ~ inputs.keyboard.key_up.k~ - Inside source: true *** True Line Result - @button_bits = 0 -** Processing line: ~ @button_left = false~ + inputs.keyboard.key_up.k +** Processing line: ~ end~ - Inside source: true *** True Line Result - @button_left = false -** Processing line: ~ @button_middle = false~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @button_middle = false -** Processing line: ~ @button_right = false~ + +** Processing line: ~ def input_down?~ - Inside source: true *** True Line Result - @button_right = false -** Processing line: ~ @button_x1 = false~ + def input_down? +** Processing line: ~ inputs.keyboard.s || inputs.keyboard.down || inputs.keyboard.j~ - Inside source: true *** True Line Result - @button_x1 = false -** Processing line: ~ @button_x2 = false~ + inputs.keyboard.s || inputs.keyboard.down || inputs.keyboard.j +** Processing line: ~ end~ - Inside source: true *** True Line Result - @button_x2 = false -** Processing line: ~ clear~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - clear -** Processing line: ~ end~ + +** Processing line: ~ def input_down_released?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def input_down_released? +** Processing line: ~ inputs.keyboard.key_up.s ||~ - Inside source: true *** True Line Result - -** Processing line: ~ def point~ + inputs.keyboard.key_up.s || +** Processing line: ~ inputs.keyboard.key_up.down ||~ - Inside source: true *** True Line Result - def point -** Processing line: ~ [@x, @y].point~ + inputs.keyboard.key_up.down || +** Processing line: ~ inputs.keyboard.key_up.j~ - Inside source: true *** True Line Result - [@x, @y].point -** Processing line: ~ end~ + inputs.keyboard.key_up.j +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def inside_rect? rect~ +** Processing line: ~ def input_left?~ - Inside source: true *** True Line Result - def inside_rect? rect -** Processing line: ~ point.inside_rect? rect~ + def input_left? +** Processing line: ~ inputs.keyboard.a || inputs.keyboard.left || inputs.keyboard.h~ - Inside source: true *** True Line Result - point.inside_rect? rect -** Processing line: ~ end~ + inputs.keyboard.a || inputs.keyboard.left || inputs.keyboard.h +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def inside_circle? center, radius~ +** Processing line: ~ def input_right?~ - Inside source: true *** True Line Result - def inside_circle? center, radius -** Processing line: ~ point.point_inside_circle? center, radius~ + def input_right? +** Processing line: ~ inputs.keyboard.d || inputs.keyboard.right || inputs.keyboard.l~ - Inside source: true *** True Line Result - point.point_inside_circle? center, radius -** Processing line: ~ end~ + inputs.keyboard.d || inputs.keyboard.right || inputs.keyboard.l +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ alias_method :position, :point~ +** Processing line: ~ def set_object path, w, h~ - Inside source: true *** True Line Result - alias_method :position, :point -** Processing line: ~~ + def set_object path, w, h +** Processing line: ~ state.object = path~ - Inside source: true *** True Line Result - -** Processing line: ~ def clear~ + state.object = path +** Processing line: ~ state.object_w = w~ - Inside source: true *** True Line Result - def clear -** Processing line: ~ if @click~ + state.object_w = w +** Processing line: ~ state.object_h = h~ - Inside source: true *** True Line Result - if @click -** Processing line: ~ @previous_click = MousePoint.new @click.point.x, @click.point.y~ + state.object_h = h +** Processing line: ~ end~ - Inside source: true *** True Line Result - @previous_click = MousePoint.new @click.point.x, @click.point.y -** Processing line: ~ @previous_click.created_at = @click.created_at~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @previous_click.created_at = @click.created_at -** Processing line: ~ @previous_click.global_created_at = @click.global_created_at~ + +** Processing line: ~ def collision_mode~ - Inside source: true *** True Line Result - @previous_click.global_created_at = @click.global_created_at -** Processing line: ~ end~ + def collision_mode +** Processing line: ~ state.dev_action = :collision_mode~ - Inside source: true *** True Line Result - end + state.dev_action = :collision_mode +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @click = nil~ +** Processing line: ~ def process_inputs_player_movement~ - Inside source: true *** True Line Result - @click = nil -** Processing line: ~ @up = nil~ + def process_inputs_player_movement +** Processing line: ~ if inputs.keyboard.key_down.g~ - Inside source: true *** True Line Result - @up = nil -** Processing line: ~ @moved = nil~ + if inputs.keyboard.key_down.g +** Processing line: ~ state.god_mode = !state.god_mode~ - Inside source: true *** True Line Result - @moved = nil -** Processing line: ~ @wheel = nil~ + state.god_mode = !state.god_mode +** Processing line: ~ puts state.god_mode~ - Inside source: true *** True Line Result - @wheel = nil + puts state.god_mode ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -104403,14 +108396,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 up~ +** Processing line: ~ if inputs.keyboard.key_down.u && state.dev_action == :collision_mode~ - Inside source: true *** True Line Result - def up -** Processing line: ~ @up~ + if inputs.keyboard.key_down.u && state.dev_action == :collision_mode +** Processing line: ~ state.world = state.world[0..-2]~ - Inside source: true *** True Line Result - @up + state.world = state.world[0..-2] +** Processing line: ~ state.world_lookup = {}~ +- Inside source: true +*** True Line Result + state.world_lookup = {} ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -104419,298 +108416,338 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def down~ +** Processing line: ~ if inputs.keyboard.key_down.space && !state.anchor_point~ - Inside source: true *** True Line Result - def down -** Processing line: ~ @click~ + if inputs.keyboard.key_down.space && !state.anchor_point +** Processing line: ~ state.tongue_length = 0~ - Inside source: true *** True Line Result - @click -** Processing line: ~ end~ + state.tongue_length = 0 +** Processing line: ~ state.action = :shooting~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.action = :shooting +** Processing line: ~ outputs.sounds << 'sounds/shooting.wav'~ - Inside source: true *** True Line Result - -** Processing line: ~ def serialize~ + outputs.sounds << 'sounds/shooting.wav' +** Processing line: ~ elsif inputs.keyboard.key_down.space~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ result = {}~ + elsif inputs.keyboard.key_down.space +** Processing line: ~ state.action = :aiming~ - Inside source: true *** True Line Result - result = {} -** Processing line: ~~ + state.action = :aiming +** Processing line: ~ state.anchor_point = nil~ - Inside source: true *** True Line Result - -** Processing line: ~ if @click~ + state.anchor_point = nil +** Processing line: ~ state.tongue_length = 100~ - Inside source: true *** True Line Result - if @click -** Processing line: ~ result[:click] = @click.to_hash~ + state.tongue_length = 100 +** Processing line: ~ end~ - Inside source: true *** True Line Result - result[:click] = @click.to_hash -** Processing line: ~ result[:down] = @click.to_hash~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - result[:down] = @click.to_hash -** Processing line: ~ end~ + +** Processing line: ~ if state.anchor_point~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if state.anchor_point +** Processing line: ~ if input_up?~ - Inside source: true *** True Line Result - -** Processing line: ~ result[:up] = @up.to_hash if @up~ + if input_up? +** Processing line: ~ if state.tongue_length >= 105~ - Inside source: true *** True Line Result - result[:up] = @up.to_hash if @up -** Processing line: ~ result[:x] = @x~ + if state.tongue_length >= 105 +** Processing line: ~ state.tongue_length -= 5~ - Inside source: true *** True Line Result - result[:x] = @x -** Processing line: ~ result[:y] = @y~ + state.tongue_length -= 5 +** Processing line: ~ state.dy += 0.8~ - Inside source: true *** True Line Result - result[:y] = @y -** Processing line: ~ result[:moved] = @moved~ + state.dy += 0.8 +** Processing line: ~ end~ - Inside source: true *** True Line Result - result[:moved] = @moved -** Processing line: ~ result[:moved_at] = @moved_at~ + end +** Processing line: ~ elsif input_down?~ - Inside source: true *** True Line Result - result[:moved_at] = @moved_at -** Processing line: ~ result[:has_focus] = @has_focus~ + elsif input_down? +** Processing line: ~ state.tongue_length += 5~ - Inside source: true *** True Line Result - result[:has_focus] = @has_focus + state.tongue_length += 5 +** Processing line: ~ state.dy -= 0.8~ +- Inside source: true +*** True Line Result + state.dy -= 0.8 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ result~ +** Processing line: ~ if input_left? && state.dx > 1~ - Inside source: true *** True Line Result - result -** Processing line: ~ end~ + if input_left? && state.dx > 1 +** Processing line: ~ state.dx *= 0.98~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.dx *= 0.98 +** Processing line: ~ elsif input_left? && state.dx < -1~ - Inside source: true *** True Line Result - -** Processing line: ~ def to_s~ + elsif input_left? && state.dx < -1 +** Processing line: ~ state.dx *= 1.03~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ serialize.to_s~ + state.dx *= 1.03 +** Processing line: ~ elsif input_left? && !state.on_floor~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + elsif input_left? && !state.on_floor +** Processing line: ~ state.dx -= 3~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.dx -= 3 +** Processing line: ~ elsif input_right? && state.dx > 1~ - Inside source: true *** True Line Result - -** Processing line: ~ alias_method :inspect, :to_s~ + elsif input_right? && state.dx > 1 +** Processing line: ~ state.dx *= 1.03~ - Inside source: true *** True Line Result - alias_method :inspect, :to_s -** Processing line: ~ end~ + state.dx *= 1.03 +** Processing line: ~ elsif input_right? && state.dx < -1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif input_right? && state.dx < -1 +** Processing line: ~ state.dx *= 0.98~ - Inside source: true *** True Line Result - -** Processing line: ~ # Provides access to multitouch input~ + state.dx *= 0.98 +** Processing line: ~ elsif input_right? && !state.on_floor~ - Inside source: true *** True Line Result - # Provides access to multitouch input -** Processing line: ~ #~ + elsif input_right? && !state.on_floor +** Processing line: ~ state.dx += 3~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + state.dx += 3 +** Processing line: ~ end~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ class FingerTouch~ + end +** Processing line: ~ else~ - Inside source: true *** True Line Result - class FingerTouch -** Processing line: ~~ + else +** Processing line: ~ if input_left?~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + if input_left? +** Processing line: ~ state.tongue_angle += 1.5~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_accessor :moved,~ + state.tongue_angle += 1.5 +** Processing line: ~ state.tongue_angle = state.tongue_angle~ - Inside source: true *** True Line Result - attr_accessor :moved, -** Processing line: ~ :moved_at,~ + state.tongue_angle = state.tongue_angle +** Processing line: ~ elsif input_right?~ - Inside source: true *** True Line Result - :moved_at, -** Processing line: ~ :global_moved_at,~ + elsif input_right? +** Processing line: ~ state.tongue_angle -= 1.5~ - Inside source: true *** True Line Result - :global_moved_at, -** Processing line: ~ :touch_order,~ + state.tongue_angle -= 1.5 +** Processing line: ~ state.tongue_angle = state.tongue_angle~ - Inside source: true *** True Line Result - :touch_order, -** Processing line: ~ :x, :y~ + state.tongue_angle = state.tongue_angle +** Processing line: ~ end~ - Inside source: true *** True Line Result - :x, :y + 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 initialize~ +** Processing line: ~ def add_floors~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @moved = false~ + def add_floors +** Processing line: ~ # floors~ - Inside source: true *** True Line Result - @moved = false -** Processing line: ~ @moved_at = 0~ + # floors +** Processing line: ~ state.world += [~ - Inside source: true *** True Line Result - @moved_at = 0 -** Processing line: ~ @global_moved_at = 0~ + state.world += [ +** Processing line: ~ [0, 0, 10000, 40],~ - Inside source: true *** True Line Result - @global_moved_at = 0 -** Processing line: ~ @touch_order = 0~ + [0, 0, 10000, 40], +** Processing line: ~ [0, 1670, 3250, 60],~ - Inside source: true *** True Line Result - @touch_order = 0 -** Processing line: ~ @x = 0~ + [0, 1670, 3250, 60], +** Processing line: ~ [6691, 1653, 3290, 60],~ - Inside source: true *** True Line Result - @x = 0 -** Processing line: ~ @y = 0~ + [6691, 1653, 3290, 60], +** Processing line: ~ [1521, 3792, 7370, 60],~ - Inside source: true *** True Line Result - @y = 0 -** Processing line: ~ end~ + [1521, 3792, 7370, 60], +** Processing line: ~ [0, 5137, 3290, 60]~ - Inside source: true *** True Line Result - end + [0, 5137, 3290, 60] +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def point~ +** Processing line: ~ def attempt_load_world_from_file~ - Inside source: true *** True Line Result - def point -** Processing line: ~ [@x, @y].point~ + def attempt_load_world_from_file +** Processing line: ~ return if state.world~ - Inside source: true *** True Line Result - [@x, @y].point -** Processing line: ~ end~ + return if state.world +** Processing line: ~ # exported_world = gtk.read_file(MAP_FILE_PATH)~ - Inside source: true *** True Line Result - end + # exported_world = gtk.read_file(MAP_FILE_PATH) +** Processing line: ~ state.world = []~ +- Inside source: true +*** True Line Result + state.world = [] +** Processing line: ~ state.objects = []~ +- Inside source: true +*** True Line Result + state.objects = [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def inside_rect? rect~ +** Processing line: ~ if $collisions~ - Inside source: true *** True Line Result - def inside_rect? rect -** Processing line: ~ point.inside_rect? rect~ + if $collisions +** Processing line: ~ $collisions.map do |x, y, w, h|~ - Inside source: true *** True Line Result - point.inside_rect? rect -** Processing line: ~ end~ + $collisions.map do |x, y, w, h| +** Processing line: ~ state.world << [x, y, w, h]~ - Inside source: true *** True Line Result - end + state.world << [x, y, w, h] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def inside_circle? center, radius~ +** Processing line: ~ add_floors~ - Inside source: true *** True Line Result - def inside_circle? center, radius -** Processing line: ~ point.point_inside_circle? center, radius~ + add_floors +** Processing line: ~ # elsif exported_world~ - Inside source: true *** True Line Result - point.point_inside_circle? center, radius -** Processing line: ~ end~ + # elsif exported_world +** Processing line: ~ # exported_world.each_line.map do |l|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # exported_world.each_line.map do |l| +** Processing line: ~ # tokens = l.strip.split(',')~ - Inside source: true *** True Line Result - -** Processing line: ~ alias_method :position, :point~ + # tokens = l.strip.split(',') +** Processing line: ~ # x = tokens[0].to_i~ - Inside source: true *** True Line Result - alias_method :position, :point -** Processing line: ~~ + # x = tokens[0].to_i +** Processing line: ~ # y = tokens[1].to_i~ - Inside source: true *** True Line Result - -** Processing line: ~ def serialize~ + # y = tokens[1].to_i +** Processing line: ~ # type = tokens[2].to_i~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ result = {}~ + # type = tokens[2].to_i +** Processing line: ~ # if type == 1~ - Inside source: true *** True Line Result - result = {} -** Processing line: ~ result[:x] = @x~ + # if type == 1 +** Processing line: ~ # state.world << [x, y, state.tile_size, state.tile_size]~ - Inside source: true *** True Line Result - result[:x] = @x -** Processing line: ~ result[:y] = @y~ + # state.world << [x, y, state.tile_size, state.tile_size] +** Processing line: ~ # elsif type == 2~ - Inside source: true *** True Line Result - result[:y] = @y -** Processing line: ~ result[:touch_order] = @touch_order~ + # elsif type == 2 +** Processing line: ~ # w, h, path = tokens[3..-1]~ - Inside source: true *** True Line Result - result[:touch_order] = @touch_order -** Processing line: ~ result[:moved] = @moved~ + # w, h, path = tokens[3..-1] +** Processing line: ~ # state.objects << [x, y, w.to_i, h.to_i, path]~ - Inside source: true *** True Line Result - result[:moved] = @moved -** Processing line: ~ result[:moved_at] = @moved_at~ + # state.objects << [x, y, w.to_i, h.to_i, path] +** Processing line: ~ # end~ - Inside source: true *** True Line Result - result[:moved_at] = @moved_at + # end +** Processing line: ~ # end~ +- Inside source: true +*** True Line Result + # end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ result~ +** Processing line: ~ # add_floors~ - Inside source: true *** True Line Result - result + # add_floors ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -104719,194 +108756,214 @@ 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~ +** Processing line: ~ if $mugs~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ serialize.to_s~ + if $mugs +** Processing line: ~ $mugs.map do |x, y, w, h, path|~ - Inside source: true *** True Line Result - serialize.to_s + $mugs.map do |x, y, w, h, path| +** Processing line: ~ state.objects << [x, y, w, h, path]~ +- Inside source: true +*** True Line Result + state.objects << [x, y, w, h, path] +** 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: ~ alias_method :inspect, :to_s~ +** Processing line: ~ def calc_world_lookup~ - Inside source: true *** True Line Result - alias_method :inspect, :to_s -** Processing line: ~ end~ + def calc_world_lookup +** Processing line: ~ if state.tile_size != state.previous_tile_size~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + if state.tile_size != state.previous_tile_size +** Processing line: ~ state.previous_tile_size = state.tile_size~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.previous_tile_size = state.tile_size +** Processing line: ~ state.world_lookup = {}~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + state.world_lookup = {} +** Processing line: ~ end~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ # @gtk~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ class Inputs~ + +** Processing line: ~ return if state.world_lookup.keys.length > 0~ - Inside source: true *** True Line Result - class Inputs + return if state.world_lookup.keys.length > 0 +** Processing line: ~ return unless state.world.length > 0~ +- Inside source: true +*** True Line Result + return unless state.world.length > 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # A list of all controllers.~ +** Processing line: ~ # Searches through the world and finds the cordinates that exist~ - Inside source: true *** True Line Result - # A list of all controllers. -** Processing line: ~ #~ + # Searches through the world and finds the cordinates that exist +** Processing line: ~ state.world_lookup = {}~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Controller[]]~ + state.world_lookup = {} +** Processing line: ~ state.world.each do |x, y, w, h|~ - Inside source: true *** True Line Result - # @return [Controller[]] -** Processing line: ~ # @gtk~ + state.world.each do |x, y, w, h| +** Processing line: ~ state.world_lookup[[x, y, w || state.tile_size, h || state.tile_size]] = true~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_reader :controllers~ + state.world_lookup[[x, y, w || state.tile_size, h || state.tile_size]] = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_reader :controllers + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @return [Keyboard]~ +** Processing line: ~ # Assigns collision rects for every sprite drawn~ - Inside source: true *** True Line Result - # @return [Keyboard] -** Processing line: ~ # @gtk~ + # Assigns collision rects for every sprite drawn +** Processing line: ~ state.world_collision_rects =~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_reader :keyboard~ + state.world_collision_rects = +** Processing line: ~ state.world_lookup~ - Inside source: true *** True Line Result - attr_reader :keyboard -** Processing line: ~~ + state.world_lookup +** Processing line: ~ .keys~ - Inside source: true *** True Line Result - -** Processing line: ~ # @return [Mouse]~ + .keys +** Processing line: ~ .map do |x, y, w, h|~ - Inside source: true *** True Line Result - # @return [Mouse] -** Processing line: ~ # @gtk~ + .map do |x, y, w, h| +** Processing line: ~ s = state.tile_size~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_reader :mouse~ + s = state.tile_size +** Processing line: ~ w ||= s~ - Inside source: true *** True Line Result - attr_reader :mouse -** Processing line: ~~ + w ||= s +** Processing line: ~ h ||= s~ - Inside source: true *** True Line Result - -** Processing line: ~ # @return {FingerTouch}~ + h ||= s +** Processing line: ~ {~ - Inside source: true *** True Line Result - # @return {FingerTouch} -** Processing line: ~ # @gtk~ + { +** Processing line: ~ args: [x, y, w, h],~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_reader :touch~ + args: [x, y, w, h], +** Processing line: ~ left_right: [x, y + 4, w, h - 6],~ - Inside source: true *** True Line Result - attr_reader :touch -** Processing line: ~ attr_accessor :finger_one, :finger_two~ + left_right: [x, y + 4, w, h - 6], +** Processing line: ~ top: [x + 4, y + 6, w - 8, h - 6],~ - Inside source: true *** True Line Result - attr_accessor :finger_one, :finger_two -** Processing line: ~~ + top: [x + 4, y + 6, w - 8, h - 6], +** Processing line: ~ bottom: [x + 1, y - 1, w - 2, h - 8],~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + bottom: [x + 1, y - 1, w - 2, h - 8], +** Processing line: ~ }~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ attr_accessor :text, :history~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - attr_accessor :text, :history + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def initialize~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @controllers = [Controller.new, Controller.new]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @controllers = [Controller.new, Controller.new] -** Processing line: ~ @keyboard = Keyboard.new~ + +** Processing line: ~ def calc_pendulum~ - Inside source: true *** True Line Result - @keyboard = Keyboard.new -** Processing line: ~ @mouse = Mouse.new~ + def calc_pendulum +** Processing line: ~ return if !state.anchor_point~ - Inside source: true *** True Line Result - @mouse = Mouse.new -** Processing line: ~ @touch = {}~ + return if !state.anchor_point +** Processing line: ~ target_x = state.anchor_point.x - start_of_tongue.x~ - Inside source: true *** True Line Result - @touch = {} -** Processing line: ~ @finger_one = nil~ + target_x = state.anchor_point.x - start_of_tongue.x +** Processing line: ~ target_y = state.anchor_point.y -~ - Inside source: true *** True Line Result - @finger_one = nil -** Processing line: ~ @finger_two = nil~ + target_y = state.anchor_point.y - +** Processing line: ~ state.tongue_length - 5 - 20 - state.player_height~ - Inside source: true *** True Line Result - @finger_two = nil -** Processing line: ~ @text = []~ + state.tongue_length - 5 - 20 - state.player_height +** Processing line: ~~ - Inside source: true *** True Line Result - @text = [] -** Processing line: ~ end~ + +** Processing line: ~ diff_y = state.y - target_y~ - Inside source: true *** True Line Result - end + diff_y = state.y - target_y ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def up~ +** Processing line: ~ if target_x > 0~ - Inside source: true *** True Line Result - def up -** Processing line: ~ keyboard.up ||~ + if target_x > 0 +** Processing line: ~ state.dx += 0.6~ - Inside source: true *** True Line Result - keyboard.up || -** Processing line: ~ (controller_one && controller_one.up)~ + state.dx += 0.6 +** Processing line: ~ elsif target_x < 0~ - Inside source: true *** True Line Result - (controller_one && controller_one.up) + elsif target_x < 0 +** Processing line: ~ state.dx -= 0.6~ +- Inside source: true +*** True Line Result + state.dx -= 0.6 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -104915,18 +108972,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 down~ +** Processing line: ~ if diff_y > 0~ - Inside source: true *** True Line Result - def down -** Processing line: ~ keyboard.down ||~ + if diff_y > 0 +** Processing line: ~ state.dy -= 0.1~ - Inside source: true *** True Line Result - keyboard.down || -** Processing line: ~ (controller_one && controller_one.down)~ + state.dy -= 0.1 +** Processing line: ~ elsif diff_y < 0~ - Inside source: true *** True Line Result - (controller_one && controller_one.down) + elsif diff_y < 0 +** Processing line: ~ state.dy += 0.1~ +- Inside source: true +*** True Line Result + state.dy += 0.1 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -104935,38 +108996,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 left~ -- Inside source: true -*** True Line Result - def left -** Processing line: ~ keyboard.left ||~ -- Inside source: true -*** True Line Result - keyboard.left || -** Processing line: ~ (controller_one && controller_one.left)~ -- Inside source: true -*** True Line Result - (controller_one && controller_one.left) -** Processing line: ~ end~ +** Processing line: ~ state.dx *= 0.99~ - Inside source: true *** True Line Result - end + state.dx *= 0.99 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def right~ +** Processing line: ~ if state.dy.abs < 2~ - Inside source: true *** True Line Result - def right -** Processing line: ~ keyboard.right ||~ + if state.dy.abs < 2 +** Processing line: ~ state.dy *= 0.8~ - Inside source: true *** True Line Result - keyboard.right || -** Processing line: ~ (controller_one && controller_one.right)~ + state.dy *= 0.8 +** Processing line: ~ else~ - Inside source: true *** True Line Result - (controller_one && controller_one.right) + else +** Processing line: ~ state.dy *= 0.90~ +- Inside source: true +*** True Line Result + state.dy *= 0.90 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -104975,462 +109028,474 @@ 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_vector~ -- Inside source: true -*** True Line Result - def directional_vector -** Processing line: ~ keyboard.directional_vector ||~ +** Processing line: ~ if state.tongue_length && state.y~ - Inside source: true *** True Line Result - keyboard.directional_vector || -** Processing line: ~ (controller_one && controller_one.directional_vector)~ + if state.tongue_length && state.y +** Processing line: ~ state.dy += state.tongue_angle.vector_y state.tongue_length.fdiv(1000)~ - Inside source: true *** True Line Result - (controller_one && controller_one.directional_vector) + state.dy += state.tongue_angle.vector_y state.tongue_length.fdiv(1000) ** 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: ~ # Returns a signal indicating right (`1`), left (`-1`), or neither ('0').~ +** Processing line: ~ def calc_tongue_angle~ - Inside source: true *** True Line Result - # Returns a signal indicating right (`1`), left (`-1`), or neither ('0'). -** Processing line: ~ #~ + def calc_tongue_angle +** Processing line: ~ return unless state.anchor_point~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Integer]~ + return unless state.anchor_point +** Processing line: ~ state.tongue_angle = args.geometry.angle_from state.anchor_point, start_of_tongue~ - Inside source: true *** True Line Result - # @return [Integer] -** Processing line: ~ def left_right~ + state.tongue_angle = args.geometry.angle_from state.anchor_point, start_of_tongue +** Processing line: ~ state.tongue_length = args.geometry.distance(start_of_tongue, state.anchor_point)~ - Inside source: true *** True Line Result - def left_right -** Processing line: ~ return -1 if self.left~ + state.tongue_length = args.geometry.distance(start_of_tongue, state.anchor_point) +** Processing line: ~ state.tongue_length = state.tongue_length.greater(100)~ - Inside source: true *** True Line Result - return -1 if self.left -** Processing line: ~ return 1 if self.right~ + state.tongue_length = state.tongue_length.greater(100) +** Processing line: ~ end~ - Inside source: true *** True Line Result - return 1 if self.right -** Processing line: ~ return 0~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - return 0 -** Processing line: ~ end~ + +** Processing line: ~ def player_from_end_of_tongue~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def player_from_end_of_tongue +** Processing line: ~ p = state.tongue_angle.vector(state.tongue_length)~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns a signal indicating up (`1`), down (`-1`), or neither ('0').~ + p = state.tongue_angle.vector(state.tongue_length) +** Processing line: ~ derived_start = [state.anchor_point.x - p.x, state.anchor_point.y - p.y]~ - Inside source: true *** True Line Result - # Returns a signal indicating up (`1`), down (`-1`), or neither ('0'). -** Processing line: ~ #~ + derived_start = [state.anchor_point.x - p.x, state.anchor_point.y - p.y] +** Processing line: ~ derived_start.x -= state.player_width.half~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Integer]~ + derived_start.x -= state.player_width.half +** Processing line: ~ derived_start.y -= state.player_height.half~ - Inside source: true *** True Line Result - # @return [Integer] -** Processing line: ~ def up_down~ + derived_start.y -= state.player_height.half +** Processing line: ~ derived_start~ - Inside source: true *** True Line Result - def up_down -** Processing line: ~ return 1 if self.up~ + derived_start +** Processing line: ~ end~ - Inside source: true *** True Line Result - return 1 if self.up -** Processing line: ~ return -1 if self.down~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - return -1 if self.down -** Processing line: ~ return 0~ + +** Processing line: ~ def end_of_tongue~ - Inside source: true *** True Line Result - return 0 -** Processing line: ~ end~ + def end_of_tongue +** Processing line: ~ p = state.tongue_angle.vector(state.tongue_length)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + p = state.tongue_angle.vector(state.tongue_length) +** Processing line: ~ [start_of_tongue.x + p.x, start_of_tongue.y + p.y]~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns the coordinates of the last click.~ + [start_of_tongue.x + p.x, start_of_tongue.y + p.y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - # Returns the coordinates of the last click. -** Processing line: ~ #~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Float, Float]~ + +** Processing line: ~ def calc_shooting~ - Inside source: true *** True Line Result - # @return [Float, Float] -** Processing line: ~ def click~ + def calc_shooting +** Processing line: ~ return unless state.action == :shooting~ - Inside source: true *** True Line Result - def click -** Processing line: ~ return nil unless @mouse.click~ + return unless state.action == :shooting +** Processing line: ~ state.tongue_length += 30~ - Inside source: true *** True Line Result - return nil unless @mouse.click -** Processing line: ~ return @mouse.click.point~ + state.tongue_length += 30 +** Processing line: ~ potential_anchor = end_of_tongue~ - Inside source: true *** True Line Result - return @mouse.click.point -** Processing line: ~ end~ + potential_anchor = end_of_tongue +** Processing line: ~ if potential_anchor.x <= 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if potential_anchor.x <= 0 +** Processing line: ~ state.anchor_point = potential_anchor~ - Inside source: true *** True Line Result - -** Processing line: ~ # The first controller.~ + state.anchor_point = potential_anchor +** Processing line: ~ state.action = :anchored~ - Inside source: true *** True Line Result - # The first controller. -** Processing line: ~ #~ + state.action = :anchored +** Processing line: ~ outputs.sounds << 'sounds/attached.wav'~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Controller]~ + outputs.sounds << 'sounds/attached.wav' +** Processing line: ~ elsif potential_anchor.x >= 10000~ - Inside source: true *** True Line Result - # @return [Controller] -** Processing line: ~ def controller_one~ + elsif potential_anchor.x >= 10000 +** Processing line: ~ state.anchor_point = potential_anchor~ - Inside source: true *** True Line Result - def controller_one -** Processing line: ~ @controllers[0]~ + state.anchor_point = potential_anchor +** Processing line: ~ state.action = :anchored~ - Inside source: true *** True Line Result - @controllers[0] -** Processing line: ~ end~ + state.action = :anchored +** Processing line: ~ outputs.sounds << 'sounds/attached.wav'~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.sounds << 'sounds/attached.wav' +** Processing line: ~ elsif potential_anchor.y <= 0~ - Inside source: true *** True Line Result - -** Processing line: ~ # The second controller.~ + elsif potential_anchor.y <= 0 +** Processing line: ~ state.anchor_point = potential_anchor~ - Inside source: true *** True Line Result - # The second controller. -** Processing line: ~ #~ + state.anchor_point = potential_anchor +** Processing line: ~ state.action = :anchored~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [Controller]~ + state.action = :anchored +** Processing line: ~ outputs.sounds << 'sounds/attached.wav'~ - Inside source: true *** True Line Result - # @return [Controller] -** Processing line: ~ def controller_two~ + outputs.sounds << 'sounds/attached.wav' +** Processing line: ~ elsif potential_anchor.y >= 5875~ - Inside source: true *** True Line Result - def controller_two -** Processing line: ~ @controllers[1]~ + elsif potential_anchor.y >= 5875 +** Processing line: ~ state.anchor_point = potential_anchor~ - Inside source: true *** True Line Result - @controllers[1] -** Processing line: ~ end~ + state.anchor_point = potential_anchor +** Processing line: ~ state.action = :anchored~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.action = :anchored +** Processing line: ~ outputs.sounds << 'sounds/attached.wav'~ - Inside source: true *** True Line Result - -** Processing line: ~ # Clears all inputs.~ + outputs.sounds << 'sounds/attached.wav' +** Processing line: ~ else~ - Inside source: true *** True Line Result - # Clears all inputs. -** Processing line: ~ #~ + else +** Processing line: ~ anchor_rect = [potential_anchor.x - 5, potential_anchor.y - 5, 10, 10]~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @return [void]~ + anchor_rect = [potential_anchor.x - 5, potential_anchor.y - 5, 10, 10] +** Processing line: ~ collision = state.world_collision_rects.find_all do |v|~ - Inside source: true *** True Line Result - # @return [void] -** Processing line: ~ def clear~ + collision = state.world_collision_rects.find_all do |v| +** Processing line: ~ [v[:args].x, v[:args].y, v[:args].w, v[:args].h].intersect_rect?(anchor_rect)~ - Inside source: true *** True Line Result - def clear -** Processing line: ~ @mouse.clear~ + [v[:args].x, v[:args].y, v[:args].w, v[:args].h].intersect_rect?(anchor_rect) +** Processing line: ~ end.first~ - Inside source: true *** True Line Result - @mouse.clear -** Processing line: ~ @keyboard.clear~ + end.first +** Processing line: ~ if collision~ - Inside source: true *** True Line Result - @keyboard.clear -** Processing line: ~ @controllers.each(&:clear)~ + if collision +** Processing line: ~ state.anchor_point = potential_anchor~ - Inside source: true *** True Line Result - @controllers.each(&:clear) -** Processing line: ~ @touch.clear~ + state.anchor_point = potential_anchor +** Processing line: ~ state.action = :anchored~ - Inside source: true *** True Line Result - @touch.clear -** Processing line: ~ @finger_one = nil~ + state.action = :anchored +** Processing line: ~ outputs.sounds << 'sounds/attached.wav'~ - Inside source: true *** True Line Result - @finger_one = nil -** Processing line: ~ @finger_two = nil~ + outputs.sounds << 'sounds/attached.wav' +** Processing line: ~ end~ - Inside source: true *** True Line Result - @finger_two = nil + 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: ~ # @return [Hash]~ +** Processing line: ~ def calc_player~ - Inside source: true *** True Line Result - # @return [Hash] -** Processing line: ~ def serialize~ + def calc_player +** Processing line: ~ calc_shooting~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ {~ + calc_shooting +** Processing line: ~ if !state.god_mode~ - Inside source: true *** True Line Result - { -** Processing line: ~ controller_one: controller_one.serialize,~ + if !state.god_mode +** Processing line: ~ state.dy += state.gravity # Since acceleration is the change in velocity, the change in y (dy) increases every frame~ - Inside source: true *** True Line Result - controller_one: controller_one.serialize, -** Processing line: ~ controller_two: controller_two.serialize,~ + state.dy += state.gravity # Since acceleration is the change in velocity, the change in y (dy) increases every frame +** Processing line: ~ state.dx += state.dx * state.air~ - Inside source: true *** True Line Result - controller_two: controller_two.serialize, -** Processing line: ~ keyboard: keyboard.serialize,~ + state.dx += state.dx * state.air +** Processing line: ~ end~ - Inside source: true *** True Line Result - keyboard: keyboard.serialize, -** Processing line: ~ mouse: mouse.serialize,~ + end +** Processing line: ~ calc_pendulum~ - Inside source: true *** True Line Result - mouse: mouse.serialize, -** Processing line: ~ text: text.serialize~ + calc_pendulum +** Processing line: ~ calc_box_collision~ - Inside source: true *** True Line Result - text: text.serialize -** Processing line: ~ }~ + calc_box_collision +** Processing line: ~ calc_edge_collision~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + calc_edge_collision +** Processing line: ~ if !state.god_mode~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + if !state.god_mode +** Processing line: ~ state.y += state.dy~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + state.y += state.dy +** Processing line: ~ state.x += state.dx~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.x += state.dx +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + end +** Processing line: ~ calc_tongue_angle~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + calc_tongue_angle +** Processing line: ~ end~ +- Inside source: true *** True Line Result - -** Processing line: ~* ios_wizard.rb~ -- Header detected. + end +** Processing line: ~~ +- Inside source: true *** True Line Result +** Processing line: ~ def calc_box_collision~ +- Inside source: true *** True Line Result -* ios_wizard.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + def calc_box_collision +** Processing line: ~ return unless state.world_lookup.keys.length > 0~ +- Inside source: true *** True Line Result - + return unless state.world_lookup.keys.length > 0 +** Processing line: ~ collision_floor~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/ios_wizard.rb~ + collision_floor +** Processing line: ~ collision_left~ - Inside source: true *** True Line Result - # ./dragon/ios_wizard.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + collision_left +** Processing line: ~ collision_right~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + collision_right +** Processing line: ~ collision_ceiling~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # ios_wizard.rb has been released under MIT (*only this file*).~ + collision_ceiling +** Processing line: ~ end~ - Inside source: true *** True Line Result - # ios_wizard.rb has been released under MIT (*only this file*). + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class WizardException < Exception~ +** Processing line: ~ def calc_edge_collision~ - Inside source: true *** True Line Result - class WizardException < Exception -** Processing line: ~ attr_accessor :console_primitives~ + def calc_edge_collision +** Processing line: ~ # Ensures that player doesn't fall below the map~ - Inside source: true *** True Line Result - attr_accessor :console_primitives -** Processing line: ~~ + # Ensures that player doesn't fall below the map +** Processing line: ~ if next_y < 0 && state.dy < 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize *console_primitives~ + if next_y < 0 && state.dy < 0 +** Processing line: ~ state.y = 0~ - Inside source: true *** True Line Result - def initialize *console_primitives -** Processing line: ~ @console_primitives = console_primitives~ + state.y = 0 +** Processing line: ~ state.dy = state.dy.abs * 0.8~ - Inside source: true *** True Line Result - @console_primitives = console_primitives -** Processing line: ~ end~ + state.dy = state.dy.abs * 0.8 +** Processing line: ~ state.collision_on_y = true~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + state.collision_on_y = true +** Processing line: ~ # Ensures player doesn't go insanely high~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Ensures player doesn't go insanely high +** Processing line: ~ elsif next_y > 5875 - state.tile_size && state.dy > 0~ - Inside source: true *** True Line Result - -** Processing line: ~ class IOSWizard~ + elsif next_y > 5875 - state.tile_size && state.dy > 0 +** Processing line: ~ state.y = 5875 - state.tile_size~ - Inside source: true *** True Line Result - class IOSWizard -** Processing line: ~ def initialize~ + state.y = 5875 - state.tile_size +** Processing line: ~ state.dy = state.dy.abs * 0.8 * -1~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @doctor_executed_at = 0~ + state.dy = state.dy.abs * 0.8 * -1 +** Processing line: ~ state.collision_on_y = true~ - Inside source: true *** True Line Result - @doctor_executed_at = 0 -** Processing line: ~ end~ + state.collision_on_y = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def relative_path~ +** Processing line: ~ # Ensures that player remains in the horizontal range its supposed to~ - Inside source: true *** True Line Result - def relative_path -** Processing line: ~ (File.dirname $gtk.binary_path)~ + # Ensures that player remains in the horizontal range its supposed to +** Processing line: ~ if state.x >= 10000 - state.tile_size && state.dx > 0~ - Inside source: true *** True Line Result - (File.dirname $gtk.binary_path) -** Processing line: ~ end~ + if state.x >= 10000 - state.tile_size && state.dx > 0 +** Processing line: ~ state.x = 10000 - state.tile_size~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.x = 10000 - state.tile_size +** Processing line: ~ state.dx = state.dx.abs * 0.8 * -1~ - Inside source: true *** True Line Result - -** Processing line: ~ def steps~ + state.dx = state.dx.abs * 0.8 * -1 +** Processing line: ~ state.collision_on_x = true~ - Inside source: true *** True Line Result - def steps -** Processing line: ~ [~ + state.collision_on_x = true +** Processing line: ~ elsif state.x <= 0 && state.dx < 0~ - Inside source: true *** True Line Result - [ -** Processing line: ~ :check_for_xcode,~ + elsif state.x <= 0 && state.dx < 0 +** Processing line: ~ state.x = 0~ - Inside source: true *** True Line Result - :check_for_xcode, -** Processing line: ~ :check_for_brew,~ + state.x = 0 +** Processing line: ~ state.dx = state.dx.abs * 0.8~ - Inside source: true *** True Line Result - :check_for_brew, -** Processing line: ~ :check_for_certs,~ + state.dx = state.dx.abs * 0.8 +** Processing line: ~ state.collision_on_x = true~ - Inside source: true *** True Line Result - :check_for_certs, -** Processing line: ~ :check_for_device,~ + state.collision_on_x = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - :check_for_device, -** Processing line: ~ :check_for_dev_profile,~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - :check_for_dev_profile, -** Processing line: ~ :determine_app_name,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - :determine_app_name, -** Processing line: ~ :determine_app_id,~ + +** Processing line: ~ def next_y~ - Inside source: true *** True Line Result - :determine_app_id, -** Processing line: ~ :blow_away_temp,~ + def next_y +** Processing line: ~ state.y + state.dy~ - Inside source: true *** True Line Result - :blow_away_temp, -** Processing line: ~ :stage_app,~ + state.y + state.dy +** Processing line: ~ end~ - Inside source: true *** True Line Result - :stage_app, -** Processing line: ~ :write_info_plist,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - :write_info_plist, -** Processing line: ~ :write_entitlements_plist,~ + +** Processing line: ~ def next_x~ - Inside source: true *** True Line Result - :write_entitlements_plist, -** Processing line: ~ :code_sign,~ + def next_x +** Processing line: ~ if state.dx < 0~ - Inside source: true *** True Line Result - :code_sign, -** Processing line: ~ :create_ipa,~ + if state.dx < 0 +** Processing line: ~ return (state.x + state.dx) - (state.tile_size - state.player_width)~ - Inside source: true *** True Line Result - :create_ipa, -** Processing line: ~ :deploy,~ + return (state.x + state.dx) - (state.tile_size - state.player_width) +** Processing line: ~ else~ - Inside source: true *** True Line Result - :deploy, -** Processing line: ~ ]~ + else +** Processing line: ~ return (state.x + state.dx) + (state.tile_size - state.player_width)~ - Inside source: true *** True Line Result - ] + return (state.x + state.dx) + (state.tile_size - state.player_width) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -105439,58 +109504,58 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def get_reserved_sprite png~ +** Processing line: ~ def collision_floor~ - Inside source: true *** True Line Result - def get_reserved_sprite png -** Processing line: ~ sprite_path = ".dragonruby/sprites/wizards/ios/#{png}"~ + def collision_floor +** Processing line: ~ return unless state.dy <= 0~ - Inside source: true *** True Line Result - sprite_path = ".dragonruby/sprites/wizards/ios/#{png}" + return unless state.dy <= 0 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if !$gtk.ivar :rcb_release_mode~ +** Processing line: ~ player_rect = [state.x, next_y, state.tile_size, state.tile_size]~ - Inside source: true *** True Line Result - if !$gtk.ivar :rcb_release_mode -** Processing line: ~ sprite_path = "deploy_template/#{sprite_path}"~ + player_rect = [state.x, next_y, state.tile_size, state.tile_size] +** Processing line: ~~ - Inside source: true *** True Line Result - sprite_path = "deploy_template/#{sprite_path}" -** Processing line: ~ $gtk.reset_sprite sprite_path~ + +** Processing line: ~ # Runs through all the sprites on the field and determines if the player hits the bottom of sprite (hence "-0.1" above)~ - Inside source: true *** True Line Result - $gtk.reset_sprite sprite_path -** Processing line: ~ end~ + # Runs through all the sprites on the field and determines if the player hits the bottom of sprite (hence "-0.1" above) +** Processing line: ~ floor_collisions = state.world_collision_rects~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + floor_collisions = state.world_collision_rects +** Processing line: ~ .find_all { |r| r[:top].intersect_rect?(player_rect, state.collision_tolerance) }~ - Inside source: true *** True Line Result - -** Processing line: ~ if !$gtk.read_file sprite_path~ + .find_all { |r| r[:top].intersect_rect?(player_rect, state.collision_tolerance) } +** Processing line: ~ .first~ - Inside source: true *** True Line Result - if !$gtk.read_file sprite_path -** Processing line: ~ log_error "png #{png} not found."~ + .first +** Processing line: ~~ - Inside source: true *** True Line Result - log_error "png #{png} not found." -** Processing line: ~ end~ + +** Processing line: ~ return unless floor_collisions~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + return unless floor_collisions +** Processing line: ~ state.y = floor_collisions[:top].top~ - Inside source: true *** True Line Result - -** Processing line: ~ sprite_path~ + state.y = floor_collisions[:top].top +** Processing line: ~ state.dy = state.dy.abs * 0.8~ - Inside source: true *** True Line Result - sprite_path + state.dy = state.dy.abs * 0.8 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -105499,126 +109564,118 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def start~ +** Processing line: ~ def collision_left~ - Inside source: true *** True Line Result - def start -** Processing line: ~ @certificate_name = nil~ + def collision_left +** Processing line: ~ return unless state.dx < 0~ - Inside source: true *** True Line Result - @certificate_name = nil -** Processing line: ~ init_wizard_status~ + return unless state.dx < 0 +** Processing line: ~ player_rect = [next_x, state.y, state.tile_size, state.tile_size]~ - Inside source: true *** True Line Result - init_wizard_status -** Processing line: ~ log_info "Starting iOS Wizard so we can deploy to your device."~ + player_rect = [next_x, state.y, state.tile_size, state.tile_size] +** Processing line: ~~ - Inside source: true *** True Line Result - log_info "Starting iOS Wizard so we can deploy to your device." -** Processing line: ~ @start_at = Kernel.global_tick_count~ + +** Processing line: ~ # Runs through all the sprites on the field and determines if the player hits the left side of sprite (hence "-0.1" above)~ - Inside source: true *** True Line Result - @start_at = Kernel.global_tick_count -** Processing line: ~ steps.each do |m|~ + # Runs through all the sprites on the field and determines if the player hits the left side of sprite (hence "-0.1" above) +** Processing line: ~ left_side_collisions = state.world_collision_rects~ - Inside source: true *** True Line Result - steps.each do |m| -** Processing line: ~ begin~ -- Inside source: true -*** True Line Result - begin -** Processing line: ~ result = (send m) || :success if @wizard_status[m][:result] != :success~ + left_side_collisions = state.world_collision_rects +** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) }~ - Inside source: true *** True Line Result - result = (send m) || :success if @wizard_status[m][:result] != :success -** Processing line: ~ @wizard_status[m][:result] = result~ + .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) } +** Processing line: ~ .first~ - Inside source: true *** True Line Result - @wizard_status[m][:result] = result -** Processing line: ~ rescue Exception => e~ + .first +** Processing line: ~~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ if e.is_a? WizardException~ + +** Processing line: ~ return unless left_side_collisions~ - Inside source: true *** True Line Result - if e.is_a? WizardException -** Processing line: ~ $console.log.clear~ + return unless left_side_collisions +** Processing line: ~ state.x = left_side_collisions[:left_right].right~ - Inside source: true *** True Line Result - $console.log.clear -** Processing line: ~ $console.archived_log.clear~ + state.x = left_side_collisions[:left_right].right +** Processing line: ~ state.dx = state.dy.abs * 0.8~ - Inside source: true *** True Line Result - $console.archived_log.clear -** Processing line: ~ log "=" * $console.console_text_width~ + state.dx = state.dy.abs * 0.8 +** Processing line: ~ state.collision_on_x = true~ - Inside source: true *** True Line Result - log "=" * $console.console_text_width -** Processing line: ~ e.console_primitives.each do |p|~ + state.collision_on_x = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - e.console_primitives.each do |p| -** Processing line: ~ $console.add_primitive p~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - $console.add_primitive p -** Processing line: ~ end~ + +** Processing line: ~ def collision_right~ - Inside source: true *** True Line Result - end -** Processing line: ~ log "=" * $console.console_text_width~ + def collision_right +** Processing line: ~ return unless state.dx > 0~ - Inside source: true *** True Line Result - log "=" * $console.console_text_width -** Processing line: ~ else~ + return unless state.dx > 0 +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ log_error "Step #{m} failed."~ + +** Processing line: ~ player_rect = [next_x, state.y, state.tile_size, state.tile_size]~ - Inside source: true *** True Line Result - log_error "Step #{m} failed." -** Processing line: ~ log_error e.to_s~ + player_rect = [next_x, state.y, state.tile_size, state.tile_size] +** Processing line: ~ # Runs through all the sprites on the field and determines if the player hits the right side of sprite (hence "-0.1" above)~ - Inside source: true *** True Line Result - log_error e.to_s -** Processing line: ~ end~ + # Runs through all the sprites on the field and determines if the player hits the right side of sprite (hence "-0.1" above) +** Processing line: ~ right_side_collisions = state.world_collision_rects~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + right_side_collisions = state.world_collision_rects +** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) }~ - Inside source: true *** True Line Result - -** Processing line: ~ $console.set_command "$wizards.ios.start"~ + .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) } +** Processing line: ~ .first~ - Inside source: true *** True Line Result - $console.set_command "$wizards.ios.start" + .first ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ break~ -- Inside source: true -*** True Line Result - break -** Processing line: ~ end~ +** Processing line: ~ return unless right_side_collisions~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + return unless right_side_collisions +** Processing line: ~ state.x = right_side_collisions[:left_right].left - state.tile_size~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.x = right_side_collisions[:left_right].left - state.tile_size +** Processing line: ~ state.dx = state.dx.abs * 0.8 * -1~ - Inside source: true *** True Line Result - -** Processing line: ~ return nil~ + state.dx = state.dx.abs * 0.8 * -1 +** Processing line: ~ state.collision_on_x = true~ - Inside source: true *** True Line Result - return nil + state.collision_on_x = true ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -105627,126 +109684,134 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def always_fail~ +** Processing line: ~ def collision_ceiling~ - Inside source: true *** True Line Result - def always_fail -** Processing line: ~ return false if $gtk.ivar :rcb_release_mode~ + def collision_ceiling +** Processing line: ~ return unless state.dy > 0~ - Inside source: true *** True Line Result - return false if $gtk.ivar :rcb_release_mode -** Processing line: ~ return true~ + return unless state.dy > 0 +** Processing line: ~~ - Inside source: true *** True Line Result - return true -** Processing line: ~ end~ + +** Processing line: ~ player_rect = [state.x, next_y, state.player_width, state.player_height]~ - Inside source: true *** True Line Result - end + player_rect = [state.x, next_y, state.player_width, state.player_height] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def check_for_xcode~ +** Processing line: ~ # Runs through all the sprites on the field and determines if the player hits the ceiling of sprite (hence "+0.1" above)~ - Inside source: true *** True Line Result - def check_for_xcode -** Processing line: ~ if !cli_app_exist?(xcodebuild_cli_app)~ + # Runs through all the sprites on the field and determines if the player hits the ceiling of sprite (hence "+0.1" above) +** Processing line: ~ ceil_collisions = state.world_collision_rects~ - Inside source: true *** True Line Result - if !cli_app_exist?(xcodebuild_cli_app) -** Processing line: ~ raise WizardException.new(~ + ceil_collisions = state.world_collision_rects +** Processing line: ~ .find_all { |r| r[:bottom].intersect_rect?(player_rect, state.collision_tolerance) }~ - Inside source: true *** True Line Result - raise WizardException.new( -** Processing line: ~ "* You need Xcode to use $wizards.ios.start.",~ + .find_all { |r| r[:bottom].intersect_rect?(player_rect, state.collision_tolerance) } +** Processing line: ~ .first~ - Inside source: true *** True Line Result - "* You need Xcode to use $wizards.ios.start.", -** Processing line: ~ { w: 75, h: 75, path: get_reserved_sprite("xcode.png") },~ + .first +** Processing line: ~~ - Inside source: true *** True Line Result - { w: 75, h: 75, path: get_reserved_sprite("xcode.png") }, -** Processing line: ~ "** 1. Go to http://developer.apple.com and register.",~ + +** Processing line: ~ return unless ceil_collisions~ - Inside source: true *** True Line Result - "** 1. Go to http://developer.apple.com and register.", -** Processing line: ~ "** 2. Download Xcode 11.3+ from http://developer.apple.com/downloads.",~ + return unless ceil_collisions +** Processing line: ~ state.y = ceil_collisions[:bottom].y - state.tile_size~ - Inside source: true *** True Line Result - "** 2. Download Xcode 11.3+ from http://developer.apple.com/downloads.", -** Processing line: ~ " NOTE: DO NOT install Xcode from the App Store. Use the link above.",~ + state.y = ceil_collisions[:bottom].y - state.tile_size +** Processing line: ~ state.dy = state.dy.abs * 0.8 * -1~ - Inside source: true *** True Line Result - " NOTE: DO NOT install Xcode from the App Store. Use the link above.", -** Processing line: ~ { w: 700, h: 359, path: get_reserved_sprite("xcode-downloads.png") },~ + state.dy = state.dy.abs * 0.8 * -1 +** Processing line: ~ state.collision_on_y = true~ - Inside source: true *** True Line Result - { w: 700, h: 359, path: get_reserved_sprite("xcode-downloads.png") }, -** Processing line: ~ "** 3. After installing. Open up Xcode to accept the EULA."~ + state.collision_on_y = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - "** 3. After installing. Open up Xcode to accept the EULA." -** Processing line: ~ )~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - ) -** Processing line: ~ end~ + +** Processing line: ~ def to_coord point~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + def to_coord point +** Processing line: ~ # Integer divides (idiv) point.x to turn into grid~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # Integer divides (idiv) point.x to turn into grid +** Processing line: ~ # Then, you can just multiply each integer by state.tile_size~ - Inside source: true *** True Line Result - -** Processing line: ~ def check_for_brew~ + # Then, you can just multiply each integer by state.tile_size +** Processing line: ~ # later and huzzah. Grid coordinates~ - Inside source: true *** True Line Result - def check_for_brew -** Processing line: ~ if !cli_app_exist?('brew')~ + # later and huzzah. Grid coordinates +** Processing line: ~ [point.x.idiv(state.tile_size), point.y.idiv(state.tile_size)]~ - Inside source: true *** True Line Result - if !cli_app_exist?('brew') -** Processing line: ~ raise WizardException.new(~ + [point.x.idiv(state.tile_size), point.y.idiv(state.tile_size)] +** Processing line: ~ end~ - Inside source: true *** True Line Result - raise WizardException.new( -** Processing line: ~ "* You need to install Brew.",~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - "* You need to install Brew.", -** Processing line: ~ { w: 700, h: 388, path: get_reserved_sprite("brew.png") },~ + +** Processing line: ~ def export_map~ - Inside source: true *** True Line Result - { w: 700, h: 388, path: get_reserved_sprite("brew.png") }, -** Processing line: ~ "** 1. Go to http://brew.sh.",~ + def export_map +** Processing line: ~ export_string = state.world.map do |x, y|~ - Inside source: true *** True Line Result - "** 1. Go to http://brew.sh.", -** Processing line: ~ "** 2. Copy the command that starts with `/bin/bash -c` on the site.",~ + export_string = state.world.map do |x, y| +** Processing line: ~ "#{x},#{y},1"~ - Inside source: true *** True Line Result - "** 2. Copy the command that starts with `/bin/bash -c` on the site.", -** Processing line: ~ "** 3. Open Terminal and run the command you copied from the website.",~ + "#{x},#{y},1" +** Processing line: ~ end~ - Inside source: true *** True Line Result - "** 3. Open Terminal and run the command you copied from the website.", -** Processing line: ~ { w: 700, h: 99, path: get_reserved_sprite("terminal.png") },~ + end +** Processing line: ~ export_string += state.objects.map do |x, y, w, h, path|~ - Inside source: true *** True Line Result - { w: 700, h: 99, path: get_reserved_sprite("terminal.png") }, -** Processing line: ~ )~ + export_string += state.objects.map do |x, y, w, h, path| +** Processing line: ~ "#{x},#{y},2,#{w},#{h},#{path}"~ - Inside source: true *** True Line Result - ) + "#{x},#{y},2,#{w},#{h},#{path}" ** Processing line: ~ end~ - Inside source: true *** True Line Result end +** Processing line: ~ gtk.write_file(MAP_FILE_PATH, export_string.join("\n"))~ +- Inside source: true +*** True Line Result + gtk.write_file(MAP_FILE_PATH, export_string.join("\n")) +** Processing line: ~ state.map_saved_at = state.tick_count~ +- Inside source: true +*** True Line Result + state.map_saved_at = state.tick_count ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -105755,86 +109820,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 init_wizard_status~ +** Processing line: ~ def inputs_export_stage~ - Inside source: true *** True Line Result - def init_wizard_status -** Processing line: ~ @wizard_status = {}~ + def inputs_export_stage +** Processing line: ~ end~ - Inside source: true *** True Line Result - @wizard_status = {} -** Processing line: ~ steps.each do |m|~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - steps.each do |m| -** Processing line: ~ @wizard_status[m] = { result: :not_started }~ + +** Processing line: ~ def calc_score~ - Inside source: true *** True Line Result - @wizard_status[m] = { result: :not_started } -** Processing line: ~ end~ + def calc_score +** Processing line: ~ return unless state.scene == :game~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + return unless state.scene == :game +** Processing line: ~ player = [state.x, state.y, state.player_width, state.player_height]~ - Inside source: true *** True Line Result - -** Processing line: ~ previous_step = nil~ + player = [state.x, state.y, state.player_width, state.player_height] +** Processing line: ~ collected = state.objects.find_all { |s| s.intersect_rect? player }~ - Inside source: true *** True Line Result - previous_step = nil -** Processing line: ~ next_step = nil~ + collected = state.objects.find_all { |s| s.intersect_rect? player } +** Processing line: ~ state.stuff_score += collected.length~ - Inside source: true *** True Line Result - next_step = nil -** Processing line: ~ steps.each_cons(2) do |current_step, next_step|~ + state.stuff_score += collected.length +** Processing line: ~ if collected.length > 0~ - Inside source: true *** True Line Result - steps.each_cons(2) do |current_step, next_step| -** Processing line: ~ @wizard_status[current_step][:next_step] = next_step~ + if collected.length > 0 +** Processing line: ~ outputs.sounds << 'sounds/collectable.wav'~ - Inside source: true *** True Line Result - @wizard_status[current_step][:next_step] = next_step + outputs.sounds << 'sounds/collectable.wav' ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ state.objects = state.objects.reject { |s| collected.include? s }~ - Inside source: true *** True Line Result - -** Processing line: ~ steps.reverse.each_cons(2) do |current_step, previous_step|~ + state.objects = state.objects.reject { |s| collected.include? s } +** Processing line: ~ state.stuff_time += 0.01~ - Inside source: true *** True Line Result - steps.reverse.each_cons(2) do |current_step, previous_step| -** Processing line: ~ @wizard_status[current_step][:previous_step] = previous_step~ + state.stuff_time += 0.01 +** Processing line: ~ if state.objects.length == 0~ - Inside source: true *** True Line Result - @wizard_status[current_step][:previous_step] = previous_step -** Processing line: ~ end~ + if state.objects.length == 0 +** Processing line: ~ if !state.stuff_best_time || state.stuff_time < state.stuff_best_time~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + if !state.stuff_best_time || state.stuff_time < state.stuff_best_time +** Processing line: ~ state.stuff_best_time = state.stuff_time~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.stuff_best_time = state.stuff_time +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def restart~ + end +** Processing line: ~ state.game_over_at = nil~ - Inside source: true *** True Line Result - def restart -** Processing line: ~ init_wizard_status~ + state.game_over_at = nil +** Processing line: ~ state.scene = :ending~ - Inside source: true *** True Line Result - init_wizard_status -** Processing line: ~ start~ + state.scene = :ending +** Processing line: ~ end~ - Inside source: true *** True Line Result - start + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -105843,78 +109908,78 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def check_for_dev_profile~ +** Processing line: ~ def calc_on_floor~ - Inside source: true *** True Line Result - def check_for_dev_profile -** Processing line: ~ if !($gtk.read_file 'profiles/development.mobileprovision')~ + def calc_on_floor +** Processing line: ~ if state.action == :anchored~ - Inside source: true *** True Line Result - if !($gtk.read_file 'profiles/development.mobileprovision') -** Processing line: ~ $gtk.system "mkdir -p #{relative_path}/profiles"~ + if state.action == :anchored +** Processing line: ~ state.on_floor = false~ - Inside source: true *** True Line Result - $gtk.system "mkdir -p #{relative_path}/profiles" -** Processing line: ~ $gtk.system "open #{relative_path}/profiles"~ + state.on_floor = false +** Processing line: ~ state.on_floor_debounce = 30~ - Inside source: true *** True Line Result - $gtk.system "open #{relative_path}/profiles" -** Processing line: ~ $gtk.system "echo Download the mobile provisioning profile and place it here with the name development.mobileprovision > #{relative_path}/profiles/README.txt"~ + state.on_floor_debounce = 30 +** Processing line: ~ else~ - Inside source: true *** True Line Result - $gtk.system "echo Download the mobile provisioning profile and place it here with the name development.mobileprovision > #{relative_path}/profiles/README.txt" -** Processing line: ~ raise WizardException.new(~ + else +** Processing line: ~ state.on_floor_debounce ||= 30~ - Inside source: true *** True Line Result - raise WizardException.new( -** Processing line: ~ "* I didn't find a mobile provision.",~ + state.on_floor_debounce ||= 30 +** Processing line: ~~ - Inside source: true *** True Line Result - "* I didn't find a mobile provision.", -** Processing line: ~ "** 1. Go to http://developer.apple.com and click \"Certificates, IDs & Profiles\".",~ + +** Processing line: ~ if state.dy.round != 0~ - Inside source: true *** True Line Result - "** 1. Go to http://developer.apple.com and click \"Certificates, IDs & Profiles\".", -** Processing line: ~ "** 2. Add an App Identifier.",~ + if state.dy.round != 0 +** Processing line: ~ state.on_floor_debounce = 30~ - Inside source: true *** True Line Result - "** 2. Add an App Identifier.", -** Processing line: ~ "** 3. Select the App IDs option from the list.",~ + state.on_floor_debounce = 30 +** Processing line: ~ state.on_floor = false~ - Inside source: true *** True Line Result - "** 3. Select the App IDs option from the list.", -** Processing line: ~ { w: 700, h: 75, path: get_reserved_sprite("identifiers.png") },~ + state.on_floor = false +** Processing line: ~ else~ - Inside source: true *** True Line Result - { w: 700, h: 75, path: get_reserved_sprite("identifiers.png") }, -** Processing line: ~ "** 4. Add your Device next. You can use idevice_id -l to get the UUID of your device.",~ + else +** Processing line: ~ state.on_floor_debounce -= 1~ - Inside source: true *** True Line Result - "** 4. Add your Device next. You can use idevice_id -l to get the UUID of your device.", -** Processing line: ~ { w: 365, h: 69, path: get_reserved_sprite("device-link.png") },~ + state.on_floor_debounce -= 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - { w: 365, h: 69, path: get_reserved_sprite("device-link.png") }, -** Processing line: ~ "** 5. Create a Profile. Associate your certs, id, and device.",~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - "** 5. Create a Profile. Associate your certs, id, and device.", -** Processing line: ~ { w: 300, h: 122, path: get_reserved_sprite("profiles.png") },~ + +** Processing line: ~ if state.on_floor_debounce <= 0~ - Inside source: true *** True Line Result - { w: 300, h: 122, path: get_reserved_sprite("profiles.png") }, -** Processing line: ~ "** 6. Download the mobile provision and save it to 'profiles/development.mobileprovision'.",~ + if state.on_floor_debounce <= 0 +** Processing line: ~ state.on_floor_debounce = 0~ - Inside source: true *** True Line Result - "** 6. Download the mobile provision and save it to 'profiles/development.mobileprovision'.", -** Processing line: ~ { w: 200, h: 124, path: get_reserved_sprite("profiles-folder.png") },~ + state.on_floor_debounce = 0 +** Processing line: ~ state.on_floor = true~ - Inside source: true *** True Line Result - { w: 200, h: 124, path: get_reserved_sprite("profiles-folder.png") }, -** Processing line: ~ )~ + state.on_floor = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - ) + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -105927,142 +109992,138 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def determine_app_name~ -- Inside source: true -*** True Line Result - def determine_app_name -** Processing line: ~ @app_name = dev_profile_xml[:children].first[:children].first[:children][1][:children].first[:data]~ +** Processing line: ~ def render_player~ - Inside source: true *** True Line Result - @app_name = dev_profile_xml[:children].first[:children].first[:children][1][:children].first[:data] -** Processing line: ~ log_info "App name is: #{@app_name}."~ + def render_player +** Processing line: ~ path = "sprites/square-green.png"~ - Inside source: true *** True Line Result - log_info "App name is: #{@app_name}." -** Processing line: ~ end~ + path = "sprites/square-green.png" +** Processing line: ~ angle = 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + angle = 0 +** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y) - 30, "dy: #{state.dy.round}"]~ - Inside source: true *** True Line Result - -** Processing line: ~ def dev_profile_xml~ + # outputs.labels << [vx(state.x), vy(state.y) - 30, "dy: #{state.dy.round}"] +** Processing line: ~ if state.action == :idle~ - Inside source: true *** True Line Result - def dev_profile_xml -** Processing line: ~ xml = $gtk.read_file 'profiles/development.mobileprovision'~ + if state.action == :idle +** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "IDLE"]~ - Inside source: true *** True Line Result - xml = $gtk.read_file 'profiles/development.mobileprovision' -** Processing line: ~ scrubbed = xml.each_line.map do |l|~ + # outputs.labels << [vx(state.x), vy(state.y), "IDLE"] +** Processing line: ~ path = "sprites/square-green.png"~ - Inside source: true *** True Line Result - scrubbed = xml.each_line.map do |l| -** Processing line: ~ if l.strip.start_with? "<"~ + path = "sprites/square-green.png" +** Processing line: ~ elsif state.action == :aiming && !state.on_floor~ - Inside source: true *** True Line Result - if l.strip.start_with? "<" -** Processing line: ~ if l.start_with? ''~ + elsif state.action == :aiming && !state.on_floor +** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "AIMING AIR BORN"]~ - Inside source: true *** True Line Result - if l.start_with? '' -** Processing line: ~ ''~ + # outputs.labels << [vx(state.x), vy(state.y), "AIMING AIR BORN"] +** Processing line: ~ angle = state.tongue_angle - 90~ - Inside source: true *** True Line Result - '' -** Processing line: ~ elsif l.include? "Apple Inc."~ + angle = state.tongue_angle - 90 +** Processing line: ~ path = "sprites/square-green.png"~ - Inside source: true *** True Line Result - elsif l.include? "Apple Inc." -** Processing line: ~ nil~ + path = "sprites/square-green.png" +** Processing line: ~ elsif state.action == :aiming # ON THE GROUND~ - Inside source: true *** True Line Result - nil -** Processing line: ~ elsif l.include? ''~ + elsif state.action == :aiming # ON THE GROUND +** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "AIMING GROUND"]~ - Inside source: true *** True Line Result - elsif l.include? '' -** Processing line: ~ nil~ + # outputs.labels << [vx(state.x), vy(state.y), "AIMING GROUND"] +** Processing line: ~ path = "sprites/square-green.png"~ - Inside source: true *** True Line Result - nil -** Processing line: ~ else~ + path = "sprites/square-green.png" +** Processing line: ~ elsif state.action == :shooting && !state.on_floor~ - Inside source: true *** True Line Result - else -** Processing line: ~ l~ + elsif state.action == :shooting && !state.on_floor +** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "SHOOTING AIR BORN"]~ - Inside source: true *** True Line Result - l -** Processing line: ~ end~ + # outputs.labels << [vx(state.x), vy(state.y), "SHOOTING AIR BORN"] +** Processing line: ~ path = "sprites/square-green.png"~ - Inside source: true *** True Line Result - end -** Processing line: ~ else~ + path = "sprites/square-green.png" +** Processing line: ~ angle = state.tongue_angle - 90~ - Inside source: true *** True Line Result - else -** Processing line: ~ nil~ + angle = state.tongue_angle - 90 +** Processing line: ~ elsif state.action == :shooting~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + elsif state.action == :shooting +** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "SHOOTING ON GROUND"]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end.reject { |l| !l }.join~ + # outputs.labels << [vx(state.x), vy(state.y), "SHOOTING ON GROUND"] +** Processing line: ~ path = "sprites/square-green.png"~ - Inside source: true *** True Line Result - end.reject { |l| !l }.join -** Processing line: ~ $gtk.parse_xml scrubbed~ + path = "sprites/square-green.png" +** Processing line: ~ elsif state.action == :anchored~ - Inside source: true *** True Line Result - $gtk.parse_xml scrubbed -** Processing line: ~ end~ + elsif state.action == :anchored +** Processing line: ~ # outputs.labels << [vx(state.x), vy(state.y), "SWINGING"]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + # outputs.labels << [vx(state.x), vy(state.y), "SWINGING"] +** Processing line: ~ angle = state.tongue_angle - 90~ - Inside source: true *** True Line Result - -** Processing line: ~ def determine_app_id~ + angle = state.tongue_angle - 90 +** Processing line: ~ path = "sprites/square-green.png"~ - Inside source: true *** True Line Result - def determine_app_id -** Processing line: ~ # lol~ + path = "sprites/square-green.png" +** Processing line: ~ end~ - Inside source: true *** True Line Result - # lol -** Processing line: ~ @app_id = dev_profile_xml[:children].first[:children].first[:children][13][:children][1][:children].first[:data]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @app_id = dev_profile_xml[:children].first[:children].first[:children][13][:children][1][:children].first[:data] -** Processing line: ~ log_info "App Identifier is set to : #{@app_id}"~ + +** Processing line: ~ outputs.sprites << [vx(state.x),~ - Inside source: true *** True Line Result - log_info "App Identifier is set to : #{@app_id}" -** Processing line: ~ end~ + outputs.sprites << [vx(state.x), +** Processing line: ~ vy(state.y),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + vy(state.y), +** Processing line: ~ vw(state.player_width),~ - Inside source: true *** True Line Result - -** Processing line: ~ def set_app_name name~ + vw(state.player_width), +** Processing line: ~ vh(state.player_height),~ - Inside source: true *** True Line Result - def set_app_name name -** Processing line: ~ @app_name = name~ + vh(state.player_height), +** Processing line: ~ path,~ - Inside source: true *** True Line Result - @app_name = name -** Processing line: ~ start~ + path, +** Processing line: ~ angle]~ - Inside source: true *** True Line Result - start + angle] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -106071,4714 +110132,4714 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def set_dev_profile path~ +** Processing line: ~ def render_player_old~ - Inside source: true *** True Line Result - def set_dev_profile path -** Processing line: ~ if !$gtk.read_file path~ + def render_player_old +** Processing line: ~ # Player~ - Inside source: true *** True Line Result - if !$gtk.read_file path -** Processing line: ~ log_error "I couldn't find a development profile at #{path}."~ + # Player +** Processing line: ~ if state.action == :aiming~ - Inside source: true *** True Line Result - log_error "I couldn't find a development profile at #{path}." -** Processing line: ~ ask_for_dev_profile~ + if state.action == :aiming +** Processing line: ~ path = 'sprites\frg\idle\frog_idle.png'~ - Inside source: true *** True Line Result - ask_for_dev_profile -** Processing line: ~ else~ + path = 'sprites\frg\idle\frog_idle.png' +** Processing line: ~ if state.dx > 2~ - Inside source: true *** True Line Result - else -** Processing line: ~ @dev_profile_path = path~ + if state.dx > 2 +** Processing line: ~ #directional right sprite was here but i needa redo it~ - Inside source: true *** True Line Result - @dev_profile_path = path -** Processing line: ~ start~ + #directional right sprite was here but i needa redo it +** Processing line: ~ path = 'sprites\frg\anchor\frog-anchor-0.png'~ - Inside source: true *** True Line Result - start -** Processing line: ~ end~ + path = 'sprites\frg\anchor\frog-anchor-0.png' +** Processing line: ~ #directional left sprite was here but i needa redo it~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + #directional left sprite was here but i needa redo it +** Processing line: ~ elsif state.dx < -2~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif state.dx < -2 +** Processing line: ~ path = 'sprites\frg\anchor\frog-anchor-0.png'~ - Inside source: true *** True Line Result - -** Processing line: ~ def blow_away_temp~ + path = 'sprites\frg\anchor\frog-anchor-0.png' +** Processing line: ~ end~ - Inside source: true *** True Line Result - def blow_away_temp -** Processing line: ~ sh "rm -rf #{tmp_directory}"~ + end +** Processing line: ~ outputs.sprites << [vx(state.x),~ - Inside source: true *** True Line Result - sh "rm -rf #{tmp_directory}" -** Processing line: ~ end~ + outputs.sprites << [vx(state.x), +** Processing line: ~ vy(state.y),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + vy(state.y), +** Processing line: ~ vw(state.player_width),~ - Inside source: true *** True Line Result - -** Processing line: ~ def stage_app~ + vw(state.player_width), +** Processing line: ~ vh(state.player_height),~ - Inside source: true *** True Line Result - def stage_app -** Processing line: ~ log_info "Staging."~ + vh(state.player_height), +** Processing line: ~ path,~ - Inside source: true *** True Line Result - log_info "Staging." -** Processing line: ~ sh "mkdir -p #{tmp_directory}"~ + path, +** Processing line: ~ (state.tongue_angle - 90)]~ - Inside source: true *** True Line Result - sh "mkdir -p #{tmp_directory}" -** Processing line: ~ sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""~ + (state.tongue_angle - 90)] +** Processing line: ~ elsif state.action == :anchored || state.action == :shooting~ - Inside source: true *** True Line Result - sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\"" -** Processing line: ~ end~ + elsif state.action == :anchored || state.action == :shooting +** Processing line: ~ outputs.sprites << [vx(state.x),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.sprites << [vx(state.x), +** Processing line: ~ vy(state.y),~ - Inside source: true *** True Line Result - -** Processing line: ~ def set_app_id id~ + vy(state.y), +** Processing line: ~ vw(state.player_width),~ - Inside source: true *** True Line Result - def set_app_id id -** Processing line: ~ log_info = "App Id set to: #{id}"~ + vw(state.player_width), +** Processing line: ~ vw(state.player_height),~ - Inside source: true *** True Line Result - log_info = "App Id set to: #{id}" -** Processing line: ~ @app_id = id~ + vw(state.player_height), +** Processing line: ~ 'sprites/animations_povfrog/frog_bwah_up.png',~ - Inside source: true *** True Line Result - @app_id = id -** Processing line: ~ start~ + 'sprites/animations_povfrog/frog_bwah_up.png', +** Processing line: ~ (state.tongue_angle - 90)]~ - Inside source: true *** True Line Result - start + (state.tongue_angle - 90)] +** 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 check_for_device~ +** Processing line: ~~ - Inside source: true *** True Line Result - def check_for_device -** Processing line: ~ log_info "Looking for device."~ + +** Processing line: ~ $game = CleptoFrog.new~ - Inside source: true *** True Line Result - log_info "Looking for device." + $game = CleptoFrog.new ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if !cli_app_exist?(idevice_id_cli_app)~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - if !cli_app_exist?(idevice_id_cli_app) -** Processing line: ~ raise WizardException.new(~ + def tick args +** Processing line: ~ if args.state.scene == :game~ - Inside source: true *** True Line Result - raise WizardException.new( -** Processing line: ~ "* It doesn't look like you have the libimobiledevice iOS protocol library installed.",~ + if args.state.scene == :game +** Processing line: ~ tick_instructions args, "SPACE to SHOOT and RELEASE tongue. LEFT, RIGHT to SWING and BUILD momentum. MINIMAP in bottom right corner.", 360~ - Inside source: true *** True Line Result - "* It doesn't look like you have the libimobiledevice iOS protocol library installed.", -** Processing line: ~ "** 1. Open Terminal.",~ + tick_instructions args, "SPACE to SHOOT and RELEASE tongue. LEFT, RIGHT to SWING and BUILD momentum. MINIMAP in bottom right corner.", 360 +** Processing line: ~ end~ - Inside source: true *** True Line Result - "** 1. Open Terminal.", -** Processing line: ~ { w: 700, h: 99, path: get_reserved_sprite("terminal.png") },~ + end +** Processing line: ~ $game.args = args~ - Inside source: true *** True Line Result - { w: 700, h: 99, path: get_reserved_sprite("terminal.png") }, -** Processing line: ~ "** 2. Run: `brew install libimobiledevice`.",~ + $game.args = args +** Processing line: ~ $game.tick~ - Inside source: true *** True Line Result - "** 2. Run: `brew install libimobiledevice`.", -** Processing line: ~ { w: 500, h: 93, path: get_reserved_sprite("brew-install-libimobiledevice.png") },~ + $game.tick +** Processing line: ~ end~ - Inside source: true *** True Line Result - { w: 500, h: 93, path: get_reserved_sprite("brew-install-libimobiledevice.png") }, -** Processing line: ~ )~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - ) -** Processing line: ~ end~ + +** Processing line: ~ def tick_instructions args, text, y = 715~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def tick_instructions args, text, y = 715 +** Processing line: ~ return if args.state.key_event_occurred~ - Inside source: true *** True Line Result - -** Processing line: ~ if connected_devices.length == 0~ + return if args.state.key_event_occurred +** Processing line: ~ if args.inputs.keyboard.directional_vector || args.inputs.keyboard.key_down.space~ - Inside source: true *** True Line Result - if connected_devices.length == 0 -** Processing line: ~ raise WizardException.new("* I couldn't find any connected devices. Connect your iOS device to your Mac and try again.")~ + if args.inputs.keyboard.directional_vector || args.inputs.keyboard.key_down.space +** Processing line: ~ args.state.key_event_occurred = true~ - Inside source: true *** True Line Result - raise WizardException.new("* I couldn't find any connected devices. Connect your iOS device to your Mac and try again.") -** Processing line: ~ end~ + args.state.key_event_occurred = true +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @device_id = connected_devices.first~ +** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~ - Inside source: true *** True Line Result - @device_id = connected_devices.first -** Processing line: ~ log_info "I will be using device with UUID #{@device_id}"~ + 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 - log_info "I will be using device with UUID #{@device_id}" -** Processing line: ~ end~ + args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label +** Processing line: ~ args.outputs.debug << [640, y - 25, "(SPACE to dismiss instructions)" , -2, 1, 255, 255, 255].label~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.outputs.debug << [640, y - 25, "(SPACE to dismiss instructions)" , -2, 1, 255, 255, 255].label +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def check_for_certs~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def check_for_certs -** Processing line: ~ log_info "Attempting to find certificates on your computer."~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - log_info "Attempting to find certificates on your computer." +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ if !cli_app_exist?(security_cli_app)~ -- Inside source: true +** Processing line: ~*** Platformer - Clepto Frog - map.rb~ +- Header detected. *** True Line Result - if !cli_app_exist?(security_cli_app) -** Processing line: ~ raise WizardException.new(~ -- Inside source: true + *** True Line Result - raise WizardException.new( -** Processing line: ~ "* It doesn't look like you have #{security_cli_app}.",~ -- Inside source: true +*** Platformer - Clepto Frog - map.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result - "* It doesn't look like you have #{security_cli_app}.", -** Processing line: ~ "** 1. Open Disk Utility and run First Aid.",~ + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_platformer/clepto_frog/app/map.rb~ - Inside source: true *** True Line Result - "** 1. Open Disk Utility and run First Aid.", -** Processing line: ~ { w: 700, h: 148, path: get_reserved_sprite("disk-utility.png") },~ + # ./samples/99_genre_platformer/clepto_frog/app/map.rb +** Processing line: ~ $collisions = [~ - Inside source: true *** True Line Result - { w: 700, h: 148, path: get_reserved_sprite("disk-utility.png") }, -** Processing line: ~ )~ + $collisions = [ +** Processing line: ~ [326, 463, 64, 64],~ - Inside source: true *** True Line Result - ) -** Processing line: ~ end~ + [326, 463, 64, 64], +** Processing line: ~ [274, 462, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [274, 462, 64, 64], +** Processing line: ~ [326, 413, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if valid_certs.length == 0~ + [326, 413, 64, 64], +** Processing line: ~ [275, 412, 64, 64],~ - Inside source: true *** True Line Result - if valid_certs.length == 0 -** Processing line: ~ raise WizardException.new(~ + [275, 412, 64, 64], +** Processing line: ~ [124, 651, 64, 64],~ - Inside source: true *** True Line Result - raise WizardException.new( -** Processing line: ~ "* It doesn't look like you have any valid certs installed.",~ + [124, 651, 64, 64], +** Processing line: ~ [72, 651, 64, 64],~ - Inside source: true *** True Line Result - "* It doesn't look like you have any valid certs installed.", -** Processing line: ~ "** 1. Open Xcode.",~ + [72, 651, 64, 64], +** Processing line: ~ [124, 600, 64, 64],~ - Inside source: true *** True Line Result - "** 1. Open Xcode.", -** Processing line: ~ "** 2. Log into your developer account. Xcode -> Preferences -> Accounts.",~ + [124, 600, 64, 64], +** Processing line: ~ [69, 599, 64, 64],~ - Inside source: true *** True Line Result - "** 2. Log into your developer account. Xcode -> Preferences -> Accounts.", -** Processing line: ~ { w: 700, h: 98, path: get_reserved_sprite("login-xcode.png") },~ + [69, 599, 64, 64], +** Processing line: ~ [501, 997, 64, 64],~ - Inside source: true *** True Line Result - { w: 700, h: 98, path: get_reserved_sprite("login-xcode.png") }, -** Processing line: ~ "** 3. After loggin in, select Manage Certificates...",~ + [501, 997, 64, 64], +** Processing line: ~ [476, 995, 64, 64],~ - Inside source: true *** True Line Result - "** 3. After loggin in, select Manage Certificates...", -** Processing line: ~ { w: 700, h: 115, path: get_reserved_sprite("manage-certificates.png") },~ + [476, 995, 64, 64], +** Processing line: ~ [3224, 2057, 64, 64],~ - Inside source: true *** True Line Result - { w: 700, h: 115, path: get_reserved_sprite("manage-certificates.png") }, -** Processing line: ~ "** 4. Add a certificate for Apple Development.",~ + [3224, 2057, 64, 64], +** Processing line: ~ [3224, 1994, 64, 64],~ - Inside source: true *** True Line Result - "** 4. Add a certificate for Apple Development.", -** Processing line: ~ { w: 700, h: 217, path: get_reserved_sprite("add-cert.png") },~ + [3224, 1994, 64, 64], +** Processing line: ~ [3225, 1932, 64, 64],~ - Inside source: true *** True Line Result - { w: 700, h: 217, path: get_reserved_sprite("add-cert.png") }, -** Processing line: ~ )~ + [3225, 1932, 64, 64], +** Processing line: ~ [3225, 1870, 64, 64],~ - Inside source: true *** True Line Result - ) -** Processing line: ~ raise "You do not have any Apple development certs on this computer."~ + [3225, 1870, 64, 64], +** Processing line: ~ [3226, 1806, 64, 64],~ - Inside source: true *** True Line Result - raise "You do not have any Apple development certs on this computer." -** Processing line: ~ end~ + [3226, 1806, 64, 64], +** Processing line: ~ [3224, 1744, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3224, 1744, 64, 64], +** Processing line: ~ [3225, 1689, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ @certificate_name = valid_certs.first[:name]~ + [3225, 1689, 64, 64], +** Processing line: ~ [3226, 1660, 64, 64],~ - Inside source: true *** True Line Result - @certificate_name = valid_certs.first[:name] -** Processing line: ~ log_info "I will be using '#{@certificate_name}' to deploy to your device."~ + [3226, 1660, 64, 64], +** Processing line: ~ [3161, 1658, 64, 64],~ - Inside source: true *** True Line Result - log_info "I will be using '#{@certificate_name}' to deploy to your device." -** Processing line: ~ end~ + [3161, 1658, 64, 64], +** Processing line: ~ [3097, 1660, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3097, 1660, 64, 64], +** Processing line: ~ [3033, 1658, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def idevice_id_cli_app~ + [3033, 1658, 64, 64], +** Processing line: ~ [2969, 1658, 64, 64],~ - Inside source: true *** True Line Result - def idevice_id_cli_app -** Processing line: ~ "idevice_id"~ + [2969, 1658, 64, 64], +** Processing line: ~ [2904, 1658, 64, 64],~ - Inside source: true *** True Line Result - "idevice_id" -** Processing line: ~ end~ + [2904, 1658, 64, 64], +** Processing line: ~ [2839, 1657, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2839, 1657, 64, 64], +** Processing line: ~ [2773, 1657, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def security_cli_app~ + [2773, 1657, 64, 64], +** Processing line: ~ [2709, 1658, 64, 64],~ - Inside source: true *** True Line Result - def security_cli_app -** Processing line: ~ "/usr/bin/security"~ + [2709, 1658, 64, 64], +** Processing line: ~ [2643, 1657, 64, 64],~ - Inside source: true *** True Line Result - "/usr/bin/security" -** Processing line: ~ end~ + [2643, 1657, 64, 64], +** Processing line: ~ [2577, 1657, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2577, 1657, 64, 64], +** Processing line: ~ [2509, 1658, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def xcodebuild_cli_app~ + [2509, 1658, 64, 64], +** Processing line: ~ [2440, 1658, 64, 64],~ - Inside source: true *** True Line Result - def xcodebuild_cli_app -** Processing line: ~ "xcodebuild"~ + [2440, 1658, 64, 64], +** Processing line: ~ [2371, 1658, 64, 64],~ - Inside source: true *** True Line Result - "xcodebuild" -** Processing line: ~ end~ + [2371, 1658, 64, 64], +** Processing line: ~ [2301, 1659, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2301, 1659, 64, 64], +** Processing line: ~ [2230, 1659, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def valid_certs~ + [2230, 1659, 64, 64], +** Processing line: ~ [2159, 1659, 64, 64],~ - Inside source: true *** True Line Result - def valid_certs -** Processing line: ~ certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l|~ + [2159, 1659, 64, 64], +** Processing line: ~ [2092, 1660, 64, 64],~ - Inside source: true *** True Line Result - certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l| -** Processing line: ~ if l.include?(")") && !l.include?("Developer ID") && l.include?("Development")~ + [2092, 1660, 64, 64], +** Processing line: ~ [2025, 1661, 64, 64],~ - Inside source: true *** True Line Result - if l.include?(")") && !l.include?("Developer ID") && l.include?("Development") -** Processing line: ~ l.strip~ + [2025, 1661, 64, 64], +** Processing line: ~ [1958, 1660, 64, 64],~ - Inside source: true *** True Line Result - l.strip -** Processing line: ~ else~ + [1958, 1660, 64, 64], +** Processing line: ~ [1888, 1659, 64, 64],~ - Inside source: true *** True Line Result - else -** Processing line: ~ nil~ + [1888, 1659, 64, 64], +** Processing line: ~ [1817, 1657, 64, 64],~ - Inside source: true *** True Line Result - nil -** Processing line: ~ end~ + [1817, 1657, 64, 64], +** Processing line: ~ [1745, 1656, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end.reject_nil.map do |l|~ + [1745, 1656, 64, 64], +** Processing line: ~ [1673, 1658, 64, 64],~ - Inside source: true *** True Line Result - end.reject_nil.map do |l| -** Processing line: ~ number, id, name = l.split(' ', 3)~ + [1673, 1658, 64, 64], +** Processing line: ~ [1605, 1660, 64, 64],~ - Inside source: true *** True Line Result - number, id, name = l.split(' ', 3) -** Processing line: ~ name = name.gsub("\"", "") if name~ + [1605, 1660, 64, 64], +** Processing line: ~ [1536, 1658, 64, 64],~ - Inside source: true *** True Line Result - name = name.gsub("\"", "") if name -** Processing line: ~ {~ + [1536, 1658, 64, 64], +** Processing line: ~ [1465, 1660, 64, 64],~ - Inside source: true *** True Line Result - { -** Processing line: ~ number: 1,~ + [1465, 1660, 64, 64], +** Processing line: ~ [1386, 1960, 64, 64],~ - Inside source: true *** True Line Result - number: 1, -** Processing line: ~ id: id,~ + [1386, 1960, 64, 64], +** Processing line: ~ [1384, 1908, 64, 64],~ - Inside source: true *** True Line Result - id: id, -** Processing line: ~ name: name~ + [1384, 1908, 64, 64], +** Processing line: ~ [1387, 1862, 64, 64],~ - Inside source: true *** True Line Result - name: name -** Processing line: ~ }~ + [1387, 1862, 64, 64], +** Processing line: ~ [1326, 1863, 64, 64],~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [1326, 1863, 64, 64], +** Processing line: ~ [1302, 1862, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [1302, 1862, 64, 64], +** Processing line: ~ [1119, 1906, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [1119, 1906, 64, 64], +** Processing line: ~ [1057, 1905, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def connected_devices~ + [1057, 1905, 64, 64], +** Processing line: ~ [994, 1905, 64, 64],~ - Inside source: true *** True Line Result - def connected_devices -** Processing line: ~ sh("idevice_id -l").strip.each_line.map do |l|~ + [994, 1905, 64, 64], +** Processing line: ~ [937, 1904, 64, 64],~ - Inside source: true *** True Line Result - sh("idevice_id -l").strip.each_line.map do |l| -** Processing line: ~ l.strip~ + [937, 1904, 64, 64], +** Processing line: ~ [896, 1904, 64, 64],~ - Inside source: true *** True Line Result - l.strip -** Processing line: ~ end.reject { |l| l.length == 0 }~ + [896, 1904, 64, 64], +** Processing line: ~ [1001, 1845, 64, 64],~ - Inside source: true *** True Line Result - end.reject { |l| l.length == 0 } -** Processing line: ~ end~ + [1001, 1845, 64, 64], +** Processing line: ~ [1003, 1780, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [1003, 1780, 64, 64], +** Processing line: ~ [1003, 1718, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def cli_app_exist? app~ + [1003, 1718, 64, 64], +** Processing line: ~ [692, 1958, 64, 64],~ - Inside source: true *** True Line Result - def cli_app_exist? app -** Processing line: ~ `which #{app}`.strip.length != 0~ + [692, 1958, 64, 64], +** Processing line: ~ [691, 1900, 64, 64],~ - Inside source: true *** True Line Result - `which #{app}`.strip.length != 0 -** Processing line: ~ end~ + [691, 1900, 64, 64], +** Processing line: ~ [774, 1861, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [774, 1861, 64, 64], +** Processing line: ~ [712, 1861, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def write_entitlements_plist~ + [712, 1861, 64, 64], +** Processing line: ~ [691, 1863, 64, 64],~ - Inside source: true *** True Line Result - def write_entitlements_plist -** Processing line: ~ entitlement_plist_string = <<-XML~ + [691, 1863, 64, 64], +** Processing line: ~ [325, 2133, 64, 64],~ - Inside source: true *** True Line Result - entitlement_plist_string = <<-XML -** Processing line: ~ ~ + [325, 2133, 64, 64], +** Processing line: ~ [275, 2134, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [275, 2134, 64, 64], +** Processing line: ~ [326, 2082, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [326, 2082, 64, 64], +** Processing line: ~ [275, 2082, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [275, 2082, 64, 64], +** Processing line: ~ [124, 2321, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ application-identifier~ + [124, 2321, 64, 64], +** Processing line: ~ [71, 2320, 64, 64],~ - Inside source: true *** True Line Result - application-identifier -** Processing line: ~ :app_id~ + [71, 2320, 64, 64], +** Processing line: ~ [123, 2267, 64, 64],~ - Inside source: true *** True Line Result - :app_id -** Processing line: ~ get-task-allow~ + [123, 2267, 64, 64], +** Processing line: ~ [71, 2268, 64, 64],~ - Inside source: true *** True Line Result - get-task-allow -** Processing line: ~ ~ + [71, 2268, 64, 64], +** Processing line: ~ [2354, 1859, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [2354, 1859, 64, 64], +** Processing line: ~ [2292, 1859, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [2292, 1859, 64, 64], +** Processing line: ~ [2231, 1857, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ XML~ + [2231, 1857, 64, 64], +** Processing line: ~ [2198, 1858, 64, 64],~ - Inside source: true *** True Line Result - XML -** Processing line: ~~ + [2198, 1858, 64, 64], +** Processing line: ~ [2353, 1802, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ log_info "Creating Entitlements.plist"~ + [2353, 1802, 64, 64], +** Processing line: ~ [2296, 1798, 64, 64],~ - Inside source: true *** True Line Result - log_info "Creating Entitlements.plist" -** Processing line: ~~ + [2296, 1798, 64, 64], +** Processing line: ~ [2233, 1797, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", @app_id).strip~ + [2233, 1797, 64, 64], +** Processing line: ~ [2200, 1797, 64, 64],~ - Inside source: true *** True Line Result - $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", @app_id).strip -** Processing line: ~~ + [2200, 1797, 64, 64], +** Processing line: ~ [2352, 1742, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ sh "/usr/bin/plutil -convert binary1 \"#{tmp_directory}/Entitlements.plist\""~ + [2352, 1742, 64, 64], +** Processing line: ~ [2288, 1741, 64, 64],~ - Inside source: true *** True Line Result - sh "/usr/bin/plutil -convert binary1 \"#{tmp_directory}/Entitlements.plist\"" -** Processing line: ~ sh "/usr/bin/plutil -convert xml1 \"#{tmp_directory}/Entitlements.plist\""~ + [2288, 1741, 64, 64], +** Processing line: ~ [2230, 1743, 64, 64],~ - Inside source: true *** True Line Result - sh "/usr/bin/plutil -convert xml1 \"#{tmp_directory}/Entitlements.plist\"" -** Processing line: ~~ + [2230, 1743, 64, 64], +** Processing line: ~ [2196, 1743, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ @entitlement_plist_written = true~ + [2196, 1743, 64, 64], +** Processing line: ~ [1736, 460, 64, 64],~ - Inside source: true *** True Line Result - @entitlement_plist_written = true -** Processing line: ~ end~ + [1736, 460, 64, 64], +** Processing line: ~ [1735, 400, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [1735, 400, 64, 64], +** Processing line: ~ [1736, 339, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def code_sign~ + [1736, 339, 64, 64], +** Processing line: ~ [1736, 275, 64, 64],~ - Inside source: true *** True Line Result - def code_sign -** Processing line: ~ sh "cp #{@dev_profile_path} \"#{app_path}/embedded.mobileprovision\""~ + [1736, 275, 64, 64], +** Processing line: ~ [1738, 210, 64, 64],~ - Inside source: true *** True Line Result - sh "cp #{@dev_profile_path} \"#{app_path}/embedded.mobileprovision\"" -** Processing line: ~~ + [1738, 210, 64, 64], +** Processing line: ~ [1735, 145, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ log_info "Signing app with #{@certificate_name}."~ + [1735, 145, 64, 64], +** Processing line: ~ [1735, 87, 64, 64],~ - Inside source: true *** True Line Result - log_info "Signing app with #{@certificate_name}." -** Processing line: ~~ + [1735, 87, 64, 64], +** Processing line: ~ [1736, 51, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ sh "/usr/bin/plutil -convert binary1 \"#{app_path}/Info.plist\""~ + [1736, 51, 64, 64], +** Processing line: ~ [539, 289, 64, 64],~ - Inside source: true *** True Line Result - sh "/usr/bin/plutil -convert binary1 \"#{app_path}/Info.plist\"" -** Processing line: ~~ + [539, 289, 64, 64], +** Processing line: ~ [541, 228, 64, 64],~ - Inside source: true *** True Line Result - -** 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\""~ + [541, 228, 64, 64], +** Processing line: ~ [626, 191, 64, 64],~ - Inside source: true *** True Line Result - 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\"" -** Processing line: ~~ + [626, 191, 64, 64], +** Processing line: ~ [572, 192, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ @code_sign_completed = true~ + [572, 192, 64, 64], +** Processing line: ~ [540, 193, 64, 64],~ - Inside source: true *** True Line Result - @code_sign_completed = true -** Processing line: ~ end~ + [540, 193, 64, 64], +** Processing line: ~ [965, 233, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [965, 233, 64, 64], +** Processing line: ~ [904, 234, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def write_info_plist~ + [904, 234, 64, 64], +** Processing line: ~ [840, 234, 64, 64],~ - Inside source: true *** True Line Result - def write_info_plist -** Processing line: ~ log_info "Adding Info.plist."~ + [840, 234, 64, 64], +** Processing line: ~ [779, 234, 64, 64],~ - Inside source: true *** True Line Result - log_info "Adding Info.plist." -** Processing line: ~~ + [779, 234, 64, 64], +** Processing line: ~ [745, 236, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ info_plist_string = <<-XML~ + [745, 236, 64, 64], +** Processing line: ~ [851, 169, 64, 64],~ - Inside source: true *** True Line Result - info_plist_string = <<-XML -** Processing line: ~ ~ + [851, 169, 64, 64], +** Processing line: ~ [849, 108, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [849, 108, 64, 64], +** Processing line: ~ [852, 50, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [852, 50, 64, 64], +** Processing line: ~ [1237, 289, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [1237, 289, 64, 64], +** Processing line: ~ [1236, 228, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ NSAppTransportSecurity~ + [1236, 228, 64, 64], +** Processing line: ~ [1238, 197, 64, 64],~ - Inside source: true *** True Line Result - NSAppTransportSecurity -** Processing line: ~ ~ + [1238, 197, 64, 64], +** Processing line: ~ [1181, 192, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ NSAllowsArbitraryLoads~ + [1181, 192, 64, 64], +** Processing line: ~ [1152, 192, 64, 64],~ - Inside source: true *** True Line Result - NSAllowsArbitraryLoads -** Processing line: ~ ~ + [1152, 192, 64, 64], +** Processing line: ~ [1443, 605, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ NSExceptionDomains~ + [1443, 605, 64, 64], +** Processing line: ~ [1419, 606, 64, 64],~ - Inside source: true *** True Line Result - NSExceptionDomains -** Processing line: ~ ~ + [1419, 606, 64, 64], +** Processing line: ~ [1069, 925, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ google.com~ + [1069, 925, 64, 64], +** Processing line: ~ [1068, 902, 64, 64],~ - Inside source: true *** True Line Result - google.com -** Processing line: ~ ~ + [1068, 902, 64, 64], +** Processing line: ~ [1024, 927, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ NSExceptionAllowsInsecureHTTPLoads~ + [1024, 927, 64, 64], +** Processing line: ~ [1017, 897, 64, 64],~ - Inside source: true *** True Line Result - NSExceptionAllowsInsecureHTTPLoads -** Processing line: ~ ~ + [1017, 897, 64, 64], +** Processing line: ~ [963, 926, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ NSIncludesSubdomains~ + [963, 926, 64, 64], +** Processing line: ~ [958, 898, 64, 64],~ - Inside source: true *** True Line Result - NSIncludesSubdomains -** Processing line: ~ ~ + [958, 898, 64, 64], +** Processing line: ~ [911, 928, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [911, 928, 64, 64], +** Processing line: ~ [911, 896, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [911, 896, 64, 64], +** Processing line: ~ [2132, 803, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [2132, 803, 64, 64], +** Processing line: ~ [2081, 803, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ BuildMachineOSBuild~ + [2081, 803, 64, 64], +** Processing line: ~ [2131, 752, 64, 64],~ - Inside source: true *** True Line Result - BuildMachineOSBuild -** Processing line: ~ 19C57~ + [2131, 752, 64, 64], +** Processing line: ~ [2077, 751, 64, 64],~ - Inside source: true *** True Line Result - 19C57 -** Processing line: ~ CFBundleDevelopmentRegion~ + [2077, 751, 64, 64], +** Processing line: ~ [2615, 649, 64, 64],~ - Inside source: true *** True Line Result - CFBundleDevelopmentRegion -** Processing line: ~ en~ + [2615, 649, 64, 64], +** Processing line: ~ [2564, 651, 64, 64],~ - Inside source: true *** True Line Result - en -** Processing line: ~ CFBundleDisplayName~ + [2564, 651, 64, 64], +** Processing line: ~ [2533, 650, 64, 64],~ - Inside source: true *** True Line Result - CFBundleDisplayName -** Processing line: ~ :app_name~ + [2533, 650, 64, 64], +** Processing line: ~ [2027, 156, 64, 64],~ - Inside source: true *** True Line Result - :app_name -** Processing line: ~ CFBundleExecutable~ + [2027, 156, 64, 64], +** Processing line: ~ [1968, 155, 64, 64],~ - Inside source: true *** True Line Result - CFBundleExecutable -** Processing line: ~ Runtime~ + [1968, 155, 64, 64], +** Processing line: ~ [1907, 153, 64, 64],~ - Inside source: true *** True Line Result - Runtime -** Processing line: ~ CFBundleIconFiles~ + [1907, 153, 64, 64], +** Processing line: ~ [1873, 155, 64, 64],~ - Inside source: true *** True Line Result - CFBundleIconFiles -** Processing line: ~ ~ + [1873, 155, 64, 64], +** Processing line: ~ [2025, 95, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ AppIcon60x60~ + [2025, 95, 64, 64], +** Processing line: ~ [1953, 98, 64, 64],~ - Inside source: true *** True Line Result - AppIcon60x60 -** Processing line: ~ ~ + [1953, 98, 64, 64], +** Processing line: ~ [1894, 100, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ CFBundleIcons~ + [1894, 100, 64, 64], +** Processing line: ~ [1870, 100, 64, 64],~ - Inside source: true *** True Line Result - CFBundleIcons -** Processing line: ~ ~ + [1870, 100, 64, 64], +** Processing line: ~ [2029, 45, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ CFBundlePrimaryIcon~ + [2029, 45, 64, 64], +** Processing line: ~ [1971, 48, 64, 64],~ - Inside source: true *** True Line Result - CFBundlePrimaryIcon -** Processing line: ~ ~ + [1971, 48, 64, 64], +** Processing line: ~ [1915, 47, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ CFBundleIconFiles~ + [1915, 47, 64, 64], +** Processing line: ~ [1873, 47, 64, 64],~ - Inside source: true *** True Line Result - CFBundleIconFiles -** Processing line: ~ ~ + [1873, 47, 64, 64], +** Processing line: ~ [3956, 288, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ AppIcon60x60~ + [3956, 288, 64, 64], +** Processing line: ~ [3954, 234, 64, 64],~ - Inside source: true *** True Line Result - AppIcon60x60 -** Processing line: ~ ~ + [3954, 234, 64, 64], +** Processing line: ~ [4042, 190, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ CFBundleIconName~ + [4042, 190, 64, 64], +** Processing line: ~ [3990, 190, 64, 64],~ - Inside source: true *** True Line Result - CFBundleIconName -** Processing line: ~ AppIcon~ + [3990, 190, 64, 64], +** Processing line: ~ [3958, 195, 64, 64],~ - Inside source: true *** True Line Result - AppIcon -** Processing line: ~ ~ + [3958, 195, 64, 64], +** Processing line: ~ [3422, 709, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [3422, 709, 64, 64], +** Processing line: ~ [3425, 686, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ CFBundleIcons~ipad~ + [3425, 686, 64, 64], +** Processing line: ~ [3368, 709, 64, 64],~ - Inside source: true *** True Line Result - CFBundleIcons~ipad -** Processing line: ~ ~ + [3368, 709, 64, 64], +** Processing line: ~ [3364, 683, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ CFBundlePrimaryIcon~ + [3364, 683, 64, 64], +** Processing line: ~ [3312, 711, 64, 64],~ - Inside source: true *** True Line Result - CFBundlePrimaryIcon -** Processing line: ~ ~ + [3312, 711, 64, 64], +** Processing line: ~ [3307, 684, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ CFBundleIconFiles~ + [3307, 684, 64, 64], +** Processing line: ~ [3266, 712, 64, 64],~ - Inside source: true *** True Line Result - CFBundleIconFiles -** Processing line: ~ ~ + [3266, 712, 64, 64], +** Processing line: ~ [3269, 681, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ AppIcon60x60~ + [3269, 681, 64, 64], +** Processing line: ~ [4384, 236, 64, 64],~ - Inside source: true *** True Line Result - AppIcon60x60 -** Processing line: ~ AppIcon76x76~ + [4384, 236, 64, 64], +** Processing line: ~ [4320, 234, 64, 64],~ - Inside source: true *** True Line Result - AppIcon76x76 -** Processing line: ~ ~ + [4320, 234, 64, 64], +** Processing line: ~ [4257, 235, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ CFBundleIconName~ + [4257, 235, 64, 64], +** Processing line: ~ [4192, 234, 64, 64],~ - Inside source: true *** True Line Result - CFBundleIconName -** Processing line: ~ AppIcon~ + [4192, 234, 64, 64], +** Processing line: ~ [4162, 234, 64, 64],~ - Inside source: true *** True Line Result - AppIcon -** Processing line: ~ ~ + [4162, 234, 64, 64], +** Processing line: ~ [4269, 171, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [4269, 171, 64, 64], +** Processing line: ~ [4267, 111, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ CFBundleIdentifier~ + [4267, 111, 64, 64], +** Processing line: ~ [4266, 52, 64, 64],~ - Inside source: true *** True Line Result - CFBundleIdentifier -** Processing line: ~ com.carlile.swisscheese~ + [4266, 52, 64, 64], +** Processing line: ~ [4580, 458, 64, 64],~ - Inside source: true *** True Line Result - com.carlile.swisscheese -** Processing line: ~ CFBundleInfoDictionaryVersion~ + [4580, 458, 64, 64], +** Processing line: ~ [4582, 396, 64, 64],~ - Inside source: true *** True Line Result - CFBundleInfoDictionaryVersion -** Processing line: ~ 6.0~ + [4582, 396, 64, 64], +** Processing line: ~ [4582, 335, 64, 64],~ - Inside source: true *** True Line Result - 6.0 -** Processing line: ~ CFBundleName~ + [4582, 335, 64, 64], +** Processing line: ~ [4581, 275, 64, 64],~ - Inside source: true *** True Line Result - CFBundleName -** Processing line: ~ :app_name~ + [4581, 275, 64, 64], +** Processing line: ~ [4581, 215, 64, 64],~ - Inside source: true *** True Line Result - :app_name -** Processing line: ~ CFBundlePackageType~ + [4581, 215, 64, 64], +** Processing line: ~ [4581, 152, 64, 64],~ - Inside source: true *** True Line Result - CFBundlePackageType -** Processing line: ~ APPL~ + [4581, 152, 64, 64], +** Processing line: ~ [4582, 89, 64, 64],~ - Inside source: true *** True Line Result - APPL -** Processing line: ~ CFBundleShortVersionString~ + [4582, 89, 64, 64], +** Processing line: ~ [4583, 51, 64, 64],~ - Inside source: true *** True Line Result - CFBundleShortVersionString -** Processing line: ~ 1.0~ + [4583, 51, 64, 64], +** Processing line: ~ [4810, 289, 64, 64],~ - Inside source: true *** True Line Result - 1.0 -** Processing line: ~ CFBundleSignature~ + [4810, 289, 64, 64], +** Processing line: ~ [4810, 227, 64, 64],~ - Inside source: true *** True Line Result - CFBundleSignature -** Processing line: ~ ????~ + [4810, 227, 64, 64], +** Processing line: ~ [4895, 189, 64, 64],~ - Inside source: true *** True Line Result - ???? -** Processing line: ~ CFBundleSupportedPlatforms~ + [4895, 189, 64, 64], +** Processing line: ~ [4844, 191, 64, 64],~ - Inside source: true *** True Line Result - CFBundleSupportedPlatforms -** Processing line: ~ ~ + [4844, 191, 64, 64], +** Processing line: ~ [4809, 191, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ iPhoneOS~ + [4809, 191, 64, 64], +** Processing line: ~ [5235, 233, 64, 64],~ - Inside source: true *** True Line Result - iPhoneOS -** Processing line: ~ ~ + [5235, 233, 64, 64], +** Processing line: ~ [5176, 232, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ CFBundleVersion~ + [5176, 232, 64, 64], +** Processing line: ~ [5118, 230, 64, 64],~ - Inside source: true *** True Line Result - CFBundleVersion -** Processing line: ~ 1.0~ + [5118, 230, 64, 64], +** Processing line: ~ [5060, 232, 64, 64],~ - Inside source: true *** True Line Result - 1.0 -** Processing line: ~ DTCompiler~ + [5060, 232, 64, 64], +** Processing line: ~ [5015, 237, 64, 64],~ - Inside source: true *** True Line Result - DTCompiler -** Processing line: ~ com.apple.compilers.llvm.clang.1_0~ + [5015, 237, 64, 64], +** Processing line: ~ [5123, 171, 64, 64],~ - Inside source: true *** True Line Result - com.apple.compilers.llvm.clang.1_0 -** Processing line: ~ DTPlatformBuild~ + [5123, 171, 64, 64], +** Processing line: ~ [5123, 114, 64, 64],~ - Inside source: true *** True Line Result - DTPlatformBuild -** Processing line: ~ 17B102~ + [5123, 114, 64, 64], +** Processing line: ~ [5121, 51, 64, 64],~ - Inside source: true *** True Line Result - 17B102 -** Processing line: ~ DTPlatformName~ + [5121, 51, 64, 64], +** Processing line: ~ [5523, 461, 64, 64],~ - Inside source: true *** True Line Result - DTPlatformName -** Processing line: ~ iphoneos~ + [5523, 461, 64, 64], +** Processing line: ~ [5123, 42, 64, 64],~ - Inside source: true *** True Line Result - iphoneos -** Processing line: ~ DTPlatformVersion~ + [5123, 42, 64, 64], +** Processing line: ~ [5525, 401, 64, 64],~ - Inside source: true *** True Line Result - DTPlatformVersion -** Processing line: ~ 13.2~ + [5525, 401, 64, 64], +** Processing line: ~ [5525, 340, 64, 64],~ - Inside source: true *** True Line Result - 13.2 -** Processing line: ~ DTSDKBuild~ + [5525, 340, 64, 64], +** Processing line: ~ [5526, 273, 64, 64],~ - Inside source: true *** True Line Result - DTSDKBuild -** Processing line: ~ 17B102~ + [5526, 273, 64, 64], +** Processing line: ~ [5527, 211, 64, 64],~ - Inside source: true *** True Line Result - 17B102 -** Processing line: ~ DTSDKName~ + [5527, 211, 64, 64], +** Processing line: ~ [5525, 150, 64, 64],~ - Inside source: true *** True Line Result - DTSDKName -** Processing line: ~ iphoneos13.2~ + [5525, 150, 64, 64], +** Processing line: ~ [5527, 84, 64, 64],~ - Inside source: true *** True Line Result - iphoneos13.2 -** Processing line: ~ DTXcode~ + [5527, 84, 64, 64], +** Processing line: ~ [5524, 44, 64, 64],~ - Inside source: true *** True Line Result - DTXcode -** Processing line: ~ 01131~ + [5524, 44, 64, 64], +** Processing line: ~ [5861, 288, 64, 64],~ - Inside source: true *** True Line Result - 01131 -** Processing line: ~ DTXcodeBuild~ + [5861, 288, 64, 64], +** Processing line: ~ [5861, 229, 64, 64],~ - Inside source: true *** True Line Result - DTXcodeBuild -** Processing line: ~ 11C505~ + [5861, 229, 64, 64], +** Processing line: ~ [5945, 193, 64, 64],~ - Inside source: true *** True Line Result - 11C505 -** Processing line: ~ ITSAppUsesNonExemptEncryption~ + [5945, 193, 64, 64], +** Processing line: ~ [5904, 193, 64, 64],~ - Inside source: true *** True Line Result - ITSAppUsesNonExemptEncryption -** Processing line: ~ ~ + [5904, 193, 64, 64], +** Processing line: ~ [5856, 194, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ MinimumOSVersion~ + [5856, 194, 64, 64], +** Processing line: ~ [6542, 234, 64, 64],~ - Inside source: true *** True Line Result - MinimumOSVersion -** Processing line: ~ 11.0~ + [6542, 234, 64, 64], +** Processing line: ~ [6478, 235, 64, 64],~ - Inside source: true *** True Line Result - 11.0 -** Processing line: ~ UIAppFonts~ + [6478, 235, 64, 64], +** Processing line: ~ [6413, 238, 64, 64],~ - Inside source: true *** True Line Result - UIAppFonts -** Processing line: ~ ~ + [6413, 238, 64, 64], +** Processing line: ~ [6348, 235, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UIBackgroundModes~ + [6348, 235, 64, 64], +** Processing line: ~ [6285, 236, 64, 64],~ - Inside source: true *** True Line Result - UIBackgroundModes -** Processing line: ~ ~ + [6285, 236, 64, 64], +** Processing line: ~ [6222, 235, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UIDeviceFamily~ + [6222, 235, 64, 64], +** Processing line: ~ [6160, 235, 64, 64],~ - Inside source: true *** True Line Result - UIDeviceFamily -** Processing line: ~ ~ + [6160, 235, 64, 64], +** Processing line: ~ [6097, 236, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ 1~ + [6097, 236, 64, 64], +** Processing line: ~ [6069, 237, 64, 64],~ - Inside source: true *** True Line Result - 1 -** Processing line: ~ 2~ + [6069, 237, 64, 64], +** Processing line: ~ [6321, 174, 64, 64],~ - Inside source: true *** True Line Result - 2 -** Processing line: ~ ~ + [6321, 174, 64, 64], +** Processing line: ~ [6318, 111, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UILaunchImages~ + [6318, 111, 64, 64], +** Processing line: ~ [6320, 49, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImages -** Processing line: ~ ~ + [6320, 49, 64, 64], +** Processing line: ~ [6753, 291, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [6753, 291, 64, 64], +** Processing line: ~ [6752, 227, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UILaunchImageMinimumOSVersion~ + [6752, 227, 64, 64], +** Processing line: ~ [6753, 192, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageMinimumOSVersion -** Processing line: ~ 11.0~ + [6753, 192, 64, 64], +** Processing line: ~ [6692, 191, 64, 64],~ - Inside source: true *** True Line Result - 11.0 -** Processing line: ~ UILaunchImageName~ + [6692, 191, 64, 64], +** Processing line: ~ [6668, 193, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageName -** Processing line: ~ LaunchImage-1100-Portrait-2436h~ + [6668, 193, 64, 64], +** Processing line: ~ [6336, 604, 64, 64],~ - Inside source: true *** True Line Result - LaunchImage-1100-Portrait-2436h -** Processing line: ~ UILaunchImageOrientation~ + [6336, 604, 64, 64], +** Processing line: ~ [6309, 603, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageOrientation -** Processing line: ~ Portrait~ + [6309, 603, 64, 64], +** Processing line: ~ [7264, 461, 64, 64],~ - Inside source: true *** True Line Result - Portrait -** Processing line: ~ UILaunchImageSize~ + [7264, 461, 64, 64], +** Processing line: ~ [7264, 395, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageSize -** Processing line: ~ {375, 812}~ + [7264, 395, 64, 64], +** Processing line: ~ [7264, 333, 64, 64],~ - Inside source: true *** True Line Result - {375, 812} -** Processing line: ~ ~ + [7264, 333, 64, 64], +** Processing line: ~ [7264, 270, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [7264, 270, 64, 64], +** Processing line: ~ [7265, 207, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UILaunchImageMinimumOSVersion~ + [7265, 207, 64, 64], +** Processing line: ~ [7266, 138, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageMinimumOSVersion -** Processing line: ~ 8.0~ + [7266, 138, 64, 64], +** Processing line: ~ [7264, 78, 64, 64],~ - Inside source: true *** True Line Result - 8.0 -** Processing line: ~ UILaunchImageName~ + [7264, 78, 64, 64], +** Processing line: ~ [7266, 48, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageName -** Processing line: ~ LaunchImage-800-Portrait-736h~ + [7266, 48, 64, 64], +** Processing line: ~ [7582, 149, 64, 64],~ - Inside source: true *** True Line Result - LaunchImage-800-Portrait-736h -** Processing line: ~ UILaunchImageOrientation~ + [7582, 149, 64, 64], +** Processing line: ~ [7524, 147, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageOrientation -** Processing line: ~ Portrait~ + [7524, 147, 64, 64], +** Processing line: ~ [7461, 146, 64, 64],~ - Inside source: true *** True Line Result - Portrait -** Processing line: ~ UILaunchImageSize~ + [7461, 146, 64, 64], +** Processing line: ~ [7425, 148, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageSize -** Processing line: ~ {414, 736}~ + [7425, 148, 64, 64], +** Processing line: ~ [7580, 86, 64, 64],~ - Inside source: true *** True Line Result - {414, 736} -** Processing line: ~ ~ + [7580, 86, 64, 64], +** Processing line: ~ [7582, 41, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [7582, 41, 64, 64], +** Processing line: ~ [7519, 41, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UILaunchImageMinimumOSVersion~ + [7519, 41, 64, 64], +** Processing line: ~ [7460, 40, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageMinimumOSVersion -** Processing line: ~ 8.0~ + [7460, 40, 64, 64], +** Processing line: ~ [7427, 96, 64, 64],~ - Inside source: true *** True Line Result - 8.0 -** Processing line: ~ UILaunchImageName~ + [7427, 96, 64, 64], +** Processing line: ~ [7427, 41, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageName -** Processing line: ~ LaunchImage-800-667h~ + [7427, 41, 64, 64], +** Processing line: ~ [8060, 288, 64, 64],~ - Inside source: true *** True Line Result - LaunchImage-800-667h -** Processing line: ~ UILaunchImageOrientation~ + [8060, 288, 64, 64], +** Processing line: ~ [8059, 226, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageOrientation -** Processing line: ~ Portrait~ + [8059, 226, 64, 64], +** Processing line: ~ [8145, 194, 64, 64],~ - Inside source: true *** True Line Result - Portrait -** Processing line: ~ UILaunchImageSize~ + [8145, 194, 64, 64], +** Processing line: ~ [8081, 194, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageSize -** Processing line: ~ {375, 667}~ + [8081, 194, 64, 64], +** Processing line: ~ [8058, 195, 64, 64],~ - Inside source: true *** True Line Result - {375, 667} -** Processing line: ~ ~ + [8058, 195, 64, 64], +** Processing line: ~ [8485, 234, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [8485, 234, 64, 64], +** Processing line: ~ [8422, 235, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UILaunchImageMinimumOSVersion~ + [8422, 235, 64, 64], +** Processing line: ~ [8360, 235, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageMinimumOSVersion -** Processing line: ~ 7.0~ + [8360, 235, 64, 64], +** Processing line: ~ [8296, 235, 64, 64],~ - Inside source: true *** True Line Result - 7.0 -** Processing line: ~ UILaunchImageName~ + [8296, 235, 64, 64], +** Processing line: ~ [8266, 237, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageName -** Processing line: ~ LaunchImage-700~ + [8266, 237, 64, 64], +** Processing line: ~ [8371, 173, 64, 64],~ - Inside source: true *** True Line Result - LaunchImage-700 -** Processing line: ~ UILaunchImageOrientation~ + [8371, 173, 64, 64], +** Processing line: ~ [8370, 117, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageOrientation -** Processing line: ~ Portrait~ + [8370, 117, 64, 64], +** Processing line: ~ [8372, 59, 64, 64],~ - Inside source: true *** True Line Result - Portrait -** Processing line: ~ UILaunchImageSize~ + [8372, 59, 64, 64], +** Processing line: ~ [8372, 51, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageSize -** Processing line: ~ {320, 480}~ + [8372, 51, 64, 64], +** Processing line: ~ [9147, 192, 64, 64],~ - Inside source: true *** True Line Result - {320, 480} -** Processing line: ~ ~ + [9147, 192, 64, 64], +** Processing line: ~ [9063, 287, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [9063, 287, 64, 64], +** Processing line: ~ [9064, 225, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UILaunchImageMinimumOSVersion~ + [9064, 225, 64, 64], +** Processing line: ~ [9085, 193, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageMinimumOSVersion -** Processing line: ~ 7.0~ + [9085, 193, 64, 64], +** Processing line: ~ [9063, 194, 64, 64],~ - Inside source: true *** True Line Result - 7.0 -** Processing line: ~ UILaunchImageName~ + [9063, 194, 64, 64], +** Processing line: ~ [9492, 234, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageName -** Processing line: ~ LaunchImage-700-568h~ + [9492, 234, 64, 64], +** Processing line: ~ [9428, 234, 64, 64],~ - Inside source: true *** True Line Result - LaunchImage-700-568h -** Processing line: ~ UILaunchImageOrientation~ + [9428, 234, 64, 64], +** Processing line: ~ [9365, 235, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageOrientation -** Processing line: ~ Portrait~ + [9365, 235, 64, 64], +** Processing line: ~ [9302, 235, 64, 64],~ - Inside source: true *** True Line Result - Portrait -** Processing line: ~ UILaunchImageSize~ + [9302, 235, 64, 64], +** Processing line: ~ [9270, 237, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageSize -** Processing line: ~ {320, 568}~ + [9270, 237, 64, 64], +** Processing line: ~ [9374, 172, 64, 64],~ - Inside source: true *** True Line Result - {320, 568} -** Processing line: ~ ~ + [9374, 172, 64, 64], +** Processing line: ~ [9376, 109, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [9376, 109, 64, 64], +** Processing line: ~ [9377, 48, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UILaunchImageMinimumOSVersion~ + [9377, 48, 64, 64], +** Processing line: ~ [9545, 1060, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageMinimumOSVersion -** Processing line: ~ 7.0~ + [9545, 1060, 64, 64], +** Processing line: ~ [9482, 1062, 64, 64],~ - Inside source: true *** True Line Result - 7.0 -** Processing line: ~ UILaunchImageName~ + [9482, 1062, 64, 64], +** Processing line: ~ [9423, 1062, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageName -** Processing line: ~ LaunchImage-700-Portrait~ + [9423, 1062, 64, 64], +** Processing line: ~ [9387, 1062, 64, 64],~ - Inside source: true *** True Line Result - LaunchImage-700-Portrait -** Processing line: ~ UILaunchImageOrientation~ + [9387, 1062, 64, 64], +** Processing line: ~ [9541, 999, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageOrientation -** Processing line: ~ Portrait~ + [9541, 999, 64, 64], +** Processing line: ~ [9542, 953, 64, 64],~ - Inside source: true *** True Line Result - Portrait -** Processing line: ~ UILaunchImageSize~ + [9542, 953, 64, 64], +** Processing line: ~ [9478, 953, 64, 64],~ - Inside source: true *** True Line Result - UILaunchImageSize -** Processing line: ~ {768, 1024}~ + [9478, 953, 64, 64], +** Processing line: ~ [9388, 999, 64, 64],~ - Inside source: true *** True Line Result - {768, 1024} -** Processing line: ~ ~ + [9388, 999, 64, 64], +** Processing line: ~ [9414, 953, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [9414, 953, 64, 64], +** Processing line: ~ [9389, 953, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UIRequiredDeviceCapabilities~ + [9389, 953, 64, 64], +** Processing line: ~ [9294, 1194, 64, 64],~ - Inside source: true *** True Line Result - UIRequiredDeviceCapabilities -** Processing line: ~ ~ + [9294, 1194, 64, 64], +** Processing line: ~ [9245, 1195, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ arm64~ + [9245, 1195, 64, 64], +** Processing line: ~ [9297, 1143, 64, 64],~ - Inside source: true *** True Line Result - arm64 -** Processing line: ~ ~ + [9297, 1143, 64, 64], +** Processing line: ~ [9245, 1144, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UIRequiresFullScreen~ + [9245, 1144, 64, 64], +** Processing line: ~ [5575, 1781, 64, 64],~ - Inside source: true *** True Line Result - UIRequiresFullScreen -** Processing line: ~ ~ + [5575, 1781, 64, 64], +** Processing line: ~ [5574, 1753, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ UIStatusBarStyle~ + [5574, 1753, 64, 64], +** Processing line: ~ [5522, 1782, 64, 64],~ - Inside source: true *** True Line Result - UIStatusBarStyle -** Processing line: ~ UIStatusBarStyleDefault~ + [5522, 1782, 64, 64], +** Processing line: ~ [5518, 1753, 64, 64],~ - Inside source: true *** True Line Result - UIStatusBarStyleDefault -** Processing line: ~ UISupportedInterfaceOrientations~ + [5518, 1753, 64, 64], +** Processing line: ~ [5472, 1783, 64, 64],~ - Inside source: true *** True Line Result - UISupportedInterfaceOrientations -** Processing line: ~ ~ + [5472, 1783, 64, 64], +** Processing line: ~ [5471, 1751, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ #{device_orientation_xml}~ + [5471, 1751, 64, 64], +** Processing line: ~ [5419, 1781, 64, 64],~ - Inside source: true *** True Line Result - #{device_orientation_xml} -** Processing line: ~ ~ + [5419, 1781, 64, 64], +** Processing line: ~ [5421, 1749, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [5421, 1749, 64, 64], +** Processing line: ~ [500, 3207, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ ~ + [500, 3207, 64, 64], +** Processing line: ~ [477, 3205, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ XML~ + [477, 3205, 64, 64], +** Processing line: ~ [1282, 3214, 64, 64],~ - Inside source: true *** True Line Result - XML -** Processing line: ~~ + [1282, 3214, 64, 64], +** Processing line: ~ [1221, 3214, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ # UIInterfaceOrientationPortrait~ + [1221, 3214, 64, 64], +** Processing line: ~ [1188, 3215, 64, 64],~ - Inside source: true *** True Line Result - # UIInterfaceOrientationPortrait -** Processing line: ~ # UIInterfaceOrientationLandscapeRight~ + [1188, 3215, 64, 64], +** Processing line: ~ [1345, 3103, 64, 64],~ - Inside source: true *** True Line Result - # UIInterfaceOrientationLandscapeRight -** Processing line: ~~ + [1345, 3103, 64, 64], +** Processing line: ~ [1288, 3103, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.gsub(":app_name", @app_name).strip~ + [1288, 3103, 64, 64], +** Processing line: ~ [1231, 3104, 64, 64],~ - Inside source: true *** True Line Result - $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.gsub(":app_name", @app_name).strip -** Processing line: ~~ + [1231, 3104, 64, 64], +** Processing line: ~ [1190, 3153, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ @info_plist_written = true~ + [1190, 3153, 64, 64], +** Processing line: ~ [1189, 3105, 64, 64],~ - Inside source: true *** True Line Result - @info_plist_written = true -** Processing line: ~ end~ + [1189, 3105, 64, 64], +** Processing line: ~ [2255, 3508, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2255, 3508, 64, 64], +** Processing line: ~ [2206, 3510, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def device_orientation_xml~ + [2206, 3510, 64, 64], +** Processing line: ~ [2254, 3458, 64, 64],~ - Inside source: true *** True Line Result - def device_orientation_xml -** Processing line: ~ return "UIInterfaceOrientationLandscapeRight" if $gtk.logical_width > $gtk.logical_height~ + [2254, 3458, 64, 64], +** Processing line: ~ [2202, 3458, 64, 64],~ - Inside source: true *** True Line Result - return "UIInterfaceOrientationLandscapeRight" if $gtk.logical_width > $gtk.logical_height -** Processing line: ~ return "UIInterfaceOrientationPortrait"~ + [2202, 3458, 64, 64], +** Processing line: ~ [2754, 2930, 64, 64],~ - Inside source: true *** True Line Result - return "UIInterfaceOrientationPortrait" -** Processing line: ~ end~ + [2754, 2930, 64, 64], +** Processing line: ~ [2726, 2932, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2726, 2932, 64, 64], +** Processing line: ~ [3408, 2874, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def tmp_directory~ + [3408, 2874, 64, 64], +** Processing line: ~ [3407, 2849, 64, 64],~ - Inside source: true *** True Line Result - def tmp_directory -** Processing line: ~ "#{relative_path}/tmp/ios"~ + [3407, 2849, 64, 64], +** Processing line: ~ [3345, 2872, 64, 64],~ - Inside source: true *** True Line Result - "#{relative_path}/tmp/ios" -** Processing line: ~ end~ + [3345, 2872, 64, 64], +** Processing line: ~ [3342, 2847, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3342, 2847, 64, 64], +** Processing line: ~ [3284, 2874, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def app_path~ + [3284, 2874, 64, 64], +** Processing line: ~ [3284, 2848, 64, 64],~ - Inside source: true *** True Line Result - def app_path -** Processing line: ~ "#{tmp_directory}/#{@app_name}.app"~ + [3284, 2848, 64, 64], +** Processing line: ~ [3248, 2878, 64, 64],~ - Inside source: true *** True Line Result - "#{tmp_directory}/#{@app_name}.app" -** Processing line: ~ end~ + [3248, 2878, 64, 64], +** Processing line: ~ [3252, 2848, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3252, 2848, 64, 64], +** Processing line: ~ [3953, 3274, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def root_folder~ + [3953, 3274, 64, 64], +** Processing line: ~ [3899, 3277, 64, 64],~ - Inside source: true *** True Line Result - def root_folder -** Processing line: ~ "#{relative_path}/#{$gtk.cli_arguments[:dragonruby]}"~ + [3899, 3277, 64, 64], +** Processing line: ~ [3951, 3222, 64, 64],~ - Inside source: true *** True Line Result - "#{relative_path}/#{$gtk.cli_arguments[:dragonruby]}" -** Processing line: ~ end~ + [3951, 3222, 64, 64], +** Processing line: ~ [3900, 3222, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3900, 3222, 64, 64], +** Processing line: ~ [4310, 2968, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def write_ip_address~ + [4310, 2968, 64, 64], +** Processing line: ~ [4246, 2969, 64, 64],~ - 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~ + [4246, 2969, 64, 64], +** Processing line: ~ [4183, 2965, 64, 64],~ - Inside source: true *** True Line Result - $gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip -** Processing line: ~ end~ + [4183, 2965, 64, 64], +** Processing line: ~ [4153, 2967, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [4153, 2967, 64, 64], +** Processing line: ~ [4311, 2910, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def create_ipa~ + [4311, 2910, 64, 64], +** Processing line: ~ [4308, 2856, 64, 64],~ - Inside source: true *** True Line Result - def create_ipa -** Processing line: ~ write_ip_address~ + [4308, 2856, 64, 64], +** Processing line: ~ [4251, 2855, 64, 64],~ - Inside source: true *** True Line Result - write_ip_address -** Processing line: ~ sh "rm \"#{@app_name}\".ipa"~ + [4251, 2855, 64, 64], +** Processing line: ~ [4197, 2857, 64, 64],~ - Inside source: true *** True Line Result - sh "rm \"#{@app_name}\".ipa" -** Processing line: ~ sh "rm -rf \"#{app_path}/app\""~ + [4197, 2857, 64, 64], +** Processing line: ~ [5466, 3184, 64, 64],~ - Inside source: true *** True Line Result - sh "rm -rf \"#{app_path}/app\"" -** Processing line: ~ sh "rm -rf \"#{app_path}/sounds\""~ + [5466, 3184, 64, 64], +** Processing line: ~ [5466, 3158, 64, 64],~ - Inside source: true *** True Line Result - sh "rm -rf \"#{app_path}/sounds\"" -** Processing line: ~ sh "rm -rf \"#{app_path}/sprites\""~ + [5466, 3158, 64, 64], +** Processing line: ~ [5404, 3184, 64, 64],~ - Inside source: true *** True Line Result - sh "rm -rf \"#{app_path}/sprites\"" -** Processing line: ~ sh "rm -rf \"#{app_path}/data\""~ + [5404, 3184, 64, 64], +** Processing line: ~ [5404, 3156, 64, 64],~ - Inside source: true *** True Line Result - sh "rm -rf \"#{app_path}/data\"" -** Processing line: ~ sh "rm -rf \"#{app_path}/fonts\""~ + [5404, 3156, 64, 64], +** Processing line: ~ [5343, 3185, 64, 64],~ - Inside source: true *** True Line Result - sh "rm -rf \"#{app_path}/fonts\"" -** Processing line: ~ sh "cp -r \"#{root_folder}/app/\" \"#{app_path}/app/\""~ + [5343, 3185, 64, 64], +** Processing line: ~ [5342, 3156, 64, 64],~ - 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/\""~ + [5342, 3156, 64, 64], +** Processing line: ~ [5308, 3185, 64, 64],~ - 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/\""~ + [5308, 3185, 64, 64], +** Processing line: ~ [5307, 3154, 64, 64],~ - 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/\""~ + [5307, 3154, 64, 64], +** Processing line: ~ [6163, 2950, 64, 64],~ - 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/\""~ + [6163, 2950, 64, 64], +** Processing line: ~ [6111, 2952, 64, 64],~ - 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"~ + [6111, 2952, 64, 64], +** Processing line: ~ [6164, 2898, 64, 64],~ - 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\""~ + [6164, 2898, 64, 64], +** Processing line: ~ [6113, 2897, 64, 64],~ - 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\""~ + [6113, 2897, 64, 64], +** Processing line: ~ [7725, 3156, 64, 64],~ - Inside source: true *** True Line Result - sh "chmod -R 755 \"#{tmp_directory}/ipa_root/Payload\"" -** Processing line: ~ do_zip~ + [7725, 3156, 64, 64], +** Processing line: ~ [7661, 3157, 64, 64],~ - Inside source: true *** True Line Result - do_zip -** Processing line: ~ sh "cp \"#{tmp_directory}/ipa_root/archive.zip\" \"#{tmp_directory}/#{@app_name}.ipa\""~ + [7661, 3157, 64, 64], +** Processing line: ~ [7598, 3157, 64, 64],~ - Inside source: true *** True Line Result - sh "cp \"#{tmp_directory}/ipa_root/archive.zip\" \"#{tmp_directory}/#{@app_name}.ipa\"" -** Processing line: ~ sh "XCODE_DIR=\"/Applications/Xcode.app/Contents/Developer\" \"#{relative_path}/dragonruby-deploy-ios\" -d \"#{@device_id}\" \"#{tmp_directory}/#{@app_name}.ipa\""~ + [7598, 3157, 64, 64], +** Processing line: ~ [7533, 3156, 64, 64],~ - Inside source: true *** True Line Result - sh "XCODE_DIR=\"/Applications/Xcode.app/Contents/Developer\" \"#{relative_path}/dragonruby-deploy-ios\" -d \"#{@device_id}\" \"#{tmp_directory}/#{@app_name}.ipa\"" -** Processing line: ~ cmd_result = `ps -e | grep civetweb`~ + [7533, 3156, 64, 64], +** Processing line: ~ [7468, 3156, 64, 64],~ - Inside source: true *** True Line Result - cmd_result = `ps -e | grep civetweb` -** Processing line: ~ is_civet_running = (`ps -e | grep civetweb`).strip.each_line.to_a.length > 2~ + [7468, 3156, 64, 64], +** Processing line: ~ [7401, 3156, 64, 64],~ - Inside source: true *** True Line Result - is_civet_running = (`ps -e | grep civetweb`).strip.each_line.to_a.length > 2 -** Processing line: ~ if !is_civet_running~ + [7401, 3156, 64, 64], +** Processing line: ~ [7335, 3157, 64, 64],~ - Inside source: true *** True Line Result - if !is_civet_running -** Processing line: ~ $gtk.system "cp \"#{relative_path}/civetweb\" \"#{tmp_directory}/../src_backup/civetweb\""~ + [7335, 3157, 64, 64], +** Processing line: ~ [7270, 3157, 64, 64],~ - Inside source: true *** True Line Result - $gtk.system "cp \"#{relative_path}/civetweb\" \"#{tmp_directory}/../src_backup/civetweb\"" -** Processing line: ~ $gtk.system "open \"#{tmp_directory}/../src_backup/civetweb\" -g"~ + [7270, 3157, 64, 64], +** Processing line: ~ [7208, 3157, 64, 64],~ - Inside source: true *** True Line Result - $gtk.system "open \"#{tmp_directory}/../src_backup/civetweb\" -g" -** Processing line: ~ else~ + [7208, 3157, 64, 64], +** Processing line: ~ [7146, 3157, 64, 64],~ - Inside source: true *** True Line Result - else -** Processing line: ~ log "* INFO: civetweb is running already running. No need to start another instance."~ + [7146, 3157, 64, 64], +** Processing line: ~ [7134, 3159, 64, 64],~ - Inside source: true *** True Line Result - log "* INFO: civetweb is running already running. No need to start another instance." -** Processing line: ~ end~ + [7134, 3159, 64, 64], +** Processing line: ~ [6685, 3726, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ log_info "Check your device!!"~ + [6685, 3726, 64, 64], +** Processing line: ~ [6685, 3663, 64, 64],~ - Inside source: true *** True Line Result - log_info "Check your device!!" -** Processing line: ~ end~ + [6685, 3663, 64, 64], +** Processing line: ~ [6683, 3602, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6683, 3602, 64, 64], +** Processing line: ~ [6679, 3538, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def do_zip~ + [6679, 3538, 64, 64], +** Processing line: ~ [6680, 3474, 64, 64],~ - Inside source: true *** True Line Result - def do_zip -** Processing line: ~ $gtk.write_file_root "tmp/ios/do_zip.sh", <<-SCRIPT~ + [6680, 3474, 64, 64], +** Processing line: ~ [6682, 3413, 64, 64],~ - Inside source: true *** True Line Result - $gtk.write_file_root "tmp/ios/do_zip.sh", <<-SCRIPT -** Processing line: ~ pushd #{tmp_directory}/ipa_root/~ + [6682, 3413, 64, 64], +** Processing line: ~ [6681, 3347, 64, 64],~ - Inside source: true *** True Line Result - pushd #{tmp_directory}/ipa_root/ -** Processing line: ~ zip -q -r archive.zip Payload~ + [6681, 3347, 64, 64], +** Processing line: ~ [6681, 3287, 64, 64],~ - Inside source: true *** True Line Result - zip -q -r archive.zip Payload -** Processing line: ~ popd~ + [6681, 3287, 64, 64], +** Processing line: ~ [6682, 3223, 64, 64],~ - Inside source: true *** True Line Result - popd -** Processing line: ~ SCRIPT~ + [6682, 3223, 64, 64], +** Processing line: ~ [6683, 3161, 64, 64],~ - Inside source: true *** True Line Result - SCRIPT -** Processing line: ~~ + [6683, 3161, 64, 64], +** Processing line: ~ [6682, 3102, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ sh "sh #{tmp_directory}/do_zip.sh"~ + [6682, 3102, 64, 64], +** Processing line: ~ [6684, 3042, 64, 64],~ - Inside source: true *** True Line Result - sh "sh #{tmp_directory}/do_zip.sh" -** Processing line: ~ end~ + [6684, 3042, 64, 64], +** Processing line: ~ [6685, 2980, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6685, 2980, 64, 64], +** Processing line: ~ [6685, 2920, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def sh cmd~ + [6685, 2920, 64, 64], +** Processing line: ~ [6683, 2859, 64, 64],~ - Inside source: true *** True Line Result - def sh cmd -** Processing line: ~ log_info cmd.strip~ + [6683, 2859, 64, 64], +** Processing line: ~ [6684, 2801, 64, 64],~ - Inside source: true *** True Line Result - log_info cmd.strip -** Processing line: ~ result = `#{cmd}`~ + [6684, 2801, 64, 64], +** Processing line: ~ [6686, 2743, 64, 64],~ - Inside source: true *** True Line Result - result = `#{cmd}` -** Processing line: ~ if result.strip.length > 0~ + [6686, 2743, 64, 64], +** Processing line: ~ [6683, 2683, 64, 64],~ - Inside source: true *** True Line Result - if result.strip.length > 0 -** Processing line: ~ log_info result.strip.each_line.map(&:strip).join("\n")~ + [6683, 2683, 64, 64], +** Processing line: ~ [6681, 2622, 64, 64],~ - Inside source: true *** True Line Result - log_info result.strip.each_line.map(&:strip).join("\n") -** Processing line: ~ end~ + [6681, 2622, 64, 64], +** Processing line: ~ [6682, 2559, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ result~ + [6682, 2559, 64, 64], +** Processing line: ~ [6683, 2498, 64, 64],~ - Inside source: true *** True Line Result - result -** Processing line: ~ end~ + [6683, 2498, 64, 64], +** Processing line: ~ [6685, 2434, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6685, 2434, 64, 64], +** Processing line: ~ [6683, 2371, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def deploy~ + [6683, 2371, 64, 64], +** Processing line: ~ [6683, 2306, 64, 64],~ - Inside source: true *** True Line Result - def deploy -** Processing line: ~ end~ + [6683, 2306, 64, 64], +** Processing line: ~ [6684, 2242, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [6684, 2242, 64, 64], +** Processing line: ~ [6683, 2177, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6683, 2177, 64, 64], +** Processing line: ~ [6683, 2112, 64, 64],~ - 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 - + [6683, 2112, 64, 64], +** Processing line: ~ [6683, 2049, 64, 64],~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/itch_wizard.rb~ + [6683, 2049, 64, 64], +** Processing line: ~ [6683, 1985, 64, 64],~ - Inside source: true *** True Line Result - # ./dragon/itch_wizard.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + [6683, 1985, 64, 64], +** Processing line: ~ [6682, 1923, 64, 64],~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + [6682, 1923, 64, 64], +** Processing line: ~ [6683, 1860, 64, 64],~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # itch_wizard.rb has been released under MIT (*only this file*).~ + [6683, 1860, 64, 64], +** Processing line: ~ [6685, 1797, 64, 64],~ - Inside source: true *** True Line Result - # itch_wizard.rb has been released under MIT (*only this file*). -** Processing line: ~~ + [6685, 1797, 64, 64], +** Processing line: ~ [6684, 1735, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ class ItchWizard~ + [6684, 1735, 64, 64], +** Processing line: ~ [6685, 1724, 64, 64],~ - Inside source: true *** True Line Result - class ItchWizard -** Processing line: ~ def steps~ + [6685, 1724, 64, 64], +** Processing line: ~ [7088, 1967, 64, 64],~ - Inside source: true *** True Line Result - def steps -** Processing line: ~ [~ + [7088, 1967, 64, 64], +** Processing line: ~ [7026, 1966, 64, 64],~ - Inside source: true *** True Line Result - [ -** Processing line: ~ :check_metadata,~ + [7026, 1966, 64, 64], +** Processing line: ~ [6964, 1967, 64, 64],~ - Inside source: true *** True Line Result - :check_metadata, -** Processing line: ~ :deploy~ + [6964, 1967, 64, 64], +** Processing line: ~ [6900, 1965, 64, 64],~ - Inside source: true *** True Line Result - :deploy -** Processing line: ~ ]~ + [6900, 1965, 64, 64], +** Processing line: ~ [6869, 1969, 64, 64],~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + [6869, 1969, 64, 64], +** Processing line: ~ [6972, 1904, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6972, 1904, 64, 64], +** Processing line: ~ [6974, 1840, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def metadata_file_path~ + [6974, 1840, 64, 64], +** Processing line: ~ [6971, 1776, 64, 64],~ - Inside source: true *** True Line Result - def metadata_file_path -** Processing line: ~ "metadata/game_metadata.txt"~ + [6971, 1776, 64, 64], +** Processing line: ~ [6971, 1716, 64, 64],~ - Inside source: true *** True Line Result - "metadata/game_metadata.txt" -** Processing line: ~ end~ + [6971, 1716, 64, 64], +** Processing line: ~ [7168, 1979, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7168, 1979, 64, 64], +** Processing line: ~ [7170, 1919, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def get_metadata~ + [7170, 1919, 64, 64], +** Processing line: ~ [7169, 1882, 64, 64],~ - Inside source: true *** True Line Result - def get_metadata -** Processing line: ~ metadata = $gtk.read_file metadata_file_path~ + [7169, 1882, 64, 64], +** Processing line: ~ [7115, 1880, 64, 64],~ - Inside source: true *** True Line Result - metadata = $gtk.read_file metadata_file_path -** Processing line: ~~ + [7115, 1880, 64, 64], +** Processing line: ~ [7086, 1881, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if !metadata~ + [7086, 1881, 64, 64], +** Processing line: ~ [7725, 1837, 64, 64],~ - Inside source: true *** True Line Result - if !metadata -** Processing line: ~ write_blank_metadata~ + [7725, 1837, 64, 64], +** Processing line: ~ [7724, 1776, 64, 64],~ - Inside source: true *** True Line Result - write_blank_metadata -** Processing line: ~ metadata = $gtk.read_file metadata_file_path~ + [7724, 1776, 64, 64], +** Processing line: ~ [7724, 1728, 64, 64],~ - Inside source: true *** True Line Result - metadata = $gtk.read_file metadata_file_path -** Processing line: ~ end~ + [7724, 1728, 64, 64], +** Processing line: ~ [7661, 1727, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7661, 1727, 64, 64], +** Processing line: ~ [7603, 1728, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a~ + [7603, 1728, 64, 64], +** Processing line: ~ [7571, 1837, 64, 64],~ - Inside source: true *** True Line Result - dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a -** Processing line: ~~ + [7571, 1837, 64, 64], +** Processing line: ~ [7570, 1774, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ {~ + [7570, 1774, 64, 64], +** Processing line: ~ [7572, 1725, 64, 64],~ - Inside source: true *** True Line Result - { -** Processing line: ~ dev_id: dev_id.strip,~ + [7572, 1725, 64, 64], +** Processing line: ~ [7859, 2134, 64, 64],~ - Inside source: true *** True Line Result - dev_id: dev_id.strip, -** Processing line: ~ dev_title: dev_title.strip,~ + [7859, 2134, 64, 64], +** Processing line: ~ [7858, 2070, 64, 64],~ - Inside source: true *** True Line Result - dev_title: dev_title.strip, -** Processing line: ~ game_id: game_id.strip,~ + [7858, 2070, 64, 64], +** Processing line: ~ [7858, 2008, 64, 64],~ - Inside source: true *** True Line Result - game_id: game_id.strip, -** Processing line: ~ game_title: game_title.strip,~ + [7858, 2008, 64, 64], +** Processing line: ~ [7860, 1942, 64, 64],~ - Inside source: true *** True Line Result - game_title: game_title.strip, -** Processing line: ~ version: version.strip,~ + [7860, 1942, 64, 64], +** Processing line: ~ [7856, 1878, 64, 64],~ - Inside source: true *** True Line Result - version: version.strip, -** Processing line: ~ icon: icon.strip~ + [7856, 1878, 64, 64], +** Processing line: ~ [7860, 1813, 64, 64],~ - Inside source: true *** True Line Result - icon: icon.strip -** Processing line: ~ }~ + [7860, 1813, 64, 64], +** Processing line: ~ [7859, 1750, 64, 64],~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [7859, 1750, 64, 64], +** Processing line: ~ [7856, 1724, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7856, 1724, 64, 64], +** Processing line: ~ [8155, 1837, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def write_blank_metadata~ + [8155, 1837, 64, 64], +** Processing line: ~ [8092, 1839, 64, 64],~ - Inside source: true *** True Line Result - def write_blank_metadata -** Processing line: ~ $gtk.write_file metadata_file_path, <<-S.strip~ + [8092, 1839, 64, 64], +** Processing line: ~ [8032, 1838, 64, 64],~ - Inside source: true *** True Line Result - $gtk.write_file metadata_file_path, <<-S.strip -** Processing line: ~ #devid=myname~ + [8032, 1838, 64, 64], +** Processing line: ~ [7999, 1839, 64, 64],~ - Inside source: true *** True Line Result - #devid=myname -** Processing line: ~ #devtitle=My Name~ + [7999, 1839, 64, 64], +** Processing line: ~ [8153, 1773, 64, 64],~ - Inside source: true *** True Line Result - #devtitle=My Name -** Processing line: ~ #gameid=mygame~ + [8153, 1773, 64, 64], +** Processing line: ~ [8154, 1731, 64, 64],~ - Inside source: true *** True Line Result - #gameid=mygame -** Processing line: ~ #gametitle=My Game~ + [8154, 1731, 64, 64], +** Processing line: ~ [8090, 1730, 64, 64],~ - Inside source: true *** True Line Result - #gametitle=My Game -** Processing line: ~ #version=0.1~ + [8090, 1730, 64, 64], +** Processing line: ~ [8035, 1732, 64, 64],~ - Inside source: true *** True Line Result - #version=0.1 -** Processing line: ~ #icon=metadata/icon.png~ + [8035, 1732, 64, 64], +** Processing line: ~ [8003, 1776, 64, 64],~ - Inside source: true *** True Line Result - #icon=metadata/icon.png -** Processing line: ~ S~ + [8003, 1776, 64, 64], +** Processing line: ~ [8003, 1730, 64, 64],~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + [8003, 1730, 64, 64], +** Processing line: ~ [8421, 1978, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8421, 1978, 64, 64], +** Processing line: ~ [8420, 1917, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def check_metadata~ + [8420, 1917, 64, 64], +** Processing line: ~ [8505, 1878, 64, 64],~ - Inside source: true *** True Line Result - def check_metadata -** Processing line: ~ metadata_text = $gtk.read_file metadata_file_path~ + [8505, 1878, 64, 64], +** Processing line: ~ [8443, 1881, 64, 64],~ - Inside source: true *** True Line Result - metadata_text = $gtk.read_file metadata_file_path -** Processing line: ~ if !metadata_text~ + [8443, 1881, 64, 64], +** Processing line: ~ [8420, 1882, 64, 64],~ - Inside source: true *** True Line Result - if !metadata_text -** Processing line: ~ write_blank_metadata~ + [8420, 1882, 64, 64], +** Processing line: ~ [8847, 1908, 64, 64],~ - Inside source: true *** True Line Result - write_blank_metadata -** Processing line: ~ end~ + [8847, 1908, 64, 64], +** Processing line: ~ [8783, 1908, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8783, 1908, 64, 64], +** Processing line: ~ [8718, 1910, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if metadata_text.each_line.to_a.length != 6~ + [8718, 1910, 64, 64], +** Processing line: ~ [8654, 1910, 64, 64],~ - Inside source: true *** True Line Result - if metadata_text.each_line.to_a.length != 6 -** Processing line: ~ write_blank_metadata~ + [8654, 1910, 64, 64], +** Processing line: ~ [8628, 1911, 64, 64],~ - Inside source: true *** True Line Result - write_blank_metadata -** Processing line: ~ end~ + [8628, 1911, 64, 64], +** Processing line: ~ [8729, 1847, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8729, 1847, 64, 64], +** Processing line: ~ [8731, 1781, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ log "* INFO: Contents of #{metadata_file_path}:"~ + [8731, 1781, 64, 64], +** Processing line: ~ [8731, 1721, 64, 64],~ - Inside source: true *** True Line Result - log "* INFO: Contents of #{metadata_file_path}:" -** Processing line: ~ log "#+begin_src txt"~ + [8731, 1721, 64, 64], +** Processing line: ~ [9058, 2135, 64, 64],~ - Inside source: true *** True Line Result - log "#+begin_src txt" -** Processing line: ~ metadata_text.each_line { |l| log " #{l}" }~ + [9058, 2135, 64, 64], +** Processing line: ~ [9056, 2073, 64, 64],~ - Inside source: true *** True Line Result - metadata_text.each_line { |l| log " #{l}" } -** Processing line: ~ log "#+end_src"~ + [9056, 2073, 64, 64], +** Processing line: ~ [9058, 2006, 64, 64],~ - Inside source: true *** True Line Result - log "#+end_src" -** Processing line: ~ metadata = get_metadata~ + [9058, 2006, 64, 64], +** Processing line: ~ [9057, 1939, 64, 64],~ - Inside source: true *** True Line Result - metadata = get_metadata -** Processing line: ~~ + [9057, 1939, 64, 64], +** Processing line: ~ [9058, 1876, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if metadata[:dev_id].start_with?("#") || !@dev_id~ + [9058, 1876, 64, 64], +** Processing line: ~ [9056, 1810, 64, 64],~ - Inside source: true *** True Line Result - if metadata[:dev_id].start_with?("#") || !@dev_id -** Processing line: ~ log "* PROMPT: Please provide your username for Itch."~ + [9056, 1810, 64, 64], +** Processing line: ~ [9059, 1745, 64, 64],~ - 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\""~ + [9059, 1745, 64, 64], +** Processing line: ~ [9060, 1722, 64, 64],~ - Inside source: true *** True Line Result - $console.set_command "$wizards.itch.set_dev_id \"your-itch-username\"" -** Processing line: ~ return :need_dev_id~ + [9060, 1722, 64, 64], +** Processing line: ~ [9273, 1977, 64, 64],~ - Inside source: true *** True Line Result - return :need_dev_id -** Processing line: ~ end~ + [9273, 1977, 64, 64], +** Processing line: ~ [9273, 1912, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [9273, 1912, 64, 64], +** Processing line: ~ [9358, 1883, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if metadata[:dev_title].start_with?("#") || !@dev_title~ + [9358, 1883, 64, 64], +** Processing line: ~ [9298, 1881, 64, 64],~ - Inside source: true *** True Line Result - if metadata[:dev_title].start_with?("#") || !@dev_title -** Processing line: ~ log "* PROMPT: Please provide developer's/company's name that you want displayed."~ + [9298, 1881, 64, 64], +** Processing line: ~ [9270, 1883, 64, 64],~ - 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\""~ + [9270, 1883, 64, 64], +** Processing line: ~ [9699, 1910, 64, 64],~ - Inside source: true *** True Line Result - $console.set_command "$wizards.itch.set_dev_title \"Your Name\"" -** Processing line: ~ return :need_dev_title~ + [9699, 1910, 64, 64], +** Processing line: ~ [9637, 1910, 64, 64],~ - Inside source: true *** True Line Result - return :need_dev_title -** Processing line: ~ end~ + [9637, 1910, 64, 64], +** Processing line: ~ [9576, 1910, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [9576, 1910, 64, 64], +** Processing line: ~ [9512, 1911, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if metadata[:game_id].start_with?("#") || !@game_id~ + [9512, 1911, 64, 64], +** Processing line: ~ [9477, 1912, 64, 64],~ - Inside source: true *** True Line Result - 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."~ + [9477, 1912, 64, 64], +** Processing line: ~ [9584, 1846, 64, 64],~ - 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\""~ + [9584, 1846, 64, 64], +** Processing line: ~ [9585, 1783, 64, 64],~ - Inside source: true *** True Line Result - $console.set_command "$wizards.itch.set_game_id \"your-game-id\"" -** Processing line: ~ return :need_game_id~ + [9585, 1783, 64, 64], +** Processing line: ~ [9586, 1719, 64, 64],~ - Inside source: true *** True Line Result - return :need_game_id -** Processing line: ~ end~ + [9586, 1719, 64, 64], +** Processing line: ~ [8320, 2788, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8320, 2788, 64, 64], +** Processing line: ~ [8256, 2789, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if metadata[:game_title].start_with?("#") || !@game_title~ + [8256, 2789, 64, 64], +** Processing line: ~ [8192, 2789, 64, 64],~ - Inside source: true *** True Line Result - if metadata[:game_title].start_with?("#") || !@game_title -** Processing line: ~ log "* PROMPT: Please provide the display name for your game. (This can include spaces)"~ + [8192, 2789, 64, 64], +** Processing line: ~ [8180, 2789, 64, 64],~ - 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\""~ + [8180, 2789, 64, 64], +** Processing line: ~ [8319, 2730, 64, 64],~ - Inside source: true *** True Line Result - $console.set_command "$wizards.itch.set_game_title \"Your Game\"" -** Processing line: ~ return :need_game_title~ + [8319, 2730, 64, 64], +** Processing line: ~ [8319, 2671, 64, 64],~ - Inside source: true *** True Line Result - return :need_game_title -** Processing line: ~ end~ + [8319, 2671, 64, 64], +** Processing line: ~ [8319, 2639, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8319, 2639, 64, 64], +** Processing line: ~ [8259, 2639, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if metadata[:version].start_with?("#") || !@version~ + [8259, 2639, 64, 64], +** Processing line: ~ [8202, 2639, 64, 64],~ - Inside source: true *** True Line Result - if metadata[:version].start_with?("#") || !@version -** Processing line: ~ log "* PROMPT: Please provide the version for your game."~ + [8202, 2639, 64, 64], +** Processing line: ~ [8179, 2727, 64, 64],~ - 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\""~ + [8179, 2727, 64, 64], +** Processing line: ~ [8178, 2665, 64, 64],~ - Inside source: true *** True Line Result - $console.set_command "$wizards.itch.set_version \"1.0\"" -** Processing line: ~ return :need_version~ + [8178, 2665, 64, 64], +** Processing line: ~ [8177, 2636, 64, 64],~ - Inside source: true *** True Line Result - return :need_version -** Processing line: ~ end~ + [8177, 2636, 64, 64], +** Processing line: ~ [9360, 3138, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [9360, 3138, 64, 64], +** Processing line: ~ [9296, 3137, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if metadata[:icon].start_with?("#") || !@icon~ + [9296, 3137, 64, 64], +** Processing line: ~ [9235, 3139, 64, 64],~ - Inside source: true *** True Line Result - if metadata[:icon].start_with?("#") || !@icon -** Processing line: ~ log "* PROPT: Please provide icon path for your game."~ + [9235, 3139, 64, 64], +** Processing line: ~ [9174, 3139, 64, 64],~ - Inside source: true *** True Line Result - log "* PROPT: Please provide icon path for your game." -** Processing line: ~ $console.set_command "$wizards.itch.set_icon \"icon.png\""~ + [9174, 3139, 64, 64], +** Processing line: ~ [9113, 3138, 64, 64],~ - Inside source: true *** True Line Result - $console.set_command "$wizards.itch.set_icon \"icon.png\"" -** Processing line: ~ return :need_icon~ + [9113, 3138, 64, 64], +** Processing line: ~ [9050, 3138, 64, 64],~ - Inside source: true *** True Line Result - return :need_icon -** Processing line: ~ end~ + [9050, 3138, 64, 64], +** Processing line: ~ [8988, 3138, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8988, 3138, 64, 64], +** Processing line: ~ [8925, 3138, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ return :success~ + [8925, 3138, 64, 64], +** Processing line: ~ [8860, 3136, 64, 64],~ - Inside source: true *** True Line Result - return :success -** Processing line: ~ end~ + [8860, 3136, 64, 64], +** Processing line: ~ [8797, 3136, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8797, 3136, 64, 64], +** Processing line: ~ [8770, 3138, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def set_dev_id value~ + [8770, 3138, 64, 64], +** Processing line: ~ [8827, 4171, 64, 64],~ - Inside source: true *** True Line Result - def set_dev_id value -** Processing line: ~ @dev_id = value~ + [8827, 4171, 64, 64], +** Processing line: ~ [8827, 4107, 64, 64],~ - Inside source: true *** True Line Result - @dev_id = value -** Processing line: ~ write_metadata~ + [8827, 4107, 64, 64], +** Processing line: ~ [8827, 4043, 64, 64],~ - Inside source: true *** True Line Result - write_metadata -** Processing line: ~ start~ + [8827, 4043, 64, 64], +** Processing line: ~ [8827, 3978, 64, 64],~ - Inside source: true *** True Line Result - start -** Processing line: ~ end~ + [8827, 3978, 64, 64], +** Processing line: ~ [8825, 3914, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8825, 3914, 64, 64], +** Processing line: ~ [8824, 3858, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def set_dev_title value~ + [8824, 3858, 64, 64], +** Processing line: ~ [9635, 4234, 64, 64],~ - Inside source: true *** True Line Result - def set_dev_title value -** Processing line: ~ @dev_title = value~ + [9635, 4234, 64, 64], +** Processing line: ~ [9584, 4235, 64, 64],~ - Inside source: true *** True Line Result - @dev_title = value -** Processing line: ~ write_metadata~ + [9584, 4235, 64, 64], +** Processing line: ~ [9634, 4187, 64, 64],~ - Inside source: true *** True Line Result - write_metadata -** Processing line: ~ start~ + [9634, 4187, 64, 64], +** Processing line: ~ [9582, 4183, 64, 64],~ - Inside source: true *** True Line Result - start -** Processing line: ~ end~ + [9582, 4183, 64, 64], +** Processing line: ~ [9402, 5114, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [9402, 5114, 64, 64], +** Processing line: ~ [9402, 5087, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def set_game_id value~ + [9402, 5087, 64, 64], +** Processing line: ~ [9347, 5113, 64, 64],~ - Inside source: true *** True Line Result - def set_game_id value -** Processing line: ~ @game_id = value~ + [9347, 5113, 64, 64], +** Processing line: ~ [9345, 5086, 64, 64],~ - Inside source: true *** True Line Result - @game_id = value -** Processing line: ~ write_metadata~ + [9345, 5086, 64, 64], +** Processing line: ~ [9287, 5114, 64, 64],~ - Inside source: true *** True Line Result - write_metadata -** Processing line: ~ start~ + [9287, 5114, 64, 64], +** Processing line: ~ [9285, 5085, 64, 64],~ - Inside source: true *** True Line Result - start -** Processing line: ~ end~ + [9285, 5085, 64, 64], +** Processing line: ~ [9245, 5114, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [9245, 5114, 64, 64], +** Processing line: ~ [9244, 5086, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def set_game_title value~ + [9244, 5086, 64, 64], +** Processing line: ~ [9336, 5445, 64, 64],~ - Inside source: true *** True Line Result - def set_game_title value -** Processing line: ~ @game_title = value~ + [9336, 5445, 64, 64], +** Processing line: ~ [9285, 5445, 64, 64],~ - Inside source: true *** True Line Result - @game_title = value -** Processing line: ~ write_metadata~ + [9285, 5445, 64, 64], +** Processing line: ~ [9337, 5395, 64, 64],~ - Inside source: true *** True Line Result - write_metadata -** Processing line: ~ start~ + [9337, 5395, 64, 64], +** Processing line: ~ [9283, 5393, 64, 64],~ - Inside source: true *** True Line Result - start -** Processing line: ~ end~ + [9283, 5393, 64, 64], +** Processing line: ~ [8884, 4968, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8884, 4968, 64, 64], +** Processing line: ~ [8884, 4939, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def set_version value~ + [8884, 4939, 64, 64], +** Processing line: ~ [8822, 4967, 64, 64],~ - Inside source: true *** True Line Result - def set_version value -** Processing line: ~ @version = value~ + [8822, 4967, 64, 64], +** Processing line: ~ [8823, 4940, 64, 64],~ - Inside source: true *** True Line Result - @version = value -** Processing line: ~ write_metadata~ + [8823, 4940, 64, 64], +** Processing line: ~ [8765, 4967, 64, 64],~ - Inside source: true *** True Line Result - write_metadata -** Processing line: ~ start~ + [8765, 4967, 64, 64], +** Processing line: ~ [8762, 4937, 64, 64],~ - Inside source: true *** True Line Result - start -** Processing line: ~ end~ + [8762, 4937, 64, 64], +** Processing line: ~ [8726, 4969, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8726, 4969, 64, 64], +** Processing line: ~ [8727, 4939, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def set_icon value~ + [8727, 4939, 64, 64], +** Processing line: ~ [7946, 5248, 64, 64],~ - Inside source: true *** True Line Result - def set_icon value -** Processing line: ~ @icon = value~ + [7946, 5248, 64, 64], +** Processing line: ~ [7945, 5220, 64, 64],~ - Inside source: true *** True Line Result - @icon = value -** Processing line: ~ write_metadata~ + [7945, 5220, 64, 64], +** Processing line: ~ [7887, 5248, 64, 64],~ - Inside source: true *** True Line Result - write_metadata -** Processing line: ~ start~ + [7887, 5248, 64, 64], +** Processing line: ~ [7886, 5219, 64, 64],~ - Inside source: true *** True Line Result - start -** Processing line: ~ end~ + [7886, 5219, 64, 64], +** Processing line: ~ [7830, 5248, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7830, 5248, 64, 64], +** Processing line: ~ [7827, 5218, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def write_metadata~ + [7827, 5218, 64, 64], +** Processing line: ~ [7781, 5248, 64, 64],~ - Inside source: true *** True Line Result - def write_metadata -** Processing line: ~ text = ""~ + [7781, 5248, 64, 64], +** Processing line: ~ [7781, 5216, 64, 64],~ - Inside source: true *** True Line Result - text = "" -** Processing line: ~ if @dev_id~ + [7781, 5216, 64, 64], +** Processing line: ~ [6648, 4762, 64, 64],~ - Inside source: true *** True Line Result - if @dev_id -** Processing line: ~ text += "devid=#{@dev_id}\n"~ + [6648, 4762, 64, 64], +** Processing line: ~ [6621, 4761, 64, 64],~ - Inside source: true *** True Line Result - text += "devid=#{@dev_id}\n" -** Processing line: ~ else~ + [6621, 4761, 64, 64], +** Processing line: ~ [5011, 4446, 64, 64],~ - Inside source: true *** True Line Result - else -** Processing line: ~ text += "#devid=myname\n"~ + [5011, 4446, 64, 64], +** Processing line: ~ [4982, 4444, 64, 64],~ - Inside source: true *** True Line Result - text += "#devid=myname\n" -** Processing line: ~ end~ + [4982, 4444, 64, 64], +** Processing line: ~ [4146, 4641, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [4146, 4641, 64, 64], +** Processing line: ~ [4092, 4643, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if @dev_title~ + [4092, 4643, 64, 64], +** Processing line: ~ [4145, 4589, 64, 64],~ - Inside source: true *** True Line Result - if @dev_title -** Processing line: ~ text += "devtitle=#{@dev_title}\n"~ + [4145, 4589, 64, 64], +** Processing line: ~ [4091, 4590, 64, 64],~ - Inside source: true *** True Line Result - text += "devtitle=#{@dev_title}\n" -** Processing line: ~ else~ + [4091, 4590, 64, 64], +** Processing line: ~ [4139, 4497, 64, 64],~ - Inside source: true *** True Line Result - else -** Processing line: ~ text += "#devtitle=My Name\n"~ + [4139, 4497, 64, 64], +** Processing line: ~ [4135, 4437, 64, 64],~ - Inside source: true *** True Line Result - text += "#devtitle=My Name\n" -** Processing line: ~ end~ + [4135, 4437, 64, 64], +** Processing line: ~ [4135, 4383, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [4135, 4383, 64, 64], +** Processing line: ~ [4078, 4495, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if @game_id~ + [4078, 4495, 64, 64], +** Processing line: ~ [4014, 4494, 64, 64],~ - Inside source: true *** True Line Result - if @game_id -** Processing line: ~ text += "gameid=#{@game_id}\n"~ + [4014, 4494, 64, 64], +** Processing line: ~ [3979, 4496, 64, 64],~ - Inside source: true *** True Line Result - text += "gameid=#{@game_id}\n" -** Processing line: ~ else~ + [3979, 4496, 64, 64], +** Processing line: ~ [4074, 4384, 64, 64],~ - Inside source: true *** True Line Result - else -** Processing line: ~ text += "#gameid=gameid\n"~ + [4074, 4384, 64, 64], +** Processing line: ~ [4015, 4381, 64, 64],~ - Inside source: true *** True Line Result - text += "#gameid=gameid\n" -** Processing line: ~ end~ + [4015, 4381, 64, 64], +** Processing line: ~ [3980, 4433, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3980, 4433, 64, 64], +** Processing line: ~ [3981, 4384, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if @game_title~ + [3981, 4384, 64, 64], +** Processing line: ~ [3276, 4279, 64, 64],~ - Inside source: true *** True Line Result - if @game_title -** Processing line: ~ text += "gametitle=#{@game_title}\n"~ + [3276, 4279, 64, 64], +** Processing line: ~ [3275, 4218, 64, 64],~ - Inside source: true *** True Line Result - text += "gametitle=#{@game_title}\n" -** Processing line: ~ else~ + [3275, 4218, 64, 64], +** Processing line: ~ [3276, 4170, 64, 64],~ - Inside source: true *** True Line Result - else -** Processing line: ~ text += "#gametitle=Game Name\n"~ + [3276, 4170, 64, 64], +** Processing line: ~ [3211, 4164, 64, 64],~ - Inside source: true *** True Line Result - text += "#gametitle=Game Name\n" -** Processing line: ~ end~ + [3211, 4164, 64, 64], +** Processing line: ~ [3213, 4280, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3213, 4280, 64, 64], +** Processing line: ~ [3156, 4278, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if @version~ + [3156, 4278, 64, 64], +** Processing line: ~ [3120, 4278, 64, 64],~ - Inside source: true *** True Line Result - if @version -** Processing line: ~ text += "version=#{@version}\n"~ + [3120, 4278, 64, 64], +** Processing line: ~ [3151, 4163, 64, 64],~ - Inside source: true *** True Line Result - text += "version=#{@version}\n" -** Processing line: ~ else~ + [3151, 4163, 64, 64], +** Processing line: ~ [3120, 4216, 64, 64],~ - Inside source: true *** True Line Result - else -** Processing line: ~ text += "#version=0.1\n"~ + [3120, 4216, 64, 64], +** Processing line: ~ [3120, 4161, 64, 64],~ - Inside source: true *** True Line Result - text += "#version=0.1\n" -** Processing line: ~ end~ + [3120, 4161, 64, 64], +** Processing line: ~ [1536, 4171, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [1536, 4171, 64, 64], +** Processing line: ~ [1536, 4110, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if @icon~ + [1536, 4110, 64, 64], +** Processing line: ~ [1535, 4051, 64, 64],~ - Inside source: true *** True Line Result - if @icon -** Processing line: ~ text += "icon=metadata/#{@icon}\n"~ + [1535, 4051, 64, 64], +** Processing line: ~ [1536, 3991, 64, 64],~ - Inside source: true *** True Line Result - text += "icon=metadata/#{@icon}\n" -** Processing line: ~ else~ + [1536, 3991, 64, 64], +** Processing line: ~ [1536, 3928, 64, 64],~ - Inside source: true *** True Line Result - else -** Processing line: ~ text += "#icon=metadata/icon.png\n"~ + [1536, 3928, 64, 64], +** Processing line: ~ [1536, 3863, 64, 64],~ - Inside source: true *** True Line Result - text += "#icon=metadata/icon.png\n" -** Processing line: ~ end~ + [1536, 3863, 64, 64], +** Processing line: ~ [1078, 4605, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [1078, 4605, 64, 64], +** Processing line: ~ [1076, 4577, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ $gtk.write_file metadata_file_path, text~ + [1076, 4577, 64, 64], +** Processing line: ~ [1018, 4604, 64, 64],~ - Inside source: true *** True Line Result - $gtk.write_file metadata_file_path, text -** Processing line: ~ end~ + [1018, 4604, 64, 64], +** Processing line: ~ [1018, 4575, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [1018, 4575, 64, 64], +** Processing line: ~ [957, 4606, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def relative_path~ + [957, 4606, 64, 64], +** Processing line: ~ [960, 4575, 64, 64],~ - Inside source: true *** True Line Result - def relative_path -** Processing line: ~ (File.dirname $gtk.binary_path)~ + [960, 4575, 64, 64], +** Processing line: ~ [918, 4602, 64, 64],~ - Inside source: true *** True Line Result - (File.dirname $gtk.binary_path) -** Processing line: ~ end~ + [918, 4602, 64, 64], +** Processing line: ~ [918, 4580, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [918, 4580, 64, 64], +** Processing line: ~ [394, 4164, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def package_command~ + [394, 4164, 64, 64], +** Processing line: ~ [335, 4163, 64, 64],~ - Inside source: true *** True Line Result - def package_command -** Processing line: ~ "#{File.join $gtk.get_base_dir, 'dragonruby-publish'}"~ + [335, 4163, 64, 64], +** Processing line: ~ [274, 4161, 64, 64],~ - Inside source: true *** True Line Result - "#{File.join $gtk.get_base_dir, 'dragonruby-publish'}" -** Processing line: ~ end~ + [274, 4161, 64, 64], +** Processing line: ~ [236, 4163, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [236, 4163, 64, 64], +** Processing line: ~ [394, 4140, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def deploy~ + [394, 4140, 64, 64], +** Processing line: ~ [329, 4139, 64, 64],~ - Inside source: true *** True Line Result - def deploy -** Processing line: ~ log_info "* Running dragonruby-publish: #{package_command}"~ + [329, 4139, 64, 64], +** Processing line: ~ [268, 4139, 64, 64],~ - Inside source: true *** True Line Result - log_info "* Running dragonruby-publish: #{package_command}" -** Processing line: ~ results = $gtk.exec package_command~ + [268, 4139, 64, 64], +** Processing line: ~ [239, 4139, 64, 64],~ - Inside source: true *** True Line Result - results = $gtk.exec package_command -** Processing line: ~ log "#+begin_src"~ + [239, 4139, 64, 64], +** Processing line: ~ [4326, 5073, 64, 64],~ - Inside source: true *** True Line Result - log "#+begin_src" -** Processing line: ~ log results~ + [4326, 5073, 64, 64], +** Processing line: ~ [4324, 5042, 64, 64],~ - Inside source: true *** True Line Result - log results -** Processing line: ~ log "#+end_src"~ + [4324, 5042, 64, 64], +** Processing line: ~ [4265, 5074, 64, 64],~ - Inside source: true *** True Line Result - log "#+end_src" -** Processing line: ~ :success~ + [4265, 5074, 64, 64], +** Processing line: ~ [4263, 5042, 64, 64],~ - Inside source: true *** True Line Result - :success -** Processing line: ~ end~ + [4263, 5042, 64, 64], +** Processing line: ~ [4214, 5072, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [4214, 5072, 64, 64], +** Processing line: ~ [4211, 5043, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def start~ + [4211, 5043, 64, 64], +** Processing line: ~ [4166, 5073, 64, 64],~ - Inside source: true *** True Line Result - def start -** Processing line: ~ log "================"~ + [4166, 5073, 64, 64], +** Processing line: ~ [4164, 5041, 64, 64],~ - Inside source: true *** True Line Result - log "================" -** Processing line: ~ log "* INFO: Starting Itch Wizard."~ + [4164, 5041, 64, 64], +** Processing line: ~ [4844, 5216, 64, 64],~ - Inside source: true *** True Line Result - log "* INFO: Starting Itch Wizard." -** Processing line: ~ @start_at = Kernel.global_tick_count~ + [4844, 5216, 64, 64], +** Processing line: ~ [4844, 5189, 64, 64],~ - Inside source: true *** True Line Result - @start_at = Kernel.global_tick_count -** Processing line: ~ steps.each do |m|~ + [4844, 5189, 64, 64], +** Processing line: ~ [4785, 5217, 64, 64],~ - Inside source: true *** True Line Result - steps.each do |m| -** Processing line: ~ begin~ + [4785, 5217, 64, 64], +** Processing line: ~ [4790, 5187, 64, 64],~ - Inside source: true *** True Line Result - begin -** Processing line: ~ log_info "Running Itch Wizard Step: ~$wizards.itch.#{m}~"~ + [4790, 5187, 64, 64], +** Processing line: ~ [4726, 5219, 64, 64],~ - 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~ + [4726, 5219, 64, 64], +** Processing line: ~ [4728, 5185, 64, 64],~ - Inside source: true *** True Line Result - result = (send m) || :success if @wizard_status[m][:result] != :success -** Processing line: ~ @wizard_status[m][:result] = result~ + [4728, 5185, 64, 64], +** Processing line: ~ [4681, 5218, 64, 64],~ - Inside source: true *** True Line Result - @wizard_status[m][:result] = result -** Processing line: ~ if result != :success~ + [4681, 5218, 64, 64], +** Processing line: ~ [4684, 5186, 64, 64],~ - Inside source: true *** True Line Result - if result != :success -** Processing line: ~ log_info "Exiting wizard. :#{result}"~ + [4684, 5186, 64, 64], +** Processing line: ~ [4789, 4926, 64, 64],~ - Inside source: true *** True Line Result - log_info "Exiting wizard. :#{result}" -** Processing line: ~ break~ + [4789, 4926, 64, 64], +** Processing line: ~ [4734, 4928, 64, 64],~ - Inside source: true *** True Line Result - break -** Processing line: ~ end~ + [4734, 4928, 64, 64], +** Processing line: ~ [4787, 4876, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + [4787, 4876, 64, 64], +** Processing line: ~ [4738, 4874, 64, 64],~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ if e.is_a? WizardException~ + [4738, 4874, 64, 64], +** Processing line: ~ [4775, 5548, 64, 64],~ - Inside source: true *** True Line Result - if e.is_a? WizardException -** Processing line: ~ $console.log.clear~ + [4775, 5548, 64, 64], +** Processing line: ~ [4775, 5495, 64, 64],~ - Inside source: true *** True Line Result - $console.log.clear -** Processing line: ~ $console.archived_log.clear~ + [4775, 5495, 64, 64], +** Processing line: ~ [4723, 5550, 64, 64],~ - Inside source: true *** True Line Result - $console.archived_log.clear -** Processing line: ~ log "=" * $console.console_text_width~ + [4723, 5550, 64, 64], +** Processing line: ~ [4725, 5494, 64, 64],~ - Inside source: true *** True Line Result - log "=" * $console.console_text_width -** Processing line: ~ e.console_primitives.each do |p|~ + [4725, 5494, 64, 64], +** Processing line: ~ [1360, 5269, 64, 64],~ - Inside source: true *** True Line Result - e.console_primitives.each do |p| -** Processing line: ~ $console.add_primitive p~ + [1360, 5269, 64, 64], +** Processing line: ~ [1362, 5218, 64, 64],~ - Inside source: true *** True Line Result - $console.add_primitive p -** Processing line: ~ end~ + [1362, 5218, 64, 64], +** Processing line: ~ [1315, 5266, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ log "=" * $console.console_text_width~ + [1315, 5266, 64, 64], +** Processing line: ~ [1282, 5266, 64, 64],~ - Inside source: true *** True Line Result - log "=" * $console.console_text_width -** Processing line: ~ $console.set_command (e.console_command || "$wizards.itch.start")~ + [1282, 5266, 64, 64], +** Processing line: ~ [1246, 5311, 64, 64],~ - Inside source: true *** True Line Result - $console.set_command (e.console_command || "$wizards.itch.start") -** Processing line: ~ else~ + [1246, 5311, 64, 64], +** Processing line: ~ [1190, 5312, 64, 64],~ - Inside source: true *** True Line Result - else -** Processing line: ~ log_error "Step #{m} failed."~ + [1190, 5312, 64, 64], +** Processing line: ~ [1136, 5310, 64, 64],~ - Inside source: true *** True Line Result - log_error "Step #{m} failed." -** Processing line: ~ log_error e.to_s~ + [1136, 5310, 64, 64], +** Processing line: ~ [1121, 5427, 64, 64],~ - Inside source: true *** True Line Result - log_error e.to_s -** Processing line: ~ $console.set_command "$wizards.itch.start"~ + [1121, 5427, 64, 64], +** Processing line: ~ [1121, 5370, 64, 64],~ - Inside source: true *** True Line Result - $console.set_command "$wizards.itch.start" -** Processing line: ~ end~ + [1121, 5370, 64, 64], +** Processing line: ~ [1074, 5427, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [1074, 5427, 64, 64], +** Processing line: ~ [1064, 5423, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ break~ + [1064, 5423, 64, 64], +** Processing line: ~ [1052, 5417, 64, 64],~ - Inside source: true *** True Line Result - break -** Processing line: ~ end~ + [1052, 5417, 64, 64], +** Processing line: ~ [1050, 5368, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [1050, 5368, 64, 64], +** Processing line: ~ [1008, 5314, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [1008, 5314, 64, 64], +** Processing line: ~ [997, 5307, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [997, 5307, 64, 64], +** Processing line: ~ [977, 5299, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def reset~ + [977, 5299, 64, 64], +** Processing line: ~ [976, 5248, 64, 64],~ - Inside source: true *** True Line Result - def reset -** Processing line: ~ @dev_id = nil~ + [976, 5248, 64, 64], +** Processing line: ~ [825, 5267, 64, 64],~ - Inside source: true *** True Line Result - @dev_id = nil -** Processing line: ~ @dev_title = nil~ + [825, 5267, 64, 64], +** Processing line: ~ [826, 5213, 64, 64],~ - Inside source: true *** True Line Result - @dev_title = nil -** Processing line: ~ @game_id = nil~ + [826, 5213, 64, 64], +** Processing line: ~ [776, 5267, 64, 64],~ - Inside source: true *** True Line Result - @game_id = nil -** Processing line: ~ @game_title = nil~ + [776, 5267, 64, 64], +** Processing line: ~ [768, 5261, 64, 64],~ - Inside source: true *** True Line Result - @game_title = nil -** Processing line: ~ @version = nil~ + [768, 5261, 64, 64], +** Processing line: ~ [755, 5256, 64, 64],~ - Inside source: true *** True Line Result - @version = nil -** Processing line: ~ @icon = nil~ + [755, 5256, 64, 64], +** Processing line: ~ [753, 5209, 64, 64],~ - Inside source: true *** True Line Result - @icon = nil -** Processing line: ~ init_wizard_status~ + [753, 5209, 64, 64], +** Processing line: ~ [1299, 5206, 64, 64],~ - Inside source: true *** True Line Result - init_wizard_status -** Processing line: ~ end~ + [1299, 5206, 64, 64], +** Processing line: ~ [1238, 5204, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [1238, 5204, 64, 64], +** Processing line: ~ [1178, 5203, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def restart~ + [1178, 5203, 64, 64], +** Processing line: ~ [1124, 5204, 64, 64],~ - Inside source: true *** True Line Result - def restart -** Processing line: ~ reset~ + [1124, 5204, 64, 64], +** Processing line: ~ [1065, 5206, 64, 64],~ - Inside source: true *** True Line Result - reset -** Processing line: ~ start~ + [1065, 5206, 64, 64], +** Processing line: ~ [1008, 5203, 64, 64],~ - Inside source: true *** True Line Result - start -** Processing line: ~ end~ + [1008, 5203, 64, 64], +** Processing line: ~ [977, 5214, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [977, 5214, 64, 64], +** Processing line: ~ [410, 5313, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize~ + [410, 5313, 64, 64], +** Processing line: ~ [407, 5249, 64, 64],~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ reset~ + [407, 5249, 64, 64], +** Processing line: ~ [411, 5225, 64, 64],~ - Inside source: true *** True Line Result - reset -** Processing line: ~ end~ + [411, 5225, 64, 64], +** Processing line: ~ [397, 5217, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [397, 5217, 64, 64], +** Processing line: ~ [378, 5209, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def init_wizard_status~ + [378, 5209, 64, 64], +** Processing line: ~ [358, 5312, 64, 64],~ - Inside source: true *** True Line Result - def init_wizard_status -** Processing line: ~ @wizard_status = {}~ + [358, 5312, 64, 64], +** Processing line: ~ [287, 5427, 64, 64],~ - Inside source: true *** True Line Result - @wizard_status = {} -** Processing line: ~~ + [287, 5427, 64, 64], +** Processing line: ~ [286, 5364, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ steps.each do |m|~ + [286, 5364, 64, 64], +** Processing line: ~ [300, 5313, 64, 64],~ - Inside source: true *** True Line Result - steps.each do |m| -** Processing line: ~ @wizard_status[m] = { result: :not_started }~ + [300, 5313, 64, 64], +** Processing line: ~ [242, 5427, 64, 64],~ - Inside source: true *** True Line Result - @wizard_status[m] = { result: :not_started } -** Processing line: ~ end~ + [242, 5427, 64, 64], +** Processing line: ~ [229, 5420, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [229, 5420, 64, 64], +** Processing line: ~ [217, 5416, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ previous_step = nil~ + [217, 5416, 64, 64], +** Processing line: ~ [215, 5364, 64, 64],~ - Inside source: true *** True Line Result - previous_step = nil -** Processing line: ~ next_step = nil~ + [215, 5364, 64, 64], +** Processing line: ~ [174, 5311, 64, 64],~ - Inside source: true *** True Line Result - next_step = nil -** Processing line: ~~ + [174, 5311, 64, 64], +** Processing line: ~ [165, 5308, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ steps.each_cons(2) do |current_step, next_step|~ + [165, 5308, 64, 64], +** Processing line: ~ [139, 5300, 64, 64],~ - Inside source: true *** True Line Result - steps.each_cons(2) do |current_step, next_step| -** Processing line: ~ @wizard_status[current_step][:next_step] = next_step~ + [139, 5300, 64, 64], +** Processing line: ~ [141, 5236, 64, 64],~ - Inside source: true *** True Line Result - @wizard_status[current_step][:next_step] = next_step -** Processing line: ~ end~ + [141, 5236, 64, 64], +** Processing line: ~ [141, 5211, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [141, 5211, 64, 64], +** Processing line: ~ [315, 5208, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ steps.reverse.each_cons(2) do |current_step, previous_step|~ + [315, 5208, 64, 64], +** Processing line: ~ [251, 5208, 64, 64],~ - Inside source: true *** True Line Result - steps.reverse.each_cons(2) do |current_step, previous_step| -** Processing line: ~ @wizard_status[current_step][:previous_step] = previous_step~ + [251, 5208, 64, 64], +** Processing line: ~ [211, 5211, 64, 64],~ - Inside source: true *** True Line Result - @wizard_status[current_step][:previous_step] = previous_step -** Processing line: ~ end~ + [211, 5211, 64, 64], +** Processing line: ~ [8050, 4060, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [8050, 4060, 64, 64], +** Processing line: ~ [7992, 4060, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [7992, 4060, 64, 64], +** Processing line: ~ [7929, 4060, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7929, 4060, 64, 64], +** Processing line: ~ [7866, 4061, 64, 64],~ - 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: ~* layout.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* layout.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/layout.rb~ + [7866, 4061, 64, 64], +** Processing line: ~ [7828, 4063, 64, 64],~ - Inside source: true *** True Line Result - # ./dragon/layout.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + [7828, 4063, 64, 64], +** Processing line: ~ [7934, 4001, 64, 64],~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + [7934, 4001, 64, 64], +** Processing line: ~ [7935, 3936, 64, 64],~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # layout.rb has been released under MIT (*only this file*).~ + [7935, 3936, 64, 64], +** Processing line: ~ [7935, 3875, 64, 64],~ - Inside source: true *** True Line Result - # layout.rb has been released under MIT (*only this file*). -** Processing line: ~~ + [7935, 3875, 64, 64], +** Processing line: ~ [7622, 4111, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + [7622, 4111, 64, 64], +** Processing line: ~ [7623, 4049, 64, 64],~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Margin~ + [7623, 4049, 64, 64], +** Processing line: ~ [7707, 4018, 64, 64],~ - Inside source: true *** True Line Result - class Margin -** Processing line: ~ attr :left, :right, :top, :bottom~ + [7707, 4018, 64, 64], +** Processing line: ~ [7663, 4019, 64, 64],~ - Inside source: true *** True Line Result - attr :left, :right, :top, :bottom -** Processing line: ~~ + [7663, 4019, 64, 64], +** Processing line: ~ [7623, 4017, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize~ + [7623, 4017, 64, 64], +** Processing line: ~ [7193, 4060, 64, 64],~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @left = 0~ + [7193, 4060, 64, 64], +** Processing line: ~ [7131, 4059, 64, 64],~ - Inside source: true *** True Line Result - @left = 0 -** Processing line: ~ @right = 0~ + [7131, 4059, 64, 64], +** Processing line: ~ [7070, 4057, 64, 64],~ - Inside source: true *** True Line Result - @right = 0 -** Processing line: ~ @top = 0~ + [7070, 4057, 64, 64], +** Processing line: ~ [7008, 4060, 64, 64],~ - Inside source: true *** True Line Result - @top = 0 -** Processing line: ~ @bottom = 0~ + [7008, 4060, 64, 64], +** Processing line: ~ [6977, 4060, 64, 64],~ - Inside source: true *** True Line Result - @bottom = 0 -** Processing line: ~ end~ + [6977, 4060, 64, 64], +** Processing line: ~ [7080, 3998, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7080, 3998, 64, 64], +** Processing line: ~ [7081, 3935, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def serialize~ + [7081, 3935, 64, 64], +** Processing line: ~ [7080, 3873, 64, 64],~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ {~ + [7080, 3873, 64, 64], +** Processing line: ~ [6855, 4019, 64, 64],~ - Inside source: true *** True Line Result - { -** Processing line: ~ left: @left,~ + [6855, 4019, 64, 64], +** Processing line: ~ [6790, 4018, 64, 64],~ - Inside source: true *** True Line Result - left: @left, -** Processing line: ~ right: @right,~ + [6790, 4018, 64, 64], +** Processing line: ~ [6770, 4114, 64, 64],~ - Inside source: true *** True Line Result - right: @right, -** Processing line: ~ top: @top,~ + [6770, 4114, 64, 64], +** Processing line: ~ [6770, 4060, 64, 64],~ - Inside source: true *** True Line Result - top: @top, -** Processing line: ~ bottom: @bottom,~ + [6770, 4060, 64, 64], +** Processing line: ~ [6768, 4013, 64, 64],~ - Inside source: true *** True Line Result - bottom: @bottom, -** Processing line: ~ }~ + [6768, 4013, 64, 64], +** Processing line: ~ [6345, 4060, 64, 64],~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [6345, 4060, 64, 64], +** Processing line: ~ [6284, 4062, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6284, 4062, 64, 64], +** Processing line: ~ [6222, 4061, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def inspect~ + [6222, 4061, 64, 64], +** Processing line: ~ [6166, 4061, 64, 64],~ - Inside source: true *** True Line Result - def inspect -** Processing line: ~ serialize.to_s~ + [6166, 4061, 64, 64], +** Processing line: ~ [6124, 4066, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [6124, 4066, 64, 64], +** Processing line: ~ [6226, 3995, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6226, 3995, 64, 64], +** Processing line: ~ [6226, 3933, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def to_s~ + [6226, 3933, 64, 64], +** Processing line: ~ [6228, 3868, 64, 64],~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ serialize.to_s~ + [6228, 3868, 64, 64], +** Processing line: ~ [5916, 4113, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [5916, 4113, 64, 64], +** Processing line: ~ [5918, 4052, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [5918, 4052, 64, 64], +** Processing line: ~ [6001, 4018, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6001, 4018, 64, 64], +** Processing line: ~ [5941, 4019, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ class SafeArea~ + [5941, 4019, 64, 64], +** Processing line: ~ [5918, 4020, 64, 64],~ - Inside source: true *** True Line Result - class SafeArea -** Processing line: ~ attr :w, :h, :margin~ + [5918, 4020, 64, 64], +** Processing line: ~ [5501, 4059, 64, 64],~ - Inside source: true *** True Line Result - attr :w, :h, :margin -** Processing line: ~~ + [5501, 4059, 64, 64], +** Processing line: ~ [5439, 4061, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize~ + [5439, 4061, 64, 64], +** Processing line: ~ [5376, 4059, 64, 64],~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @w = 0~ + [5376, 4059, 64, 64], +** Processing line: ~ [5312, 4058, 64, 64],~ - Inside source: true *** True Line Result - @w = 0 -** Processing line: ~ @h = 0~ + [5312, 4058, 64, 64], +** Processing line: ~ [5285, 4062, 64, 64],~ - Inside source: true *** True Line Result - @h = 0 -** Processing line: ~ @margin = Margin.new~ + [5285, 4062, 64, 64], +** Processing line: ~ [5388, 3999, 64, 64],~ - Inside source: true *** True Line Result - @margin = Margin.new -** Processing line: ~ end~ + [5388, 3999, 64, 64], +** Processing line: ~ [5385, 3941, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [5385, 3941, 64, 64], +** Processing line: ~ [5384, 3874, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def serialize~ + [5384, 3874, 64, 64], +** Processing line: ~ [5075, 4112, 64, 64],~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ {~ + [5075, 4112, 64, 64], +** Processing line: ~ [5074, 4051, 64, 64],~ - Inside source: true *** True Line Result - { -** Processing line: ~ w: @w,~ + [5074, 4051, 64, 64], +** Processing line: ~ [5158, 4018, 64, 64],~ - Inside source: true *** True Line Result - w: @w, -** Processing line: ~ h: @h,~ + [5158, 4018, 64, 64], +** Processing line: ~ [5095, 4020, 64, 64],~ - Inside source: true *** True Line Result - h: @h, -** Processing line: ~ margin: @margin.serialize~ + [5095, 4020, 64, 64], +** Processing line: ~ [5073, 4018, 64, 64],~ - Inside source: true *** True Line Result - margin: @margin.serialize -** Processing line: ~ }~ + [5073, 4018, 64, 64], +** Processing line: ~ [4549, 3998, 64, 64],~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [4549, 3998, 64, 64], +** Processing line: ~ [4393, 3996, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [4393, 3996, 64, 64], +** Processing line: ~ [4547, 3938, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def inspect~ + [4547, 3938, 64, 64], +** Processing line: ~ [4547, 3886, 64, 64],~ - Inside source: true *** True Line Result - def inspect -** Processing line: ~ serialize.to_s~ + [4547, 3886, 64, 64], +** Processing line: ~ [4488, 3885, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [4488, 3885, 64, 64], +** Processing line: ~ [4427, 3885, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [4427, 3885, 64, 64], +** Processing line: ~ [4395, 3938, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def to_s~ + [4395, 3938, 64, 64], +** Processing line: ~ [4395, 3885, 64, 64],~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ serialize.to_s~ + [4395, 3885, 64, 64], +** Processing line: ~ [0, 0, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [0, 0, 64, 64], +** Processing line: ~ [0, 1670, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [0, 1670, 64, 64], +** Processing line: ~ [6691, 1653, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6691, 1653, 64, 64], +** Processing line: ~ [1521, 3792, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ class GridArea~ + [1521, 3792, 64, 64], +** Processing line: ~ [0, 5137, 64, 64],~ - Inside source: true *** True Line Result - class GridArea -** Processing line: ~ attr :w, :h, :margin, :gutter, :col_count, :row_count, :cell_w, :cell_h, :outer_gutter~ + [0, 5137, 64, 64], +** Processing line: ~ [0, 0, 64, 64],~ - Inside source: true *** True Line Result - attr :w, :h, :margin, :gutter, :col_count, :row_count, :cell_w, :cell_h, :outer_gutter -** Processing line: ~~ + [0, 0, 64, 64], +** Processing line: ~ [0, 1670, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize~ + [0, 1670, 64, 64], +** Processing line: ~ [6691, 1653, 64, 64],~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @w = 0~ + [6691, 1653, 64, 64], +** Processing line: ~ [1521, 3792, 64, 64],~ - Inside source: true *** True Line Result - @w = 0 -** Processing line: ~ @h = 0~ + [1521, 3792, 64, 64], +** Processing line: ~ [0, 5137, 64, 64],~ - Inside source: true *** True Line Result - @h = 0 -** Processing line: ~ @gutter = 0~ + [0, 5137, 64, 64], +** Processing line: ~ [1215, 2421, 64, 64],~ - Inside source: true *** True Line Result - @gutter = 0 -** Processing line: ~ @outer_gutter = 0~ + [1215, 2421, 64, 64], +** Processing line: ~ [1214, 2360, 64, 64],~ - Inside source: true *** True Line Result - @outer_gutter = 0 -** Processing line: ~ @col_count = 0~ + [1214, 2360, 64, 64], +** Processing line: ~ [1211, 2300, 64, 64],~ - Inside source: true *** True Line Result - @col_count = 0 -** Processing line: ~ @row_count = 0~ + [1211, 2300, 64, 64], +** Processing line: ~ [1211, 2291, 64, 64],~ - Inside source: true *** True Line Result - @row_count = 0 -** Processing line: ~ @margin = Margin.new~ + [1211, 2291, 64, 64], +** Processing line: ~ [1158, 2420, 64, 64],~ - Inside source: true *** True Line Result - @margin = Margin.new -** Processing line: ~ end~ + [1158, 2420, 64, 64], +** Processing line: ~ [1156, 2358, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [1156, 2358, 64, 64], +** Processing line: ~ [1149, 2291, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def serialize~ + [1149, 2291, 64, 64], +** Processing line: ~ [1095, 2420, 64, 64],~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ {~ + [1095, 2420, 64, 64], +** Processing line: ~ [1030, 2418, 64, 64],~ - Inside source: true *** True Line Result - { -** Processing line: ~ w: @w,~ + [1030, 2418, 64, 64], +** Processing line: ~ [966, 2419, 64, 64],~ - Inside source: true *** True Line Result - w: @w, -** Processing line: ~ h: @h,~ + [966, 2419, 64, 64], +** Processing line: ~ [903, 2419, 64, 64],~ - Inside source: true *** True Line Result - h: @h, -** Processing line: ~ gutter: @gutter,~ + [903, 2419, 64, 64], +** Processing line: ~ [852, 2419, 64, 64],~ - Inside source: true *** True Line Result - gutter: @gutter, -** Processing line: ~ outer_gutter: @outer_gutter,~ + [852, 2419, 64, 64], +** Processing line: ~ [1087, 2291, 64, 64],~ - Inside source: true *** True Line Result - outer_gutter: @outer_gutter, -** Processing line: ~ col_count: @col_count,~ + [1087, 2291, 64, 64], +** Processing line: ~ [1023, 2291, 64, 64],~ - Inside source: true *** True Line Result - col_count: @col_count, -** Processing line: ~ row_count: @row_count,~ + [1023, 2291, 64, 64], +** Processing line: ~ [960, 2291, 64, 64],~ - Inside source: true *** True Line Result - row_count: @row_count, -** Processing line: ~ margin: @margin.serialize~ + [960, 2291, 64, 64], +** Processing line: ~ [896, 2292, 64, 64],~ - Inside source: true *** True Line Result - margin: @margin.serialize -** Processing line: ~ }~ + [896, 2292, 64, 64], +** Processing line: ~ [854, 2355, 64, 64],~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [854, 2355, 64, 64], +** Processing line: ~ [854, 2292, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [854, 2292, 64, 64], +** Processing line: ~ [675, 3017, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def inspect~ + [675, 3017, 64, 64], +** Processing line: ~ [622, 3017, 64, 64],~ - Inside source: true *** True Line Result - def inspect -** Processing line: ~ serialize.to_s~ + [622, 3017, 64, 64], +** Processing line: ~ [676, 2965, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [676, 2965, 64, 64], +** Processing line: ~ [622, 2965, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [622, 2965, 64, 64], +** Processing line: ~ [1560, 3212, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def to_s~ + [1560, 3212, 64, 64], +** Processing line: ~ [1496, 3212, 64, 64],~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ serialize.to_s~ + [1496, 3212, 64, 64], +** Processing line: ~ [1430, 3211, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [1430, 3211, 64, 64], +** Processing line: ~ [1346, 3214, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [1346, 3214, 64, 64], +** Processing line: ~ [1410, 3213, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [1410, 3213, 64, 64], +** Processing line: ~ [1560, 3147, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ class ControlArea~ + [1560, 3147, 64, 64], +** Processing line: ~ [1559, 3105, 64, 64],~ - Inside source: true *** True Line Result - class ControlArea -** Processing line: ~ attr :cell_size, :w, :h, :margin~ + [1559, 3105, 64, 64], +** Processing line: ~ [1496, 3105, 64, 64],~ - Inside source: true *** True Line Result - attr :cell_size, :w, :h, :margin -** Processing line: ~~ + [1496, 3105, 64, 64], +** Processing line: ~ [1442, 3105, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize~ + [1442, 3105, 64, 64], +** Processing line: ~ [1412, 3106, 64, 64],~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @margin = Margin.new~ + [1412, 3106, 64, 64], +** Processing line: ~ [918, 4163, 64, 64],~ - Inside source: true *** True Line Result - @margin = Margin.new -** Processing line: ~ end~ + [918, 4163, 64, 64], +** Processing line: ~ [854, 4161, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [854, 4161, 64, 64], +** Processing line: ~ [792, 4160, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def serialize~ + [792, 4160, 64, 64], +** Processing line: ~ [729, 4159, 64, 64],~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ {~ + [729, 4159, 64, 64], +** Processing line: ~ [666, 4158, 64, 64],~ - Inside source: true *** True Line Result - { -** Processing line: ~ cell_size: @cell_size,~ + [666, 4158, 64, 64], +** Processing line: ~ [601, 4158, 64, 64],~ - Inside source: true *** True Line Result - cell_size: @cell_size, -** Processing line: ~ w: @w,~ + [601, 4158, 64, 64], +** Processing line: ~ [537, 4156, 64, 64],~ - Inside source: true *** True Line Result - w: @w, -** Processing line: ~ h: @h,~ + [537, 4156, 64, 64], +** Processing line: ~ [918, 4137, 64, 64],~ - Inside source: true *** True Line Result - h: @h, -** Processing line: ~ margin: @margin.serialize,~ + [918, 4137, 64, 64], +** Processing line: ~ [854, 4137, 64, 64],~ - Inside source: true *** True Line Result - margin: @margin.serialize, -** Processing line: ~ }~ + [854, 4137, 64, 64], +** Processing line: ~ [789, 4136, 64, 64],~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [789, 4136, 64, 64], +** Processing line: ~ [726, 4137, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [726, 4137, 64, 64], +** Processing line: ~ [661, 4137, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def inspect~ + [661, 4137, 64, 64], +** Processing line: ~ [599, 4139, 64, 64],~ - Inside source: true *** True Line Result - def inspect -** Processing line: ~ serialize.to_s~ + [599, 4139, 64, 64], +** Processing line: ~ [538, 4137, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [538, 4137, 64, 64], +** Processing line: ~ [5378, 4254, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [5378, 4254, 64, 64], +** Processing line: ~ [5440, 4204, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def to_s~ + [5440, 4204, 64, 64], +** Processing line: ~ [5405, 4214, 64, 64],~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ serialize.to_s~ + [5405, 4214, 64, 64], +** Processing line: ~ [5350, 4254, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [5350, 4254, 64, 64], +** Processing line: ~ [5439, 4177, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [5439, 4177, 64, 64], +** Processing line: ~ [5413, 4173, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [5413, 4173, 64, 64], +** Processing line: ~ [5399, 4128, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ class Device~ + [5399, 4128, 64, 64], +** Processing line: ~ [5352, 4200, 64, 64],~ - Inside source: true *** True Line Result - class Device -** Processing line: ~ attr :w, :h, :safe_area, :grid_area, :control_area, :name, :aspect~ + [5352, 4200, 64, 64], +** Processing line: ~ [5352, 4158, 64, 64],~ - Inside source: true *** True Line Result - attr :w, :h, :safe_area, :grid_area, :control_area, :name, :aspect -** Processing line: ~~ + [5352, 4158, 64, 64], +** Processing line: ~ [5392, 4130, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize~ + [5392, 4130, 64, 64], +** Processing line: ~ [6216, 4251, 64, 64],~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @name = ""~ + [6216, 4251, 64, 64], +** Processing line: ~ [6190, 4251, 64, 64],~ - Inside source: true *** True Line Result - @name = "" -** Processing line: ~ @w = 0~ + [6190, 4251, 64, 64], +** Processing line: ~ [6279, 4200, 64, 64],~ - Inside source: true *** True Line Result - @w = 0 -** Processing line: ~ @h = 0~ + [6279, 4200, 64, 64], +** Processing line: ~ [6262, 4205, 64, 64],~ - Inside source: true *** True Line Result - @h = 0 -** Processing line: ~ @safe_area = SafeArea.new~ + [6262, 4205, 64, 64], +** Processing line: ~ [6233, 4214, 64, 64],~ - Inside source: true *** True Line Result - @safe_area = SafeArea.new -** Processing line: ~ @grid_area = GridArea.new~ + [6233, 4214, 64, 64], +** Processing line: ~ [6280, 4172, 64, 64],~ - Inside source: true *** True Line Result - @grid_area = GridArea.new -** Processing line: ~ @control_area = ControlArea.new~ + [6280, 4172, 64, 64], +** Processing line: ~ [6256, 4169, 64, 64],~ - Inside source: true *** True Line Result - @control_area = ControlArea.new -** Processing line: ~ @aspect = AspectRatio.new~ + [6256, 4169, 64, 64], +** Processing line: ~ [6239, 4128, 64, 64],~ - Inside source: true *** True Line Result - @aspect = AspectRatio.new -** Processing line: ~ end~ + [6239, 4128, 64, 64], +** Processing line: ~ [6231, 4128, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6231, 4128, 64, 64], +** Processing line: ~ [6191, 4195, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def assert! result, message~ + [6191, 4195, 64, 64], +** Processing line: ~ [6190, 4158, 64, 64],~ - Inside source: true *** True Line Result - def assert! result, message -** Processing line: ~ return if result~ + [6190, 4158, 64, 64], +** Processing line: ~ [7072, 4250, 64, 64],~ - Inside source: true *** True Line Result - return if result -** Processing line: ~ raise message~ + [7072, 4250, 64, 64], +** Processing line: ~ [7046, 4250, 64, 64],~ - Inside source: true *** True Line Result - raise message -** Processing line: ~ end~ + [7046, 4250, 64, 64], +** Processing line: ~ [7133, 4202, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7133, 4202, 64, 64], +** Processing line: ~ [7107, 4209, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def check_math!~ + [7107, 4209, 64, 64], +** Processing line: ~ [7086, 4214, 64, 64],~ - Inside source: true *** True Line Result - def check_math! -** Processing line: ~ assert! (@control_area.w + @control_area.margin.left + @control_area.margin.right) == @w, "Math for Width didn't pan out."~ + [7086, 4214, 64, 64], +** Processing line: ~ [7133, 4173, 64, 64],~ - Inside source: true *** True Line Result - assert! (@control_area.w + @control_area.margin.left + @control_area.margin.right) == @w, "Math for Width didn't pan out." -** Processing line: ~ assert! (@control_area.h + @control_area.margin.top + @control_area.margin.bottom) == @h, "Math for Height didn't pan out."~ + [7133, 4173, 64, 64], +** Processing line: ~ [7108, 4169, 64, 64],~ - Inside source: true *** True Line Result - assert! (@control_area.h + @control_area.margin.top + @control_area.margin.bottom) == @h, "Math for Height didn't pan out." -** Processing line: ~ end~ + [7108, 4169, 64, 64], +** Processing line: ~ [7092, 4127, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7092, 4127, 64, 64], +** Processing line: ~ [7084, 4128, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def serialize~ + [7084, 4128, 64, 64], +** Processing line: ~ [7047, 4191, 64, 64],~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ {~ + [7047, 4191, 64, 64], +** Processing line: ~ [7047, 4156, 64, 64],~ - Inside source: true *** True Line Result - { -** Processing line: ~ name: @name,~ + [7047, 4156, 64, 64], +** Processing line: ~ [7926, 4252, 64, 64],~ - Inside source: true *** True Line Result - name: @name, -** Processing line: ~ w: @w,~ + [7926, 4252, 64, 64], +** Processing line: ~ [7900, 4253, 64, 64],~ - Inside source: true *** True Line Result - w: @w, -** Processing line: ~ h: @h,~ + [7900, 4253, 64, 64], +** Processing line: ~ [7987, 4202, 64, 64],~ - Inside source: true *** True Line Result - h: @h, -** Processing line: ~ aspect: @aspect.serialize,~ + [7987, 4202, 64, 64], +** Processing line: ~ [7965, 4209, 64, 64],~ - Inside source: true *** True Line Result - aspect: @aspect.serialize, -** Processing line: ~ safe_area: @safe_area.serialize,~ + [7965, 4209, 64, 64], +** Processing line: ~ [7942, 4216, 64, 64],~ - Inside source: true *** True Line Result - safe_area: @safe_area.serialize, -** Processing line: ~ grid_area: @grid_area.serialize,~ + [7942, 4216, 64, 64], +** Processing line: ~ [7989, 4174, 64, 64],~ - Inside source: true *** True Line Result - grid_area: @grid_area.serialize, -** Processing line: ~ control_area: @control_area.serialize~ + [7989, 4174, 64, 64], +** Processing line: ~ [7970, 4170, 64, 64],~ - Inside source: true *** True Line Result - control_area: @control_area.serialize -** Processing line: ~ }~ + [7970, 4170, 64, 64], +** Processing line: ~ [7949, 4126, 64, 64],~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [7949, 4126, 64, 64], +** Processing line: ~ [7901, 4196, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7901, 4196, 64, 64], +** Processing line: ~ [7900, 4159, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def inspect~ + [7900, 4159, 64, 64], +** Processing line: ~ [7941, 4130, 64, 64],~ - Inside source: true *** True Line Result - def inspect -** Processing line: ~ serialize.to_s~ + [7941, 4130, 64, 64], +** Processing line: ~ [2847, 379, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [2847, 379, 64, 64], +** Processing line: ~ [2825, 380, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2825, 380, 64, 64], +** Processing line: ~ [2845, 317, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def to_s~ + [2845, 317, 64, 64], +** Processing line: ~ [2829, 316, 64, 64],~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ serialize.to_s~ + [2829, 316, 64, 64], +** Processing line: ~ [2845, 255, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [2845, 255, 64, 64], +** Processing line: ~ [2830, 257, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [2830, 257, 64, 64], +** Processing line: ~ [2845, 202, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2845, 202, 64, 64], +** Processing line: ~ [2829, 198, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ class AspectRatio~ + [2829, 198, 64, 64], +** Processing line: ~ [2770, 169, 64, 64],~ - Inside source: true *** True Line Result - class AspectRatio -** Processing line: ~ attr :w, :h, :u~ + [2770, 169, 64, 64], +** Processing line: ~ [2708, 170, 64, 64],~ - Inside source: true *** True Line Result - attr :w, :h, :u -** Processing line: ~~ + [2708, 170, 64, 64], +** Processing line: ~ [2646, 171, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize~ + [2646, 171, 64, 64], +** Processing line: ~ [2582, 171, 64, 64],~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @w = 0~ + [2582, 171, 64, 64], +** Processing line: ~ [2518, 171, 64, 64],~ - Inside source: true *** True Line Result - @w = 0 -** Processing line: ~ @h = 0~ + [2518, 171, 64, 64], +** Processing line: ~ [2454, 171, 64, 64],~ - Inside source: true *** True Line Result - @h = 0 -** Processing line: ~ @u = 0~ + [2454, 171, 64, 64], +** Processing line: ~ [2391, 172, 64, 64],~ - Inside source: true *** True Line Result - @u = 0 -** Processing line: ~ end~ + [2391, 172, 64, 64], +** Processing line: ~ [2332, 379, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2332, 379, 64, 64], +** Processing line: ~ [2315, 379, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def serialize~ + [2315, 379, 64, 64], +** Processing line: ~ [2334, 316, 64, 64],~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ {~ + [2334, 316, 64, 64], +** Processing line: ~ [2315, 317, 64, 64],~ - Inside source: true *** True Line Result - { -** Processing line: ~ w: @w,~ + [2315, 317, 64, 64], +** Processing line: ~ [2332, 254, 64, 64],~ - Inside source: true *** True Line Result - w: @w, -** Processing line: ~ h: @h,~ + [2332, 254, 64, 64], +** Processing line: ~ [2314, 254, 64, 64],~ - Inside source: true *** True Line Result - h: @h, -** Processing line: ~ u: @u~ + [2314, 254, 64, 64], +** Processing line: ~ [2335, 192, 64, 64],~ - Inside source: true *** True Line Result - u: @u -** Processing line: ~ }~ + [2335, 192, 64, 64], +** Processing line: ~ [2311, 192, 64, 64],~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [2311, 192, 64, 64], +** Processing line: ~ [2846, 142, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2846, 142, 64, 64], +** Processing line: ~ [2784, 140, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def inspect~ + [2784, 140, 64, 64], +** Processing line: ~ [2846, 79, 64, 64],~ - Inside source: true *** True Line Result - def inspect -** Processing line: ~ serialize.to_s~ + [2846, 79, 64, 64], +** Processing line: ~ [2847, 41, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [2847, 41, 64, 64], +** Processing line: ~ [2783, 80, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2783, 80, 64, 64], +** Processing line: ~ [2790, 39, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def to_s~ + [2790, 39, 64, 64], +** Processing line: ~ [2727, 41, 64, 64],~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ serialize.to_s~ + [2727, 41, 64, 64], +** Processing line: ~ [2665, 43, 64, 64],~ - Inside source: true *** True Line Result - serialize.to_s -** Processing line: ~ end~ + [2665, 43, 64, 64], +** Processing line: ~ [2605, 43, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [2605, 43, 64, 64], +** Processing line: ~ [2543, 44, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2543, 44, 64, 64], +** Processing line: ~ [2480, 45, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ class Layout~ + [2480, 45, 64, 64], +** Processing line: ~ [2419, 45, 64, 64],~ - Inside source: true *** True Line Result - class Layout -** Processing line: ~ attr :w, :h, :rect_cache~ + [2419, 45, 64, 64], +** Processing line: ~ [2357, 44, 64, 64],~ - Inside source: true *** True Line Result - attr :w, :h, :rect_cache -** Processing line: ~~ + [2357, 44, 64, 64], +** Processing line: ~ [2313, 129, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize w, h~ + [2313, 129, 64, 64], +** Processing line: ~ [2313, 70, 64, 64],~ - Inside source: true *** True Line Result - def initialize w, h -** Processing line: ~ @w = w~ + [2313, 70, 64, 64], +** Processing line: ~ [2314, 40, 64, 64],~ - Inside source: true *** True Line Result - @w = w -** Processing line: ~ @h = h~ + [2314, 40, 64, 64], +** Processing line: ~ [2517, 2385, 64, 64],~ - Inside source: true *** True Line Result - @h = h -** Processing line: ~ @rect_cache = {}~ + [2517, 2385, 64, 64], +** Processing line: ~ [2452, 2385, 64, 64],~ - Inside source: true *** True Line Result - @rect_cache = {} -** Processing line: ~ init_device @w, @h~ + [2452, 2385, 64, 64], +** Processing line: ~ [2390, 2386, 64, 64],~ - Inside source: true *** True Line Result - init_device @w, @h -** Processing line: ~ end~ + [2390, 2386, 64, 64], +** Processing line: ~ [2328, 2386, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2328, 2386, 64, 64], +** Processing line: ~ [2264, 2386, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def u_for_16x9 w, h~ + [2264, 2386, 64, 64], +** Processing line: ~ [2200, 2386, 64, 64],~ - Inside source: true *** True Line Result - def u_for_16x9 w, h -** Processing line: ~ u = (w.fdiv 16).floor~ + [2200, 2386, 64, 64], +** Processing line: ~ [2137, 2387, 64, 64],~ - Inside source: true *** True Line Result - u = (w.fdiv 16).floor -** Processing line: ~ u = (h.fdiv 9).floor if (u * 9) > h~ + [2137, 2387, 64, 64], +** Processing line: ~ [2071, 2385, 64, 64],~ - Inside source: true *** True Line Result - u = (h.fdiv 9).floor if (u * 9) > h -** Processing line: ~~ + [2071, 2385, 64, 64], +** Processing line: ~ [2016, 2389, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ {~ + [2016, 2389, 64, 64], +** Processing line: ~ [2517, 2341, 64, 64],~ - Inside source: true *** True Line Result - { -** Processing line: ~ u: u,~ + [2517, 2341, 64, 64], +** Processing line: ~ [2518, 2316, 64, 64],~ - Inside source: true *** True Line Result - u: u, -** Processing line: ~ w: u * 16,~ + [2518, 2316, 64, 64], +** Processing line: ~ [2456, 2316, 64, 64],~ - Inside source: true *** True Line Result - w: u * 16, -** Processing line: ~ h: u * 9~ + [2456, 2316, 64, 64], +** Processing line: ~ [2393, 2316, 64, 64],~ - Inside source: true *** True Line Result - h: u * 9 -** Processing line: ~ }~ + [2393, 2316, 64, 64], +** Processing line: ~ [2328, 2317, 64, 64],~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [2328, 2317, 64, 64], +** Processing line: ~ [2264, 2316, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2264, 2316, 64, 64], +** Processing line: ~ [2207, 2318, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def font_relative_size_enum size_enum~ + [2207, 2318, 64, 64], +** Processing line: ~ [2144, 2317, 64, 64],~ - Inside source: true *** True Line Result - def font_relative_size_enum size_enum -** Processing line: ~ base_line_logical = 22~ + [2144, 2317, 64, 64], +** Processing line: ~ [2081, 2316, 64, 64],~ - Inside source: true *** True Line Result - base_line_logical = 22 -** Processing line: ~ base_line_actual = font_size_med~ + [2081, 2316, 64, 64], +** Processing line: ~ [2015, 2342, 64, 64],~ - Inside source: true *** True Line Result - base_line_actual = font_size_med -** Processing line: ~ target_logical = size_enum~ + [2015, 2342, 64, 64], +** Processing line: ~ [2016, 2315, 64, 64],~ - Inside source: true *** True Line Result - target_logical = size_enum -** Processing line: ~ target_logical = 1 if target_logical <= 0~ + [2016, 2315, 64, 64], +** Processing line: ~ [869, 3709, 64, 64],~ - Inside source: true *** True Line Result - target_logical = 1 if target_logical <= 0 -** Processing line: ~ (base_line_actual / base_line_logical) * target_logical~ + [869, 3709, 64, 64], +** Processing line: ~ [819, 3710, 64, 64],~ - Inside source: true *** True Line Result - (base_line_actual / base_line_logical) * target_logical -** Processing line: ~ end~ + [819, 3710, 64, 64], +** Processing line: ~ [869, 3658, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [869, 3658, 64, 64], +** Processing line: ~ [820, 3658, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def font_px_to_pt px~ + [820, 3658, 64, 64], +** Processing line: ~ [0, 0, 64, 64],~ - Inside source: true *** True Line Result - def font_px_to_pt px -** Processing line: ~ (px / 1.33333).floor~ + [0, 0, 64, 64], +** Processing line: ~ [0, 1670, 64, 64],~ - Inside source: true *** True Line Result - (px / 1.33333).floor -** Processing line: ~ end~ + [0, 1670, 64, 64], +** Processing line: ~ [6691, 1653, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6691, 1653, 64, 64], +** Processing line: ~ [1521, 3792, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def font_pt_to_px pt~ + [1521, 3792, 64, 64], +** Processing line: ~ [0, 5137, 64, 64],~ - Inside source: true *** True Line Result - def font_pt_to_px pt -** Processing line: ~ pt * 1.333333~ + [0, 5137, 64, 64], +** Processing line: ~ [3898, 2400, 64, 64],~ - Inside source: true *** True Line Result - pt * 1.333333 -** Processing line: ~ end~ + [3898, 2400, 64, 64], +** Processing line: ~ [3835, 2400, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3835, 2400, 64, 64], +** Processing line: ~ [3771, 2400, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def font_size_cell~ + [3771, 2400, 64, 64], +** Processing line: ~ [3708, 2401, 64, 64],~ - Inside source: true *** True Line Result - def font_size_cell -** Processing line: ~ (cell_height / 1.33333)~ + [3708, 2401, 64, 64], +** Processing line: ~ [3646, 2401, 64, 64],~ - Inside source: true *** True Line Result - (cell_height / 1.33333) -** Processing line: ~ end~ + [3646, 2401, 64, 64], +** Processing line: ~ [3587, 2401, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3587, 2401, 64, 64], +** Processing line: ~ [3530, 2401, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def font_size_xl~ + [3530, 2401, 64, 64], +** Processing line: ~ [3897, 2340, 64, 64],~ - Inside source: true *** True Line Result - def font_size_xl -** Processing line: ~ font_size_cell~ + [3897, 2340, 64, 64], +** Processing line: ~ [3897, 2295, 64, 64],~ - Inside source: true *** True Line Result - font_size_cell -** Processing line: ~ end~ + [3897, 2295, 64, 64], +** Processing line: ~ [3834, 2296, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3834, 2296, 64, 64], +** Processing line: ~ [3773, 2295, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def font_size_lg~ + [3773, 2295, 64, 64], +** Processing line: ~ [3710, 2296, 64, 64],~ - Inside source: true *** True Line Result - def font_size_lg -** Processing line: ~ font_size_cell * 0.8~ + [3710, 2296, 64, 64], +** Processing line: ~ [3656, 2295, 64, 64],~ - Inside source: true *** True Line Result - font_size_cell * 0.8 -** Processing line: ~ end~ + [3656, 2295, 64, 64], +** Processing line: ~ [3593, 2294, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3593, 2294, 64, 64], +** Processing line: ~ [3527, 2339, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def font_size_med~ + [3527, 2339, 64, 64], +** Processing line: ~ [3531, 2293, 64, 64],~ - Inside source: true *** True Line Result - def font_size_med -** Processing line: ~ font_size_cell * 0.7~ + [3531, 2293, 64, 64], +** Processing line: ~ [4152, 2903, 64, 64],~ - Inside source: true *** True Line Result - font_size_cell * 0.7 -** Processing line: ~ end~ + [4152, 2903, 64, 64], +** Processing line: ~ [4155, 2858, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [4155, 2858, 64, 64], +** Processing line: ~ [3942, 1306, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def font_size_sm~ + [3942, 1306, 64, 64], +** Processing line: ~ [3942, 1279, 64, 64],~ - Inside source: true *** True Line Result - def font_size_sm -** Processing line: ~ font_size_cell * 0.6~ + [3942, 1279, 64, 64], +** Processing line: ~ [3879, 1306, 64, 64],~ - Inside source: true *** True Line Result - font_size_cell * 0.6 -** Processing line: ~ end~ + [3879, 1306, 64, 64], +** Processing line: ~ [3881, 1278, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3881, 1278, 64, 64], +** Processing line: ~ [3819, 1305, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def font_size_xs~ + [3819, 1305, 64, 64], +** Processing line: ~ [3819, 1277, 64, 64],~ - Inside source: true *** True Line Result - def font_size_xs -** Processing line: ~ font_size_cell * 0.5~ + [3819, 1277, 64, 64], +** Processing line: ~ [3756, 1306, 64, 64],~ - Inside source: true *** True Line Result - font_size_cell * 0.5 -** Processing line: ~ end~ + [3756, 1306, 64, 64], +** Processing line: ~ [3756, 1277, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3756, 1277, 64, 64], +** Processing line: ~ [3694, 1306, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def font_size~ + [3694, 1306, 64, 64], +** Processing line: ~ [3695, 1277, 64, 64],~ - Inside source: true *** True Line Result - def font_size -** Processing line: ~ font_size_cell * 0.7~ + [3695, 1277, 64, 64], +** Processing line: ~ [3631, 1306, 64, 64],~ - Inside source: true *** True Line Result - font_size_cell * 0.7 -** Processing line: ~ end~ + [3631, 1306, 64, 64], +** Processing line: ~ [3632, 1278, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [3632, 1278, 64, 64], +** Processing line: ~ [3565, 1306, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def logical_rect~ + [3565, 1306, 64, 64], +** Processing line: ~ [3567, 1279, 64, 64],~ - Inside source: true *** True Line Result - def logical_rect -** Processing line: ~ @logical_rect ||= { x: 0,~ + [3567, 1279, 64, 64], +** Processing line: ~ [4432, 1165, 64, 64],~ - Inside source: true *** True Line Result - @logical_rect ||= { x: 0, -** Processing line: ~ y: 0,~ + [4432, 1165, 64, 64], +** Processing line: ~ [4408, 1163, 64, 64],~ - Inside source: true *** True Line Result - y: 0, -** Processing line: ~ w: @w,~ + [4408, 1163, 64, 64], +** Processing line: ~ [5123, 1003, 64, 64],~ - Inside source: true *** True Line Result - w: @w, -** Processing line: ~ h: @h }~ + [5123, 1003, 64, 64], +** Processing line: ~ [5065, 1002, 64, 64],~ - Inside source: true *** True Line Result - h: @h } -** Processing line: ~ end~ + [5065, 1002, 64, 64], +** Processing line: ~ [5042, 1002, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [5042, 1002, 64, 64], +** Processing line: ~ [6020, 1780, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def safe_rect~ + [6020, 1780, 64, 64], +** Processing line: ~ [6020, 1756, 64, 64],~ - Inside source: true *** True Line Result - def safe_rect -** Processing line: ~ @safe_rect ||= { x: 0,~ + [6020, 1756, 64, 64], +** Processing line: ~ [5959, 1780, 64, 64],~ - Inside source: true *** True Line Result - @safe_rect ||= { x: 0, -** Processing line: ~ y: 0,~ + [5959, 1780, 64, 64], +** Processing line: ~ [5959, 1752, 64, 64],~ - Inside source: true *** True Line Result - y: 0, -** Processing line: ~ w: @w,~ + [5959, 1752, 64, 64], +** Processing line: ~ [5897, 1779, 64, 64],~ - Inside source: true *** True Line Result - w: @w, -** Processing line: ~ h: @h }~ + [5897, 1779, 64, 64], +** Processing line: ~ [5899, 1752, 64, 64],~ - Inside source: true *** True Line Result - h: @h } -** Processing line: ~ end~ + [5899, 1752, 64, 64], +** Processing line: ~ [5836, 1779, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [5836, 1779, 64, 64], +** Processing line: ~ [5836, 1751, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def control_rect~ + [5836, 1751, 64, 64], +** Processing line: ~ [5776, 1780, 64, 64],~ - Inside source: true *** True Line Result - def control_rect -** Processing line: ~ @control_rect ||= { x: device.control_area.margin.left,~ + [5776, 1780, 64, 64], +** Processing line: ~ [5776, 1754, 64, 64],~ - Inside source: true *** True Line Result - @control_rect ||= { x: device.control_area.margin.left, -** Processing line: ~ y: device.control_area.margin.top,~ + [5776, 1754, 64, 64], +** Processing line: ~ [5717, 1780, 64, 64],~ - Inside source: true *** True Line Result - y: device.control_area.margin.top, -** Processing line: ~ w: device.control_area.w,~ + [5717, 1780, 64, 64], +** Processing line: ~ [5716, 1752, 64, 64],~ - Inside source: true *** True Line Result - w: device.control_area.w, -** Processing line: ~ h: device.control_area.h }~ + [5716, 1752, 64, 64], +** Processing line: ~ [5658, 1781, 64, 64],~ - Inside source: true *** True Line Result - h: device.control_area.h } -** Processing line: ~ end~ + [5658, 1781, 64, 64], +** Processing line: ~ [5658, 1755, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [5658, 1755, 64, 64], +** Processing line: ~ [5640, 1781, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def row_count~ + [5640, 1781, 64, 64], +** Processing line: ~ [5640, 1754, 64, 64],~ - Inside source: true *** True Line Result - def row_count -** Processing line: ~ device.grid_area.row_count~ + [5640, 1754, 64, 64], +** Processing line: ~ [5832, 2095, 64, 64],~ - Inside source: true *** True Line Result - device.grid_area.row_count -** Processing line: ~ end~ + [5832, 2095, 64, 64], +** Processing line: ~ [5782, 2093, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [5782, 2093, 64, 64], +** Processing line: ~ [5832, 2044, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def col_count~ + [5832, 2044, 64, 64], +** Processing line: ~ [5777, 2043, 64, 64],~ - Inside source: true *** True Line Result - def col_count -** Processing line: ~ device.grid_area.col_count~ + [5777, 2043, 64, 64], +** Processing line: ~ [4847, 2577, 64, 64],~ - Inside source: true *** True Line Result - device.grid_area.col_count -** Processing line: ~ end~ + [4847, 2577, 64, 64], +** Processing line: ~ [4795, 2577, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [4795, 2577, 64, 64], +** Processing line: ~ [4846, 2526, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def gutter_height~ + [4846, 2526, 64, 64], +** Processing line: ~ [4794, 2526, 64, 64],~ - Inside source: true *** True Line Result - def gutter_height -** Processing line: ~ device.grid_area.gutter~ + [4794, 2526, 64, 64], +** Processing line: ~ [8390, 923, 64, 64],~ - Inside source: true *** True Line Result - device.grid_area.gutter -** Processing line: ~ end~ + [8390, 923, 64, 64], +** Processing line: ~ [8363, 922, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8363, 922, 64, 64], +** Processing line: ~ [7585, 1084, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def gutter_width~ + [7585, 1084, 64, 64], +** Processing line: ~ [7582, 1058, 64, 64],~ - Inside source: true *** True Line Result - def gutter_width -** Processing line: ~ device.grid_area.gutter~ + [7582, 1058, 64, 64], +** Processing line: ~ [7525, 1084, 64, 64],~ - Inside source: true *** True Line Result - device.grid_area.gutter -** Processing line: ~ end~ + [7525, 1084, 64, 64], +** Processing line: ~ [7524, 1056, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7524, 1056, 64, 64], +** Processing line: ~ [7478, 1085, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def outer_gutter~ + [7478, 1085, 64, 64], +** Processing line: ~ [7476, 1055, 64, 64],~ - Inside source: true *** True Line Result - def outer_gutter -** Processing line: ~ device.grid_area.outer_gutter~ + [7476, 1055, 64, 64], +** Processing line: ~ [7421, 1086, 64, 64],~ - Inside source: true *** True Line Result - device.grid_area.outer_gutter -** Processing line: ~ end~ + [7421, 1086, 64, 64], +** Processing line: ~ [7421, 1052, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7421, 1052, 64, 64], +** Processing line: ~ [7362, 1085, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def cell_height~ + [7362, 1085, 64, 64], +** Processing line: ~ [7361, 1053, 64, 64],~ - Inside source: true *** True Line Result - def cell_height -** Processing line: ~ device.control_area.cell_size~ + [7361, 1053, 64, 64], +** Processing line: ~ [7307, 1087, 64, 64],~ - Inside source: true *** True Line Result - device.control_area.cell_size -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~~ + [7307, 1087, 64, 64], +** Processing line: ~ [7307, 1054, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def cell_width~ + [7307, 1054, 64, 64], +** Processing line: ~ [7258, 1086, 64, 64],~ - Inside source: true *** True Line Result - def cell_width -** Processing line: ~ device.control_area.cell_size~ + [7258, 1086, 64, 64], +** Processing line: ~ [7255, 1058, 64, 64],~ - Inside source: true *** True Line Result - device.control_area.cell_size -** Processing line: ~ end~ + [7255, 1058, 64, 64], +** Processing line: ~ [7203, 1083, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7203, 1083, 64, 64], +** Processing line: ~ [7203, 1055, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def rect_defaults~ + [7203, 1055, 64, 64], +** Processing line: ~ [7161, 1085, 64, 64],~ - Inside source: true *** True Line Result - def rect_defaults -** Processing line: ~ {~ + [7161, 1085, 64, 64], +** Processing line: ~ [7158, 1057, 64, 64],~ - Inside source: true *** True Line Result - { -** Processing line: ~ row: nil,~ + [7158, 1057, 64, 64], +** Processing line: ~ [7100, 1083, 64, 64],~ - Inside source: true *** True Line Result - row: nil, -** Processing line: ~ col: nil,~ + [7100, 1083, 64, 64], +** Processing line: ~ [7099, 1058, 64, 64],~ - Inside source: true *** True Line Result - col: nil, -** Processing line: ~ h: 1,~ + [7099, 1058, 64, 64], +** Processing line: ~ [7038, 1082, 64, 64],~ - Inside source: true *** True Line Result - h: 1, -** Processing line: ~ w: 1,~ + [7038, 1082, 64, 64], +** Processing line: ~ [7038, 1058, 64, 64],~ - Inside source: true *** True Line Result - w: 1, -** Processing line: ~ dx: 0,~ + [7038, 1058, 64, 64], +** Processing line: ~ [6982, 1083, 64, 64],~ - Inside source: true *** True Line Result - dx: 0, -** Processing line: ~ dy: 0,~ + [6982, 1083, 64, 64], +** Processing line: ~ [6984, 1057, 64, 64],~ - Inside source: true *** True Line Result - dy: 0, -** Processing line: ~ rect: :control_rect~ + [6984, 1057, 64, 64], +** Processing line: ~ [0, 0, 64, 64],~ - Inside source: true *** True Line Result - rect: :control_rect -** Processing line: ~ }~ + [0, 0, 64, 64], +** Processing line: ~ [0, 1670, 64, 64],~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + [0, 1670, 64, 64], +** Processing line: ~ [6691, 1653, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6691, 1653, 64, 64], +** Processing line: ~ [1521, 3792, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ def rect opts~ + [1521, 3792, 64, 64], +** Processing line: ~ [0, 5137, 64, 64],~ - Inside source: true *** True Line Result - def rect opts -** Processing line: ~ opts = rect_defaults.merge opts~ + [0, 5137, 64, 64], +** Processing line: ~ [0, 0, 64, 64],~ - Inside source: true *** True Line Result - opts = rect_defaults.merge opts -** Processing line: ~ result = send opts[:rect]~ + [0, 0, 64, 64], +** Processing line: ~ [0, 1670, 64, 64],~ - Inside source: true *** True Line Result - result = send opts[:rect] -** Processing line: ~ if opts[:row] && opts[:col] && opts[:w] && opts[:h]~ + [0, 1670, 64, 64], +** Processing line: ~ [6691, 1653, 64, 64],~ - Inside source: true *** True Line Result - if opts[:row] && opts[:col] && opts[:w] && opts[:h] -** Processing line: ~ col = rect_col opts[:col], opts[:w]~ + [6691, 1653, 64, 64], +** Processing line: ~ [1521, 3792, 64, 64],~ - Inside source: true *** True Line Result - col = rect_col opts[:col], opts[:w] -** Processing line: ~ row = rect_row opts[:row], opts[:h]~ + [1521, 3792, 64, 64], +** Processing line: ~ [0, 5137, 64, 64],~ - Inside source: true *** True Line Result - row = rect_row opts[:row], opts[:h] -** Processing line: ~ result = control_rect.merge x: col.x,~ + [0, 5137, 64, 64], +** Processing line: ~ [0, 0, 64, 64],~ - Inside source: true *** True Line Result - result = control_rect.merge x: col.x, -** Processing line: ~ y: row.y,~ + [0, 0, 64, 64], +** Processing line: ~ [0, 1670, 64, 64],~ - Inside source: true *** True Line Result - y: row.y, -** Processing line: ~ w: col.w,~ + [0, 1670, 64, 64], +** Processing line: ~ [6691, 1653, 64, 64],~ - Inside source: true *** True Line Result - w: col.w, -** Processing line: ~ h: row.h~ + [6691, 1653, 64, 64], +** Processing line: ~ [1521, 3792, 64, 64],~ - Inside source: true *** True Line Result - h: row.h -** Processing line: ~ elsif opts[:row] && !opts[:col]~ + [1521, 3792, 64, 64], +** Processing line: ~ [0, 5137, 64, 64],~ - Inside source: true *** True Line Result - elsif opts[:row] && !opts[:col] -** Processing line: ~ result = rect_row opts[:row], opts[:h]~ + [0, 5137, 64, 64], +** Processing line: ~ [8346, 424, 64, 64],~ - Inside source: true *** True Line Result - result = rect_row opts[:row], opts[:h] -** Processing line: ~ elsif !opts[:row] && opts[:col]~ + [8346, 424, 64, 64], +** Processing line: ~ [8407, 376, 64, 64],~ - Inside source: true *** True Line Result - elsif !opts[:row] && opts[:col] -** Processing line: ~ result = rect_col opts[:col], opts[:w]~ + [8407, 376, 64, 64], +** Processing line: ~ [8375, 386, 64, 64],~ - Inside source: true *** True Line Result - result = rect_col opts[:col], opts[:w] -** Processing line: ~ else~ + [8375, 386, 64, 64], +** Processing line: ~ [8407, 347, 64, 64],~ - Inside source: true *** True Line Result - else -** Processing line: ~ raise "LayoutTheory::rect unable to process opts #{opts}."~ + [8407, 347, 64, 64], +** Processing line: ~ [8388, 343, 64, 64],~ - Inside source: true *** True Line Result - raise "LayoutTheory::rect unable to process opts #{opts}." -** Processing line: ~ end~ + [8388, 343, 64, 64], +** Processing line: ~ [8320, 423, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [8320, 423, 64, 64], +** Processing line: ~ [8319, 363, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if opts[:max_height] && opts[:max_height] >= 0~ + [8319, 363, 64, 64], +** Processing line: ~ [8368, 303, 64, 64],~ - Inside source: true *** True Line Result - if opts[:max_height] && opts[:max_height] >= 0 -** Processing line: ~ if result[:h] > opts[:max_height]~ + [8368, 303, 64, 64], +** Processing line: ~ [8359, 303, 64, 64],~ - Inside source: true *** True Line Result - if result[:h] > opts[:max_height] -** Processing line: ~ delta = (result[:h] - opts[:max_height]) * 2~ + [8359, 303, 64, 64], +** Processing line: ~ [8318, 330, 64, 64],~ - Inside source: true *** True Line Result - delta = (result[:h] - opts[:max_height]) * 2 -** Processing line: ~ result[:y] += delta~ + [8318, 330, 64, 64], +** Processing line: ~ [9369, 425, 64, 64],~ - Inside source: true *** True Line Result - result[:y] += delta -** Processing line: ~ result[:h] = opts[:max_height]~ + [9369, 425, 64, 64], +** Processing line: ~ [9340, 425, 64, 64],~ - Inside source: true *** True Line Result - result[:h] = opts[:max_height] -** Processing line: ~ end~ + [9340, 425, 64, 64], +** Processing line: ~ [9431, 376, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [9431, 376, 64, 64], +** Processing line: ~ [9414, 382, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [9414, 382, 64, 64], +** Processing line: ~ [9387, 391, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if opts[:max_width] && opts[:max_width] >= 0~ + [9387, 391, 64, 64], +** Processing line: ~ [9431, 349, 64, 64],~ - Inside source: true *** True Line Result - if opts[:max_width] && opts[:max_width] >= 0 -** Processing line: ~ if result[:w] > opts[:max_width]~ + [9431, 349, 64, 64], +** Processing line: ~ [9412, 344, 64, 64],~ - Inside source: true *** True Line Result - if result[:w] > opts[:max_width] -** Processing line: ~ delta = (result[:w] - opts[:max_width]) * 2~ + [9412, 344, 64, 64], +** Processing line: ~ [9392, 305, 64, 64],~ - Inside source: true *** True Line Result - delta = (result[:w] - opts[:max_width]) * 2 -** Processing line: ~ result[:x] += delta~ + [9392, 305, 64, 64], +** Processing line: ~ [9339, 365, 64, 64],~ - Inside source: true *** True Line Result - result[:x] += delta -** Processing line: ~ result[:w] = opts[:max_width]~ + [9339, 365, 64, 64], +** Processing line: ~ [9341, 333, 64, 64],~ - Inside source: true *** True Line Result - result[:w] = opts[:max_width] -** Processing line: ~ end~ + [9341, 333, 64, 64], +** Processing line: ~ [9384, 301, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + [9384, 301, 64, 64], +** Processing line: ~ [7673, 1896, 64, 64],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [7673, 1896, 64, 64], +** Processing line: ~ [7642, 1834, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ result[:x] += opts[:dx]~ + [7642, 1834, 64, 64], +** Processing line: ~ [7646, 1901, 64, 64],~ - Inside source: true *** True Line Result - result[:x] += opts[:dx] -** Processing line: ~ result[:y] += opts[:dy]~ + [7646, 1901, 64, 64], +** Processing line: ~ [4500, 4054, 64, 64],~ - Inside source: true *** True Line Result - result[:y] += opts[:dy] -** Processing line: ~~ + [4500, 4054, 64, 64], +** Processing line: ~ [4476, 4055, 64, 64],~ - Inside source: true *** True Line Result - -** Processing line: ~ if opts[:include_row_gutter]~ + [4476, 4055, 64, 64], +** Processing line: ~ [4459, 3997, 64, 64],~ - Inside source: true *** True Line Result - if opts[:include_row_gutter] -** Processing line: ~ result[:x] -= device.grid_area.gutter~ + [4459, 3997, 64, 64], +** Processing line: ~ [76, 5215, 64, 64],~ - Inside source: true *** True Line Result - result[:x] -= device.grid_area.gutter -** Processing line: ~ result[:w] += device.grid_area.gutter * 2~ + [76, 5215, 64, 64], +** Processing line: ~ [39, 5217, 64, 64],~ - Inside source: true *** True Line Result - result[:w] += device.grid_area.gutter * 2 -** Processing line: ~ end~ + [39, 5217, 64, 64], +** Processing line: ~ ]~ - Inside source: true *** True Line Result - end + ] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ if opts[:include_col_gutter]~ +** Processing line: ~ $mugs = [~ - Inside source: true *** True Line Result - if opts[:include_col_gutter] -** Processing line: ~ result[:y] -= device.grid_area.gutter~ + $mugs = [ +** Processing line: ~ [85, 87, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - result[:y] -= device.grid_area.gutter -** Processing line: ~ result[:h] += device.grid_area.gutter * 2~ + [85, 87, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [958, 1967, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - result[:h] += device.grid_area.gutter * 2 -** Processing line: ~ end~ + [958, 1967, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [2537, 1734, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2537, 1734, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [3755, 2464, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - -** Processing line: ~ result~ + [3755, 2464, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [1548, 3273, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - result -** Processing line: ~ end~ + [1548, 3273, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [2050, 220, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [2050, 220, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [854, 297, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - -** Processing line: ~ def rect_center reference, target~ + [854, 297, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [343, 526, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - def rect_center reference, target -** Processing line: ~ delta_x = (reference.w - target.w).fdiv 2~ + [343, 526, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [3454, 772, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - delta_x = (reference.w - target.w).fdiv 2 -** Processing line: ~ delta_y = (reference.h - target.h).fdiv 2~ + [3454, 772, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [5041, 298, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - delta_y = (reference.h - target.h).fdiv 2 -** Processing line: ~ [target.x - delta_x, target.y - delta_y, target.w, target.h]~ + [5041, 298, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [6089, 300, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - [target.x - delta_x, target.y - delta_y, target.w, target.h] -** Processing line: ~ end~ + [6089, 300, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [6518, 295, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [6518, 295, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [7661, 47, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - -** Processing line: ~ def rect_row index, h~ + [7661, 47, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [9392, 1125, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - def rect_row index, h -** Processing line: ~ @rect_cache[:row] ||= {}~ + [9392, 1125, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [7298, 1152, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - @rect_cache[:row] ||= {} -** Processing line: ~ @rect_cache[:row][index] ||= {}~ + [7298, 1152, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [5816, 1843, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - @rect_cache[:row][index] ||= {} -** Processing line: ~ return @rect_cache[:row][index][h] if @rect_cache[:row][index][h]~ + [5816, 1843, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [876, 3772, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - return @rect_cache[:row][index][h] if @rect_cache[:row][index][h] -** Processing line: ~ row_h = (device.grid_area.gutter * (h - 1)) +~ + [876, 3772, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [1029, 4667, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - row_h = (device.grid_area.gutter * (h - 1)) + -** Processing line: ~ (device.control_area.cell_size * h)~ + [1029, 4667, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [823, 5324, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - (device.control_area.cell_size * h) -** Processing line: ~~ + [823, 5324, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [3251, 5220, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - -** Processing line: ~ row_h = row_h.to_i~ + [3251, 5220, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [4747, 5282, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - row_h = row_h.to_i -** Processing line: ~ row_h -= 1 if row_h.odd?~ + [4747, 5282, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [9325, 5178, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - row_h -= 1 if row_h.odd? -** Processing line: ~~ + [9325, 5178, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [9635, 4298, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - -** Processing line: ~ row_y = (control_rect.y) +~ + [9635, 4298, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [7837, 4127, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - row_y = (control_rect.y) + -** Processing line: ~ (device.grid_area.gutter * index) +~ + [7837, 4127, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [8651, 1971, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - (device.grid_area.gutter * index) + -** Processing line: ~ (device.control_area.cell_size * index)~ + [8651, 1971, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [6892, 2031, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - (device.control_area.cell_size * index) -** Processing line: ~~ + [6892, 2031, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [4626, 3882, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - -** Processing line: ~ row_y = row_y.to_i~ + [4626, 3882, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [4024, 4554, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - row_y = row_y.to_i -** Processing line: ~ row_y += 1 if row_y.odd? && (index + 1) > @device.grid_area.row_count.half~ + [4024, 4554, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [3925, 3337, 39, 43, "sprites/square-orange.png"],~ - Inside source: true *** True Line Result - row_y += 1 if row_y.odd? && (index + 1) > @device.grid_area.row_count.half -** Processing line: ~ row_y += 1 if row_y.odd? && (index + 1) <= @device.grid_area.row_count.half~ + [3925, 3337, 39, 43, "sprites/square-orange.png"], +** Processing line: ~ [5064, 1064, 39, 43, "sprites/square-orange.png"]~ - Inside source: true *** True Line Result - row_y += 1 if row_y.odd? && (index + 1) <= @device.grid_area.row_count.half + [5064, 1064, 39, 43, "sprites/square-orange.png"] +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ row_y = device.h - row_y - row_h~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - row_y = device.h - row_y - row_h +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ result = control_rect.merge y: row_y, h: row_h~ -- Inside source: true +** Processing line: ~*** Platformer - Gorillas Basic - credits.txt~ +- Header detected. *** True Line Result - result = control_rect.merge y: row_y, h: row_h -** Processing line: ~ @rect_cache[:row][index][h] = result~ + +*** True Line Result +*** Platformer - Gorillas Basic - credits.txt +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_platformer/gorillas_basic/CREDITS.txt~ - Inside source: true *** True Line Result - @rect_cache[:row][index][h] = result -** Processing line: ~ @rect_cache[:row][index][h]~ + # ./samples/99_genre_platformer/gorillas_basic/CREDITS.txt +** Processing line: ~ code: Amir Rajan, https://twitter.com/amirrajan~ - Inside source: true *** True Line Result - @rect_cache[:row][index][h] -** Processing line: ~ end~ + code: Amir Rajan, https://twitter.com/amirrajan +** Processing line: ~ graphics: Nick Culbertson, https://twitter.com/MobyPixel~ - Inside source: true *** True Line Result - end + graphics: Nick Culbertson, https://twitter.com/MobyPixel ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def rect_col index, w~ +** Processing line: ~~ - Inside source: true *** True Line Result - def rect_col index, w -** Processing line: ~ @rect_cache[:col] ||= {}~ -- Inside source: true + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - @rect_cache[:col] ||= {} -** Processing line: ~ @rect_cache[:col][index] ||= {}~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - @rect_cache[:col][index] ||= {} -** Processing line: ~ return @rect_cache[:col][index][w] if @rect_cache[:col][index][w]~ -- Inside source: true + +** Processing line: ~*** Platformer - Gorillas Basic - main.rb~ +- Header detected. *** True Line Result - return @rect_cache[:col][index][w] if @rect_cache[:col][index][w] -** Processing line: ~ col_x = (control_rect.x) +~ + +*** True Line Result +*** Platformer - Gorillas Basic - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_platformer/gorillas_basic/app/main.rb~ - Inside source: true *** True Line Result - col_x = (control_rect.x) + -** Processing line: ~ (device.grid_area.gutter * index) +~ + # ./samples/99_genre_platformer/gorillas_basic/app/main.rb +** Processing line: ~ class YouSoBasicGorillas~ - Inside source: true *** True Line Result - (device.grid_area.gutter * index) + -** Processing line: ~ (device.control_area.cell_size * index)~ + class YouSoBasicGorillas +** Processing line: ~ attr_accessor :outputs, :grid, :state, :inputs~ - Inside source: true *** True Line Result - (device.control_area.cell_size * index) + attr_accessor :outputs, :grid, :state, :inputs ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ col_x = col_x.to_i~ +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - col_x = col_x.to_i -** Processing line: ~ col_x -= 1 if col_x.odd? && (index + 1) < @device.grid_area.col_count.half~ + def tick +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - col_x -= 1 if col_x.odd? && (index + 1) < @device.grid_area.col_count.half -** Processing line: ~ col_x += 1 if col_x.odd? && (index + 1) >= @device.grid_area.col_count.half~ + defaults +** Processing line: ~ render~ - Inside source: true *** True Line Result - col_x += 1 if col_x.odd? && (index + 1) >= @device.grid_area.col_count.half -** Processing line: ~~ + render +** Processing line: ~ calc~ - Inside source: true *** True Line Result - -** Processing line: ~ col_w = (device.grid_area.gutter * (w - 1)) +~ + calc +** Processing line: ~ process_inputs~ - Inside source: true *** True Line Result - col_w = (device.grid_area.gutter * (w - 1)) + -** Processing line: ~ (device.control_area.cell_size * w)~ + process_inputs +** Processing line: ~ end~ - Inside source: true *** True Line Result - (device.control_area.cell_size * w) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ col_w = col_w.to_i~ -- Inside source: true -*** True Line Result - col_w = col_w.to_i -** Processing line: ~ col_w -= 1 if col_w.odd?~ +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - col_w -= 1 if col_w.odd? -** Processing line: ~~ + def defaults +** Processing line: ~ outputs.background_color = [33, 32, 87]~ - Inside source: true *** True Line Result - -** Processing line: ~ result = control_rect.merge x: col_x, w: col_w~ + outputs.background_color = [33, 32, 87] +** Processing line: ~ state.building_spacing = 1~ - Inside source: true *** True Line Result - result = control_rect.merge x: col_x, w: col_w -** Processing line: ~ @rect_cache[:col][index][w] = result~ + state.building_spacing = 1 +** Processing line: ~ state.building_room_spacing = 15~ - Inside source: true *** True Line Result - @rect_cache[:col][index][w] = result -** Processing line: ~ @rect_cache[:col][index][w]~ + state.building_room_spacing = 15 +** Processing line: ~ state.building_room_width = 10~ - Inside source: true *** True Line Result - @rect_cache[:col][index][w] -** Processing line: ~ end~ + state.building_room_width = 10 +** Processing line: ~ state.building_room_height = 15~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.building_room_height = 15 +** Processing line: ~ state.building_heights = [4, 4, 6, 8, 15, 20, 18]~ - Inside source: true *** True Line Result - -** Processing line: ~ def device~ + state.building_heights = [4, 4, 6, 8, 15, 20, 18] +** Processing line: ~ state.building_room_sizes = [5, 4, 6, 7]~ - Inside source: true *** True Line Result - def device -** Processing line: ~ @device~ + state.building_room_sizes = [5, 4, 6, 7] +** Processing line: ~ state.gravity = 0.25~ - Inside source: true *** True Line Result - @device -** Processing line: ~ end~ + state.gravity = 0.25 +** Processing line: ~ state.first_strike ||= :player_1~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.first_strike ||= :player_1 +** Processing line: ~ state.buildings ||= []~ - Inside source: true *** True Line Result - -** Processing line: ~ def init_device w, h~ + state.buildings ||= [] +** Processing line: ~ state.holes ||= []~ - Inside source: true *** True Line Result - def init_device w, h -** Processing line: ~ @device = Device.new~ + state.holes ||= [] +** Processing line: ~ state.player_1_score ||= 0~ - Inside source: true *** True Line Result - @device = Device.new -** Processing line: ~ @device.w = w~ + state.player_1_score ||= 0 +** Processing line: ~ state.player_2_score ||= 0~ - Inside source: true *** True Line Result - @device.w = w -** Processing line: ~ @device.h = h~ + state.player_2_score ||= 0 +** Processing line: ~ state.wind ||= 0~ - Inside source: true *** True Line Result - @device.h = h -** Processing line: ~ @device.name = "Device"~ + state.wind ||= 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - @device.name = "Device" -** Processing line: ~ @device.aspect.w = (u_for_16x9 w, h)[:w]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - @device.aspect.w = (u_for_16x9 w, h)[:w] -** Processing line: ~ @device.aspect.h = (u_for_16x9 w, h)[:h]~ + +** Processing line: ~ def render~ - Inside source: true *** True Line Result - @device.aspect.h = (u_for_16x9 w, h)[:h] -** Processing line: ~ @device.aspect.u = (u_for_16x9 w, h)[:u]~ + def render +** Processing line: ~ render_stage~ - Inside source: true *** True Line Result - @device.aspect.u = (u_for_16x9 w, h)[:u] -** Processing line: ~ @device.safe_area.w = @device.aspect.u * 16~ + render_stage +** Processing line: ~ render_value_insertion~ - Inside source: true *** True Line Result - @device.safe_area.w = @device.aspect.u * 16 -** Processing line: ~ @device.safe_area.h = @device.aspect.u * 9~ + render_value_insertion +** Processing line: ~ render_gorillas~ - Inside source: true *** True Line Result - @device.safe_area.h = @device.aspect.u * 9 -** Processing line: ~ @device.safe_area.margin.left = ((@device.w - @device.safe_area.w).fdiv 2).floor~ + render_gorillas +** Processing line: ~ render_holes~ - Inside source: true *** True Line Result - @device.safe_area.margin.left = ((@device.w - @device.safe_area.w).fdiv 2).floor -** Processing line: ~ @device.safe_area.margin.right = ((@device.w - @device.safe_area.w).fdiv 2).floor~ + render_holes +** Processing line: ~ render_banana~ - Inside source: true *** True Line Result - @device.safe_area.margin.right = ((@device.w - @device.safe_area.w).fdiv 2).floor -** Processing line: ~ @device.safe_area.margin.top = ((@device.h - @device.safe_area.h).fdiv 2).floor~ + render_banana +** Processing line: ~ render_game_over~ - Inside source: true *** True Line Result - @device.safe_area.margin.top = ((@device.h - @device.safe_area.h).fdiv 2).floor -** Processing line: ~ @device.safe_area.margin.bottom = ((@device.h - @device.safe_area.h).fdiv 2).floor~ + render_game_over +** Processing line: ~ render_score~ - Inside source: true *** True Line Result - @device.safe_area.margin.bottom = ((@device.h - @device.safe_area.h).fdiv 2).floor -** Processing line: ~ @device.grid_area.outer_gutter = @device.w / 80~ + render_score +** Processing line: ~ render_wind~ - Inside source: true *** True Line Result - @device.grid_area.outer_gutter = @device.w / 80 -** Processing line: ~ @device.grid_area.gutter = @device.w / 160~ + render_wind +** Processing line: ~ end~ - Inside source: true *** True Line Result - @device.grid_area.gutter = @device.w / 160 + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @device.grid_area.w = @device.safe_area.w - (@device.grid_area.outer_gutter * 2)~ -- Inside source: true -*** True Line Result - @device.grid_area.w = @device.safe_area.w - (@device.grid_area.outer_gutter * 2) -** Processing line: ~ @device.grid_area.h = @device.safe_area.h - (@device.grid_area.outer_gutter * 2)~ +** Processing line: ~ def render_score~ - Inside source: true *** True Line Result - @device.grid_area.h = @device.safe_area.h - (@device.grid_area.outer_gutter * 2) -** Processing line: ~~ + def render_score +** Processing line: ~ outputs.primitives << [0, 0, 1280, 31, fancy_white].solid~ - Inside source: true *** True Line Result - -** Processing line: ~ @device.grid_area.margin.left = ((@device.w - @device.grid_area.w).fdiv 2).floor~ + outputs.primitives << [0, 0, 1280, 31, fancy_white].solid +** Processing line: ~ outputs.primitives << [1, 1, 1279, 29].solid~ - Inside source: true *** True Line Result - @device.grid_area.margin.left = ((@device.w - @device.grid_area.w).fdiv 2).floor -** Processing line: ~ @device.grid_area.margin.right = ((@device.w - @device.grid_area.w).fdiv 2).floor~ + outputs.primitives << [1, 1, 1279, 29].solid +** Processing line: ~ outputs.labels << [ 10, 25, "Score: #{state.player_1_score}", 0, 0, fancy_white]~ - Inside source: true *** True Line Result - @device.grid_area.margin.right = ((@device.w - @device.grid_area.w).fdiv 2).floor -** Processing line: ~ @device.grid_area.margin.top = ((@device.h - @device.grid_area.h).fdiv 2).floor~ + outputs.labels << [ 10, 25, "Score: #{state.player_1_score}", 0, 0, fancy_white] +** Processing line: ~ outputs.labels << [1270, 25, "Score: #{state.player_2_score}", 0, 2, fancy_white]~ - Inside source: true *** True Line Result - @device.grid_area.margin.top = ((@device.h - @device.grid_area.h).fdiv 2).floor -** Processing line: ~ @device.grid_area.margin.bottom = ((@device.h - @device.grid_area.h).fdiv 2).floor~ + outputs.labels << [1270, 25, "Score: #{state.player_2_score}", 0, 2, fancy_white] +** Processing line: ~ end~ - Inside source: true *** True Line Result - @device.grid_area.margin.bottom = ((@device.h - @device.grid_area.h).fdiv 2).floor + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @device.grid_area.col_count = 24~ +** Processing line: ~ def render_wind~ - Inside source: true *** True Line Result - @device.grid_area.col_count = 24 -** Processing line: ~ @device.grid_area.row_count = 12~ + def render_wind +** Processing line: ~ outputs.primitives << [640, 12, state.wind * 500 + state.wind * 10 * rand, 4, 35, 136, 162].solid~ - Inside source: true *** True Line Result - @device.grid_area.row_count = 12 -** Processing line: ~ @device.grid_area.cell_w = ((@device.aspect.w - (@device.grid_area.outer_gutter * 2)) - ((@device.grid_area.col_count - 1) * @device.grid_area.gutter)).fdiv @device.grid_area.col_count~ + outputs.primitives << [640, 12, state.wind * 500 + state.wind * 10 * rand, 4, 35, 136, 162].solid +** Processing line: ~ outputs.lines << [640, 30, 640, 0, fancy_white]~ - Inside source: true *** True Line Result - @device.grid_area.cell_w = ((@device.aspect.w - (@device.grid_area.outer_gutter * 2)) - ((@device.grid_area.col_count - 1) * @device.grid_area.gutter)).fdiv @device.grid_area.col_count -** Processing line: ~ @device.grid_area.cell_h = ((@device.aspect.h - (@device.grid_area.outer_gutter * 2)) - ((@device.grid_area.row_count - 1) * @device.grid_area.gutter)).fdiv @device.grid_area.row_count~ + outputs.lines << [640, 30, 640, 0, fancy_white] +** Processing line: ~ end~ - Inside source: true *** True Line Result - @device.grid_area.cell_h = ((@device.aspect.h - (@device.grid_area.outer_gutter * 2)) - ((@device.grid_area.row_count - 1) * @device.grid_area.gutter)).fdiv @device.grid_area.row_count + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ @device.control_area.cell_size = @device.grid_area.cell_w~ -- Inside source: true -*** True Line Result - @device.control_area.cell_size = @device.grid_area.cell_w -** Processing line: ~ @device.control_area.cell_size = @device.grid_area.cell_h if @device.grid_area.cell_h < @device.grid_area.cell_w && @device.grid_area.cell_h > 0~ -- Inside source: true -*** True Line Result - @device.control_area.cell_size = @device.grid_area.cell_h if @device.grid_area.cell_h < @device.grid_area.cell_w && @device.grid_area.cell_h > 0 -** Processing line: ~ @device.control_area.cell_size = @device.control_area.cell_size.floor~ +** Processing line: ~ def render_game_over~ - Inside source: true *** True Line Result - @device.control_area.cell_size = @device.control_area.cell_size.floor -** Processing line: ~ @device.control_area.w = (@device.control_area.cell_size * @device.grid_area.col_count) + (@device.grid_area.gutter * (@device.grid_area.col_count - 1))~ + def render_game_over +** Processing line: ~ return unless state.over~ - Inside source: true *** True Line Result - @device.control_area.w = (@device.control_area.cell_size * @device.grid_area.col_count) + (@device.grid_area.gutter * (@device.grid_area.col_count - 1)) -** Processing line: ~ @device.control_area.h = (@device.control_area.cell_size * @device.grid_area.row_count) + (@device.grid_area.gutter * (@device.grid_area.row_count - 1))~ + return unless state.over +** Processing line: ~ outputs.primitives << [grid.rect, 0, 0, 0, 200].solid~ - Inside source: true *** True Line Result - @device.control_area.h = (@device.control_area.cell_size * @device.grid_area.row_count) + (@device.grid_area.gutter * (@device.grid_area.row_count - 1)) -** Processing line: ~ @device.control_area.margin.left = (@device.w - @device.control_area.w).fdiv 2~ + outputs.primitives << [grid.rect, 0, 0, 0, 200].solid +** Processing line: ~ outputs.primitives << [640, 370, "Game Over!!", 5, 1, fancy_white].label~ - Inside source: true *** True Line Result - @device.control_area.margin.left = (@device.w - @device.control_area.w).fdiv 2 -** Processing line: ~ @device.control_area.margin.right = (@device.w - @device.control_area.w).fdiv 2~ + outputs.primitives << [640, 370, "Game Over!!", 5, 1, fancy_white].label +** Processing line: ~ if state.winner == :player_1~ - Inside source: true *** True Line Result - @device.control_area.margin.right = (@device.w - @device.control_area.w).fdiv 2 -** Processing line: ~ @device.control_area.margin.top = (@device.h - @device.control_area.h).fdiv 2~ + if state.winner == :player_1 +** Processing line: ~ outputs.primitives << [640, 340, "Player 1 Wins!!", 5, 1, fancy_white].label~ - Inside source: true *** True Line Result - @device.control_area.margin.top = (@device.h - @device.control_area.h).fdiv 2 -** Processing line: ~ @device.control_area.margin.bottom = (@device.h - @device.control_area.h).fdiv 2~ + outputs.primitives << [640, 340, "Player 1 Wins!!", 5, 1, fancy_white].label +** Processing line: ~ else~ - Inside source: true *** True Line Result - @device.control_area.margin.bottom = (@device.h - @device.control_area.h).fdiv 2 -** Processing line: ~ @device~ + else +** Processing line: ~ outputs.primitives << [640, 340, "Player 2 Wins!!", 5, 1, fancy_white].label~ - Inside source: true *** True Line Result - @device + outputs.primitives << [640, 340, "Player 2 Wins!!", 5, 1, fancy_white].label ** 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 serialize~ +** Processing line: ~ def render_stage~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ {~ + def render_stage +** Processing line: ~ return unless state.stage_generated~ - Inside source: true *** True Line Result - { -** Processing line: ~ device: @device.serialize,~ + return unless state.stage_generated +** Processing line: ~ return if state.stage_rendered~ - Inside source: true *** True Line Result - device: @device.serialize, -** Processing line: ~ }~ + return if state.stage_rendered +** Processing line: ~~ - Inside source: true *** True Line Result - } -** Processing line: ~ end~ + +** Processing line: ~ outputs.static_solids << [grid.rect, 33, 32, 87]~ - Inside source: true *** True Line Result - end + outputs.static_solids << [grid.rect, 33, 32, 87] +** Processing line: ~ outputs.static_solids << state.buildings.map(&:solids)~ +- Inside source: true +*** True Line Result + outputs.static_solids << state.buildings.map(&:solids) +** Processing line: ~ state.stage_rendered = true~ +- Inside source: true +*** True Line Result + state.stage_rendered = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def inspect~ +** Processing line: ~ def render_gorilla gorilla, id~ - Inside source: true *** True Line Result - def inspect -** Processing line: ~ serialize.to_s~ + def render_gorilla gorilla, id +** Processing line: ~ return unless gorilla~ - Inside source: true *** True Line Result - serialize.to_s + return unless gorilla +** Processing line: ~ if state.banana && state.banana.owner == gorilla~ +- Inside source: true +*** True Line Result + if state.banana && state.banana.owner == gorilla +** Processing line: ~ animation_index = state.banana.created_at.frame_index(3, 5, false)~ +- Inside source: true +*** True Line Result + animation_index = state.banana.created_at.frame_index(3, 5, false) ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ if !animation_index~ - Inside source: true *** True Line Result - -** Processing line: ~ def to_s~ + if !animation_index +** Processing line: ~ outputs.sprites << [gorilla.solid, "sprites/#{id}-idle.png"]~ - Inside source: true *** True Line Result - def to_s -** Processing line: ~ serialize.to_s~ + outputs.sprites << [gorilla.solid, "sprites/#{id}-idle.png"] +** Processing line: ~ else~ - Inside source: true *** True Line Result - serialize.to_s + else +** Processing line: ~ outputs.sprites << [gorilla.solid, "sprites/#{id}-#{animation_index}.png"]~ +- Inside source: true +*** True Line Result + outputs.sprites << [gorilla.solid, "sprites/#{id}-#{animation_index}.png"] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -110787,258 +114848,258 @@ 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: ~* log.rb~ -- Header detected. -*** True Line Result - +** Processing line: ~ def render_gorillas~ +- Inside source: true *** True Line Result -* log.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + def render_gorillas +** Processing line: ~ render_gorilla state.player_1, :left~ +- Inside source: true *** True Line Result - + render_gorilla state.player_1, :left +** Processing line: ~ render_gorilla state.player_2, :right~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/log.rb~ + render_gorilla state.player_2, :right +** Processing line: ~ end~ - Inside source: true *** True Line Result - # ./dragon/log.rb -** Processing line: ~ # coding: utf-8~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + +** Processing line: ~ def render_value_insertion~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + def render_value_insertion +** Processing line: ~ return if state.banana~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # log.rb has been released under MIT (*only this file*).~ + return if state.banana +** Processing line: ~ return if state.over~ - Inside source: true *** True Line Result - # log.rb has been released under MIT (*only this file*). + return if state.over ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ XTERM_COLOR = {~ +** Processing line: ~ if state.current_turn == :player_1_angle~ - Inside source: true *** True Line Result - XTERM_COLOR = { -** Processing line: ~ black: "\u001b[30m",~ + if state.current_turn == :player_1_angle +** Processing line: ~ outputs.labels << [ 10, 710, "Angle: #{state.player_1_angle}_", fancy_white]~ - Inside source: true *** True Line Result - black: "\u001b[30m", -** Processing line: ~ red: "\u001b[31m",~ + outputs.labels << [ 10, 710, "Angle: #{state.player_1_angle}_", fancy_white] +** Processing line: ~ elsif state.current_turn == :player_1_velocity~ - Inside source: true *** True Line Result - red: "\u001b[31m", -** Processing line: ~ green: "\u001b[32m",~ + elsif state.current_turn == :player_1_velocity +** Processing line: ~ outputs.labels << [ 10, 710, "Angle: #{state.player_1_angle}", fancy_white]~ - Inside source: true *** True Line Result - green: "\u001b[32m", -** Processing line: ~ yellow: "\u001b[33m",~ + outputs.labels << [ 10, 710, "Angle: #{state.player_1_angle}", fancy_white] +** Processing line: ~ outputs.labels << [ 10, 690, "Velocity: #{state.player_1_velocity}_", fancy_white]~ - Inside source: true *** True Line Result - yellow: "\u001b[33m", -** Processing line: ~ blue: "\u001b[34m",~ + outputs.labels << [ 10, 690, "Velocity: #{state.player_1_velocity}_", fancy_white] +** Processing line: ~ elsif state.current_turn == :player_2_angle~ - Inside source: true *** True Line Result - blue: "\u001b[34m", -** Processing line: ~ magenta: "\u001b[35m",~ + elsif state.current_turn == :player_2_angle +** Processing line: ~ outputs.labels << [1120, 710, "Angle: #{state.player_2_angle}_", fancy_white]~ - Inside source: true *** True Line Result - magenta: "\u001b[35m", -** Processing line: ~ cyan: "\u001b[36m",~ + outputs.labels << [1120, 710, "Angle: #{state.player_2_angle}_", fancy_white] +** Processing line: ~ elsif state.current_turn == :player_2_velocity~ - Inside source: true *** True Line Result - cyan: "\u001b[36m", -** Processing line: ~ white: "\u001b[37m",~ + elsif state.current_turn == :player_2_velocity +** Processing line: ~ outputs.labels << [1120, 710, "Angle: #{state.player_2_angle}", fancy_white]~ - Inside source: true *** True Line Result - white: "\u001b[37m", -** Processing line: ~ bright_black: "\u001b[30;1m",~ + outputs.labels << [1120, 710, "Angle: #{state.player_2_angle}", fancy_white] +** Processing line: ~ outputs.labels << [1120, 690, "Velocity: #{state.player_2_velocity}_", fancy_white]~ - Inside source: true *** True Line Result - bright_black: "\u001b[30;1m", -** Processing line: ~ bright_red: "\u001b[31;1m",~ + outputs.labels << [1120, 690, "Velocity: #{state.player_2_velocity}_", fancy_white] +** Processing line: ~ end~ - Inside source: true *** True Line Result - bright_red: "\u001b[31;1m", -** Processing line: ~ bright_green: "\u001b[32;1m",~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - bright_green: "\u001b[32;1m", -** Processing line: ~ bright_yellow: "\u001b[33;1m",~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - bright_yellow: "\u001b[33;1m", -** Processing line: ~ bright_blue: "\u001b[34;1m",~ + +** Processing line: ~ def render_banana~ - Inside source: true *** True Line Result - bright_blue: "\u001b[34;1m", -** Processing line: ~ bright_magenta: "\u001b[35;1m",~ + def render_banana +** Processing line: ~ return unless state.banana~ - Inside source: true *** True Line Result - bright_magenta: "\u001b[35;1m", -** Processing line: ~ bright_cyan: "\u001b[36;1m",~ + return unless state.banana +** Processing line: ~ rotation = state.tick_count.%(360) * 20~ - Inside source: true *** True Line Result - bright_cyan: "\u001b[36;1m", -** Processing line: ~ bright_white: "\u001b[37;1m",~ + rotation = state.tick_count.%(360) * 20 +** Processing line: ~ rotation *= -1 if state.banana.dx > 0~ - Inside source: true *** True Line Result - bright_white: "\u001b[37;1m", -** Processing line: ~ reset: "\u001b[0m",~ + rotation *= -1 if state.banana.dx > 0 +** Processing line: ~ outputs.sprites << [state.banana.x, state.banana.y, 15, 15, 'sprites/banana.png', rotation]~ - Inside source: true *** True Line Result - reset: "\u001b[0m", -** Processing line: ~ }~ + outputs.sprites << [state.banana.x, state.banana.y, 15, 15, 'sprites/banana.png', rotation] +** Processing line: ~ end~ - Inside source: true *** True Line Result - } + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ def render_holes~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Log~ + def render_holes +** Processing line: ~ outputs.sprites << state.holes.map do |s|~ - Inside source: true *** True Line Result - class Log -** Processing line: ~ def self.write_to_log_and_puts *args~ + outputs.sprites << state.holes.map do |s| +** Processing line: ~ animation_index = s.created_at.frame_index(7, 3, false)~ - Inside source: true *** True Line Result - def self.write_to_log_and_puts *args -** Processing line: ~ return if $gtk.production~ + animation_index = s.created_at.frame_index(7, 3, false) +** Processing line: ~ if animation_index~ - Inside source: true *** True Line Result - return if $gtk.production -** Processing line: ~ $gtk.append_file_root 'logs/log.txt', args.join("\n") + "\n"~ + if animation_index +** Processing line: ~ [s.sprite, [s.sprite.rect, "sprites/explosion#{animation_index}.png" ]]~ - Inside source: true *** True Line Result - $gtk.append_file_root 'logs/log.txt', args.join("\n") + "\n" -** Processing line: ~ args.each { |obj| $gtk.log obj, self }~ + [s.sprite, [s.sprite.rect, "sprites/explosion#{animation_index}.png" ]] +** Processing line: ~ else~ - Inside source: true *** True Line Result - args.each { |obj| $gtk.log obj, self } + else +** Processing line: ~ s.sprite~ +- Inside source: true +*** True Line Result + s.sprite +** 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 self.write_to_log_and_print *args~ +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - def self.write_to_log_and_print *args -** Processing line: ~ return if $gtk.production~ + def calc +** Processing line: ~ calc_generate_stage~ - Inside source: true *** True Line Result - return if $gtk.production -** Processing line: ~ $gtk.append_file_root 'logs/log.txt', args.join("\n")~ + calc_generate_stage +** Processing line: ~ calc_current_turn~ - Inside source: true *** True Line Result - $gtk.append_file_root 'logs/log.txt', args.join("\n") -** Processing line: ~ Object.print(*args)~ + calc_current_turn +** Processing line: ~ calc_banana~ - Inside source: true *** True Line Result - Object.print(*args) -** Processing line: ~ end~ + calc_banana +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.puts_important *args~ +** Processing line: ~ def calc_current_turn~ - Inside source: true *** True Line Result - def self.puts_important *args -** Processing line: ~ return if $gtk.production~ + def calc_current_turn +** Processing line: ~ return if state.current_turn~ - Inside source: true *** True Line Result - return if $gtk.production -** Processing line: ~ $gtk.append_file_root 'logs/log.txt', args.join("\n")~ + return if state.current_turn +** Processing line: ~~ - Inside source: true *** True Line Result - $gtk.append_file_root 'logs/log.txt', args.join("\n") -** Processing line: ~ $gtk.notify! "Important notification occurred."~ + +** Processing line: ~ state.current_turn = :player_1_angle~ - Inside source: true *** True Line Result - $gtk.notify! "Important notification occurred." -** Processing line: ~ args.each { |obj| $gtk.log obj }~ + state.current_turn = :player_1_angle +** Processing line: ~ state.current_turn = :player_2_angle if state.first_strike == :player_2~ - Inside source: true *** True Line Result - args.each { |obj| $gtk.log obj } -** Processing line: ~ end~ + state.current_turn = :player_2_angle if state.first_strike == :player_2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.puts *args~ +** Processing line: ~ def calc_generate_stage~ - Inside source: true *** True Line Result - def self.puts *args -** Processing line: ~ message_id, message = args~ + def calc_generate_stage +** Processing line: ~ return if state.stage_generated~ - Inside source: true *** True Line Result - message_id, message = args -** Processing line: ~ message ||= message_id~ + return if state.stage_generated +** Processing line: ~~ - Inside source: true *** True Line Result - message ||= message_id -** Processing line: ~ write_to_log_and_puts message~ + +** Processing line: ~ state.buildings << building_prefab(state.building_spacing + -20, *random_building_size)~ - Inside source: true *** True Line Result - write_to_log_and_puts message -** Processing line: ~ end~ + state.buildings << building_prefab(state.building_spacing + -20, *random_building_size) +** Processing line: ~ 8.numbers.inject(state.buildings) do |buildings, i|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 8.numbers.inject(state.buildings) do |buildings, i| +** Processing line: ~ buildings <<~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.multiline? *args~ + buildings << +** Processing line: ~ building_prefab(state.building_spacing +~ - Inside source: true *** True Line Result - def self.multiline? *args -** Processing line: ~ return true if args.length > 1~ + building_prefab(state.building_spacing + +** Processing line: ~ state.buildings.last.right,~ - Inside source: true *** True Line Result - return true if args.length > 1 -** Processing line: ~ return !args[0].to_s.multiline?~ + state.buildings.last.right, +** Processing line: ~ *random_building_size)~ - Inside source: true *** True Line Result - return !args[0].to_s.multiline? + *random_building_size) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111047,198 +115108,206 @@ 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.join_lines args~ +** Processing line: ~ building_two = state.buildings[1]~ - Inside source: true *** True Line Result - def self.join_lines args -** Processing line: ~ return "" if args.length == 0~ + building_two = state.buildings[1] +** Processing line: ~ state.player_1 = new_player(building_two.x + building_two.w.fdiv(2),~ - Inside source: true *** True Line Result - return "" if args.length == 0 -** Processing line: ~ return args if args.is_a? String~ + state.player_1 = new_player(building_two.x + building_two.w.fdiv(2), +** Processing line: ~ building_two.h)~ - Inside source: true *** True Line Result - return args if args.is_a? String -** Processing line: ~ return args[0] if args.length == 1~ + building_two.h) +** Processing line: ~~ - Inside source: true *** True Line Result - return args[0] if args.length == 1 -** Processing line: ~ return args.to_s.join("\n")~ + +** Processing line: ~ building_nine = state.buildings[-3]~ - Inside source: true *** True Line Result - return args.to_s.join("\n") -** Processing line: ~ end~ + building_nine = state.buildings[-3] +** Processing line: ~ state.player_2 = new_player(building_nine.x + building_nine.w.fdiv(2),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.player_2 = new_player(building_nine.x + building_nine.w.fdiv(2), +** Processing line: ~ building_nine.h)~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.headline name~ + building_nine.h) +** Processing line: ~ state.stage_generated = true~ - Inside source: true *** True Line Result - def self.headline name -** Processing line: ~ @asterisk_count ||= 1~ + state.stage_generated = true +** Processing line: ~ state.wind = 1.randomize(:ratio, :sign)~ - Inside source: true *** True Line Result - @asterisk_count ||= 1 -** Processing line: ~ @asterisk_count = @asterisk_count.greater(1)~ + state.wind = 1.randomize(:ratio, :sign) +** Processing line: ~ end~ - Inside source: true *** True Line Result - @asterisk_count = @asterisk_count.greater(1) -** Processing line: ~ result_from_yield = join_lines yield~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - result_from_yield = join_lines yield -** Processing line: ~ result_from_yield = result_from_yield.each_line.map { |l| " #{l}" }.join~ + +** Processing line: ~ def new_player x, y~ - Inside source: true *** True Line Result - result_from_yield = result_from_yield.each_line.map { |l| " #{l}" }.join -** Processing line: ~ r ="#{"*" * @asterisk_count} #{name}\n#{result_from_yield}"~ + def new_player x, y +** Processing line: ~ state.new_entity(:gorilla) do |p|~ - Inside source: true *** True Line Result - r ="#{"*" * @asterisk_count} #{name}\n#{result_from_yield}" -** Processing line: ~ @asterisk_count -= 1~ + state.new_entity(:gorilla) do |p| +** Processing line: ~ p.x = x - 25~ - Inside source: true *** True Line Result - @asterisk_count -= 1 -** Processing line: ~ @asterisk_count = @asterisk_count.greater(1)~ + p.x = x - 25 +** Processing line: ~ p.y = y~ - Inside source: true *** True Line Result - @asterisk_count = @asterisk_count.greater(1) -** Processing line: ~ r~ + p.y = y +** Processing line: ~ p.solid = [p.x, p.y, 50, 50]~ - Inside source: true *** True Line Result - r + p.solid = [p.x, p.y, 50, 50] ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ -- Inside source: true -*** True Line Result - -** Processing line: ~ def self.dynamic_block~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - def self.dynamic_block -** Processing line: ~ "#+BEGIN:~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - "#+BEGIN: -** Processing line: ~ #{join_lines yield}~ + +** Processing line: ~ def calc_banana~ - Inside source: true *** True Line Result - #{join_lines yield} -** Processing line: ~ #+END:~ + def calc_banana +** Processing line: ~ return unless state.banana~ - Inside source: true *** True Line Result - #+END: + return unless state.banana ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ "~ -- Inside source: true -*** True Line Result - " -** Processing line: ~ end~ +** Processing line: ~ state.banana.x += state.banana.dx~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.banana.x += state.banana.dx +** Processing line: ~ state.banana.dx += state.wind.fdiv(50)~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.puts_error *args~ + state.banana.dx += state.wind.fdiv(50) +** Processing line: ~ state.banana.y += state.banana.dy~ - Inside source: true *** True Line Result - def self.puts_error *args -** Processing line: ~ args ||= []~ + state.banana.y += state.banana.dy +** Processing line: ~ state.banana.dy -= state.gravity~ - Inside source: true *** True Line Result - args ||= [] -** Processing line: ~ title = args[0]~ + state.banana.dy -= state.gravity +** Processing line: ~ banana_collision = [state.banana.x, state.banana.y, 10, 10]~ - Inside source: true *** True Line Result - title = args[0] -** Processing line: ~ additional = args[1..-1] || []~ + banana_collision = [state.banana.x, state.banana.y, 10, 10] +** Processing line: ~~ - Inside source: true *** True Line Result - additional = args[1..-1] || [] -** Processing line: ~ additional = "" if additional.length == 0~ + +** Processing line: ~ if state.player_1 && banana_collision.intersect_rect?(state.player_1.solid)~ - Inside source: true *** True Line Result - additional = "" if additional.length == 0 -** Processing line: ~ if !title.multiline? && join_lines(additional).multiline?~ + if state.player_1 && banana_collision.intersect_rect?(state.player_1.solid) +** Processing line: ~ state.over = true~ - Inside source: true *** True Line Result - if !title.multiline? && join_lines(additional).multiline? -** Processing line: ~ message = headline "ERROR: #{title}" do~ + state.over = true +** Processing line: ~ if state.banana.owner == state.player_2~ - Inside source: true *** True Line Result - message = headline "ERROR: #{title}" do -** Processing line: ~ dynamic_block do~ + if state.banana.owner == state.player_2 +** Processing line: ~ state.winner = :player_2~ - Inside source: true *** True Line Result - dynamic_block do -** Processing line: ~ additional~ + state.winner = :player_2 +** Processing line: ~ else~ - Inside source: true *** True Line Result - additional -** Processing line: ~ end~ + else +** Processing line: ~ state.winner = :player_1~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + state.winner = :player_1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ elsif title.multiline?~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - elsif title.multiline? -** Processing line: ~ message = headline "ERROR: " do~ + +** Processing line: ~ state.player_2_score += 1~ - Inside source: true *** True Line Result - message = headline "ERROR: " do -** Processing line: ~ dynamic_block do~ + state.player_2_score += 1 +** Processing line: ~ elsif state.player_2 && banana_collision.intersect_rect?(state.player_2.solid)~ - Inside source: true *** True Line Result - dynamic_block do -** Processing line: ~ args~ + elsif state.player_2 && banana_collision.intersect_rect?(state.player_2.solid) +** Processing line: ~ state.over = true~ - Inside source: true *** True Line Result - args -** Processing line: ~ end~ + state.over = true +** Processing line: ~ if state.banana.owner == state.player_2~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + if state.banana.owner == state.player_2 +** Processing line: ~ state.winner = :player_1~ - Inside source: true *** True Line Result - end + state.winner = :player_1 ** Processing line: ~ else~ - Inside source: true *** True Line Result else -** Processing line: ~ message = "* ERROR: #{title} #{additional}".strip~ +** Processing line: ~ state.winner = :player_2~ - Inside source: true *** True Line Result - message = "* ERROR: #{title} #{additional}".strip + state.winner = :player_2 ** Processing line: ~ end~ - Inside source: true *** True Line Result end +** Processing line: ~ state.player_1_score += 1~ +- Inside source: true +*** True Line Result + state.player_1_score += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ self.puts message~ +** Processing line: ~ if state.over~ - Inside source: true *** True Line Result - self.puts message + if state.over +** Processing line: ~ place_hole~ +- Inside source: true +*** True Line Result + place_hole +** Processing line: ~ return~ +- Inside source: true +*** True Line Result + return ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111247,322 +115316,358 @@ 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.puts_info *args~ +** Processing line: ~ return if state.holes.any? do |h|~ - Inside source: true *** True Line Result - def self.puts_info *args -** Processing line: ~ args ||= []~ + return if state.holes.any? do |h| +** Processing line: ~ h.sprite.scale_rect(0.8, 0.5, 0.5).intersect_rect? [state.banana.x, state.banana.y, 10, 10]~ - Inside source: true *** True Line Result - args ||= [] -** Processing line: ~ title = args[0]~ + h.sprite.scale_rect(0.8, 0.5, 0.5).intersect_rect? [state.banana.x, state.banana.y, 10, 10] +** Processing line: ~ end~ - Inside source: true *** True Line Result - title = args[0] -** Processing line: ~ additional = args[1..-1] || []~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - additional = args[1..-1] || [] -** Processing line: ~ additional = "" if additional.length == 0~ + +** Processing line: ~ return unless state.banana.y < 0 || state.buildings.any? do |b|~ - Inside source: true *** True Line Result - additional = "" if additional.length == 0 -** Processing line: ~ if !title.multiline? && join_lines(additional).multiline?~ + return unless state.banana.y < 0 || state.buildings.any? do |b| +** Processing line: ~ b.rect.intersect_rect? [state.banana.x, state.banana.y, 1, 1]~ - Inside source: true *** True Line Result - if !title.multiline? && join_lines(additional).multiline? -** Processing line: ~ message = headline "INFO: #{title}" do~ + b.rect.intersect_rect? [state.banana.x, state.banana.y, 1, 1] +** Processing line: ~ end~ - Inside source: true *** True Line Result - message = headline "INFO: #{title}" do -** Processing line: ~ dynamic_block do~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - dynamic_block do -** Processing line: ~ additional~ + +** Processing line: ~ place_hole~ - Inside source: true *** True Line Result - additional -** Processing line: ~ end~ + place_hole +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end -** Processing line: ~ elsif title.multiline?~ + +** Processing line: ~ def place_hole~ - Inside source: true *** True Line Result - elsif title.multiline? -** Processing line: ~ message = headline "INFO: " do~ + def place_hole +** Processing line: ~ return unless state.banana~ - Inside source: true *** True Line Result - message = headline "INFO: " do -** Processing line: ~ dynamic_block do~ + return unless state.banana +** Processing line: ~~ - Inside source: true *** True Line Result - dynamic_block do -** Processing line: ~ args~ + +** Processing line: ~ state.holes << state.new_entity(:banana) do |b|~ - Inside source: true *** True Line Result - args -** Processing line: ~ end~ + state.holes << state.new_entity(:banana) do |b| +** Processing line: ~ b.sprite = [state.banana.x - 20, state.banana.y - 20, 40, 40, 'sprites/hole.png']~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + b.sprite = [state.banana.x - 20, state.banana.y - 20, 40, 40, 'sprites/hole.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ message = "* INFO: #{title} #{additional}".strip~ + +** Processing line: ~ state.banana = nil~ - Inside source: true *** True Line Result - message = "* INFO: #{title} #{additional}".strip -** Processing line: ~ end~ + state.banana = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ self.puts message~ +** Processing line: ~ def process_inputs_main~ - Inside source: true *** True Line Result - self.puts message -** Processing line: ~ end~ + def process_inputs_main +** Processing line: ~ return if state.banana~ - Inside source: true *** True Line Result - end + return if state.banana +** Processing line: ~ return if state.over~ +- Inside source: true +*** True Line Result + return if state.over ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def self.puts_once *ids, message~ +** Processing line: ~ if inputs.keyboard.key_down.enter~ - Inside source: true *** True Line Result - def self.puts_once *ids, message -** Processing line: ~ id = "#{ids}"~ + if inputs.keyboard.key_down.enter +** Processing line: ~ input_execute_turn~ - Inside source: true *** True Line Result - id = "#{ids}" -** Processing line: ~ @once ||= {}~ + input_execute_turn +** Processing line: ~ elsif inputs.keyboard.key_down.backspace~ - Inside source: true *** True Line Result - @once ||= {} -** Processing line: ~ return if @once[id]~ + elsif inputs.keyboard.key_down.backspace +** Processing line: ~ state.as_hash[state.current_turn] ||= ""~ - Inside source: true *** True Line Result - return if @once[id] -** Processing line: ~ @once[id] = id~ + state.as_hash[state.current_turn] ||= "" +** Processing line: ~ state.as_hash[state.current_turn] = state.as_hash[state.current_turn][0..-2]~ - Inside source: true *** True Line Result - @once[id] = id -** Processing line: ~ if !$gtk.cli_arguments[:replay] && !$gtk.cli_arguments[:record]~ + state.as_hash[state.current_turn] = state.as_hash[state.current_turn][0..-2] +** Processing line: ~ elsif inputs.keyboard.key_down.char~ - Inside source: true *** True Line Result - if !$gtk.cli_arguments[:replay] && !$gtk.cli_arguments[:record] -** Processing line: ~ $gtk.notify!("Open the DragonRuby Console by pressing [`] [~] [²] [^] [º] or [§]. [Message ID: #{id}].")~ + elsif inputs.keyboard.key_down.char +** Processing line: ~ state.as_hash[state.current_turn] ||= ""~ - Inside source: true *** True Line Result - $gtk.notify!("Open the DragonRuby Console by pressing [`] [~] [²] [^] [º] or [§]. [Message ID: #{id}].") -** Processing line: ~ end~ + state.as_hash[state.current_turn] ||= "" +** Processing line: ~ state.as_hash[state.current_turn] += inputs.keyboard.key_down.char~ - Inside source: true *** True Line Result - end -** Processing line: ~ write_to_log_and_puts ""~ + state.as_hash[state.current_turn] += inputs.keyboard.key_down.char +** Processing line: ~ end~ - Inside source: true *** True Line Result - write_to_log_and_puts "" -** Processing line: ~ write_to_log_and_puts "#{message.strip}"~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - write_to_log_and_puts "#{message.strip}" -** Processing line: ~ write_to_log_and_puts ""~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - write_to_log_and_puts "" -** Processing line: ~ write_to_log_and_puts "[Message ID: #{id}]"~ + +** Processing line: ~ def process_inputs_game_over~ - Inside source: true *** True Line Result - write_to_log_and_puts "[Message ID: #{id}]" -** Processing line: ~ write_to_log_and_puts ""~ + def process_inputs_game_over +** Processing line: ~ return unless state.over~ - Inside source: true *** True Line Result - write_to_log_and_puts "" -** Processing line: ~ end~ + return unless state.over +** Processing line: ~ return unless inputs.keyboard.key_down.truthy_keys.any?~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + return unless inputs.keyboard.key_down.truthy_keys.any? +** Processing line: ~ state.over = false~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.puts_once_info *ids, message~ + state.over = false +** Processing line: ~ outputs.static_solids.clear~ - Inside source: true *** True Line Result - def self.puts_once_info *ids, message -** Processing line: ~ id = "#{ids}"~ + outputs.static_solids.clear +** Processing line: ~ state.buildings.clear~ - Inside source: true *** True Line Result - id = "#{ids}" -** Processing line: ~ @once ||= {}~ + state.buildings.clear +** Processing line: ~ state.holes.clear~ - Inside source: true *** True Line Result - @once ||= {} -** Processing line: ~ return if @once[id]~ + state.holes.clear +** Processing line: ~ state.stage_generated = false~ - Inside source: true *** True Line Result - return if @once[id] -** Processing line: ~ @once[id] = id~ + state.stage_generated = false +** Processing line: ~ state.stage_rendered = false~ - Inside source: true *** True Line Result - @once[id] = id -** Processing line: ~ log_info message~ + state.stage_rendered = false +** Processing line: ~ if state.first_strike == :player_1~ - Inside source: true *** True Line Result - log_info message + if state.first_strike == :player_1 +** Processing line: ~ state.first_strike = :player_2~ +- Inside source: true +*** True Line Result + state.first_strike = :player_2 +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ state.first_strike = :player_1~ +- Inside source: true +*** True Line Result + state.first_strike = :player_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 self.print *args~ +** Processing line: ~ def process_inputs~ - Inside source: true *** True Line Result - def self.print *args -** Processing line: ~ write_to_log_and_print(*args)~ + def process_inputs +** Processing line: ~ process_inputs_main~ - Inside source: true *** True Line Result - write_to_log_and_print(*args) -** Processing line: ~ end~ + process_inputs_main +** Processing line: ~ process_inputs_game_over~ - Inside source: true *** True Line Result - end + process_inputs_game_over ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ +** Processing line: ~~ - Inside source: true *** True Line Result - end + +** Processing line: ~ def input_execute_turn~ +- Inside source: true +*** True Line Result + def input_execute_turn +** Processing line: ~ return if state.banana~ +- Inside source: true +*** True Line Result + return if state.banana ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class Object~ +** Processing line: ~ if state.current_turn == :player_1_angle && parse_or_clear!(:player_1_angle)~ - Inside source: true *** True Line Result - class Object -** Processing line: ~ def log_print *args~ + if state.current_turn == :player_1_angle && parse_or_clear!(:player_1_angle) +** Processing line: ~ state.current_turn = :player_1_velocity~ - Inside source: true *** True Line Result - def log_print *args -** Processing line: ~ GTK::Log.print(*args)~ + state.current_turn = :player_1_velocity +** Processing line: ~ elsif state.current_turn == :player_1_velocity && parse_or_clear!(:player_1_velocity)~ - Inside source: true *** True Line Result - GTK::Log.print(*args) -** Processing line: ~ end~ + elsif state.current_turn == :player_1_velocity && parse_or_clear!(:player_1_velocity) +** Processing line: ~ state.current_turn = :player_2_angle~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.current_turn = :player_2_angle +** Processing line: ~ state.banana =~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_important *args~ + state.banana = +** Processing line: ~ new_banana(state.player_1,~ - Inside source: true *** True Line Result - def log_important *args -** Processing line: ~ GTK::Log.puts_important(*args)~ + new_banana(state.player_1, +** Processing line: ~ state.player_1.x + 25,~ - Inside source: true *** True Line Result - GTK::Log.puts_important(*args) -** Processing line: ~ end~ + state.player_1.x + 25, +** Processing line: ~ state.player_1.y + 60,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.player_1.y + 60, +** Processing line: ~ state.player_1_angle,~ - Inside source: true *** True Line Result - -** Processing line: ~ def log *args~ + state.player_1_angle, +** Processing line: ~ state.player_1_velocity)~ - Inside source: true *** True Line Result - def log *args -** Processing line: ~ GTK::Log.puts(*args)~ + state.player_1_velocity) +** Processing line: ~ elsif state.current_turn == :player_2_angle && parse_or_clear!(:player_2_angle)~ - Inside source: true *** True Line Result - GTK::Log.puts(*args) -** Processing line: ~ end~ + elsif state.current_turn == :player_2_angle && parse_or_clear!(:player_2_angle) +** Processing line: ~ state.current_turn = :player_2_velocity~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.current_turn = :player_2_velocity +** Processing line: ~ elsif state.current_turn == :player_2_velocity && parse_or_clear!(:player_2_velocity)~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_with_color xterm_escape_code, *args~ + elsif state.current_turn == :player_2_velocity && parse_or_clear!(:player_2_velocity) +** Processing line: ~ state.current_turn = :player_1_angle~ - Inside source: true *** True Line Result - def log_with_color xterm_escape_code, *args -** Processing line: ~ log_print xterm_escape_code~ + state.current_turn = :player_1_angle +** Processing line: ~ state.banana =~ - Inside source: true *** True Line Result - log_print xterm_escape_code -** Processing line: ~ log(*args)~ + state.banana = +** Processing line: ~ new_banana(state.player_2,~ - Inside source: true *** True Line Result - log(*args) -** Processing line: ~ ensure~ + new_banana(state.player_2, +** Processing line: ~ state.player_2.x + 25,~ - Inside source: true *** True Line Result - ensure -** Processing line: ~ log_reset_color~ + state.player_2.x + 25, +** Processing line: ~ state.player_2.y + 60,~ - Inside source: true *** True Line Result - log_reset_color -** Processing line: ~ end~ + state.player_2.y + 60, +** Processing line: ~ 180 - state.player_2_angle,~ - Inside source: true *** True Line Result - end + 180 - state.player_2_angle, +** Processing line: ~ state.player_2_velocity)~ +- Inside source: true +*** True Line Result + state.player_2_velocity) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def log_reset_color~ +** Processing line: ~ if state.banana~ - Inside source: true *** True Line Result - def log_reset_color -** Processing line: ~ log_print XTERM_COLOR[:reset]~ + if state.banana +** Processing line: ~ state.player_1_angle = nil~ - Inside source: true *** True Line Result - log_print XTERM_COLOR[:reset] -** Processing line: ~ end~ + state.player_1_angle = nil +** Processing line: ~ state.player_1_velocity = nil~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.player_1_velocity = nil +** Processing line: ~ state.player_2_angle = nil~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_black *args~ + state.player_2_angle = nil +** Processing line: ~ state.player_2_velocity = nil~ - Inside source: true *** True Line Result - def log_black *args -** Processing line: ~ log_with_color XTERM_COLOR[:black], *args~ + state.player_2_velocity = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:black], *args + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111571,14 +115676,14 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def log_red *args~ +** Processing line: ~ def random_building_size~ - Inside source: true *** True Line Result - def log_red *args -** Processing line: ~ log_with_color XTERM_COLOR[:red], *args~ + def random_building_size +** Processing line: ~ [state.building_heights.sample, state.building_room_sizes.sample]~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:red], *args + [state.building_heights.sample, state.building_room_sizes.sample] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111587,14 +115692,14 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def log_green *args~ +** Processing line: ~ def int? v~ - Inside source: true *** True Line Result - def log_green *args -** Processing line: ~ log_with_color XTERM_COLOR[:green], *args~ + def int? v +** Processing line: ~ v.to_i.to_s == v.to_s~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:green], *args + v.to_i.to_s == v.to_s ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111603,14 +115708,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 log_yellow *args~ +** Processing line: ~ def random_building_color~ - Inside source: true *** True Line Result - def log_yellow *args -** Processing line: ~ log_with_color XTERM_COLOR[:yellow], *args~ + def random_building_color +** Processing line: ~ [[ 99, 0, 107],~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:yellow], *args + [[ 99, 0, 107], +** Processing line: ~ [ 35, 64, 124],~ +- Inside source: true +*** True Line Result + [ 35, 64, 124], +** Processing line: ~ [ 35, 136, 162],~ +- Inside source: true +*** True Line Result + [ 35, 136, 162], +** Processing line: ~ ].sample~ +- Inside source: true +*** True Line Result + ].sample ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111619,14 +115736,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 log_blue *args~ +** Processing line: ~ def random_window_color~ - Inside source: true *** True Line Result - def log_blue *args -** Processing line: ~ log_with_color XTERM_COLOR[:blue], *args~ + def random_window_color +** Processing line: ~ [[ 88, 62, 104],~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:blue], *args + [[ 88, 62, 104], +** Processing line: ~ [253, 224, 187]].sample~ +- Inside source: true +*** True Line Result + [253, 224, 187]].sample ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111635,46 +115756,50 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def log_magenta *args~ +** Processing line: ~ def windows_for_building starting_x, floors, rooms~ - Inside source: true *** True Line Result - def log_magenta *args -** Processing line: ~ log_with_color XTERM_COLOR[:magenta], *args~ + def windows_for_building starting_x, floors, rooms +** Processing line: ~ floors.-(1).combinations(rooms - 1).map do |floor, room|~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:magenta], *args -** Processing line: ~ end~ + floors.-(1).combinations(rooms - 1).map do |floor, room| +** Processing line: ~ [starting_x +~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + [starting_x + +** Processing line: ~ state.building_room_width.*(room) +~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_cyan *args~ + state.building_room_width.*(room) + +** Processing line: ~ state.building_room_spacing.*(room + 1),~ - Inside source: true *** True Line Result - def log_cyan *args -** Processing line: ~ log_with_color XTERM_COLOR[:cyan], *args~ + state.building_room_spacing.*(room + 1), +** Processing line: ~ state.building_room_height.*(floor) +~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:cyan], *args -** Processing line: ~ end~ + state.building_room_height.*(floor) + +** Processing line: ~ state.building_room_spacing.*(floor + 1),~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.building_room_spacing.*(floor + 1), +** Processing line: ~ state.building_room_width,~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_white *args~ + state.building_room_width, +** Processing line: ~ state.building_room_height,~ - Inside source: true *** True Line Result - def log_white *args -** Processing line: ~ log_with_color XTERM_COLOR[:white], *args~ + state.building_room_height, +** Processing line: ~ random_window_color]~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:white], *args + random_window_color] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111683,62 +115808,62 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def log_bright_black *args~ +** Processing line: ~ def building_prefab starting_x, floors, rooms~ - Inside source: true *** True Line Result - def log_bright_black *args -** Processing line: ~ log_with_color XTERM_COLOR[:bright_black], *args~ + def building_prefab starting_x, floors, rooms +** Processing line: ~ state.new_entity(:building) do |b|~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:bright_black], *args -** Processing line: ~ end~ + state.new_entity(:building) do |b| +** Processing line: ~ b.x = starting_x~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + b.x = starting_x +** Processing line: ~ b.y = 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_bright_red *args~ + b.y = 0 +** Processing line: ~ b.w = state.building_room_width.*(rooms) +~ - Inside source: true *** True Line Result - def log_bright_red *args -** Processing line: ~ log_with_color XTERM_COLOR[:bright_red], *args~ + b.w = state.building_room_width.*(rooms) + +** Processing line: ~ state.building_room_spacing.*(rooms + 1)~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:bright_red], *args -** Processing line: ~ end~ + state.building_room_spacing.*(rooms + 1) +** Processing line: ~ b.h = state.building_room_height.*(floors) +~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + b.h = state.building_room_height.*(floors) + +** Processing line: ~ state.building_room_spacing.*(floors + 1)~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_bright_green *args~ + state.building_room_spacing.*(floors + 1) +** Processing line: ~ b.right = b.x + b.w~ - Inside source: true *** True Line Result - def log_bright_green *args -** Processing line: ~ log_with_color XTERM_COLOR[:bright_green], *args~ + b.right = b.x + b.w +** Processing line: ~ b.rect = [b.x, b.y, b.w, b.h]~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:bright_green], *args -** Processing line: ~ end~ + b.rect = [b.x, b.y, b.w, b.h] +** Processing line: ~ b.solids = [[b.x - 1, b.y, b.w + 2, b.h + 1, fancy_white],~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + b.solids = [[b.x - 1, b.y, b.w + 2, b.h + 1, fancy_white], +** Processing line: ~ [b.x, b.y, b.w, b.h, random_building_color],~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_bright_yellow *args~ + [b.x, b.y, b.w, b.h, random_building_color], +** Processing line: ~ windows_for_building(b.x, floors, rooms)]~ - Inside source: true *** True Line Result - def log_bright_yellow *args -** Processing line: ~ log_with_color XTERM_COLOR[:bright_yellow], *args~ + windows_for_building(b.x, floors, rooms)] +** Processing line: ~ end~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:bright_yellow], *args + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111747,30 +115872,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 log_bright_blue *args~ +** Processing line: ~ def parse_or_clear! game_prop~ - Inside source: true *** True Line Result - def log_bright_blue *args -** Processing line: ~ log_with_color XTERM_COLOR[:bright_blue], *args~ + def parse_or_clear! game_prop +** Processing line: ~ if int? state.as_hash[game_prop]~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:bright_blue], *args -** Processing line: ~ end~ + if int? state.as_hash[game_prop] +** Processing line: ~ state.as_hash[game_prop] = state.as_hash[game_prop].to_i~ - Inside source: true *** True Line Result - end + state.as_hash[game_prop] = state.as_hash[game_prop].to_i +** Processing line: ~ return true~ +- Inside source: true +*** True Line Result + return true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def log_bright_magenta *args~ +** Processing line: ~ state.as_hash[game_prop] = nil~ - Inside source: true *** True Line Result - def log_bright_magenta *args -** Processing line: ~ log_with_color XTERM_COLOR[:bright_magenta], *args~ + state.as_hash[game_prop] = nil +** Processing line: ~ return false~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:bright_magenta], *args + return false ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111779,46 +115912,46 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def log_bright_cyan *args~ +** Processing line: ~ def new_banana owner, x, y, angle, velocity~ - Inside source: true *** True Line Result - def log_bright_cyan *args -** Processing line: ~ log_with_color XTERM_COLOR[:bright_cyan], *args~ + def new_banana owner, x, y, angle, velocity +** Processing line: ~ state.new_entity(:banana) do |b|~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:bright_cyan], *args -** Processing line: ~ end~ + state.new_entity(:banana) do |b| +** Processing line: ~ b.owner = owner~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + b.owner = owner +** Processing line: ~ b.x = x~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_bright_white *args~ + b.x = x +** Processing line: ~ b.y = y~ - Inside source: true *** True Line Result - def log_bright_white *args -** Processing line: ~ log_with_color XTERM_COLOR[:bright_white], *args~ + b.y = y +** Processing line: ~ b.angle = angle % 360~ - Inside source: true *** True Line Result - log_with_color XTERM_COLOR[:bright_white], *args -** Processing line: ~ end~ + b.angle = angle % 360 +** Processing line: ~ b.velocity = velocity / 5~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + b.velocity = velocity / 5 +** Processing line: ~ b.dx = b.angle.vector_x(b.velocity)~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_error *args~ + b.dx = b.angle.vector_x(b.velocity) +** Processing line: ~ b.dy = b.angle.vector_y(b.velocity)~ - Inside source: true *** True Line Result - def log_error *args -** Processing line: ~ GTK::Log.puts_error(*args)~ + b.dy = b.angle.vector_y(b.velocity) +** Processing line: ~ end~ - Inside source: true *** True Line Result - GTK::Log.puts_error(*args) + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111827,50 +115960,58 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def log_info *args~ +** Processing line: ~ def fancy_white~ - Inside source: true *** True Line Result - def log_info *args -** Processing line: ~ GTK::Log.puts_info(*args)~ + def fancy_white +** Processing line: ~ [253, 252, 253]~ - Inside source: true *** True Line Result - GTK::Log.puts_info(*args) + [253, 252, 253] ** 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 log_once *ids, message~ +** Processing line: ~ $you_so_basic_gorillas = YouSoBasicGorillas.new~ - Inside source: true *** True Line Result - def log_once *ids, message -** Processing line: ~ GTK::Log.puts_once(*ids, message)~ + $you_so_basic_gorillas = YouSoBasicGorillas.new +** Processing line: ~~ - Inside source: true *** True Line Result - GTK::Log.puts_once(*ids, message) -** Processing line: ~ end~ + +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + def tick args +** Processing line: ~ $you_so_basic_gorillas.outputs = args.outputs~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_once_info *ids, message~ + $you_so_basic_gorillas.outputs = args.outputs +** Processing line: ~ $you_so_basic_gorillas.grid = args.grid~ - Inside source: true *** True Line Result - def log_once_info *ids, message -** Processing line: ~ GTK::Log.puts_once_info(*ids, message)~ + $you_so_basic_gorillas.grid = args.grid +** Processing line: ~ $you_so_basic_gorillas.state = args.state~ - Inside source: true *** True Line Result - GTK::Log.puts_once_info(*ids, message) -** Processing line: ~ end~ + $you_so_basic_gorillas.state = args.state +** Processing line: ~ $you_so_basic_gorillas.inputs = args.inputs~ - Inside source: true *** True Line Result - end + $you_so_basic_gorillas.inputs = args.inputs +** Processing line: ~ $you_so_basic_gorillas.tick~ +- Inside source: true +*** True Line Result + $you_so_basic_gorillas.tick ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -111887,182 +116028,190 @@ Follows is a source code listing for all files that have been open sourced. This - End of paragraph detected. *** True Line Result -** Processing line: ~* numeric.rb~ +** Processing line: ~*** Platformer - Gorillas Basic - tests.rb~ - Header detected. *** True Line Result *** True Line Result -* numeric.rb +*** Platformer - Gorillas Basic - 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: ~ # ./dragon/numeric.rb~ +** Processing line: ~ # ./samples/99_genre_platformer/gorillas_basic/app/tests.rb~ - Inside source: true *** True Line Result - # ./dragon/numeric.rb -** Processing line: ~ # coding: utf-8~ + # ./samples/99_genre_platformer/gorillas_basic/app/tests.rb +** Processing line: ~ $gtk.reset 100~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + $gtk.reset 100 +** Processing line: ~ $gtk.supress_framerate_warning = true~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + $gtk.supress_framerate_warning = true +** Processing line: ~ $gtk.require 'app/tests/building_generation_tests.rb'~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # numeric.rb has been released under MIT (*only this file*).~ + $gtk.require 'app/tests/building_generation_tests.rb' +** Processing line: ~ $gtk.tests.start~ - Inside source: true *** True Line Result - # numeric.rb has been released under MIT (*only this file*). + $gtk.tests.start ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class Numeric~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - class Numeric -** Processing line: ~ include ValueType~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - include ValueType -** Processing line: ~ include NumericDeprecated~ -- Inside source: true + +** Processing line: ~*** Platformer - Gorillas Basic - Tests - building_generation_tests.rb~ +- Header detected. *** True Line Result - include NumericDeprecated -** Processing line: ~~ -- Inside source: true + +*** True Line Result +*** Platformer - Gorillas Basic - Tests - building_generation_tests.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ alias_method :gte, :>=~ +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_platformer/gorillas_basic/app/tests/building_generation_tests.rb~ - Inside source: true *** True Line Result - alias_method :gte, :>= -** Processing line: ~ alias_method :lte, :<=~ + # ./samples/99_genre_platformer/gorillas_basic/app/tests/building_generation_tests.rb +** Processing line: ~ def test_solids args, assert~ - Inside source: true *** True Line Result - alias_method :lte, :<= -** Processing line: ~~ + def test_solids args, assert +** Processing line: ~ game = YouSoBasicGorillas.new~ - Inside source: true *** True Line Result - -** Processing line: ~ # Converts a numeric value representing seconds into frames.~ + game = YouSoBasicGorillas.new +** Processing line: ~ game.outputs = args.outputs~ - Inside source: true *** True Line Result - # Converts a numeric value representing seconds into frames. -** Processing line: ~ #~ + game.outputs = args.outputs +** Processing line: ~ game.grid = args.grid~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + game.grid = args.grid +** Processing line: ~ game.state = args.state~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def seconds~ + game.state = args.state +** Processing line: ~ game.inputs = args.inputs~ - Inside source: true *** True Line Result - def seconds -** Processing line: ~ self * 60~ + game.inputs = args.inputs +** Processing line: ~ game.tick~ - Inside source: true *** True Line Result - self * 60 -** Processing line: ~ end~ + game.tick +** Processing line: ~ assert.true! args.state.stage_generated, "stage wasn't generated but it should have been"~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + assert.true! args.state.stage_generated, "stage wasn't generated but it should have been" +** Processing line: ~ game.tick~ - Inside source: true *** True Line Result - -** Processing line: ~ # Divides the number by `2.0` and returns a `float`.~ + game.tick +** Processing line: ~ assert.true! args.outputs.static_solids.length > 0, "stage wasn't rendered"~ - Inside source: true *** True Line Result - # Divides the number by `2.0` and returns a `float`. -** Processing line: ~ #~ + assert.true! args.outputs.static_solids.length > 0, "stage wasn't rendered" +** Processing line: ~ number_of_building_components = (args.state.buildings.map { |b| 2 + b.solids[2].length }.inject do |sum, v| (sum || 0) + v end)~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + number_of_building_components = (args.state.buildings.map { |b| 2 + b.solids[2].length }.inject do |sum, v| (sum || 0) + v end) +** Processing line: ~ the_only_background = 1~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def half~ + the_only_background = 1 +** Processing line: ~ static_solids = args.outputs.static_solids.length~ - Inside source: true *** True Line Result - def half -** Processing line: ~ self / 2.0~ + static_solids = args.outputs.static_solids.length +** Processing line: ~ assert.true! static_solids == the_only_background.+(number_of_building_components), "not all parts of the buildings and background were rendered"~ - Inside source: true *** True Line Result - self / 2.0 -** Processing line: ~ end~ + assert.true! static_solids == the_only_background.+(number_of_building_components), "not all parts of the buildings and background were rendered" +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def to_byte~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - def to_byte -** Processing line: ~ clamp(0, 255).to_i~ -- Inside source: true +#+end_src +** Processing line: ~~ +- End of paragraph detected. *** True Line Result - clamp(0, 255).to_i -** Processing line: ~ end~ -- Inside source: true + +** Processing line: ~*** Platformer - The Little Probe - main.rb~ +- Header detected. *** True Line Result - end -** Processing line: ~~ -- Inside source: true + +*** True Line Result +*** Platformer - The Little Probe - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ def elapsed_time tick_count_override = nil~ +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_platformer/the_little_probe/app/main.rb~ - Inside source: true *** True Line Result - def elapsed_time tick_count_override = nil -** Processing line: ~ (tick_count_override || Kernel.tick_count) - self~ + # ./samples/99_genre_platformer/the_little_probe/app/main.rb +** Processing line: ~ class FallingCircle~ - Inside source: true *** True Line Result - (tick_count_override || Kernel.tick_count) - self -** Processing line: ~ end~ + class FallingCircle +** Processing line: ~ attr_gtk~ - Inside source: true *** True Line Result - end + attr_gtk ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def elapsed_time_percent duration~ +** Processing line: ~ def tick~ - Inside source: true *** True Line Result - def elapsed_time_percent duration -** Processing line: ~ elapsed_time.percentage_of duration~ + def tick +** Processing line: ~ fiddle~ - Inside source: true *** True Line Result - elapsed_time.percentage_of duration -** Processing line: ~ end~ + fiddle +** Processing line: ~ defaults~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + defaults +** Processing line: ~ render~ - Inside source: true *** True Line Result - -** Processing line: ~ def new?~ + render +** Processing line: ~ input~ - Inside source: true *** True Line Result - def new? -** Processing line: ~ elapsed_time == 0~ + input +** Processing line: ~ calc~ - Inside source: true *** True Line Result - elapsed_time == 0 + calc ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -112071,34 +116220,26 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Returns `true` if the numeric value has passed a duration/offset number.~ -- Inside source: true -*** True Line Result - # Returns `true` if the numeric value has passed a duration/offset number. -** Processing line: ~ # `Kernel.tick_count` is used to determine if a number represents an elapsed~ -- Inside source: true -*** True Line Result - # `Kernel.tick_count` is used to determine if a number represents an elapsed -** Processing line: ~ # moment in time.~ +** Processing line: ~ def fiddle~ - Inside source: true *** True Line Result - # moment in time. -** Processing line: ~ #~ + def fiddle +** Processing line: ~ state.gravity = -0.02~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + state.gravity = -0.02 +** Processing line: ~ circle.radius = 15~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def elapsed? offset = 0, tick_count_override = Kernel.tick_count~ + circle.radius = 15 +** Processing line: ~ circle.elasticity = 0.4~ - Inside source: true *** True Line Result - def elapsed? offset = 0, tick_count_override = Kernel.tick_count -** Processing line: ~ (self + offset) < tick_count_override~ + circle.elasticity = 0.4 +** Processing line: ~ camera.follow_speed = 0.4 * 0.4~ - Inside source: true *** True Line Result - (self + offset) < tick_count_override + camera.follow_speed = 0.4 * 0.4 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -112107,42 +116248,42 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def frame_index *opts~ +** Processing line: ~ def render~ - Inside source: true *** True Line Result - def frame_index *opts -** Processing line: ~ frame_count_or_hash, hold_for, repeat, tick_count_override = opts~ + def render +** Processing line: ~ render_stage_editor~ - Inside source: true *** True Line Result - frame_count_or_hash, hold_for, repeat, tick_count_override = opts -** Processing line: ~ if frame_count_or_hash.is_a? Hash~ + render_stage_editor +** Processing line: ~ render_debug~ - Inside source: true *** True Line Result - if frame_count_or_hash.is_a? Hash -** Processing line: ~ frame_count = frame_count_or_hash[:count]~ + render_debug +** Processing line: ~ render_game~ - Inside source: true *** True Line Result - frame_count = frame_count_or_hash[:count] -** Processing line: ~ hold_for = frame_count_or_hash[:hold_for]~ + render_game +** Processing line: ~ end~ - Inside source: true *** True Line Result - hold_for = frame_count_or_hash[:hold_for] -** Processing line: ~ repeat = frame_count_or_hash[:repeat]~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - repeat = frame_count_or_hash[:repeat] -** Processing line: ~ tick_count_override = frame_count_or_hash[:tick_count_override]~ + +** Processing line: ~ def defaults~ - Inside source: true *** True Line Result - tick_count_override = frame_count_or_hash[:tick_count_override] -** Processing line: ~ else~ + def defaults +** Processing line: ~ if state.tick_count == 0~ - Inside source: true *** True Line Result - else -** Processing line: ~ frame_count = frame_count_or_hash~ + if state.tick_count == 0 +** Processing line: ~ outputs.sounds << "sounds/bg.ogg"~ - Inside source: true *** True Line Result - frame_count = frame_count_or_hash + outputs.sounds << "sounds/bg.ogg" ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -112151,170 +116292,178 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ tick_count_override ||= Kernel.tick_count~ +** Processing line: ~ state.storyline ||= [~ - Inside source: true *** True Line Result - tick_count_override ||= Kernel.tick_count -** Processing line: ~ animation_frame_count = frame_count~ + state.storyline ||= [ +** Processing line: ~ { text: "<- -> to aim, hold space to charge", distance_gate: 0 },~ - Inside source: true *** True Line Result - animation_frame_count = frame_count -** Processing line: ~ animation_frame_hold_time = hold_for~ + { text: "<- -> to aim, hold space to charge", distance_gate: 0 }, +** Processing line: ~ { text: "the little probe - by @amirrajan, made with DragonRuby Game Toolkit", distance_gate: 0 },~ - Inside source: true *** True Line Result - animation_frame_hold_time = hold_for -** Processing line: ~ animation_length = animation_frame_hold_time * animation_frame_count~ + { text: "the little probe - by @amirrajan, made with DragonRuby Game Toolkit", distance_gate: 0 }, +** Processing line: ~ { text: "mission control, this is sasha. landing on europa successful.", distance_gate: 0 },~ - Inside source: true *** True Line Result - animation_length = animation_frame_hold_time * animation_frame_count -** Processing line: ~ return nil if Kernel.tick_count < self~ + { text: "mission control, this is sasha. landing on europa successful.", distance_gate: 0 }, +** Processing line: ~ { text: "operation \"find earth 2.0\", initiated at 8-29-2036 14:00.", distance_gate: 0 },~ - Inside source: true *** True Line Result - return nil if Kernel.tick_count < self -** Processing line: ~~ + { text: "operation \"find earth 2.0\", initiated at 8-29-2036 14:00.", distance_gate: 0 }, +** Processing line: ~ { text: "jupiter's sure is beautiful...", distance_gate: 4000 },~ - Inside source: true *** True Line Result - -** Processing line: ~ if !repeat && (self + animation_length) < (tick_count_override - 1)~ + { text: "jupiter's sure is beautiful...", distance_gate: 4000 }, +** Processing line: ~ { text: "hmm, it seems there's some kind of anomoly in the sky", distance_gate: 7000 },~ - Inside source: true *** True Line Result - if !repeat && (self + animation_length) < (tick_count_override - 1) -** Processing line: ~ return nil~ + { text: "hmm, it seems there's some kind of anomoly in the sky", distance_gate: 7000 }, +** Processing line: ~ { text: "dancing lights, i'll call them whisps.", distance_gate: 8000 },~ - Inside source: true *** True Line Result - return nil -** Processing line: ~ else~ + { text: "dancing lights, i'll call them whisps.", distance_gate: 8000 }, +** Processing line: ~ { text: "#todo... look i ran out of time -_-", distance_gate: 9000 },~ - Inside source: true *** True Line Result - else -** Processing line: ~ return self.elapsed_time.-(1).idiv(animation_frame_hold_time) % animation_frame_count~ + { text: "#todo... look i ran out of time -_-", distance_gate: 9000 }, +** Processing line: ~ { text: "there's never enough time", distance_gate: 9000 },~ - Inside source: true *** True Line Result - return self.elapsed_time.-(1).idiv(animation_frame_hold_time) % animation_frame_count -** Processing line: ~ end~ + { text: "there's never enough time", distance_gate: 9000 }, +** Processing line: ~ { text: "the game jam was fun though ^_^", distance_gate: 10000 },~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + { text: "the game jam was fun though ^_^", distance_gate: 10000 }, +** Processing line: ~ ]~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise <<-S~ + ] +** Processing line: ~~ - Inside source: true *** True Line Result - raise <<-S -** Processing line: ~ * ERROR:~ + +** Processing line: ~ load_level force: args.state.tick_count == 0~ - Inside source: true *** True Line Result - * ERROR: -** Processing line: ~ #{opts}~ + load_level force: args.state.tick_count == 0 +** Processing line: ~ state.line_mode ||= :terrain~ - Inside source: true *** True Line Result - #{opts} -** Processing line: ~ #{e}~ + state.line_mode ||= :terrain +** Processing line: ~~ - Inside source: true *** True Line Result - #{e} -** Processing line: ~ S~ + +** Processing line: ~ state.sound_index ||= 1~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + state.sound_index ||= 1 +** Processing line: ~ circle.potential_lift ||= 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + circle.potential_lift ||= 0 +** Processing line: ~ circle.angle ||= 90~ - Inside source: true *** True Line Result - -** Processing line: ~ def zero?~ + circle.angle ||= 90 +** Processing line: ~ circle.check_point_at ||= -1000~ - Inside source: true *** True Line Result - def zero? -** Processing line: ~ self == 0~ -- Inside source: true -*** True Line Result - self == 0 -** Processing line: ~ end~ + circle.check_point_at ||= -1000 +** Processing line: ~ circle.game_over_at ||= -1000~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + circle.game_over_at ||= -1000 +** Processing line: ~ circle.x ||= -485~ - Inside source: true *** True Line Result - -** Processing line: ~ def zero~ + circle.x ||= -485 +** Processing line: ~ circle.y ||= 12226~ - Inside source: true *** True Line Result - def zero -** Processing line: ~ 0~ + circle.y ||= 12226 +** Processing line: ~ circle.check_point_x ||= circle.x~ - Inside source: true *** True Line Result - 0 -** Processing line: ~ end~ + circle.check_point_x ||= circle.x +** Processing line: ~ circle.check_point_y ||= circle.y~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + circle.check_point_y ||= circle.y +** Processing line: ~ circle.dy ||= 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def one~ + circle.dy ||= 0 +** Processing line: ~ circle.dx ||= 0~ - Inside source: true *** True Line Result - def one -** Processing line: ~ 1~ + circle.dx ||= 0 +** Processing line: ~ circle.previous_dy ||= 0~ - Inside source: true *** True Line Result - 1 -** Processing line: ~ end~ + circle.previous_dy ||= 0 +** Processing line: ~ circle.previous_dx ||= 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + circle.previous_dx ||= 0 +** Processing line: ~ circle.angle ||= 0~ - Inside source: true *** True Line Result - -** Processing line: ~ def two~ + circle.angle ||= 0 +** Processing line: ~ circle.after_images ||= []~ - Inside source: true *** True Line Result - def two -** Processing line: ~ 2~ + circle.after_images ||= [] +** Processing line: ~ circle.terrains_to_monitor ||= {}~ - Inside source: true *** True Line Result - 2 -** Processing line: ~ end~ + circle.terrains_to_monitor ||= {} +** Processing line: ~ circle.impact_history ||= []~ - Inside source: true *** True Line Result - end + circle.impact_history ||= [] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def five~ +** Processing line: ~ camera.x ||= 0~ - Inside source: true *** True Line Result - def five -** Processing line: ~ 5~ + camera.x ||= 0 +** Processing line: ~ camera.y ||= 0~ - Inside source: true *** True Line Result - 5 -** Processing line: ~ end~ + camera.y ||= 0 +** Processing line: ~ camera.target_x ||= 0~ - Inside source: true *** True Line Result - end + camera.target_x ||= 0 +** Processing line: ~ camera.target_y ||= 0~ +- Inside source: true +*** True Line Result + camera.target_y ||= 0 +** Processing line: ~ state.snaps ||= { }~ +- Inside source: true +*** True Line Result + state.snaps ||= { } +** Processing line: ~ state.snap_number = 10~ +- Inside source: true +*** True Line Result + state.snap_number = 10 ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def ten~ +** Processing line: ~ args.state.storyline_x ||= -1000~ - Inside source: true *** True Line Result - def ten -** Processing line: ~ 10~ + args.state.storyline_x ||= -1000 +** Processing line: ~ args.state.storyline_y ||= -1000~ - Inside source: true *** True Line Result - 10 + args.state.storyline_y ||= -1000 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -112323,70 +116472,70 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ alias_method :gt, :>~ +** Processing line: ~ def render_game~ - Inside source: true *** True Line Result - alias_method :gt, :> -** Processing line: ~ alias_method :above?, :>~ + def render_game +** Processing line: ~ outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - alias_method :above?, :> -** Processing line: ~ alias_method :right_of?, :>~ + outputs.background_color = [0, 0, 0] +** Processing line: ~ outputs.sprites << [-circle.x + 1100,~ - Inside source: true *** True Line Result - alias_method :right_of?, :> -** Processing line: ~~ + outputs.sprites << [-circle.x + 1100, +** Processing line: ~ -circle.y - 100,~ - Inside source: true *** True Line Result - -** Processing line: ~ alias_method :lt, :<~ + -circle.y - 100, +** Processing line: ~ 2416 * 4,~ - Inside source: true *** True Line Result - alias_method :lt, :< -** Processing line: ~ alias_method :below?, :<~ + 2416 * 4, +** Processing line: ~ 3574 * 4,~ - Inside source: true *** True Line Result - alias_method :below?, :< -** Processing line: ~ alias_method :left_of?, :<~ + 3574 * 4, +** Processing line: ~ 'sprites/jupiter.png']~ - Inside source: true *** True Line Result - alias_method :left_of?, :< -** Processing line: ~~ + 'sprites/jupiter.png'] +** Processing line: ~ outputs.sprites << [-circle.x,~ - Inside source: true *** True Line Result - -** Processing line: ~ def shift_right i~ + outputs.sprites << [-circle.x, +** Processing line: ~ -circle.y,~ - Inside source: true *** True Line Result - def shift_right i -** Processing line: ~ self + i~ + -circle.y, +** Processing line: ~ 2416 * 4,~ - Inside source: true *** True Line Result - self + i -** Processing line: ~ end~ + 2416 * 4, +** Processing line: ~ 3574 * 4,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 3574 * 4, +** Processing line: ~ 'sprites/level.png']~ - Inside source: true *** True Line Result - -** Processing line: ~ def shift_left i~ + 'sprites/level.png'] +** Processing line: ~ outputs.sprites << state.whisp_queue~ - Inside source: true *** True Line Result - def shift_left i -** Processing line: ~ shift_right(i * -1)~ + outputs.sprites << state.whisp_queue +** Processing line: ~ render_aiming_retical~ - Inside source: true *** True Line Result - shift_right(i * -1) -** Processing line: ~ rescue Exception => e~ + render_aiming_retical +** Processing line: ~ render_circle~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise_immediately e, :shift_left, i~ + render_circle +** Processing line: ~ render_notification~ - Inside source: true *** True Line Result - raise_immediately e, :shift_left, i + render_notification ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -112395,126 +116544,118 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def shift_up i~ -- Inside source: true -*** True Line Result - def shift_up i -** Processing line: ~ self + i~ -- Inside source: true -*** True Line Result - self + i -** Processing line: ~ rescue Exception => e~ -- Inside source: true -*** True Line Result - rescue Exception => e -** Processing line: ~ raise_immediately e, :shift_up, i~ +** Processing line: ~ def render_notification~ - Inside source: true *** True Line Result - raise_immediately e, :shift_up, i -** Processing line: ~ end~ + def render_notification +** Processing line: ~ toast_length = 500~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + toast_length = 500 +** Processing line: ~ if circle.game_over_at.elapsed_time < toast_length~ - Inside source: true *** True Line Result - -** Processing line: ~ def shift_down i~ + if circle.game_over_at.elapsed_time < toast_length +** Processing line: ~ label_text = "..."~ - Inside source: true *** True Line Result - def shift_down i -** Processing line: ~ shift_up(i * -1)~ + label_text = "..." +** Processing line: ~ elsif circle.check_point_at.elapsed_time > toast_length~ - Inside source: true *** True Line Result - shift_up(i * -1) -** Processing line: ~ rescue Exception => e~ + elsif circle.check_point_at.elapsed_time > toast_length +** Processing line: ~ args.state.current_storyline = nil~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise_immediately e, :shift_down, i~ + args.state.current_storyline = nil +** Processing line: ~ return~ - Inside source: true *** True Line Result - raise_immediately e, :shift_down, i -** Processing line: ~ end~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ if circle.check_point_at &&~ - Inside source: true *** True Line Result - -** Processing line: ~ # This provides a way for a numeric value to be randomized based on a combination~ + if circle.check_point_at && +** Processing line: ~ circle.check_point_at.elapsed_time == 1 &&~ - Inside source: true *** True Line Result - # This provides a way for a numeric value to be randomized based on a combination -** Processing line: ~ # of two options: `:sign` and `:ratio`.~ + circle.check_point_at.elapsed_time == 1 && +** Processing line: ~ !args.state.current_storyline~ - Inside source: true *** True Line Result - # of two options: `:sign` and `:ratio`. -** Processing line: ~ #~ + !args.state.current_storyline +** Processing line: ~ if args.state.storyline.length > 0 && args.state.distance_traveled > args.state.storyline[0][:distance_gate]~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + if args.state.storyline.length > 0 && args.state.distance_traveled > args.state.storyline[0][:distance_gate] +** Processing line: ~ args.state.current_storyline = args.state.storyline.shift[:text]~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def randomize *definitions~ + args.state.current_storyline = args.state.storyline.shift[:text] +** Processing line: ~ args.state.distance_traveled ||= 0~ - Inside source: true *** True Line Result - def randomize *definitions -** Processing line: ~ result = self~ + args.state.distance_traveled ||= 0 +** Processing line: ~ args.state.storyline_x = circle.x~ - Inside source: true *** True Line Result - result = self -** Processing line: ~~ + args.state.storyline_x = circle.x +** Processing line: ~ args.state.storyline_y = circle.y~ - Inside source: true *** True Line Result - -** Processing line: ~ if definitions.include?(:sign)~ + args.state.storyline_y = circle.y +** Processing line: ~ end~ - Inside source: true *** True Line Result - if definitions.include?(:sign) -** Processing line: ~ result = rand_sign~ + end +** Processing line: ~ return unless args.state.current_storyline~ - Inside source: true *** True Line Result - result = rand_sign + return unless args.state.current_storyline ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~~ +** Processing line: ~ label_text = args.state.current_storyline~ - Inside source: true *** True Line Result - -** Processing line: ~ if definitions.include?(:ratio)~ + label_text = args.state.current_storyline +** Processing line: ~ return unless label_text~ - Inside source: true *** True Line Result - if definitions.include?(:ratio) -** Processing line: ~ result = rand * result~ + return unless label_text +** Processing line: ~ x = circle.x + camera.x~ - Inside source: true *** True Line Result - result = rand * result -** Processing line: ~ elsif definitions.include?(:int)~ + x = circle.x + camera.x +** Processing line: ~ y = circle.y + camera.y - 40~ - Inside source: true *** True Line Result - elsif definitions.include?(:int) -** Processing line: ~ result = (rand result)~ + y = circle.y + camera.y - 40 +** Processing line: ~ w = 900~ - Inside source: true *** True Line Result - result = (rand result) -** Processing line: ~ end~ + w = 900 +** Processing line: ~ h = 30~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + h = 30 +** Processing line: ~ outputs.primitives << [x - w.idiv(2), y - h, w, h, 255, 255, 255, 255].solid~ - Inside source: true *** True Line Result - -** Processing line: ~ result~ + outputs.primitives << [x - w.idiv(2), y - h, w, h, 255, 255, 255, 255].solid +** Processing line: ~ outputs.primitives << [x - w.idiv(2), y - h, w, h, 0, 0, 0, 255].border~ - Inside source: true *** True Line Result - result + outputs.primitives << [x - w.idiv(2), y - h, w, h, 0, 0, 0, 255].border +** Processing line: ~ outputs.labels << [x, y - 4, label_text, 1, 1, 0, 0, 0, 255]~ +- Inside source: true +*** True Line Result + outputs.labels << [x, y - 4, label_text, 1, 1, 0, 0, 0, 255] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -112523,50 +116664,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 rand_sign~ +** Processing line: ~ def render_aiming_retical~ - Inside source: true *** True Line Result - def rand_sign -** Processing line: ~ return self * -1 if rand > 0.5~ + def render_aiming_retical +** Processing line: ~ outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.potential_lift * 10) - 5,~ - Inside source: true *** True Line Result - return self * -1 if rand > 0.5 -** Processing line: ~ self~ + outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.potential_lift * 10) - 5, +** Processing line: ~ state.camera.y + circle.y + circle.angle.vector_y(circle.potential_lift * 10) - 5,~ - Inside source: true *** True Line Result - self -** Processing line: ~ end~ + state.camera.y + circle.y + circle.angle.vector_y(circle.potential_lift * 10) - 5, +** Processing line: ~ 10, 10, 'sprites/circle-orange.png']~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 10, 10, 'sprites/circle-orange.png'] +** Processing line: ~ outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.radius * 3) - 5,~ - Inside source: true *** True Line Result - -** Processing line: ~ def rand_ratio~ + outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.radius * 3) - 5, +** Processing line: ~ state.camera.y + circle.y + circle.angle.vector_y(circle.radius * 3) - 5,~ - Inside source: true *** True Line Result - def rand_ratio -** Processing line: ~ self * rand~ + state.camera.y + circle.y + circle.angle.vector_y(circle.radius * 3) - 5, +** Processing line: ~ 10, 10, 'sprites/circle-orange.png', 0, 128]~ - Inside source: true *** True Line Result - self * rand -** Processing line: ~ end~ + 10, 10, 'sprites/circle-orange.png', 0, 128] +** Processing line: ~ if rand > 0.9~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if rand > 0.9 +** Processing line: ~ outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.radius * 3) - 5,~ - Inside source: true *** True Line Result - -** Processing line: ~ def remainder_of_divide n~ + outputs.sprites << [state.camera.x + circle.x + circle.angle.vector_x(circle.radius * 3) - 5, +** Processing line: ~ state.camera.y + circle.y + circle.angle.vector_y(circle.radius * 3) - 5,~ - Inside source: true *** True Line Result - def remainder_of_divide n -** Processing line: ~ mod n~ + state.camera.y + circle.y + circle.angle.vector_y(circle.radius * 3) - 5, +** Processing line: ~ 10, 10, 'sprites/circle-white.png', 0, 128]~ - Inside source: true *** True Line Result - mod n + 10, 10, 'sprites/circle-white.png', 0, 128] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -112575,514 +116720,514 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Easing function progress/percentage for a specific point in time.~ -- Inside source: true -*** True Line Result - # Easing function progress/percentage for a specific point in time. -** Processing line: ~ #~ +** Processing line: ~ def render_circle~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + def render_circle +** Processing line: ~ outputs.sprites << circle.after_images.map do |ai|~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def ease_extended tick_count_override, duration, default_before, default_after, *definitions~ + outputs.sprites << circle.after_images.map do |ai| +** Processing line: ~ ai.merge(x: ai.x + state.camera.x - circle.radius,~ - Inside source: true *** True Line Result - def ease_extended tick_count_override, duration, default_before, default_after, *definitions -** Processing line: ~ GTK::Easing.ease_extended self,~ + ai.merge(x: ai.x + state.camera.x - circle.radius, +** Processing line: ~ y: ai.y + state.camera.y - circle.radius,~ - Inside source: true *** True Line Result - GTK::Easing.ease_extended self, -** Processing line: ~ tick_count_override,~ + y: ai.y + state.camera.y - circle.radius, +** Processing line: ~ w: circle.radius * 2,~ - Inside source: true *** True Line Result - tick_count_override, -** Processing line: ~ self + duration,~ + w: circle.radius * 2, +** Processing line: ~ h: circle.radius * 2,~ - Inside source: true *** True Line Result - self + duration, -** Processing line: ~ default_before,~ + h: circle.radius * 2, +** Processing line: ~ path: 'sprites/circle-white.png')~ - Inside source: true *** True Line Result - default_before, -** Processing line: ~ default_after,~ + path: 'sprites/circle-white.png') +** Processing line: ~ end~ - Inside source: true *** True Line Result - default_after, -** Processing line: ~ *definitions~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - *definitions -** Processing line: ~ end~ + +** Processing line: ~ outputs.sprites << [(circle.x - circle.radius) + state.camera.x,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.sprites << [(circle.x - circle.radius) + state.camera.x, +** Processing line: ~ (circle.y - circle.radius) + state.camera.y,~ - Inside source: true *** True Line Result - -** Processing line: ~ # Easing function progress/percentage for a specific point in time.~ + (circle.y - circle.radius) + state.camera.y, +** Processing line: ~ circle.radius * 2,~ - Inside source: true *** True Line Result - # Easing function progress/percentage for a specific point in time. -** Processing line: ~ #~ + circle.radius * 2, +** Processing line: ~ circle.radius * 2,~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + circle.radius * 2, +** Processing line: ~ 'sprites/probe.png']~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def global_ease duration, *definitions~ + 'sprites/probe.png'] +** Processing line: ~ end~ - Inside source: true *** True Line Result - def global_ease duration, *definitions -** Processing line: ~ ease_extended Kernel.global_tick_count,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - ease_extended Kernel.global_tick_count, -** Processing line: ~ duration,~ + +** Processing line: ~ def render_debug~ - Inside source: true *** True Line Result - duration, -** Processing line: ~ GTK::Easing.initial_value(*definitions),~ + def render_debug +** Processing line: ~ return unless state.debug_mode~ - Inside source: true *** True Line Result - GTK::Easing.initial_value(*definitions), -** Processing line: ~ GTK::Easing.final_value(*definitions),~ + return unless state.debug_mode +** Processing line: ~~ - Inside source: true *** True Line Result - GTK::Easing.final_value(*definitions), -** Processing line: ~ *definitions~ + +** Processing line: ~ outputs.labels << [10, 30, state.line_mode, 0, 0, 0, 0, 0]~ - Inside source: true *** True Line Result - *definitions -** Processing line: ~ end~ + outputs.labels << [10, 30, state.line_mode, 0, 0, 0, 0, 0] +** Processing line: ~ outputs.labels << [12, 32, state.line_mode, 0, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - end + outputs.labels << [12, 32, state.line_mode, 0, 0, 255, 255, 255] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Easing function progress/percentage for a specific point in time.~ +** Processing line: ~ args.outputs.lines << trajectory(circle).line.to_hash.tap do |h|~ - Inside source: true *** True Line Result - # Easing function progress/percentage for a specific point in time. -** Processing line: ~ #~ + args.outputs.lines << trajectory(circle).line.to_hash.tap do |h| +** Processing line: ~ h[:x] += state.camera.x~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + h[:x] += state.camera.x +** Processing line: ~ h[:y] += state.camera.y~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def ease duration, *definitions~ + h[:y] += state.camera.y +** Processing line: ~ h[:x2] += state.camera.x~ - Inside source: true *** True Line Result - def ease duration, *definitions -** Processing line: ~ ease_extended Kernel.tick_count,~ + h[:x2] += state.camera.x +** Processing line: ~ h[:y2] += state.camera.y~ - Inside source: true *** True Line Result - ease_extended Kernel.tick_count, -** Processing line: ~ duration,~ + h[:y2] += state.camera.y +** Processing line: ~ end~ - Inside source: true *** True Line Result - duration, -** Processing line: ~ GTK::Easing.initial_value(*definitions),~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - GTK::Easing.initial_value(*definitions), -** Processing line: ~ GTK::Easing.final_value(*definitions),~ + +** Processing line: ~ outputs.primitives << state.terrain.find_all do |t|~ - Inside source: true *** True Line Result - GTK::Easing.final_value(*definitions), -** Processing line: ~ *definitions~ + outputs.primitives << state.terrain.find_all do |t| +** Processing line: ~ circle.x.between?(t.x - 640, t.x2 + 640) || circle.y.between?(t.y - 360, t.y2 + 360)~ - Inside source: true *** True Line Result - *definitions -** Processing line: ~ end~ + circle.x.between?(t.x - 640, t.x2 + 640) || circle.y.between?(t.y - 360, t.y2 + 360) +** Processing line: ~ end.map do |t|~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end.map do |t| +** Processing line: ~ [~ - Inside source: true *** True Line Result - -** Processing line: ~ # Easing function progress/percentage for a specific point in time.~ + [ +** Processing line: ~ t.line.associate(r: 0, g: 255, b: 0) do |h|~ - Inside source: true *** True Line Result - # Easing function progress/percentage for a specific point in time. -** Processing line: ~ #~ + t.line.associate(r: 0, g: 255, b: 0) do |h| +** Processing line: ~ h.x += state.camera.x~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + h.x += state.camera.x +** Processing line: ~ h.y += state.camera.y~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def ease_spline_extended tick_count_override, duration, spline~ + h.y += state.camera.y +** Processing line: ~ h.x2 += state.camera.x~ - Inside source: true *** True Line Result - def ease_spline_extended tick_count_override, duration, spline -** Processing line: ~ GTK::Easing.ease_spline_extended self,~ + h.x2 += state.camera.x +** Processing line: ~ h.y2 += state.camera.y~ - Inside source: true *** True Line Result - GTK::Easing.ease_spline_extended self, -** Processing line: ~ tick_count_override,~ + h.y2 += state.camera.y +** Processing line: ~ if circle.rect.intersect_rect? t[:rect]~ - Inside source: true *** True Line Result - tick_count_override, -** Processing line: ~ self + duration,~ + if circle.rect.intersect_rect? t[:rect] +** Processing line: ~ h[:r] = 255~ - Inside source: true *** True Line Result - self + duration, -** Processing line: ~ spline~ + h[:r] = 255 +** Processing line: ~ h[:g] = 0~ - Inside source: true *** True Line Result - spline -** Processing line: ~ end~ + h[:g] = 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end +** Processing line: ~ h~ - Inside source: true *** True Line Result - -** Processing line: ~ # Easing function progress/percentage for a specific point in time.~ + h +** Processing line: ~ end,~ - Inside source: true *** True Line Result - # Easing function progress/percentage for a specific point in time. -** Processing line: ~ #~ + end, +** Processing line: ~ t[:rect].border.associate(r: 255, g: 0, b: 0) do |h|~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + t[:rect].border.associate(r: 255, g: 0, b: 0) do |h| +** Processing line: ~ h.x += state.camera.x~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def global_ease_spline duration, spline~ + h.x += state.camera.x +** Processing line: ~ h.y += state.camera.y~ - Inside source: true *** True Line Result - def global_ease_spline duration, spline -** Processing line: ~ ease_spline_extended Kernel.global_tick_count,~ + h.y += state.camera.y +** Processing line: ~ h.b = 255 if line_near_rect? circle.rect, t~ - Inside source: true *** True Line Result - ease_spline_extended Kernel.global_tick_count, -** Processing line: ~ duration,~ + h.b = 255 if line_near_rect? circle.rect, t +** Processing line: ~ h~ - Inside source: true *** True Line Result - duration, -** Processing line: ~ spline~ + h +** Processing line: ~ end~ - Inside source: true *** True Line Result - spline -** Processing line: ~ end~ + end +** Processing line: ~ ]~ - 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: ~ # Easing function progress/percentage for a specific point in time.~ +** Processing line: ~ outputs.primitives << state.lava.find_all do |t|~ - Inside source: true *** True Line Result - # Easing function progress/percentage for a specific point in time. -** Processing line: ~ #~ + outputs.primitives << state.lava.find_all do |t| +** Processing line: ~ circle.x.between?(t.x - 640, t.x2 + 640) || circle.y.between?(t.y - 360, t.y2 + 360)~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + circle.x.between?(t.x - 640, t.x2 + 640) || circle.y.between?(t.y - 360, t.y2 + 360) +** Processing line: ~ end.map do |t|~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def ease_spline duration, spline~ + end.map do |t| +** Processing line: ~ [~ - Inside source: true *** True Line Result - def ease_spline duration, spline -** Processing line: ~ ease_spline_extended Kernel.tick_count,~ + [ +** Processing line: ~ t.line.associate(r: 0, g: 0, b: 255) do |h|~ - Inside source: true *** True Line Result - ease_spline_extended Kernel.tick_count, -** Processing line: ~ duration,~ + t.line.associate(r: 0, g: 0, b: 255) do |h| +** Processing line: ~ h.x += state.camera.x~ - Inside source: true *** True Line Result - duration, -** Processing line: ~ spline~ + h.x += state.camera.x +** Processing line: ~ h.y += state.camera.y~ - Inside source: true *** True Line Result - spline -** Processing line: ~ end~ + h.y += state.camera.y +** Processing line: ~ h.x2 += state.camera.x~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + h.x2 += state.camera.x +** Processing line: ~ h.y2 += state.camera.y~ - Inside source: true *** True Line Result - -** Processing line: ~ # Converts a number representing an angle in degrees to radians.~ + h.y2 += state.camera.y +** Processing line: ~ if circle.rect.intersect_rect? t[:rect]~ - Inside source: true *** True Line Result - # Converts a number representing an angle in degrees to radians. -** Processing line: ~ #~ + if circle.rect.intersect_rect? t[:rect] +** Processing line: ~ h[:r] = 255~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + h[:r] = 255 +** Processing line: ~ h[:b] = 0~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def to_radians~ + h[:b] = 0 +** Processing line: ~ end~ - Inside source: true *** True Line Result - def to_radians -** Processing line: ~ self * Math::PI.fdiv(180)~ + end +** Processing line: ~ h~ - Inside source: true *** True Line Result - self * Math::PI.fdiv(180) -** Processing line: ~ end~ + h +** Processing line: ~ end,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + end, +** Processing line: ~ t[:rect].border.associate(r: 255, g: 0, b: 0) do |h|~ - Inside source: true *** True Line Result - -** Processing line: ~ # Converts a number representing an angle in radians to degress.~ + t[:rect].border.associate(r: 255, g: 0, b: 0) do |h| +** Processing line: ~ h.x += state.camera.x~ - Inside source: true *** True Line Result - # Converts a number representing an angle in radians to degress. -** Processing line: ~ #~ + h.x += state.camera.x +** Processing line: ~ h.y += state.camera.y~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + h.y += state.camera.y +** Processing line: ~ h.b = 255 if line_near_rect? circle.rect, t~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def to_degrees~ + h.b = 255 if line_near_rect? circle.rect, t +** Processing line: ~ h~ - Inside source: true *** True Line Result - def to_degrees -** Processing line: ~ self / Math::PI.fdiv(180)~ + h +** Processing line: ~ end~ - Inside source: true *** True Line Result - self / Math::PI.fdiv(180) -** Processing line: ~ end~ + end +** Processing line: ~ ]~ - 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: ~ # Given `self`, a rectangle primitive is returned.~ +** Processing line: ~ if state.god_mode~ - Inside source: true *** True Line Result - # Given `self`, a rectangle primitive is returned. -** Processing line: ~ #~ + if state.god_mode +** Processing line: ~ border = circle.rect.merge(x: circle.rect.x + state.camera.x,~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @example~ + border = circle.rect.merge(x: circle.rect.x + state.camera.x, +** Processing line: ~ y: circle.rect.y + state.camera.y,~ - Inside source: true *** True Line Result - # @example -** Processing line: ~ # 5.to_square 100, 300 # returns [100, 300, 5, 5]~ + y: circle.rect.y + state.camera.y, +** Processing line: ~ g: 255)~ - Inside source: true *** True Line Result - # 5.to_square 100, 300 # returns [100, 300, 5, 5] -** Processing line: ~ #~ + g: 255) +** Processing line: ~ else~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + else +** Processing line: ~ border = circle.rect.merge(x: circle.rect.x + state.camera.x,~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def to_square x, y, anchor_x = 0.5, anchor_y = nil~ + border = circle.rect.merge(x: circle.rect.x + state.camera.x, +** Processing line: ~ y: circle.rect.y + state.camera.y,~ - Inside source: true *** True Line Result - def to_square x, y, anchor_x = 0.5, anchor_y = nil -** Processing line: ~ GTK::Geometry.to_square(self, x, y, anchor_x, anchor_y)~ + y: circle.rect.y + state.camera.y, +** Processing line: ~ b: 255)~ - Inside source: true *** True Line Result - GTK::Geometry.to_square(self, x, y, anchor_x, anchor_y) -** Processing line: ~ end~ + b: 255) +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns a normal vector for a number that represents an angle in degress.~ -- Inside source: true -*** True Line Result - # Returns a normal vector for a number that represents an angle in degress. -** Processing line: ~ #~ -- Inside source: true -*** True Line Result - # -** Processing line: ~ # @gtk~ -- Inside source: true -*** True Line Result - # @gtk -** Processing line: ~ def vector max_value = 1~ +** Processing line: ~ outputs.borders << border~ - Inside source: true *** True Line Result - def vector max_value = 1 -** Processing line: ~ [vector_x(max_value), vector_y(max_value)]~ + outputs.borders << border +** Processing line: ~~ - Inside source: true *** True Line Result - [vector_x(max_value), vector_y(max_value)] -** Processing line: ~ end~ + +** Processing line: ~ overlapping ||= {}~ - Inside source: true *** True Line Result - end + overlapping ||= {} ** Processing line: ~~ - 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: ~ circle.impact_history.each do |h|~ - Inside source: true *** True Line Result - # Returns the y component of a normal vector for a number that represents an angle in degress. -** Processing line: ~ #~ + circle.impact_history.each do |h| +** Processing line: ~ label_mod = 300~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + label_mod = 300 +** Processing line: ~ x = (h[:body][:x].-(150).idiv(label_mod)) * label_mod + camera.x~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def vector_y max_value = 1~ + x = (h[:body][:x].-(150).idiv(label_mod)) * label_mod + camera.x +** Processing line: ~ y = (h[:body][:y].+(150).idiv(label_mod)) * label_mod + camera.y~ - Inside source: true *** True Line Result - def vector_y max_value = 1 -** Processing line: ~ max_value * Math.sin(self.to_radians)~ + y = (h[:body][:y].+(150).idiv(label_mod)) * label_mod + camera.y +** Processing line: ~ 10.times do~ - Inside source: true *** True Line Result - max_value * Math.sin(self.to_radians) -** Processing line: ~ end~ + 10.times do +** Processing line: ~ if overlapping[x] && overlapping[x][y]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if overlapping[x] && overlapping[x][y] +** Processing line: ~ y -= 52~ - 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.~ + y -= 52 +** Processing line: ~ else~ - Inside source: true *** True Line Result - # Returns the x component of a normal vector for a number that represents an angle in degress. -** Processing line: ~ #~ + else +** Processing line: ~ break~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + break +** Processing line: ~ end~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def vector_x max_value = 1~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - def vector_x max_value = 1 -** Processing line: ~ max_value * Math.cos(self.to_radians)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - max_value * Math.cos(self.to_radians) -** Processing line: ~ end~ + +** Processing line: ~ overlapping[x] ||= {}~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + overlapping[x] ||= {} +** Processing line: ~ overlapping[x][y] ||= true~ - Inside source: true *** True Line Result - -** Processing line: ~ def x_vector max_value = 1~ + overlapping[x][y] ||= true +** Processing line: ~ outputs.primitives << [x, y - 25, 300, 50, 0, 0, 0, 128].solid~ - Inside source: true *** True Line Result - def x_vector max_value = 1 -** Processing line: ~ vector_x max_value~ + outputs.primitives << [x, y - 25, 300, 50, 0, 0, 0, 128].solid +** Processing line: ~ outputs.labels << [x + 10, y + 24, "dy: %.2f" % h[:body][:new_dy], -2, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - vector_x max_value -** Processing line: ~ end~ + outputs.labels << [x + 10, y + 24, "dy: %.2f" % h[:body][:new_dy], -2, 0, 255, 255, 255] +** Processing line: ~ outputs.labels << [x + 10, y + 9, "dx: %.2f" % h[:body][:new_dx], -2, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - end + outputs.labels << [x + 10, y + 9, "dx: %.2f" % h[:body][:new_dx], -2, 0, 255, 255, 255] +** Processing line: ~ outputs.labels << [x + 10, y - 5, " ?: #{h[:body][:new_reason]}", -2, 0, 255, 255, 255]~ +- Inside source: true +*** True Line Result + outputs.labels << [x + 10, y - 5, " ?: #{h[:body][:new_reason]}", -2, 0, 255, 255, 255] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def y_vector max_value = 1~ +** Processing line: ~ outputs.labels << [x + 100, y + 24, "angle: %.2f" % h[:impact][:angle], -2, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - def y_vector max_value = 1 -** Processing line: ~ vector_y max_value~ + outputs.labels << [x + 100, y + 24, "angle: %.2f" % h[:impact][:angle], -2, 0, 255, 255, 255] +** Processing line: ~ outputs.labels << [x + 100, y + 9, "m(l): %.2f" % h[:terrain][:slope], -2, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - vector_y max_value -** Processing line: ~ end~ + outputs.labels << [x + 100, y + 9, "m(l): %.2f" % h[:terrain][:slope], -2, 0, 255, 255, 255] +** Processing line: ~ outputs.labels << [x + 100, y - 5, "m(c): %.2f" % h[:body][:slope], -2, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - end + outputs.labels << [x + 100, y - 5, "m(c): %.2f" % h[:body][:slope], -2, 0, 255, 255, 255] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ outputs.labels << [x + 200, y + 24, "ray: #{h[:impact][:ray]}", -2, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def mod n~ + outputs.labels << [x + 200, y + 24, "ray: #{h[:impact][:ray]}", -2, 0, 255, 255, 255] +** Processing line: ~ outputs.labels << [x + 200, y + 9, "nxt: #{h[:impact][:ray_next]}", -2, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - def mod n -** Processing line: ~ self % n~ + outputs.labels << [x + 200, y + 9, "nxt: #{h[:impact][:ray_next]}", -2, 0, 255, 255, 255] +** Processing line: ~ outputs.labels << [x + 200, y - 5, "typ: #{h[:impact][:type]}", -2, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - self % n -** Processing line: ~ end~ + outputs.labels << [x + 200, y - 5, "typ: #{h[:impact][:type]}", -2, 0, 255, 255, 255] +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ if circle.floor~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def mod_zero? *ns~ + if circle.floor +** Processing line: ~ outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 100, "point: #{circle.floor_point.slice(:x, :y).values}", -2, 0]~ - Inside source: true *** True Line Result - def mod_zero? *ns -** Processing line: ~ ns.any? { |n| mod(n) == 0 }~ + outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 100, "point: #{circle.floor_point.slice(:x, :y).values}", -2, 0] +** Processing line: ~ outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 101, "point: #{circle.floor_point.slice(:x, :y).values}", -2, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - ns.any? { |n| mod(n) == 0 } -** Processing line: ~ end~ + outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 101, "point: #{circle.floor_point.slice(:x, :y).values}", -2, 0, 255, 255, 255] +** Processing line: ~ outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 85, "circle: #{circle.as_hash.slice(:x, :y).values}", -2, 0]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 85, "circle: #{circle.as_hash.slice(:x, :y).values}", -2, 0] +** Processing line: ~ outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 86, "circle: #{circle.as_hash.slice(:x, :y).values}", -2, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - -** Processing line: ~ def mult n~ + outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 86, "circle: #{circle.as_hash.slice(:x, :y).values}", -2, 0, 255, 255, 255] +** Processing line: ~ outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 70, "rel: #{circle.floor_relative_x} #{circle.floor_relative_y}", -2, 0]~ - Inside source: true *** True Line Result - def mult n -** Processing line: ~ self * n~ + outputs.labels << [circle.x + camera.x + 30, circle.y + camera.y + 70, "rel: #{circle.floor_relative_x} #{circle.floor_relative_y}", -2, 0] +** Processing line: ~ outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 71, "rel: #{circle.floor_relative_x} #{circle.floor_relative_y}", -2, 0, 255, 255, 255]~ - Inside source: true *** True Line Result - self * n + outputs.labels << [circle.x + camera.x + 31, circle.y + camera.y + 71, "rel: #{circle.floor_relative_x} #{circle.floor_relative_y}", -2, 0, 255, 255, 255] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113091,18 +117236,22 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ +** Processing line: ~ def render_stage_editor~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def fdiv n~ + def render_stage_editor +** Processing line: ~ return unless state.god_mode~ - Inside source: true *** True Line Result - def fdiv n -** Processing line: ~ self / n.to_f~ + return unless state.god_mode +** Processing line: ~ return unless state.point_one~ - Inside source: true *** True Line Result - self / n.to_f + return unless state.point_one +** Processing line: ~ args.lines << [state.point_one, inputs.mouse.point, 0, 255, 255]~ +- Inside source: true +*** True Line Result + args.lines << [state.point_one, inputs.mouse.point, 0, 255, 255] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113111,26 +117260,30 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Divides `self` by a number `n` as a float, and converts it `to_i`.~ +** Processing line: ~ def trajectory body~ - Inside source: true *** True Line Result - # Divides `self` by a number `n` as a float, and converts it `to_i`. -** Processing line: ~ #~ + def trajectory body +** Processing line: ~ [body.x + body.dx,~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + [body.x + body.dx, +** Processing line: ~ body.y + body.dy,~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def idiv n~ + body.y + body.dy, +** Processing line: ~ body.x + body.dx * 1000,~ - Inside source: true *** True Line Result - def idiv n -** Processing line: ~ (self / n.to_f).to_i~ + body.x + body.dx * 1000, +** Processing line: ~ body.y + body.dy * 1000,~ - Inside source: true *** True Line Result - (self / n.to_f).to_i + body.y + body.dy * 1000, +** Processing line: ~ 0, 255, 255]~ +- Inside source: true +*** True Line Result + 0, 255, 255] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113139,50 +117292,38 @@ 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 numeric value that is a quantity `magnitude` closer to~ -- Inside source: true -*** True Line Result - # Returns a numeric value that is a quantity `magnitude` closer to -** Processing line: ~ #`self`. If the distance between `self` and `target` is less than~ -- Inside source: true -*** True Line Result - #`self`. If the distance between `self` and `target` is less than -** Processing line: ~ #the `magnitude` then `target` is returned.~ -- Inside source: true -*** True Line Result - #the `magnitude` then `target` is returned. -** Processing line: ~ #~ +** Processing line: ~ def lengthen_line line, num~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + def lengthen_line line, num +** Processing line: ~ line = normalize_line(line)~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def towards target, magnitude~ + line = normalize_line(line) +** Processing line: ~ slope = geometry.line_slope(line, replace_infinity: 10).abs~ - Inside source: true *** True Line Result - def towards target, magnitude -** Processing line: ~ return self if self == target~ + slope = geometry.line_slope(line, replace_infinity: 10).abs +** Processing line: ~ if slope < 2~ - Inside source: true *** True Line Result - return self if self == target -** Processing line: ~ delta = (self - target).abs~ + if slope < 2 +** Processing line: ~ [line.x - num, line.y, line.x2 + num, line.y2].line.to_hash~ - Inside source: true *** True Line Result - delta = (self - target).abs -** Processing line: ~ return target if delta < magnitude~ + [line.x - num, line.y, line.x2 + num, line.y2].line.to_hash +** Processing line: ~ else~ - Inside source: true *** True Line Result - return target if delta < magnitude -** Processing line: ~ return self - magnitude if self > target~ + else +** Processing line: ~ [line.x, line.y, line.x2, line.y2].line.to_hash~ - Inside source: true *** True Line Result - return self - magnitude if self > target -** Processing line: ~ return self + magnitude~ + [line.x, line.y, line.x2, line.y2].line.to_hash +** Processing line: ~ end~ - Inside source: true *** True Line Result - return self + magnitude + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113191,206 +117332,194 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Given `self` and a number representing `y` of a grid. This~ +** Processing line: ~ def normalize_line line~ - Inside source: true *** True Line Result - # Given `self` and a number representing `y` of a grid. This -** Processing line: ~ # function will return a one dimensional array containing the value~ + def normalize_line line +** Processing line: ~ if line.x > line.x2~ - Inside source: true *** True Line Result - # function will return a one dimensional array containing the value -** Processing line: ~ # yielded by an implicit block.~ + if line.x > line.x2 +** Processing line: ~ x = line.x2~ - Inside source: true *** True Line Result - # yielded by an implicit block. -** Processing line: ~ #~ + x = line.x2 +** Processing line: ~ y = line.y2~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @example~ + y = line.y2 +** Processing line: ~ x2 = line.x~ - Inside source: true *** True Line Result - # @example -** Processing line: ~ # 3.map_with_ys 2 do |x, y|~ + x2 = line.x +** Processing line: ~ y2 = line.y~ - Inside source: true *** True Line Result - # 3.map_with_ys 2 do |x, y| -** Processing line: ~ # x * y~ + y2 = line.y +** Processing line: ~ else~ - Inside source: true *** True Line Result - # x * y -** Processing line: ~ # end~ + else +** Processing line: ~ x = line.x~ - Inside source: true *** True Line Result - # end -** Processing line: ~ # # x y x y x y x y x y x y~ + x = line.x +** Processing line: ~ y = line.y~ - Inside source: true *** True Line Result - # # x y x y x y x y x y x y -** Processing line: ~ # # 0*0, 0*1 1*0 1*1 2*0 2*1~ + y = line.y +** Processing line: ~ x2 = line.x2~ - Inside source: true *** True Line Result - # # 0*0, 0*1 1*0 1*1 2*0 2*1 -** Processing line: ~ # # => [ 0, 0, 0, 1, 0, 2]~ + x2 = line.x2 +** Processing line: ~ y2 = line.y2~ - Inside source: true *** True Line Result - # # => [ 0, 0, 0, 1, 0, 2] -** Processing line: ~ #~ + y2 = line.y2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + end +** Processing line: ~ [x, y, x2, y2]~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def map_with_ys ys, &block~ + [x, y, x2, y2] +** Processing line: ~ end~ - Inside source: true *** True Line Result - def map_with_ys ys, &block -** Processing line: ~ self.times.flat_map do |x|~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - self.times.flat_map do |x| -** Processing line: ~ ys.map_with_index do |y|~ + +** Processing line: ~ def rect_for_line line~ - Inside source: true *** True Line Result - ys.map_with_index do |y| -** Processing line: ~ yield x, y~ + def rect_for_line line +** Processing line: ~ if line.x > line.x2~ - Inside source: true *** True Line Result - yield x, y -** Processing line: ~ end~ + if line.x > line.x2 +** Processing line: ~ x = line.x2~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + x = line.x2 +** Processing line: ~ y = line.y2~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + y = line.y2 +** Processing line: ~ x2 = line.x~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise_immediately e, :map_with_ys, [self, ys]~ + x2 = line.x +** Processing line: ~ y2 = line.y~ - Inside source: true *** True Line Result - raise_immediately e, :map_with_ys, [self, ys] -** Processing line: ~ end~ + y2 = line.y +** Processing line: ~ else~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + else +** Processing line: ~ x = line.x~ - Inside source: true *** True Line Result - -** Processing line: ~ def combinations other_int~ + x = line.x +** Processing line: ~ y = line.y~ - Inside source: true *** True Line Result - def combinations other_int -** Processing line: ~ self.numbers.product(other_int.numbers)~ + y = line.y +** Processing line: ~ x2 = line.x2~ - Inside source: true *** True Line Result - self.numbers.product(other_int.numbers) -** Processing line: ~ end~ + x2 = line.x2 +** Processing line: ~ y2 = line.y2~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + y2 = line.y2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - -** Processing line: ~ def percentage_of n~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def percentage_of n -** Processing line: ~ (self / n.to_f).cap_min_max(0, 1)~ + +** Processing line: ~ w = x2 - x~ - Inside source: true *** True Line Result - (self / n.to_f).cap_min_max(0, 1) -** Processing line: ~ end~ + w = x2 - x +** Processing line: ~ h = y2 - y~ - Inside source: true *** True Line Result - end + h = y2 - y ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def cap i~ +** Processing line: ~ if h < 0~ - Inside source: true *** True Line Result - def cap i -** Processing line: ~ return i if self > i~ + if h < 0 +** Processing line: ~ y += h~ - Inside source: true *** True Line Result - return i if self > i -** Processing line: ~ self~ + y += h +** Processing line: ~ h = h.abs~ - Inside source: true *** True Line Result - self -** Processing line: ~ end~ + h = h.abs +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def cap_min_max min, max~ -- Inside source: true -*** True Line Result - def cap_min_max min, max -** Processing line: ~ return min if self < min~ +** Processing line: ~ if w < circle.radius~ - Inside source: true *** True Line Result - return min if self < min -** Processing line: ~ return max if self > max~ + if w < circle.radius +** Processing line: ~ x -= circle.radius~ - Inside source: true *** True Line Result - return max if self > max -** Processing line: ~ self~ + x -= circle.radius +** Processing line: ~ w = circle.radius * 2~ - Inside source: true *** True Line Result - self -** Processing line: ~ end~ + w = circle.radius * 2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def lesser other~ +** Processing line: ~ if h < circle.radius~ - Inside source: true *** True Line Result - def lesser other -** Processing line: ~ return other if other < self~ + if h < circle.radius +** Processing line: ~ y -= circle.radius~ - Inside source: true *** True Line Result - return other if other < self -** Processing line: ~ self~ + y -= circle.radius +** Processing line: ~ h = circle.radius * 2~ - Inside source: true *** True Line Result - self -** Processing line: ~ end~ + h = circle.radius * 2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def greater other~ -- Inside source: true -*** True Line Result - def greater other -** Processing line: ~ return other if other > self~ -- Inside source: true -*** True Line Result - return other if other > self -** Processing line: ~ self~ +** Processing line: ~ { x: x, y: y, w: w, h: h }~ - Inside source: true *** True Line Result - self + { x: x, y: y, w: w, h: h } ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113399,158 +117528,158 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def subtract i~ +** Processing line: ~ def snap_to_grid x, y, snaps~ - Inside source: true *** True Line Result - def subtract i -** Processing line: ~ self - i~ + def snap_to_grid x, y, snaps +** Processing line: ~ snap_number = 10~ - Inside source: true *** True Line Result - self - i -** Processing line: ~ end~ + snap_number = 10 +** Processing line: ~ x = x.to_i~ - Inside source: true *** True Line Result - end + x = x.to_i +** Processing line: ~ y = y.to_i~ +- Inside source: true +*** True Line Result + y = y.to_i ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def minus i~ +** Processing line: ~ x_floor = x.idiv(snap_number) * snap_number~ - Inside source: true *** True Line Result - def minus i -** Processing line: ~ self - i~ + x_floor = x.idiv(snap_number) * snap_number +** Processing line: ~ x_mod = x % snap_number~ - Inside source: true *** True Line Result - self - i -** Processing line: ~ end~ + x_mod = x % snap_number +** Processing line: ~ x_ceil = (x.idiv(snap_number) + 1) * snap_number~ - Inside source: true *** True Line Result - end + x_ceil = (x.idiv(snap_number) + 1) * snap_number ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def add i~ +** Processing line: ~ y_floor = y.idiv(snap_number) * snap_number~ - Inside source: true *** True Line Result - def add i -** Processing line: ~ self + i~ + y_floor = y.idiv(snap_number) * snap_number +** Processing line: ~ y_mod = y % snap_number~ - Inside source: true *** True Line Result - self + i -** Processing line: ~ end~ + y_mod = y % snap_number +** Processing line: ~ y_ceil = (y.idiv(snap_number) + 1) * snap_number~ - Inside source: true *** True Line Result - end + y_ceil = (y.idiv(snap_number) + 1) * snap_number ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def plus i~ -- Inside source: true -*** True Line Result - def plus i -** Processing line: ~ self + i~ +** Processing line: ~ if snaps[x_floor]~ - Inside source: true *** True Line Result - self + i -** Processing line: ~ end~ + if snaps[x_floor] +** Processing line: ~ x_result = x_floor~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x_result = x_floor +** Processing line: ~ elsif snaps[x_ceil]~ - Inside source: true *** True Line Result - -** Processing line: ~ def numbers~ + elsif snaps[x_ceil] +** Processing line: ~ x_result = x_ceil~ - Inside source: true *** True Line Result - def numbers -** Processing line: ~ (0..self).to_a~ + x_result = x_ceil +** Processing line: ~ elsif x_mod < snap_number.idiv(2)~ - Inside source: true *** True Line Result - (0..self).to_a -** Processing line: ~ end~ + elsif x_mod < snap_number.idiv(2) +** Processing line: ~ x_result = x_floor~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + x_result = x_floor +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ def >= other~ + else +** Processing line: ~ x_result = x_ceil~ - Inside source: true *** True Line Result - def >= other -** Processing line: ~ return false if !other~ + x_result = x_ceil +** Processing line: ~ end~ - Inside source: true *** True Line Result - return false if !other -** Processing line: ~ return gte other~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - return gte other -** Processing line: ~ end~ + +** Processing line: ~ snaps[x_result] ||= {}~ - Inside source: true *** True Line Result - end + snaps[x_result] ||= {} ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def > other~ +** Processing line: ~ if snaps[x_result][y_floor]~ - Inside source: true *** True Line Result - def > other -** Processing line: ~ return false if !other~ + if snaps[x_result][y_floor] +** Processing line: ~ y_result = y_floor~ - Inside source: true *** True Line Result - return false if !other -** Processing line: ~ return gt other~ + y_result = y_floor +** Processing line: ~ elsif snaps[x_result][y_ceil]~ - Inside source: true *** True Line Result - return gt other -** Processing line: ~ end~ + elsif snaps[x_result][y_ceil] +** Processing line: ~ y_result = y_ceil~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + y_result = y_ceil +** Processing line: ~ elsif y_mod < snap_number.idiv(2)~ - Inside source: true *** True Line Result - -** Processing line: ~ def <= other~ + elsif y_mod < snap_number.idiv(2) +** Processing line: ~ y_result = y_floor~ - Inside source: true *** True Line Result - def <= other -** Processing line: ~ return false if !other~ + y_result = y_floor +** Processing line: ~ else~ - Inside source: true *** True Line Result - return false if !other -** Processing line: ~ return lte other~ + else +** Processing line: ~ y_result = y_ceil~ - Inside source: true *** True Line Result - return lte other -** Processing line: ~ end~ + y_result = y_ceil +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def < other~ +** Processing line: ~ snaps[x_result][y_result] = true~ - Inside source: true *** True Line Result - def < other -** Processing line: ~ return false if !other~ + snaps[x_result][y_result] = true +** Processing line: ~ return [x_result, y_result]~ - Inside source: true *** True Line Result - return false if !other -** Processing line: ~ return gt other~ + return [x_result, y_result] +** Processing line: ~~ - Inside source: true *** True Line Result - return gt other + ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113559,34 +117688,14 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ alias_method(:original_eq_eq, :==) unless Numeric.instance_methods.include?(:original_eq_eq)~ -- Inside source: true -*** True Line Result - alias_method(:original_eq_eq, :==) unless Numeric.instance_methods.include?(:original_eq_eq) -** Processing line: ~ def == other~ -- Inside source: true -*** True Line Result - def == other -** Processing line: ~ return true if self.original_eq_eq(other)~ -- Inside source: true -*** True Line Result - return true if self.original_eq_eq(other) -** Processing line: ~ if other.is_a?(OpenEntity)~ -- Inside source: true -*** True Line Result - if other.is_a?(OpenEntity) -** Processing line: ~ return self.original_eq_eq(other.entity_id)~ -- Inside source: true -*** True Line Result - return self.original_eq_eq(other.entity_id) -** Processing line: ~ end~ +** Processing line: ~ def snap_line line~ - Inside source: true *** True Line Result - end -** Processing line: ~ return self.original_eq_eq(other)~ + def snap_line line +** Processing line: ~ x, y, x2, y2 = line~ - Inside source: true *** True Line Result - return self.original_eq_eq(other) + x, y, x2, y2 = line ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113595,38 +117704,30 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ -- Inside source: true -*** True Line Result - # @gtk -** Processing line: ~ def map~ -- Inside source: true -*** True Line Result - def map -** Processing line: ~ unless block_given?~ +** Processing line: ~ def string_to_line s~ - Inside source: true *** True Line Result - unless block_given? -** Processing line: ~ raise <<-S~ + def string_to_line s +** Processing line: ~ x, y, x2, y2 = s.split(',').map(&:to_f)~ - Inside source: true *** True Line Result - raise <<-S -** Processing line: ~ * ERROR:~ + x, y, x2, y2 = s.split(',').map(&:to_f) +** Processing line: ~~ - Inside source: true *** True Line Result - * ERROR: -** Processing line: ~ A block is required for Numeric#map.~ + +** Processing line: ~ if x > x2~ - Inside source: true *** True Line Result - A block is required for Numeric#map. -** Processing line: ~~ + if x > x2 +** Processing line: ~ x2, x = x, x2~ - Inside source: true *** True Line Result - -** Processing line: ~ S~ + x2, x = x, x2 +** Processing line: ~ y2, y = y, y2~ - Inside source: true *** True Line Result - S + y2, y = y, y2 ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113635,18 +117736,18 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ self.to_i.times.map do~ +** Processing line: ~ x, y = snap_to_grid x, y, state.snaps~ - Inside source: true *** True Line Result - self.to_i.times.map do -** Processing line: ~ yield~ + x, y = snap_to_grid x, y, state.snaps +** Processing line: ~ x2, y2 = snap_to_grid x2, y2, state.snaps~ - Inside source: true *** True Line Result - yield -** Processing line: ~ end~ + x2, y2 = snap_to_grid x2, y2, state.snaps +** Processing line: ~ [x, y, x2, y2].line.to_hash~ - Inside source: true *** True Line Result - end + [x, y, x2, y2].line.to_hash ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113655,58 +117756,46 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # @gtk~ -- Inside source: true -*** True Line Result - # @gtk -** Processing line: ~ def map_with_index~ -- Inside source: true -*** True Line Result - def map_with_index -** Processing line: ~ unless block_given?~ +** Processing line: ~ def load_lines file~ - Inside source: true *** True Line Result - unless block_given? -** Processing line: ~ raise <<-S~ + def load_lines file +** Processing line: ~ data = gtk.read_file(file) || ""~ - Inside source: true *** True Line Result - raise <<-S -** Processing line: ~ * ERROR:~ + data = gtk.read_file(file) || "" +** Processing line: ~ data.each_line~ - Inside source: true *** True Line Result - * ERROR: -** Processing line: ~ A block is required for Numeric#map.~ + data.each_line +** Processing line: ~ .reject { |l| l.strip.length == 0 }~ - Inside source: true *** True Line Result - A block is required for Numeric#map. -** Processing line: ~~ + .reject { |l| l.strip.length == 0 } +** Processing line: ~ .map { |l| string_to_line l }~ - Inside source: true *** True Line Result - -** Processing line: ~ S~ + .map { |l| string_to_line l } +** Processing line: ~ .map { |h| h.merge(rect: rect_for_line(h)) }~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + .map { |h| h.merge(rect: rect_for_line(h)) } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ self.to_i.times.map do |i|~ -- Inside source: true -*** True Line Result - self.to_i.times.map do |i| -** Processing line: ~ yield i~ +** Processing line: ~ def load_terrain~ - Inside source: true *** True Line Result - yield i -** Processing line: ~ end~ + def load_terrain +** Processing line: ~ load_lines 'data/level.txt'~ - Inside source: true *** True Line Result - end + load_lines 'data/level.txt' ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113715,54 +117804,58 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def check_numeric! sender, other~ +** Processing line: ~ def load_lava~ +- Inside source: true +*** True Line Result + def load_lava +** Processing line: ~ load_lines 'data/level_lava.txt'~ - Inside source: true *** True Line Result - def check_numeric! sender, other -** Processing line: ~ return if other.is_a? Numeric~ + load_lines 'data/level_lava.txt' +** Processing line: ~ end~ - Inside source: true *** True Line Result - return if other.is_a? Numeric + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ raise <<-S~ +** Processing line: ~ def load_level force: false~ - Inside source: true *** True Line Result - raise <<-S -** Processing line: ~ * ERROR:~ + def load_level force: false +** Processing line: ~ if force~ - Inside source: true *** True Line Result - * ERROR: -** Processing line: ~ Attempted to invoke :+ on #{self} with the right hand argument of:~ + if force +** Processing line: ~ state.snaps = {}~ - Inside source: true *** True Line Result - Attempted to invoke :+ on #{self} with the right hand argument of: -** Processing line: ~~ + state.snaps = {} +** Processing line: ~ state.terrain = load_terrain~ - Inside source: true *** True Line Result - -** Processing line: ~ #{other}~ + state.terrain = load_terrain +** Processing line: ~ state.lava = load_lava~ - Inside source: true *** True Line Result - #{other} -** Processing line: ~~ + state.lava = load_lava +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ The object above is not a Numeric.~ + else +** Processing line: ~ state.terrain ||= load_terrain~ - Inside source: true *** True Line Result - The object above is not a Numeric. -** Processing line: ~~ + state.terrain ||= load_terrain +** Processing line: ~ state.lava ||= load_lava~ - Inside source: true *** True Line Result - -** Processing line: ~ S~ + state.lava ||= load_lava +** Processing line: ~ end~ - Inside source: true *** True Line Result - S + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113771,22 +117864,26 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def - other~ +** Processing line: ~ def save_lines lines, file~ - Inside source: true *** True Line Result - def - other -** Processing line: ~ return nil unless other~ + def save_lines lines, file +** Processing line: ~ s = lines.map do |l|~ - Inside source: true *** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :-, other~ + s = lines.map do |l| +** Processing line: ~ "#{l.x1},#{l.y1},#{l.x2},#{l.y2}"~ - Inside source: true *** True Line Result - check_numeric! :-, other -** Processing line: ~ super~ + "#{l.x1},#{l.y1},#{l.x2},#{l.y2}" +** Processing line: ~ end.join("\n")~ - Inside source: true *** True Line Result - super + end.join("\n") +** Processing line: ~ gtk.write_file(file, s)~ +- Inside source: true +*** True Line Result + gtk.write_file(file, s) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113795,22 +117892,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 + other~ +** Processing line: ~ def save_level~ - Inside source: true *** True Line Result - def + other -** Processing line: ~ return nil unless other~ + def save_level +** Processing line: ~ save_lines(state.terrain, 'level.txt')~ - Inside source: true *** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :+, other~ + save_lines(state.terrain, 'level.txt') +** Processing line: ~ save_lines(state.lava, 'level_lava.txt')~ - Inside source: true *** True Line Result - check_numeric! :+, other -** Processing line: ~ super~ + save_lines(state.lava, 'level_lava.txt') +** Processing line: ~ load_level force: true~ - Inside source: true *** True Line Result - super + load_level force: true ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113819,22 +117916,14 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def * other~ -- Inside source: true -*** True Line Result - def * other -** Processing line: ~ return nil unless other~ -- Inside source: true -*** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :*, other~ +** Processing line: ~ def line_near_rect? rect, terrain~ - Inside source: true *** True Line Result - check_numeric! :*, other -** Processing line: ~ super~ + def line_near_rect? rect, terrain +** Processing line: ~ geometry.intersect_rect?(rect, terrain[:rect])~ - Inside source: true *** True Line Result - super + geometry.intersect_rect?(rect, terrain[:rect]) ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113843,22 +117932,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 / other~ +** Processing line: ~ def point_within_line? point, line~ - Inside source: true *** True Line Result - def / other -** Processing line: ~ return nil unless other~ + def point_within_line? point, line +** Processing line: ~ return false if !point~ - Inside source: true *** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :/, other~ + return false if !point +** Processing line: ~ return false if !line~ - Inside source: true *** True Line Result - check_numeric! :/, other -** Processing line: ~ super~ + return false if !line +** Processing line: ~ return true~ - Inside source: true *** True Line Result - super + return true ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113867,102 +117956,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 serialize~ +** Processing line: ~ def calc_impacts x, dx, y, dy, radius~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ self~ + def calc_impacts x, dx, y, dy, radius +** Processing line: ~ results = { }~ - Inside source: true *** True Line Result - self -** Processing line: ~ end~ + results = { } +** Processing line: ~ results[:x] = x~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + results[:x] = x +** Processing line: ~ results[:y] = y~ - Inside source: true *** True Line Result - -** Processing line: ~ def from_top~ + results[:y] = y +** Processing line: ~ results[:dx] = x~ - Inside source: true *** True Line Result - def from_top -** Processing line: ~ return 720 - self unless $gtk~ + results[:dx] = x +** Processing line: ~ results[:dy] = y~ - Inside source: true *** True Line Result - return 720 - self unless $gtk -** Processing line: ~ $gtk.args.grid.h - self~ + results[:dy] = y +** Processing line: ~ results[:point] = { x: x, y: y }~ - Inside source: true *** True Line Result - $gtk.args.grid.h - self -** Processing line: ~ end~ + results[:point] = { x: x, y: y } +** Processing line: ~ results[:rect] = { x: x - radius, y: y - radius, w: radius * 2, h: radius * 2 }~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + results[:rect] = { x: x - radius, y: y - radius, w: radius * 2, h: radius * 2 } +** Processing line: ~ results[:trajectory] = trajectory(results)~ - Inside source: true *** True Line Result - -** Processing line: ~ def from_right~ + results[:trajectory] = trajectory(results) +** Processing line: ~ results[:impacts] = terrain.find_all { |t| line_near_rect? results[:rect], t }.map do |t|~ - Inside source: true *** True Line Result - def from_right -** Processing line: ~ return 1280 - self unless $gtk~ + results[:impacts] = terrain.find_all { |t| line_near_rect? results[:rect], t }.map do |t| +** Processing line: ~ {~ - Inside source: true *** True Line Result - return 1280 - self unless $gtk -** Processing line: ~ $gtk.args.grid.w - self~ + { +** Processing line: ~ terrain: t,~ - Inside source: true *** True Line Result - $gtk.args.grid.w - self -** Processing line: ~ end~ + terrain: t, +** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t),~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + point: geometry.line_intersect(results[:trajectory], t), +** Processing line: ~ type: :terrain~ - Inside source: true *** True Line Result - end + type: :terrain +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ end.reject { |t| !point_within_line? t[:point], t[:terrain] }~ +- Inside source: true +*** True Line Result + end.reject { |t| !point_within_line? t[:point], t[:terrain] } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class Fixnum~ +** Processing line: ~ results[:impacts] += lava.find_all { |t| line_near_rect? results[:rect], t }.map do |t|~ - Inside source: true *** True Line Result - class Fixnum -** Processing line: ~ include ValueType~ + results[:impacts] += lava.find_all { |t| line_near_rect? results[:rect], t }.map do |t| +** Processing line: ~ {~ - Inside source: true *** True Line Result - include ValueType -** Processing line: ~~ + { +** Processing line: ~ terrain: t,~ - Inside source: true *** True Line Result - -** Processing line: ~ alias_method(:original_eq_eq, :==) unless Fixnum.instance_methods.include?(:original_eq_eq)~ + terrain: t, +** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t),~ - Inside source: true *** True Line Result - alias_method(:original_eq_eq, :==) unless Fixnum.instance_methods.include?(:original_eq_eq) -** Processing line: ~~ + point: geometry.line_intersect(results[:trajectory], t), +** Processing line: ~ type: :lava~ - Inside source: true *** True Line Result - -** Processing line: ~ def - other~ + type: :lava +** Processing line: ~ }~ - Inside source: true *** True Line Result - def - other -** Processing line: ~ return nil unless other~ + } +** Processing line: ~ end.reject { |t| !point_within_line? t[:point], t[:terrain] }~ - Inside source: true *** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :-, other~ + end.reject { |t| !point_within_line? t[:point], t[:terrain] } +** Processing line: ~~ - Inside source: true *** True Line Result - check_numeric! :-, other -** Processing line: ~ super~ + +** Processing line: ~ results~ - Inside source: true *** True Line Result - super + results ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113971,26 +118068,26 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Returns `true` if the numeric value is evenly divisible by 2.~ +** Processing line: ~ def calc_potential_impacts~ - Inside source: true *** True Line Result - # Returns `true` if the numeric value is evenly divisible by 2. -** Processing line: ~ #~ + def calc_potential_impacts +** Processing line: ~ impact_results = calc_impacts circle.x, circle.dx, circle.y, circle.dy, circle.radius~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + impact_results = calc_impacts circle.x, circle.dx, circle.y, circle.dy, circle.radius +** Processing line: ~ circle.rect = impact_results[:rect]~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def even?~ + circle.rect = impact_results[:rect] +** Processing line: ~ circle.trajectory = impact_results[:trajectory]~ - Inside source: true *** True Line Result - def even? -** Processing line: ~ return (self % 2) == 0~ + circle.trajectory = impact_results[:trajectory] +** Processing line: ~ circle.impacts = impact_results[:impacts]~ - Inside source: true *** True Line Result - return (self % 2) == 0 + circle.impacts = impact_results[:impacts] ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -113999,74 +118096,66 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ # Returns `true` if the numeric value is *NOT* evenly divisible by 2.~ +** Processing line: ~ def calc_terrains_to_monitor~ - Inside source: true *** True Line Result - # Returns `true` if the numeric value is *NOT* evenly divisible by 2. -** Processing line: ~ #~ + def calc_terrains_to_monitor +** Processing line: ~ circle.impact = nil~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + circle.impact = nil +** Processing line: ~ circle.impacts.each do |i|~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def odd?~ + circle.impacts.each do |i| +** Processing line: ~ circle.terrains_to_monitor[i[:terrain]] ||= {~ - Inside source: true *** True Line Result - def odd? -** Processing line: ~ return !even?~ + circle.terrains_to_monitor[i[:terrain]] ||= { +** Processing line: ~ ray_start: geometry.ray_test(circle, i[:terrain]),~ - Inside source: true *** True Line Result - return !even? -** Processing line: ~ end~ + ray_start: geometry.ray_test(circle, i[:terrain]), +** Processing line: ~ }~ - Inside source: true *** True Line Result - end + } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def + other~ -- Inside source: true -*** True Line Result - def + other -** Processing line: ~ return nil unless other~ -- Inside source: true -*** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :+, other~ +** Processing line: ~ circle.terrains_to_monitor[i[:terrain]][:ray_current] = geometry.ray_test(circle, i[:terrain])~ - Inside source: true *** True Line Result - check_numeric! :+, other -** Processing line: ~ super~ + circle.terrains_to_monitor[i[:terrain]][:ray_current] = geometry.ray_test(circle, i[:terrain]) +** Processing line: ~ if circle.terrains_to_monitor[i[:terrain]][:ray_start] != circle.terrains_to_monitor[i[:terrain]][:ray_current]~ - Inside source: true *** True Line Result - super -** Processing line: ~ end~ + if circle.terrains_to_monitor[i[:terrain]][:ray_start] != circle.terrains_to_monitor[i[:terrain]][:ray_current] +** Processing line: ~ if circle.x.between?(i[:terrain].x, i[:terrain].x2) || circle.y.between?(i[:terrain].y, i[:terrain].y2)~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + if circle.x.between?(i[:terrain].x, i[:terrain].x2) || circle.y.between?(i[:terrain].y, i[:terrain].y2) +** Processing line: ~ circle.impact = i~ - Inside source: true *** True Line Result - -** Processing line: ~ def * other~ + circle.impact = i +** Processing line: ~ circle.ray_current = circle.terrains_to_monitor[i[:terrain]][:ray_current]~ - Inside source: true *** True Line Result - def * other -** Processing line: ~ return nil unless other~ + circle.ray_current = circle.terrains_to_monitor[i[:terrain]][:ray_current] +** Processing line: ~ end~ - Inside source: true *** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :*, other~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - check_numeric! :*, other -** Processing line: ~ super~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - super + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -114075,246 +118164,282 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def / other~ +** Processing line: ~ def impact_result body, impact~ - Inside source: true *** True Line Result - def / other -** Processing line: ~ return nil unless other~ + def impact_result body, impact +** Processing line: ~ infinity_alias = 1000~ - Inside source: true *** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :/, other~ + infinity_alias = 1000 +** Processing line: ~ r = {~ - Inside source: true *** True Line Result - check_numeric! :/, other -** Processing line: ~ super~ + r = { +** Processing line: ~ body: {},~ - Inside source: true *** True Line Result - super -** Processing line: ~ end~ + body: {}, +** Processing line: ~ terrain: {},~ - Inside source: true *** True Line Result - end + terrain: {}, +** Processing line: ~ impact: {}~ +- Inside source: true +*** True Line Result + impact: {} +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def == other~ +** Processing line: ~ r[:body][:line] = body.trajectory.dup~ - Inside source: true *** True Line Result - def == other -** Processing line: ~ return true if self.original_eq_eq(other)~ + r[:body][:line] = body.trajectory.dup +** Processing line: ~ r[:body][:slope] = geometry.line_slope(body.trajectory, replace_infinity: infinity_alias)~ - Inside source: true *** True Line Result - return true if self.original_eq_eq(other) -** Processing line: ~ if other.is_a?(GTK::OpenEntity)~ + r[:body][:slope] = geometry.line_slope(body.trajectory, replace_infinity: infinity_alias) +** Processing line: ~ r[:body][:slope_sign] = r[:body][:slope].sign~ - Inside source: true *** True Line Result - if other.is_a?(GTK::OpenEntity) -** Processing line: ~ return self.original_eq_eq(other.entity_id)~ + r[:body][:slope_sign] = r[:body][:slope].sign +** Processing line: ~ r[:body][:x] = body.x~ - Inside source: true *** True Line Result - return self.original_eq_eq(other.entity_id) -** Processing line: ~ end~ + r[:body][:x] = body.x +** Processing line: ~ r[:body][:y] = body.y~ - Inside source: true *** True Line Result - end -** Processing line: ~ return self.original_eq_eq(other)~ + r[:body][:y] = body.y +** Processing line: ~ r[:body][:dy] = body.dy~ - Inside source: true *** True Line Result - return self.original_eq_eq(other) -** Processing line: ~ end~ + r[:body][:dy] = body.dy +** Processing line: ~ r[:body][:dx] = body.dx~ - Inside source: true *** True Line Result - end + r[:body][:dx] = body.dx ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns `-1` if the number is less than `0`. `+1` if the number~ +** Processing line: ~ r[:terrain][:line] = impact[:terrain].dup~ - Inside source: true *** True Line Result - # 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`.~ + r[:terrain][:line] = impact[:terrain].dup +** Processing line: ~ r[:terrain][:slope] = geometry.line_slope(impact[:terrain], replace_infinity: infinity_alias)~ - Inside source: true *** True Line Result - # is greater than `0`. Returns `0` if the number is equal to `0`. -** Processing line: ~ #~ + r[:terrain][:slope] = geometry.line_slope(impact[:terrain], replace_infinity: infinity_alias) +** Processing line: ~ r[:terrain][:slope_sign] = r[:terrain][:slope].sign~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + r[:terrain][:slope_sign] = r[:terrain][:slope].sign +** Processing line: ~~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def sign~ + +** Processing line: ~ r[:impact][:angle] = geometry.angle_between_lines(body.trajectory, impact[:terrain], replace_infinity: infinity_alias)~ - Inside source: true *** True Line Result - def sign -** Processing line: ~ return -1 if self < 0~ + r[:impact][:angle] = geometry.angle_between_lines(body.trajectory, impact[:terrain], replace_infinity: infinity_alias) +** Processing line: ~ r[:impact][:point] = { x: impact[:point].x, y: impact[:point].y }~ - Inside source: true *** True Line Result - return -1 if self < 0 -** Processing line: ~ return 1 if self > 0~ + r[:impact][:point] = { x: impact[:point].x, y: impact[:point].y } +** Processing line: ~ r[:impact][:same_slope_sign] = r[:body][:slope_sign] == r[:terrain][:slope_sign]~ - Inside source: true *** True Line Result - return 1 if self > 0 -** Processing line: ~ return 0~ + r[:impact][:same_slope_sign] = r[:body][:slope_sign] == r[:terrain][:slope_sign] +** Processing line: ~ r[:impact][:ray] = body.ray_current~ - Inside source: true *** True Line Result - return 0 -** Processing line: ~ end~ + r[:impact][:ray] = body.ray_current +** Processing line: ~ r[:body][:new_on_floor] = body.on_floor~ - Inside source: true *** True Line Result - end + r[:body][:new_on_floor] = body.on_floor +** Processing line: ~ r[:body][:new_floor] = r[:terrain][:line]~ +- Inside source: true +*** True Line Result + r[:body][:new_floor] = r[:terrain][:line] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns `true` if number is greater than `0`.~ +** Processing line: ~ if r[:impact][:angle].abs < 90 && r[:terrain][:slope].abs < 3~ - Inside source: true *** True Line Result - # Returns `true` if number is greater than `0`. -** Processing line: ~ #~ + if r[:impact][:angle].abs < 90 && r[:terrain][:slope].abs < 3 +** Processing line: ~ play_sound~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + play_sound +** Processing line: ~ r[:body][:new_dy] = r[:body][:dy] * circle.elasticity * -1~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def pos?~ + r[:body][:new_dy] = r[:body][:dy] * circle.elasticity * -1 +** Processing line: ~ r[:body][:new_dx] = r[:body][:dx] * circle.elasticity~ - Inside source: true *** True Line Result - def pos? -** Processing line: ~ sign > 0~ + r[:body][:new_dx] = r[:body][:dx] * circle.elasticity +** Processing line: ~ r[:impact][:type] = :horizontal~ - Inside source: true *** True Line Result - sign > 0 -** Processing line: ~ end~ + r[:impact][:type] = :horizontal +** Processing line: ~ r[:body][:new_reason] = "-"~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + r[:body][:new_reason] = "-" +** Processing line: ~ elsif r[:impact][:angle].abs < 90 && r[:terrain][:slope].abs > 3~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns `true` if number is less than `0`.~ + elsif r[:impact][:angle].abs < 90 && r[:terrain][:slope].abs > 3 +** Processing line: ~ play_sound~ - Inside source: true *** True Line Result - # Returns `true` if number is less than `0`. -** Processing line: ~ #~ + play_sound +** Processing line: ~ r[:body][:new_dy] = r[:body][:dy] * 1.1~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + r[:body][:new_dy] = r[:body][:dy] * 1.1 +** Processing line: ~ r[:body][:new_dx] = r[:body][:dx] * -circle.elasticity~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def neg?~ + r[:body][:new_dx] = r[:body][:dx] * -circle.elasticity +** Processing line: ~ r[:impact][:type] = :vertical~ - Inside source: true *** True Line Result - def neg? -** Processing line: ~ sign < 0~ + r[:impact][:type] = :vertical +** Processing line: ~ r[:body][:new_reason] = "|"~ - Inside source: true *** True Line Result - sign < 0 -** Processing line: ~ end~ + r[:body][:new_reason] = "|" +** Processing line: ~ else~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + else +** Processing line: ~ play_sound~ - Inside source: true *** True Line Result - -** Processing line: ~ # Returns the cosine of a represented in degrees (NOT radians).~ + play_sound +** Processing line: ~ r[:body][:new_dx] = r[:body][:dx] * -circle.elasticity~ - Inside source: true *** True Line Result - # Returns the cosine of a represented in degrees (NOT radians). -** Processing line: ~ #~ + r[:body][:new_dx] = r[:body][:dx] * -circle.elasticity +** Processing line: ~ r[:body][:new_dy] = r[:body][:dy] * -circle.elasticity~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + r[:body][:new_dy] = r[:body][:dy] * -circle.elasticity +** Processing line: ~ r[:impact][:type] = :slanted~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def cos~ + r[:impact][:type] = :slanted +** Processing line: ~ r[:body][:new_reason] = "/"~ - Inside source: true *** True Line Result - def cos -** Processing line: ~ Math.cos(self.to_radians)~ + r[:body][:new_reason] = "/" +** Processing line: ~ end~ - Inside source: true *** True Line Result - Math.cos(self.to_radians) -** Processing line: ~ end~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - end + +** Processing line: ~ r[:impact][:energy] = r[:body][:new_dx].abs + r[:body][:new_dy].abs~ +- Inside source: true +*** True Line Result + r[:impact][:energy] = r[:body][:new_dx].abs + r[:body][:new_dy].abs ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # Returns the cosine of a represented in degrees (NOT radians).~ +** Processing line: ~ if r[:impact][:energy] <= 0.3 && r[:terrain][:slope].abs < 4~ - Inside source: true *** True Line Result - # Returns the cosine of a represented in degrees (NOT radians). -** Processing line: ~ #~ + if r[:impact][:energy] <= 0.3 && r[:terrain][:slope].abs < 4 +** Processing line: ~ r[:body][:new_dx] = 0~ - Inside source: true *** True Line Result - # -** Processing line: ~ # @gtk~ + r[:body][:new_dx] = 0 +** Processing line: ~ r[:body][:new_dy] = 0~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def sin~ + r[:body][:new_dy] = 0 +** Processing line: ~ r[:impact][:energy] = 0~ - Inside source: true *** True Line Result - def sin -** Processing line: ~ Math.sin(self.to_radians)~ + r[:impact][:energy] = 0 +** Processing line: ~ r[:body][:new_on_floor] = true~ - Inside source: true *** True Line Result - Math.sin(self.to_radians) -** Processing line: ~ end~ + r[:body][:new_on_floor] = true +** Processing line: ~ r[:body][:new_floor] = r[:terrain][:line]~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + r[:body][:new_floor] = r[:terrain][:line] +** Processing line: ~ r[:body][:new_reason] = "0"~ - Inside source: true *** True Line Result - end + r[:body][:new_reason] = "0" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class Float~ +** Processing line: ~ r[:impact][:ray_next] = geometry.ray_test({ x: r[:body][:x] - (r[:body][:dx] * 1.1) + r[:body][:new_dx],~ - Inside source: true *** True Line Result - class Float -** Processing line: ~ include ValueType~ + r[:impact][:ray_next] = geometry.ray_test({ x: r[:body][:x] - (r[:body][:dx] * 1.1) + r[:body][:new_dx], +** Processing line: ~ y: r[:body][:y] - (r[:body][:dy] * 1.1) + r[:body][:new_dy] + state.gravity },~ - Inside source: true *** True Line Result - include ValueType + y: r[:body][:y] - (r[:body][:dy] * 1.1) + r[:body][:new_dy] + state.gravity }, +** Processing line: ~ r[:terrain][:line])~ +- Inside source: true +*** True Line Result + r[:terrain][:line]) ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def - other~ +** Processing line: ~ if r[:impact][:ray_next] == r[:impact][:ray]~ - Inside source: true *** True Line Result - def - other -** Processing line: ~ return nil unless other~ + if r[:impact][:ray_next] == r[:impact][:ray] +** Processing line: ~ r[:body][:new_dx] *= -1~ - Inside source: true *** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :-, other~ + r[:body][:new_dx] *= -1 +** Processing line: ~ r[:body][:new_dy] *= -1~ - Inside source: true *** True Line Result - check_numeric! :-, other -** Processing line: ~ super~ + r[:body][:new_dy] *= -1 +** Processing line: ~ r[:body][:new_reason] = "clip"~ - Inside source: true *** True Line Result - super + r[:body][:new_reason] = "clip" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ r~ +- Inside source: true +*** True Line Result + r ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -114323,22 +118448,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 + other~ +** Processing line: ~ def game_over!~ - Inside source: true *** True Line Result - def + other -** Processing line: ~ return nil unless other~ + def game_over! +** Processing line: ~ circle.x = circle.check_point_x~ - Inside source: true *** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :+, other~ + circle.x = circle.check_point_x +** Processing line: ~ circle.y = circle.check_point_y~ - Inside source: true *** True Line Result - check_numeric! :+, other -** Processing line: ~ super~ + circle.y = circle.check_point_y +** Processing line: ~ circle.dx = 0~ - Inside source: true *** True Line Result - super + circle.dx = 0 +** Processing line: ~ circle.dy = 0~ +- Inside source: true +*** True Line Result + circle.dy = 0 +** Processing line: ~ circle.game_over_at = state.tick_count~ +- Inside source: true +*** True Line Result + circle.game_over_at = state.tick_count ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -114347,830 +118480,754 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def * other~ +** Processing line: ~ def not_game_over!~ - Inside source: true *** True Line Result - def * other -** Processing line: ~ return nil unless other~ + def not_game_over! +** Processing line: ~ impact_history_entry = impact_result circle, circle.impact~ - Inside source: true *** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :*, other~ + impact_history_entry = impact_result circle, circle.impact +** Processing line: ~ circle.impact_history << impact_history_entry~ - Inside source: true *** True Line Result - check_numeric! :*, other -** Processing line: ~ super~ + circle.impact_history << impact_history_entry +** Processing line: ~ circle.x -= circle.dx * 1.1~ - Inside source: true *** True Line Result - super -** Processing line: ~ end~ + circle.x -= circle.dx * 1.1 +** Processing line: ~ circle.y -= circle.dy * 1.1~ - Inside source: true *** True Line Result - end + circle.y -= circle.dy * 1.1 +** Processing line: ~ circle.dx = impact_history_entry[:body][:new_dx]~ +- Inside source: true +*** True Line Result + circle.dx = impact_history_entry[:body][:new_dx] +** Processing line: ~ circle.dy = impact_history_entry[:body][:new_dy]~ +- Inside source: true +*** True Line Result + circle.dy = impact_history_entry[:body][:new_dy] +** Processing line: ~ circle.on_floor = impact_history_entry[:body][:new_on_floor]~ +- Inside source: true +*** True Line Result + circle.on_floor = impact_history_entry[:body][:new_on_floor] ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def / other~ +** Processing line: ~ if circle.on_floor~ - Inside source: true *** True Line Result - def / other -** Processing line: ~ return nil unless other~ + if circle.on_floor +** Processing line: ~ circle.check_point_at = state.tick_count~ - Inside source: true *** True Line Result - return nil unless other -** Processing line: ~ check_numeric! :/, other~ + circle.check_point_at = state.tick_count +** Processing line: ~ circle.check_point_x = circle.x~ - Inside source: true *** True Line Result - check_numeric! :/, other -** Processing line: ~ super~ + circle.check_point_x = circle.x +** Processing line: ~ circle.check_point_y = circle.y~ - Inside source: true *** True Line Result - super -** Processing line: ~ end~ + circle.check_point_y = circle.y +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def serialize~ +** Processing line: ~ circle.previous_floor = circle.floor || {}~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ self~ + circle.previous_floor = circle.floor || {} +** Processing line: ~ circle.floor = impact_history_entry[:body][:new_floor] || {}~ - Inside source: true *** True Line Result - self -** Processing line: ~ end~ + circle.floor = impact_history_entry[:body][:new_floor] || {} +** Processing line: ~ circle.floor_point = impact_history_entry[:impact][:point]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + circle.floor_point = impact_history_entry[:impact][:point] +** Processing line: ~ if circle.floor.slice(:x, :y, :x2, :y2) != circle.previous_floor.slice(:x, :y, :x2, :y2)~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + if circle.floor.slice(:x, :y, :x2, :y2) != circle.previous_floor.slice(:x, :y, :x2, :y2) +** Processing line: ~ new_relative_x = if circle.dx > 0~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def sign~ + new_relative_x = if circle.dx > 0 +** Processing line: ~ :right~ - Inside source: true *** True Line Result - def sign -** Processing line: ~ return -1 if self < 0~ + :right +** Processing line: ~ elsif circle.dx < 0~ - Inside source: true *** True Line Result - return -1 if self < 0 -** Processing line: ~ return 1 if self > 0~ + elsif circle.dx < 0 +** Processing line: ~ :left~ - Inside source: true *** True Line Result - return 1 if self > 0 -** Processing line: ~ return 0~ + :left +** Processing line: ~ else~ - Inside source: true *** True Line Result - return 0 -** Processing line: ~ end~ + else +** Processing line: ~ nil~ - Inside source: true *** True Line Result - end + nil +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def replace_infinity scalar~ +** Processing line: ~ new_relative_y = if circle.dy > 0~ - Inside source: true *** True Line Result - def replace_infinity scalar -** Processing line: ~ return self if !scalar~ + new_relative_y = if circle.dy > 0 +** Processing line: ~ :above~ - Inside source: true *** True Line Result - return self if !scalar -** Processing line: ~ return self unless self.infinite?~ + :above +** Processing line: ~ elsif circle.dy < 0~ - Inside source: true *** True Line Result - return self unless self.infinite? -** Processing line: ~ return -scalar if self < 0~ + elsif circle.dy < 0 +** Processing line: ~ :below~ - Inside source: true *** True Line Result - return -scalar if self < 0 -** Processing line: ~ return scalar if self > 0~ + :below +** Processing line: ~ else~ - Inside source: true *** True Line Result - return scalar if self > 0 -** Processing line: ~ end~ + else +** Processing line: ~ nil~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ class Integer~ +** Processing line: ~ circle.floor_relative_x = new_relative_x~ - Inside source: true *** True Line Result - class Integer -** Processing line: ~ alias_method(:original_round, :round) unless Fixnum.instance_methods.include?(:original_round)~ + circle.floor_relative_x = new_relative_x +** Processing line: ~ circle.floor_relative_y = new_relative_y~ +- Inside source: true +*** True Line Result + circle.floor_relative_y = new_relative_y +** Processing line: ~ end~ - Inside source: true *** True Line Result - alias_method(:original_round, :round) unless Fixnum.instance_methods.include?(:original_round) + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def round *args~ +** Processing line: ~ circle.impact = nil~ - Inside source: true *** True Line Result - def round *args -** Processing line: ~ original_round~ + circle.impact = nil +** Processing line: ~ circle.terrains_to_monitor.clear~ - Inside source: true *** True Line Result - original_round + circle.terrains_to_monitor.clear ** 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: ~* runtime/draw.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* runtime/draw.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +** Processing line: ~ def calc_physics~ +- Inside source: true *** True Line Result - + def calc_physics +** Processing line: ~ if args.state.god_mode~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/runtime/draw.rb~ + if args.state.god_mode +** Processing line: ~ calc_potential_impacts~ - Inside source: true *** True Line Result - # ./dragon/runtime/draw.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + calc_potential_impacts +** Processing line: ~ calc_terrains_to_monitor~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + calc_terrains_to_monitor +** Processing line: ~ return~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # draw.rb has been released under MIT (*only this file*).~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - # draw.rb has been released under MIT (*only this file*). + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ module GTK~ +** Processing line: ~ if circle.y < -700~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Runtime~ + if circle.y < -700 +** Processing line: ~ game_over~ - Inside source: true *** True Line Result - class Runtime -** Processing line: ~ module Draw~ + game_over +** Processing line: ~ return~ - 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~ -- Inside source: true -*** True Line Result - return $top_level.tick_render @args, pass -** Processing line: ~ end~ -- 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~ -- Inside source: true -*** True Line Result - # Don't change this draw order unless you understand -** Processing line: ~ # the implications.~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - # the implications. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # pass.solids.each { |s| draw_solid s }~ +** Processing line: ~ return if state.game_over~ - Inside source: true *** True Line Result - # pass.solids.each { |s| draw_solid s } -** Processing line: ~ # while loops are faster than each with block~ + return if state.game_over +** Processing line: ~ return if circle.on_floor~ - Inside source: true *** True Line Result - # while loops are faster than each with block -** Processing line: ~ idx = 0~ + return if circle.on_floor +** Processing line: ~ circle.previous_dy = circle.dy~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.solids.length~ + circle.previous_dy = circle.dy +** Processing line: ~ circle.previous_dx = circle.dx~ - Inside source: true *** True Line Result - while idx < pass.solids.length -** Processing line: ~ draw_solid (pass.solids.value idx) # accessing an array using .value instead of [] is faster~ + circle.previous_dx = circle.dx +** Processing line: ~ circle.x += circle.dx~ - Inside source: true *** True Line Result - draw_solid (pass.solids.value idx) # accessing an array using .value instead of [] is faster -** Processing line: ~ idx += 1~ + circle.x += circle.dx +** Processing line: ~ circle.y += circle.dy~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + circle.y += circle.dy +** Processing line: ~ args.state.distance_traveled ||= 0~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + args.state.distance_traveled ||= 0 +** Processing line: ~ args.state.distance_traveled += circle.dx.abs + circle.dy.abs~ - Inside source: true *** True Line Result - -** Processing line: ~ # pass.static_solids.each { |s| draw_solid s }~ + args.state.distance_traveled += circle.dx.abs + circle.dy.abs +** Processing line: ~ circle.dy += state.gravity~ - Inside source: true *** True Line Result - # pass.static_solids.each { |s| draw_solid s } -** Processing line: ~ idx = 0~ + circle.dy += state.gravity +** Processing line: ~ calc_potential_impacts~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.static_solids.length~ + calc_potential_impacts +** Processing line: ~ calc_terrains_to_monitor~ - Inside source: true *** True Line Result - while idx < pass.static_solids.length -** Processing line: ~ draw_solid (pass.static_solids.value idx)~ + calc_terrains_to_monitor +** Processing line: ~ return unless circle.impact~ - Inside source: true *** True Line Result - draw_solid (pass.static_solids.value idx) -** Processing line: ~ idx += 1~ + return unless circle.impact +** Processing line: ~ if circle.impact && circle.impact[:type] == :lava~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + if circle.impact && circle.impact[:type] == :lava +** Processing line: ~ game_over!~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + game_over! +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ # pass.sprites.each { |s| draw_sprite s }~ + else +** Processing line: ~ not_game_over!~ - Inside source: true *** True Line Result - # pass.sprites.each { |s| draw_sprite s } -** Processing line: ~ idx = 0~ + not_game_over! +** Processing line: ~ end~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.sprites.length~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - while idx < pass.sprites.length -** Processing line: ~ draw_sprite (pass.sprites.value idx)~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - draw_sprite (pass.sprites.value idx) -** Processing line: ~ idx += 1~ + +** Processing line: ~ def input_god_mode~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + def input_god_mode +** Processing line: ~ state.debug_mode = !state.debug_mode if inputs.keyboard.key_down.forward_slash~ - Inside source: true *** True Line Result - end + state.debug_mode = !state.debug_mode if inputs.keyboard.key_down.forward_slash ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # pass.static_sprites.each { |s| draw_sprite s }~ -- Inside source: true -*** True Line Result - # pass.static_sprites.each { |s| draw_sprite s } -** Processing line: ~ idx = 0~ +** Processing line: ~ # toggle god mode~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.static_sprites.length~ + # toggle god mode +** Processing line: ~ if inputs.keyboard.key_down.g~ - Inside source: true *** True Line Result - while idx < pass.static_sprites.length -** Processing line: ~ draw_sprite (pass.static_sprites.value idx)~ + if inputs.keyboard.key_down.g +** Processing line: ~ state.god_mode = !state.god_mode~ - Inside source: true *** True Line Result - draw_sprite (pass.static_sprites.value idx) -** Processing line: ~ idx += 1~ + state.god_mode = !state.god_mode +** Processing line: ~ state.potential_lift = 0~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + state.potential_lift = 0 +** Processing line: ~ circle.floor = nil~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + circle.floor = nil +** Processing line: ~ circle.floor_point = nil~ - Inside source: true *** True Line Result - -** Processing line: ~ # pass.primitives.each { |p| draw_primitive p }~ + circle.floor_point = nil +** Processing line: ~ circle.floor_relative_x = nil~ - Inside source: true *** True Line Result - # pass.primitives.each { |p| draw_primitive p } -** Processing line: ~ idx = 0~ + circle.floor_relative_x = nil +** Processing line: ~ circle.floor_relative_y = nil~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.primitives.length~ + circle.floor_relative_y = nil +** Processing line: ~ circle.impact = nil~ - Inside source: true *** True Line Result - while idx < pass.primitives.length -** Processing line: ~ draw_primitive (pass.primitives.value idx)~ + circle.impact = nil +** Processing line: ~ circle.terrains_to_monitor.clear~ - Inside source: true *** True Line Result - draw_primitive (pass.primitives.value idx) -** Processing line: ~ idx += 1~ + circle.terrains_to_monitor.clear +** Processing line: ~ return~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + return +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # pass.static_primitives.each { |p| draw_primitive p }~ -- Inside source: true -*** True Line Result - # pass.static_primitives.each { |p| draw_primitive p } -** Processing line: ~ idx = 0~ -- Inside source: true -*** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.static_primitives.length~ +** Processing line: ~ return unless state.god_mode~ - Inside source: true *** True Line Result - while idx < pass.static_primitives.length -** Processing line: ~ draw_primitive (pass.static_primitives.value idx)~ + return unless state.god_mode +** Processing line: ~~ - Inside source: true *** True Line Result - draw_primitive (pass.static_primitives.value idx) -** Processing line: ~ idx += 1~ + +** Processing line: ~ circle.x = circle.x.to_i~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + circle.x = circle.x.to_i +** Processing line: ~ circle.y = circle.y.to_i~ - Inside source: true *** True Line Result - end + circle.y = circle.y.to_i ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # pass.labels.each { |l| draw_label l }~ +** Processing line: ~ # move god circle~ - Inside source: true *** True Line Result - # pass.labels.each { |l| draw_label l } -** Processing line: ~ idx = 0~ + # move god circle +** Processing line: ~ if inputs.keyboard.left || inputs.keyboard.a~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.labels.length~ + if inputs.keyboard.left || inputs.keyboard.a +** Processing line: ~ circle.x -= 20~ - Inside source: true *** True Line Result - while idx < pass.labels.length -** Processing line: ~ draw_label (pass.labels.value idx)~ + circle.x -= 20 +** Processing line: ~ elsif inputs.keyboard.right || inputs.keyboard.d || inputs.keyboard.f~ - Inside source: true *** True Line Result - draw_label (pass.labels.value idx) -** Processing line: ~ idx += 1~ + elsif inputs.keyboard.right || inputs.keyboard.d || inputs.keyboard.f +** Processing line: ~ circle.x += 20~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + circle.x += 20 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # pass.static_labels.each { |l| draw_label l }~ -- Inside source: true -*** True Line Result - # pass.static_labels.each { |l| draw_label l } -** Processing line: ~ idx = 0~ +** Processing line: ~ if inputs.keyboard.up || inputs.keyboard.w~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.static_labels.length~ + if inputs.keyboard.up || inputs.keyboard.w +** Processing line: ~ circle.y += 20~ - Inside source: true *** True Line Result - while idx < pass.static_labels.length -** Processing line: ~ draw_label (pass.static_labels.value idx)~ + circle.y += 20 +** Processing line: ~ elsif inputs.keyboard.down || inputs.keyboard.s~ - Inside source: true *** True Line Result - draw_label (pass.static_labels.value idx) -** Processing line: ~ idx += 1~ + elsif inputs.keyboard.down || inputs.keyboard.s +** Processing line: ~ circle.y -= 20~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + circle.y -= 20 +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # pass.lines.each { |l| draw_line l }~ +** Processing line: ~ # delete terrain~ - Inside source: true *** True Line Result - # pass.lines.each { |l| draw_line l } -** Processing line: ~ idx = 0~ + # delete terrain +** Processing line: ~ if inputs.keyboard.key_down.x~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.lines.length~ + if inputs.keyboard.key_down.x +** Processing line: ~ calc_terrains_to_monitor~ - Inside source: true *** True Line Result - while idx < pass.lines.length -** Processing line: ~ draw_line (pass.lines.value idx)~ + calc_terrains_to_monitor +** Processing line: ~ state.terrain = state.terrain.reject do |t|~ - Inside source: true *** True Line Result - draw_line (pass.lines.value idx) -** Processing line: ~ idx += 1~ + state.terrain = state.terrain.reject do |t| +** Processing line: ~ t[:rect].intersect_rect? circle.rect~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + t[:rect].intersect_rect? circle.rect +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** 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~ -- Inside source: true -*** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.static_lines.length~ -- Inside source: true -*** True Line Result - while idx < pass.static_lines.length -** Processing line: ~ draw_line (pass.static_lines.value idx)~ +** Processing line: ~ state.lava = state.lava.reject do |t|~ - Inside source: true *** True Line Result - draw_line (pass.static_lines.value idx) -** Processing line: ~ idx += 1~ + state.lava = state.lava.reject do |t| +** Processing line: ~ t[:rect].intersect_rect? circle.rect~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + t[:rect].intersect_rect? circle.rect +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # pass.borders.each { |b| draw_border b }~ -- Inside source: true -*** True Line Result - # pass.borders.each { |b| draw_border b } -** Processing line: ~ idx = 0~ -- Inside source: true -*** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.borders.length~ -- Inside source: true -*** True Line Result - while idx < pass.borders.length -** Processing line: ~ draw_border (pass.borders.value idx)~ +** Processing line: ~ calc_potential_impacts~ - Inside source: true *** True Line Result - draw_border (pass.borders.value idx) -** Processing line: ~ idx += 1~ + calc_potential_impacts +** Processing line: ~ save_level~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + save_level +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # pass.static_borders.each { |b| draw_border b }~ -- Inside source: true -*** True Line Result - # pass.static_borders.each { |b| draw_border b } -** Processing line: ~ idx = 0~ -- Inside source: true -*** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.static_borders.length~ +** Processing line: ~ # change terrain type~ - Inside source: true *** True Line Result - while idx < pass.static_borders.length -** Processing line: ~ draw_border (pass.static_borders.value idx)~ + # change terrain type +** Processing line: ~ if inputs.keyboard.key_down.l~ - Inside source: true *** True Line Result - draw_border (pass.static_borders.value idx) -** Processing line: ~ idx += 1~ + if inputs.keyboard.key_down.l +** Processing line: ~ if state.line_mode == :terrain~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + if state.line_mode == :terrain +** Processing line: ~ state.line_mode = :lava~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.line_mode = :lava +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ if !$gtk.production~ + else +** Processing line: ~ state.line_mode = :terrain~ - Inside source: true *** True Line Result - if !$gtk.production -** Processing line: ~ # pass.debug.each { |r| draw_primitive r }~ + state.line_mode = :terrain +** Processing line: ~ end~ - Inside source: true *** True Line Result - # pass.debug.each { |r| draw_primitive r } -** Processing line: ~ idx = 0~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.debug.length~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - while idx < pass.debug.length -** Processing line: ~ draw_primitive (pass.debug.value idx)~ + +** Processing line: ~ if inputs.mouse.click && !state.point_one~ - Inside source: true *** True Line Result - draw_primitive (pass.debug.value idx) -** Processing line: ~ idx += 1~ + if inputs.mouse.click && !state.point_one +** Processing line: ~ state.point_one = inputs.mouse.click.point~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + state.point_one = inputs.mouse.click.point +** Processing line: ~ elsif inputs.mouse.click && state.point_one~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + elsif inputs.mouse.click && state.point_one +** Processing line: ~ l = [*state.point_one, *inputs.mouse.click.point]~ - Inside source: true *** True Line Result - -** Processing line: ~ # pass.static_debug.each { |r| draw_primitive r }~ + l = [*state.point_one, *inputs.mouse.click.point] +** Processing line: ~ l = [l.x - state.camera.x,~ - Inside source: true *** True Line Result - # pass.static_debug.each { |r| draw_primitive r } -** Processing line: ~ idx = 0~ + l = [l.x - state.camera.x, +** Processing line: ~ l.y - state.camera.y,~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.static_debug.length~ + l.y - state.camera.y, +** Processing line: ~ l.x2 - state.camera.x,~ - Inside source: true *** True Line Result - while idx < pass.static_debug.length -** Processing line: ~ draw_primitive (pass.static_debug.value idx)~ + l.x2 - state.camera.x, +** Processing line: ~ l.y2 - state.camera.y].line.to_hash~ - Inside source: true *** True Line Result - draw_primitive (pass.static_debug.value idx) -** Processing line: ~ idx += 1~ + l.y2 - state.camera.y].line.to_hash +** Processing line: ~ l[:rect] = rect_for_line l~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + l[:rect] = rect_for_line l +** Processing line: ~ if state.line_mode == :terrain~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + if state.line_mode == :terrain +** Processing line: ~ state.terrain << l~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.terrain << l +** Processing line: ~ else~ - Inside source: true *** True Line Result - -** Processing line: ~ # pass.reserved.each { |r| draw_primitive r }~ + else +** Processing line: ~ state.lava << l~ - Inside source: true *** True Line Result - # pass.reserved.each { |r| draw_primitive r } -** Processing line: ~ idx = 0~ + state.lava << l +** Processing line: ~ end~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.reserved.length~ + end +** Processing line: ~ save_level~ - Inside source: true *** True Line Result - while idx < pass.reserved.length -** Processing line: ~ draw_primitive (pass.reserved.value idx)~ + save_level +** Processing line: ~ next_x = inputs.mouse.click.point.x - 640~ - Inside source: true *** True Line Result - draw_primitive (pass.reserved.value idx) -** Processing line: ~ idx += 1~ + next_x = inputs.mouse.click.point.x - 640 +** Processing line: ~ next_y = inputs.mouse.click.point.y - 360~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + next_y = inputs.mouse.click.point.y - 360 +** Processing line: ~ circle.x += next_x~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + circle.x += next_x +** Processing line: ~ circle.y += next_y~ - Inside source: true *** True Line Result - -** Processing line: ~ # pass.static_reserved.each { |r| draw_primitive r }~ + circle.y += next_y +** Processing line: ~ state.point_one = nil~ - Inside source: true *** True Line Result - # pass.static_reserved.each { |r| draw_primitive r } -** Processing line: ~ idx = 0~ + state.point_one = nil +** Processing line: ~ elsif inputs.keyboard.one~ - Inside source: true *** True Line Result - idx = 0 -** Processing line: ~ while idx < pass.static_reserved.length~ + elsif inputs.keyboard.one +** Processing line: ~ state.point_one = [circle.x + camera.x, circle.y+ camera.y]~ - Inside source: true *** True Line Result - while idx < pass.static_reserved.length -** Processing line: ~ draw_primitive (pass.static_reserved.value idx)~ + state.point_one = [circle.x + camera.x, circle.y+ camera.y] +** Processing line: ~ end~ - Inside source: true *** True Line Result - draw_primitive (pass.static_reserved.value idx) -** Processing line: ~ idx += 1~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - idx += 1 -** Processing line: ~ end~ + +** Processing line: ~ # cancel chain lines~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + # cancel chain lines +** Processing line: ~ if inputs.keyboard.key_down.nine || inputs.keyboard.key_down.escape || inputs.keyboard.key_up.six || inputs.keyboard.key_up.one~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ pause!~ + if inputs.keyboard.key_down.nine || inputs.keyboard.key_down.escape || inputs.keyboard.key_up.six || inputs.keyboard.key_up.one +** Processing line: ~ state.point_one = nil~ - Inside source: true *** True Line Result - pause! -** Processing line: ~ pretty_print_exception_and_export! e~ + state.point_one = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - pretty_print_exception_and_export! e -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def draw_solid s~ -- Inside source: true -*** True Line Result - def draw_solid s -** Processing line: ~ return unless s~ +** Processing line: ~ def play_sound~ - Inside source: true *** True Line Result - return unless s -** Processing line: ~ if s.respond_to? :draw_override~ + def play_sound +** Processing line: ~ return if state.sound_debounce > 0~ - Inside source: true *** True Line Result - if s.respond_to? :draw_override -** Processing line: ~ s.draw_override @ffi_draw~ + return if state.sound_debounce > 0 +** Processing line: ~ state.sound_debounce = 5~ - Inside source: true *** True Line Result - s.draw_override @ffi_draw -** Processing line: ~ else~ + state.sound_debounce = 5 +** Processing line: ~ outputs.sounds << "sounds/03#{"%02d" % state.sound_index}.wav"~ - 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~ + outputs.sounds << "sounds/03#{"%02d" % state.sound_index}.wav" +** Processing line: ~ state.sound_index += 1~ - 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 -** Processing line: ~ end~ + state.sound_index += 1 +** Processing line: ~ if state.sound_index > 21~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + if state.sound_index > 21 +** Processing line: ~ state.sound_index = 1~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise_conversion_for_rendering_failed s, e, :solid~ + state.sound_index = 1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - raise_conversion_for_rendering_failed s, e, :solid -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def draw_sprite s~ -- Inside source: true -*** True Line Result - def draw_sprite s -** Processing line: ~ return unless s~ +** Processing line: ~ def input_game~ - Inside source: true *** True Line Result - return unless s -** Processing line: ~ if s.respond_to? :draw_override~ + def input_game +** Processing line: ~ if inputs.keyboard.down || inputs.keyboard.space~ - Inside source: true *** True Line Result - if s.respond_to? :draw_override -** Processing line: ~ s.draw_override @ffi_draw~ + if inputs.keyboard.down || inputs.keyboard.space +** Processing line: ~ circle.potential_lift += 0.03~ - Inside source: true *** True Line Result - s.draw_override @ffi_draw -** Processing line: ~ else~ + circle.potential_lift += 0.03 +** Processing line: ~ circle.potential_lift = circle.potential_lift.lesser(10)~ - Inside source: true *** True Line Result - else -** Processing line: ~ @ffi_draw.draw_sprite_3 s.x, s.y, s.w, s.h,~ + circle.potential_lift = circle.potential_lift.lesser(10) +** Processing line: ~ elsif inputs.keyboard.key_up.down || inputs.keyboard.key_up.space~ - 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,~ + elsif inputs.keyboard.key_up.down || inputs.keyboard.key_up.space +** Processing line: ~ play_sound~ - Inside source: true *** True Line Result - s.path.s_or_default, -** Processing line: ~ s.angle,~ + play_sound +** Processing line: ~ circle.dy += circle.angle.vector_y circle.potential_lift~ - Inside source: true *** True Line Result - s.angle, -** Processing line: ~ s.a, s.r, s.g, s.b,~ + circle.dy += circle.angle.vector_y circle.potential_lift +** Processing line: ~ circle.dx += circle.angle.vector_x circle.potential_lift~ - Inside source: true *** True Line Result - s.a, s.r, s.g, s.b, -** Processing line: ~ s.tile_x, s.tile_y, s.tile_w, s.tile_h,~ + circle.dx += circle.angle.vector_x circle.potential_lift +** Processing line: ~~ - Inside source: true *** True Line Result - s.tile_x, s.tile_y, s.tile_w, s.tile_h, -** Processing line: ~ !!s.flip_horizontally, !!s.flip_vertically,~ + +** Processing line: ~ if circle.on_floor~ - Inside source: true *** True Line Result - !!s.flip_horizontally, !!s.flip_vertically, -** Processing line: ~ s.angle_anchor_x, s.angle_anchor_y,~ + if circle.on_floor +** Processing line: ~ if circle.floor_relative_y == :above~ - 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~ + if circle.floor_relative_y == :above +** Processing line: ~ circle.y += circle.potential_lift.abs * 2~ - Inside source: true *** True Line Result - s.source_x, s.source_y, s.source_w, s.source_h -** Processing line: ~ end~ + circle.y += circle.potential_lift.abs * 2 +** Processing line: ~ elsif circle.floor_relative_y == :below~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + elsif circle.floor_relative_y == :below +** Processing line: ~ circle.y -= circle.potential_lift.abs * 2~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise_conversion_for_rendering_failed s, e, :sprite~ + circle.y -= circle.potential_lift.abs * 2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - raise_conversion_for_rendering_failed s, e, :sprite + end ** Processing line: ~ end~ - Inside source: true *** True Line Result @@ -115179,8101 +119236,71927 @@ Follows is a source code listing for all files that have been open sourced. This - Inside source: true *** True Line Result -** Processing line: ~ def draw_screenshot s~ -- Inside source: true -*** True Line Result - def draw_screenshot s -** Processing line: ~ return unless s~ -- Inside source: true -*** True Line Result - return unless s -** Processing line: ~ if s.respond_to? :draw_override~ +** Processing line: ~ circle.on_floor = false~ - Inside source: true *** True Line Result - if s.respond_to? :draw_override -** Processing line: ~ s.draw_override @ffi_draw~ + circle.on_floor = false +** Processing line: ~ circle.potential_lift = 0~ - Inside source: true *** True Line Result - s.draw_override @ffi_draw -** Processing line: ~ else~ + circle.potential_lift = 0 +** Processing line: ~ circle.terrains_to_monitor.clear~ - Inside source: true *** True Line Result - else -** Processing line: ~ @ffi_draw.draw_screenshot s.path.s_or_default,~ + circle.terrains_to_monitor.clear +** Processing line: ~ circle.impact_history.clear~ - Inside source: true *** True Line Result - @ffi_draw.draw_screenshot s.path.s_or_default, -** Processing line: ~ s.x, s.y, s.w, s.h,~ + circle.impact_history.clear +** Processing line: ~ circle.impact = nil~ - Inside source: true *** True Line Result - s.x, s.y, s.w, s.h, -** Processing line: ~ s.angle,~ + circle.impact = nil +** Processing line: ~ calc_physics~ - Inside source: true *** True Line Result - s.angle, -** Processing line: ~ s.a, s.r, s.g, s.b,~ + calc_physics +** Processing line: ~ end~ - Inside source: true *** True Line Result - s.a, s.r, s.g, s.b, -** Processing line: ~ s.tile_x, s.tile_y, s.tile_w, s.tile_h,~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - s.tile_x, s.tile_y, s.tile_w, s.tile_h, -** Processing line: ~ !!s.flip_horizontally, !!s.flip_vertically,~ + +** Processing line: ~ # aim probe~ - Inside source: true *** True Line Result - !!s.flip_horizontally, !!s.flip_vertically, -** Processing line: ~ s.angle_anchor_x, s.angle_anchor_y,~ + # aim probe +** Processing line: ~ if inputs.keyboard.right || inputs.keyboard.a~ - 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~ + if inputs.keyboard.right || inputs.keyboard.a +** Processing line: ~ circle.angle -= 2~ - Inside source: true *** True Line Result - s.source_x, s.source_y, s.source_w, s.source_h -** Processing line: ~ end~ + circle.angle -= 2 +** Processing line: ~ elsif inputs.keyboard.left || inputs.keyboard.d~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + elsif inputs.keyboard.left || inputs.keyboard.d +** Processing line: ~ circle.angle += 2~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise_conversion_for_rendering_failed s, e, :screenshot~ + circle.angle += 2 +** Processing line: ~ end~ - Inside source: true *** True Line Result - raise_conversion_for_rendering_failed s, e, :screenshot -** Processing line: ~ end~ + end +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def draw_label l~ +** Processing line: ~ def input~ - Inside source: true *** True Line Result - def draw_label l -** Processing line: ~ return unless l~ + def input +** Processing line: ~ input_god_mode~ - Inside source: true *** True Line Result - return unless l -** Processing line: ~ if l.respond_to? :draw_override~ + input_god_mode +** Processing line: ~ input_game~ - Inside source: true *** True Line Result - if l.respond_to? :draw_override -** Processing line: ~ l.draw_override @ffi_draw~ + input_game +** Processing line: ~ end~ - Inside source: true *** True Line Result - l.draw_override @ffi_draw -** Processing line: ~ else~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - else -** Processing line: ~ @ffi_draw.draw_label l.x, l.y, l.text.s_or_default,~ + +** Processing line: ~ def calc_camera~ - 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,~ + def calc_camera +** Processing line: ~ state.camera.target_x = 640 - circle.x~ - Inside source: true *** True Line Result - l.size_enum, l.alignment_enum, -** Processing line: ~ l.r, l.g, l.b, l.a,~ + state.camera.target_x = 640 - circle.x +** Processing line: ~ state.camera.target_y = 360 - circle.y~ - Inside source: true *** True Line Result - l.r, l.g, l.b, l.a, -** Processing line: ~ l.font.s_or_default(nil)~ + state.camera.target_y = 360 - circle.y +** Processing line: ~ xdiff = state.camera.target_x - state.camera.x~ - Inside source: true *** True Line Result - l.font.s_or_default(nil) -** Processing line: ~ end~ + xdiff = state.camera.target_x - state.camera.x +** Processing line: ~ ydiff = state.camera.target_y - state.camera.y~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + ydiff = state.camera.target_y - state.camera.y +** Processing line: ~ state.camera.x += xdiff * camera.follow_speed~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise_conversion_for_rendering_failed l, e, :label~ + state.camera.x += xdiff * camera.follow_speed +** Processing line: ~ state.camera.y += ydiff * camera.follow_speed~ - Inside source: true *** True Line Result - raise_conversion_for_rendering_failed l, e, :label -** Processing line: ~ end~ + state.camera.y += ydiff * camera.follow_speed +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def draw_line l~ +** Processing line: ~ def calc~ - Inside source: true *** True Line Result - def draw_line l -** Processing line: ~ return unless l~ + def calc +** Processing line: ~ state.sound_debounce ||= 0~ - Inside source: true *** True Line Result - return unless l -** Processing line: ~ if l.respond_to? :draw_override~ + state.sound_debounce ||= 0 +** Processing line: ~ state.sound_debounce -= 1~ - Inside source: true *** True Line Result - if l.respond_to? :draw_override -** Processing line: ~ l.draw_override @ffi_draw~ + state.sound_debounce -= 1 +** Processing line: ~ state.sound_debounce = 0 if state.sound_debounce < 0~ - Inside source: true *** True Line Result - l.draw_override @ffi_draw -** Processing line: ~ else~ + state.sound_debounce = 0 if state.sound_debounce < 0 +** Processing line: ~ if state.god_mode~ - 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~ + if state.god_mode +** Processing line: ~ circle.dy *= 0.1~ - 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 -** Processing line: ~ end~ + circle.dy *= 0.1 +** Processing line: ~ circle.dx *= 0.1~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + circle.dx *= 0.1 +** Processing line: ~ end~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise_conversion_for_rendering_failed l, e, :line~ + end +** Processing line: ~ calc_camera~ - Inside source: true *** True Line Result - raise_conversion_for_rendering_failed l, e, :line -** Processing line: ~ end~ + calc_camera +** Processing line: ~ state.whisp_queue ||= []~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + state.whisp_queue ||= [] +** Processing line: ~ if state.tick_count.mod_zero?(4)~ - Inside source: true *** True Line Result - -** Processing line: ~ def draw_border s~ + if state.tick_count.mod_zero?(4) +** Processing line: ~ state.whisp_queue << {~ - Inside source: true *** True Line Result - def draw_border s -** Processing line: ~ return unless s~ + state.whisp_queue << { +** Processing line: ~ x: -300,~ - Inside source: true *** True Line Result - return unless s -** Processing line: ~ if s.respond_to? :draw_override~ + x: -300, +** Processing line: ~ y: 1400 * rand,~ - Inside source: true *** True Line Result - if s.respond_to? :draw_override -** Processing line: ~ s.draw_override @ffi_draw~ + y: 1400 * rand, +** Processing line: ~ speed: 2.randomize(:ratio) + 3,~ - Inside source: true *** True Line Result - s.draw_override @ffi_draw -** Processing line: ~ else~ + speed: 2.randomize(:ratio) + 3, +** Processing line: ~ w: 20,~ - 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~ + w: 20, +** Processing line: ~ h: 20, path: 'sprites/whisp.png',~ - 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 -** Processing line: ~ end~ + h: 20, path: 'sprites/whisp.png', +** Processing line: ~ a: 0,~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + a: 0, +** Processing line: ~ created_at: state.tick_count,~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ raise_conversion_for_rendering_failed s, e, :border~ + created_at: state.tick_count, +** Processing line: ~ angle: 0,~ - Inside source: true *** True Line Result - raise_conversion_for_rendering_failed s, e, :border -** Processing line: ~ end~ + angle: 0, +** Processing line: ~ r: 100,~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + r: 100, +** Processing line: ~ g: 128 + 128 * rand,~ - Inside source: true *** True Line Result - -** Processing line: ~ def draw_screenshots~ + g: 128 + 128 * rand, +** Processing line: ~ b: 128 + 128 * rand~ - Inside source: true *** True Line Result - def draw_screenshots -** Processing line: ~ @args.outputs.screenshots.each { |s| draw_screenshot s }~ + b: 128 + 128 * rand +** Processing line: ~ }~ - Inside source: true *** True Line Result - @args.outputs.screenshots.each { |s| draw_screenshot s } -** Processing line: ~ end~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - end + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ def pixel_arrays~ -- Inside source: true -*** True Line Result - def pixel_arrays -** Processing line: ~ @args.pixel_arrays.each { |k,v|~ -- Inside source: true -*** True Line Result - @args.pixel_arrays.each { |k,v| -** Processing line: ~ if v.pixels.length == (v.width * v.height) # !!! FIXME: warning? exception? Different API?~ -- Inside source: true -*** True Line Result - if v.pixels.length == (v.width * v.height) # !!! FIXME: warning? exception? Different API? -** Processing line: ~ @ffi_draw.upload_pixel_array k.to_s, v.width.to_i, v.height.to_i, v.pixels~ -- Inside source: true -*** True Line Result - @ffi_draw.upload_pixel_array k.to_s, v.width.to_i, v.height.to_i, v.pixels -** Processing line: ~ end~ +** Processing line: ~ state.whisp_queue.each do |w|~ - Inside source: true *** True Line Result - end -** Processing line: ~ }~ + state.whisp_queue.each do |w| +** Processing line: ~ w.x += w[:speed] * 2~ - Inside source: true *** True Line Result - } -** Processing line: ~ rescue Exception => e~ + w.x += w[:speed] * 2 +** Processing line: ~ w.x -= circle.dx * 0.3~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ pause!~ + w.x -= circle.dx * 0.3 +** Processing line: ~ w.y -= w[:speed]~ - Inside source: true *** True Line Result - pause! -** Processing line: ~ pretty_print_exception_and_export! e~ + w.y -= w[:speed] +** Processing line: ~ w.y -= circle.dy * 0.3~ - Inside source: true *** True Line Result - pretty_print_exception_and_export! e -** Processing line: ~ end~ + w.y -= circle.dy * 0.3 +** Processing line: ~ w.angle += w[:speed]~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + w.angle += w[:speed] +** Processing line: ~ w.a = w[:created_at].ease(30) * 255~ - Inside source: true *** True Line Result - + w.a = w[:created_at].ease(30) * 255 ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end -** Processing line: ~ end~ -- Inside source: true -*** True Line Result - end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. +** Processing line: ~ state.whisp_queue = state.whisp_queue.reject { |w| w[:x] > 1280 }~ +- Inside source: true *** True Line Result -#+end_src + state.whisp_queue = state.whisp_queue.reject { |w| w[:x] > 1280 } ** Processing line: ~~ -- End of paragraph detected. -*** True Line Result - -** Processing line: ~* runtime/framerate_diagnostics.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* runtime/framerate_diagnostics.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. +- Inside source: true *** True Line Result +** Processing line: ~ if state.tick_count.mod_zero?(2) && (circle.dx != 0 || circle.dy != 0)~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/runtime/framerate_diagnostics.rb~ + if state.tick_count.mod_zero?(2) && (circle.dx != 0 || circle.dy != 0) +** Processing line: ~ circle.after_images << {~ - Inside source: true *** True Line Result - # ./dragon/runtime/framerate_diagnostics.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + circle.after_images << { +** Processing line: ~ x: circle.x,~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + x: circle.x, +** Processing line: ~ y: circle.y,~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # framerate_diagnostics.rb has been released under MIT (*only this file*).~ + y: circle.y, +** Processing line: ~ w: circle.radius,~ - Inside source: true *** True Line Result - # framerate_diagnostics.rb has been released under MIT (*only this file*). -** Processing line: ~~ + w: circle.radius, +** Processing line: ~ h: circle.radius,~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + h: circle.radius, +** Processing line: ~ a: 255,~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Runtime~ + a: 255, +** Processing line: ~ created_at: state.tick_count~ - Inside source: true *** True Line Result - class Runtime -** Processing line: ~ # @visibility private~ + created_at: state.tick_count +** Processing line: ~ }~ - Inside source: true *** True Line Result - # @visibility private -** Processing line: ~ module FramerateDiagnostics~ + } +** Processing line: ~ end~ - Inside source: true *** True Line Result - module FramerateDiagnostics -** Processing line: ~ def framerate_get_diagnostics~ + end +** Processing line: ~~ - Inside source: true *** True Line Result - def framerate_get_diagnostics -** Processing line: ~ <<-S~ + +** Processing line: ~ circle.after_images.each do |ai|~ - Inside source: true *** True Line Result - <<-S -** Processing line: ~ * INFO: Framerate Diagnostics~ + circle.after_images.each do |ai| +** Processing line: ~ ai.a = ai[:created_at].ease(10, :flip) * 255~ - Inside source: true *** True Line Result - * INFO: Framerate Diagnostics -** Processing line: ~ You can display these diagnostics using:~ + ai.a = ai[:created_at].ease(10, :flip) * 255 +** Processing line: ~ end~ - Inside source: true *** True Line Result - You can display these diagnostics using: + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ #+begin_src~ +** Processing line: ~ circle.after_images = circle.after_images.reject { |ai| ai[:created_at].elapsed_time > 10 }~ - Inside source: true *** True Line Result - #+begin_src -** Processing line: ~ def tick args~ + circle.after_images = circle.after_images.reject { |ai| ai[:created_at].elapsed_time > 10 } +** Processing line: ~ calc_physics~ - Inside source: true *** True Line Result - def tick args -** Processing line: ~ # ....~ + calc_physics +** Processing line: ~ end~ - Inside source: true *** True Line Result - # .... + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ # IMPORTANT: Put this at the END of the ~tick~ method.~ +** Processing line: ~ def circle~ - Inside source: true *** True Line Result - # IMPORTANT: Put this at the END of the ~tick~ method. -** Processing line: ~ args.outputs.debug << args.gtk.framerate_diagnostics_primitives~ + def circle +** Processing line: ~ state.circle~ - Inside source: true *** True Line Result - args.outputs.debug << args.gtk.framerate_diagnostics_primitives + state.circle ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ #+end_src~ -- Inside source: true -*** True Line Result - #+end_src ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ ** Draw Calls: ~<<~ Invocation Perf Counter~ -- Inside source: true -*** True Line Result - ** Draw Calls: ~<<~ Invocation Perf Counter -** Processing line: ~ Here is how many times ~args.outputs.PRIMITIVE_ARRAY <<~ was called:~ +** Processing line: ~ def camera~ - Inside source: true *** True Line Result - Here is how many times ~args.outputs.PRIMITIVE_ARRAY <<~ was called: -** Processing line: ~~ + def camera +** Processing line: ~ state.camera~ - Inside source: true *** True Line Result - -** Processing line: ~ #{$perf_counter_outputs_push_count} times invoked.~ + state.camera +** Processing line: ~ end~ - Inside source: true *** True Line Result - #{$perf_counter_outputs_push_count} times invoked. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ If the number above is high, consider batching primitives so you can lower the invocation of ~<<~. For example.~ +** Processing line: ~ def terrain~ - Inside source: true *** True Line Result - If the number above is high, consider batching primitives so you can lower the invocation of ~<<~. For example. -** Processing line: ~~ + def terrain +** Processing line: ~ state.terrain~ - Inside source: true *** True Line Result - -** Processing line: ~ Instead of:~ + state.terrain +** Processing line: ~ end~ - Inside source: true *** True Line Result - Instead of: + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ #+begin_src~ -- Inside source: true -*** True Line Result - #+begin_src -** Processing line: ~ args.state.enemies.map do |e|~ -- Inside source: true -*** True Line Result - args.state.enemies.map do |e| -** Processing line: ~ e.alpha = 128~ +** Processing line: ~ def lava~ - Inside source: true *** True Line Result - e.alpha = 128 -** Processing line: ~ args.outputs.sprites << e # <-- ~args.outputs.sprites <<~ is invoked a lot~ + def lava +** Processing line: ~ state.lava~ - Inside source: true *** True Line Result - args.outputs.sprites << e # <-- ~args.outputs.sprites <<~ is invoked a lot + state.lava ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ #+end_src~ +** Processing line: ~ end~ - Inside source: true *** True Line Result - #+end_src + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Do this:~ +** Processing line: ~ # $gtk.reset~ - Inside source: true *** True Line Result - Do this: + # $gtk.reset ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ #+begin_src~ -- Inside source: true -*** True Line Result - #+begin_src -** Processing line: ~ args.outputs.sprites << args.state~ +** Processing line: ~ def tick args~ - Inside source: true *** True Line Result - args.outputs.sprites << args.state -** Processing line: ~ .enemies~ + def tick args +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ - Inside source: true *** True Line Result - .enemies -** Processing line: ~ .map do |e| # <-- ~args.outputs.sprites <<~ is only invoked once.~ + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ if args.inputs.keyboard.r~ - Inside source: true *** True Line Result - .map do |e| # <-- ~args.outputs.sprites <<~ is only invoked once. -** Processing line: ~ e.alpha = 128~ + if args.inputs.keyboard.r +** Processing line: ~ args.gtk.reset~ - Inside source: true *** True Line Result - e.alpha = 128 -** Processing line: ~ e~ + args.gtk.reset +** Processing line: ~ return~ - Inside source: true *** True Line Result - e + return ** Processing line: ~ end~ - Inside source: true *** True Line Result end -** Processing line: ~ #+end_src~ +** Processing line: ~ # uncomment the line below to slow down the game so you~ - Inside source: true *** True Line Result - #+end_src -** Processing line: ~~ + # uncomment the line below to slow down the game so you +** Processing line: ~ # can see each tick as it passes~ - Inside source: true *** True Line Result - -** Processing line: ~ ** Array Primitives~ + # can see each tick as it passes +** Processing line: ~ # args.gtk.slowmo! 30~ - Inside source: true *** True Line Result - ** Array Primitives -** Processing line: ~ ~Primitives~ represented as an ~Array~ (~Tuple~) are great for prototyping, but are not as performant as using a ~Hash~.~ + # args.gtk.slowmo! 30 +** Processing line: ~ $game ||= FallingCircle.new~ - Inside source: true *** True Line Result - ~Primitives~ represented as an ~Array~ (~Tuple~) are great for prototyping, but are not as performant as using a ~Hash~. -** Processing line: ~~ + $game ||= FallingCircle.new +** Processing line: ~ $game.args = args~ - Inside source: true *** True Line Result - -** Processing line: ~ Here is the number of ~Array~ primitives that were encountered:~ + $game.args = args +** Processing line: ~ $game.tick~ - Inside source: true *** True Line Result - Here is the number of ~Array~ primitives that were encountered: + $game.tick +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ #{$perf_counter_primitive_is_array} Array Primitives.~ +** Processing line: ~ def reset~ - Inside source: true *** True Line Result - #{$perf_counter_primitive_is_array} Array Primitives. -** Processing line: ~~ + def reset +** Processing line: ~ $game = nil~ - Inside source: true *** True Line Result - -** Processing line: ~ If the number above is high, consider converting them to hashes. For example.~ + $game = nil +** Processing line: ~ end~ - Inside source: true *** True Line Result - If the number above is high, consider converting them to hashes. For example. + end ** Processing line: ~~ - Inside source: true *** True Line Result -** Processing line: ~ Instead of:~ -- Inside source: true +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. *** True Line Result - Instead of: +#+end_src ** Processing line: ~~ -- Inside source: true +- End of paragraph detected. *** True Line Result -** Processing line: ~ #+begin_src~ -- Inside source: true -*** True Line Result - #+begin_src -** Processing line: ~ args.outputs.sprites << [0, 0, 100, 100, 'sprites/enemy.png']~ -- Inside source: true +** Processing line: ~*** Platformer - The Little Probe - Data - level.txt~ +- Header detected. *** True Line Result - args.outputs.sprites << [0, 0, 100, 100, 'sprites/enemy.png'] -** Processing line: ~ #+begin_end~ -- Inside source: true + *** True Line Result - #+begin_end -** Processing line: ~~ -- Inside source: true +*** Platformer - The Little Probe - Data - level.txt +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. *** True Line Result -** Processing line: ~ Do this:~ -- Inside source: true *** True Line Result - Do this: -** Processing line: ~~ +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_platformer/the_little_probe/data/level.txt~ - Inside source: true *** True Line Result - -** Processing line: ~ #+begin_src~ + # ./samples/99_genre_platformer/the_little_probe/data/level.txt +** Processing line: ~ 640,8840,1180,8840~ - Inside source: true *** True Line Result - #+begin_src -** Processing line: ~ args.outputs.sprites << { x: 0,~ + 640,8840,1180,8840 +** Processing line: ~ -60,10220,0,9960~ - Inside source: true *** True Line Result - args.outputs.sprites << { x: 0, -** Processing line: ~ y: 0,~ + -60,10220,0,9960 +** Processing line: ~ -60,10220,0,10500~ - Inside source: true *** True Line Result - y: 0, -** Processing line: ~ w: 100,~ + -60,10220,0,10500 +** Processing line: ~ 0,10500,0,10780~ - Inside source: true *** True Line Result - w: 100, -** Processing line: ~ h: 100,~ + 0,10500,0,10780 +** Processing line: ~ 0,10780,40,10900~ - Inside source: true *** True Line Result - h: 100, -** Processing line: ~ path: 'sprites/enemy.png' }~ + 0,10780,40,10900 +** Processing line: ~ 500,10920,760,10960~ - Inside source: true *** True Line Result - path: 'sprites/enemy.png' } -** Processing line: ~ #+begin_end~ + 500,10920,760,10960 +** Processing line: ~ 300,10560,820,10600~ - Inside source: true *** True Line Result - #+begin_end -** Processing line: ~~ + 300,10560,820,10600 +** Processing line: ~ 420,10320,700,10300~ - Inside source: true *** True Line Result - -** Processing line: ~ ** Primitive Counts~ + 420,10320,700,10300 +** Processing line: ~ 820,10600,1500,10600~ - Inside source: true *** True Line Result - ** Primitive Counts -** Processing line: ~ Here are the draw counts ordered by lowest to highest z order:~ + 820,10600,1500,10600 +** Processing line: ~ 1500,10600,1940,10600~ - Inside source: true *** True Line Result - Here are the draw counts ordered by lowest to highest z order: -** Processing line: ~~ + 1500,10600,1940,10600 +** Processing line: ~ 1940,10600,2380,10580~ - Inside source: true *** True Line Result - -** Processing line: ~ PRIMITIVE COUNT, STATIC COUNT~ + 1940,10600,2380,10580 +** Processing line: ~ 2380,10580,2800,10620~ - Inside source: true *** True Line Result - PRIMITIVE COUNT, STATIC COUNT -** Processing line: ~ solids: #{@args.outputs.solids.length}, #{@args.outputs.static_solids.length}~ + 2380,10580,2800,10620 +** Processing line: ~ 2240,11080,2480,11020~ - Inside source: true *** True Line Result - solids: #{@args.outputs.solids.length}, #{@args.outputs.static_solids.length} -** Processing line: ~ sprites: #{@args.outputs.sprites.length}, #{@args.outputs.static_sprites.length}~ + 2240,11080,2480,11020 +** Processing line: ~ 2000,11120,2240,11080~ - Inside source: true *** True Line Result - sprites: #{@args.outputs.sprites.length}, #{@args.outputs.static_sprites.length} -** Processing line: ~ primitives: #{@args.outputs.primitives.length}, #{@args.outputs.static_primitives.length}~ + 2000,11120,2240,11080 +** Processing line: ~ 1760,11180,2000,11120~ - Inside source: true *** True Line Result - primitives: #{@args.outputs.primitives.length}, #{@args.outputs.static_primitives.length} -** Processing line: ~ labels: #{@args.outputs.labels.length}, #{@args.outputs.static_labels.length}~ + 1760,11180,2000,11120 +** Processing line: ~ 1620,11180,1760,11180~ - Inside source: true *** True Line Result - labels: #{@args.outputs.labels.length}, #{@args.outputs.static_labels.length} -** Processing line: ~ lines: #{@args.outputs.lines.length}, #{@args.outputs.static_lines.length}~ + 1620,11180,1760,11180 +** Processing line: ~ 1500,11220,1620,11180~ - Inside source: true *** True Line Result - lines: #{@args.outputs.lines.length}, #{@args.outputs.static_lines.length} -** Processing line: ~ borders: #{@args.outputs.borders.length}, #{@args.outputs.static_borders.length}~ + 1500,11220,1620,11180 +** Processing line: ~ 1180,11280,1340,11220~ - Inside source: true *** True Line Result - borders: #{@args.outputs.borders.length}, #{@args.outputs.static_borders.length} -** Processing line: ~ debug: #{@args.outputs.debug.length}, #{@args.outputs.static_debug.length}~ + 1180,11280,1340,11220 +** Processing line: ~ 1040,11240,1180,11280~ - Inside source: true *** True Line Result - debug: #{@args.outputs.debug.length}, #{@args.outputs.static_debug.length} -** Processing line: ~ reserved: #{@args.outputs.reserved.length}, #{@args.outputs.static_reserved.length}~ + 1040,11240,1180,11280 +** Processing line: ~ 840,11280,1040,11240~ - Inside source: true *** True Line Result - reserved: #{@args.outputs.reserved.length}, #{@args.outputs.static_reserved.length} -** Processing line: ~~ + 840,11280,1040,11240 +** Processing line: ~ 640,11280,840,11280~ - Inside source: true *** True Line Result - -** Processing line: ~ ** Additional Help~ + 640,11280,840,11280 +** Processing line: ~ 500,11220,640,11280~ - Inside source: true *** True Line Result - ** Additional Help -** Processing line: ~ Come to the DragonRuby Discord channel if you need help troubleshooting performance issues. http://discord.dragonruby.org.~ + 500,11220,640,11280 +** Processing line: ~ 420,11140,500,11220~ - Inside source: true *** True Line Result - Come to the DragonRuby Discord channel if you need help troubleshooting performance issues. http://discord.dragonruby.org. -** Processing line: ~~ + 420,11140,500,11220 +** Processing line: ~ 240,11100,420,11140~ - Inside source: true *** True Line Result - -** Processing line: ~ Source code for these diagnostics can be found at: [[https://github.com/dragonruby/dragonruby-game-toolkit-contrib/]]~ + 240,11100,420,11140 +** Processing line: ~ 100,11120,240,11100~ - Inside source: true *** True Line Result - Source code for these diagnostics can be found at: [[https://github.com/dragonruby/dragonruby-game-toolkit-contrib/]] -** Processing line: ~ S~ + 100,11120,240,11100 +** Processing line: ~ 0,11180,100,11120~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + 0,11180,100,11120 +** Processing line: ~ -160,11220,0,11180~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + -160,11220,0,11180 +** Processing line: ~ -260,11240,-160,11220~ - Inside source: true *** True Line Result - -** Processing line: ~ def framerate_warning_message~ + -260,11240,-160,11220 +** Processing line: ~ 1340,11220,1500,11220~ - Inside source: true *** True Line Result - def framerate_warning_message -** Processing line: ~ <<-S~ + 1340,11220,1500,11220 +** Processing line: ~ 960,13300,1280,13060~ - Inside source: true *** True Line Result - <<-S -** Processing line: ~ * WARNING:~ + 960,13300,1280,13060 +** Processing line: ~ 1280,13060,1540,12860~ - Inside source: true *** True Line Result - * WARNING: -** Processing line: ~ Your average framerate dropped below 60 fps for two seconds.~ + 1280,13060,1540,12860 +** Processing line: ~ 1540,12860,1820,12700~ - Inside source: true *** True Line Result - Your average framerate dropped below 60 fps for two seconds. -** Processing line: ~~ + 1540,12860,1820,12700 +** Processing line: ~ 1820,12700,2080,12520~ - Inside source: true *** True Line Result - -** Processing line: ~ The average FPS was #{current_framerate}.~ + 1820,12700,2080,12520 +** Processing line: ~ 2080,12520,2240,12400~ - Inside source: true *** True Line Result - The average FPS was #{current_framerate}. -** Processing line: ~~ + 2080,12520,2240,12400 +** Processing line: ~ 2240,12400,2240,12240~ - Inside source: true *** True Line Result - -** Processing line: ~ ** How To Disable Warning~ + 2240,12400,2240,12240 +** Processing line: ~ 2240,12240,2400,12080~ - Inside source: true *** True Line Result - ** How To Disable Warning -** Processing line: ~ If this warning is getting annoying put the following in your tick method:~ + 2240,12240,2400,12080 +** Processing line: ~ 2400,12080,2560,11920~ - Inside source: true *** True Line Result - If this warning is getting annoying put the following in your tick method: -** Processing line: ~~ + 2400,12080,2560,11920 +** Processing line: ~ 2560,11920,2640,11740~ - Inside source: true *** True Line Result - -** Processing line: ~ #+begin_src~ + 2560,11920,2640,11740 +** Processing line: ~ 2640,11740,2740,11580~ - Inside source: true *** True Line Result - #+begin_src -** Processing line: ~ args.gtk.log_level = :off~ + 2640,11740,2740,11580 +** Processing line: ~ 2740,11580,2800,11400~ - Inside source: true *** True Line Result - args.gtk.log_level = :off -** Processing line: ~ #+end_src~ + 2740,11580,2800,11400 +** Processing line: ~ 2800,11400,2800,11240~ - Inside source: true *** True Line Result - #+end_src -** Processing line: ~~ + 2800,11400,2800,11240 +** Processing line: ~ 2740,11140,2800,11240~ - Inside source: true *** True Line Result - -** Processing line: ~ #{framerate_get_diagnostics}~ + 2740,11140,2800,11240 +** Processing line: ~ 2700,11040,2740,11140~ - Inside source: true *** True Line Result - #{framerate_get_diagnostics} -** Processing line: ~ S~ + 2700,11040,2740,11140 +** Processing line: ~ 2700,11040,2740,10960~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + 2700,11040,2740,10960 +** Processing line: ~ 2740,10960,2740,10920~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2740,10960,2740,10920 +** Processing line: ~ 2700,10900,2740,10920~ - Inside source: true *** True Line Result - -** Processing line: ~ def current_framerate_primitives~ + 2700,10900,2740,10920 +** Processing line: ~ 2380,10900,2700,10900~ - Inside source: true *** True Line Result - def current_framerate_primitives -** Processing line: ~ framerate_diagnostics_primitives~ + 2380,10900,2700,10900 +** Processing line: ~ 2040,10920,2380,10900~ - Inside source: true *** True Line Result - framerate_diagnostics_primitives -** Processing line: ~ end~ + 2040,10920,2380,10900 +** Processing line: ~ 1720,10940,2040,10920~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 1720,10940,2040,10920 +** Processing line: ~ 1380,11000,1720,10940~ - Inside source: true *** True Line Result - -** Processing line: ~ def framerate_diagnostics_primitives~ + 1380,11000,1720,10940 +** Processing line: ~ 1180,10980,1380,11000~ - Inside source: true *** True Line Result - def framerate_diagnostics_primitives -** Processing line: ~ [~ + 1180,10980,1380,11000 +** Processing line: ~ 900,10980,1180,10980~ - Inside source: true *** True Line Result - [ -** Processing line: ~ { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid,~ + 900,10980,1180,10980 +** Processing line: ~ 760,10960,900,10980~ - Inside source: true *** True Line Result - { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid, -** Processing line: ~ {~ + 760,10960,900,10980 +** Processing line: ~ 240,10960,500,10920~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: 5,~ + 240,10960,500,10920 +** Processing line: ~ 40,10900,240,10960~ - Inside source: true *** True Line Result - x: 5, -** Processing line: ~ y: 5.from_top,~ + 40,10900,240,10960 +** Processing line: ~ 0,9700,0,9960~ - Inside source: true *** True Line Result - y: 5.from_top, -** Processing line: ~ text: "More Info via DragonRuby Console: $gtk.framerate_diagnostics",~ + 0,9700,0,9960 +** Processing line: ~ -60,9500,0,9700~ - Inside source: true *** True Line Result - text: "More Info via DragonRuby Console: $gtk.framerate_diagnostics", -** Processing line: ~ r: 255,~ + -60,9500,0,9700 +** Processing line: ~ -60,9420,-60,9500~ - Inside source: true *** True Line Result - r: 255, -** Processing line: ~ g: 255,~ + -60,9420,-60,9500 +** Processing line: ~ -60,9420,-60,9340~ - Inside source: true *** True Line Result - g: 255, -** Processing line: ~ b: 255,~ + -60,9420,-60,9340 +** Processing line: ~ -60,9340,-60,9280~ - Inside source: true *** True Line Result - b: 255, -** Processing line: ~ size_enum: -2~ + -60,9340,-60,9280 +** Processing line: ~ -60,9120,-60,9280~ - Inside source: true *** True Line Result - size_enum: -2 -** Processing line: ~ }.label,~ + -60,9120,-60,9280 +** Processing line: ~ -60,8940,-60,9120~ - Inside source: true *** True Line Result - }.label, -** Processing line: ~ {~ + -60,8940,-60,9120 +** Processing line: ~ -60,8940,-60,8780~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: 5,~ + -60,8940,-60,8780 +** Processing line: ~ -60,8780,0,8700~ - Inside source: true *** True Line Result - x: 5, -** Processing line: ~ y: 20.from_top,~ + -60,8780,0,8700 +** Processing line: ~ 0,8700,40,8680~ - Inside source: true *** True Line Result - y: 20.from_top, -** Processing line: ~ text: "FPS: %.2f" % args.gtk.current_framerate,~ + 0,8700,40,8680 +** Processing line: ~ 40,8680,240,8700~ - Inside source: true *** True Line Result - text: "FPS: %.2f" % args.gtk.current_framerate, -** Processing line: ~ r: 255,~ + 40,8680,240,8700 +** Processing line: ~ 240,8700,360,8780~ - Inside source: true *** True Line Result - r: 255, -** Processing line: ~ g: 255,~ + 240,8700,360,8780 +** Processing line: ~ 360,8780,640,8840~ - Inside source: true *** True Line Result - g: 255, -** Processing line: ~ b: 255,~ + 360,8780,640,8840 +** Processing line: ~ 1420,8400,1540,8480~ - Inside source: true *** True Line Result - b: 255, -** Processing line: ~ size_enum: -2~ + 1420,8400,1540,8480 +** Processing line: ~ 1540,8480,1680,8500~ - Inside source: true *** True Line Result - size_enum: -2 -** Processing line: ~ }.label,~ + 1540,8480,1680,8500 +** Processing line: ~ 1680,8500,1940,8460~ - Inside source: true *** True Line Result - }.label, -** Processing line: ~ {~ + 1680,8500,1940,8460 +** Processing line: ~ 1180,8840,1280,8880~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: 5,~ + 1180,8840,1280,8880 +** Processing line: ~ 1280,8880,1340,8860~ - Inside source: true *** True Line Result - x: 5, -** Processing line: ~ y: 35.from_top,~ + 1280,8880,1340,8860 +** Processing line: ~ 1340,8860,1720,8860~ - Inside source: true *** True Line Result - y: 35.from_top, -** Processing line: ~ text: "Draw Calls: #{$perf_counter_outputs_push_count}",~ + 1340,8860,1720,8860 +** Processing line: ~ 1720,8860,1820,8920~ - Inside source: true *** True Line Result - text: "Draw Calls: #{$perf_counter_outputs_push_count}", -** Processing line: ~ r: 255,~ + 1720,8860,1820,8920 +** Processing line: ~ 1820,8920,1820,9140~ - Inside source: true *** True Line Result - r: 255, -** Processing line: ~ g: 255,~ + 1820,8920,1820,9140 +** Processing line: ~ 1820,9140,1820,9280~ - Inside source: true *** True Line Result - g: 255, -** Processing line: ~ b: 255,~ + 1820,9140,1820,9280 +** Processing line: ~ 1820,9460,1820,9280~ - Inside source: true *** True Line Result - b: 255, -** Processing line: ~ size_enum: -2~ + 1820,9460,1820,9280 +** Processing line: ~ 1760,9480,1820,9460~ - Inside source: true *** True Line Result - size_enum: -2 -** Processing line: ~ }.label,~ + 1760,9480,1820,9460 +** Processing line: ~ 1640,9480,1760,9480~ - Inside source: true *** True Line Result - }.label, -** Processing line: ~ {~ + 1640,9480,1760,9480 +** Processing line: ~ 1540,9500,1640,9480~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: 5,~ + 1540,9500,1640,9480 +** Processing line: ~ 1340,9500,1540,9500~ - Inside source: true *** True Line Result - x: 5, -** Processing line: ~ y: 50.from_top,~ + 1340,9500,1540,9500 +** Processing line: ~ 1100,9500,1340,9500~ - Inside source: true *** True Line Result - y: 50.from_top, -** Processing line: ~ text: "Array Primitives: #{$perf_counter_primitive_is_array}",~ + 1100,9500,1340,9500 +** Processing line: ~ 1040,9540,1100,9500~ - Inside source: true *** True Line Result - text: "Array Primitives: #{$perf_counter_primitive_is_array}", -** Processing line: ~ r: 255,~ + 1040,9540,1100,9500 +** Processing line: ~ 960,9540,1040,9540~ - Inside source: true *** True Line Result - r: 255, -** Processing line: ~ g: 255,~ + 960,9540,1040,9540 +** Processing line: ~ 300,9420,360,9460~ - Inside source: true *** True Line Result - g: 255, -** Processing line: ~ b: 255,~ + 300,9420,360,9460 +** Processing line: ~ 240,9440,300,9420~ - Inside source: true *** True Line Result - b: 255, -** Processing line: ~ size_enum: -2~ + 240,9440,300,9420 +** Processing line: ~ 180,9600,240,9440~ - Inside source: true *** True Line Result - size_enum: -2 -** Processing line: ~ }.label,~ + 180,9600,240,9440 +** Processing line: ~ 120,9660,180,9600~ - Inside source: true *** True Line Result - }.label, -** Processing line: ~ {~ + 120,9660,180,9600 +** Processing line: ~ 100,9820,120,9660~ - Inside source: true *** True Line Result - { -** Processing line: ~ x: 5,~ + 100,9820,120,9660 +** Processing line: ~ 100,9820,120,9860~ - Inside source: true *** True Line Result - x: 5, -** Processing line: ~ y: 65.from_top,~ + 100,9820,120,9860 +** Processing line: ~ 120,9860,140,9900~ - Inside source: true *** True Line Result - y: 65.from_top, -** Processing line: ~ text: "Mouse: #{@args.inputs.mouse.point}",~ + 120,9860,140,9900 +** Processing line: ~ 140,9900,140,10000~ - Inside source: true *** True Line Result - text: "Mouse: #{@args.inputs.mouse.point}", -** Processing line: ~ r: 255,~ + 140,9900,140,10000 +** Processing line: ~ 140,10440,180,10540~ - Inside source: true *** True Line Result - r: 255, -** Processing line: ~ g: 255,~ + 140,10440,180,10540 +** Processing line: ~ 100,10080,140,10000~ - Inside source: true *** True Line Result - g: 255, -** Processing line: ~ b: 255,~ + 100,10080,140,10000 +** Processing line: ~ 100,10080,140,10100~ - Inside source: true *** True Line Result - b: 255, -** Processing line: ~ size_enum: -2~ + 100,10080,140,10100 +** Processing line: ~ 140,10100,140,10440~ - Inside source: true *** True Line Result - size_enum: -2 -** Processing line: ~ }.label,~ + 140,10100,140,10440 +** Processing line: ~ 180,10540,300,10560~ - Inside source: true *** True Line Result - }.label, -** Processing line: ~ ]~ + 180,10540,300,10560 +** Processing line: ~ 2140,9560,2140,9640~ - Inside source: true *** True Line Result - ] -** Processing line: ~ end~ + 2140,9560,2140,9640 +** Processing line: ~ 2140,9720,2140,9640~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2140,9720,2140,9640 +** Processing line: ~ 1880,9780,2140,9720~ - Inside source: true *** True Line Result - -** Processing line: ~ end~ + 1880,9780,2140,9720 +** Processing line: ~ 1720,9780,1880,9780~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 1720,9780,1880,9780 +** Processing line: ~ 1620,9740,1720,9780~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 1620,9740,1720,9780 +** Processing line: ~ 1500,9780,1620,9740~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 1500,9780,1620,9740 +** Processing line: ~ 1380,9780,1500,9780~ - 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: ~* string.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* string.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/string.rb~ + 1380,9780,1500,9780 +** Processing line: ~ 1340,9820,1380,9780~ - Inside source: true *** True Line Result - # ./dragon/string.rb -** Processing line: ~ # coding: utf-8~ + 1340,9820,1380,9780 +** Processing line: ~ 1200,9820,1340,9820~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + 1200,9820,1340,9820 +** Processing line: ~ 1100,9780,1200,9820~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + 1100,9780,1200,9820 +** Processing line: ~ 900,9780,1100,9780~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # string.rb has been released under MIT (*only this file*).~ + 900,9780,1100,9780 +** Processing line: ~ 820,9720,900,9780~ - Inside source: true *** True Line Result - # string.rb has been released under MIT (*only this file*). -** Processing line: ~~ + 820,9720,900,9780 +** Processing line: ~ 540,9720,820,9720~ - Inside source: true *** True Line Result - -** Processing line: ~ class String~ + 540,9720,820,9720 +** Processing line: ~ 360,9840,540,9720~ - Inside source: true *** True Line Result - class String -** Processing line: ~ include ValueType~ + 360,9840,540,9720 +** Processing line: ~ 360,9840,360,9960~ - Inside source: true *** True Line Result - include ValueType -** Processing line: ~~ + 360,9840,360,9960 +** Processing line: ~ 360,9960,360,10080~ - Inside source: true *** True Line Result - -** Processing line: ~ def wrapped_lines_recur word, rest, length, aggregate~ + 360,9960,360,10080 +** Processing line: ~ 360,10140,360,10080~ - Inside source: true *** True Line Result - def wrapped_lines_recur word, rest, length, aggregate -** Processing line: ~ if word.nil?~ + 360,10140,360,10080 +** Processing line: ~ 360,10140,360,10240~ - Inside source: true *** True Line Result - if word.nil? -** Processing line: ~ return aggregate~ + 360,10140,360,10240 +** Processing line: ~ 360,10240,420,10320~ - Inside source: true *** True Line Result - return aggregate -** Processing line: ~ elsif rest[0].nil?~ + 360,10240,420,10320 +** Processing line: ~ 700,10300,820,10280~ - Inside source: true *** True Line Result - elsif rest[0].nil? -** Processing line: ~ aggregate << word + "\n"~ + 700,10300,820,10280 +** Processing line: ~ 820,10280,820,10280~ - Inside source: true *** True Line Result - aggregate << word + "\n" -** Processing line: ~ return aggregate~ + 820,10280,820,10280 +** Processing line: ~ 820,10280,900,10320~ - Inside source: true *** True Line Result - return aggregate -** Processing line: ~ elsif (word + " " + rest[0]).length > length~ + 820,10280,900,10320 +** Processing line: ~ 900,10320,1040,10300~ - Inside source: true *** True Line Result - elsif (word + " " + rest[0]).length > length -** Processing line: ~ aggregate << word + "\n"~ + 900,10320,1040,10300 +** Processing line: ~ 1040,10300,1200,10320~ - Inside source: true *** True Line Result - aggregate << word + "\n" -** Processing line: ~ return wrapped_lines_recur rest[0], rest[1..-1], length, aggregate~ + 1040,10300,1200,10320 +** Processing line: ~ 1200,10320,1380,10280~ - Inside source: true *** True Line Result - return wrapped_lines_recur rest[0], rest[1..-1], length, aggregate -** Processing line: ~ elsif (word + " " + rest[0]).length <= length~ + 1200,10320,1380,10280 +** Processing line: ~ 1380,10280,1500,10300~ - Inside source: true *** True Line Result - elsif (word + " " + rest[0]).length <= length -** Processing line: ~ next_word = (word + " " + rest[0])~ + 1380,10280,1500,10300 +** Processing line: ~ 1500,10300,1760,10300~ - Inside source: true *** True Line Result - next_word = (word + " " + rest[0]) -** Processing line: ~ return wrapped_lines_recur next_word, rest[1..-1], length, aggregate~ + 1500,10300,1760,10300 +** Processing line: ~ 2800,10620,2840,10600~ - Inside source: true *** True Line Result - return wrapped_lines_recur next_word, rest[1..-1], length, aggregate -** Processing line: ~ else~ + 2800,10620,2840,10600 +** Processing line: ~ 2840,10600,2900,10600~ - Inside source: true *** True Line Result - else -** Processing line: ~ log <<-S~ + 2840,10600,2900,10600 +** Processing line: ~ 2900,10600,3000,10620~ - Inside source: true *** True Line Result - log <<-S -** Processing line: ~ WARNING:~ + 2900,10600,3000,10620 +** Processing line: ~ 3000,10620,3080,10620~ - Inside source: true *** True Line Result - WARNING: -** Processing line: ~ #{word} is too long to fit in length of #{length}.~ + 3000,10620,3080,10620 +** Processing line: ~ 3080,10620,3140,10600~ - Inside source: true *** True Line Result - #{word} is too long to fit in length of #{length}. -** Processing line: ~~ + 3080,10620,3140,10600 +** Processing line: ~ 3140,10540,3140,10600~ - Inside source: true *** True Line Result - -** Processing line: ~ S~ + 3140,10540,3140,10600 +** Processing line: ~ 3140,10540,3140,10460~ - Inside source: true *** True Line Result - S -** Processing line: ~ next_word = (word + " " + rest[0])~ + 3140,10540,3140,10460 +** Processing line: ~ 3140,10460,3140,10360~ - Inside source: true *** True Line Result - next_word = (word + " " + rest[0]) -** Processing line: ~ return wrapped_lines_recur next_word, rest[1..-1], length, aggregate~ + 3140,10460,3140,10360 +** Processing line: ~ 3140,10360,3140,10260~ - Inside source: true *** True Line Result - return wrapped_lines_recur next_word, rest[1..-1], length, aggregate -** Processing line: ~ end~ + 3140,10360,3140,10260 +** Processing line: ~ 3140,10260,3140,10140~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 3140,10260,3140,10140 +** Processing line: ~ 3140,10140,3140,10000~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 3140,10140,3140,10000 +** Processing line: ~ 3140,10000,3140,9860~ - Inside source: true *** True Line Result - -** Processing line: ~ def end_with_bang?~ + 3140,10000,3140,9860 +** Processing line: ~ 3140,9860,3160,9720~ - Inside source: true *** True Line Result - def end_with_bang? -** Processing line: ~ self[-1] == "!"~ + 3140,9860,3160,9720 +** Processing line: ~ 3160,9720,3160,9580~ - Inside source: true *** True Line Result - self[-1] == "!" -** Processing line: ~ end~ + 3160,9720,3160,9580 +** Processing line: ~ 3160,9580,3160,9440~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 3160,9580,3160,9440 +** Processing line: ~ 3160,9300,3160,9440~ - Inside source: true *** True Line Result - -** Processing line: ~ def without_ending_bang~ + 3160,9300,3160,9440 +** Processing line: ~ 3160,9300,3160,9140~ - Inside source: true *** True Line Result - def without_ending_bang -** Processing line: ~ return self unless end_with_bang?~ + 3160,9300,3160,9140 +** Processing line: ~ 3160,9140,3160,8980~ - Inside source: true *** True Line Result - return self unless end_with_bang? -** Processing line: ~ self[0..-2]~ + 3160,9140,3160,8980 +** Processing line: ~ 3160,8980,3160,8820~ - Inside source: true *** True Line Result - self[0..-2] -** Processing line: ~ end~ + 3160,8980,3160,8820 +** Processing line: ~ 3160,8820,3160,8680~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 3160,8820,3160,8680 +** Processing line: ~ 3160,8680,3160,8520~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + 3160,8680,3160,8520 +** Processing line: ~ 1760,10300,1880,10300~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def wrapped_lines length~ + 1760,10300,1880,10300 +** Processing line: ~ 660,9500,960,9540~ - Inside source: true *** True Line Result - def wrapped_lines length -** Processing line: ~ self.each_line.map do |l|~ + 660,9500,960,9540 +** Processing line: ~ 640,9460,660,9500~ - Inside source: true *** True Line Result - self.each_line.map do |l| -** Processing line: ~ l = l.rstrip~ + 640,9460,660,9500 +** Processing line: ~ 360,9460,640,9460~ - Inside source: true *** True Line Result - l = l.rstrip -** Processing line: ~ if l.length < length~ + 360,9460,640,9460 +** Processing line: ~ -480,10760,-440,10880~ - Inside source: true *** True Line Result - if l.length < length -** Processing line: ~ l + "\n"~ + -480,10760,-440,10880 +** Processing line: ~ -480,11020,-440,10880~ - Inside source: true *** True Line Result - l + "\n" -** Processing line: ~ else~ + -480,11020,-440,10880 +** Processing line: ~ -480,11160,-260,11240~ - Inside source: true *** True Line Result - else -** Processing line: ~ words = l.split ' '~ + -480,11160,-260,11240 +** Processing line: ~ -480,11020,-480,11160~ - Inside source: true *** True Line Result - words = l.split ' ' -** Processing line: ~ wrapped_lines_recur(words[0], words[1..-1], length, []).flatten~ + -480,11020,-480,11160 +** Processing line: ~ -600,11420,-380,11320~ - Inside source: true *** True Line Result - wrapped_lines_recur(words[0], words[1..-1], length, []).flatten -** Processing line: ~ end~ + -600,11420,-380,11320 +** Processing line: ~ -380,11320,-200,11340~ - Inside source: true *** True Line Result - end -** Processing line: ~ end.flatten~ + -380,11320,-200,11340 +** Processing line: ~ -200,11340,0,11340~ - Inside source: true *** True Line Result - end.flatten -** Processing line: ~ end~ + -200,11340,0,11340 +** Processing line: ~ 0,11340,180,11340~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 0,11340,180,11340 +** Processing line: ~ 960,13420,960,13300~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + 960,13420,960,13300 +** Processing line: ~ 960,13420,960,13520~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def wrap length~ + 960,13420,960,13520 +** Processing line: ~ 960,13520,1000,13560~ - Inside source: true *** True Line Result - def wrap length -** Processing line: ~ wrapped_lines(length).join.rstrip~ + 960,13520,1000,13560 +** Processing line: ~ 1000,13560,1040,13540~ - Inside source: true *** True Line Result - wrapped_lines(length).join.rstrip -** Processing line: ~ end~ + 1000,13560,1040,13540 +** Processing line: ~ 1040,13540,1200,13440~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 1040,13540,1200,13440 +** Processing line: ~ 1200,13440,1380,13380~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + 1200,13440,1380,13380 +** Processing line: ~ 1380,13380,1620,13300~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def multiline?~ + 1380,13380,1620,13300 +** Processing line: ~ 1620,13300,1820,13220~ - Inside source: true *** True Line Result - def multiline? -** Processing line: ~ include? "\n"~ + 1620,13300,1820,13220 +** Processing line: ~ 1820,13220,2000,13200~ - Inside source: true *** True Line Result - include? "\n" -** Processing line: ~ end~ + 1820,13220,2000,13200 +** Processing line: ~ 2000,13200,2240,13200~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2000,13200,2240,13200 +** Processing line: ~ 2240,13200,2440,13160~ - Inside source: true *** True Line Result - -** Processing line: ~ def indent_lines amount, char = " "~ + 2240,13200,2440,13160 +** Processing line: ~ 2440,13160,2640,13040~ - Inside source: true *** True Line Result - def indent_lines amount, char = " " -** Processing line: ~ self.each_line.each_with_index.map do |l, i|~ + 2440,13160,2640,13040 +** Processing line: ~ -480,10760,-440,10620~ - Inside source: true *** True Line Result - self.each_line.each_with_index.map do |l, i| -** Processing line: ~ if i == 0~ + -480,10760,-440,10620 +** Processing line: ~ -440,10620,-360,10560~ - Inside source: true *** True Line Result - if i == 0 -** Processing line: ~ l~ + -440,10620,-360,10560 +** Processing line: ~ -380,10460,-360,10560~ - Inside source: true *** True Line Result - l -** Processing line: ~ else~ + -380,10460,-360,10560 +** Processing line: ~ -380,10460,-360,10300~ - Inside source: true *** True Line Result - else -** Processing line: ~ char * amount + l~ + -380,10460,-360,10300 +** Processing line: ~ -380,10140,-360,10300~ - Inside source: true *** True Line Result - char * amount + l -** Processing line: ~ end~ + -380,10140,-360,10300 +** Processing line: ~ -380,10140,-380,10040~ - Inside source: true *** True Line Result - end -** Processing line: ~ end.join~ + -380,10140,-380,10040 +** Processing line: ~ -380,9880,-380,10040~ - Inside source: true *** True Line Result - end.join -** Processing line: ~ end~ + -380,9880,-380,10040 +** Processing line: ~ -380,9720,-380,9880~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + -380,9720,-380,9880 +** Processing line: ~ -380,9720,-380,9540~ - Inside source: true *** True Line Result - -** Processing line: ~ def quote~ + -380,9720,-380,9540 +** Processing line: ~ -380,9360,-380,9540~ - Inside source: true *** True Line Result - def quote -** Processing line: ~ "\"#{self}\""~ + -380,9360,-380,9540 +** Processing line: ~ -380,9180,-380,9360~ - Inside source: true *** True Line Result - "\"#{self}\"" -** Processing line: ~ end~ + -380,9180,-380,9360 +** Processing line: ~ -380,9180,-380,9000~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + -380,9180,-380,9000 +** Processing line: ~ -380,8840,-380,9000~ - Inside source: true *** True Line Result - -** Processing line: ~ def trim~ + -380,8840,-380,9000 +** Processing line: ~ -380,8840,-380,8760~ - Inside source: true *** True Line Result - def trim -** Processing line: ~ strip~ + -380,8840,-380,8760 +** Processing line: ~ -380,8760,-380,8620~ - Inside source: true *** True Line Result - strip -** Processing line: ~ end~ + -380,8760,-380,8620 +** Processing line: ~ -380,8620,-380,8520~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + -380,8620,-380,8520 +** Processing line: ~ -380,8520,-360,8400~ - Inside source: true *** True Line Result - -** Processing line: ~ def trim!~ + -380,8520,-360,8400 +** Processing line: ~ -360,8400,-100,8400~ - Inside source: true *** True Line Result - def trim! -** Processing line: ~ strip!~ + -360,8400,-100,8400 +** Processing line: ~ -100,8400,-60,8420~ - Inside source: true *** True Line Result - strip! -** Processing line: ~ end~ + -100,8400,-60,8420 +** Processing line: ~ -60,8420,240,8440~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + -60,8420,240,8440 +** Processing line: ~ 240,8440,240,8380~ - Inside source: true *** True Line Result - -** Processing line: ~ def ltrim~ + 240,8440,240,8380 +** Processing line: ~ 240,8380,500,8440~ - Inside source: true *** True Line Result - def ltrim -** Processing line: ~ lstrip~ + 240,8380,500,8440 +** Processing line: ~ 500,8440,760,8460~ - Inside source: true *** True Line Result - lstrip -** Processing line: ~ end~ + 500,8440,760,8460 +** Processing line: ~ 760,8460,1000,8400~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 760,8460,1000,8400 +** Processing line: ~ 1000,8400,1180,8420~ - Inside source: true *** True Line Result - -** Processing line: ~ def ltrim!~ + 1000,8400,1180,8420 +** Processing line: ~ 1180,8420,1420,8400~ - Inside source: true *** True Line Result - def ltrim! -** Processing line: ~ lstrip!~ + 1180,8420,1420,8400 +** Processing line: ~ 1940,8460,2140,8420~ - Inside source: true *** True Line Result - lstrip! -** Processing line: ~ end~ + 1940,8460,2140,8420 +** Processing line: ~ 2140,8420,2200,8520~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2140,8420,2200,8520 +** Processing line: ~ 2200,8680,2200,8520~ - Inside source: true *** True Line Result - -** Processing line: ~ def rtrim~ + 2200,8680,2200,8520 +** Processing line: ~ 2140,8840,2200,8680~ - Inside source: true *** True Line Result - def rtrim -** Processing line: ~ rstrip~ + 2140,8840,2200,8680 +** Processing line: ~ 2140,8840,2140,9020~ - Inside source: true *** True Line Result - rstrip -** Processing line: ~ end~ + 2140,8840,2140,9020 +** Processing line: ~ 2140,9100,2140,9020~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2140,9100,2140,9020 +** Processing line: ~ 2140,9200,2140,9100~ - Inside source: true *** True Line Result - -** Processing line: ~ def rtrim!~ + 2140,9200,2140,9100 +** Processing line: ~ 2140,9200,2200,9320~ - Inside source: true *** True Line Result - def rtrim! -** Processing line: ~ rstrip!~ + 2140,9200,2200,9320 +** Processing line: ~ 2200,9320,2200,9440~ - Inside source: true *** True Line Result - rstrip! -** Processing line: ~ end~ + 2200,9320,2200,9440 +** Processing line: ~ 2140,9560,2200,9440~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2140,9560,2200,9440 +** Processing line: ~ 1880,10300,2200,10280~ - Inside source: true *** True Line Result - -** Processing line: ~ def serialize~ + 1880,10300,2200,10280 +** Processing line: ~ 2200,10280,2480,10260~ - Inside source: true *** True Line Result - def serialize -** Processing line: ~ self~ + 2200,10280,2480,10260 +** Processing line: ~ 2480,10260,2700,10240~ - Inside source: true *** True Line Result - self -** Processing line: ~ end~ + 2480,10260,2700,10240 +** Processing line: ~ 2700,10240,2840,10180~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 2700,10240,2840,10180 +** Processing line: ~ 2840,10180,2900,10060~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2840,10180,2900,10060 +** Processing line: ~ 2900,9860,2900,10060~ - 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: ~* tests.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* 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: ~ # ./dragon/tests.rb~ + 2900,9860,2900,10060 +** Processing line: ~ 2900,9640,2900,9860~ - Inside source: true *** True Line Result - # ./dragon/tests.rb -** Processing line: ~ # coding: utf-8~ + 2900,9640,2900,9860 +** Processing line: ~ 2900,9640,2900,9500~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + 2900,9640,2900,9500 +** Processing line: ~ 2900,9460,2900,9500~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + 2900,9460,2900,9500 +** Processing line: ~ 2740,9460,2900,9460~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # tests.rb has been released under MIT (*only this file*).~ + 2740,9460,2900,9460 +** Processing line: ~ 2700,9460,2740,9460~ - Inside source: true *** True Line Result - # tests.rb has been released under MIT (*only this file*). -** Processing line: ~~ + 2700,9460,2740,9460 +** Processing line: ~ 2700,9360,2700,9460~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + 2700,9360,2700,9460 +** Processing line: ~ 2700,9320,2700,9360~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Tests~ + 2700,9320,2700,9360 +** Processing line: ~ 2600,9320,2700,9320~ - Inside source: true *** True Line Result - class Tests -** Processing line: ~ attr_accessor :failed, :passed, :inconclusive~ + 2600,9320,2700,9320 +** Processing line: ~ 2600,9260,2600,9320~ - Inside source: true *** True Line Result - attr_accessor :failed, :passed, :inconclusive -** Processing line: ~~ + 2600,9260,2600,9320 +** Processing line: ~ 2600,9200,2600,9260~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize~ + 2600,9200,2600,9260 +** Processing line: ~ 2480,9120,2600,9200~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @failed = []~ + 2480,9120,2600,9200 +** Processing line: ~ 2440,9080,2480,9120~ - Inside source: true *** True Line Result - @failed = [] -** Processing line: ~ @passed = []~ + 2440,9080,2480,9120 +** Processing line: ~ 2380,9080,2440,9080~ - Inside source: true *** True Line Result - @passed = [] -** Processing line: ~ @inconclusive = []~ + 2380,9080,2440,9080 +** Processing line: ~ 2320,9060,2380,9080~ - Inside source: true *** True Line Result - @inconclusive = [] -** Processing line: ~ end~ + 2320,9060,2380,9080 +** Processing line: ~ 2320,8860,2320,9060~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2320,8860,2320,9060 +** Processing line: ~ 2320,8860,2380,8840~ - Inside source: true *** True Line Result - -** Processing line: ~ def run_test m~ + 2320,8860,2380,8840 +** Processing line: ~ 2380,8840,2480,8860~ - Inside source: true *** True Line Result - def run_test m -** Processing line: ~ args = Args.new $gtk, nil~ + 2380,8840,2480,8860 +** Processing line: ~ 2480,8860,2600,8840~ - Inside source: true *** True Line Result - args = Args.new $gtk, nil -** Processing line: ~ assert = Assert.new~ + 2480,8860,2600,8840 +** Processing line: ~ 2600,8840,2740,8840~ - Inside source: true *** True Line Result - assert = Assert.new -** Processing line: ~ begin~ + 2600,8840,2740,8840 +** Processing line: ~ 2740,8840,2840,8800~ - Inside source: true *** True Line Result - begin -** Processing line: ~ log_test_running m~ + 2740,8840,2840,8800 +** Processing line: ~ 2840,8800,2900,8700~ - Inside source: true *** True Line Result - log_test_running m -** Processing line: ~ send(m, args, assert)~ + 2840,8800,2900,8700 +** Processing line: ~ 2900,8600,2900,8700~ - Inside source: true *** True Line Result - send(m, args, assert) -** Processing line: ~ if !assert.assertion_performed~ + 2900,8600,2900,8700 +** Processing line: ~ 2900,8480,2900,8600~ - Inside source: true *** True Line Result - if !assert.assertion_performed -** Processing line: ~ log_inconclusive m~ + 2900,8480,2900,8600 +** Processing line: ~ 2900,8380,2900,8480~ - Inside source: true *** True Line Result - log_inconclusive m -** Processing line: ~ else~ + 2900,8380,2900,8480 +** Processing line: ~ 2900,8380,2900,8260~ - Inside source: true *** True Line Result - else -** Processing line: ~ log_passed m~ + 2900,8380,2900,8260 +** Processing line: ~ 2900,8260,2900,8140~ - Inside source: true *** True Line Result - log_passed m -** Processing line: ~ end~ + 2900,8260,2900,8140 +** Processing line: ~ 2900,8140,2900,8020~ - Inside source: true *** True Line Result - end -** Processing line: ~ rescue Exception => e~ + 2900,8140,2900,8020 +** Processing line: ~ 2900,8020,2900,7900~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ if test_signature_invalid_exception? e, m~ + 2900,8020,2900,7900 +** Processing line: ~ 2900,7820,2900,7900~ - Inside source: true *** True Line Result - if test_signature_invalid_exception? e, m -** Processing line: ~ log_test_signature_incorrect m~ + 2900,7820,2900,7900 +** Processing line: ~ 2900,7820,2900,7740~ - Inside source: true *** True Line Result - log_test_signature_incorrect m -** Processing line: ~ else~ + 2900,7820,2900,7740 +** Processing line: ~ 2900,7660,2900,7740~ - Inside source: true *** True Line Result - else -** Processing line: ~ mark_test_failed m, e~ + 2900,7660,2900,7740 +** Processing line: ~ 2900,7560,2900,7660~ - Inside source: true *** True Line Result - mark_test_failed m, e -** Processing line: ~ end~ + 2900,7560,2900,7660 +** Processing line: ~ 2900,7460,2900,7560~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 2900,7460,2900,7560 +** Processing line: ~ 2900,7460,2900,7360~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 2900,7460,2900,7360 +** Processing line: ~ 2900,7260,2900,7360~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2900,7260,2900,7360 +** Processing line: ~ 2840,7160,2900,7260~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_methods_focused~ + 2840,7160,2900,7260 +** Processing line: ~ 2800,7080,2840,7160~ - Inside source: true *** True Line Result - def test_methods_focused -** Processing line: ~ Object.methods.find_all { |m| m.start_with?( "focus_test_") }~ + 2800,7080,2840,7160 +** Processing line: ~ 2700,7100,2800,7080~ - Inside source: true *** True Line Result - Object.methods.find_all { |m| m.start_with?( "focus_test_") } -** Processing line: ~ end~ + 2700,7100,2800,7080 +** Processing line: ~ 2560,7120,2700,7100~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2560,7120,2700,7100 +** Processing line: ~ 2400,7100,2560,7120~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_methods~ + 2400,7100,2560,7120 +** Processing line: ~ 2320,7100,2400,7100~ - Inside source: true *** True Line Result - def test_methods -** Processing line: ~ Object.methods.find_all { |m| m.start_with? "test_" }~ + 2320,7100,2400,7100 +** Processing line: ~ 2140,7100,2320,7100~ - Inside source: true *** True Line Result - Object.methods.find_all { |m| m.start_with? "test_" } -** Processing line: ~ end~ + 2140,7100,2320,7100 +** Processing line: ~ 2040,7080,2140,7100~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2040,7080,2140,7100 +** Processing line: ~ 1940,7080,2040,7080~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + 1940,7080,2040,7080 +** Processing line: ~ 1820,7140,1940,7080~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def start~ + 1820,7140,1940,7080 +** Processing line: ~ 1680,7140,1820,7140~ - Inside source: true *** True Line Result - def start -** Processing line: ~ log "* TEST: gtk.test.start has been invoked."~ + 1680,7140,1820,7140 +** Processing line: ~ 1540,7140,1680,7140~ - Inside source: true *** True Line Result - log "* TEST: gtk.test.start has been invoked." -** Processing line: ~ if test_methods_focused.length != 0~ + 1540,7140,1680,7140 +** Processing line: ~ 1420,7220,1540,7140~ - Inside source: true *** True Line Result - if test_methods_focused.length != 0 -** Processing line: ~ @is_running = true~ + 1420,7220,1540,7140 +** Processing line: ~ 1280,7220,1380,7220~ - Inside source: true *** True Line Result - @is_running = true -** Processing line: ~ test_methods_focused.each { |m| run_test m }~ + 1280,7220,1380,7220 +** Processing line: ~ 1140,7200,1280,7220~ - Inside source: true *** True Line Result - test_methods_focused.each { |m| run_test m } -** Processing line: ~ print_summary~ + 1140,7200,1280,7220 +** Processing line: ~ 1000,7220,1140,7200~ - Inside source: true *** True Line Result - print_summary -** Processing line: ~ @is_running = false~ + 1000,7220,1140,7200 +** Processing line: ~ 760,7280,900,7320~ - Inside source: true *** True Line Result - @is_running = false -** Processing line: ~ elsif test_methods.length == 0~ + 760,7280,900,7320 +** Processing line: ~ 540,7220,760,7280~ - Inside source: true *** True Line Result - elsif test_methods.length == 0 -** Processing line: ~ log_no_tests_found~ + 540,7220,760,7280 +** Processing line: ~ 300,7180,540,7220~ - Inside source: true *** True Line Result - log_no_tests_found -** Processing line: ~ else~ + 300,7180,540,7220 +** Processing line: ~ 180,7120,180,7160~ - Inside source: true *** True Line Result - else -** Processing line: ~ @is_running = true~ + 180,7120,180,7160 +** Processing line: ~ 40,7140,180,7120~ - Inside source: true *** True Line Result - @is_running = true -** Processing line: ~ test_methods.each { |m| run_test m }~ + 40,7140,180,7120 +** Processing line: ~ -60,7160,40,7140~ - Inside source: true *** True Line Result - test_methods.each { |m| run_test m } -** Processing line: ~ print_summary~ + -60,7160,40,7140 +** Processing line: ~ -200,7120,-60,7160~ - Inside source: true *** True Line Result - print_summary -** Processing line: ~ @is_running = false~ + -200,7120,-60,7160 +** Processing line: ~ 180,7160,300,7180~ - Inside source: true *** True Line Result - @is_running = false -** Processing line: ~ end~ + 180,7160,300,7180 +** Processing line: ~ -260,7060,-200,7120~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + -260,7060,-200,7120 +** Processing line: ~ -260,6980,-260,7060~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + -260,6980,-260,7060 +** Processing line: ~ -260,6880,-260,6980~ - Inside source: true *** True Line Result - -** Processing line: ~ def mark_test_failed m, e~ + -260,6880,-260,6980 +** Processing line: ~ -260,6880,-260,6820~ - Inside source: true *** True Line Result - def mark_test_failed m, e -** Processing line: ~ message = "Failed."~ + -260,6880,-260,6820 +** Processing line: ~ -260,6820,-200,6760~ - Inside source: true *** True Line Result - message = "Failed." -** Processing line: ~ self.failed << { m: m, e: e }~ + -260,6820,-200,6760 +** Processing line: ~ -200,6760,-100,6740~ - Inside source: true *** True Line Result - self.failed << { m: m, e: e } -** Processing line: ~ log message~ + -200,6760,-100,6740 +** Processing line: ~ -100,6740,-60,6740~ - Inside source: true *** True Line Result - log message -** Processing line: ~ end~ + -100,6740,-60,6740 +** Processing line: ~ -60,6740,40,6740~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + -60,6740,40,6740 +** Processing line: ~ 40,6740,300,6800~ - Inside source: true *** True Line Result - -** Processing line: ~ def running?~ + 40,6740,300,6800 +** Processing line: ~ 300,6800,420,6760~ - Inside source: true *** True Line Result - def running? -** Processing line: ~ @is_running~ + 300,6800,420,6760 +** Processing line: ~ 420,6760,500,6740~ - Inside source: true *** True Line Result - @is_running -** Processing line: ~ end~ + 420,6760,500,6740 +** Processing line: ~ 500,6740,540,6760~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 500,6740,540,6760 +** Processing line: ~ 540,6760,540,6760~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_inconclusive m~ + 540,6760,540,6760 +** Processing line: ~ 540,6760,640,6780~ - Inside source: true *** True Line Result - def log_inconclusive m -** Processing line: ~ self.inconclusive << {m: m}~ + 540,6760,640,6780 +** Processing line: ~ 640,6660,640,6780~ - Inside source: true *** True Line Result - self.inconclusive << {m: m} -** Processing line: ~ log "Inconclusive."~ + 640,6660,640,6780 +** Processing line: ~ 580,6580,640,6660~ - Inside source: true *** True Line Result - log "Inconclusive." -** Processing line: ~ end~ + 580,6580,640,6660 +** Processing line: ~ 580,6440,580,6580~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 580,6440,580,6580 +** Processing line: ~ 580,6440,640,6320~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_passed m~ + 580,6440,640,6320 +** Processing line: ~ 640,6320,640,6180~ - Inside source: true *** True Line Result - def log_passed m -** Processing line: ~ self.passed << {m: m}~ + 640,6320,640,6180 +** Processing line: ~ 580,6080,640,6180~ - Inside source: true *** True Line Result - self.passed << {m: m} -** Processing line: ~ log "Passed."~ + 580,6080,640,6180 +** Processing line: ~ 580,6080,640,5960~ - Inside source: true *** True Line Result - log "Passed." -** Processing line: ~ end~ + 580,6080,640,5960 +** Processing line: ~ 640,5960,640,5840~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 640,5960,640,5840 +** Processing line: ~ 640,5840,640,5700~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_no_tests_found~ + 640,5840,640,5700 +** Processing line: ~ 640,5700,660,5560~ - Inside source: true *** True Line Result - def log_no_tests_found -** Processing line: ~ log <<-S~ + 640,5700,660,5560 +** Processing line: ~ 660,5560,660,5440~ - Inside source: true *** True Line Result - log <<-S -** Processing line: ~ No tests were found. To create a test. Define a method~ + 660,5560,660,5440 +** Processing line: ~ 660,5440,660,5300~ - Inside source: true *** True Line Result - No tests were found. To create a test. Define a method -** Processing line: ~ that begins with test_. For example:~ + 660,5440,660,5300 +** Processing line: ~ 660,5140,660,5300~ - Inside source: true *** True Line Result - that begins with test_. For example: -** Processing line: ~ #+begin_src~ + 660,5140,660,5300 +** Processing line: ~ 660,5140,660,5000~ - Inside source: true *** True Line Result - #+begin_src -** Processing line: ~ def test_game_over args, assert~ + 660,5140,660,5000 +** Processing line: ~ 660,5000,660,4880~ - Inside source: true *** True Line Result - def test_game_over args, assert -** Processing line: ~~ + 660,5000,660,4880 +** Processing line: ~ 660,4880,820,4860~ - Inside source: true *** True Line Result - -** Processing line: ~ end~ + 660,4880,820,4860 +** Processing line: ~ 820,4860,1000,4840~ - Inside source: true *** True Line Result - end -** Processing line: ~ #+end_src~ + 820,4860,1000,4840 +** Processing line: ~ 1000,4840,1100,4860~ - Inside source: true *** True Line Result - #+end_src -** Processing line: ~ S~ + 1000,4840,1100,4860 +** Processing line: ~ 1100,4860,1280,4860~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + 1100,4860,1280,4860 +** Processing line: ~ 1280,4860,1420,4840~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 1280,4860,1420,4840 +** Processing line: ~ 1420,4840,1580,4860~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_test_running m~ + 1420,4840,1580,4860 +** Processing line: ~ 1580,4860,1720,4820~ - Inside source: true *** True Line Result - def log_test_running m -** Processing line: ~ log "** Running: #{m}"~ + 1580,4860,1720,4820 +** Processing line: ~ 1720,4820,1880,4860~ - Inside source: true *** True Line Result - log "** Running: #{m}" -** Processing line: ~ end~ + 1720,4820,1880,4860 +** Processing line: ~ 1880,4860,2000,4840~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 1880,4860,2000,4840 +** Processing line: ~ 2000,4840,2140,4840~ - Inside source: true *** True Line Result - -** Processing line: ~ def test_signature_invalid_exception? e, m~ + 2000,4840,2140,4840 +** Processing line: ~ 2140,4840,2320,4860~ - Inside source: true *** True Line Result - def test_signature_invalid_exception? e, m -** Processing line: ~ e.to_s.include?(m.to_s) && e.to_s.include?("wrong number of arguments")~ + 2140,4840,2320,4860 +** Processing line: ~ 2320,4860,2440,4880~ - Inside source: true *** True Line Result - e.to_s.include?(m.to_s) && e.to_s.include?("wrong number of arguments") -** Processing line: ~ end~ + 2320,4860,2440,4880 +** Processing line: ~ 2440,4880,2600,4880~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2440,4880,2600,4880 +** Processing line: ~ 2600,4880,2800,4880~ - Inside source: true *** True Line Result - -** Processing line: ~ def log_test_signature_incorrect m~ + 2600,4880,2800,4880 +** Processing line: ~ 2800,4880,2900,4880~ - Inside source: true *** True Line Result - def log_test_signature_incorrect m -** Processing line: ~ log "TEST METHOD INVALID:", <<-S~ + 2800,4880,2900,4880 +** Processing line: ~ 2900,4880,2900,4820~ - Inside source: true *** True Line Result - log "TEST METHOD INVALID:", <<-S -** Processing line: ~ I found a test method called :#{m}. But it needs to have~ + 2900,4880,2900,4820 +** Processing line: ~ 2900,4740,2900,4820~ - Inside source: true *** True Line Result - I found a test method called :#{m}. But it needs to have -** Processing line: ~ the following method signature:~ + 2900,4740,2900,4820 +** Processing line: ~ 2800,4700,2900,4740~ - Inside source: true *** True Line Result - the following method signature: -** Processing line: ~ #+begin_src~ + 2800,4700,2900,4740 +** Processing line: ~ 2520,4680,2800,4700~ - Inside source: true *** True Line Result - #+begin_src -** Processing line: ~ def #{m} args, assert~ + 2520,4680,2800,4700 +** Processing line: ~ 2240,4660,2520,4680~ - Inside source: true *** True Line Result - def #{m} args, assert -** Processing line: ~~ + 2240,4660,2520,4680 +** Processing line: ~ 1940,4620,2240,4660~ - Inside source: true *** True Line Result - -** Processing line: ~ end~ + 1940,4620,2240,4660 +** Processing line: ~ 1820,4580,1940,4620~ - Inside source: true *** True Line Result - end -** Processing line: ~ #+end_src~ + 1820,4580,1940,4620 +** Processing line: ~ 1820,4500,1820,4580~ - Inside source: true *** True Line Result - #+end_src -** Processing line: ~ Please update the method signature to match the code above. If you~ + 1820,4500,1820,4580 +** Processing line: ~ 1820,4500,1880,4420~ - Inside source: true *** True Line Result - Please update the method signature to match the code above. If you -** Processing line: ~ did not intend this to be a test method. Rename the method so it does~ + 1820,4500,1880,4420 +** Processing line: ~ 1880,4420,2000,4420~ - Inside source: true *** True Line Result - did not intend this to be a test method. Rename the method so it does -** Processing line: ~ not start with "test_".~ + 1880,4420,2000,4420 +** Processing line: ~ 2000,4420,2200,4420~ - Inside source: true *** True Line Result - not start with "test_". -** Processing line: ~ S~ + 2000,4420,2200,4420 +** Processing line: ~ 2200,4420,2400,4440~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + 2200,4420,2400,4440 +** Processing line: ~ 2400,4440,2600,4440~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 2400,4440,2600,4440 +** Processing line: ~ 2600,4440,2840,4440~ - Inside source: true *** True Line Result - -** Processing line: ~ def print_summary~ + 2600,4440,2840,4440 +** Processing line: ~ 2840,4440,2900,4400~ - Inside source: true *** True Line Result - def print_summary -** Processing line: ~ log "** Summary"~ + 2840,4440,2900,4400 +** Processing line: ~ 2740,4260,2900,4280~ - Inside source: true *** True Line Result - log "** Summary" -** Processing line: ~ log "*** Passed"~ + 2740,4260,2900,4280 +** Processing line: ~ 2600,4240,2740,4260~ - Inside source: true *** True Line Result - log "*** Passed" -** Processing line: ~ log "#{self.passed.length} test(s) passed."~ + 2600,4240,2740,4260 +** Processing line: ~ 2480,4280,2600,4240~ - Inside source: true *** True Line Result - log "#{self.passed.length} test(s) passed." -** Processing line: ~ self.passed.each { |h| log "**** :#{h[:m]}" }~ + 2480,4280,2600,4240 +** Processing line: ~ 2320,4240,2480,4280~ - Inside source: true *** True Line Result - self.passed.each { |h| log "**** :#{h[:m]}" } -** Processing line: ~ log "*** Inconclusive"~ + 2320,4240,2480,4280 +** Processing line: ~ 2140,4220,2320,4240~ - Inside source: true *** True Line Result - log "*** Inconclusive" -** Processing line: ~ if self.inconclusive.length > 0~ + 2140,4220,2320,4240 +** Processing line: ~ 1940,4220,2140,4220~ - Inside source: true *** True Line Result - if self.inconclusive.length > 0 -** Processing line: ~ log_once :assertion_ok_note, <<-S~ + 1940,4220,2140,4220 +** Processing line: ~ 1880,4160,1940,4220~ - Inside source: true *** True Line Result - log_once :assertion_ok_note, <<-S -** Processing line: ~ NOTE FOR INCONCLUSIVE TESTS: No assertion was performed in the test.~ + 1880,4160,1940,4220 +** Processing line: ~ 1880,4160,1880,4080~ - Inside source: true *** True Line Result - NOTE FOR INCONCLUSIVE TESTS: No assertion was performed in the test. -** Processing line: ~ Add assert.ok! at the end of the test if you are using your own assertions.~ + 1880,4160,1880,4080 +** Processing line: ~ 1880,4080,2040,4040~ - Inside source: true *** True Line Result - Add assert.ok! at the end of the test if you are using your own assertions. -** Processing line: ~ S~ + 1880,4080,2040,4040 +** Processing line: ~ 2040,4040,2240,4060~ - Inside source: true *** True Line Result - S -** Processing line: ~ end~ + 2040,4040,2240,4060 +** Processing line: ~ 2240,4060,2400,4040~ - Inside source: true *** True Line Result - end -** Processing line: ~ log "#{self.inconclusive.length} test(s) inconclusive."~ + 2240,4060,2400,4040 +** Processing line: ~ 2400,4040,2600,4060~ - Inside source: true *** True Line Result - log "#{self.inconclusive.length} test(s) inconclusive." -** Processing line: ~ self.inconclusive.each { |h| log "**** :#{h[:m]}" }~ + 2400,4040,2600,4060 +** Processing line: ~ 2600,4060,2740,4020~ - Inside source: true *** True Line Result - self.inconclusive.each { |h| log "**** :#{h[:m]}" } -** Processing line: ~ log "*** Failed"~ + 2600,4060,2740,4020 +** Processing line: ~ 2740,4020,2840,3940~ - Inside source: true *** True Line Result - log "*** Failed" -** Processing line: ~ log "#{self.failed.length} test(s) failed."~ + 2740,4020,2840,3940 +** Processing line: ~ 2840,3780,2840,3940~ - Inside source: true *** True Line Result - log "#{self.failed.length} test(s) failed." -** Processing line: ~ self.failed.each do |h|~ + 2840,3780,2840,3940 +** Processing line: ~ 2740,3660,2840,3780~ - Inside source: true *** True Line Result - self.failed.each do |h| -** Processing line: ~ log "**** Test name: :#{h[:m]}"~ + 2740,3660,2840,3780 +** Processing line: ~ 2700,3680,2740,3660~ - Inside source: true *** True Line Result - log "**** Test name: :#{h[:m]}" -** Processing line: ~ log "#{h[:e].to_s.gsub("* ERROR:", "").strip}"~ + 2700,3680,2740,3660 +** Processing line: ~ 2520,3700,2700,3680~ - Inside source: true *** True Line Result - log "#{h[:e].to_s.gsub("* ERROR:", "").strip}" -** Processing line: ~ end~ + 2520,3700,2700,3680 +** Processing line: ~ 2380,3700,2520,3700~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 2380,3700,2520,3700 +** Processing line: ~ 2200,3720,2380,3700~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 2200,3720,2380,3700 +** Processing line: ~ 2040,3720,2200,3720~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 2040,3720,2200,3720 +** Processing line: ~ 1880,3700,2040,3720~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 1880,3700,2040,3720 +** Processing line: ~ 1820,3680,1880,3700~ - 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: ~* trace.rb~ -- Header detected. -*** True Line Result - -*** True Line Result -* trace.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. -*** True Line Result - + 1820,3680,1880,3700 +** Processing line: ~ 1760,3600,1820,3680~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/trace.rb~ + 1760,3600,1820,3680 +** Processing line: ~ 1760,3600,1820,3480~ - Inside source: true *** True Line Result - # ./dragon/trace.rb -** Processing line: ~ # coding: utf-8~ + 1760,3600,1820,3480 +** Processing line: ~ 1820,3480,1880,3440~ - Inside source: true *** True Line Result - # coding: utf-8 -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + 1820,3480,1880,3440 +** Processing line: ~ 1880,3440,1960,3460~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + 1880,3440,1960,3460 +** Processing line: ~ 1960,3460,2140,3460~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # trace.rb has been released under MIT (*only this file*).~ + 1960,3460,2140,3460 +** Processing line: ~ 2140,3460,2380,3460~ - Inside source: true *** True Line Result - # trace.rb has been released under MIT (*only this file*). -** Processing line: ~~ + 2140,3460,2380,3460 +** Processing line: ~ 2380,3460,2640,3440~ - Inside source: true *** True Line Result - -** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright:~ + 2380,3460,2640,3440 +** Processing line: ~ 2640,3440,2900,3380~ - Inside source: true *** True Line Result - # Contributors outside of DragonRuby who also hold Copyright: -** Processing line: ~ # - Dan Healy: https://github.com/danhealy~ + 2640,3440,2900,3380 +** Processing line: ~ 2840,3280,2900,3380~ - Inside source: true *** True Line Result - # - Dan Healy: https://github.com/danhealy -** Processing line: ~~ + 2840,3280,2900,3380 +** Processing line: ~ 2840,3280,2900,3200~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + 2840,3280,2900,3200 +** Processing line: ~ 2900,3200,2900,3140~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ module Trace~ + 2900,3200,2900,3140 +** Processing line: ~ 2840,3020,2900,3140~ - Inside source: true *** True Line Result - module Trace -** Processing line: ~ IGNORED_METHODS = [~ + 2840,3020,2900,3140 +** Processing line: ~ 2800,2960,2840,3020~ - Inside source: true *** True Line Result - IGNORED_METHODS = [ -** Processing line: ~ :define_singleton_method, :raise_immediately, :instance_of?,~ + 2800,2960,2840,3020 +** Processing line: ~ 2700,3000,2800,2960~ - Inside source: true *** True Line Result - :define_singleton_method, :raise_immediately, :instance_of?, -** Processing line: ~ :raise_with_caller, :initialize_copy, :class_defined?,~ + 2700,3000,2800,2960 +** Processing line: ~ 2600,2980,2700,3000~ - Inside source: true *** True Line Result - :raise_with_caller, :initialize_copy, :class_defined?, -** Processing line: ~ :instance_variable_get, :format, :purge_class, :instance_variable_defined?,~ + 2600,2980,2700,3000 +** Processing line: ~ 2380,3000,2600,2980~ - Inside source: true *** True Line Result - :instance_variable_get, :format, :purge_class, :instance_variable_defined?, -** Processing line: ~ :metadata_object_id, :instance_variable_set, :__printstr__,~ + 2380,3000,2600,2980 +** Processing line: ~ 2140,3000,2380,3000~ - Inside source: true *** True Line Result - :metadata_object_id, :instance_variable_set, :__printstr__, -** Processing line: ~ :instance_variables, :is_a?, :p, :kind_of?, :==, :log_once,~ + 2140,3000,2380,3000 +** Processing line: ~ 1880,3000,2140,3000~ - Inside source: true *** True Line Result - :instance_variables, :is_a?, :p, :kind_of?, :==, :log_once, -** Processing line: ~ :protected_methods, :log_once_info, :private_methods, :open,~ + 1880,3000,2140,3000 +** Processing line: ~ 1720,3040,1880,3000~ - Inside source: true *** True Line Result - :protected_methods, :log_once_info, :private_methods, :open, -** Processing line: ~ :!=, :initialize, :object_id, :Hash, :methods, :tick, :!,~ + 1720,3040,1880,3000 +** Processing line: ~ 1640,2960,1720,3040~ - Inside source: true *** True Line Result - :!=, :initialize, :object_id, :Hash, :methods, :tick, :!, -** Processing line: ~ :respond_to?, :yield_self, :send, :instance_eval, :then,~ + 1640,2960,1720,3040 +** Processing line: ~ 1500,2940,1640,2960~ - Inside source: true *** True Line Result - :respond_to?, :yield_self, :send, :instance_eval, :then, -** Processing line: ~ :__method__, :__send__, :log_print, :dig, :itself, :log_info,~ + 1500,2940,1640,2960 +** Processing line: ~ 1340,3000,1500,2940~ - Inside source: true *** True Line Result - :__method__, :__send__, :log_print, :dig, :itself, :log_info, -** Processing line: ~ :remove_instance_variable, :raise, :public_methods, :instance_exec,~ + 1340,3000,1500,2940 +** Processing line: ~ 1240,3000,1340,3000~ - Inside source: true *** True Line Result - :remove_instance_variable, :raise, :public_methods, :instance_exec, -** Processing line: ~ :gets, :local_variables, :tap, :__id__, :class, :singleton_class,~ + 1240,3000,1340,3000 +** Processing line: ~ 1140,3020,1240,3000~ - Inside source: true *** True Line Result - :gets, :local_variables, :tap, :__id__, :class, :singleton_class, -** Processing line: ~ :block_given?, :_inspect, :puts, :global_variables, :getc, :iterator?,~ + 1140,3020,1240,3000 +** Processing line: ~ 1040,3000,1140,3020~ - Inside source: true *** True Line Result - :block_given?, :_inspect, :puts, :global_variables, :getc, :iterator?, -** Processing line: ~ :hash, :to_enum, :printf, :frozen?, :print, :original_puts,~ + 1040,3000,1140,3020 +** Processing line: ~ 960,2960,1040,3000~ - Inside source: true *** True Line Result - :hash, :to_enum, :printf, :frozen?, :print, :original_puts, -** Processing line: ~ :srand, :freeze, :rand, :extend, :eql?, :equal?, :sprintf, :clone,~ + 960,2960,1040,3000 +** Processing line: ~ 900,2960,960,2960~ - Inside source: true *** True Line Result - :srand, :freeze, :rand, :extend, :eql?, :equal?, :sprintf, :clone, -** Processing line: ~ :dup, :to_s, :primitive_determined?, :inspect, :primitive?, :help,~ + 900,2960,960,2960 +** Processing line: ~ 840,2840,900,2960~ - Inside source: true *** True Line Result - :dup, :to_s, :primitive_determined?, :inspect, :primitive?, :help, -** Processing line: ~ :__object_methods__, :proc, :__custom_object_methods__, :Float, :enum_for,~ + 840,2840,900,2960 +** Processing line: ~ 700,2820,840,2840~ - Inside source: true *** True Line Result - :__object_methods__, :proc, :__custom_object_methods__, :Float, :enum_for, -** Processing line: ~ :__supports_ivars__?, :nil?, :fast_rand, :or, :and,~ + 700,2820,840,2840 +** Processing line: ~ 540,2820,700,2820~ - Inside source: true *** True Line Result - :__supports_ivars__?, :nil?, :fast_rand, :or, :and, -** Processing line: ~ :__caller_without_noise__, :__gtk_ruby_string_contains_source_file_path__?,~ + 540,2820,700,2820 +** Processing line: ~ 420,2820,540,2820~ - Inside source: true *** True Line Result - :__caller_without_noise__, :__gtk_ruby_string_contains_source_file_path__?, -** Processing line: ~ :__pretty_print_exception__, :__gtk_ruby_source_files__,~ + 420,2820,540,2820 +** Processing line: ~ 180,2800,420,2820~ - Inside source: true *** True Line Result - :__pretty_print_exception__, :__gtk_ruby_source_files__, -** Processing line: ~ :String, :log, :Array, :putsc, :Integer, :===, :here,~ + 180,2800,420,2820 +** Processing line: ~ 60,2780,180,2800~ - Inside source: true *** True Line Result - :String, :log, :Array, :putsc, :Integer, :===, :here, -** Processing line: ~ :raise_error_with_kind_of_okay_message, :better_instance_information,~ + 60,2780,180,2800 +** Processing line: ~ -60,2800,60,2780~ - Inside source: true *** True Line Result - :raise_error_with_kind_of_okay_message, :better_instance_information, -** Processing line: ~ :lambda, :fail, :method_missing, :__case_eqq, :caller,~ + -60,2800,60,2780 +** Processing line: ~ -160,2760,-60,2800~ - Inside source: true *** True Line Result - :lambda, :fail, :method_missing, :__case_eqq, :caller, -** Processing line: ~ :raise_method_missing_better_error, :require, :singleton_methods,~ + -160,2760,-60,2800 +** Processing line: ~ -260,2740,-160,2760~ - Inside source: true *** True Line Result - :raise_method_missing_better_error, :require, :singleton_methods, -** Processing line: ~ :!~, :loop, :numeric_or_default, :`, :state, :inputs, :outputs, "args=".to_sym,~ + -260,2740,-160,2760 +** Processing line: ~ -300,2640,-260,2740~ - Inside source: true *** True Line Result - :!~, :loop, :numeric_or_default, :`, :state, :inputs, :outputs, "args=".to_sym, -** Processing line: ~ :grid, :gtk, :dragon, :args, :passes, :tick, :grep_source, :grep_source_file,~ + -300,2640,-260,2740 +** Processing line: ~ -360,2560,-300,2640~ - Inside source: true *** True Line Result - :grid, :gtk, :dragon, :args, :passes, :tick, :grep_source, :grep_source_file, -** Processing line: ~ :numeric_or_default, :f_or_default, :s_or_default, :i_or_default,~ + -360,2560,-300,2640 +** Processing line: ~ -380,2460,-360,2560~ - Inside source: true *** True Line Result - :numeric_or_default, :f_or_default, :s_or_default, :i_or_default, -** Processing line: ~ :comment, :primitive_marker, :xrepl, :repl~ + -380,2460,-360,2560 +** Processing line: ~ -380,2460,-300,2380~ - Inside source: true *** True Line Result - :comment, :primitive_marker, :xrepl, :repl -** Processing line: ~ ]~ + -380,2460,-300,2380 +** Processing line: ~ -300,2300,-300,2380~ - Inside source: true *** True Line Result - ] -** Processing line: ~~ + -300,2300,-300,2380 +** Processing line: ~ -300,2300,-300,2220~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.traced_classes~ + -300,2300,-300,2220 +** Processing line: ~ -300,2100,-300,2220~ - Inside source: true *** True Line Result - def self.traced_classes -** Processing line: ~ @traced_classes ||= []~ + -300,2100,-300,2220 +** Processing line: ~ -300,2100,-300,2040~ - Inside source: true *** True Line Result - @traced_classes ||= [] -** Processing line: ~ @traced_classes~ + -300,2100,-300,2040 +** Processing line: ~ -300,2040,-160,2040~ - Inside source: true *** True Line Result - @traced_classes -** Processing line: ~ end~ + -300,2040,-160,2040 +** Processing line: ~ -160,2040,-60,2040~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + -160,2040,-60,2040 +** Processing line: ~ -60,2040,60,2040~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.mark_class_as_traced! klass~ + -60,2040,60,2040 +** Processing line: ~ 60,2040,180,2040~ - Inside source: true *** True Line Result - def self.mark_class_as_traced! klass -** Processing line: ~ @traced_classes << klass~ + 60,2040,180,2040 +** Processing line: ~ 180,2040,360,2040~ - Inside source: true *** True Line Result - @traced_classes << klass -** Processing line: ~ end~ + 180,2040,360,2040 +** Processing line: ~ 360,2040,540,2040~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 360,2040,540,2040 +** Processing line: ~ 540,2040,700,2080~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.untrace_classes!~ + 540,2040,700,2080 +** Processing line: ~ 660,2160,700,2080~ - Inside source: true *** True Line Result - def self.untrace_classes! -** Processing line: ~ traced_classes.each do |klass|~ + 660,2160,700,2080 +** Processing line: ~ 660,2160,700,2260~ - Inside source: true *** True Line Result - traced_classes.each do |klass| -** Processing line: ~ klass.class_eval do~ + 660,2160,700,2260 +** Processing line: ~ 660,2380,700,2260~ - Inside source: true *** True Line Result - klass.class_eval do -** Processing line: ~ all_methods = klass.instance_methods false~ + 660,2380,700,2260 +** Processing line: ~ 500,2340,660,2380~ - Inside source: true *** True Line Result - all_methods = klass.instance_methods false -** Processing line: ~ if klass.instance_methods.respond_to?(:__trace_call_depth__)~ + 500,2340,660,2380 +** Processing line: ~ 360,2340,500,2340~ - Inside source: true *** True Line Result - if klass.instance_methods.respond_to?(:__trace_call_depth__) -** Processing line: ~ undef_method :__trace_call_depth__~ + 360,2340,500,2340 +** Processing line: ~ 240,2340,360,2340~ - Inside source: true *** True Line Result - undef_method :__trace_call_depth__ -** Processing line: ~ end~ + 240,2340,360,2340 +** Processing line: ~ 40,2320,240,2340~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 40,2320,240,2340 +** Processing line: ~ -60,2320,40,2320~ - Inside source: true *** True Line Result - -** Processing line: ~ GTK::Trace.filter_methods_to_trace(all_methods).each do |m|~ + -60,2320,40,2320 +** Processing line: ~ -100,2380,-60,2320~ - Inside source: true *** True Line Result - GTK::Trace.filter_methods_to_trace(all_methods).each do |m| -** Processing line: ~ original_method_name = m~ + -100,2380,-60,2320 +** Processing line: ~ -100,2380,-100,2460~ - Inside source: true *** True Line Result - original_method_name = m -** Processing line: ~ trace_method_name = GTK::Trace.trace_method_name_for m~ + -100,2380,-100,2460 +** Processing line: ~ -100,2460,-100,2540~ - Inside source: true *** True Line Result - trace_method_name = GTK::Trace.trace_method_name_for m -** Processing line: ~ if klass.instance_methods.include? trace_method_name~ + -100,2460,-100,2540 +** Processing line: ~ -100,2540,0,2560~ - Inside source: true *** True Line Result - if klass.instance_methods.include? trace_method_name -** Processing line: ~ alias_method m, trace_method_name~ + -100,2540,0,2560 +** Processing line: ~ 0,2560,140,2600~ - Inside source: true *** True Line Result - alias_method m, trace_method_name -** Processing line: ~ end~ + 0,2560,140,2600 +** Processing line: ~ 140,2600,300,2600~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 140,2600,300,2600 +** Processing line: ~ 300,2600,460,2600~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 300,2600,460,2600 +** Processing line: ~ 460,2600,640,2600~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 460,2600,640,2600 +** Processing line: ~ 640,2600,760,2580~ - Inside source: true *** True Line Result - end -** Processing line: ~ $last_method_traced = nil~ + 640,2600,760,2580 +** Processing line: ~ 760,2580,820,2560~ - Inside source: true *** True Line Result - $last_method_traced = nil -** Processing line: ~ @traced_classes.clear~ + 760,2580,820,2560 +** Processing line: ~ 820,2560,820,2500~ - Inside source: true *** True Line Result - @traced_classes.clear -** Processing line: ~ $trace_enabled = false~ + 820,2560,820,2500 +** Processing line: ~ 820,2500,820,2400~ - Inside source: true *** True Line Result - $trace_enabled = false -** Processing line: ~ if !$gtk.production~ + 820,2500,820,2400 +** Processing line: ~ 820,2400,840,2320~ - Inside source: true *** True Line Result - if !$gtk.production -** Processing line: ~ $gtk.write_file_root 'logs/trace.txt', "Add trace!(SOMEOBJECT) to the top of ~tick~ and this file will be populated with invocation information.\n"~ + 820,2400,840,2320 +** Processing line: ~ 840,2320,840,2240~ - Inside source: true *** True Line Result - $gtk.write_file_root 'logs/trace.txt', "Add trace!(SOMEOBJECT) to the top of ~tick~ and this file will be populated with invocation information.\n" -** Processing line: ~ end~ + 840,2320,840,2240 +** Processing line: ~ 820,2120,840,2240~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 820,2120,840,2240 +** Processing line: ~ 820,2020,820,2120~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 820,2020,820,2120 +** Processing line: ~ 820,1900,820,2020~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.trace_method_name_for m~ + 820,1900,820,2020 +** Processing line: ~ 760,1840,820,1900~ - Inside source: true *** True Line Result - def self.trace_method_name_for m -** Processing line: ~ "__trace_original_#{m}__".to_sym~ + 760,1840,820,1900 +** Processing line: ~ 640,1840,760,1840~ - Inside source: true *** True Line Result - "__trace_original_#{m}__".to_sym -** Processing line: ~ end~ + 640,1840,760,1840 +** Processing line: ~ 500,1840,640,1840~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 500,1840,640,1840 +** Processing line: ~ 300,1860,420,1880~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.original_method_name_for m~ + 300,1860,420,1880 +** Processing line: ~ 180,1840,300,1860~ - Inside source: true *** True Line Result - def self.original_method_name_for m -** Processing line: ~ return m unless m.to_s.start_with?("__trace_original_") && m.to_s.end_with?("__")~ + 180,1840,300,1860 +** Processing line: ~ 420,1880,500,1840~ - Inside source: true *** True Line Result - return m unless m.to_s.start_with?("__trace_original_") && m.to_s.end_with?("__") -** Processing line: ~ m[16..-3]~ + 420,1880,500,1840 +** Processing line: ~ 0,1840,180,1840~ - Inside source: true *** True Line Result - m[16..-3] -** Processing line: ~ end~ + 0,1840,180,1840 +** Processing line: ~ -60,1860,0,1840~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + -60,1860,0,1840 +** Processing line: ~ -160,1840,-60,1860~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.filter_methods_to_trace methods~ + -160,1840,-60,1860 +** Processing line: ~ -200,1800,-160,1840~ - Inside source: true *** True Line Result - def self.filter_methods_to_trace methods -** Processing line: ~ methods.reject { |m| m.start_with? "__trace_" }.reject { |m| IGNORED_METHODS.include? m }~ + -200,1800,-160,1840 +** Processing line: ~ -260,1760,-200,1800~ - Inside source: true *** True Line Result - methods.reject { |m| m.start_with? "__trace_" }.reject { |m| IGNORED_METHODS.include? m } -** Processing line: ~ end~ + -260,1760,-200,1800 +** Processing line: ~ -260,1680,-260,1760~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + -260,1680,-260,1760 +** Processing line: ~ -260,1620,-260,1680~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.trace_times_string~ + -260,1620,-260,1680 +** Processing line: ~ -260,1540,-260,1620~ - Inside source: true *** True Line Result - def self.trace_times_string -** Processing line: ~ str = []~ + -260,1540,-260,1620 +** Processing line: ~ -260,1540,-260,1460~ - Inside source: true *** True Line Result - str = [] -** Processing line: ~ $trace_performance.sort_by {|method_name, times| -times[:avg] }.each do |method_name, times|~ + -260,1540,-260,1460 +** Processing line: ~ -300,1420,-260,1460~ - Inside source: true *** True Line Result - $trace_performance.sort_by {|method_name, times| -times[:avg] }.each do |method_name, times| -** Processing line: ~ str << "#{method_name}: #{times[:sum].round(2)}/#{times[:count]} #{times[:min]}ms min, #{times[:avg].round(2)}ms avg, #{times[:max]}ms max"~ + -300,1420,-260,1460 +** Processing line: ~ -300,1420,-300,1340~ - Inside source: true *** True Line Result - str << "#{method_name}: #{times[:sum].round(2)}/#{times[:count]} #{times[:min]}ms min, #{times[:avg].round(2)}ms avg, #{times[:max]}ms max" -** Processing line: ~ end~ + -300,1420,-300,1340 +** Processing line: ~ -300,1340,-260,1260~ - Inside source: true *** True Line Result - end -** Processing line: ~ str.join("\n")~ + -300,1340,-260,1260 +** Processing line: ~ -260,1260,-260,1160~ - Inside source: true *** True Line Result - str.join("\n") -** Processing line: ~ end~ + -260,1260,-260,1160 +** Processing line: ~ -260,1060,-260,1160~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + -260,1060,-260,1160 +** Processing line: ~ -260,1060,-260,960~ - Inside source: true *** True Line Result - -** Processing line: ~ def self.flush_trace pad_with_newline = false~ + -260,1060,-260,960 +** Processing line: ~ -260,880,-260,960~ - Inside source: true *** True Line Result - def self.flush_trace pad_with_newline = false -** Processing line: ~ $trace_puts ||= []~ + -260,880,-260,960 +** Processing line: ~ -260,880,-260,780~ - Inside source: true *** True Line Result - $trace_puts ||= [] -** Processing line: ~ puts "(Trace info flushed!)"~ + -260,880,-260,780 +** Processing line: ~ -260,780,-260,680~ - Inside source: true *** True Line Result - puts "(Trace info flushed!)" -** Processing line: ~ if $trace_puts.length > 0~ + -260,780,-260,680 +** Processing line: ~ -300,580,-260,680~ - Inside source: true *** True Line Result - if $trace_puts.length > 0 -** Processing line: ~ text = $trace_puts.join("").strip + "\n" + self.trace_times_string + "\n"~ + -300,580,-260,680 +** Processing line: ~ -300,580,-300,480~ - Inside source: true *** True Line Result - text = $trace_puts.join("").strip + "\n" + self.trace_times_string + "\n" -** Processing line: ~ if pad_with_newline~ + -300,580,-300,480 +** Processing line: ~ -300,480,-260,400~ - Inside source: true *** True Line Result - if pad_with_newline -** Processing line: ~ $gtk.append_file_root 'logs/trace.txt', "\n" + text.strip~ + -300,480,-260,400 +** Processing line: ~ -300,320,-260,400~ - Inside source: true *** True Line Result - $gtk.append_file_root 'logs/trace.txt', "\n" + text.strip -** Processing line: ~ else~ + -300,320,-260,400 +** Processing line: ~ -300,320,-300,240~ - Inside source: true *** True Line Result - else -** Processing line: ~ $gtk.append_file_root 'logs/trace.txt', text.strip~ + -300,320,-300,240 +** Processing line: ~ -300,240,-200,220~ - Inside source: true *** True Line Result - $gtk.append_file_root 'logs/trace.txt', text.strip -** Processing line: ~ end~ + -300,240,-200,220 +** Processing line: ~ -200,220,-200,160~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + -200,220,-200,160 +** Processing line: ~ -200,160,-100,140~ - Inside source: true *** True Line Result - end -** Processing line: ~ $trace_puts.clear~ + -200,160,-100,140 +** Processing line: ~ -100,140,0,120~ - Inside source: true *** True Line Result - $trace_puts.clear -** Processing line: ~ end~ + -100,140,0,120 +** Processing line: ~ 0,120,60,120~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 0,120,60,120 +** Processing line: ~ 60,120,180,120~ - Inside source: true *** True Line Result - -** Processing line: ~ # @gtk~ + 60,120,180,120 +** Processing line: ~ 180,120,300,120~ - Inside source: true *** True Line Result - # @gtk -** Processing line: ~ def self.trace! instance = nil~ + 180,120,300,120 +** Processing line: ~ 300,120,420,140~ - Inside source: true *** True Line Result - def self.trace! instance = nil -** Processing line: ~ $trace_history ||= []~ + 300,120,420,140 +** Processing line: ~ 420,140,580,180~ - Inside source: true *** True Line Result - $trace_history ||= [] -** Processing line: ~ $trace_enabled = true~ + 420,140,580,180 +** Processing line: ~ 580,180,760,180~ - Inside source: true *** True Line Result - $trace_enabled = true -** Processing line: ~ $trace_call_depth ||=0~ + 580,180,760,180 +** Processing line: ~ 760,180,900,180~ - Inside source: true *** True Line Result - $trace_call_depth ||=0 -** Processing line: ~ $trace_performance = Hash.new {|h,k|~ + 760,180,900,180 +** Processing line: ~ 960,180,1100,180~ - Inside source: true *** True Line Result - $trace_performance = Hash.new {|h,k| -** Processing line: ~ h[k] = {~ + 960,180,1100,180 +** Processing line: ~ 1100,180,1340,200~ - Inside source: true *** True Line Result - h[k] = { -** Processing line: ~ min: 100000,~ + 1100,180,1340,200 +** Processing line: ~ 1340,200,1580,200~ - Inside source: true *** True Line Result - min: 100000, -** Processing line: ~ max: 0,~ + 1340,200,1580,200 +** Processing line: ~ 1580,200,1720,180~ - Inside source: true *** True Line Result - max: 0, -** Processing line: ~ avg: 0,~ + 1580,200,1720,180 +** Processing line: ~ 1720,180,2000,140~ - Inside source: true *** True Line Result - avg: 0, -** Processing line: ~ sum: 0,~ + 1720,180,2000,140 +** Processing line: ~ 2000,140,2240,140~ - Inside source: true *** True Line Result - sum: 0, -** Processing line: ~ count: 0~ + 2000,140,2240,140 +** Processing line: ~ 2240,140,2480,140~ - Inside source: true *** True Line Result - count: 0 -** Processing line: ~ }~ + 2240,140,2480,140 +** Processing line: ~ 2520,140,2800,160~ - Inside source: true *** True Line Result - } -** Processing line: ~ }~ + 2520,140,2800,160 +** Processing line: ~ 2800,160,3000,160~ - Inside source: true *** True Line Result - } -** Processing line: ~ flush_trace~ + 2800,160,3000,160 +** Processing line: ~ 3000,160,3140,160~ - Inside source: true *** True Line Result - flush_trace -** Processing line: ~ instance = $top_level unless instance~ + 3000,160,3140,160 +** Processing line: ~ 3140,260,3140,160~ - Inside source: true *** True Line Result - instance = $top_level unless instance -** Processing line: ~ return if Trace.traced_classes.include? instance.class~ + 3140,260,3140,160 +** Processing line: ~ 3140,260,3140,380~ - Inside source: true *** True Line Result - return if Trace.traced_classes.include? instance.class -** Processing line: ~ all_methods = instance.class.instance_methods false~ + 3140,260,3140,380 +** Processing line: ~ 3080,500,3140,380~ - Inside source: true *** True Line Result - all_methods = instance.class.instance_methods false -** Processing line: ~ instance.class.class_eval do~ + 3080,500,3140,380 +** Processing line: ~ 3080,620,3080,500~ - Inside source: true *** True Line Result - instance.class.class_eval do -** Processing line: ~ attr_accessor :__trace_call_depth__ unless instance.class.instance_methods.include?(:__trace_call_depth__)~ + 3080,620,3080,500 +** Processing line: ~ 3080,620,3080,740~ - Inside source: true *** True Line Result - attr_accessor :__trace_call_depth__ unless instance.class.instance_methods.include?(:__trace_call_depth__) -** Processing line: ~ GTK::Trace.filter_methods_to_trace(all_methods).each do |m|~ + 3080,620,3080,740 +** Processing line: ~ 3080,740,3080,840~ - Inside source: true *** True Line Result - GTK::Trace.filter_methods_to_trace(all_methods).each do |m| -** Processing line: ~ original_method_name = m~ + 3080,740,3080,840 +** Processing line: ~ 3080,960,3080,840~ - Inside source: true *** True Line Result - original_method_name = m -** Processing line: ~ trace_method_name = GTK::Trace.trace_method_name_for m~ + 3080,960,3080,840 +** Processing line: ~ 3080,1080,3080,960~ - Inside source: true *** True Line Result - trace_method_name = GTK::Trace.trace_method_name_for m -** Processing line: ~ alias_method trace_method_name, m~ + 3080,1080,3080,960 +** Processing line: ~ 3080,1080,3080,1200~ - Inside source: true *** True Line Result - alias_method trace_method_name, m -** Processing line: ~ $trace_puts << "Tracing #{m} on #{instance.class}.\n"~ + 3080,1080,3080,1200 +** Processing line: ~ 3080,1200,3080,1340~ - Inside source: true *** True Line Result - $trace_puts << "Tracing #{m} on #{instance.class}.\n" -** Processing line: ~ define_method(m) do |*args|~ + 3080,1200,3080,1340 +** Processing line: ~ 3080,1340,3080,1460~ - Inside source: true *** True Line Result - define_method(m) do |*args| -** Processing line: ~ instance.__trace_call_depth__ ||= 0~ + 3080,1340,3080,1460 +** Processing line: ~ 3080,1580,3080,1460~ - Inside source: true *** True Line Result - instance.__trace_call_depth__ ||= 0 -** Processing line: ~ tab_width = " " * (instance.__trace_call_depth__ * 8)~ + 3080,1580,3080,1460 +** Processing line: ~ 3080,1700,3080,1580~ - Inside source: true *** True Line Result - tab_width = " " * (instance.__trace_call_depth__ * 8) -** Processing line: ~ instance.__trace_call_depth__ += 1~ + 3080,1700,3080,1580 +** Processing line: ~ 3080,1700,3080,1760~ - Inside source: true *** True Line Result - instance.__trace_call_depth__ += 1 -** Processing line: ~ $trace_call_depth = instance.__trace_call_depth__~ + 3080,1700,3080,1760 +** Processing line: ~ 3080,1760,3200,1760~ - Inside source: true *** True Line Result - $trace_call_depth = instance.__trace_call_depth__ -** Processing line: ~ parameters = "#{args}"[1..-2]~ + 3080,1760,3200,1760 +** Processing line: ~ 3200,1760,3320,1760~ - Inside source: true *** True Line Result - parameters = "#{args}"[1..-2] -** Processing line: ~~ + 3200,1760,3320,1760 +** Processing line: ~ 3320,1760,3520,1760~ - Inside source: true *** True Line Result - -** Processing line: ~ $trace_puts << "\n #{tab_width}#{m}(#{parameters})"~ + 3320,1760,3520,1760 +** Processing line: ~ 3520,1760,3680,1740~ - Inside source: true *** True Line Result - $trace_puts << "\n #{tab_width}#{m}(#{parameters})" -** Processing line: ~~ + 3520,1760,3680,1740 +** Processing line: ~ 3680,1740,3780,1700~ - Inside source: true *** True Line Result - -** Processing line: ~ execution_time = Time.new~ + 3680,1740,3780,1700 +** Processing line: ~ 3780,1700,3840,1620~ - Inside source: true *** True Line Result - execution_time = Time.new -** Processing line: ~~ + 3780,1700,3840,1620 +** Processing line: ~ 3840,1620,3840,1520~ - Inside source: true *** True Line Result - -** Processing line: ~ $last_method_traced = trace_method_name~ + 3840,1620,3840,1520 +** Processing line: ~ 3840,1520,3840,1420~ - Inside source: true *** True Line Result - $last_method_traced = trace_method_name -** Processing line: ~ $trace_history << [m, parameters]~ + 3840,1520,3840,1420 +** Processing line: ~ 3840,1320,3840,1420~ - Inside source: true *** True Line Result - $trace_history << [m, parameters] -** Processing line: ~~ + 3840,1320,3840,1420 +** Processing line: ~ 3840,1120,3840,1320~ - Inside source: true *** True Line Result - -** Processing line: ~ result = send(trace_method_name, *args)~ + 3840,1120,3840,1320 +** Processing line: ~ 3840,1120,3840,940~ - Inside source: true *** True Line Result - result = send(trace_method_name, *args) -** Processing line: ~~ + 3840,1120,3840,940 +** Processing line: ~ 3840,940,3840,760~ - Inside source: true *** True Line Result - -** Processing line: ~ class_m = "#{instance.class}##{m}"~ + 3840,940,3840,760 +** Processing line: ~ 3780,600,3840,760~ - Inside source: true *** True Line Result - class_m = "#{instance.class}##{m}" -** Processing line: ~ completion_time = ((Time.new - execution_time).to_f * 1000).round(2)~ + 3780,600,3840,760 +** Processing line: ~ 3780,600,3780,440~ - Inside source: true *** True Line Result - completion_time = ((Time.new - execution_time).to_f * 1000).round(2) -** Processing line: ~ $trace_performance[class_m][:min] = [$trace_performance[class_m][:min], completion_time].min~ + 3780,600,3780,440 +** Processing line: ~ 3780,320,3780,440~ - Inside source: true *** True Line Result - $trace_performance[class_m][:min] = [$trace_performance[class_m][:min], completion_time].min -** Processing line: ~ $trace_performance[class_m][:max] = [$trace_performance[class_m][:max], completion_time].max~ + 3780,320,3780,440 +** Processing line: ~ 3780,320,3780,160~ - Inside source: true *** True Line Result - $trace_performance[class_m][:max] = [$trace_performance[class_m][:max], completion_time].max -** Processing line: ~ $trace_performance[class_m][:count] += 1~ + 3780,320,3780,160 +** Processing line: ~ 3780,60,3780,160~ - Inside source: true *** True Line Result - $trace_performance[class_m][:count] += 1 -** Processing line: ~ $trace_performance[class_m][:sum] += completion_time~ + 3780,60,3780,160 +** Processing line: ~ 3780,60,4020,60~ - Inside source: true *** True Line Result - $trace_performance[class_m][:sum] += completion_time -** Processing line: ~ $trace_performance[class_m][:avg] = $trace_performance[class_m][:sum].fdiv($trace_performance[class_m][:count])~ + 3780,60,4020,60 +** Processing line: ~ 4020,60,4260,40~ - Inside source: true *** True Line Result - $trace_performance[class_m][:avg] = $trace_performance[class_m][:sum].fdiv($trace_performance[class_m][:count]) -** Processing line: ~~ + 4020,60,4260,40 +** Processing line: ~ 4260,40,4500,40~ - Inside source: true *** True Line Result - -** Processing line: ~ instance.__trace_call_depth__ -= 1~ + 4260,40,4500,40 +** Processing line: ~ 4500,40,4740,40~ - Inside source: true *** True Line Result - instance.__trace_call_depth__ -= 1 -** Processing line: ~ instance.__trace_call_depth__ = instance.__trace_call_depth__.greater 0~ + 4500,40,4740,40 +** Processing line: ~ 4740,40,4840,20~ - Inside source: true *** True Line Result - instance.__trace_call_depth__ = instance.__trace_call_depth__.greater 0 -** Processing line: ~ $trace_puts << "\n #{tab_width} #{completion_time > 10 ? '!!! ' : ''}#{completion_time}ms success: #{m}"~ + 4740,40,4840,20 +** Processing line: ~ 4840,20,4880,80~ - Inside source: true *** True Line Result - $trace_puts << "\n #{tab_width} #{completion_time > 10 ? '!!! ' : ''}#{completion_time}ms success: #{m}" -** Processing line: ~ if instance.__trace_call_depth__ == 0~ + 4840,20,4880,80 +** Processing line: ~ 4880,80,5080,40~ - Inside source: true *** True Line Result - if instance.__trace_call_depth__ == 0 -** Processing line: ~ $trace_puts << "\n"~ + 4880,80,5080,40 +** Processing line: ~ 5080,40,5280,20~ - Inside source: true *** True Line Result - $trace_puts << "\n" -** Processing line: ~ $trace_history.clear~ + 5080,40,5280,20 +** Processing line: ~ 5280,20,5500,0~ - Inside source: true *** True Line Result - $trace_history.clear -** Processing line: ~ end~ + 5280,20,5500,0 +** Processing line: ~ 5500,0,5720,0~ - Inside source: true *** True Line Result - end -** Processing line: ~ result~ + 5500,0,5720,0 +** Processing line: ~ 5720,0,5940,60~ - Inside source: true *** True Line Result - result -** Processing line: ~ rescue Exception => e~ + 5720,0,5940,60 +** Processing line: ~ 5940,60,6240,60~ - Inside source: true *** True Line Result - rescue Exception => e -** Processing line: ~ instance.__trace_call_depth__ -= 1~ + 5940,60,6240,60 +** Processing line: ~ 6240,60,6540,20~ - Inside source: true *** True Line Result - instance.__trace_call_depth__ -= 1 -** Processing line: ~ instance.__trace_call_depth__ = instance.__trace_call_depth__.greater 0~ + 6240,60,6540,20 +** Processing line: ~ 6540,20,6840,20~ - Inside source: true *** True Line Result - instance.__trace_call_depth__ = instance.__trace_call_depth__.greater 0 -** Processing line: ~ $trace_puts << "\n #{tab_width} failed: #{m}"~ + 6540,20,6840,20 +** Processing line: ~ 6840,20,7040,0~ - Inside source: true *** True Line Result - $trace_puts << "\n #{tab_width} failed: #{m}" -** Processing line: ~ if instance.__trace_call_depth__ == 0~ + 6840,20,7040,0 +** Processing line: ~ 7040,0,7140,0~ - Inside source: true *** True Line Result - if instance.__trace_call_depth__ == 0 -** Processing line: ~ $trace_puts << "\n #{tab_width} #{e}"~ + 7040,0,7140,0 +** Processing line: ~ 7140,0,7400,20~ - Inside source: true *** True Line Result - $trace_puts << "\n #{tab_width} #{e}" -** Processing line: ~ $trace_puts << "\n"~ + 7140,0,7400,20 +** Processing line: ~ 7400,20,7680,0~ - Inside source: true *** True Line Result - $trace_puts << "\n" -** Processing line: ~ end~ + 7400,20,7680,0 +** Processing line: ~ 7680,0,7940,0~ - Inside source: true *** True Line Result - end -** Processing line: ~ $trace_call_depth = 0~ + 7680,0,7940,0 +** Processing line: ~ 7940,0,8200,-20~ - Inside source: true *** True Line Result - $trace_call_depth = 0 -** Processing line: ~ GTK::Trace.flush_trace true~ + 7940,0,8200,-20 +** Processing line: ~ 8200,-20,8360,20~ - Inside source: true *** True Line Result - GTK::Trace.flush_trace true -** Processing line: ~ raise e~ + 8200,-20,8360,20 +** Processing line: ~ 8360,20,8560,-40~ - Inside source: true *** True Line Result - raise e -** Processing line: ~ end~ + 8360,20,8560,-40 +** Processing line: ~ 8560,-40,8760,0~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 8560,-40,8760,0 +** Processing line: ~ 8760,0,8880,40~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 8760,0,8880,40 +** Processing line: ~ 8880,120,8880,40~ - Inside source: true *** True Line Result - end -** Processing line: ~ mark_class_as_traced! instance.class~ + 8880,120,8880,40 +** Processing line: ~ 8840,220,8840,120~ - Inside source: true *** True Line Result - mark_class_as_traced! instance.class -** Processing line: ~ end~ + 8840,220,8840,120 +** Processing line: ~ 8620,240,8840,220~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 8620,240,8840,220 +** Processing line: ~ 8420,260,8620,240~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 8420,260,8620,240 +** Processing line: ~ 8200,280,8420,260~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 8200,280,8420,260 +** Processing line: ~ 7940,280,8200,280~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + 7940,280,8200,280 +** Processing line: ~ 7760,240,7940,280~ +- Inside source: true *** True Line Result -#+end_src -** Processing line: ~~ -- End of paragraph detected. + 7760,240,7940,280 +** Processing line: ~ 7560,220,7760,240~ +- Inside source: true *** True Line Result - -** Processing line: ~* wizards.rb~ -- Header detected. + 7560,220,7760,240 +** Processing line: ~ 7360,280,7560,220~ +- Inside source: true *** True Line Result - + 7360,280,7560,220 +** Processing line: ~ 7140,260,7360,280~ +- Inside source: true *** True Line Result -* wizards.rb -** Processing line: ~#+begin_src ruby~ -- Line was identified as the beginning of a code block. + 7140,260,7360,280 +** Processing line: ~ 6940,240,7140,260~ +- Inside source: true *** True Line Result - + 6940,240,7140,260 +** Processing line: ~ 6720,220,6940,240~ +- Inside source: true *** True Line Result -#+begin_src ruby -** Processing line: ~ # ./dragon/wizards.rb~ + 6720,220,6940,240 +** Processing line: ~ 6480,220,6720,220~ - Inside source: true *** True Line Result - # ./dragon/wizards.rb -** Processing line: ~ # Copyright 2019 DragonRuby LLC~ + 6480,220,6720,220 +** Processing line: ~ 6360,300,6480,220~ - Inside source: true *** True Line Result - # Copyright 2019 DragonRuby LLC -** Processing line: ~ # MIT License~ + 6360,300,6480,220 +** Processing line: ~ 6240,300,6360,300~ - Inside source: true *** True Line Result - # MIT License -** Processing line: ~ # wizards.rb has been released under MIT (*only this file*).~ + 6240,300,6360,300 +** Processing line: ~ 6200,500,6240,300~ - Inside source: true *** True Line Result - # wizards.rb has been released under MIT (*only this file*). -** Processing line: ~~ + 6200,500,6240,300 +** Processing line: ~ 6200,500,6360,540~ - Inside source: true *** True Line Result - -** Processing line: ~ module GTK~ + 6200,500,6360,540 +** Processing line: ~ 6360,540,6540,520~ - Inside source: true *** True Line Result - module GTK -** Processing line: ~ class Wizards~ + 6360,540,6540,520 +** Processing line: ~ 6540,520,6720,480~ - Inside source: true *** True Line Result - class Wizards -** Processing line: ~ attr_accessor :ios, :itch~ + 6540,520,6720,480 +** Processing line: ~ 6720,480,6880,460~ - Inside source: true *** True Line Result - attr_accessor :ios, :itch -** Processing line: ~~ + 6720,480,6880,460 +** Processing line: ~ 6880,460,7080,500~ - Inside source: true *** True Line Result - -** Processing line: ~ def initialize~ + 6880,460,7080,500 +** Processing line: ~ 7080,500,7320,500~ - Inside source: true *** True Line Result - def initialize -** Processing line: ~ @ios = IOSWizard.new~ + 7080,500,7320,500 +** Processing line: ~ 7320,500,7680,500~ - Inside source: true *** True Line Result - @ios = IOSWizard.new -** Processing line: ~ @itch = ItchWizard.new~ + 7320,500,7680,500 +** Processing line: ~ 7680,620,7680,500~ - Inside source: true *** True Line Result - @itch = ItchWizard.new -** Processing line: ~ end~ + 7680,620,7680,500 +** Processing line: ~ 7520,640,7680,620~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 7520,640,7680,620 +** Processing line: ~ 7360,640,7520,640~ - Inside source: true *** True Line Result - end -** Processing line: ~ end~ + 7360,640,7520,640 +** Processing line: ~ 7200,640,7360,640~ - Inside source: true *** True Line Result - end -** Processing line: ~~ + 7200,640,7360,640 +** Processing line: ~ 7040,660,7200,640~ - Inside source: true *** True Line Result - -** Processing line: ~#+end_src~ -- Line was identified as the end of a code block. + 7040,660,7200,640 +** Processing line: ~ 6880,720,7040,660~ +- Inside source: true *** True Line Result -#+end_src -* Processing Html Given True Lines -** Processing line: ~* DragonRuby Game Toolkit Live Docs~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DragonRuby Game Toolkit Live Docs~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~The information contained here is all available via the DragonRuby Console. You can Open the DragonRuby Console by pressing [`] [~] [²] [^] [º] or [§] within your game.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The information contained here is all available via the DragonRuby Console. You can Open the DragonRuby Console by pressing [`] [~] [²] [^] [º] or [§] within your game.~ -- Line's tilde count is: 1 -- Line contains link marker: false -** Processing line: ~To search docs you can type ~docs_search "SEARCH TERM"~ or if you want to get fancy you can provide a ~lambda~ to filter documentation:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~To search docs you can type ~docs_search "SEARCH TERM"~ or if you want to get fancy you can provide a ~lambda~ to filter documentation:~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ docs_search { |entry| (entry.include? "Array") && (!entry.include? "Enumerable") }~ -** 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. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Hello World~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Welcome to DragonRuby Game Toolkit. Take the steps below to get started.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Welcome to DragonRuby Game Toolkit. Take the steps below to get started.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~* Join the Discord and Subscribe to the News Letter~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Join the Discord and Subscribe to the News Letter~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Our Discord channel is [[http://discord.dragonruby.org]].~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Our Discord channel is [[http://discord.dragonruby.org]].~ -- Line's tilde count is: 0 -- Line contains link marker: true -- LINK detected. -** Processing line: ~The News Letter will keep you in the loop with regards to current DragonRuby Events: [[http://dragonrubydispatch.com]].~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The News Letter will keep you in the loop with regards to current DragonRuby Events: [[http://dragonrubydispatch.com]].~ -- Line's tilde count is: 0 -- Line contains link marker: true -- LINK detected. -** Processing line: ~Those who use DragonRuby are called Dragon Riders. This identity is incredibly important to us. When someone asks you:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Those who use DragonRuby are called Dragon Riders. This identity is incredibly important to us. When someone asks you:~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~#+begin_quote~ -- BLOCKQUOTE start detected. -** Processing line: ~What game engine do you use?~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~What game engine do you use?~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~#+end_quote~ -- BLOCKQUOTE end detected. -** Processing line: ~~ -** Processing line: ~Reply with:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Reply with:~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~#+begin_quote~ -- BLOCKQUOTE start detected. -** Processing line: ~I am a Dragon Rider.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~I am a Dragon Rider.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~#+end_quote~ -- BLOCKQUOTE end detected. -** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~* Watch Some Intro Videos~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Watch Some 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:~ -- 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:~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~1. Beginner Introduction to DragonRuby Game Toolkit: [[https://youtu.be/ixw7TJhU08E]]~ -- OL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Beginner Introduction to DragonRuby Game Toolkit: [[https://youtu.be/ixw7TJhU08E]]~ -- 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]]~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]]~ -- 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]]~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]]~ -- 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. -- 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.~ -- 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 does not appear to be a header. -- 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: ~* Getting Started Tutorial~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Getting Started Tutorial~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~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: [[https://en.wikipedia.org/wiki/Ryan_C._Gordon]]).~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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: [[https://en.wikipedia.org/wiki/Ryan_C._Gordon]]).~ -- Line's tilde count is: 0 -- Line contains link marker: true -- LINK detected. -** Processing line: ~~ -** Processing line: ~** Introduction~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Introduction~ -- 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: ~Introduction~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Welcome!~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Welcome!~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Here's just a little push to get you started if you're new to programming or game development.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Here's just a little push to get you started if you're new to programming or game development.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~If you want to write a game, it's no different than writing any other program for any other framework: there are a few simple rules that might be new to you, but more or less programming is programming no matter what you are building.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~If you want to write a game, it's no different than writing any other program for any other framework: there are a few simple rules that might be new to you, but more or less programming is programming no matter what you are building.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Did you not know that? Did you think you couldn't write a game because you're a "web guy" or you're writing Java at a desk job? Stop letting people tell you that you can't, because you already have everything you need.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Did you not know that? Did you think you couldn't write a game because you're a "web guy" or you're writing Java at a desk job? Stop letting people tell you that you can't, because you already have everything you need.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Here, we're going to be programming in a language called "Ruby." In the interest of full disclosure, I (Ryan Gordon) wrote the C parts of this toolkit and Ruby looks a little strange to me (Amir Rajan wrote the Ruby parts, discounting the parts I mangled), but I'm going to walk you through the basics because we're all learning together, and if you mostly think of yourself as someone that writes C (or C++, C#, Objective-C), PHP, or Java, then you're only a step behind me right now.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Here, we're going to be programming in a language called "Ruby." In the interest of full disclosure, I (Ryan Gordon) wrote the C parts of this toolkit and Ruby looks a little strange to me (Amir Rajan wrote the Ruby parts, discounting the parts I mangled), but I'm going to walk you through the basics because we're all learning together, and if you mostly think of yourself as someone that writes C (or C++, C#, Objective-C), PHP, or Java, then you're only a step behind me right now.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~** Prerequisites~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Prerequisites~ -- 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: ~Prerequisites~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Here's the most important thing you should know: Ruby lets you do some complicated things really easily, and you can learn that stuff later. I'm going to show you one or two cool tricks, but that's all.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Here's the most important thing you should know: Ruby lets you do some complicated things really easily, and you can learn that stuff later. I'm going to show you one or two cool tricks, but that's all.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Do you know what an if statement is? A for-loop? An array? That's all you'll need to start.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Do you know what an if statement is? A for-loop? An array? That's all you'll need to start.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~** The Game Loop~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~The Game Loop~ -- 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: ~The Game Loop~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Ok, here are few rules with regards to game development with GTK:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Ok, here are few rules with regards to game development with GTK:~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~- Your game is all going to happen under one function ...~ -- UL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Your game is all going to happen under one function ...~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~- that runs 60 times a second ...~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~that runs 60 times a second ...~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~- and has to tell the computer what to draw each time.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~and has to tell the computer what to draw each time.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~That's an entire video game in one run-on sentence.~ -- UL end detected. -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~That's an entire video game in one run-on sentence.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Here's that function. You're going to want to put this in mygame/app/main.rb, because that's where we'll look for it by default. Load it up in your favorite text editor.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Here's that function. You're going to want to put this in mygame/app/main.rb, because that's where we'll look for it by default. Load it up in your favorite text editor.~ -- 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: ~ args.outputs.labels << [580, 400, 'Hello World!']~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. -** Processing line: ~~ -** Processing line: ~Now run ~dragonruby~ ...did you get a window with "Hello World!" written in it? Good, you're officially a game developer!~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Now run ~dragonruby~ ...did you get a window with "Hello World!" written in it? Good, you're officially a game developer!~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~** Breakdown Of The ~tick~ Method~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Breakdown Of The ~tick~ Method~ -- 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: ~Breakdown Of The ~tick~ Method~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~~mygame/app/main.rb~, is where the Ruby source code is located. This looks a little strange, so I'll break it down line by line. In Ruby, a '#' character starts a single-line comment, so I'll talk about this inline.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~mygame/app/main.rb~, is where the Ruby source code is located. This looks a little strange, so I'll break it down line by line. In Ruby, a '#' character starts a single-line comment, so I'll talk about this inline.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # This "def"ines a function, named "tick," which takes a single argument~ -** Processing line: ~ # named "args". DragonRuby looks for this function and calls it every~ -** Processing line: ~ # frame, 60 times a second. "args" is a magic structure with lots of~ -** Processing line: ~ # information in it. You can set variables in there for your own game state,~ -** Processing line: ~ # and every frame it will updated if keys are pressed, joysticks moved,~ -** Processing line: ~ # mice clicked, etc.~ -** Processing line: ~ def tick args~ -** Processing line: ~~ -** Processing line: ~ # One of the things in "args" is the "outputs" object that your game uses~ -** Processing line: ~ # to draw things. Afraid of rendering APIs? No problem. In DragonRuby,~ -** Processing line: ~ # you use arrays to draw things and we figure out the details.~ -** Processing line: ~ # If you want to draw text on the screen, you give it an array (the thing~ -** Processing line: ~ # in the [ brackets ]), with an X and Y coordinate and the text to draw.~ -** Processing line: ~ # The "<<" thing says "append this array onto the list of them at~ -** Processing line: ~ # args.outputs.labels)~ -** Processing line: ~ args.outputs.labels << [580, 400, 'Hello World!']~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. -** Processing line: ~~ -** Processing line: ~Once your ~tick~ function finishes, we look at all the arrays you made and figure out how to draw it. You don't need to know about graphics APIs. You're just setting up some arrays! DragonRuby clears out these arrays every frame, so you just need to add what you need _right now_ each time.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Once your ~tick~ function finishes, we look at all the arrays you made and figure out how to draw it. You don't need to know about graphics APIs. You're just setting up some arrays! DragonRuby clears out these arrays every frame, so you just need to add what you need _right now_ each time.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~** Rendering A Sprite~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Rendering A Sprite~ -- 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~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Now let's spice this up a little.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Now let's spice this up a little.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~We're going to add some graphics. Each 2D image in DragonRuby is called a "sprite," and to use them, you just make sure they exist in a reasonable file format (png, jpg, gif, bmp, etc) and specify them by filename. The first time you use one, DragonRuby will load it and keep it in video memory for fast access in the future. If you use a filename that doesn't exist, you get a fun checkerboard pattern!~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~We're going to add some graphics. Each 2D image in DragonRuby is called a "sprite," and to use them, you just make sure they exist in a reasonable file format (png, jpg, gif, bmp, etc) and specify them by filename. The first time you use one, DragonRuby will load it and keep it in video memory for fast access in the future. If you use a filename that doesn't exist, you get a fun checkerboard pattern!~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~There's a "dragonruby.png" file included, just to get you started. Let's have it draw every frame with our text:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~There's a "dragonruby.png" file included, just to get you started. Let's have it draw every frame with our text:~ -- 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: ~ args.outputs.labels << [580, 400, 'Hello World!']~ -** Processing line: ~ args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png']~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. -** Processing line: ~~ -** Processing line: ~(Pro Tip: you don't have to restart DragonRuby to test your changes; when you save main.rb, DragonRuby will notice and reload your program.)~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~(Pro Tip: you don't have to restart DragonRuby to test your changes; when you save main.rb, DragonRuby will notice and reload your program.)~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~That ~.sprites~ line says "add a sprite to the list of sprites we're drawing, and draw it at position (576, 100) at a size of 128x101 pixels". You can find the image to draw at dragonruby.png.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~That ~.sprites~ line says "add a sprite to the list of sprites we're drawing, and draw it at position (576, 100) at a size of 128x101 pixels". You can find the image to draw at dragonruby.png.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~** Coordinate System and Virtual Canvas~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Coordinate System and Virtual Canvas~ -- 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: ~Coordinate System and Virtual Canvas~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Quick note about coordinates: (0, 0) is the bottom left corner of the screen, and positive numbers go up and to the right. This is more "geometrically correct," even if it's not how you remember doing 2D graphics, but we chose this for a simpler reason: when you're making Super Mario Brothers and you want Mario to jump, you should be able to add to Mario's y position as he goes up and subtract as he falls. It makes things easier to understand.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Quick note about coordinates: (0, 0) is the bottom left corner of the screen, and positive numbers go up and to the right. This is more "geometrically correct," even if it's not how you remember doing 2D graphics, but we chose this for a simpler reason: when you're making Super Mario Brothers and you want Mario to jump, you should be able to add to Mario's y position as he goes up and subtract as he falls. It makes things easier to understand.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Also: your game screen is _always_ 1280x720 pixels. If you resize the window, we will scale and letterbox everything appropriately, so you never have to worry about different resolutions.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Also: your game screen is _always_ 1280x720 pixels. If you resize the window, we will scale and letterbox everything appropriately, so you never have to worry about different resolutions.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Ok, now we have an image on the screen, let's animate it:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Ok, now we have an image on the screen, let's animate it:~ -- 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: ~ args.state.rotation ||= 0~ -** Processing line: ~ args.outputs.labels << [580, 400, 'Hello World!' ]~ -** Processing line: ~ args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png', args.state.rotation]~ -** Processing line: ~ args.state.rotation -= 1~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. -** Processing line: ~~ -** Processing line: ~Now you can see that this function is getting called a lot!~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Now you can see that this function is getting called a lot!~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~** Game State~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Game State~ -- 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: ~Game State~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Here's a fun Ruby thing: ~args.state.rotation ||= 0~ is shorthand for "if args.state.rotation isn't initialized, set it to zero." It's a nice way to embed your initialization code right next to where you need the variable.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Here's a fun Ruby thing: ~args.state.rotation ||= 0~ is shorthand for "if args.state.rotation isn't initialized, set it to zero." It's a nice way to embed your initialization code right next to where you need the variable.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~~args.state~ is a place you can hang your own data. It's an open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of class.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.state~ is a place you can hang your own data. It's an open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of class.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~In this case, the current rotation of our sprite, which is happily spinning at 60 frames per second. If you don't specify rotation (or alpha, or color modulation, or a source rectangle, etc), DragonRuby picks a reasonable default, and the array is ordered by the most likely things you need to tell us: position, size, name.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~In this case, the current rotation of our sprite, which is happily spinning at 60 frames per second. If you don't specify rotation (or alpha, or color modulation, or a source rectangle, etc), DragonRuby picks a reasonable default, and the array is ordered by the most likely things you need to tell us: position, size, name.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~** There Is No Delta Time~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~There Is No Delta Time~ -- 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: ~There Is No Delta Time~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~One thing we decided to do in DragonRuby is not make you worry about delta time: your function runs at 60 frames per second (about 16 milliseconds) and that's that. Having to worry about framerate is something massive triple-AAA games do, but for fun little 2D games? You'd have to work really hard to not hit 60fps. All your drawing is happening on a GPU designed to run Fortnite quickly; it can definitely handle this.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~One thing we decided to do in DragonRuby is not make you worry about delta time: your function runs at 60 frames per second (about 16 milliseconds) and that's that. Having to worry about framerate is something massive triple-AAA games do, but for fun little 2D games? You'd have to work really hard to not hit 60fps. All your drawing is happening on a GPU designed to run Fortnite quickly; it can definitely handle this.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Since we didn't make you worry about delta time, you can just move the rotation by 1 every time and it works without you having to keep track of time and math. Want it to move faster? Subtract 2.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Since we didn't make you worry about delta time, you can just move the rotation by 1 every time and it works without you having to keep track of time and math. Want it to move faster? Subtract 2.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~** Handling User Input~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Handling User Input~ -- 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: ~Handling User Input~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Now, let's move that image around.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Now, let's move that image around.~ -- 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: ~ args.state.rotation ||= 0~ -** Processing line: ~ args.state.x ||= 576~ -** Processing line: ~ args.state.y ||= 100~ -** Processing line: ~~ -** Processing line: ~ if args.inputs.mouse.click~ -** Processing line: ~ args.state.x = args.inputs.mouse.click.point.x - 64~ -** Processing line: ~ args.state.y = args.inputs.mouse.click.point.y - 50~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ args.outputs.labels << [580, 400, 'Hello World!']~ -** Processing line: ~ args.outputs.sprites << [args.state.x,~ -** Processing line: ~ args.state.y,~ -** Processing line: ~ 128,~ -** Processing line: ~ 101,~ -** Processing line: ~ 'dragonruby.png',~ -** Processing line: ~ args.state.rotation]~ -** Processing line: ~~ -** Processing line: ~ args.state.rotation -= 1~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. -** Processing line: ~~ -** Processing line: ~Everywhere you click your mouse, the image moves there. We set a default location for it with ~args.state.x ||= 576~, and then we change those variables when we see the mouse button in action. You can get at the keyboard and game controllers in similar ways.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Everywhere you click your mouse, the image moves there. We set a default location for it with ~args.state.x ||= 576~, and then we change those variables when we see the mouse button in action. You can get at the keyboard and game controllers in similar ways.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~** Coding On A Raspberry Pi~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Coding On A Raspberry Pi~ -- 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: ~Coding On A Raspberry Pi~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~We have only tested DragonRuby on a Raspberry Pi 3, Models B and B+, but we believe it _should_ work on any model with comparable specs.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~We have only tested DragonRuby on a Raspberry Pi 3, Models B and B+, but we believe it _should_ work on any model with comparable specs.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~If you're running DragonRuby Game Toolkit on a Raspberry Pi, or trying to run a game made with the Toolkit on a Raspberry Pi, and it's really really slow-- like one frame every few seconds--then there's likely a simple fix.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~If you're running DragonRuby Game Toolkit on a Raspberry Pi, or trying to run a game made with the Toolkit on a Raspberry Pi, and it's really really slow-- like one frame every few seconds--then there's likely a simple fix.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~You're probably running a desktop environment: menus, apps, web browsers, etc. This is okay! Launch the terminal app and type:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You're probably running a desktop environment: menus, apps, web browsers, etc. This is okay! Launch the terminal app and type:~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~sudo raspi-config~ -** Processing line: ~#+end_src~ -- PRE end detected. -** Processing line: ~~ -** Processing line: ~It'll ask you for your password (if you don't know, try "raspberry"), and then give you a menu of options. Find your way to "Advanced Options", then "GL Driver", and change this to "GL (Full KMS)" ... not "fake KMS," which is also listed there. Save and reboot. In theory, this should fix the problem.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~It'll ask you for your password (if you don't know, try "raspberry"), and then give you a menu of options. Find your way to "Advanced Options", then "GL Driver", and change this to "GL (Full KMS)" ... not "fake KMS," which is also listed there. Save and reboot. In theory, this should fix the problem.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~If you're _still_ having problems and have a Raspberry Pi 2 or better, go back to raspi-config and head over to "Advanced Options", "Memory split," and give the GPU 256 megabytes. You might be able to avoid this for simple games, as this takes RAM away from the system and reserves it for graphics. You can also try 128 megabytes as a gentler option.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~If you're _still_ having problems and have a Raspberry Pi 2 or better, go back to raspi-config and head over to "Advanced Options", "Memory split," and give the GPU 256 megabytes. You might be able to avoid this for simple games, as this takes RAM away from the system and reserves it for graphics. You can also try 128 megabytes as a gentler option.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Note that you can also run DragonRuby without X11 at all: if you run it from a virtual terminal it will render fullscreen and won't need the "Full KMS" option. This might be attractive if you want to use it as a game console sort of thing, or develop over ssh, or launch it from RetroPie, etc.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Note that you can also run DragonRuby without X11 at all: if you run it from a virtual terminal it will render fullscreen and won't need the "Full KMS" option. This might be attractive if you want to use it as a game console sort of thing, or develop over ssh, or launch it from RetroPie, etc.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~** Conclusion~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Conclusion~ -- 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: ~Conclusion~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~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 ~args.output~ anymore.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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 ~args.output~ anymore.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~* IMPORTANT: Go through all of the sample apps! Study them thoroughly!! No really, you should definitely do this!~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~IMPORTANT: Go through all of the sample apps! Study them thoroughly!! No really, you should definitely do this!~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Now that you've completed the Hello World tutorial. Head over to the `samples` directory. It is very very important that you study the sample apps thoroughly! Go through them in order. Here is a short description of each sample app.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Now that you've completed the Hello World tutorial. Head over to the `samples` directory. It is very very important that you study the sample apps thoroughly! Go through them in order. Here is a short description of each sample app.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~** Guided Samples~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Guided Samples~ -- 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: ~Guided Samples~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~1. ~samples/00_learn_ruby_optional~: This directory contains sample apps that will help you learn the language.~ -- OL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/00_learn_ruby_optional~: This directory contains sample apps that will help you learn the language.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~2. ~samples/01_rendering_basics~: This set of samples will show you how to render basic primitives such as ~labels~, ~solids~, ~borders~, ~lines~, ~sprites~, and how to play ~sounds~.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/01_rendering_basics~: This set of samples will show you how to render basic primitives such as ~labels~, ~solids~, ~borders~, ~lines~, ~sprites~, and how to play ~sounds~.~ -- Line's tilde count is: 14 -- Line contains link marker: false -- CODE detected. -** Processing line: ~3. ~samples/02_input_basics~: This set of samples show you how to accept input from the ~mouse~, ~keyboard~, and ~controllers~.~ + 6880,720,7040,660 +** Processing line: ~ 6720,700,6880,720~ +- Inside source: true +*** True Line Result + 6720,700,6880,720 +** Processing line: ~ 6540,700,6720,700~ +- Inside source: true +*** True Line Result + 6540,700,6720,700 +** Processing line: ~ 6420,760,6540,700~ +- Inside source: true +*** True Line Result + 6420,760,6540,700 +** Processing line: ~ 6280,740,6420,760~ +- Inside source: true +*** True Line Result + 6280,740,6420,760 +** Processing line: ~ 6240,760,6280,740~ +- Inside source: true +*** True Line Result + 6240,760,6280,740 +** Processing line: ~ 6200,920,6240,760~ +- Inside source: true +*** True Line Result + 6200,920,6240,760 +** Processing line: ~ 6200,920,6360,960~ +- Inside source: true +*** True Line Result + 6200,920,6360,960 +** Processing line: ~ 6360,960,6540,960~ +- Inside source: true +*** True Line Result + 6360,960,6540,960 +** Processing line: ~ 6540,960,6720,960~ +- Inside source: true +*** True Line Result + 6540,960,6720,960 +** Processing line: ~ 6720,960,6760,980~ +- Inside source: true +*** True Line Result + 6720,960,6760,980 +** Processing line: ~ 6760,980,6880,940~ +- Inside source: true +*** True Line Result + 6760,980,6880,940 +** Processing line: ~ 6880,940,7080,940~ +- Inside source: true +*** True Line Result + 6880,940,7080,940 +** Processing line: ~ 7080,940,7280,940~ +- Inside source: true +*** True Line Result + 7080,940,7280,940 +** Processing line: ~ 7280,940,7520,920~ +- Inside source: true +*** True Line Result + 7280,940,7520,920 +** Processing line: ~ 7520,920,7760,900~ +- Inside source: true +*** True Line Result + 7520,920,7760,900 +** Processing line: ~ 7760,900,7980,860~ +- Inside source: true +*** True Line Result + 7760,900,7980,860 +** Processing line: ~ 7980,860,8100,880~ +- Inside source: true +*** True Line Result + 7980,860,8100,880 +** Processing line: ~ 8100,880,8280,900~ +- Inside source: true +*** True Line Result + 8100,880,8280,900 +** Processing line: ~ 8280,900,8500,820~ +- Inside source: true +*** True Line Result + 8280,900,8500,820 +** Processing line: ~ 8500,820,8700,820~ +- Inside source: true +*** True Line Result + 8500,820,8700,820 +** Processing line: ~ 8700,820,8760,840~ +- Inside source: true +*** True Line Result + 8700,820,8760,840 +** Processing line: ~ 8760,960,8760,840~ +- Inside source: true +*** True Line Result + 8760,960,8760,840 +** Processing line: ~ 8700,1040,8760,960~ +- Inside source: true +*** True Line Result + 8700,1040,8760,960 +** Processing line: ~ 8560,1060,8700,1040~ +- Inside source: true +*** True Line Result + 8560,1060,8700,1040 +** Processing line: ~ 8460,1080,8560,1060~ +- Inside source: true +*** True Line Result + 8460,1080,8560,1060 +** Processing line: ~ 8360,1040,8460,1080~ +- Inside source: true +*** True Line Result + 8360,1040,8460,1080 +** Processing line: ~ 8280,1080,8360,1040~ +- Inside source: true +*** True Line Result + 8280,1080,8360,1040 +** Processing line: ~ 8160,1120,8280,1080~ +- Inside source: true +*** True Line Result + 8160,1120,8280,1080 +** Processing line: ~ 8040,1120,8160,1120~ +- Inside source: true +*** True Line Result + 8040,1120,8160,1120 +** Processing line: ~ 7940,1100,8040,1120~ +- Inside source: true +*** True Line Result + 7940,1100,8040,1120 +** Processing line: ~ 7800,1120,7940,1100~ +- Inside source: true +*** True Line Result + 7800,1120,7940,1100 +** Processing line: ~ 7680,1120,7800,1120~ +- Inside source: true +*** True Line Result + 7680,1120,7800,1120 +** Processing line: ~ 7520,1100,7680,1120~ +- Inside source: true +*** True Line Result + 7520,1100,7680,1120 +** Processing line: ~ 7360,1100,7520,1100~ +- Inside source: true +*** True Line Result + 7360,1100,7520,1100 +** Processing line: ~ 7200,1120,7360,1100~ +- Inside source: true +*** True Line Result + 7200,1120,7360,1100 +** Processing line: ~ 7040,1180,7200,1120~ +- Inside source: true +*** True Line Result + 7040,1180,7200,1120 +** Processing line: ~ 6880,1160,7040,1180~ +- Inside source: true +*** True Line Result + 6880,1160,7040,1180 +** Processing line: ~ 6720,1160,6880,1160~ +- Inside source: true +*** True Line Result + 6720,1160,6880,1160 +** Processing line: ~ 6540,1160,6720,1160~ +- Inside source: true +*** True Line Result + 6540,1160,6720,1160 +** Processing line: ~ 6360,1160,6540,1160~ +- Inside source: true +*** True Line Result + 6360,1160,6540,1160 +** Processing line: ~ 6200,1160,6360,1160~ +- Inside source: true +*** True Line Result + 6200,1160,6360,1160 +** Processing line: ~ 6040,1220,6200,1160~ +- Inside source: true +*** True Line Result + 6040,1220,6200,1160 +** Processing line: ~ 6040,1220,6040,1400~ +- Inside source: true +*** True Line Result + 6040,1220,6040,1400 +** Processing line: ~ 6040,1400,6200,1440~ +- Inside source: true +*** True Line Result + 6040,1400,6200,1440 +** Processing line: ~ 6200,1440,6320,1440~ +- Inside source: true +*** True Line Result + 6200,1440,6320,1440 +** Processing line: ~ 6320,1440,6440,1440~ +- Inside source: true +*** True Line Result + 6320,1440,6440,1440 +** Processing line: ~ 6600,1440,6760,1440~ +- Inside source: true +*** True Line Result + 6600,1440,6760,1440 +** Processing line: ~ 6760,1440,6940,1420~ +- Inside source: true +*** True Line Result + 6760,1440,6940,1420 +** Processing line: ~ 6440,1440,6600,1440~ +- Inside source: true +*** True Line Result + 6440,1440,6600,1440 +** Processing line: ~ 6940,1420,7280,1400~ +- Inside source: true +*** True Line Result + 6940,1420,7280,1400 +** Processing line: ~ 7280,1400,7560,1400~ +- Inside source: true +*** True Line Result + 7280,1400,7560,1400 +** Processing line: ~ 7560,1400,7760,1400~ +- Inside source: true +*** True Line Result + 7560,1400,7760,1400 +** Processing line: ~ 7760,1400,7940,1360~ +- Inside source: true +*** True Line Result + 7760,1400,7940,1360 +** Processing line: ~ 7940,1360,8100,1380~ +- Inside source: true +*** True Line Result + 7940,1360,8100,1380 +** Processing line: ~ 8100,1380,8280,1340~ +- Inside source: true +*** True Line Result + 8100,1380,8280,1340 +** Processing line: ~ 8280,1340,8460,1320~ +- Inside source: true +*** True Line Result + 8280,1340,8460,1320 +** Processing line: ~ 8660,1300,8760,1360~ +- Inside source: true +*** True Line Result + 8660,1300,8760,1360 +** Processing line: ~ 8460,1320,8660,1300~ +- Inside source: true +*** True Line Result + 8460,1320,8660,1300 +** Processing line: ~ 8760,1360,8800,1500~ +- Inside source: true +*** True Line Result + 8760,1360,8800,1500 +** Processing line: ~ 8800,1660,8800,1500~ +- Inside source: true +*** True Line Result + 8800,1660,8800,1500 +** Processing line: ~ 8800,1660,8800,1820~ +- Inside source: true +*** True Line Result + 8800,1660,8800,1820 +** Processing line: ~ 8700,1840,8800,1820~ +- Inside source: true +*** True Line Result + 8700,1840,8800,1820 +** Processing line: ~ 8620,1860,8700,1840~ +- Inside source: true +*** True Line Result + 8620,1860,8700,1840 +** Processing line: ~ 8560,1800,8620,1860~ +- Inside source: true +*** True Line Result + 8560,1800,8620,1860 +** Processing line: ~ 8560,1800,8620,1680~ +- Inside source: true +*** True Line Result + 8560,1800,8620,1680 +** Processing line: ~ 8500,1640,8620,1680~ +- Inside source: true +*** True Line Result + 8500,1640,8620,1680 +** Processing line: ~ 8420,1680,8500,1640~ +- Inside source: true +*** True Line Result + 8420,1680,8500,1640 +** Processing line: ~ 8280,1680,8420,1680~ +- Inside source: true +*** True Line Result + 8280,1680,8420,1680 +** Processing line: ~ 8160,1680,8280,1680~ +- Inside source: true +*** True Line Result + 8160,1680,8280,1680 +** Processing line: ~ 7900,1680,8160,1680~ +- Inside source: true +*** True Line Result + 7900,1680,8160,1680 +** Processing line: ~ 7680,1680,7900,1680~ +- Inside source: true +*** True Line Result + 7680,1680,7900,1680 +** Processing line: ~ 7400,1660,7680,1680~ +- Inside source: true +*** True Line Result + 7400,1660,7680,1680 +** Processing line: ~ 7140,1680,7400,1660~ +- Inside source: true +*** True Line Result + 7140,1680,7400,1660 +** Processing line: ~ 6880,1640,7140,1680~ +- Inside source: true +*** True Line Result + 6880,1640,7140,1680 +** Processing line: ~ 6040,1820,6320,1780~ +- Inside source: true +*** True Line Result + 6040,1820,6320,1780 +** Processing line: ~ 5900,1840,6040,1820~ +- Inside source: true +*** True Line Result + 5900,1840,6040,1820 +** Processing line: ~ 6640,1700,6880,1640~ +- Inside source: true +*** True Line Result + 6640,1700,6880,1640 +** Processing line: ~ 6320,1780,6640,1700~ +- Inside source: true +*** True Line Result + 6320,1780,6640,1700 +** Processing line: ~ 5840,2040,5900,1840~ +- Inside source: true +*** True Line Result + 5840,2040,5900,1840 +** Processing line: ~ 5840,2040,5840,2220~ +- Inside source: true +*** True Line Result + 5840,2040,5840,2220 +** Processing line: ~ 5840,2220,5840,2320~ +- Inside source: true +*** True Line Result + 5840,2220,5840,2320 +** Processing line: ~ 5840,2460,5840,2320~ +- Inside source: true +*** True Line Result + 5840,2460,5840,2320 +** Processing line: ~ 5840,2560,5840,2460~ +- Inside source: true +*** True Line Result + 5840,2560,5840,2460 +** Processing line: ~ 5840,2560,5960,2620~ +- Inside source: true +*** True Line Result + 5840,2560,5960,2620 +** Processing line: ~ 5960,2620,6200,2620~ +- Inside source: true +*** True Line Result + 5960,2620,6200,2620 +** Processing line: ~ 6200,2620,6380,2600~ +- Inside source: true +*** True Line Result + 6200,2620,6380,2600 +** Processing line: ~ 6380,2600,6600,2580~ +- Inside source: true +*** True Line Result + 6380,2600,6600,2580 +** Processing line: ~ 6600,2580,6800,2600~ +- Inside source: true +*** True Line Result + 6600,2580,6800,2600 +** Processing line: ~ 6800,2600,7040,2580~ +- Inside source: true +*** True Line Result + 6800,2600,7040,2580 +** Processing line: ~ 7040,2580,7280,2580~ +- Inside source: true +*** True Line Result + 7040,2580,7280,2580 +** Processing line: ~ 7280,2580,7480,2560~ +- Inside source: true +*** True Line Result + 7280,2580,7480,2560 +** Processing line: ~ 7760,2540,7980,2520~ +- Inside source: true +*** True Line Result + 7760,2540,7980,2520 +** Processing line: ~ 7980,2520,8160,2500~ +- Inside source: true +*** True Line Result + 7980,2520,8160,2500 +** Processing line: ~ 7480,2560,7760,2540~ +- Inside source: true +*** True Line Result + 7480,2560,7760,2540 +** Processing line: ~ 8160,2500,8160,2420~ +- Inside source: true +*** True Line Result + 8160,2500,8160,2420 +** Processing line: ~ 8160,2420,8160,2320~ +- Inside source: true +*** True Line Result + 8160,2420,8160,2320 +** Processing line: ~ 8160,2180,8160,2320~ +- Inside source: true +*** True Line Result + 8160,2180,8160,2320 +** Processing line: ~ 7980,2160,8160,2180~ +- Inside source: true +*** True Line Result + 7980,2160,8160,2180 +** Processing line: ~ 7800,2180,7980,2160~ +- Inside source: true +*** True Line Result + 7800,2180,7980,2160 +** Processing line: ~ 7600,2200,7800,2180~ +- Inside source: true +*** True Line Result + 7600,2200,7800,2180 +** Processing line: ~ 7400,2200,7600,2200~ +- Inside source: true +*** True Line Result + 7400,2200,7600,2200 +** Processing line: ~ 6960,2200,7200,2200~ +- Inside source: true +*** True Line Result + 6960,2200,7200,2200 +** Processing line: ~ 7200,2200,7400,2200~ +- Inside source: true +*** True Line Result + 7200,2200,7400,2200 +** Processing line: ~ 6720,2200,6960,2200~ +- Inside source: true +*** True Line Result + 6720,2200,6960,2200 +** Processing line: ~ 6540,2180,6720,2200~ +- Inside source: true +*** True Line Result + 6540,2180,6720,2200 +** Processing line: ~ 6320,2200,6540,2180~ +- Inside source: true +*** True Line Result + 6320,2200,6540,2180 +** Processing line: ~ 6240,2160,6320,2200~ +- Inside source: true +*** True Line Result + 6240,2160,6320,2200 +** Processing line: ~ 6240,2160,6240,2040~ +- Inside source: true +*** True Line Result + 6240,2160,6240,2040 +** Processing line: ~ 6240,2040,6240,1940~ +- Inside source: true +*** True Line Result + 6240,2040,6240,1940 +** Processing line: ~ 6240,1940,6440,1940~ +- Inside source: true +*** True Line Result + 6240,1940,6440,1940 +** Processing line: ~ 6440,1940,6720,1940~ +- Inside source: true +*** True Line Result + 6440,1940,6720,1940 +** Processing line: ~ 6720,1940,6940,1920~ +- Inside source: true +*** True Line Result + 6720,1940,6940,1920 +** Processing line: ~ 7520,1920,7760,1920~ +- Inside source: true +*** True Line Result + 7520,1920,7760,1920 +** Processing line: ~ 6940,1920,7280,1920~ +- Inside source: true +*** True Line Result + 6940,1920,7280,1920 +** Processing line: ~ 7280,1920,7520,1920~ +- Inside source: true +*** True Line Result + 7280,1920,7520,1920 +** Processing line: ~ 7760,1920,8100,1900~ +- Inside source: true +*** True Line Result + 7760,1920,8100,1900 +** Processing line: ~ 8100,1900,8420,1900~ +- Inside source: true +*** True Line Result + 8100,1900,8420,1900 +** Processing line: ~ 8420,1900,8460,1940~ +- Inside source: true +*** True Line Result + 8420,1900,8460,1940 +** Processing line: ~ 8460,2120,8460,1940~ +- Inside source: true +*** True Line Result + 8460,2120,8460,1940 +** Processing line: ~ 8460,2280,8460,2120~ +- Inside source: true +*** True Line Result + 8460,2280,8460,2120 +** Processing line: ~ 8460,2280,8560,2420~ +- Inside source: true +*** True Line Result + 8460,2280,8560,2420 +** Processing line: ~ 8560,2420,8660,2380~ +- Inside source: true +*** True Line Result + 8560,2420,8660,2380 +** Processing line: ~ 8660,2380,8800,2340~ +- Inside source: true +*** True Line Result + 8660,2380,8800,2340 +** Processing line: ~ 8800,2340,8840,2400~ +- Inside source: true +*** True Line Result + 8800,2340,8840,2400 +** Processing line: ~ 8840,2520,8840,2400~ +- Inside source: true +*** True Line Result + 8840,2520,8840,2400 +** Processing line: ~ 8800,2620,8840,2520~ +- Inside source: true +*** True Line Result + 8800,2620,8840,2520 +** Processing line: ~ 8800,2740,8800,2620~ +- Inside source: true +*** True Line Result + 8800,2740,8800,2620 +** Processing line: ~ 8800,2860,8800,2740~ +- Inside source: true +*** True Line Result + 8800,2860,8800,2740 +** Processing line: ~ 8800,2940,8800,2860~ +- Inside source: true +*** True Line Result + 8800,2940,8800,2860 +** Processing line: ~ 8760,2980,8800,2940~ +- Inside source: true +*** True Line Result + 8760,2980,8800,2940 +** Processing line: ~ 8660,2980,8760,2980~ +- Inside source: true +*** True Line Result + 8660,2980,8760,2980 +** Processing line: ~ 8620,2960,8660,2980~ +- Inside source: true +*** True Line Result + 8620,2960,8660,2980 +** Processing line: ~ 8560,2880,8620,2960~ +- Inside source: true +*** True Line Result + 8560,2880,8620,2960 +** Processing line: ~ 8560,2880,8560,2780~ +- Inside source: true +*** True Line Result + 8560,2880,8560,2780 +** Processing line: ~ 8500,2740,8560,2780~ +- Inside source: true +*** True Line Result + 8500,2740,8560,2780 +** Processing line: ~ 8420,2760,8500,2740~ +- Inside source: true +*** True Line Result + 8420,2760,8500,2740 +** Processing line: ~ 8420,2840,8420,2760~ +- Inside source: true +*** True Line Result + 8420,2840,8420,2760 +** Processing line: ~ 8420,2840,8420,2940~ +- Inside source: true +*** True Line Result + 8420,2840,8420,2940 +** Processing line: ~ 8420,3040,8420,2940~ +- Inside source: true +*** True Line Result + 8420,3040,8420,2940 +** Processing line: ~ 8420,3160,8420,3040~ +- Inside source: true +*** True Line Result + 8420,3160,8420,3040 +** Processing line: ~ 8420,3280,8420,3380~ +- Inside source: true +*** True Line Result + 8420,3280,8420,3380 +** Processing line: ~ 8420,3280,8420,3160~ +- Inside source: true +*** True Line Result + 8420,3280,8420,3160 +** Processing line: ~ 8420,3380,8620,3460~ +- Inside source: true +*** True Line Result + 8420,3380,8620,3460 +** Processing line: ~ 8620,3460,8760,3460~ +- Inside source: true +*** True Line Result + 8620,3460,8760,3460 +** Processing line: ~ 8760,3460,8840,3400~ +- Inside source: true +*** True Line Result + 8760,3460,8840,3400 +** Processing line: ~ 8840,3400,8960,3400~ +- Inside source: true +*** True Line Result + 8840,3400,8960,3400 +** Processing line: ~ 8960,3400,9000,3500~ +- Inside source: true +*** True Line Result + 8960,3400,9000,3500 +** Processing line: ~ 9000,3700,9000,3500~ +- Inside source: true +*** True Line Result + 9000,3700,9000,3500 +** Processing line: ~ 9000,3900,9000,3700~ +- Inside source: true +*** True Line Result + 9000,3900,9000,3700 +** Processing line: ~ 9000,4080,9000,3900~ +- Inside source: true +*** True Line Result + 9000,4080,9000,3900 +** Processing line: ~ 9000,4280,9000,4080~ +- Inside source: true +*** True Line Result + 9000,4280,9000,4080 +** Processing line: ~ 9000,4500,9000,4280~ +- Inside source: true +*** True Line Result + 9000,4500,9000,4280 +** Processing line: ~ 9000,4620,9000,4500~ +- Inside source: true +*** True Line Result + 9000,4620,9000,4500 +** Processing line: ~ 9000,4780,9000,4620~ +- Inside source: true +*** True Line Result + 9000,4780,9000,4620 +** Processing line: ~ 9000,4780,9000,4960~ +- Inside source: true +*** True Line Result + 9000,4780,9000,4960 +** Processing line: ~ 9000,5120,9000,4960~ +- Inside source: true +*** True Line Result + 9000,5120,9000,4960 +** Processing line: ~ 9000,5120,9000,5300~ +- Inside source: true +*** True Line Result + 9000,5120,9000,5300 +** Processing line: ~ 8960,5460,9000,5300~ +- Inside source: true +*** True Line Result + 8960,5460,9000,5300 +** Processing line: ~ 8920,5620,8960,5460~ +- Inside source: true +*** True Line Result + 8920,5620,8960,5460 +** Processing line: ~ 8920,5620,8920,5800~ +- Inside source: true +*** True Line Result + 8920,5620,8920,5800 +** Processing line: ~ 8920,5800,8920,5960~ +- Inside source: true +*** True Line Result + 8920,5800,8920,5960 +** Processing line: ~ 8920,5960,8920,6120~ +- Inside source: true +*** True Line Result + 8920,5960,8920,6120 +** Processing line: ~ 8920,6120,8960,6300~ +- Inside source: true +*** True Line Result + 8920,6120,8960,6300 +** Processing line: ~ 8960,6300,8960,6480~ +- Inside source: true +*** True Line Result + 8960,6300,8960,6480 +** Processing line: ~ 8960,6660,8960,6480~ +- Inside source: true +*** True Line Result + 8960,6660,8960,6480 +** Processing line: ~ 8960,6860,8960,6660~ +- Inside source: true +*** True Line Result + 8960,6860,8960,6660 +** Processing line: ~ 8960,7040,8960,6860~ +- Inside source: true +*** True Line Result + 8960,7040,8960,6860 +** Processing line: ~ 8920,7420,8920,7220~ +- Inside source: true +*** True Line Result + 8920,7420,8920,7220 +** Processing line: ~ 8920,7420,8960,7620~ +- Inside source: true +*** True Line Result + 8920,7420,8960,7620 +** Processing line: ~ 8960,7620,8960,7800~ +- Inside source: true +*** True Line Result + 8960,7620,8960,7800 +** Processing line: ~ 8960,7800,8960,8000~ +- Inside source: true +*** True Line Result + 8960,7800,8960,8000 +** Processing line: ~ 8960,8000,8960,8180~ +- Inside source: true +*** True Line Result + 8960,8000,8960,8180 +** Processing line: ~ 8960,8180,8960,8380~ +- Inside source: true +*** True Line Result + 8960,8180,8960,8380 +** Processing line: ~ 8960,8580,8960,8380~ +- Inside source: true +*** True Line Result + 8960,8580,8960,8380 +** Processing line: ~ 8920,8800,8960,8580~ +- Inside source: true +*** True Line Result + 8920,8800,8960,8580 +** Processing line: ~ 8880,9000,8920,8800~ +- Inside source: true +*** True Line Result + 8880,9000,8920,8800 +** Processing line: ~ 8840,9180,8880,9000~ +- Inside source: true +*** True Line Result + 8840,9180,8880,9000 +** Processing line: ~ 8800,9220,8840,9180~ +- Inside source: true +*** True Line Result + 8800,9220,8840,9180 +** Processing line: ~ 8800,9220,8840,9340~ +- Inside source: true +*** True Line Result + 8800,9220,8840,9340 +** Processing line: ~ 8760,9380,8840,9340~ +- Inside source: true +*** True Line Result + 8760,9380,8840,9340 +** Processing line: ~ 8560,9340,8760,9380~ +- Inside source: true +*** True Line Result + 8560,9340,8760,9380 +** Processing line: ~ 8360,9360,8560,9340~ +- Inside source: true +*** True Line Result + 8360,9360,8560,9340 +** Processing line: ~ 8160,9360,8360,9360~ +- Inside source: true +*** True Line Result + 8160,9360,8360,9360 +** Processing line: ~ 8040,9340,8160,9360~ +- Inside source: true +*** True Line Result + 8040,9340,8160,9360 +** Processing line: ~ 7860,9360,8040,9340~ +- Inside source: true +*** True Line Result + 7860,9360,8040,9340 +** Processing line: ~ 7680,9360,7860,9360~ +- Inside source: true +*** True Line Result + 7680,9360,7860,9360 +** Processing line: ~ 7520,9360,7680,9360~ +- Inside source: true +*** True Line Result + 7520,9360,7680,9360 +** Processing line: ~ 7420,9260,7520,9360~ +- Inside source: true +*** True Line Result + 7420,9260,7520,9360 +** Processing line: ~ 7400,9080,7420,9260~ +- Inside source: true +*** True Line Result + 7400,9080,7420,9260 +** Processing line: ~ 7400,9080,7420,8860~ +- Inside source: true +*** True Line Result + 7400,9080,7420,8860 +** Processing line: ~ 7420,8860,7440,8720~ +- Inside source: true +*** True Line Result + 7420,8860,7440,8720 +** Processing line: ~ 7440,8720,7480,8660~ +- Inside source: true +*** True Line Result + 7440,8720,7480,8660 +** Processing line: ~ 7480,8660,7520,8540~ +- Inside source: true +*** True Line Result + 7480,8660,7520,8540 +** Processing line: ~ 7520,8540,7600,8460~ +- Inside source: true +*** True Line Result + 7520,8540,7600,8460 +** Processing line: ~ 7600,8460,7800,8480~ +- Inside source: true +*** True Line Result + 7600,8460,7800,8480 +** Processing line: ~ 7800,8480,8040,8480~ +- Inside source: true +*** True Line Result + 7800,8480,8040,8480 +** Processing line: ~ 8040,8480,8280,8480~ +- Inside source: true +*** True Line Result + 8040,8480,8280,8480 +** Processing line: ~ 8280,8480,8500,8460~ +- Inside source: true +*** True Line Result + 8280,8480,8500,8460 +** Processing line: ~ 8500,8460,8620,8440~ +- Inside source: true +*** True Line Result + 8500,8460,8620,8440 +** Processing line: ~ 8620,8440,8660,8340~ +- Inside source: true +*** True Line Result + 8620,8440,8660,8340 +** Processing line: ~ 8660,8340,8660,8220~ +- Inside source: true +*** True Line Result + 8660,8340,8660,8220 +** Processing line: ~ 8660,8220,8700,8080~ +- Inside source: true +*** True Line Result + 8660,8220,8700,8080 +** Processing line: ~ 8700,8080,8700,7920~ +- Inside source: true +*** True Line Result + 8700,8080,8700,7920 +** Processing line: ~ 8700,7920,8700,7760~ +- Inside source: true +*** True Line Result + 8700,7920,8700,7760 +** Processing line: ~ 8700,7760,8700,7620~ +- Inside source: true +*** True Line Result + 8700,7760,8700,7620 +** Processing line: ~ 8700,7480,8700,7620~ +- Inside source: true +*** True Line Result + 8700,7480,8700,7620 +** Processing line: ~ 8700,7480,8700,7320~ +- Inside source: true +*** True Line Result + 8700,7480,8700,7320 +** Processing line: ~ 8700,7160,8700,7320~ +- Inside source: true +*** True Line Result + 8700,7160,8700,7320 +** Processing line: ~ 8920,7220,8960,7040~ +- Inside source: true +*** True Line Result + 8920,7220,8960,7040 +** Processing line: ~ 8660,7040,8700,7160~ +- Inside source: true +*** True Line Result + 8660,7040,8700,7160 +** Processing line: ~ 8660,7040,8700,6880~ +- Inside source: true +*** True Line Result + 8660,7040,8700,6880 +** Processing line: ~ 8660,6700,8700,6880~ +- Inside source: true +*** True Line Result + 8660,6700,8700,6880 +** Processing line: ~ 8660,6700,8700,6580~ +- Inside source: true +*** True Line Result + 8660,6700,8700,6580 +** Processing line: ~ 8700,6460,8700,6580~ +- Inside source: true +*** True Line Result + 8700,6460,8700,6580 +** Processing line: ~ 8700,6460,8700,6320~ +- Inside source: true +*** True Line Result + 8700,6460,8700,6320 +** Processing line: ~ 8700,6160,8700,6320~ +- Inside source: true +*** True Line Result + 8700,6160,8700,6320 +** Processing line: ~ 8700,6160,8760,6020~ +- Inside source: true +*** True Line Result + 8700,6160,8760,6020 +** Processing line: ~ 8760,6020,8760,5860~ +- Inside source: true +*** True Line Result + 8760,6020,8760,5860 +** Processing line: ~ 8760,5860,8760,5700~ +- Inside source: true +*** True Line Result + 8760,5860,8760,5700 +** Processing line: ~ 8760,5700,8760,5540~ +- Inside source: true +*** True Line Result + 8760,5700,8760,5540 +** Processing line: ~ 8760,5540,8760,5360~ +- Inside source: true +*** True Line Result + 8760,5540,8760,5360 +** Processing line: ~ 8760,5360,8760,5180~ +- Inside source: true +*** True Line Result + 8760,5360,8760,5180 +** Processing line: ~ 8760,5000,8760,5180~ +- Inside source: true +*** True Line Result + 8760,5000,8760,5180 +** Processing line: ~ 8700,4820,8760,5000~ +- Inside source: true +*** True Line Result + 8700,4820,8760,5000 +** Processing line: ~ 8560,4740,8700,4820~ +- Inside source: true +*** True Line Result + 8560,4740,8700,4820 +** Processing line: ~ 8420,4700,8560,4740~ +- Inside source: true +*** True Line Result + 8420,4700,8560,4740 +** Processing line: ~ 8280,4700,8420,4700~ +- Inside source: true +*** True Line Result + 8280,4700,8420,4700 +** Processing line: ~ 8100,4700,8280,4700~ +- Inside source: true +*** True Line Result + 8100,4700,8280,4700 +** Processing line: ~ 7980,4700,8100,4700~ +- Inside source: true +*** True Line Result + 7980,4700,8100,4700 +** Processing line: ~ 7820,4740,7980,4700~ +- Inside source: true +*** True Line Result + 7820,4740,7980,4700 +** Processing line: ~ 7800,4920,7820,4740~ +- Inside source: true +*** True Line Result + 7800,4920,7820,4740 +** Processing line: ~ 7800,4920,7900,4960~ +- Inside source: true +*** True Line Result + 7800,4920,7900,4960 +** Processing line: ~ 7900,4960,8060,4980~ +- Inside source: true +*** True Line Result + 7900,4960,8060,4980 +** Processing line: ~ 8060,4980,8220,5000~ +- Inside source: true +*** True Line Result + 8060,4980,8220,5000 +** Processing line: ~ 8220,5000,8420,5040~ +- Inside source: true +*** True Line Result + 8220,5000,8420,5040 +** Processing line: ~ 8420,5040,8460,5120~ +- Inside source: true +*** True Line Result + 8420,5040,8460,5120 +** Processing line: ~ 8460,5180,8460,5120~ +- Inside source: true +*** True Line Result + 8460,5180,8460,5120 +** Processing line: ~ 8360,5200,8460,5180~ +- Inside source: true +*** True Line Result + 8360,5200,8460,5180 +** Processing line: ~ 8360,5280,8360,5200~ +- Inside source: true +*** True Line Result + 8360,5280,8360,5200 +** Processing line: ~ 8160,5300,8360,5280~ +- Inside source: true +*** True Line Result + 8160,5300,8360,5280 +** Processing line: ~ 8040,5260,8160,5300~ +- Inside source: true +*** True Line Result + 8040,5260,8160,5300 +** Processing line: ~ 7860,5220,8040,5260~ +- Inside source: true +*** True Line Result + 7860,5220,8040,5260 +** Processing line: ~ 7720,5160,7860,5220~ +- Inside source: true +*** True Line Result + 7720,5160,7860,5220 +** Processing line: ~ 7640,5120,7720,5160~ +- Inside source: true +*** True Line Result + 7640,5120,7720,5160 +** Processing line: ~ 7480,5120,7640,5120~ +- Inside source: true +*** True Line Result + 7480,5120,7640,5120 +** Processing line: ~ 7240,5120,7480,5120~ +- Inside source: true +*** True Line Result + 7240,5120,7480,5120 +** Processing line: ~ 7000,5120,7240,5120~ +- Inside source: true +*** True Line Result + 7000,5120,7240,5120 +** Processing line: ~ 6800,5160,7000,5120~ +- Inside source: true +*** True Line Result + 6800,5160,7000,5120 +** Processing line: ~ 6640,5220,6800,5160~ +- Inside source: true +*** True Line Result + 6640,5220,6800,5160 +** Processing line: ~ 6600,5360,6640,5220~ +- Inside source: true +*** True Line Result + 6600,5360,6640,5220 +** Processing line: ~ 6600,5460,6600,5360~ +- Inside source: true +*** True Line Result + 6600,5460,6600,5360 +** Processing line: ~ 6480,5520,6600,5460~ +- Inside source: true +*** True Line Result + 6480,5520,6600,5460 +** Processing line: ~ 6240,5540,6480,5520~ +- Inside source: true +*** True Line Result + 6240,5540,6480,5520 +** Processing line: ~ 5980,5540,6240,5540~ +- Inside source: true +*** True Line Result + 5980,5540,6240,5540 +** Processing line: ~ 5740,5540,5980,5540~ +- Inside source: true +*** True Line Result + 5740,5540,5980,5540 +** Processing line: ~ 5500,5520,5740,5540~ +- Inside source: true +*** True Line Result + 5500,5520,5740,5540 +** Processing line: ~ 5400,5520,5500,5520~ +- Inside source: true +*** True Line Result + 5400,5520,5500,5520 +** Processing line: ~ 5280,5540,5400,5520~ +- Inside source: true +*** True Line Result + 5280,5540,5400,5520 +** Processing line: ~ 5080,5540,5280,5540~ +- Inside source: true +*** True Line Result + 5080,5540,5280,5540 +** Processing line: ~ 4940,5540,5080,5540~ +- Inside source: true +*** True Line Result + 4940,5540,5080,5540 +** Processing line: ~ 4760,5540,4940,5540~ +- Inside source: true +*** True Line Result + 4760,5540,4940,5540 +** Processing line: ~ 4600,5540,4760,5540~ +- Inside source: true +*** True Line Result + 4600,5540,4760,5540 +** Processing line: ~ 4440,5560,4600,5540~ +- Inside source: true +*** True Line Result + 4440,5560,4600,5540 +** Processing line: ~ 4040,5580,4120,5520~ +- Inside source: true +*** True Line Result + 4040,5580,4120,5520 +** Processing line: ~ 4260,5540,4440,5560~ +- Inside source: true +*** True Line Result + 4260,5540,4440,5560 +** Processing line: ~ 4120,5520,4260,5540~ +- Inside source: true +*** True Line Result + 4120,5520,4260,5540 +** Processing line: ~ 4020,5720,4040,5580~ +- Inside source: true +*** True Line Result + 4020,5720,4040,5580 +** Processing line: ~ 4020,5840,4020,5720~ +- Inside source: true +*** True Line Result + 4020,5840,4020,5720 +** Processing line: ~ 4020,5840,4080,5940~ +- Inside source: true +*** True Line Result + 4020,5840,4080,5940 +** Processing line: ~ 4080,5940,4120,6040~ +- Inside source: true +*** True Line Result + 4080,5940,4120,6040 +** Processing line: ~ 4120,6040,4200,6080~ +- Inside source: true +*** True Line Result + 4120,6040,4200,6080 +** Processing line: ~ 4200,6080,4340,6080~ +- Inside source: true +*** True Line Result + 4200,6080,4340,6080 +** Processing line: ~ 4340,6080,4500,6060~ +- Inside source: true +*** True Line Result + 4340,6080,4500,6060 +** Processing line: ~ 4500,6060,4700,6060~ +- Inside source: true +*** True Line Result + 4500,6060,4700,6060 +** Processing line: ~ 4700,6060,4880,6060~ +- Inside source: true +*** True Line Result + 4700,6060,4880,6060 +** Processing line: ~ 4880,6060,5080,6060~ +- Inside source: true +*** True Line Result + 4880,6060,5080,6060 +** Processing line: ~ 5080,6060,5280,6080~ +- Inside source: true +*** True Line Result + 5080,6060,5280,6080 +** Processing line: ~ 5280,6080,5440,6100~ +- Inside source: true +*** True Line Result + 5280,6080,5440,6100 +** Processing line: ~ 5440,6100,5660,6100~ +- Inside source: true +*** True Line Result + 5440,6100,5660,6100 +** Processing line: ~ 5660,6100,5900,6080~ +- Inside source: true +*** True Line Result + 5660,6100,5900,6080 +** Processing line: ~ 5900,6080,6120,6080~ +- Inside source: true +*** True Line Result + 5900,6080,6120,6080 +** Processing line: ~ 6120,6080,6360,6080~ +- Inside source: true +*** True Line Result + 6120,6080,6360,6080 +** Processing line: ~ 6360,6080,6480,6100~ +- Inside source: true +*** True Line Result + 6360,6080,6480,6100 +** Processing line: ~ 6480,6100,6540,6060~ +- Inside source: true +*** True Line Result + 6480,6100,6540,6060 +** Processing line: ~ 6540,6060,6720,6060~ +- Inside source: true +*** True Line Result + 6540,6060,6720,6060 +** Processing line: ~ 6720,6060,6940,6060~ +- Inside source: true +*** True Line Result + 6720,6060,6940,6060 +** Processing line: ~ 6940,6060,7140,6060~ +- Inside source: true +*** True Line Result + 6940,6060,7140,6060 +** Processing line: ~ 7400,6060,7600,6060~ +- Inside source: true +*** True Line Result + 7400,6060,7600,6060 +** Processing line: ~ 7140,6060,7400,6060~ +- Inside source: true +*** True Line Result + 7140,6060,7400,6060 +** Processing line: ~ 7600,6060,7800,6060~ +- Inside source: true +*** True Line Result + 7600,6060,7800,6060 +** Processing line: ~ 7800,6060,7860,6080~ +- Inside source: true +*** True Line Result + 7800,6060,7860,6080 +** Processing line: ~ 7860,6080,8060,6080~ +- Inside source: true +*** True Line Result + 7860,6080,8060,6080 +** Processing line: ~ 8060,6080,8220,6080~ +- Inside source: true +*** True Line Result + 8060,6080,8220,6080 +** Processing line: ~ 8220,6080,8320,6140~ +- Inside source: true +*** True Line Result + 8220,6080,8320,6140 +** Processing line: ~ 8320,6140,8360,6300~ +- Inside source: true +*** True Line Result + 8320,6140,8360,6300 +** Processing line: ~ 8320,6460,8360,6300~ +- Inside source: true +*** True Line Result + 8320,6460,8360,6300 +** Processing line: ~ 8320,6620,8320,6460~ +- Inside source: true +*** True Line Result + 8320,6620,8320,6460 +** Processing line: ~ 8320,6800,8320,6620~ +- Inside source: true +*** True Line Result + 8320,6800,8320,6620 +** Processing line: ~ 8320,6960,8320,6800~ +- Inside source: true +*** True Line Result + 8320,6960,8320,6800 +** Processing line: ~ 8320,6960,8360,7120~ +- Inside source: true +*** True Line Result + 8320,6960,8360,7120 +** Processing line: ~ 8320,7280,8360,7120~ +- Inside source: true +*** True Line Result + 8320,7280,8360,7120 +** Processing line: ~ 8320,7440,8320,7280~ +- Inside source: true +*** True Line Result + 8320,7440,8320,7280 +** Processing line: ~ 8320,7600,8320,7440~ +- Inside source: true +*** True Line Result + 8320,7600,8320,7440 +** Processing line: ~ 8100,7580,8220,7600~ +- Inside source: true +*** True Line Result + 8100,7580,8220,7600 +** Processing line: ~ 8220,7600,8320,7600~ +- Inside source: true +*** True Line Result + 8220,7600,8320,7600 +** Processing line: ~ 7900,7560,8100,7580~ +- Inside source: true +*** True Line Result + 7900,7560,8100,7580 +** Processing line: ~ 7680,7560,7900,7560~ +- Inside source: true +*** True Line Result + 7680,7560,7900,7560 +** Processing line: ~ 7480,7580,7680,7560~ +- Inside source: true +*** True Line Result + 7480,7580,7680,7560 +** Processing line: ~ 7280,7580,7480,7580~ +- Inside source: true +*** True Line Result + 7280,7580,7480,7580 +** Processing line: ~ 7080,7580,7280,7580~ +- Inside source: true +*** True Line Result + 7080,7580,7280,7580 +** Processing line: ~ 7000,7600,7080,7580~ +- Inside source: true +*** True Line Result + 7000,7600,7080,7580 +** Processing line: ~ 6880,7600,7000,7600~ +- Inside source: true +*** True Line Result + 6880,7600,7000,7600 +** Processing line: ~ 6800,7580,6880,7600~ +- Inside source: true +*** True Line Result + 6800,7580,6880,7600 +** Processing line: ~ 6640,7580,6800,7580~ +- Inside source: true +*** True Line Result + 6640,7580,6800,7580 +** Processing line: ~ 6540,7580,6640,7580~ +- Inside source: true +*** True Line Result + 6540,7580,6640,7580 +** Processing line: ~ 6380,7600,6540,7580~ +- Inside source: true +*** True Line Result + 6380,7600,6540,7580 +** Processing line: ~ 6280,7620,6380,7600~ +- Inside source: true +*** True Line Result + 6280,7620,6380,7600 +** Processing line: ~ 6240,7700,6280,7620~ +- Inside source: true +*** True Line Result + 6240,7700,6280,7620 +** Processing line: ~ 6240,7700,6240,7800~ +- Inside source: true +*** True Line Result + 6240,7700,6240,7800 +** Processing line: ~ 6240,7840,6240,7800~ +- Inside source: true +*** True Line Result + 6240,7840,6240,7800 +** Processing line: ~ 6080,7840,6240,7840~ +- Inside source: true +*** True Line Result + 6080,7840,6240,7840 +** Processing line: ~ 5960,7820,6080,7840~ +- Inside source: true +*** True Line Result + 5960,7820,6080,7840 +** Processing line: ~ 5660,7840,5800,7840~ +- Inside source: true +*** True Line Result + 5660,7840,5800,7840 +** Processing line: ~ 5500,7800,5660,7840~ +- Inside source: true +*** True Line Result + 5500,7800,5660,7840 +** Processing line: ~ 5440,7700,5500,7800~ +- Inside source: true +*** True Line Result + 5440,7700,5500,7800 +** Processing line: ~ 5800,7840,5960,7820~ +- Inside source: true +*** True Line Result + 5800,7840,5960,7820 +** Processing line: ~ 5440,7540,5440,7700~ +- Inside source: true +*** True Line Result + 5440,7540,5440,7700 +** Processing line: ~ 5440,7440,5440,7540~ +- Inside source: true +*** True Line Result + 5440,7440,5440,7540 +** Processing line: ~ 5440,7320,5440,7440~ +- Inside source: true +*** True Line Result + 5440,7320,5440,7440 +** Processing line: ~ 5400,7320,5440,7320~ +- Inside source: true +*** True Line Result + 5400,7320,5440,7320 +** Processing line: ~ 5340,7400,5400,7320~ +- Inside source: true +*** True Line Result + 5340,7400,5400,7320 +** Processing line: ~ 5340,7400,5340,7500~ +- Inside source: true +*** True Line Result + 5340,7400,5340,7500 +** Processing line: ~ 5340,7600,5340,7500~ +- Inside source: true +*** True Line Result + 5340,7600,5340,7500 +** Processing line: ~ 5340,7600,5340,7720~ +- Inside source: true +*** True Line Result + 5340,7600,5340,7720 +** Processing line: ~ 5340,7720,5340,7860~ +- Inside source: true +*** True Line Result + 5340,7720,5340,7860 +** Processing line: ~ 5340,7860,5340,7960~ +- Inside source: true +*** True Line Result + 5340,7860,5340,7960 +** Processing line: ~ 5340,7960,5440,8020~ +- Inside source: true +*** True Line Result + 5340,7960,5440,8020 +** Processing line: ~ 5440,8020,5560,8020~ +- Inside source: true +*** True Line Result + 5440,8020,5560,8020 +** Processing line: ~ 5560,8020,5720,8040~ +- Inside source: true +*** True Line Result + 5560,8020,5720,8040 +** Processing line: ~ 5720,8040,5900,8060~ +- Inside source: true +*** True Line Result + 5720,8040,5900,8060 +** Processing line: ~ 5900,8060,6080,8060~ +- Inside source: true +*** True Line Result + 5900,8060,6080,8060 +** Processing line: ~ 6080,8060,6240,8060~ +- Inside source: true +*** True Line Result + 6080,8060,6240,8060 +** Processing line: ~ 6720,8040,6840,8060~ +- Inside source: true +*** True Line Result + 6720,8040,6840,8060 +** Processing line: ~ 6240,8060,6480,8040~ +- Inside source: true +*** True Line Result + 6240,8060,6480,8040 +** Processing line: ~ 6480,8040,6720,8040~ +- Inside source: true +*** True Line Result + 6480,8040,6720,8040 +** Processing line: ~ 6840,8060,6940,8060~ +- Inside source: true +*** True Line Result + 6840,8060,6940,8060 +** Processing line: ~ 6940,8060,7080,8120~ +- Inside source: true +*** True Line Result + 6940,8060,7080,8120 +** Processing line: ~ 7080,8120,7140,8180~ +- Inside source: true +*** True Line Result + 7080,8120,7140,8180 +** Processing line: ~ 7140,8460,7140,8320~ +- Inside source: true +*** True Line Result + 7140,8460,7140,8320 +** Processing line: ~ 7140,8620,7140,8460~ +- Inside source: true +*** True Line Result + 7140,8620,7140,8460 +** Processing line: ~ 7140,8620,7140,8740~ +- Inside source: true +*** True Line Result + 7140,8620,7140,8740 +** Processing line: ~ 7140,8860,7140,8740~ +- Inside source: true +*** True Line Result + 7140,8860,7140,8740 +** Processing line: ~ 7140,8960,7140,8860~ +- Inside source: true +*** True Line Result + 7140,8960,7140,8860 +** Processing line: ~ 7140,8960,7200,9080~ +- Inside source: true +*** True Line Result + 7140,8960,7200,9080 +** Processing line: ~ 7140,9200,7200,9080~ +- Inside source: true +*** True Line Result + 7140,9200,7200,9080 +** Processing line: ~ 7140,9200,7200,9320~ +- Inside source: true +*** True Line Result + 7140,9200,7200,9320 +** Processing line: ~ 7200,9320,7200,9460~ +- Inside source: true +*** True Line Result + 7200,9320,7200,9460 +** Processing line: ~ 7200,9760,7200,9900~ +- Inside source: true +*** True Line Result + 7200,9760,7200,9900 +** Processing line: ~ 7200,9620,7200,9460~ +- Inside source: true +*** True Line Result + 7200,9620,7200,9460 +** Processing line: ~ 7200,9620,7200,9760~ +- Inside source: true +*** True Line Result + 7200,9620,7200,9760 +** Processing line: ~ 7200,9900,7200,10060~ +- Inside source: true +*** True Line Result + 7200,9900,7200,10060 +** Processing line: ~ 7200,10220,7200,10060~ +- Inside source: true +*** True Line Result + 7200,10220,7200,10060 +** Processing line: ~ 7200,10360,7200,10220~ +- Inside source: true +*** True Line Result + 7200,10360,7200,10220 +** Processing line: ~ 7140,10400,7200,10360~ +- Inside source: true +*** True Line Result + 7140,10400,7200,10360 +** Processing line: ~ 6880,10400,7140,10400~ +- Inside source: true +*** True Line Result + 6880,10400,7140,10400 +** Processing line: ~ 6640,10360,6880,10400~ +- Inside source: true +*** True Line Result + 6640,10360,6880,10400 +** Processing line: ~ 6420,10360,6640,10360~ +- Inside source: true +*** True Line Result + 6420,10360,6640,10360 +** Processing line: ~ 6160,10380,6420,10360~ +- Inside source: true +*** True Line Result + 6160,10380,6420,10360 +** Processing line: ~ 5940,10340,6160,10380~ +- Inside source: true +*** True Line Result + 5940,10340,6160,10380 +** Processing line: ~ 5720,10320,5940,10340~ +- Inside source: true +*** True Line Result + 5720,10320,5940,10340 +** Processing line: ~ 5500,10340,5720,10320~ +- Inside source: true +*** True Line Result + 5500,10340,5720,10320 +** Processing line: ~ 5280,10300,5500,10340~ +- Inside source: true +*** True Line Result + 5280,10300,5500,10340 +** Processing line: ~ 5080,10300,5280,10300~ +- Inside source: true +*** True Line Result + 5080,10300,5280,10300 +** Processing line: ~ 4840,10280,5080,10300~ +- Inside source: true +*** True Line Result + 4840,10280,5080,10300 +** Processing line: ~ 4700,10280,4840,10280~ +- Inside source: true +*** True Line Result + 4700,10280,4840,10280 +** Processing line: ~ 4540,10280,4700,10280~ +- Inside source: true +*** True Line Result + 4540,10280,4700,10280 +** Processing line: ~ 4360,10280,4540,10280~ +- Inside source: true +*** True Line Result + 4360,10280,4540,10280 +** Processing line: ~ 4200,10300,4360,10280~ +- Inside source: true +*** True Line Result + 4200,10300,4360,10280 +** Processing line: ~ 4040,10380,4200,10300~ +- Inside source: true +*** True Line Result + 4040,10380,4200,10300 +** Processing line: ~ 4020,10500,4040,10380~ +- Inside source: true +*** True Line Result + 4020,10500,4040,10380 +** Processing line: ~ 3980,10640,4020,10500~ +- Inside source: true +*** True Line Result + 3980,10640,4020,10500 +** Processing line: ~ 3980,10640,3980,10760~ +- Inside source: true +*** True Line Result + 3980,10640,3980,10760 +** Processing line: ~ 3980,10760,4020,10920~ +- Inside source: true +*** True Line Result + 3980,10760,4020,10920 +** Processing line: ~ 4020,10920,4080,11000~ +- Inside source: true +*** True Line Result + 4020,10920,4080,11000 +** Processing line: ~ 4080,11000,4340,11020~ +- Inside source: true +*** True Line Result + 4080,11000,4340,11020 +** Processing line: ~ 4340,11020,4600,11060~ +- Inside source: true +*** True Line Result + 4340,11020,4600,11060 +** Processing line: ~ 4600,11060,4840,11040~ +- Inside source: true +*** True Line Result + 4600,11060,4840,11040 +** Processing line: ~ 4840,11040,4880,10960~ +- Inside source: true +*** True Line Result + 4840,11040,4880,10960 +** Processing line: ~ 4880,10740,4880,10960~ +- Inside source: true +*** True Line Result + 4880,10740,4880,10960 +** Processing line: ~ 4880,10740,4880,10600~ +- Inside source: true +*** True Line Result + 4880,10740,4880,10600 +** Processing line: ~ 4880,10600,5080,10560~ +- Inside source: true +*** True Line Result + 4880,10600,5080,10560 +** Processing line: ~ 5080,10560,5340,10620~ +- Inside source: true +*** True Line Result + 5080,10560,5340,10620 +** Processing line: ~ 5340,10620,5660,10620~ +- Inside source: true +*** True Line Result + 5340,10620,5660,10620 +** Processing line: ~ 5660,10620,6040,10600~ +- Inside source: true +*** True Line Result + 5660,10620,6040,10600 +** Processing line: ~ 6040,10600,6120,10620~ +- Inside source: true +*** True Line Result + 6040,10600,6120,10620 +** Processing line: ~ 6120,10620,6240,10720~ +- Inside source: true +*** True Line Result + 6120,10620,6240,10720 +** Processing line: ~ 6240,10720,6420,10740~ +- Inside source: true +*** True Line Result + 6240,10720,6420,10740 +** Processing line: ~ 6420,10740,6640,10760~ +- Inside source: true +*** True Line Result + 6420,10740,6640,10760 +** Processing line: ~ 6640,10760,6880,10780~ +- Inside source: true +*** True Line Result + 6640,10760,6880,10780 +** Processing line: ~ 7140,10780,7400,10780~ +- Inside source: true +*** True Line Result + 7140,10780,7400,10780 +** Processing line: ~ 6880,10780,7140,10780~ +- Inside source: true +*** True Line Result + 6880,10780,7140,10780 +** Processing line: ~ 7400,10780,7680,10780~ +- Inside source: true +*** True Line Result + 7400,10780,7680,10780 +** Processing line: ~ 7680,10780,8100,10760~ +- Inside source: true +*** True Line Result + 7680,10780,8100,10760 +** Processing line: ~ 8100,10760,8460,10740~ +- Inside source: true +*** True Line Result + 8100,10760,8460,10740 +** Processing line: ~ 8460,10740,8700,10760~ +- Inside source: true +*** True Line Result + 8460,10740,8700,10760 +** Processing line: ~ 8800,10840,8800,10980~ +- Inside source: true +*** True Line Result + 8800,10840,8800,10980 +** Processing line: ~ 8700,10760,8800,10840~ +- Inside source: true +*** True Line Result + 8700,10760,8800,10840 +** Processing line: ~ 8760,11200,8800,10980~ +- Inside source: true +*** True Line Result + 8760,11200,8800,10980 +** Processing line: ~ 8760,11200,8760,11380~ +- Inside source: true +*** True Line Result + 8760,11200,8760,11380 +** Processing line: ~ 8760,11380,8800,11560~ +- Inside source: true +*** True Line Result + 8760,11380,8800,11560 +** Processing line: ~ 8760,11680,8800,11560~ +- Inside source: true +*** True Line Result + 8760,11680,8800,11560 +** Processing line: ~ 8760,11760,8760,11680~ +- Inside source: true +*** True Line Result + 8760,11760,8760,11680 +** Processing line: ~ 8760,11760,8760,11920~ +- Inside source: true +*** True Line Result + 8760,11760,8760,11920 +** Processing line: ~ 8760,11920,8800,12080~ +- Inside source: true +*** True Line Result + 8760,11920,8800,12080 +** Processing line: ~ 8800,12200,8800,12080~ +- Inside source: true +*** True Line Result + 8800,12200,8800,12080 +** Processing line: ~ 8700,12240,8800,12200~ +- Inside source: true +*** True Line Result + 8700,12240,8800,12200 +** Processing line: ~ 8560,12220,8700,12240~ +- Inside source: true +*** True Line Result + 8560,12220,8700,12240 +** Processing line: ~ 8360,12220,8560,12220~ +- Inside source: true +*** True Line Result + 8360,12220,8560,12220 +** Processing line: ~ 8160,12240,8360,12220~ +- Inside source: true +*** True Line Result + 8160,12240,8360,12220 +** Processing line: ~ 7720,12220,7980,12220~ +- Inside source: true +*** True Line Result + 7720,12220,7980,12220 +** Processing line: ~ 7980,12220,8160,12240~ +- Inside source: true +*** True Line Result + 7980,12220,8160,12240 +** Processing line: ~ 7400,12200,7720,12220~ +- Inside source: true +*** True Line Result + 7400,12200,7720,12220 +** Processing line: ~ 7200,12180,7400,12200~ +- Inside source: true +*** True Line Result + 7200,12180,7400,12200 +** Processing line: ~ 7000,12160,7200,12180~ +- Inside source: true +*** True Line Result + 7000,12160,7200,12180 +** Processing line: ~ 6800,12160,7000,12160~ +- Inside source: true +*** True Line Result + 6800,12160,7000,12160 +** Processing line: ~ 6280,12140,6380,12180~ +- Inside source: true +*** True Line Result + 6280,12140,6380,12180 +** Processing line: ~ 6120,12180,6280,12140~ +- Inside source: true +*** True Line Result + 6120,12180,6280,12140 +** Processing line: ~ 6540,12180,6800,12160~ +- Inside source: true +*** True Line Result + 6540,12180,6800,12160 +** Processing line: ~ 6380,12180,6540,12180~ +- Inside source: true +*** True Line Result + 6380,12180,6540,12180 +** Processing line: ~ 5900,12200,6120,12180~ +- Inside source: true +*** True Line Result + 5900,12200,6120,12180 +** Processing line: ~ 5620,12180,5900,12200~ +- Inside source: true +*** True Line Result + 5620,12180,5900,12200 +** Processing line: ~ 5340,12120,5620,12180~ +- Inside source: true +*** True Line Result + 5340,12120,5620,12180 +** Processing line: ~ 5140,12100,5340,12120~ +- Inside source: true +*** True Line Result + 5140,12100,5340,12120 +** Processing line: ~ 4980,12120,5140,12100~ +- Inside source: true +*** True Line Result + 4980,12120,5140,12100 +** Processing line: ~ 4840,12120,4980,12120~ +- Inside source: true +*** True Line Result + 4840,12120,4980,12120 +** Processing line: ~ 4700,12200,4840,12120~ +- Inside source: true +*** True Line Result + 4700,12200,4840,12120 +** Processing line: ~ 4700,12380,4700,12200~ +- Inside source: true +*** True Line Result + 4700,12380,4700,12200 +** Processing line: ~ 4740,12480,4940,12520~ +- Inside source: true +*** True Line Result + 4740,12480,4940,12520 +** Processing line: ~ 4700,12380,4740,12480~ +- Inside source: true +*** True Line Result + 4700,12380,4740,12480 +** Processing line: ~ 4940,12520,5160,12560~ +- Inside source: true +*** True Line Result + 4940,12520,5160,12560 +** Processing line: ~ 5160,12560,5340,12600~ +- Inside source: true +*** True Line Result + 5160,12560,5340,12600 +** Processing line: ~ 5340,12600,5400,12600~ +- Inside source: true +*** True Line Result + 5340,12600,5400,12600 +** Processing line: ~ 5400,12600,5500,12600~ +- Inside source: true +*** True Line Result + 5400,12600,5500,12600 +** Processing line: ~ 5500,12600,5620,12600~ +- Inside source: true +*** True Line Result + 5500,12600,5620,12600 +** Processing line: ~ 5620,12600,5720,12560~ +- Inside source: true +*** True Line Result + 5620,12600,5720,12560 +** Processing line: ~ 5720,12560,5800,12440~ +- Inside source: true +*** True Line Result + 5720,12560,5800,12440 +** Processing line: ~ 5800,12440,5900,12380~ +- Inside source: true +*** True Line Result + 5800,12440,5900,12380 +** Processing line: ~ 5900,12380,6120,12420~ +- Inside source: true +*** True Line Result + 5900,12380,6120,12420 +** Processing line: ~ 6120,12420,6380,12440~ +- Inside source: true +*** True Line Result + 6120,12420,6380,12440 +** Processing line: ~ 6380,12440,6600,12460~ +- Inside source: true +*** True Line Result + 6380,12440,6600,12460 +** Processing line: ~ 6720,12460,6840,12520~ +- Inside source: true +*** True Line Result + 6720,12460,6840,12520 +** Processing line: ~ 6840,12520,6960,12520~ +- Inside source: true +*** True Line Result + 6840,12520,6960,12520 +** Processing line: ~ 6600,12460,6720,12460~ +- Inside source: true +*** True Line Result + 6600,12460,6720,12460 +** Processing line: ~ 6960,12520,7040,12500~ +- Inside source: true +*** True Line Result + 6960,12520,7040,12500 +** Processing line: ~ 7040,12500,7140,12440~ +- Inside source: true +*** True Line Result + 7040,12500,7140,12440 +** Processing line: ~ 7200,12440,7360,12500~ +- Inside source: true +*** True Line Result + 7200,12440,7360,12500 +** Processing line: ~ 7360,12500,7600,12560~ +- Inside source: true +*** True Line Result + 7360,12500,7600,12560 +** Processing line: ~ 7600,12560,7860,12600~ +- Inside source: true +*** True Line Result + 7600,12560,7860,12600 +** Processing line: ~ 7860,12600,8060,12500~ +- Inside source: true +*** True Line Result + 7860,12600,8060,12500 +** Processing line: ~ 8100,12500,8200,12340~ +- Inside source: true +*** True Line Result + 8100,12500,8200,12340 +** Processing line: ~ 8200,12340,8360,12360~ +- Inside source: true +*** True Line Result + 8200,12340,8360,12360 +** Processing line: ~ 8360,12360,8560,12400~ +- Inside source: true +*** True Line Result + 8360,12360,8560,12400 +** Processing line: ~ 8560,12400,8660,12420~ +- Inside source: true +*** True Line Result + 8560,12400,8660,12420 +** Processing line: ~ 8660,12420,8840,12400~ +- Inside source: true +*** True Line Result + 8660,12420,8840,12400 +** Processing line: ~ 8840,12400,9000,12360~ +- Inside source: true +*** True Line Result + 8840,12400,9000,12360 +** Processing line: ~ 9000,12360,9000,12360~ +- Inside source: true +*** True Line Result + 9000,12360,9000,12360 +** Processing line: ~ 2900,4400,2900,4280~ +- Inside source: true +*** True Line Result + 2900,4400,2900,4280 +** Processing line: ~ 900,7320,1000,7220~ +- Inside source: true +*** True Line Result + 900,7320,1000,7220 +** Processing line: ~ 2640,13040,2900,12920~ +- Inside source: true +*** True Line Result + 2640,13040,2900,12920 +** Processing line: ~ 2900,12920,3160,12840~ +- Inside source: true +*** True Line Result + 2900,12920,3160,12840 +** Processing line: ~ 3480,12760,3780,12620~ +- Inside source: true +*** True Line Result + 3480,12760,3780,12620 +** Processing line: ~ 3780,12620,4020,12460~ +- Inside source: true +*** True Line Result + 3780,12620,4020,12460 +** Processing line: ~ 4300,12360,4440,12260~ +- Inside source: true +*** True Line Result + 4300,12360,4440,12260 +** Processing line: ~ 4020,12460,4300,12360~ +- Inside source: true +*** True Line Result + 4020,12460,4300,12360 +** Processing line: ~ 3160,12840,3480,12760~ +- Inside source: true +*** True Line Result + 3160,12840,3480,12760 +** Processing line: ~ 4440,12080,4440,12260~ +- Inside source: true +*** True Line Result + 4440,12080,4440,12260 +** Processing line: ~ 4440,12080,4440,11880~ +- Inside source: true +*** True Line Result + 4440,12080,4440,11880 +** Processing line: ~ 4440,11880,4440,11720~ +- Inside source: true +*** True Line Result + 4440,11880,4440,11720 +** Processing line: ~ 4440,11720,4600,11720~ +- Inside source: true +*** True Line Result + 4440,11720,4600,11720 +** Processing line: ~ 4600,11720,4760,11740~ +- Inside source: true +*** True Line Result + 4600,11720,4760,11740 +** Processing line: ~ 4760,11740,4980,11760~ +- Inside source: true +*** True Line Result + 4760,11740,4980,11760 +** Processing line: ~ 4980,11760,5160,11760~ +- Inside source: true +*** True Line Result + 4980,11760,5160,11760 +** Processing line: ~ 5160,11760,5340,11780~ +- Inside source: true +*** True Line Result + 5160,11760,5340,11780 +** Processing line: ~ 6000,11860,6120,11820~ +- Inside source: true +*** True Line Result + 6000,11860,6120,11820 +** Processing line: ~ 5340,11780,5620,11820~ +- Inside source: true +*** True Line Result + 5340,11780,5620,11820 +** Processing line: ~ 5620,11820,6000,11860~ +- Inside source: true +*** True Line Result + 5620,11820,6000,11860 +** Processing line: ~ 6120,11820,6360,11820~ +- Inside source: true +*** True Line Result + 6120,11820,6360,11820 +** Processing line: ~ 6360,11820,6640,11860~ +- Inside source: true +*** True Line Result + 6360,11820,6640,11860 +** Processing line: ~ 6940,11920,7240,11940~ +- Inside source: true +*** True Line Result + 6940,11920,7240,11940 +** Processing line: ~ 7240,11940,7520,11960~ +- Inside source: true +*** True Line Result + 7240,11940,7520,11960 +** Processing line: ~ 7520,11960,7860,11960~ +- Inside source: true +*** True Line Result + 7520,11960,7860,11960 +** Processing line: ~ 7860,11960,8100,11920~ +- Inside source: true +*** True Line Result + 7860,11960,8100,11920 +** Processing line: ~ 8100,11920,8420,11940~ +- Inside source: true +*** True Line Result + 8100,11920,8420,11940 +** Processing line: ~ 8420,11940,8460,11960~ +- Inside source: true +*** True Line Result + 8420,11940,8460,11960 +** Processing line: ~ 8460,11960,8500,11860~ +- Inside source: true +*** True Line Result + 8460,11960,8500,11860 +** Processing line: ~ 8460,11760,8500,11860~ +- Inside source: true +*** True Line Result + 8460,11760,8500,11860 +** Processing line: ~ 8320,11720,8460,11760~ +- Inside source: true +*** True Line Result + 8320,11720,8460,11760 +** Processing line: ~ 8160,11720,8320,11720~ +- Inside source: true +*** True Line Result + 8160,11720,8320,11720 +** Processing line: ~ 7940,11720,8160,11720~ +- Inside source: true +*** True Line Result + 7940,11720,8160,11720 +** Processing line: ~ 7720,11700,7940,11720~ +- Inside source: true +*** True Line Result + 7720,11700,7940,11720 +** Processing line: ~ 7520,11680,7720,11700~ +- Inside source: true +*** True Line Result + 7520,11680,7720,11700 +** Processing line: ~ 7320,11680,7520,11680~ +- Inside source: true +*** True Line Result + 7320,11680,7520,11680 +** Processing line: ~ 7200,11620,7320,11680~ +- Inside source: true +*** True Line Result + 7200,11620,7320,11680 +** Processing line: ~ 7200,11620,7200,11500~ +- Inside source: true +*** True Line Result + 7200,11620,7200,11500 +** Processing line: ~ 7200,11500,7280,11440~ +- Inside source: true +*** True Line Result + 7200,11500,7280,11440 +** Processing line: ~ 7280,11440,7420,11440~ +- Inside source: true +*** True Line Result + 7280,11440,7420,11440 +** Processing line: ~ 7420,11440,7600,11440~ +- Inside source: true +*** True Line Result + 7420,11440,7600,11440 +** Processing line: ~ 7600,11440,7980,11460~ +- Inside source: true +*** True Line Result + 7600,11440,7980,11460 +** Processing line: ~ 7980,11460,8160,11460~ +- Inside source: true +*** True Line Result + 7980,11460,8160,11460 +** Processing line: ~ 8160,11460,8360,11460~ +- Inside source: true +*** True Line Result + 8160,11460,8360,11460 +** Processing line: ~ 8360,11460,8460,11400~ +- Inside source: true +*** True Line Result + 8360,11460,8460,11400 +** Processing line: ~ 8420,11060,8500,11200~ +- Inside source: true +*** True Line Result + 8420,11060,8500,11200 +** Processing line: ~ 8280,11040,8420,11060~ +- Inside source: true +*** True Line Result + 8280,11040,8420,11060 +** Processing line: ~ 8100,11060,8280,11040~ +- Inside source: true +*** True Line Result + 8100,11060,8280,11040 +** Processing line: ~ 8460,11400,8500,11200~ +- Inside source: true +*** True Line Result + 8460,11400,8500,11200 +** Processing line: ~ 7800,11060,8100,11060~ +- Inside source: true +*** True Line Result + 7800,11060,8100,11060 +** Processing line: ~ 7520,11060,7800,11060~ +- Inside source: true +*** True Line Result + 7520,11060,7800,11060 +** Processing line: ~ 7240,11060,7520,11060~ +- Inside source: true +*** True Line Result + 7240,11060,7520,11060 +** Processing line: ~ 6940,11040,7240,11060~ +- Inside source: true +*** True Line Result + 6940,11040,7240,11060 +** Processing line: ~ 6640,11000,6940,11040~ +- Inside source: true +*** True Line Result + 6640,11000,6940,11040 +** Processing line: ~ 6420,10980,6640,11000~ +- Inside source: true +*** True Line Result + 6420,10980,6640,11000 +** Processing line: ~ 6360,11060,6420,10980~ +- Inside source: true +*** True Line Result + 6360,11060,6420,10980 +** Processing line: ~ 6360,11180,6360,11060~ +- Inside source: true +*** True Line Result + 6360,11180,6360,11060 +** Processing line: ~ 6200,11280,6360,11180~ +- Inside source: true +*** True Line Result + 6200,11280,6360,11180 +** Processing line: ~ 5960,11300,6200,11280~ +- Inside source: true +*** True Line Result + 5960,11300,6200,11280 +** Processing line: ~ 5720,11280,5960,11300~ +- Inside source: true +*** True Line Result + 5720,11280,5960,11300 +** Processing line: ~ 5500,11280,5720,11280~ +- Inside source: true +*** True Line Result + 5500,11280,5720,11280 +** Processing line: ~ 4940,11300,5200,11280~ +- Inside source: true +*** True Line Result + 4940,11300,5200,11280 +** Processing line: ~ 4660,11260,4940,11300~ +- Inside source: true +*** True Line Result + 4660,11260,4940,11300 +** Processing line: ~ 4440,11280,4660,11260~ +- Inside source: true +*** True Line Result + 4440,11280,4660,11260 +** Processing line: ~ 4260,11280,4440,11280~ +- Inside source: true +*** True Line Result + 4260,11280,4440,11280 +** Processing line: ~ 4220,11220,4260,11280~ +- Inside source: true +*** True Line Result + 4220,11220,4260,11280 +** Processing line: ~ 4080,11280,4220,11220~ +- Inside source: true +*** True Line Result + 4080,11280,4220,11220 +** Processing line: ~ 3980,11420,4080,11280~ +- Inside source: true +*** True Line Result + 3980,11420,4080,11280 +** Processing line: ~ 3980,11420,4040,11620~ +- Inside source: true +*** True Line Result + 3980,11420,4040,11620 +** Processing line: ~ 4040,11620,4040,11820~ +- Inside source: true +*** True Line Result + 4040,11620,4040,11820 +** Processing line: ~ 3980,11960,4040,11820~ +- Inside source: true +*** True Line Result + 3980,11960,4040,11820 +** Processing line: ~ 3840,12000,3980,11960~ +- Inside source: true +*** True Line Result + 3840,12000,3980,11960 +** Processing line: ~ 3720,11940,3840,12000~ +- Inside source: true +*** True Line Result + 3720,11940,3840,12000 +** Processing line: ~ 3680,11800,3720,11940~ +- Inside source: true +*** True Line Result + 3680,11800,3720,11940 +** Processing line: ~ 3680,11580,3680,11800~ +- Inside source: true +*** True Line Result + 3680,11580,3680,11800 +** Processing line: ~ 3680,11360,3680,11580~ +- Inside source: true +*** True Line Result + 3680,11360,3680,11580 +** Processing line: ~ 3680,11360,3680,11260~ +- Inside source: true +*** True Line Result + 3680,11360,3680,11260 +** Processing line: ~ 3680,11080,3680,11260~ +- Inside source: true +*** True Line Result + 3680,11080,3680,11260 +** Processing line: ~ 3680,11080,3680,10880~ +- Inside source: true +*** True Line Result + 3680,11080,3680,10880 +** Processing line: ~ 3680,10700,3680,10880~ +- Inside source: true +*** True Line Result + 3680,10700,3680,10880 +** Processing line: ~ 3680,10700,3680,10620~ +- Inside source: true +*** True Line Result + 3680,10700,3680,10620 +** Processing line: ~ 3680,10480,3680,10620~ +- Inside source: true +*** True Line Result + 3680,10480,3680,10620 +** Processing line: ~ 3680,10480,3680,10300~ +- Inside source: true +*** True Line Result + 3680,10480,3680,10300 +** Processing line: ~ 3680,10300,3680,10100~ +- Inside source: true +*** True Line Result + 3680,10300,3680,10100 +** Processing line: ~ 3680,10100,3680,9940~ +- Inside source: true +*** True Line Result + 3680,10100,3680,9940 +** Processing line: ~ 3680,9940,3720,9860~ +- Inside source: true +*** True Line Result + 3680,9940,3720,9860 +** Processing line: ~ 3720,9860,3920,9900~ +- Inside source: true +*** True Line Result + 3720,9860,3920,9900 +** Processing line: ~ 3920,9900,4220,9880~ +- Inside source: true +*** True Line Result + 3920,9900,4220,9880 +** Processing line: ~ 4980,9940,5340,9960~ +- Inside source: true +*** True Line Result + 4980,9940,5340,9960 +** Processing line: ~ 4220,9880,4540,9900~ +- Inside source: true +*** True Line Result + 4220,9880,4540,9900 +** Processing line: ~ 4540,9900,4980,9940~ +- Inside source: true +*** True Line Result + 4540,9900,4980,9940 +** Processing line: ~ 5340,9960,5620,9960~ +- Inside source: true +*** True Line Result + 5340,9960,5620,9960 +** Processing line: ~ 5620,9960,5900,9960~ +- Inside source: true +*** True Line Result + 5620,9960,5900,9960 +** Processing line: ~ 5900,9960,6160,10000~ +- Inside source: true +*** True Line Result + 5900,9960,6160,10000 +** Processing line: ~ 6160,10000,6480,10000~ +- Inside source: true +*** True Line Result + 6160,10000,6480,10000 +** Processing line: ~ 6480,10000,6720,10000~ +- Inside source: true +*** True Line Result + 6480,10000,6720,10000 +** Processing line: ~ 6720,10000,6880,9860~ +- Inside source: true +*** True Line Result + 6720,10000,6880,9860 +** Processing line: ~ 6880,9860,6880,9520~ +- Inside source: true +*** True Line Result + 6880,9860,6880,9520 +** Processing line: ~ 6880,9520,6940,9340~ +- Inside source: true +*** True Line Result + 6880,9520,6940,9340 +** Processing line: ~ 6940,9120,6940,9340~ +- Inside source: true +*** True Line Result + 6940,9120,6940,9340 +** Processing line: ~ 6940,9120,6940,8920~ +- Inside source: true +*** True Line Result + 6940,9120,6940,8920 +** Processing line: ~ 6940,8700,6940,8920~ +- Inside source: true +*** True Line Result + 6940,8700,6940,8920 +** Processing line: ~ 6880,8500,6940,8700~ +- Inside source: true +*** True Line Result + 6880,8500,6940,8700 +** Processing line: ~ 6880,8320,6880,8500~ +- Inside source: true +*** True Line Result + 6880,8320,6880,8500 +** Processing line: ~ 7140,8320,7140,8180~ +- Inside source: true +*** True Line Result + 7140,8320,7140,8180 +** Processing line: ~ 6760,8260,6880,8320~ +- Inside source: true +*** True Line Result + 6760,8260,6880,8320 +** Processing line: ~ 6540,8240,6760,8260~ +- Inside source: true +*** True Line Result + 6540,8240,6760,8260 +** Processing line: ~ 6420,8180,6540,8240~ +- Inside source: true +*** True Line Result + 6420,8180,6540,8240 +** Processing line: ~ 6280,8240,6420,8180~ +- Inside source: true +*** True Line Result + 6280,8240,6420,8180 +** Processing line: ~ 6160,8300,6280,8240~ +- Inside source: true +*** True Line Result + 6160,8300,6280,8240 +** Processing line: ~ 6120,8400,6160,8300~ +- Inside source: true +*** True Line Result + 6120,8400,6160,8300 +** Processing line: ~ 6080,8520,6120,8400~ +- Inside source: true +*** True Line Result + 6080,8520,6120,8400 +** Processing line: ~ 5840,8480,6080,8520~ +- Inside source: true +*** True Line Result + 5840,8480,6080,8520 +** Processing line: ~ 5620,8500,5840,8480~ +- Inside source: true +*** True Line Result + 5620,8500,5840,8480 +** Processing line: ~ 5500,8500,5620,8500~ +- Inside source: true +*** True Line Result + 5500,8500,5620,8500 +** Processing line: ~ 5340,8560,5500,8500~ +- Inside source: true +*** True Line Result + 5340,8560,5500,8500 +** Processing line: ~ 5160,8540,5340,8560~ +- Inside source: true +*** True Line Result + 5160,8540,5340,8560 +** Processing line: ~ 4620,8520,4880,8520~ +- Inside source: true +*** True Line Result + 4620,8520,4880,8520 +** Processing line: ~ 4360,8480,4620,8520~ +- Inside source: true +*** True Line Result + 4360,8480,4620,8520 +** Processing line: ~ 4880,8520,5160,8540~ +- Inside source: true +*** True Line Result + 4880,8520,5160,8540 +** Processing line: ~ 4140,8440,4360,8480~ +- Inside source: true +*** True Line Result + 4140,8440,4360,8480 +** Processing line: ~ 3920,8460,4140,8440~ +- Inside source: true +*** True Line Result + 3920,8460,4140,8440 +** Processing line: ~ 3720,8380,3920,8460~ +- Inside source: true +*** True Line Result + 3720,8380,3920,8460 +** Processing line: ~ 3680,8160,3720,8380~ +- Inside source: true +*** True Line Result + 3680,8160,3720,8380 +** Processing line: ~ 3680,8160,3720,7940~ +- Inside source: true +*** True Line Result + 3680,8160,3720,7940 +** Processing line: ~ 3720,7720,3720,7940~ +- Inside source: true +*** True Line Result + 3720,7720,3720,7940 +** Processing line: ~ 3680,7580,3720,7720~ +- Inside source: true +*** True Line Result + 3680,7580,3720,7720 +** Processing line: ~ 3680,7580,3720,7440~ +- Inside source: true +*** True Line Result + 3680,7580,3720,7440 +** Processing line: ~ 3720,7440,3720,7300~ +- Inside source: true +*** True Line Result + 3720,7440,3720,7300 +** Processing line: ~ 3720,7160,3720,7300~ +- Inside source: true +*** True Line Result + 3720,7160,3720,7300 +** Processing line: ~ 3720,7160,3720,7020~ +- Inside source: true +*** True Line Result + 3720,7160,3720,7020 +** Processing line: ~ 3720,7020,3780,6900~ +- Inside source: true +*** True Line Result + 3720,7020,3780,6900 +** Processing line: ~ 3780,6900,4080,6940~ +- Inside source: true +*** True Line Result + 3780,6900,4080,6940 +** Processing line: ~ 4080,6940,4340,6980~ +- Inside source: true +*** True Line Result + 4080,6940,4340,6980 +** Processing line: ~ 4340,6980,4600,6980~ +- Inside source: true +*** True Line Result + 4340,6980,4600,6980 +** Processing line: ~ 4600,6980,4880,6980~ +- Inside source: true +*** True Line Result + 4600,6980,4880,6980 +** Processing line: ~ 4880,6980,5160,6980~ +- Inside source: true +*** True Line Result + 4880,6980,5160,6980 +** Processing line: ~ 5160,6980,5400,7000~ +- Inside source: true +*** True Line Result + 5160,6980,5400,7000 +** Processing line: ~ 5400,7000,5560,7020~ +- Inside source: true +*** True Line Result + 5400,7000,5560,7020 +** Processing line: ~ 5560,7020,5660,7080~ +- Inside source: true +*** True Line Result + 5560,7020,5660,7080 +** Processing line: ~ 5660,7080,5660,7280~ +- Inside source: true +*** True Line Result + 5660,7080,5660,7280 +** Processing line: ~ 5660,7280,5660,7440~ +- Inside source: true +*** True Line Result + 5660,7280,5660,7440 +** Processing line: ~ 5660,7440,5740,7520~ +- Inside source: true +*** True Line Result + 5660,7440,5740,7520 +** Processing line: ~ 5740,7520,5740,7600~ +- Inside source: true +*** True Line Result + 5740,7520,5740,7600 +** Processing line: ~ 5740,7600,5900,7600~ +- Inside source: true +*** True Line Result + 5740,7600,5900,7600 +** Processing line: ~ 5900,7600,6040,7540~ +- Inside source: true +*** True Line Result + 5900,7600,6040,7540 +** Processing line: ~ 6040,7540,6040,7320~ +- Inside source: true +*** True Line Result + 6040,7540,6040,7320 +** Processing line: ~ 6040,7320,6120,7200~ +- Inside source: true +*** True Line Result + 6040,7320,6120,7200 +** Processing line: ~ 6120,7200,6120,7040~ +- Inside source: true +*** True Line Result + 6120,7200,6120,7040 +** Processing line: ~ 6120,7040,6240,7000~ +- Inside source: true +*** True Line Result + 6120,7040,6240,7000 +** Processing line: ~ 6240,7000,6480,7060~ +- Inside source: true +*** True Line Result + 6240,7000,6480,7060 +** Processing line: ~ 6480,7060,6800,7060~ +- Inside source: true +*** True Line Result + 6480,7060,6800,7060 +** Processing line: ~ 6800,7060,7080,7080~ +- Inside source: true +*** True Line Result + 6800,7060,7080,7080 +** Processing line: ~ 7080,7080,7320,7100~ +- Inside source: true +*** True Line Result + 7080,7080,7320,7100 +** Processing line: ~ 7940,7100,7980,6920~ +- Inside source: true +*** True Line Result + 7940,7100,7980,6920 +** Processing line: ~ 7860,6860,7980,6920~ +- Inside source: true +*** True Line Result + 7860,6860,7980,6920 +** Processing line: ~ 7640,6860,7860,6860~ +- Inside source: true +*** True Line Result + 7640,6860,7860,6860 +** Processing line: ~ 7400,6840,7640,6860~ +- Inside source: true +*** True Line Result + 7400,6840,7640,6860 +** Processing line: ~ 7320,7100,7560,7120~ +- Inside source: true +*** True Line Result + 7320,7100,7560,7120 +** Processing line: ~ 7560,7120,7760,7120~ +- Inside source: true +*** True Line Result + 7560,7120,7760,7120 +** Processing line: ~ 7760,7120,7940,7100~ +- Inside source: true +*** True Line Result + 7760,7120,7940,7100 +** Processing line: ~ 7200,6820,7400,6840~ +- Inside source: true +*** True Line Result + 7200,6820,7400,6840 +** Processing line: ~ 7040,6820,7200,6820~ +- Inside source: true +*** True Line Result + 7040,6820,7200,6820 +** Processing line: ~ 6600,6840,6840,6840~ +- Inside source: true +*** True Line Result + 6600,6840,6840,6840 +** Processing line: ~ 6380,6800,6600,6840~ +- Inside source: true +*** True Line Result + 6380,6800,6600,6840 +** Processing line: ~ 6120,6800,6380,6800~ +- Inside source: true +*** True Line Result + 6120,6800,6380,6800 +** Processing line: ~ 5900,6840,6120,6800~ +- Inside source: true +*** True Line Result + 5900,6840,6120,6800 +** Processing line: ~ 5620,6820,5900,6840~ +- Inside source: true +*** True Line Result + 5620,6820,5900,6840 +** Processing line: ~ 5400,6800,5620,6820~ +- Inside source: true +*** True Line Result + 5400,6800,5620,6820 +** Processing line: ~ 5140,6800,5400,6800~ +- Inside source: true +*** True Line Result + 5140,6800,5400,6800 +** Processing line: ~ 4880,6780,5140,6800~ +- Inside source: true +*** True Line Result + 4880,6780,5140,6800 +** Processing line: ~ 4600,6760,4880,6780~ +- Inside source: true +*** True Line Result + 4600,6760,4880,6780 +** Processing line: ~ 4340,6760,4600,6760~ +- Inside source: true +*** True Line Result + 4340,6760,4600,6760 +** Processing line: ~ 4080,6760,4340,6760~ +- Inside source: true +*** True Line Result + 4080,6760,4340,6760 +** Processing line: ~ 3840,6740,4080,6760~ +- Inside source: true +*** True Line Result + 3840,6740,4080,6760 +** Processing line: ~ 3680,6720,3840,6740~ +- Inside source: true +*** True Line Result + 3680,6720,3840,6740 +** Processing line: ~ 3680,6720,3680,6560~ +- Inside source: true +*** True Line Result + 3680,6720,3680,6560 +** Processing line: ~ 3680,6560,3720,6400~ +- Inside source: true +*** True Line Result + 3680,6560,3720,6400 +** Processing line: ~ 3720,6400,3720,6200~ +- Inside source: true +*** True Line Result + 3720,6400,3720,6200 +** Processing line: ~ 3720,6200,3780,6000~ +- Inside source: true +*** True Line Result + 3720,6200,3780,6000 +** Processing line: ~ 3720,5780,3780,6000~ +- Inside source: true +*** True Line Result + 3720,5780,3780,6000 +** Processing line: ~ 3720,5580,3720,5780~ +- Inside source: true +*** True Line Result + 3720,5580,3720,5780 +** Processing line: ~ 3720,5360,3720,5580~ +- Inside source: true +*** True Line Result + 3720,5360,3720,5580 +** Processing line: ~ 3720,5360,3840,5240~ +- Inside source: true +*** True Line Result + 3720,5360,3840,5240 +** Processing line: ~ 3840,5240,4200,5260~ +- Inside source: true +*** True Line Result + 3840,5240,4200,5260 +** Processing line: ~ 4200,5260,4600,5280~ +- Inside source: true +*** True Line Result + 4200,5260,4600,5280 +** Processing line: ~ 4600,5280,4880,5280~ +- Inside source: true +*** True Line Result + 4600,5280,4880,5280 +** Processing line: ~ 4880,5280,5140,5200~ +- Inside source: true +*** True Line Result + 4880,5280,5140,5200 +** Processing line: ~ 5140,5200,5220,5100~ +- Inside source: true +*** True Line Result + 5140,5200,5220,5100 +** Processing line: ~ 5220,5100,5280,4900~ +- Inside source: true +*** True Line Result + 5220,5100,5280,4900 +** Processing line: ~ 5280,4900,5340,4840~ +- Inside source: true +*** True Line Result + 5280,4900,5340,4840 +** Processing line: ~ 5340,4840,5720,4880~ +- Inside source: true +*** True Line Result + 5340,4840,5720,4880 +** Processing line: ~ 6120,4880,6480,4860~ +- Inside source: true +*** True Line Result + 6120,4880,6480,4860 +** Processing line: ~ 6880,4840,7200,4860~ +- Inside source: true +*** True Line Result + 6880,4840,7200,4860 +** Processing line: ~ 6480,4860,6880,4840~ +- Inside source: true +*** True Line Result + 6480,4860,6880,4840 +** Processing line: ~ 7200,4860,7320,4860~ +- Inside source: true +*** True Line Result + 7200,4860,7320,4860 +** Processing line: ~ 7320,4860,7360,4740~ +- Inside source: true +*** True Line Result + 7320,4860,7360,4740 +** Processing line: ~ 7360,4600,7440,4520~ +- Inside source: true +*** True Line Result + 7360,4600,7440,4520 +** Processing line: ~ 7360,4600,7360,4740~ +- Inside source: true +*** True Line Result + 7360,4600,7360,4740 +** Processing line: ~ 7440,4520,7640,4520~ +- Inside source: true +*** True Line Result + 7440,4520,7640,4520 +** Processing line: ~ 7640,4520,7800,4480~ +- Inside source: true +*** True Line Result + 7640,4520,7800,4480 +** Processing line: ~ 7800,4480,7800,4280~ +- Inside source: true +*** True Line Result + 7800,4480,7800,4280 +** Processing line: ~ 7800,4280,7800,4040~ +- Inside source: true +*** True Line Result + 7800,4280,7800,4040 +** Processing line: ~ 7800,4040,7800,3780~ +- Inside source: true +*** True Line Result + 7800,4040,7800,3780 +** Processing line: ~ 7800,3560,7800,3780~ +- Inside source: true +*** True Line Result + 7800,3560,7800,3780 +** Processing line: ~ 7800,3560,7860,3440~ +- Inside source: true +*** True Line Result + 7800,3560,7860,3440 +** Processing line: ~ 7860,3440,8060,3460~ +- Inside source: true +*** True Line Result + 7860,3440,8060,3460 +** Processing line: ~ 8060,3460,8160,3340~ +- Inside source: true +*** True Line Result + 8060,3460,8160,3340 +** Processing line: ~ 8160,3340,8160,3140~ +- Inside source: true +*** True Line Result + 8160,3340,8160,3140 +** Processing line: ~ 8160,3140,8160,2960~ +- Inside source: true +*** True Line Result + 8160,3140,8160,2960 +** Processing line: ~ 8000,2900,8160,2960~ +- Inside source: true +*** True Line Result + 8000,2900,8160,2960 +** Processing line: ~ 7860,2900,8000,2900~ +- Inside source: true +*** True Line Result + 7860,2900,8000,2900 +** Processing line: ~ 7640,2940,7860,2900~ +- Inside source: true +*** True Line Result + 7640,2940,7860,2900 +** Processing line: ~ 7400,2980,7640,2940~ +- Inside source: true +*** True Line Result + 7400,2980,7640,2940 +** Processing line: ~ 7100,2980,7400,2980~ +- Inside source: true +*** True Line Result + 7100,2980,7400,2980 +** Processing line: ~ 6840,3000,7100,2980~ +- Inside source: true +*** True Line Result + 6840,3000,7100,2980 +** Processing line: ~ 5620,2980,5840,2980~ +- Inside source: true +*** True Line Result + 5620,2980,5840,2980 +** Processing line: ~ 5840,2980,6500,3000~ +- Inside source: true +*** True Line Result + 5840,2980,6500,3000 +** Processing line: ~ 6500,3000,6840,3000~ +- Inside source: true +*** True Line Result + 6500,3000,6840,3000 +** Processing line: ~ 5560,2780,5620,2980~ +- Inside source: true +*** True Line Result + 5560,2780,5620,2980 +** Processing line: ~ 5560,2780,5560,2580~ +- Inside source: true +*** True Line Result + 5560,2780,5560,2580 +** Processing line: ~ 5560,2580,5560,2380~ +- Inside source: true +*** True Line Result + 5560,2580,5560,2380 +** Processing line: ~ 5560,2140,5560,2380~ +- Inside source: true +*** True Line Result + 5560,2140,5560,2380 +** Processing line: ~ 5560,2140,5560,1900~ +- Inside source: true +*** True Line Result + 5560,2140,5560,1900 +** Processing line: ~ 5560,1900,5620,1660~ +- Inside source: true +*** True Line Result + 5560,1900,5620,1660 +** Processing line: ~ 5620,1660,5660,1460~ +- Inside source: true +*** True Line Result + 5620,1660,5660,1460 +** Processing line: ~ 5660,1460,5660,1300~ +- Inside source: true +*** True Line Result + 5660,1460,5660,1300 +** Processing line: ~ 5500,1260,5660,1300~ +- Inside source: true +*** True Line Result + 5500,1260,5660,1300 +** Processing line: ~ 5340,1260,5500,1260~ +- Inside source: true +*** True Line Result + 5340,1260,5500,1260 +** Processing line: ~ 4600,1220,4840,1240~ +- Inside source: true +*** True Line Result + 4600,1220,4840,1240 +** Processing line: ~ 4440,1220,4600,1220~ +- Inside source: true +*** True Line Result + 4440,1220,4600,1220 +** Processing line: ~ 4440,1080,4440,1220~ +- Inside source: true +*** True Line Result + 4440,1080,4440,1220 +** Processing line: ~ 4440,1080,4600,1020~ +- Inside source: true +*** True Line Result + 4440,1080,4600,1020 +** Processing line: ~ 5080,1260,5340,1260~ +- Inside source: true +*** True Line Result + 5080,1260,5340,1260 +** Processing line: ~ 4840,1240,5080,1260~ +- Inside source: true +*** True Line Result + 4840,1240,5080,1260 +** Processing line: ~ 4600,1020,4940,1020~ +- Inside source: true +*** True Line Result + 4600,1020,4940,1020 +** Processing line: ~ 4940,1020,5220,1020~ +- Inside source: true +*** True Line Result + 4940,1020,5220,1020 +** Processing line: ~ 5220,1020,5560,960~ +- Inside source: true +*** True Line Result + 5220,1020,5560,960 +** Processing line: ~ 5560,960,5660,860~ +- Inside source: true +*** True Line Result + 5560,960,5660,860 +** Processing line: ~ 5660,740,5660,860~ +- Inside source: true +*** True Line Result + 5660,740,5660,860 +** Processing line: ~ 5280,740,5660,740~ +- Inside source: true +*** True Line Result + 5280,740,5660,740 +** Processing line: ~ 4940,780,5280,740~ +- Inside source: true +*** True Line Result + 4940,780,5280,740 +** Processing line: ~ 4660,760,4940,780~ +- Inside source: true +*** True Line Result + 4660,760,4940,780 +** Processing line: ~ 4500,700,4660,760~ +- Inside source: true +*** True Line Result + 4500,700,4660,760 +** Processing line: ~ 4500,520,4500,700~ +- Inside source: true +*** True Line Result + 4500,520,4500,700 +** Processing line: ~ 4500,520,4700,460~ +- Inside source: true +*** True Line Result + 4500,520,4700,460 +** Processing line: ~ 4700,460,5080,440~ +- Inside source: true +*** True Line Result + 4700,460,5080,440 +** Processing line: ~ 5440,420,5740,420~ +- Inside source: true +*** True Line Result + 5440,420,5740,420 +** Processing line: ~ 5080,440,5440,420~ +- Inside source: true +*** True Line Result + 5080,440,5440,420 +** Processing line: ~ 5740,420,5840,360~ +- Inside source: true +*** True Line Result + 5740,420,5840,360 +** Processing line: ~ 5800,280,5840,360~ +- Inside source: true +*** True Line Result + 5800,280,5840,360 +** Processing line: ~ 5560,280,5800,280~ +- Inside source: true +*** True Line Result + 5560,280,5800,280 +** Processing line: ~ 4980,300,5280,320~ +- Inside source: true +*** True Line Result + 4980,300,5280,320 +** Processing line: ~ 4360,320,4660,300~ +- Inside source: true +*** True Line Result + 4360,320,4660,300 +** Processing line: ~ 4200,360,4360,320~ +- Inside source: true +*** True Line Result + 4200,360,4360,320 +** Processing line: ~ 5280,320,5560,280~ +- Inside source: true +*** True Line Result + 5280,320,5560,280 +** Processing line: ~ 4660,300,4980,300~ +- Inside source: true +*** True Line Result + 4660,300,4980,300 +** Processing line: ~ 4140,480,4200,360~ +- Inside source: true +*** True Line Result + 4140,480,4200,360 +** Processing line: ~ 4140,480,4140,640~ +- Inside source: true +*** True Line Result + 4140,480,4140,640 +** Processing line: ~ 4140,640,4200,780~ +- Inside source: true +*** True Line Result + 4140,640,4200,780 +** Processing line: ~ 4200,780,4200,980~ +- Inside source: true +*** True Line Result + 4200,780,4200,980 +** Processing line: ~ 4200,980,4220,1180~ +- Inside source: true +*** True Line Result + 4200,980,4220,1180 +** Processing line: ~ 4220,1400,4220,1180~ +- Inside source: true +*** True Line Result + 4220,1400,4220,1180 +** Processing line: ~ 4220,1400,4260,1540~ +- Inside source: true +*** True Line Result + 4220,1400,4260,1540 +** Processing line: ~ 4260,1540,4500,1540~ +- Inside source: true +*** True Line Result + 4260,1540,4500,1540 +** Processing line: ~ 4500,1540,4700,1520~ +- Inside source: true +*** True Line Result + 4500,1540,4700,1520 +** Processing line: ~ 4700,1520,4980,1540~ +- Inside source: true +*** True Line Result + 4700,1520,4980,1540 +** Processing line: ~ 5280,1560,5400,1560~ +- Inside source: true +*** True Line Result + 5280,1560,5400,1560 +** Processing line: ~ 4980,1540,5280,1560~ +- Inside source: true +*** True Line Result + 4980,1540,5280,1560 +** Processing line: ~ 5400,1560,5400,1700~ +- Inside source: true +*** True Line Result + 5400,1560,5400,1700 +** Processing line: ~ 5400,1780,5400,1700~ +- Inside source: true +*** True Line Result + 5400,1780,5400,1700 +** Processing line: ~ 5340,1900,5400,1780~ +- Inside source: true +*** True Line Result + 5340,1900,5400,1780 +** Processing line: ~ 5340,2020,5340,1900~ +- Inside source: true +*** True Line Result + 5340,2020,5340,1900 +** Processing line: ~ 5340,2220,5340,2020~ +- Inside source: true +*** True Line Result + 5340,2220,5340,2020 +** Processing line: ~ 5340,2220,5340,2420~ +- Inside source: true +*** True Line Result + 5340,2220,5340,2420 +** Processing line: ~ 5340,2420,5340,2520~ +- Inside source: true +*** True Line Result + 5340,2420,5340,2520 +** Processing line: ~ 5080,2600,5220,2580~ +- Inside source: true +*** True Line Result + 5080,2600,5220,2580 +** Processing line: ~ 5220,2580,5340,2520~ +- Inside source: true +*** True Line Result + 5220,2580,5340,2520 +** Processing line: ~ 4900,2580,5080,2600~ +- Inside source: true +*** True Line Result + 4900,2580,5080,2600 +** Processing line: ~ 4700,2540,4900,2580~ +- Inside source: true +*** True Line Result + 4700,2540,4900,2580 +** Processing line: ~ 4500,2540,4700,2540~ +- Inside source: true +*** True Line Result + 4500,2540,4700,2540 +** Processing line: ~ 4220,2580,4340,2540~ +- Inside source: true +*** True Line Result + 4220,2580,4340,2540 +** Processing line: ~ 4200,2700,4220,2580~ +- Inside source: true +*** True Line Result + 4200,2700,4220,2580 +** Processing line: ~ 4340,2540,4500,2540~ +- Inside source: true +*** True Line Result + 4340,2540,4500,2540 +** Processing line: ~ 3980,2740,4200,2700~ +- Inside source: true +*** True Line Result + 3980,2740,4200,2700 +** Processing line: ~ 3840,2740,3980,2740~ +- Inside source: true +*** True Line Result + 3840,2740,3980,2740 +** Processing line: ~ 3780,2640,3840,2740~ +- Inside source: true +*** True Line Result + 3780,2640,3840,2740 +** Processing line: ~ 3780,2640,3780,2460~ +- Inside source: true +*** True Line Result + 3780,2640,3780,2460 +** Processing line: ~ 3780,2280,3780,2460~ +- Inside source: true +*** True Line Result + 3780,2280,3780,2460 +** Processing line: ~ 3620,2020,3780,2100~ +- Inside source: true +*** True Line Result + 3620,2020,3780,2100 +** Processing line: ~ 3780,2280,3780,2100~ +- Inside source: true +*** True Line Result + 3780,2280,3780,2100 +** Processing line: ~ 3360,2040,3620,2020~ +- Inside source: true +*** True Line Result + 3360,2040,3620,2020 +** Processing line: ~ 3080,2040,3360,2040~ +- Inside source: true +*** True Line Result + 3080,2040,3360,2040 +** Processing line: ~ 2840,2020,3080,2040~ +- Inside source: true +*** True Line Result + 2840,2020,3080,2040 +** Processing line: ~ 2740,1940,2840,2020~ +- Inside source: true +*** True Line Result + 2740,1940,2840,2020 +** Processing line: ~ 2740,1940,2800,1800~ +- Inside source: true +*** True Line Result + 2740,1940,2800,1800 +** Processing line: ~ 2800,1640,2800,1800~ +- Inside source: true +*** True Line Result + 2800,1640,2800,1800 +** Processing line: ~ 2800,1640,2800,1460~ +- Inside source: true +*** True Line Result + 2800,1640,2800,1460 +** Processing line: ~ 2800,1300,2800,1460~ +- Inside source: true +*** True Line Result + 2800,1300,2800,1460 +** Processing line: ~ 2700,1180,2800,1300~ +- Inside source: true +*** True Line Result + 2700,1180,2800,1300 +** Processing line: ~ 2480,1140,2700,1180~ +- Inside source: true +*** True Line Result + 2480,1140,2700,1180 +** Processing line: ~ 1580,1200,1720,1200~ +- Inside source: true +*** True Line Result + 1580,1200,1720,1200 +** Processing line: ~ 2240,1180,2480,1140~ +- Inside source: true +*** True Line Result + 2240,1180,2480,1140 +** Processing line: ~ 1960,1180,2240,1180~ +- Inside source: true +*** True Line Result + 1960,1180,2240,1180 +** Processing line: ~ 1720,1200,1960,1180~ +- Inside source: true +*** True Line Result + 1720,1200,1960,1180 +** Processing line: ~ 1500,1320,1580,1200~ +- Inside source: true +*** True Line Result + 1500,1320,1580,1200 +** Processing line: ~ 1500,1440,1500,1320~ +- Inside source: true +*** True Line Result + 1500,1440,1500,1320 +** Processing line: ~ 1500,1440,1760,1480~ +- Inside source: true +*** True Line Result + 1500,1440,1760,1480 +** Processing line: ~ 1760,1480,1940,1480~ +- Inside source: true +*** True Line Result + 1760,1480,1940,1480 +** Processing line: ~ 1940,1480,2140,1500~ +- Inside source: true +*** True Line Result + 1940,1480,2140,1500 +** Processing line: ~ 2140,1500,2320,1520~ +- Inside source: true +*** True Line Result + 2140,1500,2320,1520 +** Processing line: ~ 2400,1560,2400,1700~ +- Inside source: true +*** True Line Result + 2400,1560,2400,1700 +** Processing line: ~ 2280,1820,2380,1780~ +- Inside source: true +*** True Line Result + 2280,1820,2380,1780 +** Processing line: ~ 2320,1520,2400,1560~ +- Inside source: true +*** True Line Result + 2320,1520,2400,1560 +** Processing line: ~ 2380,1780,2400,1700~ +- Inside source: true +*** True Line Result + 2380,1780,2400,1700 +** Processing line: ~ 2080,1840,2280,1820~ +- Inside source: true +*** True Line Result + 2080,1840,2280,1820 +** Processing line: ~ 1720,1820,2080,1840~ +- Inside source: true +*** True Line Result + 1720,1820,2080,1840 +** Processing line: ~ 1420,1800,1720,1820~ +- Inside source: true +*** True Line Result + 1420,1800,1720,1820 +** Processing line: ~ 1280,1800,1420,1800~ +- Inside source: true +*** True Line Result + 1280,1800,1420,1800 +** Processing line: ~ 1240,1720,1280,1800~ +- Inside source: true +*** True Line Result + 1240,1720,1280,1800 +** Processing line: ~ 1240,1720,1240,1600~ +- Inside source: true +*** True Line Result + 1240,1720,1240,1600 +** Processing line: ~ 1240,1600,1280,1480~ +- Inside source: true +*** True Line Result + 1240,1600,1280,1480 +** Processing line: ~ 1280,1340,1280,1480~ +- Inside source: true +*** True Line Result + 1280,1340,1280,1480 +** Processing line: ~ 1180,1280,1280,1340~ +- Inside source: true +*** True Line Result + 1180,1280,1280,1340 +** Processing line: ~ 1000,1280,1180,1280~ +- Inside source: true +*** True Line Result + 1000,1280,1180,1280 +** Processing line: ~ 760,1280,1000,1280~ +- Inside source: true +*** True Line Result + 760,1280,1000,1280 +** Processing line: ~ 360,1240,540,1260~ +- Inside source: true +*** True Line Result + 360,1240,540,1260 +** Processing line: ~ 180,1220,360,1240~ +- Inside source: true +*** True Line Result + 180,1220,360,1240 +** Processing line: ~ 540,1260,760,1280~ +- Inside source: true +*** True Line Result + 540,1260,760,1280 +** Processing line: ~ 180,1080,180,1220~ +- Inside source: true +*** True Line Result + 180,1080,180,1220 +** Processing line: ~ 180,1080,180,1000~ +- Inside source: true +*** True Line Result + 180,1080,180,1000 +** Processing line: ~ 180,1000,360,940~ +- Inside source: true +*** True Line Result + 180,1000,360,940 +** Processing line: ~ 360,940,540,960~ +- Inside source: true +*** True Line Result + 360,940,540,960 +** Processing line: ~ 540,960,820,980~ +- Inside source: true +*** True Line Result + 540,960,820,980 +** Processing line: ~ 1100,980,1200,920~ +- Inside source: true +*** True Line Result + 1100,980,1200,920 +** Processing line: ~ 820,980,1100,980~ +- Inside source: true +*** True Line Result + 820,980,1100,980 +** Processing line: ~ 6640,11860,6940,11920~ +- Inside source: true +*** True Line Result + 6640,11860,6940,11920 +** Processing line: ~ 5200,11280,5500,11280~ +- Inside source: true +*** True Line Result + 5200,11280,5500,11280 +** Processing line: ~ 4120,7330,4120,7230~ +- Inside source: true +*** True Line Result + 4120,7330,4120,7230 +** Processing line: ~ 4120,7230,4660,7250~ +- Inside source: true +*** True Line Result + 4120,7230,4660,7250 +** Processing line: ~ 4660,7250,4940,7250~ +- Inside source: true +*** True Line Result + 4660,7250,4940,7250 +** Processing line: ~ 4940,7250,5050,7340~ +- Inside source: true +*** True Line Result + 4940,7250,5050,7340 +** Processing line: ~ 5010,7400,5050,7340~ +- Inside source: true +*** True Line Result + 5010,7400,5050,7340 +** Processing line: ~ 4680,7380,5010,7400~ +- Inside source: true +*** True Line Result + 4680,7380,5010,7400 +** Processing line: ~ 4380,7370,4680,7380~ +- Inside source: true +*** True Line Result + 4380,7370,4680,7380 +** Processing line: ~ 4120,7330,4360,7370~ +- Inside source: true +*** True Line Result + 4120,7330,4360,7370 +** Processing line: ~ 4120,7670,4120,7760~ +- Inside source: true +*** True Line Result + 4120,7670,4120,7760 +** Processing line: ~ 4120,7670,4280,7650~ +- Inside source: true +*** True Line Result + 4120,7670,4280,7650 +** Processing line: ~ 4280,7650,4540,7660~ +- Inside source: true +*** True Line Result + 4280,7650,4540,7660 +** Processing line: ~ 4550,7660,4820,7680~ +- Inside source: true +*** True Line Result + 4550,7660,4820,7680 +** Processing line: ~ 4820,7680,4900,7730~ +- Inside source: true +*** True Line Result + 4820,7680,4900,7730 +** Processing line: ~ 4880,7800,4900,7730~ +- Inside source: true +*** True Line Result + 4880,7800,4900,7730 +** Processing line: ~ 4620,7820,4880,7800~ +- Inside source: true +*** True Line Result + 4620,7820,4880,7800 +** Processing line: ~ 4360,7790,4620,7820~ +- Inside source: true +*** True Line Result + 4360,7790,4620,7820 +** Processing line: ~ 4120,7760,4360,7790~ +- Inside source: true +*** True Line Result + 4120,7760,4360,7790 +** Processing line: ~ 6840,6840,7040,6820~ +- Inside source: true +*** True Line Result + 6840,6840,7040,6820 +** Processing line: ~ 5720,4880,6120,4880~ +- Inside source: true +*** True Line Result + 5720,4880,6120,4880 +** Processing line: ~ 1200,920,1340,810~ +- Inside source: true +*** True Line Result + 1200,920,1340,810 +** Processing line: ~ 1340,810,1520,790~ +- Inside source: true +*** True Line Result + 1340,810,1520,790 +** Processing line: ~ 1520,790,1770,800~ +- Inside source: true +*** True Line Result + 1520,790,1770,800 +** Processing line: ~ 2400,790,2600,750~ +- Inside source: true +*** True Line Result + 2400,790,2600,750 +** Processing line: ~ 2600,750,2640,520~ +- Inside source: true +*** True Line Result + 2600,750,2640,520 +** Processing line: ~ 2520,470,2640,520~ +- Inside source: true +*** True Line Result + 2520,470,2640,520 +** Processing line: ~ 2140,470,2520,470~ +- Inside source: true +*** True Line Result + 2140,470,2520,470 +** Processing line: ~ 1760,800,2090,800~ +- Inside source: true +*** True Line Result + 1760,800,2090,800 +** Processing line: ~ 2080,800,2400,790~ +- Inside source: true +*** True Line Result + 2080,800,2400,790 +** Processing line: ~ 1760,450,2140,470~ +- Inside source: true +*** True Line Result + 1760,450,2140,470 +** Processing line: ~ 1420,450,1760,450~ +- Inside source: true +*** True Line Result + 1420,450,1760,450 +** Processing line: ~ 1180,440,1420,450~ +- Inside source: true +*** True Line Result + 1180,440,1420,450 +** Processing line: ~ 900,480,1180,440~ +- Inside source: true +*** True Line Result + 900,480,1180,440 +** Processing line: ~ 640,450,900,480~ +- Inside source: true +*** True Line Result + 640,450,900,480 +** Processing line: ~ 360,440,620,450~ +- Inside source: true +*** True Line Result + 360,440,620,450 +** Processing line: ~ 120,430,360,440~ +- Inside source: true +*** True Line Result + 120,430,360,440 +** Processing line: ~ 0,520,120,430~ +- Inside source: true +*** True Line Result + 0,520,120,430 +** Processing line: ~ -20,780,0,520~ +- Inside source: true +*** True Line Result + -20,780,0,520 +** Processing line: ~ -20,780,-20,1020~ +- Inside source: true +*** True Line Result + -20,780,-20,1020 +** Processing line: ~ -20,1020,-20,1150~ +- Inside source: true +*** True Line Result + -20,1020,-20,1150 +** Processing line: ~ -20,1150,0,1300~ +- Inside source: true +*** True Line Result + -20,1150,0,1300 +** Processing line: ~ 0,1470,60,1530~ +- Inside source: true +*** True Line Result + 0,1470,60,1530 +** Processing line: ~ 0,1300,0,1470~ +- Inside source: true +*** True Line Result + 0,1300,0,1470 +** Processing line: ~ 60,1530,360,1530~ +- Inside source: true +*** True Line Result + 60,1530,360,1530 +** Processing line: ~ 360,1530,660,1520~ +- Inside source: true +*** True Line Result + 360,1530,660,1520 +** Processing line: ~ 660,1520,980,1520~ +- Inside source: true +*** True Line Result + 660,1520,980,1520 +** Processing line: ~ 980,1520,1040,1520~ +- Inside source: true +*** True Line Result + 980,1520,1040,1520 +** Processing line: ~ 1040,1520,1070,1560~ +- Inside source: true +*** True Line Result + 1040,1520,1070,1560 +** Processing line: ~ 1070,1770,1070,1560~ +- Inside source: true +*** True Line Result + 1070,1770,1070,1560 +** Processing line: ~ 1070,1770,1100,2010~ +- Inside source: true +*** True Line Result + 1070,1770,1100,2010 +** Processing line: ~ 1070,2230,1100,2010~ +- Inside source: true +*** True Line Result + 1070,2230,1100,2010 +** Processing line: ~ 1070,2240,1180,2340~ +- Inside source: true +*** True Line Result + 1070,2240,1180,2340 +** Processing line: ~ 1180,2340,1580,2340~ +- Inside source: true +*** True Line Result + 1180,2340,1580,2340 +** Processing line: ~ 1580,2340,1940,2350~ +- Inside source: true +*** True Line Result + 1580,2340,1940,2350 +** Processing line: ~ 1940,2350,2440,2350~ +- Inside source: true +*** True Line Result + 1940,2350,2440,2350 +** Processing line: ~ 2440,2350,2560,2380~ +- Inside source: true +*** True Line Result + 2440,2350,2560,2380 +** Processing line: ~ 2560,2380,2600,2540~ +- Inside source: true +*** True Line Result + 2560,2380,2600,2540 +** Processing line: ~ 2810,2640,3140,2680~ +- Inside source: true +*** True Line Result + 2810,2640,3140,2680 +** Processing line: ~ 2600,2540,2810,2640~ +- Inside source: true +*** True Line Result + 2600,2540,2810,2640 +** Processing line: ~ 3140,2680,3230,2780~ +- Inside source: true +*** True Line Result + 3140,2680,3230,2780 +** Processing line: ~ 3230,2780,3260,2970~ +- Inside source: true +*** True Line Result + 3230,2780,3260,2970 +** Processing line: ~ 3230,3220,3260,2970~ +- Inside source: true +*** True Line Result + 3230,3220,3260,2970 +** Processing line: ~ 3200,3470,3230,3220~ +- Inside source: true +*** True Line Result + 3200,3470,3230,3220 +** Processing line: ~ 3200,3480,3210,3760~ +- Inside source: true +*** True Line Result + 3200,3480,3210,3760 +** Processing line: ~ 3210,3760,3210,4040~ +- Inside source: true +*** True Line Result + 3210,3760,3210,4040 +** Processing line: ~ 3200,4040,3230,4310~ +- Inside source: true +*** True Line Result + 3200,4040,3230,4310 +** Processing line: ~ 3210,4530,3230,4310~ +- Inside source: true +*** True Line Result + 3210,4530,3230,4310 +** Processing line: ~ 3210,4530,3230,4730~ +- Inside source: true +*** True Line Result + 3210,4530,3230,4730 +** Processing line: ~ 3230,4960,3230,4730~ +- Inside source: true +*** True Line Result + 3230,4960,3230,4730 +** Processing line: ~ 3230,4960,3260,5190~ +- Inside source: true +*** True Line Result + 3230,4960,3260,5190 +** Processing line: ~ 3170,5330,3260,5190~ +- Inside source: true +*** True Line Result + 3170,5330,3260,5190 +** Processing line: ~ 2920,5330,3170,5330~ +- Inside source: true +*** True Line Result + 2920,5330,3170,5330 +** Processing line: ~ 2660,5360,2920,5330~ +- Inside source: true +*** True Line Result + 2660,5360,2920,5330 +** Processing line: ~ 2420,5330,2660,5360~ +- Inside source: true +*** True Line Result + 2420,5330,2660,5360 +** Processing line: ~ 2200,5280,2400,5330~ +- Inside source: true +*** True Line Result + 2200,5280,2400,5330 +** Processing line: ~ 2020,5280,2200,5280~ +- Inside source: true +*** True Line Result + 2020,5280,2200,5280 +** Processing line: ~ 1840,5260,2020,5280~ +- Inside source: true +*** True Line Result + 1840,5260,2020,5280 +** Processing line: ~ 1660,5280,1840,5260~ +- Inside source: true +*** True Line Result + 1660,5280,1840,5260 +** Processing line: ~ 1500,5300,1660,5280~ +- Inside source: true +*** True Line Result + 1500,5300,1660,5280 +** Processing line: ~ 1360,5270,1500,5300~ +- Inside source: true +*** True Line Result + 1360,5270,1500,5300 +** Processing line: ~ 1200,5290,1340,5270~ +- Inside source: true +*** True Line Result + 1200,5290,1340,5270 +** Processing line: ~ 1070,5400,1200,5290~ +- Inside source: true +*** True Line Result + 1070,5400,1200,5290 +** Processing line: ~ 1040,5630,1070,5400~ +- Inside source: true +*** True Line Result + 1040,5630,1070,5400 +** Processing line: ~ 1000,5900,1040,5630~ +- Inside source: true +*** True Line Result + 1000,5900,1040,5630 +** Processing line: ~ 980,6170,1000,5900~ +- Inside source: true +*** True Line Result + 980,6170,1000,5900 +** Processing line: ~ 980,6280,980,6170~ +- Inside source: true +*** True Line Result + 980,6280,980,6170 +** Processing line: ~ 980,6540,980,6280~ +- Inside source: true +*** True Line Result + 980,6540,980,6280 +** Processing line: ~ 980,6540,1040,6720~ +- Inside source: true +*** True Line Result + 980,6540,1040,6720 +** Processing line: ~ 1040,6720,1360,6730~ +- Inside source: true +*** True Line Result + 1040,6720,1360,6730 +** Processing line: ~ 1360,6730,1760,6710~ +- Inside source: true +*** True Line Result + 1360,6730,1760,6710 +** Processing line: ~ 2110,6720,2420,6730~ +- Inside source: true +*** True Line Result + 2110,6720,2420,6730 +** Processing line: ~ 1760,6710,2110,6720~ +- Inside source: true +*** True Line Result + 1760,6710,2110,6720 +** Processing line: ~ 2420,6730,2640,6720~ +- Inside source: true +*** True Line Result + 2420,6730,2640,6720 +** Processing line: ~ 2640,6720,2970,6720~ +- Inside source: true +*** True Line Result + 2640,6720,2970,6720 +** Processing line: ~ 2970,6720,3160,6700~ +- Inside source: true +*** True Line Result + 2970,6720,3160,6700 +** Processing line: ~ 3160,6700,3240,6710~ +- Inside source: true +*** True Line Result + 3160,6700,3240,6710 +** Processing line: ~ 3240,6710,3260,6890~ +- Inside source: true +*** True Line Result + 3240,6710,3260,6890 +** Processing line: ~ 3260,7020,3260,6890~ +- Inside source: true +*** True Line Result + 3260,7020,3260,6890 +** Processing line: ~ 3230,7180,3260,7020~ +- Inside source: true +*** True Line Result + 3230,7180,3260,7020 +** Processing line: ~ 3230,7350,3230,7180~ +- Inside source: true +*** True Line Result + 3230,7350,3230,7180 +** Processing line: ~ 3210,7510,3230,7350~ +- Inside source: true +*** True Line Result + 3210,7510,3230,7350 +** Processing line: ~ 3210,7510,3210,7690~ +- Inside source: true +*** True Line Result + 3210,7510,3210,7690 +** Processing line: ~ 3210,7870,3210,7690~ +- Inside source: true +*** True Line Result + 3210,7870,3210,7690 +** Processing line: ~ 3210,7870,3210,7980~ +- Inside source: true +*** True Line Result + 3210,7870,3210,7980 +** Processing line: ~ 3200,8120,3210,7980~ +- Inside source: true +*** True Line Result + 3200,8120,3210,7980 +** Processing line: ~ 3200,8330,3200,8120~ +- Inside source: true +*** True Line Result + 3200,8330,3200,8120 +** Processing line: ~ 3160,8520,3200,8330~ +- Inside source: true +*** True Line Result + 3160,8520,3200,8330 +** Processing line: ~ 2460,11100,2480,11020~ +- Inside source: true +*** True Line Result + 2460,11100,2480,11020 +** Processing line: ~ 2200,11180,2460,11100~ +- Inside source: true +*** True Line Result + 2200,11180,2460,11100 +** Processing line: ~ 1260,11350,1600,11320~ +- Inside source: true +*** True Line Result + 1260,11350,1600,11320 +** Processing line: ~ 600,11430,930,11400~ +- Inside source: true +*** True Line Result + 600,11430,930,11400 +** Processing line: ~ 180,11340,620,11430~ +- Inside source: true +*** True Line Result + 180,11340,620,11430 +** Processing line: ~ 1600,11320,1910,11280~ +- Inside source: true +*** True Line Result + 1600,11320,1910,11280 +** Processing line: ~ 1910,11280,2200,11180~ +- Inside source: true +*** True Line Result + 1910,11280,2200,11180 +** Processing line: ~ 923.0029599285435,11398.99893503157,1264.002959928544,11351.99893503157~ +- Inside source: true +*** True Line Result + 923.0029599285435,11398.99893503157,1264.002959928544,11351.99893503157 +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Platformer - The Little Probe - Data - level_lava.txt~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Platformer - The Little Probe - Data - level_lava.txt +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_platformer/the_little_probe/data/level_lava.txt~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_platformer/the_little_probe/data/level_lava.txt +** Processing line: ~ 100,10740,500,10780~ +- Inside source: true +*** True Line Result + 100,10740,500,10780 +** Processing line: ~ 500,10780,960,10760~ +- Inside source: true +*** True Line Result + 500,10780,960,10760 +** Processing line: ~ 960,10760,1340,10760~ +- Inside source: true +*** True Line Result + 960,10760,1340,10760 +** Processing line: ~ 1380,10760,1820,10780~ +- Inside source: true +*** True Line Result + 1380,10760,1820,10780 +** Processing line: ~ 1820,10780,2240,10780~ +- Inside source: true +*** True Line Result + 1820,10780,2240,10780 +** Processing line: ~ 2280,10780,2740,10740~ +- Inside source: true +*** True Line Result + 2280,10780,2740,10740 +** Processing line: ~ 2740,10740,3000,10780~ +- Inside source: true +*** True Line Result + 2740,10740,3000,10780 +** Processing line: ~ 3000,10780,3140,11020~ +- Inside source: true +*** True Line Result + 3000,10780,3140,11020 +** Processing line: ~ -520,8820,-480,9160~ +- Inside source: true +*** True Line Result + -520,8820,-480,9160 +** Processing line: ~ -520,8480,-520,8820~ +- Inside source: true +*** True Line Result + -520,8480,-520,8820 +** Processing line: ~ -520,8480,-480,8180~ +- Inside source: true +*** True Line Result + -520,8480,-480,8180 +** Processing line: ~ -480,8180,-200,8120~ +- Inside source: true +*** True Line Result + -480,8180,-200,8120 +** Processing line: ~ -200,8120,100,8220~ +- Inside source: true +*** True Line Result + -200,8120,100,8220 +** Processing line: ~ 100,8220,420,8240~ +- Inside source: true +*** True Line Result + 100,8220,420,8240 +** Processing line: ~ 420,8240,760,8260~ +- Inside source: true +*** True Line Result + 420,8240,760,8260 +** Processing line: ~ 760,8260,1140,8280~ +- Inside source: true +*** True Line Result + 760,8260,1140,8280 +** Processing line: ~ 1140,8280,1500,8200~ +- Inside source: true +*** True Line Result + 1140,8280,1500,8200 +** Processing line: ~ 1500,8200,1880,8240~ +- Inside source: true +*** True Line Result + 1500,8200,1880,8240 +** Processing line: ~ 1880,8240,2240,8260~ +- Inside source: true +*** True Line Result + 1880,8240,2240,8260 +** Processing line: ~ 2240,8260,2320,8480~ +- Inside source: true +*** True Line Result + 2240,8260,2320,8480 +** Processing line: ~ 2320,8480,2380,8680~ +- Inside source: true +*** True Line Result + 2320,8480,2380,8680 +** Processing line: ~ 2240,8860,2380,8680~ +- Inside source: true +*** True Line Result + 2240,8860,2380,8680 +** Processing line: ~ 2240,9080,2240,8860~ +- Inside source: true +*** True Line Result + 2240,9080,2240,8860 +** Processing line: ~ 2240,9080,2320,9260~ +- Inside source: true +*** True Line Result + 2240,9080,2320,9260 +** Processing line: ~ 2320,9260,2480,9440~ +- Inside source: true +*** True Line Result + 2320,9260,2480,9440 +** Processing line: ~ 2480,9440,2600,9640~ +- Inside source: true +*** True Line Result + 2480,9440,2600,9640 +** Processing line: ~ 2480,9840,2600,9640~ +- Inside source: true +*** True Line Result + 2480,9840,2600,9640 +** Processing line: ~ 2400,10020,2480,9840~ +- Inside source: true +*** True Line Result + 2400,10020,2480,9840 +** Processing line: ~ 2240,10080,2400,10020~ +- Inside source: true +*** True Line Result + 2240,10080,2400,10020 +** Processing line: ~ 1960,10080,2240,10080~ +- Inside source: true +*** True Line Result + 1960,10080,2240,10080 +** Processing line: ~ 1720,10080,1960,10080~ +- Inside source: true +*** True Line Result + 1720,10080,1960,10080 +** Processing line: ~ 1460,10080,1720,10080~ +- Inside source: true +*** True Line Result + 1460,10080,1720,10080 +** Processing line: ~ 1180,10080,1420,10080~ +- Inside source: true +*** True Line Result + 1180,10080,1420,10080 +** Processing line: ~ 900,10080,1180,10080~ +- Inside source: true +*** True Line Result + 900,10080,1180,10080 +** Processing line: ~ 640,10080,900,10080~ +- Inside source: true +*** True Line Result + 640,10080,900,10080 +** Processing line: ~ 640,10080,640,9900~ +- Inside source: true +*** True Line Result + 640,10080,640,9900 +** Processing line: ~ 60,10520,100,10740~ +- Inside source: true +*** True Line Result + 60,10520,100,10740 +** Processing line: ~ 40,10240,60,10520~ +- Inside source: true +*** True Line Result + 40,10240,60,10520 +** Processing line: ~ 40,10240,40,9960~ +- Inside source: true +*** True Line Result + 40,10240,40,9960 +** Processing line: ~ 40,9960,40,9680~ +- Inside source: true +*** True Line Result + 40,9960,40,9680 +** Processing line: ~ 40,9680,40,9360~ +- Inside source: true +*** True Line Result + 40,9680,40,9360 +** Processing line: ~ 40,9360,60,9080~ +- Inside source: true +*** True Line Result + 40,9360,60,9080 +** Processing line: ~ 60,9080,100,8860~ +- Inside source: true +*** True Line Result + 60,9080,100,8860 +** Processing line: ~ 100,8860,460,9040~ +- Inside source: true +*** True Line Result + 100,8860,460,9040 +** Processing line: ~ 460,9040,760,9220~ +- Inside source: true +*** True Line Result + 460,9040,760,9220 +** Processing line: ~ 760,9220,1140,9220~ +- Inside source: true +*** True Line Result + 760,9220,1140,9220 +** Processing line: ~ 1140,9220,1720,9200~ +- Inside source: true +*** True Line Result + 1140,9220,1720,9200 +** Processing line: ~ -660,11580,-600,11420~ +- Inside source: true +*** True Line Result + -660,11580,-600,11420 +** Processing line: ~ -660,11800,-660,11580~ +- Inside source: true +*** True Line Result + -660,11800,-660,11580 +** Processing line: ~ -660,12000,-660,11800~ +- Inside source: true +*** True Line Result + -660,12000,-660,11800 +** Processing line: ~ -660,12000,-600,12220~ +- Inside source: true +*** True Line Result + -660,12000,-600,12220 +** Processing line: ~ -600,12220,-600,12440~ +- Inside source: true +*** True Line Result + -600,12220,-600,12440 +** Processing line: ~ -600,12440,-600,12640~ +- Inside source: true +*** True Line Result + -600,12440,-600,12640 +** Processing line: ~ -600,11240,-260,11280~ +- Inside source: true +*** True Line Result + -600,11240,-260,11280 +** Processing line: ~ -260,11280,100,11240~ +- Inside source: true +*** True Line Result + -260,11280,100,11240 +** Processing line: ~ 9000,12360,9020,12400~ +- Inside source: true +*** True Line Result + 9000,12360,9020,12400 +** Processing line: ~ 9020,12620,9020,12400~ +- Inside source: true +*** True Line Result + 9020,12620,9020,12400 +** Processing line: ~ 9020,12840,9020,12620~ +- Inside source: true +*** True Line Result + 9020,12840,9020,12620 +** Processing line: ~ 9020,13060,9020,12840~ +- Inside source: true +*** True Line Result + 9020,13060,9020,12840 +** Processing line: ~ 9020,13060,9020,13240~ +- Inside source: true +*** True Line Result + 9020,13060,9020,13240 +** Processing line: ~ 9020,13240,9020,13420~ +- Inside source: true +*** True Line Result + 9020,13240,9020,13420 +** Processing line: ~ 9020,13420,9020,13600~ +- Inside source: true +*** True Line Result + 9020,13420,9020,13600 +** Processing line: ~ 9020,13600,9020,13780~ +- Inside source: true +*** True Line Result + 9020,13600,9020,13780 +** Processing line: ~ 8880,13900,9020,13780~ +- Inside source: true +*** True Line Result + 8880,13900,9020,13780 +** Processing line: ~ 8560,13800,8880,13900~ +- Inside source: true +*** True Line Result + 8560,13800,8880,13900 +** Processing line: ~ 8220,13780,8560,13800~ +- Inside source: true +*** True Line Result + 8220,13780,8560,13800 +** Processing line: ~ 7860,13760,8220,13780~ +- Inside source: true +*** True Line Result + 7860,13760,8220,13780 +** Processing line: ~ 7640,13780,7860,13760~ +- Inside source: true +*** True Line Result + 7640,13780,7860,13760 +** Processing line: ~ 7360,13800,7640,13780~ +- Inside source: true +*** True Line Result + 7360,13800,7640,13780 +** Processing line: ~ 7100,13800,7360,13800~ +- Inside source: true +*** True Line Result + 7100,13800,7360,13800 +** Processing line: ~ 6540,13760,6800,13780~ +- Inside source: true +*** True Line Result + 6540,13760,6800,13780 +** Processing line: ~ 6800,13780,7100,13800~ +- Inside source: true +*** True Line Result + 6800,13780,7100,13800 +** Processing line: ~ 6280,13760,6540,13760~ +- Inside source: true +*** True Line Result + 6280,13760,6540,13760 +** Processing line: ~ 5760,13760,6280,13760~ +- Inside source: true +*** True Line Result + 5760,13760,6280,13760 +** Processing line: ~ 5220,13780,5760,13760~ +- Inside source: true +*** True Line Result + 5220,13780,5760,13760 +** Processing line: ~ 4700,13760,5220,13780~ +- Inside source: true +*** True Line Result + 4700,13760,5220,13780 +** Processing line: ~ 4200,13740,4700,13760~ +- Inside source: true +*** True Line Result + 4200,13740,4700,13760 +** Processing line: ~ 3680,13720,4200,13740~ +- Inside source: true +*** True Line Result + 3680,13720,4200,13740 +** Processing line: ~ 3140,13700,3680,13720~ +- Inside source: true +*** True Line Result + 3140,13700,3680,13720 +** Processing line: ~ 2600,13680,3140,13700~ +- Inside source: true +*** True Line Result + 2600,13680,3140,13700 +** Processing line: ~ 2040,13940,2600,13680~ +- Inside source: true +*** True Line Result + 2040,13940,2600,13680 +** Processing line: ~ 1640,13940,2040,13940~ +- Inside source: true +*** True Line Result + 1640,13940,2040,13940 +** Processing line: ~ 1200,13960,1640,13940~ +- Inside source: true +*** True Line Result + 1200,13960,1640,13940 +** Processing line: ~ 840,14000,1200,13960~ +- Inside source: true +*** True Line Result + 840,14000,1200,13960 +** Processing line: ~ 300,13960,840,14000~ +- Inside source: true +*** True Line Result + 300,13960,840,14000 +** Processing line: ~ -200,13900,300,13960~ +- Inside source: true +*** True Line Result + -200,13900,300,13960 +** Processing line: ~ -600,12840,-600,12640~ +- Inside source: true +*** True Line Result + -600,12840,-600,12640 +** Processing line: ~ -600,13140,-600,12840~ +- Inside source: true +*** True Line Result + -600,13140,-600,12840 +** Processing line: ~ -600,13140,-600,13420~ +- Inside source: true +*** True Line Result + -600,13140,-600,13420 +** Processing line: ~ -600,13700,-600,13420~ +- Inside source: true +*** True Line Result + -600,13700,-600,13420 +** Processing line: ~ -600,13700,-600,13820~ +- Inside source: true +*** True Line Result + -600,13700,-600,13820 +** Processing line: ~ -600,13820,-200,13900~ +- Inside source: true +*** True Line Result + -600,13820,-200,13900 +** Processing line: ~ -600,11240,-560,11000~ +- Inside source: true +*** True Line Result + -600,11240,-560,11000 +** Processing line: ~ -560,11000,-480,10840~ +- Inside source: true +*** True Line Result + -560,11000,-480,10840 +** Processing line: ~ -520,10660,-480,10840~ +- Inside source: true +*** True Line Result + -520,10660,-480,10840 +** Processing line: ~ -520,10660,-520,10480~ +- Inside source: true +*** True Line Result + -520,10660,-520,10480 +** Processing line: ~ -520,10480,-520,10300~ +- Inside source: true +*** True Line Result + -520,10480,-520,10300 +** Processing line: ~ -520,10260,-480,10080~ +- Inside source: true +*** True Line Result + -520,10260,-480,10080 +** Processing line: ~ -480,9880,-440,10060~ +- Inside source: true +*** True Line Result + -480,9880,-440,10060 +** Processing line: ~ -520,9680,-480,9880~ +- Inside source: true +*** True Line Result + -520,9680,-480,9880 +** Processing line: ~ -520,9680,-480,9400~ +- Inside source: true +*** True Line Result + -520,9680,-480,9400 +** Processing line: ~ -480,9400,-480,9160~ +- Inside source: true +*** True Line Result + -480,9400,-480,9160 +** Processing line: ~ 1820,9880,2140,9800~ +- Inside source: true +*** True Line Result + 1820,9880,2140,9800 +** Processing line: ~ 1540,9880,1820,9880~ +- Inside source: true +*** True Line Result + 1540,9880,1820,9880 +** Processing line: ~ 1200,9920,1500,9880~ +- Inside source: true +*** True Line Result + 1200,9920,1500,9880 +** Processing line: ~ 900,9880,1200,9920~ +- Inside source: true +*** True Line Result + 900,9880,1200,9920 +** Processing line: ~ 640,9900,840,9880~ +- Inside source: true +*** True Line Result + 640,9900,840,9880 +** Processing line: ~ 2380,8760,2800,8760~ +- Inside source: true +*** True Line Result + 2380,8760,2800,8760 +** Processing line: ~ 2800,8760,2840,8660~ +- Inside source: true +*** True Line Result + 2800,8760,2840,8660 +** Processing line: ~ 2840,8660,2840,8420~ +- Inside source: true +*** True Line Result + 2840,8660,2840,8420 +** Processing line: ~ 2840,8160,2840,8420~ +- Inside source: true +*** True Line Result + 2840,8160,2840,8420 +** Processing line: ~ 2800,7900,2840,8160~ +- Inside source: true +*** True Line Result + 2800,7900,2840,8160 +** Processing line: ~ 2800,7900,2800,7720~ +- Inside source: true +*** True Line Result + 2800,7900,2800,7720 +** Processing line: ~ 2800,7540,2800,7720~ +- Inside source: true +*** True Line Result + 2800,7540,2800,7720 +** Processing line: ~ 2800,7540,2800,7360~ +- Inside source: true +*** True Line Result + 2800,7540,2800,7360 +** Processing line: ~ 2700,7220,2800,7360~ +- Inside source: true +*** True Line Result + 2700,7220,2800,7360 +** Processing line: ~ 2400,7220,2700,7220~ +- Inside source: true +*** True Line Result + 2400,7220,2700,7220 +** Processing line: ~ 2080,7240,2400,7220~ +- Inside source: true +*** True Line Result + 2080,7240,2400,7220 +** Processing line: ~ 1760,7320,2080,7240~ +- Inside source: true +*** True Line Result + 1760,7320,2080,7240 +** Processing line: ~ 1380,7360,1720,7320~ +- Inside source: true +*** True Line Result + 1380,7360,1720,7320 +** Processing line: ~ 1040,7400,1340,7360~ +- Inside source: true +*** True Line Result + 1040,7400,1340,7360 +** Processing line: ~ 640,7400,1000,7420~ +- Inside source: true +*** True Line Result + 640,7400,1000,7420 +** Processing line: ~ 300,7380,640,7400~ +- Inside source: true +*** True Line Result + 300,7380,640,7400 +** Processing line: ~ 0,7300,240,7380~ +- Inside source: true +*** True Line Result + 0,7300,240,7380 +** Processing line: ~ -300,7180,-60,7300~ +- Inside source: true +*** True Line Result + -300,7180,-60,7300 +** Processing line: ~ -380,6860,-360,7180~ +- Inside source: true +*** True Line Result + -380,6860,-360,7180 +** Processing line: ~ -380,6880,-360,6700~ +- Inside source: true +*** True Line Result + -380,6880,-360,6700 +** Processing line: ~ -360,6700,-260,6540~ +- Inside source: true +*** True Line Result + -360,6700,-260,6540 +** Processing line: ~ -260,6540,0,6520~ +- Inside source: true +*** True Line Result + -260,6540,0,6520 +** Processing line: ~ 0,6520,240,6640~ +- Inside source: true +*** True Line Result + 0,6520,240,6640 +** Processing line: ~ 240,6640,460,6640~ +- Inside source: true +*** True Line Result + 240,6640,460,6640 +** Processing line: ~ 460,6640,500,6480~ +- Inside source: true +*** True Line Result + 460,6640,500,6480 +** Processing line: ~ 500,6260,500,6480~ +- Inside source: true +*** True Line Result + 500,6260,500,6480 +** Processing line: ~ 460,6060,500,6260~ +- Inside source: true +*** True Line Result + 460,6060,500,6260 +** Processing line: ~ 460,5860,460,6060~ +- Inside source: true +*** True Line Result + 460,5860,460,6060 +** Processing line: ~ 460,5860,500,5640~ +- Inside source: true +*** True Line Result + 460,5860,500,5640 +** Processing line: ~ 500,5640,540,5440~ +- Inside source: true +*** True Line Result + 500,5640,540,5440 +** Processing line: ~ 540,5440,580,5220~ +- Inside source: true +*** True Line Result + 540,5440,580,5220 +** Processing line: ~ 580,5220,580,5000~ +- Inside source: true +*** True Line Result + 580,5220,580,5000 +** Processing line: ~ 580,4960,580,4740~ +- Inside source: true +*** True Line Result + 580,4960,580,4740 +** Processing line: ~ 580,4740,960,4700~ +- Inside source: true +*** True Line Result + 580,4740,960,4700 +** Processing line: ~ 960,4700,1140,4760~ +- Inside source: true +*** True Line Result + 960,4700,1140,4760 +** Processing line: ~ 1140,4760,1420,4740~ +- Inside source: true +*** True Line Result + 1140,4760,1420,4740 +** Processing line: ~ 1420,4740,1720,4700~ +- Inside source: true +*** True Line Result + 1420,4740,1720,4700 +** Processing line: ~ 1720,4700,2000,4740~ +- Inside source: true +*** True Line Result + 1720,4700,2000,4740 +** Processing line: ~ 2000,4740,2380,4760~ +- Inside source: true +*** True Line Result + 2000,4740,2380,4760 +** Processing line: ~ 2380,4760,2700,4800~ +- Inside source: true +*** True Line Result + 2380,4760,2700,4800 +** Processing line: ~ 1720,4600,1760,4300~ +- Inside source: true +*** True Line Result + 1720,4600,1760,4300 +** Processing line: ~ 1760,4300,2200,4340~ +- Inside source: true +*** True Line Result + 1760,4300,2200,4340 +** Processing line: ~ 2200,4340,2560,4340~ +- Inside source: true +*** True Line Result + 2200,4340,2560,4340 +** Processing line: ~ 2560,4340,2740,4340~ +- Inside source: true +*** True Line Result + 2560,4340,2740,4340 +** Processing line: ~ 2160,12580,2440,12400~ +- Inside source: true +*** True Line Result + 2160,12580,2440,12400 +** Processing line: ~ 1820,12840,2160,12580~ +- Inside source: true +*** True Line Result + 1820,12840,2160,12580 +** Processing line: ~ 1500,13080,1820,12840~ +- Inside source: true +*** True Line Result + 1500,13080,1820,12840 +** Processing line: ~ 1140,13340,1500,13080~ +- Inside source: true +*** True Line Result + 1140,13340,1500,13080 +** Processing line: ~ 1140,13340,1580,13220~ +- Inside source: true +*** True Line Result + 1140,13340,1580,13220 +** Processing line: ~ 2110,13080,2520,13000~ +- Inside source: true +*** True Line Result + 2110,13080,2520,13000 +** Processing line: ~ 2520,13000,2900,12800~ +- Inside source: true +*** True Line Result + 2520,13000,2900,12800 +** Processing line: ~ 1580,13220,2110,13080~ +- Inside source: true +*** True Line Result + 1580,13220,2110,13080 +** Processing line: ~ 2900,12800,3200,12680~ +- Inside source: true +*** True Line Result + 2900,12800,3200,12680 +** Processing line: ~ 3200,12680,3440,12640~ +- Inside source: true +*** True Line Result + 3200,12680,3440,12640 +** Processing line: ~ 3440,12640,3720,12460~ +- Inside source: true +*** True Line Result + 3440,12640,3720,12460 +** Processing line: ~ 3720,12460,4040,12320~ +- Inside source: true +*** True Line Result + 3720,12460,4040,12320 +** Processing line: ~ 4040,12320,4360,12200~ +- Inside source: true +*** True Line Result + 4040,12320,4360,12200 +** Processing line: ~ 4360,11940,4380,12180~ +- Inside source: true +*** True Line Result + 4360,11940,4380,12180 +** Processing line: ~ 4360,11700,4360,11940~ +- Inside source: true +*** True Line Result + 4360,11700,4360,11940 +** Processing line: ~ 4360,11700,4540,11500~ +- Inside source: true +*** True Line Result + 4360,11700,4540,11500 +** Processing line: ~ 4540,11500,4880,11540~ +- Inside source: true +*** True Line Result + 4540,11500,4880,11540 +** Processing line: ~ 6000,11660,6280,11640~ +- Inside source: true +*** True Line Result + 6000,11660,6280,11640 +** Processing line: ~ 5440,11600,5720,11610~ +- Inside source: true +*** True Line Result + 5440,11600,5720,11610 +** Processing line: ~ 5720,11610,6000,11660~ +- Inside source: true +*** True Line Result + 5720,11610,6000,11660 +** Processing line: ~ 6280,11640,6760,11720~ +- Inside source: true +*** True Line Result + 6280,11640,6760,11720 +** Processing line: ~ 6760,11720,7060,11780~ +- Inside source: true +*** True Line Result + 6760,11720,7060,11780 +** Processing line: ~ 7060,11780,7360,11810~ +- Inside source: true +*** True Line Result + 7060,11780,7360,11810 +** Processing line: ~ 7360,11810,7640,11840~ +- Inside source: true +*** True Line Result + 7360,11810,7640,11840 +** Processing line: ~ 7640,11840,8000,11830~ +- Inside source: true +*** True Line Result + 7640,11840,8000,11830 +** Processing line: ~ 8000,11830,8320,11850~ +- Inside source: true +*** True Line Result + 8000,11830,8320,11850 +** Processing line: ~ 8320,11850,8390,11800~ +- Inside source: true +*** True Line Result + 8320,11850,8390,11800 +** Processing line: ~ 8330,11760,8390,11800~ +- Inside source: true +*** True Line Result + 8330,11760,8390,11800 +** Processing line: ~ 8160,11760,8330,11760~ +- Inside source: true +*** True Line Result + 8160,11760,8330,11760 +** Processing line: ~ 7910,11750,8160,11760~ +- Inside source: true +*** True Line Result + 7910,11750,8160,11760 +** Processing line: ~ 7660,11740,7900,11750~ +- Inside source: true +*** True Line Result + 7660,11740,7900,11750 +** Processing line: ~ 7400,11730,7660,11740~ +- Inside source: true +*** True Line Result + 7400,11730,7660,11740 +** Processing line: ~ 7160,11680,7400,11730~ +- Inside source: true +*** True Line Result + 7160,11680,7400,11730 +** Processing line: ~ 7080,11570,7160,11680~ +- Inside source: true +*** True Line Result + 7080,11570,7160,11680 +** Processing line: ~ 7080,11570,7100,11350~ +- Inside source: true +*** True Line Result + 7080,11570,7100,11350 +** Processing line: ~ 7100,11350,7440,11280~ +- Inside source: true +*** True Line Result + 7100,11350,7440,11280 +** Processing line: ~ 7440,11280,7940,11280~ +- Inside source: true +*** True Line Result + 7440,11280,7940,11280 +** Processing line: ~ 7960,11280,8360,11280~ +- Inside source: true +*** True Line Result + 7960,11280,8360,11280 +** Processing line: ~ 5840,11540,6650,11170~ +- Inside source: true +*** True Line Result + 5840,11540,6650,11170 +** Processing line: ~ 4880,11540,5440,11600~ +- Inside source: true +*** True Line Result + 4880,11540,5440,11600 +** Processing line: ~ 3410,11830,3420,11300~ +- Inside source: true +*** True Line Result + 3410,11830,3420,11300 +** Processing line: ~ 3410,11260,3520,10920~ +- Inside source: true +*** True Line Result + 3410,11260,3520,10920 +** Processing line: ~ 3520,10590,3520,10920~ +- Inside source: true +*** True Line Result + 3520,10590,3520,10920 +** Processing line: ~ 3520,10590,3540,10260~ +- Inside source: true +*** True Line Result + 3520,10590,3540,10260 +** Processing line: ~ 3520,9900,3540,10240~ +- Inside source: true +*** True Line Result + 3520,9900,3540,10240 +** Processing line: ~ 3520,9900,3640,9590~ +- Inside source: true +*** True Line Result + 3520,9900,3640,9590 +** Processing line: ~ 3640,9570,4120,9590~ +- Inside source: true +*** True Line Result + 3640,9570,4120,9590 +** Processing line: ~ 4140,9590,4600,9680~ +- Inside source: true +*** True Line Result + 4140,9590,4600,9680 +** Processing line: ~ 4620,9680,5030,9730~ +- Inside source: true +*** True Line Result + 4620,9680,5030,9730 +** Processing line: ~ 5120,9750,5520,9800~ +- Inside source: true +*** True Line Result + 5120,9750,5520,9800 +** Processing line: ~ 5620,9820,6080,9800~ +- Inside source: true +*** True Line Result + 5620,9820,6080,9800 +** Processing line: ~ 6130,9810,6580,9820~ +- Inside source: true +*** True Line Result + 6130,9810,6580,9820 +** Processing line: ~ 6640,9820,6800,9700~ +- Inside source: true +*** True Line Result + 6640,9820,6800,9700 +** Processing line: ~ 6780,9400,6800,9700~ +- Inside source: true +*** True Line Result + 6780,9400,6800,9700 +** Processing line: ~ 6780,9400,6840,9140~ +- Inside source: true +*** True Line Result + 6780,9400,6840,9140 +** Processing line: ~ 6820,8860,6840,9120~ +- Inside source: true +*** True Line Result + 6820,8860,6840,9120 +** Processing line: ~ 6780,8600,6820,8830~ +- Inside source: true +*** True Line Result + 6780,8600,6820,8830 +** Processing line: ~ 6720,8350,6780,8570~ +- Inside source: true +*** True Line Result + 6720,8350,6780,8570 +** Processing line: ~ 6480,8340,6720,8320~ +- Inside source: true +*** True Line Result + 6480,8340,6720,8320 +** Processing line: ~ 6260,8400,6480,8340~ +- Inside source: true +*** True Line Result + 6260,8400,6480,8340 +** Processing line: ~ 6050,8580,6240,8400~ +- Inside source: true +*** True Line Result + 6050,8580,6240,8400 +** Processing line: ~ 5760,8630,6040,8590~ +- Inside source: true +*** True Line Result + 5760,8630,6040,8590 +** Processing line: ~ 5520,8690,5740,8630~ +- Inside source: true +*** True Line Result + 5520,8690,5740,8630 +** Processing line: ~ 5120,8690,5450,8700~ +- Inside source: true +*** True Line Result + 5120,8690,5450,8700 +** Processing line: ~ 4570,8670,5080,8690~ +- Inside source: true +*** True Line Result + 4570,8670,5080,8690 +** Processing line: ~ 4020,8610,4540,8670~ +- Inside source: true +*** True Line Result + 4020,8610,4540,8670 +** Processing line: ~ 3540,8480,4020,8610~ +- Inside source: true +*** True Line Result + 3540,8480,4020,8610 +** Processing line: ~ 3520,8230,3520,8480~ +- Inside source: true +*** True Line Result + 3520,8230,3520,8480 +** Processing line: ~ 3520,7930,3520,8230~ +- Inside source: true +*** True Line Result + 3520,7930,3520,8230 +** Processing line: ~ 3520,7930,3540,7630~ +- Inside source: true +*** True Line Result + 3520,7930,3540,7630 +** Processing line: ~ 3480,7320,3540,7610~ +- Inside source: true +*** True Line Result + 3480,7320,3540,7610 +** Processing line: ~ 3480,7280,3500,7010~ +- Inside source: true +*** True Line Result + 3480,7280,3500,7010 +** Processing line: ~ 3500,6980,3680,6850~ +- Inside source: true +*** True Line Result + 3500,6980,3680,6850 +** Processing line: ~ 3680,6850,4220,6840~ +- Inside source: true +*** True Line Result + 3680,6850,4220,6840 +** Processing line: ~ 4230,6840,4760,6850~ +- Inside source: true +*** True Line Result + 4230,6840,4760,6850 +** Processing line: ~ 4780,6850,5310,6860~ +- Inside source: true +*** True Line Result + 4780,6850,5310,6860 +** Processing line: ~ 5310,6860,5720,6940~ +- Inside source: true +*** True Line Result + 5310,6860,5720,6940 +** Processing line: ~ 5720,6940,5880,7250~ +- Inside source: true +*** True Line Result + 5720,6940,5880,7250 +** Processing line: ~ 5880,7250,5900,7520~ +- Inside source: true +*** True Line Result + 5880,7250,5900,7520 +** Processing line: ~ 100,11240,440,11300~ +- Inside source: true +*** True Line Result + 100,11240,440,11300 +** Processing line: ~ 440,11300,760,11330~ +- Inside source: true +*** True Line Result + 440,11300,760,11330 +** Processing line: ~ 1480,11280,1840,11230~ +- Inside source: true +*** True Line Result + 1480,11280,1840,11230 +** Processing line: ~ 2200,11130,2360,11090~ +- Inside source: true +*** True Line Result + 2200,11130,2360,11090 +** Processing line: ~ 1840,11230,2200,11130~ +- Inside source: true +*** True Line Result + 1840,11230,2200,11130 +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Narrative - Choose Your Own Adventure - decision.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Choose Your Own Adventure - decision.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/decision.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/decision.rb +** Processing line: ~ # Hey there! Welcome to Four Decisions. Here is how you~ +- Inside source: true +*** True Line Result + # Hey there! Welcome to Four Decisions. Here is how you +** Processing line: ~ # create your decision tree. Remove =being and =end from the text to~ +- Inside source: true +*** True Line Result + # create your decision tree. Remove =being and =end from the text to +** Processing line: ~ # enable the game (just save the file). Change stuff and see what happens!~ +- Inside source: true +*** True Line Result + # enable the game (just save the file). Change stuff and see what happens! +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def game~ +- Inside source: true +*** True Line Result + def game +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ starting_decision: :stormy_night,~ +- Inside source: true +*** True Line Result + starting_decision: :stormy_night, +** Processing line: ~ decisions: {~ +- Inside source: true +*** True Line Result + decisions: { +** Processing line: ~ stormy_night: {~ +- Inside source: true +*** True Line Result + stormy_night: { +** Processing line: ~ description: 'It was a dark and stormy night. (storyline located in decision.rb)',~ +- Inside source: true +*** True Line Result + description: 'It was a dark and stormy night. (storyline located in decision.rb)', +** Processing line: ~ option_one: {~ +- Inside source: true +*** True Line Result + option_one: { +** Processing line: ~ description: 'Go to sleep.',~ +- Inside source: true +*** True Line Result + description: 'Go to sleep.', +** Processing line: ~ decision: :nap~ +- Inside source: true +*** True Line Result + decision: :nap +** Processing line: ~ },~ +- Inside source: true +*** True Line Result + }, +** Processing line: ~ option_two: {~ +- Inside source: true +*** True Line Result + option_two: { +** Processing line: ~ description: 'Watch a movie.',~ +- Inside source: true +*** True Line Result + description: 'Watch a movie.', +** Processing line: ~ decision: :movie~ +- Inside source: true +*** True Line Result + decision: :movie +** Processing line: ~ },~ +- Inside source: true +*** True Line Result + }, +** Processing line: ~ option_three: {~ +- Inside source: true +*** True Line Result + option_three: { +** Processing line: ~ description: 'Go outside.',~ +- Inside source: true +*** True Line Result + description: 'Go outside.', +** Processing line: ~ decision: :go_outside~ +- Inside source: true +*** True Line Result + decision: :go_outside +** Processing line: ~ },~ +- Inside source: true +*** True Line Result + }, +** Processing line: ~ option_four: {~ +- Inside source: true +*** True Line Result + option_four: { +** Processing line: ~ description: 'Get a snack.',~ +- Inside source: true +*** True Line Result + description: 'Get a snack.', +** Processing line: ~ decision: :get_a_snack~ +- Inside source: true +*** True Line Result + decision: :get_a_snack +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ },~ +- Inside source: true +*** True Line Result + }, +** Processing line: ~ nap: {~ +- Inside source: true +*** True Line Result + nap: { +** Processing line: ~ description: 'You took a nap. The end.',~ +- Inside source: true +*** True Line Result + description: 'You took a nap. The end.', +** Processing line: ~ option_one: {~ +- Inside source: true +*** True Line Result + option_one: { +** Processing line: ~ description: 'Start over.',~ +- Inside source: true +*** True Line Result + description: 'Start over.', +** Processing line: ~ decision: :stormy_night~ +- Inside source: true +*** True Line Result + decision: :stormy_night +** 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: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Narrative - Choose Your Own Adventure - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Choose Your Own Adventure - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/main.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/main.rb +** Processing line: ~ =begin~ +- Inside source: true +*** True Line Result + =begin +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Reminders:~ +- Inside source: true +*** True Line Result + Reminders: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The values can be found~ +- Inside source: true +*** True Line Result + - Hashes: Collection of unique keys and their corresponding values. The values can be found +** Processing line: ~ using their keys.~ +- Inside source: true +*** True Line Result + using their keys. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ In this sample app, the decisions needed for the game are stored in a hash. In fact, the~ +- Inside source: true +*** True Line Result + In this sample app, the decisions needed for the game are stored in a hash. In fact, the +** Processing line: ~ decision.rb file contains hashes inside of other hashes!~ +- Inside source: true +*** True Line Result + decision.rb file contains hashes inside of other hashes! +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Each option is a key in the first hash, but also contains a hash (description and~ +- Inside source: true +*** True Line Result + Each option is a key in the first hash, but also contains a hash (description and +** Processing line: ~ decision being its keys) as its value.~ +- Inside source: true +*** True Line Result + decision being its keys) as its value. +** Processing line: ~ Go into the decision.rb file and take a look before diving into the code below.~ +- Inside source: true +*** True Line Result + Go into the decision.rb file and take a look before diving into the code below. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ +- Inside source: true +*** True Line Result + - args.outputs.labels: An array. The values generate a label. +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +- Inside source: true +*** True Line Result + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +- Inside source: true +*** True Line Result + For more information about labels, go to mygame/documentation/02-labels.md. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - args.keyboard.key_down.KEY: Determines if a key is in the down state or pressed down.~ +- Inside source: true +*** True Line Result + - args.keyboard.key_down.KEY: Determines if a key is in the down state or pressed down. +** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ +- Inside source: true +*** True Line Result + For more information about the keyboard, go to mygame/documentation/06-keyboard.md. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated~ +- Inside source: true +*** True Line Result + - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +- Inside source: true +*** True Line Result + as Ruby code, and the placeholder is replaced with its corresponding value or 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: ~ # This sample app provides users with a story and multiple decisions that they can choose to make.~ +- Inside source: true +*** True Line Result + # This sample app provides users with a story and multiple decisions that they can choose to make. +** Processing line: ~ # Users can make a decision using their keyboard, and the story will move forward based on user choices.~ +- Inside source: true +*** True Line Result + # Users can make a decision using their keyboard, and the story will move forward based on user choices. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # The decisions available to users are stored in the decision.rb file.~ +- Inside source: true +*** True Line Result + # The decisions available to users are stored in the decision.rb file. +** Processing line: ~ # We must have access to it for the game to function properly.~ +- Inside source: true +*** True Line Result + # We must have access to it for the game to function properly. +** Processing line: ~ GAME_FILE = 'app/decision.rb' # found in app folder~ +- Inside source: true +*** True Line Result + GAME_FILE = 'app/decision.rb' # found in app folder +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ require GAME_FILE # require used to load another file, import class/method definitions~ +- Inside source: true +*** True Line Result + require GAME_FILE # require used to load another file, import class/method definitions +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Instructions are given using labels to users if they have not yet set up their story in the decision.rb file.~ +- Inside source: true +*** True Line Result + # Instructions are given using labels to users if they have not yet set up their story in the decision.rb file. +** Processing line: ~ # Otherwise, the game is run.~ +- Inside source: true +*** True Line Result + # Otherwise, the game is run. +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ if !args.state.loaded && !respond_to?(:game) # if game is not loaded and not responding to game symbol's method~ +- Inside source: true +*** True Line Result + if !args.state.loaded && !respond_to?(:game) # if game is not loaded and not responding to game symbol's method +** Processing line: ~ args.labels << [640, 370, 'Hey there! Welcome to Four Decisions.', 0, 1] # a welcome label is shown~ +- Inside source: true +*** True Line Result + args.labels << [640, 370, 'Hey there! Welcome to Four Decisions.', 0, 1] # a welcome label is shown +** Processing line: ~ args.labels << [640, 340, 'Go to the file called decision.rb and tell me your story.', 0, 1]~ +- Inside source: true +*** True Line Result + args.labels << [640, 340, 'Go to the file called decision.rb and tell me your story.', 0, 1] +** Processing line: ~ elsif respond_to?(:game) # otherwise, if responds to game~ +- Inside source: true +*** True Line Result + elsif respond_to?(:game) # otherwise, if responds to game +** Processing line: ~ args.state.loaded = true~ +- Inside source: true +*** True Line Result + args.state.loaded = true +** Processing line: ~ tick_game args # calls tick_game method, runs game~ +- Inside source: true +*** True Line Result + tick_game args # calls tick_game method, runs game +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.state.tick_count.mod_zero? 60 # update every 60 frames~ +- Inside source: true +*** True Line Result + if args.state.tick_count.mod_zero? 60 # update every 60 frames +** Processing line: ~ t = args.gtk.ffi_file.mtime GAME_FILE # mtime returns modification time for named file~ +- Inside source: true +*** True Line Result + t = args.gtk.ffi_file.mtime GAME_FILE # mtime returns modification time for named file +** Processing line: ~ if t != args.state.mtime~ +- Inside source: true +*** True Line Result + if t != args.state.mtime +** Processing line: ~ args.state.mtime = t~ +- Inside source: true +*** True Line Result + args.state.mtime = t +** Processing line: ~ require GAME_FILE # require used to load file~ +- Inside source: true +*** True Line Result + require GAME_FILE # require used to load file +** Processing line: ~ args.state.game_definition = nil # game definition and decision are empty~ +- Inside source: true +*** True Line Result + args.state.game_definition = nil # game definition and decision are empty +** Processing line: ~ args.state.decision_id = nil~ +- Inside source: true +*** True Line Result + args.state.decision_id = nil +** 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: ~ # Runs methods needed for game to function properly~ +- Inside source: true +*** True Line Result + # Runs methods needed for game to function properly +** Processing line: ~ # Creates a rectangular border around the screen~ +- Inside source: true +*** True Line Result + # Creates a rectangular border around the screen +** Processing line: ~ def tick_game args~ +- Inside source: true +*** True Line Result + def tick_game args +** Processing line: ~ defaults args~ +- Inside source: true +*** True Line Result + defaults args +** Processing line: ~ args.borders << args.grid.rect~ +- Inside source: true +*** True Line Result + args.borders << args.grid.rect +** Processing line: ~ render_decision args~ +- Inside source: true +*** True Line Result + render_decision args +** Processing line: ~ process_inputs args~ +- Inside source: true +*** True Line Result + process_inputs 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 uses decision.rb file to define game and decision_id~ +- Inside source: true +*** True Line Result + # Sets default values and uses decision.rb file to define game and decision_id +** Processing line: ~ # variable using the starting decision~ +- Inside source: true +*** True Line Result + # variable using the starting decision +** Processing line: ~ def defaults args~ +- Inside source: true +*** True Line Result + def defaults args +** Processing line: ~ args.state.game_definition ||= game~ +- Inside source: true +*** True Line Result + args.state.game_definition ||= game +** Processing line: ~ args.state.decision_id ||= args.state.game_definition[:starting_decision]~ +- Inside source: true +*** True Line Result + args.state.decision_id ||= args.state.game_definition[:starting_decision] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Outputs the possible decision descriptions the user can choose onto the screen~ +- Inside source: true +*** True Line Result + # Outputs the possible decision descriptions the user can choose onto the screen +** Processing line: ~ # as well as what key to press on their keyboard to make their decision~ +- Inside source: true +*** True Line Result + # as well as what key to press on their keyboard to make their decision +** Processing line: ~ def render_decision args~ +- Inside source: true +*** True Line Result + def render_decision args +** Processing line: ~ decision = current_decision args~ +- Inside source: true +*** True Line Result + decision = current_decision args +** Processing line: ~ # text is either the value of decision's description key or warning that no description exists~ +- Inside source: true +*** True Line Result + # text is either the value of decision's description key or warning that no description exists +** Processing line: ~ args.labels << [640, 360, decision[:description] || "No definition found for #{args.state.decision_id}. Please update decision.rb.", 0, 1] # uses string interpolation~ +- Inside source: true +*** True Line Result + args.labels << [640, 360, decision[:description] || "No definition found for #{args.state.decision_id}. Please update decision.rb.", 0, 1] # uses string interpolation +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # All decisions are stored in a hash~ +- Inside source: true +*** True Line Result + # All decisions are stored in a hash +** Processing line: ~ # The descriptions output onto the screen are the values for the description keys of the hash.~ +- Inside source: true +*** True Line Result + # The descriptions output onto the screen are the values for the description keys of the hash. +** Processing line: ~ if decision[:option_one]~ +- Inside source: true +*** True Line Result + if decision[:option_one] +** Processing line: ~ args.labels << [10, 360, decision[:option_one][:description], 0, 0] # option one's description label~ +- Inside source: true +*** True Line Result + args.labels << [10, 360, decision[:option_one][:description], 0, 0] # option one's description label +** Processing line: ~ args.labels << [10, 335, "(Press 'left' on the keyboard to select this decision)", -5, 0] # label of what key to press to select the decision~ +- Inside source: true +*** True Line Result + args.labels << [10, 335, "(Press 'left' on the keyboard to select this decision)", -5, 0] # label of what key to press to select the decision +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if decision[:option_two]~ +- Inside source: true +*** True Line Result + if decision[:option_two] +** Processing line: ~ args.labels << [1270, 360, decision[:option_two][:description], 0, 2] # option two's description~ +- Inside source: true +*** True Line Result + args.labels << [1270, 360, decision[:option_two][:description], 0, 2] # option two's description +** Processing line: ~ args.labels << [1270, 335, "(Press 'right' on the keyboard to select this decision)", -5, 2]~ +- Inside source: true +*** True Line Result + args.labels << [1270, 335, "(Press 'right' on the keyboard to select this decision)", -5, 2] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if decision[:option_three]~ +- Inside source: true +*** True Line Result + if decision[:option_three] +** Processing line: ~ args.labels << [640, 45, decision[:option_three][:description], 0, 1] # option three's description~ +- Inside source: true +*** True Line Result + args.labels << [640, 45, decision[:option_three][:description], 0, 1] # option three's description +** Processing line: ~ args.labels << [640, 20, "(Press 'down' on the keyboard to select this decision)", -5, 1]~ +- Inside source: true +*** True Line Result + args.labels << [640, 20, "(Press 'down' on the keyboard to select this decision)", -5, 1] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if decision[:option_four]~ +- Inside source: true +*** True Line Result + if decision[:option_four] +** Processing line: ~ args.labels << [640, 700, decision[:option_four][:description], 0, 1] # option four's description~ +- Inside source: true +*** True Line Result + args.labels << [640, 700, decision[:option_four][:description], 0, 1] # option four's description +** Processing line: ~ args.labels << [640, 675, "(Press 'up' on the keyboard to select this decision)", -5, 1]~ +- Inside source: true +*** True Line Result + args.labels << [640, 675, "(Press 'up' on the keyboard to select this decision)", -5, 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: ~ # Uses keyboard input from the user to make a decision~ +- Inside source: true +*** True Line Result + # Uses keyboard input from the user to make a decision +** Processing line: ~ # Assigns the decision as the value of the decision_id variable~ +- Inside source: true +*** True Line Result + # Assigns the decision as the value of the decision_id variable +** Processing line: ~ def process_inputs args~ +- Inside source: true +*** True Line Result + def process_inputs args +** Processing line: ~ decision = current_decision args # calls current_decision method~ +- Inside source: true +*** True Line Result + decision = current_decision args # calls current_decision method +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.keyboard.key_down.left! && decision[:option_one] # if left key pressed and option one exists~ +- Inside source: true +*** True Line Result + if args.keyboard.key_down.left! && decision[:option_one] # if left key pressed and option one exists +** Processing line: ~ args.state.decision_id = decision[:option_one][:decision] # value of option one's decision hash key is set to decision_id~ +- Inside source: true +*** True Line Result + args.state.decision_id = decision[:option_one][:decision] # value of option one's decision hash key is set to decision_id +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.keyboard.key_down.right! && decision[:option_two] # if right key pressed and option two exists~ +- Inside source: true +*** True Line Result + if args.keyboard.key_down.right! && decision[:option_two] # if right key pressed and option two exists +** Processing line: ~ args.state.decision_id = decision[:option_two][:decision] # value of option two's decision hash key is set to decision_id~ +- Inside source: true +*** True Line Result + args.state.decision_id = decision[:option_two][:decision] # value of option two's decision hash key is set to decision_id +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.keyboard.key_down.down! && decision[:option_three] # if down key pressed and option three exists~ +- Inside source: true +*** True Line Result + if args.keyboard.key_down.down! && decision[:option_three] # if down key pressed and option three exists +** Processing line: ~ args.state.decision_id = decision[:option_three][:decision] # value of option three's decision hash key is set to decision_id~ +- Inside source: true +*** True Line Result + args.state.decision_id = decision[:option_three][:decision] # value of option three's decision hash key is set to decision_id +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.keyboard.key_down.up! && decision[:option_four] # if up key pressed and option four exists~ +- Inside source: true +*** True Line Result + if args.keyboard.key_down.up! && decision[:option_four] # if up key pressed and option four exists +** Processing line: ~ args.state.decision_id = decision[:option_four][:decision] # value of option four's decision hash key is set to decision_id~ +- Inside source: true +*** True Line Result + args.state.decision_id = decision[:option_four][:decision] # value of option four's decision hash key is set to decision_id +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Uses decision_id's value to keep track of current decision being made~ +- Inside source: true +*** True Line Result + # Uses decision_id's value to keep track of current decision being made +** Processing line: ~ def current_decision args~ +- Inside source: true +*** True Line Result + def current_decision args +** Processing line: ~ args.state.game_definition[:decisions][args.state.decision_id] || {} # either has value or is empty~ +- Inside source: true +*** True Line Result + args.state.game_definition[:decisions][args.state.decision_id] || {} # either has value or is empty +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Resets the game.~ +- Inside source: true +*** True Line Result + # Resets the game. +** 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: ~*** Rpg Narrative - Return Of Serenity - lowrez_simulator.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - lowrez_simulator.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/lowrez_simulator.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/lowrez_simulator.rb +** Processing line: ~ ###################################################################################~ +- Inside source: true +*** True Line Result + ################################################################################### +** Processing line: ~ # YOU CAN PLAY AROUND WITH THE CODE BELOW, BUT USE CAUTION AS THIS IS WHAT EMULATES~ +- Inside source: true +*** True Line Result + # YOU CAN PLAY AROUND WITH THE CODE BELOW, BUT USE CAUTION AS THIS IS WHAT EMULATES +** Processing line: ~ # THE 64x64 CANVAS.~ +- Inside source: true +*** True Line Result + # THE 64x64 CANVAS. +** Processing line: ~ ###################################################################################~ +- Inside source: true +*** True Line Result + ################################################################################### +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ TINY_RESOLUTION = 64~ +- Inside source: true +*** True Line Result + TINY_RESOLUTION = 64 +** Processing line: ~ TINY_SCALE = 720.fdiv(TINY_RESOLUTION + 5)~ +- Inside source: true +*** True Line Result + TINY_SCALE = 720.fdiv(TINY_RESOLUTION + 5) +** Processing line: ~ CENTER_OFFSET = 10~ +- Inside source: true +*** True Line Result + CENTER_OFFSET = 10 +** Processing line: ~ EMULATED_FONT_SIZE = 20~ +- Inside source: true +*** True Line Result + EMULATED_FONT_SIZE = 20 +** Processing line: ~ EMULATED_FONT_X_ZERO = 0~ +- Inside source: true +*** True Line Result + EMULATED_FONT_X_ZERO = 0 +** Processing line: ~ EMULATED_FONT_Y_ZERO = 46~ +- Inside source: true +*** True Line Result + EMULATED_FONT_Y_ZERO = 46 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ sprites = []~ +- Inside source: true +*** True Line Result + sprites = [] +** Processing line: ~ labels = []~ +- Inside source: true +*** True Line Result + labels = [] +** Processing line: ~ borders = []~ +- Inside source: true +*** True Line Result + borders = [] +** Processing line: ~ solids = []~ +- Inside source: true +*** True Line Result + solids = [] +** Processing line: ~ mouse = emulate_lowrez_mouse args~ +- Inside source: true +*** True Line Result + mouse = emulate_lowrez_mouse args +** Processing line: ~ args.state.show_gridlines = false~ +- Inside source: true +*** True Line Result + args.state.show_gridlines = false +** Processing line: ~ lowrez_tick args, sprites, labels, borders, solids, mouse~ +- Inside source: true +*** True Line Result + lowrez_tick args, sprites, labels, borders, solids, mouse +** Processing line: ~ render_gridlines_if_needed args~ +- Inside source: true +*** True Line Result + render_gridlines_if_needed args +** Processing line: ~ render_mouse_crosshairs args, mouse~ +- Inside source: true +*** True Line Result + render_mouse_crosshairs args, mouse +** Processing line: ~ emulate_lowrez_scene args, sprites, labels, borders, solids, mouse~ +- Inside source: true +*** True Line Result + emulate_lowrez_scene args, sprites, labels, borders, solids, mouse +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def emulate_lowrez_mouse args~ +- Inside source: true +*** True Line Result + def emulate_lowrez_mouse args +** Processing line: ~ args.state.new_entity_strict(:lowrez_mouse) do |m|~ +- Inside source: true +*** True Line Result + args.state.new_entity_strict(:lowrez_mouse) do |m| +** Processing line: ~ m.x = args.mouse.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1~ +- Inside source: true +*** True Line Result + m.x = args.mouse.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1 +** Processing line: ~ m.y = args.mouse.y.idiv(TINY_SCALE)~ +- Inside source: true +*** True Line Result + m.y = args.mouse.y.idiv(TINY_SCALE) +** Processing line: ~ if args.mouse.click~ +- Inside source: true +*** True Line Result + if args.mouse.click +** Processing line: ~ m.click = [~ +- Inside source: true +*** True Line Result + m.click = [ +** Processing line: ~ args.mouse.click.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1,~ +- Inside source: true +*** True Line Result + args.mouse.click.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1, +** Processing line: ~ args.mouse.click.point.y.idiv(TINY_SCALE)~ +- Inside source: true +*** True Line Result + args.mouse.click.point.y.idiv(TINY_SCALE) +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ m.down = m.click~ +- Inside source: true +*** True Line Result + m.down = m.click +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ m.click = nil~ +- Inside source: true +*** True Line Result + m.click = nil +** Processing line: ~ m.down = nil~ +- Inside source: true +*** True Line Result + m.down = nil +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.mouse.up~ +- Inside source: true +*** True Line Result + if args.mouse.up +** Processing line: ~ m.up = [~ +- Inside source: true +*** True Line Result + m.up = [ +** Processing line: ~ args.mouse.up.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1,~ +- Inside source: true +*** True Line Result + args.mouse.up.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1, +** Processing line: ~ args.mouse.up.point.y.idiv(TINY_SCALE)~ +- Inside source: true +*** True Line Result + args.mouse.up.point.y.idiv(TINY_SCALE) +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ m.up = nil~ +- Inside source: true +*** True Line Result + m.up = nil +** 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 render_mouse_crosshairs args, mouse~ +- Inside source: true +*** True Line Result + def render_mouse_crosshairs args, mouse +** Processing line: ~ return unless args.state.show_gridlines~ +- Inside source: true +*** True Line Result + return unless args.state.show_gridlines +** Processing line: ~ args.labels << [10, 25, "mouse: #{mouse.x} #{mouse.y}", 255, 255, 255]~ +- Inside source: true +*** True Line Result + args.labels << [10, 25, "mouse: #{mouse.x} #{mouse.y}", 255, 255, 255] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def emulate_lowrez_scene args, sprites, labels, borders, solids, mouse~ +- Inside source: true +*** True Line Result + def emulate_lowrez_scene args, sprites, labels, borders, solids, mouse +** Processing line: ~ args.render_target(:lowrez).solids << [0, 0, 1280, 720]~ +- Inside source: true +*** True Line Result + args.render_target(:lowrez).solids << [0, 0, 1280, 720] +** Processing line: ~ args.render_target(:lowrez).sprites << sprites~ +- Inside source: true +*** True Line Result + args.render_target(:lowrez).sprites << sprites +** Processing line: ~ args.render_target(:lowrez).borders << borders~ +- Inside source: true +*** True Line Result + args.render_target(:lowrez).borders << borders +** Processing line: ~ args.render_target(:lowrez).solids << solids~ +- Inside source: true +*** True Line Result + args.render_target(:lowrez).solids << solids +** Processing line: ~ args.outputs.primitives << labels.map do |l|~ +- Inside source: true +*** True Line Result + args.outputs.primitives << labels.map do |l| +** Processing line: ~ as_label = l.label~ +- Inside source: true +*** True Line Result + as_label = l.label +** Processing line: ~ l.text.each_char.each_with_index.map do |char, i|~ +- Inside source: true +*** True Line Result + l.text.each_char.each_with_index.map do |char, i| +** Processing line: ~ [CENTER_OFFSET + EMULATED_FONT_X_ZERO + (as_label.x * TINY_SCALE) + i * 5 * TINY_SCALE,~ +- Inside source: true +*** True Line Result + [CENTER_OFFSET + EMULATED_FONT_X_ZERO + (as_label.x * TINY_SCALE) + i * 5 * TINY_SCALE, +** Processing line: ~ EMULATED_FONT_Y_ZERO + (as_label.y * TINY_SCALE), char,~ +- Inside source: true +*** True Line Result + EMULATED_FONT_Y_ZERO + (as_label.y * TINY_SCALE), char, +** Processing line: ~ EMULATED_FONT_SIZE, 0, as_label.r, as_label.g, as_label.b, as_label.a, 'fonts/dragonruby-gtk-4x4.ttf'].label~ +- Inside source: true +*** True Line Result + EMULATED_FONT_SIZE, 0, as_label.r, as_label.g, as_label.b, as_label.a, 'fonts/dragonruby-gtk-4x4.ttf'].label +** 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.sprites << [CENTER_OFFSET, 0, 1280 * TINY_SCALE, 720 * TINY_SCALE, :lowrez]~ +- Inside source: true +*** True Line Result + args.sprites << [CENTER_OFFSET, 0, 1280 * TINY_SCALE, 720 * TINY_SCALE, :lowrez] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_gridlines_if_needed args~ +- Inside source: true +*** True Line Result + def render_gridlines_if_needed args +** Processing line: ~ if args.state.show_gridlines && args.static_lines.length == 0~ +- Inside source: true +*** True Line Result + if args.state.show_gridlines && args.static_lines.length == 0 +** Processing line: ~ args.static_lines << 65.times.map do |i|~ +- Inside source: true +*** True Line Result + args.static_lines << 65.times.map do |i| +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ [CENTER_OFFSET + i * TINY_SCALE + 1, 0,~ +- Inside source: true +*** True Line Result + [CENTER_OFFSET + i * TINY_SCALE + 1, 0, +** Processing line: ~ CENTER_OFFSET + i * TINY_SCALE + 1, 720, 128, 128, 128],~ +- Inside source: true +*** True Line Result + CENTER_OFFSET + i * TINY_SCALE + 1, 720, 128, 128, 128], +** Processing line: ~ [CENTER_OFFSET + i * TINY_SCALE, 0,~ +- Inside source: true +*** True Line Result + [CENTER_OFFSET + i * TINY_SCALE, 0, +** Processing line: ~ CENTER_OFFSET + i * TINY_SCALE, 720, 128, 128, 128],~ +- Inside source: true +*** True Line Result + CENTER_OFFSET + i * TINY_SCALE, 720, 128, 128, 128], +** Processing line: ~ [CENTER_OFFSET, 0 + i * TINY_SCALE,~ +- Inside source: true +*** True Line Result + [CENTER_OFFSET, 0 + i * TINY_SCALE, +** Processing line: ~ CENTER_OFFSET + 720, 0 + i * TINY_SCALE, 128, 128, 128],~ +- Inside source: true +*** True Line Result + CENTER_OFFSET + 720, 0 + i * TINY_SCALE, 128, 128, 128], +** Processing line: ~ [CENTER_OFFSET, 1 + i * TINY_SCALE,~ +- Inside source: true +*** True Line Result + [CENTER_OFFSET, 1 + i * TINY_SCALE, +** Processing line: ~ CENTER_OFFSET + 720, 1 + i * TINY_SCALE, 128, 128, 128]~ +- Inside source: true +*** True Line Result + CENTER_OFFSET + 720, 1 + i * TINY_SCALE, 128, 128, 128] +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ elsif !args.state.show_gridlines~ +- Inside source: true +*** True Line Result + elsif !args.state.show_gridlines +** Processing line: ~ args.static_lines.clear~ +- Inside source: true +*** True Line Result + args.static_lines.clear +** 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: ~*** Rpg Narrative - Return Of Serenity - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/main.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/main.rb +** Processing line: ~ require 'app/require.rb'~ +- Inside source: true +*** True Line Result + require 'app/require.rb' +** 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.outputs.background_color = [0, 0, 0]~ +- Inside source: true +*** True Line Result + args.outputs.background_color = [0, 0, 0] +** Processing line: ~ args.state.last_story_line_text ||= ""~ +- Inside source: true +*** True Line Result + args.state.last_story_line_text ||= "" +** Processing line: ~ args.state.scene_history ||= []~ +- Inside source: true +*** True Line Result + args.state.scene_history ||= [] +** Processing line: ~ args.state.storyline_history ||= []~ +- Inside source: true +*** True Line Result + args.state.storyline_history ||= [] +** Processing line: ~ args.state.word_delay ||= 8~ +- Inside source: true +*** True Line Result + args.state.word_delay ||= 8 +** Processing line: ~ if args.state.tick_count == 0~ +- Inside source: true +*** True Line Result + if args.state.tick_count == 0 +** Processing line: ~ args.gtk.stop_music~ +- Inside source: true +*** True Line Result + args.gtk.stop_music +** Processing line: ~ args.outputs.sounds << 'sounds/static-loop.ogg'~ +- Inside source: true +*** True Line Result + args.outputs.sounds << 'sounds/static-loop.ogg' +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.state.last_story_line_text~ +- Inside source: true +*** True Line Result + if args.state.last_story_line_text +** Processing line: ~ lines = args.state~ +- Inside source: true +*** True Line Result + lines = args.state +** Processing line: ~ .last_story_line_text~ +- Inside source: true +*** True Line Result + .last_story_line_text +** Processing line: ~ .gsub("-", "")~ +- Inside source: true +*** True Line Result + .gsub("-", "") +** Processing line: ~ .gsub("~", "")~ +- Inside source: true +*** True Line Result + .gsub("~", "") +** Processing line: ~ .wrapped_lines(50)~ +- Inside source: true +*** True Line Result + .wrapped_lines(50) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.labels << lines.map_with_index { |l, i| [690, 200 - (i * 25), l, 1, 0, 255, 255, 255] }~ +- Inside source: true +*** True Line Result + args.outputs.labels << lines.map_with_index { |l, i| [690, 200 - (i * 25), l, 1, 0, 255, 255, 255] } +** Processing line: ~ elsif args.state.storyline_history[-1]~ +- Inside source: true +*** True Line Result + elsif args.state.storyline_history[-1] +** Processing line: ~ lines = args.state~ +- Inside source: true +*** True Line Result + lines = args.state +** Processing line: ~ .storyline_history[-1]~ +- Inside source: true +*** True Line Result + .storyline_history[-1] +** Processing line: ~ .gsub("-", "")~ +- Inside source: true +*** True Line Result + .gsub("-", "") +** Processing line: ~ .gsub("~", "")~ +- Inside source: true +*** True Line Result + .gsub("~", "") +** Processing line: ~ .wrapped_lines(50)~ +- Inside source: true +*** True Line Result + .wrapped_lines(50) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.labels << lines.map_with_index { |l, i| [690, 200 - (i * 25), l, 1, 0, 255, 255, 255] }~ +- Inside source: true +*** True Line Result + args.outputs.labels << lines.map_with_index { |l, i| [690, 200 - (i * 25), l, 1, 0, 255, 255, 255] } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return if args.state.current_scene~ +- Inside source: true +*** True Line Result + return if args.state.current_scene +** Processing line: ~ set_scene(args, day_one_beginning(args))~ +- Inside source: true +*** True Line Result + set_scene(args, day_one_beginning(args)) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def inputs_move_player args~ +- Inside source: true +*** True Line Result + def inputs_move_player args +** Processing line: ~ if args.state.scene_changed_at.elapsed_time > 5~ +- Inside source: true +*** True Line Result + if args.state.scene_changed_at.elapsed_time > 5 +** Processing line: ~ if args.keyboard.down || args.keyboard.s || args.keyboard.j~ +- Inside source: true +*** True Line Result + if args.keyboard.down || args.keyboard.s || args.keyboard.j +** Processing line: ~ args.state.player.y -= 0.25~ +- Inside source: true +*** True Line Result + args.state.player.y -= 0.25 +** Processing line: ~ elsif args.keyboard.up || args.keyboard.w || args.keyboard.k~ +- Inside source: true +*** True Line Result + elsif args.keyboard.up || args.keyboard.w || args.keyboard.k +** Processing line: ~ args.state.player.y += 0.25~ +- Inside source: true +*** True Line Result + args.state.player.y += 0.25 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.keyboard.left || args.keyboard.a || args.keyboard.h~ +- Inside source: true +*** True Line Result + if args.keyboard.left || args.keyboard.a || args.keyboard.h +** Processing line: ~ args.state.player.x -= 0.25~ +- Inside source: true +*** True Line Result + args.state.player.x -= 0.25 +** Processing line: ~ elsif args.keyboard.right || args.keyboard.d || args.keyboard.l~ +- Inside source: true +*** True Line Result + elsif args.keyboard.right || args.keyboard.d || args.keyboard.l +** Processing line: ~ args.state.player.x += 0.25~ +- Inside source: true +*** True Line Result + args.state.player.x += 0.25 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.state.player.y = 60 if args.state.player.y > 63~ +- Inside source: true +*** True Line Result + args.state.player.y = 60 if args.state.player.y > 63 +** Processing line: ~ args.state.player.y = 0 if args.state.player.y < -3~ +- Inside source: true +*** True Line Result + args.state.player.y = 0 if args.state.player.y < -3 +** Processing line: ~ args.state.player.x = 60 if args.state.player.x > 63~ +- Inside source: true +*** True Line Result + args.state.player.x = 60 if args.state.player.x > 63 +** Processing line: ~ args.state.player.x = 0 if args.state.player.x < -3~ +- Inside source: true +*** True Line Result + args.state.player.x = 0 if args.state.player.x < -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 null_or_empty? ary~ +- Inside source: true +*** True Line Result + def null_or_empty? ary +** Processing line: ~ return true unless ary~ +- Inside source: true +*** True Line Result + return true unless ary +** Processing line: ~ return true if ary.length == 0~ +- Inside source: true +*** True Line Result + return true if ary.length == 0 +** 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 calc_storyline_hotspot args~ +- Inside source: true +*** True Line Result + def calc_storyline_hotspot args +** Processing line: ~ hotspots = args.state.storylines.find_all do |hs|~ +- Inside source: true +*** True Line Result + hotspots = args.state.storylines.find_all do |hs| +** Processing line: ~ args.state.player.inside_rect?(hs.shift_rect(-2, 0))~ +- Inside source: true +*** True Line Result + args.state.player.inside_rect?(hs.shift_rect(-2, 0)) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !null_or_empty?(hotspots) && !args.state.inside_storyline_hotspot~ +- Inside source: true +*** True Line Result + if !null_or_empty?(hotspots) && !args.state.inside_storyline_hotspot +** Processing line: ~ _, _, _, _, storyline = hotspots.first~ +- Inside source: true +*** True Line Result + _, _, _, _, storyline = hotspots.first +** Processing line: ~ queue_storyline_text(args, storyline)~ +- Inside source: true +*** True Line Result + queue_storyline_text(args, storyline) +** Processing line: ~ args.state.inside_storyline_hotspot = true~ +- Inside source: true +*** True Line Result + args.state.inside_storyline_hotspot = true +** Processing line: ~ elsif null_or_empty?(hotspots)~ +- Inside source: true +*** True Line Result + elsif null_or_empty?(hotspots) +** Processing line: ~ args.state.inside_storyline_hotspot = false~ +- Inside source: true +*** True Line Result + args.state.inside_storyline_hotspot = false +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.state.storyline_queue_empty_at ||= args.state.tick_count~ +- Inside source: true +*** True Line Result + args.state.storyline_queue_empty_at ||= args.state.tick_count +** Processing line: ~ args.state.is_storyline_dialog_active = false~ +- Inside source: true +*** True Line Result + args.state.is_storyline_dialog_active = false +** Processing line: ~ args.state.scene_storyline_queue.clear~ +- Inside source: true +*** True Line Result + args.state.scene_storyline_queue.clear +** 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_scenes args~ +- Inside source: true +*** True Line Result + def calc_scenes args +** Processing line: ~ hotspots = args.state.scenes.find_all do |hs|~ +- Inside source: true +*** True Line Result + hotspots = args.state.scenes.find_all do |hs| +** Processing line: ~ args.state.player.inside_rect?(hs.shift_rect(-2, 0))~ +- Inside source: true +*** True Line Result + args.state.player.inside_rect?(hs.shift_rect(-2, 0)) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !null_or_empty?(hotspots) && !args.state.inside_scene_hotspot~ +- Inside source: true +*** True Line Result + if !null_or_empty?(hotspots) && !args.state.inside_scene_hotspot +** Processing line: ~ _, _, _, _, scene_method_or_hash = hotspots.first~ +- Inside source: true +*** True Line Result + _, _, _, _, scene_method_or_hash = hotspots.first +** Processing line: ~ if scene_method_or_hash.is_a? Symbol~ +- Inside source: true +*** True Line Result + if scene_method_or_hash.is_a? Symbol +** Processing line: ~ set_scene(args, send(scene_method_or_hash, args))~ +- Inside source: true +*** True Line Result + set_scene(args, send(scene_method_or_hash, args)) +** Processing line: ~ args.state.last_hotspot_scene = scene_method_or_hash~ +- Inside source: true +*** True Line Result + args.state.last_hotspot_scene = scene_method_or_hash +** Processing line: ~ args.state.scene_history << scene_method_or_hash~ +- Inside source: true +*** True Line Result + args.state.scene_history << scene_method_or_hash +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ set_scene(args, scene_method_or_hash)~ +- Inside source: true +*** True Line Result + set_scene(args, scene_method_or_hash) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ args.state.inside_scene_hotspot = true~ +- Inside source: true +*** True Line Result + args.state.inside_scene_hotspot = true +** Processing line: ~ elsif null_or_empty?(hotspots)~ +- Inside source: true +*** True Line Result + elsif null_or_empty?(hotspots) +** Processing line: ~ args.state.inside_scene_hotspot = false~ +- Inside source: true +*** True Line Result + args.state.inside_scene_hotspot = false +** 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 null_or_whitespace? word~ +- Inside source: true +*** True Line Result + def null_or_whitespace? word +** Processing line: ~ return true if !word~ +- Inside source: true +*** True Line Result + return true if !word +** Processing line: ~ return true if word.strip.length == 0~ +- Inside source: true +*** True Line Result + return true if word.strip.length == 0 +** 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 calc_storyline_presentation args~ +- Inside source: true +*** True Line Result + def calc_storyline_presentation args +** Processing line: ~ return unless args.state.tick_count > args.state.next_storyline~ +- Inside source: true +*** True Line Result + return unless args.state.tick_count > args.state.next_storyline +** Processing line: ~ return unless args.state.scene_storyline_queue~ +- Inside source: true +*** True Line Result + return unless args.state.scene_storyline_queue +** Processing line: ~ next_storyline = args.state.scene_storyline_queue.shift~ +- Inside source: true +*** True Line Result + next_storyline = args.state.scene_storyline_queue.shift +** Processing line: ~ if null_or_whitespace? next_storyline~ +- Inside source: true +*** True Line Result + if null_or_whitespace? next_storyline +** Processing line: ~ args.state.storyline_queue_empty_at ||= args.state.tick_count~ +- Inside source: true +*** True Line Result + args.state.storyline_queue_empty_at ||= args.state.tick_count +** Processing line: ~ args.state.is_storyline_dialog_active = false~ +- Inside source: true +*** True Line Result + args.state.is_storyline_dialog_active = false +** Processing line: ~ return~ +- Inside source: true +*** True Line Result + return +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ args.state.storyline_to_show = next_storyline~ +- Inside source: true +*** True Line Result + args.state.storyline_to_show = next_storyline +** Processing line: ~ args.state.is_storyline_dialog_active = true~ +- Inside source: true +*** True Line Result + args.state.is_storyline_dialog_active = true +** Processing line: ~ args.state.storyline_queue_empty_at = nil~ +- Inside source: true +*** True Line Result + args.state.storyline_queue_empty_at = nil +** Processing line: ~ if next_storyline.end_with?(".") || next_storyline.end_with?("!") || next_storyline.end_with?("?") || next_storyline.end_with?("\"")~ +- Inside source: true +*** True Line Result + if next_storyline.end_with?(".") || next_storyline.end_with?("!") || next_storyline.end_with?("?") || next_storyline.end_with?("\"") +** Processing line: ~ args.state.next_storyline += 60~ +- Inside source: true +*** True Line Result + args.state.next_storyline += 60 +** Processing line: ~ elsif next_storyline.end_with?(",")~ +- Inside source: true +*** True Line Result + elsif next_storyline.end_with?(",") +** Processing line: ~ args.state.next_storyline += 50~ +- Inside source: true +*** True Line Result + args.state.next_storyline += 50 +** Processing line: ~ elsif next_storyline.end_with?(":")~ +- Inside source: true +*** True Line Result + elsif next_storyline.end_with?(":") +** Processing line: ~ args.state.next_storyline += 60~ +- Inside source: true +*** True Line Result + args.state.next_storyline += 60 +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ default_word_delay = 13 + args.state.word_delay - 8~ +- Inside source: true +*** True Line Result + default_word_delay = 13 + args.state.word_delay - 8 +** Processing line: ~ if next_storyline.gsub("-", "").gsub("~", "").length <= 4~ +- Inside source: true +*** True Line Result + if next_storyline.gsub("-", "").gsub("~", "").length <= 4 +** Processing line: ~ default_word_delay = 11 + args.state.word_delay - 8~ +- Inside source: true +*** True Line Result + default_word_delay = 11 + args.state.word_delay - 8 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ number_of_syllabals = next_storyline.length - next_storyline.gsub("-", "").length~ +- Inside source: true +*** True Line Result + number_of_syllabals = next_storyline.length - next_storyline.gsub("-", "").length +** Processing line: ~ args.state.next_storyline += default_word_delay + number_of_syllabals * (args.state.word_delay + 1)~ +- Inside source: true +*** True Line Result + args.state.next_storyline += default_word_delay + number_of_syllabals * (args.state.word_delay + 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 inputs_reload_current_scene args~ +- Inside source: true +*** True Line Result + def inputs_reload_current_scene args +** Processing line: ~ return~ +- Inside source: true +*** True Line Result + return +** Processing line: ~ if args.inputs.keyboard.key_down.r!~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.r! +** Processing line: ~ reload_current_scene~ +- Inside source: true +*** True Line Result + reload_current_scene +** 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 inputs_dismiss_current_storyline args~ +- Inside source: true +*** True Line Result + def inputs_dismiss_current_storyline args +** Processing line: ~ if args.inputs.keyboard.key_down.x!~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.x! +** Processing line: ~ args.state.scene_storyline_queue.clear~ +- Inside source: true +*** True Line Result + args.state.scene_storyline_queue.clear +** 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 inputs_restart_game args~ +- Inside source: true +*** True Line Result + def inputs_restart_game args +** Processing line: ~ if args.inputs.keyboard.exclamation_point~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.exclamation_point +** Processing line: ~ args.gtk.reset_state~ +- Inside source: true +*** True Line Result + args.gtk.reset_state +** 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 inputs_change_word_delay args~ +- Inside source: true +*** True Line Result + def inputs_change_word_delay args +** Processing line: ~ if args.inputs.keyboard.key_down.plus || args.inputs.keyboard.key_down.equal_sign~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.plus || args.inputs.keyboard.key_down.equal_sign +** Processing line: ~ args.state.word_delay -= 2~ +- Inside source: true +*** True Line Result + args.state.word_delay -= 2 +** Processing line: ~ if args.state.word_delay < 0~ +- Inside source: true +*** True Line Result + if args.state.word_delay < 0 +** Processing line: ~ args.state.word_delay = 0~ +- Inside source: true +*** True Line Result + args.state.word_delay = 0 +** Processing line: ~ # queue_storyline_text args, "Text speed at MAXIMUM. Geez, how fast do you read?"~ +- Inside source: true +*** True Line Result + # queue_storyline_text args, "Text speed at MAXIMUM. Geez, how fast do you read?" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ # queue_storyline_text args, "Text speed INCREASED."~ +- Inside source: true +*** True Line Result + # queue_storyline_text args, "Text speed INCREASED." +** 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.keyboard.key_down.hyphen || args.inputs.keyboard.key_down.underscore~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.hyphen || args.inputs.keyboard.key_down.underscore +** Processing line: ~ args.state.word_delay += 2~ +- Inside source: true +*** True Line Result + args.state.word_delay += 2 +** Processing line: ~ # queue_storyline_text args, "Text speed DECREASED."~ +- Inside source: true +*** True Line Result + # queue_storyline_text args, "Text speed DECREASED." +** 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 multiple_lines args, x, y, texts, size = 0, minimum_alpha = nil~ +- Inside source: true +*** True Line Result + def multiple_lines args, x, y, texts, size = 0, minimum_alpha = nil +** Processing line: ~ texts.each_with_index.map do |t, i|~ +- Inside source: true +*** True Line Result + texts.each_with_index.map do |t, i| +** Processing line: ~ [x, y - i * (25 + size * 2), t, size, 0, 255, 255, 255, adornments_alpha(args, 255, minimum_alpha)]~ +- Inside source: true +*** True Line Result + [x, y - i * (25 + size * 2), t, size, 0, 255, 255, 255, adornments_alpha(args, 255, minimum_alpha)] +** 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 lowrez_tick args, lowrez_sprites, lowrez_labels, lowrez_borders, lowrez_solids, lowrez_mouse~ +- Inside source: true +*** True Line Result + def lowrez_tick args, lowrez_sprites, lowrez_labels, lowrez_borders, lowrez_solids, lowrez_mouse +** Processing line: ~ # args.state.show_gridlines = true~ +- Inside source: true +*** True Line Result + # args.state.show_gridlines = true +** Processing line: ~ defaults args~ +- Inside source: true +*** True Line Result + defaults args +** Processing line: ~ render_current_scene args, lowrez_sprites, lowrez_labels, lowrez_solids~ +- Inside source: true +*** True Line Result + render_current_scene args, lowrez_sprites, lowrez_labels, lowrez_solids +** Processing line: ~ render_controller args, lowrez_borders~ +- Inside source: true +*** True Line Result + render_controller args, lowrez_borders +** Processing line: ~ lowrez_solids << [0, 0, 64, 64, 0, 0, 0]~ +- Inside source: true +*** True Line Result + lowrez_solids << [0, 0, 64, 64, 0, 0, 0] +** Processing line: ~ calc_storyline_presentation args~ +- Inside source: true +*** True Line Result + calc_storyline_presentation args +** Processing line: ~ calc_scenes args~ +- Inside source: true +*** True Line Result + calc_scenes args +** Processing line: ~ calc_storyline_hotspot args~ +- Inside source: true +*** True Line Result + calc_storyline_hotspot args +** Processing line: ~ inputs_move_player args~ +- Inside source: true +*** True Line Result + inputs_move_player args +** Processing line: ~ inputs_print_mouse_rect args, lowrez_mouse~ +- Inside source: true +*** True Line Result + inputs_print_mouse_rect args, lowrez_mouse +** Processing line: ~ inputs_reload_current_scene args~ +- Inside source: true +*** True Line Result + inputs_reload_current_scene args +** Processing line: ~ inputs_dismiss_current_storyline args~ +- Inside source: true +*** True Line Result + inputs_dismiss_current_storyline args +** Processing line: ~ inputs_change_word_delay args~ +- Inside source: true +*** True Line Result + inputs_change_word_delay args +** Processing line: ~ inputs_restart_game args~ +- Inside source: true +*** True Line Result + inputs_restart_game args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_controller args, lowrez_borders~ +- Inside source: true +*** True Line Result + def render_controller args, lowrez_borders +** Processing line: ~ args.state.up_button = [85, 40, 15, 15, 255, 255, 255]~ +- Inside source: true +*** True Line Result + args.state.up_button = [85, 40, 15, 15, 255, 255, 255] +** Processing line: ~ args.state.down_button = [85, 20, 15, 15, 255, 255, 255]~ +- Inside source: true +*** True Line Result + args.state.down_button = [85, 20, 15, 15, 255, 255, 255] +** Processing line: ~ args.state.left_button = [65, 20, 15, 15, 255, 255, 255]~ +- Inside source: true +*** True Line Result + args.state.left_button = [65, 20, 15, 15, 255, 255, 255] +** Processing line: ~ args.state.right_button = [105, 20, 15, 15, 255, 255, 255]~ +- Inside source: true +*** True Line Result + args.state.right_button = [105, 20, 15, 15, 255, 255, 255] +** Processing line: ~ lowrez_borders << args.state.up_button~ +- Inside source: true +*** True Line Result + lowrez_borders << args.state.up_button +** Processing line: ~ lowrez_borders << args.state.down_button~ +- Inside source: true +*** True Line Result + lowrez_borders << args.state.down_button +** Processing line: ~ lowrez_borders << args.state.left_button~ +- Inside source: true +*** True Line Result + lowrez_borders << args.state.left_button +** Processing line: ~ lowrez_borders << args.state.right_button~ +- Inside source: true +*** True Line Result + lowrez_borders << args.state.right_button +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def inputs_print_mouse_rect args, lowrez_mouse~ +- Inside source: true +*** True Line Result + def inputs_print_mouse_rect args, lowrez_mouse +** Processing line: ~ if lowrez_mouse.up~ +- Inside source: true +*** True Line Result + if lowrez_mouse.up +** Processing line: ~ args.state.mouse_held = false~ +- Inside source: true +*** True Line Result + args.state.mouse_held = false +** Processing line: ~ elsif lowrez_mouse.click~ +- Inside source: true +*** True Line Result + elsif lowrez_mouse.click +** Processing line: ~ mouse_rect = [lowrez_mouse.x, lowrez_mouse.y, 1, 1]~ +- Inside source: true +*** True Line Result + mouse_rect = [lowrez_mouse.x, lowrez_mouse.y, 1, 1] +** Processing line: ~ if args.state.up_button.intersect_rect? mouse_rect~ +- Inside source: true +*** True Line Result + if args.state.up_button.intersect_rect? mouse_rect +** Processing line: ~ args.state.player.y += 1~ +- Inside source: true +*** True Line Result + args.state.player.y += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.state.down_button.intersect_rect? mouse_rect~ +- Inside source: true +*** True Line Result + if args.state.down_button.intersect_rect? mouse_rect +** Processing line: ~ args.state.player.y -= 1~ +- Inside source: true +*** True Line Result + args.state.player.y -= 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.state.left_button.intersect_rect? mouse_rect~ +- Inside source: true +*** True Line Result + if args.state.left_button.intersect_rect? mouse_rect +** Processing line: ~ args.state.player.x -= 1~ +- Inside source: true +*** True Line Result + args.state.player.x -= 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.state.right_button.intersect_rect? mouse_rect~ +- Inside source: true +*** True Line Result + if args.state.right_button.intersect_rect? mouse_rect +** Processing line: ~ args.state.player.x += 1~ +- Inside source: true +*** True Line Result + args.state.player.x += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ args.state.mouse_held = true~ +- Inside source: true +*** True Line Result + args.state.mouse_held = true +** Processing line: ~ elsif args.state.mouse_held~ +- Inside source: true +*** True Line Result + elsif args.state.mouse_held +** Processing line: ~ mouse_rect = [lowrez_mouse.x, lowrez_mouse.y, 1, 1]~ +- Inside source: true +*** True Line Result + mouse_rect = [lowrez_mouse.x, lowrez_mouse.y, 1, 1] +** Processing line: ~ if args.state.up_button.intersect_rect? mouse_rect~ +- Inside source: true +*** True Line Result + if args.state.up_button.intersect_rect? mouse_rect +** Processing line: ~ args.state.player.y += 0.25~ +- Inside source: true +*** True Line Result + args.state.player.y += 0.25 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.state.down_button.intersect_rect? mouse_rect~ +- Inside source: true +*** True Line Result + if args.state.down_button.intersect_rect? mouse_rect +** Processing line: ~ args.state.player.y -= 0.25~ +- Inside source: true +*** True Line Result + args.state.player.y -= 0.25 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.state.left_button.intersect_rect? mouse_rect~ +- Inside source: true +*** True Line Result + if args.state.left_button.intersect_rect? mouse_rect +** Processing line: ~ args.state.player.x -= 0.25~ +- Inside source: true +*** True Line Result + args.state.player.x -= 0.25 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.state.right_button.intersect_rect? mouse_rect~ +- Inside source: true +*** True Line Result + if args.state.right_button.intersect_rect? mouse_rect +** Processing line: ~ args.state.player.x += 0.25~ +- Inside source: true +*** True Line Result + args.state.player.x += 0.25 +** 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 lowrez_mouse.click~ +- Inside source: true +*** True Line Result + if lowrez_mouse.click +** Processing line: ~ dx = lowrez_mouse.click.x - args.state.previous_mouse_click.x~ +- Inside source: true +*** True Line Result + dx = lowrez_mouse.click.x - args.state.previous_mouse_click.x +** Processing line: ~ dy = lowrez_mouse.click.y - args.state.previous_mouse_click.y~ +- Inside source: true +*** True Line Result + dy = lowrez_mouse.click.y - args.state.previous_mouse_click.y +** Processing line: ~ x, y, w, h = args.state.previous_mouse_click.x, args.state.previous_mouse_click.y, dx, dy~ +- Inside source: true +*** True Line Result + x, y, w, h = args.state.previous_mouse_click.x, args.state.previous_mouse_click.y, dx, dy +** Processing line: ~ puts "x #{lowrez_mouse.click.x}, y: #{lowrez_mouse.click.y}"~ +- Inside source: true +*** True Line Result + puts "x #{lowrez_mouse.click.x}, y: #{lowrez_mouse.click.y}" +** Processing line: ~ if args.state.previous_mouse_click~ +- Inside source: true +*** True Line Result + if args.state.previous_mouse_click +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if dx < 0 && dx < 0~ +- Inside source: true +*** True Line Result + if dx < 0 && dx < 0 +** Processing line: ~ x = x + w~ +- Inside source: true +*** True Line Result + x = x + w +** Processing line: ~ w = w.abs~ +- Inside source: true +*** True Line Result + w = w.abs +** Processing line: ~ y = y + h~ +- Inside source: true +*** True Line Result + y = y + h +** Processing line: ~ h = h.abs~ +- Inside source: true +*** True Line Result + h = h.abs +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ w += 1~ +- Inside source: true +*** True Line Result + w += 1 +** Processing line: ~ h += 1~ +- Inside source: true +*** True Line Result + h += 1 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.state.previous_mouse_click = nil~ +- Inside source: true +*** True Line Result + args.state.previous_mouse_click = nil +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ args.state.previous_mouse_click = lowrez_mouse.click~ +- Inside source: true +*** True Line Result + args.state.previous_mouse_click = lowrez_mouse.click +** Processing line: ~ square_x, square_y = lowrez_mouse.click~ +- Inside source: true +*** True Line Result + square_x, square_y = lowrez_mouse.click +** 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 try_centering! word~ +- Inside source: true +*** True Line Result + def try_centering! word +** Processing line: ~ word ||= ""~ +- Inside source: true +*** True Line Result + word ||= "" +** Processing line: ~ just_word = word.gsub("-", "").gsub(",", "").gsub(".", "").gsub("'", "").gsub('""', "\"-\"")~ +- Inside source: true +*** True Line Result + just_word = word.gsub("-", "").gsub(",", "").gsub(".", "").gsub("'", "").gsub('""', "\"-\"") +** Processing line: ~ return word if just_word.strip.length == 0~ +- Inside source: true +*** True Line Result + return word if just_word.strip.length == 0 +** Processing line: ~ return word if just_word.include? "~"~ +- Inside source: true +*** True Line Result + return word if just_word.include? "~" +** Processing line: ~ return "~#{word}" if just_word.length <= 2~ +- Inside source: true +*** True Line Result + return "~#{word}" if just_word.length <= 2 +** Processing line: ~ if just_word.length.mod_zero? 2~ +- Inside source: true +*** True Line Result + if just_word.length.mod_zero? 2 +** Processing line: ~ center_index = just_word.length.idiv(2) - 1~ +- Inside source: true +*** True Line Result + center_index = just_word.length.idiv(2) - 1 +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ center_index = (just_word.length - 1).idiv(2)~ +- Inside source: true +*** True Line Result + center_index = (just_word.length - 1).idiv(2) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ return "#{word[0..center_index - 1]}~#{word[center_index]}#{word[center_index + 1..-1]}"~ +- Inside source: true +*** True Line Result + return "#{word[0..center_index - 1]}~#{word[center_index]}#{word[center_index + 1..-1]}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def queue_storyline args, scene~ +- Inside source: true +*** True Line Result + def queue_storyline args, scene +** Processing line: ~ queue_storyline_text args, scene[:storyline]~ +- Inside source: true +*** True Line Result + queue_storyline_text args, scene[:storyline] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def queue_storyline_text args, text~ +- Inside source: true +*** True Line Result + def queue_storyline_text args, text +** Processing line: ~ args.state.last_story_line_text = text~ +- Inside source: true +*** True Line Result + args.state.last_story_line_text = text +** Processing line: ~ args.state.storyline_history << text if text~ +- Inside source: true +*** True Line Result + args.state.storyline_history << text if text +** Processing line: ~ words = (text || "").split(" ")~ +- Inside source: true +*** True Line Result + words = (text || "").split(" ") +** Processing line: ~ words = words.map { |w| try_centering! w }~ +- Inside source: true +*** True Line Result + words = words.map { |w| try_centering! w } +** Processing line: ~ args.state.scene_storyline_queue = words~ +- Inside source: true +*** True Line Result + args.state.scene_storyline_queue = words +** Processing line: ~ if args.state.scene_storyline_queue.length != 0~ +- Inside source: true +*** True Line Result + if args.state.scene_storyline_queue.length != 0 +** Processing line: ~ args.state.scene_storyline_queue.unshift "~$--"~ +- Inside source: true +*** True Line Result + args.state.scene_storyline_queue.unshift "~$--" +** Processing line: ~ args.state.storyline_to_show = "~."~ +- Inside source: true +*** True Line Result + args.state.storyline_to_show = "~." +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ args.state.storyline_to_show = ""~ +- Inside source: true +*** True Line Result + args.state.storyline_to_show = "" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ args.state.scene_storyline_queue << ""~ +- Inside source: true +*** True Line Result + args.state.scene_storyline_queue << "" +** Processing line: ~ args.state.next_storyline = args.state.tick_count~ +- Inside source: true +*** True Line Result + args.state.next_storyline = args.state.tick_count +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_scene args, scene~ +- Inside source: true +*** True Line Result + def set_scene args, scene +** Processing line: ~ args.state.current_scene = scene~ +- Inside source: true +*** True Line Result + args.state.current_scene = scene +** Processing line: ~ args.state.background = scene[:background] || 'sprites/todo.png'~ +- Inside source: true +*** True Line Result + args.state.background = scene[:background] || 'sprites/todo.png' +** Processing line: ~ args.state.scene_fade = scene[:fade] || 0~ +- Inside source: true +*** True Line Result + args.state.scene_fade = scene[:fade] || 0 +** Processing line: ~ args.state.scenes = (scene[:scenes] || []).reject { |s| !s }~ +- Inside source: true +*** True Line Result + args.state.scenes = (scene[:scenes] || []).reject { |s| !s } +** Processing line: ~ args.state.scene_render_override = scene[:render_override]~ +- Inside source: true +*** True Line Result + args.state.scene_render_override = scene[:render_override] +** Processing line: ~ args.state.storylines = (scene[:storylines] || []).reject { |s| !s }~ +- Inside source: true +*** True Line Result + args.state.storylines = (scene[:storylines] || []).reject { |s| !s } +** Processing line: ~ args.state.scene_changed_at = args.state.tick_count~ +- Inside source: true +*** True Line Result + args.state.scene_changed_at = args.state.tick_count +** Processing line: ~ if scene[:player]~ +- Inside source: true +*** True Line Result + if scene[:player] +** Processing line: ~ args.state.player = scene[:player]~ +- Inside source: true +*** True Line Result + args.state.player = scene[:player] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ args.state.inside_scene_hotspot = false~ +- Inside source: true +*** True Line Result + args.state.inside_scene_hotspot = false +** Processing line: ~ args.state.inside_storyline_hotspot = false~ +- Inside source: true +*** True Line Result + args.state.inside_storyline_hotspot = false +** Processing line: ~ queue_storyline args, scene~ +- Inside source: true +*** True Line Result + queue_storyline args, scene +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def replay_storyline_rect~ +- Inside source: true +*** True Line Result + def replay_storyline_rect +** Processing line: ~ [26, -1, 7, 4]~ +- Inside source: true +*** True Line Result + [26, -1, 7, 4] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def labels_for_word word~ +- Inside source: true +*** True Line Result + def labels_for_word word +** Processing line: ~ left_side_of_word = ""~ +- Inside source: true +*** True Line Result + left_side_of_word = "" +** Processing line: ~ center_letter = ""~ +- Inside source: true +*** True Line Result + center_letter = "" +** Processing line: ~ right_side_of_word = ""~ +- Inside source: true +*** True Line Result + right_side_of_word = "" +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if word[0] == "~"~ +- Inside source: true +*** True Line Result + if word[0] == "~" +** Processing line: ~ left_side_of_word = ""~ +- Inside source: true +*** True Line Result + left_side_of_word = "" +** Processing line: ~ center_letter = word[1]~ +- Inside source: true +*** True Line Result + center_letter = word[1] +** Processing line: ~ right_side_of_word = word[2..-1]~ +- Inside source: true +*** True Line Result + right_side_of_word = word[2..-1] +** Processing line: ~ elsif word.length > 0~ +- Inside source: true +*** True Line Result + elsif word.length > 0 +** Processing line: ~ left_side_of_word, right_side_of_word = word.split("~")~ +- Inside source: true +*** True Line Result + left_side_of_word, right_side_of_word = word.split("~") +** Processing line: ~ center_letter = right_side_of_word[0]~ +- Inside source: true +*** True Line Result + center_letter = right_side_of_word[0] +** Processing line: ~ right_side_of_word = right_side_of_word[1..-1]~ +- Inside source: true +*** True Line Result + right_side_of_word = right_side_of_word[1..-1] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ right_side_of_word = right_side_of_word.gsub("-", "")~ +- Inside source: true +*** True Line Result + right_side_of_word = right_side_of_word.gsub("-", "") +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ left: [29 - left_side_of_word.length * 4 - 1 * left_side_of_word.length, 2, left_side_of_word],~ +- Inside source: true +*** True Line Result + left: [29 - left_side_of_word.length * 4 - 1 * left_side_of_word.length, 2, left_side_of_word], +** Processing line: ~ center: [29, 2, center_letter, 255, 0, 0],~ +- Inside source: true +*** True Line Result + center: [29, 2, center_letter, 255, 0, 0], +** Processing line: ~ right: [34, 2, right_side_of_word]~ +- Inside source: true +*** True Line Result + right: [34, 2, right_side_of_word] +** 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_scenes args, lowrez_sprites~ +- Inside source: true +*** True Line Result + def render_scenes args, lowrez_sprites +** Processing line: ~ lowrez_sprites << args.state.scenes.flat_map do |hs|~ +- Inside source: true +*** True Line Result + lowrez_sprites << args.state.scenes.flat_map do |hs| +** Processing line: ~ hotspot_square args, hs.x, hs.y, hs.w, hs.h~ +- Inside source: true +*** True Line Result + hotspot_square args, hs.x, hs.y, hs.w, hs.h +** 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_storylines args, lowrez_sprites~ +- Inside source: true +*** True Line Result + def render_storylines args, lowrez_sprites +** Processing line: ~ lowrez_sprites << args.state.storylines.flat_map do |hs|~ +- Inside source: true +*** True Line Result + lowrez_sprites << args.state.storylines.flat_map do |hs| +** Processing line: ~ hotspot_square args, hs.x, hs.y, hs.w, hs.h~ +- Inside source: true +*** True Line Result + hotspot_square args, hs.x, hs.y, hs.w, hs.h +** 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 adornments_alpha args, target_alpha = nil, minimum_alpha = nil~ +- Inside source: true +*** True Line Result + def adornments_alpha args, target_alpha = nil, minimum_alpha = nil +** Processing line: ~ return (minimum_alpha || 80) unless args.state.storyline_queue_empty_at~ +- Inside source: true +*** True Line Result + return (minimum_alpha || 80) unless args.state.storyline_queue_empty_at +** Processing line: ~ target_alpha ||= 255~ +- Inside source: true +*** True Line Result + target_alpha ||= 255 +** Processing line: ~ target_alpha * args.state.storyline_queue_empty_at.ease(60)~ +- Inside source: true +*** True Line Result + target_alpha * args.state.storyline_queue_empty_at.ease(60) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def hotspot_square args, x, y, w, h~ +- Inside source: true +*** True Line Result + def hotspot_square args, x, y, w, h +** Processing line: ~ if w >= 3 && h >= 3~ +- Inside source: true +*** True Line Result + if w >= 3 && h >= 3 +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ [x + w.idiv(2) + 1, y, w.idiv(2), h, 'sprites/label-background.png', 0, adornments_alpha(args, 50), 23, 23, 23],~ +- Inside source: true +*** True Line Result + [x + w.idiv(2) + 1, y, w.idiv(2), h, 'sprites/label-background.png', 0, adornments_alpha(args, 50), 23, 23, 23], +** Processing line: ~ [x, y, w.idiv(2), h, 'sprites/label-background.png', 0, adornments_alpha(args, 100), 223, 223, 223],~ +- Inside source: true +*** True Line Result + [x, y, w.idiv(2), h, 'sprites/label-background.png', 0, adornments_alpha(args, 100), 223, 223, 223], +** Processing line: ~ [x + 1, y + 1, w - 2, h - 2, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 40, 140, 40],~ +- Inside source: true +*** True Line Result + [x + 1, y + 1, w - 2, h - 2, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 40, 140, 40], +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ [x, y, w, h, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 0, 140, 0],~ +- Inside source: true +*** True Line Result + [x, y, w, h, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 0, 140, 0], +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_storyline_dialog args, lowrez_labels, lowrez_sprites~ +- Inside source: true +*** True Line Result + def render_storyline_dialog args, lowrez_labels, lowrez_sprites +** Processing line: ~ return unless args.state.is_storyline_dialog_active~ +- Inside source: true +*** True Line Result + return unless args.state.is_storyline_dialog_active +** Processing line: ~ return unless args.state.storyline_to_show~ +- Inside source: true +*** True Line Result + return unless args.state.storyline_to_show +** Processing line: ~ labels = labels_for_word args.state.storyline_to_show~ +- Inside source: true +*** True Line Result + labels = labels_for_word args.state.storyline_to_show +** Processing line: ~ if true # high rez version~ +- Inside source: true +*** True Line Result + if true # high rez version +** Processing line: ~ scale = 8.88~ +- Inside source: true +*** True Line Result + scale = 8.88 +** Processing line: ~ offset = 45~ +- Inside source: true +*** True Line Result + offset = 45 +** Processing line: ~ size = 25~ +- Inside source: true +*** True Line Result + size = 25 +** Processing line: ~ args.outputs.labels << [offset + labels[:left].x.-(1) * scale,~ +- Inside source: true +*** True Line Result + args.outputs.labels << [offset + labels[:left].x.-(1) * scale, +** Processing line: ~ labels[:left].y * TINY_SCALE + 55,~ +- Inside source: true +*** True Line Result + labels[:left].y * TINY_SCALE + 55, +** Processing line: ~ labels[:left].text, size, 0, 0, 0, 0, 255,~ +- Inside source: true +*** True Line Result + labels[:left].text, size, 0, 0, 0, 0, 255, +** Processing line: ~ 'fonts/manaspc.ttf']~ +- Inside source: true +*** True Line Result + 'fonts/manaspc.ttf'] +** Processing line: ~ center_text = labels[:center].text~ +- Inside source: true +*** True Line Result + center_text = labels[:center].text +** Processing line: ~ center_text = "|" if center_text == "$"~ +- Inside source: true +*** True Line Result + center_text = "|" if center_text == "$" +** Processing line: ~ args.outputs.labels << [offset + labels[:center].x * scale,~ +- Inside source: true +*** True Line Result + args.outputs.labels << [offset + labels[:center].x * scale, +** Processing line: ~ labels[:center].y * TINY_SCALE + 55,~ +- Inside source: true +*** True Line Result + labels[:center].y * TINY_SCALE + 55, +** Processing line: ~ center_text, size, 0, 255, 0, 0, 255,~ +- Inside source: true +*** True Line Result + center_text, size, 0, 255, 0, 0, 255, +** Processing line: ~ 'fonts/manaspc.ttf']~ +- Inside source: true +*** True Line Result + 'fonts/manaspc.ttf'] +** Processing line: ~ args.outputs.labels << [offset + labels[:right].x * scale,~ +- Inside source: true +*** True Line Result + args.outputs.labels << [offset + labels[:right].x * scale, +** Processing line: ~ labels[:right].y * TINY_SCALE + 55,~ +- Inside source: true +*** True Line Result + labels[:right].y * TINY_SCALE + 55, +** Processing line: ~ labels[:right].text, size, 0, 0, 0, 0, 255,~ +- Inside source: true +*** True Line Result + labels[:right].text, size, 0, 0, 0, 0, 255, +** Processing line: ~ 'fonts/manaspc.ttf']~ +- Inside source: true +*** True Line Result + 'fonts/manaspc.ttf'] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ lowrez_labels << labels[:left]~ +- Inside source: true +*** True Line Result + lowrez_labels << labels[:left] +** Processing line: ~ lowrez_labels << labels[:center]~ +- Inside source: true +*** True Line Result + lowrez_labels << labels[:center] +** Processing line: ~ lowrez_labels << labels[:right]~ +- Inside source: true +*** True Line Result + lowrez_labels << labels[:right] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ args.state.is_storyline_dialog_active = true~ +- Inside source: true +*** True Line Result + args.state.is_storyline_dialog_active = true +** Processing line: ~ render_player args, lowrez_sprites~ +- Inside source: true +*** True Line Result + render_player args, lowrez_sprites +** Processing line: ~ lowrez_sprites << [0, 0, 64, 8, 'sprites/label-background.png']~ +- Inside source: true +*** True Line Result + lowrez_sprites << [0, 0, 64, 8, 'sprites/label-background.png'] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_player args, lowrez_sprites~ +- Inside source: true +*** True Line Result + def render_player args, lowrez_sprites +** Processing line: ~ lowrez_sprites << player_md_down(args, *args.state.player)~ +- Inside source: true +*** True Line Result + lowrez_sprites << player_md_down(args, *args.state.player) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_adornments args, lowrez_sprites~ +- Inside source: true +*** True Line Result + def render_adornments args, lowrez_sprites +** Processing line: ~ render_scenes args, lowrez_sprites~ +- Inside source: true +*** True Line Result + render_scenes args, lowrez_sprites +** Processing line: ~ render_storylines args, lowrez_sprites~ +- Inside source: true +*** True Line Result + render_storylines args, lowrez_sprites +** Processing line: ~ return if args.state.is_storyline_dialog_active~ +- Inside source: true +*** True Line Result + return if args.state.is_storyline_dialog_active +** Processing line: ~ lowrez_sprites << player_md_down(args, *args.state.player)~ +- Inside source: true +*** True Line Result + lowrez_sprites << player_md_down(args, *args.state.player) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def global_alpha_percentage args, max_alpha = 255~ +- Inside source: true +*** True Line Result + def global_alpha_percentage args, max_alpha = 255 +** Processing line: ~ return 255 unless args.state.scene_changed_at~ +- Inside source: true +*** True Line Result + return 255 unless args.state.scene_changed_at +** Processing line: ~ return 255 unless args.state.scene_fade~ +- Inside source: true +*** True Line Result + return 255 unless args.state.scene_fade +** Processing line: ~ return 255 unless args.state.scene_fade > 0~ +- Inside source: true +*** True Line Result + return 255 unless args.state.scene_fade > 0 +** Processing line: ~ return max_alpha * args.state.scene_changed_at.ease(args.state.scene_fade)~ +- Inside source: true +*** True Line Result + return max_alpha * args.state.scene_changed_at.ease(args.state.scene_fade) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_current_scene args, lowrez_sprites, lowrez_labels, lowrez_solids~ +- Inside source: true +*** True Line Result + def render_current_scene args, lowrez_sprites, lowrez_labels, lowrez_solids +** Processing line: ~ lowrez_sprites << [0, 0, 64, 64, args.state.background, 0, (global_alpha_percentage args)]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [0, 0, 64, 64, args.state.background, 0, (global_alpha_percentage args)] +** Processing line: ~ if args.state.scene_render_override~ +- Inside source: true +*** True Line Result + if args.state.scene_render_override +** Processing line: ~ send args.state.scene_render_override, args, lowrez_sprites, lowrez_labels, lowrez_solids~ +- Inside source: true +*** True Line Result + send args.state.scene_render_override, args, lowrez_sprites, lowrez_labels, lowrez_solids +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ storyline_to_show = args.state.storyline_to_show || ""~ +- Inside source: true +*** True Line Result + storyline_to_show = args.state.storyline_to_show || "" +** Processing line: ~ render_adornments args, lowrez_sprites~ +- Inside source: true +*** True Line Result + render_adornments args, lowrez_sprites +** Processing line: ~ render_storyline_dialog args, lowrez_labels, lowrez_sprites~ +- Inside source: true +*** True Line Result + render_storyline_dialog args, lowrez_labels, lowrez_sprites +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.state.background == 'sprites/tribute-game-over.png'~ +- Inside source: true +*** True Line Result + if args.state.background == 'sprites/tribute-game-over.png' +** Processing line: ~ lowrez_sprites << [0, 0, 64, 11, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 0, 0, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [0, 0, 64, 11, 'sprites/label-background.png', 0, adornments_alpha(args, 200), 0, 0, 0] +** Processing line: ~ lowrez_labels << [9, 6, 'Return of', 255, 255, 255]~ +- Inside source: true +*** True Line Result + lowrez_labels << [9, 6, 'Return of', 255, 255, 255] +** Processing line: ~ lowrez_labels << [9, 1, ' Serenity', 255, 255, 255]~ +- Inside source: true +*** True Line Result + lowrez_labels << [9, 1, ' Serenity', 255, 255, 255] +** Processing line: ~ if !args.state.ended~ +- Inside source: true +*** True Line Result + if !args.state.ended +** Processing line: ~ args.gtk.stop_music~ +- Inside source: true +*** True Line Result + args.gtk.stop_music +** Processing line: ~ args.outputs.sounds << 'sounds/music-loop.ogg'~ +- Inside source: true +*** True Line Result + args.outputs.sounds << 'sounds/music-loop.ogg' +** Processing line: ~ args.state.ended = true~ +- Inside source: true +*** True Line Result + args.state.ended = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def player_md_right args, x, y~ +- Inside source: true +*** True Line Result + def player_md_right args, x, y +** Processing line: ~ [x, y, 4, 11, 'sprites/player-right.png', 0, (global_alpha_percentage args)]~ +- Inside source: true +*** True Line Result + [x, y, 4, 11, 'sprites/player-right.png', 0, (global_alpha_percentage args)] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def player_md_left args, x, y~ +- Inside source: true +*** True Line Result + def player_md_left args, x, y +** Processing line: ~ [x, y, 4, 11, 'sprites/player-left.png', 0, (global_alpha_percentage args)]~ +- Inside source: true +*** True Line Result + [x, y, 4, 11, 'sprites/player-left.png', 0, (global_alpha_percentage args)] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def player_md_up args, x, y~ +- Inside source: true +*** True Line Result + def player_md_up args, x, y +** Processing line: ~ [x, y, 4, 11, 'sprites/player-up.png', 0, (global_alpha_percentage args)]~ +- Inside source: true +*** True Line Result + [x, y, 4, 11, 'sprites/player-up.png', 0, (global_alpha_percentage args)] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def player_md_down args, x, y~ +- Inside source: true +*** True Line Result + def player_md_down args, x, y +** Processing line: ~ [x, y, 4, 11, 'sprites/player-down.png', 0, (global_alpha_percentage args)]~ +- Inside source: true +*** True Line Result + [x, y, 4, 11, 'sprites/player-down.png', 0, (global_alpha_percentage args)] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def player_sm args, x, y~ +- Inside source: true +*** True Line Result + def player_sm args, x, y +** Processing line: ~ [x, y, 3, 7, 'sprites/player-zoomed-out.png', 0, (global_alpha_percentage args)]~ +- Inside source: true +*** True Line Result + [x, y, 3, 7, 'sprites/player-zoomed-out.png', 0, (global_alpha_percentage args)] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def player_xs args, x, y~ +- Inside source: true +*** True Line Result + def player_xs args, x, y +** Processing line: ~ [x, y, 1, 4, 'sprites/player-zoomed-out.png', 0, (global_alpha_percentage args)]~ +- Inside source: true +*** True Line Result + [x, y, 1, 4, 'sprites/player-zoomed-out.png', 0, (global_alpha_percentage 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: ~*** Rpg Narrative - Return Of Serenity - require.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - require.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/require.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/require.rb +** Processing line: ~ require 'app/lowrez_simulator.rb'~ +- Inside source: true +*** True Line Result + require 'app/lowrez_simulator.rb' +** Processing line: ~ require 'app/storyline_day_one.rb'~ +- Inside source: true +*** True Line Result + require 'app/storyline_day_one.rb' +** Processing line: ~ require 'app/storyline_blinking_light.rb'~ +- Inside source: true +*** True Line Result + require 'app/storyline_blinking_light.rb' +** Processing line: ~ require 'app/storyline_serenity_introduction.rb'~ +- Inside source: true +*** True Line Result + require 'app/storyline_serenity_introduction.rb' +** Processing line: ~ require 'app/storyline_speed_of_light.rb'~ +- Inside source: true +*** True Line Result + require 'app/storyline_speed_of_light.rb' +** Processing line: ~ require 'app/storyline_serenity_alive.rb'~ +- Inside source: true +*** True Line Result + require 'app/storyline_serenity_alive.rb' +** Processing line: ~ require 'app/storyline_serenity_bio.rb'~ +- Inside source: true +*** True Line Result + require 'app/storyline_serenity_bio.rb' +** Processing line: ~ require 'app/storyline_anka.rb'~ +- Inside source: true +*** True Line Result + require 'app/storyline_anka.rb' +** Processing line: ~ require 'app/storyline_final_message.rb'~ +- Inside source: true +*** True Line Result + require 'app/storyline_final_message.rb' +** Processing line: ~ require 'app/storyline_final_decision.rb'~ +- Inside source: true +*** True Line Result + require 'app/storyline_final_decision.rb' +** Processing line: ~ require 'app/storyline.rb'~ +- Inside source: true +*** True Line Result + require 'app/storyline.rb' +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - storyline.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline.rb +** Processing line: ~ def hotspot_top~ +- Inside source: true +*** True Line Result + def hotspot_top +** Processing line: ~ [4, 61, 56, 3]~ +- Inside source: true +*** True Line Result + [4, 61, 56, 3] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def hotspot_bottom~ +- Inside source: true +*** True Line Result + def hotspot_bottom +** Processing line: ~ [4, 0, 56, 3]~ +- Inside source: true +*** True Line Result + [4, 0, 56, 3] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def hotspot_top_right~ +- Inside source: true +*** True Line Result + def hotspot_top_right +** Processing line: ~ [62, 35, 3, 25]~ +- Inside source: true +*** True Line Result + [62, 35, 3, 25] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def hotspot_bottom_right~ +- Inside source: true +*** True Line Result + def hotspot_bottom_right +** Processing line: ~ [62, 0, 3, 25]~ +- Inside source: true +*** True Line Result + [62, 0, 3, 25] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def storyline_history_include? args, text~ +- Inside source: true +*** True Line Result + def storyline_history_include? args, text +** Processing line: ~ args.state.storyline_history.any? { |s| s.gsub("-", "").gsub(" ", "").include? text.gsub("-", "").gsub(" ", "") }~ +- Inside source: true +*** True Line Result + args.state.storyline_history.any? { |s| s.gsub("-", "").gsub(" ", "").include? text.gsub("-", "").gsub(" ", "") } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def blinking_light_side_of_home_render args, lowrez_sprites, lowrez_labels, lowrez_solids~ +- Inside source: true +*** True Line Result + def blinking_light_side_of_home_render args, lowrez_sprites, lowrez_labels, lowrez_solids +** Processing line: ~ lowrez_sprites << [48, 44, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [48, 44, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ lowrez_sprites << [49, 45, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [49, 45, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ lowrez_sprites << [50, 46, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [50, 46, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def blinking_light_mountain_pass_render args, lowrez_sprites, lowrez_labels, lowrez_solids~ +- Inside source: true +*** True Line Result + def blinking_light_mountain_pass_render args, lowrez_sprites, lowrez_labels, lowrez_solids +** Processing line: ~ lowrez_sprites << [18, 47, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [18, 47, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ lowrez_sprites << [19, 48, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [19, 48, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ lowrez_sprites << [20, 49, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [20, 49, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def blinking_light_path_to_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids~ +- Inside source: true +*** True Line Result + def blinking_light_path_to_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids +** Processing line: ~ lowrez_sprites << [0, 26, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [0, 26, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ lowrez_sprites << [1, 27, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [1, 27, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ lowrez_sprites << [2, 28, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [2, 28, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def blinking_light_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids~ +- Inside source: true +*** True Line Result + def blinking_light_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids +** Processing line: ~ lowrez_sprites << [23, 59, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [23, 59, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ lowrez_sprites << [24, 60, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [24, 60, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ lowrez_sprites << [25, 61, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [25, 61, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def blinking_light_inside_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids~ +- Inside source: true +*** True Line Result + def blinking_light_inside_observatory_render args, lowrez_sprites, lowrez_labels, lowrez_solids +** Processing line: ~ lowrez_sprites << [30, 30, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [30, 30, 5, 5, 'sprites/square.png', 0, 50 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ lowrez_sprites << [31, 31, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [31, 31, 3, 3, 'sprites/square.png', 0, 100 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ lowrez_sprites << [32, 32, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0]~ +- Inside source: true +*** True Line Result + lowrez_sprites << [32, 32, 1, 1, 'sprites/square.png', 0, 255 * (args.state.tick_count % 50).fdiv(50), 0, 255, 0] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def decision_graph context_message, context_action, context_result_one, context_result_two, context_result_three = [], context_result_four = []~ +- Inside source: true +*** True Line Result + def decision_graph context_message, context_action, context_result_one, context_result_two, context_result_three = [], context_result_four = [] +** Processing line: ~ result_one_scene, result_one_label, result_one_text = context_result_one~ +- Inside source: true +*** True Line Result + result_one_scene, result_one_label, result_one_text = context_result_one +** Processing line: ~ result_two_scene, result_two_label, result_two_text = context_result_two~ +- Inside source: true +*** True Line Result + result_two_scene, result_two_label, result_two_text = context_result_two +** Processing line: ~ result_three_scene, result_three_label, result_three_text = context_result_three~ +- Inside source: true +*** True Line Result + result_three_scene, result_three_label, result_three_text = context_result_three +** Processing line: ~ result_four_scene, result_four_label, result_four_text = context_result_four~ +- Inside source: true +*** True Line Result + result_four_scene, result_four_label, result_four_text = context_result_four +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ top_level_hash = {~ +- Inside source: true +*** True Line Result + top_level_hash = { +** Processing line: ~ background: 'sprites/decision.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/decision.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [20, 36],~ +- Inside source: true +*** True Line Result + player: [20, 36], +** Processing line: ~ storylines: [ ],~ +- Inside source: true +*** True Line Result + storylines: [ ], +** Processing line: ~ scenes: [ ]~ +- Inside source: true +*** True Line Result + scenes: [ ] +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ confirmation_result_one_hash = {~ +- Inside source: true +*** True Line Result + confirmation_result_one_hash = { +** Processing line: ~ background: 'sprites/decision.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/decision.png', +** Processing line: ~ scenes: [ ],~ +- Inside source: true +*** True Line Result + scenes: [ ], +** Processing line: ~ storylines: [ ]~ +- Inside source: true +*** True Line Result + storylines: [ ] +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ confirmation_result_two_hash = {~ +- Inside source: true +*** True Line Result + confirmation_result_two_hash = { +** Processing line: ~ background: 'sprites/decision.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/decision.png', +** Processing line: ~ scenes: [ ],~ +- Inside source: true +*** True Line Result + scenes: [ ], +** Processing line: ~ storylines: [ ]~ +- Inside source: true +*** True Line Result + storylines: [ ] +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ confirmation_result_three_hash = {~ +- Inside source: true +*** True Line Result + confirmation_result_three_hash = { +** Processing line: ~ background: 'sprites/decision.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/decision.png', +** Processing line: ~ scenes: [ ],~ +- Inside source: true +*** True Line Result + scenes: [ ], +** Processing line: ~ storylines: [ ]~ +- Inside source: true +*** True Line Result + storylines: [ ] +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ confirmation_result_four_hash = {~ +- Inside source: true +*** True Line Result + confirmation_result_four_hash = { +** Processing line: ~ background: 'sprites/decision.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/decision.png', +** Processing line: ~ scenes: [ ],~ +- Inside source: true +*** True Line Result + scenes: [ ], +** Processing line: ~ storylines: [ ]~ +- Inside source: true +*** True Line Result + storylines: [ ] +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ top_level_hash[:storylines] << [ 5, 35, 4, 4, context_message]~ +- Inside source: true +*** True Line Result + top_level_hash[:storylines] << [ 5, 35, 4, 4, context_message] +** Processing line: ~ top_level_hash[:storylines] << [20, 35, 4, 4, context_action]~ +- Inside source: true +*** True Line Result + top_level_hash[:storylines] << [20, 35, 4, 4, context_action] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ confirmation_result_one_hash[:scenes] << [20, 35, 4, 4, top_level_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_one_hash[:scenes] << [20, 35, 4, 4, top_level_hash] +** Processing line: ~ confirmation_result_one_hash[:scenes] << [60, 50, 4, 4, result_one_scene]~ +- Inside source: true +*** True Line Result + confirmation_result_one_hash[:scenes] << [60, 50, 4, 4, result_one_scene] +** Processing line: ~ confirmation_result_one_hash[:storylines] << [40, 50, 4, 4, "#{result_one_label}: \"#{result_one_text}\""]~ +- Inside source: true +*** True Line Result + confirmation_result_one_hash[:storylines] << [40, 50, 4, 4, "#{result_one_label}: \"#{result_one_text}\""] +** Processing line: ~ confirmation_result_one_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene~ +- Inside source: true +*** True Line Result + confirmation_result_one_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene +** Processing line: ~ confirmation_result_one_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene~ +- Inside source: true +*** True Line Result + confirmation_result_one_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene +** Processing line: ~ confirmation_result_one_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_one_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ confirmation_result_two_hash[:scenes] << [20, 35, 4, 4, top_level_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_two_hash[:scenes] << [20, 35, 4, 4, top_level_hash] +** Processing line: ~ confirmation_result_two_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_two_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash] +** Processing line: ~ confirmation_result_two_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene~ +- Inside source: true +*** True Line Result + confirmation_result_two_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene +** Processing line: ~ confirmation_result_two_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene~ +- Inside source: true +*** True Line Result + confirmation_result_two_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene +** Processing line: ~ confirmation_result_two_hash[:scenes] << [60, 20, 4, 4, result_two_scene]~ +- Inside source: true +*** True Line Result + confirmation_result_two_hash[:scenes] << [60, 20, 4, 4, result_two_scene] +** Processing line: ~ confirmation_result_two_hash[:storylines] << [40, 20, 4, 4, "#{result_two_label}: \"#{result_two_text}\""]~ +- Inside source: true +*** True Line Result + confirmation_result_two_hash[:storylines] << [40, 20, 4, 4, "#{result_two_label}: \"#{result_two_text}\""] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ confirmation_result_three_hash[:scenes] << [20, 35, 4, 4, top_level_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_three_hash[:scenes] << [20, 35, 4, 4, top_level_hash] +** Processing line: ~ confirmation_result_three_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_three_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash] +** Processing line: ~ confirmation_result_three_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_three_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] +** Processing line: ~ confirmation_result_three_hash[:scenes] << [60, 30, 4, 4, result_three_scene]~ +- Inside source: true +*** True Line Result + confirmation_result_three_hash[:scenes] << [60, 30, 4, 4, result_three_scene] +** Processing line: ~ confirmation_result_three_hash[:storylines] << [40, 30, 4, 4, "#{result_three_label}: \"#{result_three_text}\""]~ +- Inside source: true +*** True Line Result + confirmation_result_three_hash[:storylines] << [40, 30, 4, 4, "#{result_three_label}: \"#{result_three_text}\""] +** Processing line: ~ confirmation_result_three_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_three_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ confirmation_result_four_hash[:scenes] << [20, 35, 4, 4, top_level_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_four_hash[:scenes] << [20, 35, 4, 4, top_level_hash] +** Processing line: ~ confirmation_result_four_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_four_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash] +** Processing line: ~ confirmation_result_four_hash[:scenes] << [60, 40, 4, 4, result_four_scene]~ +- Inside source: true +*** True Line Result + confirmation_result_four_hash[:scenes] << [60, 40, 4, 4, result_four_scene] +** Processing line: ~ confirmation_result_four_hash[:storylines] << [40, 40, 4, 4, "#{result_four_label}: \"#{result_four_text}\""]~ +- Inside source: true +*** True Line Result + confirmation_result_four_hash[:storylines] << [40, 40, 4, 4, "#{result_four_label}: \"#{result_four_text}\""] +** Processing line: ~ confirmation_result_four_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_four_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] +** Processing line: ~ confirmation_result_four_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash]~ +- Inside source: true +*** True Line Result + confirmation_result_four_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ top_level_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash]~ +- Inside source: true +*** True Line Result + top_level_hash[:scenes] << [40, 50, 4, 4, confirmation_result_one_hash] +** Processing line: ~ top_level_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene~ +- Inside source: true +*** True Line Result + top_level_hash[:scenes] << [40, 40, 4, 4, confirmation_result_four_hash] if result_four_scene +** Processing line: ~ top_level_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene~ +- Inside source: true +*** True Line Result + top_level_hash[:scenes] << [40, 30, 4, 4, confirmation_result_three_hash] if result_three_scene +** Processing line: ~ top_level_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash]~ +- Inside source: true +*** True Line Result + top_level_hash[:scenes] << [40, 20, 4, 4, confirmation_result_two_hash] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ top_level_hash~ +- Inside source: true +*** True Line Result + top_level_hash +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def ship_control_hotspot offset_x, offset_y, a, b, c, d~ +- Inside source: true +*** True Line Result + def ship_control_hotspot offset_x, offset_y, a, b, c, d +** Processing line: ~ results = []~ +- Inside source: true +*** True Line Result + results = [] +** Processing line: ~ results << [ 6 + offset_x, 0 + offset_y, 4, 4, a] if a~ +- Inside source: true +*** True Line Result + results << [ 6 + offset_x, 0 + offset_y, 4, 4, a] if a +** Processing line: ~ results << [ 1 + offset_x, 5 + offset_y, 4, 4, b] if b~ +- Inside source: true +*** True Line Result + results << [ 1 + offset_x, 5 + offset_y, 4, 4, b] if b +** Processing line: ~ results << [ 6 + offset_x, 5 + offset_y, 4, 4, c] if c~ +- Inside source: true +*** True Line Result + results << [ 6 + offset_x, 5 + offset_y, 4, 4, c] if c +** Processing line: ~ results << [ 11 + offset_x, 5 + offset_y, 4, 4, d] if d~ +- Inside source: true +*** True Line Result + results << [ 11 + offset_x, 5 + offset_y, 4, 4, d] if d +** Processing line: ~ results~ +- Inside source: true +*** True Line Result + results +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def reload_current_scene~ +- Inside source: true +*** True Line Result + def reload_current_scene +** Processing line: ~ if $gtk.args.state.last_hotspot_scene~ +- Inside source: true +*** True Line Result + if $gtk.args.state.last_hotspot_scene +** Processing line: ~ set_scene $gtk.args, send($gtk.args.state.last_hotspot_scene, $gtk.args)~ +- Inside source: true +*** True Line Result + set_scene $gtk.args, send($gtk.args.state.last_hotspot_scene, $gtk.args) +** Processing line: ~ tick $gtk.args~ +- Inside source: true +*** True Line Result + tick $gtk.args +** Processing line: ~ elsif respond_to? :set_scene~ +- Inside source: true +*** True Line Result + elsif respond_to? :set_scene +** Processing line: ~ set_scene $gtk.args, (replied_to_serenity_alive_firmly $gtk.args)~ +- Inside source: true +*** True Line Result + set_scene $gtk.args, (replied_to_serenity_alive_firmly $gtk.args) +** Processing line: ~ tick $gtk.args~ +- Inside source: true +*** True Line Result + tick $gtk.args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ $gtk.console.close~ +- Inside source: true +*** True Line Result + $gtk.console.close +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_anka.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - storyline_anka.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_anka.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_anka.rb +** Processing line: ~ def anka_inside_room args~ +- Inside source: true +*** True Line Result + def anka_inside_room args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [34, 35],~ +- Inside source: true +*** True Line Result + player: [34, 35], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [34, 34, 4, 4, "Ahhhh!!! Oh god, it was just- a nightmare."],~ +- Inside source: true +*** True Line Result + [34, 34, 4, 4, "Ahhhh!!! Oh god, it was just- a nightmare."], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [32, -1, 8, 3, :anka_observatory]~ +- Inside source: true +*** True Line Result + [32, -1, 8, 3, :anka_observatory] +** 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 anka_observatory args~ +- Inside source: true +*** True Line Result + def anka_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [51, 12],~ +- Inside source: true +*** True Line Result + player: [51, 12], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [50, 10, 4, 4, "Breathe, Hiro. Just see what's there... everything--- will- be okay."]~ +- Inside source: true +*** True Line Result + [50, 10, 4, 4, "Breathe, Hiro. Just see what's there... everything--- will- be okay."] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 18, 5, 12, :anka_inside_mainframe]~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, :anka_inside_mainframe] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_inside_observatory_render +** 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 anka_inside_mainframe args~ +- Inside source: true +*** True Line Result + def anka_inside_mainframe args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ player: [32, 4],~ +- Inside source: true +*** True Line Result + player: [32, 4], +** Processing line: ~ background: 'sprites/mainframe.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mainframe.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [22, 45, 17, 4, (anka_last_reply args)],~ +- Inside source: true +*** True Line Result + [22, 45, 17, 4, (anka_last_reply args)], +** Processing line: ~ [45, 45, 4, 4, (anka_current_reply args)],~ +- Inside source: true +*** True Line Result + [45, 45, 4, 4, (anka_current_reply args)], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_top_right, :reply_to_anka]~ +- Inside source: true +*** True Line Result + [*hotspot_top_right, :reply_to_anka] +** 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 reply_to_anka args~ +- Inside source: true +*** True Line Result + def reply_to_anka args +** Processing line: ~ decision_graph anka_current_reply(args),~ +- Inside source: true +*** True Line Result + decision_graph anka_current_reply(args), +** Processing line: ~ "Matthew's-- wife is doing-- well. What's-- even-- better-- is that he's-- a dad, and he didn't-- even-- know it. Should- I- leave- out the part about-- the crew- being-- in hibernation-- for 20-- years? They- should- enter-- statis-- on a high- note... Right?",~ +- Inside source: true +*** True Line Result + "Matthew's-- wife is doing-- well. What's-- even-- better-- is that he's-- a dad, and he didn't-- even-- know it. Should- I- leave- out the part about-- the crew- being-- in hibernation-- for 20-- years? They- should- enter-- statis-- on a high- note... Right?", +** Processing line: ~ [:replied_with_whole_truth, "Whole-- Truth--", anka_reply_whole_truth],~ +- Inside source: true +*** True Line Result + [:replied_with_whole_truth, "Whole-- Truth--", anka_reply_whole_truth], +** Processing line: ~ [:replied_with_half_truth, "Half-- Truth--", anka_reply_half_truth]~ +- Inside source: true +*** True Line Result + [:replied_with_half_truth, "Half-- Truth--", anka_reply_half_truth] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def anka_last_reply args~ +- Inside source: true +*** True Line Result + def anka_last_reply args +** Processing line: ~ if args.state.scene_history.include? :replied_to_serenity_alive_firmly~ +- Inside source: true +*** True Line Result + if args.state.scene_history.include? :replied_to_serenity_alive_firmly +** Processing line: ~ return "Buffer--: #{serenity_alive_firm_reply.quote}"~ +- Inside source: true +*** True Line Result + return "Buffer--: #{serenity_alive_firm_reply.quote}" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return "Buffer--: #{serenity_alive_sugarcoated_reply.quote}"~ +- Inside source: true +*** True Line Result + return "Buffer--: #{serenity_alive_sugarcoated_reply.quote}" +** 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 anka_reply_whole_truth~ +- Inside source: true +*** True Line Result + def anka_reply_whole_truth +** Processing line: ~ "Matthew's wife is doing-- very-- well. In fact, she was pregnant. Matthew-- is a dad. He has a son. But, I need- all-- of-- you-- to brace-- yourselves. You've-- been in statis-- for 20 years. A lot has changed. Most of Earth's-- population--- didn't-- survive. Tell- Matthew-- that I'm-- sorry he didn't-- get to see- his- son grow- up."~ +- Inside source: true +*** True Line Result + "Matthew's wife is doing-- very-- well. In fact, she was pregnant. Matthew-- is a dad. He has a son. But, I need- all-- of-- you-- to brace-- yourselves. You've-- been in statis-- for 20 years. A lot has changed. Most of Earth's-- population--- didn't-- survive. Tell- Matthew-- that I'm-- sorry he didn't-- get to see- his- son grow- up." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def anka_reply_half_truth~ +- Inside source: true +*** True Line Result + def anka_reply_half_truth +** Processing line: ~ "Matthew's--- wife- is doing-- very-- well. In fact, she was pregnant. Matthew is a dad! It's a boy! Tell- Matthew-- congrats-- for me. Hope-- to see- all of you- soon."~ +- Inside source: true +*** True Line Result + "Matthew's--- wife- is doing-- very-- well. In fact, she was pregnant. Matthew is a dad! It's a boy! Tell- Matthew-- congrats-- for me. Hope-- to see- all of you- soon." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def replied_with_whole_truth args~ +- Inside source: true +*** True Line Result + def replied_with_whole_truth args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [32, 21],~ +- Inside source: true +*** True Line Result + player: [32, 21], +** Processing line: ~ scenes: [[60, 0, 4, 32, :replied_to_anka_back_home]],~ +- Inside source: true +*** True Line Result + scenes: [[60, 0, 4, 32, :replied_to_anka_back_home]], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: #{anka_reply_whole_truth.quote}"],~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, "Buffer-- has been set to: #{anka_reply_whole_truth.quote}"], +** Processing line: ~ [30, 10, 5, 4, "I- hope- I- did the right- thing- by laying-- it all- out- there."],~ +- Inside source: true +*** True Line Result + [30, 10, 5, 4, "I- hope- I- did the right- thing- by laying-- it all- out- there."], +** 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 replied_with_half_truth args~ +- Inside source: true +*** True Line Result + def replied_with_half_truth args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [32, 21],~ +- Inside source: true +*** True Line Result + player: [32, 21], +** Processing line: ~ scenes: [[60, 0, 4, 32, :replied_to_anka_back_home]],~ +- Inside source: true +*** True Line Result + scenes: [[60, 0, 4, 32, :replied_to_anka_back_home]], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: #{anka_reply_half_truth.quote}"],~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, "Buffer-- has been set to: #{anka_reply_half_truth.quote}"], +** Processing line: ~ [30, 10, 5, 4, "I- hope- I- did the right- thing- by not giving-- them- the whole- truth."],~ +- Inside source: true +*** True Line Result + [30, 10, 5, 4, "I- hope- I- did the right- thing- by not giving-- them- the whole- truth."], +** 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 anka_current_reply args~ +- Inside source: true +*** True Line Result + def anka_current_reply args +** Processing line: ~ if args.state.scene_history.include? :replied_to_serenity_alive_firmly~ +- Inside source: true +*** True Line Result + if args.state.scene_history.include? :replied_to_serenity_alive_firmly +** Processing line: ~ return "Hello. This is, Aanka. Sasha-- is still- trying-- to gather-- her wits about-- her, given- the gravity--- of your- last- reply. Thank- you- for being-- honest, and thank- you- for the help- with the ship- diagnostics. I was able-- to retrieve-- all of the navigation--- information---- after-- the battery--- swap. We- are ready-- to head back to Earth. Before-- we go- back- into-- statis, Matthew--- wanted-- to know- how his- wife- is doing. Please- reply-- as soon- as you can. He's-- not going-- to get- into-- the statis-- chamber-- until-- he knows- his wife is okay."~ +- Inside source: true +*** True Line Result + return "Hello. This is, Aanka. Sasha-- is still- trying-- to gather-- her wits about-- her, given- the gravity--- of your- last- reply. Thank- you- for being-- honest, and thank- you- for the help- with the ship- diagnostics. I was able-- to retrieve-- all of the navigation--- information---- after-- the battery--- swap. We- are ready-- to head back to Earth. Before-- we go- back- into-- statis, Matthew--- wanted-- to know- how his- wife- is doing. Please- reply-- as soon- as you can. He's-- not going-- to get- into-- the statis-- chamber-- until-- he knows- his wife is okay." +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return "Hello. This is, Aanka. Thank- you for the help- with the ship's-- diagnostics. I was able-- to retrieve-- all of the navigation--- information--- after-- the battery-- swap. I- know-- that- you didn't-- tell- the whole truth- about-- how far we are from- Earth. Don't-- worry. I understand-- why you did it. We- are ready-- to head back to Earth. Before-- we go- back- into-- statis, Matthew--- wanted-- to know- how his- wife- is doing. Please- reply-- as soon- as you can. He's-- not going-- to get- into-- the statis-- chamber-- until-- he knows- his wife is okay."~ +- Inside source: true +*** True Line Result + return "Hello. This is, Aanka. Thank- you for the help- with the ship's-- diagnostics. I was able-- to retrieve-- all of the navigation--- information--- after-- the battery-- swap. I- know-- that- you didn't-- tell- the whole truth- about-- how far we are from- Earth. Don't-- worry. I understand-- why you did it. We- are ready-- to head back to Earth. Before-- we go- back- into-- statis, Matthew--- wanted-- to know- how his- wife- is doing. Please- reply-- as soon- as you can. He's-- not going-- to get- into-- the statis-- chamber-- until-- he knows- his wife is okay." +** 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 replied_to_anka_back_home args~ +- Inside source: true +*** True Line Result + def replied_to_anka_back_home args +** Processing line: ~ if args.state.scene_history.include? :replied_with_whole_truth~ +- Inside source: true +*** True Line Result + if args.state.scene_history.include? :replied_with_whole_truth +** Processing line: ~ return {~ +- Inside source: true +*** True Line Result + return { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [34, 4],~ +- Inside source: true +*** True Line Result + player: [34, 4], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [34, 4, 4, 4, "I- hope-- this pit in my stomach-- is gone-- by tomorrow---."],~ +- Inside source: true +*** True Line Result + [34, 4, 4, 4, "I- hope-- this pit in my stomach-- is gone-- by tomorrow---."], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 38, 12, 13, :final_message_sad],~ +- Inside source: true +*** True Line Result + [30, 38, 12, 13, :final_message_sad], +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return {~ +- Inside source: true +*** True Line Result + return { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [34, 4],~ +- Inside source: true +*** True Line Result + player: [34, 4], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [34, 4, 4, 4, "I- get the feeling-- I'm going-- to sleep real well tonight--."],~ +- Inside source: true +*** True Line Result + [34, 4, 4, 4, "I- get the feeling-- I'm going-- to sleep real well tonight--."], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 38, 12, 13, :final_message_happy],~ +- Inside source: true +*** True Line Result + [30, 38, 12, 13, :final_message_happy], +** 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: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_blinking_light.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_blinking_light.rb +** Processing line: ~ def the_blinking_light args~ +- Inside source: true +*** True Line Result + def the_blinking_light args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/side-of-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/side-of-home.png', +** Processing line: ~ player: [16, 13],~ +- Inside source: true +*** True Line Result + player: [16, 13], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [52, 24, 11, 5, :blinking_light_mountain_pass],~ +- Inside source: true +*** True Line Result + [52, 24, 11, 5, :blinking_light_mountain_pass], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_side_of_home_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_side_of_home_render +** 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 blinking_light_mountain_pass args~ +- Inside source: true +*** True Line Result + def blinking_light_mountain_pass args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/mountain-pass-zoomed-out.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mountain-pass-zoomed-out.png', +** Processing line: ~ player: [4, 4],~ +- Inside source: true +*** True Line Result + player: [4, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [18, 47, 5, 5, :blinking_light_path_to_observatory]~ +- Inside source: true +*** True Line Result + [18, 47, 5, 5, :blinking_light_path_to_observatory] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_mountain_pass_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_mountain_pass_render +** 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 blinking_light_path_to_observatory args~ +- Inside source: true +*** True Line Result + def blinking_light_path_to_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/path-to-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/path-to-observatory.png', +** Processing line: ~ player: [60, 4],~ +- Inside source: true +*** True Line Result + player: [60, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [0, 26, 5, 5, :blinking_light_observatory]~ +- Inside source: true +*** True Line Result + [0, 26, 5, 5, :blinking_light_observatory] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_path_to_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_path_to_observatory_render +** 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 blinking_light_observatory args~ +- Inside source: true +*** True Line Result + def blinking_light_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/observatory.png', +** Processing line: ~ player: [60, 2],~ +- Inside source: true +*** True Line Result + player: [60, 2], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [28, 39, 4, 10, :blinking_light_inside_observatory]~ +- Inside source: true +*** True Line Result + [28, 39, 4, 10, :blinking_light_inside_observatory] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_observatory_render +** 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 blinking_light_inside_observatory args~ +- Inside source: true +*** True Line Result + def blinking_light_inside_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ player: [60, 2],~ +- Inside source: true +*** True Line Result + player: [60, 2], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [50, 2, 4, 8, "That's weird. I thought- this- mainframe-- was broken--."]~ +- Inside source: true +*** True Line Result + [50, 2, 4, 8, "That's weird. I thought- this- mainframe-- was broken--."] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 18, 5, 12, :blinking_light_inside_mainframe]~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, :blinking_light_inside_mainframe] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_inside_observatory_render +** 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 blinking_light_inside_mainframe args~ +- Inside source: true +*** True Line Result + def blinking_light_inside_mainframe args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/mainframe.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mainframe.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [30, 4],~ +- Inside source: true +*** True Line Result + player: [30, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [62, 32, 4, 32, :reply_to_introduction]~ +- Inside source: true +*** True Line Result + [62, 32, 4, 32, :reply_to_introduction] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [43, 43, 8, 8, "\"Mission-- control--, your- main- comm-- channels-- seem-- to be down. My apologies-- for- using-- this low- level-- exploit--. What's-- going-- on down there? We are ready-- for reentry--.\" Message--- Timestamp---: 4- hours-- 23--- minutes-- ago--."],~ +- Inside source: true +*** True Line Result + [43, 43, 8, 8, "\"Mission-- control--, your- main- comm-- channels-- seem-- to be down. My apologies-- for- using-- this low- level-- exploit--. What's-- going-- on down there? We are ready-- for reentry--.\" Message--- Timestamp---: 4- hours-- 23--- minutes-- ago--."], +** Processing line: ~ [30, 30, 4, 4, "There's-- a low- level-- message-- here... NANI.T.F?"],~ +- Inside source: true +*** True Line Result + [30, 30, 4, 4, "There's-- a low- level-- message-- here... NANI.T.F?"], +** Processing line: ~ [14, 10, 24, 4, "Oh interesting---. This transistor--- needed-- to be activated--- for the- mainframe-- to work."],~ +- Inside source: true +*** True Line Result + [14, 10, 24, 4, "Oh interesting---. This transistor--- needed-- to be activated--- for the- mainframe-- to work."], +** Processing line: ~ [14, 20, 24, 4, "What the heck activated--- this thing- though?"]~ +- Inside source: true +*** True Line Result + [14, 20, 24, 4, "What the heck activated--- this thing- though?"] +** 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: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_day_one.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - storyline_day_one.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_day_one.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_day_one.rb +** Processing line: ~ def day_one_beginning args~ +- Inside source: true +*** True Line Result + def day_one_beginning args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/side-of-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/side-of-home.png', +** Processing line: ~ player: [16, 13],~ +- Inside source: true +*** True Line Result + player: [16, 13], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [0, 0, 64, 2, :day_one_infront_of_home],~ +- Inside source: true +*** True Line Result + [0, 0, 64, 2, :day_one_infront_of_home], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [35, 10, 6, 6, "Man. Hard to believe- that today- is the 20th--- anniversary-- of The Impact."]~ +- Inside source: true +*** True Line Result + [35, 10, 6, 6, "Man. Hard to believe- that today- is the 20th--- anniversary-- of The Impact."] +** 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 day_one_infront_of_home args~ +- Inside source: true +*** True Line Result + def day_one_infront_of_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/front-of-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/front-of-home.png', +** Processing line: ~ player: [56, 23],~ +- Inside source: true +*** True Line Result + player: [56, 23], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [43, 34, 10, 16, :day_one_home],~ +- Inside source: true +*** True Line Result + [43, 34, 10, 16, :day_one_home], +** Processing line: ~ [62, 0, 3, 40, :day_one_beginning],~ +- Inside source: true +*** True Line Result + [62, 0, 3, 40, :day_one_beginning], +** Processing line: ~ [0, 4, 3, 20, :day_one_ceremony]~ +- Inside source: true +*** True Line Result + [0, 4, 3, 20, :day_one_ceremony] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [40, 20, 4, 4, "It looks like everyone- is already- at the rememberance-- ceremony."],~ +- Inside source: true +*** True Line Result + [40, 20, 4, 4, "It looks like everyone- is already- at the rememberance-- ceremony."], +** 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 day_one_home args~ +- Inside source: true +*** True Line Result + def day_one_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [34, 3],~ +- Inside source: true +*** True Line Result + player: [34, 3], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [28, 0, 12, 2, :day_one_infront_of_home]~ +- Inside source: true +*** True Line Result + [28, 0, 12, 2, :day_one_infront_of_home] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ 38, 4, 4, 4, "My mansion- in all its glory! Okay yea, it's just a shipping- container-. Apparently-, it's nothing- like the luxuries- of the 2040's. But it's- all we have- in- this day and age. And it'll suffice."~ +- Inside source: true +*** True Line Result + 38, 4, 4, 4, "My mansion- in all its glory! Okay yea, it's just a shipping- container-. Apparently-, it's nothing- like the luxuries- of the 2040's. But it's- all we have- in- this day and age. And it'll suffice." +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ 28, 7, 4, 7,~ +- Inside source: true +*** True Line Result + 28, 7, 4, 7, +** Processing line: ~ "Ahhh. My reading- couch. It's so comfortable--."~ +- Inside source: true +*** True Line Result + "Ahhh. My reading- couch. It's so comfortable--." +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ 38, 21, 4, 4,~ +- Inside source: true +*** True Line Result + 38, 21, 4, 4, +** Processing line: ~ "I'm- lucky- to have a computer--. I'm- one of the few people- with- the skills to put this- thing to good use."~ +- Inside source: true +*** True Line Result + "I'm- lucky- to have a computer--. I'm- one of the few people- with- the skills to put this- thing to good use." +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ 45, 37, 4, 8,~ +- Inside source: true +*** True Line Result + 45, 37, 4, 8, +** Processing line: ~ "This corner- of my home- is always- warmer-. It's cause of the ref~lected-- light- from the solar-- panels--, just on the other- side- of this wall. It's hard- to believe- there was o~nce-- an unlimited- amount- of electricity--."~ +- Inside source: true +*** True Line Result + "This corner- of my home- is always- warmer-. It's cause of the ref~lected-- light- from the solar-- panels--, just on the other- side- of this wall. It's hard- to believe- there was o~nce-- an unlimited- amount- of electricity--." +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ 32, 40, 8, 10,~ +- Inside source: true +*** True Line Result + 32, 40, 8, 10, +** Processing line: ~ "This isn't- a good time- to sleep. I- should probably- head to the ceremony-."~ +- Inside source: true +*** True Line Result + "This isn't- a good time- to sleep. I- should probably- head to the ceremony-." +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ 25, 21, 5, 12,~ +- Inside source: true +*** True Line Result + 25, 21, 5, 12, +** Processing line: ~ "Fifteen-- years- of computer-- science-- notes, neatly-- organized. Compiler--- Theory--, Linear--- Algebra---, Game-- Development---... Every-- subject-- imaginable--."~ +- Inside source: true +*** True Line Result + "Fifteen-- years- of computer-- science-- notes, neatly-- organized. Compiler--- Theory--, Linear--- Algebra---, Game-- Development---... Every-- subject-- imaginable--." +** 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: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def day_one_ceremony args~ +- Inside source: true +*** True Line Result + def day_one_ceremony args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/tribute.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/tribute.png', +** Processing line: ~ player: [57, 21],~ +- Inside source: true +*** True Line Result + player: [57, 21], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [62, 0, 2, 40, :day_one_infront_of_home],~ +- Inside source: true +*** True Line Result + [62, 0, 2, 40, :day_one_infront_of_home], +** Processing line: ~ [0, 24, 2, 40, :day_one_infront_of_library]~ +- Inside source: true +*** True Line Result + [0, 24, 2, 40, :day_one_infront_of_library] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [53, 12, 3, 8, "It's- been twenty- years since The Impact. Twenty- years, since Halley's-- Comet-- set Earth's- blue- sky on fire."],~ +- Inside source: true +*** True Line Result + [53, 12, 3, 8, "It's- been twenty- years since The Impact. Twenty- years, since Halley's-- Comet-- set Earth's- blue- sky on fire."], +** Processing line: ~ [45, 12, 3, 8, "The space mission- sent to prevent- Earth's- total- destruction--, was a success. Only- 99.9%------ of the world's- population-- died-- that day. Hey, it's- better-- than 100%---- of humanity-- dying."],~ +- Inside source: true +*** True Line Result + [45, 12, 3, 8, "The space mission- sent to prevent- Earth's- total- destruction--, was a success. Only- 99.9%------ of the world's- population-- died-- that day. Hey, it's- better-- than 100%---- of humanity-- dying."], +** Processing line: ~ [20, 12, 23, 4, "The monument--- reads:---- Here- stands- the tribute-- to Space- Mission-- Serenity--- and- its- crew. You- have- given-- humanity--- a second-- chance."],~ +- Inside source: true +*** True Line Result + [20, 12, 23, 4, "The monument--- reads:---- Here- stands- the tribute-- to Space- Mission-- Serenity--- and- its- crew. You- have- given-- humanity--- a second-- chance."], +** Processing line: ~ [15, 12, 3, 8, "Rest- in- peace--- Matthew----, Sasha----, Aanka----"],~ +- Inside source: true +*** True Line Result + [15, 12, 3, 8, "Rest- in- peace--- Matthew----, Sasha----, Aanka----"], +** 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 day_one_infront_of_library args~ +- Inside source: true +*** True Line Result + def day_one_infront_of_library args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/outside-library.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/outside-library.png', +** Processing line: ~ player: [57, 21],~ +- Inside source: true +*** True Line Result + player: [57, 21], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [62, 0, 2, 40, :day_one_ceremony],~ +- Inside source: true +*** True Line Result + [62, 0, 2, 40, :day_one_ceremony], +** Processing line: ~ [49, 39, 6, 9, :day_one_library]~ +- Inside source: true +*** True Line Result + [49, 39, 6, 9, :day_one_library] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [50, 20, 4, 8, "Shipping- containers-- as far- as the eye- can see. It's- rather- beautiful-- if you ask me. Even- though-- this- view- represents-- all- that's-- left- of humanity-."]~ +- Inside source: true +*** True Line Result + [50, 20, 4, 8, "Shipping- containers-- as far- as the eye- can see. It's- rather- beautiful-- if you ask me. Even- though-- this- view- represents-- all- that's-- left- of humanity-."] +** 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 day_one_library args~ +- Inside source: true +*** True Line Result + def day_one_library args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/library.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/library.png', +** Processing line: ~ player: [27, 4],~ +- Inside source: true +*** True Line Result + player: [27, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [0, 0, 64, 2, :end_day_one_infront_of_library]~ +- Inside source: true +*** True Line Result + [0, 0, 64, 2, :end_day_one_infront_of_library] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [28, 22, 8, 4, "I grew- up- in this library. I've- read every- book- here. My favorites-- were- of course-- anything- computer-- related."],~ +- Inside source: true +*** True Line Result + [28, 22, 8, 4, "I grew- up- in this library. I've- read every- book- here. My favorites-- were- of course-- anything- computer-- related."], +** Processing line: ~ [6, 32, 10, 6, "My favorite-- area--- of the library. The Science-- Section."]~ +- Inside source: true +*** True Line Result + [6, 32, 10, 6, "My favorite-- area--- of the library. The Science-- Section."] +** 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 end_day_one_infront_of_library args~ +- Inside source: true +*** True Line Result + def end_day_one_infront_of_library args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/outside-library.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/outside-library.png', +** Processing line: ~ player: [51, 33],~ +- Inside source: true +*** True Line Result + player: [51, 33], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [49, 39, 6, 9, :day_one_library],~ +- Inside source: true +*** True Line Result + [49, 39, 6, 9, :day_one_library], +** Processing line: ~ [62, 0, 2, 40, :end_day_one_monument],~ +- Inside source: true +*** True Line Result + [62, 0, 2, 40, :end_day_one_monument], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [50, 27, 4, 4, "It's getting late. Better get some sleep."]~ +- Inside source: true +*** True Line Result + [50, 27, 4, 4, "It's getting late. Better get some sleep."] +** 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 end_day_one_monument args~ +- Inside source: true +*** True Line Result + def end_day_one_monument args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/tribute.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/tribute.png', +** Processing line: ~ player: [2, 36],~ +- Inside source: true +*** True Line Result + player: [2, 36], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [62, 0, 2, 40, :end_day_one_infront_of_home],~ +- Inside source: true +*** True Line Result + [62, 0, 2, 40, :end_day_one_infront_of_home], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [50, 27, 4, 4, "It's getting late. Better get some sleep."],~ +- Inside source: true +*** True Line Result + [50, 27, 4, 4, "It's getting late. Better get some sleep."], +** 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 end_day_one_infront_of_home args~ +- Inside source: true +*** True Line Result + def end_day_one_infront_of_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/front-of-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/front-of-home.png', +** Processing line: ~ player: [1, 17],~ +- Inside source: true +*** True Line Result + player: [1, 17], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [43, 34, 10, 16, :end_day_one_home],~ +- Inside source: true +*** True Line Result + [43, 34, 10, 16, :end_day_one_home], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [20, 10, 4, 4, "It's getting late. Better get some sleep."],~ +- Inside source: true +*** True Line Result + [20, 10, 4, 4, "It's getting late. Better get some sleep."], +** 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 end_day_one_home args~ +- Inside source: true +*** True Line Result + def end_day_one_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [34, 3],~ +- Inside source: true +*** True Line Result + player: [34, 3], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [32, 40, 8, 10, :end_day_one_dream],~ +- Inside source: true +*** True Line Result + [32, 40, 8, 10, :end_day_one_dream], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [38, 4, 4, 4, "It's getting late. Better get some sleep."],~ +- Inside source: true +*** True Line Result + [38, 4, 4, 4, "It's getting late. Better get some sleep."], +** 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 end_day_one_dream args~ +- Inside source: true +*** True Line Result + def end_day_one_dream args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/dream.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/dream.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [4, 4],~ +- Inside source: true +*** True Line Result + player: [4, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [62, 0, 2, 64, :explaining_the_special_power]~ +- Inside source: true +*** True Line Result + [62, 0, 2, 64, :explaining_the_special_power] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [10, 10, 4, 4, "Why- does this- moment-- always- haunt- my dreams?"],~ +- Inside source: true +*** True Line Result + [10, 10, 4, 4, "Why- does this- moment-- always- haunt- my dreams?"], +** Processing line: ~ [20, 10, 4, 4, "This kid- reads these computer--- science--- books- nonstop-. What's- wrong with him?"],~ +- Inside source: true +*** True Line Result + [20, 10, 4, 4, "This kid- reads these computer--- science--- books- nonstop-. What's- wrong with him?"], +** Processing line: ~ [30, 10, 4, 4, "There- is nothing-- wrong- with him. This behavior-- should be encouraged---! In fact-, I think- he's- special---. Have- you seen- him use- a computer---? It's-- almost-- as if he can- speak-- to it."]~ +- Inside source: true +*** True Line Result + [30, 10, 4, 4, "There- is nothing-- wrong- with him. This behavior-- should be encouraged---! In fact-, I think- he's- special---. Have- you seen- him use- a computer---? It's-- almost-- as if he can- speak-- to it."] +** 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 explaining_the_special_power args~ +- Inside source: true +*** True Line Result + def explaining_the_special_power args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [32, 30],~ +- Inside source: true +*** True Line Result + player: [32, 30], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ 38, 21, 4, 4, :explaining_the_special_power_inside_computer~ +- Inside source: true +*** True Line Result + 38, 21, 4, 4, :explaining_the_special_power_inside_computer +** 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: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def explaining_the_special_power_inside_computer args~ +- Inside source: true +*** True Line Result + def explaining_the_special_power_inside_computer args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/pc.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/pc.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [34, 4],~ +- Inside source: true +*** True Line Result + player: [34, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [0, 62, 64, 3, :the_blinking_light]~ +- Inside source: true +*** True Line Result + [0, 62, 64, 3, :the_blinking_light] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [14, 20, 24, 4, "So... I have a special-- power--. I don't-- need a mouse-, keyboard--, or even-- a monitor--- to control-- a computer--."],~ +- Inside source: true +*** True Line Result + [14, 20, 24, 4, "So... I have a special-- power--. I don't-- need a mouse-, keyboard--, or even-- a monitor--- to control-- a computer--."], +** Processing line: ~ [14, 25, 24, 4, "I only-- pretend-- to use peripherals---, so as not- to freak- anyone--- out."],~ +- Inside source: true +*** True Line Result + [14, 25, 24, 4, "I only-- pretend-- to use peripherals---, so as not- to freak- anyone--- out."], +** Processing line: ~ [14, 30, 24, 4, "Inside-- this silicon--- Universe---, is the only-- place I- feel- at peace."],~ +- Inside source: true +*** True Line Result + [14, 30, 24, 4, "Inside-- this silicon--- Universe---, is the only-- place I- feel- at peace."], +** Processing line: ~ [14, 35, 24, 4, "It's-- the only-- place where I don't-- feel alone."]~ +- Inside source: true +*** True Line Result + [14, 35, 24, 4, "It's-- the only-- place where I don't-- feel alone."] +** 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: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_final_decision.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - storyline_final_decision.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_decision.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_decision.rb +** Processing line: ~ def final_decision_side_of_home args~ +- Inside source: true +*** True Line Result + def final_decision_side_of_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 120,~ +- Inside source: true +*** True Line Result + fade: 120, +** Processing line: ~ background: 'sprites/side-of-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/side-of-home.png', +** Processing line: ~ player: [16, 13],~ +- Inside source: true +*** True Line Result + player: [16, 13], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [52, 24, 11, 5, :final_decision_mountain_pass],~ +- Inside source: true +*** True Line Result + [52, 24, 11, 5, :final_decision_mountain_pass], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_side_of_home_render,~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_side_of_home_render, +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [28, 13, 8, 4, "Man. Hard to believe- that today- is the 21st--- anniversary-- of The Impact. Serenity--- will- be- home- soon."]~ +- Inside source: true +*** True Line Result + [28, 13, 8, 4, "Man. Hard to believe- that today- is the 21st--- anniversary-- of The Impact. Serenity--- will- be- home- soon."] +** 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 final_decision_mountain_pass args~ +- Inside source: true +*** True Line Result + def final_decision_mountain_pass args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/mountain-pass-zoomed-out.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mountain-pass-zoomed-out.png', +** Processing line: ~ player: [4, 4],~ +- Inside source: true +*** True Line Result + player: [4, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [18, 47, 5, 5, :final_decision_path_to_observatory]~ +- Inside source: true +*** True Line Result + [18, 47, 5, 5, :final_decision_path_to_observatory] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_mountain_pass_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_mountain_pass_render +** 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 final_decision_path_to_observatory args~ +- Inside source: true +*** True Line Result + def final_decision_path_to_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/path-to-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/path-to-observatory.png', +** Processing line: ~ player: [60, 4],~ +- Inside source: true +*** True Line Result + player: [60, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [0, 26, 5, 5, :final_decision_observatory]~ +- Inside source: true +*** True Line Result + [0, 26, 5, 5, :final_decision_observatory] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_path_to_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_path_to_observatory_render +** 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 final_decision_observatory args~ +- Inside source: true +*** True Line Result + def final_decision_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/observatory.png', +** Processing line: ~ player: [60, 2],~ +- Inside source: true +*** True Line Result + player: [60, 2], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [28, 39, 4, 10, :final_decision_inside_observatory]~ +- Inside source: true +*** True Line Result + [28, 39, 4, 10, :final_decision_inside_observatory] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_observatory_render +** 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 final_decision_inside_observatory args~ +- Inside source: true +*** True Line Result + def final_decision_inside_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ player: [60, 2],~ +- Inside source: true +*** True Line Result + player: [60, 2], +** Processing line: ~ storylines: [],~ +- Inside source: true +*** True Line Result + storylines: [], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 18, 5, 12, :final_decision_inside_mainframe]~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, :final_decision_inside_mainframe] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_inside_observatory_render +** 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 final_decision_inside_mainframe args~ +- Inside source: true +*** True Line Result + def final_decision_inside_mainframe args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ player: [32, 4],~ +- Inside source: true +*** True Line Result + player: [32, 4], +** Processing line: ~ background: 'sprites/mainframe.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mainframe.png', +** Processing line: ~ storylines: [],~ +- Inside source: true +*** True Line Result + storylines: [], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_top, :final_decision_ship_status],~ +- Inside source: true +*** True Line Result + [*hotspot_top, :final_decision_ship_status], +** 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 final_decision_ship_status args~ +- Inside source: true +*** True Line Result + def final_decision_ship_status args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/serenity.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/serenity.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [30, 10],~ +- Inside source: true +*** True Line Result + player: [30, 10], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_top_right, :final_decision]~ +- Inside source: true +*** True Line Result + [*hotspot_top_right, :final_decision] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 8, 4, 4, "????"],~ +- Inside source: true +*** True Line Result + [30, 8, 4, 4, "????"], +** Processing line: ~ *final_decision_ship_status_shared(args)~ +- Inside source: true +*** True Line Result + *final_decision_ship_status_shared(args) +** 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 final_decision args~ +- Inside source: true +*** True Line Result + def final_decision args +** Processing line: ~ decision_graph "Stasis-- Chambers--: UNDERPOWERED, Life- forms-- will be terminated---- unless-- equilibrium----- is reached.",~ +- Inside source: true +*** True Line Result + decision_graph "Stasis-- Chambers--: UNDERPOWERED, Life- forms-- will be terminated---- unless-- equilibrium----- is reached.", +** Processing line: ~ "I CAN'T DO THIS... But... If-- I-- don't--- bring-- the- chambers--- to- equilibrium-----, they all die...",~ +- Inside source: true +*** True Line Result + "I CAN'T DO THIS... But... If-- I-- don't--- bring-- the- chambers--- to- equilibrium-----, they all die...", +** Processing line: ~ [:final_decision_game_over_noone, "Kill--- Everyone---", "DO--- NOTHING?"],~ +- Inside source: true +*** True Line Result + [:final_decision_game_over_noone, "Kill--- Everyone---", "DO--- NOTHING?"], +** Processing line: ~ [:final_decision_game_over_matthew, "Kill--- Sasha---", "KILL--- SASHA?"],~ +- Inside source: true +*** True Line Result + [:final_decision_game_over_matthew, "Kill--- Sasha---", "KILL--- SASHA?"], +** Processing line: ~ [:final_decision_game_over_anka, "Kill--- Aanka---", "KILL--- AANKA?"],~ +- Inside source: true +*** True Line Result + [:final_decision_game_over_anka, "Kill--- Aanka---", "KILL--- AANKA?"], +** Processing line: ~ [:final_decision_game_over_sasha, "Kill--- Matthew---", "KILL--- MATTHEW?"]~ +- Inside source: true +*** True Line Result + [:final_decision_game_over_sasha, "Kill--- Matthew---", "KILL--- MATTHEW?"] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def final_decision_game_over_noone args~ +- Inside source: true +*** True Line Result + def final_decision_game_over_noone args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/tribute-game-over.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/tribute-game-over.png', +** Processing line: ~ player: [53, 14],~ +- Inside source: true +*** True Line Result + player: [53, 14], +** Processing line: ~ fade: 600~ +- Inside source: true +*** True Line Result + fade: 600 +** 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 final_decision_game_over_matthew args~ +- Inside source: true +*** True Line Result + def final_decision_game_over_matthew args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/tribute-game-over.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/tribute-game-over.png', +** Processing line: ~ player: [53, 14],~ +- Inside source: true +*** True Line Result + player: [53, 14], +** Processing line: ~ fade: 600~ +- Inside source: true +*** True Line Result + fade: 600 +** 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 final_decision_game_over_anka args~ +- Inside source: true +*** True Line Result + def final_decision_game_over_anka args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/tribute-game-over.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/tribute-game-over.png', +** Processing line: ~ player: [53, 14],~ +- Inside source: true +*** True Line Result + player: [53, 14], +** Processing line: ~ fade: 600~ +- Inside source: true +*** True Line Result + fade: 600 +** 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 final_decision_game_over_sasha args~ +- Inside source: true +*** True Line Result + def final_decision_game_over_sasha args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/tribute-game-over.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/tribute-game-over.png', +** Processing line: ~ player: [53, 14],~ +- Inside source: true +*** True Line Result + player: [53, 14], +** Processing line: ~ fade: 600~ +- Inside source: true +*** True Line Result + fade: 600 +** 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 final_decision_ship_status_shared args~ +- Inside source: true +*** True Line Result + def final_decision_ship_status_shared args +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ *ship_control_hotspot(24, 22,~ +- Inside source: true +*** True Line Result + *ship_control_hotspot(24, 22, +** Processing line: ~ "Stasis-- Chambers--: UNDERPOWERED, Life- forms-- will be terminated---- unless-- equilibrium----- is reached. WHAT?! NO!",~ +- Inside source: true +*** True Line Result + "Stasis-- Chambers--: UNDERPOWERED, Life- forms-- will be terminated---- unless-- equilibrium----- is reached. WHAT?! NO!", +** Processing line: ~ "Matthew's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!",~ +- Inside source: true +*** True Line Result + "Matthew's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!", +** Processing line: ~ "Aanka's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!",~ +- Inside source: true +*** True Line Result + "Aanka's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!", +** Processing line: ~ "Sasha's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!"),~ +- Inside source: true +*** True Line Result + "Sasha's--- Chamber--: UNDER-- THREAT-- OF-- TERMINATION. WHAT?! NO!"), +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_final_message.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - storyline_final_message.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_message.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_message.rb +** Processing line: ~ def final_message_sad args~ +- Inside source: true +*** True Line Result + def final_message_sad args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [34, 35],~ +- Inside source: true +*** True Line Result + player: [34, 35], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [34, 34, 4, 4, "Another-- sleepless-- night..."],~ +- Inside source: true +*** True Line Result + [34, 34, 4, 4, "Another-- sleepless-- night..."], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [32, -1, 8, 3, :final_message_observatory]~ +- Inside source: true +*** True Line Result + [32, -1, 8, 3, :final_message_observatory] +** 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 final_message_happy args~ +- Inside source: true +*** True Line Result + def final_message_happy args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [34, 35],~ +- Inside source: true +*** True Line Result + player: [34, 35], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [34, 34, 4, 4, "Oh man, I slept like rock!"],~ +- Inside source: true +*** True Line Result + [34, 34, 4, 4, "Oh man, I slept like rock!"], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [32, -1, 8, 3, :final_message_observatory]~ +- Inside source: true +*** True Line Result + [32, -1, 8, 3, :final_message_observatory] +** 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 final_message_side_of_home args~ +- Inside source: true +*** True Line Result + def final_message_side_of_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/side-of-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/side-of-home.png', +** Processing line: ~ player: [16, 13],~ +- Inside source: true +*** True Line Result + player: [16, 13], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [52, 24, 11, 5, :final_message_mountain_pass],~ +- Inside source: true +*** True Line Result + [52, 24, 11, 5, :final_message_mountain_pass], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_side_of_home_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_side_of_home_render +** 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 final_message_mountain_pass args~ +- Inside source: true +*** True Line Result + def final_message_mountain_pass args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/mountain-pass-zoomed-out.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mountain-pass-zoomed-out.png', +** Processing line: ~ player: [4, 4],~ +- Inside source: true +*** True Line Result + player: [4, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [18, 47, 5, 5, :final_message_path_to_observatory],~ +- Inside source: true +*** True Line Result + [18, 47, 5, 5, :final_message_path_to_observatory], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [18, 13, 5, 5, "Hnnnnnnnggg. My legs-- are still sore- from yesterday."]~ +- Inside source: true +*** True Line Result + [18, 13, 5, 5, "Hnnnnnnnggg. My legs-- are still sore- from yesterday."] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_mountain_pass_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_mountain_pass_render +** 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 final_message_path_to_observatory args~ +- Inside source: true +*** True Line Result + def final_message_path_to_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/path-to-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/path-to-observatory.png', +** Processing line: ~ player: [60, 4],~ +- Inside source: true +*** True Line Result + player: [60, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [0, 26, 5, 5, :final_message_observatory]~ +- Inside source: true +*** True Line Result + [0, 26, 5, 5, :final_message_observatory] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [22, 20, 10, 10, "This spot--, on the mountain, right here, it's-- perfect. This- is where- I'll-- yeet-- the person-- who is playing-- this- prank- on me."]~ +- Inside source: true +*** True Line Result + [22, 20, 10, 10, "This spot--, on the mountain, right here, it's-- perfect. This- is where- I'll-- yeet-- the person-- who is playing-- this- prank- on me."] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_path_to_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_path_to_observatory_render +** 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 final_message_observatory args~ +- Inside source: true +*** True Line Result + def final_message_observatory args +** Processing line: ~ if args.state.scene_history.include? :replied_with_whole_truth~ +- Inside source: true +*** True Line Result + if args.state.scene_history.include? :replied_with_whole_truth +** Processing line: ~ return {~ +- Inside source: true +*** True Line Result + return { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [51, 12],~ +- Inside source: true +*** True Line Result + player: [51, 12], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [50, 10, 4, 4, "Here-- we- go..."]~ +- Inside source: true +*** True Line Result + [50, 10, 4, 4, "Here-- we- go..."] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 18, 5, 12, :final_message_inside_mainframe]~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, :final_message_inside_mainframe] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_inside_observatory_render +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return {~ +- Inside source: true +*** True Line Result + return { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [51, 12],~ +- Inside source: true +*** True Line Result + player: [51, 12], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [50, 10, 4, 4, "I feel like I'm-- walking-- on sunshine!"]~ +- Inside source: true +*** True Line Result + [50, 10, 4, 4, "I feel like I'm-- walking-- on sunshine!"] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 18, 5, 12, :final_message_inside_mainframe]~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, :final_message_inside_mainframe] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_inside_observatory_render +** 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 final_message_inside_mainframe args~ +- Inside source: true +*** True Line Result + def final_message_inside_mainframe args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ player: [32, 4],~ +- Inside source: true +*** True Line Result + player: [32, 4], +** Processing line: ~ background: 'sprites/mainframe.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mainframe.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ scenes: [[45, 45, 4, 4, :final_message_check_ship_status]]~ +- Inside source: true +*** True Line Result + scenes: [[45, 45, 4, 4, :final_message_check_ship_status]] +** 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 final_message_check_ship_status args~ +- Inside source: true +*** True Line Result + def final_message_check_ship_status args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/mainframe.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mainframe.png', +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [45, 45, 4, 4, (final_message_current args)],~ +- Inside source: true +*** True Line Result + [45, 45, 4, 4, (final_message_current args)], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_top, :final_message_ship_status],~ +- Inside source: true +*** True Line Result + [*hotspot_top, :final_message_ship_status], +** 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 final_message_ship_status args~ +- Inside source: true +*** True Line Result + def final_message_ship_status args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/serenity.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/serenity.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [30, 10],~ +- Inside source: true +*** True Line Result + player: [30, 10], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 50, 4, 4, :final_message_ship_status_reviewed]~ +- Inside source: true +*** True Line Result + [30, 50, 4, 4, :final_message_ship_status_reviewed] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 8, 4, 4, "Let me make- sure- everything--- looks good. It'll-- give me peace- of mind."],~ +- Inside source: true +*** True Line Result + [30, 8, 4, 4, "Let me make- sure- everything--- looks good. It'll-- give me peace- of mind."], +** Processing line: ~ *final_message_ship_status_shared(args)~ +- Inside source: true +*** True Line Result + *final_message_ship_status_shared(args) +** 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 final_message_ship_status_reviewed args~ +- Inside source: true +*** True Line Result + def final_message_ship_status_reviewed args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/serenity.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/serenity.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_bottom, :final_message_summary]~ +- Inside source: true +*** True Line Result + [*hotspot_bottom, :final_message_summary] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [0, 62, 62, 3, "Whew. Everyone-- is in their- chambers. The engines-- are roaring-- and Serenity-- is coming-- home."],~ +- Inside source: true +*** True Line Result + [0, 62, 62, 3, "Whew. Everyone-- is in their- chambers. The engines-- are roaring-- and Serenity-- is coming-- home."], +** 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 final_message_ship_status_shared args~ +- Inside source: true +*** True Line Result + def final_message_ship_status_shared args +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ *ship_control_hotspot( 0, 50,~ +- Inside source: true +*** True Line Result + *ship_control_hotspot( 0, 50, +** Processing line: ~ "Stasis-- Chambers--: Online, All chambers-- are powered. Battery--- Allocation---: 3--- of-- 3--.",~ +- Inside source: true +*** True Line Result + "Stasis-- Chambers--: Online, All chambers-- are powered. Battery--- Allocation---: 3--- of-- 3--.", +** Processing line: ~ "Matthew's--- Chamber--: OCCUPIED----",~ +- Inside source: true +*** True Line Result + "Matthew's--- Chamber--: OCCUPIED----", +** Processing line: ~ "Aanka's--- Chamber--: OCCUPIED----",~ +- Inside source: true +*** True Line Result + "Aanka's--- Chamber--: OCCUPIED----", +** Processing line: ~ "Sasha's--- Chamber--: OCCUPIED----"),~ +- Inside source: true +*** True Line Result + "Sasha's--- Chamber--: OCCUPIED----"), +** Processing line: ~ *ship_control_hotspot(12, 35,~ +- Inside source: true +*** True Line Result + *ship_control_hotspot(12, 35, +** Processing line: ~ "Life- Support--: Not-- Needed---",~ +- Inside source: true +*** True Line Result + "Life- Support--: Not-- Needed---", +** Processing line: ~ "O2--- Production---: OFF---",~ +- Inside source: true +*** True Line Result + "O2--- Production---: OFF---", +** Processing line: ~ "CO2--- Scrubbers---: OFF---",~ +- Inside source: true +*** True Line Result + "CO2--- Scrubbers---: OFF---", +** Processing line: ~ "H2O--- Production---: OFF---"),~ +- Inside source: true +*** True Line Result + "H2O--- Production---: OFF---"), +** Processing line: ~ *ship_control_hotspot(24, 20,~ +- Inside source: true +*** True Line Result + *ship_control_hotspot(24, 20, +** Processing line: ~ "Navigation: Offline---",~ +- Inside source: true +*** True Line Result + "Navigation: Offline---", +** Processing line: ~ "Sensor: OFF---",~ +- Inside source: true +*** True Line Result + "Sensor: OFF---", +** Processing line: ~ "Heads- Up- Display: DAMAGED---",~ +- Inside source: true +*** True Line Result + "Heads- Up- Display: DAMAGED---", +** Processing line: ~ "Arithmetic--- Unit: DAMAGED----"),~ +- Inside source: true +*** True Line Result + "Arithmetic--- Unit: DAMAGED----"), +** Processing line: ~ *ship_control_hotspot(36, 35,~ +- Inside source: true +*** True Line Result + *ship_control_hotspot(36, 35, +** Processing line: ~ "COMM: Underpowered----",~ +- Inside source: true +*** True Line Result + "COMM: Underpowered----", +** Processing line: ~ "Text: ON---",~ +- Inside source: true +*** True Line Result + "Text: ON---", +** Processing line: ~ "Audio: SEGFAULT---",~ +- Inside source: true +*** True Line Result + "Audio: SEGFAULT---", +** Processing line: ~ "Video: DAMAGED---"),~ +- Inside source: true +*** True Line Result + "Video: DAMAGED---"), +** Processing line: ~ *ship_control_hotspot(48, 50,~ +- Inside source: true +*** True Line Result + *ship_control_hotspot(48, 50, +** Processing line: ~ "Engine: Online, Coordinates--- Set- for Earth. Battery--- Allocation---: 3--- of-- 3---",~ +- Inside source: true +*** True Line Result + "Engine: Online, Coordinates--- Set- for Earth. Battery--- Allocation---: 3--- of-- 3---", +** Processing line: ~ "Engine I: ON---",~ +- Inside source: true +*** True Line Result + "Engine I: ON---", +** Processing line: ~ "Engine II: ON---",~ +- Inside source: true +*** True Line Result + "Engine II: ON---", +** Processing line: ~ "Engine III: ON---")~ +- Inside source: true +*** True Line Result + "Engine III: ON---") +** 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 final_message_last_reply args~ +- Inside source: true +*** True Line Result + def final_message_last_reply args +** Processing line: ~ if args.state.scene_history.include? :replied_with_whole_truth~ +- Inside source: true +*** True Line Result + if args.state.scene_history.include? :replied_with_whole_truth +** Processing line: ~ return "Buffer--: #{anka_reply_whole_truth.quote}"~ +- Inside source: true +*** True Line Result + return "Buffer--: #{anka_reply_whole_truth.quote}" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return "Buffer--: #{anka_reply_half_truth.quote}"~ +- Inside source: true +*** True Line Result + return "Buffer--: #{anka_reply_half_truth.quote}" +** 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 final_message_current args~ +- Inside source: true +*** True Line Result + def final_message_current args +** Processing line: ~ if args.state.scene_history.include? :replied_with_whole_truth~ +- Inside source: true +*** True Line Result + if args.state.scene_history.include? :replied_with_whole_truth +** Processing line: ~ return "Hey... It's-- me Sasha. Aanka-- is trying-- her best to comfort-- Matthew. This- is the first- time- I've-- ever-- seen-- Matthew-- cry. We'll-- probably-- be in stasis-- by the time you get this message--. Thank- you- again-- for all your help. I look forward-- to meeting-- you in person."~ +- Inside source: true +*** True Line Result + return "Hey... It's-- me Sasha. Aanka-- is trying-- her best to comfort-- Matthew. This- is the first- time- I've-- ever-- seen-- Matthew-- cry. We'll-- probably-- be in stasis-- by the time you get this message--. Thank- you- again-- for all your help. I look forward-- to meeting-- you in person." +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return "Hey! It's-- me Sasha! LOL! Aanka-- and Matthew-- are dancing-- around-- like- goofballs--! They- are both- so adorable! Only-- this- tiny-- little-- genius-- can make-- a battle-- hardened-- general--- put- on a tiara-- and dance- around-- like a fairy-- princess-- XD------ Anyways, we are heading-- back into-- the chambers--. I hope our welcome-- home- parade-- has fireworks!"~ +- Inside source: true +*** True Line Result + return "Hey! It's-- me Sasha! LOL! Aanka-- and Matthew-- are dancing-- around-- like- goofballs--! They- are both- so adorable! Only-- this- tiny-- little-- genius-- can make-- a battle-- hardened-- general--- put- on a tiara-- and dance- around-- like a fairy-- princess-- XD------ Anyways, we are heading-- back into-- the chambers--. I hope our welcome-- home- parade-- has fireworks!" +** 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 final_message_summary args~ +- Inside source: true +*** True Line Result + def final_message_summary args +** Processing line: ~ if args.state.scene_history.include? :replied_with_whole_truth~ +- Inside source: true +*** True Line Result + if args.state.scene_history.include? :replied_with_whole_truth +** Processing line: ~ return {~ +- Inside source: true +*** True Line Result + return { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [31, 11],~ +- Inside source: true +*** True Line Result + player: [31, 11], +** Processing line: ~ scenes: [[60, 0, 4, 32, :final_decision_side_of_home]],~ +- Inside source: true +*** True Line Result + scenes: [[60, 0, 4, 32, :final_decision_side_of_home]], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 10, 5, 4, "I can't-- imagine-- what they are feeling-- right now. But at least- they- know everything---, and we can- concentrate-- on rebuilding--- this world-- right- off the bat. I can't-- wait to see the future-- they'll-- help- build."],~ +- Inside source: true +*** True Line Result + [30, 10, 5, 4, "I can't-- imagine-- what they are feeling-- right now. But at least- they- know everything---, and we can- concentrate-- on rebuilding--- this world-- right- off the bat. I can't-- wait to see the future-- they'll-- help- build."], +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return {~ +- Inside source: true +*** True Line Result + return { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [31, 11],~ +- Inside source: true +*** True Line Result + player: [31, 11], +** Processing line: ~ scenes: [[60, 0, 4, 32, :final_decision_side_of_home]],~ +- Inside source: true +*** True Line Result + scenes: [[60, 0, 4, 32, :final_decision_side_of_home]], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 10, 5, 4, "They all sounded-- so happy. I know- they'll-- be in for a tough- dose- of reality--- when they- arrive. But- at least- they'll-- be around-- all- of us. We'll-- help them- cope."],~ +- Inside source: true +*** True Line Result + [30, 10, 5, 4, "They all sounded-- so happy. I know- they'll-- be in for a tough- dose- of reality--- when they- arrive. But- at least- they'll-- be around-- all- of us. We'll-- help them- cope."], +** 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: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_alive.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_alive.rb +** Processing line: ~ def serenity_alive_side_of_home args~ +- Inside source: true +*** True Line Result + def serenity_alive_side_of_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/side-of-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/side-of-home.png', +** Processing line: ~ player: [16, 13],~ +- Inside source: true +*** True Line Result + player: [16, 13], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [52, 24, 11, 5, :serenity_alive_mountain_pass],~ +- Inside source: true +*** True Line Result + [52, 24, 11, 5, :serenity_alive_mountain_pass], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_side_of_home_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_side_of_home_render +** 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 serenity_alive_mountain_pass args~ +- Inside source: true +*** True Line Result + def serenity_alive_mountain_pass args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/mountain-pass-zoomed-out.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mountain-pass-zoomed-out.png', +** Processing line: ~ player: [4, 4],~ +- Inside source: true +*** True Line Result + player: [4, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [18, 47, 5, 5, :serenity_alive_path_to_observatory],~ +- Inside source: true +*** True Line Result + [18, 47, 5, 5, :serenity_alive_path_to_observatory], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [18, 13, 5, 5, "Hnnnnnnnggg. My legs-- are still sore- from yesterday."]~ +- Inside source: true +*** True Line Result + [18, 13, 5, 5, "Hnnnnnnnggg. My legs-- are still sore- from yesterday."] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_mountain_pass_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_mountain_pass_render +** 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 serenity_alive_path_to_observatory args~ +- Inside source: true +*** True Line Result + def serenity_alive_path_to_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/path-to-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/path-to-observatory.png', +** Processing line: ~ player: [60, 4],~ +- Inside source: true +*** True Line Result + player: [60, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [0, 26, 5, 5, :serenity_alive_observatory]~ +- Inside source: true +*** True Line Result + [0, 26, 5, 5, :serenity_alive_observatory] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [22, 20, 10, 10, "This spot--, on the mountain, right here, it's-- perfect. This- is where- I'll-- yeet-- the person-- who is playing-- this- prank- on me."]~ +- Inside source: true +*** True Line Result + [22, 20, 10, 10, "This spot--, on the mountain, right here, it's-- perfect. This- is where- I'll-- yeet-- the person-- who is playing-- this- prank- on me."] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_path_to_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_path_to_observatory_render +** 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 serenity_alive_observatory args~ +- Inside source: true +*** True Line Result + def serenity_alive_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/observatory.png', +** Processing line: ~ player: [60, 2],~ +- Inside source: true +*** True Line Result + player: [60, 2], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [28, 39, 4, 10, :serenity_alive_inside_observatory]~ +- Inside source: true +*** True Line Result + [28, 39, 4, 10, :serenity_alive_inside_observatory] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_observatory_render +** 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 serenity_alive_inside_observatory args~ +- Inside source: true +*** True Line Result + def serenity_alive_inside_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ player: [60, 2],~ +- Inside source: true +*** True Line Result + player: [60, 2], +** Processing line: ~ storylines: [],~ +- Inside source: true +*** True Line Result + storylines: [], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 18, 5, 12, :serenity_alive_inside_mainframe]~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, :serenity_alive_inside_mainframe] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_inside_observatory_render +** 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 serenity_alive_inside_mainframe args~ +- Inside source: true +*** True Line Result + def serenity_alive_inside_mainframe args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/mainframe.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mainframe.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [30, 4],~ +- Inside source: true +*** True Line Result + player: [30, 4], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_top, :serenity_alive_ship_status],~ +- Inside source: true +*** True Line Result + [*hotspot_top, :serenity_alive_ship_status], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [22, 45, 17, 4, (serenity_alive_last_reply args)],~ +- Inside source: true +*** True Line Result + [22, 45, 17, 4, (serenity_alive_last_reply args)], +** Processing line: ~ [45, 45, 4, 4, (serenity_alive_current_message args)],~ +- Inside source: true +*** True Line Result + [45, 45, 4, 4, (serenity_alive_current_message args)], +** 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 serenity_alive_ship_status args~ +- Inside source: true +*** True Line Result + def serenity_alive_ship_status args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/serenity.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/serenity.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [30, 10],~ +- Inside source: true +*** True Line Result + player: [30, 10], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 50, 4, 4, :serenity_alive_ship_status_reviewed]~ +- Inside source: true +*** True Line Result + [30, 50, 4, 4, :serenity_alive_ship_status_reviewed] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 8, 4, 4, "Serenity? THE--- Mission-- Serenity?! How is that possible? They- are supposed-- to be dead."],~ +- Inside source: true +*** True Line Result + [30, 8, 4, 4, "Serenity? THE--- Mission-- Serenity?! How is that possible? They- are supposed-- to be dead."], +** Processing line: ~ [30, 10, 4, 4, "I... can't-- believe-- it. I- can access-- Serenity's-- computer? I- guess my \"superpower----\" isn't limited-- by proximity-- to- a machine--."],~ +- Inside source: true +*** True Line Result + [30, 10, 4, 4, "I... can't-- believe-- it. I- can access-- Serenity's-- computer? I- guess my \"superpower----\" isn't limited-- by proximity-- to- a machine--."], +** Processing line: ~ *serenity_alive_shared_ship_status(args)~ +- Inside source: true +*** True Line Result + *serenity_alive_shared_ship_status(args) +** 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 serenity_alive_ship_status_reviewed args~ +- Inside source: true +*** True Line Result + def serenity_alive_ship_status_reviewed args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/serenity.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/serenity.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_bottom, :serenity_alive_time_to_reply]~ +- Inside source: true +*** True Line Result + [*hotspot_bottom, :serenity_alive_time_to_reply] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [0, 62, 62, 3, "Okay. Reviewing-- everything--, it looks- like- I- can- take- the batteries--- from the Stasis--- Chambers--- and- Engine--- to keep- the crew-- alive-- and-- their-- location--- pinpointed---."],~ +- Inside source: true +*** True Line Result + [0, 62, 62, 3, "Okay. Reviewing-- everything--, it looks- like- I- can- take- the batteries--- from the Stasis--- Chambers--- and- Engine--- to keep- the crew-- alive-- and-- their-- location--- pinpointed---."], +** 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 serenity_alive_time_to_reply args~ +- Inside source: true +*** True Line Result + def serenity_alive_time_to_reply args +** Processing line: ~ decision_graph serenity_alive_current_message(args),~ +- Inside source: true +*** True Line Result + decision_graph serenity_alive_current_message(args), +** Processing line: ~ "Okay... time to deliver the bad news...",~ +- Inside source: true +*** True Line Result + "Okay... time to deliver the bad news...", +** Processing line: ~ [:replied_to_serenity_alive_firmly, "Firm-- Reply", serenity_alive_firm_reply],~ +- Inside source: true +*** True Line Result + [:replied_to_serenity_alive_firmly, "Firm-- Reply", serenity_alive_firm_reply], +** Processing line: ~ [:replied_to_serenity_alive_kindly, "Sugar-- Coated---- Reply", serenity_alive_sugarcoated_reply]~ +- Inside source: true +*** True Line Result + [:replied_to_serenity_alive_kindly, "Sugar-- Coated---- Reply", serenity_alive_sugarcoated_reply] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def serenity_alive_shared_ship_status args~ +- Inside source: true +*** True Line Result + def serenity_alive_shared_ship_status args +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ *ship_control_hotspot( 0, 50,~ +- Inside source: true +*** True Line Result + *ship_control_hotspot( 0, 50, +** Processing line: ~ "Stasis-- Chambers--: Online, All chambers-- are powered. Battery--- Allocation---: 3--- of-- 3--, Hmmm. They don't-- need this to be powered-- right- now. Everyone-- is awake.",~ +- Inside source: true +*** True Line Result + "Stasis-- Chambers--: Online, All chambers-- are powered. Battery--- Allocation---: 3--- of-- 3--, Hmmm. They don't-- need this to be powered-- right- now. Everyone-- is awake.", +** Processing line: ~ nil,~ +- Inside source: true +*** True Line Result + nil, +** Processing line: ~ nil,~ +- Inside source: true +*** True Line Result + nil, +** Processing line: ~ nil),~ +- Inside source: true +*** True Line Result + nil), +** Processing line: ~ *ship_control_hotspot(12, 35,~ +- Inside source: true +*** True Line Result + *ship_control_hotspot(12, 35, +** Processing line: ~ "Life- Support--: Offline, Unable--- to- Sustain-- Life. Battery--- Allocation---: 0--- of-- 3---, Okay. That is definitely---- not a good thing.",~ +- Inside source: true +*** True Line Result + "Life- Support--: Offline, Unable--- to- Sustain-- Life. Battery--- Allocation---: 0--- of-- 3---, Okay. That is definitely---- not a good thing.", +** Processing line: ~ nil,~ +- Inside source: true +*** True Line Result + nil, +** Processing line: ~ nil,~ +- Inside source: true +*** True Line Result + nil, +** Processing line: ~ nil),~ +- Inside source: true +*** True Line Result + nil), +** Processing line: ~ *ship_control_hotspot(24, 20,~ +- Inside source: true +*** True Line Result + *ship_control_hotspot(24, 20, +** Processing line: ~ "Navigation: Offline, Unable--- to- Calculate--- Location. Battery--- Allocation---: 0--- of-- 3---, Whelp. No wonder-- Sasha-- can't-- get- any-- readings. Their- Navigation--- is completely--- offline.",~ +- Inside source: true +*** True Line Result + "Navigation: Offline, Unable--- to- Calculate--- Location. Battery--- Allocation---: 0--- of-- 3---, Whelp. No wonder-- Sasha-- can't-- get- any-- readings. Their- Navigation--- is completely--- offline.", +** Processing line: ~ nil,~ +- Inside source: true +*** True Line Result + nil, +** Processing line: ~ nil,~ +- Inside source: true +*** True Line Result + nil, +** Processing line: ~ nil),~ +- Inside source: true +*** True Line Result + nil), +** Processing line: ~ *ship_control_hotspot(36, 35,~ +- Inside source: true +*** True Line Result + *ship_control_hotspot(36, 35, +** Processing line: ~ "COMM: Underpowered----, Limited--- to- Text-- Based-- COMM. Battery--- Allocation---: 1--- of-- 3---, It's-- lucky- that- their- COMM---- system was able to survive-- twenty-- years--. Just- barely-- it seems.",~ +- Inside source: true +*** True Line Result + "COMM: Underpowered----, Limited--- to- Text-- Based-- COMM. Battery--- Allocation---: 1--- of-- 3---, It's-- lucky- that- their- COMM---- system was able to survive-- twenty-- years--. Just- barely-- it seems.", +** Processing line: ~ nil,~ +- Inside source: true +*** True Line Result + nil, +** Processing line: ~ nil,~ +- Inside source: true +*** True Line Result + nil, +** Processing line: ~ nil),~ +- Inside source: true +*** True Line Result + nil), +** Processing line: ~ *ship_control_hotspot(48, 50,~ +- Inside source: true +*** True Line Result + *ship_control_hotspot(48, 50, +** Processing line: ~ "Engine: Online, Full- Control-- Available. Battery--- Allocation---: 3--- of-- 3---, Hmmm. No point of having an engine-- online--, if you don't- know- where you're-- going.",~ +- Inside source: true +*** True Line Result + "Engine: Online, Full- Control-- Available. Battery--- Allocation---: 3--- of-- 3---, Hmmm. No point of having an engine-- online--, if you don't- know- where you're-- going.", +** Processing line: ~ nil,~ +- Inside source: true +*** True Line Result + nil, +** Processing line: ~ nil,~ +- Inside source: true +*** True Line Result + nil, +** Processing line: ~ nil)~ +- Inside source: true +*** True Line Result + nil) +** 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 serenity_alive_firm_reply~ +- Inside source: true +*** True Line Result + def serenity_alive_firm_reply +** Processing line: ~ "Serenity, you are at a distance-- farther-- than- Neptune. All- of the ship's-- systems-- are failing. Please- move the batteries---- from- the Stasis-- Chambers-- over- to- Life-- Support--. I also-- need- you to move-- the batteries---- from- the Engines--- to your Navigation---- System."~ +- Inside source: true +*** True Line Result + "Serenity, you are at a distance-- farther-- than- Neptune. All- of the ship's-- systems-- are failing. Please- move the batteries---- from- the Stasis-- Chambers-- over- to- Life-- Support--. I also-- need- you to move-- the batteries---- from- the Engines--- to your Navigation---- System." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def serenity_alive_sugarcoated_reply~ +- Inside source: true +*** True Line Result + def serenity_alive_sugarcoated_reply +** Processing line: ~ "So... you- are- a teeny--- tiny--- bit--- farther-- from Earth- than you think. And you have a teeny--- tiny--- problem-- with your ship. Please-- move the batteries--- from the Stasis--- Chambers--- over to Life--- Support---. I also need you to move the batteries--- from the Engines--- to your- Navigation--- System. Don't-- worry-- Sasha. I'll-- get y'all-- home."~ +- Inside source: true +*** True Line Result + "So... you- are- a teeny--- tiny--- bit--- farther-- from Earth- than you think. And you have a teeny--- tiny--- problem-- with your ship. Please-- move the batteries--- from the Stasis--- Chambers--- over to Life--- Support---. I also need you to move the batteries--- from the Engines--- to your- Navigation--- System. Don't-- worry-- Sasha. I'll-- get y'all-- home." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def replied_to_serenity_alive_firmly args~ +- Inside source: true +*** True Line Result + def replied_to_serenity_alive_firmly args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [32, 21],~ +- Inside source: true +*** True Line Result + player: [32, 21], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_bottom_right, :serenity_alive_path_from_observatory]~ +- Inside source: true +*** True Line Result + [*hotspot_bottom_right, :serenity_alive_path_from_observatory] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: #{serenity_alive_firm_reply.quote}"],~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, "Buffer-- has been set to: #{serenity_alive_firm_reply.quote}"], +** Processing line: ~ *serenity_alive_reply_completed_shared_hotspots(args),~ +- Inside source: true +*** True Line Result + *serenity_alive_reply_completed_shared_hotspots(args), +** 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 replied_to_serenity_alive_kindly args~ +- Inside source: true +*** True Line Result + def replied_to_serenity_alive_kindly args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [32, 21],~ +- Inside source: true +*** True Line Result + player: [32, 21], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_bottom_right, :serenity_alive_path_from_observatory]~ +- Inside source: true +*** True Line Result + [*hotspot_bottom_right, :serenity_alive_path_from_observatory] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: #{serenity_alive_sugarcoated_reply.quote}"],~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, "Buffer-- has been set to: #{serenity_alive_sugarcoated_reply.quote}"], +** Processing line: ~ *serenity_alive_reply_completed_shared_hotspots(args),~ +- Inside source: true +*** True Line Result + *serenity_alive_reply_completed_shared_hotspots(args), +** 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 serenity_alive_path_from_observatory args~ +- Inside source: true +*** True Line Result + def serenity_alive_path_from_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/path-to-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/path-to-observatory.png', +** Processing line: ~ player: [4, 21],~ +- Inside source: true +*** True Line Result + player: [4, 21], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_bottom_right, :serenity_bio_infront_of_home]~ +- Inside source: true +*** True Line Result + [*hotspot_bottom_right, :serenity_bio_infront_of_home] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [22, 20, 10, 10, "I'm not sure what's-- worse. Waiting-- for Sasha's-- reply. Or jumping-- off- from- right- here."]~ +- Inside source: true +*** True Line Result + [22, 20, 10, 10, "I'm not sure what's-- worse. Waiting-- for Sasha's-- reply. Or jumping-- off- from- right- here."] +** 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 serenity_alive_reply_completed_shared_hotspots args~ +- Inside source: true +*** True Line Result + def serenity_alive_reply_completed_shared_hotspots args +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ [30, 10, 5, 4, "I guess it wasn't-- a joke- after-- all."],~ +- Inside source: true +*** True Line Result + [30, 10, 5, 4, "I guess it wasn't-- a joke- after-- all."], +** Processing line: ~ [40, 10, 5, 4, "I barely-- remember--- the- history----- of the crew."],~ +- Inside source: true +*** True Line Result + [40, 10, 5, 4, "I barely-- remember--- the- history----- of the crew."], +** Processing line: ~ [50, 10, 5, 4, "It probably--- wouldn't-- hurt- to- refresh-- my memory--."]~ +- Inside source: true +*** True Line Result + [50, 10, 5, 4, "It probably--- wouldn't-- hurt- to- refresh-- my memory--."] +** 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 serenity_alive_last_reply args~ +- Inside source: true +*** True Line Result + def serenity_alive_last_reply args +** Processing line: ~ if args.state.scene_history.include? :replied_to_introduction_seriously~ +- Inside source: true +*** True Line Result + if args.state.scene_history.include? :replied_to_introduction_seriously +** Processing line: ~ return "Buffer--: \"Hello, Who- is sending-- this message--?\""~ +- Inside source: true +*** True Line Result + return "Buffer--: \"Hello, Who- is sending-- this message--?\"" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return "Buffer--: \"New- phone. Who dis?\""~ +- Inside source: true +*** True Line Result + return "Buffer--: \"New- phone. Who dis?\"" +** 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 serenity_alive_current_message args~ +- Inside source: true +*** True Line Result + def serenity_alive_current_message args +** Processing line: ~ if args.state.scene_history.include? :replied_to_introduction_seriously~ +- Inside source: true +*** True Line Result + if args.state.scene_history.include? :replied_to_introduction_seriously +** Processing line: ~ "This- is Sasha. The Serenity--- crew-- is out of hibernation---- and ready-- for Earth reentry--. But, it seems like we are having-- trouble-- with our Navigation---- systems. Please advise.".quote~ +- Inside source: true +*** True Line Result + "This- is Sasha. The Serenity--- crew-- is out of hibernation---- and ready-- for Earth reentry--. But, it seems like we are having-- trouble-- with our Navigation---- systems. Please advise.".quote +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ "LOL! Thanks for the laugh. I needed that. This- is Sasha. The Serenity--- crew-- is out of hibernation---- and ready-- for Earth reentry--. But, it seems like we are having-- trouble-- with our Navigation---- systems. Can you help me out- babe?".quote~ +- Inside source: true +*** True Line Result + "LOL! Thanks for the laugh. I needed that. This- is Sasha. The Serenity--- crew-- is out of hibernation---- and ready-- for Earth reentry--. But, it seems like we are having-- trouble-- with our Navigation---- systems. Can you help me out- babe?".quote +** 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: ~*** Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_bio.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_bio.rb +** Processing line: ~ def serenity_bio_infront_of_home args~ +- Inside source: true +*** True Line Result + def serenity_bio_infront_of_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/front-of-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/front-of-home.png', +** Processing line: ~ player: [54, 23],~ +- Inside source: true +*** True Line Result + player: [54, 23], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [44, 34, 8, 14, :serenity_bio_inside_home],~ +- Inside source: true +*** True Line Result + [44, 34, 8, 14, :serenity_bio_inside_home], +** Processing line: ~ [0, 3, 3, 22, :serenity_bio_library]~ +- Inside source: true +*** True Line Result + [0, 3, 3, 22, :serenity_bio_library] +** 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 serenity_bio_inside_home args~ +- Inside source: true +*** True Line Result + def serenity_bio_inside_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [34, 4],~ +- Inside source: true +*** True Line Result + player: [34, 4], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [34, 4, 4, 4, "I'm--- completely--- exhausted."],~ +- Inside source: true +*** True Line Result + [34, 4, 4, 4, "I'm--- completely--- exhausted."], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 38, 12, 13, :serenity_bio_restless_sleep],~ +- Inside source: true +*** True Line Result + [30, 38, 12, 13, :serenity_bio_restless_sleep], +** Processing line: ~ [32, 0, 8, 3, :serenity_bio_infront_of_home],~ +- Inside source: true +*** True Line Result + [32, 0, 8, 3, :serenity_bio_infront_of_home], +** 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 serenity_bio_restless_sleep args~ +- Inside source: true +*** True Line Result + def serenity_bio_restless_sleep args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [32, 38, 10, 13, "I can't-- seem to sleep. I know nothing-- about the- crew-. Maybe- I- should- go read- up- on- them."],~ +- Inside source: true +*** True Line Result + [32, 38, 10, 13, "I can't-- seem to sleep. I know nothing-- about the- crew-. Maybe- I- should- go read- up- on- them."], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [32, 0, 8, 3, :serenity_bio_infront_of_home],~ +- Inside source: true +*** True Line Result + [32, 0, 8, 3, :serenity_bio_infront_of_home], +** 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 serenity_bio_library args~ +- Inside source: true +*** True Line Result + def serenity_bio_library args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/library.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/library.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [30, 7],~ +- Inside source: true +*** True Line Result + player: [30, 7], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [21, 35, 3, 18, :serenity_bio_book]~ +- Inside source: true +*** True Line Result + [21, 35, 3, 18, :serenity_bio_book] +** 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 serenity_bio_book args~ +- Inside source: true +*** True Line Result + def serenity_bio_book args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/book.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/book.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [6, 52],~ +- Inside source: true +*** True Line Result + player: [6, 52], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [ 4, 50, 56, 4, "The Title-- Reads: Never-- Forget-- Mission-- Serenity---"],~ +- Inside source: true +*** True Line Result + [ 4, 50, 56, 4, "The Title-- Reads: Never-- Forget-- Mission-- Serenity---"], +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ [ 4, 38, 8, 8, "Name: Matthew--- R. Sex: Male--- Age-- at-- Departure: 36-----"],~ +- Inside source: true +*** True Line Result + [ 4, 38, 8, 8, "Name: Matthew--- R. Sex: Male--- Age-- at-- Departure: 36-----"], +** Processing line: ~ [14, 38, 46, 8, "Tribute-- Text: Matthew graduated-- Magna-- Cum-- Laude-- from MIT--- with-- a- PHD---- in Aero-- Nautical--- Engineering. He was immensely--- competitive, and had an insatiable---- thirst- for aerial-- battle. From the age of twenty, he remained-- undefeated--- in the Israeli-- Air- Force- \"Blue Flag\" combat-- exercises. By the age of 29--- he had already-- risen through- the ranks, and became-- the Lieutenant--- General--- of Lufwaffe. Matthew-- volenteered-- to- pilot-- Mission-- Serenity. To- this day, his wife- and son- are pillars-- of strength- for us. Rest- in Peace- Matthew, we are sorry-- that- news of the pregancy-- never-- reached- you. Please forgive us."],~ +- Inside source: true +*** True Line Result + [14, 38, 46, 8, "Tribute-- Text: Matthew graduated-- Magna-- Cum-- Laude-- from MIT--- with-- a- PHD---- in Aero-- Nautical--- Engineering. He was immensely--- competitive, and had an insatiable---- thirst- for aerial-- battle. From the age of twenty, he remained-- undefeated--- in the Israeli-- Air- Force- \"Blue Flag\" combat-- exercises. By the age of 29--- he had already-- risen through- the ranks, and became-- the Lieutenant--- General--- of Lufwaffe. Matthew-- volenteered-- to- pilot-- Mission-- Serenity. To- this day, his wife- and son- are pillars-- of strength- for us. Rest- in Peace- Matthew, we are sorry-- that- news of the pregancy-- never-- reached- you. Please forgive us."], +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ [4, 26, 8, 8, "Name: Aanka--- P. Sex: Female--- Age-- at-- Departure: 9-----"],~ +- Inside source: true +*** True Line Result + [4, 26, 8, 8, "Name: Aanka--- P. Sex: Female--- Age-- at-- Departure: 9-----"], +** Processing line: ~ [14, 26, 46, 8, "Tribute-- Text: Aanka--- gratuated--- Magna-- Cum- Laude-- from MIT, at- the- age- of eight, with a- PHD---- in Astro-- Physics. Her-- IQ--- was over 390, the highest-- ever- recorded--- IQ-- in- human-- history. She changed- the landscape-- of Physics-- with her efforts- in- unravelling--- the mysteries--- of- Dark- Matter--. Anka discovered-- the threat- of Halley's-- Comet-- collision--- with Earth. She spear headed-- the global-- effort-- for Misson-- Serenity. Her- multilingual--- address-- to- the world-- brought- us all hope."],~ +- Inside source: true +*** True Line Result + [14, 26, 46, 8, "Tribute-- Text: Aanka--- gratuated--- Magna-- Cum- Laude-- from MIT, at- the- age- of eight, with a- PHD---- in Astro-- Physics. Her-- IQ--- was over 390, the highest-- ever- recorded--- IQ-- in- human-- history. She changed- the landscape-- of Physics-- with her efforts- in- unravelling--- the mysteries--- of- Dark- Matter--. Anka discovered-- the threat- of Halley's-- Comet-- collision--- with Earth. She spear headed-- the global-- effort-- for Misson-- Serenity. Her- multilingual--- address-- to- the world-- brought- us all hope."], +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ [4, 14, 8, 8, "Name: Sasha--- N. Sex: Female--- Age-- at-- Departure: 29-----"],~ +- Inside source: true +*** True Line Result + [4, 14, 8, 8, "Name: Sasha--- N. Sex: Female--- Age-- at-- Departure: 29-----"], +** Processing line: ~ [14, 14, 46, 8, "Tribute-- Text: Sasha gratuated-- Magna-- Cum- Laude-- from MIT--- with-- a- PHD---- in Computer---- Science----. She-- was-- brilliant--, strong- willed--, and-- a-- stunningly--- beautiful--- woman---. Sasha---- is- the- creator--- of the world's--- first- Ruby--- Quantum-- Machine---. After-- much- critical--- acclaim--, the Quantum-- Computer-- was placed in MIT's---- Museam-- next- to- Richard--- G. and Thomas--- K.'s---- Lisp-- Machine---. Her- engineering--- skills-- were-- paramount--- for Mission--- Serenity's--- success. Humanity-- misses-- you-- dearly,-- Sasha--. Life-- shines-- a dimmer-- light-- now- that- your- angelic- voice-- can never- be heard- again."],~ +- Inside source: true +*** True Line Result + [14, 14, 46, 8, "Tribute-- Text: Sasha gratuated-- Magna-- Cum- Laude-- from MIT--- with-- a- PHD---- in Computer---- Science----. She-- was-- brilliant--, strong- willed--, and-- a-- stunningly--- beautiful--- woman---. Sasha---- is- the- creator--- of the world's--- first- Ruby--- Quantum-- Machine---. After-- much- critical--- acclaim--, the Quantum-- Computer-- was placed in MIT's---- Museam-- next- to- Richard--- G. and Thomas--- K.'s---- Lisp-- Machine---. Her- engineering--- skills-- were-- paramount--- for Mission--- Serenity's--- success. Humanity-- misses-- you-- dearly,-- Sasha--. Life-- shines-- a dimmer-- light-- now- that- your- angelic- voice-- can never- be heard- again."], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_bottom, :serenity_bio_finally_to_bed]~ +- Inside source: true +*** True Line Result + [*hotspot_bottom, :serenity_bio_finally_to_bed] +** 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 serenity_bio_finally_to_bed args~ +- Inside source: true +*** True Line Result + def serenity_bio_finally_to_bed args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [35, 3],~ +- Inside source: true +*** True Line Result + player: [35, 3], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [34, 4, 4, 4, "Maybe-- I'll-- be able-- to sleep- now..."],~ +- Inside source: true +*** True Line Result + [34, 4, 4, 4, "Maybe-- I'll-- be able-- to sleep- now..."], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [32, 38, 10, 13, :bad_dream],~ +- Inside source: true +*** True Line Result + [32, 38, 10, 13, :bad_dream], +** 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 bad_dream args~ +- Inside source: true +*** True Line Result + def bad_dream args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 120,~ +- Inside source: true +*** True Line Result + fade: 120, +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [34, 35],~ +- Inside source: true +*** True Line Result + player: [34, 35], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [34, 34, 4, 4, "Man. I did not- sleep- well- at all..."],~ +- Inside source: true +*** True Line Result + [34, 34, 4, 4, "Man. I did not- sleep- well- at all..."], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [32, -1, 8, 3, :bad_dream_observatory]~ +- Inside source: true +*** True Line Result + [32, -1, 8, 3, :bad_dream_observatory] +** 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 bad_dream_observatory args~ +- Inside source: true +*** True Line Result + def bad_dream_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 120,~ +- Inside source: true +*** True Line Result + fade: 120, +** Processing line: ~ player: [51, 12],~ +- Inside source: true +*** True Line Result + player: [51, 12], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [50, 10, 4, 4, "Breathe, Hiro. Just see what's there... everything--- will- be okay."]~ +- Inside source: true +*** True Line Result + [50, 10, 4, 4, "Breathe, Hiro. Just see what's there... everything--- will- be okay."] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [30, 18, 5, 12, :bad_dream_inside_mainframe]~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, :bad_dream_inside_mainframe] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ render_override: :blinking_light_inside_observatory_render~ +- Inside source: true +*** True Line Result + render_override: :blinking_light_inside_observatory_render +** 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 bad_dream_inside_mainframe args~ +- Inside source: true +*** True Line Result + def bad_dream_inside_mainframe args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ player: [32, 4],~ +- Inside source: true +*** True Line Result + player: [32, 4], +** Processing line: ~ background: 'sprites/mainframe.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mainframe.png', +** Processing line: ~ fade: 120,~ +- Inside source: true +*** True Line Result + fade: 120, +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [22, 45, 17, 4, (bad_dream_last_reply args)],~ +- Inside source: true +*** True Line Result + [22, 45, 17, 4, (bad_dream_last_reply args)], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [45, 45, 4, 4, :bad_dream_everyone_dead],~ +- Inside source: true +*** True Line Result + [45, 45, 4, 4, :bad_dream_everyone_dead], +** 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 bad_dream_everyone_dead args~ +- Inside source: true +*** True Line Result + def bad_dream_everyone_dead args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/mainframe.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mainframe.png', +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [22, 45, 17, 4, (bad_dream_last_reply args)],~ +- Inside source: true +*** True Line Result + [22, 45, 17, 4, (bad_dream_last_reply args)], +** Processing line: ~ [45, 45, 4, 4, "Hi-- Hiro. This is Sasha. By the time- you get this- message, chances-- are we will- already-- be- dead. The batteries--- got- damaged-- during-- removal. And- we don't-- have enough-- power-- for Life-- Support. The air-- is- already--- starting-- to taste- bad. It... would- have been- nice... to go- on a date--- with- you-- when-- I- got- back- to Earth. Anyways, good-- bye-- Hiro-- XOXOXO----"],~ +- Inside source: true +*** True Line Result + [45, 45, 4, 4, "Hi-- Hiro. This is Sasha. By the time- you get this- message, chances-- are we will- already-- be- dead. The batteries--- got- damaged-- during-- removal. And- we don't-- have enough-- power-- for Life-- Support. The air-- is- already--- starting-- to taste- bad. It... would- have been- nice... to go- on a date--- with- you-- when-- I- got- back- to Earth. Anyways, good-- bye-- Hiro-- XOXOXO----"], +** Processing line: ~ [22, 5, 17, 4, "Meh. Whatever, I didn't-- want to save them anyways. What- a pain- in my ass."],~ +- Inside source: true +*** True Line Result + [22, 5, 17, 4, "Meh. Whatever, I didn't-- want to save them anyways. What- a pain- in my ass."], +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [*hotspot_bottom, :anka_inside_room]~ +- Inside source: true +*** True Line Result + [*hotspot_bottom, :anka_inside_room] +** 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 bad_dream_last_reply args~ +- Inside source: true +*** True Line Result + def bad_dream_last_reply args +** Processing line: ~ if args.state.scene_history.include? :replied_to_serenity_alive_firmly~ +- Inside source: true +*** True Line Result + if args.state.scene_history.include? :replied_to_serenity_alive_firmly +** Processing line: ~ return "Buffer--: #{serenity_alive_firm_reply.quote}"~ +- Inside source: true +*** True Line Result + return "Buffer--: #{serenity_alive_firm_reply.quote}" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return "Buffer--: #{serenity_alive_sugarcoated_reply.quote}"~ +- Inside source: true +*** True Line Result + return "Buffer--: #{serenity_alive_sugarcoated_reply.quote}" +** 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: ~*** Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_introduction.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_introduction.rb +** Processing line: ~ # decision_graph "Message from Sasha",~ +- Inside source: true +*** True Line Result + # decision_graph "Message from Sasha", +** Processing line: ~ # "I should reply.",~ +- Inside source: true +*** True Line Result + # "I should reply.", +** Processing line: ~ # [:replied_to_introduction_seriously, "Reply Seriously", "Who is this?"],~ +- Inside source: true +*** True Line Result + # [:replied_to_introduction_seriously, "Reply Seriously", "Who is this?"], +** Processing line: ~ # [:replied_to_introduction_humorously, "Reply Humorously", "New phone who dis?"]~ +- Inside source: true +*** True Line Result + # [:replied_to_introduction_humorously, "Reply Humorously", "New phone who dis?"] +** Processing line: ~ def reply_to_introduction args~ +- Inside source: true +*** True Line Result + def reply_to_introduction args +** Processing line: ~ decision_graph "\"Mission-- control--, your- main- comm-- channels-- seem-- to be down. My apologies-- for- using-- this low- level-- exploit--. What's-- going-- on down there? We are ready-- for reentry--.\" Message--- Timestamp---: 4- hours-- 23--- minutes-- ago--.",~ +- Inside source: true +*** True Line Result + decision_graph "\"Mission-- control--, your- main- comm-- channels-- seem-- to be down. My apologies-- for- using-- this low- level-- exploit--. What's-- going-- on down there? We are ready-- for reentry--.\" Message--- Timestamp---: 4- hours-- 23--- minutes-- ago--.", +** Processing line: ~ "Whoever-- pulled- off this exploit-- knows their stuff. I should reply--.",~ +- Inside source: true +*** True Line Result + "Whoever-- pulled- off this exploit-- knows their stuff. I should reply--.", +** Processing line: ~ [:replied_to_introduction_seriously, "Serious Reply", "Hello, Who- is sending-- this message--?"],~ +- Inside source: true +*** True Line Result + [:replied_to_introduction_seriously, "Serious Reply", "Hello, Who- is sending-- this message--?"], +** Processing line: ~ [:replied_to_introduction_humorously, "Humorous Reply", "New phone, who dis?"]~ +- Inside source: true +*** True Line Result + [:replied_to_introduction_humorously, "Humorous Reply", "New phone, who dis?"] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def replied_to_introduction_seriously args~ +- Inside source: true +*** True Line Result + def replied_to_introduction_seriously args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [32, 21],~ +- Inside source: true +*** True Line Result + player: [32, 21], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ *replied_to_introduction_shared_scenes(args)~ +- Inside source: true +*** True Line Result + *replied_to_introduction_shared_scenes(args) +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: \"Hello, Who- is sending-- this message--?\""],~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, "Buffer-- has been set to: \"Hello, Who- is sending-- this message--?\""], +** Processing line: ~ *replied_to_introduction_shared_storylines(args)~ +- Inside source: true +*** True Line Result + *replied_to_introduction_shared_storylines(args) +** 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 replied_to_introduction_humorously args~ +- Inside source: true +*** True Line Result + def replied_to_introduction_humorously args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-observatory.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [32, 21],~ +- Inside source: true +*** True Line Result + player: [32, 21], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ *replied_to_introduction_shared_scenes(args)~ +- Inside source: true +*** True Line Result + *replied_to_introduction_shared_scenes(args) +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 18, 5, 12, "Buffer-- has been set to: \"New- phone. Who dis?\""],~ +- Inside source: true +*** True Line Result + [30, 18, 5, 12, "Buffer-- has been set to: \"New- phone. Who dis?\""], +** Processing line: ~ *replied_to_introduction_shared_storylines(args)~ +- Inside source: true +*** True Line Result + *replied_to_introduction_shared_storylines(args) +** 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 replied_to_introduction_shared_storylines args~ +- Inside source: true +*** True Line Result + def replied_to_introduction_shared_storylines args +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ [30, 10, 5, 4, "It's-- going-- to take a while-- for this reply-- to make it's-- way back."],~ +- Inside source: true +*** True Line Result + [30, 10, 5, 4, "It's-- going-- to take a while-- for this reply-- to make it's-- way back."], +** Processing line: ~ [40, 10, 5, 4, "4- hours-- to send a message-- at light speed?! How far away-- is the sender--?"],~ +- Inside source: true +*** True Line Result + [40, 10, 5, 4, "4- hours-- to send a message-- at light speed?! How far away-- is the sender--?"], +** Processing line: ~ [50, 10, 5, 4, "I know- I've-- read about-- light- speed- travel-- before--. Maybe-- the library--- still has that- poster."]~ +- Inside source: true +*** True Line Result + [50, 10, 5, 4, "I know- I've-- read about-- light- speed- travel-- before--. Maybe-- the library--- still has that- poster."] +** 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 replied_to_introduction_shared_scenes args~ +- Inside source: true +*** True Line Result + def replied_to_introduction_shared_scenes args +** Processing line: ~ [[60, 0, 4, 32, :replied_to_introduction_observatory]]~ +- Inside source: true +*** True Line Result + [[60, 0, 4, 32, :replied_to_introduction_observatory]] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def replied_to_introduction_observatory args~ +- Inside source: true +*** True Line Result + def replied_to_introduction_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/observatory.png', +** Processing line: ~ player: [28, 39],~ +- Inside source: true +*** True Line Result + player: [28, 39], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [60, 0, 4, 32, :replied_to_introduction_path_to_observatory]~ +- Inside source: true +*** True Line Result + [60, 0, 4, 32, :replied_to_introduction_path_to_observatory] +** 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 replied_to_introduction_path_to_observatory args~ +- Inside source: true +*** True Line Result + def replied_to_introduction_path_to_observatory args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/path-to-observatory.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/path-to-observatory.png', +** Processing line: ~ player: [0, 26],~ +- Inside source: true +*** True Line Result + player: [0, 26], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [60, 0, 4, 20, :replied_to_introduction_mountain_pass]~ +- Inside source: true +*** True Line Result + [60, 0, 4, 20, :replied_to_introduction_mountain_pass] +** 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 replied_to_introduction_mountain_pass args~ +- Inside source: true +*** True Line Result + def replied_to_introduction_mountain_pass args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/mountain-pass-zoomed-out.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/mountain-pass-zoomed-out.png', +** Processing line: ~ player: [21, 48],~ +- Inside source: true +*** True Line Result + player: [21, 48], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [0, 0, 15, 4, :replied_to_introduction_side_of_home]~ +- Inside source: true +*** True Line Result + [0, 0, 15, 4, :replied_to_introduction_side_of_home] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [15, 28, 5, 3, "At least I'm-- getting-- my- exercise-- in- for- today--."]~ +- Inside source: true +*** True Line Result + [15, 28, 5, 3, "At least I'm-- getting-- my- exercise-- in- for- today--."] +** 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 replied_to_introduction_side_of_home args~ +- Inside source: true +*** True Line Result + def replied_to_introduction_side_of_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/side-of-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/side-of-home.png', +** Processing line: ~ player: [58, 29],~ +- Inside source: true +*** True Line Result + player: [58, 29], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [2, 0, 61, 2, :speed_of_light_front_of_home]~ +- Inside source: true +*** True Line Result + [2, 0, 61, 2, :speed_of_light_front_of_home] +** 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: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_speed_of_light.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_speed_of_light.rb +** Processing line: ~ def speed_of_light_front_of_home args~ +- Inside source: true +*** True Line Result + def speed_of_light_front_of_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/front-of-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/front-of-home.png', +** Processing line: ~ player: [54, 23],~ +- Inside source: true +*** True Line Result + player: [54, 23], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [44, 34, 8, 14, :speed_of_light_inside_home],~ +- Inside source: true +*** True Line Result + [44, 34, 8, 14, :speed_of_light_inside_home], +** Processing line: ~ [0, 3, 3, 22, :speed_of_light_outside_library]~ +- Inside source: true +*** True Line Result + [0, 3, 3, 22, :speed_of_light_outside_library] +** 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 speed_of_light_inside_home args~ +- Inside source: true +*** True Line Result + def speed_of_light_inside_home args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [35, 4],~ +- Inside source: true +*** True Line Result + player: [35, 4], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 38, 12, 13, "Can't- sleep right now. I have to- find- out- why- it took- over-- 4- hours-- to receive-- that message."]~ +- Inside source: true +*** True Line Result + [30, 38, 12, 13, "Can't- sleep right now. I have to- find- out- why- it took- over-- 4- hours-- to receive-- that message."] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [32, 0, 8, 3, :speed_of_light_front_of_home],~ +- Inside source: true +*** True Line Result + [32, 0, 8, 3, :speed_of_light_front_of_home], +** 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 speed_of_light_outside_library args~ +- Inside source: true +*** True Line Result + def speed_of_light_outside_library args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/outside-library.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/outside-library.png', +** Processing line: ~ player: [55, 19],~ +- Inside source: true +*** True Line Result + player: [55, 19], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [49, 39, 6, 10, :speed_of_light_library],~ +- Inside source: true +*** True Line Result + [49, 39, 6, 10, :speed_of_light_library], +** Processing line: ~ [61, 11, 3, 20, :speed_of_light_front_of_home]~ +- Inside source: true +*** True Line Result + [61, 11, 3, 20, :speed_of_light_front_of_home] +** 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 speed_of_light_library args~ +- Inside source: true +*** True Line Result + def speed_of_light_library args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/library.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/library.png', +** Processing line: ~ player: [30, 7],~ +- Inside source: true +*** True Line Result + player: [30, 7], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [3, 50, 10, 3, :speed_of_light_celestial_bodies_diagram]~ +- Inside source: true +*** True Line Result + [3, 50, 10, 3, :speed_of_light_celestial_bodies_diagram] +** 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 speed_of_light_celestial_bodies_diagram args~ +- Inside source: true +*** True Line Result + def speed_of_light_celestial_bodies_diagram args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/planets.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/planets.png', +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ player: [30, 3],~ +- Inside source: true +*** True Line Result + player: [30, 3], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [56 - 2, 10, 5, 5, :speed_of_light_distance_discovered]~ +- Inside source: true +*** True Line Result + [56 - 2, 10, 5, 5, :speed_of_light_distance_discovered] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [30, 2, 4, 4, "Here- it is! This is a diagram--- of the solar-- system--. It was printed-- over-- fifty-- years- ago. Geez-- that's-- old."],~ +- Inside source: true +*** True Line Result + [30, 2, 4, 4, "Here- it is! This is a diagram--- of the solar-- system--. It was printed-- over-- fifty-- years- ago. Geez-- that's-- old."], +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ [ 0 - 2, 10, 5, 5, "The label- reads: Sun. The length- of the Astronomical-------- Unit-- (AU), is the distance-- from the Sun- to the Earth. Which is about 150--- million--- kilometers----."],~ +- Inside source: true +*** True Line Result + [ 0 - 2, 10, 5, 5, "The label- reads: Sun. The length- of the Astronomical-------- Unit-- (AU), is the distance-- from the Sun- to the Earth. Which is about 150--- million--- kilometers----."], +** Processing line: ~ [ 7 - 2, 10, 5, 5, "The label- reads: Mercury. Distance from Sun: 0.39AU------------ or- 3----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [ 7 - 2, 10, 5, 5, "The label- reads: Mercury. Distance from Sun: 0.39AU------------ or- 3----- light-- minutes--."], +** Processing line: ~ [14 - 2, 10, 5, 5, "The label- reads: Venus. Distance from Sun: 0.72AU------------ or- 6----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [14 - 2, 10, 5, 5, "The label- reads: Venus. Distance from Sun: 0.72AU------------ or- 6----- light-- minutes--."], +** Processing line: ~ [21 - 2, 10, 5, 5, "The label- reads: Earth. Distance from Sun: 1.00AU------------ or- 8----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [21 - 2, 10, 5, 5, "The label- reads: Earth. Distance from Sun: 1.00AU------------ or- 8----- light-- minutes--."], +** Processing line: ~ [28 - 2, 10, 5, 5, "The label- reads: Mars. Distance from Sun: 1.52AU------------ or- 12----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [28 - 2, 10, 5, 5, "The label- reads: Mars. Distance from Sun: 1.52AU------------ or- 12----- light-- minutes--."], +** Processing line: ~ [35 - 2, 10, 5, 5, "The label- reads: Jupiter. Distance from Sun: 5.20AU------------ or- 45----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [35 - 2, 10, 5, 5, "The label- reads: Jupiter. Distance from Sun: 5.20AU------------ or- 45----- light-- minutes--."], +** Processing line: ~ [42 - 2, 10, 5, 5, "The label- reads: Saturn. Distance from Sun: 9.53AU------------ or- 79----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [42 - 2, 10, 5, 5, "The label- reads: Saturn. Distance from Sun: 9.53AU------------ or- 79----- light-- minutes--."], +** Processing line: ~ [49 - 2, 10, 5, 5, "The label- reads: Uranus. Distance from Sun: 19.81AU------------ or- 159----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [49 - 2, 10, 5, 5, "The label- reads: Uranus. Distance from Sun: 19.81AU------------ or- 159----- light-- minutes--."], +** Processing line: ~ # [56 - 2, 15, 4, 4, "The label- reads: Neptune. Distance from Sun: 30.05AU------------ or- 4.1----- light-- hours--."],~ +- Inside source: true +*** True Line Result + # [56 - 2, 15, 4, 4, "The label- reads: Neptune. Distance from Sun: 30.05AU------------ or- 4.1----- light-- hours--."], +** Processing line: ~ [63 - 2, 10, 5, 5, "The label- reads: Pluto. Wait. WTF? Pluto-- isn't-- a planet."],~ +- Inside source: true +*** True Line Result + [63 - 2, 10, 5, 5, "The label- reads: Pluto. Wait. WTF? Pluto-- isn't-- a planet."], +** 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 speed_of_light_distance_discovered args~ +- Inside source: true +*** True Line Result + def speed_of_light_distance_discovered args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ background: 'sprites/planets.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/planets.png', +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [13, 0, 44, 3, :speed_of_light_end_of_day]~ +- Inside source: true +*** True Line Result + [13, 0, 44, 3, :speed_of_light_end_of_day] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [ 0 - 2, 10, 5, 5, "The label- reads: Sun. The length- of the Astronomical-------- Unit-- (AU), is the distance-- from the Sun- to the Earth. Which is about 150--- million--- kilometers----."],~ +- Inside source: true +*** True Line Result + [ 0 - 2, 10, 5, 5, "The label- reads: Sun. The length- of the Astronomical-------- Unit-- (AU), is the distance-- from the Sun- to the Earth. Which is about 150--- million--- kilometers----."], +** Processing line: ~ [ 7 - 2, 10, 5, 5, "The label- reads: Mercury. Distance from Sun: 0.39AU------------ or- 3----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [ 7 - 2, 10, 5, 5, "The label- reads: Mercury. Distance from Sun: 0.39AU------------ or- 3----- light-- minutes--."], +** Processing line: ~ [14 - 2, 10, 5, 5, "The label- reads: Venus. Distance from Sun: 0.72AU------------ or- 6----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [14 - 2, 10, 5, 5, "The label- reads: Venus. Distance from Sun: 0.72AU------------ or- 6----- light-- minutes--."], +** Processing line: ~ [21 - 2, 10, 5, 5, "The label- reads: Earth. Distance from Sun: 1.00AU------------ or- 8----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [21 - 2, 10, 5, 5, "The label- reads: Earth. Distance from Sun: 1.00AU------------ or- 8----- light-- minutes--."], +** Processing line: ~ [28 - 2, 10, 5, 5, "The label- reads: Mars. Distance from Sun: 1.52AU------------ or- 12----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [28 - 2, 10, 5, 5, "The label- reads: Mars. Distance from Sun: 1.52AU------------ or- 12----- light-- minutes--."], +** Processing line: ~ [35 - 2, 10, 5, 5, "The label- reads: Jupiter. Distance from Sun: 5.20AU------------ or- 45----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [35 - 2, 10, 5, 5, "The label- reads: Jupiter. Distance from Sun: 5.20AU------------ or- 45----- light-- minutes--."], +** Processing line: ~ [42 - 2, 10, 5, 5, "The label- reads: Saturn. Distance from Sun: 9.53AU------------ or- 79----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [42 - 2, 10, 5, 5, "The label- reads: Saturn. Distance from Sun: 9.53AU------------ or- 79----- light-- minutes--."], +** Processing line: ~ [49 - 2, 10, 5, 5, "The label- reads: Uranus. Distance from Sun: 19.81AU------------ or- 159----- light-- minutes--."],~ +- Inside source: true +*** True Line Result + [49 - 2, 10, 5, 5, "The label- reads: Uranus. Distance from Sun: 19.81AU------------ or- 159----- light-- minutes--."], +** Processing line: ~ [56 - 2, 10, 5, 5, "The label- reads: Neptune. Distance from Sun: 30.05AU------------ or- 4.1----- light-- hours--. What?! The message--- I received-- was from a source-- farther-- than-- Neptune?!"],~ +- Inside source: true +*** True Line Result + [56 - 2, 10, 5, 5, "The label- reads: Neptune. Distance from Sun: 30.05AU------------ or- 4.1----- light-- hours--. What?! The message--- I received-- was from a source-- farther-- than-- Neptune?!"], +** Processing line: ~ [63 - 2, 10, 5, 5, "The label- reads: Pluto. Dista- Wait... Pluto-- isn't-- a planet. People-- thought- Pluto-- was a planet-- back- then?--"],~ +- Inside source: true +*** True Line Result + [63 - 2, 10, 5, 5, "The label- reads: Pluto. Dista- Wait... Pluto-- isn't-- a planet. People-- thought- Pluto-- was a planet-- back- then?--"], +** 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 speed_of_light_end_of_day args~ +- Inside source: true +*** True Line Result + def speed_of_light_end_of_day args +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ fade: 60,~ +- Inside source: true +*** True Line Result + fade: 60, +** Processing line: ~ background: 'sprites/inside-home.png',~ +- Inside source: true +*** True Line Result + background: 'sprites/inside-home.png', +** Processing line: ~ player: [35, 0],~ +- Inside source: true +*** True Line Result + player: [35, 0], +** Processing line: ~ storylines: [~ +- Inside source: true +*** True Line Result + storylines: [ +** Processing line: ~ [35, 10, 4, 4, "Wonder-- what the reply-- will be. Who- the hell is contacting--- me from beyond-- Neptune? This- has to be some- kind- of- joke."]~ +- Inside source: true +*** True Line Result + [35, 10, 4, 4, "Wonder-- what the reply-- will be. Who- the hell is contacting--- me from beyond-- Neptune? This- has to be some- kind- of- joke."] +** Processing line: ~ ],~ +- Inside source: true +*** True Line Result + ], +** Processing line: ~ scenes: [~ +- Inside source: true +*** True Line Result + scenes: [ +** Processing line: ~ [31, 38, 10, 12, :serenity_alive_side_of_home]~ +- Inside source: true +*** True Line Result + [31, 38, 10, 12, :serenity_alive_side_of_home] +** 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: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Roguelike - Roguelike Starting Point - constants.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Roguelike - Roguelike Starting Point - constants.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/constants.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/constants.rb +** Processing line: ~ SHOW_LEGEND = true~ +- Inside source: true +*** True Line Result + SHOW_LEGEND = true +** Processing line: ~ SOURCE_TILE_SIZE = 16~ +- Inside source: true +*** True Line Result + SOURCE_TILE_SIZE = 16 +** Processing line: ~ DESTINATION_TILE_SIZE = 16~ +- Inside source: true +*** True Line Result + DESTINATION_TILE_SIZE = 16 +** Processing line: ~ TILE_SHEET_SIZE = 256~ +- Inside source: true +*** True Line Result + TILE_SHEET_SIZE = 256 +** Processing line: ~ TILE_R = 0~ +- Inside source: true +*** True Line Result + TILE_R = 0 +** Processing line: ~ TILE_G = 0~ +- Inside source: true +*** True Line Result + TILE_G = 0 +** Processing line: ~ TILE_B = 0~ +- Inside source: true +*** True Line Result + TILE_B = 0 +** Processing line: ~ TILE_A = 255~ +- Inside source: true +*** True Line Result + TILE_A = 255 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Roguelike - Roguelike Starting Point - legend.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Roguelike - Roguelike Starting Point - legend.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/legend.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/legend.rb +** Processing line: ~ def tick_legend args~ +- Inside source: true +*** True Line Result + def tick_legend args +** Processing line: ~ return unless SHOW_LEGEND~ +- Inside source: true +*** True Line Result + return unless SHOW_LEGEND +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ legend_padding = 16~ +- Inside source: true +*** True Line Result + legend_padding = 16 +** Processing line: ~ legend_x = 1280 - TILE_SHEET_SIZE - legend_padding~ +- Inside source: true +*** True Line Result + legend_x = 1280 - TILE_SHEET_SIZE - legend_padding +** Processing line: ~ legend_y = 720 - TILE_SHEET_SIZE - legend_padding~ +- Inside source: true +*** True Line Result + legend_y = 720 - TILE_SHEET_SIZE - legend_padding +** Processing line: ~ tile_sheet_sprite = [legend_x,~ +- Inside source: true +*** True Line Result + tile_sheet_sprite = [legend_x, +** Processing line: ~ legend_y,~ +- Inside source: true +*** True Line Result + legend_y, +** Processing line: ~ TILE_SHEET_SIZE,~ +- Inside source: true +*** True Line Result + TILE_SHEET_SIZE, +** Processing line: ~ TILE_SHEET_SIZE,~ +- Inside source: true +*** True Line Result + TILE_SHEET_SIZE, +** Processing line: ~ 'sprites/simple-mood-16x16.png', 0,~ +- Inside source: true +*** True Line Result + 'sprites/simple-mood-16x16.png', 0, +** Processing line: ~ TILE_A,~ +- Inside source: true +*** True Line Result + TILE_A, +** Processing line: ~ TILE_R,~ +- Inside source: true +*** True Line Result + TILE_R, +** Processing line: ~ TILE_G,~ +- Inside source: true +*** True Line Result + TILE_G, +** Processing line: ~ TILE_B]~ +- Inside source: true +*** True Line Result + TILE_B] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.inputs.mouse.point.inside_rect? tile_sheet_sprite~ +- Inside source: true +*** True Line Result + if args.inputs.mouse.point.inside_rect? tile_sheet_sprite +** Processing line: ~ mouse_row = args.inputs.mouse.point.y.idiv(SOURCE_TILE_SIZE)~ +- Inside source: true +*** True Line Result + mouse_row = args.inputs.mouse.point.y.idiv(SOURCE_TILE_SIZE) +** Processing line: ~ tile_row = 15 - (mouse_row - legend_y.idiv(SOURCE_TILE_SIZE))~ +- Inside source: true +*** True Line Result + tile_row = 15 - (mouse_row - legend_y.idiv(SOURCE_TILE_SIZE)) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ mouse_col = args.inputs.mouse.point.x.idiv(SOURCE_TILE_SIZE)~ +- Inside source: true +*** True Line Result + mouse_col = args.inputs.mouse.point.x.idiv(SOURCE_TILE_SIZE) +** Processing line: ~ tile_col = (mouse_col - legend_x.idiv(SOURCE_TILE_SIZE))~ +- Inside source: true +*** True Line Result + tile_col = (mouse_col - legend_x.idiv(SOURCE_TILE_SIZE)) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.primitives << [legend_x - legend_padding * 2,~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [legend_x - legend_padding * 2, +** Processing line: ~ mouse_row * SOURCE_TILE_SIZE, 256 + legend_padding * 2, 16, 128, 128, 128, 64].solid~ +- Inside source: true +*** True Line Result + mouse_row * SOURCE_TILE_SIZE, 256 + legend_padding * 2, 16, 128, 128, 128, 64].solid +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.primitives << [mouse_col * SOURCE_TILE_SIZE,~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [mouse_col * SOURCE_TILE_SIZE, +** Processing line: ~ legend_y - legend_padding * 2, 16, 256 + legend_padding * 2, 128, 128, 128, 64].solid~ +- Inside source: true +*** True Line Result + legend_y - legend_padding * 2, 16, 256 + legend_padding * 2, 128, 128, 128, 64].solid +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ sprite_key = sprite_lookup.find { |k, v| v == [tile_row, tile_col] }~ +- Inside source: true +*** True Line Result + sprite_key = sprite_lookup.find { |k, v| v == [tile_row, tile_col] } +** Processing line: ~ if sprite_key~ +- Inside source: true +*** True Line Result + if sprite_key +** Processing line: ~ member_name, _ = sprite_key~ +- Inside source: true +*** True Line Result + member_name, _ = sprite_key +** Processing line: ~ member_name = member_name_as_code member_name~ +- Inside source: true +*** True Line Result + member_name = member_name_as_code member_name +** Processing line: ~ args.outputs.labels << [660, 70, "# CODE SAMPLE (place in the tick_game method located in main.rb)", -1, 0]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [660, 70, "# CODE SAMPLE (place in the tick_game method located in main.rb)", -1, 0] +** Processing line: ~ args.outputs.labels << [660, 50, "# GRID_X, GRID_Y, TILE_KEY", -1, 0]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [660, 50, "# GRID_X, GRID_Y, TILE_KEY", -1, 0] +** Processing line: ~ args.outputs.labels << [660, 30, "args.outputs.sprites << tile_in_game( 5, 6, #{member_name} )", -1, 0]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [660, 30, "args.outputs.sprites << tile_in_game( 5, 6, #{member_name} )", -1, 0] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ args.outputs.labels << [660, 50, "Tile [#{tile_row}, #{tile_col}] not found. Add a key and value to app/sprite_lookup.rb:", -1, 0]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [660, 50, "Tile [#{tile_row}, #{tile_col}] not found. Add a key and value to app/sprite_lookup.rb:", -1, 0] +** Processing line: ~ args.outputs.labels << [660, 30, "{ \"some_string\" => [#{tile_row}, #{tile_col}] } OR { some_symbol: [#{tile_row}, #{tile_col}] }.", -1, 0]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [660, 30, "{ \"some_string\" => [#{tile_row}, #{tile_col}] } OR { some_symbol: [#{tile_row}, #{tile_col}] }.", -1, 0] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # render the sprite in the top right with a padding to the top and right so it's~ +- Inside source: true +*** True Line Result + # render the sprite in the top right with a padding to the top and right so it's +** Processing line: ~ # not flush against the edge~ +- Inside source: true +*** True Line Result + # not flush against the edge +** Processing line: ~ args.outputs.sprites << tile_sheet_sprite~ +- Inside source: true +*** True Line Result + args.outputs.sprites << tile_sheet_sprite +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # carefully place some ascii arrows to show the legend labels~ +- Inside source: true +*** True Line Result + # carefully place some ascii arrows to show the legend labels +** Processing line: ~ args.outputs.labels << [895, 707, "ROW --->"]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [895, 707, "ROW --->"] +** Processing line: ~ args.outputs.labels << [943, 412, " ^"]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [943, 412, " ^"] +** Processing line: ~ args.outputs.labels << [943, 412, " |"]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [943, 412, " |"] +** Processing line: ~ args.outputs.labels << [943, 394, "COL ---+"]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [943, 394, "COL ---+"] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # use the tile sheet to print out row and column numbers~ +- Inside source: true +*** True Line Result + # use the tile sheet to print out row and column numbers +** Processing line: ~ args.outputs.sprites << 16.map_with_index do |i|~ +- Inside source: true +*** True Line Result + args.outputs.sprites << 16.map_with_index do |i| +** Processing line: ~ sprite_key = i % 10~ +- Inside source: true +*** True Line Result + sprite_key = i % 10 +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ tile(1280 - TILE_SHEET_SIZE - legend_padding * 2 - SOURCE_TILE_SIZE,~ +- Inside source: true +*** True Line Result + tile(1280 - TILE_SHEET_SIZE - legend_padding * 2 - SOURCE_TILE_SIZE, +** Processing line: ~ 720 - legend_padding * 2 - (SOURCE_TILE_SIZE * i),~ +- Inside source: true +*** True Line Result + 720 - legend_padding * 2 - (SOURCE_TILE_SIZE * i), +** Processing line: ~ sprite(sprite_key)),~ +- Inside source: true +*** True Line Result + sprite(sprite_key)), +** Processing line: ~ tile(1280 - TILE_SHEET_SIZE - SOURCE_TILE_SIZE + (SOURCE_TILE_SIZE * i),~ +- Inside source: true +*** True Line Result + tile(1280 - TILE_SHEET_SIZE - SOURCE_TILE_SIZE + (SOURCE_TILE_SIZE * i), +** Processing line: ~ 720 - TILE_SHEET_SIZE - legend_padding * 3, sprite(sprite_key))~ +- Inside source: true +*** True Line Result + 720 - TILE_SHEET_SIZE - legend_padding * 3, sprite(sprite_key)) +** 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: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Roguelike - Roguelike Starting Point - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Roguelike - Roguelike 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_rpg_roguelike/01_roguelike_starting_point/app/main.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb +** Processing line: ~ require 'app/constants.rb'~ +- Inside source: true +*** True Line Result + require 'app/constants.rb' +** Processing line: ~ require 'app/sprite_lookup.rb'~ +- Inside source: true +*** True Line Result + require 'app/sprite_lookup.rb' +** Processing line: ~ require 'app/legend.rb'~ +- Inside source: true +*** True Line Result + require 'app/legend.rb' +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ tick_game args~ +- Inside source: true +*** True Line Result + tick_game args +** Processing line: ~ tick_legend args~ +- Inside source: true +*** True Line Result + tick_legend args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick_game args~ +- Inside source: true +*** True Line Result + def tick_game args +** Processing line: ~ # setup the grid~ +- Inside source: true +*** True Line Result + # setup the grid +** Processing line: ~ args.state.grid.padding = 104~ +- Inside source: true +*** True Line Result + args.state.grid.padding = 104 +** Processing line: ~ args.state.grid.size = 512~ +- Inside source: true +*** True Line Result + args.state.grid.size = 512 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # set up your game~ +- Inside source: true +*** True Line Result + # set up your game +** Processing line: ~ # initialize the game/game defaults. ||= means that you only initialize it if~ +- Inside source: true +*** True Line Result + # initialize the game/game defaults. ||= means that you only initialize it if +** Processing line: ~ # the value isn't alread initialized~ +- Inside source: true +*** True Line Result + # the value isn't alread initialized +** 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: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.state.enemies ||= [~ +- Inside source: true +*** True Line Result + args.state.enemies ||= [ +** Processing line: ~ { x: 10, y: 10, type: :goblin, tile_key: :G },~ +- Inside source: true +*** True Line Result + { x: 10, y: 10, type: :goblin, tile_key: :G }, +** Processing line: ~ { x: 15, y: 30, type: :rat, tile_key: :R }~ +- Inside source: true +*** True Line Result + { x: 15, y: 30, type: :rat, tile_key: :R } +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.state.info_message ||= "Use arrow keys to move around."~ +- Inside source: true +*** True Line Result + args.state.info_message ||= "Use arrow keys to move around." +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # handle keyboard input~ +- Inside source: true +*** True Line Result + # handle keyboard input +** Processing line: ~ # keyboard input (arrow keys to move player)~ +- Inside source: true +*** True Line Result + # keyboard input (arrow keys to move player) +** Processing line: ~ new_player_x = args.state.player.x~ +- Inside source: true +*** True Line Result + new_player_x = args.state.player.x +** Processing line: ~ new_player_y = args.state.player.y~ +- Inside source: true +*** True Line Result + new_player_y = args.state.player.y +** Processing line: ~ player_direction = ""~ +- Inside source: true +*** True Line Result + player_direction = "" +** Processing line: ~ player_moved = false~ +- Inside source: true +*** True Line Result + player_moved = false +** Processing line: ~ if args.inputs.keyboard.key_down.up~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.up +** Processing line: ~ new_player_y += 1~ +- Inside source: true +*** True Line Result + new_player_y += 1 +** Processing line: ~ player_direction = "north"~ +- Inside source: true +*** True Line Result + player_direction = "north" +** Processing line: ~ player_moved = true~ +- Inside source: true +*** True Line Result + player_moved = true +** Processing line: ~ elsif args.inputs.keyboard.key_down.down~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.down +** Processing line: ~ new_player_y -= 1~ +- Inside source: true +*** True Line Result + new_player_y -= 1 +** Processing line: ~ player_direction = "south"~ +- Inside source: true +*** True Line Result + player_direction = "south" +** Processing line: ~ player_moved = true~ +- Inside source: true +*** True Line Result + player_moved = true +** Processing line: ~ elsif args.inputs.keyboard.key_down.right~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.right +** Processing line: ~ new_player_x += 1~ +- Inside source: true +*** True Line Result + new_player_x += 1 +** Processing line: ~ player_direction = "east"~ +- Inside source: true +*** True Line Result + player_direction = "east" +** Processing line: ~ player_moved = true~ +- Inside source: true +*** True Line Result + player_moved = true +** Processing line: ~ elsif args.inputs.keyboard.key_down.left~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.left +** Processing line: ~ new_player_x -= 1~ +- Inside source: true +*** True Line Result + new_player_x -= 1 +** Processing line: ~ player_direction = "west"~ +- Inside source: true +*** True Line Result + player_direction = "west" +** Processing line: ~ player_moved = true~ +- Inside source: true +*** True Line Result + player_moved = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #handle game logic~ +- Inside source: true +*** True Line Result + #handle game logic +** Processing line: ~ # determine if there is an enemy on that square,~ +- Inside source: true +*** True Line Result + # determine if there is an enemy on that square, +** Processing line: ~ # if so, don't let the player move there~ +- Inside source: true +*** True Line Result + # if so, don't let the player move there +** Processing line: ~ if player_moved~ +- Inside source: true +*** True Line Result + if player_moved +** Processing line: ~ found_enemy = args.state.enemies.find do |e|~ +- Inside source: true +*** True Line Result + found_enemy = args.state.enemies.find do |e| +** Processing line: ~ e[:x] == new_player_x && e[:y] == new_player_y~ +- Inside source: true +*** True Line Result + e[:x] == new_player_x && e[:y] == new_player_y +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !found_enemy~ +- Inside source: true +*** True Line Result + if !found_enemy +** Processing line: ~ args.state.player.x = new_player_x~ +- Inside source: true +*** True Line Result + args.state.player.x = new_player_x +** Processing line: ~ args.state.player.y = new_player_y~ +- Inside source: true +*** True Line Result + args.state.player.y = new_player_y +** Processing line: ~ args.state.info_message = "You moved #{player_direction}."~ +- Inside source: true +*** True Line Result + args.state.info_message = "You moved #{player_direction}." +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ args.state.info_message = "You cannot move into a square an enemy occupies."~ +- Inside source: true +*** True Line Result + args.state.info_message = "You cannot move into a square an enemy occupies." +** 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 << tile_in_game(args.state.player.x,~ +- Inside source: true +*** True Line Result + args.outputs.sprites << tile_in_game(args.state.player.x, +** Processing line: ~ args.state.player.y, '@')~ +- Inside source: true +*** True Line Result + args.state.player.y, '@') +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # render game~ +- Inside source: true +*** True Line Result + # render game +** Processing line: ~ # render enemies at locations~ +- Inside source: true +*** True Line Result + # render enemies at locations +** Processing line: ~ args.outputs.sprites << args.state.enemies.map do |e|~ +- Inside source: true +*** True Line Result + args.outputs.sprites << args.state.enemies.map do |e| +** Processing line: ~ tile_in_game(e[:x], e[:y], e[:tile_key])~ +- Inside source: true +*** True Line Result + tile_in_game(e[:x], e[:y], e[:tile_key]) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # render the border~ +- Inside source: true +*** True Line Result + # render the border +** Processing line: ~ border_x = args.state.grid.padding - DESTINATION_TILE_SIZE~ +- Inside source: true +*** True Line Result + border_x = args.state.grid.padding - DESTINATION_TILE_SIZE +** Processing line: ~ border_y = args.state.grid.padding - DESTINATION_TILE_SIZE~ +- Inside source: true +*** True Line Result + border_y = args.state.grid.padding - DESTINATION_TILE_SIZE +** Processing line: ~ border_size = args.state.grid.size + DESTINATION_TILE_SIZE * 2~ +- Inside source: true +*** True Line Result + border_size = args.state.grid.size + DESTINATION_TILE_SIZE * 2 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.borders << [border_x,~ +- Inside source: true +*** True Line Result + args.outputs.borders << [border_x, +** Processing line: ~ border_y,~ +- Inside source: true +*** True Line Result + border_y, +** Processing line: ~ border_size,~ +- Inside source: true +*** True Line Result + border_size, +** Processing line: ~ border_size]~ +- Inside source: true +*** True Line Result + border_size] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # render label stuff~ +- Inside source: true +*** True Line Result + # render label stuff +** Processing line: ~ args.outputs.labels << [border_x, border_y - 10, "Current player location is: #{args.state.player.x}, #{args.state.player.y}"]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [border_x, border_y - 10, "Current player location is: #{args.state.player.x}, #{args.state.player.y}"] +** Processing line: ~ args.outputs.labels << [border_x, border_y + 25 + border_size, args.state.info_message]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [border_x, border_y + 25 + border_size, args.state.info_message] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tile_in_game x, y, tile_key~ +- Inside source: true +*** True Line Result + def tile_in_game x, y, tile_key +** Processing line: ~ tile($gtk.args.state.grid.padding + x * DESTINATION_TILE_SIZE,~ +- Inside source: true +*** True Line Result + tile($gtk.args.state.grid.padding + x * DESTINATION_TILE_SIZE, +** Processing line: ~ $gtk.args.state.grid.padding + y * DESTINATION_TILE_SIZE,~ +- Inside source: true +*** True Line Result + $gtk.args.state.grid.padding + y * DESTINATION_TILE_SIZE, +** Processing line: ~ tile_key)~ +- Inside source: true +*** True Line Result + tile_key) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Roguelike - Roguelike Starting Point - sprite_lookup.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Roguelike - Roguelike Starting Point - sprite_lookup.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb +** Processing line: ~ def sprite_lookup~ +- Inside source: true +*** True Line Result + def sprite_lookup +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ 0 => [3, 0],~ +- Inside source: true +*** True Line Result + 0 => [3, 0], +** Processing line: ~ 1 => [3, 1],~ +- Inside source: true +*** True Line Result + 1 => [3, 1], +** Processing line: ~ 2 => [3, 2],~ +- Inside source: true +*** True Line Result + 2 => [3, 2], +** Processing line: ~ 3 => [3, 3],~ +- Inside source: true +*** True Line Result + 3 => [3, 3], +** Processing line: ~ 4 => [3, 4],~ +- Inside source: true +*** True Line Result + 4 => [3, 4], +** Processing line: ~ 5 => [3, 5],~ +- Inside source: true +*** True Line Result + 5 => [3, 5], +** Processing line: ~ 6 => [3, 6],~ +- Inside source: true +*** True Line Result + 6 => [3, 6], +** Processing line: ~ 7 => [3, 7],~ +- Inside source: true +*** True Line Result + 7 => [3, 7], +** Processing line: ~ 8 => [3, 8],~ +- Inside source: true +*** True Line Result + 8 => [3, 8], +** Processing line: ~ 9 => [3, 9],~ +- Inside source: true +*** True Line Result + 9 => [3, 9], +** Processing line: ~ '@' => [4, 0],~ +- Inside source: true +*** True Line Result + '@' => [4, 0], +** Processing line: ~ A: [ 4, 1],~ +- Inside source: true +*** True Line Result + A: [ 4, 1], +** Processing line: ~ B: [ 4, 2],~ +- Inside source: true +*** True Line Result + B: [ 4, 2], +** Processing line: ~ C: [ 4, 3],~ +- Inside source: true +*** True Line Result + C: [ 4, 3], +** Processing line: ~ D: [ 4, 4],~ +- Inside source: true +*** True Line Result + D: [ 4, 4], +** Processing line: ~ E: [ 4, 5],~ +- Inside source: true +*** True Line Result + E: [ 4, 5], +** Processing line: ~ F: [ 4, 6],~ +- Inside source: true +*** True Line Result + F: [ 4, 6], +** Processing line: ~ G: [ 4, 7],~ +- Inside source: true +*** True Line Result + G: [ 4, 7], +** Processing line: ~ H: [ 4, 8],~ +- Inside source: true +*** True Line Result + H: [ 4, 8], +** Processing line: ~ I: [ 4, 9],~ +- Inside source: true +*** True Line Result + I: [ 4, 9], +** Processing line: ~ J: [ 4, 10],~ +- Inside source: true +*** True Line Result + J: [ 4, 10], +** Processing line: ~ K: [ 4, 11],~ +- Inside source: true +*** True Line Result + K: [ 4, 11], +** Processing line: ~ L: [ 4, 12],~ +- Inside source: true +*** True Line Result + L: [ 4, 12], +** Processing line: ~ M: [ 4, 13],~ +- Inside source: true +*** True Line Result + M: [ 4, 13], +** Processing line: ~ N: [ 4, 14],~ +- Inside source: true +*** True Line Result + N: [ 4, 14], +** Processing line: ~ O: [ 4, 15],~ +- Inside source: true +*** True Line Result + O: [ 4, 15], +** Processing line: ~ P: [ 5, 0],~ +- Inside source: true +*** True Line Result + P: [ 5, 0], +** Processing line: ~ Q: [ 5, 1],~ +- Inside source: true +*** True Line Result + Q: [ 5, 1], +** Processing line: ~ R: [ 5, 2],~ +- Inside source: true +*** True Line Result + R: [ 5, 2], +** Processing line: ~ S: [ 5, 3],~ +- Inside source: true +*** True Line Result + S: [ 5, 3], +** Processing line: ~ T: [ 5, 4],~ +- Inside source: true +*** True Line Result + T: [ 5, 4], +** Processing line: ~ U: [ 5, 5],~ +- Inside source: true +*** True Line Result + U: [ 5, 5], +** Processing line: ~ V: [ 5, 6],~ +- Inside source: true +*** True Line Result + V: [ 5, 6], +** Processing line: ~ W: [ 5, 7],~ +- Inside source: true +*** True Line Result + W: [ 5, 7], +** Processing line: ~ X: [ 5, 8],~ +- Inside source: true +*** True Line Result + X: [ 5, 8], +** Processing line: ~ Y: [ 5, 9],~ +- Inside source: true +*** True Line Result + Y: [ 5, 9], +** Processing line: ~ Z: [ 5, 10],~ +- Inside source: true +*** True Line Result + Z: [ 5, 10], +** Processing line: ~ a: [ 6, 1],~ +- Inside source: true +*** True Line Result + a: [ 6, 1], +** Processing line: ~ b: [ 6, 2],~ +- Inside source: true +*** True Line Result + b: [ 6, 2], +** Processing line: ~ c: [ 6, 3],~ +- Inside source: true +*** True Line Result + c: [ 6, 3], +** Processing line: ~ d: [ 6, 4],~ +- Inside source: true +*** True Line Result + d: [ 6, 4], +** Processing line: ~ e: [ 6, 5],~ +- Inside source: true +*** True Line Result + e: [ 6, 5], +** Processing line: ~ f: [ 6, 6],~ +- Inside source: true +*** True Line Result + f: [ 6, 6], +** Processing line: ~ g: [ 6, 7],~ +- Inside source: true +*** True Line Result + g: [ 6, 7], +** Processing line: ~ h: [ 6, 8],~ +- Inside source: true +*** True Line Result + h: [ 6, 8], +** Processing line: ~ i: [ 6, 9],~ +- Inside source: true +*** True Line Result + i: [ 6, 9], +** Processing line: ~ j: [ 6, 10],~ +- Inside source: true +*** True Line Result + j: [ 6, 10], +** Processing line: ~ k: [ 6, 11],~ +- Inside source: true +*** True Line Result + k: [ 6, 11], +** Processing line: ~ l: [ 6, 12],~ +- Inside source: true +*** True Line Result + l: [ 6, 12], +** Processing line: ~ m: [ 6, 13],~ +- Inside source: true +*** True Line Result + m: [ 6, 13], +** Processing line: ~ n: [ 6, 14],~ +- Inside source: true +*** True Line Result + n: [ 6, 14], +** Processing line: ~ o: [ 6, 15],~ +- Inside source: true +*** True Line Result + o: [ 6, 15], +** Processing line: ~ p: [ 7, 0],~ +- Inside source: true +*** True Line Result + p: [ 7, 0], +** Processing line: ~ q: [ 7, 1],~ +- Inside source: true +*** True Line Result + q: [ 7, 1], +** Processing line: ~ r: [ 7, 2],~ +- Inside source: true +*** True Line Result + r: [ 7, 2], +** Processing line: ~ s: [ 7, 3],~ +- Inside source: true +*** True Line Result + s: [ 7, 3], +** Processing line: ~ t: [ 7, 4],~ +- Inside source: true +*** True Line Result + t: [ 7, 4], +** Processing line: ~ u: [ 7, 5],~ +- Inside source: true +*** True Line Result + u: [ 7, 5], +** Processing line: ~ v: [ 7, 6],~ +- Inside source: true +*** True Line Result + v: [ 7, 6], +** Processing line: ~ w: [ 7, 7],~ +- Inside source: true +*** True Line Result + w: [ 7, 7], +** Processing line: ~ x: [ 7, 8],~ +- Inside source: true +*** True Line Result + x: [ 7, 8], +** Processing line: ~ y: [ 7, 9],~ +- Inside source: true +*** True Line Result + y: [ 7, 9], +** Processing line: ~ z: [ 7, 10],~ +- Inside source: true +*** True Line Result + z: [ 7, 10], +** Processing line: ~ '|' => [ 7, 12]~ +- Inside source: true +*** True Line Result + '|' => [ 7, 12] +** 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 sprite key~ +- Inside source: true +*** True Line Result + def sprite key +** Processing line: ~ $gtk.args.state.reserved.sprite_lookup[key]~ +- Inside source: true +*** True Line Result + $gtk.args.state.reserved.sprite_lookup[key] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def member_name_as_code raw_member_name~ +- Inside source: true +*** True Line Result + def member_name_as_code raw_member_name +** Processing line: ~ if raw_member_name.is_a? Symbol~ +- Inside source: true +*** True Line Result + if raw_member_name.is_a? Symbol +** Processing line: ~ ":#{raw_member_name}"~ +- Inside source: true +*** True Line Result + ":#{raw_member_name}" +** Processing line: ~ elsif raw_member_name.is_a? String~ +- Inside source: true +*** True Line Result + elsif raw_member_name.is_a? String +** Processing line: ~ "'#{raw_member_name}'"~ +- Inside source: true +*** True Line Result + "'#{raw_member_name}'" +** Processing line: ~ elsif raw_member_name.is_a? Fixnum~ +- Inside source: true +*** True Line Result + elsif raw_member_name.is_a? Fixnum +** Processing line: ~ "#{raw_member_name}"~ +- Inside source: true +*** True Line Result + "#{raw_member_name}" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ "UNKNOWN: #{raw_member_name}"~ +- Inside source: true +*** True Line Result + "UNKNOWN: #{raw_member_name}" +** 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 tile x, y, tile_row_column_or_key~ +- Inside source: true +*** True Line Result + def tile x, y, tile_row_column_or_key +** Processing line: ~ tile_extended x, y, DESTINATION_TILE_SIZE, DESTINATION_TILE_SIZE, TILE_R, TILE_G, TILE_B, TILE_A, tile_row_column_or_key~ +- Inside source: true +*** True Line Result + tile_extended x, y, DESTINATION_TILE_SIZE, DESTINATION_TILE_SIZE, TILE_R, TILE_G, TILE_B, TILE_A, tile_row_column_or_key +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tile_extended x, y, w, h, r, g, b, a, tile_row_column_or_key~ +- Inside source: true +*** True Line Result + def tile_extended x, y, w, h, r, g, b, a, tile_row_column_or_key +** Processing line: ~ row_or_key, column = tile_row_column_or_key~ +- Inside source: true +*** True Line Result + row_or_key, column = tile_row_column_or_key +** Processing line: ~ if !column~ +- Inside source: true +*** True Line Result + if !column +** Processing line: ~ row, column = sprite row_or_key~ +- Inside source: true +*** True Line Result + row, column = sprite row_or_key +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ row, column = row_or_key, column~ +- Inside source: true +*** True Line Result + row, column = row_or_key, column +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !row~ +- Inside source: true +*** True Line Result + if !row +** Processing line: ~ member_name = member_name_as_code tile_row_column_or_key~ +- Inside source: true +*** True Line Result + member_name = member_name_as_code tile_row_column_or_key +** Processing line: ~ raise "Unabled to find a sprite for #{member_name}. Make sure the value exists in app/sprite_lookup.rb."~ +- Inside source: true +*** True Line Result + raise "Unabled to find a sprite for #{member_name}. Make sure the value exists in app/sprite_lookup.rb." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Sprite provided by Rogue Yun~ +- Inside source: true +*** True Line Result + # Sprite provided by Rogue Yun +** Processing line: ~ # http://www.bay12forums.com/smf/index.php?topic=144897.0~ +- Inside source: true +*** True Line Result + # http://www.bay12forums.com/smf/index.php?topic=144897.0 +** Processing line: ~ # License: Public Domain~ +- Inside source: true +*** True Line Result + # License: Public Domain +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ x: x,~ +- Inside source: true +*** True Line Result + x: x, +** Processing line: ~ y: y,~ +- Inside source: true +*** True Line Result + y: y, +** Processing line: ~ w: w,~ +- Inside source: true +*** True Line Result + w: w, +** Processing line: ~ h: h,~ +- Inside source: true +*** True Line Result + h: h, +** Processing line: ~ tile_x: column * 16,~ +- Inside source: true +*** True Line Result + tile_x: column * 16, +** Processing line: ~ tile_y: (row * 16),~ +- Inside source: true +*** True Line Result + tile_y: (row * 16), +** Processing line: ~ tile_w: 16,~ +- Inside source: true +*** True Line Result + tile_w: 16, +** Processing line: ~ tile_h: 16,~ +- Inside source: true +*** True Line Result + tile_h: 16, +** 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: ~ a: a,~ +- Inside source: true +*** True Line Result + a: a, +** Processing line: ~ path: 'sprites/simple-mood-16x16.png'~ +- Inside source: true +*** True Line Result + path: 'sprites/simple-mood-16x16.png' +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ $gtk.args.state.reserved.sprite_lookup = sprite_lookup~ +- Inside source: true +*** True Line Result + $gtk.args.state.reserved.sprite_lookup = sprite_lookup +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Roguelike - Roguelike Line Of Sight - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Roguelike - Roguelike Line Of Sight - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb +** Processing line: ~ =begin~ +- Inside source: true +*** True Line Result + =begin +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +- Inside source: true +*** True Line Result + APIs listing that haven't been encountered in previous sample apps: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - lambda: A way to define a block and its parameters with special syntax.~ +- Inside source: true +*** True Line Result + - lambda: A way to define a block and its parameters with special syntax. +** Processing line: ~ For example, the syntax of lambda looks like this:~ +- Inside source: true +*** True Line Result + For example, the syntax of lambda looks like this: +** Processing line: ~ my_lambda = -> { puts "This is my lambda" }~ +- Inside source: true +*** True Line Result + my_lambda = -> { puts "This is my lambda" } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Reminders:~ +- Inside source: true +*** True Line Result + Reminders: +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ +- Inside source: true +*** True Line Result + - args.outputs.labels: An array. The values generate a label. +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +- Inside source: true +*** True Line Result + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.~ +- Inside source: true +*** True Line Result + For more information about labels, go to mygame/documentation/02-labels. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - ARRAY#inside_rect?: Returns whether or not the point is inside a rect.~ +- Inside source: true +*** True Line Result + - ARRAY#inside_rect?: Returns whether or not the point is inside a rect. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - product: Returns an array of all combinations of elements from all arrays.~ +- Inside source: true +*** True Line Result + - product: Returns an array of all combinations of elements from all arrays. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - find: Finds all elements of a collection that meet requirements.~ +- Inside source: true +*** True Line Result + - find: Finds all elements of a collection that meet requirements. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - abs: Returns the absolute value.~ +- Inside source: true +*** True Line Result + - abs: Returns the absolute value. +** 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: ~ # This sample app allows the player to move around in the dungeon, which becomes more or less visible~ +- Inside source: true +*** True Line Result + # This sample app allows the player to move around in the dungeon, which becomes more or less visible +** Processing line: ~ # depending on the player's location, and also has enemies.~ +- Inside source: true +*** True Line Result + # depending on the player's location, and also has enemies. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ class Game~ +- Inside source: true +*** True Line Result + class Game +** Processing line: ~ attr_accessor :args, :state, :inputs, :outputs, :grid~ +- Inside source: true +*** True Line Result + attr_accessor :args, :state, :inputs, :outputs, :grid +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Calls all the methods needed for the game to run properly.~ +- Inside source: true +*** True Line Result + # Calls all the methods needed for the game to run properly. +** 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_canvas~ +- Inside source: true +*** True Line Result + render_canvas +** Processing line: ~ render_dungeon~ +- Inside source: true +*** True Line Result + render_dungeon +** Processing line: ~ render_player~ +- Inside source: true +*** True Line Result + render_player +** Processing line: ~ render_enemies~ +- Inside source: true +*** True Line Result + render_enemies +** Processing line: ~ print_cell_coordinates~ +- Inside source: true +*** True Line Result + print_cell_coordinates +** Processing line: ~ calc_canvas~ +- Inside source: true +*** True Line Result + calc_canvas +** Processing line: ~ input_move~ +- Inside source: true +*** True Line Result + input_move +** Processing line: ~ input_click_map~ +- Inside source: true +*** True Line Result + input_click_map +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Sets default values and initializes variables~ +- Inside source: true +*** True Line Result + # Sets default values and initializes variables +** Processing line: ~ def defaults~ +- Inside source: true +*** True Line Result + def defaults +** Processing line: ~ outputs.background_color = [0, 0, 0] # black background~ +- Inside source: true +*** True Line Result + outputs.background_color = [0, 0, 0] # black background +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Initializes empty canvas, dungeon, and enemies collections.~ +- Inside source: true +*** True Line Result + # Initializes empty canvas, dungeon, and enemies collections. +** Processing line: ~ state.canvas ||= []~ +- Inside source: true +*** True Line Result + state.canvas ||= [] +** Processing line: ~ state.dungeon ||= []~ +- Inside source: true +*** True Line Result + state.dungeon ||= [] +** Processing line: ~ state.enemies ||= []~ +- Inside source: true +*** True Line Result + state.enemies ||= [] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # If state.area doesn't have value, load_area_one and derive_dungeon_from_area methods are called~ +- Inside source: true +*** True Line Result + # If state.area doesn't have value, load_area_one and derive_dungeon_from_area methods are called +** Processing line: ~ if !state.area~ +- Inside source: true +*** True Line Result + if !state.area +** Processing line: ~ load_area_one~ +- Inside source: true +*** True Line Result + load_area_one +** Processing line: ~ derive_dungeon_from_area~ +- Inside source: true +*** True Line Result + derive_dungeon_from_area +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Changing these values will change the position of player~ +- Inside source: true +*** True Line Result + # Changing these values will change the position of player +** Processing line: ~ state.x = 7~ +- Inside source: true +*** True Line Result + state.x = 7 +** Processing line: ~ state.y = 5~ +- Inside source: true +*** True Line Result + state.y = 5 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Creates new enemies, sets their values, and adds them to the enemies collection.~ +- Inside source: true +*** True Line Result + # Creates new enemies, sets their values, and adds them to the enemies collection. +** Processing line: ~ state.enemies << state.new_entity(:enemy) do |e| # declares each enemy as new entity~ +- Inside source: true +*** True Line Result + state.enemies << state.new_entity(:enemy) do |e| # declares each enemy as new entity +** Processing line: ~ e.x = 13 # position~ +- Inside source: true +*** True Line Result + e.x = 13 # position +** Processing line: ~ e.y = 5~ +- Inside source: true +*** True Line Result + e.y = 5 +** Processing line: ~ e.previous_hp = 3~ +- Inside source: true +*** True Line Result + e.previous_hp = 3 +** Processing line: ~ e.hp = 3~ +- Inside source: true +*** True Line Result + e.hp = 3 +** Processing line: ~ e.max_hp = 3~ +- Inside source: true +*** True Line Result + e.max_hp = 3 +** Processing line: ~ e.is_dead = false # the enemy is alive~ +- Inside source: true +*** True Line Result + e.is_dead = false # the enemy is alive +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ update_line_of_sight # updates line of sight by adding newly visible cells~ +- Inside source: true +*** True Line Result + update_line_of_sight # updates line of sight by adding newly visible cells +** 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: ~ # Adds elements into the state.area collection~ +- Inside source: true +*** True Line Result + # Adds elements into the state.area collection +** Processing line: ~ # The dungeon is derived using the coordinates of this collection~ +- Inside source: true +*** True Line Result + # The dungeon is derived using the coordinates of this collection +** Processing line: ~ def load_area_one~ +- Inside source: true +*** True Line Result + def load_area_one +** Processing line: ~ state.area ||= []~ +- Inside source: true +*** True Line Result + state.area ||= [] +** Processing line: ~ state.area << [8, 6]~ +- Inside source: true +*** True Line Result + state.area << [8, 6] +** Processing line: ~ state.area << [7, 6]~ +- Inside source: true +*** True Line Result + state.area << [7, 6] +** Processing line: ~ state.area << [7, 7]~ +- Inside source: true +*** True Line Result + state.area << [7, 7] +** Processing line: ~ state.area << [8, 9]~ +- Inside source: true +*** True Line Result + state.area << [8, 9] +** Processing line: ~ state.area << [7, 8]~ +- Inside source: true +*** True Line Result + state.area << [7, 8] +** Processing line: ~ state.area << [7, 9]~ +- Inside source: true +*** True Line Result + state.area << [7, 9] +** Processing line: ~ state.area << [6, 4]~ +- Inside source: true +*** True Line Result + state.area << [6, 4] +** Processing line: ~ state.area << [7, 3]~ +- Inside source: true +*** True Line Result + state.area << [7, 3] +** Processing line: ~ state.area << [7, 4]~ +- Inside source: true +*** True Line Result + state.area << [7, 4] +** Processing line: ~ state.area << [6, 5]~ +- Inside source: true +*** True Line Result + state.area << [6, 5] +** Processing line: ~ state.area << [7, 5]~ +- Inside source: true +*** True Line Result + state.area << [7, 5] +** Processing line: ~ state.area << [8, 5]~ +- Inside source: true +*** True Line Result + state.area << [8, 5] +** Processing line: ~ state.area << [8, 4]~ +- Inside source: true +*** True Line Result + state.area << [8, 4] +** Processing line: ~ state.area << [1, 1]~ +- Inside source: true +*** True Line Result + state.area << [1, 1] +** Processing line: ~ state.area << [0, 1]~ +- Inside source: true +*** True Line Result + state.area << [0, 1] +** Processing line: ~ state.area << [0, 2]~ +- Inside source: true +*** True Line Result + state.area << [0, 2] +** Processing line: ~ state.area << [1, 2]~ +- Inside source: true +*** True Line Result + state.area << [1, 2] +** Processing line: ~ state.area << [2, 2]~ +- Inside source: true +*** True Line Result + state.area << [2, 2] +** Processing line: ~ state.area << [2, 1]~ +- Inside source: true +*** True Line Result + state.area << [2, 1] +** Processing line: ~ state.area << [2, 3]~ +- Inside source: true +*** True Line Result + state.area << [2, 3] +** Processing line: ~ state.area << [1, 3]~ +- Inside source: true +*** True Line Result + state.area << [1, 3] +** Processing line: ~ state.area << [1, 4]~ +- Inside source: true +*** True Line Result + state.area << [1, 4] +** Processing line: ~ state.area << [2, 4]~ +- Inside source: true +*** True Line Result + state.area << [2, 4] +** Processing line: ~ state.area << [2, 5]~ +- Inside source: true +*** True Line Result + state.area << [2, 5] +** Processing line: ~ state.area << [1, 5]~ +- Inside source: true +*** True Line Result + state.area << [1, 5] +** Processing line: ~ state.area << [2, 6]~ +- Inside source: true +*** True Line Result + state.area << [2, 6] +** Processing line: ~ state.area << [3, 6]~ +- Inside source: true +*** True Line Result + state.area << [3, 6] +** Processing line: ~ state.area << [4, 6]~ +- Inside source: true +*** True Line Result + state.area << [4, 6] +** Processing line: ~ state.area << [4, 7]~ +- Inside source: true +*** True Line Result + state.area << [4, 7] +** Processing line: ~ state.area << [4, 8]~ +- Inside source: true +*** True Line Result + state.area << [4, 8] +** Processing line: ~ state.area << [5, 8]~ +- Inside source: true +*** True Line Result + state.area << [5, 8] +** Processing line: ~ state.area << [5, 9]~ +- Inside source: true +*** True Line Result + state.area << [5, 9] +** Processing line: ~ state.area << [6, 9]~ +- Inside source: true +*** True Line Result + state.area << [6, 9] +** Processing line: ~ state.area << [7, 10]~ +- Inside source: true +*** True Line Result + state.area << [7, 10] +** Processing line: ~ state.area << [7, 11]~ +- Inside source: true +*** True Line Result + state.area << [7, 11] +** Processing line: ~ state.area << [7, 12]~ +- Inside source: true +*** True Line Result + state.area << [7, 12] +** Processing line: ~ state.area << [7, 12]~ +- Inside source: true +*** True Line Result + state.area << [7, 12] +** Processing line: ~ state.area << [7, 13]~ +- Inside source: true +*** True Line Result + state.area << [7, 13] +** Processing line: ~ state.area << [8, 13]~ +- Inside source: true +*** True Line Result + state.area << [8, 13] +** Processing line: ~ state.area << [9, 13]~ +- Inside source: true +*** True Line Result + state.area << [9, 13] +** Processing line: ~ state.area << [10, 13]~ +- Inside source: true +*** True Line Result + state.area << [10, 13] +** Processing line: ~ state.area << [11, 13]~ +- Inside source: true +*** True Line Result + state.area << [11, 13] +** Processing line: ~ state.area << [12, 13]~ +- Inside source: true +*** True Line Result + state.area << [12, 13] +** Processing line: ~ state.area << [12, 12]~ +- Inside source: true +*** True Line Result + state.area << [12, 12] +** Processing line: ~ state.area << [8, 12]~ +- Inside source: true +*** True Line Result + state.area << [8, 12] +** Processing line: ~ state.area << [9, 12]~ +- Inside source: true +*** True Line Result + state.area << [9, 12] +** Processing line: ~ state.area << [10, 12]~ +- Inside source: true +*** True Line Result + state.area << [10, 12] +** Processing line: ~ state.area << [11, 12]~ +- Inside source: true +*** True Line Result + state.area << [11, 12] +** Processing line: ~ state.area << [12, 11]~ +- Inside source: true +*** True Line Result + state.area << [12, 11] +** Processing line: ~ state.area << [13, 11]~ +- Inside source: true +*** True Line Result + state.area << [13, 11] +** Processing line: ~ state.area << [13, 10]~ +- Inside source: true +*** True Line Result + state.area << [13, 10] +** Processing line: ~ state.area << [13, 9]~ +- Inside source: true +*** True Line Result + state.area << [13, 9] +** Processing line: ~ state.area << [13, 8]~ +- Inside source: true +*** True Line Result + state.area << [13, 8] +** Processing line: ~ state.area << [13, 7]~ +- Inside source: true +*** True Line Result + state.area << [13, 7] +** Processing line: ~ state.area << [13, 6]~ +- Inside source: true +*** True Line Result + state.area << [13, 6] +** Processing line: ~ state.area << [12, 6]~ +- Inside source: true +*** True Line Result + state.area << [12, 6] +** Processing line: ~ state.area << [14, 6]~ +- Inside source: true +*** True Line Result + state.area << [14, 6] +** Processing line: ~ state.area << [14, 5]~ +- Inside source: true +*** True Line Result + state.area << [14, 5] +** Processing line: ~ state.area << [13, 5]~ +- Inside source: true +*** True Line Result + state.area << [13, 5] +** Processing line: ~ state.area << [12, 5]~ +- Inside source: true +*** True Line Result + state.area << [12, 5] +** Processing line: ~ state.area << [12, 4]~ +- Inside source: true +*** True Line Result + state.area << [12, 4] +** Processing line: ~ state.area << [13, 4]~ +- Inside source: true +*** True Line Result + state.area << [13, 4] +** Processing line: ~ state.area << [14, 4]~ +- Inside source: true +*** True Line Result + state.area << [14, 4] +** Processing line: ~ state.area << [1, 6]~ +- Inside source: true +*** True Line Result + state.area << [1, 6] +** Processing line: ~ state.area << [6, 6]~ +- Inside source: true +*** True Line Result + state.area << [6, 6] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Starts with an empty dungeon collection, and adds dungeon cells into it.~ +- Inside source: true +*** True Line Result + # Starts with an empty dungeon collection, and adds dungeon cells into it. +** Processing line: ~ def derive_dungeon_from_area~ +- Inside source: true +*** True Line Result + def derive_dungeon_from_area +** Processing line: ~ state.dungeon = [] # starts as empty collection~ +- Inside source: true +*** True Line Result + state.dungeon = [] # starts as empty collection +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ state.area.each do |a| # for each element of the area collection~ +- Inside source: true +*** True Line Result + state.area.each do |a| # for each element of the area collection +** Processing line: ~ state.dungeon << state.new_entity(:dungeon_cell) do |d| # declares each dungeon cell as new entity~ +- Inside source: true +*** True Line Result + state.dungeon << state.new_entity(:dungeon_cell) do |d| # declares each dungeon cell as new entity +** Processing line: ~ d.x = a.x # dungeon cell position using coordinates from area~ +- Inside source: true +*** True Line Result + d.x = a.x # dungeon cell position using coordinates from area +** Processing line: ~ d.y = a.y~ +- Inside source: true +*** True Line Result + d.y = a.y +** Processing line: ~ d.is_visible = false # cell is not visible~ +- Inside source: true +*** True Line Result + d.is_visible = false # cell is not visible +** Processing line: ~ d.alpha = 0 # not transparent at all~ +- Inside source: true +*** True Line Result + d.alpha = 0 # not transparent at all +** Processing line: ~ d.border = [left_margin + a.x * grid_size,~ +- Inside source: true +*** True Line Result + d.border = [left_margin + a.x * grid_size, +** Processing line: ~ bottom_margin + a.y * grid_size,~ +- Inside source: true +*** True Line Result + bottom_margin + a.y * grid_size, +** Processing line: ~ grid_size,~ +- Inside source: true +*** True Line Result + grid_size, +** Processing line: ~ grid_size,~ +- Inside source: true +*** True Line Result + grid_size, +** Processing line: ~ *blue,~ +- Inside source: true +*** True Line Result + *blue, +** Processing line: ~ 255] # sets border definition for dungeon cell~ +- Inside source: true +*** True Line Result + 255] # sets border definition for dungeon cell +** Processing line: ~ d # returns dungeon cell~ +- Inside source: true +*** True Line Result + d # returns dungeon cell +** 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 left_margin~ +- Inside source: true +*** True Line Result + def left_margin +** Processing line: ~ 40 # sets left margin~ +- Inside source: true +*** True Line Result + 40 # sets left margin +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def bottom_margin~ +- Inside source: true +*** True Line Result + def bottom_margin +** Processing line: ~ 60 # sets bottom margin~ +- Inside source: true +*** True Line Result + 60 # sets bottom margin +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def grid_size~ +- Inside source: true +*** True Line Result + def grid_size +** Processing line: ~ 40 # sets size of grid square~ +- Inside source: true +*** True Line Result + 40 # sets size of grid square +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Updates the line of sight by calling the thick_line_of_sight method and~ +- Inside source: true +*** True Line Result + # Updates the line of sight by calling the thick_line_of_sight method and +** Processing line: ~ # adding dungeon cells to the newly_visible collection~ +- Inside source: true +*** True Line Result + # adding dungeon cells to the newly_visible collection +** Processing line: ~ def update_line_of_sight~ +- Inside source: true +*** True Line Result + def update_line_of_sight +** Processing line: ~ variations = [-1, 0, 1]~ +- Inside source: true +*** True Line Result + variations = [-1, 0, 1] +** Processing line: ~ # creates collection of newly visible dungeon cells~ +- Inside source: true +*** True Line Result + # creates collection of newly visible dungeon cells +** Processing line: ~ newly_visible = variations.product(variations).flat_map do |rise, run| # combo of all elements~ +- Inside source: true +*** True Line Result + newly_visible = variations.product(variations).flat_map do |rise, run| # combo of all elements +** Processing line: ~ thick_line_of_sight state.x, state.y, rise, run, 15, # calls thick_line_of_sight method~ +- Inside source: true +*** True Line Result + thick_line_of_sight state.x, state.y, rise, run, 15, # calls thick_line_of_sight method +** Processing line: ~ lambda { |x, y| dungeon_cell_exists? x, y } # checks whether or not cell exists~ +- Inside source: true +*** True Line Result + lambda { |x, y| dungeon_cell_exists? x, y } # checks whether or not cell exists +** Processing line: ~ end.uniq# removes duplicates~ +- Inside source: true +*** True Line Result + end.uniq# removes duplicates +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ state.dungeon.each do |d| # perform action on each element of dungeons collection~ +- Inside source: true +*** True Line Result + state.dungeon.each do |d| # perform action on each element of dungeons collection +** Processing line: ~ d.is_visible = newly_visible.find { |v| v.x == d.x && v.y == d.y } # finds match inside newly_visible collection~ +- Inside source: true +*** True Line Result + d.is_visible = newly_visible.find { |v| v.x == d.x && v.y == d.y } # finds match inside newly_visible collection +** 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: ~ #Returns a boolean value~ +- Inside source: true +*** True Line Result + #Returns a boolean value +** Processing line: ~ def dungeon_cell_exists? x, y~ +- Inside source: true +*** True Line Result + def dungeon_cell_exists? x, y +** Processing line: ~ # Finds cell coordinates inside dungeon collection to determine if dungeon cell exists~ +- Inside source: true +*** True Line Result + # Finds cell coordinates inside dungeon collection to determine if dungeon cell exists +** Processing line: ~ state.dungeon.find { |d| d.x == x && d.y == y }~ +- Inside source: true +*** True Line Result + state.dungeon.find { |d| d.x == x && d.y == y } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Calls line_of_sight method to add elements to result collection~ +- Inside source: true +*** True Line Result + # Calls line_of_sight method to add elements to result collection +** Processing line: ~ def thick_line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda~ +- Inside source: true +*** True Line Result + def thick_line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda +** Processing line: ~ result = []~ +- Inside source: true +*** True Line Result + result = [] +** Processing line: ~ result += line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda~ +- Inside source: true +*** True Line Result + result += line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda +** Processing line: ~ result += line_of_sight start_x - 1, start_y, rise, run, distance, cell_exists_lambda # one left~ +- Inside source: true +*** True Line Result + result += line_of_sight start_x - 1, start_y, rise, run, distance, cell_exists_lambda # one left +** Processing line: ~ result += line_of_sight start_x + 1, start_y, rise, run, distance, cell_exists_lambda # one right~ +- Inside source: true +*** True Line Result + result += line_of_sight start_x + 1, start_y, rise, run, distance, cell_exists_lambda # one right +** 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: ~ # Adds points to the result collection to create the player's line of sight~ +- Inside source: true +*** True Line Result + # Adds points to the result collection to create the player's line of sight +** Processing line: ~ def line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda~ +- Inside source: true +*** True Line Result + def line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda +** Processing line: ~ result = [] # starts as empty collection~ +- Inside source: true +*** True Line Result + result = [] # starts as empty collection +** Processing line: ~ points = points_on_line start_x, start_y, rise, run, distance # calls points_on_line method~ +- Inside source: true +*** True Line Result + points = points_on_line start_x, start_y, rise, run, distance # calls points_on_line method +** Processing line: ~ points.each do |p| # for each point in collection~ +- Inside source: true +*** True Line Result + points.each do |p| # for each point in collection +** Processing line: ~ if cell_exists_lambda.call(p.x, p.y) # if the cell exists~ +- Inside source: true +*** True Line Result + if cell_exists_lambda.call(p.x, p.y) # if the cell exists +** Processing line: ~ result << p # add it to result collection~ +- Inside source: true +*** True Line Result + result << p # add it to result collection +** Processing line: ~ else # if cell does not exist~ +- Inside source: true +*** True Line Result + else # if cell does not exist +** Processing line: ~ return result # return result collection as it is~ +- Inside source: true +*** True Line Result + return result # return result collection as it is +** 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: ~ result # return result collection~ +- Inside source: true +*** True Line Result + result # return result collection +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Finds the coordinates of the points on the line by performing calculations~ +- Inside source: true +*** True Line Result + # Finds the coordinates of the points on the line by performing calculations +** Processing line: ~ def points_on_line start_x, start_y, rise, run, distance~ +- Inside source: true +*** True Line Result + def points_on_line start_x, start_y, rise, run, distance +** Processing line: ~ distance.times.map do |i| # perform an action~ +- Inside source: true +*** True Line Result + distance.times.map do |i| # perform an action +** Processing line: ~ [start_x + run * i, start_y + rise * i] # definition of point~ +- Inside source: true +*** True Line Result + [start_x + run * i, start_y + rise * i] # definition of point +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_canvas~ +- Inside source: true +*** True Line Result + def render_canvas +** Processing line: ~ return~ +- Inside source: true +*** True Line Result + return +** Processing line: ~ outputs.borders << state.canvas.map do |c| # on each element of canvas collection~ +- Inside source: true +*** True Line Result + outputs.borders << state.canvas.map do |c| # on each element of canvas collection +** Processing line: ~ c.border # outputs border~ +- Inside source: true +*** True Line Result + c.border # outputs border +** 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: ~ # Outputs the dungeon cells.~ +- Inside source: true +*** True Line Result + # Outputs the dungeon cells. +** Processing line: ~ def render_dungeon~ +- Inside source: true +*** True Line Result + def render_dungeon +** Processing line: ~ outputs.solids << [0, 0, grid.w, grid.h] # outputs black background for grid~ +- Inside source: true +*** True Line Result + outputs.solids << [0, 0, grid.w, grid.h] # outputs black background for grid +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Sets the alpha value (opacity) for each dungeon cell and calls the cell_border method.~ +- Inside source: true +*** True Line Result + # Sets the alpha value (opacity) for each dungeon cell and calls the cell_border method. +** Processing line: ~ outputs.borders << state.dungeon.map do |d| # for each element in dungeon collection~ +- Inside source: true +*** True Line Result + outputs.borders << state.dungeon.map do |d| # for each element in dungeon collection +** Processing line: ~ d.alpha += if d.is_visible # if cell is visible~ +- Inside source: true +*** True Line Result + d.alpha += if d.is_visible # if cell is visible +** Processing line: ~ 255.fdiv(30) # increment opacity (transparency)~ +- Inside source: true +*** True Line Result + 255.fdiv(30) # increment opacity (transparency) +** Processing line: ~ else # if cell is not visible~ +- Inside source: true +*** True Line Result + else # if cell is not visible +** Processing line: ~ 255.fdiv(600) * -1 # decrease opacity~ +- Inside source: true +*** True Line Result + 255.fdiv(600) * -1 # decrease opacity +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ d.alpha = d.alpha.cap_min_max(0, 255)~ +- Inside source: true +*** True Line Result + d.alpha = d.alpha.cap_min_max(0, 255) +** Processing line: ~ cell_border d.x, d.y, [*blue, d.alpha] # sets blue border using alpha value~ +- Inside source: true +*** True Line Result + cell_border d.x, d.y, [*blue, d.alpha] # sets blue border using alpha value +** Processing line: ~ end.reject_nil~ +- Inside source: true +*** True Line Result + end.reject_nil +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Sets definition of a cell border using the parameters~ +- Inside source: true +*** True Line Result + # Sets definition of a cell border using the parameters +** Processing line: ~ def cell_border x, y, color = nil~ +- Inside source: true +*** True Line Result + def cell_border x, y, color = nil +** Processing line: ~ [left_margin + x * grid_size,~ +- Inside source: true +*** True Line Result + [left_margin + x * grid_size, +** Processing line: ~ bottom_margin + y * grid_size,~ +- Inside source: true +*** True Line Result + bottom_margin + y * grid_size, +** Processing line: ~ grid_size,~ +- Inside source: true +*** True Line Result + grid_size, +** Processing line: ~ grid_size,~ +- Inside source: true +*** True Line Result + grid_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: ~ # Sets the values for the player and outputs it as a label~ +- Inside source: true +*** True Line Result + # Sets the values for the player and outputs it as a label +** Processing line: ~ def render_player~ +- Inside source: true +*** True Line Result + def render_player +** Processing line: ~ outputs.labels << [grid_x(state.x) + 20, # positions "@" text in center of grid square~ +- Inside source: true +*** True Line Result + outputs.labels << [grid_x(state.x) + 20, # positions "@" text in center of grid square +** Processing line: ~ grid_y(state.y) + 35,~ +- Inside source: true +*** True Line Result + grid_y(state.y) + 35, +** Processing line: ~ "@", # player is represented by a white "@" character~ +- Inside source: true +*** True Line Result + "@", # player is represented by a white "@" character +** Processing line: ~ 1, 1, *white]~ +- Inside source: true +*** True Line Result + 1, 1, *white] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def grid_x x~ +- Inside source: true +*** True Line Result + def grid_x x +** Processing line: ~ left_margin + x * grid_size # positions horizontally on grid~ +- Inside source: true +*** True Line Result + left_margin + x * grid_size # positions horizontally on grid +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def grid_y y~ +- Inside source: true +*** True Line Result + def grid_y y +** Processing line: ~ bottom_margin + y * grid_size # positions vertically on grid~ +- Inside source: true +*** True Line Result + bottom_margin + y * grid_size # positions vertically on grid +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Outputs enemies onto the screen.~ +- Inside source: true +*** True Line Result + # Outputs enemies onto the screen. +** Processing line: ~ def render_enemies~ +- Inside source: true +*** True Line Result + def render_enemies +** Processing line: ~ state.enemies.map do |e| # for each enemy in the collection~ +- Inside source: true +*** True Line Result + state.enemies.map do |e| # for each enemy in the collection +** Processing line: ~ alpha = 255 # set opacity (full transparency)~ +- Inside source: true +*** True Line Result + alpha = 255 # set opacity (full transparency) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Outputs an enemy using a label.~ +- Inside source: true +*** True Line Result + # Outputs an enemy using a label. +** Processing line: ~ outputs.labels << [~ +- Inside source: true +*** True Line Result + outputs.labels << [ +** Processing line: ~ left_margin + 20 + e.x * grid_size, # positions enemy's "r" text in center of grid square~ +- Inside source: true +*** True Line Result + left_margin + 20 + e.x * grid_size, # positions enemy's "r" text in center of grid square +** Processing line: ~ bottom_margin + 35 + e.y * grid_size,~ +- Inside source: true +*** True Line Result + bottom_margin + 35 + e.y * grid_size, +** Processing line: ~ "r", # enemy's text~ +- Inside source: true +*** True Line Result + "r", # enemy's text +** Processing line: ~ 1, 1, *white, alpha]~ +- Inside source: true +*** True Line Result + 1, 1, *white, alpha] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Creates a red border around an enemy.~ +- Inside source: true +*** True Line Result + # Creates a red border around an enemy. +** Processing line: ~ outputs.borders << [grid_x(e.x), grid_y(e.y), grid_size, grid_size, *red]~ +- Inside source: true +*** True Line Result + outputs.borders << [grid_x(e.x), grid_y(e.y), grid_size, grid_size, *red] +** 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: ~ #White labels are output for the cell coordinates of each element in the dungeon collection.~ +- Inside source: true +*** True Line Result + #White labels are output for the cell coordinates of each element in the dungeon collection. +** Processing line: ~ def print_cell_coordinates~ +- Inside source: true +*** True Line Result + def print_cell_coordinates +** Processing line: ~ return unless state.debug~ +- Inside source: true +*** True Line Result + return unless state.debug +** Processing line: ~ state.dungeon.each do |d|~ +- Inside source: true +*** True Line Result + state.dungeon.each do |d| +** Processing line: ~ outputs.labels << [grid_x(d.x) + 2,~ +- Inside source: true +*** True Line Result + outputs.labels << [grid_x(d.x) + 2, +** Processing line: ~ grid_y(d.y) - 2,~ +- Inside source: true +*** True Line Result + grid_y(d.y) - 2, +** Processing line: ~ "#{d.x},#{d.y}",~ +- Inside source: true +*** True Line Result + "#{d.x},#{d.y}", +** Processing line: ~ -2, 0, *white]~ +- Inside source: true +*** True Line Result + -2, 0, *white] +** 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: ~ # Adds new elements into the canvas collection and sets their values.~ +- Inside source: true +*** True Line Result + # Adds new elements into the canvas collection and sets their values. +** Processing line: ~ def calc_canvas~ +- Inside source: true +*** True Line Result + def calc_canvas +** Processing line: ~ return if state.canvas.length > 0 # return if canvas collection has at least one element~ +- Inside source: true +*** True Line Result + return if state.canvas.length > 0 # return if canvas collection has at least one element +** Processing line: ~ 15.times do |x| # 15 times perform an action~ +- Inside source: true +*** True Line Result + 15.times do |x| # 15 times perform an action +** Processing line: ~ 15.times do |y|~ +- Inside source: true +*** True Line Result + 15.times do |y| +** Processing line: ~ state.canvas << state.new_entity(:canvas) do |c| # declare canvas element as new entity~ +- Inside source: true +*** True Line Result + state.canvas << state.new_entity(:canvas) do |c| # declare canvas element as new entity +** Processing line: ~ c.x = x # set position~ +- Inside source: true +*** True Line Result + c.x = x # set position +** Processing line: ~ c.y = y~ +- Inside source: true +*** True Line Result + c.y = y +** Processing line: ~ c.border = [left_margin + x * grid_size,~ +- Inside source: true +*** True Line Result + c.border = [left_margin + x * grid_size, +** Processing line: ~ bottom_margin + y * grid_size,~ +- Inside source: true +*** True Line Result + bottom_margin + y * grid_size, +** Processing line: ~ grid_size,~ +- Inside source: true +*** True Line Result + grid_size, +** Processing line: ~ grid_size,~ +- Inside source: true +*** True Line Result + grid_size, +** Processing line: ~ *white, 30] # sets border definition~ +- Inside source: true +*** True Line Result + *white, 30] # sets border definition +** 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: ~ # Updates x and y values of the player, and updates player's line of sight~ +- Inside source: true +*** True Line Result + # Updates x and y values of the player, and updates player's line of sight +** Processing line: ~ def input_move~ +- Inside source: true +*** True Line Result + def input_move +** Processing line: ~ x, y, x_diff, y_diff = input_target_cell~ +- Inside source: true +*** True Line Result + x, y, x_diff, y_diff = input_target_cell +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return unless dungeon_cell_exists? x, y # player can't move there if a dungeon cell doesn't exist in that location~ +- Inside source: true +*** True Line Result + return unless dungeon_cell_exists? x, y # player can't move there if a dungeon cell doesn't exist in that location +** Processing line: ~ return if enemy_at x, y # player can't move there if there is an enemy in that location~ +- Inside source: true +*** True Line Result + return if enemy_at x, y # player can't move there if there is an enemy in that location +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ state.x += x_diff # increments x by x_diff (so player moves left or right)~ +- Inside source: true +*** True Line Result + state.x += x_diff # increments x by x_diff (so player moves left or right) +** Processing line: ~ state.y += y_diff # same with y and y_diff ( so player moves up or down)~ +- Inside source: true +*** True Line Result + state.y += y_diff # same with y and y_diff ( so player moves up or down) +** Processing line: ~ update_line_of_sight # updates visible cells~ +- Inside source: true +*** True Line Result + update_line_of_sight # updates visible cells +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def enemy_at x, y~ +- Inside source: true +*** True Line Result + def enemy_at x, y +** Processing line: ~ # Finds if coordinates exist in enemies collection and enemy is not dead~ +- Inside source: true +*** True Line Result + # Finds if coordinates exist in enemies collection and enemy is not dead +** Processing line: ~ state.enemies.find { |e| e.x == x && e.y == y && !e.is_dead }~ +- Inside source: true +*** True Line Result + state.enemies.find { |e| e.x == x && e.y == y && !e.is_dead } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #M oves the user based on their keyboard input and sets values for target cell~ +- Inside source: true +*** True Line Result + #M oves the user based on their keyboard input and sets values for target cell +** Processing line: ~ def input_target_cell~ +- Inside source: true +*** True Line Result + def input_target_cell +** Processing line: ~ if inputs.keyboard.key_down.up # if "up" key is in "down" state~ +- Inside source: true +*** True Line Result + if inputs.keyboard.key_down.up # if "up" key is in "down" state +** Processing line: ~ [state.x, state.y + 1, 0, 1] # user moves up~ +- Inside source: true +*** True Line Result + [state.x, state.y + 1, 0, 1] # user moves up +** Processing line: ~ elsif inputs.keyboard.key_down.down # if "down" key is pressed~ +- Inside source: true +*** True Line Result + elsif inputs.keyboard.key_down.down # if "down" key is pressed +** Processing line: ~ [state.x, state.y - 1, 0, -1] # user moves down~ +- Inside source: true +*** True Line Result + [state.x, state.y - 1, 0, -1] # user moves down +** Processing line: ~ elsif inputs.keyboard.key_down.left # if "left" key is pressed~ +- Inside source: true +*** True Line Result + elsif inputs.keyboard.key_down.left # if "left" key is pressed +** Processing line: ~ [state.x - 1, state.y, -1, 0] # user moves left~ +- Inside source: true +*** True Line Result + [state.x - 1, state.y, -1, 0] # user moves left +** Processing line: ~ elsif inputs.keyboard.key_down.right # if "right" key is pressed~ +- Inside source: true +*** True Line Result + elsif inputs.keyboard.key_down.right # if "right" key is pressed +** Processing line: ~ [state.x + 1, state.y, 1, 0] # user moves right~ +- Inside source: true +*** True Line Result + [state.x + 1, state.y, 1, 0] # user moves right +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ nil # otherwise, empty~ +- Inside source: true +*** True Line Result + nil # otherwise, empty +** 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: ~ # Goes through the canvas collection to find if the mouse was clicked inside of the borders of an element.~ +- Inside source: true +*** True Line Result + # Goes through the canvas collection to find if the mouse was clicked inside of the borders of an element. +** Processing line: ~ def input_click_map~ +- Inside source: true +*** True Line Result + def input_click_map +** Processing line: ~ return unless inputs.mouse.click # return unless the mouse is clicked~ +- Inside source: true +*** True Line Result + return unless inputs.mouse.click # return unless the mouse is clicked +** Processing line: ~ canvas_entry = state.canvas.find do |c| # find element from canvas collection that meets requirements~ +- Inside source: true +*** True Line Result + canvas_entry = state.canvas.find do |c| # find element from canvas collection that meets requirements +** Processing line: ~ inputs.mouse.click.inside_rect? c.border # find border that mouse was clicked inside of~ +- Inside source: true +*** True Line Result + inputs.mouse.click.inside_rect? c.border # find border that mouse was clicked inside of +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ puts canvas_entry # prints canvas_entry value~ +- Inside source: true +*** True Line Result + puts canvas_entry # prints canvas_entry value +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Sets the definition of a label using the parameters.~ +- Inside source: true +*** True Line Result + # Sets the definition of a label using the parameters. +** Processing line: ~ def label text, x, y, color = nil~ +- Inside source: true +*** True Line Result + def label text, x, y, color = nil +** Processing line: ~ color ||= white # color is initialized to white~ +- Inside source: true +*** True Line Result + color ||= white # color is initialized to white +** Processing line: ~ [x, y, text, 1, 1, *color] # sets label definition~ +- Inside source: true +*** True Line Result + [x, y, text, 1, 1, *color] # sets label definition +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def green~ +- Inside source: true +*** True Line Result + def green +** Processing line: ~ [60, 200, 100] # sets color saturation to shade of green~ +- Inside source: true +*** True Line Result + [60, 200, 100] # sets color saturation to shade of green +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def blue~ +- Inside source: true +*** True Line Result + def blue +** Processing line: ~ [50, 50, 210] # sets color saturation to shade of blue~ +- Inside source: true +*** True Line Result + [50, 50, 210] # sets color saturation to shade of blue +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def white~ +- Inside source: true +*** True Line Result + def white +** Processing line: ~ [255, 255, 255] # sets color saturation to white~ +- Inside source: true +*** True Line Result + [255, 255, 255] # sets color saturation to white +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def red~ +- Inside source: true +*** True Line Result + def red +** Processing line: ~ [230, 80, 80] # sets color saturation to shade of red~ +- Inside source: true +*** True Line Result + [230, 80, 80] # sets color saturation to shade of red +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def orange~ +- Inside source: true +*** True Line Result + def orange +** Processing line: ~ [255, 80, 60] # sets color saturation to shade of orange~ +- Inside source: true +*** True Line Result + [255, 80, 60] # sets color saturation to shade of orange +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def pink~ +- Inside source: true +*** True Line Result + def pink +** Processing line: ~ [255, 0, 200] # sets color saturation to shade of pink~ +- Inside source: true +*** True Line Result + [255, 0, 200] # sets color saturation to shade of pink +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def gray~ +- Inside source: true +*** True Line Result + def gray +** Processing line: ~ [75, 75, 75] # sets color saturation to shade of gray~ +- Inside source: true +*** True Line Result + [75, 75, 75] # sets color saturation to shade of gray +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Recolors the border using the parameters.~ +- Inside source: true +*** True Line Result + # Recolors the border using the parameters. +** Processing line: ~ def recolor_border border, r, g, b~ +- Inside source: true +*** True Line Result + def recolor_border border, r, g, b +** Processing line: ~ border[4] = r~ +- Inside source: true +*** True Line Result + border[4] = r +** Processing line: ~ border[5] = g~ +- Inside source: true +*** True Line Result + border[5] = g +** Processing line: ~ border[6] = b~ +- Inside source: true +*** True Line Result + border[6] = b +** Processing line: ~ border~ +- Inside source: true +*** True Line Result + border +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns a boolean value.~ +- Inside source: true +*** True Line Result + # Returns a boolean value. +** Processing line: ~ def visible? cell~ +- Inside source: true +*** True Line Result + def visible? cell +** Processing line: ~ # finds cell's coordinates inside visible_cells collections to determine if cell is visible~ +- Inside source: true +*** True Line Result + # finds cell's coordinates inside visible_cells collections to determine if cell is visible +** Processing line: ~ state.visible_cells.find { |c| c.x == cell.x && c.y == cell.y}~ +- Inside source: true +*** True Line Result + state.visible_cells.find { |c| c.x == cell.x && c.y == cell.y} +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Exports dungeon by printing dungeon cell coordinates~ +- Inside source: true +*** True Line Result + # Exports dungeon by printing dungeon cell coordinates +** Processing line: ~ def export_dungeon~ +- Inside source: true +*** True Line Result + def export_dungeon +** Processing line: ~ state.dungeon.each do |d| # on each element of dungeon collection~ +- Inside source: true +*** True Line Result + state.dungeon.each do |d| # on each element of dungeon collection +** Processing line: ~ puts "state.dungeon << [#{d.x}, #{d.y}]" # prints cell coordinates~ +- Inside source: true +*** True Line Result + puts "state.dungeon << [#{d.x}, #{d.y}]" # prints cell coordinates +** 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 distance_to_cell cell~ +- Inside source: true +*** True Line Result + def distance_to_cell cell +** Processing line: ~ distance_to state.x, cell.x, state.y, cell.y # calls distance_to method~ +- Inside source: true +*** True Line Result + distance_to state.x, cell.x, state.y, cell.y # calls distance_to method +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def distance_to from_x, x, from_y, y~ +- Inside source: true +*** True Line Result + def distance_to from_x, x, from_y, y +** Processing line: ~ (from_x - x).abs + (from_y - y).abs # finds distance between two cells using coordinates~ +- Inside source: true +*** True Line Result + (from_x - x).abs + (from_y - y).abs # finds distance between two cells using coordinates +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ $game = Game.new~ +- Inside source: true +*** True Line Result + $game = Game.new +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ $game.args = args~ +- Inside source: true +*** True Line Result + $game.args = args +** Processing line: ~ $game.state = args.state~ +- Inside source: true +*** True Line Result + $game.state = args.state +** Processing line: ~ $game.inputs = args.inputs~ +- Inside source: true +*** True Line Result + $game.inputs = args.inputs +** Processing line: ~ $game.outputs = args.outputs~ +- Inside source: true +*** True Line Result + $game.outputs = args.outputs +** Processing line: ~ $game.grid = args.grid~ +- Inside source: true +*** True Line Result + $game.grid = args.grid +** 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: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Tactical - Hexagonal Grid - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Tactical - Hexagonal Grid - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_tactical/hexagonal_grid/app/main.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_tactical/hexagonal_grid/app/main.rb +** Processing line: ~ class HexagonTileGame~ +- Inside source: true +*** True Line Result + class HexagonTileGame +** Processing line: ~ attr_gtk~ +- Inside source: true +*** True Line Result + attr_gtk +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def defaults~ +- Inside source: true +*** True Line Result + def defaults +** Processing line: ~ state.tile_scale = 1.3~ +- Inside source: true +*** True Line Result + state.tile_scale = 1.3 +** Processing line: ~ state.tile_size = 80~ +- Inside source: true +*** True Line Result + state.tile_size = 80 +** Processing line: ~ state.tile_w = Math.sqrt(3) * state.tile_size.half~ +- Inside source: true +*** True Line Result + state.tile_w = Math.sqrt(3) * state.tile_size.half +** Processing line: ~ state.tile_h = state.tile_size * 3/4~ +- Inside source: true +*** True Line Result + state.tile_h = state.tile_size * 3/4 +** Processing line: ~ state.tiles_x_count = 1280.idiv(state.tile_w) - 1~ +- Inside source: true +*** True Line Result + state.tiles_x_count = 1280.idiv(state.tile_w) - 1 +** Processing line: ~ state.tiles_y_count = 720.idiv(state.tile_h) - 1~ +- Inside source: true +*** True Line Result + state.tiles_y_count = 720.idiv(state.tile_h) - 1 +** Processing line: ~ state.world_width_px = state.tiles_x_count * state.tile_w~ +- Inside source: true +*** True Line Result + state.world_width_px = state.tiles_x_count * state.tile_w +** Processing line: ~ state.world_height_px = state.tiles_y_count * state.tile_h~ +- Inside source: true +*** True Line Result + state.world_height_px = state.tiles_y_count * state.tile_h +** Processing line: ~ state.world_x_offset = (1280 - state.world_width_px).half~ +- Inside source: true +*** True Line Result + state.world_x_offset = (1280 - state.world_width_px).half +** Processing line: ~ state.world_y_offset = (720 - state.world_height_px).half~ +- Inside source: true +*** True Line Result + state.world_y_offset = (720 - state.world_height_px).half +** Processing line: ~ state.tiles ||= state.tiles_x_count.map_with_ys(state.tiles_y_count) do |ordinal_x, ordinal_y|~ +- Inside source: true +*** True Line Result + state.tiles ||= state.tiles_x_count.map_with_ys(state.tiles_y_count) do |ordinal_x, ordinal_y| +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ ordinal_x: ordinal_x,~ +- Inside source: true +*** True Line Result + ordinal_x: ordinal_x, +** Processing line: ~ ordinal_y: ordinal_y,~ +- Inside source: true +*** True Line Result + ordinal_y: ordinal_y, +** Processing line: ~ offset_x: (ordinal_y.even?) ?~ +- Inside source: true +*** True Line Result + offset_x: (ordinal_y.even?) ? +** Processing line: ~ (state.world_x_offset + state.tile_w.half.half) :~ +- Inside source: true +*** True Line Result + (state.world_x_offset + state.tile_w.half.half) : +** Processing line: ~ (state.world_x_offset - state.tile_w.half.half),~ +- Inside source: true +*** True Line Result + (state.world_x_offset - state.tile_w.half.half), +** Processing line: ~ offset_y: state.world_y_offset,~ +- Inside source: true +*** True Line Result + offset_y: state.world_y_offset, +** Processing line: ~ w: state.tile_w,~ +- Inside source: true +*** True Line Result + w: state.tile_w, +** Processing line: ~ h: state.tile_h,~ +- Inside source: true +*** True Line Result + h: state.tile_h, +** Processing line: ~ type: :blank,~ +- Inside source: true +*** True Line Result + type: :blank, +** Processing line: ~ path: "sprites/hexagon-gray.png",~ +- Inside source: true +*** True Line Result + path: "sprites/hexagon-gray.png", +** Processing line: ~ a: 20~ +- Inside source: true +*** True Line Result + a: 20 +** Processing line: ~ }.associate do |h|~ +- Inside source: true +*** True Line Result + }.associate do |h| +** Processing line: ~ h.merge(x: h[:offset_x] + h[:ordinal_x] * h[:w],~ +- Inside source: true +*** True Line Result + h.merge(x: h[:offset_x] + h[:ordinal_x] * h[:w], +** Processing line: ~ y: h[:offset_y] + h[:ordinal_y] * h[:h]).scale_rect(state.tile_scale)~ +- Inside source: true +*** True Line Result + y: h[:offset_y] + h[:ordinal_y] * h[:h]).scale_rect(state.tile_scale) +** Processing line: ~ end.associate do |h|~ +- Inside source: true +*** True Line Result + end.associate do |h| +** Processing line: ~ h.merge(center: {~ +- Inside source: true +*** True Line Result + h.merge(center: { +** Processing line: ~ x: h[:x] + h[:w].half,~ +- Inside source: true +*** True Line Result + x: h[:x] + h[:w].half, +** Processing line: ~ y: h[:y] + h[:h].half~ +- Inside source: true +*** True Line Result + y: h[:y] + h[:h].half +** Processing line: ~ }, radius: [h[:w].half, h[:h].half].max)~ +- Inside source: true +*** True Line Result + }, radius: [h[:w].half, h[:h].half].max) +** 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 input~ +- Inside source: true +*** True Line Result + def input +** Processing line: ~ if inputs.click~ +- Inside source: true +*** True Line Result + if inputs.click +** Processing line: ~ tile = state.tiles.find { |t| inputs.click.point_inside_circle? t[:center], t[:radius] }~ +- Inside source: true +*** True Line Result + tile = state.tiles.find { |t| inputs.click.point_inside_circle? t[:center], t[:radius] } +** Processing line: ~ if tile~ +- Inside source: true +*** True Line Result + if tile +** Processing line: ~ tile[:a] = 255~ +- Inside source: true +*** True Line Result + tile[:a] = 255 +** Processing line: ~ tile[:path] = "sprites/hexagon-black.png"~ +- Inside source: true +*** True Line Result + tile[:path] = "sprites/hexagon-black.png" +** 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 tick~ +- Inside source: true +*** True Line Result + def tick +** Processing line: ~ defaults~ +- Inside source: true +*** True Line Result + defaults +** Processing line: ~ input~ +- Inside source: true +*** True Line Result + input +** Processing line: ~ render~ +- Inside source: true +*** True Line Result + render +** 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 << state.tiles~ +- Inside source: true +*** True Line Result + outputs.sprites << state.tiles +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ $game = HexagonTileGame.new~ +- Inside source: true +*** True Line Result + $game = HexagonTileGame.new +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ $game.args = args~ +- Inside source: true +*** True Line Result + $game.args = args +** Processing line: ~ $game.tick~ +- Inside source: true +*** True Line Result + $game.tick +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ $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: ~*** Rpg Tactical - Isometric Grid - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Tactical - Isometric Grid - main.rb +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ # ./samples/99_genre_rpg_tactical/isometric_grid/app/main.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_tactical/isometric_grid/app/main.rb +** Processing line: ~ class Isometric~ +- Inside source: true +*** True Line Result + class Isometric +** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs~ +- Inside source: true +*** True Line Result + attr_accessor :grid, :inputs, :state, :outputs +** 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: ~ calc~ +- Inside source: true +*** True Line Result + calc +** Processing line: ~ process_inputs~ +- Inside source: true +*** True Line Result + process_inputs +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def defaults~ +- Inside source: true +*** True Line Result + def defaults +** Processing line: ~ state.quantity ||= 6 #Size of grid~ +- Inside source: true +*** True Line Result + state.quantity ||= 6 #Size of grid +** Processing line: ~ state.tileSize ||= [262 / 2, 194 / 2] #width and heigth of orange tiles~ +- Inside source: true +*** True Line Result + state.tileSize ||= [262 / 2, 194 / 2] #width and heigth of orange tiles +** Processing line: ~ state.tileGrid ||= [] #Holds ordering of tiles~ +- Inside source: true +*** True Line Result + state.tileGrid ||= [] #Holds ordering of tiles +** Processing line: ~ state.currentSpriteLocation ||= -1 #Current Sprite hovering location~ +- Inside source: true +*** True Line Result + state.currentSpriteLocation ||= -1 #Current Sprite hovering location +** Processing line: ~ state.tileCords ||= [] #Physical, rendering cordinates~ +- Inside source: true +*** True Line Result + state.tileCords ||= [] #Physical, rendering cordinates +** Processing line: ~ state.initCords ||= [640 - (state.quantity / 2 * state.tileSize[0]), 330] #Location of tile (0, 0)~ +- Inside source: true +*** True Line Result + state.initCords ||= [640 - (state.quantity / 2 * state.tileSize[0]), 330] #Location of tile (0, 0) +** Processing line: ~ state.sideSize ||= [state.tileSize[0] / 2, 242 / 2] #Purple & green cube face size~ +- Inside source: true +*** True Line Result + state.sideSize ||= [state.tileSize[0] / 2, 242 / 2] #Purple & green cube face size +** Processing line: ~ state.mode ||= :delete #Switches between :delete and :insert~ +- Inside source: true +*** True Line Result + state.mode ||= :delete #Switches between :delete and :insert +** Processing line: ~ state.spriteSelection ||= [['river', 0, 0, 262 / 2, 194 / 2],~ +- Inside source: true +*** True Line Result + state.spriteSelection ||= [['river', 0, 0, 262 / 2, 194 / 2], +** Processing line: ~ ['mountain', 0, 0, 262 / 2, 245 / 2],~ +- Inside source: true +*** True Line Result + ['mountain', 0, 0, 262 / 2, 245 / 2], +** Processing line: ~ ['ocean', 0, 0, 262 / 2, 194 / 2]] #Storage for sprite information~ +- Inside source: true +*** True Line Result + ['ocean', 0, 0, 262 / 2, 194 / 2]] #Storage for sprite information +** Processing line: ~ #['name', deltaX, deltaY, sizeW, sizeH]~ +- Inside source: true +*** True Line Result + #['name', deltaX, deltaY, sizeW, sizeH] +** Processing line: ~ #^delta refers to distance from tile cords~ +- Inside source: true +*** True Line Result + #^delta refers to distance from tile cords +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #Orders tiles based on tile placement and fancy math. Very left: 0,0. Very bottom: quantity-1, 0, etc~ +- Inside source: true +*** True Line Result + #Orders tiles based on tile placement and fancy math. Very left: 0,0. Very bottom: quantity-1, 0, etc +** Processing line: ~ if state.tileGrid == []~ +- Inside source: true +*** True Line Result + if state.tileGrid == [] +** Processing line: ~ tempX = 0~ +- Inside source: true +*** True Line Result + tempX = 0 +** Processing line: ~ tempY = 0~ +- Inside source: true +*** True Line Result + tempY = 0 +** Processing line: ~ tempLeft = false~ +- Inside source: true +*** True Line Result + tempLeft = false +** Processing line: ~ tempRight = false~ +- Inside source: true +*** True Line Result + tempRight = false +** Processing line: ~ count = 0~ +- Inside source: true +*** True Line Result + count = 0 +** Processing line: ~ (state.quantity * state.quantity).times do~ +- Inside source: true +*** True Line Result + (state.quantity * state.quantity).times do +** Processing line: ~ if tempY == 0~ +- Inside source: true +*** True Line Result + if tempY == 0 +** Processing line: ~ tempLeft = true~ +- Inside source: true +*** True Line Result + tempLeft = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ if tempX == (state.quantity - 1)~ +- Inside source: true +*** True Line Result + if tempX == (state.quantity - 1) +** Processing line: ~ tempRight = true~ +- Inside source: true +*** True Line Result + tempRight = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ state.tileGrid.push([tempX, tempY, true, tempLeft, tempRight, count])~ +- Inside source: true +*** True Line Result + state.tileGrid.push([tempX, tempY, true, tempLeft, tempRight, count]) +** Processing line: ~ #orderX, orderY, exists?, leftSide, rightSide, order~ +- Inside source: true +*** True Line Result + #orderX, orderY, exists?, leftSide, rightSide, order +** Processing line: ~ tempX += 1~ +- Inside source: true +*** True Line Result + tempX += 1 +** Processing line: ~ if tempX == state.quantity~ +- Inside source: true +*** True Line Result + if tempX == state.quantity +** Processing line: ~ tempX = 0~ +- Inside source: true +*** True Line Result + tempX = 0 +** Processing line: ~ tempY += 1~ +- Inside source: true +*** True Line Result + tempY += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ tempLeft = false~ +- Inside source: true +*** True Line Result + tempLeft = false +** Processing line: ~ tempRight = false~ +- Inside source: true +*** True Line Result + tempRight = false +** Processing line: ~ count += 1~ +- Inside source: true +*** True Line Result + count += 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: ~ #Calculates physical cordinates for tiles~ +- Inside source: true +*** True Line Result + #Calculates physical cordinates for tiles +** Processing line: ~ if state.tileCords == []~ +- Inside source: true +*** True Line Result + if state.tileCords == [] +** Processing line: ~ state.tileCords = state.tileGrid.map do~ +- Inside source: true +*** True Line Result + state.tileCords = state.tileGrid.map do +** Processing line: ~ |val|~ +- Inside source: true +*** True Line Result + |val| +** Processing line: ~ x = (state.initCords[0]) + ((val[0] + val[1]) * state.tileSize[0] / 2)~ +- Inside source: true +*** True Line Result + x = (state.initCords[0]) + ((val[0] + val[1]) * state.tileSize[0] / 2) +** Processing line: ~ y = (state.initCords[1]) + (-1 * val[0] * state.tileSize[1] / 2) + (val[1] * state.tileSize[1] / 2)~ +- Inside source: true +*** True Line Result + y = (state.initCords[1]) + (-1 * val[0] * state.tileSize[1] / 2) + (val[1] * state.tileSize[1] / 2) +** Processing line: ~ [x, y, val[2], val[3], val[4], val[5], -1] #-1 represents sprite on top of tile. -1 for now~ +- Inside source: true +*** True Line Result + [x, y, val[2], val[3], val[4], val[5], -1] #-1 represents sprite on top of tile. -1 for now +** 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~ +- 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: ~ renderBackground~ +- Inside source: true +*** True Line Result + renderBackground +** Processing line: ~ renderLeft~ +- Inside source: true +*** True Line Result + renderLeft +** Processing line: ~ renderRight~ +- Inside source: true +*** True Line Result + renderRight +** Processing line: ~ renderTiles~ +- Inside source: true +*** True Line Result + renderTiles +** Processing line: ~ renderObjects~ +- Inside source: true +*** True Line Result + renderObjects +** Processing line: ~ renderLabels~ +- Inside source: true +*** True Line Result + renderLabels +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def renderBackground~ +- Inside source: true +*** True Line Result + def renderBackground +** Processing line: ~ outputs.solids << [0, 0, 1280, 720, 0, 0, 0] #Background color~ +- Inside source: true +*** True Line Result + outputs.solids << [0, 0, 1280, 720, 0, 0, 0] #Background color +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def renderLeft~ +- Inside source: true +*** True Line Result + def renderLeft +** Processing line: ~ #Shows the pink left cube face~ +- Inside source: true +*** True Line Result + #Shows the pink left cube face +** Processing line: ~ outputs.sprites << state.tileCords.map do~ +- Inside source: true +*** True Line Result + outputs.sprites << state.tileCords.map do +** Processing line: ~ |val|~ +- Inside source: true +*** True Line Result + |val| +** Processing line: ~ if val[2] == true && val[3] == true #Checks if the tile exists and right face needs to be rendered~ +- Inside source: true +*** True Line Result + if val[2] == true && val[3] == true #Checks if the tile exists and right face needs to be rendered +** Processing line: ~ [val[0], val[1] + (state.tileSize[1] / 2) - state.sideSize[1], state.sideSize[0],~ +- Inside source: true +*** True Line Result + [val[0], val[1] + (state.tileSize[1] / 2) - state.sideSize[1], state.sideSize[0], +** Processing line: ~ state.sideSize[1], 'sprites/leftSide.png']~ +- Inside source: true +*** True Line Result + state.sideSize[1], 'sprites/leftSide.png'] +** 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 renderRight~ +- Inside source: true +*** True Line Result + def renderRight +** Processing line: ~ #Shows the green right cube face~ +- Inside source: true +*** True Line Result + #Shows the green right cube face +** Processing line: ~ outputs.sprites << state.tileCords.map do~ +- Inside source: true +*** True Line Result + outputs.sprites << state.tileCords.map do +** Processing line: ~ |val|~ +- Inside source: true +*** True Line Result + |val| +** Processing line: ~ if val[2] == true && val[4] == true #Checks if it exists & checks if right face needs to be rendered~ +- Inside source: true +*** True Line Result + if val[2] == true && val[4] == true #Checks if it exists & checks if right face needs to be rendered +** Processing line: ~ [val[0] + state.tileSize[0] / 2, val[1] + (state.tileSize[1] / 2) - state.sideSize[1], state.sideSize[0],~ +- Inside source: true +*** True Line Result + [val[0] + state.tileSize[0] / 2, val[1] + (state.tileSize[1] / 2) - state.sideSize[1], state.sideSize[0], +** Processing line: ~ state.sideSize[1], 'sprites/rightSide.png']~ +- Inside source: true +*** True Line Result + state.sideSize[1], 'sprites/rightSide.png'] +** 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 renderTiles~ +- Inside source: true +*** True Line Result + def renderTiles +** Processing line: ~ #Shows the tile itself. Important that it's rendered after the two above!~ +- Inside source: true +*** True Line Result + #Shows the tile itself. Important that it's rendered after the two above! +** Processing line: ~ outputs.sprites << state.tileCords.map do~ +- Inside source: true +*** True Line Result + outputs.sprites << state.tileCords.map do +** Processing line: ~ |val|~ +- Inside source: true +*** True Line Result + |val| +** Processing line: ~ if val[2] == true #Chcekcs if tile needs to be rendered~ +- Inside source: true +*** True Line Result + if val[2] == true #Chcekcs if tile needs to be rendered +** Processing line: ~ if val[5] == state.currentSpriteLocation~ +- Inside source: true +*** True Line Result + if val[5] == state.currentSpriteLocation +** Processing line: ~ [val[0], val[1], state.tileSize[0], state.tileSize[1], 'sprites/selectedTile.png']~ +- Inside source: true +*** True Line Result + [val[0], val[1], state.tileSize[0], state.tileSize[1], 'sprites/selectedTile.png'] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ [val[0], val[1], state.tileSize[0], state.tileSize[1], 'sprites/tile.png']~ +- Inside source: true +*** True Line Result + [val[0], val[1], state.tileSize[0], state.tileSize[1], 'sprites/tile.png'] +** 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 renderObjects~ +- Inside source: true +*** True Line Result + def renderObjects +** Processing line: ~ #Renders the sprites on top of the tiles. Order of rendering: top corner to right corner and cascade down until left corner~ +- Inside source: true +*** True Line Result + #Renders the sprites on top of the tiles. Order of rendering: top corner to right corner and cascade down until left corner +** Processing line: ~ #to bottom corner.~ +- Inside source: true +*** True Line Result + #to bottom corner. +** Processing line: ~ a = (state.quantity * state.quantity) - state.quantity~ +- Inside source: true +*** True Line Result + a = (state.quantity * state.quantity) - state.quantity +** Processing line: ~ iter = 0~ +- Inside source: true +*** True Line Result + iter = 0 +** Processing line: ~ loop do~ +- Inside source: true +*** True Line Result + loop do +** Processing line: ~ if state.tileCords[a][2] == true && state.tileCords[a][6] != -1~ +- Inside source: true +*** True Line Result + if state.tileCords[a][2] == true && state.tileCords[a][6] != -1 +** Processing line: ~ outputs.sprites << [state.tileCords[a][0] + state.spriteSelection[state.tileCords[a][6]][1],~ +- Inside source: true +*** True Line Result + outputs.sprites << [state.tileCords[a][0] + state.spriteSelection[state.tileCords[a][6]][1], +** Processing line: ~ state.tileCords[a][1] + state.spriteSelection[state.tileCords[a][6]][2],~ +- Inside source: true +*** True Line Result + state.tileCords[a][1] + state.spriteSelection[state.tileCords[a][6]][2], +** Processing line: ~ state.spriteSelection[state.tileCords[a][6]][3], state.spriteSelection[state.tileCords[a][6]][4],~ +- Inside source: true +*** True Line Result + state.spriteSelection[state.tileCords[a][6]][3], state.spriteSelection[state.tileCords[a][6]][4], +** Processing line: ~ 'sprites/' + state.spriteSelection[state.tileCords[a][6]][0] + '.png']~ +- Inside source: true +*** True Line Result + 'sprites/' + state.spriteSelection[state.tileCords[a][6]][0] + '.png'] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ iter += 1~ +- Inside source: true +*** True Line Result + iter += 1 +** Processing line: ~ a += 1~ +- Inside source: true +*** True Line Result + a += 1 +** Processing line: ~ a -= state.quantity * 2 if iter == state.quantity~ +- Inside source: true +*** True Line Result + a -= state.quantity * 2 if iter == state.quantity +** Processing line: ~ iter = 0 if iter == state.quantity~ +- Inside source: true +*** True Line Result + iter = 0 if iter == state.quantity +** Processing line: ~ break if a < 0~ +- Inside source: true +*** True Line Result + break if a < 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def renderLabels~ +- Inside source: true +*** True Line Result + def renderLabels +** Processing line: ~ #Labels~ +- Inside source: true +*** True Line Result + #Labels +** Processing line: ~ outputs.labels << [50, 680, 'Click to delete!', 5, 0, 255, 255, 255, 255] if state.mode == :delete~ +- Inside source: true +*** True Line Result + outputs.labels << [50, 680, 'Click to delete!', 5, 0, 255, 255, 255, 255] if state.mode == :delete +** Processing line: ~ outputs.labels << [50, 640, 'Press \'i\' for insert mode!', 5, 0, 255, 255, 255, 255] if state.mode == :delete~ +- Inside source: true +*** True Line Result + outputs.labels << [50, 640, 'Press \'i\' for insert mode!', 5, 0, 255, 255, 255, 255] if state.mode == :delete +** Processing line: ~ outputs.labels << [50, 680, 'Click to insert!', 5, 0, 255, 255, 255, 255] if state.mode == :insert~ +- Inside source: true +*** True Line Result + outputs.labels << [50, 680, 'Click to insert!', 5, 0, 255, 255, 255, 255] if state.mode == :insert +** Processing line: ~ outputs.labels << [50, 640, 'Press \'d\' for delete mode!', 5, 0, 255, 255, 255, 255] if state.mode == :insert~ +- Inside source: true +*** True Line Result + outputs.labels << [50, 640, 'Press \'d\' for delete mode!', 5, 0, 255, 255, 255, 255] if state.mode == :insert +** 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: ~ calcCurrentHover~ +- Inside source: true +*** True Line Result + calcCurrentHover +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calcCurrentHover~ +- Inside source: true +*** True Line Result + def calcCurrentHover +** Processing line: ~ #This determines what tile the mouse is hovering (or last hovering) over~ +- Inside source: true +*** True Line Result + #This determines what tile the mouse is hovering (or last hovering) over +** Processing line: ~ x = inputs.mouse.position.x~ +- Inside source: true +*** True Line Result + x = inputs.mouse.position.x +** Processing line: ~ y = inputs.mouse.position.y~ +- Inside source: true +*** True Line Result + y = inputs.mouse.position.y +** Processing line: ~ m = (state.tileSize[1] / state.tileSize[0]) #slope~ +- Inside source: true +*** True Line Result + m = (state.tileSize[1] / state.tileSize[0]) #slope +** Processing line: ~ state.tileCords.map do~ +- Inside source: true +*** True Line Result + state.tileCords.map do +** Processing line: ~ |val|~ +- Inside source: true +*** True Line Result + |val| +** Processing line: ~ #Conditions that makes runtime faster. Checks if the mouse click was between tile dimensions (rectangle collision)~ +- Inside source: true +*** True Line Result + #Conditions that makes runtime faster. Checks if the mouse click was between tile dimensions (rectangle collision) +** Processing line: ~ next unless val[0] < x && x < val[0] + state.tileSize[0]~ +- Inside source: true +*** True Line Result + next unless val[0] < x && x < val[0] + state.tileSize[0] +** Processing line: ~ next unless val[1] < y && y < val[1] + state.tileSize[1]~ +- Inside source: true +*** True Line Result + next unless val[1] < y && y < val[1] + state.tileSize[1] +** Processing line: ~ next unless val[2] == true~ +- Inside source: true +*** True Line Result + next unless val[2] == true +** Processing line: ~ tempBool = false~ +- Inside source: true +*** True Line Result + tempBool = false +** Processing line: ~ if x == val[0] + (state.tileSize[0] / 2)~ +- Inside source: true +*** True Line Result + if x == val[0] + (state.tileSize[0] / 2) +** Processing line: ~ #The height of a diamond is the height of the diamond, so if x equals that exact point, it must be inside the diamond~ +- Inside source: true +*** True Line Result + #The height of a diamond is the height of the diamond, so if x equals that exact point, it must be inside the diamond +** Processing line: ~ tempBool = true~ +- Inside source: true +*** True Line Result + tempBool = true +** Processing line: ~ elsif x < state.tileSize[0] / 2 + val[0]~ +- Inside source: true +*** True Line Result + elsif x < state.tileSize[0] / 2 + val[0] +** Processing line: ~ #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the left half of diamond~ +- Inside source: true +*** True Line Result + #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the left half of diamond +** Processing line: ~ tempY1 = (m * (x - val[0])) + val[1] + (state.tileSize[1] / 2)~ +- Inside source: true +*** True Line Result + tempY1 = (m * (x - val[0])) + val[1] + (state.tileSize[1] / 2) +** Processing line: ~ tempY2 = (-1 * m * (x - val[0])) + val[1] + (state.tileSize[1] / 2)~ +- Inside source: true +*** True Line Result + tempY2 = (-1 * m * (x - val[0])) + val[1] + (state.tileSize[1] / 2) +** Processing line: ~ #Checks to see if the mouse click y value is between those temp y values~ +- Inside source: true +*** True Line Result + #Checks to see if the mouse click y value is between those temp y values +** Processing line: ~ tempBool = true if y < tempY1 && y > tempY2~ +- Inside source: true +*** True Line Result + tempBool = true if y < tempY1 && y > tempY2 +** Processing line: ~ elsif x > state.tileSize[0] / 2 + val[0]~ +- Inside source: true +*** True Line Result + elsif x > state.tileSize[0] / 2 + val[0] +** Processing line: ~ #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the right half of diamond~ +- Inside source: true +*** True Line Result + #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the right half of diamond +** Processing line: ~ tempY1 = (m * (x - val[0] - (state.tileSize[0] / 2))) + val[1]~ +- Inside source: true +*** True Line Result + tempY1 = (m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] +** Processing line: ~ tempY2 = (-1 * m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] + state.tileSize[1]~ +- Inside source: true +*** True Line Result + tempY2 = (-1 * m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] + state.tileSize[1] +** Processing line: ~ #Checks to see if the mouse click y value is between those temp y values~ +- Inside source: true +*** True Line Result + #Checks to see if the mouse click y value is between those temp y values +** Processing line: ~ tempBool = true if y > tempY1 && y < tempY2~ +- Inside source: true +*** True Line Result + tempBool = true if y > tempY1 && y < tempY2 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if tempBool == true~ +- Inside source: true +*** True Line Result + if tempBool == true +** Processing line: ~ state.currentSpriteLocation = val[5] #Current sprite location set to the order value~ +- Inside source: true +*** True Line Result + state.currentSpriteLocation = val[5] #Current sprite location set to the order value +** 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 process_inputs~ +- Inside source: true +*** True Line Result + def process_inputs +** Processing line: ~ #Makes development much faster and easier~ +- Inside source: true +*** True Line Result + #Makes development much faster and easier +** Processing line: ~ if inputs.keyboard.key_up.r~ +- Inside source: true +*** True Line Result + if inputs.keyboard.key_up.r +** Processing line: ~ $dragon.reset~ +- Inside source: true +*** True Line Result + $dragon.reset +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ checkTileSelected~ +- Inside source: true +*** True Line Result + checkTileSelected +** Processing line: ~ switchModes~ +- Inside source: true +*** True Line Result + switchModes +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def checkTileSelected~ +- Inside source: true +*** True Line Result + def checkTileSelected +** Processing line: ~ if inputs.mouse.down~ +- Inside source: true +*** True Line Result + if inputs.mouse.down +** Processing line: ~ x = inputs.mouse.down.point.x~ +- Inside source: true +*** True Line Result + x = inputs.mouse.down.point.x +** Processing line: ~ y = inputs.mouse.down.point.y~ +- Inside source: true +*** True Line Result + y = inputs.mouse.down.point.y +** Processing line: ~ m = (state.tileSize[1] / state.tileSize[0]) #slope~ +- Inside source: true +*** True Line Result + m = (state.tileSize[1] / state.tileSize[0]) #slope +** Processing line: ~ state.tileCords.map do~ +- Inside source: true +*** True Line Result + state.tileCords.map do +** Processing line: ~ |val|~ +- Inside source: true +*** True Line Result + |val| +** Processing line: ~ #Conditions that makes runtime faster. Checks if the mouse click was between tile dimensions (rectangle collision)~ +- Inside source: true +*** True Line Result + #Conditions that makes runtime faster. Checks if the mouse click was between tile dimensions (rectangle collision) +** Processing line: ~ next unless val[0] < x && x < val[0] + state.tileSize[0]~ +- Inside source: true +*** True Line Result + next unless val[0] < x && x < val[0] + state.tileSize[0] +** Processing line: ~ next unless val[1] < y && y < val[1] + state.tileSize[1]~ +- Inside source: true +*** True Line Result + next unless val[1] < y && y < val[1] + state.tileSize[1] +** Processing line: ~ next unless val[2] == true~ +- Inside source: true +*** True Line Result + next unless val[2] == true +** Processing line: ~ tempBool = false~ +- Inside source: true +*** True Line Result + tempBool = false +** Processing line: ~ if x == val[0] + (state.tileSize[0] / 2)~ +- Inside source: true +*** True Line Result + if x == val[0] + (state.tileSize[0] / 2) +** Processing line: ~ #The height of a diamond is the height of the diamond, so if x equals that exact point, it must be inside the diamond~ +- Inside source: true +*** True Line Result + #The height of a diamond is the height of the diamond, so if x equals that exact point, it must be inside the diamond +** Processing line: ~ tempBool = true~ +- Inside source: true +*** True Line Result + tempBool = true +** Processing line: ~ elsif x < state.tileSize[0] / 2 + val[0]~ +- Inside source: true +*** True Line Result + elsif x < state.tileSize[0] / 2 + val[0] +** Processing line: ~ #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the left half of diamond~ +- Inside source: true +*** True Line Result + #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the left half of diamond +** Processing line: ~ tempY1 = (m * (x - val[0])) + val[1] + (state.tileSize[1] / 2)~ +- Inside source: true +*** True Line Result + tempY1 = (m * (x - val[0])) + val[1] + (state.tileSize[1] / 2) +** Processing line: ~ tempY2 = (-1 * m * (x - val[0])) + val[1] + (state.tileSize[1] / 2)~ +- Inside source: true +*** True Line Result + tempY2 = (-1 * m * (x - val[0])) + val[1] + (state.tileSize[1] / 2) +** Processing line: ~ #Checks to see if the mouse click y value is between those temp y values~ +- Inside source: true +*** True Line Result + #Checks to see if the mouse click y value is between those temp y values +** Processing line: ~ tempBool = true if y < tempY1 && y > tempY2~ +- Inside source: true +*** True Line Result + tempBool = true if y < tempY1 && y > tempY2 +** Processing line: ~ elsif x > state.tileSize[0] / 2 + val[0]~ +- Inside source: true +*** True Line Result + elsif x > state.tileSize[0] / 2 + val[0] +** Processing line: ~ #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the right half of diamond~ +- Inside source: true +*** True Line Result + #Uses y = (m) * (x - x1) + y1 to determine the y values for the two diamond lines on the right half of diamond +** Processing line: ~ tempY1 = (m * (x - val[0] - (state.tileSize[0] / 2))) + val[1]~ +- Inside source: true +*** True Line Result + tempY1 = (m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] +** Processing line: ~ tempY2 = (-1 * m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] + state.tileSize[1]~ +- Inside source: true +*** True Line Result + tempY2 = (-1 * m * (x - val[0] - (state.tileSize[0] / 2))) + val[1] + state.tileSize[1] +** Processing line: ~ #Checks to see if the mouse click y value is between those temp y values~ +- Inside source: true +*** True Line Result + #Checks to see if the mouse click y value is between those temp y values +** Processing line: ~ tempBool = true if y > tempY1 && y < tempY2~ +- Inside source: true +*** True Line Result + tempBool = true if y > tempY1 && y < tempY2 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if tempBool == true~ +- Inside source: true +*** True Line Result + if tempBool == true +** Processing line: ~ if state.mode == :delete~ +- Inside source: true +*** True Line Result + if state.mode == :delete +** Processing line: ~ val[2] = false~ +- Inside source: true +*** True Line Result + val[2] = false +** Processing line: ~ state.tileGrid[val[5]][2] = false #Unnecessary because never used again but eh, I like consistency~ +- Inside source: true +*** True Line Result + state.tileGrid[val[5]][2] = false #Unnecessary because never used again but eh, I like consistency +** Processing line: ~ state.tileCords[val[5]][2] = false #Ensures that the tile isn't rendered~ +- Inside source: true +*** True Line Result + state.tileCords[val[5]][2] = false #Ensures that the tile isn't rendered +** Processing line: ~ unless state.tileGrid[val[5]][0] == 0 #If tile is the left most tile in the row, right doesn't get rendered~ +- Inside source: true +*** True Line Result + unless state.tileGrid[val[5]][0] == 0 #If tile is the left most tile in the row, right doesn't get rendered +** Processing line: ~ state.tileGrid[val[5] - 1][4] = true #Why the order value is amazing~ +- Inside source: true +*** True Line Result + state.tileGrid[val[5] - 1][4] = true #Why the order value is amazing +** Processing line: ~ state.tileCords[val[5] - 1][4] = true~ +- Inside source: true +*** True Line Result + state.tileCords[val[5] - 1][4] = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ unless state.tileGrid[val[5]][1] == state.quantity - 1 #Same but left side~ +- Inside source: true +*** True Line Result + unless state.tileGrid[val[5]][1] == state.quantity - 1 #Same but left side +** Processing line: ~ state.tileGrid[val[5] + state.quantity][3] = true~ +- Inside source: true +*** True Line Result + state.tileGrid[val[5] + state.quantity][3] = true +** Processing line: ~ state.tileCords[val[5] + state.quantity][3] = true~ +- Inside source: true +*** True Line Result + state.tileCords[val[5] + state.quantity][3] = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ elsif state.mode == :insert~ +- Inside source: true +*** True Line Result + elsif state.mode == :insert +** Processing line: ~ #adds the current sprite value selected to tileCords. (changes from the -1 earlier)~ +- Inside source: true +*** True Line Result + #adds the current sprite value selected to tileCords. (changes from the -1 earlier) +** Processing line: ~ val[6] = rand(state.spriteSelection.length)~ +- Inside source: true +*** True Line Result + val[6] = rand(state.spriteSelection.length) +** 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: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def switchModes~ +- Inside source: true +*** True Line Result + def switchModes +** Processing line: ~ #Switches between insert and delete modes~ +- Inside source: true +*** True Line Result + #Switches between insert and delete modes +** Processing line: ~ if inputs.keyboard.key_up.i && state.mode == :delete~ +- Inside source: true +*** True Line Result + if inputs.keyboard.key_up.i && state.mode == :delete +** Processing line: ~ state.mode = :insert~ +- Inside source: true +*** True Line Result + state.mode = :insert +** Processing line: ~ inputs.keyboard.clear~ +- Inside source: true +*** True Line Result + inputs.keyboard.clear +** Processing line: ~ elsif inputs.keyboard.key_up.d && state.mode == :insert~ +- Inside source: true +*** True Line Result + elsif inputs.keyboard.key_up.d && state.mode == :insert +** Processing line: ~ state.mode = :delete~ +- Inside source: true +*** True Line Result + state.mode = :delete +** Processing line: ~ inputs.keyboard.clear~ +- Inside source: true +*** True Line Result + inputs.keyboard.clear +** 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~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ $isometric = Isometric.new~ +- Inside source: true +*** True Line Result + $isometric = Isometric.new +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ $isometric.grid = args.grid~ +- Inside source: true +*** True Line Result + $isometric.grid = args.grid +** Processing line: ~ $isometric.inputs = args.inputs~ +- Inside source: true +*** True Line Result + $isometric.inputs = args.inputs +** Processing line: ~ $isometric.state = args.state~ +- Inside source: true +*** True Line Result + $isometric.state = args.state +** Processing line: ~ $isometric.outputs = args.outputs~ +- Inside source: true +*** True Line Result + $isometric.outputs = args.outputs +** Processing line: ~ $isometric.tick~ +- Inside source: true +*** True Line Result + $isometric.tick +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** Rpg Topdown - Topdown Starting Point - main.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Rpg Topdown - Topdown 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_rpg_topdown/topdown_starting_point/app/main.rb~ +- Inside source: true +*** True Line Result + # ./samples/99_genre_rpg_topdown/topdown_starting_point/app/main.rb +** Processing line: ~ =begin~ +- Inside source: true +*** True Line Result + =begin +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +- Inside source: true +*** True Line Result + APIs listing that haven't been encountered in previous sample apps: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - reverse: Returns a new string with the characters from original string in reverse order.~ +- Inside source: true +*** True Line Result + - reverse: Returns a new string with the characters from original string in reverse order. +** Processing line: ~ For example, the command~ +- Inside source: true +*** True Line Result + For example, the command +** Processing line: ~ "dragonruby".reverse~ +- Inside source: true +*** True Line Result + "dragonruby".reverse +** Processing line: ~ would return the string~ +- Inside source: true +*** True Line Result + would return the string +** Processing line: ~ "yburnogard".~ +- Inside source: true +*** True Line Result + "yburnogard". +** Processing line: ~ Reverse is not only limited to strings, but can be applied to arrays and other collections.~ +- Inside source: true +*** True Line Result + Reverse is not only limited to strings, but can be applied to arrays and other collections. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Reminders:~ +- Inside source: true +*** True Line Result + Reminders: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect.~ +- Inside source: true +*** True Line Result + - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ +- Inside source: true +*** True Line Result + - args.outputs.labels: An array. The values generate a label. +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +- Inside source: true +*** True Line Result + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +- Inside source: true +*** True Line Result + For more information about labels, go to mygame/documentation/02-labels.md. +** 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: ~ # This code shows a maze and uses input from the keyboard to move the user around the screen.~ +- Inside source: true +*** True Line Result + # This code shows a maze and uses input from the keyboard to move the user around the screen. +** Processing line: ~ # The objective is to reach the goal.~ +- Inside source: true +*** True Line Result + # The objective is to reach the goal. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Sets values of tile size and player's movement speed~ +- Inside source: true +*** True Line Result + # Sets values of tile size and player's movement speed +** Processing line: ~ # Also creates tile or box for player and generates map~ +- Inside source: true +*** True Line Result + # Also creates tile or box for player and generates map +** 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: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Adds walls, goal, and player to args.outputs.solids so they appear on screen~ +- Inside source: true +*** True Line Result + # Adds walls, goal, and player to args.outputs.solids so they appear on screen +** 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.goal~ +- Inside source: true +*** True Line Result + args.outputs.solids << args.state.goal +** Processing line: ~ args.outputs.solids << args.state.player~ +- Inside source: true +*** True Line Result + args.outputs.solids << args.state.player +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # If player's box intersects with goal, a label is output onto the screen~ +- Inside source: true +*** True Line Result + # If player's box intersects with goal, a label is output onto the screen +** Processing line: ~ if args.state.player.intersect_rect? args.state.goal~ +- Inside source: true +*** True Line Result + if args.state.player.intersect_rect? args.state.goal +** Processing line: ~ args.outputs.labels << [30, 720 - 30, "You're a wizard Harry!!"] # 30 pixels lower than top of screen~ +- Inside source: true +*** True Line Result + args.outputs.labels << [30, 720 - 30, "You're a wizard Harry!!"] # 30 pixels lower than top of screen +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** 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, 0, 0, 1, 1, 1, 1, 1, 1, 1,],~ +- Inside source: true +*** True Line Result + [1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1,], +** Processing line: ~ [1, 1, 1, 2, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1,], # the "2" represents the goal~ +- Inside source: true +*** True Line Result + [1, 1, 1, 2, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1,], # the "2" represents the goal +** Processing line: ~ [1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,],~ +- Inside source: true +*** True Line Result + [1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,], +** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,],~ +- Inside source: true +*** True Line Result + [1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,], +** Processing line: ~ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],~ +- Inside source: true +*** True Line Result + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,], +** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,],~ +- Inside source: true +*** True Line Result + [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,], +** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,],~ +- Inside source: true +*** True Line Result + [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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: ~ [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: ~~ +- 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, 0, 255, 0) # green tile~ +- Inside source: true +*** True Line Result + args.state.walls << tile(args, x, y, 0, 255, 0) # green tile +** Processing line: ~ elsif v == 2 # notice there is only one "2" above because there is only one single goal~ +- Inside source: true +*** True Line Result + elsif v == 2 # notice there is only one "2" above because there is only one single goal +** Processing line: ~ args.state.goal = tile(args, x, y, 0, 0, 0) # black tile~ +- Inside source: true +*** True Line Result + args.state.goal = tile(args, x, y, 0, 0, 0) # black 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: ~** OSS~ +- Header detected. +*** True Line Result + +*** True Line Result +** OSS +** Processing line: ~Follows is a source code listing for all files that have been open sourced. This code can be found online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]].~ +** Processing line: ~*** args.rb~ +- Header detected. +*** True Line Result +Follows is a source code listing for all files that have been open sourced. This code can be found online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]]. +*** True Line Result +*** args.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/args.rb~ +- Inside source: true +*** True Line Result + # ./dragon/args.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # args.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # args.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ # This class is the one you'll interact with the most. It's~ +- Inside source: true +*** True Line Result + # This class is the one you'll interact with the most. It's +** Processing line: ~ # constructed by the DragonRuby Runtime and is provided to you on~ +- Inside source: true +*** True Line Result + # constructed by the DragonRuby Runtime and is provided to you on +** Processing line: ~ # each tick.~ +- Inside source: true +*** True Line Result + # each tick. +** Processing line: ~ class Args~ +- Inside source: true +*** True Line Result + class Args +** Processing line: ~ include ArgsDeprecated~ +- Inside source: true +*** True Line Result + include ArgsDeprecated +** Processing line: ~ include Serialize~ +- 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: ~~ +- 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] +** Processing line: ~ attr_accessor :runtime~ +- Inside source: true +*** True Line Result + attr_accessor :runtime +** Processing line: ~ alias_method :gtk, :runtime~ +- 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 + attr_accessor :string +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize runtime, recording~ +- Inside source: true +*** True Line Result + def initialize runtime, recording +** Processing line: ~ @inputs = Inputs.new~ +- Inside source: true +*** True Line Result + @inputs = Inputs.new +** Processing line: ~ @outputs = Outputs.new args: self~ +- Inside source: true +*** True Line Result + @outputs = Outputs.new args: self +** Processing line: ~ @audio = {}~ +- Inside source: true +*** True Line Result + @audio = {} +** Processing line: ~ @passes = []~ +- Inside source: true +*** True Line Result + @passes = [] +** Processing line: ~ @state = OpenEntity.new~ +- Inside source: true +*** True Line Result + @state = OpenEntity.new +** Processing line: ~ @state.tick_count = -1~ +- Inside source: true +*** True Line Result + @state.tick_count = -1 +** Processing line: ~ @runtime = runtime~ +- Inside source: true +*** True Line Result + @runtime = runtime +** Processing line: ~ @recording = recording~ +- Inside source: true +*** True Line Result + @recording = recording +** Processing line: ~ @grid = Grid.new runtime~ +- Inside source: true +*** True Line Result + @grid = Grid.new runtime +** Processing line: ~ @render_targets = {}~ +- Inside source: true +*** True Line Result + @render_targets = {} +** Processing line: ~ @pixel_arrays = {}~ +- Inside source: true +*** True Line Result + @pixel_arrays = {} +** Processing line: ~ @all_tests = []~ +- Inside source: true +*** True Line Result + @all_tests = [] +** Processing line: ~ @geometry = GTK::Geometry~ +- Inside source: true +*** True Line Result + @geometry = GTK::Geometry +** Processing line: ~ @fn = GTK::Fn~ +- Inside source: true +*** True Line Result + @fn = GTK::Fn +** Processing line: ~ @wizards = Wizards.new~ +- Inside source: true +*** True Line Result + @wizards = Wizards.new +** Processing line: ~ @layout = GTK::Layout.new @grid.w, @grid.h~ +- Inside source: true +*** True Line Result + @layout = GTK::Layout.new @grid.w, @grid.h +** Processing line: ~ @easing = GTK::Easing~ +- Inside source: true +*** True Line Result + @easing = GTK::Easing +** Processing line: ~ @string = String~ +- Inside source: true +*** True Line Result + @string = String +** 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: ~ # The number of ticks since the start of the game.~ +- Inside source: true +*** True Line Result + # The number of ticks since the start of the game. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Integer]~ +- Inside source: true +*** True Line Result + # @return [Integer] +** Processing line: ~ def tick_count~ +- Inside source: true +*** True Line Result + def tick_count +** Processing line: ~ @state.tick_count~ +- Inside source: true +*** True Line Result + @state.tick_count +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick_count= value~ +- Inside source: true +*** True Line Result + def tick_count= value +** Processing line: ~ @state.tick_count = value~ +- Inside source: true +*** True Line Result + @state.tick_count = value +** 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 + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ state: state.as_hash,~ +- Inside source: true +*** True Line Result + state: state.as_hash, +** Processing line: ~ inputs: inputs.serialize,~ +- Inside source: true +*** True Line Result + inputs: inputs.serialize, +** Processing line: ~ passes: passes.serialize,~ +- Inside source: true +*** True Line Result + passes: passes.serialize, +** Processing line: ~ outputs: outputs.serialize,~ +- Inside source: true +*** True Line Result + outputs: outputs.serialize, +** Processing line: ~ grid: grid.serialize~ +- Inside source: true +*** True Line Result + grid: grid.serialize +** 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 destructure~ +- Inside source: true +*** True Line Result + def destructure +** Processing line: ~ [grid, inputs, state, outputs, runtime, passes]~ +- Inside source: true +*** True Line Result + [grid, inputs, state, outputs, runtime, passes] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def clear_pixel_arrays~ +- Inside source: true +*** True Line Result + def clear_pixel_arrays +** Processing line: ~ pixel_arrays_clear~ +- Inside source: true +*** True Line Result + pixel_arrays_clear +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def pixel_arrays_clear~ +- Inside source: true +*** True Line Result + def pixel_arrays_clear +** Processing line: ~ @pixel_arrays = {}~ +- Inside source: true +*** True Line Result + @pixel_arrays = {} +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def pixel_arrays~ +- Inside source: true +*** True Line Result + def pixel_arrays +** Processing line: ~ @pixel_arrays~ +- Inside source: true +*** True Line Result + @pixel_arrays +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def pixel_array name~ +- Inside source: true +*** True Line Result + def pixel_array name +** Processing line: ~ name = name.to_s~ +- Inside source: true +*** True Line Result + name = name.to_s +** Processing line: ~ if !@pixel_arrays[name]~ +- Inside source: true +*** True Line Result + if !@pixel_arrays[name] +** Processing line: ~ @pixel_arrays[name] = PixelArray.new~ +- Inside source: true +*** True Line Result + @pixel_arrays[name] = PixelArray.new +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ @pixel_arrays[name]~ +- Inside source: true +*** True Line Result + @pixel_arrays[name] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def clear_render_targets~ +- Inside source: true +*** True Line Result + def clear_render_targets +** Processing line: ~ render_targets_clear~ +- Inside source: true +*** True Line Result + render_targets_clear +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_targets_clear~ +- Inside source: true +*** True Line Result + def render_targets_clear +** Processing line: ~ @render_targets = {}~ +- Inside source: true +*** True Line Result + @render_targets = {} +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_targets~ +- Inside source: true +*** True Line Result + def render_targets +** Processing line: ~ @render_targets~ +- Inside source: true +*** True Line Result + @render_targets +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_target name~ +- Inside source: true +*** True Line Result + def render_target name +** Processing line: ~ name = name.to_s~ +- Inside source: true +*** True Line Result + name = name.to_s +** Processing line: ~ if !@render_targets[name]~ +- Inside source: true +*** True Line Result + if !@render_targets[name] +** Processing line: ~ @render_targets[name] = Outputs.new(args: self, target: name, background_color_override: [255, 255, 255, 0])~ +- Inside source: true +*** True Line Result + @render_targets[name] = Outputs.new(args: self, target: name, background_color_override: [255, 255, 255, 0]) +** Processing line: ~ @passes << @render_targets[name]~ +- Inside source: true +*** True Line Result + @passes << @render_targets[name] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ @render_targets[name]~ +- Inside source: true +*** True Line Result + @render_targets[name] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def solids~ +- Inside source: true +*** True Line Result + def solids +** Processing line: ~ @outputs.solids~ +- Inside source: true +*** True Line Result + @outputs.solids +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def static_solids~ +- Inside source: true +*** True Line Result + def static_solids +** Processing line: ~ @outputs.static_solids~ +- Inside source: true +*** True Line Result + @outputs.static_solids +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def sprites~ +- Inside source: true +*** True Line Result + def sprites +** Processing line: ~ @outputs.sprites~ +- Inside source: true +*** True Line Result + @outputs.sprites +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def static_sprites~ +- Inside source: true +*** True Line Result + def static_sprites +** Processing line: ~ @outputs.static_sprites~ +- Inside source: true +*** True Line Result + @outputs.static_sprites +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def labels~ +- Inside source: true +*** True Line Result + def labels +** Processing line: ~ @outputs.labels~ +- Inside source: true +*** True Line Result + @outputs.labels +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def static_labels~ +- Inside source: true +*** True Line Result + def static_labels +** Processing line: ~ @outputs.static_labels~ +- Inside source: true +*** True Line Result + @outputs.static_labels +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def lines~ +- Inside source: true +*** True Line Result + def lines +** Processing line: ~ @outputs.lines~ +- Inside source: true +*** True Line Result + @outputs.lines +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def static_lines~ +- Inside source: true +*** True Line Result + def static_lines +** Processing line: ~ @outputs.static_lines~ +- Inside source: true +*** True Line Result + @outputs.static_lines +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def borders~ +- Inside source: true +*** True Line Result + def borders +** Processing line: ~ @outputs.borders~ +- Inside source: true +*** True Line Result + @outputs.borders +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def static_borders~ +- Inside source: true +*** True Line Result + def static_borders +** Processing line: ~ @outputs.static_borders~ +- Inside source: true +*** True Line Result + @outputs.static_borders +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def primitives~ +- Inside source: true +*** True Line Result + def primitives +** Processing line: ~ @outputs.primitives~ +- Inside source: true +*** True Line Result + @outputs.primitives +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def static_primitives~ +- Inside source: true +*** True Line Result + def static_primitives +** Processing line: ~ @outputs.static_primitives~ +- Inside source: true +*** True Line Result + @outputs.static_primitives +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def keyboard~ +- Inside source: true +*** True Line Result + def keyboard +** Processing line: ~ @inputs.keyboard~ +- Inside source: true +*** True Line Result + @inputs.keyboard +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def click~ +- Inside source: true +*** True Line Result + def click +** Processing line: ~ return nil unless @inputs.mouse.click~ +- Inside source: true +*** True Line Result + return nil unless @inputs.mouse.click +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @inputs.mouse.click.point~ +- Inside source: true +*** True Line Result + @inputs.mouse.click.point +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def click_at~ +- Inside source: true +*** True Line Result + def click_at +** Processing line: ~ return nil unless @inputs.mouse.click~ +- Inside source: true +*** True Line Result + return nil unless @inputs.mouse.click +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @inputs.mouse.click.created_at~ +- Inside source: true +*** True Line Result + @inputs.mouse.click.created_at +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def mouse~ +- Inside source: true +*** True Line Result + def mouse +** Processing line: ~ @inputs.mouse~ +- Inside source: true +*** True Line Result + @inputs.mouse +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @see Inputs#controller_one~ +- Inside source: true +*** True Line Result + # @see Inputs#controller_one +** Processing line: ~ # @return (see Inputs#controller_one)~ +- Inside source: true +*** True Line Result + # @return (see Inputs#controller_one) +** Processing line: ~ def controller_one~ +- Inside source: true +*** True Line Result + def controller_one +** Processing line: ~ @inputs.controller_one~ +- Inside source: true +*** True Line Result + @inputs.controller_one +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @see Inputs#controller_two~ +- Inside source: true +*** True Line Result + # @see Inputs#controller_two +** Processing line: ~ # @return (see Inputs#controller_two)~ +- Inside source: true +*** True Line Result + # @return (see Inputs#controller_two) +** Processing line: ~ def controller_two~ +- Inside source: true +*** True Line Result + def controller_two +** Processing line: ~ @inputs.controller_two~ +- Inside source: true +*** True Line Result + @inputs.controller_two +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def autocomplete_methods~ +- Inside source: true +*** True Line Result + def autocomplete_methods +** Processing line: ~ [:inputs, :outputs, :gtk, :state, :geometry, :audio, :grid, :layout, :fn]~ +- Inside source: true +*** True Line Result + [:inputs, :outputs, :gtk, :state, :geometry, :audio, :grid, :layout, :fn] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** assert.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** assert.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/assert.rb~ +- Inside source: true +*** True Line Result + # ./dragon/assert.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # assert.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # assert.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ =begin~ +- Inside source: true +*** True Line Result + =begin +** Processing line: ~ This is a tiny assertion api for the unit testing portion of Game Toolkit.~ +- Inside source: true +*** True Line Result + This is a tiny assertion api for the unit testing portion of Game Toolkit. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @example~ +- Inside source: true +*** True Line Result + @example +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ 1. Create a file called tests.rb under mygame.~ +- Inside source: true +*** True Line Result + 1. Create a file called tests.rb under mygame. +** Processing line: ~ 2. Any method that begins with the word test_ will be considered a test.~ +- Inside source: true +*** True Line Result + 2. Any method that begins with the word test_ will be considered a test. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def test_this_works args, assert~ +- Inside source: true +*** True Line Result + def test_this_works args, assert +** Processing line: ~ assert.equal! 1, 1~ +- Inside source: true +*** True Line Result + assert.equal! 1, 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ 3. To run a test, save the file while the game is running.~ +- Inside source: true +*** True Line Result + 3. To run a test, save the file while the game is running. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @example~ +- Inside source: true +*** True Line Result + @example +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ To add an assertion open up this class and write:~ +- Inside source: true +*** True Line Result + To add an assertion open up this class and write: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ class Assert~ +- Inside source: true +*** True Line Result + class Assert +** Processing line: ~ def custom_assertion actual, expected, message = nil~ +- 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).~ +- Inside source: true +*** True Line Result + # this tell 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 + @assertion_performed = true +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # perform your custom logic here and rais 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. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ raise "Some Error. #{message}."~ +- Inside source: true +*** True Line Result + raise "Some Error. #{message}." +** 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: ~ class Assert~ +- Inside source: true +*** True Line Result + class Assert +** Processing line: ~ attr :assertion_performed~ +- Inside source: true +*** True Line Result + attr :assertion_performed +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ =begin~ +- 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).~ +- 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). +** Processing line: ~ =end~ +- Inside source: true +*** True Line Result + =end +** Processing line: ~ def ok!~ +- Inside source: true +*** True Line Result + def ok! +** Processing line: ~ @assertion_performed = true~ +- Inside source: true +*** True Line Result + @assertion_performed = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ =begin~ +- Inside source: true +*** True Line Result + =begin +** Processing line: ~ 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.~ +- 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. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @example~ +- Inside source: true +*** True Line Result + @example +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def test_does_this_work args, assert~ +- Inside source: true +*** True Line Result + def test_does_this_work args, assert +** Processing line: ~ some_result = Person.new~ +- Inside source: true +*** True Line Result + some_result = Person.new +** Processing line: ~ assert.true! some_result~ +- Inside source: true +*** True Line Result + assert.true! some_result +** Processing line: ~ # OR~ +- Inside source: true +*** True Line Result + # OR +** Processing line: ~ assert.true! some_result, "Person was not created."~ +- Inside source: true +*** True Line Result + assert.true! some_result, "Person was not created." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ =end~ +- Inside source: true +*** True Line Result + =end +** Processing line: ~ def true! value, message = nil~ +- Inside source: true +*** True Line Result + def true! value, message = nil +** Processing line: ~ @assertion_performed = true~ +- Inside source: true +*** True Line Result + @assertion_performed = true +** Processing line: ~ if !value~ +- Inside source: true +*** True Line Result + if !value +** Processing line: ~ message = "#{value} was not truthy.\n#{message}"~ +- Inside source: true +*** True Line Result + message = "#{value} was not truthy.\n#{message}" +** Processing line: ~ raise "#{message}"~ +- Inside source: true +*** True Line Result + raise "#{message}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** 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: ~ =begin~ +- Inside source: true +*** True Line Result + =begin +** Processing line: ~ Assert if a value is a falsey value.~ +- Inside source: true +*** True Line Result + Assert if a value is a falsey value. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @example~ +- Inside source: true +*** True Line Result + @example +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def test_does_this_work args, assert~ +- Inside source: true +*** True Line Result + def test_does_this_work args, assert +** Processing line: ~ some_result = nil~ +- Inside source: true +*** True Line Result + some_result = nil +** Processing line: ~ assert.false! some_result~ +- Inside source: true +*** True Line Result + assert.false! some_result +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ =end~ +- Inside source: true +*** True Line Result + =end +** Processing line: ~ def false! value, message = nil~ +- Inside source: true +*** True Line Result + def false! value, message = nil +** Processing line: ~ @assertion_performed = true~ +- Inside source: true +*** True Line Result + @assertion_performed = true +** Processing line: ~ if value~ +- Inside source: true +*** True Line Result + if value +** Processing line: ~ message = "#{value} was not falsey.\n#{message}"~ +- Inside source: true +*** True Line Result + message = "#{value} was not falsey.\n#{message}" +** Processing line: ~ raise message~ +- Inside source: true +*** True Line Result + raise message +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** 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: ~ =begin~ +- Inside source: true +*** True Line Result + =begin +** Processing line: ~ Assert if two values are equal.~ +- Inside source: true +*** True Line Result + Assert if two values are equal. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @example~ +- Inside source: true +*** True Line Result + @example +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def test_does_this_work args, assert~ +- Inside source: true +*** True Line Result + def test_does_this_work args, assert +** Processing line: ~ a = 1~ +- Inside source: true +*** True Line Result + a = 1 +** Processing line: ~ b = 1~ +- Inside source: true +*** True Line Result + b = 1 +** Processing line: ~ assert.equal! a, b~ +- Inside source: true +*** True Line Result + assert.equal! a, b +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ =end~ +- Inside source: true +*** True Line Result + =end +** Processing line: ~ def equal! actual, expected, message = nil~ +- Inside source: true +*** True Line Result + def equal! actual, expected, message = nil +** Processing line: ~ @assertion_performed = true~ +- Inside source: true +*** True Line Result + @assertion_performed = true +** Processing line: ~ if actual != expected~ +- Inside source: true +*** True Line Result + if actual != expected +** Processing line: ~ actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip~ +- 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}"~ +- Inside source: true +*** True Line Result + 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 + raise message +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** 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 not_equal! actual, expected, message = nil~ +- Inside source: true +*** True Line Result + def not_equal! actual, expected, message = nil +** Processing line: ~ @assertion_performed = true~ +- Inside source: true +*** True Line Result + @assertion_performed = true +** Processing line: ~ if actual == expected~ +- Inside source: true +*** True Line Result + if actual == expected +** Processing line: ~ actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip~ +- 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}"~ +- Inside source: true +*** True Line Result + message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}.\n#{message}" +** Processing line: ~ raise message~ +- Inside source: true +*** True Line Result + raise message +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** 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: ~ =begin~ +- Inside source: true +*** True Line Result + =begin +** Processing line: ~ Assert if a value is explicitly nil (not false).~ +- Inside source: true +*** True Line Result + Assert if a value is explicitly nil (not false). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @example~ +- Inside source: true +*** True Line Result + @example +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def test_does_this_work args, assert~ +- Inside source: true +*** True Line Result + def test_does_this_work args, assert +** Processing line: ~ a = nil~ +- Inside source: true +*** True Line Result + a = nil +** Processing line: ~ b = false~ +- Inside source: true +*** True Line Result + b = false +** Processing line: ~ assert.nil! a # this will pass~ +- Inside source: true +*** True Line Result + assert.nil! a # this will pass +** Processing line: ~ assert.nil! b # this will throw an exception.~ +- Inside source: true +*** True Line Result + assert.nil! b # this will throw an exception. +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ =end~ +- Inside source: true +*** True Line Result + =end +** Processing line: ~ def nil! value, message = nil~ +- Inside source: true +*** True Line Result + def nil! value, message = nil +** Processing line: ~ @assertion_performed = true~ +- Inside source: true +*** True Line Result + @assertion_performed = true +** Processing line: ~ if !value.nil?~ +- Inside source: true +*** True Line Result + if !value.nil? +** Processing line: ~ message = "#{value} was supposed to be nil, but wasn't.\n#{message}"~ +- Inside source: true +*** True Line Result + message = "#{value} was supposed to be nil, but wasn't.\n#{message}" +** Processing line: ~ raise message~ +- Inside source: true +*** True Line Result + raise message +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ nil~ +- Inside source: true +*** True Line Result + nil +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** attr_gtk.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** attr_gtk.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/attr_gtk.rb~ +- Inside source: true +*** True Line Result + # ./dragon/attr_gtk.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # attr_gtk.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # attr_gtk.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @private~ +- Inside source: true +*** True Line Result + # @private +** Processing line: ~ module AttrGTK~ +- Inside source: true +*** True Line Result + module AttrGTK +** Processing line: ~ attr_accessor :args~ +- Inside source: true +*** True Line Result + attr_accessor :args +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def keyboard~ +- Inside source: true +*** True Line Result + def keyboard +** Processing line: ~ args.inputs.keyboard~ +- Inside source: true +*** True Line Result + args.inputs.keyboard +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def grid~ +- Inside source: true +*** True Line Result + def grid +** Processing line: ~ args.grid~ +- Inside source: true +*** True Line Result + args.grid +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def state~ +- Inside source: true +*** True Line Result + def state +** Processing line: ~ args.state~ +- Inside source: true +*** True Line Result + args.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 + def inputs +** Processing line: ~ args.inputs~ +- Inside source: true +*** True Line Result + args.inputs +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def outputs~ +- Inside source: true +*** True Line Result + def outputs +** Processing line: ~ args.outputs~ +- Inside source: true +*** True Line Result + args.outputs +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def gtk~ +- Inside source: true +*** True Line Result + def gtk +** Processing line: ~ args.gtk~ +- Inside source: true +*** True Line Result + args.gtk +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def passes~ +- Inside source: true +*** True Line Result + def passes +** Processing line: ~ args.passes~ +- Inside source: true +*** True Line Result + args.passes +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def pixel_arrays~ +- Inside source: true +*** True Line Result + def pixel_arrays +** Processing line: ~ args.pixel_arrays~ +- Inside source: true +*** True Line Result + args.pixel_arrays +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def geometry~ +- Inside source: true +*** True Line Result + def geometry +** Processing line: ~ args.geometry~ +- Inside source: true +*** True Line Result + args.geometry +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def layout~ +- Inside source: true +*** True Line Result + def layout +** Processing line: ~ args.layout~ +- Inside source: true +*** True Line Result + args.layout +** 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: ~*** attr_sprite.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** attr_sprite.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/attr_sprite.rb~ +- Inside source: true +*** True Line Result + # ./dragon/attr_sprite.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # attr_sprite.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # attr_sprite.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @private~ +- Inside source: true +*** True Line Result + # @private +** Processing line: ~ module AttrRect~ +- Inside source: true +*** True Line Result + module AttrRect +** Processing line: ~ include GTK::Geometry~ +- Inside source: true +*** True Line Result + include GTK::Geometry +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def left~ +- Inside source: true +*** True Line Result + def left +** Processing line: ~ (@x || self.x)~ +- Inside source: true +*** True Line Result + (@x || self.x) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def right~ +- Inside source: true +*** True Line Result + def right +** Processing line: ~ (@x || self.x) + (@w || self.w)~ +- Inside source: true +*** True Line Result + (@x || self.x) + (@w || self.w) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def bottom~ +- Inside source: true +*** True Line Result + def bottom +** Processing line: ~ (@y || self.y)~ +- Inside source: true +*** True Line Result + (@y || self.y) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def top~ +- Inside source: true +*** True Line Result + def top +** Processing line: ~ (@y || self.y) + (@h || self.h)~ +- Inside source: true +*** True Line Result + (@y || self.y) + (@h || self.h) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def x1~ +- Inside source: true +*** True Line Result + def x1 +** Processing line: ~ (@x || self.x)~ +- Inside source: true +*** True Line Result + (@x || self.x) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def y1~ +- Inside source: true +*** True Line Result + def y1 +** Processing line: ~ (@y || self.y)~ +- Inside source: true +*** True Line Result + (@y || self.y) +** 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 AttrSprite~ +- Inside source: true +*** True Line Result + module AttrSprite +** Processing line: ~ include AttrRect~ +- Inside source: true +*** True Line Result + include AttrRect +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :tile_x,~ +- Inside source: true +*** True Line Result + attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :tile_x, +** Processing line: ~ :tile_y, :tile_w, :tile_h, :flip_horizontally,~ +- Inside source: true +*** True Line Result + :tile_y, :tile_w, :tile_h, :flip_horizontally, +** Processing line: ~ :flip_vertically, :angle_anchor_x, :angle_anchor_y, :id,~ +- 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~ +- Inside source: true +*** True Line Result + :source_x, :source_y, :source_w, :source_h +** 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: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def sprite~ +- Inside source: true +*** True Line Result + def sprite +** Processing line: ~ self~ +- Inside source: true +*** True Line Result + self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def x1= value~ +- Inside source: true +*** True Line Result + def x1= value +** Processing line: ~ @x = value~ +- Inside source: true +*** True Line Result + @x = value +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def y1= value~ +- Inside source: true +*** True Line Result + def y1= value +** Processing line: ~ @y = value~ +- Inside source: true +*** True Line Result + @y = 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: ~#+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: ~*** console.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** console.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/console.rb~ +- Inside source: true +*** True Line Result + # ./dragon/console.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # console.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # console.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright:~ +- Inside source: true +*** True Line Result + # Contributors outside of DragonRuby who also hold Copyright: +** Processing line: ~ # - Kevin Fischer: https://github.com/kfischer-okarin~ +- Inside source: true +*** True Line Result + # - Kevin Fischer: https://github.com/kfischer-okarin +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Console~ +- Inside source: true +*** True Line Result + class Console +** Processing line: ~ include ConsoleDeprecated~ +- Inside source: true +*** True Line Result + include ConsoleDeprecated +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ attr_accessor :show_reason, :log, :logo, :background_color,~ +- Inside source: true +*** True Line Result + attr_accessor :show_reason, :log, :logo, :background_color, +** Processing line: ~ :text_color, :animation_duration,~ +- Inside source: true +*** True Line Result + :text_color, :animation_duration, +** Processing line: ~ :max_log_lines, :max_history, :log,~ +- Inside source: true +*** True Line Result + :max_log_lines, :max_history, :log, +** Processing line: ~ :last_command_errored, :last_command, :error_color, :shown_at,~ +- Inside source: true +*** True Line Result + :last_command_errored, :last_command, :error_color, :shown_at, +** Processing line: ~ :header_color, :archived_log, :last_log_lines, :last_log_lines_count,~ +- Inside source: true +*** True Line Result + :header_color, :archived_log, :last_log_lines, :last_log_lines_count, +** Processing line: ~ :suppress_left_arrow_behavior, :command_set_at,~ +- Inside source: true +*** True Line Result + :suppress_left_arrow_behavior, :command_set_at, +** Processing line: ~ :toast_ids, :bottom,~ +- Inside source: true +*** True Line Result + :toast_ids, :bottom, +** Processing line: ~ :font_style, :menu~ +- Inside source: true +*** True Line Result + :font_style, :menu +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1, line_height: 1.1)~ +- Inside source: true +*** True Line Result + @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1, line_height: 1.1) +** Processing line: ~ @menu = Menu.new self~ +- Inside source: true +*** True Line Result + @menu = Menu.new self +** Processing line: ~ @disabled = false~ +- Inside source: true +*** True Line Result + @disabled = false +** Processing line: ~ @log_offset = 0~ +- Inside source: true +*** True Line Result + @log_offset = 0 +** Processing line: ~ @visible = false~ +- Inside source: true +*** True Line Result + @visible = false +** Processing line: ~ @toast_ids = []~ +- Inside source: true +*** True Line Result + @toast_ids = [] +** Processing line: ~ @archived_log = []~ +- Inside source: true +*** True Line Result + @archived_log = [] +** Processing line: ~ @log = [ 'Console ready.' ]~ +- Inside source: true +*** True Line Result + @log = [ 'Console ready.' ] +** Processing line: ~ @max_log_lines = 1000 # I guess...?~ +- Inside source: true +*** True Line Result + @max_log_lines = 1000 # I guess...? +** Processing line: ~ @max_history = 1000 # I guess...?~ +- Inside source: true +*** True Line Result + @max_history = 1000 # I guess...? +** Processing line: ~ @log_invocation_count = 0~ +- Inside source: true +*** True Line Result + @log_invocation_count = 0 +** Processing line: ~ @command_history = []~ +- Inside source: true +*** True Line Result + @command_history = [] +** Processing line: ~ @command_history_index = -1~ +- Inside source: true +*** True Line Result + @command_history_index = -1 +** Processing line: ~ @nonhistory_input = ''~ +- Inside source: true +*** True Line Result + @nonhistory_input = '' +** Processing line: ~ @logo = 'console-logo.png'~ +- Inside source: true +*** True Line Result + @logo = 'console-logo.png' +** Processing line: ~ @history_fname = 'console_history.txt'~ +- Inside source: true +*** True Line Result + @history_fname = 'console_history.txt' +** Processing line: ~ @background_color = Color.new [0, 0, 0, 224]~ +- Inside source: true +*** True Line Result + @background_color = Color.new [0, 0, 0, 224] +** Processing line: ~ @text_color = Color.new [255, 255, 255]~ +- Inside source: true +*** True Line Result + @text_color = Color.new [255, 255, 255] +** Processing line: ~ @error_color = Color.new [200, 50, 50]~ +- Inside source: true +*** True Line Result + @error_color = Color.new [200, 50, 50] +** Processing line: ~ @header_color = Color.new [100, 200, 220]~ +- Inside source: true +*** True Line Result + @header_color = Color.new [100, 200, 220] +** Processing line: ~ @animation_duration = 1.seconds~ +- Inside source: true +*** True Line Result + @animation_duration = 1.seconds +** Processing line: ~ @shown_at = -1~ +- Inside source: true +*** True Line Result + @shown_at = -1 +** Processing line: ~ load_history~ +- Inside source: true +*** True Line Result + load_history +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def console_text_width~ +- Inside source: true +*** True Line Result + def console_text_width +** Processing line: ~ @console_text_width ||= ($gtk.logical_width - 20).idiv(font_style.letter_size.x)~ +- Inside source: true +*** True Line Result + @console_text_width ||= ($gtk.logical_width - 20).idiv(font_style.letter_size.x) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def save_history~ +- Inside source: true +*** True Line Result + def save_history +** Processing line: ~ $gtk.ffi_file.write_root @history_fname, (@command_history.reverse.join "\n")~ +- Inside source: true +*** True Line Result + $gtk.ffi_file.write_root @history_fname, (@command_history.reverse.join "\n") +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def load_history~ +- Inside source: true +*** True Line Result + def load_history +** Processing line: ~ @command_history.clear~ +- Inside source: true +*** True Line Result + @command_history.clear +** Processing line: ~ str = $gtk.ffi_file.read @history_fname~ +- Inside source: true +*** True Line Result + str = $gtk.ffi_file.read @history_fname +** Processing line: ~ return if str.nil? # no history to load.~ +- Inside source: true +*** True Line Result + return if str.nil? # no history to load. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ str.chomp!("\n") # Don't let endlines at the end cause extra blank line.~ +- Inside source: true +*** True Line Result + str.chomp!("\n") # Don't let endlines at the end cause extra blank line. +** Processing line: ~ str.chomp!("\r")~ +- Inside source: true +*** True Line Result + str.chomp!("\r") +** Processing line: ~ str.each_line { |s|~ +- Inside source: true +*** True Line Result + str.each_line { |s| +** Processing line: ~ s.chomp!("\n")~ +- Inside source: true +*** True Line Result + s.chomp!("\n") +** Processing line: ~ s.chomp!("\r")~ +- Inside source: true +*** True Line Result + s.chomp!("\r") +** Processing line: ~ if s.length > 0~ +- Inside source: true +*** True Line Result + if s.length > 0 +** Processing line: ~ @command_history.unshift s~ +- Inside source: true +*** True Line Result + @command_history.unshift s +** Processing line: ~ break if @command_history.length >= @max_history~ +- Inside source: true +*** True Line Result + break if @command_history.length >= @max_history +** 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: ~ @command_history.uniq!~ +- Inside source: true +*** True Line Result + @command_history.uniq! +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def disable~ +- Inside source: true +*** True Line Result + def disable +** Processing line: ~ @disabled = true~ +- Inside source: true +*** True Line Result + @disabled = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def enable~ +- Inside source: true +*** True Line Result + def enable +** Processing line: ~ @disabled = false~ +- Inside source: true +*** True Line Result + @disabled = false +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def add_sprite obj~ +- Inside source: true +*** True Line Result + def add_sprite obj +** Processing line: ~ @log_invocation_count += 1~ +- Inside source: true +*** True Line Result + @log_invocation_count += 1 +** Processing line: ~ obj[:id] ||= "id_#{obj[:path]}_#{Time.now.to_i}".to_sym~ +- Inside source: true +*** True Line Result + obj[:id] ||= "id_#{obj[:path]}_#{Time.now.to_i}".to_sym +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if @last_line_log_index &&~ +- Inside source: true +*** True Line Result + if @last_line_log_index && +** Processing line: ~ @last_sprite_line.is_a?(Hash) &&~ +- Inside source: true +*** True Line Result + @last_sprite_line.is_a?(Hash) && +** Processing line: ~ @last_sprite_line[:id] == obj[:id]~ +- Inside source: true +*** True Line Result + @last_sprite_line[:id] == obj[:id] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @log[@last_line_log_index] = obj~ +- Inside source: true +*** True Line Result + @log[@last_line_log_index] = obj +** Processing line: ~ return~ +- Inside source: true +*** True Line Result + return +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @log << obj~ +- Inside source: true +*** True Line Result + @log << obj +** Processing line: ~ @last_line_log_index = @log.length - 1~ +- Inside source: true +*** True Line Result + @last_line_log_index = @log.length - 1 +** Processing line: ~ @last_sprite_line = obj~ +- Inside source: true +*** True Line Result + @last_sprite_line = obj +** 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 add_primitive obj~ +- Inside source: true +*** True Line Result + def add_primitive obj +** Processing line: ~ if obj.is_a? Hash~ +- Inside source: true +*** True Line Result + if obj.is_a? Hash +** Processing line: ~ add_sprite obj~ +- Inside source: true +*** True Line Result + add_sprite obj +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ add_text obj~ +- Inside source: true +*** True Line Result + add_text obj +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** 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 add_text obj~ +- Inside source: true +*** True Line Result + def add_text obj +** Processing line: ~ @last_log_lines_count ||= 1~ +- Inside source: true +*** True Line Result + @last_log_lines_count ||= 1 +** Processing line: ~ @log_invocation_count += 1~ +- Inside source: true +*** True Line Result + @log_invocation_count += 1 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ str = obj.to_s~ +- Inside source: true +*** True Line Result + str = obj.to_s +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ log_lines = []~ +- Inside source: true +*** True Line Result + log_lines = [] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ str.each_line do |s|~ +- Inside source: true +*** True Line Result + str.each_line do |s| +** Processing line: ~ s.wrapped_lines(self.console_text_width).each do |l|~ +- Inside source: true +*** True Line Result + s.wrapped_lines(self.console_text_width).each do |l| +** Processing line: ~ log_lines << l~ +- Inside source: true +*** True Line Result + log_lines << l +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if log_lines == @last_log_lines~ +- Inside source: true +*** True Line Result + if log_lines == @last_log_lines +** Processing line: ~ @last_log_lines_count += 1~ +- Inside source: true +*** True Line Result + @last_log_lines_count += 1 +** Processing line: ~ new_log_line_with_count = @last_log_lines.last + " (#{@last_log_lines_count})"~ +- Inside source: true +*** True Line Result + new_log_line_with_count = @last_log_lines.last + " (#{@last_log_lines_count})" +** Processing line: ~ if log_lines.length > 1~ +- Inside source: true +*** True Line Result + if log_lines.length > 1 +** Processing line: ~ @log = @log[0..-(@log.length - log_lines.length)] + log_lines[0..-2] + [new_log_line_with_count]~ +- Inside source: true +*** True Line Result + @log = @log[0..-(@log.length - log_lines.length)] + log_lines[0..-2] + [new_log_line_with_count] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @log = @log[0..-2] + [new_log_line_with_count]~ +- Inside source: true +*** True Line Result + @log = @log[0..-2] + [new_log_line_with_count] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ return~ +- Inside source: true +*** True Line Result + return +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ log_lines.each do |l|~ +- Inside source: true +*** True Line Result + log_lines.each do |l| +** Processing line: ~ @log.shift if @log.length > @max_log_lines~ +- Inside source: true +*** True Line Result + @log.shift if @log.length > @max_log_lines +** Processing line: ~ @log << l~ +- Inside source: true +*** True Line Result + @log << l +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @last_log_lines_count = 1~ +- Inside source: true +*** True Line Result + @last_log_lines_count = 1 +** Processing line: ~ @last_log_lines = log_lines~ +- Inside source: true +*** True Line Result + @last_log_lines = log_lines +** 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 ready?~ +- Inside source: true +*** True Line Result + def ready? +** Processing line: ~ visible? && @toggled_at.elapsed?(@animation_duration, Kernel.global_tick_count)~ +- Inside source: true +*** True Line Result + visible? && @toggled_at.elapsed?(@animation_duration, Kernel.global_tick_count) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def hidden?~ +- Inside source: true +*** True Line Result + def hidden? +** Processing line: ~ !@visible~ +- Inside source: true +*** True Line Result + !@visible +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def visible?~ +- Inside source: true +*** True Line Result + def visible? +** Processing line: ~ @visible~ +- Inside source: true +*** True Line Result + @visible +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def open reason = nil~ +- Inside source: true +*** True Line Result + def open reason = nil +** Processing line: ~ show reason~ +- Inside source: true +*** True Line Result + show reason +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def show reason = nil~ +- Inside source: true +*** True Line Result + def show reason = nil +** Processing line: ~ @shown_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @shown_at = Kernel.global_tick_count +** Processing line: ~ @show_reason = reason~ +- Inside source: true +*** True Line Result + @show_reason = reason +** Processing line: ~ toggle if hidden?~ +- Inside source: true +*** True Line Result + toggle if hidden? +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def hide~ +- Inside source: true +*** True Line Result + def hide +** Processing line: ~ if visible?~ +- Inside source: true +*** True Line Result + if visible? +** Processing line: ~ toggle~ +- Inside source: true +*** True Line Result + toggle +** Processing line: ~ @archived_log += @log~ +- Inside source: true +*** True Line Result + @archived_log += @log +** Processing line: ~ if @archived_log.length > @max_log_lines~ +- Inside source: true +*** True Line Result + if @archived_log.length > @max_log_lines +** Processing line: ~ @archived_log = @archived_log.drop(@archived_log.length - @max_log_lines)~ +- Inside source: true +*** True Line Result + @archived_log = @archived_log.drop(@archived_log.length - @max_log_lines) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ @log.clear~ +- Inside source: true +*** True Line Result + @log.clear +** Processing line: ~ @show_reason = nil~ +- Inside source: true +*** True Line Result + @show_reason = nil +** Processing line: ~ clear_toast~ +- Inside source: true +*** True Line Result + clear_toast +** 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 close~ +- Inside source: true +*** True Line Result + def close +** Processing line: ~ hide~ +- Inside source: true +*** True Line Result + hide +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def clear_toast~ +- Inside source: true +*** True Line Result + def clear_toast +** Processing line: ~ @toasted_at = nil~ +- Inside source: true +*** True Line Result + @toasted_at = nil +** Processing line: ~ @toast_duration = 0~ +- Inside source: true +*** True Line Result + @toast_duration = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def toggle~ +- Inside source: true +*** True Line Result + def toggle +** Processing line: ~ @visible = !@visible~ +- Inside source: true +*** True Line Result + @visible = !@visible +** Processing line: ~ @toggled_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @toggled_at = Kernel.global_tick_count +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def currently_toasting?~ +- Inside source: true +*** True Line Result + def currently_toasting? +** Processing line: ~ return false if hidden?~ +- Inside source: true +*** True Line Result + return false if hidden? +** Processing line: ~ return false unless @show_reason == :toast~ +- Inside source: true +*** True Line Result + return false unless @show_reason == :toast +** Processing line: ~ return false unless @toasted_at~ +- Inside source: true +*** True Line Result + return false unless @toasted_at +** Processing line: ~ return false if @toasted_at.elapsed?(5.seconds, Kernel.global_tick_count)~ +- Inside source: true +*** True Line Result + return false if @toasted_at.elapsed?(5.seconds, Kernel.global_tick_count) +** Processing line: ~ return true~ +- Inside source: true +*** True Line Result + return true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def toast_extended id = nil, duration = nil, *messages~ +- Inside source: true +*** True Line Result + def toast_extended id = nil, duration = nil, *messages +** Processing line: ~ if !id.is_a?(Symbol)~ +- Inside source: true +*** True Line Result + if !id.is_a?(Symbol) +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ args.gtk.console.toast has the following signature:~ +- Inside source: true +*** True Line Result + args.gtk.console.toast has the following signature: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def toast id, *messages~ +- Inside source: true +*** True Line Result + def toast id, *messages +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ The id property uniquely defines the message and must be~ +- Inside source: true +*** True Line Result + The id property uniquely defines the message and must be +** Processing line: ~ a symbol.~ +- Inside source: true +*** True Line Result + a symbol. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ After that, you can provide all the objects you want to~ +- Inside source: true +*** True Line Result + After that, you can provide all the objects you want to +** Processing line: ~ look at.~ +- Inside source: true +*** True Line Result + look at. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Example:~ +- Inside source: true +*** True Line Result + Example: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.gtk.console.toast :say_hello,~ +- Inside source: true +*** True Line Result + args.gtk.console.toast :say_hello, +** Processing line: ~ \"Hello world.\",~ +- Inside source: true +*** True Line Result + \"Hello world.\", +** Processing line: ~ args.state.tick_count~ +- Inside source: true +*** True Line Result + args.state.tick_count +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Toast messages autohide after 5 seconds.~ +- Inside source: true +*** True Line Result + Toast messages autohide after 5 seconds. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ If you need to look at something for longer, use~ +- Inside source: true +*** True Line Result + If you need to look at something for longer, use +** Processing line: ~ args.gtk.console.perma_toast instead (which you can manually dismiss).~ +- Inside source: true +*** True Line Result + args.gtk.console.perma_toast instead (which you can manually dismiss). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return if currently_toasting?~ +- Inside source: true +*** True Line Result + return if currently_toasting? +** Processing line: ~ return if @toast_ids.include? id~ +- Inside source: true +*** True Line Result + return if @toast_ids.include? id +** Processing line: ~ @toasted_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @toasted_at = Kernel.global_tick_count +** Processing line: ~ log_once_info :perma_toast_tip, "Use console.perma_toast to show the toast for longer."~ +- Inside source: true +*** True Line Result + log_once_info :perma_toast_tip, "Use console.perma_toast to show the toast for longer." +** Processing line: ~ dwim_duration = 5.seconds~ +- Inside source: true +*** True Line Result + dwim_duration = 5.seconds +** Processing line: ~ add_text "* toast :#{id}"~ +- Inside source: true +*** True Line Result + add_text "* toast :#{id}" +** Processing line: ~ puts "* TOAST: :#{id}"~ +- Inside source: true +*** True Line Result + puts "* TOAST: :#{id}" +** Processing line: ~ messages.each do |message|~ +- Inside source: true +*** True Line Result + messages.each do |message| +** Processing line: ~ lines = message.to_s.wrapped_lines(self.console_text_width)~ +- Inside source: true +*** True Line Result + lines = message.to_s.wrapped_lines(self.console_text_width) +** Processing line: ~ dwim_duration += lines.length.seconds~ +- Inside source: true +*** True Line Result + dwim_duration += lines.length.seconds +** Processing line: ~ add_text "** #{message}"~ +- Inside source: true +*** True Line Result + add_text "** #{message}" +** Processing line: ~ puts "** #{message}"~ +- Inside source: true +*** True Line Result + puts "** #{message}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ show :toast~ +- Inside source: true +*** True Line Result + show :toast +** Processing line: ~ @toast_duration += duration || dwim_duration~ +- Inside source: true +*** True Line Result + @toast_duration += duration || dwim_duration +** Processing line: ~ @toast_ids << id~ +- Inside source: true +*** True Line Result + @toast_ids << id +** Processing line: ~ set_command "$gtk.console.hide"~ +- Inside source: true +*** True Line Result + set_command "$gtk.console.hide" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def perma_toast id = nil, messages~ +- Inside source: true +*** True Line Result + def perma_toast id = nil, messages +** Processing line: ~ toast_extended id, 600.seconds, *messages~ +- Inside source: true +*** True Line Result + toast_extended id, 600.seconds, *messages +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def toast id = nil, *messages~ +- Inside source: true +*** True Line Result + def toast id = nil, *messages +** Processing line: ~ toast_extended id, nil, *messages~ +- Inside source: true +*** True Line Result + toast_extended id, nil, *messages +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def console_toggle_keys~ +- Inside source: true +*** True Line Result + def console_toggle_keys +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ :backtick!,~ +- Inside source: true +*** True Line Result + :backtick!, +** Processing line: ~ :tilde!,~ +- Inside source: true +*** True Line Result + :tilde!, +** Processing line: ~ :superscript_two!,~ +- Inside source: true +*** True Line Result + :superscript_two!, +** Processing line: ~ :section_sign!,~ +- Inside source: true +*** True Line Result + :section_sign!, +** Processing line: ~ :ordinal_indicator!,~ +- Inside source: true +*** True Line Result + :ordinal_indicator!, +** Processing line: ~ :circumflex!,~ +- Inside source: true +*** True Line Result + :circumflex!, +** 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 console_toggle_key_down? args~ +- Inside source: true +*** True Line Result + def console_toggle_key_down? args +** Processing line: ~ args.inputs.keyboard.key_down.any? console_toggle_keys~ +- Inside source: true +*** True Line Result + args.inputs.keyboard.key_down.any? console_toggle_keys +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def try_search_docs exception~ +- Inside source: true +*** True Line Result + def try_search_docs exception +** Processing line: ~ string_e = "#{exception}"~ +- Inside source: true +*** True Line Result + string_e = "#{exception}" +** Processing line: ~ @last_command_errored = true~ +- Inside source: true +*** True Line Result + @last_command_errored = true +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if (string_e.include? "wrong number of arguments")~ +- Inside source: true +*** True Line Result + if (string_e.include? "wrong number of arguments") +** Processing line: ~ method_name = ((string_e.split ":")[0].gsub "'", "")~ +- Inside source: true +*** True Line Result + method_name = ((string_e.split ":")[0].gsub "'", "") +** Processing line: ~ if !(method_name.include? " ")~ +- Inside source: true +*** True Line Result + if !(method_name.include? " ") +** Processing line: ~ results = (Kernel.__docs_search_results__ method_name)~ +- Inside source: true +*** True Line Result + results = (Kernel.__docs_search_results__ method_name) +** Processing line: ~ if !results.include? "* DOCS: No results found."~ +- Inside source: true +*** True Line Result + if !results.include? "* DOCS: No results found." +** Processing line: ~ puts (results.join "\n")~ +- Inside source: true +*** True Line Result + puts (results.join "\n") +** Processing line: ~ puts <<-S~ +- Inside source: true +*** True Line Result + puts <<-S +** Processing line: ~ * INFO: #{results.length} matches(s) found in DOCS for ~#{method_name}~ (see above).~ +- Inside source: true +*** True Line Result + * INFO: #{results.length} matches(s) found in DOCS for ~#{method_name}~ (see above). +** Processing line: ~ You can search the documentation yourself using the following command in the Console:~ +- Inside source: true +*** True Line Result + You can search the documentation yourself using the following command in the Console: +** Processing line: ~ #+begin_src ruby~ +- Inside source: true +*** True Line Result + #+begin_src ruby +** Processing line: ~ docs_search \"#{method_name}\"~ +- Inside source: true +*** True Line Result + docs_search \"#{method_name}\" +** Processing line: ~ #+end_src~ +- Inside source: true +*** True Line Result + #+end_src +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ log_once_info :exported_search_results, "The search results above has been seen in logs/puts.txt and docs/search_results.txt."~ +- Inside source: true +*** True Line Result + log_once_info :exported_search_results, "The search results above has been seen in logs/puts.txt and docs/search_results.txt." +** 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: ~ rescue Exception => se~ +- Inside source: true +*** True Line Result + rescue Exception => se +** Processing line: ~ puts <<-S~ +- Inside source: true +*** True Line Result + puts <<-S +** Processing line: ~ * FATAL: ~GTK::Console#try_search_docs~~ +- Inside source: true +*** True Line Result + * FATAL: ~GTK::Console#try_search_docs~ +** Processing line: ~ There was an exception searching for docs (~GTK::Console#try_search_docs~). You might want to let DragonRuby know about this.~ +- Inside source: true +*** True Line Result + There was an exception searching for docs (~GTK::Console#try_search_docs~). You might want to let DragonRuby know about this. +** Processing line: ~ ** INNER EXCEPTION~ +- Inside source: true +*** True Line Result + ** INNER EXCEPTION +** Processing line: ~ #{se}~ +- Inside source: true +*** True Line Result + #{se} +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def eval_the_set_command~ +- Inside source: true +*** True Line Result + def eval_the_set_command +** Processing line: ~ cmd = current_input_str.strip~ +- Inside source: true +*** True Line Result + cmd = current_input_str.strip +** Processing line: ~ if cmd.length != 0~ +- Inside source: true +*** True Line Result + if cmd.length != 0 +** Processing line: ~ @log_offset = 0~ +- Inside source: true +*** True Line Result + @log_offset = 0 +** Processing line: ~ prompt.clear~ +- Inside source: true +*** True Line Result + prompt.clear +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @command_history.pop while @command_history.length >= @max_history~ +- Inside source: true +*** True Line Result + @command_history.pop while @command_history.length >= @max_history +** Processing line: ~ @command_history.unshift cmd~ +- Inside source: true +*** True Line Result + @command_history.unshift cmd +** Processing line: ~ @command_history_index = -1~ +- Inside source: true +*** True Line Result + @command_history_index = -1 +** Processing line: ~ @nonhistory_input = ''~ +- Inside source: true +*** True Line Result + @nonhistory_input = '' +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if cmd == 'quit' || cmd == ':wq' || cmd == ':q!' || cmd == ':q' || cmd == ':wqa'~ +- Inside source: true +*** True Line Result + if cmd == 'quit' || cmd == ':wq' || cmd == ':q!' || cmd == ':q' || cmd == ':wqa' +** Processing line: ~ $gtk.request_quit~ +- Inside source: true +*** True Line Result + $gtk.request_quit +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ puts "-> #{cmd}"~ +- Inside source: true +*** True Line Result + puts "-> #{cmd}" +** Processing line: ~ begin~ +- Inside source: true +*** True Line Result + begin +** Processing line: ~ @last_command = cmd~ +- Inside source: true +*** True Line Result + @last_command = cmd +** Processing line: ~ Kernel.eval("$results = (#{cmd})")~ +- Inside source: true +*** True Line Result + Kernel.eval("$results = (#{cmd})") +** Processing line: ~ if $results.nil?~ +- Inside source: true +*** True Line Result + if $results.nil? +** Processing line: ~ puts "=> nil"~ +- Inside source: true +*** True Line Result + puts "=> nil" +** Processing line: ~ elsif $results == :console_silent_eval~ +- Inside source: true +*** True Line Result + elsif $results == :console_silent_eval +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ puts "=> #{$results}"~ +- Inside source: true +*** True Line Result + puts "=> #{$results}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ @last_command_errored = false~ +- Inside source: true +*** True Line Result + @last_command_errored = false +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ try_search_docs e~ +- Inside source: true +*** True Line Result + try_search_docs e +** Processing line: ~ puts "* EXCEPTION: #{e}"~ +- Inside source: true +*** True Line Result + puts "* EXCEPTION: #{e}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def inputs_scroll_up_full? args~ +- Inside source: true +*** True Line Result + def inputs_scroll_up_full? args +** Processing line: ~ return false if @disabled~ +- Inside source: true +*** True Line Result + return false if @disabled +** Processing line: ~ args.inputs.keyboard.key_down.pageup ||~ +- Inside source: true +*** True Line Result + args.inputs.keyboard.key_down.pageup || +** Processing line: ~ (args.inputs.keyboard.key_up.b && args.inputs.keyboard.key_up.control)~ +- Inside source: true +*** True Line Result + (args.inputs.keyboard.key_up.b && args.inputs.keyboard.key_up.control) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def scroll_to_bottom~ +- Inside source: true +*** True Line Result + def scroll_to_bottom +** Processing line: ~ @log_offset = 0~ +- Inside source: true +*** True Line Result + @log_offset = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def scroll_up_full~ +- Inside source: true +*** True Line Result + def scroll_up_full +** Processing line: ~ @log_offset += lines_on_one_page~ +- Inside source: true +*** True Line Result + @log_offset += lines_on_one_page +** Processing line: ~ @log_offset = @log.size if @log_offset > @log.size~ +- Inside source: true +*** True Line Result + @log_offset = @log.size if @log_offset > @log.size +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def inputs_scroll_up_half? args~ +- Inside source: true +*** True Line Result + def inputs_scroll_up_half? args +** Processing line: ~ return false if @disabled~ +- Inside source: true +*** True Line Result + return false if @disabled +** Processing line: ~ args.inputs.keyboard.ctrl_u~ +- Inside source: true +*** True Line Result + args.inputs.keyboard.ctrl_u +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def scroll_up_half~ +- Inside source: true +*** True Line Result + def scroll_up_half +** Processing line: ~ @log_offset += lines_on_one_page.idiv(2)~ +- Inside source: true +*** True Line Result + @log_offset += lines_on_one_page.idiv(2) +** Processing line: ~ @log_offset = @log.size if @log_offset > @log.size~ +- Inside source: true +*** True Line Result + @log_offset = @log.size if @log_offset > @log.size +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def inputs_scroll_down_full? args~ +- Inside source: true +*** True Line Result + def inputs_scroll_down_full? args +** Processing line: ~ return false if @disabled~ +- Inside source: true +*** True Line Result + return false if @disabled +** Processing line: ~ args.inputs.keyboard.key_down.pagedown ||~ +- Inside source: true +*** True Line Result + args.inputs.keyboard.key_down.pagedown || +** Processing line: ~ (args.inputs.keyboard.key_up.f && args.inputs.keyboard.key_up.control)~ +- Inside source: true +*** True Line Result + (args.inputs.keyboard.key_up.f && args.inputs.keyboard.key_up.control) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def scroll_down_full~ +- Inside source: true +*** True Line Result + def scroll_down_full +** Processing line: ~ @log_offset -= lines_on_one_page~ +- Inside source: true +*** True Line Result + @log_offset -= lines_on_one_page +** Processing line: ~ @log_offset = 0 if @log_offset < 0~ +- Inside source: true +*** True Line Result + @log_offset = 0 if @log_offset < 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def inputs_scroll_down_half? args~ +- Inside source: true +*** True Line Result + def inputs_scroll_down_half? args +** Processing line: ~ return false if @disabled~ +- Inside source: true +*** True Line Result + return false if @disabled +** Processing line: ~ args.inputs.keyboard.ctrl_d~ +- Inside source: true +*** True Line Result + args.inputs.keyboard.ctrl_d +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def inputs_clear_command? args~ +- Inside source: true +*** True Line Result + def inputs_clear_command? args +** Processing line: ~ return false if @disabled~ +- Inside source: true +*** True Line Result + return false if @disabled +** Processing line: ~ args.inputs.keyboard.escape || args.inputs.keyboard.ctrl_g~ +- Inside source: true +*** True Line Result + args.inputs.keyboard.escape || args.inputs.keyboard.ctrl_g +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def scroll_down_half~ +- Inside source: true +*** True Line Result + def scroll_down_half +** Processing line: ~ @log_offset -= lines_on_one_page.idiv(2)~ +- Inside source: true +*** True Line Result + @log_offset -= lines_on_one_page.idiv(2) +** Processing line: ~ @log_offset = 0 if @log_offset < 0~ +- Inside source: true +*** True Line Result + @log_offset = 0 if @log_offset < 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def mouse_wheel_scroll args~ +- Inside source: true +*** True Line Result + def mouse_wheel_scroll args +** Processing line: ~ @inertia ||= 0~ +- Inside source: true +*** True Line Result + @inertia ||= 0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.inputs.mouse.wheel && args.inputs.mouse.wheel.y > 0~ +- Inside source: true +*** True Line Result + if args.inputs.mouse.wheel && args.inputs.mouse.wheel.y > 0 +** Processing line: ~ @inertia = 1~ +- Inside source: true +*** True Line Result + @inertia = 1 +** Processing line: ~ elsif args.inputs.mouse.wheel && args.inputs.mouse.wheel.y < 0~ +- Inside source: true +*** True Line Result + elsif args.inputs.mouse.wheel && args.inputs.mouse.wheel.y < 0 +** Processing line: ~ @inertia = -1~ +- Inside source: true +*** True Line Result + @inertia = -1 +** 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~ +- Inside source: true +*** True Line Result + if args.inputs.mouse.click +** Processing line: ~ @inertia = 0~ +- Inside source: true +*** True Line Result + @inertia = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return if @inertia == 0~ +- Inside source: true +*** True Line Result + return if @inertia == 0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if @inertia != 0~ +- Inside source: true +*** True Line Result + if @inertia != 0 +** Processing line: ~ @inertia = (@inertia * 0.7)~ +- Inside source: true +*** True Line Result + @inertia = (@inertia * 0.7) +** Processing line: ~ if @inertia > 0~ +- Inside source: true +*** True Line Result + if @inertia > 0 +** Processing line: ~ @log_offset -= 1~ +- Inside source: true +*** True Line Result + @log_offset -= 1 +** Processing line: ~ elsif @inertia < 0~ +- Inside source: true +*** True Line Result + elsif @inertia < 0 +** Processing line: ~ @log_offset += 1~ +- Inside source: true +*** True Line Result + @log_offset += 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: ~ if @inertia.abs < 0.01~ +- Inside source: true +*** True Line Result + if @inertia.abs < 0.01 +** Processing line: ~ @inertia = 0~ +- Inside source: true +*** True Line Result + @inertia = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if @log_offset > @log.size~ +- Inside source: true +*** True Line Result + if @log_offset > @log.size +** Processing line: ~ @log_offset = @log.size~ +- Inside source: true +*** True Line Result + @log_offset = @log.size +** Processing line: ~ elsif @log_offset < 0~ +- Inside source: true +*** True Line Result + elsif @log_offset < 0 +** Processing line: ~ @log_offset = 0~ +- Inside source: true +*** True Line Result + @log_offset = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def process_inputs args~ +- Inside source: true +*** True Line Result + def process_inputs args +** Processing line: ~ if console_toggle_key_down? args~ +- Inside source: true +*** True Line Result + if console_toggle_key_down? args +** Processing line: ~ args.inputs.text.clear~ +- Inside source: true +*** True Line Result + args.inputs.text.clear +** Processing line: ~ toggle~ +- Inside source: true +*** True Line Result + toggle +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return unless visible?~ +- Inside source: true +*** True Line Result + return unless visible? +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.inputs.text.each { |str| prompt << str }~ +- Inside source: true +*** True Line Result + args.inputs.text.each { |str| prompt << str } +** Processing line: ~ args.inputs.text.clear~ +- Inside source: true +*** True Line Result + args.inputs.text.clear +** Processing line: ~ mouse_wheel_scroll args~ +- Inside source: true +*** True Line Result + mouse_wheel_scroll args +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @log_offset = 0 if @log_offset < 0~ +- Inside source: true +*** True Line Result + @log_offset = 0 if @log_offset < 0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.inputs.keyboard.key_down.enter~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.enter +** Processing line: ~ eval_the_set_command~ +- Inside source: true +*** True Line Result + eval_the_set_command +** Processing line: ~ elsif args.inputs.keyboard.key_down.v~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.v +** Processing line: ~ if args.inputs.keyboard.key_down.control || args.inputs.keyboard.key_down.meta~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.control || args.inputs.keyboard.key_down.meta +** Processing line: ~ prompt << $gtk.ffi_misc.getclipboard~ +- Inside source: true +*** True Line Result + prompt << $gtk.ffi_misc.getclipboard +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ elsif args.inputs.keyboard.key_down.home~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.home +** Processing line: ~ prompt.move_cursor_home~ +- Inside source: true +*** True Line Result + prompt.move_cursor_home +** Processing line: ~ elsif args.inputs.keyboard.key_down.end~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.end +** Processing line: ~ prompt.move_cursor_end~ +- Inside source: true +*** True Line Result + prompt.move_cursor_end +** Processing line: ~ elsif args.inputs.keyboard.key_down.up~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.up +** Processing line: ~ if @command_history_index == -1~ +- Inside source: true +*** True Line Result + if @command_history_index == -1 +** Processing line: ~ @nonhistory_input = current_input_str~ +- Inside source: true +*** True Line Result + @nonhistory_input = current_input_str +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ if @command_history_index < (@command_history.length - 1)~ +- Inside source: true +*** True Line Result + if @command_history_index < (@command_history.length - 1) +** Processing line: ~ @command_history_index += 1~ +- Inside source: true +*** True Line Result + @command_history_index += 1 +** Processing line: ~ self.current_input_str = @command_history[@command_history_index].dup~ +- Inside source: true +*** True Line Result + self.current_input_str = @command_history[@command_history_index].dup +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ elsif args.inputs.keyboard.key_down.down~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.down +** Processing line: ~ if @command_history_index == 0~ +- Inside source: true +*** True Line Result + if @command_history_index == 0 +** Processing line: ~ @command_history_index = -1~ +- Inside source: true +*** True Line Result + @command_history_index = -1 +** Processing line: ~ self.current_input_str = @nonhistory_input~ +- Inside source: true +*** True Line Result + self.current_input_str = @nonhistory_input +** Processing line: ~ @nonhistory_input = ''~ +- Inside source: true +*** True Line Result + @nonhistory_input = '' +** Processing line: ~ elsif @command_history_index > 0~ +- Inside source: true +*** True Line Result + elsif @command_history_index > 0 +** Processing line: ~ @command_history_index -= 1~ +- Inside source: true +*** True Line Result + @command_history_index -= 1 +** Processing line: ~ self.current_input_str = @command_history[@command_history_index].dup~ +- Inside source: true +*** True Line Result + self.current_input_str = @command_history[@command_history_index].dup +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ elsif args.inputs.keyboard.key_down.left~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.left +** Processing line: ~ if args.inputs.keyboard.key_down.control~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.control +** Processing line: ~ prompt.move_cursor_left_word~ +- Inside source: true +*** True Line Result + prompt.move_cursor_left_word +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ prompt.move_cursor_left~ +- Inside source: true +*** True Line Result + prompt.move_cursor_left +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ elsif args.inputs.keyboard.key_down.right~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.right +** Processing line: ~ if args.inputs.keyboard.key_down.control~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.control +** Processing line: ~ prompt.move_cursor_right_word~ +- Inside source: true +*** True Line Result + prompt.move_cursor_right_word +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ prompt.move_cursor_right~ +- Inside source: true +*** True Line Result + prompt.move_cursor_right +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ elsif inputs_scroll_up_full? args~ +- Inside source: true +*** True Line Result + elsif inputs_scroll_up_full? args +** Processing line: ~ scroll_up_full~ +- Inside source: true +*** True Line Result + scroll_up_full +** Processing line: ~ elsif inputs_scroll_down_full? args~ +- Inside source: true +*** True Line Result + elsif inputs_scroll_down_full? args +** Processing line: ~ scroll_down_full~ +- Inside source: true +*** True Line Result + scroll_down_full +** Processing line: ~ elsif inputs_scroll_up_half? args~ +- Inside source: true +*** True Line Result + elsif inputs_scroll_up_half? args +** Processing line: ~ scroll_up_half~ +- Inside source: true +*** True Line Result + scroll_up_half +** Processing line: ~ elsif inputs_scroll_down_half? args~ +- Inside source: true +*** True Line Result + elsif inputs_scroll_down_half? args +** Processing line: ~ scroll_down_half~ +- Inside source: true +*** True Line Result + scroll_down_half +** Processing line: ~ elsif inputs_clear_command? args~ +- Inside source: true +*** True Line Result + elsif inputs_clear_command? args +** Processing line: ~ prompt.clear~ +- Inside source: true +*** True Line Result + prompt.clear +** Processing line: ~ @command_history_index = -1~ +- Inside source: true +*** True Line Result + @command_history_index = -1 +** Processing line: ~ @nonhistory_input = ''~ +- Inside source: true +*** True Line Result + @nonhistory_input = '' +** Processing line: ~ elsif args.inputs.keyboard.key_down.backspace~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.backspace +** Processing line: ~ prompt.backspace~ +- Inside source: true +*** True Line Result + prompt.backspace +** Processing line: ~ elsif args.inputs.keyboard.key_down.delete~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.delete +** Processing line: ~ prompt.delete~ +- Inside source: true +*** True Line Result + prompt.delete +** Processing line: ~ elsif args.inputs.keyboard.key_down.tab~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.tab +** Processing line: ~ prompt.autocomplete~ +- Inside source: true +*** True Line Result + prompt.autocomplete +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.inputs.keyboard.key_down.clear~ +- Inside source: true +*** True Line Result + args.inputs.keyboard.key_down.clear +** Processing line: ~ args.inputs.keyboard.key_up.clear~ +- Inside source: true +*** True Line Result + args.inputs.keyboard.key_up.clear +** Processing line: ~ args.inputs.keyboard.key_held.clear~ +- Inside source: true +*** True Line Result + args.inputs.keyboard.key_held.clear +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def write_primitive_and_return_offset(args, left, y, str, archived: false)~ +- Inside source: true +*** True Line Result + def write_primitive_and_return_offset(args, left, y, str, archived: false) +** Processing line: ~ if str.is_a?(Hash)~ +- Inside source: true +*** True Line Result + if str.is_a?(Hash) +** Processing line: ~ padding = 10~ +- Inside source: true +*** True Line Result + padding = 10 +** Processing line: ~ args.outputs.reserved << [left + 10, y + 5, str[:w], str[:h], str[:path]].sprite~ +- Inside source: true +*** True Line Result + args.outputs.reserved << [left + 10, y + 5, str[:w], str[:h], str[:path]].sprite +** Processing line: ~ return str[:h] + padding~ +- Inside source: true +*** True Line Result + return str[:h] + padding +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ write_line args, left, y, str, archived: archived~ +- Inside source: true +*** True Line Result + write_line args, left, y, str, archived: archived +** Processing line: ~ return line_height_px~ +- Inside source: true +*** True Line Result + return line_height_px +** 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 write_line(args, left, y, str, archived: false)~ +- Inside source: true +*** True Line Result + def write_line(args, left, y, str, archived: false) +** Processing line: ~ color = color_for_log_entry(str)~ +- Inside source: true +*** True Line Result + color = color_for_log_entry(str) +** Processing line: ~ color = color.mult_alpha(0.5) if archived~ +- Inside source: true +*** True Line Result + color = color.mult_alpha(0.5) if archived +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.reserved << font_style.label(x: left.shift_right(10), y: y, text: str, color: color)~ +- Inside source: true +*** True Line Result + args.outputs.reserved << font_style.label(x: left.shift_right(10), y: y, text: str, color: color) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def should_tick?~ +- Inside source: true +*** True Line Result + def should_tick? +** Processing line: ~ return false if !@toggled_at~ +- Inside source: true +*** True Line Result + return false if !@toggled_at +** Processing line: ~ return false if slide_progress == 0~ +- Inside source: true +*** True Line Result + return false if slide_progress == 0 +** Processing line: ~ return false if @disabled~ +- Inside source: true +*** True Line Result + return false if @disabled +** Processing line: ~ return visible?~ +- Inside source: true +*** True Line Result + return visible? +** 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: ~ return if !@toggled_at~ +- Inside source: true +*** True Line Result + return if !@toggled_at +** Processing line: ~ return if slide_progress == 0~ +- Inside source: true +*** True Line Result + return if slide_progress == 0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @bottom = top - (h * slide_progress)~ +- Inside source: true +*** True Line Result + @bottom = top - (h * slide_progress) +** Processing line: ~ args.outputs.reserved << [left, @bottom, w, h, *@background_color.mult_alpha(slide_progress)].solid~ +- Inside source: true +*** True Line Result + args.outputs.reserved << [left, @bottom, w, h, *@background_color.mult_alpha(slide_progress)].solid +** Processing line: ~ args.outputs.reserved << [right.shift_left(110), @bottom.shift_up(630), 100, 100, @logo, 0, (80.0 * slide_progress).to_i].sprite~ +- Inside source: true +*** True Line Result + args.outputs.reserved << [right.shift_left(110), @bottom.shift_up(630), 100, 100, @logo, 0, (80.0 * slide_progress).to_i].sprite +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ y = @bottom + 2 # just give us a little padding at the bottom.~ +- Inside source: true +*** True Line Result + y = @bottom + 2 # just give us a little padding at the bottom. +** Processing line: ~ prompt.render args, x: left.shift_right(10), y: y~ +- Inside source: true +*** True Line Result + prompt.render args, x: left.shift_right(10), y: y +** Processing line: ~ y += line_height_px * 1.5~ +- Inside source: true +*** True Line Result + y += line_height_px * 1.5 +** Processing line: ~ args.outputs.reserved << line(y: y, color: @text_color.mult_alpha(slide_progress))~ +- Inside source: true +*** True Line Result + args.outputs.reserved << line(y: y, color: @text_color.mult_alpha(slide_progress)) +** Processing line: ~ y += line_height_px.to_f / 2.0~ +- Inside source: true +*** True Line Result + y += line_height_px.to_f / 2.0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ((@log.size - @log_offset) - 1).downto(0) do |idx|~ +- Inside source: true +*** True Line Result + ((@log.size - @log_offset) - 1).downto(0) do |idx| +** Processing line: ~ offset_after_write = write_primitive_and_return_offset args, left, y, @log[idx]~ +- Inside source: true +*** True Line Result + offset_after_write = write_primitive_and_return_offset args, left, y, @log[idx] +** Processing line: ~ y += offset_after_write~ +- Inside source: true +*** True Line Result + y += offset_after_write +** Processing line: ~ break if y > top~ +- Inside source: true +*** True Line Result + break if y > top +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # past log separator~ +- Inside source: true +*** True Line Result + # past log separator +** Processing line: ~ args.outputs.reserved << line(y: y + line_height_px.half, color: @text_color.mult_alpha(0.25 * slide_progress))~ +- Inside source: true +*** True Line Result + args.outputs.reserved << line(y: y + line_height_px.half, color: @text_color.mult_alpha(0.25 * slide_progress)) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ y += line_height_px~ +- Inside source: true +*** True Line Result + y += line_height_px +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ((@archived_log.size - @log_offset) - 1).downto(0) do |idx|~ +- Inside source: true +*** True Line Result + ((@archived_log.size - @log_offset) - 1).downto(0) do |idx| +** Processing line: ~ offset_after_write = write_primitive_and_return_offset args, left, y, @archived_log[idx], archived: true~ +- Inside source: true +*** True Line Result + offset_after_write = write_primitive_and_return_offset args, left, y, @archived_log[idx], archived: true +** Processing line: ~ y += offset_after_write~ +- Inside source: true +*** True Line Result + y += offset_after_write +** Processing line: ~ break if y > top~ +- Inside source: true +*** True Line Result + break if y > top +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ render_log_offset args~ +- Inside source: true +*** True Line Result + render_log_offset args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_log_offset args~ +- Inside source: true +*** True Line Result + def render_log_offset args +** Processing line: ~ return if @log_offset <= 0~ +- Inside source: true +*** True Line Result + return if @log_offset <= 0 +** Processing line: ~ args.outputs.reserved << font_style.label(~ +- Inside source: true +*** True Line Result + args.outputs.reserved << font_style.label( +** Processing line: ~ x: right.shift_left(5),~ +- Inside source: true +*** True Line Result + x: right.shift_left(5), +** Processing line: ~ y: top.shift_down(5 + line_height_px),~ +- Inside source: true +*** True Line Result + y: top.shift_down(5 + line_height_px), +** Processing line: ~ text: "[#{@log_offset}/#{@log.size}]",~ +- Inside source: true +*** True Line Result + text: "[#{@log_offset}/#{@log.size}]", +** Processing line: ~ color: @text_color,~ +- Inside source: true +*** True Line Result + color: @text_color, +** Processing line: ~ alignment_enum: 2~ +- Inside source: true +*** True Line Result + alignment_enum: 2 +** 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 include_error_marker? text~ +- Inside source: true +*** True Line Result + def include_error_marker? text +** Processing line: ~ include_any_words?(text.gsub('OutputsDeprecated', ''), error_markers)~ +- Inside source: true +*** True Line Result + include_any_words?(text.gsub('OutputsDeprecated', ''), error_markers) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def error_markers~ +- Inside source: true +*** True Line Result + def error_markers +** Processing line: ~ ["exception:", "error:", "undefined method", "failed", "syntax", "deprecated"]~ +- Inside source: true +*** True Line Result + ["exception:", "error:", "undefined method", "failed", "syntax", "deprecated"] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def include_subdued_markers? text~ +- Inside source: true +*** True Line Result + def include_subdued_markers? text +** Processing line: ~ include_any_words? text, subdued_markers~ +- Inside source: true +*** True Line Result + include_any_words? text, subdued_markers +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def include_any_words? text, words~ +- Inside source: true +*** True Line Result + def include_any_words? text, words +** Processing line: ~ words.any? { |w| text.downcase.include?(w) && !text.downcase.include?(":#{w}") }~ +- Inside source: true +*** True Line Result + words.any? { |w| text.downcase.include?(w) && !text.downcase.include?(":#{w}") } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def subdued_markers~ +- Inside source: true +*** True Line Result + def subdued_markers +** Processing line: ~ ["reloaded", "exported the", "~require~"]~ +- Inside source: true +*** True Line Result + ["reloaded", "exported the", "~require~"] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calc args~ +- Inside source: true +*** True Line Result + def calc args +** Processing line: ~ if visible? &&~ +- Inside source: true +*** True Line Result + if visible? && +** Processing line: ~ @show_reason == :toast &&~ +- Inside source: true +*** True Line Result + @show_reason == :toast && +** Processing line: ~ @toasted_at &&~ +- Inside source: true +*** True Line Result + @toasted_at && +** Processing line: ~ @toasted_at.elapsed?(@toast_duration, Kernel.global_tick_count)~ +- Inside source: true +*** True Line Result + @toasted_at.elapsed?(@toast_duration, Kernel.global_tick_count) +** Processing line: ~ hide~ +- Inside source: true +*** True Line Result + hide +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !$gtk.paused? && visible? && (show_reason == :exception || show_reason == :exception_on_load)~ +- Inside source: true +*** True Line Result + if !$gtk.paused? && visible? && (show_reason == :exception || show_reason == :exception_on_load) +** Processing line: ~ hide~ +- Inside source: true +*** True Line Result + hide +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if $gtk.files_reloaded.length > 0~ +- Inside source: true +*** True Line Result + if $gtk.files_reloaded.length > 0 +** Processing line: ~ clear_toast~ +- Inside source: true +*** True Line Result + clear_toast +** Processing line: ~ @toast_ids.clear~ +- Inside source: true +*** True Line Result + @toast_ids.clear +** 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: ~ begin~ +- Inside source: true +*** True Line Result + begin +** Processing line: ~ return if @disabled~ +- Inside source: true +*** True Line Result + return if @disabled +** Processing line: ~ render args~ +- Inside source: true +*** True Line Result + render args +** Processing line: ~ process_inputs args~ +- Inside source: true +*** True Line Result + process_inputs args +** Processing line: ~ return unless should_tick?~ +- Inside source: true +*** True Line Result + return unless should_tick? +** Processing line: ~ calc args~ +- Inside source: true +*** True Line Result + calc args +** Processing line: ~ prompt.tick~ +- Inside source: true +*** True Line Result + prompt.tick +** Processing line: ~ menu.tick args~ +- Inside source: true +*** True Line Result + menu.tick args +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ begin~ +- Inside source: true +*** True Line Result + begin +** Processing line: ~ puts "#{e}"~ +- Inside source: true +*** True Line Result + puts "#{e}" +** Processing line: ~ puts "* FATAL: The GTK::Console console threw an unhandled exception and has been reset. You should report this exception (along with reproduction steps) to DragonRuby."~ +- Inside source: true +*** True Line Result + puts "* FATAL: The GTK::Console console threw an unhandled exception and has been reset. You should report this exception (along with reproduction steps) to DragonRuby." +** Processing line: ~ rescue~ +- Inside source: true +*** True Line Result + rescue +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ @disabled = true~ +- Inside source: true +*** True Line Result + @disabled = true +** Processing line: ~ $stdout.puts e~ +- Inside source: true +*** True Line Result + $stdout.puts e +** Processing line: ~ $stdout.puts "* FATAL: The GTK::Console console threw an unhandled exception and has been reset. You should report this exception (along with reproduction steps) to DragonRuby."~ +- Inside source: true +*** True Line Result + $stdout.puts "* FATAL: The GTK::Console console threw an unhandled exception and has been reset. You should report this exception (along with reproduction steps) to DragonRuby." +** 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 set_command_with_history_silent command, histories, show_reason = nil~ +- Inside source: true +*** True Line Result + def set_command_with_history_silent command, histories, show_reason = nil +** Processing line: ~ set_command_extended command: command, histories: histories, show_reason: show_reason~ +- Inside source: true +*** True Line Result + set_command_extended command: command, histories: histories, show_reason: show_reason +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def defaults_set_command_extended~ +- Inside source: true +*** True Line Result + def defaults_set_command_extended +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ command: "puts 'Hello World'",~ +- Inside source: true +*** True Line Result + command: "puts 'Hello World'", +** Processing line: ~ histories: [],~ +- Inside source: true +*** True Line Result + histories: [], +** Processing line: ~ show_reason: nil,~ +- Inside source: true +*** True Line Result + show_reason: nil, +** Processing line: ~ force: false~ +- Inside source: true +*** True Line Result + force: 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 set_command_extended opts~ +- Inside source: true +*** True Line Result + def set_command_extended opts +** Processing line: ~ opts = defaults_set_command_extended.merge opts~ +- Inside source: true +*** True Line Result + opts = defaults_set_command_extended.merge opts +** Processing line: ~ @command_history.concat opts[:histories]~ +- Inside source: true +*** True Line Result + @command_history.concat opts[:histories] +** Processing line: ~ @command_history << opts[:command] if @command_history[-1] != opts[:command]~ +- Inside source: true +*** True Line Result + @command_history << opts[:command] if @command_history[-1] != opts[:command] +** Processing line: ~ self.current_input_str = opts[:command] if @command_set_at != Kernel.global_tick_count || opts[:force]~ +- Inside source: true +*** True Line Result + self.current_input_str = opts[:command] if @command_set_at != Kernel.global_tick_count || opts[:force] +** Processing line: ~ @command_set_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @command_set_at = Kernel.global_tick_count +** Processing line: ~ @command_history_index = -1~ +- Inside source: true +*** True Line Result + @command_history_index = -1 +** Processing line: ~ save_history~ +- Inside source: true +*** True Line Result + save_history +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_command_with_history command, histories, show_reason = nil~ +- Inside source: true +*** True Line Result + def set_command_with_history command, histories, show_reason = nil +** Processing line: ~ set_command_with_history_silent command, histories, show_reason~ +- Inside source: true +*** True Line Result + set_command_with_history_silent command, histories, show_reason +** Processing line: ~ show show_reason~ +- Inside source: true +*** True Line Result + show show_reason +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def set_command command, show_reason = nil~ +- Inside source: true +*** True Line Result + def set_command command, show_reason = nil +** Processing line: ~ set_command_silent command, show_reason~ +- Inside source: true +*** True Line Result + set_command_silent command, show_reason +** Processing line: ~ show show_reason~ +- Inside source: true +*** True Line Result + show show_reason +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_command_silent command, show_reason = nil~ +- Inside source: true +*** True Line Result + def set_command_silent command, show_reason = nil +** Processing line: ~ set_command_with_history_silent command, [], show_reason~ +- Inside source: true +*** True Line Result + set_command_with_history_silent command, [], show_reason +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_system_command command, show_reason = nil~ +- Inside source: true +*** True Line Result + def set_system_command command, show_reason = nil +** Processing line: ~ if $gtk.platform == "Mac OS X"~ +- Inside source: true +*** True Line Result + if $gtk.platform == "Mac OS X" +** Processing line: ~ set_command_silent "$gtk.system \"open #{command}\""~ +- Inside source: true +*** True Line Result + set_command_silent "$gtk.system \"open #{command}\"" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ set_command_silent "$gtk.system \"start #{command}\""~ +- Inside source: true +*** True Line Result + set_command_silent "$gtk.system \"start #{command}\"" +** 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 system_command~ +- Inside source: true +*** True Line Result + def system_command +** Processing line: ~ if $gtk.platform == "Mac OS X"~ +- Inside source: true +*** True Line Result + if $gtk.platform == "Mac OS X" +** Processing line: ~ "open"~ +- Inside source: true +*** True Line Result + "open" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ "start"~ +- Inside source: true +*** True Line Result + "start" +** 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: ~ private~ +- Inside source: true +*** True Line Result + private +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def w~ +- Inside source: true +*** True Line Result + def w +** Processing line: ~ $gtk.logical_width~ +- Inside source: true +*** True Line Result + $gtk.logical_width +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def h~ +- Inside source: true +*** True Line Result + def h +** Processing line: ~ $gtk.logical_height~ +- Inside source: true +*** True Line Result + $gtk.logical_height +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # methods top; left; right~ +- Inside source: true +*** True Line Result + # methods top; left; right +** Processing line: ~ # Forward to grid~ +- Inside source: true +*** True Line Result + # Forward to grid +** Processing line: ~ %i[top left right].each do |method|~ +- Inside source: true +*** True Line Result + %i[top left right].each do |method| +** Processing line: ~ define_method method do~ +- Inside source: true +*** True Line Result + define_method method do +** Processing line: ~ $gtk.args.grid.send(method)~ +- Inside source: true +*** True Line Result + $gtk.args.grid.send(method) +** 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 line_height_px~ +- Inside source: true +*** True Line Result + def line_height_px +** Processing line: ~ font_style.line_height_px~ +- Inside source: true +*** True Line Result + font_style.line_height_px +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def lines_on_one_page~ +- Inside source: true +*** True Line Result + def lines_on_one_page +** Processing line: ~ (h - 4).idiv(line_height_px)~ +- Inside source: true +*** True Line Result + (h - 4).idiv(line_height_px) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def line(y:, color:)~ +- Inside source: true +*** True Line Result + def line(y:, color:) +** Processing line: ~ [left, y, right, y, *color].line~ +- Inside source: true +*** True Line Result + [left, y, right, y, *color].line +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def include_row_marker? log_entry~ +- Inside source: true +*** True Line Result + def include_row_marker? log_entry +** Processing line: ~ log_entry[0] == "|"~ +- Inside source: true +*** True Line Result + log_entry[0] == "|" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def include_header_marker? log_entry~ +- Inside source: true +*** True Line Result + def include_header_marker? log_entry +** Processing line: ~ return false if (log_entry.strip.include? ".rb")~ +- Inside source: true +*** True Line Result + return false if (log_entry.strip.include? ".rb") +** Processing line: ~ (log_entry.start_with? "* ") ||~ +- Inside source: true +*** True Line Result + (log_entry.start_with? "* ") || +** Processing line: ~ (log_entry.start_with? "** ") ||~ +- Inside source: true +*** True Line Result + (log_entry.start_with? "** ") || +** Processing line: ~ (log_entry.start_with? "*** ") ||~ +- Inside source: true +*** True Line Result + (log_entry.start_with? "*** ") || +** Processing line: ~ (log_entry.start_with? "**** ")~ +- Inside source: true +*** True Line Result + (log_entry.start_with? "**** ") +** 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~ +- Inside source: true +*** True Line Result + if include_row_marker? log_entry +** Processing line: ~ @text_color~ +- Inside source: true +*** True Line Result + @text_color +** Processing line: ~ elsif include_error_marker? log_entry~ +- Inside source: true +*** True Line Result + elsif include_error_marker? log_entry +** Processing line: ~ @error_color~ +- Inside source: true +*** True Line Result + @error_color +** Processing line: ~ elsif include_subdued_markers? log_entry~ +- Inside source: true +*** True Line Result + elsif include_subdued_markers? log_entry +** Processing line: ~ @text_color.mult_alpha(0.5)~ +- Inside source: true +*** True Line Result + @text_color.mult_alpha(0.5) +** Processing line: ~ elsif include_header_marker? log_entry~ +- Inside source: true +*** True Line Result + elsif include_header_marker? log_entry +** Processing line: ~ @header_color~ +- Inside source: true +*** True Line Result + @header_color +** Processing line: ~ elsif log_entry.start_with?("====")~ +- Inside source: true +*** True Line Result + elsif log_entry.start_with?("====") +** Processing line: ~ @header_color~ +- Inside source: true +*** True Line Result + @header_color +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @text_color~ +- Inside source: true +*** True Line Result + @text_color +** 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 prompt~ +- Inside source: true +*** True Line Result + def prompt +** Processing line: ~ @prompt ||= Prompt.new(font_style: font_style, text_color: @text_color, console_text_width: console_text_width)~ +- Inside source: true +*** True Line Result + @prompt ||= Prompt.new(font_style: font_style, text_color: @text_color, console_text_width: console_text_width) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def current_input_str~ +- Inside source: true +*** True Line Result + def current_input_str +** Processing line: ~ prompt.current_input_str~ +- Inside source: true +*** True Line Result + prompt.current_input_str +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def current_input_str=(str)~ +- Inside source: true +*** True Line Result + def current_input_str=(str) +** Processing line: ~ prompt.current_input_str = str~ +- Inside source: true +*** True Line Result + prompt.current_input_str = str +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def clear~ +- Inside source: true +*** True Line Result + def clear +** Processing line: ~ @archived_log.clear~ +- Inside source: true +*** True Line Result + @archived_log.clear +** Processing line: ~ @log.clear~ +- Inside source: true +*** True Line Result + @log.clear +** Processing line: ~ @prompt.clear~ +- Inside source: true +*** True Line Result + @prompt.clear +** Processing line: ~ :console_silent_eval~ +- Inside source: true +*** True Line Result + :console_silent_eval +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def slide_progress~ +- Inside source: true +*** True Line Result + def slide_progress +** Processing line: ~ return 0 if !@toggled_at~ +- Inside source: true +*** True Line Result + return 0 if !@toggled_at +** Processing line: ~ if visible?~ +- Inside source: true +*** True Line Result + if visible? +** Processing line: ~ @slide_progress = @toggled_at.global_ease(@animation_duration, :flip, :quint, :flip)~ +- Inside source: true +*** True Line Result + @slide_progress = @toggled_at.global_ease(@animation_duration, :flip, :quint, :flip) +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @slide_progress = @toggled_at.global_ease(@animation_duration, :flip, :quint)~ +- Inside source: true +*** True Line Result + @slide_progress = @toggled_at.global_ease(@animation_duration, :flip, :quint) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ @slide_progress~ +- Inside source: true +*** True Line Result + @slide_progress +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** console_color.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** console_color.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/console_color.rb~ +- Inside source: true +*** True Line Result + # ./dragon/console_color.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # console_color.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # console_color.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright:~ +- Inside source: true +*** True Line Result + # Contributors outside of DragonRuby who also hold Copyright: +** Processing line: ~ # - Kevin Fischer: https://github.com/kfischer-okarin~ +- Inside source: true +*** True Line Result + # - Kevin Fischer: https://github.com/kfischer-okarin +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Console~ +- Inside source: true +*** True Line Result + class Console +** Processing line: ~ class Color~ +- Inside source: true +*** True Line Result + class Color +** Processing line: ~ def initialize(color)~ +- Inside source: true +*** True Line Result + def initialize(color) +** Processing line: ~ @color = color~ +- Inside source: true +*** True Line Result + @color = color +** Processing line: ~ @color << 255 if @color.size == 3~ +- Inside source: true +*** True Line Result + @color << 255 if @color.size == 3 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def mult_alpha(alpha_modifier)~ +- Inside source: true +*** True Line Result + def mult_alpha(alpha_modifier) +** Processing line: ~ Color.new [@color[0], @color[1], @color[2], (@color[3].to_f * alpha_modifier).to_i]~ +- Inside source: true +*** True Line Result + Color.new [@color[0], @color[1], @color[2], (@color[3].to_f * alpha_modifier).to_i] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Support splat operator~ +- Inside source: true +*** True Line Result + # Support splat operator +** Processing line: ~ def to_a~ +- Inside source: true +*** True Line Result + def to_a +** 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: ~ def to_h~ +- Inside source: true +*** True Line Result + def to_h +** Processing line: ~ { r: @color[0], g: @color[1], b: @color[2], a: @color[3] }~ +- Inside source: true +*** True Line Result + { r: @color[0], g: @color[1], b: @color[2], a: @color[3] } +** 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: ~#+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: ~*** console_font_style.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** console_font_style.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/console_font_style.rb~ +- Inside source: true +*** True Line Result + # ./dragon/console_font_style.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # console_font_style.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # console_font_style.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright:~ +- Inside source: true +*** True Line Result + # Contributors outside of DragonRuby who also hold Copyright: +** Processing line: ~ # - Kevin Fischer: https://github.com/kfischer-okarin~ +- Inside source: true +*** True Line Result + # - Kevin Fischer: https://github.com/kfischer-okarin +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Console~ +- Inside source: true +*** True Line Result + class Console +** Processing line: ~ class FontStyle~ +- Inside source: true +*** True Line Result + class FontStyle +** Processing line: ~ attr_reader :font, :size_enum, :line_height~ +- Inside source: true +*** True Line Result + attr_reader :font, :size_enum, :line_height +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize(font:, size_enum:, line_height:)~ +- Inside source: true +*** True Line Result + def initialize(font:, size_enum:, line_height:) +** Processing line: ~ @font = font~ +- Inside source: true +*** True Line Result + @font = font +** Processing line: ~ @size_enum = size_enum~ +- Inside source: true +*** True Line Result + @size_enum = size_enum +** Processing line: ~ @line_height = line_height~ +- Inside source: true +*** True Line Result + @line_height = line_height +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def letter_size~ +- Inside source: true +*** True Line Result + def letter_size +** Processing line: ~ @letter_size ||= $gtk.calcstringbox 'W', size_enum, font~ +- Inside source: true +*** True Line Result + @letter_size ||= $gtk.calcstringbox 'W', size_enum, font +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def line_height_px~ +- Inside source: true +*** True Line Result + def line_height_px +** Processing line: ~ @line_height_px ||= letter_size.y * line_height~ +- Inside source: true +*** True Line Result + @line_height_px ||= letter_size.y * line_height +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def label(x:, y:, text:, color:, alignment_enum: 0)~ +- Inside source: true +*** True Line Result + def label(x:, y:, text:, color:, alignment_enum: 0) +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ x: x,~ +- Inside source: true +*** True Line Result + x: x, +** Processing line: ~ y: y.shift_up(line_height_px), # !!! FIXME: remove .shift_up(line_height_px) when we fix coordinate origin on labels.~ +- Inside source: true +*** True Line Result + y: y.shift_up(line_height_px), # !!! FIXME: remove .shift_up(line_height_px) when we fix coordinate origin on labels. +** Processing line: ~ text: text,~ +- Inside source: true +*** True Line Result + text: text, +** Processing line: ~ font: font,~ +- Inside source: true +*** True Line Result + font: font, +** Processing line: ~ size_enum: size_enum,~ +- Inside source: true +*** True Line Result + size_enum: size_enum, +** Processing line: ~ alignment_enum: alignment_enum,~ +- Inside source: true +*** True Line Result + alignment_enum: alignment_enum, +** Processing line: ~ **color.to_h,~ +- Inside source: true +*** True Line Result + **color.to_h, +** Processing line: ~ }.label~ +- Inside source: true +*** True Line Result + }.label +** 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: ~#+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: ~*** console_menu.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** console_menu.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/console_menu.rb~ +- Inside source: true +*** True Line Result + # ./dragon/console_menu.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # console_menu.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # console_menu.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Console~ +- Inside source: true +*** True Line Result + class Console +** Processing line: ~ class Menu~ +- Inside source: true +*** True Line Result + class Menu +** Processing line: ~ attr_accessor :buttons~ +- Inside source: true +*** True Line Result + attr_accessor :buttons +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize console~ +- Inside source: true +*** True Line Result + def initialize console +** Processing line: ~ @console = console~ +- Inside source: true +*** True Line Result + @console = console +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def record_clicked~ +- Inside source: true +*** True Line Result + def record_clicked +** Processing line: ~ $recording.start 100~ +- Inside source: true +*** True Line Result + $recording.start 100 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def replay_clicked~ +- Inside source: true +*** True Line Result + def replay_clicked +** Processing line: ~ $replay.start 'replay.txt'~ +- Inside source: true +*** True Line Result + $replay.start 'replay.txt' +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def reset_clicked~ +- Inside source: true +*** True Line Result + def reset_clicked +** Processing line: ~ $gtk.reset~ +- Inside source: true +*** True Line Result + $gtk.reset +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def scroll_up_clicked~ +- Inside source: true +*** True Line Result + def scroll_up_clicked +** Processing line: ~ @console.scroll_up_half~ +- Inside source: true +*** True Line Result + @console.scroll_up_half +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def scroll_down_clicked~ +- Inside source: true +*** True Line Result + def scroll_down_clicked +** Processing line: ~ @console.scroll_down_half~ +- Inside source: true +*** True Line Result + @console.scroll_down_half +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def show_menu_clicked~ +- Inside source: true +*** True Line Result + def show_menu_clicked +** Processing line: ~ @menu_shown = :visible~ +- Inside source: true +*** True Line Result + @menu_shown = :visible +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def close_clicked~ +- Inside source: true +*** True Line Result + def close_clicked +** Processing line: ~ @menu_shown = :hidden~ +- Inside source: true +*** True Line Result + @menu_shown = :hidden +** Processing line: ~ @console.hide~ +- Inside source: true +*** True Line Result + @console.hide +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def hide_menu_clicked~ +- Inside source: true +*** True Line Result + def hide_menu_clicked +** Processing line: ~ @menu_shown = :hidden~ +- Inside source: true +*** True Line Result + @menu_shown = :hidden +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def framerate_diagnostics_clicked~ +- Inside source: true +*** True Line Result + def framerate_diagnostics_clicked +** Processing line: ~ @console.scroll_to_bottom~ +- Inside source: true +*** True Line Result + @console.scroll_to_bottom +** Processing line: ~ $gtk.framerate_diagnostics~ +- Inside source: true +*** True Line Result + $gtk.framerate_diagnostics +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def itch_wizard_clicked~ +- Inside source: true +*** True Line Result + def itch_wizard_clicked +** Processing line: ~ @console.scroll_to_bottom~ +- Inside source: true +*** True Line Result + @console.scroll_to_bottom +** Processing line: ~ $wizards.itch.start~ +- Inside source: true +*** True Line Result + $wizards.itch.start +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def docs_clicked~ +- Inside source: true +*** True Line Result + def docs_clicked +** Processing line: ~ @console.scroll_to_bottom~ +- Inside source: true +*** True Line Result + @console.scroll_to_bottom +** Processing line: ~ log Kernel.docs_classes~ +- Inside source: true +*** True Line Result + log Kernel.docs_classes +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def scroll_end_clicked~ +- Inside source: true +*** True Line Result + def scroll_end_clicked +** Processing line: ~ @console.scroll_to_bottom~ +- Inside source: true +*** True Line Result + @console.scroll_to_bottom +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def custom_buttons~ +- Inside source: true +*** True Line Result + def custom_buttons +** 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 tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ return unless @console.visible?~ +- Inside source: true +*** True Line Result + return unless @console.visible? +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @menu_shown ||= :hidden~ +- Inside source: true +*** True Line Result + @menu_shown ||= :hidden +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if $gtk.production~ +- Inside source: true +*** True Line Result + if $gtk.production +** Processing line: ~ @buttons = [~ +- Inside source: true +*** True Line Result + @buttons = [ +** Processing line: ~ (button id: :record, row: 0, col: 9, text: "record gameplay", method: :record_clicked),~ +- Inside source: true +*** True Line Result + (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),~ +- Inside source: true +*** True Line Result + (button id: :replay, row: 0, col: 10, text: "start replay", method: :replay_clicked), +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ elsif @menu_shown == :hidden~ +- Inside source: true +*** True Line Result + elsif @menu_shown == :hidden +** Processing line: ~ @buttons = [~ +- Inside source: true +*** True Line Result + @buttons = [ +** Processing line: ~ (button id: :show_menu, row: 0, col: 10, text: "show menu", method: :show_menu_clicked),~ +- Inside source: true +*** True Line Result + (button id: :show_menu, row: 0, col: 10, text: "show menu", method: :show_menu_clicked), +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @buttons = [~ +- Inside source: true +*** True Line Result + @buttons = [ +** Processing line: ~ (button id: :scroll_up, row: 0, col: 6, text: "scroll up", method: :scroll_up_clicked),~ +- Inside source: true +*** True Line Result + (button id: :scroll_up, row: 0, col: 6, text: "scroll up", method: :scroll_up_clicked), +** Processing line: ~ (button id: :scroll_down, row: 0, col: 7, text: "scroll down", method: :scroll_down_clicked),~ +- Inside source: true +*** True Line Result + (button id: :scroll_down, row: 0, col: 7, text: "scroll down", method: :scroll_down_clicked), +** Processing line: ~ (button id: :scroll_down, row: 0, col: 8, text: "scroll end", method: :scroll_end_clicked),~ +- Inside source: true +*** True Line Result + (button id: :scroll_down, row: 0, col: 8, text: "scroll end", method: :scroll_end_clicked), +** Processing line: ~ (button id: :close, row: 0, col: 9, text: "close console", method: :close_clicked),~ +- Inside source: true +*** True Line Result + (button id: :close, row: 0, col: 9, text: "close console", method: :close_clicked), +** Processing line: ~ (button id: :hide, row: 0, col: 10, text: "hide menu", method: :hide_menu_clicked),~ +- Inside source: true +*** True Line Result + (button id: :hide, row: 0, col: 10, text: "hide menu", method: :hide_menu_clicked), +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ (button id: :record, row: 1, col: 7, text: "record gameplay", method: :record_clicked),~ +- Inside source: true +*** True Line Result + (button id: :record, row: 1, col: 7, text: "record gameplay", method: :record_clicked), +** Processing line: ~ (button id: :replay, row: 1, col: 8, text: "start replay", method: :replay_clicked),~ +- Inside source: true +*** True Line Result + (button id: :replay, row: 1, col: 8, text: "start replay", method: :replay_clicked), +** Processing line: ~ (button id: :record, row: 1, col: 9, text: "framerate diagnostics", method: :framerate_diagnostics_clicked),~ +- Inside source: true +*** True Line Result + (button id: :record, row: 1, col: 9, text: "framerate diagnostics", method: :framerate_diagnostics_clicked), +** Processing line: ~ (button id: :reset, row: 1, col: 10, text: "reset game", method: :reset_clicked),~ +- Inside source: true +*** True Line Result + (button id: :reset, row: 1, col: 10, text: "reset game", method: :reset_clicked), +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ (button id: :reset, row: 2, col: 10, text: "docs", method: :docs_clicked),~ +- Inside source: true +*** True Line Result + (button id: :reset, row: 2, col: 10, text: "docs", method: :docs_clicked), +** Processing line: ~ (button id: :reset, row: 2, col: 9, text: "itch wizard", method: :itch_wizard_clicked),~ +- Inside source: true +*** True Line Result + (button id: :reset, row: 2, col: 9, text: "itch wizard", method: :itch_wizard_clicked), +** Processing line: ~ *custom_buttons~ +- Inside source: true +*** True Line Result + *custom_buttons +** 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: ~ # render~ +- Inside source: true +*** True Line Result + # render +** Processing line: ~ args.outputs.reserved << @buttons.map { |b| b[:primitives] }~ +- Inside source: true +*** True Line Result + args.outputs.reserved << @buttons.map { |b| b[:primitives] } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # inputs~ +- Inside source: true +*** True Line Result + # inputs +** Processing line: ~ if args.inputs.mouse.click~ +- Inside source: true +*** True Line Result + if args.inputs.mouse.click +** Processing line: ~ clicked = @buttons.find { |b| args.inputs.mouse.inside_rect? b[:rect] }~ +- Inside source: true +*** True Line Result + clicked = @buttons.find { |b| args.inputs.mouse.inside_rect? b[:rect] } +** Processing line: ~ if clicked~ +- Inside source: true +*** True Line Result + if clicked +** Processing line: ~ args.inputs.mouse.click = nil~ +- Inside source: true +*** True Line Result + args.inputs.mouse.click = nil +** Processing line: ~ send clicked[:method]~ +- Inside source: true +*** True Line Result + send clicked[:method] +** 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 rect_for_layout row, col~ +- Inside source: true +*** True Line Result + def rect_for_layout row, col +** Processing line: ~ col_width = 100~ +- Inside source: true +*** True Line Result + col_width = 100 +** Processing line: ~ row_height = 50~ +- Inside source: true +*** True Line Result + row_height = 50 +** Processing line: ~ col_margin = 5~ +- Inside source: true +*** True Line Result + col_margin = 5 +** Processing line: ~ row_margin = 5~ +- Inside source: true +*** True Line Result + row_margin = 5 +** Processing line: ~ x = (col_margin + (col * col_width) + (col * col_margin))~ +- Inside source: true +*** True Line Result + x = (col_margin + (col * col_width) + (col * col_margin)) +** Processing line: ~ y = (row_margin + (row * row_height) + (row * row_margin) + row_height).from_top~ +- Inside source: true +*** True Line Result + y = (row_margin + (row * row_height) + (row * row_margin) + row_height).from_top +** Processing line: ~ { x: x, y: y, w: col_width, h: row_height }~ +- Inside source: true +*** True Line Result + { x: x, y: y, w: col_width, h: row_height } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def button args~ +- Inside source: true +*** True Line Result + def button args +** Processing line: ~ id, row, col, text, method = args[:id], args[:row], args[:col], args[:text], args[:method]~ +- Inside source: true +*** True Line Result + id, row, col, text, method = args[:id], args[:row], args[:col], args[:text], args[:method] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ font_height = @console.font_style.line_height_px.half~ +- Inside source: true +*** True Line Result + font_height = @console.font_style.line_height_px.half +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ id: id,~ +- Inside source: true +*** True Line Result + id: id, +** Processing line: ~ rect: (rect_for_layout row, col),~ +- Inside source: true +*** True Line Result + rect: (rect_for_layout row, col), +** Processing line: ~ text: text,~ +- Inside source: true +*** True Line Result + text: text, +** Processing line: ~ method: method~ +- Inside source: true +*** True Line Result + method: method +** Processing line: ~ }.let do |entity|~ +- Inside source: true +*** True Line Result + }.let do |entity| +** Processing line: ~ primitives = []~ +- Inside source: true +*** True Line Result + primitives = [] +** Processing line: ~ primitives << entity[:rect].merge(a: 164).solid~ +- 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~ +- Inside source: true +*** True Line Result + primitives << entity[:rect].merge(r: 255, g: 255, b: 255).border +** Processing line: ~ primitives << text.wrapped_lines(5)~ +- Inside source: true +*** True Line Result + primitives << text.wrapped_lines(5) +** Processing line: ~ .map_with_index do |l, i|~ +- Inside source: true +*** True Line Result + .map_with_index do |l, i| +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ entity[:rect][:x] + entity[:rect][:w].half,~ +- Inside source: true +*** True Line Result + entity[:rect][:x] + entity[:rect][:w].half, +** Processing line: ~ entity[:rect][:y] + entity[:rect][:h].half + font_height - (i * (font_height + 2)),~ +- Inside source: true +*** True Line Result + entity[:rect][:y] + entity[:rect][:h].half + font_height - (i * (font_height + 2)), +** Processing line: ~ l, -3, 1, 255, 255, 255~ +- Inside source: true +*** True Line Result + l, -3, 1, 255, 255, 255 +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ end.labels~ +- Inside source: true +*** True Line Result + end.labels +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ entity.merge(primitives: primitives)~ +- Inside source: true +*** True Line Result + entity.merge(primitives: 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: ~ def serialize~ +- Inside source: true +*** True Line Result + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ not_supported: "#{self}"~ +- Inside source: true +*** True Line Result + not_supported: "#{self}" +** 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: ~ 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: ~*** console_prompt.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** console_prompt.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/console_prompt.rb~ +- Inside source: true +*** True Line Result + # ./dragon/console_prompt.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # console_prompt.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # console_prompt.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright:~ +- Inside source: true +*** True Line Result + # Contributors outside of DragonRuby who also hold Copyright: +** Processing line: ~ # - Kevin Fischer: https://github.com/kfischer-okarin~ +- Inside source: true +*** True Line Result + # - Kevin Fischer: https://github.com/kfischer-okarin +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Console~ +- Inside source: true +*** True Line Result + class Console +** Processing line: ~ class Prompt~ +- Inside source: true +*** True Line Result + class Prompt +** Processing line: ~ # ? Can be changed, it was just taken from my editor settings :>~ +- Inside source: true +*** True Line Result + # ? Can be changed, it was just taken from my editor settings :> +** Processing line: ~ WORD_LIMITER_CHARS = "`~!@#$%^&*-=+()[]{}\|;:'\",.<>/?_ \t\n\0".chars~ +- Inside source: true +*** True Line Result + WORD_LIMITER_CHARS = "`~!@#$%^&*-=+()[]{}\|;:'\",.<>/?_ \t\n\0".chars +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ attr_accessor :current_input_str, :font_style, :console_text_width, :last_input_str, :last_input_str_changed~ +- Inside source: true +*** True Line Result + attr_accessor :current_input_str, :font_style, :console_text_width, :last_input_str, :last_input_str_changed +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize(font_style:, text_color:, console_text_width:)~ +- Inside source: true +*** True Line Result + def initialize(font_style:, text_color:, console_text_width:) +** Processing line: ~ @prompt = '-> '~ +- Inside source: true +*** True Line Result + @prompt = '-> ' +** Processing line: ~ @current_input_str = ''~ +- Inside source: true +*** True Line Result + @current_input_str = '' +** Processing line: ~ @font_style = font_style~ +- Inside source: true +*** True Line Result + @font_style = font_style +** Processing line: ~ @text_color = text_color~ +- Inside source: true +*** True Line Result + @text_color = text_color +** Processing line: ~ @cursor_color = Color.new [187, 21, 6]~ +- Inside source: true +*** True Line Result + @cursor_color = Color.new [187, 21, 6] +** Processing line: ~ @console_text_width = console_text_width~ +- Inside source: true +*** True Line Result + @console_text_width = console_text_width +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @cursor_position = 0~ +- Inside source: true +*** True Line Result + @cursor_position = 0 +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @last_autocomplete_prefix = nil~ +- Inside source: true +*** True Line Result + @last_autocomplete_prefix = nil +** Processing line: ~ @next_candidate_index = 0~ +- Inside source: true +*** True Line Result + @next_candidate_index = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def update_cursor_position_px~ +- Inside source: true +*** True Line Result + def update_cursor_position_px +** Processing line: ~ @cursor_position_px = ($gtk.calcstringbox (@prompt + @current_input_str[0...@cursor_position]), @font_style.size_enum, @font_style.font).x~ +- Inside source: true +*** True Line Result + @cursor_position_px = ($gtk.calcstringbox (@prompt + @current_input_str[0...@cursor_position]), @font_style.size_enum, @font_style.font).x +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def current_input_str=(str)~ +- Inside source: true +*** True Line Result + def current_input_str=(str) +** Processing line: ~ @current_input_str = str~ +- Inside source: true +*** True Line Result + @current_input_str = str +** Processing line: ~ @cursor_position = str.length~ +- Inside source: true +*** True Line Result + @cursor_position = str.length +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def <<(str)~ +- Inside source: true +*** True Line Result + def <<(str) +** Processing line: ~ @current_input_str = @current_input_str[0...@cursor_position] + str + @current_input_str[@cursor_position..-1]~ +- Inside source: true +*** True Line Result + @current_input_str = @current_input_str[0...@cursor_position] + str + @current_input_str[@cursor_position..-1] +** Processing line: ~ @cursor_position += str.length~ +- Inside source: true +*** True Line Result + @cursor_position += str.length +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~ @current_input_changed_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @current_input_changed_at = Kernel.global_tick_count +** Processing line: ~ reset_autocomplete~ +- Inside source: true +*** True Line Result + reset_autocomplete +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def backspace~ +- Inside source: true +*** True Line Result + def backspace +** Processing line: ~ return if current_input_str.length.zero? || @cursor_position.zero?~ +- Inside source: true +*** True Line Result + return if current_input_str.length.zero? || @cursor_position.zero? +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @current_input_str = @current_input_str[0...(@cursor_position - 1)] + @current_input_str[@cursor_position..-1]~ +- Inside source: true +*** True Line Result + @current_input_str = @current_input_str[0...(@cursor_position - 1)] + @current_input_str[@cursor_position..-1] +** Processing line: ~ @cursor_position -= 1~ +- Inside source: true +*** True Line Result + @cursor_position -= 1 +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~ reset_autocomplete~ +- Inside source: true +*** True Line Result + reset_autocomplete +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def delete~ +- Inside source: true +*** True Line Result + def delete +** Processing line: ~ return if current_input_str.length.zero? || @cursor_position == current_input_str.length~ +- Inside source: true +*** True Line Result + return if current_input_str.length.zero? || @cursor_position == current_input_str.length +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @cursor_position += 1~ +- Inside source: true +*** True Line Result + @cursor_position += 1 +** Processing line: ~ backspace~ +- Inside source: true +*** True Line Result + backspace +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def move_cursor_left~ +- Inside source: true +*** True Line Result + def move_cursor_left +** Processing line: ~ @cursor_position -= 1 if @cursor_position > 0~ +- Inside source: true +*** True Line Result + @cursor_position -= 1 if @cursor_position > 0 +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def move_cursor_left_word~ +- Inside source: true +*** True Line Result + def move_cursor_left_word +** Processing line: ~ return if @cursor_position.zero?~ +- Inside source: true +*** True Line Result + return if @cursor_position.zero? +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ new_pos = @cursor_position - 1~ +- Inside source: true +*** True Line Result + new_pos = @cursor_position - 1 +** Processing line: ~ (is_word_boundary? @current_input_str[new_pos]) ?~ +- Inside source: true +*** True Line Result + (is_word_boundary? @current_input_str[new_pos]) ? +** Processing line: ~ (new_pos -= 1 until !(is_word_boundary? @current_input_str[new_pos - 1]) || new_pos.zero?):~ +- Inside source: true +*** True Line Result + (new_pos -= 1 until !(is_word_boundary? @current_input_str[new_pos - 1]) || new_pos.zero?): +** Processing line: ~ (new_pos -= 1 until (is_word_boundary? @current_input_str[new_pos - 1]) || new_pos.zero?)~ +- Inside source: true +*** True Line Result + (new_pos -= 1 until (is_word_boundary? @current_input_str[new_pos - 1]) || new_pos.zero?) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @cursor_position = new_pos~ +- Inside source: true +*** True Line Result + @cursor_position = new_pos +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def move_cursor_right~ +- Inside source: true +*** True Line Result + def move_cursor_right +** Processing line: ~ @cursor_position += 1 if @cursor_position < current_input_str.length~ +- Inside source: true +*** True Line Result + @cursor_position += 1 if @cursor_position < current_input_str.length +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def move_cursor_right_word~ +- Inside source: true +*** True Line Result + def move_cursor_right_word +** Processing line: ~ return if @cursor_position.equal? str_len~ +- Inside source: true +*** True Line Result + return if @cursor_position.equal? str_len +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ new_pos = @cursor_position + 1~ +- Inside source: true +*** True Line Result + new_pos = @cursor_position + 1 +** Processing line: ~ (is_word_boundary? @current_input_str[new_pos]) ?~ +- Inside source: true +*** True Line Result + (is_word_boundary? @current_input_str[new_pos]) ? +** Processing line: ~ (new_pos += 1 until !(is_word_boundary? @current_input_str[new_pos]) || (new_pos.equal? str_len)):~ +- Inside source: true +*** True Line Result + (new_pos += 1 until !(is_word_boundary? @current_input_str[new_pos]) || (new_pos.equal? str_len)): +** Processing line: ~ (new_pos += 1 until (is_word_boundary? @current_input_str[new_pos]) || (new_pos.equal? str_len))~ +- Inside source: true +*** True Line Result + (new_pos += 1 until (is_word_boundary? @current_input_str[new_pos]) || (new_pos.equal? str_len)) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @cursor_position = new_pos~ +- Inside source: true +*** True Line Result + @cursor_position = new_pos +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def move_cursor_home~ +- Inside source: true +*** True Line Result + def move_cursor_home +** Processing line: ~ @cursor_position = 0~ +- Inside source: true +*** True Line Result + @cursor_position = 0 +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def move_cursor_end~ +- Inside source: true +*** True Line Result + def move_cursor_end +** Processing line: ~ @cursor_position = str_len~ +- Inside source: true +*** True Line Result + @cursor_position = str_len +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def clear~ +- Inside source: true +*** True Line Result + def clear +** Processing line: ~ @current_input_str = ''~ +- Inside source: true +*** True Line Result + @current_input_str = '' +** Processing line: ~ @cursor_position = 0~ +- Inside source: true +*** True Line Result + @cursor_position = 0 +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~ reset_autocomplete~ +- Inside source: true +*** True Line Result + reset_autocomplete +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def autocomplete~ +- Inside source: true +*** True Line Result + def autocomplete +** Processing line: ~ if !@last_autocomplete_prefix~ +- Inside source: true +*** True Line Result + if !@last_autocomplete_prefix +** Processing line: ~ @last_autocomplete_prefix = calc_autocomplete_prefix~ +- Inside source: true +*** True Line Result + @last_autocomplete_prefix = calc_autocomplete_prefix +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ puts "* AUTOCOMPLETE CANDIDATES: #{current_input_str}.."~ +- Inside source: true +*** True Line Result + puts "* AUTOCOMPLETE CANDIDATES: #{current_input_str}.." +** Processing line: ~ pretty_print_strings_as_table method_candidates(@last_autocomplete_prefix)~ +- Inside source: true +*** True Line Result + pretty_print_strings_as_table method_candidates(@last_autocomplete_prefix) +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ candidates = method_candidates(@last_autocomplete_prefix)~ +- Inside source: true +*** True Line Result + candidates = method_candidates(@last_autocomplete_prefix) +** Processing line: ~ return if candidates.empty?~ +- Inside source: true +*** True Line Result + return if candidates.empty? +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ candidate = candidates[@next_candidate_index]~ +- Inside source: true +*** True Line Result + candidate = candidates[@next_candidate_index] +** Processing line: ~ candidate = candidate[0..-2] + " = " if candidate.end_with? '='~ +- Inside source: true +*** True Line Result + candidate = candidate[0..-2] + " = " if candidate.end_with? '=' +** Processing line: ~ @next_candidate_index += 1~ +- Inside source: true +*** True Line Result + @next_candidate_index += 1 +** Processing line: ~ @next_candidate_index = 0 if @next_candidate_index >= candidates.length~ +- Inside source: true +*** True Line Result + @next_candidate_index = 0 if @next_candidate_index >= candidates.length +** Processing line: ~ self.current_input_str = display_autocomplete_candidate(candidate)~ +- Inside source: true +*** True Line Result + self.current_input_str = display_autocomplete_candidate(candidate) +** Processing line: ~ update_cursor_position_px~ +- Inside source: true +*** True Line Result + update_cursor_position_px +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ puts "* BUG: Tab autocompletion failed. Let us know about this.\n#{e}"~ +- Inside source: true +*** True Line Result + puts "* BUG: Tab autocompletion failed. Let us know about this.\n#{e}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def pretty_print_strings_as_table items~ +- Inside source: true +*** True Line Result + def pretty_print_strings_as_table items +** Processing line: ~ if items.length == 0~ +- Inside source: true +*** True Line Result + if items.length == 0 +** Processing line: ~ puts <<-S.strip~ +- Inside source: true +*** True Line Result + puts <<-S.strip +** Processing line: ~ +--------+~ +- Inside source: true +*** True Line Result + +--------+ +** Processing line: ~ | (none) |~ +- Inside source: true +*** True Line Result + | (none) | +** Processing line: ~ +--------+~ +- Inside source: true +*** True Line Result + +--------+ +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ # figure out the largest string~ +- Inside source: true +*** True Line Result + # figure out the largest string +** Processing line: ~ string_width = items.sort_by { |c| -c.to_s.length }.first~ +- Inside source: true +*** True Line Result + string_width = items.sort_by { |c| -c.to_s.length }.first +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # add spacing to each side of the string which represents the cell width~ +- Inside source: true +*** True Line Result + # add spacing to each side of the string which represents the cell width +** Processing line: ~ cell_width = string_width.length + 2~ +- Inside source: true +*** True Line Result + cell_width = string_width.length + 2 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # add spacing to each side of the cell to represent the column width~ +- Inside source: true +*** True Line Result + # add spacing to each side of the cell to represent the column width +** Processing line: ~ column_width = cell_width + 2~ +- Inside source: true +*** True Line Result + column_width = cell_width + 2 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # determine the max number of columns that can fit on the screen~ +- Inside source: true +*** True Line Result + # determine the max number of columns that can fit on the screen +** Processing line: ~ columns = @console_text_width.idiv column_width~ +- Inside source: true +*** True Line Result + columns = @console_text_width.idiv column_width +** Processing line: ~ columns = items.length if items.length < columns~ +- Inside source: true +*** True Line Result + columns = items.length if items.length < columns +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # partition the original list of items into a string to be printed~ +- Inside source: true +*** True Line Result + # partition the original list of items into a string to be printed +** Processing line: ~ items.each_slice(columns).each_with_index do |cells, i|~ +- Inside source: true +*** True Line Result + items.each_slice(columns).each_with_index do |cells, i| +** Processing line: ~ pretty_print_row_seperator string_width, cell_width, column_width, columns~ +- Inside source: true +*** True Line Result + pretty_print_row_seperator string_width, cell_width, column_width, columns +** Processing line: ~ pretty_print_row cells, string_width, cell_width, column_width, columns~ +- Inside source: true +*** True Line Result + pretty_print_row cells, string_width, cell_width, column_width, columns +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ pretty_print_row_seperator string_width, cell_width, column_width, columns~ +- Inside source: true +*** True Line Result + pretty_print_row_seperator string_width, cell_width, column_width, columns +** 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 pretty_print_row cells, string_width, cell_width, column_width, columns~ +- Inside source: true +*** True Line Result + def pretty_print_row cells, string_width, cell_width, column_width, columns +** Processing line: ~ # if the number of cells doesn't match the number of columns, then pad the array with empty values~ +- Inside source: true +*** True Line Result + # if the number of cells doesn't match the number of columns, then pad the array with empty values +** Processing line: ~ cells += (columns - cells.length).map { "" }~ +- Inside source: true +*** True Line Result + cells += (columns - cells.length).map { "" } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # right align each cell value~ +- Inside source: true +*** True Line Result + # right align each cell value +** Processing line: ~ formated_row = "|" + cells.map do |c|~ +- Inside source: true +*** True Line Result + formated_row = "|" + cells.map do |c| +** Processing line: ~ "#{" " * (string_width.length - c.length) } #{c} |"~ +- Inside source: true +*** True Line Result + "#{" " * (string_width.length - c.length) } #{c} |" +** Processing line: ~ end.join~ +- Inside source: true +*** True Line Result + end.join +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # remove seperators between empty values~ +- Inside source: true +*** True Line Result + # remove seperators between empty values +** Processing line: ~ formated_row = formated_row.gsub(" | ", " ")~ +- Inside source: true +*** True Line Result + formated_row = formated_row.gsub(" | ", " ") +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ puts formated_row~ +- Inside source: true +*** True Line Result + puts formated_row +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def pretty_print_row_seperator 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 +** Processing line: ~ # this is a joint: +--------~ +- Inside source: true +*** True Line Result + # this is a joint: +-------- +** Processing line: ~ column_joint = "+#{"-" * cell_width}"~ +- Inside source: true +*** True Line Result + column_joint = "+#{"-" * cell_width}" +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # multiple joints create a row seperator: +----+----+~ +- Inside source: true +*** True Line Result + # multiple joints create a row seperator: +----+----+ +** Processing line: ~ puts (column_joint * columns) + "+"~ +- Inside source: true +*** True Line Result + puts (column_joint * columns) + "+" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render(args, x:, y:)~ +- Inside source: true +*** True Line Result + def render(args, x:, y:) +** Processing line: ~ args.outputs.reserved << font_style.label(x: x, y: y, text: "#{@prompt}#{current_input_str}", color: @text_color)~ +- Inside source: true +*** True Line Result + args.outputs.reserved << font_style.label(x: x, y: y, text: "#{@prompt}#{current_input_str}", color: @text_color) +** Processing line: ~ args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 0.5,~ +- Inside source: true +*** True Line Result + args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 0.5, +** Processing line: ~ y: y + 5,~ +- Inside source: true +*** True Line Result + y: y + 5, +** Processing line: ~ x2: x + @cursor_position_px + 0.5,~ +- Inside source: true +*** True Line Result + x2: x + @cursor_position_px + 0.5, +** Processing line: ~ y2: y + @font_style.letter_size.y + 5)~ +- Inside source: true +*** True Line Result + y2: y + @font_style.letter_size.y + 5) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 1,~ +- Inside source: true +*** True Line Result + args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 1, +** Processing line: ~ y: y + 5,~ +- Inside source: true +*** True Line Result + y: y + 5, +** Processing line: ~ x2: x + @cursor_position_px + 1,~ +- Inside source: true +*** True Line Result + x2: x + @cursor_position_px + 1, +** Processing line: ~ y2: y + @font_style.letter_size.y + 5)~ +- Inside source: true +*** True Line Result + y2: y + @font_style.letter_size.y + 5) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # debugging rectangle for string~ +- Inside source: true +*** True Line Result + # debugging rectangle for string +** Processing line: ~ # args.outputs.reserved << (@cursor_color.to_h.merge x: x,~ +- Inside source: true +*** True Line Result + # args.outputs.reserved << (@cursor_color.to_h.merge x: x, +** Processing line: ~ # y: y + 5,~ +- Inside source: true +*** True Line Result + # y: y + 5, +** Processing line: ~ # w: @cursor_position_px,~ +- Inside source: true +*** True Line Result + # w: @cursor_position_px, +** Processing line: ~ # h: @font_style.letter_size.y).border~ +- Inside source: true +*** True Line Result + # h: @font_style.letter_size.y).border +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick~ +- Inside source: true +*** True Line Result + def tick +** Processing line: ~ if (@current_input_changed_at) &&~ +- Inside source: true +*** True Line Result + if (@current_input_changed_at) && +** Processing line: ~ (@current_input_changed_at < Kernel.global_tick_count) &&~ +- Inside source: true +*** True Line Result + (@current_input_changed_at < Kernel.global_tick_count) && +** Processing line: ~ (@last_input_str != @current_input_str)~ +- Inside source: true +*** True Line Result + (@last_input_str != @current_input_str) +** Processing line: ~ @last_input_str_changed = true~ +- Inside source: true +*** True Line Result + @last_input_str_changed = true +** Processing line: ~ @last_input_str = "#{@current_input_str}"~ +- Inside source: true +*** True Line Result + @last_input_str = "#{@current_input_str}" +** Processing line: ~ @current_input_changed_at = nil~ +- Inside source: true +*** True Line Result + @current_input_changed_at = nil +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @last_input_str_changed = false~ +- Inside source: true +*** True Line Result + @last_input_str_changed = false +** 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: ~ private~ +- Inside source: true +*** True Line Result + private +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def last_period_index~ +- Inside source: true +*** True Line Result + def last_period_index +** Processing line: ~ current_input_str.rindex('.')~ +- Inside source: true +*** True Line Result + current_input_str.rindex('.') +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calc_autocomplete_prefix~ +- Inside source: true +*** True Line Result + def calc_autocomplete_prefix +** Processing line: ~ if last_period_index~ +- Inside source: true +*** True Line Result + if last_period_index +** Processing line: ~ current_input_str[(last_period_index + 1)..-1]~ +- Inside source: true +*** True Line Result + current_input_str[(last_period_index + 1)..-1] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ current_input_str~ +- Inside source: true +*** True Line Result + current_input_str +** 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 current_object~ +- Inside source: true +*** True Line Result + def current_object +** Processing line: ~ return Kernel unless last_period_index~ +- Inside source: true +*** True Line Result + return Kernel unless last_period_index +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Kernel.eval(current_input_str[0...last_period_index])~ +- Inside source: true +*** True Line Result + Kernel.eval(current_input_str[0...last_period_index]) +** Processing line: ~ rescue NameError~ +- Inside source: true +*** True Line Result + rescue NameError +** 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 method_candidates(prefix)~ +- Inside source: true +*** True Line Result + def method_candidates(prefix) +** Processing line: ~ current_object.autocomplete_methods.map(&:to_s).select { |m| m.start_with? prefix }~ +- Inside source: true +*** True Line Result + current_object.autocomplete_methods.map(&:to_s).select { |m| m.start_with? prefix } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def display_autocomplete_candidate(candidate)~ +- Inside source: true +*** True Line Result + def display_autocomplete_candidate(candidate) +** Processing line: ~ if last_period_index~ +- Inside source: true +*** True Line Result + if last_period_index +** Processing line: ~ @current_input_str[0..last_period_index] + candidate.to_s~ +- Inside source: true +*** True Line Result + @current_input_str[0..last_period_index] + candidate.to_s +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ candidate.to_s~ +- Inside source: true +*** True Line Result + candidate.to_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: ~ def reset_autocomplete~ +- Inside source: true +*** True Line Result + def reset_autocomplete +** Processing line: ~ @last_autocomplete_prefix = nil~ +- Inside source: true +*** True Line Result + @last_autocomplete_prefix = nil +** Processing line: ~ @next_candidate_index = 0~ +- Inside source: true +*** True Line Result + @next_candidate_index = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def is_word_boundary? char~ +- Inside source: true +*** True Line Result + def is_word_boundary? char +** Processing line: ~ # Alternative method~ +- Inside source: true +*** True Line Result + # Alternative method +** Processing line: ~ # (WORD_LIMITER_CHARS - [char]).length != WORD_LIMITER_CHARS.length~ +- Inside source: true +*** True Line Result + # (WORD_LIMITER_CHARS - [char]).length != WORD_LIMITER_CHARS.length +** Processing line: ~ # Production code~ +- Inside source: true +*** True Line Result + # Production code +** Processing line: ~ WORD_LIMITER_CHARS.include? char~ +- Inside source: true +*** True Line Result + WORD_LIMITER_CHARS.include? char +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def str_len~ +- Inside source: true +*** True Line Result + def str_len +** Processing line: ~ @current_input_str.length~ +- Inside source: true +*** True Line Result + @current_input_str.length +** 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: ~#+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: ~*** controller.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** controller.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/controller.rb~ +- Inside source: true +*** True Line Result + # ./dragon/controller.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # controller.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # controller.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ class Controller~ +- Inside source: true +*** True Line Result + class Controller +** Processing line: ~ # Access to keys that have been pressed down.~ +- Inside source: true +*** True Line Result + # Access to keys that have been pressed down. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Controller::Keys]~ +- Inside source: true +*** True Line Result + # @return [Controller::Keys] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_reader :key_down~ +- Inside source: true +*** True Line Result + attr_reader :key_down +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Access to keys that have been released up.~ +- Inside source: true +*** True Line Result + # Access to keys that have been released up. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Controller::Keys]~ +- Inside source: true +*** True Line Result + # @return [Controller::Keys] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_reader :key_up~ +- Inside source: true +*** True Line Result + attr_reader :key_up +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Access to keys that have been held down.~ +- Inside source: true +*** True Line Result + # Access to keys that have been held down. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Controller::Keys]~ +- Inside source: true +*** True Line Result + # @return [Controller::Keys] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_reader :key_held~ +- Inside source: true +*** True Line Result + attr_reader :key_held +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_accessor :left_analog_x_raw,~ +- Inside source: true +*** True Line Result + attr_accessor :left_analog_x_raw, +** Processing line: ~ :left_analog_y_raw,~ +- Inside source: true +*** True Line Result + :left_analog_y_raw, +** Processing line: ~ :left_analog_x_perc,~ +- Inside source: true +*** True Line Result + :left_analog_x_perc, +** Processing line: ~ :left_analog_y_perc,~ +- Inside source: true +*** True Line Result + :left_analog_y_perc, +** Processing line: ~ :right_analog_x_raw,~ +- Inside source: true +*** True Line Result + :right_analog_x_raw, +** Processing line: ~ :right_analog_y_raw,~ +- Inside source: true +*** True Line Result + :right_analog_y_raw, +** Processing line: ~ :right_analog_x_perc,~ +- Inside source: true +*** True Line Result + :right_analog_x_perc, +** Processing line: ~ :right_analog_y_perc~ +- Inside source: true +*** True Line Result + :right_analog_y_perc +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @key_down = Controller::Keys.new~ +- Inside source: true +*** True Line Result + @key_down = Controller::Keys.new +** Processing line: ~ @key_up = Controller::Keys.new~ +- Inside source: true +*** True Line Result + @key_up = Controller::Keys.new +** Processing line: ~ @key_held = Controller::Keys.new~ +- Inside source: true +*** True Line Result + @key_held = Controller::Keys.new +** Processing line: ~ @left_analog_x_raw = 0~ +- Inside source: true +*** True Line Result + @left_analog_x_raw = 0 +** Processing line: ~ @left_analog_y_raw = 0~ +- Inside source: true +*** True Line Result + @left_analog_y_raw = 0 +** Processing line: ~ @left_analog_x_perc = 0~ +- Inside source: true +*** True Line Result + @left_analog_x_perc = 0 +** Processing line: ~ @left_analog_y_perc = 0~ +- Inside source: true +*** True Line Result + @left_analog_y_perc = 0 +** Processing line: ~ @right_analog_x_raw = 0~ +- Inside source: true +*** True Line Result + @right_analog_x_raw = 0 +** Processing line: ~ @right_analog_y_raw = 0~ +- Inside source: true +*** True Line Result + @right_analog_y_raw = 0 +** Processing line: ~ @right_analog_x_perc = 0~ +- Inside source: true +*** True Line Result + @right_analog_x_perc = 0 +** Processing line: ~ @right_analog_y_perc = 0~ +- Inside source: true +*** True Line Result + @right_analog_y_perc = 0 +** 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 + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ key_down: @key_down.serialize,~ +- Inside source: true +*** True Line Result + key_down: @key_down.serialize, +** Processing line: ~ key_held: @key_held.serialize,~ +- Inside source: true +*** True Line Result + key_held: @key_held.serialize, +** Processing line: ~ key_up: @key_up.serialize~ +- Inside source: true +*** True Line Result + key_up: @key_up.serialize +** 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: ~ # Clear all current key presses.~ +- Inside source: true +*** True Line Result + # Clear all current key presses. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [void]~ +- Inside source: true +*** True Line Result + # @return [void] +** Processing line: ~ def clear~ +- Inside source: true +*** True Line Result + def clear +** Processing line: ~ @key_down.clear~ +- Inside source: true +*** True Line Result + @key_down.clear +** Processing line: ~ @key_up.clear~ +- Inside source: true +*** True Line Result + @key_up.clear +** Processing line: ~ @key_held.clear~ +- Inside source: true +*** True Line Result + @key_held.clear +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def up~ +- Inside source: true +*** True Line Result + def up +** Processing line: ~ @key_up.up || @key_held.up~ +- Inside source: true +*** True Line Result + @key_up.up || @key_held.up +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def down~ +- Inside source: true +*** True Line Result + def down +** Processing line: ~ @key_up.down || @key_held.down~ +- Inside source: true +*** True Line Result + @key_up.down || @key_held.down +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def left~ +- Inside source: true +*** True Line Result + def left +** Processing line: ~ @key_up.left || @key_held.left~ +- Inside source: true +*** True Line Result + @key_up.left || @key_held.left +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def right~ +- Inside source: true +*** True Line Result + def right +** Processing line: ~ @key_up.right || @key_held.right~ +- Inside source: true +*** True Line Result + @key_up.right || @key_held.right +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Activates a key into the down position.~ +- Inside source: true +*** True Line Result + # Activates a key into the down position. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @param key [Symbol] The key to press down.~ +- Inside source: true +*** True Line Result + # @param key [Symbol] The key to press down. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [void]~ +- Inside source: true +*** True Line Result + # @return [void] +** Processing line: ~ def activate_down(key)~ +- Inside source: true +*** True Line Result + def activate_down(key) +** Processing line: ~ key_down.activate(key)~ +- Inside source: true +*** True Line Result + key_down.activate(key) +** Processing line: ~ key_held.deactivate(key)~ +- Inside source: true +*** True Line Result + key_held.deactivate(key) +** Processing line: ~ key_up.deactivate(key)~ +- Inside source: true +*** True Line Result + key_up.deactivate(key) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Activates a key into the held down position.~ +- Inside source: true +*** True Line Result + # Activates a key into the held down position. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @param key [Symbol] The key to hold down.~ +- Inside source: true +*** True Line Result + # @param key [Symbol] The key to hold down. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [void]~ +- Inside source: true +*** True Line Result + # @return [void] +** Processing line: ~ def activate_held(key)~ +- Inside source: true +*** True Line Result + def activate_held(key) +** Processing line: ~ key_down.deactivate(key)~ +- Inside source: true +*** True Line Result + key_down.deactivate(key) +** Processing line: ~ key_held.activate(key) unless key_held.send(key)~ +- Inside source: true +*** True Line Result + key_held.activate(key) unless key_held.send(key) +** Processing line: ~ key_up.deactivate(key)~ +- Inside source: true +*** True Line Result + key_up.deactivate(key) +** 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: ~ # Activates a key release into the up position.~ +- Inside source: true +*** True Line Result + # Activates a key release into the up position. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @param key [Symbol] The key release up.~ +- Inside source: true +*** True Line Result + # @param key [Symbol] The key release up. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [void]~ +- Inside source: true +*** True Line Result + # @return [void] +** Processing line: ~ def activate_up(key)~ +- Inside source: true +*** True Line Result + def activate_up(key) +** Processing line: ~ key_down.deactivate(key)~ +- Inside source: true +*** True Line Result + key_down.deactivate(key) +** Processing line: ~ key_held.deactivate(key)~ +- Inside source: true +*** True Line Result + key_held.deactivate(key) +** Processing line: ~ key_up.activate(key)~ +- Inside source: true +*** True Line Result + key_up.activate(key) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ include DirectionalInputHelperMethods~ +- Inside source: true +*** True Line Result + include DirectionalInputHelperMethods +** 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: ~#+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: ~*** controller/config.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** controller/config.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/controller/config.rb~ +- Inside source: true +*** True Line Result + # ./dragon/controller/config.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # controller/config.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # controller/config.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # !!! FIXME: add console command to forget custom binding(s)~ +- Inside source: true +*** True Line Result + # !!! FIXME: add console command to forget custom binding(s) +** Processing line: ~ # !!! FIXME: add console command to forget replace existing binding(s)~ +- Inside source: true +*** True Line Result + # !!! FIXME: add console command to forget replace existing binding(s) +** Processing line: ~ # !!! FIXME: add console command go into play_around mode to make sure controller isn't wonky.~ +- Inside source: true +*** True Line Result + # !!! FIXME: add console command go into play_around mode to make sure controller isn't wonky. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Controller~ +- Inside source: true +*** True Line Result + class Controller +** Processing line: ~ class Config~ +- Inside source: true +*** True Line Result + class Config +** Processing line: ~ def initialize runtime~ +- Inside source: true +*** True Line Result + def initialize runtime +** Processing line: ~ @runtime = runtime~ +- Inside source: true +*** True Line Result + @runtime = runtime +** Processing line: ~ @raw_joysticks = {} # things that aren't game controllers to try to configure.~ +- Inside source: true +*** True Line Result + @raw_joysticks = {} # things that aren't game controllers to try to configure. +** Processing line: ~ @target = nil~ +- Inside source: true +*** True Line Result + @target = nil +** Processing line: ~ @animation_duration = (1.5).seconds~ +- Inside source: true +*** True Line Result + @animation_duration = (1.5).seconds +** Processing line: ~ @toggled_at = 0~ +- Inside source: true +*** True Line Result + @toggled_at = 0 +** Processing line: ~ @fading = 0~ +- Inside source: true +*** True Line Result + @fading = 0 +** Processing line: ~ @current_part = 0~ +- Inside source: true +*** True Line Result + @current_part = 0 +** Processing line: ~ @part_alpha = 0~ +- Inside source: true +*** True Line Result + @part_alpha = 0 +** Processing line: ~ @part_alpha_increment = 10~ +- Inside source: true +*** True Line Result + @part_alpha_increment = 10 +** Processing line: ~ @joystick_state = {}~ +- Inside source: true +*** True Line Result + @joystick_state = {} +** Processing line: ~ @playing_around = false~ +- Inside source: true +*** True Line Result + @playing_around = false +** Processing line: ~ @used_bindings = {}~ +- Inside source: true +*** True Line Result + @used_bindings = {} +** Processing line: ~ @bindings = []~ +- Inside source: true +*** True Line Result + @bindings = [] +** Processing line: ~ @parts = [~ +- Inside source: true +*** True Line Result + @parts = [ +** Processing line: ~ [ 919, 282, 'A button', 'a' ],~ +- Inside source: true +*** True Line Result + [ 919, 282, 'A button', 'a' ], +** Processing line: ~ [ 960, 323, 'B button', 'b' ],~ +- Inside source: true +*** True Line Result + [ 960, 323, 'B button', 'b' ], +** Processing line: ~ [ 878, 323, 'X button', 'x' ],~ +- Inside source: true +*** True Line Result + [ 878, 323, 'X button', 'x' ], +** Processing line: ~ [ 919, 365, 'Y button', 'y' ],~ +- Inside source: true +*** True Line Result + [ 919, 365, 'Y button', 'y' ], +** Processing line: ~ [ 433, 246, 'left stick left', '-leftx' ],~ +- Inside source: true +*** True Line Result + [ 433, 246, 'left stick left', '-leftx' ], +** Processing line: ~ [ 497, 246, 'left stick right', '+leftx' ],~ +- Inside source: true +*** True Line Result + [ 497, 246, 'left stick right', '+leftx' ], +** Processing line: ~ [ 466, 283, 'left stick up', '-lefty' ],~ +- Inside source: true +*** True Line Result + [ 466, 283, 'left stick up', '-lefty' ], +** Processing line: ~ [ 466, 218, 'left stick down', '+lefty' ],~ +- Inside source: true +*** True Line Result + [ 466, 218, 'left stick down', '+lefty' ], +** Processing line: ~ [ 466, 246, 'left stick button', 'leftstick' ],~ +- Inside source: true +*** True Line Result + [ 466, 246, 'left stick button', 'leftstick' ], +** Processing line: ~ [ 741, 246, 'right stick left', '-rightx' ],~ +- Inside source: true +*** True Line Result + [ 741, 246, 'right stick left', '-rightx' ], +** Processing line: ~ [ 802, 246, 'right stick right', '+rightx' ],~ +- Inside source: true +*** True Line Result + [ 802, 246, 'right stick right', '+rightx' ], +** Processing line: ~ [ 773, 283, 'right stick up', '-righty' ],~ +- Inside source: true +*** True Line Result + [ 773, 283, 'right stick up', '-righty' ], +** Processing line: ~ [ 773, 218, 'right stick down', '+righty' ],~ +- Inside source: true +*** True Line Result + [ 773, 218, 'right stick down', '+righty' ], +** Processing line: ~ [ 772, 246, 'right stick button', 'rightstick' ],~ +- Inside source: true +*** True Line Result + [ 772, 246, 'right stick button', 'rightstick' ], +** Processing line: ~ [ 263, 465, 'left shoulder button', 'leftshoulder' ],~ +- Inside source: true +*** True Line Result + [ 263, 465, 'left shoulder button', 'leftshoulder' ], +** Processing line: ~ [ 263, 503, 'left trigger', 'lefttrigger' ],~ +- Inside source: true +*** True Line Result + [ 263, 503, 'left trigger', 'lefttrigger' ], +** Processing line: ~ [ 977, 465, 'right shoulder button', 'rightshoulder' ],~ +- Inside source: true +*** True Line Result + [ 977, 465, 'right shoulder button', 'rightshoulder' ], +** Processing line: ~ [ 977, 503, 'right trigger', 'righttrigger' ],~ +- Inside source: true +*** True Line Result + [ 977, 503, 'right trigger', 'righttrigger' ], +** Processing line: ~ [ 318, 365, 'D-pad up', 'dpup' ],~ +- Inside source: true +*** True Line Result + [ 318, 365, 'D-pad up', 'dpup' ], +** Processing line: ~ [ 360, 322, 'D-pad right', 'dpright' ],~ +- Inside source: true +*** True Line Result + [ 360, 322, 'D-pad right', 'dpright' ], +** Processing line: ~ [ 318, 280, 'D-pad down', 'dpdown' ],~ +- Inside source: true +*** True Line Result + [ 318, 280, 'D-pad down', 'dpdown' ], +** Processing line: ~ [ 275, 322, 'D-pad left', 'dpleft' ],~ +- Inside source: true +*** True Line Result + [ 275, 322, 'D-pad left', 'dpleft' ], +** Processing line: ~ [ 570, 402, 'select/back button', 'back'],~ +- Inside source: true +*** True Line Result + [ 570, 402, 'select/back button', 'back'], +** Processing line: ~ [ 619, 448, 'guide/home button', 'guide' ],~ +- Inside source: true +*** True Line Result + [ 619, 448, 'guide/home button', 'guide' ], +** Processing line: ~ [ 669, 402, 'start button', 'start' ],~ +- Inside source: true +*** True Line Result + [ 669, 402, 'start button', 'start' ], +** 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 rawjoystick_connected jid, joystickname, guid~ +- Inside source: true +*** True Line Result + def rawjoystick_connected jid, joystickname, guid +** Processing line: ~ return if jid < 0~ +- Inside source: true +*** True Line Result + return if jid < 0 +** Processing line: ~ @raw_joysticks[jid] = { name: joystickname, guid: guid }~ +- Inside source: true +*** True Line Result + @raw_joysticks[jid] = { name: joystickname, guid: guid } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def rawjoystick_disconnected jid~ +- Inside source: true +*** True Line Result + def rawjoystick_disconnected jid +** Processing line: ~ return if jid < 0~ +- Inside source: true +*** True Line Result + return if jid < 0 +** Processing line: ~ if @raw_joysticks[jid] != nil~ +- Inside source: true +*** True Line Result + if @raw_joysticks[jid] != nil +** Processing line: ~ @raw_joysticks.delete(jid)~ +- Inside source: true +*** True Line Result + @raw_joysticks.delete(jid) +** Processing line: ~ @runtime.ffi_misc.close_raw_joystick(jid)~ +- Inside source: true +*** True Line Result + @runtime.ffi_misc.close_raw_joystick(jid) +** Processing line: ~ # Fade out the config screen if we were literally configuring this controller right now.~ +- Inside source: true +*** True Line Result + # Fade out the config screen if we were literally configuring this controller right now. +** Processing line: ~ if !@target.nil? && @target[0] == jid~ +- Inside source: true +*** True Line Result + if !@target.nil? && @target[0] == jid +** Processing line: ~ @target[0] = nil~ +- Inside source: true +*** True Line Result + @target[0] = nil +** Processing line: ~ @toggled_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @toggled_at = Kernel.global_tick_count +** Processing line: ~ @fading = -1~ +- Inside source: true +*** True Line Result + @fading = -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: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def build_binding_string~ +- Inside source: true +*** True Line Result + def build_binding_string +** Processing line: ~ bindingstr = ''~ +- Inside source: true +*** True Line Result + bindingstr = '' +** Processing line: ~ skip = false~ +- Inside source: true +*** True Line Result + skip = false +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ for i in 0..@parts.length-1~ +- Inside source: true +*** True Line Result + for i in 0..@parts.length-1 +** Processing line: ~ if skip ; skip = false ; next ; end~ +- Inside source: true +*** True Line Result + if skip ; skip = false ; next ; end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ binding = @bindings[i]~ +- Inside source: true +*** True Line Result + binding = @bindings[i] +** Processing line: ~ next if binding.nil?~ +- Inside source: true +*** True Line Result + next if binding.nil? +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ part = @parts[i][3]~ +- Inside source: true +*** True Line Result + part = @parts[i][3] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # clean up string:~ +- Inside source: true +*** True Line Result + # clean up string: +** Processing line: ~ # if axis uses -a0 for negative and +a0 for positive, just make it "leftx:a0" instead of "-leftx:-a0,+leftx:+a0"~ +- Inside source: true +*** True Line Result + # if axis uses -a0 for negative and +a0 for positive, just make it "leftx:a0" instead of "-leftx:-a0,+leftx:+a0" +** Processing line: ~ # if axis uses +a0 for negative and -a0 for positive, just make it "leftx:a0~" instead of "-leftx:+a0,+leftx:-a0"~ +- Inside source: true +*** True Line Result + # if axis uses +a0 for negative and -a0 for positive, just make it "leftx:a0~" instead of "-leftx:+a0,+leftx:-a0" +** Processing line: ~ if part == '-leftx' || part == '-lefty' || part == '-rightx' || part == '-righty'~ +- Inside source: true +*** True Line Result + if part == '-leftx' || part == '-lefty' || part == '-rightx' || part == '-righty' +** Processing line: ~ nextbinding = @bindings[i+1]~ +- Inside source: true +*** True Line Result + nextbinding = @bindings[i+1] +** Processing line: ~ if binding.start_with?('-a') && nextbinding.start_with?('+a') && binding[2..-1] == nextbinding[2..-1]~ +- Inside source: true +*** True Line Result + if binding.start_with?('-a') && nextbinding.start_with?('+a') && binding[2..-1] == nextbinding[2..-1] +** Processing line: ~ skip = true~ +- Inside source: true +*** True Line Result + skip = true +** Processing line: ~ part = part[1..-1]~ +- Inside source: true +*** True Line Result + part = part[1..-1] +** Processing line: ~ binding = binding[1..-1]~ +- Inside source: true +*** True Line Result + binding = binding[1..-1] +** Processing line: ~ elsif binding.start_with?('+a') && nextbinding.start_with?('-a') && binding[2..-1] == nextbinding[2..-1]~ +- Inside source: true +*** True Line Result + elsif binding.start_with?('+a') && nextbinding.start_with?('-a') && binding[2..-1] == nextbinding[2..-1] +** Processing line: ~ skip = true~ +- Inside source: true +*** True Line Result + skip = true +** Processing line: ~ part = part[1..-1]~ +- Inside source: true +*** True Line Result + part = part[1..-1] +** Processing line: ~ binding = "#{binding[1..-1]}~"~ +- Inside source: true +*** True Line Result + binding = "#{binding[1..-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: ~ bindingstr += "#{!bindingstr.empty? ? ',' : ''}#{part}:#{binding}"~ +- Inside source: true +*** True Line Result + bindingstr += "#{!bindingstr.empty? ? ',' : ''}#{part}:#{binding}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ details = @target[1]~ +- Inside source: true +*** True Line Result + details = @target[1] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # !!! FIXME: no String.delete in mRuby?!?! Maybe so when upgrading.~ +- Inside source: true +*** True Line Result + # !!! FIXME: no String.delete in mRuby?!?! Maybe so when upgrading. +** Processing line: ~ #name = details[:name].delete(',')~ +- Inside source: true +*** True Line Result + #name = details[:name].delete(',') +** Processing line: ~ # !!! FIXME: ...no regexp either... :/~ +- Inside source: true +*** True Line Result + # !!! FIXME: ...no regexp either... :/ +** Processing line: ~ #name = details[:name].gsub(/,/, ' ') # !!! FIXME: will SDL let you escape these instead?~ +- Inside source: true +*** True Line Result + #name = details[:name].gsub(/,/, ' ') # !!! FIXME: will SDL let you escape these instead? +** Processing line: ~ unescaped = details[:name]~ +- Inside source: true +*** True Line Result + unescaped = details[:name] +** Processing line: ~ name = ''~ +- Inside source: true +*** True Line Result + name = '' +** Processing line: ~ for i in 0..unescaped.length-1~ +- Inside source: true +*** True Line Result + for i in 0..unescaped.length-1 +** Processing line: ~ ch = unescaped[i]~ +- Inside source: true +*** True Line Result + ch = unescaped[i] +** Processing line: ~ name += (ch == ',') ? ' ' : ch~ +- Inside source: true +*** True Line Result + name += (ch == ',') ? ' ' : ch +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ return "#{details[:guid]},#{name},platform:#{@runtime.platform},#{bindingstr}"~ +- Inside source: true +*** True Line Result + return "#{details[:guid]},#{name},platform:#{@runtime.platform},#{bindingstr}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def move_to_different_part part~ +- Inside source: true +*** True Line Result + def move_to_different_part part +** Processing line: ~ if !@joystick_state[:axes].nil?~ +- Inside source: true +*** True Line Result + if !@joystick_state[:axes].nil? +** Processing line: ~ @joystick_state[:axes].each { |i| i[:farthestval] = i[:startingval] if !i.nil? }~ +- Inside source: true +*** True Line Result + @joystick_state[:axes].each { |i| i[:farthestval] = i[:startingval] if !i.nil? } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ @current_part = part~ +- Inside source: true +*** True Line Result + @current_part = part +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def previous_part~ +- Inside source: true +*** True Line Result + def previous_part +** Processing line: ~ if @current_part > 0~ +- Inside source: true +*** True Line Result + if @current_part > 0 +** Processing line: ~ # remove the binding that we previous had here so it can be reused.~ +- Inside source: true +*** True Line Result + # remove the binding that we previous had here so it can be reused. +** Processing line: ~ bindstr = @bindings[@current_part - 1]~ +- Inside source: true +*** True Line Result + bindstr = @bindings[@current_part - 1] +** Processing line: ~ @bindings[@current_part - 1] = nil~ +- Inside source: true +*** True Line Result + @bindings[@current_part - 1] = nil +** Processing line: ~ @used_bindings[bindstr] = nil~ +- Inside source: true +*** True Line Result + @used_bindings[bindstr] = nil +** Processing line: ~ move_to_different_part @current_part - 1~ +- Inside source: true +*** True Line Result + move_to_different_part @current_part - 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 next_part~ +- Inside source: true +*** True Line Result + def next_part +** Processing line: ~ if @current_part < (@parts.length - 1)~ +- Inside source: true +*** True Line Result + if @current_part < (@parts.length - 1) +** Processing line: ~ move_to_different_part @current_part + 1~ +- Inside source: true +*** True Line Result + move_to_different_part @current_part + 1 +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @playing_around = true~ +- Inside source: true +*** True Line Result + @playing_around = true +** 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 set_binding bindstr~ +- Inside source: true +*** True Line Result + def set_binding bindstr +** Processing line: ~ return false if !@used_bindings[bindstr].nil?~ +- Inside source: true +*** True Line Result + return false if !@used_bindings[bindstr].nil? +** Processing line: ~ @used_bindings[bindstr] = @current_part~ +- Inside source: true +*** True Line Result + @used_bindings[bindstr] = @current_part +** Processing line: ~ @bindings[@current_part] = bindstr~ +- Inside source: true +*** True Line Result + @bindings[@current_part] = bindstr +** Processing line: ~ return true~ +- Inside source: true +*** True Line Result + return true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Called when a lowlevel joystick moves an axis.~ +- Inside source: true +*** True Line Result + # Called when a lowlevel joystick moves an axis. +** Processing line: ~ def rawjoystick_axis jid, axis, value~ +- Inside source: true +*** True Line Result + def rawjoystick_axis jid, axis, value +** Processing line: ~ return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick.~ +- Inside source: true +*** True Line Result + return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @joystick_state[:axes] ||= []~ +- Inside source: true +*** True Line Result + @joystick_state[:axes] ||= [] +** Processing line: ~ @joystick_state[:axes][axis] ||= {~ +- Inside source: true +*** True Line Result + @joystick_state[:axes][axis] ||= { +** Processing line: ~ moving: false,~ +- Inside source: true +*** True Line Result + moving: false, +** Processing line: ~ startingval: 0,~ +- Inside source: true +*** True Line Result + startingval: 0, +** Processing line: ~ currentval: 0,~ +- Inside source: true +*** True Line Result + currentval: 0, +** Processing line: ~ farthestval: 0~ +- Inside source: true +*** True Line Result + farthestval: 0 +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # this is the logic from SDL's controllermap.c, more or less, since this is hard to get right from scratch.~ +- Inside source: true +*** True Line Result + # this is the logic from SDL's controllermap.c, more or less, since this is hard to get right from scratch. +** Processing line: ~ state = @joystick_state[:axes][axis]~ +- Inside source: true +*** True Line Result + state = @joystick_state[:axes][axis] +** Processing line: ~ state[:currentval] = value~ +- Inside source: true +*** True Line Result + state[:currentval] = value +** Processing line: ~ if !state[:moving]~ +- Inside source: true +*** True Line Result + if !state[:moving] +** Processing line: ~ state[:moving] = true~ +- Inside source: true +*** True Line Result + state[:moving] = true +** Processing line: ~ state[:startingval] = value~ +- Inside source: true +*** True Line Result + state[:startingval] = value +** Processing line: ~ state[:farthestval] = value~ +- Inside source: true +*** True Line Result + state[:farthestval] = value +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ current_distance = (value - state[:startingval]).abs~ +- Inside source: true +*** True Line Result + current_distance = (value - state[:startingval]).abs +** Processing line: ~ farthest_distance = (state[:farthestval] - state[:startingval]).abs~ +- Inside source: true +*** True Line Result + farthest_distance = (state[:farthestval] - state[:startingval]).abs +** Processing line: ~ if current_distance > farthest_distance~ +- Inside source: true +*** True Line Result + if current_distance > farthest_distance +** Processing line: ~ state[:farthestval] = value~ +- Inside source: true +*** True Line Result + state[:farthestval] = value +** Processing line: ~ farthest_distance = (state[:farthestval] - state[:startingval]).abs~ +- Inside source: true +*** True Line Result + farthest_distance = (state[:farthestval] - state[:startingval]).abs +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # If we've gone out far enough and started to come back, let's bind this axis~ +- Inside source: true +*** True Line Result + # If we've gone out far enough and started to come back, let's bind this axis +** Processing line: ~ if (farthest_distance >= 16000) && (current_distance <= 10000)~ +- Inside source: true +*** True Line Result + if (farthest_distance >= 16000) && (current_distance <= 10000) +** Processing line: ~ next_part if set_binding("#{(state[:farthestval] < 0) ? '-' : '+'}a#{axis}")~ +- Inside source: true +*** True Line Result + next_part if set_binding("#{(state[:farthestval] < 0) ? '-' : '+'}a#{axis}") +** 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: ~ # Called when a lowlevel joystick moves a hat.~ +- Inside source: true +*** True Line Result + # Called when a lowlevel joystick moves a hat. +** Processing line: ~ def rawjoystick_hat jid, hat, value~ +- Inside source: true +*** True Line Result + def rawjoystick_hat jid, hat, value +** Processing line: ~ return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick.~ +- Inside source: true +*** True Line Result + return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @joystick_state[:hats] ||= []~ +- Inside source: true +*** True Line Result + @joystick_state[:hats] ||= [] +** Processing line: ~ @joystick_state[:hats][hat] = value~ +- Inside source: true +*** True Line Result + @joystick_state[:hats][hat] = value +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return if value == 0 # 0 == centered, skip it~ +- Inside source: true +*** True Line Result + return if value == 0 # 0 == centered, skip it +** Processing line: ~ next_part if set_binding("h#{hat}.#{value}")~ +- Inside source: true +*** True Line Result + next_part if set_binding("h#{hat}.#{value}") +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Called when a lowlevel joystick moves a button.~ +- Inside source: true +*** True Line Result + # Called when a lowlevel joystick moves a button. +** Processing line: ~ def rawjoystick_button jid, button, pressed~ +- Inside source: true +*** True Line Result + def rawjoystick_button jid, button, pressed +** Processing line: ~ return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick.~ +- Inside source: true +*** True Line Result + return if @target.nil? || jid != @target[0] || @fading != 0 # skip if not currently considering this joystick. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @joystick_state[:buttons] ||= []~ +- Inside source: true +*** True Line Result + @joystick_state[:buttons] ||= [] +** Processing line: ~ @joystick_state[:buttons][button] = pressed~ +- Inside source: true +*** True Line Result + @joystick_state[:buttons][button] = pressed +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return if !pressed~ +- Inside source: true +*** True Line Result + return if !pressed +** Processing line: ~ next_part if set_binding("b#{button}")~ +- Inside source: true +*** True Line Result + next_part if set_binding("b#{button}") +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def calc_fading~ +- Inside source: true +*** True Line Result + def calc_fading +** Processing line: ~ if @fading == 0~ +- Inside source: true +*** True Line Result + if @fading == 0 +** Processing line: ~ return 255~ +- Inside source: true +*** True Line Result + return 255 +** Processing line: ~ elsif @fading > 0 # fading in~ +- Inside source: true +*** True Line Result + elsif @fading > 0 # fading in +** Processing line: ~ percent = @toggled_at.global_ease(@animation_duration, :flip, :quint, :flip)~ +- Inside source: true +*** True Line Result + percent = @toggled_at.global_ease(@animation_duration, :flip, :quint, :flip) +** Processing line: ~ if percent >= 1.0~ +- Inside source: true +*** True Line Result + if percent >= 1.0 +** Processing line: ~ percent = 1.0~ +- Inside source: true +*** True Line Result + percent = 1.0 +** Processing line: ~ @fading = 0~ +- Inside source: true +*** True Line Result + @fading = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ else # fading out~ +- Inside source: true +*** True Line Result + else # fading out +** Processing line: ~ percent = @toggled_at.global_ease(@animation_duration, :flip, :quint)~ +- Inside source: true +*** True Line Result + percent = @toggled_at.global_ease(@animation_duration, :flip, :quint) +** Processing line: ~ if percent <= 0.0~ +- Inside source: true +*** True Line Result + if percent <= 0.0 +** Processing line: ~ percent = 0.0~ +- Inside source: true +*** True Line Result + percent = 0.0 +** Processing line: ~ @fading = 0~ +- Inside source: true +*** True Line Result + @fading = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return (percent * 255.0).to_i~ +- Inside source: true +*** True Line Result + return (percent * 255.0).to_i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_basics args, msg, fade=255~ +- Inside source: true +*** True Line Result + def render_basics args, msg, fade=255 +** Processing line: ~ joystickname = @target[1][:name]~ +- Inside source: true +*** True Line Result + joystickname = @target[1][:name] +** Processing line: ~ args.outputs.primitives << [0, 0, $gtk.logical_width, $gtk.logical_height, 255, 255, 255, fade].solid~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [0, 0, $gtk.logical_width, $gtk.logical_height, 255, 255, 255, fade].solid +** Processing line: ~ args.outputs.primitives << [0, 0, $gtk.logical_width, $gtk.logical_height, 'dragonruby-controller.png', 0, fade, 255, 255, 255].sprite~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [0, 0, $gtk.logical_width, $gtk.logical_height, 'dragonruby-controller.png', 0, fade, 255, 255, 255].sprite +** Processing line: ~ args.outputs.primitives << [$gtk.logical_width / 2, 700, joystickname, 2, 1, 0, 0, 0, fade].label~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [$gtk.logical_width / 2, 700, joystickname, 2, 1, 0, 0, 0, fade].label +** Processing line: ~ args.outputs.primitives << [$gtk.logical_height / 2, 650, msg, 0, 1, 0, 0, 0, 255].label if !msg.empty?~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [$gtk.logical_height / 2, 650, msg, 0, 1, 0, 0, 0, 255].label if !msg.empty? +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_part_highlight args, part, alpha=255~ +- Inside source: true +*** True Line Result + def render_part_highlight args, part, alpha=255 +** Processing line: ~ partsize = 41~ +- Inside source: true +*** True Line Result + partsize = 41 +** Processing line: ~ args.outputs.primitives << [part[0], part[1], partsize, partsize, 255, 0, 0, alpha].border~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [part[0], part[1], partsize, partsize, 255, 0, 0, alpha].border +** Processing line: ~ args.outputs.primitives << [part[0]-1, part[1]-1, partsize+2, partsize+2, 255, 0, 0, alpha].border~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [part[0]-1, part[1]-1, partsize+2, partsize+2, 255, 0, 0, alpha].border +** Processing line: ~ args.outputs.primitives << [part[0]-2, part[1]-2, partsize+4, partsize+4, 255, 0, 0, alpha].border~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [part[0]-2, part[1]-2, partsize+4, partsize+4, 255, 0, 0, alpha].border +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def choose_target~ +- Inside source: true +*** True Line Result + def choose_target +** Processing line: ~ if @target.nil?~ +- Inside source: true +*** True Line Result + if @target.nil? +** Processing line: ~ while !@raw_joysticks.empty?~ +- Inside source: true +*** True Line Result + while !@raw_joysticks.empty? +** Processing line: ~ t = @raw_joysticks.shift # see if there's a joystick waiting on us.~ +- Inside source: true +*** True Line Result + t = @raw_joysticks.shift # see if there's a joystick waiting on us. +** Processing line: ~ next if t[0] < 0 # just in case.~ +- Inside source: true +*** True Line Result + next if t[0] < 0 # just in case. +** Processing line: ~ next if t[1][:guid].nil? # did we already handle this guid? Dump it.~ +- Inside source: true +*** True Line Result + next if t[1][:guid].nil? # did we already handle this guid? Dump it. +** Processing line: ~ @target = t~ +- Inside source: true +*** True Line Result + @target = t +** Processing line: ~ break~ +- Inside source: true +*** True Line Result + break +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ return false if @target.nil? # nothing to configure at the moment.~ +- Inside source: true +*** True Line Result + return false if @target.nil? # nothing to configure at the moment. +** Processing line: ~ @toggled_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @toggled_at = Kernel.global_tick_count +** Processing line: ~ @fading = 1~ +- Inside source: true +*** True Line Result + @fading = 1 +** Processing line: ~ @current_part = 0~ +- Inside source: true +*** True Line Result + @current_part = 0 +** Processing line: ~ @part_alpha = 0~ +- Inside source: true +*** True Line Result + @part_alpha = 0 +** Processing line: ~ @part_alpha_increment = 10~ +- Inside source: true +*** True Line Result + @part_alpha_increment = 10 +** Processing line: ~ @joystick_state = {}~ +- Inside source: true +*** True Line Result + @joystick_state = {} +** Processing line: ~ @used_bindings = {}~ +- Inside source: true +*** True Line Result + @used_bindings = {} +** Processing line: ~ @playing_around = false~ +- Inside source: true +*** True Line Result + @playing_around = false +** Processing line: ~ @bindings = []~ +- Inside source: true +*** True Line Result + @bindings = [] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ return true~ +- Inside source: true +*** True Line Result + return true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def render_part_highlight_from_bindstr args, bindstr, alpha=255~ +- Inside source: true +*** True Line Result + def render_part_highlight_from_bindstr args, bindstr, alpha=255 +** Processing line: ~ partidx = @used_bindings[bindstr]~ +- Inside source: true +*** True Line Result + partidx = @used_bindings[bindstr] +** Processing line: ~ return if partidx.nil?~ +- Inside source: true +*** True Line Result + return if partidx.nil? +** Processing line: ~ render_part_highlight args, @parts[partidx], alpha~ +- Inside source: true +*** True Line Result + render_part_highlight args, @parts[partidx], alpha +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def play_around args~ +- Inside source: true +*** True Line Result + def play_around args +** Processing line: ~ return false if !@playing_around~ +- Inside source: true +*** True Line Result + return false if !@playing_around +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if args.inputs.keyboard.key_down.escape~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.escape +** Processing line: ~ @current_part = 0~ +- Inside source: true +*** True Line Result + @current_part = 0 +** Processing line: ~ @part_alpha = 0~ +- Inside source: true +*** True Line Result + @part_alpha = 0 +** Processing line: ~ @part_alpha_increment = 10~ +- Inside source: true +*** True Line Result + @part_alpha_increment = 10 +** Processing line: ~ @used_bindings = {}~ +- Inside source: true +*** True Line Result + @used_bindings = {} +** Processing line: ~ @playing_around = false~ +- Inside source: true +*** True Line Result + @playing_around = false +** Processing line: ~ @bindings = []~ +- Inside source: true +*** True Line Result + @bindings = [] +** Processing line: ~ elsif args.inputs.keyboard.key_down.space~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.space +** Processing line: ~ jid = @target[0]~ +- Inside source: true +*** True Line Result + jid = @target[0] +** Processing line: ~ bindingstr = build_binding_string~ +- Inside source: true +*** True Line Result + bindingstr = build_binding_string +** Processing line: ~ #puts("new controller binding: '#{bindingstr}'")~ +- Inside source: true +*** True Line Result + #puts("new controller binding: '#{bindingstr}'") +** Processing line: ~ @runtime.ffi_misc.add_controller_config bindingstr~ +- Inside source: true +*** True Line Result + @runtime.ffi_misc.add_controller_config bindingstr +** Processing line: ~ @runtime.ffi_misc.convert_rawjoystick_to_controller jid~ +- Inside source: true +*** True Line Result + @runtime.ffi_misc.convert_rawjoystick_to_controller jid +** Processing line: ~ @target[0] = -1 # Conversion closes the raw joystick.~ +- Inside source: true +*** True Line Result + @target[0] = -1 # Conversion closes the raw joystick. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Handle any other pending joysticks that have the same GUID (so if you plug in four of the same model, we're already done!)~ +- Inside source: true +*** True Line Result + # Handle any other pending joysticks that have the same GUID (so if you plug in four of the same model, we're already done!) +** Processing line: ~ guid = @target[1][:guid]~ +- Inside source: true +*** True Line Result + guid = @target[1][:guid] +** Processing line: ~ @raw_joysticks.each { |jid, details|~ +- Inside source: true +*** True Line Result + @raw_joysticks.each { |jid, details| +** Processing line: ~ if details[:guid] == guid~ +- Inside source: true +*** True Line Result + if details[:guid] == guid +** Processing line: ~ @runtime.ffi_misc.convert_rawjoystick_to_controller jid~ +- Inside source: true +*** True Line Result + @runtime.ffi_misc.convert_rawjoystick_to_controller jid +** Processing line: ~ details[:guid] = nil~ +- Inside source: true +*** True Line Result + details[:guid] = nil +** 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: ~ # Done with this guy.~ +- Inside source: true +*** True Line Result + # Done with this guy. +** Processing line: ~ @playing_around = false~ +- Inside source: true +*** True Line Result + @playing_around = false +** Processing line: ~ @toggled_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @toggled_at = Kernel.global_tick_count +** Processing line: ~ @fading = -1~ +- Inside source: true +*** True Line Result + @fading = -1 +** 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: ~ render_basics args, 'Now play around with the controller, and make sure it feels right!'~ +- Inside source: true +*** True Line Result + render_basics args, 'Now play around with the controller, and make sure it feels right!' +** Processing line: ~ args.outputs.primitives << [$gtk.logical_width / 2, 90, '[ESCAPE]: Reconfigure, [SPACE]: Save this configuration', 0, 1, 0, 0, 0, 255].label~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [$gtk.logical_width / 2, 90, '[ESCAPE]: Reconfigure, [SPACE]: Save this configuration', 0, 1, 0, 0, 0, 255].label +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ axes = @joystick_state[:axes]~ +- Inside source: true +*** True Line Result + axes = @joystick_state[:axes] +** Processing line: ~ if !axes.nil?~ +- Inside source: true +*** True Line Result + if !axes.nil? +** Processing line: ~ for i in 0..axes.length-1~ +- Inside source: true +*** True Line Result + for i in 0..axes.length-1 +** Processing line: ~ next if axes[i].nil?~ +- Inside source: true +*** True Line Result + next if axes[i].nil? +** Processing line: ~ value = axes[i][:currentval]~ +- Inside source: true +*** True Line Result + value = axes[i][:currentval] +** Processing line: ~ next if value.nil? || (value.abs < 16000)~ +- Inside source: true +*** True Line Result + next if value.nil? || (value.abs < 16000) +** Processing line: ~ render_part_highlight_from_bindstr args, "#{value < 0 ? '-' : '+'}a#{i}"~ +- Inside source: true +*** True Line Result + render_part_highlight_from_bindstr args, "#{value < 0 ? '-' : '+'}a#{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: ~ hats = @joystick_state[:hats]~ +- Inside source: true +*** True Line Result + hats = @joystick_state[:hats] +** Processing line: ~ if !hats.nil?~ +- Inside source: true +*** True Line Result + if !hats.nil? +** Processing line: ~ for i in 0..hats.length-1~ +- Inside source: true +*** True Line Result + for i in 0..hats.length-1 +** Processing line: ~ value = hats[i]~ +- Inside source: true +*** True Line Result + value = hats[i] +** Processing line: ~ next if value.nil? || (value == 0)~ +- Inside source: true +*** True Line Result + next if value.nil? || (value == 0) +** Processing line: ~ render_part_highlight_from_bindstr args, "h#{i}.#{value}"~ +- Inside source: true +*** True Line Result + render_part_highlight_from_bindstr args, "h#{i}.#{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: ~ buttons = @joystick_state[:buttons]~ +- Inside source: true +*** True Line Result + buttons = @joystick_state[:buttons] +** Processing line: ~ if !buttons.nil?~ +- Inside source: true +*** True Line Result + if !buttons.nil? +** Processing line: ~ for i in 0..buttons.length-1~ +- Inside source: true +*** True Line Result + for i in 0..buttons.length-1 +** Processing line: ~ value = buttons[i]~ +- Inside source: true +*** True Line Result + value = buttons[i] +** Processing line: ~ next if value.nil? || !value~ +- Inside source: true +*** True Line Result + next if value.nil? || !value +** Processing line: ~ render_part_highlight_from_bindstr args, "b#{i}"~ +- Inside source: true +*** True Line Result + render_part_highlight_from_bindstr args, "b#{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: ~ return true~ +- Inside source: true +*** True Line Result + return true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def should_tick?~ +- Inside source: true +*** True Line Result + def should_tick? +** Processing line: ~ return true if @play_around~ +- Inside source: true +*** True Line Result + return true if @play_around +** Processing line: ~ return true if @target~ +- Inside source: true +*** True Line Result + return true if @target +** 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 tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ return true if play_around args~ +- Inside source: true +*** True Line Result + return true if play_around args +** Processing line: ~ return false if !choose_target~ +- Inside source: true +*** True Line Result + return false if !choose_target +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ jid = @target[0]~ +- Inside source: true +*** True Line Result + jid = @target[0] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if @fading == 0~ +- Inside source: true +*** True Line Result + if @fading == 0 +** Processing line: ~ # Cancel config?~ +- Inside source: true +*** True Line Result + # Cancel config? +** Processing line: ~ if args.inputs.keyboard.key_down.escape~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.escape +** Processing line: ~ # !!! FIXME: prompt to ignore this joystick forever or just this run~ +- Inside source: true +*** True Line Result + # !!! FIXME: prompt to ignore this joystick forever or just this run +** Processing line: ~ @toggled_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @toggled_at = Kernel.global_tick_count +** Processing line: ~ @fading = -1~ +- Inside source: true +*** True Line Result + @fading = -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: ~ if @fading == 0~ +- Inside source: true +*** True Line Result + if @fading == 0 +** Processing line: ~ if args.inputs.keyboard.key_down.backspace~ +- Inside source: true +*** True Line Result + if args.inputs.keyboard.key_down.backspace +** Processing line: ~ previous_part~ +- Inside source: true +*** True Line Result + previous_part +** Processing line: ~ elsif args.inputs.keyboard.key_down.space~ +- Inside source: true +*** True Line Result + elsif args.inputs.keyboard.key_down.space +** Processing line: ~ next_part~ +- Inside source: true +*** True Line Result + next_part +** 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: ~ fade = calc_fading~ +- Inside source: true +*** True Line Result + fade = calc_fading +** Processing line: ~ if (@fading < 0) && (fade == 0)~ +- Inside source: true +*** True Line Result + if (@fading < 0) && (fade == 0) +** Processing line: ~ @runtime.ffi_misc.close_raw_joystick(jid) if jid >= 0~ +- Inside source: true +*** True Line Result + @runtime.ffi_misc.close_raw_joystick(jid) if jid >= 0 +** Processing line: ~ @target = nil # done with this controller~ +- Inside source: true +*** True Line Result + @target = nil # done with this controller +** 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: ~ render_basics args, (@fading >= 0) ? "We don't recognize this controller, so tell us about it!" : '', fade~ +- Inside source: true +*** True Line Result + render_basics args, (@fading >= 0) ? "We don't recognize this controller, so tell us about it!" : '', fade +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return true if fade < 255 # all done for now~ +- Inside source: true +*** True Line Result + return true if fade < 255 # all done for now +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ part = @parts[@current_part]~ +- Inside source: true +*** True Line Result + part = @parts[@current_part] +** Processing line: ~ args.outputs.primitives << [$gtk.logical_width / 2, 575, "Please press the #{part[2]}.", 0, 1, 0, 0, 0, 255].label~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [$gtk.logical_width / 2, 575, "Please press the #{part[2]}.", 0, 1, 0, 0, 0, 255].label +** Processing line: ~ render_part_highlight args, part, @part_alpha~ +- Inside source: true +*** True Line Result + render_part_highlight args, part, @part_alpha +** Processing line: ~ args.outputs.primitives << [$gtk.logical_width / 2, 90, '[ESCAPE]: Ignore controller, [BACKSPACE]: Go back one button, [SPACE]: Skip this button', 0, 1, 0, 0, 0, 255].label~ +- Inside source: true +*** True Line Result + args.outputs.primitives << [$gtk.logical_width / 2, 90, '[ESCAPE]: Ignore controller, [BACKSPACE]: Go back one button, [SPACE]: Skip this button', 0, 1, 0, 0, 0, 255].label +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @part_alpha += @part_alpha_increment~ +- Inside source: true +*** True Line Result + @part_alpha += @part_alpha_increment +** Processing line: ~ if (@part_alpha_increment > 0) && (@part_alpha >= 255)~ +- Inside source: true +*** True Line Result + if (@part_alpha_increment > 0) && (@part_alpha >= 255) +** Processing line: ~ @part_alpha = 255~ +- Inside source: true +*** True Line Result + @part_alpha = 255 +** Processing line: ~ @part_alpha_increment = -10~ +- Inside source: true +*** True Line Result + @part_alpha_increment = -10 +** Processing line: ~ elsif (@part_alpha_increment < 0) && (@part_alpha <= 0)~ +- Inside source: true +*** True Line Result + elsif (@part_alpha_increment < 0) && (@part_alpha <= 0) +** Processing line: ~ @part_alpha = 0~ +- Inside source: true +*** True Line Result + @part_alpha = 0 +** Processing line: ~ @part_alpha_increment = 10~ +- Inside source: true +*** True Line Result + @part_alpha_increment = 10 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return true~ +- Inside source: true +*** True Line Result + return true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ 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: ~*** controller/keys.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** controller/keys.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/controller/keys.rb~ +- Inside source: true +*** True Line Result + # ./dragon/controller/keys.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # controller/keys.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # controller/keys.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Controller~ +- Inside source: true +*** True Line Result + class Controller +** Processing line: ~ class Keys~ +- Inside source: true +*** True Line Result + class Keys +** Processing line: ~ include Serialize~ +- Inside source: true +*** True Line Result + include Serialize +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ LABELS = [~ +- Inside source: true +*** True Line Result + LABELS = [ +** Processing line: ~ :up, :down, :left, :right,~ +- Inside source: true +*** True Line Result + :up, :down, :left, :right, +** Processing line: ~ :a, :b, :x, :y,~ +- Inside source: true +*** True Line Result + :a, :b, :x, :y, +** Processing line: ~ :l1, :r1,~ +- Inside source: true +*** True Line Result + :l1, :r1, +** Processing line: ~ :l2, :r2,~ +- Inside source: true +*** True Line Result + :l2, :r2, +** Processing line: ~ :l3, :r3,~ +- Inside source: true +*** True Line Result + :l3, :r3, +** Processing line: ~ :start, :select,~ +- Inside source: true +*** True Line Result + :start, :select, +** Processing line: ~ :directional_up, :directional_down, :directional_left, :directional_right~ +- Inside source: true +*** True Line Result + :directional_up, :directional_down, :directional_left, :directional_right +** Processing line: ~ ].freeze~ +- Inside source: true +*** True Line Result + ].freeze +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ LABELS.each do |label|~ +- Inside source: true +*** True Line Result + LABELS.each do |label| +** Processing line: ~ attr label~ +- Inside source: true +*** True Line Result + attr label +** 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 + # Activate a key. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [void]~ +- Inside source: true +*** True Line Result + # @return [void] +** Processing line: ~ def activate key~ +- Inside source: true +*** True Line Result + def activate key +** Processing line: ~ instance_variable_set("@#{key}", Kernel.tick_count + 1)~ +- Inside source: true +*** True Line Result + instance_variable_set("@#{key}", Kernel.tick_count + 1) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Deactivate a key.~ +- Inside source: true +*** True Line Result + # Deactivate a key. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [void]~ +- Inside source: true +*** True Line Result + # @return [void] +** Processing line: ~ def deactivate key~ +- Inside source: true +*** True Line Result + def deactivate key +** Processing line: ~ instance_variable_set("@#{key}", nil)~ +- Inside source: true +*** True Line Result + instance_variable_set("@#{key}", nil) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Clear all key inputs.~ +- Inside source: true +*** True Line Result + # Clear all key inputs. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [void]~ +- Inside source: true +*** True Line Result + # @return [void] +** Processing line: ~ def clear~ +- Inside source: true +*** True Line Result + def clear +** Processing line: ~ LABELS.each { |label| deactivate(label) }~ +- Inside source: true +*** True Line Result + LABELS.each { |label| deactivate(label) } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def truthy_keys~ +- Inside source: true +*** True Line Result + def truthy_keys +** Processing line: ~ LABELS.select { |label| send(label) }~ +- Inside source: true +*** True Line Result + LABELS.select { |label| send(label) } +** 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: ~#+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: ~*** directional_input_helper_methods.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** directional_input_helper_methods.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/directional_input_helper_methods.rb~ +- Inside source: true +*** True Line Result + # ./dragon/directional_input_helper_methods.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # directional_input_helper_methods.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # directional_input_helper_methods.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ # This is a module that contains normalization of behavior related to `up`|`down`|`left`|`right` on keyboards and controllers.~ +- Inside source: true +*** True Line Result + # This is a module that contains normalization of behavior related to `up`|`down`|`left`|`right` on keyboards and controllers. +** Processing line: ~ module DirectionalInputHelperMethods~ +- Inside source: true +*** True Line Result + module DirectionalInputHelperMethods +** Processing line: ~ def self.included klass~ +- Inside source: true +*** True Line Result + def self.included klass +** Processing line: ~ key_state_methods = [:key_held, :key_down]~ +- Inside source: true +*** True Line Result + key_state_methods = [:key_held, :key_down] +** Processing line: ~ directional_methods = [:up, :down, :left, :right]~ +- Inside source: true +*** True Line Result + directional_methods = [:up, :down, :left, :right] +** Processing line: ~ method_results = (directional_methods + key_state_methods).map {|m| [m, klass.instance_methods.include?(m)] }~ +- Inside source: true +*** True Line Result + method_results = (directional_methods + key_state_methods).map {|m| [m, klass.instance_methods.include?(m)] } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ error_message = <<-S~ +- Inside source: true +*** True Line Result + error_message = <<-S +** Processing line: ~ * ERROR~ +- 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:~ +- Inside source: true +*** True Line Result + The GTK::DirectionalKeys module should only be included in objects that respond to the following api heirarchy: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ - (#{ directional_methods.join("|") })~ +- Inside source: true +*** True Line Result + - (#{ directional_methods.join("|") }) +** Processing line: ~ - key_held.(#{ directional_methods.join("|") })~ +- Inside source: true +*** True Line Result + - key_held.(#{ directional_methods.join("|") }) +** Processing line: ~ - key_down.(#{ directional_methods.join("|") })~ +- Inside source: true +*** True Line Result + - key_down.(#{ directional_methods.join("|") }) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #{klass} does not respond to all of these methods (here is the diagnostics):~ +- Inside source: true +*** True Line Result + #{klass} does not respond to all of these methods (here is the diagnostics): +** Processing line: ~ #{method_results.map {|m, r| "- #{m}: #{r}"}.join("\n")}~ +- Inside source: true +*** True Line Result + #{method_results.map {|m, r| "- #{m}: #{r}"}.join("\n")} +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Please implement the methods that returned false inthe list above.~ +- Inside source: true +*** True Line Result + Please implement the methods that returned false inthe list above. +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ unless method_results.map {|m, result| result}.all?~ +- Inside source: true +*** True Line Result + unless method_results.map {|m, result| result}.all? +** Processing line: ~ raise error_message~ +- Inside source: true +*** True Line Result + raise error_message +** 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: ~ # Returns a signal indicating left (`-1`), right (`1`), or neither ('0').~ +- Inside source: true +*** True Line Result + # Returns a signal indicating left (`-1`), right (`1`), or neither ('0'). +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Integer]~ +- Inside source: true +*** True Line Result + # @return [Integer] +** Processing line: ~ def left_right~ +- Inside source: true +*** True Line Result + def left_right +** Processing line: ~ return -1 if self.left~ +- Inside source: true +*** True Line Result + return -1 if self.left +** Processing line: ~ return 1 if self.right~ +- Inside source: true +*** True Line Result + return 1 if self.right +** Processing line: ~ return 0~ +- Inside source: true +*** True Line Result + return 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns a signal indicating up (`1`), down (`-1`), or neither ('0').~ +- Inside source: true +*** True Line Result + # Returns a signal indicating up (`1`), down (`-1`), or neither ('0'). +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Integer]~ +- Inside source: true +*** True Line Result + # @return [Integer] +** Processing line: ~ def up_down~ +- Inside source: true +*** True Line Result + def up_down +** Processing line: ~ return 1 if self.up~ +- Inside source: true +*** True Line Result + return 1 if self.up +** Processing line: ~ return -1 if self.down~ +- Inside source: true +*** True Line Result + return -1 if self.down +** Processing line: ~ return 0~ +- Inside source: true +*** True Line Result + return 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns a normal vector (in the form of an Array with two values). If no directionals are held/down, the function returns nil.~ +- Inside source: true +*** True Line Result + # Returns a normal vector (in the form of an Array with two values). If no directionals are held/down, the function returns nil. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # The possible results are:~ +- Inside source: true +*** True Line Result + # The possible results are: +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # - ~nil~ which denotes that no directional input exists.~ +- Inside source: true +*** True Line Result + # - ~nil~ which denotes that no directional input exists. +** Processing line: ~ # - ~[ 0, 1]~ which denotes that only up is being held/pressed.~ +- Inside source: true +*** True Line Result + # - ~[ 0, 1]~ which denotes that only up is being held/pressed. +** Processing line: ~ # - ~[ 0, -1]~ which denotes that only down is being held/pressed.~ +- Inside source: true +*** True Line Result + # - ~[ 0, -1]~ which denotes that only down is being held/pressed. +** Processing line: ~ # - ~[-0.707, 0.707]~ which denotes that right and up are being pressed/held.~ +- Inside source: true +*** True Line Result + # - ~[-0.707, 0.707]~ which denotes that right and up are being pressed/held. +** Processing line: ~ # - ~[-0.707, -0.707]~ which denotes that left and down are being pressed/held.~ +- Inside source: true +*** True Line Result + # - ~[-0.707, -0.707]~ which denotes that left and down are being pressed/held. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def directional_vector~ +- Inside source: true +*** True Line Result + def directional_vector +** Processing line: ~ lr, ud = [self.left_right, self.up_down]~ +- Inside source: true +*** True Line Result + lr, ud = [self.left_right, self.up_down] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if lr == 0 && ud == 0~ +- Inside source: true +*** True Line Result + if lr == 0 && ud == 0 +** Processing line: ~ return nil~ +- Inside source: true +*** True Line Result + return nil +** Processing line: ~ elsif lr.abs == ud.abs~ +- Inside source: true +*** True Line Result + elsif lr.abs == ud.abs +** Processing line: ~ return [45.vector_x * lr.sign, 45.vector_y * ud.sign, ud.sign]~ +- Inside source: true +*** True Line Result + return [45.vector_x * lr.sign, 45.vector_y * ud.sign, ud.sign] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return [lr, ud]~ +- Inside source: true +*** True Line Result + return [lr, ud] +** 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 method_missing m, *args~ +- Inside source: true +*** True Line Result + def method_missing m, *args +** Processing line: ~ # combine the key with ctrl_~ +- Inside source: true +*** True Line Result + # combine the key with ctrl_ +** Processing line: ~ if m.to_s.start_with?("ctrl_")~ +- Inside source: true +*** True Line Result + if m.to_s.start_with?("ctrl_") +** Processing line: ~ other_key = m.to_s.split("_").last~ +- Inside source: true +*** True Line Result + other_key = m.to_s.split("_").last +** Processing line: ~ define_singleton_method(m) do~ +- Inside source: true +*** True Line Result + define_singleton_method(m) do +** Processing line: ~ return self.key_up.send(other_key.to_sym) && self.key_up.control~ +- Inside source: true +*** True Line Result + return self.key_up.send(other_key.to_sym) && self.key_up.control +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return send(m)~ +- Inside source: true +*** True Line Result + return send(m) +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ # see if the key is either held or down~ +- Inside source: true +*** True Line Result + # see if the key is either held or down +** Processing line: ~ define_singleton_method(m) do~ +- Inside source: true +*** True Line Result + define_singleton_method(m) do +** Processing line: ~ self.key_down.send(m) || self.key_held.send(m)~ +- Inside source: true +*** True Line Result + self.key_down.send(m) || self.key_held.send(m) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return send(m)~ +- Inside source: true +*** True Line Result + return send(m) +** 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: ~#+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: ~*** easing.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** easing.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/easing.rb~ +- Inside source: true +*** True Line Result + # ./dragon/easing.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # easing.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # easing.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ module Easing~ +- Inside source: true +*** True Line Result + module Easing +** Processing line: ~ def self.ease start_tick, current_tick, duration, *definitions~ +- Inside source: true +*** True Line Result + def self.ease start_tick, current_tick, duration, *definitions +** Processing line: ~ ease_extended start_tick,~ +- Inside source: true +*** True Line Result + ease_extended start_tick, +** Processing line: ~ current_tick,~ +- Inside source: true +*** True Line Result + current_tick, +** Processing line: ~ start_tick + duration,~ +- Inside source: true +*** True Line Result + start_tick + duration, +** Processing line: ~ (initial_value *definitions),~ +- Inside source: true +*** True Line Result + (initial_value *definitions), +** Processing line: ~ (final_value *definitions),~ +- Inside source: true +*** True Line Result + (final_value *definitions), +** Processing line: ~ *definitions~ +- Inside source: true +*** True Line Result + *definitions +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.ease_extended start_tick, current_tick, end_tick, default_before, default_after, *definitions~ +- Inside source: true +*** True Line Result + def self.ease_extended start_tick, current_tick, end_tick, default_before, default_after, *definitions +** Processing line: ~ definitions.flatten!~ +- Inside source: true +*** True Line Result + definitions.flatten! +** Processing line: ~ definitions = [:identity] if definitions.length == 0~ +- Inside source: true +*** True Line Result + definitions = [:identity] if definitions.length == 0 +** Processing line: ~ duration = end_tick - start_tick~ +- Inside source: true +*** True Line Result + duration = end_tick - start_tick +** Processing line: ~ elapsed = current_tick - start_tick~ +- Inside source: true +*** True Line Result + elapsed = current_tick - start_tick +** Processing line: ~ y = elapsed.percentage_of(duration).cap_min_max(0, 1)~ +- Inside source: true +*** True Line Result + y = elapsed.percentage_of(duration).cap_min_max(0, 1) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ definitions.map do |definition|~ +- Inside source: true +*** True Line Result + definitions.map do |definition| +** Processing line: ~ y = Easing.exec_definition(definition, start_tick, duration, y)~ +- Inside source: true +*** True Line Result + y = Easing.exec_definition(definition, start_tick, duration, y) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ y~ +- Inside source: true +*** True Line Result + y +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.ease_spline start_tick, current_tick, duration, spline~ +- Inside source: true +*** True Line Result + def self.ease_spline start_tick, current_tick, duration, spline +** Processing line: ~ ease_spline_extended start_tick, current_tick, start_tick + duration, spline~ +- Inside source: true +*** True Line Result + ease_spline_extended start_tick, current_tick, start_tick + duration, spline +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.ease_spline_extended start_tick, current_tick, end_tick, spline~ +- Inside source: true +*** True Line Result + def self.ease_spline_extended start_tick, current_tick, end_tick, spline +** Processing line: ~ return spline[-1][-1] if current_tick >= end_tick~ +- Inside source: true +*** True Line Result + return spline[-1][-1] if current_tick >= end_tick +** Processing line: ~ duration = end_tick - start_tick~ +- Inside source: true +*** True Line Result + duration = end_tick - start_tick +** Processing line: ~ t = (current_tick - start_tick).fdiv duration~ +- Inside source: true +*** True Line Result + t = (current_tick - start_tick).fdiv duration +** Processing line: ~ time_allocation_per_curve = 1.fdiv(spline.length)~ +- Inside source: true +*** True Line Result + time_allocation_per_curve = 1.fdiv(spline.length) +** Processing line: ~ curve_index, curve_t = t.fdiv(time_allocation_per_curve).let do |spline_t|~ +- Inside source: true +*** True Line Result + curve_index, curve_t = t.fdiv(time_allocation_per_curve).let do |spline_t| +** Processing line: ~ [spline_t.to_i, spline_t - spline_t.to_i]~ +- Inside source: true +*** True Line Result + [spline_t.to_i, spline_t - spline_t.to_i] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ Geometry.cubic_bezier curve_t, *spline[curve_index]~ +- Inside source: true +*** True Line Result + Geometry.cubic_bezier curve_t, *spline[curve_index] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.initial_value *definitions~ +- Inside source: true +*** True Line Result + def self.initial_value *definitions +** Processing line: ~ definitions.flatten!~ +- Inside source: true +*** True Line Result + definitions.flatten! +** Processing line: ~ return Easing.exec_definition (definitions.at(-1) || :identity), 0, 10, 0~ +- Inside source: true +*** True Line Result + return Easing.exec_definition (definitions.at(-1) || :identity), 0, 10, 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.final_value *definitions~ +- Inside source: true +*** True Line Result + def self.final_value *definitions +** Processing line: ~ definitions.flatten!~ +- Inside source: true +*** True Line Result + definitions.flatten! +** Processing line: ~ return Easing.exec_definition (definitions.at(-1) || :identity), 0, 10, 1.0~ +- Inside source: true +*** True Line Result + return Easing.exec_definition (definitions.at(-1) || :identity), 0, 10, 1.0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.exec_definition definition, start_tick, duration, x~ +- Inside source: true +*** True Line Result + def self.exec_definition definition, start_tick, duration, x +** Processing line: ~ if definition.is_a? Symbol~ +- Inside source: true +*** True Line Result + if definition.is_a? Symbol +** Processing line: ~ return Easing.send(definition, x).cap_min_max(0, 1)~ +- Inside source: true +*** True Line Result + return Easing.send(definition, x).cap_min_max(0, 1) +** Processing line: ~ elsif definition.is_a? Proc~ +- Inside source: true +*** True Line Result + elsif definition.is_a? Proc +** Processing line: ~ return definition.call(x, start_tick, duration).cap_min_max(0, 1)~ +- Inside source: true +*** True Line Result + return definition.call(x, start_tick, duration).cap_min_max(0, 1) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ I don't know how to execute easing function with definition #{definition}.~ +- Inside source: true +*** True Line Result + I don't know how to execute easing function with definition #{definition}. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.identity x~ +- Inside source: true +*** True Line Result + def self.identity x +** Processing line: ~ x~ +- Inside source: true +*** True Line Result + x +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.flip x~ +- Inside source: true +*** True Line Result + def self.flip x +** Processing line: ~ 1 - x~ +- Inside source: true +*** True Line Result + 1 - x +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.quad x~ +- Inside source: true +*** True Line Result + def self.quad x +** Processing line: ~ x * x~ +- Inside source: true +*** True Line Result + x * x +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.cube x~ +- Inside source: true +*** True Line Result + def self.cube x +** Processing line: ~ x * x * x~ +- Inside source: true +*** True Line Result + x * x * x +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.quart x~ +- Inside source: true +*** True Line Result + def self.quart x +** Processing line: ~ x * x * x * x * x~ +- Inside source: true +*** True Line Result + x * x * x * x * x +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.quint x~ +- Inside source: true +*** True Line Result + def self.quint x +** Processing line: ~ x * x * x * x * x * x~ +- Inside source: true +*** True Line Result + x * x * x * x * x * x +** 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: ~ Easing = GTK::Easing~ +- Inside source: true +*** True Line Result + Easing = GTK::Easing +** 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: ~*** entity.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** entity.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/entity.rb~ +- Inside source: true +*** True Line Result + # ./dragon/entity.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # entity.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # entity.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Entity~ +- Inside source: true +*** True Line Result + class Entity +** Processing line: ~ def self.id!~ +- Inside source: true +*** True Line Result + def self.id! +** Processing line: ~ @id ||= 0~ +- Inside source: true +*** True Line Result + @id ||= 0 +** Processing line: ~ @id += 1~ +- Inside source: true +*** True Line Result + @id += 1 +** Processing line: ~ @id~ +- Inside source: true +*** True Line Result + @id +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.__reset_id__!~ +- Inside source: true +*** True Line Result + def self.__reset_id__! +** Processing line: ~ @id = 0~ +- Inside source: true +*** True Line Result + @id = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.strict_entities~ +- Inside source: true +*** True Line Result + def self.strict_entities +** Processing line: ~ @strict_entities ||= {}~ +- Inside source: true +*** True Line Result + @strict_entities ||= {} +** Processing line: ~ @strict_entities~ +- Inside source: true +*** True Line Result + @strict_entities +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.parse_serialization_data data~ +- Inside source: true +*** True Line Result + def self.parse_serialization_data data +** Processing line: ~ r = Entity.parse_serialization_data data~ +- Inside source: true +*** True Line Result + r = Entity.parse_serialization_data data +** Processing line: ~ return r if r.is_a? OpenEntity~ +- Inside source: true +*** True Line Result + return r if r.is_a? OpenEntity +** Processing line: ~ return r if r.is_a? StrictEntity~ +- Inside source: true +*** True Line Result + return r if r.is_a? StrictEntity +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ The save data looks to be corrupt.~ +- Inside source: true +*** True Line Result + The save data looks to be corrupt. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.parse_serialization_data value~ +- Inside source: true +*** True Line Result + def self.parse_serialization_data value +** Processing line: ~ if value.is_a?(Hash) && value[:entity_id] && value[:entity_strict]~ +- Inside source: true +*** True Line Result + if value.is_a?(Hash) && value[:entity_id] && value[:entity_strict] +** Processing line: ~ o = new_entity_strict value[:entity_name], value~ +- Inside source: true +*** True Line Result + o = new_entity_strict value[:entity_name], value +** Processing line: ~ o.load_entity_data! value~ +- Inside source: true +*** True Line Result + o.load_entity_data! value +** Processing line: ~ return o~ +- Inside source: true +*** True Line Result + return o +** Processing line: ~ elsif value.is_a?(Hash) && value[:entity_id]~ +- Inside source: true +*** True Line Result + elsif value.is_a?(Hash) && value[:entity_id] +** Processing line: ~ o = OpenEntity.new~ +- Inside source: true +*** True Line Result + o = OpenEntity.new +** Processing line: ~ o.load_entity_data! value~ +- Inside source: true +*** True Line Result + o.load_entity_data! value +** Processing line: ~ return o~ +- Inside source: true +*** True Line Result + return o +** Processing line: ~ elsif value.is_a? Array~ +- Inside source: true +*** True Line Result + elsif value.is_a? Array +** Processing line: ~ return value.map { |entry| Entity.parse_serialization_data entry }~ +- Inside source: true +*** True Line Result + return value.map { |entry| Entity.parse_serialization_data entry } +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return value~ +- Inside source: true +*** True Line Result + return 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: ~ def self.new_entity entity_type, init_hash = nil, block = nil~ +- Inside source: true +*** True Line Result + def self.new_entity entity_type, init_hash = nil, block = nil +** Processing line: ~ n = OpenEntity.new(entity_type)~ +- Inside source: true +*** True Line Result + n = OpenEntity.new(entity_type) +** Processing line: ~ n.entity_type = entity_type~ +- Inside source: true +*** True Line Result + n.entity_type = entity_type +** Processing line: ~ n.created_at = Kernel.tick_count~ +- Inside source: true +*** True Line Result + n.created_at = Kernel.tick_count +** Processing line: ~ n.global_created_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + n.global_created_at = Kernel.global_tick_count +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if init_hash~ +- Inside source: true +*** True Line Result + if init_hash +** Processing line: ~ init_hash.each do |k, v|~ +- Inside source: true +*** True Line Result + init_hash.each do |k, v| +** Processing line: ~ n.as_hash[k] = v~ +- Inside source: true +*** True Line Result + n.as_hash[k] = v +** 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: ~ block.call(n) if block~ +- Inside source: true +*** True Line Result + block.call(n) if block +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ n~ +- Inside source: true +*** True Line Result + n +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.new_entity_strict entity_type, init_hash = nil, block = nil~ +- Inside source: true +*** True Line Result + def self.new_entity_strict entity_type, init_hash = nil, block = nil +** Processing line: ~ if !Entity.strict_entities[entity_type]~ +- Inside source: true +*** True Line Result + if !Entity.strict_entities[entity_type] +** Processing line: ~ init_hash ||= { }~ +- Inside source: true +*** True Line Result + init_hash ||= { } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ n = new_entity entity_type, init_hash, block~ +- Inside source: true +*** True Line Result + n = new_entity entity_type, init_hash, block +** Processing line: ~ klass = Class.new(StrictEntity)~ +- Inside source: true +*** True Line Result + klass = Class.new(StrictEntity) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ klass.class_eval do~ +- Inside source: true +*** True Line Result + klass.class_eval do +** Processing line: ~ init_hash.each do |k, v|~ +- Inside source: true +*** True Line Result + init_hash.each do |k, v| +** Processing line: ~ attr_accessor k~ +- Inside source: true +*** True Line Result + attr_accessor k +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ n.as_hash.each do |k, v|~ +- Inside source: true +*** True Line Result + n.as_hash.each do |k, v| +** Processing line: ~ attr_accessor k if !init_hash[k]~ +- Inside source: true +*** True Line Result + attr_accessor k if !init_hash[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: ~ Entity.strict_entities[entity_type] = klass~ +- Inside source: true +*** True Line Result + Entity.strict_entities[entity_type] = klass +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ klass = Entity.strict_entities[entity_type]~ +- Inside source: true +*** True Line Result + klass = Entity.strict_entities[entity_type] +** Processing line: ~ (klass.new entity_type, init_hash, block)~ +- Inside source: true +*** True Line Result + (klass.new entity_type, init_hash, block) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** geometry.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** geometry.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/geometry.rb~ +- Inside source: true +*** True Line Result + # ./dragon/geometry.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # geometry.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # geometry.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ module Geometry~ +- Inside source: true +*** True Line Result + module Geometry +** Processing line: ~ # Returns f(t) for a cubic Bezier curve.~ +- Inside source: true +*** True Line Result + # Returns f(t) for a cubic Bezier curve. +** Processing line: ~ def self.cubic_bezier t, a, b, c, d~ +- Inside source: true +*** True Line Result + def self.cubic_bezier t, a, b, c, d +** Processing line: ~ s = 1 - t~ +- Inside source: true +*** True Line Result + s = 1 - t +** Processing line: ~ s0 = 1~ +- Inside source: true +*** True Line Result + s0 = 1 +** Processing line: ~ s1 = s~ +- Inside source: true +*** True Line Result + s1 = s +** Processing line: ~ s2 = s * s~ +- Inside source: true +*** True Line Result + s2 = s * s +** Processing line: ~ s3 = s * s * s~ +- Inside source: true +*** True Line Result + s3 = s * s * s +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ t0 = 1~ +- Inside source: true +*** True Line Result + t0 = 1 +** Processing line: ~ t1 = t~ +- Inside source: true +*** True Line Result + t1 = t +** Processing line: ~ t2 = t * t~ +- Inside source: true +*** True Line Result + t2 = t * t +** Processing line: ~ t3 = t * t * t~ +- Inside source: true +*** True Line Result + t3 = t * t * t +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ 1 * s3 * t0 * a +~ +- Inside source: true +*** True Line Result + 1 * s3 * t0 * a + +** Processing line: ~ 3 * s2 * t1 * b +~ +- Inside source: true +*** True Line Result + 3 * s2 * t1 * b + +** Processing line: ~ 3 * s1 * t2 * c +~ +- Inside source: true +*** True Line Result + 3 * s1 * t2 * c + +** Processing line: ~ 1 * s0 * t3 * d~ +- Inside source: true +*** True Line Result + 1 * s0 * t3 * d +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns true if a primitive's rectangle is entirely inside another primitive's rectangle.~ +- Inside source: true +*** True Line Result + # Returns true if a primitive's rectangle is entirely inside another primitive's rectangle. +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def inside_rect? outer, tolerance = 0.0~ +- Inside source: true +*** True Line Result + def inside_rect? outer, tolerance = 0.0 +** Processing line: ~ Geometry.inside_rect? self, outer, tolerance~ +- Inside source: true +*** True Line Result + Geometry.inside_rect? self, outer, tolerance +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns true if a primitive's rectangle overlaps another primitive's rectangle.~ +- Inside source: true +*** True Line Result + # Returns true if a primitive's rectangle overlaps another primitive's rectangle. +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def intersect_rect? other, tolerance = 0.1~ +- Inside source: true +*** True Line Result + def intersect_rect? other, tolerance = 0.1 +** Processing line: ~ Geometry.intersect_rect? self, other, tolerance~ +- Inside source: true +*** True Line Result + Geometry.intersect_rect? self, other, tolerance +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def intersects_rect? *args~ +- Inside source: true +*** True Line Result + def intersects_rect? *args +** Processing line: ~ Geometry.intersects_rect?(*args)~ +- Inside source: true +*** True Line Result + Geometry.intersects_rect?(*args) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def scale_rect_extended percentage_x: percentage_x,~ +- Inside source: true +*** True Line Result + def scale_rect_extended percentage_x: percentage_x, +** Processing line: ~ percentage_y: percentage_y,~ +- Inside source: true +*** True Line Result + percentage_y: percentage_y, +** Processing line: ~ anchor_x: anchor_x,~ +- Inside source: true +*** True Line Result + anchor_x: anchor_x, +** Processing line: ~ anchor_y: anchor_y~ +- Inside source: true +*** True Line Result + anchor_y: anchor_y +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Geometry.scale_rect_extended self,~ +- Inside source: true +*** True Line Result + Geometry.scale_rect_extended self, +** Processing line: ~ percentage_x: percentage_x,~ +- Inside source: true +*** True Line Result + percentage_x: percentage_x, +** Processing line: ~ percentage_y: percentage_y,~ +- Inside source: true +*** True Line Result + percentage_y: percentage_y, +** Processing line: ~ anchor_x: anchor_x,~ +- Inside source: true +*** True Line Result + anchor_x: anchor_x, +** Processing line: ~ anchor_y: anchor_y~ +- Inside source: true +*** True Line Result + anchor_y: anchor_y +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Scales a primitive rect by a percentage.~ +- Inside source: true +*** True Line Result + # Scales a primitive rect by a percentage. +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def scale_rect percentage, *anchors~ +- Inside source: true +*** True Line Result + def scale_rect percentage, *anchors +** Processing line: ~ Geometry.scale_rect self, percentage, *anchors~ +- Inside source: true +*** True Line Result + Geometry.scale_rect self, percentage, *anchors +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the angle from one primitive to another primitive.~ +- Inside source: true +*** True Line Result + # Returns the angle from one primitive to another primitive. +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def angle_to other_point~ +- Inside source: true +*** True Line Result + def angle_to other_point +** Processing line: ~ Geometry.angle_to self, other_point~ +- Inside source: true +*** True Line Result + Geometry.angle_to self, other_point +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the angle to one primitive from another primitive.~ +- Inside source: true +*** True Line Result + # Returns the angle to one primitive from another primitive. +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def angle_from other_point~ +- Inside source: true +*** True Line Result + def angle_from other_point +** Processing line: ~ Geometry.angle_from self, other_point~ +- Inside source: true +*** True Line Result + Geometry.angle_from self, other_point +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns true if a primitive is within a circle specified by the circle's center and radius.~ +- Inside source: true +*** True Line Result + # Returns true if a primitive is within a circle specified by the circle's center and radius. +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def point_inside_circle? circle_center_point, radius~ +- Inside source: true +*** True Line Result + def point_inside_circle? circle_center_point, radius +** Processing line: ~ Geometry.point_inside_circle? self, circle_center_point, radius~ +- Inside source: true +*** True Line Result + Geometry.point_inside_circle? self, circle_center_point, radius +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.center_inside_rect rect, other_rect~ +- Inside source: true +*** True Line Result + def self.center_inside_rect rect, other_rect +** Processing line: ~ offset_x = (other_rect.w - rect.w).half~ +- Inside source: true +*** True Line Result + offset_x = (other_rect.w - rect.w).half +** Processing line: ~ offset_y = (other_rect.h - rect.h).half~ +- Inside source: true +*** True Line Result + offset_y = (other_rect.h - rect.h).half +** Processing line: ~ new_rect = rect.shift_rect(0, 0)~ +- Inside source: true +*** True Line Result + new_rect = rect.shift_rect(0, 0) +** Processing line: ~ new_rect.x = other_rect.x + offset_x~ +- Inside source: true +*** True Line Result + new_rect.x = other_rect.x + offset_x +** Processing line: ~ new_rect.y = other_rect.y + offset_y~ +- Inside source: true +*** True Line Result + new_rect.y = other_rect.y + offset_y +** Processing line: ~ new_rect~ +- Inside source: true +*** True Line Result + new_rect +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise e, <<-S~ +- Inside source: true +*** True Line Result + raise e, <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ center_inside_rect for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.~ +- Inside source: true +*** True Line Result + center_inside_rect for self #{self} and other_rect #{other_rect}. Failed with exception #{e}. +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def center_inside_rect other_rect~ +- Inside source: true +*** True Line Result + def center_inside_rect other_rect +** Processing line: ~ Geometry.center_inside_rect self, other_rect~ +- Inside source: true +*** True Line Result + Geometry.center_inside_rect self, other_rect +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.center_inside_rect_x rect, other_rect~ +- Inside source: true +*** True Line Result + def self.center_inside_rect_x rect, other_rect +** Processing line: ~ offset_x = (other_rect.w - rect.w).half~ +- Inside source: true +*** True Line Result + offset_x = (other_rect.w - rect.w).half +** Processing line: ~ new_rect = rect.shift_rect(0, 0)~ +- Inside source: true +*** True Line Result + new_rect = rect.shift_rect(0, 0) +** Processing line: ~ new_rect.x = other_rect.x + offset_x~ +- Inside source: true +*** True Line Result + new_rect.x = other_rect.x + offset_x +** Processing line: ~ new_rect.y = other_rect.y~ +- Inside source: true +*** True Line Result + new_rect.y = other_rect.y +** Processing line: ~ new_rect~ +- Inside source: true +*** True Line Result + new_rect +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise e, <<-S~ +- Inside source: true +*** True Line Result + raise e, <<-S +** Processing line: ~ * ERROR:~ +- 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}.~ +- Inside source: true +*** True Line Result + center_inside_rect_x for self #{self} and other_rect #{other_rect}. Failed with exception #{e}. +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def center_inside_rect_x other_rect~ +- Inside source: true +*** True Line Result + def center_inside_rect_x other_rect +** Processing line: ~ Geometry.center_inside_rect_x self, other_rect~ +- Inside source: true +*** True Line Result + Geometry.center_inside_rect_x self, other_rect +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.center_inside_rect_y rect, other_rect~ +- Inside source: true +*** True Line Result + def self.center_inside_rect_y rect, other_rect +** Processing line: ~ offset_y = (other_rect.h - rect.h).half~ +- Inside source: true +*** True Line Result + offset_y = (other_rect.h - rect.h).half +** Processing line: ~ new_rect = rect.shift_rect(0, 0)~ +- Inside source: true +*** True Line Result + new_rect = rect.shift_rect(0, 0) +** Processing line: ~ new_rect.x = other_rect.x~ +- Inside source: true +*** True Line Result + new_rect.x = other_rect.x +** Processing line: ~ new_rect.y = other_rect.y + offset_y~ +- Inside source: true +*** True Line Result + new_rect.y = other_rect.y + offset_y +** Processing line: ~ new_rect~ +- Inside source: true +*** True Line Result + new_rect +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise e, <<-S~ +- Inside source: true +*** True Line Result + raise e, <<-S +** Processing line: ~ * ERROR:~ +- 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}.~ +- Inside source: true +*** True Line Result + center_inside_rect_y for self #{self} and other_rect #{other_rect}. Failed with exception #{e}. +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def center_inside_rect_y other_rect~ +- Inside source: true +*** True Line Result + def center_inside_rect_y other_rect +** Processing line: ~ Geometry.center_inside_rect_y self, other_rect~ +- Inside source: true +*** True Line Result + Geometry.center_inside_rect_y self, other_rect +** 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: ~ # Returns a primitive that is anchored/repositioned based off its retangle.~ +- Inside source: true +*** True Line Result + # Returns a primitive that is anchored/repositioned based off its retangle. +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def anchor_rect anchor_x, anchor_y~ +- Inside source: true +*** True Line Result + def anchor_rect anchor_x, anchor_y +** Processing line: ~ current_w = self.w~ +- Inside source: true +*** True Line Result + current_w = self.w +** Processing line: ~ current_h = self.h~ +- Inside source: true +*** True Line Result + current_h = self.h +** Processing line: ~ delta_x = -1 * (anchor_x * current_w)~ +- Inside source: true +*** True Line Result + delta_x = -1 * (anchor_x * current_w) +** Processing line: ~ delta_y = -1 * (anchor_y * current_h)~ +- Inside source: true +*** True Line Result + delta_y = -1 * (anchor_y * current_h) +** Processing line: ~ self.shift_rect(delta_x, delta_y)~ +- Inside source: true +*** True Line Result + self.shift_rect(delta_x, delta_y) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def angle_given_point other_point~ +- Inside source: true +*** True Line Result + def angle_given_point other_point +** Processing line: ~ raise ":angle_given_point has been deprecated use :angle_from instead."~ +- Inside source: true +*** True Line Result + raise ":angle_given_point has been deprecated use :angle_from instead." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.shift_line line, x, y~ +- Inside source: true +*** True Line Result + def self.shift_line line, x, y +** Processing line: ~ if line.is_a?(Array) || line.is_a?(Hash)~ +- Inside source: true +*** True Line Result + if line.is_a?(Array) || line.is_a?(Hash) +** Processing line: ~ new_line = line.dup~ +- Inside source: true +*** True Line Result + new_line = line.dup +** Processing line: ~ new_line.x += x~ +- Inside source: true +*** True Line Result + new_line.x += x +** Processing line: ~ new_line.x2 += x~ +- Inside source: true +*** True Line Result + new_line.x2 += x +** Processing line: ~ new_line.y += y~ +- Inside source: true +*** True Line Result + new_line.y += y +** Processing line: ~ new_line.y2 += y~ +- Inside source: true +*** True Line Result + new_line.y2 += y +** Processing line: ~ new_line~ +- Inside source: true +*** True Line Result + new_line +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ raise "shift_line for #{line} is not supported."~ +- Inside source: true +*** True Line Result + raise "shift_line for #{line} is not supported." +** 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 self.intersects_rect? *args~ +- Inside source: true +*** True Line Result + def self.intersects_rect? *args +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ intersects_rect? (with an \"s\") has been deprecated.~ +- Inside source: true +*** True Line Result + intersects_rect? (with an \"s\") has been deprecated. +** Processing line: ~ Use intersect_rect? instead (remove the \"s\").~ +- Inside source: true +*** True Line Result + Use intersect_rect? instead (remove the \"s\"). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ * NOTE:~ +- Inside source: true +*** True Line Result + * NOTE: +** Processing line: ~ Ruby's naming convention is to *never* include the \"s\" for~ +- Inside source: true +*** True Line Result + Ruby's naming convention is to *never* include the \"s\" for +** Processing line: ~ interrogative method names (methods that end with a ?). It~ +- Inside source: true +*** True Line Result + interrogative method names (methods that end with a ?). It +** Processing line: ~ doesn't sound grammatically correct, but that has been the~ +- Inside source: true +*** True Line Result + doesn't sound grammatically correct, but that has been the +** Processing line: ~ rule for a long time (and why intersects_rect? has been deprecated).~ +- Inside source: true +*** True Line Result + rule for a long time (and why intersects_rect? has been deprecated). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.line_y_intercept line~ +- Inside source: true +*** True Line Result + def self.line_y_intercept line +** Processing line: ~ line.y - line_slope(line) * line.x~ +- Inside source: true +*** True Line Result + line.y - line_slope(line) * line.x +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.angle_between_lines line_one, line_two, replace_infinity: nil~ +- Inside source: true +*** True Line Result + def self.angle_between_lines line_one, line_two, replace_infinity: nil +** Processing line: ~ m_line_one = line_slope line_one, replace_infinity: replace_infinity~ +- Inside source: true +*** True Line Result + m_line_one = line_slope line_one, replace_infinity: replace_infinity +** Processing line: ~ m_line_two = line_slope line_two, replace_infinity: replace_infinity~ +- Inside source: true +*** True Line Result + m_line_two = line_slope line_two, replace_infinity: replace_infinity +** Processing line: ~ Math.atan((m_line_one - m_line_two) / (1 + m_line_two * m_line_one)).to_degrees~ +- Inside source: true +*** True Line Result + Math.atan((m_line_one - m_line_two) / (1 + m_line_two * m_line_one)).to_degrees +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.line_slope line, replace_infinity: nil~ +- Inside source: true +*** True Line Result + def self.line_slope line, replace_infinity: nil +** Processing line: ~ return replace_infinity if line.x2 == line.x~ +- Inside source: true +*** True Line Result + return replace_infinity if line.x2 == line.x +** Processing line: ~ (line.y2 - line.y).fdiv(line.x2 - line.x)~ +- Inside source: true +*** True Line Result + (line.y2 - line.y).fdiv(line.x2 - line.x) +** Processing line: ~ .replace_infinity(replace_infinity)~ +- Inside source: true +*** True Line Result + .replace_infinity(replace_infinity) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.line_rise_run line~ +- Inside source: true +*** True Line Result + def self.line_rise_run line +** Processing line: ~ rise = (line.y2 - line.y).to_f~ +- Inside source: true +*** True Line Result + rise = (line.y2 - line.y).to_f +** Processing line: ~ run = (line.x2 - line.x).to_f~ +- Inside source: true +*** True Line Result + run = (line.x2 - line.x).to_f +** Processing line: ~ if rise.abs > run.abs && rise != 0~ +- Inside source: true +*** True Line Result + if rise.abs > run.abs && rise != 0 +** Processing line: ~ rise = rise.fdiv rise.abs~ +- Inside source: true +*** True Line Result + rise = rise.fdiv rise.abs +** Processing line: ~ run = run.fdiv rise.abs~ +- Inside source: true +*** True Line Result + run = run.fdiv rise.abs +** Processing line: ~ elsif run.abs > rise.abs && run != 0~ +- Inside source: true +*** True Line Result + elsif run.abs > rise.abs && run != 0 +** Processing line: ~ rise = rise.fdiv run.abs~ +- Inside source: true +*** True Line Result + rise = rise.fdiv run.abs +** Processing line: ~ run = run.fdiv run.abs~ +- Inside source: true +*** True Line Result + run = run.fdiv run.abs +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ rise = rise / rise.abs if rise != 0~ +- Inside source: true +*** True Line Result + rise = rise / rise.abs if rise != 0 +** Processing line: ~ run = run / run.abs if run != 0~ +- Inside source: true +*** True Line Result + run = run / run.abs if run != 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ return { x: run , y: rise }~ +- Inside source: true +*** True Line Result + return { x: run , y: rise } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.ray_test point, line~ +- Inside source: true +*** True Line Result + def self.ray_test point, line +** Processing line: ~ slope = (line.y2 - line.y).fdiv(line.x2 - line.x)~ +- Inside source: true +*** True Line Result + slope = (line.y2 - line.y).fdiv(line.x2 - line.x) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if line.x > line.x2~ +- Inside source: true +*** True Line Result + if line.x > line.x2 +** Processing line: ~ point_two, point_one = [point_one, point_two]~ +- Inside source: true +*** True Line Result + point_two, point_one = [point_one, point_two] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ r = ((line.x2 - line.x) * (point.y - line.y) -~ +- Inside source: true +*** True Line Result + r = ((line.x2 - line.x) * (point.y - line.y) - +** Processing line: ~ (point.x - line.x) * (line.y2 - line.y))~ +- Inside source: true +*** True Line Result + (point.x - line.x) * (line.y2 - line.y)) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if r == 0~ +- Inside source: true +*** True Line Result + if r == 0 +** Processing line: ~ return :on~ +- Inside source: true +*** True Line Result + return :on +** Processing line: ~ elsif r < 0~ +- Inside source: true +*** True Line Result + elsif r < 0 +** Processing line: ~ return :right if slope >= 0~ +- Inside source: true +*** True Line Result + return :right if slope >= 0 +** Processing line: ~ return :left~ +- Inside source: true +*** True Line Result + return :left +** Processing line: ~ elsif r > 0~ +- Inside source: true +*** True Line Result + elsif r > 0 +** Processing line: ~ return :left if slope >= 0~ +- Inside source: true +*** True Line Result + return :left if slope >= 0 +** Processing line: ~ return :right~ +- Inside source: true +*** True Line Result + return :right +** 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~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.line_rect line~ +- Inside source: true +*** True Line Result + def self.line_rect line +** Processing line: ~ if line.x > line.x2~ +- Inside source: true +*** True Line Result + if line.x > line.x2 +** Processing line: ~ x = line.x2~ +- Inside source: true +*** True Line Result + x = line.x2 +** Processing line: ~ y = line.y2~ +- Inside source: true +*** True Line Result + y = line.y2 +** Processing line: ~ x2 = line.x~ +- Inside source: true +*** True Line Result + x2 = line.x +** Processing line: ~ y2 = line.y~ +- Inside source: true +*** True Line Result + y2 = line.y +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ x = line.x~ +- Inside source: true +*** True Line Result + x = line.x +** Processing line: ~ y = line.y~ +- Inside source: true +*** True Line Result + y = line.y +** Processing line: ~ x2 = line.x2~ +- Inside source: true +*** True Line Result + x2 = line.x2 +** Processing line: ~ y2 = line.y2~ +- Inside source: true +*** True Line Result + y2 = line.y2 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ w = x2 - x~ +- Inside source: true +*** True Line Result + w = x2 - x +** Processing line: ~ h = y2 - y~ +- Inside source: true +*** True Line Result + h = y2 - y +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ { x: x, y: y, w: w, h: h }~ +- Inside source: true +*** True Line Result + { x: x, y: y, w: w, h: h } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.line_intersect line_one, line_two~ +- Inside source: true +*** True Line Result + def self.line_intersect line_one, line_two +** Processing line: ~ m1 = line_slope(line_one)~ +- Inside source: true +*** True Line Result + m1 = line_slope(line_one) +** Processing line: ~ m2 = line_slope(line_two)~ +- Inside source: true +*** True Line Result + m2 = line_slope(line_two) +** Processing line: ~ b1 = line_y_intercept(line_one)~ +- Inside source: true +*** True Line Result + b1 = line_y_intercept(line_one) +** Processing line: ~ b2 = line_y_intercept(line_two)~ +- Inside source: true +*** True Line Result + b2 = line_y_intercept(line_two) +** Processing line: ~ x = (b1 - b2) / (m2 - m1)~ +- Inside source: true +*** True Line Result + x = (b1 - b2) / (m2 - m1) +** Processing line: ~ y = (-b2.fdiv(m2) + b1.fdiv(m1)).fdiv(1.fdiv(m1) - 1.fdiv(m2))~ +- Inside source: true +*** True Line Result + y = (-b2.fdiv(m2) + b1.fdiv(m1)).fdiv(1.fdiv(m1) - 1.fdiv(m2)) +** Processing line: ~ [x, y]~ +- Inside source: true +*** True Line Result + [x, y] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.contract_intersect_rect?~ +- Inside source: true +*** True Line Result + def self.contract_intersect_rect? +** Processing line: ~ [:left, :right, :top, :bottom]~ +- Inside source: true +*** True Line Result + [:left, :right, :top, :bottom] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.intersect_rect? rect_one, rect_two, tolerance = 0.1~ +- 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~ +- 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~ +- 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~ +- 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~ +- Inside source: true +*** True Line Result + return false if rect_one.bottom + tolerance > rect_two.top - tolerance +** Processing line: ~ return true~ +- Inside source: true +*** True Line Result + return true +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ context_help_rect_one = (rect_one.__help_contract_implementation contract_intersect_rect?)[:not_implemented_methods]~ +- Inside source: true +*** True Line Result + context_help_rect_one = (rect_one.__help_contract_implementation contract_intersect_rect?)[:not_implemented_methods] +** Processing line: ~ context_help_rect_two = (rect_two.__help_contract_implementation contract_intersect_rect?)[:not_implemented_methods]~ +- Inside source: true +*** True Line Result + context_help_rect_two = (rect_two.__help_contract_implementation contract_intersect_rect?)[:not_implemented_methods] +** Processing line: ~ context_help = ""~ +- Inside source: true +*** True Line Result + context_help = "" +** Processing line: ~ if context_help_rect_one && context_help_rect_one.length > 0~ +- Inside source: true +*** True Line Result + if context_help_rect_one && context_help_rect_one.length > 0 +** Processing line: ~ context_help += <<-S~ +- Inside source: true +*** True Line Result + context_help += <<-S +** Processing line: ~ rect_one needs to implement the following methods: #{context_help_rect_one}~ +- Inside source: true +*** True Line Result + rect_one needs to implement the following methods: #{context_help_rect_one} +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ You may want to try include the ~AttrRect~ module which will give you these methods.~ +- Inside source: true +*** True Line Result + You may want to try include the ~AttrRect~ module which will give you these methods. +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if context_help_rect_two && context_help_rect_two.length > 0~ +- Inside source: true +*** True Line Result + if context_help_rect_two && context_help_rect_two.length > 0 +** Processing line: ~ context_help += <<-S~ +- Inside source: true +*** True Line Result + context_help += <<-S +** Processing line: ~ * FAILURE REASON:~ +- Inside source: true +*** True Line Result + * FAILURE REASON: +** Processing line: ~ rect_two needs to implement the following methods: #{context_help_rect_two}~ +- Inside source: true +*** True Line Result + rect_two needs to implement the following methods: #{context_help_rect_two} +** Processing line: ~ NOTE: You may want to try include the ~GTK::Geometry~ module which will give you these methods.~ +- Inside source: true +*** True Line Result + NOTE: You may want to try include the ~GTK::Geometry~ module which will give you these methods. +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ raise e, <<-S~ +- Inside source: true +*** True Line Result + raise e, <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ :intersect_rect? failed for~ +- Inside source: true +*** True Line Result + :intersect_rect? failed for +** Processing line: ~ - rect_one: #{rect_one}~ +- Inside source: true +*** True Line Result + - rect_one: #{rect_one} +** Processing line: ~ - rect_two: #{rect_two}~ +- Inside source: true +*** True Line Result + - rect_two: #{rect_two} +** Processing line: ~ #{context_help}~ +- Inside source: true +*** True Line Result + #{context_help} +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.to_square size, x, y, anchor_x = 0.5, anchor_y = nil~ +- Inside source: true +*** True Line Result + def self.to_square size, x, y, anchor_x = 0.5, anchor_y = nil +** Processing line: ~ anchor_y ||= anchor_x~ +- Inside source: true +*** True Line Result + anchor_y ||= anchor_x +** Processing line: ~ x = x.shift_left(size * anchor_x)~ +- Inside source: true +*** True Line Result + x = x.shift_left(size * anchor_x) +** Processing line: ~ y = y.shift_down(size * anchor_y)~ +- Inside source: true +*** True Line Result + y = y.shift_down(size * anchor_y) +** Processing line: ~ [x, y, size, size]~ +- Inside source: true +*** True Line Result + [x, y, size, size] +** Processing line: ~ rescue Exception => e~ +- 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}."~ +- 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}." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.distance point_one, point_two~ +- Inside source: true +*** True Line Result + 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)~ +- Inside source: true +*** True Line Result + Math.sqrt((point_two.x - point_one.x)**2 + (point_two.y - point_one.y)**2) +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}."~ +- Inside source: true +*** True Line Result + raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.angle_from start_point, end_point~ +- Inside source: true +*** True Line Result + def self.angle_from start_point, end_point +** Processing line: ~ d_y = end_point.y - start_point.y~ +- Inside source: true +*** True Line Result + d_y = end_point.y - start_point.y +** Processing line: ~ d_x = end_point.x - start_point.x~ +- Inside source: true +*** True Line Result + d_x = end_point.x - start_point.x +** Processing line: ~ Math::PI.+(Math.atan2(d_y, d_x)).to_degrees~ +- Inside source: true +*** True Line Result + Math::PI.+(Math.atan2(d_y, d_x)).to_degrees +** Processing line: ~ rescue Exception => e~ +- 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}."~ +- Inside source: true +*** True Line Result + raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.angle_to start_point, end_point~ +- Inside source: true +*** True Line Result + def self.angle_to start_point, end_point +** Processing line: ~ angle_from end_point, start_point~ +- Inside source: true +*** True Line Result + angle_from end_point, start_point +** Processing line: ~ rescue Exception => e~ +- 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}."~ +- Inside source: true +*** True Line Result + raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.point_inside_circle? point, circle_center_point, radius~ +- Inside source: true +*** True Line Result + 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~ +- Inside source: true +*** True Line Result + (point.x - circle_center_point.x) ** 2 + (point.y - circle_center_point.y) ** 2 < radius ** 2 +** Processing line: ~ rescue Exception => e~ +- 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}"~ +- Inside source: true +*** True Line Result + raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.inside_rect? inner_rect, outer_rect, tolerance = 0.0~ +- Inside source: true +*** True Line Result + def self.inside_rect? inner_rect, outer_rect, tolerance = 0.0 +** 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 &&~ +- Inside source: true +*** True Line Result + inner_rect.right - tolerance <= outer_rect.right + 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~ +- Inside source: true +*** True Line Result + inner_rect.top - tolerance <= outer_rect.top + 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}."~ +- Inside source: true +*** True Line Result + raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.scale_rect_extended rect,~ +- Inside source: true +*** True Line Result + def self.scale_rect_extended rect, +** Processing line: ~ percentage_x: percentage_x,~ +- Inside source: true +*** True Line Result + percentage_x: percentage_x, +** Processing line: ~ percentage_y: percentage_y,~ +- Inside source: true +*** True Line Result + percentage_y: percentage_y, +** Processing line: ~ anchor_x: anchor_x,~ +- Inside source: true +*** True Line Result + anchor_x: anchor_x, +** Processing line: ~ anchor_y: anchor_y~ +- Inside source: true +*** True Line Result + anchor_y: anchor_y +** Processing line: ~ anchor_x ||= 0.0~ +- Inside source: true +*** True Line Result + anchor_x ||= 0.0 +** Processing line: ~ anchor_y ||= 0.0~ +- Inside source: true +*** True Line Result + anchor_y ||= 0.0 +** Processing line: ~ percentage_x ||= 1.0~ +- Inside source: true +*** True Line Result + percentage_x ||= 1.0 +** Processing line: ~ percentage_y ||= 1.0~ +- Inside source: true +*** True Line Result + percentage_y ||= 1.0 +** Processing line: ~ new_w = rect.w * percentage_x~ +- Inside source: true +*** True Line Result + new_w = rect.w * percentage_x +** Processing line: ~ new_h = rect.h * percentage_y~ +- Inside source: true +*** True Line Result + new_h = rect.h * percentage_y +** Processing line: ~ new_x = rect.x + (rect.w - new_w) * anchor_x~ +- Inside source: true +*** True Line Result + new_x = rect.x + (rect.w - new_w) * anchor_x +** Processing line: ~ new_y = rect.y + (rect.h - new_h) * anchor_y~ +- Inside source: true +*** True Line Result + new_y = rect.y + (rect.h - new_h) * anchor_y +** Processing line: ~ if rect.is_a? Array~ +- Inside source: true +*** True Line Result + if rect.is_a? Array +** Processing line: ~ return [~ +- Inside source: true +*** True Line Result + return [ +** Processing line: ~ new_x,~ +- Inside source: true +*** True Line Result + new_x, +** Processing line: ~ new_y,~ +- Inside source: true +*** True Line Result + new_y, +** Processing line: ~ new_w,~ +- Inside source: true +*** True Line Result + new_w, +** Processing line: ~ new_h,~ +- Inside source: true +*** True Line Result + new_h, +** Processing line: ~ *rect[4..-1]~ +- Inside source: true +*** True Line Result + *rect[4..-1] +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ elsif rect.is_a? Hash~ +- Inside source: true +*** True Line Result + elsif rect.is_a? Hash +** Processing line: ~ return rect.merge(x: new_x, y: new_y, w: new_w, h: new_h)~ +- Inside source: true +*** True Line Result + return rect.merge(x: new_x, y: new_y, w: new_w, h: new_h) +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ rect.x = new_x~ +- Inside source: true +*** True Line Result + rect.x = new_x +** Processing line: ~ rect.y = new_y~ +- Inside source: true +*** True Line Result + rect.y = new_y +** Processing line: ~ rect.w = new_w~ +- Inside source: true +*** True Line Result + rect.w = new_w +** Processing line: ~ rect.h = new_h~ +- Inside source: true +*** True Line Result + rect.h = new_h +** Processing line: ~ return rect~ +- Inside source: true +*** True Line Result + return rect +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- 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}."~ +- 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}." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.scale_rect rect, percentage, *anchors~ +- Inside source: true +*** True Line Result + def self.scale_rect rect, percentage, *anchors +** Processing line: ~ anchor_x, anchor_y = *anchors.flatten~ +- Inside source: true +*** True Line Result + anchor_x, anchor_y = *anchors.flatten +** Processing line: ~ anchor_x ||= 0~ +- Inside source: true +*** True Line Result + anchor_x ||= 0 +** Processing line: ~ anchor_y ||= anchor_x~ +- Inside source: true +*** True Line Result + anchor_y ||= anchor_x +** Processing line: ~ Geometry.scale_rect_extended rect,~ +- Inside source: true +*** True Line Result + Geometry.scale_rect_extended rect, +** Processing line: ~ percentage_x: percentage,~ +- Inside source: true +*** True Line Result + percentage_x: percentage, +** Processing line: ~ percentage_y: percentage,~ +- Inside source: true +*** True Line Result + percentage_y: percentage, +** Processing line: ~ anchor_x: anchor_x,~ +- Inside source: true +*** True Line Result + anchor_x: anchor_x, +** Processing line: ~ anchor_y: anchor_y~ +- Inside source: true +*** True Line Result + anchor_y: anchor_y +** Processing line: ~ rescue Exception => e~ +- 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)]."~ +- Inside source: true +*** True Line Result + raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)]." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end # module Geometry~ +- Inside source: true +*** True Line Result + end # module Geometry +** Processing line: ~ end # module GTK~ +- Inside source: true +*** True Line Result + end # module GTK +** 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: ~*** grid.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** grid.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/grid.rb~ +- Inside source: true +*** True Line Result + # ./dragon/grid.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # grid.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # grid.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Grid~ +- Inside source: true +*** True Line Result + class Grid +** Processing line: ~ include Serialize~ +- Inside source: true +*** True Line Result + include Serialize +** Processing line: ~ SCREEN_Y_DIRECTION = -1.0~ +- Inside source: true +*** True Line Result + SCREEN_Y_DIRECTION = -1.0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # The coordinate system currently in use.~ +- Inside source: true +*** True Line Result + # The coordinate system currently in use. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Symbol] `:bottom_left` or `:center`~ +- Inside source: true +*** True Line Result + # @return [Symbol] `:bottom_left` or `:center` +** Processing line: ~ attr_accessor :name~ +- Inside source: true +*** True Line Result + attr_accessor :name +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the "x" coordinate indicating the bottom of the screen.~ +- Inside source: true +*** True Line Result + # Returns the "x" coordinate indicating the bottom of the screen. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ attr_accessor :bottom~ +- Inside source: true +*** True Line Result + attr_accessor :bottom +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the "x" coordinate indicating the top of the screen.~ +- Inside source: true +*** True Line Result + # Returns the "x" coordinate indicating the top of the screen. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ attr_accessor :top~ +- Inside source: true +*** True Line Result + attr_accessor :top +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the "y" coordinate indicating the left of the screen.~ +- Inside source: true +*** True Line Result + # Returns the "y" coordinate indicating the left of the screen. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ attr_accessor :left~ +- Inside source: true +*** True Line Result + attr_accessor :left +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the "y" coordinate indicating the right of the screen.~ +- Inside source: true +*** True Line Result + # Returns the "y" coordinate indicating the right of the screen. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ attr_accessor :right~ +- Inside source: true +*** True Line Result + attr_accessor :right +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the "x" coordinate indicating the center of the screen.~ +- Inside source: true +*** True Line Result + # Returns the "x" coordinate indicating the center of the screen. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ attr_accessor :center_x~ +- Inside source: true +*** True Line Result + attr_accessor :center_x +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the "y" coordinate indicating the center of the screen.~ +- Inside source: true +*** True Line Result + # Returns the "y" coordinate indicating the center of the screen. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ attr_accessor :center_y~ +- Inside source: true +*** True Line Result + attr_accessor :center_y +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the bottom left and top right coordinates in a single list.~ +- Inside source: true +*** True Line Result + # Returns the bottom left and top right coordinates in a single list. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [[Float, Float, Float, Float]]~ +- Inside source: true +*** True Line Result + # @return [[Float, Float, Float, Float]] +** Processing line: ~ attr_accessor :rect~ +- Inside source: true +*** True Line Result + attr_accessor :rect +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the "x" coordinate of the origin.~ +- Inside source: true +*** True Line Result + # Returns the "x" coordinate of the origin. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ attr_accessor :origin_x~ +- Inside source: true +*** True Line Result + attr_accessor :origin_x +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the "y" coordinate of the origin.~ +- Inside source: true +*** True Line Result + # Returns the "y" coordinate of the origin. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ attr_accessor :origin_y~ +- Inside source: true +*** True Line Result + attr_accessor :origin_y +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ attr_accessor :left_margin, :bottom_margin~ +- Inside source: true +*** True Line Result + attr_accessor :left_margin, :bottom_margin +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize runtime~ +- Inside source: true +*** True Line Result + def initialize runtime +** Processing line: ~ @runtime = runtime~ +- Inside source: true +*** True Line Result + @runtime = runtime +** Processing line: ~ @ffi_draw = runtime.ffi_draw~ +- Inside source: true +*** True Line Result + @ffi_draw = runtime.ffi_draw +** Processing line: ~ origin_bottom_left!~ +- Inside source: true +*** True Line Result + origin_bottom_left! +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns `x` plus the origin "x".~ +- Inside source: true +*** True Line Result + # Returns `x` plus the origin "x". +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ def transform_x x~ +- Inside source: true +*** True Line Result + def transform_x x +** Processing line: ~ @origin_x + x~ +- Inside source: true +*** True Line Result + @origin_x + x +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns `x` minus the origin "x".~ +- Inside source: true +*** True Line Result + # Returns `x` minus the origin "x". +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ def untransform_x x~ +- Inside source: true +*** True Line Result + def untransform_x x +** Processing line: ~ x - @origin_x~ +- Inside source: true +*** True Line Result + x - @origin_x +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns `y` plus the origin "y".~ +- Inside source: true +*** True Line Result + # Returns `y` plus the origin "y". +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ def transform_y y~ +- Inside source: true +*** True Line Result + def transform_y y +** Processing line: ~ @origin_y + y * SCREEN_Y_DIRECTION~ +- Inside source: true +*** True Line Result + @origin_y + y * SCREEN_Y_DIRECTION +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns `y` minus the origin "y".~ +- Inside source: true +*** True Line Result + # Returns `y` minus the origin "y". +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ def untransform_y y~ +- Inside source: true +*** True Line Result + def untransform_y y +** Processing line: ~ @origin_y + y * SCREEN_Y_DIRECTION~ +- Inside source: true +*** True Line Result + @origin_y + y * SCREEN_Y_DIRECTION +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def ffi_draw~ +- Inside source: true +*** True Line Result + def ffi_draw +** Processing line: ~ @ffi_draw~ +- Inside source: true +*** True Line Result + @ffi_draw +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def ffi_draw= value~ +- Inside source: true +*** True Line Result + def ffi_draw= value +** Processing line: ~ @ffi_draw = value~ +- Inside source: true +*** True Line Result + @ffi_draw = value +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Sets the rendering coordinate system to have its origin in the bottom left.~ +- Inside source: true +*** True Line Result + # Sets the rendering coordinate system to have its origin in the bottom left. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [void]~ +- Inside source: true +*** True Line Result + # @return [void] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def origin_bottom_left!~ +- Inside source: true +*** True Line Result + def origin_bottom_left! +** Processing line: ~ return if @name == :bottom_left~ +- Inside source: true +*** True Line Result + return if @name == :bottom_left +** Processing line: ~ @name = :bottom_left~ +- Inside source: true +*** True Line Result + @name = :bottom_left +** Processing line: ~ @origin_x = 0.0~ +- Inside source: true +*** True Line Result + @origin_x = 0.0 +** Processing line: ~ @origin_y = @runtime.logical_height~ +- Inside source: true +*** True Line Result + @origin_y = @runtime.logical_height +** Processing line: ~ @left = 0.0~ +- Inside source: true +*** True Line Result + @left = 0.0 +** Processing line: ~ @right = @runtime.logical_width~ +- Inside source: true +*** True Line Result + @right = @runtime.logical_width +** Processing line: ~ @top = @runtime.logical_height~ +- Inside source: true +*** True Line Result + @top = @runtime.logical_height +** Processing line: ~ @bottom = 0.0~ +- Inside source: true +*** True Line Result + @bottom = 0.0 +** Processing line: ~ @left_margin = 0.0~ +- Inside source: true +*** True Line Result + @left_margin = 0.0 +** Processing line: ~ @bottom_margin = 0.0~ +- Inside source: true +*** True Line Result + @bottom_margin = 0.0 +** Processing line: ~ @center_x = @runtime.logical_width.half~ +- Inside source: true +*** True Line Result + @center_x = @runtime.logical_width.half +** Processing line: ~ @center_y = @runtime.logical_height.half~ +- Inside source: true +*** True Line Result + @center_y = @runtime.logical_height.half +** Processing line: ~ @rect = [@left, @bottom, @runtime.logical_width, @runtime.logical_height].rect~ +- Inside source: true +*** True Line Result + @rect = [@left, @bottom, @runtime.logical_width, @runtime.logical_height].rect +** Processing line: ~ @center = [@center_x, @center_y].point~ +- Inside source: true +*** True Line Result + @center = [@center_x, @center_y].point +** Processing line: ~ @ffi_draw.set_grid @origin_x, @origin_y, SCREEN_Y_DIRECTION~ +- Inside source: true +*** True Line Result + @ffi_draw.set_grid @origin_x, @origin_y, SCREEN_Y_DIRECTION +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Sets the rendering coordinate system to have its origin in the center.~ +- Inside source: true +*** True Line Result + # Sets the rendering coordinate system to have its origin in the center. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [void]~ +- Inside source: true +*** True Line Result + # @return [void] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def origin_center!~ +- Inside source: true +*** True Line Result + def origin_center! +** Processing line: ~ return if @name == :center~ +- Inside source: true +*** True Line Result + return if @name == :center +** Processing line: ~ @name = :center~ +- Inside source: true +*** True Line Result + @name = :center +** Processing line: ~ @origin_x = @runtime.logical_width.half~ +- Inside source: true +*** True Line Result + @origin_x = @runtime.logical_width.half +** Processing line: ~ @origin_y = @runtime.logical_height.half~ +- Inside source: true +*** True Line Result + @origin_y = @runtime.logical_height.half +** Processing line: ~ @left = -@runtime.logical_width.half~ +- Inside source: true +*** True Line Result + @left = -@runtime.logical_width.half +** Processing line: ~ @right = @runtime.logical_width.half~ +- Inside source: true +*** True Line Result + @right = @runtime.logical_width.half +** Processing line: ~ @top = @runtime.logical_height.half~ +- Inside source: true +*** True Line Result + @top = @runtime.logical_height.half +** Processing line: ~ @bottom = -@runtime.logical_height.half~ +- Inside source: true +*** True Line Result + @bottom = -@runtime.logical_height.half +** Processing line: ~ @center_x = 0.0~ +- Inside source: true +*** True Line Result + @center_x = 0.0 +** Processing line: ~ @center_y = 0.0~ +- Inside source: true +*** True Line Result + @center_y = 0.0 +** Processing line: ~ @rect = [@left, @bottom, @runtime.logical_width, @runtime.logical_height].rect~ +- Inside source: true +*** True Line Result + @rect = [@left, @bottom, @runtime.logical_width, @runtime.logical_height].rect +** Processing line: ~ @center = [@center_x, @center_y].point~ +- Inside source: true +*** True Line Result + @center = [@center_x, @center_y].point +** Processing line: ~ @ffi_draw.set_grid @origin_x, @origin_y, SCREEN_Y_DIRECTION~ +- Inside source: true +*** True Line Result + @ffi_draw.set_grid @origin_x, @origin_y, SCREEN_Y_DIRECTION +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # The logical width used for rendering.~ +- Inside source: true +*** True Line Result + # The logical width used for rendering. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ def w~ +- Inside source: true +*** True Line Result + def w +** Processing line: ~ @runtime.logical_width~ +- Inside source: true +*** True Line Result + @runtime.logical_width +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Half the logical width used for rendering.~ +- Inside source: true +*** True Line Result + # Half the logical width used for rendering. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ def w_half~ +- Inside source: true +*** True Line Result + def w_half +** Processing line: ~ w.half~ +- Inside source: true +*** True Line Result + w.half +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # The logical height used for rendering.~ +- Inside source: true +*** True Line Result + # The logical height used for rendering. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ def h~ +- Inside source: true +*** True Line Result + def h +** Processing line: ~ @runtime.logical_height~ +- Inside source: true +*** True Line Result + @runtime.logical_height +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Half the logical height used for rendering.~ +- Inside source: true +*** True Line Result + # Half the logical height used for rendering. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float]~ +- Inside source: true +*** True Line Result + # @return [Float] +** Processing line: ~ def h_half~ +- Inside source: true +*** True Line Result + def h_half +** Processing line: ~ h.half~ +- Inside source: true +*** True Line Result + h.half +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the coordinates indicating the center of the screen.~ +- Inside source: true +*** True Line Result + # Returns the coordinates indicating the center of the screen. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [[Float, Float]]~ +- Inside source: true +*** True Line Result + # @return [[Float, Float]] +** Processing line: ~ def center~ +- Inside source: true +*** True Line Result + def center +** Processing line: ~ @center~ +- Inside source: true +*** True Line Result + @center +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the coordinates indicating the bottom right of the screen.~ +- Inside source: true +*** True Line Result + # Returns the coordinates indicating the bottom right of the screen. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [[Float, Float]]~ +- Inside source: true +*** True Line Result + # @return [[Float, Float]] +** Processing line: ~ def bottom_right~ +- Inside source: true +*** True Line Result + def bottom_right +** Processing line: ~ [@right, @bottom].point~ +- Inside source: true +*** True Line Result + [@right, @bottom].point +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** inputs.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** inputs.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/inputs.rb~ +- Inside source: true +*** True Line Result + # ./dragon/inputs.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # inputs.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # inputs.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ # Represents all the keys available on the keyboard.~ +- Inside source: true +*** True Line Result + # Represents all the keys available on the keyboard. +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ class KeyboardKeys~ +- Inside source: true +*** True Line Result + class KeyboardKeys +** Processing line: ~ include Serialize~ +- Inside source: true +*** True Line Result + include Serialize +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_accessor :exclamation_point,~ +- Inside source: true +*** True Line Result + attr_accessor :exclamation_point, +** Processing line: ~ :zero, :one, :two, :three, :four,~ +- Inside source: true +*** True Line Result + :zero, :one, :two, :three, :four, +** Processing line: ~ :five, :six, :seven, :eight, :nine,~ +- Inside source: true +*** True Line Result + :five, :six, :seven, :eight, :nine, +** Processing line: ~ :backspace, :delete, :escape, :enter, :tab,~ +- Inside source: true +*** True Line Result + :backspace, :delete, :escape, :enter, :tab, +** Processing line: ~ :open_round_brace, :close_round_brace,~ +- Inside source: true +*** True Line Result + :open_round_brace, :close_round_brace, +** Processing line: ~ :open_curly_brace, :close_curly_brace,~ +- Inside source: true +*** True Line Result + :open_curly_brace, :close_curly_brace, +** Processing line: ~ :open_square_brace, :close_square_brace,~ +- Inside source: true +*** True Line Result + :open_square_brace, :close_square_brace, +** Processing line: ~ :colon, :semicolon, :equal_sign,~ +- Inside source: true +*** True Line Result + :colon, :semicolon, :equal_sign, +** Processing line: ~ :hyphen, :space, :dollar_sign,~ +- Inside source: true +*** True Line Result + :hyphen, :space, :dollar_sign, +** Processing line: ~ :double_quotation_mark,~ +- Inside source: true +*** True Line Result + :double_quotation_mark, +** Processing line: ~ :single_quotation_mark,~ +- Inside source: true +*** True Line Result + :single_quotation_mark, +** Processing line: ~ :backtick,~ +- Inside source: true +*** True Line Result + :backtick, +** Processing line: ~ :tilde, :period, :comma, :pipe,~ +- Inside source: true +*** True Line Result + :tilde, :period, :comma, :pipe, +** Processing line: ~ :underscore,~ +- Inside source: true +*** True Line Result + :underscore, +** Processing line: ~ :a, :b, :c, :d, :e, :f, :g, :h,~ +- Inside source: true +*** True Line Result + :a, :b, :c, :d, :e, :f, :g, :h, +** Processing line: ~ :i, :j, :k, :l, :m, :n, :o, :p,~ +- Inside source: true +*** True Line Result + :i, :j, :k, :l, :m, :n, :o, :p, +** Processing line: ~ :q, :r, :s, :t, :u, :v, :w, :x,~ +- Inside source: true +*** True Line Result + :q, :r, :s, :t, :u, :v, :w, :x, +** Processing line: ~ :y, :z,~ +- Inside source: true +*** True Line Result + :y, :z, +** Processing line: ~ :shift, :control, :alt, :meta,~ +- Inside source: true +*** True Line Result + :shift, :control, :alt, :meta, +** Processing line: ~ :shift_left, :shift_right,~ +- Inside source: true +*** True Line Result + :shift_left, :shift_right, +** Processing line: ~ :control_left, :control_right,~ +- Inside source: true +*** True Line Result + :control_left, :control_right, +** Processing line: ~ :alt_left, :alt_right,~ +- Inside source: true +*** True Line Result + :alt_left, :alt_right, +** Processing line: ~ :meta_left, :meta_right,~ +- Inside source: true +*** True Line Result + :meta_left, :meta_right, +** Processing line: ~ :home, :end,~ +- Inside source: true +*** True Line Result + :home, :end, +** Processing line: ~ :left, :right, :up, :down, :pageup, :pagedown,~ +- Inside source: true +*** True Line Result + :left, :right, :up, :down, :pageup, :pagedown, +** Processing line: ~ :char, :plus, :at, :forward_slash, :back_slash, :asterisk,~ +- Inside source: true +*** True Line Result + :char, :plus, :at, :forward_slash, :back_slash, :asterisk, +** Processing line: ~ :less_than, :greater_than, :carat, :ampersand, :superscript_two,~ +- Inside source: true +*** True Line Result + :less_than, :greater_than, :carat, :ampersand, :superscript_two, +** Processing line: ~ :circumflex,~ +- Inside source: true +*** True Line Result + :circumflex, +** Processing line: ~ :question_mark, :section_sign, :ordinal_indicator,~ +- Inside source: true +*** True Line Result + :question_mark, :section_sign, :ordinal_indicator, +** Processing line: ~ :raw_key~ +- Inside source: true +*** True Line Result + :raw_key +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.sdl_to_key raw_key, modifier~ +- Inside source: true +*** True Line Result + def self.sdl_to_key raw_key, modifier +** Processing line: ~ return nil unless (raw_key >= 0 && raw_key <= 255) ||~ +- Inside source: true +*** True Line Result + return nil unless (raw_key >= 0 && raw_key <= 255) || +** Processing line: ~ raw_key == 1073741903 ||~ +- Inside source: true +*** True Line Result + raw_key == 1073741903 || +** Processing line: ~ raw_key == 1073741904 ||~ +- Inside source: true +*** True Line Result + raw_key == 1073741904 || +** Processing line: ~ raw_key == 1073741905 ||~ +- Inside source: true +*** True Line Result + raw_key == 1073741905 || +** Processing line: ~ raw_key == 1073741906 ||~ +- Inside source: true +*** True Line Result + raw_key == 1073741906 || +** Processing line: ~ raw_key == 1073741899 ||~ +- Inside source: true +*** True Line Result + raw_key == 1073741899 || +** Processing line: ~ raw_key == 1073741902 ||~ +- Inside source: true +*** True Line Result + raw_key == 1073741902 || +** Processing line: ~ raw_key == 1073741898 ||~ +- Inside source: true +*** True Line Result + raw_key == 1073741898 || +** Processing line: ~ raw_key == 1073741901 ||~ +- Inside source: true +*** True Line Result + raw_key == 1073741901 || +** Processing line: ~ (raw_key >= 1073742048 && raw_key <= 1073742055) # Modifier Keys~ +- Inside source: true +*** True Line Result + (raw_key >= 1073742048 && raw_key <= 1073742055) # Modifier Keys +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ char = KeyboardKeys.char_with_shift raw_key, modifier~ +- Inside source: true +*** True Line Result + char = KeyboardKeys.char_with_shift raw_key, modifier +** Processing line: ~ names = KeyboardKeys.char_to_method char, raw_key~ +- Inside source: true +*** True Line Result + names = KeyboardKeys.char_to_method char, raw_key +** Processing line: ~ names << :alt if (modifier & (256|512)) != 0 # alt key~ +- Inside source: true +*** True Line Result + names << :alt if (modifier & (256|512)) != 0 # alt key +** Processing line: ~ names << :meta if (modifier & (1024|2048)) != 0 # meta key (command/apple/windows key)~ +- Inside source: true +*** True Line Result + names << :meta if (modifier & (1024|2048)) != 0 # meta key (command/apple/windows key) +** Processing line: ~ names << :control if (modifier & (64|128)) != 0 # ctrl key~ +- Inside source: true +*** True Line Result + names << :control if (modifier & (64|128)) != 0 # ctrl key +** Processing line: ~ names << :shift if (modifier & (1|2)) != 0 # shift key~ +- Inside source: true +*** True Line Result + names << :shift if (modifier & (1|2)) != 0 # shift key +** Processing line: ~ names~ +- Inside source: true +*** True Line Result + names +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.utf_8_char raw_key~ +- Inside source: true +*** True Line Result + def self.utf_8_char raw_key +** Processing line: ~ return "²" if raw_key == 178~ +- Inside source: true +*** True Line Result + return "²" if raw_key == 178 +** Processing line: ~ return "§" if raw_key == 167~ +- Inside source: true +*** True Line Result + return "§" if raw_key == 167 +** Processing line: ~ return "º" if raw_key == 186~ +- Inside source: true +*** True Line Result + return "º" if raw_key == 186 +** Processing line: ~ return raw_key.chr~ +- Inside source: true +*** True Line Result + return raw_key.chr +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.char_with_shift raw_key, modifier~ +- Inside source: true +*** True Line Result + def self.char_with_shift raw_key, modifier +** Processing line: ~ return nil unless raw_key >= 0 && raw_key <= 255~ +- Inside source: true +*** True Line Result + return nil unless raw_key >= 0 && raw_key <= 255 +** Processing line: ~ if modifier != 1 && modifier != 2 && modifier != 3~ +- Inside source: true +*** True Line Result + if modifier != 1 && modifier != 2 && modifier != 3 +** Processing line: ~ return utf_8_char raw_key~ +- Inside source: true +*** True Line Result + return utf_8_char raw_key +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @shift_keys ||= {~ +- Inside source: true +*** True Line Result + @shift_keys ||= { +** Processing line: ~ '`' => '~', '-' => '_', "'" => '"', "1" => '!',~ +- Inside source: true +*** True Line Result + '`' => '~', '-' => '_', "'" => '"', "1" => '!', +** Processing line: ~ "2" => '@', "3" => '#', "4" => '$', "5" => '%',~ +- Inside source: true +*** True Line Result + "2" => '@', "3" => '#', "4" => '$', "5" => '%', +** Processing line: ~ "6" => '^', "7" => '&', "8" => '*', "9" => '(',~ +- Inside source: true +*** True Line Result + "6" => '^', "7" => '&', "8" => '*', "9" => '(', +** Processing line: ~ "0" => ')', ";" => ":", "=" => "+", "[" => "{",~ +- Inside source: true +*** True Line Result + "0" => ')', ";" => ":", "=" => "+", "[" => "{", +** Processing line: ~ "]" => "}", '\\'=> "|", '/' => "?", '.' => ">",~ +- Inside source: true +*** True Line Result + "]" => "}", '\\'=> "|", '/' => "?", '.' => ">", +** Processing line: ~ ',' => "<", 'a' => 'A', 'b' => 'B', 'c' => 'C',~ +- Inside source: true +*** True Line Result + ',' => "<", 'a' => 'A', 'b' => 'B', 'c' => 'C', +** Processing line: ~ 'd' => 'D', 'e' => 'E', 'f' => 'F', 'g' => 'G',~ +- Inside source: true +*** True Line Result + 'd' => 'D', 'e' => 'E', 'f' => 'F', 'g' => 'G', +** Processing line: ~ 'h' => 'H', 'i' => 'I', 'j' => 'J', 'k' => 'K',~ +- Inside source: true +*** True Line Result + 'h' => 'H', 'i' => 'I', 'j' => 'J', 'k' => 'K', +** Processing line: ~ 'l' => 'L', 'm' => 'M', 'n' => 'N', 'o' => 'O',~ +- Inside source: true +*** True Line Result + 'l' => 'L', 'm' => 'M', 'n' => 'N', 'o' => 'O', +** Processing line: ~ 'p' => 'P', 'q' => 'Q', 'r' => 'R', 's' => 'S',~ +- Inside source: true +*** True Line Result + 'p' => 'P', 'q' => 'Q', 'r' => 'R', 's' => 'S', +** Processing line: ~ 't' => 'T', 'u' => 'U', 'v' => 'V', 'w' => 'W',~ +- Inside source: true +*** True Line Result + 't' => 'T', 'u' => 'U', 'v' => 'V', 'w' => 'W', +** Processing line: ~ 'x' => 'X', 'y' => 'Y', 'z' => 'Z'~ +- Inside source: true +*** True Line Result + 'x' => 'X', 'y' => 'Y', 'z' => 'Z' +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @shift_keys[raw_key.chr.to_s] || raw_key.chr.to_s~ +- Inside source: true +*** True Line Result + @shift_keys[raw_key.chr.to_s] || raw_key.chr.to_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: ~ def self.char_to_method_hash~ +- Inside source: true +*** True Line Result + def self.char_to_method_hash +** Processing line: ~ @char_to_method ||= {~ +- Inside source: true +*** True Line Result + @char_to_method ||= { +** Processing line: ~ 'A' => [:a],~ +- Inside source: true +*** True Line Result + 'A' => [:a], +** Processing line: ~ 'B' => [:b],~ +- Inside source: true +*** True Line Result + 'B' => [:b], +** Processing line: ~ 'C' => [:c],~ +- Inside source: true +*** True Line Result + 'C' => [:c], +** Processing line: ~ 'D' => [:d],~ +- Inside source: true +*** True Line Result + 'D' => [:d], +** Processing line: ~ 'E' => [:e],~ +- Inside source: true +*** True Line Result + 'E' => [:e], +** Processing line: ~ 'F' => [:f],~ +- Inside source: true +*** True Line Result + 'F' => [:f], +** Processing line: ~ 'G' => [:g],~ +- Inside source: true +*** True Line Result + 'G' => [:g], +** Processing line: ~ 'H' => [:h],~ +- Inside source: true +*** True Line Result + 'H' => [:h], +** Processing line: ~ 'I' => [:i],~ +- Inside source: true +*** True Line Result + 'I' => [:i], +** Processing line: ~ 'J' => [:j],~ +- Inside source: true +*** True Line Result + 'J' => [:j], +** Processing line: ~ 'K' => [:k],~ +- Inside source: true +*** True Line Result + 'K' => [:k], +** Processing line: ~ 'L' => [:l],~ +- Inside source: true +*** True Line Result + 'L' => [:l], +** Processing line: ~ 'M' => [:m],~ +- Inside source: true +*** True Line Result + 'M' => [:m], +** Processing line: ~ 'N' => [:n],~ +- Inside source: true +*** True Line Result + 'N' => [:n], +** Processing line: ~ 'O' => [:o],~ +- Inside source: true +*** True Line Result + 'O' => [:o], +** Processing line: ~ 'P' => [:p],~ +- Inside source: true +*** True Line Result + 'P' => [:p], +** Processing line: ~ 'Q' => [:q],~ +- Inside source: true +*** True Line Result + 'Q' => [:q], +** Processing line: ~ 'R' => [:r],~ +- Inside source: true +*** True Line Result + 'R' => [:r], +** Processing line: ~ 'S' => [:s],~ +- Inside source: true +*** True Line Result + 'S' => [:s], +** Processing line: ~ 'T' => [:t],~ +- Inside source: true +*** True Line Result + 'T' => [:t], +** Processing line: ~ 'U' => [:u],~ +- Inside source: true +*** True Line Result + 'U' => [:u], +** Processing line: ~ 'V' => [:v],~ +- Inside source: true +*** True Line Result + 'V' => [:v], +** Processing line: ~ 'W' => [:w],~ +- Inside source: true +*** True Line Result + 'W' => [:w], +** Processing line: ~ 'X' => [:x],~ +- Inside source: true +*** True Line Result + 'X' => [:x], +** Processing line: ~ 'Y' => [:y],~ +- Inside source: true +*** True Line Result + 'Y' => [:y], +** Processing line: ~ 'Z' => [:z],~ +- Inside source: true +*** True Line Result + 'Z' => [:z], +** Processing line: ~ "!" => [:exclamation_point],~ +- Inside source: true +*** True Line Result + "!" => [:exclamation_point], +** Processing line: ~ "0" => [:zero],~ +- Inside source: true +*** True Line Result + "0" => [:zero], +** Processing line: ~ "1" => [:one],~ +- Inside source: true +*** True Line Result + "1" => [:one], +** Processing line: ~ "2" => [:two],~ +- Inside source: true +*** True Line Result + "2" => [:two], +** Processing line: ~ "3" => [:three],~ +- Inside source: true +*** True Line Result + "3" => [:three], +** Processing line: ~ "4" => [:four],~ +- Inside source: true +*** True Line Result + "4" => [:four], +** Processing line: ~ "5" => [:five],~ +- Inside source: true +*** True Line Result + "5" => [:five], +** Processing line: ~ "6" => [:six],~ +- Inside source: true +*** True Line Result + "6" => [:six], +** Processing line: ~ "7" => [:seven],~ +- Inside source: true +*** True Line Result + "7" => [:seven], +** Processing line: ~ "8" => [:eight],~ +- Inside source: true +*** True Line Result + "8" => [:eight], +** Processing line: ~ "9" => [:nine],~ +- Inside source: true +*** True Line Result + "9" => [:nine], +** Processing line: ~ "\b" => [:backspace],~ +- Inside source: true +*** True Line Result + "\b" => [:backspace], +** Processing line: ~ "\e" => [:escape],~ +- Inside source: true +*** True Line Result + "\e" => [:escape], +** Processing line: ~ "\r" => [:enter],~ +- Inside source: true +*** True Line Result + "\r" => [:enter], +** Processing line: ~ "\t" => [:tab],~ +- Inside source: true +*** True Line Result + "\t" => [:tab], +** Processing line: ~ "(" => [:open_round_brace],~ +- Inside source: true +*** True Line Result + "(" => [:open_round_brace], +** Processing line: ~ ")" => [:close_round_brace],~ +- Inside source: true +*** True Line Result + ")" => [:close_round_brace], +** Processing line: ~ "{" => [:open_curly_brace],~ +- Inside source: true +*** True Line Result + "{" => [:open_curly_brace], +** Processing line: ~ "}" => [:close_curly_brace],~ +- Inside source: true +*** True Line Result + "}" => [:close_curly_brace], +** Processing line: ~ "[" => [:open_square_brace],~ +- Inside source: true +*** True Line Result + "[" => [:open_square_brace], +** Processing line: ~ "]" => [:close_square_brace],~ +- Inside source: true +*** True Line Result + "]" => [:close_square_brace], +** Processing line: ~ ":" => [:colon],~ +- Inside source: true +*** True Line Result + ":" => [:colon], +** Processing line: ~ ";" => [:semicolon],~ +- Inside source: true +*** True Line Result + ";" => [:semicolon], +** Processing line: ~ "=" => [:equal_sign],~ +- Inside source: true +*** True Line Result + "=" => [:equal_sign], +** Processing line: ~ "-" => [:hyphen],~ +- Inside source: true +*** True Line Result + "-" => [:hyphen], +** Processing line: ~ " " => [:space],~ +- Inside source: true +*** True Line Result + " " => [:space], +** Processing line: ~ "$" => [:dollar_sign],~ +- Inside source: true +*** True Line Result + "$" => [:dollar_sign], +** Processing line: ~ "\"" => [:double_quotation_mark],~ +- Inside source: true +*** True Line Result + "\"" => [:double_quotation_mark], +** Processing line: ~ "'" => [:single_quotation_mark],~ +- Inside source: true +*** True Line Result + "'" => [:single_quotation_mark], +** Processing line: ~ "`" => [:backtick],~ +- Inside source: true +*** True Line Result + "`" => [:backtick], +** Processing line: ~ "~" => [:tilde],~ +- Inside source: true +*** True Line Result + "~" => [:tilde], +** Processing line: ~ "." => [:period],~ +- Inside source: true +*** True Line Result + "." => [:period], +** Processing line: ~ "," => [:comma],~ +- Inside source: true +*** True Line Result + "," => [:comma], +** Processing line: ~ "|" => [:pipe],~ +- Inside source: true +*** True Line Result + "|" => [:pipe], +** Processing line: ~ "_" => [:underscore],~ +- Inside source: true +*** True Line Result + "_" => [:underscore], +** Processing line: ~ "#" => [:hash],~ +- Inside source: true +*** True Line Result + "#" => [:hash], +** Processing line: ~ "+" => [:plus],~ +- Inside source: true +*** True Line Result + "+" => [:plus], +** Processing line: ~ "@" => [:at],~ +- Inside source: true +*** True Line Result + "@" => [:at], +** Processing line: ~ "/" => [:forward_slash],~ +- Inside source: true +*** True Line Result + "/" => [:forward_slash], +** Processing line: ~ "\\" => [:back_slash],~ +- Inside source: true +*** True Line Result + "\\" => [:back_slash], +** Processing line: ~ "*" => [:asterisk],~ +- Inside source: true +*** True Line Result + "*" => [:asterisk], +** Processing line: ~ "<" => [:less_than],~ +- Inside source: true +*** True Line Result + "<" => [:less_than], +** Processing line: ~ ">" => [:greater_than],~ +- Inside source: true +*** True Line Result + ">" => [:greater_than], +** Processing line: ~ "^" => [:circumflex],~ +- Inside source: true +*** True Line Result + "^" => [:circumflex], +** Processing line: ~ "&" => [:ampersand],~ +- Inside source: true +*** True Line Result + "&" => [:ampersand], +** Processing line: ~ "²" => [:superscript_two],~ +- Inside source: true +*** True Line Result + "²" => [:superscript_two], +** Processing line: ~ "§" => [:section_sign],~ +- Inside source: true +*** True Line Result + "§" => [:section_sign], +** Processing line: ~ "?" => [:question_mark],~ +- Inside source: true +*** True Line Result + "?" => [:question_mark], +** Processing line: ~ '%' => [:percent_sign],~ +- Inside source: true +*** True Line Result + '%' => [:percent_sign], +** Processing line: ~ "º" => [:ordinal_indicator],~ +- Inside source: true +*** True Line Result + "º" => [:ordinal_indicator], +** Processing line: ~ 1073741898 => [:home],~ +- Inside source: true +*** True Line Result + 1073741898 => [:home], +** Processing line: ~ 1073741901 => [:end],~ +- Inside source: true +*** True Line Result + 1073741901 => [:end], +** Processing line: ~ 1073741903 => [:right],~ +- Inside source: true +*** True Line Result + 1073741903 => [:right], +** Processing line: ~ 1073741904 => [:left],~ +- Inside source: true +*** True Line Result + 1073741904 => [:left], +** Processing line: ~ 1073741905 => [:down],~ +- Inside source: true +*** True Line Result + 1073741905 => [:down], +** Processing line: ~ 1073741906 => [:up],~ +- Inside source: true +*** True Line Result + 1073741906 => [:up], +** Processing line: ~ 1073741899 => [:pageup],~ +- Inside source: true +*** True Line Result + 1073741899 => [:pageup], +** Processing line: ~ 1073741902 => [:pagedown],~ +- Inside source: true +*** True Line Result + 1073741902 => [:pagedown], +** Processing line: ~ 127 => [:delete],~ +- Inside source: true +*** True Line Result + 127 => [:delete], +** Processing line: ~ 1073742049 => [:shift_left, :shift],~ +- Inside source: true +*** True Line Result + 1073742049 => [:shift_left, :shift], +** Processing line: ~ 1073742053 => [:shift_right, :shift],~ +- Inside source: true +*** True Line Result + 1073742053 => [:shift_right, :shift], +** Processing line: ~ 1073742048 => [:control_left, :control],~ +- Inside source: true +*** True Line Result + 1073742048 => [:control_left, :control], +** Processing line: ~ 1073742052 => [:control_right, :control],~ +- Inside source: true +*** True Line Result + 1073742052 => [:control_right, :control], +** Processing line: ~ 1073742050 => [:alt_left, :alt],~ +- Inside source: true +*** True Line Result + 1073742050 => [:alt_left, :alt], +** Processing line: ~ 1073742054 => [:alt_right, :alt],~ +- Inside source: true +*** True Line Result + 1073742054 => [:alt_right, :alt], +** Processing line: ~ 1073742051 => [:meta_left, :meta],~ +- Inside source: true +*** True Line Result + 1073742051 => [:meta_left, :meta], +** Processing line: ~ 1073742055 => [:meta_right, :meta]~ +- Inside source: true +*** True Line Result + 1073742055 => [:meta_right, :meta] +** 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 self.char_to_method char, int = nil~ +- Inside source: true +*** True Line Result + def self.char_to_method char, int = nil +** Processing line: ~ methods = char_to_method_hash[char] || char_to_method_hash[int]~ +- Inside source: true +*** True Line Result + methods = char_to_method_hash[char] || char_to_method_hash[int] +** Processing line: ~ methods ? methods.dup : [char.to_sym || int]~ +- Inside source: true +*** True Line Result + methods ? methods.dup : [char.to_sym || int] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def clear~ +- Inside source: true +*** True Line Result + def clear +** Processing line: ~ set truthy_keys, false~ +- Inside source: true +*** True Line Result + set truthy_keys, false +** Processing line: ~ @scrubbed_ivars = nil~ +- Inside source: true +*** True Line Result + @scrubbed_ivars = nil +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def left_right~ +- Inside source: true +*** True Line Result + def left_right +** Processing line: ~ return -1 if self.left~ +- Inside source: true +*** True Line Result + return -1 if self.left +** Processing line: ~ return 1 if self.right~ +- Inside source: true +*** True Line Result + return 1 if self.right +** Processing line: ~ return 0~ +- Inside source: true +*** True Line Result + return 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def up_down~ +- Inside source: true +*** True Line Result + def up_down +** Processing line: ~ return 1 if self.up~ +- Inside source: true +*** True Line Result + return 1 if self.up +** Processing line: ~ return -1 if self.down~ +- Inside source: true +*** True Line Result + return -1 if self.down +** Processing line: ~ return 0~ +- Inside source: true +*** True Line Result + return 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def truthy_keys~ +- Inside source: true +*** True Line Result + def truthy_keys +** Processing line: ~ get(all).find_all { |_, v| v }~ +- Inside source: true +*** True Line Result + get(all).find_all { |_, v| v } +** Processing line: ~ .map { |k, _| k.to_sym }~ +- Inside source: true +*** True Line Result + .map { |k, _| k.to_sym } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def all? keys~ +- Inside source: true +*** True Line Result + def all? keys +** Processing line: ~ values = get(keys.map { |k| k.without_ending_bang })~ +- Inside source: true +*** True Line Result + values = get(keys.map { |k| k.without_ending_bang }) +** Processing line: ~ all_true = values.all? do |k, v|~ +- Inside source: true +*** True Line Result + all_true = values.all? do |k, v| +** Processing line: ~ v~ +- Inside source: true +*** True Line Result + v +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if all_true~ +- Inside source: true +*** True Line Result + if all_true +** Processing line: ~ keys.each do |k|~ +- Inside source: true +*** True Line Result + keys.each do |k| +** Processing line: ~ clear_key k if k.end_with_bang?~ +- Inside source: true +*** True Line Result + clear_key k if k.end_with_bang? +** 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: ~ all_true~ +- Inside source: true +*** True Line Result + all_true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def any? keys~ +- Inside source: true +*** True Line Result + def any? keys +** Processing line: ~ values = get(keys.map { |k| k.without_ending_bang })~ +- Inside source: true +*** True Line Result + values = get(keys.map { |k| k.without_ending_bang }) +** Processing line: ~ any_true = values.any? do |k, v|~ +- Inside source: true +*** True Line Result + any_true = values.any? do |k, v| +** Processing line: ~ v~ +- Inside source: true +*** True Line Result + v +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if any_true~ +- Inside source: true +*** True Line Result + if any_true +** Processing line: ~ keys.each do |k|~ +- Inside source: true +*** True Line Result + keys.each do |k| +** Processing line: ~ clear_key k if k.end_with_bang?~ +- Inside source: true +*** True Line Result + clear_key k if k.end_with_bang? +** 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: ~ any_true~ +- Inside source: true +*** True Line Result + any_true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def clear_key key~ +- Inside source: true +*** True Line Result + def clear_key key +** Processing line: ~ @scrubbed_ivars = nil~ +- Inside source: true +*** True Line Result + @scrubbed_ivars = nil +** Processing line: ~ self.instance_variable_set("@#{key.without_ending_bang}", false)~ +- Inside source: true +*** True Line Result + self.instance_variable_set("@#{key.without_ending_bang}", 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 + # @gtk +** Processing line: ~ def all~ +- Inside source: true +*** True Line Result + def all +** Processing line: ~ @scrubbed_ivars ||= self.instance_variables~ +- Inside source: true +*** True Line Result + @scrubbed_ivars ||= self.instance_variables +** Processing line: ~ .reject { |i| i == :@all || i == :@scrubbed_ivars }~ +- Inside source: true +*** True Line Result + .reject { |i| i == :@all || i == :@scrubbed_ivars } +** Processing line: ~ .map { |i| i.to_s.gsub("@", "") }~ +- Inside source: true +*** True Line Result + .map { |i| i.to_s.gsub("@", "") } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ get(@scrubbed_ivars).map { |k, _| k }~ +- Inside source: true +*** True Line Result + get(@scrubbed_ivars).map { |k, _| k } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def get collection~ +- Inside source: true +*** True Line Result + def get collection +** Processing line: ~ return [] if collection.length == 0~ +- Inside source: true +*** True Line Result + return [] if collection.length == 0 +** Processing line: ~ collection.map do |m|~ +- Inside source: true +*** True Line Result + collection.map do |m| +** Processing line: ~ if m.end_with_bang?~ +- Inside source: true +*** True Line Result + if m.end_with_bang? +** Processing line: ~ clear_after_return = true~ +- Inside source: true +*** True Line Result + clear_after_return = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ value = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)~ +- Inside source: true +*** True Line Result + value = self.instance_variable_get("@#{m.without_ending_bang}".to_sym) +** Processing line: ~ clear_key m if clear_after_return~ +- Inside source: true +*** True Line Result + clear_key m if clear_after_return +** Processing line: ~ [m.without_ending_bang, value]~ +- Inside source: true +*** True Line Result + [m.without_ending_bang, 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: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def set collection, value = true~ +- Inside source: true +*** True Line Result + def set collection, value = true +** Processing line: ~ return if collection.length == 0~ +- Inside source: true +*** True Line Result + return if collection.length == 0 +** Processing line: ~ @scrubbed_ivars = nil~ +- Inside source: true +*** True Line Result + @scrubbed_ivars = nil +** Processing line: ~ value = Kernel.tick_count if value~ +- Inside source: true +*** True Line Result + value = Kernel.tick_count if value +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ collection.each do |m|~ +- Inside source: true +*** True Line Result + collection.each do |m| +** Processing line: ~ self.instance_variable_set("@#{m.to_s}".to_sym, value)~ +- Inside source: true +*** True Line Result + self.instance_variable_set("@#{m.to_s}".to_sym, value) +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise e, <<-S~ +- Inside source: true +*** True Line Result + raise e, <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ Attempted to set the a key on the DragonRuby GTK's Keyboard data~ +- Inside source: true +*** True Line Result + Attempted to set the a key on the DragonRuby GTK's Keyboard data +** Processing line: ~ structure, but the property isn't available for raw_key #{raw_key} #{m}.~ +- Inside source: true +*** True Line Result + structure, but the property isn't available for raw_key #{raw_key} #{m}. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ You should contact DragonRuby and tell them to associate the raw_key #{raw_key}~ +- Inside source: true +*** True Line Result + You should contact DragonRuby and tell them to associate the raw_key #{raw_key} +** Processing line: ~ with a friendly property name (we are open to suggestions if you have any).~ +- Inside source: true +*** True Line Result + with a friendly property name (we are open to suggestions if you have any). +** Processing line: ~ [GTK::KeyboardKeys#set, GTK::KeyboardKeys#char_to_method]~ +- Inside source: true +*** True Line Result + [GTK::KeyboardKeys#set, GTK::KeyboardKeys#char_to_method] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** 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: ~ def method_missing m, *args~ +- Inside source: true +*** True Line Result + def method_missing m, *args +** Processing line: ~ begin~ +- Inside source: true +*** True Line Result + begin +** Processing line: ~ define_singleton_method(m) do~ +- Inside source: true +*** True Line Result + define_singleton_method(m) do +** Processing line: ~ r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)~ +- Inside source: true +*** True Line Result + r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym) +** Processing line: ~ clear_key m~ +- Inside source: true +*** True Line Result + clear_key m +** Processing line: ~ return r~ +- Inside source: true +*** True Line Result + 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~ +- Inside source: true +*** True Line Result + return self.send m +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + 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 + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ * ERROR:~ +- 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:~ +- 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: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #{KeyboardKeys.char_to_method_hash.map { |k, v| "[#{k} => #{v.join(",")}]" }.join(" ")}~ +- Inside source: true +*** True Line Result + #{KeyboardKeys.char_to_method_hash.map { |k, v| "[#{k} => #{v.join(",")}]" }.join(" ")} +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def serialize~ +- Inside source: true +*** True Line Result + def serialize +** Processing line: ~ hash = super~ +- Inside source: true +*** True Line Result + hash = super +** Processing line: ~ hash.delete(:scrubbed_ivars)~ +- Inside source: true +*** True Line Result + hash.delete(:scrubbed_ivars) +** Processing line: ~ hash[:truthy_keys] = self.truthy_keys~ +- Inside source: true +*** True Line Result + hash[:truthy_keys] = self.truthy_keys +** Processing line: ~ hash~ +- Inside source: true +*** True Line Result + hash +** 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: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ class Keyboard~ +- Inside source: true +*** True Line Result + class Keyboard +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @return [KeyboardKeys]~ +- Inside source: true +*** True Line Result + # @return [KeyboardKeys] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_accessor :key_up~ +- Inside source: true +*** True Line Result + attr_accessor :key_up +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @return [KeyboardKeys]~ +- Inside source: true +*** True Line Result + # @return [KeyboardKeys] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_accessor :key_held~ +- Inside source: true +*** True Line Result + attr_accessor :key_held +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @return [KeyboardKeys]~ +- Inside source: true +*** True Line Result + # @return [KeyboardKeys] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_accessor :key_down~ +- Inside source: true +*** True Line Result + attr_accessor :key_down +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @return [Boolean]~ +- Inside source: true +*** True Line Result + # @return [Boolean] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_accessor :has_focus~ +- Inside source: true +*** True Line Result + attr_accessor :has_focus +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @key_up = KeyboardKeys.new~ +- Inside source: true +*** True Line Result + @key_up = KeyboardKeys.new +** Processing line: ~ @key_held = KeyboardKeys.new~ +- Inside source: true +*** True Line Result + @key_held = KeyboardKeys.new +** Processing line: ~ @key_down = KeyboardKeys.new~ +- Inside source: true +*** True Line Result + @key_down = KeyboardKeys.new +** Processing line: ~ @has_focus = false~ +- Inside source: true +*** True Line Result + @has_focus = false +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def p~ +- Inside source: true +*** True Line Result + def p +** Processing line: ~ @key_down.p || @key_held.p~ +- Inside source: true +*** True Line Result + @key_down.p || @key_held.p +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # The left arrow or "a" was pressed.~ +- Inside source: true +*** True Line Result + # The left arrow or "a" was pressed. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Boolean]~ +- Inside source: true +*** True Line Result + # @return [Boolean] +** Processing line: ~ def left~ +- Inside source: true +*** True Line Result + def left +** Processing line: ~ @key_up.left || @key_held.left || a~ +- Inside source: true +*** True Line Result + @key_up.left || @key_held.left || a +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # The right arrow or "d" was pressed.~ +- Inside source: true +*** True Line Result + # The right arrow or "d" was pressed. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Boolean]~ +- Inside source: true +*** True Line Result + # @return [Boolean] +** Processing line: ~ def right~ +- Inside source: true +*** True Line Result + def right +** Processing line: ~ @key_up.right || @key_held.right || d~ +- Inside source: true +*** True Line Result + @key_up.right || @key_held.right || d +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # The up arrow or "w" was pressed.~ +- Inside source: true +*** True Line Result + # The up arrow or "w" was pressed. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Boolean]~ +- Inside source: true +*** True Line Result + # @return [Boolean] +** Processing line: ~ def up~ +- Inside source: true +*** True Line Result + def up +** Processing line: ~ @key_up.up || @key_held.up || w~ +- Inside source: true +*** True Line Result + @key_up.up || @key_held.up || w +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # The down arrow or "s" was pressed.~ +- Inside source: true +*** True Line Result + # The down arrow or "s" was pressed. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Boolean]~ +- Inside source: true +*** True Line Result + # @return [Boolean] +** Processing line: ~ def down~ +- Inside source: true +*** True Line Result + def down +** Processing line: ~ @key_up.down || @key_held.down || s~ +- Inside source: true +*** True Line Result + @key_up.down || @key_held.down || s +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Clear all current key presses.~ +- Inside source: true +*** True Line Result + # Clear all current key presses. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [void]~ +- Inside source: true +*** True Line Result + # @return [void] +** Processing line: ~ def clear~ +- Inside source: true +*** True Line Result + def clear +** Processing line: ~ @key_up.clear~ +- Inside source: true +*** True Line Result + @key_up.clear +** Processing line: ~ @key_held.clear~ +- Inside source: true +*** True Line Result + @key_held.clear +** Processing line: ~ @key_down.clear~ +- Inside source: true +*** True Line Result + @key_down.clear +** 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 + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ key_up: @key_up.serialize,~ +- Inside source: true +*** True Line Result + key_up: @key_up.serialize, +** Processing line: ~ key_held: @key_held.serialize,~ +- Inside source: true +*** True Line Result + key_held: @key_held.serialize, +** Processing line: ~ key_down: @key_down.serialize,~ +- Inside source: true +*** True Line Result + key_down: @key_down.serialize, +** Processing line: ~ has_focus: @has_focus~ +- Inside source: true +*** True Line Result + has_focus: @has_focus +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ alias_method :inspect, :serialize~ +- Inside source: true +*** True Line Result + alias_method :inspect, :serialize +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @return [String]~ +- Inside source: true +*** True Line Result + # @return [String] +** Processing line: ~ def to_s~ +- Inside source: true +*** True Line Result + def to_s +** Processing line: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.to_s +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def key~ +- Inside source: true +*** True Line Result + def key +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ down: @key_down.truthy_keys,~ +- Inside source: true +*** True Line Result + down: @key_down.truthy_keys, +** Processing line: ~ held: @key_held.truthy_keys,~ +- Inside source: true +*** True Line Result + held: @key_held.truthy_keys, +** Processing line: ~ down_or_held: (@key_down.truthy_keys + @key_held.truthy_keys).uniq,~ +- Inside source: true +*** True Line Result + down_or_held: (@key_down.truthy_keys + @key_held.truthy_keys).uniq, +** Processing line: ~ up: @key_up.truthy_keys,~ +- Inside source: true +*** True Line Result + up: @key_up.truthy_keys, +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ alias_method :keys, :key~ +- Inside source: true +*** True Line Result + alias_method :keys, :key +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ include DirectionalInputHelperMethods~ +- Inside source: true +*** True Line Result + include DirectionalInputHelperMethods +** 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 + module GTK +** Processing line: ~ class MousePoint~ +- Inside source: true +*** True Line Result + class MousePoint +** Processing line: ~ include GTK::Geometry~ +- Inside source: true +*** True Line Result + include GTK::Geometry +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_accessor :x, :y, :point, :created_at, :global_created_at~ +- Inside source: true +*** True Line Result + attr_accessor :x, :y, :point, :created_at, :global_created_at +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize x, y~ +- Inside source: true +*** True Line Result + def initialize x, y +** Processing line: ~ @x = x~ +- Inside source: true +*** True Line Result + @x = x +** Processing line: ~ @y = y~ +- Inside source: true +*** True Line Result + @y = y +** Processing line: ~ @point = [x, y]~ +- Inside source: true +*** True Line Result + @point = [x, y] +** Processing line: ~ @created_at = Kernel.tick_count~ +- Inside source: true +*** True Line Result + @created_at = Kernel.tick_count +** Processing line: ~ @global_created_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @global_created_at = Kernel.global_tick_count +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def w; 0; end~ +- Inside source: true +*** True Line Result + def w; 0; end +** Processing line: ~ def h; 0; end~ +- Inside source: true +*** True Line Result + def h; 0; end +** Processing line: ~ def left; x; end~ +- Inside source: true +*** True Line Result + def left; x; end +** Processing line: ~ def right; x; end~ +- Inside source: true +*** True Line Result + def right; x; end +** Processing line: ~ def top; y; end~ +- Inside source: true +*** True Line Result + def top; y; end +** Processing line: ~ def bottom; y; end~ +- Inside source: true +*** True Line Result + def bottom; y; end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def created_at_elapsed~ +- Inside source: true +*** True Line Result + def created_at_elapsed +** Processing line: ~ @created_at.elapsed_time~ +- Inside source: true +*** True Line Result + @created_at.elapsed_time +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def to_hash~ +- Inside source: true +*** True Line Result + def to_hash +** Processing line: ~ serialize~ +- Inside source: true +*** True Line Result + serialize +** 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 + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ x: @x,~ +- Inside source: true +*** True Line Result + x: @x, +** Processing line: ~ y: @y,~ +- Inside source: true +*** True Line Result + y: @y, +** Processing line: ~ created_at: @created_at,~ +- Inside source: true +*** True Line Result + created_at: @created_at, +** Processing line: ~ global_created_at: @global_created_at~ +- Inside source: true +*** True Line Result + global_created_at: @global_created_at +** 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 inspect~ +- Inside source: true +*** True Line Result + def inspect +** Processing line: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.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: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.to_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: ~ # Provides access to the mouse.~ +- Inside source: true +*** True Line Result + # Provides access to the mouse. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ class Mouse~ +- Inside source: true +*** True Line Result + class Mouse +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_accessor :moved,~ +- Inside source: true +*** True Line Result + attr_accessor :moved, +** Processing line: ~ :moved_at,~ +- Inside source: true +*** True Line Result + :moved_at, +** Processing line: ~ :global_moved_at,~ +- Inside source: true +*** True Line Result + :global_moved_at, +** Processing line: ~ :up, :has_focus,~ +- Inside source: true +*** True Line Result + :up, :has_focus, +** Processing line: ~ :button_bits, :button_left,~ +- Inside source: true +*** True Line Result + :button_bits, :button_left, +** Processing line: ~ :button_middle, :button_right,~ +- Inside source: true +*** True Line Result + :button_middle, :button_right, +** Processing line: ~ :button_x1, :button_x2,~ +- Inside source: true +*** True Line Result + :button_x1, :button_x2, +** Processing line: ~ :wheel~ +- Inside source: true +*** True Line Result + :wheel +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ attr_accessor :click~ +- Inside source: true +*** True Line Result + attr_accessor :click +** Processing line: ~ attr_accessor :previous_click~ +- Inside source: true +*** True Line Result + attr_accessor :previous_click +** Processing line: ~ attr_accessor :x~ +- Inside source: true +*** True Line Result + attr_accessor :x +** Processing line: ~ attr_accessor :y~ +- Inside source: true +*** True Line Result + attr_accessor :y +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** 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: ~ @has_focus = false~ +- Inside source: true +*** True Line Result + @has_focus = false +** Processing line: ~ @button_bits = 0~ +- Inside source: true +*** True Line Result + @button_bits = 0 +** Processing line: ~ @button_left = false~ +- Inside source: true +*** True Line Result + @button_left = false +** Processing line: ~ @button_middle = false~ +- Inside source: true +*** True Line Result + @button_middle = false +** Processing line: ~ @button_right = false~ +- Inside source: true +*** True Line Result + @button_right = false +** Processing line: ~ @button_x1 = false~ +- Inside source: true +*** True Line Result + @button_x1 = false +** Processing line: ~ @button_x2 = false~ +- Inside source: true +*** True Line Result + @button_x2 = false +** Processing line: ~ clear~ +- Inside source: true +*** True Line Result + clear +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def point~ +- Inside source: true +*** True Line Result + def point +** Processing line: ~ [@x, @y].point~ +- Inside source: true +*** True Line Result + [@x, @y].point +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def inside_rect? rect~ +- Inside source: true +*** True Line Result + def inside_rect? rect +** Processing line: ~ point.inside_rect? rect~ +- Inside source: true +*** True Line Result + point.inside_rect? rect +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def inside_circle? center, radius~ +- Inside source: true +*** True Line Result + def inside_circle? center, radius +** Processing line: ~ point.point_inside_circle? center, radius~ +- Inside source: true +*** True Line Result + point.point_inside_circle? center, radius +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def intersect_rect? other_rect~ +- Inside source: true +*** True Line Result + def intersect_rect? other_rect +** Processing line: ~ { x: point.x, y: point.y, w: 0, h: 0 }.intersect_rect? other_rect~ +- Inside source: true +*** True Line Result + { x: point.x, y: point.y, w: 0, h: 0 }.intersect_rect? other_rect +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ alias_method :position, :point~ +- Inside source: true +*** True Line Result + alias_method :position, :point +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def clear~ +- Inside source: true +*** True Line Result + def clear +** Processing line: ~ if @click~ +- Inside source: true +*** True Line Result + if @click +** Processing line: ~ @previous_click = MousePoint.new @click.point.x, @click.point.y~ +- Inside source: true +*** True Line Result + @previous_click = MousePoint.new @click.point.x, @click.point.y +** Processing line: ~ @previous_click.created_at = @click.created_at~ +- Inside source: true +*** True Line Result + @previous_click.created_at = @click.created_at +** Processing line: ~ @previous_click.global_created_at = @click.global_created_at~ +- Inside source: true +*** True Line Result + @previous_click.global_created_at = @click.global_created_at +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @click = nil~ +- Inside source: true +*** True Line Result + @click = nil +** Processing line: ~ @up = nil~ +- Inside source: true +*** True Line Result + @up = nil +** Processing line: ~ @moved = nil~ +- Inside source: true +*** True Line Result + @moved = nil +** Processing line: ~ @wheel = nil~ +- Inside source: true +*** True Line Result + @wheel = nil +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def up~ +- Inside source: true +*** True Line Result + def up +** Processing line: ~ @up~ +- Inside source: true +*** True Line Result + @up +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def down~ +- Inside source: true +*** True Line Result + def down +** Processing line: ~ @click~ +- Inside source: true +*** True Line Result + @click +** 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 + def serialize +** Processing line: ~ result = {}~ +- Inside source: true +*** True Line Result + result = {} +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if @click~ +- Inside source: true +*** True Line Result + if @click +** Processing line: ~ result[:click] = @click.to_hash~ +- Inside source: true +*** True Line Result + result[:click] = @click.to_hash +** Processing line: ~ result[:down] = @click.to_hash~ +- Inside source: true +*** True Line Result + result[:down] = @click.to_hash +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ result[:up] = @up.to_hash if @up~ +- Inside source: true +*** True Line Result + result[:up] = @up.to_hash if @up +** Processing line: ~ result[:x] = @x~ +- Inside source: true +*** True Line Result + result[:x] = @x +** Processing line: ~ result[:y] = @y~ +- Inside source: true +*** True Line Result + result[:y] = @y +** Processing line: ~ result[:moved] = @moved~ +- Inside source: true +*** True Line Result + result[:moved] = @moved +** Processing line: ~ result[:moved_at] = @moved_at~ +- Inside source: true +*** True Line Result + result[:moved_at] = @moved_at +** Processing line: ~ result[:has_focus] = @has_focus~ +- Inside source: true +*** True Line Result + result[:has_focus] = @has_focus +** 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: ~ def to_s~ +- Inside source: true +*** True Line Result + def to_s +** Processing line: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.to_s +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ alias_method :inspect, :to_s~ +- Inside source: true +*** True Line Result + alias_method :inspect, :to_s +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Provides access to multitouch input~ +- Inside source: true +*** True Line Result + # Provides access to multitouch input +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ class FingerTouch~ +- Inside source: true +*** True Line Result + class FingerTouch +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_accessor :moved,~ +- Inside source: true +*** True Line Result + attr_accessor :moved, +** Processing line: ~ :moved_at,~ +- Inside source: true +*** True Line Result + :moved_at, +** Processing line: ~ :global_moved_at,~ +- Inside source: true +*** True Line Result + :global_moved_at, +** Processing line: ~ :down_at,~ +- Inside source: true +*** True Line Result + :down_at, +** Processing line: ~ :global_down_at,~ +- Inside source: true +*** True Line Result + :global_down_at, +** Processing line: ~ :touch_order,~ +- Inside source: true +*** True Line Result + :touch_order, +** Processing line: ~ :first_tick_down,~ +- Inside source: true +*** True Line Result + :first_tick_down, +** Processing line: ~ :x, :y~ +- Inside source: true +*** True Line Result + :x, :y +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @moved = false~ +- Inside source: true +*** True Line Result + @moved = false +** Processing line: ~ @moved_at = 0~ +- Inside source: true +*** True Line Result + @moved_at = 0 +** Processing line: ~ @global_moved_at = 0~ +- Inside source: true +*** True Line Result + @global_moved_at = 0 +** Processing line: ~ @down_at = 0~ +- Inside source: true +*** True Line Result + @down_at = 0 +** Processing line: ~ @global_down_at = 0~ +- Inside source: true +*** True Line Result + @global_down_at = 0 +** Processing line: ~ @touch_order = 0~ +- Inside source: true +*** True Line Result + @touch_order = 0 +** Processing line: ~ @first_tick_down = true~ +- Inside source: true +*** True Line Result + @first_tick_down = true +** 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: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def point~ +- Inside source: true +*** True Line Result + def point +** Processing line: ~ [@x, @y].point~ +- Inside source: true +*** True Line Result + [@x, @y].point +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def inside_rect? rect~ +- Inside source: true +*** True Line Result + def inside_rect? rect +** Processing line: ~ point.inside_rect? rect~ +- Inside source: true +*** True Line Result + point.inside_rect? rect +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def inside_circle? center, radius~ +- Inside source: true +*** True Line Result + def inside_circle? center, radius +** Processing line: ~ point.point_inside_circle? center, radius~ +- Inside source: true +*** True Line Result + point.point_inside_circle? center, radius +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ alias_method :position, :point~ +- Inside source: true +*** True Line Result + alias_method :position, :point +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def serialize~ +- Inside source: true +*** True Line Result + def serialize +** Processing line: ~ result = {}~ +- Inside source: true +*** True Line Result + result = {} +** Processing line: ~ result[:x] = @x~ +- Inside source: true +*** True Line Result + result[:x] = @x +** Processing line: ~ result[:y] = @y~ +- Inside source: true +*** True Line Result + result[:y] = @y +** Processing line: ~ result[:touch_order] = @touch_order~ +- Inside source: true +*** True Line Result + result[:touch_order] = @touch_order +** Processing line: ~ result[:moved] = @moved~ +- Inside source: true +*** True Line Result + result[:moved] = @moved +** Processing line: ~ result[:moved_at] = @moved_at~ +- Inside source: true +*** True Line Result + result[:moved_at] = @moved_at +** Processing line: ~ result[:global_moved_at] = @global_moved_at~ +- Inside source: true +*** True Line Result + result[:global_moved_at] = @global_moved_at +** Processing line: ~ result[:down_at] = @down_at~ +- Inside source: true +*** True Line Result + result[:down_at] = @down_at +** Processing line: ~ result[:global_down_at] = @global_down_at~ +- Inside source: true +*** True Line Result + result[:global_down_at] = @global_down_at +** 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: ~ def to_s~ +- Inside source: true +*** True Line Result + def to_s +** Processing line: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.to_s +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ alias_method :inspect, :to_s~ +- Inside source: true +*** True Line Result + alias_method :inspect, :to_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: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ class Inputs~ +- Inside source: true +*** True Line Result + class Inputs +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # A list of all controllers.~ +- Inside source: true +*** True Line Result + # A list of all controllers. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Controller[]]~ +- Inside source: true +*** True Line Result + # @return [Controller[]] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_reader :controllers~ +- Inside source: true +*** True Line Result + attr_reader :controllers +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @return [Keyboard]~ +- Inside source: true +*** True Line Result + # @return [Keyboard] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_reader :keyboard~ +- Inside source: true +*** True Line Result + attr_reader :keyboard +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @return [Mouse]~ +- Inside source: true +*** True Line Result + # @return [Mouse] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_reader :mouse~ +- Inside source: true +*** True Line Result + attr_reader :mouse +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @return [HTTPRequest[]]~ +- Inside source: true +*** True Line Result + # @return [HTTPRequest[]] +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_accessor :http_requests~ +- Inside source: true +*** True Line Result + attr_accessor :http_requests +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @return {FingerTouch}~ +- Inside source: true +*** True Line Result + # @return {FingerTouch} +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_reader :touch~ +- Inside source: true +*** True Line Result + attr_reader :touch +** Processing line: ~ attr_accessor :finger_one, :finger_two~ +- Inside source: true +*** True Line Result + attr_accessor :finger_one, :finger_two +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ attr_accessor :text, :history~ +- Inside source: true +*** True Line Result + attr_accessor :text, :history +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @controllers = [Controller.new, Controller.new]~ +- Inside source: true +*** True Line Result + @controllers = [Controller.new, Controller.new] +** Processing line: ~ @keyboard = Keyboard.new~ +- Inside source: true +*** True Line Result + @keyboard = Keyboard.new +** Processing line: ~ @mouse = Mouse.new~ +- Inside source: true +*** True Line Result + @mouse = Mouse.new +** Processing line: ~ @touch = {}~ +- Inside source: true +*** True Line Result + @touch = {} +** Processing line: ~ @finger_one = nil~ +- Inside source: true +*** True Line Result + @finger_one = nil +** Processing line: ~ @finger_two = nil~ +- Inside source: true +*** True Line Result + @finger_two = nil +** Processing line: ~ @text = []~ +- Inside source: true +*** True Line Result + @text = [] +** Processing line: ~ @http_requests = []~ +- Inside source: true +*** True Line Result + @http_requests = [] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def up~ +- Inside source: true +*** True Line Result + def up +** Processing line: ~ keyboard.up ||~ +- Inside source: true +*** True Line Result + keyboard.up || +** Processing line: ~ (controller_one && controller_one.up)~ +- Inside source: true +*** True Line Result + (controller_one && controller_one.up) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def down~ +- Inside source: true +*** True Line Result + def down +** Processing line: ~ keyboard.down ||~ +- Inside source: true +*** True Line Result + keyboard.down || +** Processing line: ~ (controller_one && controller_one.down)~ +- Inside source: true +*** True Line Result + (controller_one && controller_one.down) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def left~ +- Inside source: true +*** True Line Result + def left +** Processing line: ~ keyboard.left ||~ +- Inside source: true +*** True Line Result + keyboard.left || +** Processing line: ~ (controller_one && controller_one.left)~ +- Inside source: true +*** True Line Result + (controller_one && controller_one.left) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def right~ +- Inside source: true +*** True Line Result + def right +** Processing line: ~ keyboard.right ||~ +- Inside source: true +*** True Line Result + keyboard.right || +** Processing line: ~ (controller_one && controller_one.right)~ +- Inside source: true +*** True Line Result + (controller_one && controller_one.right) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def directional_vector~ +- Inside source: true +*** True Line Result + def directional_vector +** Processing line: ~ keyboard.directional_vector ||~ +- Inside source: true +*** True Line Result + keyboard.directional_vector || +** Processing line: ~ (controller_one && controller_one.directional_vector)~ +- Inside source: true +*** True Line Result + (controller_one && controller_one.directional_vector) +** 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 + # Returns a signal indicating right (`1`), left (`-1`), or neither ('0'). +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Integer]~ +- Inside source: true +*** True Line Result + # @return [Integer] +** Processing line: ~ def left_right~ +- Inside source: true +*** True Line Result + def left_right +** Processing line: ~ return -1 if self.left~ +- Inside source: true +*** True Line Result + return -1 if self.left +** Processing line: ~ return 1 if self.right~ +- Inside source: true +*** True Line Result + return 1 if self.right +** Processing line: ~ return 0~ +- Inside source: true +*** True Line Result + return 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns a signal indicating up (`1`), down (`-1`), or neither ('0').~ +- Inside source: true +*** True Line Result + # Returns a signal indicating up (`1`), down (`-1`), or neither ('0'). +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Integer]~ +- Inside source: true +*** True Line Result + # @return [Integer] +** Processing line: ~ def up_down~ +- Inside source: true +*** True Line Result + def up_down +** Processing line: ~ return 1 if self.up~ +- Inside source: true +*** True Line Result + return 1 if self.up +** Processing line: ~ return -1 if self.down~ +- Inside source: true +*** True Line Result + return -1 if self.down +** Processing line: ~ return 0~ +- Inside source: true +*** True Line Result + return 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the coordinates of the last click.~ +- Inside source: true +*** True Line Result + # Returns the coordinates of the last click. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Float, Float]~ +- Inside source: true +*** True Line Result + # @return [Float, Float] +** Processing line: ~ def click~ +- Inside source: true +*** True Line Result + def click +** Processing line: ~ return nil unless @mouse.click~ +- Inside source: true +*** True Line Result + return nil unless @mouse.click +** Processing line: ~ return @mouse.click.point~ +- Inside source: true +*** True Line Result + return @mouse.click.point +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # The first controller.~ +- Inside source: true +*** True Line Result + # The first controller. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Controller]~ +- Inside source: true +*** True Line Result + # @return [Controller] +** Processing line: ~ def controller_one~ +- Inside source: true +*** True Line Result + def controller_one +** Processing line: ~ @controllers[0]~ +- Inside source: true +*** True Line Result + @controllers[0] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # The second controller.~ +- Inside source: true +*** True Line Result + # The second controller. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [Controller]~ +- Inside source: true +*** True Line Result + # @return [Controller] +** Processing line: ~ def controller_two~ +- Inside source: true +*** True Line Result + def controller_two +** Processing line: ~ @controllers[1]~ +- Inside source: true +*** True Line Result + @controllers[1] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Clears all inputs.~ +- Inside source: true +*** True Line Result + # Clears all inputs. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @return [void]~ +- Inside source: true +*** True Line Result + # @return [void] +** Processing line: ~ def clear~ +- Inside source: true +*** True Line Result + def clear +** Processing line: ~ @mouse.clear~ +- Inside source: true +*** True Line Result + @mouse.clear +** Processing line: ~ @keyboard.clear~ +- Inside source: true +*** True Line Result + @keyboard.clear +** Processing line: ~ @controllers.each(&:clear)~ +- Inside source: true +*** True Line Result + @controllers.each(&:clear) +** Processing line: ~ @touch.clear~ +- Inside source: true +*** True Line Result + @touch.clear +** Processing line: ~ @http_requests.clear~ +- Inside source: true +*** True Line Result + @http_requests.clear +** Processing line: ~ @finger_one = nil~ +- Inside source: true +*** True Line Result + @finger_one = nil +** Processing line: ~ @finger_two = nil~ +- Inside source: true +*** True Line Result + @finger_two = nil +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @return [Hash]~ +- Inside source: true +*** True Line Result + # @return [Hash] +** Processing line: ~ def serialize~ +- Inside source: true +*** True Line Result + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ controller_one: controller_one.serialize,~ +- Inside source: true +*** True Line Result + controller_one: controller_one.serialize, +** Processing line: ~ controller_two: controller_two.serialize,~ +- Inside source: true +*** True Line Result + controller_two: controller_two.serialize, +** Processing line: ~ keyboard: keyboard.serialize,~ +- Inside source: true +*** True Line Result + keyboard: keyboard.serialize, +** Processing line: ~ mouse: mouse.serialize,~ +- Inside source: true +*** True Line Result + mouse: mouse.serialize, +** Processing line: ~ text: text.serialize~ +- Inside source: true +*** True Line Result + text: text.serialize +** 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: ~#+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: ~*** ios_wizard.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** ios_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/ios_wizard.rb~ +- Inside source: true +*** True Line Result + # ./dragon/ios_wizard.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # ios_wizard.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # ios_wizard.rb has been released under MIT (*only this file*). +** 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: ~ class IOSWizard~ +- Inside source: true +*** True Line Result + class IOSWizard +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @doctor_executed_at = 0~ +- Inside source: true +*** True Line Result + @doctor_executed_at = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def relative_path~ +- Inside source: true +*** True Line Result + def relative_path +** Processing line: ~ (File.dirname $gtk.binary_path)~ +- Inside source: true +*** True Line Result + (File.dirname $gtk.binary_path) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def steps~ +- Inside source: true +*** True Line Result + def steps +** Processing line: ~ @steps ||= []~ +- Inside source: true +*** True Line Result + @steps ||= [] +** 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: ~ :check_for_xcode,~ +- 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,~ +- Inside source: true +*** True Line Result + :check_for_certs, +** 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: ~ :determine_team_identifier,~ +- Inside source: true +*** True Line Result + :determine_team_identifier, +** Processing line: ~ :determine_app_name,~ +- Inside source: true +*** True Line Result + :determine_app_name, +** Processing line: ~ :determine_app_id,~ +- Inside source: true +*** True Line Result + :determine_app_id, +** Processing line: ~ :blow_away_temp,~ +- Inside source: true +*** True Line Result + :blow_away_temp, +** Processing line: ~ :stage_app,~ +- Inside source: true +*** True Line Result + :stage_app, +** Processing line: ~ :development_write_info_plist,~ +- Inside source: true +*** True Line Result + :development_write_info_plist, +** Processing line: ~ :write_entitlements_plist,~ +- Inside source: true +*** True Line Result + :write_entitlements_plist, +** Processing line: ~ :compile_icons,~ +- Inside source: true +*** True Line Result + :compile_icons, +** Processing line: ~ :create_payload_directory,~ +- Inside source: true +*** True Line Result + :create_payload_directory, +** Processing line: ~ :code_sign_payload,~ +- Inside source: true +*** True Line Result + :code_sign_payload, +** Processing line: ~ :create_ipa,~ +- Inside source: true +*** True Line Result + :create_ipa, +** Processing line: ~ :deploy~ +- Inside source: true +*** True Line Result + :deploy +** 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_production_build~ +- Inside source: true +*** True Line Result + def steps_production_build +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ :check_for_xcode,~ +- 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,~ +- 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,~ +- Inside source: true +*** True Line Result + :determine_team_identifier, +** Processing line: ~ :determine_app_name,~ +- Inside source: true +*** True Line Result + :determine_app_name, +** Processing line: ~ :determine_app_id,~ +- Inside source: true +*** True Line Result + :determine_app_id, +** Processing line: ~ :blow_away_temp,~ +- Inside source: true +*** True Line Result + :blow_away_temp, +** Processing line: ~ :stage_app,~ +- Inside source: true +*** True Line Result + :stage_app, +** Processing line: ~ :production_write_info_plist,~ +- Inside source: true +*** True Line Result + :production_write_info_plist, +** Processing line: ~ :write_entitlements_plist,~ +- Inside source: true +*** True Line Result + :write_entitlements_plist, +** Processing line: ~ :compile_icons,~ +- Inside source: true +*** True Line Result + :compile_icons, +** Processing line: ~ :create_payload_directory,~ +- Inside source: true +*** True Line Result + :create_payload_directory, +** Processing line: ~ :code_sign_payload,~ +- Inside source: true +*** True Line Result + :code_sign_payload, +** Processing line: ~ :create_ipa,~ +- Inside source: true +*** True Line Result + :create_ipa, +** Processing line: ~ :print_publish_help~ +- Inside source: true +*** True Line Result + :print_publish_help +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def get_reserved_sprite png~ +- Inside source: true +*** True Line Result + def get_reserved_sprite png +** Processing line: ~ sprite_path = ".dragonruby/sprites/wizards/ios/#{png}"~ +- Inside source: true +*** True Line Result + sprite_path = ".dragonruby/sprites/wizards/ios/#{png}" +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !$gtk.ivar :rcb_release_mode~ +- Inside source: true +*** True Line Result + if !$gtk.ivar :rcb_release_mode +** Processing line: ~ sprite_path = "deploy_template/#{sprite_path}"~ +- Inside source: true +*** True Line Result + sprite_path = "deploy_template/#{sprite_path}" +** Processing line: ~ $gtk.reset_sprite sprite_path~ +- Inside source: true +*** True Line Result + $gtk.reset_sprite sprite_path +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !$gtk.read_file sprite_path~ +- Inside source: true +*** True Line Result + if !$gtk.read_file sprite_path +** Processing line: ~ log_error "png #{png} not found."~ +- Inside source: true +*** True Line Result + log_error "png #{png} not found." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ sprite_path~ +- Inside source: true +*** True Line Result + sprite_path +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def start opts = nil~ +- Inside source: true +*** True Line Result + def start opts = nil +** Processing line: ~ @opts = opts || {}~ +- Inside source: true +*** True Line Result + @opts = opts || {} +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !(@opts.is_a? Hash) || !($gtk.args.fn.eq_any? @opts[:env], :dev, :prod)~ +- Inside source: true +*** True Line Result + if !(@opts.is_a? Hash) || !($gtk.args.fn.eq_any? @opts[:env], :dev, :prod) +** Processing line: ~ raise WizardException.new(~ +- Inside source: true +*** True Line Result + raise WizardException.new( +** Processing line: ~ "* $wizards.ios.start needs to be provided an environment option.",~ +- Inside source: true +*** True Line Result + "* $wizards.ios.start needs to be provided an environment option.", +** Processing line: ~ "** For development builds type: $wizards.ios.start env: :dev",~ +- Inside source: true +*** True Line Result + "** For development builds type: $wizards.ios.start env: :dev", +** Processing line: ~ "** For production builds type: $wizards.ios.start env: :prod"~ +- Inside source: true +*** True Line Result + "** For production builds type: $wizards.ios.start env: :prod" +** 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: ~ @production_build = (@opts[:env] == :prod)~ +- Inside source: true +*** True Line Result + @production_build = (@opts[:env] == :prod) +** Processing line: ~ @steps = steps_development_build~ +- Inside source: true +*** True Line Result + @steps = steps_development_build +** Processing line: ~ @steps = steps_production_build if @production_build~ +- Inside source: true +*** True Line Result + @steps = steps_production_build if @production_build +** Processing line: ~ @certificate_name = nil~ +- Inside source: true +*** True Line Result + @certificate_name = nil +** Processing line: ~ init_wizard_status~ +- Inside source: true +*** True Line Result + init_wizard_status +** Processing line: ~ log_info "Starting iOS Wizard so we can deploy to your device."~ +- Inside source: true +*** True Line Result + log_info "Starting iOS Wizard so we can deploy to your device." +** Processing line: ~ @start_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @start_at = Kernel.global_tick_count +** Processing line: ~ steps.each do |m|~ +- Inside source: true +*** True Line Result + steps.each do |m| +** Processing line: ~ log_info "Running step ~:#{m}~."~ +- Inside source: true +*** True Line Result + log_info "Running step ~:#{m}~." +** Processing line: ~ result = (send m) || :success if @wizard_status[m][:result] != :success~ +- Inside source: true +*** True Line Result + result = (send m) || :success if @wizard_status[m][:result] != :success +** Processing line: ~ @wizard_status[m][:result] = result~ +- Inside source: true +*** True Line Result + @wizard_status[m][:result] = result +** Processing line: ~ log_info "Running step ~:#{m}~ complete."~ +- Inside source: true +*** True Line Result + log_info "Running step ~:#{m}~ complete." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ nil~ +- Inside source: true +*** True Line Result + nil +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ if e.is_a? WizardException~ +- Inside source: true +*** True Line Result + if e.is_a? WizardException +** Processing line: ~ $console.log.clear~ +- Inside source: true +*** True Line Result + $console.log.clear +** Processing line: ~ $console.archived_log.clear~ +- Inside source: true +*** True Line Result + $console.archived_log.clear +** Processing line: ~ log "=" * $console.console_text_width~ +- Inside source: true +*** True Line Result + log "=" * $console.console_text_width +** Processing line: ~ e.console_primitives.each do |p|~ +- Inside source: true +*** True Line Result + e.console_primitives.each do |p| +** Processing line: ~ $console.add_primitive p~ +- Inside source: true +*** True Line Result + $console.add_primitive p +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ log "=" * $console.console_text_width~ +- Inside source: true +*** True Line Result + log "=" * $console.console_text_width +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ log_error e.to_s~ +- Inside source: true +*** True Line Result + log_error e.to_s +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ $console.set_command "$wizards.ios.start env: :#{@opts[:env]}"~ +- Inside source: true +*** True Line Result + $console.set_command "$wizards.ios.start env: :#{@opts[:env]}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def always_fail~ +- Inside source: true +*** True Line Result + def always_fail +** Processing line: ~ return false if $gtk.ivar :rcb_release_mode~ +- Inside source: true +*** True Line Result + return false if $gtk.ivar :rcb_release_mode +** Processing line: ~ return true~ +- Inside source: true +*** True Line Result + return true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def check_for_xcode~ +- Inside source: true +*** True Line Result + def check_for_xcode +** Processing line: ~ if !cli_app_exist?(xcodebuild_cli_app)~ +- Inside source: true +*** True Line Result + if !cli_app_exist?(xcodebuild_cli_app) +** Processing line: ~ raise WizardException.new(~ +- Inside source: true +*** True Line Result + raise WizardException.new( +** Processing line: ~ "* You need Xcode to use $wizards.ios.start.",~ +- Inside source: true +*** True Line Result + "* You need Xcode to use $wizards.ios.start.", +** Processing line: ~ { w: 75, h: 75, path: get_reserved_sprite("xcode.png") },~ +- Inside source: true +*** True Line Result + { w: 75, h: 75, path: get_reserved_sprite("xcode.png") }, +** Processing line: ~ "** 1. Go to http://developer.apple.com and register.",~ +- Inside source: true +*** True Line Result + "** 1. Go to http://developer.apple.com and register.", +** Processing line: ~ "** 2. Download Xcode 11.3+ from http://developer.apple.com/downloads.",~ +- Inside source: true +*** True Line Result + "** 2. Download Xcode 11.3+ from http://developer.apple.com/downloads.", +** Processing line: ~ " NOTE: DO NOT install Xcode from the App Store. Use the link above.",~ +- Inside source: true +*** True Line Result + " NOTE: DO NOT install Xcode from the App Store. Use the link above.", +** Processing line: ~ { w: 700, h: 359, path: get_reserved_sprite("xcode-downloads.png") },~ +- Inside source: true +*** True Line Result + { w: 700, h: 359, path: get_reserved_sprite("xcode-downloads.png") }, +** Processing line: ~ "** 3. After installing. Open up Xcode to accept the EULA."~ +- Inside source: true +*** True Line Result + "** 3. After installing. Open up Xcode to accept the EULA." +** 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 check_for_brew~ +- Inside source: true +*** True Line Result + def check_for_brew +** Processing line: ~ if !cli_app_exist?('brew')~ +- Inside source: true +*** True Line Result + if !cli_app_exist?('brew') +** Processing line: ~ raise WizardException.new(~ +- Inside source: true +*** True Line Result + raise WizardException.new( +** Processing line: ~ "* You need to install Brew.",~ +- Inside source: true +*** True Line Result + "* You need to install Brew.", +** Processing line: ~ { w: 700, h: 388, path: get_reserved_sprite("brew.png") },~ +- Inside source: true +*** True Line Result + { w: 700, h: 388, path: get_reserved_sprite("brew.png") }, +** Processing line: ~ "** 1. Go to http://brew.sh.",~ +- Inside source: true +*** True Line Result + "** 1. Go to http://brew.sh.", +** Processing line: ~ "** 2. Copy the command that starts with `/bin/bash -c` on the site.",~ +- Inside source: true +*** True Line Result + "** 2. Copy the command that starts with `/bin/bash -c` on the site.", +** Processing line: ~ "** 3. Open Terminal and run the command you copied from the website.",~ +- Inside source: true +*** True Line Result + "** 3. Open Terminal and run the command you copied from the website.", +** Processing line: ~ { w: 700, h: 99, path: get_reserved_sprite("terminal.png") },~ +- Inside source: true +*** True Line Result + { w: 700, h: 99, path: get_reserved_sprite("terminal.png") }, +** 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 init_wizard_status~ +- Inside source: true +*** True Line Result + def init_wizard_status +** Processing line: ~ @wizard_status = {}~ +- Inside source: true +*** True Line Result + @wizard_status = {} +** Processing line: ~ steps.each do |m|~ +- Inside source: true +*** True Line Result + steps.each do |m| +** Processing line: ~ @wizard_status[m] = { result: :not_started }~ +- Inside source: true +*** True Line Result + @wizard_status[m] = { result: :not_started } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ previous_step = nil~ +- Inside source: true +*** True Line Result + previous_step = nil +** Processing line: ~ next_step = nil~ +- Inside source: true +*** True Line Result + next_step = nil +** Processing line: ~ steps.each_cons(2) do |current_step, next_step|~ +- Inside source: true +*** True Line Result + steps.each_cons(2) do |current_step, next_step| +** Processing line: ~ @wizard_status[current_step][:next_step] = next_step~ +- Inside source: true +*** True Line Result + @wizard_status[current_step][:next_step] = next_step +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ steps.reverse.each_cons(2) do |current_step, previous_step|~ +- Inside source: true +*** True Line Result + steps.reverse.each_cons(2) do |current_step, previous_step| +** Processing line: ~ @wizard_status[current_step][:previous_step] = previous_step~ +- Inside source: true +*** True Line Result + @wizard_status[current_step][:previous_step] = previous_step +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def restart~ +- Inside source: true +*** True Line Result + def restart +** Processing line: ~ init_wizard_status~ +- Inside source: true +*** True Line Result + init_wizard_status +** Processing line: ~ start~ +- Inside source: true +*** True Line Result + start +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def check_for_distribution_profile~ +- Inside source: true +*** True Line Result + def check_for_distribution_profile +** Processing line: ~ @provisioning_profile_path = "profiles/distribution.mobileprovision"~ +- Inside source: true +*** True Line Result + @provisioning_profile_path = "profiles/distribution.mobileprovision" +** Processing line: ~ if !($gtk.read_file @provisioning_profile_path)~ +- Inside source: true +*** True Line Result + if !($gtk.read_file @provisioning_profile_path) +** Processing line: ~ $gtk.system "mkdir -p #{relative_path}/profiles"~ +- Inside source: true +*** True Line Result + $gtk.system "mkdir -p #{relative_path}/profiles" +** Processing line: ~ $gtk.system "open #{relative_path}/profiles"~ +- Inside source: true +*** True Line Result + $gtk.system "open #{relative_path}/profiles" +** Processing line: ~ $gtk.system "echo Download the mobile provisioning profile and place it here with the name distribution.mobileprovision > #{relative_path}/profiles/README.txt"~ +- Inside source: true +*** True Line Result + $gtk.system "echo Download the mobile provisioning profile and place it here with the name distribution.mobileprovision > #{relative_path}/profiles/README.txt" +** Processing line: ~ raise WizardException.new(~ +- Inside source: true +*** True Line Result + raise WizardException.new( +** Processing line: ~ "* I didn't find a mobile provision.",~ +- Inside source: true +*** True Line Result + "* I didn't find a mobile provision.", +** Processing line: ~ "** 1. Go to http://developer.apple.com and click \"Certificates, IDs & Profiles\".",~ +- Inside source: true +*** True Line Result + "** 1. Go to http://developer.apple.com and click \"Certificates, IDs & Profiles\".", +** Processing line: ~ "** 2. Add an App Identifier.",~ +- Inside source: true +*** True Line Result + "** 2. Add an App Identifier.", +** Processing line: ~ "** 3. Select the App IDs option from the list.",~ +- Inside source: true +*** True Line Result + "** 3. Select the App IDs option from the list.", +** Processing line: ~ { w: 700, h: 75, path: get_reserved_sprite("identifiers.png") },~ +- Inside source: true +*** True Line Result + { w: 700, h: 75, path: get_reserved_sprite("identifiers.png") }, +** Processing line: ~ "** 4. Add your Device next. You can use idevice_id -l to get the UUID of your device.",~ +- Inside source: true +*** True Line Result + "** 4. Add your Device next. You can use idevice_id -l to get the UUID of your device.", +** Processing line: ~ { w: 365, h: 69, path: get_reserved_sprite("device-link.png") },~ +- Inside source: true +*** True Line Result + { w: 365, h: 69, path: get_reserved_sprite("device-link.png") }, +** Processing line: ~ "** 5. Create a Profile. Associate your certs, id, and device.",~ +- Inside source: true +*** True Line Result + "** 5. Create a Profile. Associate your certs, id, and device.", +** Processing line: ~ { w: 300, h: 122, path: get_reserved_sprite("profiles.png") },~ +- Inside source: true +*** True Line Result + { w: 300, h: 122, path: get_reserved_sprite("profiles.png") }, +** Processing line: ~ "** 6. Download the mobile provision and save it to 'profiles/development.mobileprovision'.",~ +- Inside source: true +*** True Line Result + "** 6. Download the mobile provision and save it to 'profiles/development.mobileprovision'.", +** Processing line: ~ { w: 200, h: 124, path: get_reserved_sprite("profiles-folder.png") },~ +- Inside source: true +*** True Line Result + { w: 200, h: 124, path: get_reserved_sprite("profiles-folder.png") }, +** 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 check_for_dev_profile~ +- Inside source: true +*** True Line Result + def check_for_dev_profile +** Processing line: ~ @provisioning_profile_path = "profiles/development.mobileprovision"~ +- Inside source: true +*** True Line Result + @provisioning_profile_path = "profiles/development.mobileprovision" +** Processing line: ~ if !($gtk.read_file @provisioning_profile_path)~ +- Inside source: true +*** True Line Result + if !($gtk.read_file @provisioning_profile_path) +** Processing line: ~ $gtk.system "mkdir -p #{relative_path}/profiles"~ +- Inside source: true +*** True Line Result + $gtk.system "mkdir -p #{relative_path}/profiles" +** Processing line: ~ $gtk.system "open #{relative_path}/profiles"~ +- Inside source: true +*** True Line Result + $gtk.system "open #{relative_path}/profiles" +** Processing line: ~ $gtk.system "echo Download the mobile provisioning profile and place it here with the name development.mobileprovision > #{relative_path}/profiles/README.txt"~ +- Inside source: true +*** True Line Result + $gtk.system "echo Download the mobile provisioning profile and place it here with the name development.mobileprovision > #{relative_path}/profiles/README.txt" +** Processing line: ~ raise WizardException.new(~ +- Inside source: true +*** True Line Result + raise WizardException.new( +** Processing line: ~ "* I didn't find a mobile provision.",~ +- Inside source: true +*** True Line Result + "* I didn't find a mobile provision.", +** Processing line: ~ "** 1. Go to http://developer.apple.com and click \"Certificates, IDs & Profiles\".",~ +- Inside source: true +*** True Line Result + "** 1. Go to http://developer.apple.com and click \"Certificates, IDs & Profiles\".", +** Processing line: ~ "** 2. Add an App Identifier.",~ +- Inside source: true +*** True Line Result + "** 2. Add an App Identifier.", +** Processing line: ~ "** 3. Select the App IDs option from the list.",~ +- Inside source: true +*** True Line Result + "** 3. Select the App IDs option from the list.", +** Processing line: ~ { w: 700, h: 75, path: get_reserved_sprite("identifiers.png") },~ +- Inside source: true +*** True Line Result + { w: 700, h: 75, path: get_reserved_sprite("identifiers.png") }, +** Processing line: ~ "** 4. Add your Device next. You can use idevice_id -l to get the UUID of your device.",~ +- Inside source: true +*** True Line Result + "** 4. Add your Device next. You can use idevice_id -l to get the UUID of your device.", +** Processing line: ~ { w: 365, h: 69, path: get_reserved_sprite("device-link.png") },~ +- Inside source: true +*** True Line Result + { w: 365, h: 69, path: get_reserved_sprite("device-link.png") }, +** Processing line: ~ "** 5. Create a Profile. Associate your certs, id, and device.",~ +- Inside source: true +*** True Line Result + "** 5. Create a Profile. Associate your certs, id, and device.", +** Processing line: ~ { w: 300, h: 122, path: get_reserved_sprite("profiles.png") },~ +- Inside source: true +*** True Line Result + { w: 300, h: 122, path: get_reserved_sprite("profiles.png") }, +** Processing line: ~ "** 6. Download the mobile provision and save it to 'profiles/development.mobileprovision'.",~ +- Inside source: true +*** True Line Result + "** 6. Download the mobile provision and save it to 'profiles/development.mobileprovision'.", +** Processing line: ~ { w: 200, h: 124, path: get_reserved_sprite("profiles-folder.png") },~ +- Inside source: true +*** True Line Result + { w: 200, h: 124, path: get_reserved_sprite("profiles-folder.png") }, +** 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 provisioning_profile_path environment~ +- Inside source: true +*** True Line Result + def provisioning_profile_path environment +** Processing line: ~ return "profiles/distribution.mobileprovision" if environment == :prod~ +- Inside source: true +*** True Line Result + return "profiles/distribution.mobileprovision" if environment == :prod +** Processing line: ~ return "profiles/development.mobileprovision"~ +- Inside source: true +*** True Line Result + return "profiles/development.mobileprovision" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def determine_team_identifier~ +- Inside source: true +*** True Line Result + def determine_team_identifier +** Processing line: ~ @team_name = (team_identifier_from_provisioning_profile @opts[:env])~ +- Inside source: true +*** True Line Result + @team_name = (team_identifier_from_provisioning_profile @opts[:env]) +** Processing line: ~ log_info "Team Identifer is: #{@team_name}"~ +- Inside source: true +*** True Line Result + log_info "Team Identifer is: #{@team_name}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def determine_app_name~ +- 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]~ +- 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}."~ +- 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: ~ 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? ''~ +- Inside source: true +*** True Line Result + if l.start_with? '' +** Processing line: ~ ''~ +- Inside source: true +*** True Line Result + '' +** 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? ''~ +- Inside source: true +*** True Line Result + elsif l.include? '' +** 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 + 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 + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def app_id_from_provisioning_profile environment~ +- 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]~ +- 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|~ +- 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"~ +- Inside source: true +*** True Line Result + if node[:children] && node[:children][0] && node[:children][0][:data] == "application-identifier" +** Processing line: ~ application_identifier_index = i~ +- Inside source: true +*** True Line Result + application_identifier_index = i +** Processing line: ~ break~ +- Inside source: true +*** True Line Result + break +** 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: ~ app_id_with_team_identifier = (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][application_identifier_index + 1][:children].first[:data]~ +- 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~ +- Inside source: true +*** True Line Result + team_identifer = team_identifier_from_provisioning_profile environment +** Processing line: ~ app_id_with_team_identifier.gsub "#{team_identifer}.", ""~ +- Inside source: true +*** True Line Result + app_id_with_team_identifier.gsub "#{team_identifer}.", "" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def team_identifier_from_provisioning_profile environment~ +- 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]~ +- 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: ~~ +- 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|~ +- 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"~ +- 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~ +- Inside source: true +*** True Line Result + team_identifer_index = i +** Processing line: ~ break~ +- Inside source: true +*** True Line Result + break +** 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: ~ (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][team_identifer_index + 1][:children].first[:data]~ +- Inside source: true +*** True Line Result + (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][team_identifer_index + 1][:children].first[:data] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def determine_app_id~ +- Inside source: true +*** True Line Result + def determine_app_id +** Processing line: ~ @app_id = app_id_from_provisioning_profile @opts[:env]~ +- Inside source: true +*** True Line Result + @app_id = app_id_from_provisioning_profile @opts[:env] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ log_info "App Identifier is set to : #{@app_id}"~ +- Inside source: true +*** True Line Result + log_info "App Identifier is set to : #{@app_id}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_app_name name~ +- Inside source: true +*** True Line Result + def set_app_name name +** Processing line: ~ @app_name = name~ +- Inside source: true +*** True Line Result + @app_name = name +** Processing line: ~ start~ +- Inside source: true +*** True Line Result + start +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_dev_profile path~ +- Inside source: true +*** True Line Result + def set_dev_profile path +** Processing line: ~ if !$gtk.read_file path~ +- Inside source: true +*** True Line Result + if !$gtk.read_file path +** Processing line: ~ log_error "I couldn't find a development profile at #{path}."~ +- Inside source: true +*** True Line Result + log_error "I couldn't find a development profile at #{path}." +** Processing line: ~ ask_for_dev_profile~ +- Inside source: true +*** True Line Result + ask_for_dev_profile +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @provisioning_profile_path = path~ +- Inside source: true +*** True Line Result + @provisioning_profile_path = path +** Processing line: ~ start~ +- Inside source: true +*** True Line Result + start +** 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 blow_away_temp~ +- Inside source: true +*** True Line Result + def blow_away_temp +** Processing line: ~ sh "rm -rf #{tmp_directory}"~ +- Inside source: true +*** True Line Result + sh "rm -rf #{tmp_directory}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def stage_app~ +- Inside source: true +*** True Line Result + def stage_app +** Processing line: ~ log_info "Staging."~ +- Inside source: true +*** True Line Result + log_info "Staging." +** Processing line: ~ sh "mkdir -p #{tmp_directory}"~ +- Inside source: true +*** True Line Result + sh "mkdir -p #{tmp_directory}" +** Processing line: ~ sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""~ +- Inside source: true +*** True Line Result + sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\"" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_app_id id~ +- Inside source: true +*** True Line Result + def set_app_id id +** Processing line: ~ log_info = "App Id set to: #{id}"~ +- Inside source: true +*** True Line Result + log_info = "App Id set to: #{id}" +** Processing line: ~ @app_id = id~ +- Inside source: true +*** True Line Result + @app_id = id +** Processing line: ~ start~ +- Inside source: true +*** True Line Result + start +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def check_for_device~ +- Inside source: true +*** True Line Result + def check_for_device +** Processing line: ~ log_info "Looking for device."~ +- Inside source: true +*** True Line Result + log_info "Looking for device." +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !cli_app_exist?(idevice_id_cli_app)~ +- Inside source: true +*** True Line Result + if !cli_app_exist?(idevice_id_cli_app) +** Processing line: ~ raise WizardException.new(~ +- Inside source: true +*** True Line Result + raise WizardException.new( +** Processing line: ~ "* It doesn't look like you have the libimobiledevice iOS protocol library installed.",~ +- Inside source: true +*** True Line Result + "* It doesn't look like you have the libimobiledevice iOS protocol library installed.", +** Processing line: ~ "** 1. Open Terminal.",~ +- Inside source: true +*** True Line Result + "** 1. Open Terminal.", +** Processing line: ~ { w: 700, h: 99, path: get_reserved_sprite("terminal.png") },~ +- Inside source: true +*** True Line Result + { w: 700, h: 99, path: get_reserved_sprite("terminal.png") }, +** Processing line: ~ "** 2. Run: `brew install libimobiledevice`.",~ +- Inside source: true +*** True Line Result + "** 2. Run: `brew install libimobiledevice`.", +** Processing line: ~ { w: 500, h: 93, path: get_reserved_sprite("brew-install-libimobiledevice.png") },~ +- Inside source: true +*** True Line Result + { w: 500, h: 93, path: get_reserved_sprite("brew-install-libimobiledevice.png") }, +** Processing line: ~ )~ +- Inside source: true +*** True Line Result + ) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if connected_devices.length == 0~ +- Inside source: true +*** True Line Result + if connected_devices.length == 0 +** Processing line: ~ raise WizardException.new("* I couldn't find any connected devices. Connect your iOS device to your Mac and try again.")~ +- Inside source: true +*** True Line Result + raise WizardException.new("* I couldn't find any connected devices. Connect your iOS device to your Mac and try again.") +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @device_id = connected_devices.first~ +- Inside source: true +*** True Line Result + @device_id = connected_devices.first +** Processing line: ~ log_info "I will be using device with UUID #{@device_id}"~ +- Inside source: true +*** True Line Result + log_info "I will be using device with UUID #{@device_id}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def check_for_certs~ +- Inside source: true +*** True Line Result + def check_for_certs +** Processing line: ~ log_info "Attempting to find certificates on your computer."~ +- Inside source: true +*** True Line Result + log_info "Attempting to find certificates on your computer." +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !cli_app_exist?(security_cli_app)~ +- Inside source: true +*** True Line Result + if !cli_app_exist?(security_cli_app) +** Processing line: ~ raise WizardException.new(~ +- Inside source: true +*** True Line Result + raise WizardException.new( +** Processing line: ~ "* It doesn't look like you have #{security_cli_app}.",~ +- Inside source: true +*** True Line Result + "* It doesn't look like you have #{security_cli_app}.", +** Processing line: ~ "** 1. Open Disk Utility and run First Aid.",~ +- Inside source: true +*** True Line Result + "** 1. Open Disk Utility and run First Aid.", +** Processing line: ~ { w: 700, h: 148, path: get_reserved_sprite("disk-utility.png") },~ +- Inside source: true +*** True Line Result + { w: 700, h: 148, path: get_reserved_sprite("disk-utility.png") }, +** Processing line: ~ )~ +- Inside source: true +*** True Line Result + ) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if valid_certs.length == 0~ +- Inside source: true +*** True Line Result + if valid_certs.length == 0 +** Processing line: ~ raise WizardException.new(~ +- Inside source: true +*** True Line Result + raise WizardException.new( +** Processing line: ~ "* It doesn't look like you have any valid certs installed.",~ +- Inside source: true +*** True Line Result + "* It doesn't look like you have any valid certs installed.", +** Processing line: ~ "** 1. Open Xcode.",~ +- Inside source: true +*** True Line Result + "** 1. Open Xcode.", +** Processing line: ~ "** 2. Log into your developer account. Xcode -> Preferences -> Accounts.",~ +- Inside source: true +*** True Line Result + "** 2. Log into your developer account. Xcode -> Preferences -> Accounts.", +** Processing line: ~ { w: 700, h: 98, path: get_reserved_sprite("login-xcode.png") },~ +- Inside source: true +*** True Line Result + { w: 700, h: 98, path: get_reserved_sprite("login-xcode.png") }, +** Processing line: ~ "** 3. After loggin in, select Manage Certificates...",~ +- Inside source: true +*** True Line Result + "** 3. After loggin in, select Manage Certificates...", +** Processing line: ~ { w: 700, h: 115, path: get_reserved_sprite("manage-certificates.png") },~ +- Inside source: true +*** True Line Result + { w: 700, h: 115, path: get_reserved_sprite("manage-certificates.png") }, +** Processing line: ~ "** 4. Add a certificate for Apple Development.",~ +- Inside source: true +*** True Line Result + "** 4. Add a certificate for Apple Development.", +** Processing line: ~ { w: 700, h: 217, path: get_reserved_sprite("add-cert.png") },~ +- Inside source: true +*** True Line Result + { w: 700, h: 217, path: get_reserved_sprite("add-cert.png") }, +** Processing line: ~ )~ +- Inside source: true +*** True Line Result + ) +** Processing line: ~ raise "You do not have any Apple development certs on this computer."~ +- Inside source: true +*** True Line Result + raise "You do not have any Apple development certs on this computer." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if @production_build~ +- Inside source: true +*** True Line Result + if @production_build +** Processing line: ~ @certificate_name = valid_certs.find_all { |f| f[:name].include? "Distribution" }.first[:name]~ +- Inside source: true +*** True Line Result + @certificate_name = valid_certs.find_all { |f| f[:name].include? "Distribution" }.first[:name] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @certificate_name = valid_certs.find_all { |f| f[:name].include? "Development" }.first[:name]~ +- Inside source: true +*** True Line Result + @certificate_name = valid_certs.find_all { |f| f[:name].include? "Development" }.first[:name] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ log_info "I will be using Certificate: '#{@certificate_name}'."~ +- Inside source: true +*** True Line Result + log_info "I will be using Certificate: '#{@certificate_name}'." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def idevice_id_cli_app~ +- Inside source: true +*** True Line Result + def idevice_id_cli_app +** Processing line: ~ "idevice_id"~ +- Inside source: true +*** True Line Result + "idevice_id" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def security_cli_app~ +- Inside source: true +*** True Line Result + def security_cli_app +** Processing line: ~ "/usr/bin/security"~ +- Inside source: true +*** True Line Result + "/usr/bin/security" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def xcodebuild_cli_app~ +- Inside source: true +*** True Line Result + def xcodebuild_cli_app +** Processing line: ~ "xcodebuild"~ +- Inside source: true +*** True Line Result + "xcodebuild" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def valid_certs~ +- Inside source: true +*** True Line Result + def valid_certs +** Processing line: ~ certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l|~ +- Inside source: true +*** True Line Result + certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l| +** Processing line: ~ if l.include?(")") && !l.include?("Developer ID") && (l.include?("Development") || l.include?("Distribution"))~ +- Inside source: true +*** True Line Result + if l.include?(")") && !l.include?("Developer ID") && (l.include?("Development") || l.include?("Distribution")) +** Processing line: ~ l.strip~ +- Inside source: true +*** True Line Result + l.strip +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ nil~ +- Inside source: true +*** True Line Result + nil +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end.reject_nil.map do |l|~ +- Inside source: true +*** True Line Result + end.reject_nil.map do |l| +** Processing line: ~ number, id, name = l.split(' ', 3)~ +- Inside source: true +*** True Line Result + number, id, name = l.split(' ', 3) +** Processing line: ~ name = name.gsub("\"", "") if name~ +- Inside source: true +*** True Line Result + name = name.gsub("\"", "") if name +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ number: 1,~ +- Inside source: true +*** True Line Result + number: 1, +** Processing line: ~ id: id,~ +- Inside source: true +*** True Line Result + id: id, +** Processing line: ~ name: name~ +- Inside source: true +*** True Line Result + name: name +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def connected_devices~ +- Inside source: true +*** True Line Result + def connected_devices +** Processing line: ~ sh("idevice_id -l").strip.each_line.map do |l|~ +- Inside source: true +*** True Line Result + sh("idevice_id -l").strip.each_line.map do |l| +** Processing line: ~ l.strip~ +- Inside source: true +*** True Line Result + l.strip +** Processing line: ~ end.reject { |l| l.length == 0 }~ +- Inside source: true +*** True Line Result + end.reject { |l| l.length == 0 } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def cli_app_exist? app~ +- Inside source: true +*** True Line Result + def cli_app_exist? app +** Processing line: ~ `which #{app}`.strip.length != 0~ +- Inside source: true +*** True Line Result + `which #{app}`.strip.length != 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def write_entitlements_plist~ +- Inside source: true +*** True Line Result + def write_entitlements_plist +** Processing line: ~ if @production_build~ +- Inside source: true +*** True Line Result + if @production_build +** Processing line: ~ entitlement_plist_string = <<-XML~ +- Inside source: true +*** True Line Result + entitlement_plist_string = <<-XML +** 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: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ application-identifier~ +- Inside source: true +*** True Line Result + application-identifier +** Processing line: ~ :app_id~ +- Inside source: true +*** True Line Result + :app_id +** Processing line: ~ beta-reports-active~ +- Inside source: true +*** True Line Result + beta-reports-active +** 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: ~ XML~ +- Inside source: true +*** True Line Result + XML +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ entitlement_plist_string = <<-XML~ +- Inside source: true +*** True Line Result + entitlement_plist_string = <<-XML +** 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: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ application-identifier~ +- Inside source: true +*** True Line Result + application-identifier +** Processing line: ~ :app_id~ +- Inside source: true +*** True Line Result + :app_id +** Processing line: ~ get-task-allow~ +- Inside source: true +*** True Line Result + get-task-allow +** 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: ~ XML~ +- Inside source: true +*** True Line Result + XML +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ log_info "Creating Entitlements.plist"~ +- Inside source: true +*** True Line Result + log_info "Creating Entitlements.plist" +** Processing line: ~~ +- 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~ +- 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 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ sh "/usr/bin/plutil -convert binary1 \"#{tmp_directory}/Entitlements.plist\""~ +- Inside source: true +*** True Line Result + sh "/usr/bin/plutil -convert binary1 \"#{tmp_directory}/Entitlements.plist\"" +** Processing line: ~ sh "/usr/bin/plutil -convert xml1 \"#{tmp_directory}/Entitlements.plist\""~ +- Inside source: true +*** True Line Result + sh "/usr/bin/plutil -convert xml1 \"#{tmp_directory}/Entitlements.plist\"" +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @entitlement_plist_written = true~ +- Inside source: true +*** True Line Result + @entitlement_plist_written = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def code_sign_payload~ +- Inside source: true +*** True Line Result + def code_sign_payload +** Processing line: ~ log_info "Signing app with #{@certificate_name}."~ +- Inside source: true +*** True Line Result + log_info "Signing app with #{@certificate_name}." +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** 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}/ipa_root/Payload/#{@app_name}.app\""~ +- Inside source: true +*** True Line Result + 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}/ipa_root/Payload/#{@app_name}.app\"" +** 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}/ipa_root/Payload/#{@app_name}.app/Runtime\""~ +- Inside source: true +*** True Line Result + 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}/ipa_root/Payload/#{@app_name}.app/Runtime\"" +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @code_sign_completed = true~ +- Inside source: true +*** True Line Result + @code_sign_completed = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def write_info_plist_distribution~ +- Inside source: true +*** True Line Result + def write_info_plist_distribution +** Processing line: ~ log_info "Adding Info.plist."~ +- Inside source: true +*** True Line Result + log_info "Adding Info.plist." +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ <<-XML~ +- Inside source: true +*** True Line Result + <<-XML +** 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: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ BuildMachineOSBuild~ +- Inside source: true +*** True Line Result + BuildMachineOSBuild +** Processing line: ~ 20D91~ +- Inside source: true +*** True Line Result + 20D91 +** Processing line: ~ CFBundleDevelopmentRegion~ +- Inside source: true +*** True Line Result + CFBundleDevelopmentRegion +** Processing line: ~ en~ +- Inside source: true +*** True Line Result + en +** Processing line: ~ CFBundleName~ +- Inside source: true +*** True Line Result + CFBundleName +** Processing line: ~ :app_name~ +- Inside source: true +*** True Line Result + :app_name +** Processing line: ~ CFBundleDisplayName~ +- Inside source: true +*** True Line Result + CFBundleDisplayName +** Processing line: ~ A Dark Room~ +- Inside source: true +*** True Line Result + A Dark Room +** Processing line: ~ CFBundleIdentifier~ +- Inside source: true +*** True Line Result + CFBundleIdentifier +** Processing line: ~ :app_id~ +- Inside source: true +*** True Line Result + :app_id +** Processing line: ~ CFBundleExecutable~ +- Inside source: true +*** True Line Result + CFBundleExecutable +** Processing line: ~ :app_name~ +- Inside source: true +*** True Line Result + :app_name +** Processing line: ~ CFBundleInfoDictionaryVersion~ +- Inside source: true +*** True Line Result + CFBundleInfoDictionaryVersion +** Processing line: ~ 6.0~ +- Inside source: true +*** True Line Result + 6.0 +** Processing line: ~ CFBundlePackageType~ +- Inside source: true +*** True Line Result + CFBundlePackageType +** Processing line: ~ APPL~ +- Inside source: true +*** True Line Result + APPL +** Processing line: ~ CFBundleShortVersionString~ +- Inside source: true +*** True Line Result + CFBundleShortVersionString +** Processing line: ~ 5.6~ +- Inside source: true +*** True Line Result + 5.6 +** Processing line: ~ CFBundleSignature~ +- Inside source: true +*** True Line Result + CFBundleSignature +** Processing line: ~ ????~ +- Inside source: true +*** True Line Result + ???? +** Processing line: ~ CFBundleVersion~ +- Inside source: true +*** True Line Result + CFBundleVersion +** Processing line: ~ 5.6~ +- Inside source: true +*** True Line Result + 5.6 +** Processing line: ~ CFBundleIcons~ +- Inside source: true +*** True Line Result + CFBundleIcons +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundlePrimaryIcon~ +- Inside source: true +*** True Line Result + CFBundlePrimaryIcon +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIconName~ +- Inside source: true +*** True Line Result + CFBundleIconName +** Processing line: ~ AppIcon~ +- Inside source: true +*** True Line Result + AppIcon +** Processing line: ~ CFBundleIconFiles~ +- Inside source: true +*** True Line Result + CFBundleIconFiles +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ AppIcon60x60~ +- Inside source: true +*** True Line Result + AppIcon60x60 +** 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: ~ CFBundleIcons~ipad~ +- Inside source: true +*** True Line Result + CFBundleIcons~ipad +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundlePrimaryIcon~ +- Inside source: true +*** True Line Result + CFBundlePrimaryIcon +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIconName~ +- Inside source: true +*** True Line Result + CFBundleIconName +** Processing line: ~ AppIcon~ +- Inside source: true +*** True Line Result + AppIcon +** Processing line: ~ CFBundleIconFiles~ +- Inside source: true +*** True Line Result + CFBundleIconFiles +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ AppIcon60x60~ +- Inside source: true +*** True Line Result + AppIcon60x60 +** Processing line: ~ AppIcon76x76~ +- Inside source: true +*** True Line Result + AppIcon76x76 +** Processing line: ~ AppIcon83.5x83.5~ +- Inside source: true +*** True Line Result + AppIcon83.5x83.5 +** 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: ~ UILaunchStoryboardName~ +- Inside source: true +*** True Line Result + UILaunchStoryboardName +** Processing line: ~ SimpleSplash~ +- Inside source: true +*** True Line Result + SimpleSplash +** Processing line: ~ UIRequiresFullScreen~ +- Inside source: true +*** True Line Result + UIRequiresFullScreen +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ITSAppUsesNonExemptEncryption~ +- Inside source: true +*** True Line Result + ITSAppUsesNonExemptEncryption +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIRequiredDeviceCapabilities~ +- Inside source: true +*** True Line Result + UIRequiredDeviceCapabilities +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ arm64~ +- Inside source: true +*** True Line Result + arm64 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ MinimumOSVersion~ +- Inside source: true +*** True Line Result + MinimumOSVersion +** Processing line: ~ 10.3~ +- Inside source: true +*** True Line Result + 10.3 +** Processing line: ~ CFBundleSupportedPlatforms~ +- Inside source: true +*** True Line Result + CFBundleSupportedPlatforms +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ iPhoneOS~ +- Inside source: true +*** True Line Result + iPhoneOS +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIconFiles~ +- Inside source: true +*** True Line Result + CFBundleIconFiles +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ AppIcon20x20~ +- Inside source: true +*** True Line Result + AppIcon20x20 +** Processing line: ~ AppIcon29x29~ +- Inside source: true +*** True Line Result + AppIcon29x29 +** Processing line: ~ AppIcon40x40~ +- Inside source: true +*** True Line Result + AppIcon40x40 +** Processing line: ~ AppIcon60x60~ +- Inside source: true +*** True Line Result + AppIcon60x60 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIDeviceFamily~ +- Inside source: true +*** True Line Result + UIDeviceFamily +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ 1~ +- Inside source: true +*** True Line Result + 1 +** Processing line: ~ 2~ +- Inside source: true +*** True Line Result + 2 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UISupportedInterfaceOrientations~ +- Inside source: true +*** True Line Result + UISupportedInterfaceOrientations +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIInterfaceOrientationPortrait~ +- Inside source: true +*** True Line Result + UIInterfaceOrientationPortrait +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIStatusBarStyle~ +- Inside source: true +*** True Line Result + UIStatusBarStyle +** Processing line: ~ UIStatusBarStyleDefault~ +- Inside source: true +*** True Line Result + UIStatusBarStyleDefault +** Processing line: ~ UIBackgroundModes~ +- Inside source: true +*** True Line Result + UIBackgroundModes +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ DTXcode~ +- Inside source: true +*** True Line Result + DTXcode +** Processing line: ~ 0124~ +- Inside source: true +*** True Line Result + 0124 +** Processing line: ~ DTXcodeBuild~ +- Inside source: true +*** True Line Result + DTXcodeBuild +** Processing line: ~ 12D4e~ +- Inside source: true +*** True Line Result + 12D4e +** Processing line: ~ DTSDKName~ +- Inside source: true +*** True Line Result + DTSDKName +** Processing line: ~ iphoneos14.4~ +- Inside source: true +*** True Line Result + iphoneos14.4 +** Processing line: ~ DTSDKBuild~ +- Inside source: true +*** True Line Result + DTSDKBuild +** Processing line: ~ 18D46~ +- Inside source: true +*** True Line Result + 18D46 +** Processing line: ~ DTPlatformName~ +- Inside source: true +*** True Line Result + DTPlatformName +** Processing line: ~ iphoneos~ +- Inside source: true +*** True Line Result + iphoneos +** Processing line: ~ DTCompiler~ +- Inside source: true +*** True Line Result + DTCompiler +** Processing line: ~ com.apple.compilers.llvm.clang.1_0~ +- Inside source: true +*** True Line Result + com.apple.compilers.llvm.clang.1_0 +** Processing line: ~ DTPlatformVersion~ +- Inside source: true +*** True Line Result + DTPlatformVersion +** Processing line: ~ 14.4~ +- Inside source: true +*** True Line Result + 14.4 +** Processing line: ~ DTPlatformBuild~ +- Inside source: true +*** True Line Result + DTPlatformBuild +** Processing line: ~ 18D46~ +- Inside source: true +*** True Line Result + 18D46 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ XML~ +- Inside source: true +*** True Line Result + XML +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def development_write_info_plist~ +- Inside source: true +*** True Line Result + def development_write_info_plist +** Processing line: ~ log_info "Adding Info.plist."~ +- Inside source: true +*** True Line Result + log_info "Adding Info.plist." +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ info_plist_string = <<-XML~ +- Inside source: true +*** True Line Result + info_plist_string = <<-XML +** 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: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ NSAppTransportSecurity~ +- Inside source: true +*** True Line Result + NSAppTransportSecurity +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ NSAllowsArbitraryLoads~ +- Inside source: true +*** True Line Result + NSAllowsArbitraryLoads +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ NSExceptionDomains~ +- Inside source: true +*** True Line Result + NSExceptionDomains +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ google.com~ +- Inside source: true +*** True Line Result + google.com +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ NSExceptionAllowsInsecureHTTPLoads~ +- Inside source: true +*** True Line Result + NSExceptionAllowsInsecureHTTPLoads +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ NSIncludesSubdomains~ +- Inside source: true +*** True Line Result + NSIncludesSubdomains +** 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: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ BuildMachineOSBuild~ +- Inside source: true +*** True Line Result + BuildMachineOSBuild +** Processing line: ~ 20D91~ +- Inside source: true +*** True Line Result + 20D91 +** Processing line: ~ CFBundleDevelopmentRegion~ +- Inside source: true +*** True Line Result + CFBundleDevelopmentRegion +** Processing line: ~ en~ +- Inside source: true +*** True Line Result + en +** Processing line: ~ CFBundleDisplayName~ +- Inside source: true +*** True Line Result + CFBundleDisplayName +** Processing line: ~ :app_name~ +- Inside source: true +*** True Line Result + :app_name +** Processing line: ~ CFBundleExecutable~ +- Inside source: true +*** True Line Result + CFBundleExecutable +** Processing line: ~ Runtime~ +- Inside source: true +*** True Line Result + Runtime +** Processing line: ~ CFBundleIconFiles~ +- Inside source: true +*** True Line Result + CFBundleIconFiles +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ AppIcon60x60~ +- Inside source: true +*** True Line Result + AppIcon60x60 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIcons~ +- Inside source: true +*** True Line Result + CFBundleIcons +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundlePrimaryIcon~ +- Inside source: true +*** True Line Result + CFBundlePrimaryIcon +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIconFiles~ +- Inside source: true +*** True Line Result + CFBundleIconFiles +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ AppIcon60x60~ +- Inside source: true +*** True Line Result + AppIcon60x60 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIconName~ +- Inside source: true +*** True Line Result + CFBundleIconName +** Processing line: ~ AppIcon~ +- Inside source: true +*** True Line Result + AppIcon +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIcons~ipad~ +- Inside source: true +*** True Line Result + CFBundleIcons~ipad +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundlePrimaryIcon~ +- Inside source: true +*** True Line Result + CFBundlePrimaryIcon +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIconFiles~ +- Inside source: true +*** True Line Result + CFBundleIconFiles +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ AppIcon60x60~ +- Inside source: true +*** True Line Result + AppIcon60x60 +** Processing line: ~ AppIcon76x76~ +- Inside source: true +*** True Line Result + AppIcon76x76 +** Processing line: ~ AppIcon83.5x83.5~ +- Inside source: true +*** True Line Result + AppIcon83.5x83.5 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIconName~ +- Inside source: true +*** True Line Result + CFBundleIconName +** Processing line: ~ AppIcon~ +- Inside source: true +*** True Line Result + AppIcon +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIdentifier~ +- Inside source: true +*** True Line Result + CFBundleIdentifier +** Processing line: ~ :app_id~ +- Inside source: true +*** True Line Result + :app_id +** Processing line: ~ CFBundleInfoDictionaryVersion~ +- Inside source: true +*** True Line Result + CFBundleInfoDictionaryVersion +** Processing line: ~ 6.0~ +- Inside source: true +*** True Line Result + 6.0 +** Processing line: ~ CFBundleName~ +- Inside source: true +*** True Line Result + CFBundleName +** Processing line: ~ :app_name~ +- Inside source: true +*** True Line Result + :app_name +** Processing line: ~ CFBundlePackageType~ +- Inside source: true +*** True Line Result + CFBundlePackageType +** Processing line: ~ APPL~ +- Inside source: true +*** True Line Result + APPL +** Processing line: ~ CFBundleShortVersionString~ +- Inside source: true +*** True Line Result + CFBundleShortVersionString +** Processing line: ~ 5.2~ +- Inside source: true +*** True Line Result + 5.2 +** Processing line: ~ CFBundleSignature~ +- Inside source: true +*** True Line Result + CFBundleSignature +** Processing line: ~ ????~ +- Inside source: true +*** True Line Result + ???? +** Processing line: ~ CFBundleSupportedPlatforms~ +- Inside source: true +*** True Line Result + CFBundleSupportedPlatforms +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ iPhoneOS~ +- Inside source: true +*** True Line Result + iPhoneOS +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleVersion~ +- Inside source: true +*** True Line Result + CFBundleVersion +** Processing line: ~ 5.2~ +- Inside source: true +*** True Line Result + 5.2 +** Processing line: ~ DTCompiler~ +- Inside source: true +*** True Line Result + DTCompiler +** Processing line: ~ com.apple.compilers.llvm.clang.1_0~ +- Inside source: true +*** True Line Result + com.apple.compilers.llvm.clang.1_0 +** Processing line: ~ DTPlatformBuild~ +- Inside source: true +*** True Line Result + DTPlatformBuild +** Processing line: ~ 18D46~ +- Inside source: true +*** True Line Result + 18D46 +** Processing line: ~ DTPlatformName~ +- Inside source: true +*** True Line Result + DTPlatformName +** Processing line: ~ iphoneos~ +- Inside source: true +*** True Line Result + iphoneos +** Processing line: ~ DTPlatformVersion~ +- Inside source: true +*** True Line Result + DTPlatformVersion +** Processing line: ~ 14.4~ +- Inside source: true +*** True Line Result + 14.4 +** Processing line: ~ DTSDKBuild~ +- Inside source: true +*** True Line Result + DTSDKBuild +** Processing line: ~ 18D46~ +- Inside source: true +*** True Line Result + 18D46 +** Processing line: ~ DTSDKName~ +- Inside source: true +*** True Line Result + DTSDKName +** Processing line: ~ iphoneos14.4~ +- Inside source: true +*** True Line Result + iphoneos14.4 +** Processing line: ~ DTXcode~ +- Inside source: true +*** True Line Result + DTXcode +** Processing line: ~ 0124~ +- Inside source: true +*** True Line Result + 0124 +** Processing line: ~ DTXcodeBuild~ +- Inside source: true +*** True Line Result + DTXcodeBuild +** Processing line: ~ 12D4e~ +- Inside source: true +*** True Line Result + 12D4e +** Processing line: ~ MinimumOSVersion~ +- Inside source: true +*** True Line Result + MinimumOSVersion +** Processing line: ~ 14.4~ +- Inside source: true +*** True Line Result + 14.4 +** Processing line: ~ UIAppFonts~ +- Inside source: true +*** True Line Result + UIAppFonts +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIBackgroundModes~ +- Inside source: true +*** True Line Result + UIBackgroundModes +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIDeviceFamily~ +- Inside source: true +*** True Line Result + UIDeviceFamily +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ 1~ +- Inside source: true +*** True Line Result + 1 +** Processing line: ~ 2~ +- Inside source: true +*** True Line Result + 2 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UILaunchImages~ +- Inside source: true +*** True Line Result + UILaunchImages +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UILaunchImageMinimumOSVersion~ +- Inside source: true +*** True Line Result + UILaunchImageMinimumOSVersion +** Processing line: ~ 7.0~ +- Inside source: true +*** True Line Result + 7.0 +** Processing line: ~ UILaunchImageName~ +- Inside source: true +*** True Line Result + UILaunchImageName +** Processing line: ~ Default-568h@2x~ +- Inside source: true +*** True Line Result + Default-568h@2x +** Processing line: ~ UILaunchImageOrientation~ +- Inside source: true +*** True Line Result + UILaunchImageOrientation +** Processing line: ~ Portrait~ +- Inside source: true +*** True Line Result + Portrait +** Processing line: ~ UILaunchImageSize~ +- Inside source: true +*** True Line Result + UILaunchImageSize +** Processing line: ~ {320, 568}~ +- Inside source: true +*** True Line Result + {320, 568} +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UILaunchImageMinimumOSVersion~ +- Inside source: true +*** True Line Result + UILaunchImageMinimumOSVersion +** Processing line: ~ 7.0~ +- Inside source: true +*** True Line Result + 7.0 +** Processing line: ~ UILaunchImageName~ +- Inside source: true +*** True Line Result + UILaunchImageName +** Processing line: ~ Default-667h@2x~ +- Inside source: true +*** True Line Result + Default-667h@2x +** Processing line: ~ UILaunchImageOrientation~ +- Inside source: true +*** True Line Result + UILaunchImageOrientation +** Processing line: ~ Portrait~ +- Inside source: true +*** True Line Result + Portrait +** Processing line: ~ UILaunchImageSize~ +- Inside source: true +*** True Line Result + UILaunchImageSize +** Processing line: ~ {375, 667}~ +- Inside source: true +*** True Line Result + {375, 667} +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UILaunchImageMinimumOSVersion~ +- Inside source: true +*** True Line Result + UILaunchImageMinimumOSVersion +** Processing line: ~ 7.0~ +- Inside source: true +*** True Line Result + 7.0 +** Processing line: ~ UILaunchImageName~ +- Inside source: true +*** True Line Result + UILaunchImageName +** Processing line: ~ Default-736h@3x~ +- Inside source: true +*** True Line Result + Default-736h@3x +** Processing line: ~ UILaunchImageOrientation~ +- Inside source: true +*** True Line Result + UILaunchImageOrientation +** Processing line: ~ Portrait~ +- Inside source: true +*** True Line Result + Portrait +** Processing line: ~ UILaunchImageSize~ +- Inside source: true +*** True Line Result + UILaunchImageSize +** Processing line: ~ {414, 736}~ +- Inside source: true +*** True Line Result + {414, 736} +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UILaunchStoryboardName~ +- Inside source: true +*** True Line Result + UILaunchStoryboardName +** Processing line: ~ SimpleSplash~ +- Inside source: true +*** True Line Result + SimpleSplash +** Processing line: ~ UIRequiredDeviceCapabilities~ +- Inside source: true +*** True Line Result + UIRequiredDeviceCapabilities +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ arm64~ +- Inside source: true +*** True Line Result + arm64 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIRequiresFullScreen~ +- Inside source: true +*** True Line Result + UIRequiresFullScreen +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIStatusBarStyle~ +- Inside source: true +*** True Line Result + UIStatusBarStyle +** Processing line: ~ UIStatusBarStyleDefault~ +- Inside source: true +*** True Line Result + UIStatusBarStyleDefault +** Processing line: ~ UISupportedInterfaceOrientations~ +- Inside source: true +*** True Line Result + UISupportedInterfaceOrientations +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIInterfaceOrientationLandscapeRight~ +- Inside source: true +*** True Line Result + UIInterfaceOrientationLandscapeRight +** 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: ~ XML~ +- Inside source: true +*** True Line Result + XML +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # UIInterfaceOrientationPortrait~ +- Inside source: true +*** True Line Result + # UIInterfaceOrientationPortrait +** Processing line: ~ # UIInterfaceOrientationLandscapeRight~ +- Inside source: true +*** True Line Result + # UIInterfaceOrientationLandscapeRight +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ info_plist_string.gsub!(":app_name", @app_name)~ +- Inside source: true +*** True Line Result + info_plist_string.gsub!(":app_name", @app_name) +** Processing line: ~ info_plist_string.gsub!(":app_id", @app_id)~ +- Inside source: true +*** True Line Result + info_plist_string.gsub!(":app_id", @app_id) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip~ +- Inside source: true +*** True Line Result + $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @info_plist_written = true~ +- Inside source: true +*** True Line Result + @info_plist_written = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def production_write_info_plist~ +- Inside source: true +*** True Line Result + def production_write_info_plist +** Processing line: ~ log_info "Adding Info.plist."~ +- Inside source: true +*** True Line Result + log_info "Adding Info.plist." +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ info_plist_string = <<-XML~ +- Inside source: true +*** True Line Result + info_plist_string = <<-XML +** 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: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ BuildMachineOSBuild~ +- Inside source: true +*** True Line Result + BuildMachineOSBuild +** Processing line: ~ 20D91~ +- Inside source: true +*** True Line Result + 20D91 +** Processing line: ~ CFBundleDevelopmentRegion~ +- Inside source: true +*** True Line Result + CFBundleDevelopmentRegion +** Processing line: ~ en~ +- Inside source: true +*** True Line Result + en +** Processing line: ~ CFBundleDisplayName~ +- Inside source: true +*** True Line Result + CFBundleDisplayName +** Processing line: ~ :app_name~ +- Inside source: true +*** True Line Result + :app_name +** Processing line: ~ CFBundleExecutable~ +- Inside source: true +*** True Line Result + CFBundleExecutable +** Processing line: ~ Runtime~ +- Inside source: true +*** True Line Result + Runtime +** Processing line: ~ CFBundleIconFiles~ +- Inside source: true +*** True Line Result + CFBundleIconFiles +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ AppIcon60x60~ +- Inside source: true +*** True Line Result + AppIcon60x60 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIcons~ +- Inside source: true +*** True Line Result + CFBundleIcons +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundlePrimaryIcon~ +- Inside source: true +*** True Line Result + CFBundlePrimaryIcon +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIconFiles~ +- Inside source: true +*** True Line Result + CFBundleIconFiles +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ AppIcon60x60~ +- Inside source: true +*** True Line Result + AppIcon60x60 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIconName~ +- Inside source: true +*** True Line Result + CFBundleIconName +** Processing line: ~ AppIcon~ +- Inside source: true +*** True Line Result + AppIcon +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIcons~ipad~ +- Inside source: true +*** True Line Result + CFBundleIcons~ipad +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundlePrimaryIcon~ +- Inside source: true +*** True Line Result + CFBundlePrimaryIcon +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIconFiles~ +- Inside source: true +*** True Line Result + CFBundleIconFiles +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ AppIcon60x60~ +- Inside source: true +*** True Line Result + AppIcon60x60 +** Processing line: ~ AppIcon76x76~ +- Inside source: true +*** True Line Result + AppIcon76x76 +** Processing line: ~ AppIcon83.5x83.5~ +- Inside source: true +*** True Line Result + AppIcon83.5x83.5 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIconName~ +- Inside source: true +*** True Line Result + CFBundleIconName +** Processing line: ~ AppIcon~ +- Inside source: true +*** True Line Result + AppIcon +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleIdentifier~ +- Inside source: true +*** True Line Result + CFBundleIdentifier +** Processing line: ~ :app_id~ +- Inside source: true +*** True Line Result + :app_id +** Processing line: ~ CFBundleInfoDictionaryVersion~ +- Inside source: true +*** True Line Result + CFBundleInfoDictionaryVersion +** Processing line: ~ 6.0~ +- Inside source: true +*** True Line Result + 6.0 +** Processing line: ~ CFBundleName~ +- Inside source: true +*** True Line Result + CFBundleName +** Processing line: ~ :app_name~ +- Inside source: true +*** True Line Result + :app_name +** Processing line: ~ CFBundlePackageType~ +- Inside source: true +*** True Line Result + CFBundlePackageType +** Processing line: ~ APPL~ +- Inside source: true +*** True Line Result + APPL +** Processing line: ~ CFBundleShortVersionString~ +- Inside source: true +*** True Line Result + CFBundleShortVersionString +** Processing line: ~ 5.2~ +- Inside source: true +*** True Line Result + 5.2 +** Processing line: ~ CFBundleSignature~ +- Inside source: true +*** True Line Result + CFBundleSignature +** Processing line: ~ ????~ +- Inside source: true +*** True Line Result + ???? +** Processing line: ~ CFBundleSupportedPlatforms~ +- Inside source: true +*** True Line Result + CFBundleSupportedPlatforms +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ iPhoneOS~ +- Inside source: true +*** True Line Result + iPhoneOS +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ CFBundleVersion~ +- Inside source: true +*** True Line Result + CFBundleVersion +** Processing line: ~ 5.2~ +- Inside source: true +*** True Line Result + 5.2 +** Processing line: ~ DTCompiler~ +- Inside source: true +*** True Line Result + DTCompiler +** Processing line: ~ com.apple.compilers.llvm.clang.1_0~ +- Inside source: true +*** True Line Result + com.apple.compilers.llvm.clang.1_0 +** Processing line: ~ DTPlatformBuild~ +- Inside source: true +*** True Line Result + DTPlatformBuild +** Processing line: ~ 18D46~ +- Inside source: true +*** True Line Result + 18D46 +** Processing line: ~ DTPlatformName~ +- Inside source: true +*** True Line Result + DTPlatformName +** Processing line: ~ iphoneos~ +- Inside source: true +*** True Line Result + iphoneos +** Processing line: ~ DTPlatformVersion~ +- Inside source: true +*** True Line Result + DTPlatformVersion +** Processing line: ~ 14.4~ +- Inside source: true +*** True Line Result + 14.4 +** Processing line: ~ DTSDKBuild~ +- Inside source: true +*** True Line Result + DTSDKBuild +** Processing line: ~ 18D46~ +- Inside source: true +*** True Line Result + 18D46 +** Processing line: ~ DTSDKName~ +- Inside source: true +*** True Line Result + DTSDKName +** Processing line: ~ iphoneos14.4~ +- Inside source: true +*** True Line Result + iphoneos14.4 +** Processing line: ~ DTXcode~ +- Inside source: true +*** True Line Result + DTXcode +** Processing line: ~ 0124~ +- Inside source: true +*** True Line Result + 0124 +** Processing line: ~ DTXcodeBuild~ +- Inside source: true +*** True Line Result + DTXcodeBuild +** Processing line: ~ 12D4e~ +- Inside source: true +*** True Line Result + 12D4e +** Processing line: ~ MinimumOSVersion~ +- Inside source: true +*** True Line Result + MinimumOSVersion +** Processing line: ~ 14.4~ +- Inside source: true +*** True Line Result + 14.4 +** Processing line: ~ UIAppFonts~ +- Inside source: true +*** True Line Result + UIAppFonts +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIBackgroundModes~ +- Inside source: true +*** True Line Result + UIBackgroundModes +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIDeviceFamily~ +- Inside source: true +*** True Line Result + UIDeviceFamily +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ 1~ +- Inside source: true +*** True Line Result + 1 +** Processing line: ~ 2~ +- Inside source: true +*** True Line Result + 2 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UILaunchImages~ +- Inside source: true +*** True Line Result + UILaunchImages +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UILaunchImageMinimumOSVersion~ +- Inside source: true +*** True Line Result + UILaunchImageMinimumOSVersion +** Processing line: ~ 7.0~ +- Inside source: true +*** True Line Result + 7.0 +** Processing line: ~ UILaunchImageName~ +- Inside source: true +*** True Line Result + UILaunchImageName +** Processing line: ~ Default-568h@2x~ +- Inside source: true +*** True Line Result + Default-568h@2x +** Processing line: ~ UILaunchImageOrientation~ +- Inside source: true +*** True Line Result + UILaunchImageOrientation +** Processing line: ~ Portrait~ +- Inside source: true +*** True Line Result + Portrait +** Processing line: ~ UILaunchImageSize~ +- Inside source: true +*** True Line Result + UILaunchImageSize +** Processing line: ~ {320, 568}~ +- Inside source: true +*** True Line Result + {320, 568} +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UILaunchImageMinimumOSVersion~ +- Inside source: true +*** True Line Result + UILaunchImageMinimumOSVersion +** Processing line: ~ 7.0~ +- Inside source: true +*** True Line Result + 7.0 +** Processing line: ~ UILaunchImageName~ +- Inside source: true +*** True Line Result + UILaunchImageName +** Processing line: ~ Default-667h@2x~ +- Inside source: true +*** True Line Result + Default-667h@2x +** Processing line: ~ UILaunchImageOrientation~ +- Inside source: true +*** True Line Result + UILaunchImageOrientation +** Processing line: ~ Portrait~ +- Inside source: true +*** True Line Result + Portrait +** Processing line: ~ UILaunchImageSize~ +- Inside source: true +*** True Line Result + UILaunchImageSize +** Processing line: ~ {375, 667}~ +- Inside source: true +*** True Line Result + {375, 667} +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UILaunchImageMinimumOSVersion~ +- Inside source: true +*** True Line Result + UILaunchImageMinimumOSVersion +** Processing line: ~ 7.0~ +- Inside source: true +*** True Line Result + 7.0 +** Processing line: ~ UILaunchImageName~ +- Inside source: true +*** True Line Result + UILaunchImageName +** Processing line: ~ Default-736h@3x~ +- Inside source: true +*** True Line Result + Default-736h@3x +** Processing line: ~ UILaunchImageOrientation~ +- Inside source: true +*** True Line Result + UILaunchImageOrientation +** Processing line: ~ Portrait~ +- Inside source: true +*** True Line Result + Portrait +** Processing line: ~ UILaunchImageSize~ +- Inside source: true +*** True Line Result + UILaunchImageSize +** Processing line: ~ {414, 736}~ +- Inside source: true +*** True Line Result + {414, 736} +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UILaunchStoryboardName~ +- Inside source: true +*** True Line Result + UILaunchStoryboardName +** Processing line: ~ SimpleSplash~ +- Inside source: true +*** True Line Result + SimpleSplash +** Processing line: ~ UIRequiredDeviceCapabilities~ +- Inside source: true +*** True Line Result + UIRequiredDeviceCapabilities +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ arm64~ +- Inside source: true +*** True Line Result + arm64 +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIRequiresFullScreen~ +- Inside source: true +*** True Line Result + UIRequiresFullScreen +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIStatusBarStyle~ +- Inside source: true +*** True Line Result + UIStatusBarStyle +** Processing line: ~ UIStatusBarStyleDefault~ +- Inside source: true +*** True Line Result + UIStatusBarStyleDefault +** Processing line: ~ UISupportedInterfaceOrientations~ +- Inside source: true +*** True Line Result + UISupportedInterfaceOrientations +** Processing line: ~ ~ +- Inside source: true +*** True Line Result + +** Processing line: ~ UIInterfaceOrientationLandscapeRight~ +- Inside source: true +*** True Line Result + UIInterfaceOrientationLandscapeRight +** 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: ~ XML~ +- Inside source: true +*** True Line Result + XML +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # UIInterfaceOrientationPortrait~ +- Inside source: true +*** True Line Result + # UIInterfaceOrientationPortrait +** Processing line: ~ # UIInterfaceOrientationLandscapeRight~ +- Inside source: true +*** True Line Result + # UIInterfaceOrientationLandscapeRight +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ info_plist_string.gsub!(":app_name", @app_name)~ +- Inside source: true +*** True Line Result + info_plist_string.gsub!(":app_name", @app_name) +** Processing line: ~ info_plist_string.gsub!(":app_id", @app_id)~ +- Inside source: true +*** True Line Result + info_plist_string.gsub!(":app_id", @app_id) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip~ +- Inside source: true +*** True Line Result + $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @info_plist_written = true~ +- Inside source: true +*** True Line Result + @info_plist_written = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def device_orientation_xml~ +- Inside source: true +*** True Line Result + def device_orientation_xml +** Processing line: ~ return "UIInterfaceOrientationLandscapeRight" if $gtk.logical_width > $gtk.logical_height~ +- Inside source: true +*** True Line Result + return "UIInterfaceOrientationLandscapeRight" if $gtk.logical_width > $gtk.logical_height +** Processing line: ~ return "UIInterfaceOrientationPortrait"~ +- Inside source: true +*** True Line Result + return "UIInterfaceOrientationPortrait" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tmp_directory~ +- Inside source: true +*** True Line Result + def tmp_directory +** Processing line: ~ "#{relative_path}/tmp/ios"~ +- Inside source: true +*** True Line Result + "#{relative_path}/tmp/ios" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def app_path~ +- Inside source: true +*** True Line Result + def app_path +** Processing line: ~ "#{tmp_directory}/#{@app_name}.app"~ +- Inside source: true +*** True Line Result + "#{tmp_directory}/#{@app_name}.app" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def root_folder~ +- Inside source: true +*** True Line Result + def root_folder +** Processing line: ~ "#{relative_path}/#{$gtk.cli_arguments[:dragonruby]}"~ +- Inside source: true +*** True Line Result + "#{relative_path}/#{$gtk.cli_arguments[:dragonruby]}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def write_ip_address~ +- 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~ +- Inside source: true +*** True Line Result + $gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def create_payload_directory~ +- Inside source: true +*** True Line Result + def create_payload_directory +** Processing line: ~ sh "cp #{@provisioning_profile_path} \"#{app_path}/embedded.mobileprovision\""~ +- 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\""~ +- Inside source: true +*** True Line Result + sh "/usr/bin/plutil -convert binary1 \"#{app_path}/Info.plist\"" +** Processing line: ~ write_ip_address~ +- Inside source: true +*** True Line Result + write_ip_address +** Processing line: ~ sh "rm \"#{@app_name}\".ipa"~ +- Inside source: true +*** True Line Result + sh "rm \"#{@app_name}\".ipa" +** Processing line: ~ sh "rm -rf \"#{app_path}/app\""~ +- Inside source: true +*** True Line Result + sh "rm -rf \"#{app_path}/app\"" +** Processing line: ~ sh "rm -rf \"#{app_path}/sounds\""~ +- Inside source: true +*** True Line Result + sh "rm -rf \"#{app_path}/sounds\"" +** Processing line: ~ sh "rm -rf \"#{app_path}/sprites\""~ +- Inside source: true +*** True Line Result + sh "rm -rf \"#{app_path}/sprites\"" +** Processing line: ~ sh "rm -rf \"#{app_path}/data\""~ +- Inside source: true +*** True Line Result + sh "rm -rf \"#{app_path}/data\"" +** Processing line: ~ sh "rm -rf \"#{app_path}/fonts\""~ +- Inside source: true +*** True Line Result + sh "rm -rf \"#{app_path}/fonts\"" +** Processing line: ~ sh "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/\""~ +- 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/\""~ +- 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/\""~ +- 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/\""~ +- 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"~ +- 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\""~ +- 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\""~ +- Inside source: true +*** True Line Result + sh "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_ipa~ +- Inside source: true +*** True Line Result + def create_ipa +** Processing line: ~ do_zip~ +- Inside source: true +*** True Line Result + do_zip +** Processing line: ~ sh "cp \"#{tmp_directory}/ipa_root/archive.zip\" \"#{tmp_directory}/#{@app_name}.ipa\""~ +- Inside source: true +*** True Line Result + sh "cp \"#{tmp_directory}/ipa_root/archive.zip\" \"#{tmp_directory}/#{@app_name}.ipa\"" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def do_zip~ +- Inside source: true +*** True Line Result + def do_zip +** Processing line: ~ $gtk.write_file_root "tmp/ios/do_zip.sh", <<-SCRIPT~ +- Inside source: true +*** True Line Result + $gtk.write_file_root "tmp/ios/do_zip.sh", <<-SCRIPT +** Processing line: ~ pushd #{tmp_directory}/ipa_root/~ +- Inside source: true +*** True Line Result + pushd #{tmp_directory}/ipa_root/ +** Processing line: ~ zip -q -r archive.zip Payload~ +- Inside source: true +*** True Line Result + zip -q -r archive.zip Payload +** Processing line: ~ popd~ +- Inside source: true +*** True Line Result + popd +** Processing line: ~ SCRIPT~ +- Inside source: true +*** True Line Result + SCRIPT +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ sh "sh #{tmp_directory}/do_zip.sh"~ +- Inside source: true +*** True Line Result + sh "sh #{tmp_directory}/do_zip.sh" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def sh cmd~ +- Inside source: true +*** True Line Result + def sh cmd +** Processing line: ~ log_info cmd.strip~ +- Inside source: true +*** True Line Result + log_info cmd.strip +** Processing line: ~ result = `#{cmd}`~ +- Inside source: true +*** True Line Result + result = `#{cmd}` +** Processing line: ~ if result.strip.length > 0~ +- Inside source: true +*** True Line Result + if result.strip.length > 0 +** Processing line: ~ log_info result.strip.each_line.map(&:strip).join("\n")~ +- Inside source: true +*** True Line Result + log_info result.strip.each_line.map(&:strip).join("\n") +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** 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: ~ def deploy~ +- Inside source: true +*** True Line Result + def deploy +** Processing line: ~ sh "XCODE_DIR=\"/Applications/Xcode.app/Contents/Developer\" \"#{relative_path}/dragonruby-deploy-ios\" -d \"#{@device_id}\" \"#{tmp_directory}/#{@app_name}.ipa\""~ +- Inside source: true +*** True Line Result + sh "XCODE_DIR=\"/Applications/Xcode.app/Contents/Developer\" \"#{relative_path}/dragonruby-deploy-ios\" -d \"#{@device_id}\" \"#{tmp_directory}/#{@app_name}.ipa\"" +** Processing line: ~ log_info "Check your device!!"~ +- Inside source: true +*** True Line Result + log_info "Check your device!!" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def print_publish_help~ +- 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."~ +- 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'."~ +- 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."~ +- 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"~ +- Inside source: true +*** True Line Result + log_info "Your app is located at ./tmp/ios/#{@app_name}.ipa" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def compile_icons~ +- Inside source: true +*** True Line Result + def compile_icons +** Processing line: ~ cmd = <<-S~ +- Inside source: true +*** True Line Result + cmd = <<-S +** Processing line: ~ "/Applications/Xcode.app/Contents/Developer/usr/bin/actool" --output-format human-readable-text \~ +- Inside source: true +*** True Line Result + "/Applications/Xcode.app/Contents/Developer/usr/bin/actool" --output-format human-readable-text \ +** Processing line: ~ --notices --warnings --platform iphoneos \~ +- Inside source: true +*** True Line Result + --notices --warnings --platform iphoneos \ +** Processing line: ~ --minimum-deployment-target 10.3 \~ +- Inside source: true +*** True Line Result + --minimum-deployment-target 10.3 \ +** Processing line: ~ --target-device iphone \~ +- Inside source: true +*** True Line Result + --target-device iphone \ +** Processing line: ~ --target-device ipad --app-icon 'AppIcon' \~ +- Inside source: true +*** True Line Result + --target-device ipad --app-icon 'AppIcon' \ +** Processing line: ~ --output-partial-info-plist '#{app_path}/AssetCatalog-Info.plist' \~ +- Inside source: true +*** True Line Result + --output-partial-info-plist '#{app_path}/AssetCatalog-Info.plist' \ +** Processing line: ~ --compress-pngs --compile "#{app_path}" \~ +- Inside source: true +*** True Line Result + --compress-pngs --compile "#{app_path}" \ +** Processing line: ~ "#{app_path}/Assets.xcassets"~ +- Inside source: true +*** True Line Result + "#{app_path}/Assets.xcassets" +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ sh cmd~ +- Inside source: true +*** True Line Result + sh cmd +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def stage_native_libs~ +- Inside source: true +*** True Line Result + def stage_native_libs +** Processing line: ~ sh "cp -r \"#{root_folder}/native/\" \"#{app_path}/native/\""~ +- Inside source: true +*** True Line Result + 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\""~ +- Inside source: true +*** True Line Result + 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~ +- 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~ +- Inside source: true +*** True Line Result + # ./dragon/itch_wizard.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # itch_wizard.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # itch_wizard.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ class ItchWizard~ +- Inside source: true +*** True Line Result + class ItchWizard +** Processing line: ~ def steps~ +- Inside source: true +*** True Line Result + def steps +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ :check_metadata,~ +- Inside source: true +*** True Line Result + :check_metadata, +** Processing line: ~ :deploy~ +- Inside source: true +*** True Line Result + :deploy +** 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 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: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def check_metadata~ +- Inside source: true +*** True Line Result + def check_metadata +** Processing line: ~ metadata_text = $gtk.read_file metadata_file_path~ +- Inside source: true +*** True Line Result + metadata_text = $gtk.read_file metadata_file_path +** Processing line: ~ if !metadata_text~ +- Inside source: true +*** True Line Result + if !metadata_text +** Processing line: ~ write_blank_metadata~ +- Inside source: true +*** True Line Result + write_blank_metadata +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if metadata_text.each_line.to_a.length != 6~ +- Inside source: true +*** True Line Result + if metadata_text.each_line.to_a.length != 6 +** Processing line: ~ write_blank_metadata~ +- Inside source: true +*** True Line Result + write_blank_metadata +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ log "* INFO: Contents of #{metadata_file_path}:"~ +- Inside source: true +*** True Line Result + log "* INFO: Contents of #{metadata_file_path}:" +** Processing line: ~ log "#+begin_src txt"~ +- Inside source: true +*** True Line Result + log "#+begin_src txt" +** Processing line: ~ metadata_text.each_line { |l| log " #{l}" }~ +- Inside source: true +*** True Line Result + metadata_text.each_line { |l| log " #{l}" } +** Processing line: ~ log "#+end_src"~ +- Inside source: true +*** True Line Result + log "#+end_src" +** Processing line: ~ metadata = get_metadata~ +- Inside source: true +*** True Line Result + metadata = get_metadata +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if metadata[:dev_id].start_with?("#") || !@dev_id~ +- Inside source: true +*** True Line Result + if metadata[:dev_id].start_with?("#") || !@dev_id +** Processing line: ~ log "* PROMPT: Please provide your username for Itch."~ +- 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\""~ +- Inside source: true +*** True Line Result + $console.set_command "$wizards.itch.set_dev_id \"your-itch-username\"" +** Processing line: ~ return :need_dev_id~ +- Inside source: true +*** True Line Result + return :need_dev_id +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if metadata[:dev_title].start_with?("#") || !@dev_title~ +- Inside source: true +*** True Line Result + if metadata[:dev_title].start_with?("#") || !@dev_title +** Processing line: ~ log "* PROMPT: Please provide developer's/company's name that you want displayed."~ +- 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\""~ +- Inside source: true +*** True Line Result + $console.set_command "$wizards.itch.set_dev_title \"Your Name\"" +** Processing line: ~ return :need_dev_title~ +- Inside source: true +*** True Line Result + return :need_dev_title +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if metadata[:game_id].start_with?("#") || !@game_id~ +- Inside source: true +*** True Line Result + 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."~ +- 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\""~ +- Inside source: true +*** True Line Result + $console.set_command "$wizards.itch.set_game_id \"your-game-id\"" +** Processing line: ~ return :need_game_id~ +- Inside source: true +*** True Line Result + return :need_game_id +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if metadata[:game_title].start_with?("#") || !@game_title~ +- Inside source: true +*** True Line Result + if metadata[:game_title].start_with?("#") || !@game_title +** Processing line: ~ log "* PROMPT: Please provide the display name for your game. (This can include spaces)"~ +- 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\""~ +- Inside source: true +*** True Line Result + $console.set_command "$wizards.itch.set_game_title \"Your Game\"" +** Processing line: ~ return :need_game_title~ +- Inside source: true +*** True Line Result + return :need_game_title +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if metadata[:version].start_with?("#") || !@version~ +- Inside source: true +*** True Line Result + if metadata[:version].start_with?("#") || !@version +** Processing line: ~ log "* PROMPT: Please provide the version for your game."~ +- 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\""~ +- Inside source: true +*** True Line Result + $console.set_command "$wizards.itch.set_version \"1.0\"" +** Processing line: ~ return :need_version~ +- Inside source: true +*** True Line Result + return :need_version +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if metadata[:icon].start_with?("#") || !@icon~ +- Inside source: true +*** True Line Result + if metadata[:icon].start_with?("#") || !@icon +** Processing line: ~ log "* PROMPT: Please provide icon path for your game."~ +- 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\""~ +- Inside source: true +*** True Line Result + $console.set_command "$wizards.itch.set_icon \"icon.png\"" +** Processing line: ~ return :need_icon~ +- Inside source: true +*** True Line Result + return :need_icon +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return :success~ +- Inside source: true +*** True Line Result + return :success +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_dev_id value~ +- Inside source: true +*** True Line Result + def set_dev_id value +** Processing line: ~ @dev_id = value~ +- 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 + start +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_dev_title value~ +- Inside source: true +*** True Line Result + def set_dev_title value +** Processing line: ~ @dev_title = value~ +- 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 + start +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_game_id value~ +- Inside source: true +*** True Line Result + def set_game_id value +** Processing line: ~ @game_id = value~ +- 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 + start +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_game_title value~ +- Inside source: true +*** True Line Result + def set_game_title value +** Processing line: ~ @game_title = value~ +- 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 + start +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_version value~ +- Inside source: true +*** True Line Result + def set_version value +** Processing line: ~ @version = value~ +- 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 + start +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def set_icon value~ +- Inside source: true +*** True Line Result + def set_icon value +** Processing line: ~ @icon = value~ +- Inside source: true +*** True Line Result + @icon = value +** Processing line: ~ write_metadata~ +- Inside source: true +*** True Line Result + write_metadata +** Processing line: ~ start~ +- Inside source: true +*** True Line Result + start +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def write_metadata~ +- Inside source: true +*** True Line Result + def write_metadata +** Processing line: ~ text = ""~ +- Inside source: true +*** True Line Result + text = "" +** Processing line: ~ if @dev_id~ +- Inside source: true +*** True Line Result + if @dev_id +** Processing line: ~ text += "devid=#{@dev_id}\n"~ +- Inside source: true +*** True Line Result + text += "devid=#{@dev_id}\n" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ text += "#devid=myname\n"~ +- Inside source: true +*** True Line Result + text += "#devid=myname\n" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if @dev_title~ +- Inside source: true +*** True Line Result + if @dev_title +** Processing line: ~ text += "devtitle=#{@dev_title}\n"~ +- Inside source: true +*** True Line Result + text += "devtitle=#{@dev_title}\n" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ text += "#devtitle=My Name\n"~ +- Inside source: true +*** True Line Result + text += "#devtitle=My Name\n" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if @game_id~ +- Inside source: true +*** True Line Result + if @game_id +** Processing line: ~ text += "gameid=#{@game_id}\n"~ +- Inside source: true +*** True Line Result + text += "gameid=#{@game_id}\n" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ text += "#gameid=gameid\n"~ +- Inside source: true +*** True Line Result + text += "#gameid=gameid\n" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if @game_title~ +- Inside source: true +*** True Line Result + if @game_title +** Processing line: ~ text += "gametitle=#{@game_title}\n"~ +- Inside source: true +*** True Line Result + text += "gametitle=#{@game_title}\n" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ text += "#gametitle=Game Name\n"~ +- Inside source: true +*** True Line Result + text += "#gametitle=Game Name\n" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if @version~ +- Inside source: true +*** True Line Result + if @version +** Processing line: ~ text += "version=#{@version}\n"~ +- Inside source: true +*** True Line Result + text += "version=#{@version}\n" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ text += "#version=0.1\n"~ +- Inside source: true +*** True Line Result + text += "#version=0.1\n" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if @icon~ +- Inside source: true +*** True Line Result + if @icon +** Processing line: ~ text += "icon=metadata/#{@icon}\n"~ +- Inside source: true +*** True Line Result + text += "icon=metadata/#{@icon}\n" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ text += "#icon=metadata/icon.png\n"~ +- Inside source: true +*** True Line Result + text += "#icon=metadata/icon.png\n" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ $gtk.write_file metadata_file_path, text~ +- Inside source: true +*** True Line Result + $gtk.write_file metadata_file_path, text +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def relative_path~ +- Inside source: true +*** True Line Result + def relative_path +** Processing line: ~ (File.dirname $gtk.binary_path)~ +- Inside source: true +*** True Line Result + (File.dirname $gtk.binary_path) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def package_command~ +- Inside source: true +*** True Line Result + def package_command +** Processing line: ~ "#{File.join $gtk.get_base_dir, 'dragonruby-publish'}"~ +- Inside source: true +*** True Line Result + "#{File.join $gtk.get_base_dir, 'dragonruby-publish'}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def deploy~ +- Inside source: true +*** True Line Result + def deploy +** Processing line: ~ log_info "* Running dragonruby-publish: #{package_command}"~ +- Inside source: true +*** True Line Result + log_info "* Running dragonruby-publish: #{package_command}" +** Processing line: ~ results = $gtk.exec package_command~ +- Inside source: true +*** True Line Result + results = $gtk.exec package_command +** Processing line: ~ log "#+begin_src"~ +- Inside source: true +*** True Line Result + log "#+begin_src" +** Processing line: ~ log results~ +- Inside source: true +*** True Line Result + log results +** Processing line: ~ log "#+end_src"~ +- Inside source: true +*** True Line Result + log "#+end_src" +** Processing line: ~ :success~ +- Inside source: true +*** True Line Result + :success +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def start~ +- Inside source: true +*** True Line Result + def start +** Processing line: ~ log "================"~ +- Inside source: true +*** True Line Result + log "================" +** Processing line: ~ log "* INFO: Starting Itch Wizard."~ +- Inside source: true +*** True Line Result + log "* INFO: Starting Itch Wizard." +** Processing line: ~ @start_at = Kernel.global_tick_count~ +- Inside source: true +*** True Line Result + @start_at = Kernel.global_tick_count +** Processing line: ~ steps.each do |m|~ +- Inside source: true +*** True Line Result + steps.each do |m| +** Processing line: ~ begin~ +- Inside source: true +*** True Line Result + begin +** Processing line: ~ log_info "Running Itch Wizard Step: ~$wizards.itch.#{m}~"~ +- 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~ +- Inside source: true +*** True Line Result + result = (send m) || :success if @wizard_status[m][:result] != :success +** Processing line: ~ @wizard_status[m][:result] = result~ +- Inside source: true +*** True Line Result + @wizard_status[m][:result] = result +** Processing line: ~ if result != :success~ +- Inside source: true +*** True Line Result + if result != :success +** Processing line: ~ log_info "Exiting wizard. :#{result}"~ +- Inside source: true +*** True Line Result + log_info "Exiting wizard. :#{result}" +** Processing line: ~ break~ +- Inside source: true +*** True Line Result + break +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ if e.is_a? WizardException~ +- Inside source: true +*** True Line Result + if e.is_a? WizardException +** Processing line: ~ $console.log.clear~ +- Inside source: true +*** True Line Result + $console.log.clear +** Processing line: ~ $console.archived_log.clear~ +- Inside source: true +*** True Line Result + $console.archived_log.clear +** Processing line: ~ log "=" * $console.console_text_width~ +- Inside source: true +*** True Line Result + log "=" * $console.console_text_width +** Processing line: ~ e.console_primitives.each do |p|~ +- Inside source: true +*** True Line Result + e.console_primitives.each do |p| +** Processing line: ~ $console.add_primitive p~ +- Inside source: true +*** True Line Result + $console.add_primitive p +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ log "=" * $console.console_text_width~ +- Inside source: true +*** True Line Result + log "=" * $console.console_text_width +** Processing line: ~ $console.set_command (e.console_command || "$wizards.itch.start")~ +- Inside source: true +*** True Line Result + $console.set_command (e.console_command || "$wizards.itch.start") +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ log_error "Step #{m} failed."~ +- Inside source: true +*** True Line Result + log_error "Step #{m} failed." +** Processing line: ~ log_error e.to_s~ +- Inside source: true +*** True Line Result + log_error e.to_s +** Processing line: ~ $console.set_command "$wizards.itch.start"~ +- Inside source: true +*** True Line Result + $console.set_command "$wizards.itch.start" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ break~ +- Inside source: true +*** True Line Result + break +** 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 reset~ +- Inside source: true +*** True Line Result + def reset +** Processing line: ~ @dev_id = nil~ +- Inside source: true +*** True Line Result + @dev_id = nil +** Processing line: ~ @dev_title = nil~ +- Inside source: true +*** True Line Result + @dev_title = nil +** Processing line: ~ @game_id = nil~ +- Inside source: true +*** True Line Result + @game_id = nil +** Processing line: ~ @game_title = nil~ +- Inside source: true +*** True Line Result + @game_title = nil +** Processing line: ~ @version = nil~ +- Inside source: true +*** True Line Result + @version = nil +** Processing line: ~ @icon = nil~ +- Inside source: true +*** True Line Result + @icon = nil +** Processing line: ~ init_wizard_status~ +- Inside source: true +*** True Line Result + init_wizard_status +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def restart~ +- Inside source: true +*** True Line Result + def restart +** Processing line: ~ reset~ +- Inside source: true +*** True Line Result + reset +** Processing line: ~ start~ +- Inside source: true +*** True Line Result + start +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ reset~ +- Inside source: true +*** True Line Result + reset +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def init_wizard_status~ +- Inside source: true +*** True Line Result + def init_wizard_status +** Processing line: ~ @wizard_status = {}~ +- Inside source: true +*** True Line Result + @wizard_status = {} +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ steps.each do |m|~ +- Inside source: true +*** True Line Result + steps.each do |m| +** Processing line: ~ @wizard_status[m] = { result: :not_started }~ +- Inside source: true +*** True Line Result + @wizard_status[m] = { result: :not_started } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ previous_step = nil~ +- Inside source: true +*** True Line Result + previous_step = nil +** Processing line: ~ next_step = nil~ +- Inside source: true +*** True Line Result + next_step = nil +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ steps.each_cons(2) do |current_step, next_step|~ +- Inside source: true +*** True Line Result + steps.each_cons(2) do |current_step, next_step| +** Processing line: ~ @wizard_status[current_step][:next_step] = next_step~ +- Inside source: true +*** True Line Result + @wizard_status[current_step][:next_step] = next_step +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ steps.reverse.each_cons(2) do |current_step, previous_step|~ +- Inside source: true +*** True Line Result + steps.reverse.each_cons(2) do |current_step, previous_step| +** Processing line: ~ @wizard_status[current_step][:previous_step] = previous_step~ +- Inside source: true +*** True Line Result + @wizard_status[current_step][:previous_step] = previous_step +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** layout.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** layout.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/layout.rb~ +- Inside source: true +*** True Line Result + # ./dragon/layout.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # layout.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # layout.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Margin~ +- Inside source: true +*** True Line Result + class Margin +** Processing line: ~ attr :left, :right, :top, :bottom~ +- Inside source: true +*** True Line Result + attr :left, :right, :top, :bottom +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @left = 0~ +- Inside source: true +*** True Line Result + @left = 0 +** Processing line: ~ @right = 0~ +- Inside source: true +*** True Line Result + @right = 0 +** Processing line: ~ @top = 0~ +- Inside source: true +*** True Line Result + @top = 0 +** Processing line: ~ @bottom = 0~ +- Inside source: true +*** True Line Result + @bottom = 0 +** 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 + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ left: @left,~ +- Inside source: true +*** True Line Result + left: @left, +** Processing line: ~ right: @right,~ +- Inside source: true +*** True Line Result + right: @right, +** Processing line: ~ top: @top,~ +- Inside source: true +*** True Line Result + top: @top, +** Processing line: ~ bottom: @bottom,~ +- Inside source: true +*** True Line Result + bottom: @bottom, +** 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 inspect~ +- Inside source: true +*** True Line Result + def inspect +** Processing line: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.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: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.to_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: ~ class SafeArea~ +- Inside source: true +*** True Line Result + class SafeArea +** Processing line: ~ attr :w, :h, :margin~ +- Inside source: true +*** True Line Result + attr :w, :h, :margin +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @w = 0~ +- Inside source: true +*** True Line Result + @w = 0 +** Processing line: ~ @h = 0~ +- Inside source: true +*** True Line Result + @h = 0 +** Processing line: ~ @margin = Margin.new~ +- Inside source: true +*** True Line Result + @margin = Margin.new +** 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 + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ w: @w,~ +- Inside source: true +*** True Line Result + w: @w, +** Processing line: ~ h: @h,~ +- Inside source: true +*** True Line Result + h: @h, +** Processing line: ~ margin: @margin.serialize~ +- Inside source: true +*** True Line Result + margin: @margin.serialize +** 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 inspect~ +- Inside source: true +*** True Line Result + def inspect +** Processing line: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.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: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.to_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: ~ class GridArea~ +- Inside source: true +*** True Line Result + class GridArea +** Processing line: ~ attr :w, :h, :margin, :gutter, :col_count, :row_count, :cell_w, :cell_h, :outer_gutter~ +- Inside source: true +*** True Line Result + attr :w, :h, :margin, :gutter, :col_count, :row_count, :cell_w, :cell_h, :outer_gutter +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @w = 0~ +- Inside source: true +*** True Line Result + @w = 0 +** Processing line: ~ @h = 0~ +- Inside source: true +*** True Line Result + @h = 0 +** Processing line: ~ @gutter = 0~ +- Inside source: true +*** True Line Result + @gutter = 0 +** Processing line: ~ @outer_gutter = 0~ +- Inside source: true +*** True Line Result + @outer_gutter = 0 +** Processing line: ~ @col_count = 0~ +- Inside source: true +*** True Line Result + @col_count = 0 +** Processing line: ~ @row_count = 0~ +- Inside source: true +*** True Line Result + @row_count = 0 +** Processing line: ~ @margin = Margin.new~ +- Inside source: true +*** True Line Result + @margin = Margin.new +** 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 + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ w: @w,~ +- Inside source: true +*** True Line Result + w: @w, +** Processing line: ~ h: @h,~ +- Inside source: true +*** True Line Result + h: @h, +** Processing line: ~ gutter: @gutter,~ +- Inside source: true +*** True Line Result + gutter: @gutter, +** Processing line: ~ outer_gutter: @outer_gutter,~ +- Inside source: true +*** True Line Result + outer_gutter: @outer_gutter, +** Processing line: ~ col_count: @col_count,~ +- Inside source: true +*** True Line Result + col_count: @col_count, +** Processing line: ~ row_count: @row_count,~ +- Inside source: true +*** True Line Result + row_count: @row_count, +** Processing line: ~ margin: @margin.serialize~ +- Inside source: true +*** True Line Result + margin: @margin.serialize +** 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 inspect~ +- Inside source: true +*** True Line Result + def inspect +** Processing line: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.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: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.to_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: ~ class ControlArea~ +- Inside source: true +*** True Line Result + class ControlArea +** Processing line: ~ attr :cell_size, :w, :h, :margin~ +- Inside source: true +*** True Line Result + attr :cell_size, :w, :h, :margin +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @margin = Margin.new~ +- Inside source: true +*** True Line Result + @margin = Margin.new +** 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 + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ cell_size: @cell_size,~ +- Inside source: true +*** True Line Result + cell_size: @cell_size, +** Processing line: ~ w: @w,~ +- Inside source: true +*** True Line Result + w: @w, +** Processing line: ~ h: @h,~ +- Inside source: true +*** True Line Result + h: @h, +** Processing line: ~ margin: @margin.serialize,~ +- Inside source: true +*** True Line Result + margin: @margin.serialize, +** 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 inspect~ +- Inside source: true +*** True Line Result + def inspect +** Processing line: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.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: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.to_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: ~ class Device~ +- Inside source: true +*** True Line Result + class Device +** Processing line: ~ attr :w, :h, :safe_area, :grid_area, :control_area, :name, :aspect~ +- Inside source: true +*** True Line Result + attr :w, :h, :safe_area, :grid_area, :control_area, :name, :aspect +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @name = ""~ +- Inside source: true +*** True Line Result + @name = "" +** Processing line: ~ @w = 0~ +- Inside source: true +*** True Line Result + @w = 0 +** Processing line: ~ @h = 0~ +- Inside source: true +*** True Line Result + @h = 0 +** Processing line: ~ @safe_area = SafeArea.new~ +- Inside source: true +*** True Line Result + @safe_area = SafeArea.new +** Processing line: ~ @grid_area = GridArea.new~ +- Inside source: true +*** True Line Result + @grid_area = GridArea.new +** Processing line: ~ @control_area = ControlArea.new~ +- Inside source: true +*** True Line Result + @control_area = ControlArea.new +** Processing line: ~ @aspect = AspectRatio.new~ +- Inside source: true +*** True Line Result + @aspect = AspectRatio.new +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def assert! result, message~ +- Inside source: true +*** True Line Result + def assert! result, message +** Processing line: ~ return if result~ +- Inside source: true +*** True Line Result + return if result +** Processing line: ~ raise message~ +- Inside source: true +*** True Line Result + raise message +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def check_math!~ +- Inside source: true +*** True Line Result + def check_math! +** Processing line: ~ assert! (@control_area.w + @control_area.margin.left + @control_area.margin.right) == @w, "Math for Width didn't pan out."~ +- Inside source: true +*** True Line Result + assert! (@control_area.w + @control_area.margin.left + @control_area.margin.right) == @w, "Math for Width didn't pan out." +** Processing line: ~ assert! (@control_area.h + @control_area.margin.top + @control_area.margin.bottom) == @h, "Math for Height didn't pan out."~ +- Inside source: true +*** True Line Result + assert! (@control_area.h + @control_area.margin.top + @control_area.margin.bottom) == @h, "Math for Height didn't pan out." +** 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 + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ name: @name,~ +- Inside source: true +*** True Line Result + name: @name, +** Processing line: ~ w: @w,~ +- Inside source: true +*** True Line Result + w: @w, +** Processing line: ~ h: @h,~ +- Inside source: true +*** True Line Result + h: @h, +** Processing line: ~ aspect: @aspect.serialize,~ +- Inside source: true +*** True Line Result + aspect: @aspect.serialize, +** Processing line: ~ safe_area: @safe_area.serialize,~ +- Inside source: true +*** True Line Result + safe_area: @safe_area.serialize, +** Processing line: ~ grid_area: @grid_area.serialize,~ +- Inside source: true +*** True Line Result + grid_area: @grid_area.serialize, +** Processing line: ~ control_area: @control_area.serialize~ +- Inside source: true +*** True Line Result + control_area: @control_area.serialize +** 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 inspect~ +- Inside source: true +*** True Line Result + def inspect +** Processing line: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.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: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.to_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: ~ class AspectRatio~ +- Inside source: true +*** True Line Result + class AspectRatio +** Processing line: ~ attr :w, :h, :u~ +- Inside source: true +*** True Line Result + attr :w, :h, :u +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @w = 0~ +- Inside source: true +*** True Line Result + @w = 0 +** Processing line: ~ @h = 0~ +- Inside source: true +*** True Line Result + @h = 0 +** Processing line: ~ @u = 0~ +- Inside source: true +*** True Line Result + @u = 0 +** 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 + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ w: @w,~ +- Inside source: true +*** True Line Result + w: @w, +** Processing line: ~ h: @h,~ +- Inside source: true +*** True Line Result + h: @h, +** Processing line: ~ u: @u~ +- Inside source: true +*** True Line Result + u: @u +** 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 inspect~ +- Inside source: true +*** True Line Result + def inspect +** Processing line: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.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: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.to_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: ~ class Layout~ +- Inside source: true +*** True Line Result + class Layout +** Processing line: ~ attr :w, :h, :rect_cache~ +- Inside source: true +*** True Line Result + attr :w, :h, :rect_cache +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize w, h~ +- Inside source: true +*** True Line Result + def initialize w, h +** Processing line: ~ @w = w~ +- Inside source: true +*** True Line Result + @w = w +** Processing line: ~ @h = h~ +- Inside source: true +*** True Line Result + @h = h +** Processing line: ~ @rect_cache = {}~ +- Inside source: true +*** True Line Result + @rect_cache = {} +** Processing line: ~ init_device @w, @h~ +- Inside source: true +*** True Line Result + init_device @w, @h +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def u_for_16x9 w, h~ +- Inside source: true +*** True Line Result + def u_for_16x9 w, h +** Processing line: ~ u = (w.fdiv 16).floor~ +- Inside source: true +*** True Line Result + u = (w.fdiv 16).floor +** Processing line: ~ u = (h.fdiv 9).floor if (u * 9) > h~ +- Inside source: true +*** True Line Result + u = (h.fdiv 9).floor if (u * 9) > h +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ u: u,~ +- Inside source: true +*** True Line Result + u: u, +** Processing line: ~ w: u * 16,~ +- Inside source: true +*** True Line Result + w: u * 16, +** Processing line: ~ h: u * 9~ +- Inside source: true +*** True Line Result + h: u * 9 +** 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 font_relative_size_enum size_enum~ +- Inside source: true +*** True Line Result + def font_relative_size_enum size_enum +** Processing line: ~ base_line_logical = 22~ +- Inside source: true +*** True Line Result + base_line_logical = 22 +** Processing line: ~ base_line_actual = font_size_med~ +- Inside source: true +*** True Line Result + base_line_actual = font_size_med +** Processing line: ~ target_logical = size_enum~ +- Inside source: true +*** True Line Result + target_logical = size_enum +** Processing line: ~ target_logical = 1 if target_logical <= 0~ +- Inside source: true +*** True Line Result + target_logical = 1 if target_logical <= 0 +** Processing line: ~ (base_line_actual / base_line_logical) * target_logical~ +- Inside source: true +*** True Line Result + (base_line_actual / base_line_logical) * target_logical +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def font_px_to_pt px~ +- Inside source: true +*** True Line Result + def font_px_to_pt px +** Processing line: ~ (px / 1.33333).floor~ +- Inside source: true +*** True Line Result + (px / 1.33333).floor +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def font_pt_to_px pt~ +- Inside source: true +*** True Line Result + def font_pt_to_px pt +** Processing line: ~ pt * 1.333333~ +- Inside source: true +*** True Line Result + pt * 1.333333 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def font_size_cell~ +- Inside source: true +*** True Line Result + def font_size_cell +** Processing line: ~ (cell_height / 1.33333)~ +- Inside source: true +*** True Line Result + (cell_height / 1.33333) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def font_size_xl~ +- Inside source: true +*** True Line Result + def font_size_xl +** Processing line: ~ font_size_cell~ +- Inside source: true +*** True Line Result + font_size_cell +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def font_size_lg~ +- Inside source: true +*** True Line Result + def font_size_lg +** Processing line: ~ font_size_cell * 0.8~ +- Inside source: true +*** True Line Result + font_size_cell * 0.8 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def font_size_med~ +- Inside source: true +*** True Line Result + def font_size_med +** Processing line: ~ font_size_cell * 0.7~ +- Inside source: true +*** True Line Result + font_size_cell * 0.7 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def font_size_sm~ +- Inside source: true +*** True Line Result + def font_size_sm +** Processing line: ~ font_size_cell * 0.6~ +- Inside source: true +*** True Line Result + font_size_cell * 0.6 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def font_size_xs~ +- Inside source: true +*** True Line Result + def font_size_xs +** Processing line: ~ font_size_cell * 0.5~ +- Inside source: true +*** True Line Result + font_size_cell * 0.5 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def font_size~ +- Inside source: true +*** True Line Result + def font_size +** Processing line: ~ font_size_cell * 0.7~ +- Inside source: true +*** True Line Result + font_size_cell * 0.7 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def logical_rect~ +- Inside source: true +*** True Line Result + def logical_rect +** Processing line: ~ @logical_rect ||= { x: 0,~ +- Inside source: true +*** True Line Result + @logical_rect ||= { x: 0, +** Processing line: ~ y: 0,~ +- Inside source: true +*** True Line Result + y: 0, +** Processing line: ~ w: @w,~ +- Inside source: true +*** True Line Result + w: @w, +** Processing line: ~ h: @h }~ +- Inside source: true +*** True Line Result + h: @h } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def safe_rect~ +- Inside source: true +*** True Line Result + def safe_rect +** Processing line: ~ @safe_rect ||= { x: 0,~ +- Inside source: true +*** True Line Result + @safe_rect ||= { x: 0, +** Processing line: ~ y: 0,~ +- Inside source: true +*** True Line Result + y: 0, +** Processing line: ~ w: @w,~ +- Inside source: true +*** True Line Result + w: @w, +** Processing line: ~ h: @h }~ +- Inside source: true +*** True Line Result + h: @h } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def control_rect~ +- Inside source: true +*** True Line Result + def control_rect +** Processing line: ~ @control_rect ||= { x: device.control_area.margin.left,~ +- Inside source: true +*** True Line Result + @control_rect ||= { x: device.control_area.margin.left, +** Processing line: ~ y: device.control_area.margin.top,~ +- Inside source: true +*** True Line Result + y: device.control_area.margin.top, +** Processing line: ~ w: device.control_area.w,~ +- Inside source: true +*** True Line Result + w: device.control_area.w, +** Processing line: ~ h: device.control_area.h }~ +- Inside source: true +*** True Line Result + h: device.control_area.h } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def row_count~ +- Inside source: true +*** True Line Result + def row_count +** Processing line: ~ device.grid_area.row_count~ +- Inside source: true +*** True Line Result + device.grid_area.row_count +** 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 + def col_count +** Processing line: ~ device.grid_area.col_count~ +- Inside source: true +*** True Line Result + device.grid_area.col_count +** 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 + def gutter_height +** Processing line: ~ device.grid_area.gutter~ +- Inside source: true +*** True Line Result + device.grid_area.gutter +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def gutter_width~ +- Inside source: true +*** True Line Result + def gutter_width +** Processing line: ~ device.grid_area.gutter~ +- Inside source: true +*** True Line Result + device.grid_area.gutter +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def outer_gutter~ +- Inside source: true +*** True Line Result + def outer_gutter +** Processing line: ~ device.grid_area.outer_gutter~ +- Inside source: true +*** True Line Result + device.grid_area.outer_gutter +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def cell_height~ +- Inside source: true +*** True Line Result + def cell_height +** Processing line: ~ device.control_area.cell_size~ +- Inside source: true +*** True Line Result + device.control_area.cell_size +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def cell_width~ +- Inside source: true +*** True Line Result + def cell_width +** Processing line: ~ device.control_area.cell_size~ +- Inside source: true +*** True Line Result + device.control_area.cell_size +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def rect_defaults~ +- Inside source: true +*** True Line Result + def rect_defaults +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** 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: ~ dy: 0,~ +- Inside source: true +*** True Line Result + dy: 0, +** Processing line: ~ rect: :control_rect~ +- Inside source: true +*** True Line Result + rect: :control_rect +** 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 rect opts~ +- Inside source: true +*** True Line Result + def rect opts +** Processing line: ~ opts = rect_defaults.merge opts~ +- Inside source: true +*** True Line Result + opts = rect_defaults.merge opts +** Processing line: ~ result = send opts[:rect]~ +- Inside source: true +*** True Line Result + result = send opts[:rect] +** Processing line: ~ if opts[:row] && opts[:col] && opts[:w] && opts[:h]~ +- Inside source: true +*** True Line Result + if opts[:row] && opts[:col] && opts[:w] && opts[:h] +** Processing line: ~ col = rect_col opts[:col], opts[:w]~ +- Inside source: true +*** True Line Result + col = rect_col opts[:col], opts[:w] +** Processing line: ~ row = rect_row opts[:row], opts[:h]~ +- Inside source: true +*** True Line Result + row = rect_row opts[:row], opts[:h] +** Processing line: ~ result = control_rect.merge x: col.x,~ +- Inside source: true +*** True Line Result + result = control_rect.merge x: col.x, +** Processing line: ~ y: row.y,~ +- Inside source: true +*** True Line Result + y: row.y, +** Processing line: ~ w: col.w,~ +- Inside source: true +*** True Line Result + w: col.w, +** Processing line: ~ h: row.h~ +- Inside source: true +*** True Line Result + h: row.h +** Processing line: ~ elsif opts[:row] && !opts[:col]~ +- Inside source: true +*** True Line Result + elsif opts[:row] && !opts[:col] +** Processing line: ~ result = rect_row opts[:row], opts[:h]~ +- Inside source: true +*** True Line Result + result = rect_row opts[:row], opts[:h] +** Processing line: ~ elsif !opts[:row] && opts[:col]~ +- Inside source: true +*** True Line Result + elsif !opts[:row] && opts[:col] +** Processing line: ~ result = rect_col opts[:col], opts[:w]~ +- Inside source: true +*** True Line Result + result = rect_col opts[:col], opts[:w] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ raise "LayoutTheory::rect unable to process opts #{opts}."~ +- Inside source: true +*** True Line Result + raise "LayoutTheory::rect unable to process opts #{opts}." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if opts[:max_height] && opts[:max_height] >= 0~ +- Inside source: true +*** True Line Result + if opts[:max_height] && opts[:max_height] >= 0 +** Processing line: ~ if result[:h] > opts[:max_height]~ +- Inside source: true +*** True Line Result + if result[:h] > opts[:max_height] +** Processing line: ~ delta = (result[:h] - opts[:max_height]) * 2~ +- Inside source: true +*** True Line Result + delta = (result[:h] - opts[:max_height]) * 2 +** Processing line: ~ result[:y] += delta~ +- Inside source: true +*** True Line Result + result[:y] += delta +** Processing line: ~ result[:h] = opts[:max_height]~ +- Inside source: true +*** True Line Result + result[:h] = opts[:max_height] +** 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 opts[:max_width] && opts[:max_width] >= 0~ +- Inside source: true +*** True Line Result + if opts[:max_width] && opts[:max_width] >= 0 +** Processing line: ~ if result[:w] > opts[:max_width]~ +- Inside source: true +*** True Line Result + if result[:w] > opts[:max_width] +** Processing line: ~ delta = (result[:w] - opts[:max_width]) * 2~ +- Inside source: true +*** True Line Result + delta = (result[:w] - opts[:max_width]) * 2 +** Processing line: ~ result[:x] += delta~ +- Inside source: true +*** True Line Result + result[:x] += delta +** Processing line: ~ result[:w] = opts[:max_width]~ +- Inside source: true +*** True Line Result + result[:w] = opts[:max_width] +** 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: ~ result[:x] += opts[:dx]~ +- Inside source: true +*** True Line Result + result[:x] += opts[:dx] +** Processing line: ~ result[:y] += opts[:dy]~ +- Inside source: true +*** True Line Result + result[:y] += opts[:dy] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if opts[:include_row_gutter]~ +- Inside source: true +*** True Line Result + if opts[:include_row_gutter] +** Processing line: ~ result[:x] -= device.grid_area.gutter~ +- Inside source: true +*** True Line Result + result[:x] -= device.grid_area.gutter +** Processing line: ~ result[:w] += device.grid_area.gutter * 2~ +- Inside source: true +*** True Line Result + result[:w] += device.grid_area.gutter * 2 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if opts[:include_col_gutter]~ +- Inside source: true +*** True Line Result + if opts[:include_col_gutter] +** Processing line: ~ result[:y] -= device.grid_area.gutter~ +- Inside source: true +*** True Line Result + result[:y] -= device.grid_area.gutter +** Processing line: ~ result[:h] += device.grid_area.gutter * 2~ +- Inside source: true +*** True Line Result + result[:h] += device.grid_area.gutter * 2 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** 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[:y] += opts[:dy] if opts[:dy]~ +- Inside source: true +*** True Line Result + result[:y] += opts[:dy] if opts[:dy] +** Processing line: ~ result[:w] += opts[:dw] if opts[:dw]~ +- Inside source: true +*** True Line Result + result[:w] += opts[:dw] if opts[:dw] +** Processing line: ~ result[:h] += opts[:dh] if opts[:dh]~ +- Inside source: true +*** True Line Result + result[:h] += opts[:dh] if opts[:dh] +** Processing line: ~ result[:row] = opts[:row]~ +- Inside source: true +*** True Line Result + result[:row] = opts[:row] +** Processing line: ~ result[:col] = opts[:col]~ +- Inside source: true +*** True Line Result + result[:col] = opts[:col] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if $gtk.args.grid.name == :center~ +- Inside source: true +*** True Line Result + if $gtk.args.grid.name == :center +** Processing line: ~ result[:x] -= 640~ +- Inside source: true +*** True Line Result + result[:x] -= 640 +** Processing line: ~ result[:y] -= 360~ +- Inside source: true +*** True Line Result + result[:y] -= 360 +** 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: ~ def rect_center reference, target~ +- Inside source: true +*** True Line Result + def rect_center reference, target +** Processing line: ~ delta_x = (reference.w - target.w).fdiv 2~ +- Inside source: true +*** True Line Result + delta_x = (reference.w - target.w).fdiv 2 +** Processing line: ~ delta_y = (reference.h - target.h).fdiv 2~ +- Inside source: true +*** True Line Result + delta_y = (reference.h - target.h).fdiv 2 +** Processing line: ~ [target.x - delta_x, target.y - delta_y, target.w, target.h]~ +- Inside source: true +*** True Line Result + [target.x - delta_x, target.y - delta_y, target.w, target.h] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def rect_row index, h~ +- Inside source: true +*** True Line Result + def rect_row index, h +** Processing line: ~ @rect_cache[:row] ||= {}~ +- Inside source: true +*** True Line Result + @rect_cache[:row] ||= {} +** Processing line: ~ @rect_cache[:row][index] ||= {}~ +- Inside source: true +*** True Line Result + @rect_cache[:row][index] ||= {} +** Processing line: ~ return @rect_cache[:row][index][h] if @rect_cache[:row][index][h]~ +- Inside source: true +*** True Line Result + return @rect_cache[:row][index][h] if @rect_cache[:row][index][h] +** Processing line: ~ row_h = (device.grid_area.gutter * (h - 1)) +~ +- Inside source: true +*** True Line Result + row_h = (device.grid_area.gutter * (h - 1)) + +** Processing line: ~ (device.control_area.cell_size * h)~ +- Inside source: true +*** True Line Result + (device.control_area.cell_size * h) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ row_h = row_h.to_i~ +- Inside source: true +*** True Line Result + row_h = row_h.to_i +** Processing line: ~ row_h -= 1 if row_h.odd?~ +- Inside source: true +*** True Line Result + row_h -= 1 if row_h.odd? +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ row_y = (control_rect.y) +~ +- Inside source: true +*** True Line Result + row_y = (control_rect.y) + +** Processing line: ~ (device.grid_area.gutter * index) +~ +- Inside source: true +*** True Line Result + (device.grid_area.gutter * index) + +** Processing line: ~ (device.control_area.cell_size * index)~ +- Inside source: true +*** True Line Result + (device.control_area.cell_size * index) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ row_y = row_y.to_i~ +- Inside source: true +*** True Line Result + row_y = row_y.to_i +** Processing line: ~ row_y += 1 if row_y.odd? && (index + 1) > @device.grid_area.row_count.half~ +- Inside source: true +*** True Line Result + row_y += 1 if row_y.odd? && (index + 1) > @device.grid_area.row_count.half +** Processing line: ~ row_y += 1 if row_y.odd? && (index + 1) <= @device.grid_area.row_count.half~ +- Inside source: true +*** True Line Result + row_y += 1 if row_y.odd? && (index + 1) <= @device.grid_area.row_count.half +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ row_y = device.h - row_y - row_h~ +- Inside source: true +*** True Line Result + row_y = device.h - row_y - row_h +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ result = control_rect.merge y: row_y, h: row_h~ +- Inside source: true +*** True Line Result + result = control_rect.merge y: row_y, h: row_h +** Processing line: ~ @rect_cache[:row][index][h] = result~ +- Inside source: true +*** True Line Result + @rect_cache[:row][index][h] = result +** Processing line: ~ @rect_cache[:row][index][h]~ +- Inside source: true +*** True Line Result + @rect_cache[:row][index][h] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def rect_col index, w~ +- Inside source: true +*** True Line Result + def rect_col index, w +** Processing line: ~ @rect_cache[:col] ||= {}~ +- Inside source: true +*** True Line Result + @rect_cache[:col] ||= {} +** Processing line: ~ @rect_cache[:col][index] ||= {}~ +- Inside source: true +*** True Line Result + @rect_cache[:col][index] ||= {} +** Processing line: ~ return @rect_cache[:col][index][w] if @rect_cache[:col][index][w]~ +- Inside source: true +*** True Line Result + return @rect_cache[:col][index][w] if @rect_cache[:col][index][w] +** Processing line: ~ col_x = (control_rect.x) +~ +- Inside source: true +*** True Line Result + col_x = (control_rect.x) + +** Processing line: ~ (device.grid_area.gutter * index) +~ +- Inside source: true +*** True Line Result + (device.grid_area.gutter * index) + +** Processing line: ~ (device.control_area.cell_size * index)~ +- Inside source: true +*** True Line Result + (device.control_area.cell_size * index) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ col_x = col_x.to_i~ +- Inside source: true +*** True Line Result + col_x = col_x.to_i +** Processing line: ~ col_x -= 1 if col_x.odd? && (index + 1) < @device.grid_area.col_count.half~ +- Inside source: true +*** True Line Result + col_x -= 1 if col_x.odd? && (index + 1) < @device.grid_area.col_count.half +** Processing line: ~ col_x += 1 if col_x.odd? && (index + 1) >= @device.grid_area.col_count.half~ +- Inside source: true +*** True Line Result + col_x += 1 if col_x.odd? && (index + 1) >= @device.grid_area.col_count.half +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ col_w = (device.grid_area.gutter * (w - 1)) +~ +- Inside source: true +*** True Line Result + col_w = (device.grid_area.gutter * (w - 1)) + +** Processing line: ~ (device.control_area.cell_size * w)~ +- Inside source: true +*** True Line Result + (device.control_area.cell_size * w) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ col_w = col_w.to_i~ +- Inside source: true +*** True Line Result + col_w = col_w.to_i +** Processing line: ~ col_w -= 1 if col_w.odd?~ +- Inside source: true +*** True Line Result + col_w -= 1 if col_w.odd? +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ result = control_rect.merge x: col_x, w: col_w~ +- Inside source: true +*** True Line Result + result = control_rect.merge x: col_x, w: col_w +** Processing line: ~ @rect_cache[:col][index][w] = result~ +- Inside source: true +*** True Line Result + @rect_cache[:col][index][w] = result +** Processing line: ~ @rect_cache[:col][index][w]~ +- Inside source: true +*** True Line Result + @rect_cache[:col][index][w] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def device~ +- Inside source: true +*** True Line Result + def device +** Processing line: ~ @device~ +- Inside source: true +*** True Line Result + @device +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def init_device w, h~ +- Inside source: true +*** True Line Result + def init_device w, h +** Processing line: ~ @device = Device.new~ +- Inside source: true +*** True Line Result + @device = Device.new +** Processing line: ~ @device.w = w~ +- Inside source: true +*** True Line Result + @device.w = w +** Processing line: ~ @device.h = h~ +- Inside source: true +*** True Line Result + @device.h = h +** Processing line: ~ @device.name = "Device"~ +- Inside source: true +*** True Line Result + @device.name = "Device" +** Processing line: ~ @device.aspect.w = (u_for_16x9 w, h)[:w]~ +- Inside source: true +*** True Line Result + @device.aspect.w = (u_for_16x9 w, h)[:w] +** Processing line: ~ @device.aspect.h = (u_for_16x9 w, h)[:h]~ +- Inside source: true +*** True Line Result + @device.aspect.h = (u_for_16x9 w, h)[:h] +** Processing line: ~ @device.aspect.u = (u_for_16x9 w, h)[:u]~ +- Inside source: true +*** True Line Result + @device.aspect.u = (u_for_16x9 w, h)[:u] +** Processing line: ~ @device.safe_area.w = @device.aspect.u * 16~ +- Inside source: true +*** True Line Result + @device.safe_area.w = @device.aspect.u * 16 +** Processing line: ~ @device.safe_area.h = @device.aspect.u * 9~ +- Inside source: true +*** True Line Result + @device.safe_area.h = @device.aspect.u * 9 +** Processing line: ~ @device.safe_area.margin.left = ((@device.w - @device.safe_area.w).fdiv 2).floor~ +- Inside source: true +*** True Line Result + @device.safe_area.margin.left = ((@device.w - @device.safe_area.w).fdiv 2).floor +** Processing line: ~ @device.safe_area.margin.right = ((@device.w - @device.safe_area.w).fdiv 2).floor~ +- Inside source: true +*** True Line Result + @device.safe_area.margin.right = ((@device.w - @device.safe_area.w).fdiv 2).floor +** Processing line: ~ @device.safe_area.margin.top = ((@device.h - @device.safe_area.h).fdiv 2).floor~ +- Inside source: true +*** True Line Result + @device.safe_area.margin.top = ((@device.h - @device.safe_area.h).fdiv 2).floor +** Processing line: ~ @device.safe_area.margin.bottom = ((@device.h - @device.safe_area.h).fdiv 2).floor~ +- Inside source: true +*** True Line Result + @device.safe_area.margin.bottom = ((@device.h - @device.safe_area.h).fdiv 2).floor +** Processing line: ~ @device.grid_area.outer_gutter = @device.w / 80~ +- Inside source: true +*** True Line Result + @device.grid_area.outer_gutter = @device.w / 80 +** Processing line: ~ @device.grid_area.gutter = @device.w / 160~ +- Inside source: true +*** True Line Result + @device.grid_area.gutter = @device.w / 160 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @device.grid_area.w = @device.safe_area.w - (@device.grid_area.outer_gutter * 2)~ +- Inside source: true +*** True Line Result + @device.grid_area.w = @device.safe_area.w - (@device.grid_area.outer_gutter * 2) +** Processing line: ~ @device.grid_area.h = @device.safe_area.h - (@device.grid_area.outer_gutter * 2)~ +- Inside source: true +*** True Line Result + @device.grid_area.h = @device.safe_area.h - (@device.grid_area.outer_gutter * 2) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @device.grid_area.margin.left = ((@device.w - @device.grid_area.w).fdiv 2).floor~ +- Inside source: true +*** True Line Result + @device.grid_area.margin.left = ((@device.w - @device.grid_area.w).fdiv 2).floor +** Processing line: ~ @device.grid_area.margin.right = ((@device.w - @device.grid_area.w).fdiv 2).floor~ +- Inside source: true +*** True Line Result + @device.grid_area.margin.right = ((@device.w - @device.grid_area.w).fdiv 2).floor +** Processing line: ~ @device.grid_area.margin.top = ((@device.h - @device.grid_area.h).fdiv 2).floor~ +- Inside source: true +*** True Line Result + @device.grid_area.margin.top = ((@device.h - @device.grid_area.h).fdiv 2).floor +** Processing line: ~ @device.grid_area.margin.bottom = ((@device.h - @device.grid_area.h).fdiv 2).floor~ +- Inside source: true +*** True Line Result + @device.grid_area.margin.bottom = ((@device.h - @device.grid_area.h).fdiv 2).floor +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @device.grid_area.col_count = 24~ +- Inside source: true +*** True Line Result + @device.grid_area.col_count = 24 +** Processing line: ~ @device.grid_area.row_count = 12~ +- Inside source: true +*** True Line Result + @device.grid_area.row_count = 12 +** Processing line: ~ @device.grid_area.cell_w = ((@device.aspect.w - (@device.grid_area.outer_gutter * 2)) - ((@device.grid_area.col_count - 1) * @device.grid_area.gutter)).fdiv @device.grid_area.col_count~ +- Inside source: true +*** True Line Result + @device.grid_area.cell_w = ((@device.aspect.w - (@device.grid_area.outer_gutter * 2)) - ((@device.grid_area.col_count - 1) * @device.grid_area.gutter)).fdiv @device.grid_area.col_count +** Processing line: ~ @device.grid_area.cell_h = ((@device.aspect.h - (@device.grid_area.outer_gutter * 2)) - ((@device.grid_area.row_count - 1) * @device.grid_area.gutter)).fdiv @device.grid_area.row_count~ +- Inside source: true +*** True Line Result + @device.grid_area.cell_h = ((@device.aspect.h - (@device.grid_area.outer_gutter * 2)) - ((@device.grid_area.row_count - 1) * @device.grid_area.gutter)).fdiv @device.grid_area.row_count +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ @device.control_area.cell_size = @device.grid_area.cell_w~ +- Inside source: true +*** True Line Result + @device.control_area.cell_size = @device.grid_area.cell_w +** Processing line: ~ @device.control_area.cell_size = @device.grid_area.cell_h if @device.grid_area.cell_h < @device.grid_area.cell_w && @device.grid_area.cell_h > 0~ +- Inside source: true +*** True Line Result + @device.control_area.cell_size = @device.grid_area.cell_h if @device.grid_area.cell_h < @device.grid_area.cell_w && @device.grid_area.cell_h > 0 +** Processing line: ~ @device.control_area.cell_size = @device.control_area.cell_size.floor~ +- Inside source: true +*** True Line Result + @device.control_area.cell_size = @device.control_area.cell_size.floor +** Processing line: ~ @device.control_area.w = (@device.control_area.cell_size * @device.grid_area.col_count) + (@device.grid_area.gutter * (@device.grid_area.col_count - 1))~ +- Inside source: true +*** True Line Result + @device.control_area.w = (@device.control_area.cell_size * @device.grid_area.col_count) + (@device.grid_area.gutter * (@device.grid_area.col_count - 1)) +** Processing line: ~ @device.control_area.h = (@device.control_area.cell_size * @device.grid_area.row_count) + (@device.grid_area.gutter * (@device.grid_area.row_count - 1))~ +- Inside source: true +*** True Line Result + @device.control_area.h = (@device.control_area.cell_size * @device.grid_area.row_count) + (@device.grid_area.gutter * (@device.grid_area.row_count - 1)) +** Processing line: ~ @device.control_area.margin.left = (@device.w - @device.control_area.w).fdiv 2~ +- Inside source: true +*** True Line Result + @device.control_area.margin.left = (@device.w - @device.control_area.w).fdiv 2 +** Processing line: ~ @device.control_area.margin.right = (@device.w - @device.control_area.w).fdiv 2~ +- Inside source: true +*** True Line Result + @device.control_area.margin.right = (@device.w - @device.control_area.w).fdiv 2 +** Processing line: ~ @device.control_area.margin.top = (@device.h - @device.control_area.h).fdiv 2~ +- Inside source: true +*** True Line Result + @device.control_area.margin.top = (@device.h - @device.control_area.h).fdiv 2 +** Processing line: ~ @device.control_area.margin.bottom = (@device.h - @device.control_area.h).fdiv 2~ +- Inside source: true +*** True Line Result + @device.control_area.margin.bottom = (@device.h - @device.control_area.h).fdiv 2 +** Processing line: ~ @device~ +- Inside source: true +*** True Line Result + @device +** 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 + def serialize +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ device: @device.serialize,~ +- Inside source: true +*** True Line Result + device: @device.serialize, +** 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 inspect~ +- Inside source: true +*** True Line Result + def inspect +** Processing line: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.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: ~ serialize.to_s~ +- Inside source: true +*** True Line Result + serialize.to_s +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** log.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** log.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/log.rb~ +- Inside source: true +*** True Line Result + # ./dragon/log.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # log.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # log.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ XTERM_COLOR = {~ +- Inside source: true +*** True Line Result + XTERM_COLOR = { +** Processing line: ~ black: "\u001b[30m",~ +- Inside source: true +*** True Line Result + black: "\u001b[30m", +** Processing line: ~ red: "\u001b[31m",~ +- Inside source: true +*** True Line Result + red: "\u001b[31m", +** Processing line: ~ green: "\u001b[32m",~ +- Inside source: true +*** True Line Result + green: "\u001b[32m", +** Processing line: ~ yellow: "\u001b[33m",~ +- Inside source: true +*** True Line Result + yellow: "\u001b[33m", +** Processing line: ~ blue: "\u001b[34m",~ +- Inside source: true +*** True Line Result + blue: "\u001b[34m", +** Processing line: ~ magenta: "\u001b[35m",~ +- Inside source: true +*** True Line Result + magenta: "\u001b[35m", +** Processing line: ~ cyan: "\u001b[36m",~ +- Inside source: true +*** True Line Result + cyan: "\u001b[36m", +** Processing line: ~ white: "\u001b[37m",~ +- Inside source: true +*** True Line Result + white: "\u001b[37m", +** Processing line: ~ bright_black: "\u001b[30;1m",~ +- Inside source: true +*** True Line Result + bright_black: "\u001b[30;1m", +** Processing line: ~ bright_red: "\u001b[31;1m",~ +- Inside source: true +*** True Line Result + bright_red: "\u001b[31;1m", +** Processing line: ~ bright_green: "\u001b[32;1m",~ +- Inside source: true +*** True Line Result + bright_green: "\u001b[32;1m", +** Processing line: ~ bright_yellow: "\u001b[33;1m",~ +- Inside source: true +*** True Line Result + bright_yellow: "\u001b[33;1m", +** Processing line: ~ bright_blue: "\u001b[34;1m",~ +- Inside source: true +*** True Line Result + bright_blue: "\u001b[34;1m", +** Processing line: ~ bright_magenta: "\u001b[35;1m",~ +- Inside source: true +*** True Line Result + bright_magenta: "\u001b[35;1m", +** Processing line: ~ bright_cyan: "\u001b[36;1m",~ +- Inside source: true +*** True Line Result + bright_cyan: "\u001b[36;1m", +** Processing line: ~ bright_white: "\u001b[37;1m",~ +- Inside source: true +*** True Line Result + bright_white: "\u001b[37;1m", +** Processing line: ~ reset: "\u001b[0m",~ +- Inside source: true +*** True Line Result + reset: "\u001b[0m", +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Log~ +- Inside source: true +*** True Line Result + class Log +** Processing line: ~ def self.write_to_log_and_puts *args~ +- Inside source: true +*** True Line Result + def self.write_to_log_and_puts *args +** Processing line: ~ return if $gtk.production~ +- Inside source: true +*** True Line Result + return if $gtk.production +** Processing line: ~ $gtk.append_file_root 'logs/log.txt', args.join("\n") + "\n"~ +- Inside source: true +*** True Line Result + $gtk.append_file_root 'logs/log.txt', args.join("\n") + "\n" +** Processing line: ~ args.each { |obj| $gtk.log obj, self }~ +- Inside source: true +*** True Line Result + args.each { |obj| $gtk.log obj, self } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.write_to_log_and_print *args~ +- Inside source: true +*** True Line Result + def self.write_to_log_and_print *args +** Processing line: ~ return if $gtk.production~ +- Inside source: true +*** True Line Result + return if $gtk.production +** Processing line: ~ $gtk.append_file_root 'logs/log.txt', args.join("\n")~ +- Inside source: true +*** True Line Result + $gtk.append_file_root 'logs/log.txt', args.join("\n") +** Processing line: ~ Object.print(*args)~ +- Inside source: true +*** True Line Result + Object.print(*args) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.puts_important *args~ +- Inside source: true +*** True Line Result + def self.puts_important *args +** Processing line: ~ return if $gtk.production~ +- Inside source: true +*** True Line Result + return if $gtk.production +** Processing line: ~ $gtk.append_file_root 'logs/log.txt', args.join("\n")~ +- Inside source: true +*** True Line Result + $gtk.append_file_root 'logs/log.txt', args.join("\n") +** Processing line: ~ $gtk.notify! "Important notification occurred."~ +- Inside source: true +*** True Line Result + $gtk.notify! "Important notification occurred." +** Processing line: ~ args.each { |obj| $gtk.log obj }~ +- Inside source: true +*** True Line Result + args.each { |obj| $gtk.log obj } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.puts *args~ +- Inside source: true +*** True Line Result + def self.puts *args +** Processing line: ~ message_id, message = args~ +- Inside source: true +*** True Line Result + message_id, message = args +** Processing line: ~ message ||= message_id~ +- Inside source: true +*** True Line Result + message ||= message_id +** Processing line: ~ write_to_log_and_puts message~ +- Inside source: true +*** True Line Result + write_to_log_and_puts message +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.multiline? *args~ +- Inside source: true +*** True Line Result + def self.multiline? *args +** Processing line: ~ return true if args.length > 1~ +- Inside source: true +*** True Line Result + return true if args.length > 1 +** Processing line: ~ return !args[0].to_s.multiline?~ +- Inside source: true +*** True Line Result + return !args[0].to_s.multiline? +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.join_lines args~ +- Inside source: true +*** True Line Result + def self.join_lines args +** Processing line: ~ return "" if args.length == 0~ +- Inside source: true +*** True Line Result + return "" if args.length == 0 +** Processing line: ~ return args if args.is_a? String~ +- Inside source: true +*** True Line Result + return args if args.is_a? String +** Processing line: ~ return args[0] if args.length == 1~ +- Inside source: true +*** True Line Result + return args[0] if args.length == 1 +** Processing line: ~ return args.to_s.join("\n")~ +- Inside source: true +*** True Line Result + return args.to_s.join("\n") +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.headline name~ +- Inside source: true +*** True Line Result + def self.headline name +** Processing line: ~ @asterisk_count ||= 1~ +- Inside source: true +*** True Line Result + @asterisk_count ||= 1 +** Processing line: ~ @asterisk_count = @asterisk_count.greater(1)~ +- Inside source: true +*** True Line Result + @asterisk_count = @asterisk_count.greater(1) +** Processing line: ~ result_from_yield = join_lines yield~ +- Inside source: true +*** True Line Result + result_from_yield = join_lines yield +** Processing line: ~ result_from_yield = result_from_yield.each_line.map { |l| " #{l}" }.join~ +- Inside source: true +*** True Line Result + result_from_yield = result_from_yield.each_line.map { |l| " #{l}" }.join +** Processing line: ~ r ="#{"*" * @asterisk_count} #{name}\n#{result_from_yield}"~ +- Inside source: true +*** True Line Result + r ="#{"*" * @asterisk_count} #{name}\n#{result_from_yield}" +** Processing line: ~ @asterisk_count -= 1~ +- Inside source: true +*** True Line Result + @asterisk_count -= 1 +** Processing line: ~ @asterisk_count = @asterisk_count.greater(1)~ +- Inside source: true +*** True Line Result + @asterisk_count = @asterisk_count.greater(1) +** 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 self.dynamic_block~ +- Inside source: true +*** True Line Result + def self.dynamic_block +** Processing line: ~ "#+BEGIN:~ +- Inside source: true +*** True Line Result + "#+BEGIN: +** Processing line: ~ #{join_lines yield}~ +- Inside source: true +*** True Line Result + #{join_lines yield} +** 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: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.puts_error *args~ +- Inside source: true +*** True Line Result + def self.puts_error *args +** Processing line: ~ args ||= []~ +- Inside source: true +*** True Line Result + args ||= [] +** Processing line: ~ title = args[0]~ +- Inside source: true +*** True Line Result + title = args[0] +** Processing line: ~ additional = args[1..-1] || []~ +- Inside source: true +*** True Line Result + additional = args[1..-1] || [] +** Processing line: ~ additional = "" if additional.length == 0~ +- Inside source: true +*** True Line Result + additional = "" if additional.length == 0 +** Processing line: ~ if !title.multiline? && join_lines(additional).multiline?~ +- Inside source: true +*** True Line Result + if !title.multiline? && join_lines(additional).multiline? +** Processing line: ~ message = headline "ERROR: #{title}" do~ +- Inside source: true +*** True Line Result + message = headline "ERROR: #{title}" do +** Processing line: ~ dynamic_block do~ +- Inside source: true +*** True Line Result + dynamic_block do +** Processing line: ~ additional~ +- Inside source: true +*** True Line Result + additional +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ elsif title.multiline?~ +- Inside source: true +*** True Line Result + elsif title.multiline? +** Processing line: ~ message = headline "ERROR: " do~ +- Inside source: true +*** True Line Result + message = headline "ERROR: " do +** Processing line: ~ dynamic_block do~ +- Inside source: true +*** True Line Result + dynamic_block do +** Processing line: ~ args~ +- Inside source: true +*** True Line Result + args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ message = "* ERROR: #{title} #{additional}".strip~ +- Inside source: true +*** True Line Result + message = "* ERROR: #{title} #{additional}".strip +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ self.puts message~ +- Inside source: true +*** True Line Result + self.puts message +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.puts_info *args~ +- Inside source: true +*** True Line Result + def self.puts_info *args +** Processing line: ~ args ||= []~ +- Inside source: true +*** True Line Result + args ||= [] +** Processing line: ~ title = args[0]~ +- Inside source: true +*** True Line Result + title = args[0] +** Processing line: ~ additional = args[1..-1] || []~ +- Inside source: true +*** True Line Result + additional = args[1..-1] || [] +** Processing line: ~ additional = "" if additional.length == 0~ +- Inside source: true +*** True Line Result + additional = "" if additional.length == 0 +** Processing line: ~ if !title.multiline? && join_lines(additional).multiline?~ +- Inside source: true +*** True Line Result + if !title.multiline? && join_lines(additional).multiline? +** Processing line: ~ message = headline "INFO: #{title}" do~ +- Inside source: true +*** True Line Result + message = headline "INFO: #{title}" do +** Processing line: ~ dynamic_block do~ +- Inside source: true +*** True Line Result + dynamic_block do +** Processing line: ~ additional~ +- Inside source: true +*** True Line Result + additional +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ elsif title.multiline?~ +- Inside source: true +*** True Line Result + elsif title.multiline? +** Processing line: ~ message = headline "INFO: " do~ +- Inside source: true +*** True Line Result + message = headline "INFO: " do +** Processing line: ~ dynamic_block do~ +- Inside source: true +*** True Line Result + dynamic_block do +** Processing line: ~ args~ +- Inside source: true +*** True Line Result + args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ message = "* INFO: #{title} #{additional}".strip~ +- Inside source: true +*** True Line Result + message = "* INFO: #{title} #{additional}".strip +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ self.puts message~ +- Inside source: true +*** True Line Result + self.puts message +** 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 + def self.puts_once *ids, message +** Processing line: ~ id = "#{ids}"~ +- Inside source: true +*** True Line Result + id = "#{ids}" +** Processing line: ~ @once ||= {}~ +- Inside source: true +*** True Line Result + @once ||= {} +** Processing line: ~ return if @once[id]~ +- Inside source: true +*** True Line Result + return if @once[id] +** Processing line: ~ @once[id] = id~ +- Inside source: true +*** True Line Result + @once[id] = id +** Processing line: ~ if !$gtk.cli_arguments[:replay] && !$gtk.cli_arguments[:record]~ +- Inside source: true +*** True Line Result + if !$gtk.cli_arguments[:replay] && !$gtk.cli_arguments[:record] +** Processing line: ~ $gtk.notify!("Open the DragonRuby Console by pressing [`] [~] [²] [^] [º] or [§]. [Message ID: #{id}].")~ +- Inside source: true +*** True Line Result + $gtk.notify!("Open the DragonRuby Console by pressing [`] [~] [²] [^] [º] or [§]. [Message ID: #{id}].") +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ write_to_log_and_puts ""~ +- Inside source: true +*** True Line Result + write_to_log_and_puts "" +** Processing line: ~ write_to_log_and_puts "#{message.strip}"~ +- Inside source: true +*** True Line Result + write_to_log_and_puts "#{message.strip}" +** Processing line: ~ write_to_log_and_puts ""~ +- Inside source: true +*** True Line Result + write_to_log_and_puts "" +** Processing line: ~ write_to_log_and_puts "[Message ID: #{id}]"~ +- Inside source: true +*** True Line Result + write_to_log_and_puts "[Message ID: #{id}]" +** Processing line: ~ write_to_log_and_puts ""~ +- Inside source: true +*** True Line Result + write_to_log_and_puts "" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.puts_once_info *ids, message~ +- Inside source: true +*** True Line Result + def self.puts_once_info *ids, message +** Processing line: ~ id = "#{ids}"~ +- Inside source: true +*** True Line Result + id = "#{ids}" +** Processing line: ~ @once ||= {}~ +- Inside source: true +*** True Line Result + @once ||= {} +** Processing line: ~ return if @once[id]~ +- Inside source: true +*** True Line Result + return if @once[id] +** Processing line: ~ @once[id] = id~ +- Inside source: true +*** True Line Result + @once[id] = id +** Processing line: ~ log_info message~ +- Inside source: true +*** True Line Result + log_info message +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.print *args~ +- Inside source: true +*** True Line Result + def self.print *args +** Processing line: ~ write_to_log_and_print(*args)~ +- Inside source: true +*** True Line Result + write_to_log_and_print(*args) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ class Object~ +- Inside source: true +*** True Line Result + class Object +** Processing line: ~ def log_print *args~ +- Inside source: true +*** True Line Result + def log_print *args +** Processing line: ~ GTK::Log.print(*args)~ +- Inside source: true +*** True Line Result + GTK::Log.print(*args) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_important *args~ +- Inside source: true +*** True Line Result + def log_important *args +** Processing line: ~ GTK::Log.puts_important(*args)~ +- Inside source: true +*** True Line Result + GTK::Log.puts_important(*args) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log *args~ +- Inside source: true +*** True Line Result + def log *args +** Processing line: ~ GTK::Log.puts(*args)~ +- Inside source: true +*** True Line Result + GTK::Log.puts(*args) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_with_color xterm_escape_code, *args~ +- Inside source: true +*** True Line Result + def log_with_color xterm_escape_code, *args +** Processing line: ~ log_print xterm_escape_code~ +- Inside source: true +*** True Line Result + log_print xterm_escape_code +** Processing line: ~ log(*args)~ +- Inside source: true +*** True Line Result + log(*args) +** Processing line: ~ ensure~ +- Inside source: true +*** True Line Result + ensure +** Processing line: ~ log_reset_color~ +- Inside source: true +*** True Line Result + log_reset_color +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_reset_color~ +- Inside source: true +*** True Line Result + def log_reset_color +** Processing line: ~ log_print XTERM_COLOR[:reset]~ +- Inside source: true +*** True Line Result + log_print XTERM_COLOR[:reset] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_black *args~ +- Inside source: true +*** True Line Result + def log_black *args +** Processing line: ~ log_with_color XTERM_COLOR[:black], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:black], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_red *args~ +- Inside source: true +*** True Line Result + def log_red *args +** Processing line: ~ log_with_color XTERM_COLOR[:red], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:red], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_green *args~ +- Inside source: true +*** True Line Result + def log_green *args +** Processing line: ~ log_with_color XTERM_COLOR[:green], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:green], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_yellow *args~ +- Inside source: true +*** True Line Result + def log_yellow *args +** Processing line: ~ log_with_color XTERM_COLOR[:yellow], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:yellow], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_blue *args~ +- Inside source: true +*** True Line Result + def log_blue *args +** Processing line: ~ log_with_color XTERM_COLOR[:blue], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:blue], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_magenta *args~ +- Inside source: true +*** True Line Result + def log_magenta *args +** Processing line: ~ log_with_color XTERM_COLOR[:magenta], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:magenta], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_cyan *args~ +- Inside source: true +*** True Line Result + def log_cyan *args +** Processing line: ~ log_with_color XTERM_COLOR[:cyan], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:cyan], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_white *args~ +- Inside source: true +*** True Line Result + def log_white *args +** Processing line: ~ log_with_color XTERM_COLOR[:white], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:white], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_bright_black *args~ +- Inside source: true +*** True Line Result + def log_bright_black *args +** Processing line: ~ log_with_color XTERM_COLOR[:bright_black], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:bright_black], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_bright_red *args~ +- Inside source: true +*** True Line Result + def log_bright_red *args +** Processing line: ~ log_with_color XTERM_COLOR[:bright_red], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:bright_red], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_bright_green *args~ +- Inside source: true +*** True Line Result + def log_bright_green *args +** Processing line: ~ log_with_color XTERM_COLOR[:bright_green], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:bright_green], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_bright_yellow *args~ +- Inside source: true +*** True Line Result + def log_bright_yellow *args +** Processing line: ~ log_with_color XTERM_COLOR[:bright_yellow], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:bright_yellow], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_bright_blue *args~ +- Inside source: true +*** True Line Result + def log_bright_blue *args +** Processing line: ~ log_with_color XTERM_COLOR[:bright_blue], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:bright_blue], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_bright_magenta *args~ +- Inside source: true +*** True Line Result + def log_bright_magenta *args +** Processing line: ~ log_with_color XTERM_COLOR[:bright_magenta], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:bright_magenta], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_bright_cyan *args~ +- Inside source: true +*** True Line Result + def log_bright_cyan *args +** Processing line: ~ log_with_color XTERM_COLOR[:bright_cyan], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:bright_cyan], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_bright_white *args~ +- Inside source: true +*** True Line Result + def log_bright_white *args +** Processing line: ~ log_with_color XTERM_COLOR[:bright_white], *args~ +- Inside source: true +*** True Line Result + log_with_color XTERM_COLOR[:bright_white], *args +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_error *args~ +- Inside source: true +*** True Line Result + def log_error *args +** Processing line: ~ GTK::Log.puts_error(*args)~ +- Inside source: true +*** True Line Result + GTK::Log.puts_error(*args) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_info *args~ +- Inside source: true +*** True Line Result + def log_info *args +** Processing line: ~ GTK::Log.puts_info(*args)~ +- Inside source: true +*** True Line Result + GTK::Log.puts_info(*args) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_once *ids, message~ +- Inside source: true +*** True Line Result + def log_once *ids, message +** Processing line: ~ GTK::Log.puts_once(*ids, message)~ +- Inside source: true +*** True Line Result + GTK::Log.puts_once(*ids, message) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_once_info *ids, message~ +- Inside source: true +*** True Line Result + def log_once_info *ids, message +** Processing line: ~ GTK::Log.puts_once_info(*ids, message)~ +- Inside source: true +*** True Line Result + GTK::Log.puts_once_info(*ids, message) +** 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 + +*** True Line Result +*** numeric.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/numeric.rb~ +- Inside source: true +*** True Line Result + # ./dragon/numeric.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # numeric.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # numeric.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ class Numeric~ +- Inside source: true +*** True Line Result + class Numeric +** Processing line: ~ include ValueType~ +- Inside source: true +*** True Line Result + include ValueType +** Processing line: ~ include NumericDeprecated~ +- Inside source: true +*** True Line Result + include NumericDeprecated +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ alias_method :gt, :>~ +- Inside source: true +*** True Line Result + alias_method :gt, :> +** Processing line: ~ alias_method :gte, :>=~ +- Inside source: true +*** True Line Result + alias_method :gte, :>= +** Processing line: ~ alias_method :lt, :<~ +- Inside source: true +*** True Line Result + alias_method :lt, :< +** Processing line: ~ alias_method :lte, :<=~ +- Inside source: true +*** True Line Result + alias_method :lte, :<= +** Processing line: ~ alias_method :__original_eq_eq__, :== unless Numeric.instance_methods.include? :__original_eq_eq__~ +- Inside source: true +*** True Line Result + alias_method :__original_eq_eq__, :== unless Numeric.instance_methods.include? :__original_eq_eq__ +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Converts a numeric value representing seconds into frames.~ +- Inside source: true +*** True Line Result + # Converts a numeric value representing seconds into frames. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def seconds~ +- Inside source: true +*** True Line Result + def seconds +** Processing line: ~ self * 60~ +- Inside source: true +*** True Line Result + self * 60 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Divides the number by `2.0` and returns a `float`.~ +- Inside source: true +*** True Line Result + # Divides the number by `2.0` and returns a `float`. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def half~ +- Inside source: true +*** True Line Result + def half +** Processing line: ~ self / 2.0~ +- Inside source: true +*** True Line Result + self / 2.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 + def to_byte +** Processing line: ~ clamp(0, 255).to_i~ +- Inside source: true +*** True Line Result + clamp(0, 255).to_i +** 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 + def clamp_wrap min, max +** Processing line: ~ max, min = min, max if min > max~ +- Inside source: true +*** True Line Result + max, min = min, max if min > max +** Processing line: ~ return self if self >= min && self <= max~ +- Inside source: true +*** True Line Result + return self if self >= min && self <= max +** Processing line: ~ return min if min == max~ +- Inside source: true +*** True Line Result + return min if min == max +** Processing line: ~ if self < min~ +- Inside source: true +*** True Line Result + if self < min +** Processing line: ~ overflow = min - self~ +- Inside source: true +*** True Line Result + overflow = min - self +** Processing line: ~ return (max - overflow).clamp_wrap min, max~ +- Inside source: true +*** True Line Result + return (max - overflow).clamp_wrap min, max +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if self > max~ +- Inside source: true +*** True Line Result + if self > max +** Processing line: ~ overflow = self - max~ +- Inside source: true +*** True Line Result + overflow = self - max +** Processing line: ~ return (min + overflow).clamp_wrap min, max~ +- Inside source: true +*** True Line Result + return (min + overflow).clamp_wrap min, max +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** 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 elapsed_time tick_count_override = nil~ +- Inside source: true +*** True Line Result + def elapsed_time tick_count_override = nil +** Processing line: ~ (tick_count_override || Kernel.tick_count) - self~ +- Inside source: true +*** True Line Result + (tick_count_override || Kernel.tick_count) - self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def elapsed_time_percent duration~ +- Inside source: true +*** True Line Result + def elapsed_time_percent duration +** Processing line: ~ elapsed_time.percentage_of duration~ +- Inside source: true +*** True Line Result + elapsed_time.percentage_of duration +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def new?~ +- Inside source: true +*** True Line Result + def new? +** Processing line: ~ elapsed_time == 0~ +- Inside source: true +*** True Line Result + elapsed_time == 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns `true` if the numeric value has passed a duration/offset number.~ +- Inside source: true +*** True Line Result + # Returns `true` if the numeric value has passed a duration/offset number. +** Processing line: ~ # `Kernel.tick_count` is used to determine if a number represents an elapsed~ +- Inside source: true +*** True Line Result + # `Kernel.tick_count` is used to determine if a number represents an elapsed +** Processing line: ~ # moment in time.~ +- Inside source: true +*** True Line Result + # moment in time. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def elapsed? offset = 0, tick_count_override = Kernel.tick_count~ +- Inside source: true +*** True Line Result + def elapsed? offset = 0, tick_count_override = Kernel.tick_count +** Processing line: ~ (self + offset) < tick_count_override~ +- Inside source: true +*** True Line Result + (self + offset) < tick_count_override +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def frame_index *opts~ +- Inside source: true +*** True Line Result + def frame_index *opts +** Processing line: ~ frame_count_or_hash, hold_for, repeat, tick_count_override = opts~ +- Inside source: true +*** True Line Result + frame_count_or_hash, hold_for, repeat, tick_count_override = opts +** Processing line: ~ if frame_count_or_hash.is_a? Hash~ +- Inside source: true +*** True Line Result + if frame_count_or_hash.is_a? Hash +** Processing line: ~ frame_count = frame_count_or_hash[:count]~ +- Inside source: true +*** True Line Result + frame_count = frame_count_or_hash[:count] +** Processing line: ~ hold_for = frame_count_or_hash[:hold_for]~ +- Inside source: true +*** True Line Result + hold_for = frame_count_or_hash[:hold_for] +** Processing line: ~ repeat = frame_count_or_hash[:repeat]~ +- Inside source: true +*** True Line Result + repeat = frame_count_or_hash[:repeat] +** Processing line: ~ tick_count_override = frame_count_or_hash[:tick_count_override]~ +- Inside source: true +*** True Line Result + tick_count_override = frame_count_or_hash[:tick_count_override] +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ frame_count = frame_count_or_hash~ +- Inside source: true +*** True Line Result + frame_count = frame_count_or_hash +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ tick_count_override ||= Kernel.tick_count~ +- Inside source: true +*** True Line Result + tick_count_override ||= Kernel.tick_count +** Processing line: ~ animation_frame_count = frame_count~ +- Inside source: true +*** True Line Result + animation_frame_count = frame_count +** Processing line: ~ animation_frame_hold_time = hold_for~ +- Inside source: true +*** True Line Result + animation_frame_hold_time = hold_for +** Processing line: ~ animation_length = animation_frame_hold_time * animation_frame_count~ +- Inside source: true +*** True Line Result + animation_length = animation_frame_hold_time * animation_frame_count +** Processing line: ~ return nil if Kernel.tick_count < self~ +- Inside source: true +*** True Line Result + return nil if Kernel.tick_count < self +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !repeat && (self + animation_length) < (tick_count_override - 1)~ +- Inside source: true +*** True Line Result + if !repeat && (self + animation_length) < (tick_count_override - 1) +** Processing line: ~ return nil~ +- Inside source: true +*** True Line Result + return nil +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ return self.elapsed_time.-(1).idiv(animation_frame_hold_time) % animation_frame_count~ +- Inside source: true +*** True Line Result + return self.elapsed_time.-(1).idiv(animation_frame_hold_time) % animation_frame_count +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ #{opts}~ +- Inside source: true +*** True Line Result + #{opts} +** Processing line: ~ #{e}~ +- Inside source: true +*** True Line Result + #{e} +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def zero?~ +- Inside source: true +*** True Line Result + def zero? +** Processing line: ~ self == 0~ +- Inside source: true +*** True Line Result + self == 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def zero~ +- Inside source: true +*** True Line Result + def zero +** 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 one~ +- Inside source: true +*** True Line Result + def one +** Processing line: ~ 1~ +- Inside source: true +*** True Line Result + 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def two~ +- Inside source: true +*** True Line Result + def two +** Processing line: ~ 2~ +- Inside source: true +*** True Line Result + 2 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def five~ +- Inside source: true +*** True Line Result + def five +** Processing line: ~ 5~ +- Inside source: true +*** True Line Result + 5 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def ten~ +- Inside source: true +*** True Line Result + def ten +** Processing line: ~ 10~ +- Inside source: true +*** True Line Result + 10 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ alias_method :gt, :>~ +- Inside source: true +*** True Line Result + alias_method :gt, :> +** Processing line: ~ alias_method :above?, :>~ +- Inside source: true +*** True Line Result + alias_method :above?, :> +** Processing line: ~ alias_method :right_of?, :>~ +- Inside source: true +*** True Line Result + alias_method :right_of?, :> +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ alias_method :lt, :<~ +- Inside source: true +*** True Line Result + alias_method :lt, :< +** Processing line: ~ alias_method :below?, :<~ +- Inside source: true +*** True Line Result + alias_method :below?, :< +** Processing line: ~ alias_method :left_of?, :<~ +- Inside source: true +*** True Line Result + alias_method :left_of?, :< +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def shift_right i~ +- Inside source: true +*** True Line Result + def shift_right i +** Processing line: ~ self + i~ +- Inside source: true +*** True Line Result + self + i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def shift_left i~ +- Inside source: true +*** True Line Result + def shift_left i +** Processing line: ~ shift_right(i * -1)~ +- Inside source: true +*** True Line Result + shift_right(i * -1) +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise_immediately e, :shift_left, i~ +- Inside source: true +*** True Line Result + raise_immediately e, :shift_left, i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def shift_up i~ +- Inside source: true +*** True Line Result + def shift_up i +** Processing line: ~ self + i~ +- Inside source: true +*** True Line Result + self + i +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise_immediately e, :shift_up, i~ +- Inside source: true +*** True Line Result + raise_immediately e, :shift_up, i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def shift_down i~ +- Inside source: true +*** True Line Result + def shift_down i +** Processing line: ~ shift_up(i * -1)~ +- Inside source: true +*** True Line Result + shift_up(i * -1) +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise_immediately e, :shift_down, i~ +- Inside source: true +*** True Line Result + raise_immediately e, :shift_down, i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # This provides a way for a numeric value to be randomized based on a combination~ +- Inside source: true +*** True Line Result + # This provides a way for a numeric value to be randomized based on a combination +** Processing line: ~ # of two options: `:sign` and `:ratio`.~ +- Inside source: true +*** True Line Result + # of two options: `:sign` and `:ratio`. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def randomize *definitions~ +- Inside source: true +*** True Line Result + def randomize *definitions +** Processing line: ~ result = self~ +- Inside source: true +*** True Line Result + result = self +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if definitions.include?(:sign)~ +- Inside source: true +*** True Line Result + if definitions.include?(:sign) +** Processing line: ~ result = rand_sign~ +- Inside source: true +*** True Line Result + result = rand_sign +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if definitions.include?(:ratio)~ +- Inside source: true +*** True Line Result + if definitions.include?(:ratio) +** Processing line: ~ result = rand * result~ +- Inside source: true +*** True Line Result + result = rand * result +** Processing line: ~ elsif definitions.include?(:int)~ +- Inside source: true +*** True Line Result + elsif definitions.include?(:int) +** Processing line: ~ result = (rand result)~ +- Inside source: true +*** True Line Result + result = (rand result) +** 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: ~ def rand_sign~ +- Inside source: true +*** True Line Result + def rand_sign +** Processing line: ~ return self * -1 if rand > 0.5~ +- Inside source: true +*** True Line Result + return self * -1 if rand > 0.5 +** Processing line: ~ self~ +- Inside source: true +*** True Line Result + self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def rand_ratio~ +- Inside source: true +*** True Line Result + def rand_ratio +** Processing line: ~ self * rand~ +- Inside source: true +*** True Line Result + self * rand +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def remainder_of_divide n~ +- Inside source: true +*** True Line Result + def remainder_of_divide n +** Processing line: ~ mod n~ +- Inside source: true +*** True Line Result + mod n +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Easing function progress/percentage for a specific point in time.~ +- Inside source: true +*** True Line Result + # Easing function progress/percentage for a specific point in time. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def ease_extended tick_count_override, duration, default_before, default_after, *definitions~ +- Inside source: true +*** True Line Result + def ease_extended tick_count_override, duration, default_before, default_after, *definitions +** Processing line: ~ GTK::Easing.ease_extended self,~ +- Inside source: true +*** True Line Result + GTK::Easing.ease_extended self, +** Processing line: ~ tick_count_override,~ +- Inside source: true +*** True Line Result + tick_count_override, +** Processing line: ~ self + duration,~ +- Inside source: true +*** True Line Result + self + duration, +** Processing line: ~ default_before,~ +- Inside source: true +*** True Line Result + default_before, +** Processing line: ~ default_after,~ +- Inside source: true +*** True Line Result + default_after, +** Processing line: ~ *definitions~ +- Inside source: true +*** True Line Result + *definitions +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Easing function progress/percentage for a specific point in time.~ +- Inside source: true +*** True Line Result + # Easing function progress/percentage for a specific point in time. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def global_ease duration, *definitions~ +- Inside source: true +*** True Line Result + def global_ease duration, *definitions +** Processing line: ~ ease_extended Kernel.global_tick_count,~ +- Inside source: true +*** True Line Result + ease_extended Kernel.global_tick_count, +** Processing line: ~ duration,~ +- Inside source: true +*** True Line Result + duration, +** Processing line: ~ GTK::Easing.initial_value(*definitions),~ +- Inside source: true +*** True Line Result + GTK::Easing.initial_value(*definitions), +** Processing line: ~ GTK::Easing.final_value(*definitions),~ +- Inside source: true +*** True Line Result + GTK::Easing.final_value(*definitions), +** Processing line: ~ *definitions~ +- Inside source: true +*** True Line Result + *definitions +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Easing function progress/percentage for a specific point in time.~ +- Inside source: true +*** True Line Result + # Easing function progress/percentage for a specific point in time. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def ease duration, *definitions~ +- Inside source: true +*** True Line Result + def ease duration, *definitions +** Processing line: ~ ease_extended Kernel.tick_count,~ +- Inside source: true +*** True Line Result + ease_extended Kernel.tick_count, +** Processing line: ~ duration,~ +- Inside source: true +*** True Line Result + duration, +** Processing line: ~ GTK::Easing.initial_value(*definitions),~ +- Inside source: true +*** True Line Result + GTK::Easing.initial_value(*definitions), +** Processing line: ~ GTK::Easing.final_value(*definitions),~ +- Inside source: true +*** True Line Result + GTK::Easing.final_value(*definitions), +** Processing line: ~ *definitions~ +- Inside source: true +*** True Line Result + *definitions +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Easing function progress/percentage for a specific point in time.~ +- Inside source: true +*** True Line Result + # Easing function progress/percentage for a specific point in time. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def ease_spline_extended tick_count_override, duration, spline~ +- Inside source: true +*** True Line Result + def ease_spline_extended tick_count_override, duration, spline +** Processing line: ~ GTK::Easing.ease_spline_extended self,~ +- Inside source: true +*** True Line Result + GTK::Easing.ease_spline_extended self, +** Processing line: ~ tick_count_override,~ +- Inside source: true +*** True Line Result + tick_count_override, +** Processing line: ~ self + duration,~ +- Inside source: true +*** True Line Result + self + duration, +** Processing line: ~ spline~ +- Inside source: true +*** True Line Result + spline +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Easing function progress/percentage for a specific point in time.~ +- Inside source: true +*** True Line Result + # Easing function progress/percentage for a specific point in time. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def global_ease_spline duration, spline~ +- Inside source: true +*** True Line Result + def global_ease_spline duration, spline +** Processing line: ~ ease_spline_extended Kernel.global_tick_count,~ +- Inside source: true +*** True Line Result + ease_spline_extended Kernel.global_tick_count, +** Processing line: ~ duration,~ +- Inside source: true +*** True Line Result + duration, +** Processing line: ~ spline~ +- Inside source: true +*** True Line Result + spline +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Easing function progress/percentage for a specific point in time.~ +- Inside source: true +*** True Line Result + # Easing function progress/percentage for a specific point in time. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def ease_spline duration, spline~ +- Inside source: true +*** True Line Result + def ease_spline duration, spline +** Processing line: ~ ease_spline_extended Kernel.tick_count,~ +- Inside source: true +*** True Line Result + ease_spline_extended Kernel.tick_count, +** Processing line: ~ duration,~ +- Inside source: true +*** True Line Result + duration, +** Processing line: ~ spline~ +- Inside source: true +*** True Line Result + spline +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Converts a number representing an angle in degrees to radians.~ +- Inside source: true +*** True Line Result + # Converts a number representing an angle in degrees to radians. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def to_radians~ +- Inside source: true +*** True Line Result + def to_radians +** Processing line: ~ self * Math::PI.fdiv(180)~ +- Inside source: true +*** True Line Result + self * Math::PI.fdiv(180) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Converts a number representing an angle in radians to degress.~ +- Inside source: true +*** True Line Result + # Converts a number representing an angle in radians to degress. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def to_degrees~ +- Inside source: true +*** True Line Result + def to_degrees +** Processing line: ~ self / Math::PI.fdiv(180)~ +- Inside source: true +*** True Line Result + self / Math::PI.fdiv(180) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Given `self`, a rectangle primitive is returned.~ +- Inside source: true +*** True Line Result + # Given `self`, a rectangle primitive is returned. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @example~ +- Inside source: true +*** True Line Result + # @example +** Processing line: ~ # 5.to_square 100, 300 # returns [100, 300, 5, 5]~ +- Inside source: true +*** True Line Result + # 5.to_square 100, 300 # returns [100, 300, 5, 5] +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def to_square x, y, anchor_x = 0.5, anchor_y = nil~ +- Inside source: true +*** True Line Result + def to_square x, y, anchor_x = 0.5, anchor_y = nil +** Processing line: ~ GTK::Geometry.to_square(self, x, y, anchor_x, anchor_y)~ +- Inside source: true +*** True Line Result + GTK::Geometry.to_square(self, x, y, anchor_x, anchor_y) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns a normal vector for a number that represents an angle in degress.~ +- Inside source: true +*** True Line Result + # Returns a normal vector for a number that represents an angle in degress. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def vector max_value = 1~ +- Inside source: true +*** True Line Result + def vector max_value = 1 +** Processing line: ~ [vector_x(max_value), vector_y(max_value)]~ +- Inside source: true +*** True Line Result + [vector_x(max_value), vector_y(max_value)] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- 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.~ +- Inside source: true +*** True Line Result + # Returns the y component of a normal vector for a number that represents an angle in degress. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def vector_y max_value = 1~ +- Inside source: true +*** True Line Result + def vector_y max_value = 1 +** Processing line: ~ max_value * Math.sin(self.to_radians)~ +- Inside source: true +*** True Line Result + max_value * Math.sin(self.to_radians) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- 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.~ +- Inside source: true +*** True Line Result + # Returns the x component of a normal vector for a number that represents an angle in degress. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def vector_x max_value = 1~ +- Inside source: true +*** True Line Result + def vector_x max_value = 1 +** Processing line: ~ max_value * Math.cos(self.to_radians)~ +- Inside source: true +*** True Line Result + max_value * Math.cos(self.to_radians) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def x_vector max_value = 1~ +- Inside source: true +*** True Line Result + def x_vector max_value = 1 +** Processing line: ~ vector_x max_value~ +- Inside source: true +*** True Line Result + vector_x max_value +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def y_vector max_value = 1~ +- Inside source: true +*** True Line Result + def y_vector max_value = 1 +** Processing line: ~ vector_y max_value~ +- Inside source: true +*** True Line Result + vector_y max_value +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def mod n~ +- Inside source: true +*** True Line Result + def mod 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 mod_zero? *ns~ +- Inside source: true +*** True Line Result + def mod_zero? *ns +** Processing line: ~ ns.any? { |n| mod(n) == 0 }~ +- Inside source: true +*** True Line Result + ns.any? { |n| mod(n) == 0 } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def zmod? n~ +- Inside source: true +*** True Line Result + def zmod? n +** Processing line: ~ (self % n) == 0~ +- Inside source: true +*** True Line Result + (self % n) == 0 +** 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 + def mult 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: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def fdiv n~ +- Inside source: true +*** True Line Result + def fdiv 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: ~ # Divides `self` by a number `n` as a float, and converts it `to_i`.~ +- Inside source: true +*** True Line Result + # Divides `self` by a number `n` as a float, and converts it `to_i`. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def idiv n~ +- Inside source: true +*** True Line Result + def idiv n +** Processing line: ~ (self / n.to_f).to_i~ +- Inside source: true +*** True Line Result + (self / n.to_f).to_i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns a numeric value that is a quantity `magnitude` closer to~ +- Inside source: true +*** True Line Result + # Returns a numeric value that is a quantity `magnitude` closer to +** Processing line: ~ #`self`. If the distance between `self` and `target` is less than~ +- Inside source: true +*** True Line Result + #`self`. If the distance between `self` and `target` is less than +** Processing line: ~ #the `magnitude` then `target` is returned.~ +- Inside source: true +*** True Line Result + #the `magnitude` then `target` is returned. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def towards target, magnitude~ +- Inside source: true +*** True Line Result + def towards target, magnitude +** Processing line: ~ return self if self == target~ +- Inside source: true +*** True Line Result + return self if self == target +** Processing line: ~ delta = (self - target).abs~ +- Inside source: true +*** True Line Result + delta = (self - target).abs +** Processing line: ~ return target if delta < magnitude~ +- Inside source: true +*** True Line Result + return target if delta < magnitude +** Processing line: ~ return self - magnitude if self > target~ +- Inside source: true +*** True Line Result + return self - magnitude if self > target +** Processing line: ~ return self + magnitude~ +- Inside source: true +*** True Line Result + return self + magnitude +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Given `self` and a number representing `y` of a grid. This~ +- Inside source: true +*** True Line Result + # Given `self` and a number representing `y` of a grid. This +** Processing line: ~ # function will return a one dimensional array containing the value~ +- Inside source: true +*** True Line Result + # function will return a one dimensional array containing the value +** Processing line: ~ # yielded by an implicit block.~ +- Inside source: true +*** True Line Result + # yielded by an implicit block. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @example~ +- Inside source: true +*** True Line Result + # @example +** Processing line: ~ # 3.map_with_ys 2 do |x, y|~ +- Inside source: true +*** True Line Result + # 3.map_with_ys 2 do |x, y| +** Processing line: ~ # x * y~ +- Inside source: true +*** True Line Result + # x * y +** Processing line: ~ # end~ +- Inside source: true +*** True Line Result + # end +** Processing line: ~ # # x y x y x y x y x y x y~ +- Inside source: true +*** True Line Result + # # x y x y x y x y x y x y +** Processing line: ~ # # 0*0, 0*1 1*0 1*1 2*0 2*1~ +- Inside source: true +*** True Line Result + # # 0*0, 0*1 1*0 1*1 2*0 2*1 +** Processing line: ~ # # => [ 0, 0, 0, 1, 0, 2]~ +- Inside source: true +*** True Line Result + # # => [ 0, 0, 0, 1, 0, 2] +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def map_with_ys ys, &block~ +- Inside source: true +*** True Line Result + def map_with_ys ys, &block +** Processing line: ~ self.times.flat_map do |x|~ +- Inside source: true +*** True Line Result + self.times.flat_map do |x| +** Processing line: ~ ys.map_with_index do |y|~ +- Inside source: true +*** True Line Result + ys.map_with_index do |y| +** Processing line: ~ yield x, y~ +- Inside source: true +*** True Line Result + yield x, y +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise_immediately e, :map_with_ys, [self, ys]~ +- Inside source: true +*** True Line Result + raise_immediately e, :map_with_ys, [self, ys] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def combinations other_int~ +- Inside source: true +*** True Line Result + def combinations other_int +** Processing line: ~ self.numbers.product(other_int.numbers)~ +- Inside source: true +*** True Line Result + self.numbers.product(other_int.numbers) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def percentage_of n~ +- Inside source: true +*** True Line Result + def percentage_of n +** Processing line: ~ (self / n.to_f).cap_min_max(0, 1)~ +- Inside source: true +*** True Line Result + (self / n.to_f).cap_min_max(0, 1) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def cap i~ +- Inside source: true +*** True Line Result + def cap i +** Processing line: ~ return i if self > i~ +- Inside source: true +*** True Line Result + return i if self > i +** Processing line: ~ self~ +- Inside source: true +*** True Line Result + self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def cap_min_max min, max~ +- Inside source: true +*** True Line Result + def cap_min_max min, max +** Processing line: ~ return min if self < min~ +- Inside source: true +*** True Line Result + return min if self < min +** Processing line: ~ return max if self > max~ +- Inside source: true +*** True Line Result + return max if self > max +** Processing line: ~ self~ +- Inside source: true +*** True Line Result + self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def lesser other~ +- Inside source: true +*** True Line Result + def lesser other +** Processing line: ~ return other if other < self~ +- Inside source: true +*** True Line Result + return other if other < self +** Processing line: ~ self~ +- Inside source: true +*** True Line Result + self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def greater other~ +- Inside source: true +*** True Line Result + def greater other +** Processing line: ~ return other if other > self~ +- Inside source: true +*** True Line Result + return other if other > self +** Processing line: ~ self~ +- Inside source: true +*** True Line Result + self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def subtract i~ +- Inside source: true +*** True Line Result + def subtract i +** Processing line: ~ self - i~ +- Inside source: true +*** True Line Result + self - i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def minus i~ +- Inside source: true +*** True Line Result + def minus i +** Processing line: ~ self - i~ +- Inside source: true +*** True Line Result + self - i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def add i~ +- Inside source: true +*** True Line Result + def add i +** Processing line: ~ self + i~ +- Inside source: true +*** True Line Result + self + i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def plus i~ +- Inside source: true +*** True Line Result + def plus i +** Processing line: ~ self + i~ +- Inside source: true +*** True Line Result + self + i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def numbers~ +- Inside source: true +*** True Line Result + def numbers +** Processing line: ~ (0..self).to_a~ +- Inside source: true +*** True Line Result + (0..self).to_a +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def >= other~ +- Inside source: true +*** True Line Result + def >= other +** Processing line: ~ return false if !other~ +- Inside source: true +*** True Line Result + return false if !other +** Processing line: ~ return gte other~ +- Inside source: true +*** True Line Result + return gte other +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def > other~ +- Inside source: true +*** True Line Result + def > other +** Processing line: ~ return false if !other~ +- Inside source: true +*** True Line Result + return false if !other +** Processing line: ~ return gt other~ +- Inside source: true +*** True Line Result + return gt other +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def <= other~ +- Inside source: true +*** True Line Result + def <= other +** Processing line: ~ return false if !other~ +- Inside source: true +*** True Line Result + return false if !other +** Processing line: ~ return lte other~ +- Inside source: true +*** True Line Result + return lte other +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def < other~ +- Inside source: true +*** True Line Result + def < other +** Processing line: ~ return false if !other~ +- Inside source: true +*** True Line Result + return false if !other +** Processing line: ~ return gt other~ +- Inside source: true +*** True Line Result + return gt other +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ 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 + # @gtk +** Processing line: ~ def map~ +- Inside source: true +*** True Line Result + def map +** Processing line: ~ unless block_given?~ +- Inside source: true +*** True Line Result + unless block_given? +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ A block is required for Numeric#map.~ +- Inside source: true +*** True Line Result + A block is required for Numeric#map. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ self.to_i.times.map do~ +- Inside source: true +*** True Line Result + self.to_i.times.map do +** Processing line: ~ yield~ +- Inside source: true +*** True Line Result + yield +** 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 each~ +- Inside source: true +*** True Line Result + def each +** Processing line: ~ unless block_given?~ +- Inside source: true +*** True Line Result + unless block_given? +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ A block is required for Numeric#each.~ +- Inside source: true +*** True Line Result + A block is required for Numeric#each. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ self.to_i.times do~ +- Inside source: true +*** True Line Result + self.to_i.times do +** Processing line: ~ yield~ +- Inside source: true +*** True Line Result + yield +** 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 times_with_index~ +- Inside source: true +*** True Line Result + def times_with_index +** Processing line: ~ unless block_given?~ +- Inside source: true +*** True Line Result + unless block_given? +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ A block is required for Numeric#times_with_index.~ +- Inside source: true +*** True Line Result + A block is required for Numeric#times_with_index. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ self.to_i.times.with_index do |i|~ +- Inside source: true +*** True Line Result + self.to_i.times.with_index do |i| +** Processing line: ~ yield i~ +- Inside source: true +*** True Line Result + yield i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def each_with_index~ +- Inside source: true +*** True Line Result + def each_with_index +** Processing line: ~ unless block_given?~ +- Inside source: true +*** True Line Result + unless block_given? +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ A block is required for Numeric#each_with_index.~ +- Inside source: true +*** True Line Result + A block is required for Numeric#each_with_index. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ self.to_i.times.with_index do |i|~ +- Inside source: true +*** True Line Result + self.to_i.times.with_index do |i| +** Processing line: ~ yield i~ +- Inside source: true +*** True Line Result + yield 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: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def map_with_index~ +- Inside source: true +*** True Line Result + def map_with_index +** Processing line: ~ unless block_given?~ +- Inside source: true +*** True Line Result + unless block_given? +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ A block is required for Numeric#map.~ +- Inside source: true +*** True Line Result + A block is required for Numeric#map. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ self.to_i.times.map do |i|~ +- Inside source: true +*** True Line Result + self.to_i.times.map do |i| +** Processing line: ~ yield i~ +- Inside source: true +*** True Line Result + yield i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def __raise_arithmetic_exception__ other, m, e~ +- Inside source: true +*** True Line Result + def __raise_arithmetic_exception__ other, m, e +** Processing line: ~ raise <<-S~ +- Inside source: true +*** True Line Result + raise <<-S +** Processing line: ~ * ERROR:~ +- Inside source: true +*** True Line Result + * ERROR: +** Processing line: ~ Attempted to invoke :#{m} on #{self} with the right hand argument of:~ +- Inside source: true +*** True Line Result + Attempted to invoke :#{m} on #{self} with the right hand argument of: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #{other}~ +- Inside source: true +*** True Line Result + #{other} +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ The object above is not a Numeric.~ +- Inside source: true +*** True Line Result + The object above is not a Numeric. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #{e}~ +- Inside source: true +*** True Line Result + #{e} +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def - other~ +- Inside source: true +*** True Line Result + def - other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :-, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :-, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def + other~ +- Inside source: true +*** True Line Result + def + other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :+, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :+, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def * other~ +- Inside source: true +*** True Line Result + def * other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :*, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :*, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def / other~ +- Inside source: true +*** True Line Result + def / other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :/, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def serialize~ +- Inside source: true +*** True Line Result + def serialize +** Processing line: ~ self~ +- Inside source: true +*** True Line Result + self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.from_top n~ +- Inside source: true +*** True Line Result + def self.from_top n +** Processing line: ~ return 720 - n unless $gtk~ +- Inside source: true +*** True Line Result + return 720 - n unless $gtk +** Processing line: ~ $gtk.args.grid.top - n~ +- Inside source: true +*** True Line Result + $gtk.args.grid.top - n +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def from_top~ +- Inside source: true +*** True Line Result + def from_top +** Processing line: ~ Numeric.from_top self~ +- Inside source: true +*** True Line Result + Numeric.from_top self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.from_right n~ +- Inside source: true +*** True Line Result + def self.from_right n +** Processing line: ~ return 1280 - n unless $gtk~ +- Inside source: true +*** True Line Result + return 1280 - n unless $gtk +** Processing line: ~ $gtk.args.grid.right - n~ +- Inside source: true +*** True Line Result + $gtk.args.grid.right - n +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def from_right~ +- Inside source: true +*** True Line Result + def from_right +** Processing line: ~ Numeric.from_right self~ +- Inside source: true +*** True Line Result + Numeric.from_right self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.clamp n, min, max~ +- Inside source: true +*** True Line Result + def self.clamp n, min, max +** Processing line: ~ n.clamp min, max~ +- Inside source: true +*** True Line Result + n.clamp min, max +** 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 Fixnum~ +- Inside source: true +*** True Line Result + class Fixnum +** Processing line: ~ include ValueType~ +- Inside source: true +*** True Line Result + include ValueType +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ alias_method :__original_eq_eq__, :== unless Fixnum.instance_methods.include? :__original_eq_eq__~ +- Inside source: true +*** True Line Result + alias_method :__original_eq_eq__, :== unless Fixnum.instance_methods.include? :__original_eq_eq__ +** Processing line: ~ alias_method :__original_add__, :+ unless Fixnum.instance_methods.include? :__original_add__~ +- Inside source: true +*** True Line Result + alias_method :__original_add__, :+ unless Fixnum.instance_methods.include? :__original_add__ +** Processing line: ~ alias_method :__original_subtract__, :- unless Fixnum.instance_methods.include? :__original_subtract__~ +- Inside source: true +*** True Line Result + alias_method :__original_subtract__, :- unless Fixnum.instance_methods.include? :__original_subtract__ +** Processing line: ~ alias_method :__original_multiply__, :* unless Fixnum.instance_methods.include? :__original_multiply__~ +- Inside source: true +*** True Line Result + alias_method :__original_multiply__, :* unless Fixnum.instance_methods.include? :__original_multiply__ +** Processing line: ~ alias_method :__original_divide__, :- unless Fixnum.instance_methods.include? :__original_divide__~ +- Inside source: true +*** True Line Result + alias_method :__original_divide__, :- unless Fixnum.instance_methods.include? :__original_divide__ +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns `true` if the numeric value is evenly divisible by 2.~ +- Inside source: true +*** True Line Result + # Returns `true` if the numeric value is evenly divisible by 2. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def even?~ +- Inside source: true +*** True Line Result + def even? +** Processing line: ~ return (self % 2) == 0~ +- Inside source: true +*** True Line Result + return (self % 2) == 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns `true` if the numeric value is *NOT* evenly divisible by 2.~ +- Inside source: true +*** True Line Result + # Returns `true` if the numeric value is *NOT* evenly divisible by 2. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def odd?~ +- Inside source: true +*** True Line Result + def odd? +** Processing line: ~ return !even?~ +- Inside source: true +*** True Line Result + return !even? +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def + other~ +- Inside source: true +*** True Line Result + def + other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :+, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :+, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def * other~ +- Inside source: true +*** True Line Result + def * other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :*, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :*, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def / other~ +- Inside source: true +*** True Line Result + def / other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :/, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def - other~ +- Inside source: true +*** True Line Result + def - other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :-, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :-, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def == other~ +- Inside source: true +*** True Line Result + def == other +** Processing line: ~ return 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 + # 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`.~ +- Inside source: true +*** True Line Result + # is greater than `0`. Returns `0` if the number is equal to `0`. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def sign~ +- Inside source: true +*** True Line Result + def sign +** Processing line: ~ return -1 if self < 0~ +- Inside source: true +*** True Line Result + return -1 if self < 0 +** Processing line: ~ return 1 if self > 0~ +- Inside source: true +*** True Line Result + return 1 if self > 0 +** Processing line: ~ return 0~ +- Inside source: true +*** True Line Result + return 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns `true` if number is greater than `0`.~ +- Inside source: true +*** True Line Result + # Returns `true` if number is greater than `0`. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def pos?~ +- Inside source: true +*** True Line Result + def pos? +** Processing line: ~ sign > 0~ +- Inside source: true +*** True Line Result + sign > 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns `true` if number is less than `0`.~ +- Inside source: true +*** True Line Result + # Returns `true` if number is less than `0`. +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def neg?~ +- Inside source: true +*** True Line Result + def neg? +** Processing line: ~ sign < 0~ +- Inside source: true +*** True Line Result + sign < 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the cosine of a represented in degrees (NOT radians).~ +- Inside source: true +*** True Line Result + # Returns the cosine of a represented in degrees (NOT radians). +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def cos~ +- Inside source: true +*** True Line Result + def cos +** Processing line: ~ Math.cos(self.to_radians)~ +- Inside source: true +*** True Line Result + Math.cos(self.to_radians) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Returns the cosine of a represented in degrees (NOT radians).~ +- Inside source: true +*** True Line Result + # Returns the cosine of a represented in degrees (NOT radians). +** Processing line: ~ #~ +- Inside source: true +*** True Line Result + # +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def sin~ +- Inside source: true +*** True Line Result + def sin +** Processing line: ~ Math.sin(self.to_radians)~ +- Inside source: true +*** True Line Result + Math.sin(self.to_radians) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def to_sf~ +- Inside source: true +*** True Line Result + def to_sf +** Processing line: ~ "%.2f" % self~ +- Inside source: true +*** True Line Result + "%.2f" % self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def ifloor int~ +- Inside source: true +*** True Line Result + def ifloor int +** Processing line: ~ (self.idiv int.to_i) * int.to_i~ +- Inside source: true +*** True Line Result + (self.idiv int.to_i) * int.to_i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ class Float~ +- Inside source: true +*** True Line Result + class Float +** Processing line: ~ include ValueType~ +- Inside source: true +*** True Line Result + include ValueType +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ alias_method :__original_add__, :+ unless Float.instance_methods.include? :__original_add__~ +- Inside source: true +*** True Line Result + alias_method :__original_add__, :+ unless Float.instance_methods.include? :__original_add__ +** Processing line: ~ alias_method :__original_subtract__, :- unless Float.instance_methods.include? :__original_subtract__~ +- Inside source: true +*** True Line Result + alias_method :__original_subtract__, :- unless Float.instance_methods.include? :__original_subtract__ +** Processing line: ~ alias_method :__original_multiply__, :* unless Float.instance_methods.include? :__original_multiply__~ +- Inside source: true +*** True Line Result + alias_method :__original_multiply__, :* unless Float.instance_methods.include? :__original_multiply__ +** Processing line: ~ alias_method :__original_divide__, :- unless Float.instance_methods.include? :__original_divide__~ +- Inside source: true +*** True Line Result + alias_method :__original_divide__, :- unless Float.instance_methods.include? :__original_divide__ +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def - other~ +- Inside source: true +*** True Line Result + def - other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :-, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :-, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def + other~ +- Inside source: true +*** True Line Result + def + other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :+, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :+, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def * other~ +- Inside source: true +*** True Line Result + def * other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :*, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :*, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def / other~ +- Inside source: true +*** True Line Result + def / other +** Processing line: ~ return nil unless other~ +- Inside source: true +*** True Line Result + return nil unless other +** Processing line: ~ super~ +- Inside source: true +*** True Line Result + super +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~ +- Inside source: true +*** True Line Result + __raise_arithmetic_exception__ other, :/, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def serialize~ +- Inside source: true +*** True Line Result + def serialize +** Processing line: ~ self~ +- Inside source: true +*** True Line Result + self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def sign~ +- Inside source: true +*** True Line Result + def sign +** Processing line: ~ return -1 if self < 0~ +- Inside source: true +*** True Line Result + return -1 if self < 0 +** Processing line: ~ return 1 if self > 0~ +- Inside source: true +*** True Line Result + return 1 if self > 0 +** Processing line: ~ return 0~ +- Inside source: true +*** True Line Result + return 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def replace_infinity scalar~ +- Inside source: true +*** True Line Result + def replace_infinity scalar +** Processing line: ~ return self if !scalar~ +- Inside source: true +*** True Line Result + return self if !scalar +** Processing line: ~ return self unless self.infinite?~ +- Inside source: true +*** True Line Result + return self unless self.infinite? +** Processing line: ~ return -scalar if self < 0~ +- Inside source: true +*** True Line Result + return -scalar if self < 0 +** Processing line: ~ return scalar if self > 0~ +- Inside source: true +*** True Line Result + return scalar if self > 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def to_sf~ +- Inside source: true +*** True Line Result + def to_sf +** Processing line: ~ "%.2f" % self~ +- Inside source: true +*** True Line Result + "%.2f" % self +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def ifloor int~ +- Inside source: true +*** True Line Result + def ifloor int +** Processing line: ~ (self.idiv int.to_i) * int.to_i~ +- Inside source: true +*** True Line Result + (self.idiv int.to_i) * int.to_i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ class Integer~ +- Inside source: true +*** True Line Result + class Integer +** Processing line: ~ alias_method :__original_round__, :round unless Integer.instance_methods.include? :__original_round__~ +- Inside source: true +*** True Line Result + alias_method :__original_round__, :round unless Integer.instance_methods.include? :__original_round__ +** Processing line: ~ alias_method :__original_add__, :+ unless Integer.instance_methods.include? :__original_add__~ +- Inside source: true +*** True Line Result + alias_method :__original_add__, :+ unless Integer.instance_methods.include? :__original_add__ +** Processing line: ~ alias_method :__original_subtract__, :- unless Integer.instance_methods.include? :__original_subtract__~ +- Inside source: true +*** True Line Result + alias_method :__original_subtract__, :- unless Integer.instance_methods.include? :__original_subtract__ +** Processing line: ~ alias_method :__original_multiply__, :* unless Integer.instance_methods.include? :__original_multiply__~ +- Inside source: true +*** True Line Result + alias_method :__original_multiply__, :* unless Integer.instance_methods.include? :__original_multiply__ +** Processing line: ~ alias_method :__original_divide__, :- unless Integer.instance_methods.include? :__original_divide__~ +- Inside source: true +*** True Line Result + alias_method :__original_divide__, :- unless Integer.instance_methods.include? :__original_divide__ +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def round *args~ +- Inside source: true +*** True Line Result + def round *args +** Processing line: ~ __original_round__~ +- Inside source: true +*** True Line Result + __original_round__ +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def nan?~ +- Inside source: true +*** True Line Result + def nan? +** Processing line: ~ false~ +- Inside source: true +*** True Line Result + false +** 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: ~*** remote_hotload_client.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** remote_hotload_client.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/remote_hotload_client.rb~ +- Inside source: true +*** True Line Result + # ./dragon/remote_hotload_client.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # hotload_client.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # hotload_client.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class RemoteHotloadClient~ +- Inside source: true +*** True Line Result + class RemoteHotloadClient +** Processing line: ~ attr :args~ +- Inside source: true +*** True Line Result + attr :args +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def gtk~ +- Inside source: true +*** True Line Result + def gtk +** Processing line: ~ args.gtk~ +- Inside source: true +*** True Line Result + args.gtk +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def state~ +- Inside source: true +*** True Line Result + def state +** Processing line: ~ local_state~ +- Inside source: true +*** True Line Result + local_state +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize local_ip_address~ +- Inside source: true +*** True Line Result + def initialize local_ip_address +** Processing line: ~ local_state.local_ip_address = local_ip_address~ +- Inside source: true +*** True Line Result + local_state.local_ip_address = local_ip_address +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick~ +- Inside source: true +*** True Line Result + def tick +** Processing line: ~ return unless server_available?~ +- Inside source: true +*** True Line Result + return unless server_available? +** Processing line: ~ return unless server_needed?~ +- Inside source: true +*** True Line Result + return unless server_needed? +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if should_tick? && server_needed? && !local_state.notified~ +- Inside source: true +*** True Line Result + if should_tick? && server_needed? && !local_state.notified +** Processing line: ~ if server_available?~ +- Inside source: true +*** True Line Result + if server_available? +** Processing line: ~ remote_log "* REMOTE CLIENT INFO: Hotload server found at #{get_server_ip_address}:9001."~ +- Inside source: true +*** True Line Result + remote_log "* REMOTE CLIENT INFO: Hotload server found at #{get_server_ip_address}:9001." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ local_state.notified = true~ +- Inside source: true +*** True Line Result + local_state.notified = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ tick_process_file_retrieval~ +- Inside source: true +*** True Line Result + tick_process_file_retrieval +** Processing line: ~ tick_process_queue~ +- Inside source: true +*** True Line Result + tick_process_queue +** Processing line: ~ tick_changes~ +- Inside source: true +*** True Line Result + tick_changes +** Processing line: ~ tick_http_boot~ +- Inside source: true +*** True Line Result + tick_http_boot +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def should_tick?~ +- Inside source: true +*** True Line Result + def should_tick? +** Processing line: ~ (game_state.tick_count.mod_zero? 60) && game_state.tick_count > 5.seconds~ +- Inside source: true +*** True Line Result + (game_state.tick_count.mod_zero? 60) && game_state.tick_count > 5.seconds +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def game_state~ +- Inside source: true +*** True Line Result + def game_state +** Processing line: ~ args.state~ +- Inside source: true +*** True Line Result + args.state +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def local_state~ +- Inside source: true +*** True Line Result + def local_state +** Processing line: ~ @local_state ||= OpenEntity.new~ +- Inside source: true +*** True Line Result + @local_state ||= OpenEntity.new +** Processing line: ~ @local_state.hotload_client ||= @local_state.new_entity(:hotload_client,~ +- 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.",~ +- Inside source: true +*** True Line Result + notes: "This enitity is used by DragonRuby Game Toolkit to provide you hotloading on remote machines.", +** Processing line: ~ changes: { },~ +- Inside source: true +*** True Line Result + changes: { }, +** Processing line: ~ changes_queue: [],~ +- Inside source: true +*** True Line Result + changes_queue: [], +** Processing line: ~ reloaded_files_times: [])~ +- Inside source: true +*** True Line Result + reloaded_files_times: []) +** Processing line: ~ @local_state.hotload_client~ +- Inside source: true +*** True Line Result + @local_state.hotload_client +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def remote_log message~ +- Inside source: true +*** True Line Result + def remote_log message +** Processing line: ~ log message~ +- Inside source: true +*** True Line Result + log message +** Processing line: ~ args.gtk.http_post "http://#{get_server_ip_address}:9001/dragon/log/", { message: "=======\n#{message}\n=======\n" }, ["Content-Type: application/x-www-form-urlencoded"]~ +- Inside source: true +*** True Line Result + args.gtk.http_post "http://#{get_server_ip_address}:9001/dragon/log/", { message: "=======\n#{message}\n=======\n" }, ["Content-Type: application/x-www-form-urlencoded"] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def get_server_ip_address~ +- Inside source: true +*** True Line Result + def get_server_ip_address +** Processing line: ~ return local_state.ip_address if local_state.ip_address~ +- Inside source: true +*** True Line Result + return local_state.ip_address if local_state.ip_address +** Processing line: ~ local_state.ip_address ||= ((gtk.read_file 'app/server_ip_address.txt') || "").strip~ +- Inside source: true +*** True Line Result + local_state.ip_address ||= ((gtk.read_file 'app/server_ip_address.txt') || "").strip +** Processing line: ~ local_state.ip_address~ +- Inside source: true +*** True Line Result + local_state.ip_address +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def server_available?~ +- Inside source: true +*** True Line Result + def server_available? +** Processing line: ~ return false if gtk.platform == 'Emscripten'~ +- Inside source: true +*** True Line Result + return false if gtk.platform == 'Emscripten' +** Processing line: ~ get_server_ip_address.length != 0~ +- Inside source: true +*** True Line Result + get_server_ip_address.length != 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def server_needed?~ +- Inside source: true +*** True Line Result + def server_needed? +** Processing line: ~ return false if gtk.platform == 'Emscripten'~ +- Inside source: true +*** True Line Result + return false if gtk.platform == 'Emscripten' +** Processing line: ~ local_state.local_ip_address != get_server_ip_address~ +- Inside source: true +*** True Line Result + local_state.local_ip_address != get_server_ip_address +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick_changes~ +- Inside source: true +*** True Line Result + def tick_changes +** Processing line: ~ return unless should_tick?~ +- Inside source: true +*** True Line Result + return unless should_tick? +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ local_state.greatest_tick ||= 0~ +- Inside source: true +*** True Line Result + local_state.greatest_tick ||= 0 +** Processing line: ~ local_state.last_greatest_tick ||= 0~ +- Inside source: true +*** True Line Result + local_state.last_greatest_tick ||= 0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ tick_http_changes~ +- Inside source: true +*** True Line Result + tick_http_changes +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick_http_boot~ +- Inside source: true +*** True Line Result + def tick_http_boot +** Processing line: ~ return if local_state.booted_at~ +- Inside source: true +*** True Line Result + return if local_state.booted_at +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !local_state.http_boot~ +- Inside source: true +*** True Line Result + if !local_state.http_boot +** Processing line: ~ # first retrieve changes.txt which has the following format~ +- Inside source: true +*** True Line Result + # first retrieve changes.txt which has the following format +** Processing line: ~ # file with latest change,~ +- Inside source: true +*** True Line Result + # file with latest change, +** Processing line: ~ # latest file update_time key~ +- Inside source: true +*** True Line Result + # latest file update_time key +** Processing line: ~ # tmp/src_backup/src_backup_app_main.rb, 1597926596, app/main.rb~ +- Inside source: true +*** True Line Result + # tmp/src_backup/src_backup_app_main.rb, 1597926596, app/main.rb +** Processing line: ~ local_state.http_boot = args.gtk.http_get "http://#{get_server_ip_address}:9001/dragon/boot/"~ +- Inside source: true +*** True Line Result + local_state.http_boot = args.gtk.http_get "http://#{get_server_ip_address}:9001/dragon/boot/" +** Processing line: ~ elsif local_state.http_boot && local_state.http_boot[:http_response_code] == 200~ +- Inside source: true +*** True Line Result + elsif local_state.http_boot && local_state.http_boot[:http_response_code] == 200 +** Processing line: ~ local_state.last_greatest_tick = local_state.http_boot[:response_data].strip.to_i~ +- Inside source: true +*** True Line Result + local_state.last_greatest_tick = local_state.http_boot[:response_data].strip.to_i +** Processing line: ~ local_state.greatest_tick = local_state.http_boot[:response_data].strip.to_i~ +- Inside source: true +*** True Line Result + local_state.greatest_tick = local_state.http_boot[:response_data].strip.to_i +** Processing line: ~ local_state.booted_at = local_state.greatest_tick~ +- Inside source: true +*** True Line Result + local_state.booted_at = local_state.greatest_tick +** Processing line: ~ remote_log '* REMOTE CLIENT INFO: HTTP GET for local_state. boot.txt succeeded.'~ +- Inside source: true +*** True Line Result + remote_log '* REMOTE CLIENT INFO: HTTP GET for local_state. boot.txt succeeded.' +** Processing line: ~ remote_log "* REMOTE CLIENT INFO: Looking for changes after: #{local_state.greatest_tick}."~ +- Inside source: true +*** True Line Result + remote_log "* REMOTE CLIENT INFO: Looking for changes after: #{local_state.greatest_tick}." +** Processing line: ~ elsif local_state.http_boot && local_state.http_boot[:http_response_code] == -1 && local_state.http_boot[:complete]~ +- Inside source: true +*** True Line Result + elsif local_state.http_boot && local_state.http_boot[:http_response_code] == -1 && local_state.http_boot[:complete] +** Processing line: ~ remote_log '* REMOTE CLIENT INFO: HTTP GET for boot.txt failed. Retrying.'~ +- Inside source: true +*** True Line Result + remote_log '* REMOTE CLIENT INFO: HTTP GET for boot.txt failed. Retrying.' +** Processing line: ~ local_state.http_boot = nil~ +- Inside source: true +*** True Line Result + local_state.http_boot = nil +** 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_http_changes~ +- Inside source: true +*** True Line Result + def tick_http_changes +** Processing line: ~ return unless local_state.booted_at~ +- Inside source: true +*** True Line Result + return unless local_state.booted_at +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !local_state.http_changes~ +- Inside source: true +*** True Line Result + if !local_state.http_changes +** Processing line: ~ local_state.http_changes = args.gtk.http_get "http://#{get_server_ip_address}:9001/dragon/changes/"~ +- Inside source: true +*** True Line Result + local_state.http_changes = args.gtk.http_get "http://#{get_server_ip_address}:9001/dragon/changes/" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if local_state.http_changes && local_state.http_changes[:http_response_code] == 200 && local_state.booted_at~ +- Inside source: true +*** True Line Result + if local_state.http_changes && local_state.http_changes[:http_response_code] == 200 && local_state.booted_at +** Processing line: ~ local_state.last_greatest_tick = local_state.greatest_tick~ +- Inside source: true +*** True Line Result + local_state.last_greatest_tick = local_state.greatest_tick +** Processing line: ~ # if the retrieval of changes.txt was successful~ +- Inside source: true +*** True Line Result + # if the retrieval of changes.txt was successful +** Processing line: ~ local_state.http_changes[:response_data].each_line do |l|~ +- Inside source: true +*** True Line Result + local_state.http_changes[:response_data].each_line do |l| +** Processing line: ~ if l.strip.length != 0~ +- Inside source: true +*** True Line Result + if l.strip.length != 0 +** Processing line: ~ # within reload state for that specific changes hash~ +- Inside source: true +*** True Line Result + # within reload state for that specific changes hash +** Processing line: ~ # set the last time the file was updated~ +- Inside source: true +*** True Line Result + # set the last time the file was updated +** Processing line: ~ file_name, updated_at, key = l.strip.split(',')~ +- Inside source: true +*** True Line Result + file_name, updated_at, key = l.strip.split(',') +** Processing line: ~ file_name.strip!~ +- Inside source: true +*** True Line Result + file_name.strip! +** Processing line: ~ updated_at.strip!~ +- Inside source: true +*** True Line Result + updated_at.strip! +** Processing line: ~ key.strip!~ +- Inside source: true +*** True Line Result + key.strip! +** Processing line: ~ updated_at = updated_at.to_i~ +- Inside source: true +*** True Line Result + updated_at = updated_at.to_i +** Processing line: ~ file_name = file_name.gsub("tmp/src_backup/", "")~ +- Inside source: true +*** True Line Result + file_name = file_name.gsub("tmp/src_backup/", "") +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # keep an internal clock that denotes that current time on the~ +- Inside source: true +*** True Line Result + # keep an internal clock that denotes that current time on the +** Processing line: ~ # dev machine~ +- Inside source: true +*** True Line Result + # dev machine +** Processing line: ~ if updated_at > local_state.greatest_tick~ +- Inside source: true +*** True Line Result + if updated_at > local_state.greatest_tick +** Processing line: ~ local_state.greatest_tick = updated_at~ +- Inside source: true +*** True Line Result + local_state.greatest_tick = updated_at +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # create a new entry in change tracking for the file~ +- Inside source: true +*** True Line Result + # create a new entry in change tracking for the file +** Processing line: ~ # for every file where the file was last updated, find all the ones where the time is not the same~ +- Inside source: true +*** True Line Result + # for every file where the file was last updated, find all the ones where the time is not the same +** Processing line: ~ # and queue those to be retrieved and required~ +- Inside source: true +*** True Line Result + # and queue those to be retrieved and required +** Processing line: ~ # if the last time the dev machine time was retrieved is less than the file time changed~ +- Inside source: true +*** True Line Result + # if the last time the dev machine time was retrieved is less than the file time changed +** Processing line: ~ # then queue the file for reload~ +- Inside source: true +*** True Line Result + # then queue the file for reload +** Processing line: ~ current_updated_at = (local_state.changes[key] || { updated_at: 0 })[:updated_at]~ +- Inside source: true +*** True Line Result + current_updated_at = (local_state.changes[key] || { updated_at: 0 })[:updated_at] +** Processing line: ~ if updated_at > current_updated_at~ +- Inside source: true +*** True Line Result + if updated_at > current_updated_at +** Processing line: ~ remote_log "* REMOTE CLIENT INFO: Queueing file #{file_name} for update."~ +- Inside source: true +*** True Line Result + remote_log "* REMOTE CLIENT INFO: Queueing file #{file_name} for update." +** Processing line: ~ local_state.changes[key] = { key: key,~ +- Inside source: true +*** True Line Result + local_state.changes[key] = { key: key, +** Processing line: ~ latest_file: file_name,~ +- Inside source: true +*** True Line Result + latest_file: file_name, +** Processing line: ~ updated_at: updated_at }~ +- Inside source: true +*** True Line Result + updated_at: updated_at } +** Processing line: ~ local_state.changes_queue << local_state.changes[key]~ +- Inside source: true +*** True Line Result + local_state.changes_queue << local_state.changes[key] +** 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: ~ # set the greatest tick/current time of the machine~ +- Inside source: true +*** True Line Result + # set the greatest tick/current time of the machine +** Processing line: ~ local_state.http_changes = nil~ +- Inside source: true +*** True Line Result + local_state.http_changes = nil +** Processing line: ~ elsif local_state.http_changes && local_state.http_changes[:http_response_code] == -1 && local_state.http_change[:complete] && local_state.booted_at~ +- Inside source: true +*** True Line Result + elsif local_state.http_changes && local_state.http_changes[:http_response_code] == -1 && local_state.http_change[:complete] && local_state.booted_at +** Processing line: ~ local_state.http_changes = nil~ +- Inside source: true +*** True Line Result + local_state.http_changes = nil +** 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_process_queue~ +- Inside source: true +*** True Line Result + def tick_process_queue +** Processing line: ~ return if local_state.http_file_changes # don't pop a file off the queue if there is an http request in flight~ +- Inside source: true +*** True Line Result + return if local_state.http_file_changes # don't pop a file off the queue if there is an http request in flight +** Processing line: ~ return if local_state.processing_file_changes # don't pop a file if there is a file currently being processed~ +- Inside source: true +*** True Line Result + return if local_state.processing_file_changes # don't pop a file if there is a file currently being processed +** Processing line: ~ return unless local_state.changes_queue.length > 0 # return if the queue is empty~ +- Inside source: true +*** True Line Result + return unless local_state.changes_queue.length > 0 # return if the queue is empty +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # if it isn't empty, pop the first file off the queue (FIFO)~ +- Inside source: true +*** True Line Result + # if it isn't empty, pop the first file off the queue (FIFO) +** Processing line: ~ local_state.processing_file_changes = local_state.changes_queue.shift~ +- Inside source: true +*** True Line Result + local_state.processing_file_changes = local_state.changes_queue.shift +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # create an http request for the file~ +- Inside source: true +*** True Line Result + # create an http request for the file +** Processing line: ~ url = "http://#{get_server_ip_address}:9001/dragon/#{local_state.processing_file_changes[:latest_file]}"~ +- Inside source: true +*** True Line Result + url = "http://#{get_server_ip_address}:9001/dragon/#{local_state.processing_file_changes[:latest_file]}" +** Processing line: ~ remote_log "* REMOTE CLIENT INFO: Getting new version of #{local_state.processing_file_changes[:latest_file]} (#{url})."~ +- Inside source: true +*** True Line Result + remote_log "* REMOTE CLIENT INFO: Getting new version of #{local_state.processing_file_changes[:latest_file]} (#{url})." +** Processing line: ~ local_state.http_file_changes = args.gtk.http_get url~ +- Inside source: true +*** True Line Result + local_state.http_file_changes = args.gtk.http_get url +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick_process_file_retrieval~ +- Inside source: true +*** True Line Result + def tick_process_file_retrieval +** Processing line: ~ return if !local_state.http_file_changes~ +- Inside source: true +*** True Line Result + return if !local_state.http_file_changes +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # if the http request has finished successfully~ +- Inside source: true +*** True Line Result + # if the http request has finished successfully +** Processing line: ~ if local_state.http_file_changes[:http_response_code] == 200~ +- Inside source: true +*** True Line Result + if local_state.http_file_changes[:http_response_code] == 200 +** Processing line: ~ file_key = local_state.processing_file_changes[:key]~ +- Inside source: true +*** True Line Result + file_key = local_state.processing_file_changes[:key] +** Processing line: ~ # notify that a file will be reloaded~ +- Inside source: true +*** True Line Result + # notify that a file will be reloaded +** Processing line: ~ remote_log "* REMOTE CLIENT INFO: Loading #{file_key}: #{local_state.processing_file_changes[:latest_file]}"~ +- Inside source: true +*** True Line Result + remote_log "* REMOTE CLIENT INFO: Loading #{file_key}: #{local_state.processing_file_changes[:latest_file]}" +** Processing line: ~ remote_log "#{local_state.http_file_changes[:response_data]}"~ +- Inside source: true +*** True Line Result + remote_log "#{local_state.http_file_changes[:response_data]}" +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # write the latest file with what came back from the response data~ +- Inside source: true +*** True Line Result + # write the latest file with what came back from the response data +** Processing line: ~ gtk.write_file "#{file_key}", local_state.http_file_changes[:response_data]~ +- Inside source: true +*** True Line Result + gtk.write_file "#{file_key}", local_state.http_file_changes[:response_data] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # nil out the currently processing file so a new item can be processed from the queue~ +- Inside source: true +*** True Line Result + # nil out the currently processing file so a new item can be processed from the queue +** Processing line: ~ # local_state.reloaded_files_times << local_state.processing_file_changes[:key]~ +- Inside source: true +*** True Line Result + # local_state.reloaded_files_times << local_state.processing_file_changes[:key] +** Processing line: ~ local_state.http_file_changes = nil~ +- Inside source: true +*** True Line Result + local_state.http_file_changes = nil +** Processing line: ~ local_state.processing_file_changes = nil~ +- Inside source: true +*** True Line Result + local_state.processing_file_changes = nil +** 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: ~#+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: ~*** runtime/autocomplete.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** runtime/autocomplete.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/autocomplete.rb~ +- Inside source: true +*** True Line Result + # ./dragon/runtime/autocomplete.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # autocomplete.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # autocomplete.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Runtime~ +- Inside source: true +*** True Line Result + class Runtime +** Processing line: ~ module Autocomplete~ +- Inside source: true +*** True Line Result + module Autocomplete +** Processing line: ~ def autocomplete_parse opts~ +- Inside source: true +*** True Line Result + def autocomplete_parse opts +** Processing line: ~ if opts[:file] && !opts[:text]~ +- Inside source: true +*** True Line Result + if opts[:file] && !opts[:text] +** Processing line: ~ opts[:text] = read_file opts[:file]~ +- Inside source: true +*** True Line Result + opts[:text] = read_file opts[:file] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ text = opts[:text]~ +- Inside source: true +*** True Line Result + text = opts[:text] +** Processing line: ~ index = opts[:index]~ +- Inside source: true +*** True Line Result + index = opts[:index] +** Processing line: ~ sum = 0~ +- Inside source: true +*** True Line Result + sum = 0 +** Processing line: ~ lines = text.each_line.to_a.map do |l|~ +- Inside source: true +*** True Line Result + lines = text.each_line.to_a.map do |l| +** Processing line: ~ sum += l.length~ +- Inside source: true +*** True Line Result + sum += l.length +** Processing line: ~ { line: l, length: l.length, sum: sum }~ +- Inside source: true +*** True Line Result + { line: l, length: l.length, sum: sum } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ cursor_line = lines.find { |l| l[:sum] >= index }~ +- Inside source: true +*** True Line Result + cursor_line = lines.find { |l| l[:sum] >= index } +** Processing line: ~ previous_line = lines.find { |l| l[:sum] < index }~ +- Inside source: true +*** True Line Result + previous_line = lines.find { |l| l[:sum] < index } +** Processing line: ~ previous_line ||= { sum: 0 }~ +- Inside source: true +*** True Line Result + previous_line ||= { sum: 0 } +** Processing line: ~ if cursor_line~ +- Inside source: true +*** True Line Result + if cursor_line +** Processing line: ~ sub_index = index - previous_line[:sum]~ +- Inside source: true +*** True Line Result + sub_index = index - previous_line[:sum] +** Processing line: ~ word = (cursor_line[:line][0..sub_index - 1]).strip~ +- Inside source: true +*** True Line Result + word = (cursor_line[:line][0..sub_index - 1]).strip +** Processing line: ~ token = (word.split " ")[-1]~ +- Inside source: true +*** True Line Result + token = (word.split " ")[-1] +** Processing line: ~ dots = (token.split ".")~ +- Inside source: true +*** True Line Result + dots = (token.split ".") +** Processing line: ~ dot = dots[-1]~ +- Inside source: true +*** True Line Result + dot = dots[-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: ~ text: opts[:text],~ +- Inside source: true +*** True Line Result + text: opts[:text], +** Processing line: ~ file: opts[:file],~ +- Inside source: true +*** True Line Result + file: opts[:file], +** Processing line: ~ index: opts[:index],~ +- Inside source: true +*** True Line Result + index: opts[:index], +** Processing line: ~ cursor_line: cursor_line,~ +- Inside source: true +*** True Line Result + cursor_line: cursor_line, +** Processing line: ~ previous_line: previous_line,~ +- Inside source: true +*** True Line Result + previous_line: previous_line, +** Processing line: ~ word: word,~ +- Inside source: true +*** True Line Result + word: word, +** Processing line: ~ token: token,~ +- Inside source: true +*** True Line Result + token: token, +** Processing line: ~ dots: dots,~ +- Inside source: true +*** True Line Result + dots: dots, +** Processing line: ~ dot: dot~ +- Inside source: true +*** True Line Result + dot: dot +** 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 autocomplete_filter_methods keys, *ignores~ +- Inside source: true +*** True Line Result + def autocomplete_filter_methods keys, *ignores +** Processing line: ~ ignores ||= []~ +- Inside source: true +*** True Line Result + ignores ||= [] +** Processing line: ~ ignores = [ignores].flatten~ +- Inside source: true +*** True Line Result + ignores = [ignores].flatten +** Processing line: ~ keys = keys.map { |k| k.to_s }~ +- Inside source: true +*** True Line Result + keys = keys.map { |k| k.to_s } +** Processing line: ~ others = ["def", "end"] +~ +- Inside source: true +*** True Line Result + others = ["def", "end"] + +** Processing line: ~ [ :entity_keys_by_ref,~ +- Inside source: true +*** True Line Result + [ :entity_keys_by_ref, +** Processing line: ~ :entity_name,~ +- Inside source: true +*** True Line Result + :entity_name, +** Processing line: ~ :as_hash,~ +- Inside source: true +*** True Line Result + :as_hash, +** Processing line: ~ :clear!,~ +- Inside source: true +*** True Line Result + :clear!, +** Processing line: ~ :created_at_elapsed,~ +- Inside source: true +*** True Line Result + :created_at_elapsed, +** Processing line: ~ :entity_id,~ +- Inside source: true +*** True Line Result + :entity_id, +** Processing line: ~ "entity_id=",~ +- Inside source: true +*** True Line Result + "entity_id=", +** Processing line: ~ "tick_count=",~ +- Inside source: true +*** True Line Result + "tick_count=", +** Processing line: ~ :global_created_at_elapsed,~ +- Inside source: true +*** True Line Result + :global_created_at_elapsed, +** Processing line: ~ :load_entity_data!,~ +- Inside source: true +*** True Line Result + :load_entity_data!, +** Processing line: ~ :meta,~ +- Inside source: true +*** True Line Result + :meta, +** Processing line: ~ :meta!,~ +- Inside source: true +*** True Line Result + :meta!, +** Processing line: ~ :new?,~ +- Inside source: true +*** True Line Result + :new?, +** Processing line: ~ :old?,~ +- Inside source: true +*** True Line Result + :old?, +** Processing line: ~ :__original_eq_eq__, :set!,~ +- Inside source: true +*** True Line Result + :__original_eq_eq__, :set!, +** Processing line: ~ :update_entity_keys_by_ref,~ +- Inside source: true +*** True Line Result + :update_entity_keys_by_ref, +** Processing line: ~ :with_meta] +~ +- Inside source: true +*** True Line Result + :with_meta] + +** Processing line: ~ ignores + keys.find_all { |k| k.to_s.to_i.to_s == k.to_s }~ +- Inside source: true +*** True Line Result + ignores + keys.find_all { |k| k.to_s.to_i.to_s == k.to_s } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ final = (keys - (others.map { |m| m.to_s })).uniq~ +- Inside source: true +*** True Line Result + final = (keys - (others.map { |m| m.to_s })).uniq +** Processing line: ~ final~ +- Inside source: true +*** True Line Result + final +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def suggest_autocompletion opts~ +- Inside source: true +*** True Line Result + def suggest_autocompletion opts +** Processing line: ~ parse_result = autocomplete_parse opts~ +- Inside source: true +*** True Line Result + parse_result = autocomplete_parse opts +** Processing line: ~ return [] unless parse_result[:cursor_line]~ +- Inside source: true +*** True Line Result + return [] unless parse_result[:cursor_line] +** Processing line: ~ text = parse_result[:text]~ +- Inside source: true +*** True Line Result + text = parse_result[:text] +** Processing line: ~ word = parse_result[:word]~ +- Inside source: true +*** True Line Result + word = parse_result[:word] +** Processing line: ~ token = parse_result[:token]~ +- Inside source: true +*** True Line Result + token = parse_result[:token] +** Processing line: ~ dots = parse_result[:dots]~ +- Inside source: true +*** True Line Result + dots = parse_result[:dots] +** Processing line: ~ dot = parse_result[:dot]~ +- Inside source: true +*** True Line Result + dot = parse_result[:dot] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return [] if word.strip.start_with? "#"~ +- Inside source: true +*** True Line Result + return [] if word.strip.start_with? "#" +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if word[-1] == "." && token~ +- Inside source: true +*** True Line Result + if word[-1] == "." && token +** Processing line: ~ lookup = {~ +- Inside source: true +*** True Line Result + lookup = { +** Processing line: ~ 'args' => lambda { $gtk.args.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'args' => lambda { $gtk.args.autocomplete_methods }, +** Processing line: ~ 'inputs' => lambda { $gtk.args.inputs.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'inputs' => lambda { $gtk.args.inputs.autocomplete_methods }, +** Processing line: ~ 'geometry' => lambda { $gtk.args.geometry.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'geometry' => lambda { $gtk.args.geometry.autocomplete_methods }, +** Processing line: ~ 'outputs' => lambda { $gtk.args.outputs.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'outputs' => lambda { $gtk.args.outputs.autocomplete_methods }, +** Processing line: ~ 'layout' => lambda { $gtk.args.layouts.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'layout' => lambda { $gtk.args.layouts.autocomplete_methods }, +** Processing line: ~ 'keyboard' => lambda { $gtk.args.keyboard.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'keyboard' => lambda { $gtk.args.keyboard.autocomplete_methods }, +** Processing line: ~ 'key_down' => lambda { $gtk.args.keyboard.key_down.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'key_down' => lambda { $gtk.args.keyboard.key_down.autocomplete_methods }, +** Processing line: ~ 'key_up' => lambda { $gtk.args.keyboard.key_up.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'key_up' => lambda { $gtk.args.keyboard.key_up.autocomplete_methods }, +** Processing line: ~ 'state' => lambda { $gtk.args.state.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'state' => lambda { $gtk.args.state.autocomplete_methods }, +** Processing line: ~ 'fn' => lambda { $gtk.args.fn.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'fn' => lambda { $gtk.args.fn.autocomplete_methods }, +** Processing line: ~ '$gtk' => lambda { $gtk.autocomplete_methods },~ +- Inside source: true +*** True Line Result + '$gtk' => lambda { $gtk.autocomplete_methods }, +** Processing line: ~ 'gtk' => lambda { $gtk.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'gtk' => lambda { $gtk.autocomplete_methods }, +** Processing line: ~ 'mouse' => lambda { $gtk.args.inputs.mouse.autocomplete_methods },~ +- Inside source: true +*** True Line Result + 'mouse' => lambda { $gtk.args.inputs.mouse.autocomplete_methods }, +** Processing line: ~ 'click' => lambda { [:x, :y, :point] }~ +- Inside source: true +*** True Line Result + 'click' => lambda { [:x, :y, :point] } +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ lookup_result = lookup[dot]~ +- Inside source: true +*** True Line Result + lookup_result = lookup[dot] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ return autocomplete_filter_methods lookup_result.call if lookup_result~ +- Inside source: true +*** True Line Result + return autocomplete_filter_methods lookup_result.call if lookup_result +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ start_collecting = false~ +- Inside source: true +*** True Line Result + start_collecting = false +** Processing line: ~ dots_after_state = dots.find_all do |s|~ +- Inside source: true +*** True Line Result + dots_after_state = dots.find_all do |s| +** Processing line: ~ if s == "state"~ +- Inside source: true +*** True Line Result + if s == "state" +** Processing line: ~ start_collecting = true~ +- Inside source: true +*** True Line Result + start_collecting = true +** Processing line: ~ false~ +- Inside source: true +*** True Line Result + false +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ start_collecting~ +- Inside source: true +*** True Line Result + start_collecting +** 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: ~ target = $gtk.args.state~ +- Inside source: true +*** True Line Result + target = $gtk.args.state +** Processing line: ~ dots_after_state.each do |k|~ +- Inside source: true +*** True Line Result + dots_after_state.each do |k| +** Processing line: ~ target = target.as_hash[k.to_sym] if target.respond_to? :as_hash~ +- Inside source: true +*** True Line Result + target = target.as_hash[k.to_sym] if target.respond_to? :as_hash +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** 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: ~ 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: ~ text.gsub!("[", " ")~ +- Inside source: true +*** True Line Result + text.gsub!("[", " ") +** Processing line: ~ text.gsub!("]", " ")~ +- Inside source: true +*** True Line Result + text.gsub!("]", " ") +** Processing line: ~ text.gsub!("(", " ")~ +- Inside source: true +*** True Line Result + text.gsub!("(", " ") +** Processing line: ~ text.gsub!(")", " ")~ +- Inside source: true +*** True Line Result + text.gsub!(")", " ") +** Processing line: ~ text.gsub!(":", "")~ +- Inside source: true +*** True Line Result + text.gsub!(":", "") +** Processing line: ~ text.gsub!(".", " ")~ +- Inside source: true +*** True Line Result + text.gsub!(".", " ") +** Processing line: ~ text.gsub!("=", " ")~ +- Inside source: true +*** True Line Result + text.gsub!("=", " ") +** Processing line: ~ return (autocomplete_filter_methods (text.split " "),~ +- Inside source: true +*** True Line Result + return (autocomplete_filter_methods (text.split " "), +** Processing line: ~ :gtk, :false, :true, :args, :suppress_mailbox, :end)~ +- Inside source: true +*** True Line Result + :gtk, :false, :true, :args, :suppress_mailbox, :end) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end # end Autocomplete~ +- Inside source: true +*** True Line Result + end # end Autocomplete +** Processing line: ~ end # end Runtime~ +- Inside source: true +*** True Line Result + end # end Runtime +** Processing line: ~ end # end GTK~ +- Inside source: true +*** True Line Result + end # end GTK +** 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: ~*** runtime/draw.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** runtime/draw.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~ +- Inside source: true +*** True Line Result + # ./dragon/runtime/draw.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # draw.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*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Runtime~ +- 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~ +- Inside source: true +*** True Line Result + return $top_level.tick_render @args, pass +** Processing line: ~ end~ +- 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~ +- Inside source: true +*** True Line Result + # Don't change this draw order unless you understand +** Processing line: ~ # the implications.~ +- 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 }~ +- Inside source: true +*** True Line Result + # pass.solids.each { |s| draw_solid s } +** Processing line: ~ # while loops are faster than each with block~ +- Inside source: true +*** True Line Result + # while loops are faster than each with block +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.solids.length~ +- Inside source: true +*** True Line Result + length = pass.solids.length +** Processing line: ~ while idx < pass.solids.length~ +- 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~ +- Inside source: true +*** True Line Result + draw_solid (pass.solids.at idx) # accessing an array using .value instead of [] is faster +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # pass.static_solids.each { |s| draw_solid s }~ +- Inside source: true +*** True Line Result + # pass.static_solids.each { |s| draw_solid s } +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.static_solids.length~ +- Inside source: true +*** True Line Result + length = pass.static_solids.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_solid (pass.static_solids.at idx)~ +- Inside source: true +*** True Line Result + draw_solid (pass.static_solids.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # pass.sprites.each { |s| draw_sprite s }~ +- Inside source: true +*** True Line Result + # pass.sprites.each { |s| draw_sprite s } +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.sprites.length~ +- Inside source: true +*** True Line Result + length = pass.sprites.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_sprite (pass.sprites.at idx)~ +- Inside source: true +*** True Line Result + draw_sprite (pass.sprites.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # pass.static_sprites.each { |s| draw_sprite s }~ +- Inside source: true +*** True Line Result + # pass.static_sprites.each { |s| draw_sprite s } +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.static_sprites.length~ +- Inside source: true +*** True Line Result + length = pass.static_sprites.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_sprite (pass.static_sprites.at idx)~ +- Inside source: true +*** True Line Result + draw_sprite (pass.static_sprites.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # pass.primitives.each { |p| draw_primitive p }~ +- Inside source: true +*** True Line Result + # pass.primitives.each { |p| draw_primitive p } +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.primitives.length~ +- Inside source: true +*** True Line Result + length = pass.primitives.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_primitive (pass.primitives.at idx)~ +- Inside source: true +*** True Line Result + draw_primitive (pass.primitives.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # pass.static_primitives.each { |p| draw_primitive p }~ +- Inside source: true +*** True Line Result + # pass.static_primitives.each { |p| draw_primitive p } +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.static_primitives.length~ +- Inside source: true +*** True Line Result + length = pass.static_primitives.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_primitive (pass.static_primitives.at idx)~ +- Inside source: true +*** True Line Result + draw_primitive (pass.static_primitives.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # pass.labels.each { |l| draw_label l }~ +- Inside source: true +*** True Line Result + # pass.labels.each { |l| draw_label l } +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.labels.length~ +- Inside source: true +*** True Line Result + length = pass.labels.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_label (pass.labels.at idx)~ +- Inside source: true +*** True Line Result + draw_label (pass.labels.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # pass.static_labels.each { |l| draw_label l }~ +- Inside source: true +*** True Line Result + # pass.static_labels.each { |l| draw_label l } +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.static_labels.length~ +- Inside source: true +*** True Line Result + length = pass.static_labels.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_label (pass.static_labels.at idx)~ +- Inside source: true +*** True Line Result + draw_label (pass.static_labels.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # pass.lines.each { |l| draw_line l }~ +- Inside source: true +*** True Line Result + # pass.lines.each { |l| draw_line l } +** Processing line: ~ idx = 0~ +- 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~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_line (pass.lines.at idx)~ +- Inside source: true +*** True Line Result + draw_line (pass.lines.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** 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~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.static_lines.length~ +- Inside source: true +*** True Line Result + length = pass.static_lines.length +** Processing line: ~ while idx < pass.static_lines.length~ +- Inside source: true +*** True Line Result + while idx < pass.static_lines.length +** Processing line: ~ draw_line (pass.static_lines.at idx)~ +- Inside source: true +*** True Line Result + draw_line (pass.static_lines.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # pass.borders.each { |b| draw_border b }~ +- Inside source: true +*** True Line Result + # pass.borders.each { |b| draw_border b } +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.borders.length~ +- Inside source: true +*** True Line Result + length = pass.borders.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_border (pass.borders.at idx)~ +- Inside source: true +*** True Line Result + draw_border (pass.borders.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # pass.static_borders.each { |b| draw_border b }~ +- Inside source: true +*** True Line Result + # pass.static_borders.each { |b| draw_border b } +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.static_borders.length~ +- Inside source: true +*** True Line Result + length = pass.static_borders.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_border (pass.static_borders.at idx)~ +- Inside source: true +*** True Line Result + draw_border (pass.static_borders.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !$gtk.production~ +- Inside source: true +*** 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 +*** 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~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_primitive (pass.debug.at idx)~ +- Inside source: true +*** True Line Result + draw_primitive (pass.debug.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** 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~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.static_debug.length~ +- Inside source: true +*** True Line Result + length = pass.static_debug.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_primitive (pass.static_debug.at idx)~ +- Inside source: true +*** True Line Result + draw_primitive (pass.static_debug.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 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: ~ # pass.reserved.each { |r| draw_primitive r }~ +- Inside source: true +*** True Line Result + # pass.reserved.each { |r| draw_primitive r } +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.reserved.length~ +- Inside source: true +*** True Line Result + length = pass.reserved.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_primitive (pass.reserved.at idx)~ +- Inside source: true +*** True Line Result + draw_primitive (pass.reserved.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # pass.static_reserved.each { |r| draw_primitive r }~ +- Inside source: true +*** True Line Result + # pass.static_reserved.each { |r| draw_primitive r } +** Processing line: ~ idx = 0~ +- Inside source: true +*** True Line Result + idx = 0 +** Processing line: ~ length = pass.static_reserved.length~ +- Inside source: true +*** True Line Result + length = pass.static_reserved.length +** Processing line: ~ while idx < length~ +- Inside source: true +*** True Line Result + while idx < length +** Processing line: ~ draw_primitive (pass.static_reserved.at idx)~ +- Inside source: true +*** True Line Result + draw_primitive (pass.static_reserved.at idx) +** Processing line: ~ idx += 1~ +- Inside source: true +*** True Line Result + idx += 1 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ pause!~ +- Inside source: true +*** True Line Result + pause! +** Processing line: ~ pretty_print_exception_and_export! e~ +- Inside source: true +*** True Line Result + pretty_print_exception_and_export! e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def draw_solid s~ +- Inside source: true +*** True Line Result + def draw_solid s +** Processing line: ~ return unless s~ +- Inside source: true +*** True Line Result + return unless s +** Processing line: ~ if s.respond_to? :draw_override~ +- Inside source: true +*** True Line Result + if s.respond_to? :draw_override +** Processing line: ~ s.draw_override @ffi_draw~ +- Inside source: true +*** True Line Result + s.draw_override @ffi_draw +** Processing line: ~ else~ +- 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~ +- 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 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise_conversion_for_rendering_failed s, e, :solid~ +- Inside source: true +*** True Line Result + raise_conversion_for_rendering_failed s, e, :solid +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def draw_sprite s~ +- Inside source: true +*** True Line Result + def draw_sprite s +** Processing line: ~ return unless s~ +- Inside source: true +*** True Line Result + return unless s +** Processing line: ~ if s.respond_to? :draw_override~ +- Inside source: true +*** True Line Result + if s.respond_to? :draw_override +** Processing line: ~ s.draw_override @ffi_draw~ +- Inside source: true +*** True Line Result + s.draw_override @ffi_draw +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @ffi_draw.draw_sprite_3 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,~ +- Inside source: true +*** True Line Result + s.path.s_or_default, +** Processing line: ~ s.angle,~ +- Inside source: true +*** True Line Result + s.angle, +** Processing line: ~ s.a, s.r, s.g, s.b,~ +- Inside source: true +*** True Line Result + s.a, s.r, s.g, s.b, +** Processing line: ~ s.tile_x, s.tile_y, s.tile_w, s.tile_h,~ +- Inside source: true +*** True Line Result + s.tile_x, s.tile_y, s.tile_w, s.tile_h, +** Processing line: ~ !!s.flip_horizontally, !!s.flip_vertically,~ +- Inside source: true +*** True Line Result + !!s.flip_horizontally, !!s.flip_vertically, +** Processing line: ~ s.angle_anchor_x, s.angle_anchor_y,~ +- 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~ +- Inside source: true +*** True Line Result + s.source_x, s.source_y, s.source_w, s.source_h +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise_conversion_for_rendering_failed s, e, :sprite~ +- Inside source: true +*** True Line Result + raise_conversion_for_rendering_failed s, e, :sprite +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def draw_screenshot s~ +- Inside source: true +*** True Line Result + def draw_screenshot s +** Processing line: ~ return unless s~ +- Inside source: true +*** True Line Result + return unless s +** Processing line: ~ if s.respond_to? :draw_override~ +- Inside source: true +*** True Line Result + if s.respond_to? :draw_override +** Processing line: ~ s.draw_override @ffi_draw~ +- Inside source: true +*** True Line Result + s.draw_override @ffi_draw +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @ffi_draw.draw_screenshot s.path.s_or_default,~ +- Inside source: true +*** True Line Result + @ffi_draw.draw_screenshot s.path.s_or_default, +** Processing line: ~ s.x, s.y, s.w, s.h,~ +- Inside source: true +*** True Line Result + s.x, s.y, s.w, s.h, +** Processing line: ~ s.angle,~ +- Inside source: true +*** True Line Result + s.angle, +** Processing line: ~ s.a, s.r, s.g, s.b,~ +- Inside source: true +*** True Line Result + s.a, s.r, s.g, s.b, +** Processing line: ~ s.tile_x, s.tile_y, s.tile_w, s.tile_h,~ +- Inside source: true +*** True Line Result + s.tile_x, s.tile_y, s.tile_w, s.tile_h, +** Processing line: ~ !!s.flip_horizontally, !!s.flip_vertically,~ +- Inside source: true +*** True Line Result + !!s.flip_horizontally, !!s.flip_vertically, +** Processing line: ~ s.angle_anchor_x, s.angle_anchor_y,~ +- 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~ +- Inside source: true +*** True Line Result + s.source_x, s.source_y, s.source_w, s.source_h +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise_conversion_for_rendering_failed s, e, :screenshot~ +- Inside source: true +*** True Line Result + raise_conversion_for_rendering_failed s, e, :screenshot +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def draw_label l~ +- Inside source: true +*** True Line Result + def draw_label l +** Processing line: ~ return unless l~ +- Inside source: true +*** True Line Result + return unless l +** Processing line: ~ if l.respond_to? :draw_override~ +- Inside source: true +*** True Line Result + if l.respond_to? :draw_override +** Processing line: ~ l.draw_override @ffi_draw~ +- Inside source: true +*** True Line Result + l.draw_override @ffi_draw +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @ffi_draw.draw_label l.x, l.y, l.text.s_or_default,~ +- 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,~ +- Inside source: true +*** True Line Result + l.size_enum, l.alignment_enum, +** 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.font.s_or_default(nil)~ +- Inside source: true +*** True Line Result + l.font.s_or_default(nil) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise_conversion_for_rendering_failed l, e, :label~ +- Inside source: true +*** True Line Result + raise_conversion_for_rendering_failed l, e, :label +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def draw_line l~ +- Inside source: true +*** True Line Result + def draw_line l +** Processing line: ~ return unless l~ +- Inside source: true +*** True Line Result + return unless l +** Processing line: ~ if l.respond_to? :draw_override~ +- Inside source: true +*** True Line Result + if l.respond_to? :draw_override +** Processing line: ~ l.draw_override @ffi_draw~ +- Inside source: true +*** True Line Result + l.draw_override @ffi_draw +** Processing line: ~ else~ +- 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~ +- 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 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise_conversion_for_rendering_failed l, e, :line~ +- Inside source: true +*** True Line Result + raise_conversion_for_rendering_failed l, e, :line +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def draw_border s~ +- Inside source: true +*** True Line Result + def draw_border s +** Processing line: ~ return unless s~ +- Inside source: true +*** True Line Result + return unless s +** Processing line: ~ if s.respond_to? :draw_override~ +- Inside source: true +*** True Line Result + if s.respond_to? :draw_override +** Processing line: ~ s.draw_override @ffi_draw~ +- Inside source: true +*** True Line Result + s.draw_override @ffi_draw +** Processing line: ~ else~ +- 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~ +- 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 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ raise_conversion_for_rendering_failed s, e, :border~ +- Inside source: true +*** True Line Result + raise_conversion_for_rendering_failed s, e, :border +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def draw_screenshots~ +- Inside source: true +*** True Line Result + def draw_screenshots +** Processing line: ~ @args.outputs.screenshots.each { |s| draw_screenshot s }~ +- Inside source: true +*** True Line Result + @args.outputs.screenshots.each { |s| draw_screenshot s } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def pixel_arrays~ +- Inside source: true +*** True Line Result + def pixel_arrays +** Processing line: ~ @args.pixel_arrays.each { |k,v|~ +- Inside source: true +*** True Line Result + @args.pixel_arrays.each { |k,v| +** Processing line: ~ if v.pixels.length == (v.width * v.height) # !!! FIXME: warning? exception? Different API?~ +- Inside source: true +*** True Line Result + if v.pixels.length == (v.width * v.height) # !!! FIXME: warning? exception? Different API? +** Processing line: ~ @ffi_draw.upload_pixel_array k.to_s, v.width.to_i, v.height.to_i, v.pixels~ +- Inside source: true +*** True Line Result + @ffi_draw.upload_pixel_array k.to_s, v.width.to_i, v.height.to_i, v.pixels +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ pause!~ +- Inside source: true +*** True Line Result + pause! +** Processing line: ~ pretty_print_exception_and_export! e~ +- Inside source: true +*** True Line Result + pretty_print_exception_and_export! e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- 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: ~*** runtime/framerate.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** runtime/framerate.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/framerate.rb~ +- Inside source: true +*** True Line Result + # ./dragon/runtime/framerate.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # framerate.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # framerate.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Runtime~ +- Inside source: true +*** True Line Result + class Runtime +** Processing line: ~ module Framerate~ +- Inside source: true +*** True Line Result + module Framerate +** Processing line: ~ def framerate_init~ +- Inside source: true +*** True Line Result + def framerate_init +** Processing line: ~ @tick_time = Time.new.to_i~ +- Inside source: true +*** True Line Result + @tick_time = Time.new.to_i +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def delta_framerate~ +- Inside source: true +*** True Line Result + def delta_framerate +** Processing line: ~ (current_framerate || 0) - (@previous_framerate || 0)~ +- Inside source: true +*** True Line Result + (current_framerate || 0) - (@previous_framerate || 0) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def reset_framerate_calculation~ +- Inside source: true +*** True Line Result + def reset_framerate_calculation +** Processing line: ~ @tick_speed_sum = 0~ +- Inside source: true +*** True Line Result + @tick_speed_sum = 0 +** Processing line: ~ @tick_speed_count = 0~ +- Inside source: true +*** True Line Result + @tick_speed_count = 0 +** Processing line: ~ @previous_framerate = 0~ +- Inside source: true +*** True Line Result + @previous_framerate = 0 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def check_framerate~ +- Inside source: true +*** True Line Result + def check_framerate +** Processing line: ~ if @framerate_diagnostics_requested~ +- Inside source: true +*** True Line Result + if @framerate_diagnostics_requested +** Processing line: ~ log "================================"~ +- Inside source: true +*** True Line Result + log "================================" +** Processing line: ~ log framerate_get_diagnostics~ +- Inside source: true +*** True Line Result + log framerate_get_diagnostics +** Processing line: ~ @framerate_diagnostics_requested = false~ +- Inside source: true +*** True Line Result + @framerate_diagnostics_requested = false +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ if !@paused~ +- Inside source: true +*** True Line Result + if !@paused +** Processing line: ~ if @tick_time~ +- Inside source: true +*** True Line Result + if @tick_time +** Processing line: ~ @tick_speed_count += 1~ +- Inside source: true +*** True Line Result + @tick_speed_count += 1 +** Processing line: ~ @tick_speed_sum += Time.now.to_i - @tick_time~ +- Inside source: true +*** True Line Result + @tick_speed_sum += Time.now.to_i - @tick_time +** Processing line: ~ if @tick_speed_count > 60 * 2~ +- Inside source: true +*** True Line Result + if @tick_speed_count > 60 * 2 +** Processing line: ~ if framerate_below_threshold?~ +- Inside source: true +*** True Line Result + if framerate_below_threshold? +** Processing line: ~ @last_framerate = current_framerate~ +- Inside source: true +*** True Line Result + @last_framerate = current_framerate +** Processing line: ~ if !@console.visible?~ +- Inside source: true +*** True Line Result + if !@console.visible? +** Processing line: ~ if !@framerate_important_notification_happened~ +- Inside source: true +*** True Line Result + if !@framerate_important_notification_happened +** Processing line: ~ log_important framerate_warning_message~ +- Inside source: true +*** True Line Result + log_important framerate_warning_message +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ log framerate_warning_message~ +- Inside source: true +*** True Line Result + log framerate_warning_message +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ @framerate_important_notification_happened = true~ +- Inside source: true +*** True Line Result + @framerate_important_notification_happened = true +** 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: ~ @previous_framerate = current_framerate.floor~ +- Inside source: true +*** True Line Result + @previous_framerate = current_framerate.floor +** 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: ~ @tick_time = Time.new.to_i~ +- Inside source: true +*** True Line Result + @tick_time = Time.new.to_i +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ reset_framerate_calculation~ +- Inside source: true +*** True Line Result + reset_framerate_calculation +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue~ +- Inside source: true +*** True Line Result + rescue +** Processing line: ~ reset_framerate_calculation~ +- Inside source: true +*** True Line Result + reset_framerate_calculation +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def framerate_diagnostics~ +- Inside source: true +*** True Line Result + def framerate_diagnostics +** Processing line: ~ # request framerate diagnostics to be printed at the end of tick~ +- Inside source: true +*** True Line Result + # request framerate diagnostics to be printed at the end of tick +** Processing line: ~ @framerate_diagnostics_requested = true~ +- Inside source: true +*** True Line Result + @framerate_diagnostics_requested = true +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def framerate_below_threshold?~ +- Inside source: true +*** True Line Result + def framerate_below_threshold? +** Processing line: ~ @last_framerate ||= 60~ +- Inside source: true +*** True Line Result + @last_framerate ||= 60 +** Processing line: ~ current_framerate < @last_framerate &&~ +- Inside source: true +*** True Line Result + current_framerate < @last_framerate && +** Processing line: ~ current_framerate < 50 &&~ +- Inside source: true +*** True Line Result + current_framerate < 50 && +** Processing line: ~ @previous_framerate > current_framerate &&~ +- Inside source: true +*** True Line Result + @previous_framerate > current_framerate && +** Processing line: ~ Kernel.tick_count > 600~ +- Inside source: true +*** True Line Result + Kernel.tick_count > 600 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def current_framerate~ +- Inside source: true +*** True Line Result + def current_framerate +** Processing line: ~ return 60 if !@tick_speed_sum || !@tick_speed_sum~ +- Inside source: true +*** True Line Result + return 60 if !@tick_speed_sum || !@tick_speed_sum +** Processing line: ~ r = 100.fdiv(@tick_speed_sum.fdiv(@tick_speed_count) * 100)~ +- Inside source: true +*** True Line Result + r = 100.fdiv(@tick_speed_sum.fdiv(@tick_speed_count) * 100) +** Processing line: ~ if (r.nan? || r.infinite? || r > 58)~ +- Inside source: true +*** True Line Result + if (r.nan? || r.infinite? || r > 58) +** Processing line: ~ r = 60~ +- Inside source: true +*** True Line Result + r = 60 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ r || 60~ +- Inside source: true +*** True Line Result + r || 60 +** Processing line: ~ rescue~ +- Inside source: true +*** True Line Result + rescue +** Processing line: ~ 60~ +- Inside source: true +*** True Line Result + 60 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end # module Framerate~ +- Inside source: true +*** True Line Result + end # module Framerate +** Processing line: ~ end # end class Runtime~ +- Inside source: true +*** True Line Result + end # end class Runtime +** Processing line: ~ end # end module GTK~ +- Inside source: true +*** True Line Result + end # end module GTK +** 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: ~*** runtime/framerate_diagnostics.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** runtime/framerate_diagnostics.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/framerate_diagnostics.rb~ +- Inside source: true +*** True Line Result + # ./dragon/runtime/framerate_diagnostics.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # framerate_diagnostics.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # framerate_diagnostics.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Runtime~ +- Inside source: true +*** True Line Result + class Runtime +** Processing line: ~ module FramerateDiagnostics~ +- Inside source: true +*** True Line Result + module FramerateDiagnostics +** Processing line: ~ def framerate_get_diagnostics~ +- Inside source: true +*** True Line Result + def framerate_get_diagnostics +** Processing line: ~ <<-S~ +- Inside source: true +*** True Line Result + <<-S +** Processing line: ~ * INFO: Framerate Diagnostics~ +- Inside source: true +*** True Line Result + * INFO: Framerate Diagnostics +** Processing line: ~ You can display these diagnostics using:~ +- Inside source: true +*** True Line Result + You can display these diagnostics using: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #+begin_src~ +- Inside source: true +*** True Line Result + #+begin_src +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ # ....~ +- Inside source: true +*** True Line Result + # .... +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # IMPORTANT: Put this at the END of the ~tick~ method.~ +- Inside source: true +*** True Line Result + # IMPORTANT: Put this at the END of the ~tick~ method. +** Processing line: ~ args.outputs.debug << args.gtk.framerate_diagnostics_primitives~ +- Inside source: true +*** True Line Result + args.outputs.debug << args.gtk.framerate_diagnostics_primitives +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ #+end_src~ +- Inside source: true +*** True Line Result + #+end_src +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ** Draw Calls: ~<<~ Invocation Perf Counter~ +- Inside source: true +*** True Line Result + ** Draw Calls: ~<<~ Invocation Perf Counter +** Processing line: ~ Here is how many times ~args.outputs.PRIMITIVE_ARRAY <<~ was called:~ +- Inside source: true +*** True Line Result + Here is how many times ~args.outputs.PRIMITIVE_ARRAY <<~ was called: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #{$perf_counter_outputs_push_count} times invoked.~ +- Inside source: true +*** True Line Result + #{$perf_counter_outputs_push_count} times invoked. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ If the number above is high, consider batching primitives so you can lower the invocation of ~<<~. For example.~ +- Inside source: true +*** True Line Result + If the number above is high, consider batching primitives so you can lower the invocation of ~<<~. For example. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Instead of:~ +- Inside source: true +*** True Line Result + Instead of: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #+begin_src~ +- Inside source: true +*** True Line Result + #+begin_src +** Processing line: ~ args.state.enemies.map do |e|~ +- Inside source: true +*** True Line Result + args.state.enemies.map do |e| +** Processing line: ~ e.alpha = 128~ +- Inside source: true +*** True Line Result + e.alpha = 128 +** Processing line: ~ args.outputs.sprites << e # <-- ~args.outputs.sprites <<~ is invoked a lot~ +- Inside source: true +*** True Line Result + args.outputs.sprites << e # <-- ~args.outputs.sprites <<~ is invoked a lot +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ #+end_src~ +- Inside source: true +*** True Line Result + #+end_src +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Do this:~ +- Inside source: true +*** True Line Result + Do this: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #+begin_src~ +- Inside source: true +*** True Line Result + #+begin_src +** Processing line: ~ args.outputs.sprites << args.state~ +- Inside source: true +*** True Line Result + args.outputs.sprites << args.state +** Processing line: ~ .enemies~ +- Inside source: true +*** True Line Result + .enemies +** Processing line: ~ .map do |e| # <-- ~args.outputs.sprites <<~ is only invoked once.~ +- Inside source: true +*** True Line Result + .map do |e| # <-- ~args.outputs.sprites <<~ is only invoked once. +** Processing line: ~ e.alpha = 128~ +- Inside source: true +*** True Line Result + e.alpha = 128 +** Processing line: ~ e~ +- Inside source: true +*** True Line Result + e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ #+end_src~ +- Inside source: true +*** True Line Result + #+end_src +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ** Array Primitives~ +- Inside source: true +*** True Line Result + ** Array Primitives +** Processing line: ~ ~Primitives~ represented as an ~Array~ (~Tuple~) are great for prototyping, but are not as performant as using a ~Hash~.~ +- Inside source: true +*** True Line Result + ~Primitives~ represented as an ~Array~ (~Tuple~) are great for prototyping, but are not as performant as using a ~Hash~. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Here is the number of ~Array~ primitives that were encountered:~ +- Inside source: true +*** True Line Result + Here is the number of ~Array~ primitives that were encountered: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #{$perf_counter_primitive_is_array} Array Primitives.~ +- Inside source: true +*** True Line Result + #{$perf_counter_primitive_is_array} Array Primitives. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ If the number above is high, consider converting them to hashes. For example.~ +- Inside source: true +*** True Line Result + If the number above is high, consider converting them to hashes. For example. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Instead of:~ +- Inside source: true +*** True Line Result + Instead of: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #+begin_src~ +- Inside source: true +*** True Line Result + #+begin_src +** Processing line: ~ args.outputs.sprites << [0, 0, 100, 100, 'sprites/enemy.png']~ +- Inside source: true +*** True Line Result + args.outputs.sprites << [0, 0, 100, 100, 'sprites/enemy.png'] +** Processing line: ~ #+begin_end~ +- Inside source: true +*** True Line Result + #+begin_end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Do this:~ +- Inside source: true +*** True Line Result + Do this: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #+begin_src~ +- Inside source: true +*** True Line Result + #+begin_src +** Processing line: ~ args.outputs.sprites << { x: 0,~ +- Inside source: true +*** True Line Result + args.outputs.sprites << { 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/enemy.png' }~ +- Inside source: true +*** True Line Result + path: 'sprites/enemy.png' } +** Processing line: ~ #+begin_end~ +- Inside source: true +*** True Line Result + #+begin_end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ** Primitive Counts~ +- Inside source: true +*** True Line Result + ** Primitive Counts +** Processing line: ~ Here are the draw counts ordered by lowest to highest z order:~ +- Inside source: true +*** True Line Result + Here are the draw counts ordered by lowest to highest z order: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ PRIMITIVE COUNT, STATIC COUNT~ +- Inside source: true +*** True Line Result + PRIMITIVE COUNT, STATIC COUNT +** Processing line: ~ solids: #{@args.outputs.solids.length}, #{@args.outputs.static_solids.length}~ +- Inside source: true +*** True Line Result + solids: #{@args.outputs.solids.length}, #{@args.outputs.static_solids.length} +** Processing line: ~ sprites: #{@args.outputs.sprites.length}, #{@args.outputs.static_sprites.length}~ +- Inside source: true +*** True Line Result + sprites: #{@args.outputs.sprites.length}, #{@args.outputs.static_sprites.length} +** Processing line: ~ primitives: #{@args.outputs.primitives.length}, #{@args.outputs.static_primitives.length}~ +- Inside source: true +*** True Line Result + primitives: #{@args.outputs.primitives.length}, #{@args.outputs.static_primitives.length} +** Processing line: ~ labels: #{@args.outputs.labels.length}, #{@args.outputs.static_labels.length}~ +- Inside source: true +*** True Line Result + labels: #{@args.outputs.labels.length}, #{@args.outputs.static_labels.length} +** Processing line: ~ lines: #{@args.outputs.lines.length}, #{@args.outputs.static_lines.length}~ +- Inside source: true +*** True Line Result + lines: #{@args.outputs.lines.length}, #{@args.outputs.static_lines.length} +** Processing line: ~ borders: #{@args.outputs.borders.length}, #{@args.outputs.static_borders.length}~ +- Inside source: true +*** True Line Result + borders: #{@args.outputs.borders.length}, #{@args.outputs.static_borders.length} +** Processing line: ~ debug: #{@args.outputs.debug.length}, #{@args.outputs.static_debug.length}~ +- Inside source: true +*** True Line Result + debug: #{@args.outputs.debug.length}, #{@args.outputs.static_debug.length} +** Processing line: ~ reserved: #{@args.outputs.reserved.length}, #{@args.outputs.static_reserved.length}~ +- Inside source: true +*** True Line Result + reserved: #{@args.outputs.reserved.length}, #{@args.outputs.static_reserved.length} +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ** Additional Help~ +- Inside source: true +*** True Line Result + ** Additional Help +** Processing line: ~ Come to the DragonRuby Discord channel if you need help troubleshooting performance issues. http://discord.dragonruby.org.~ +- Inside source: true +*** True Line Result + Come to the DragonRuby Discord channel if you need help troubleshooting performance issues. http://discord.dragonruby.org. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ Source code for these diagnostics can be found at: [[https://github.com/dragonruby/dragonruby-game-toolkit-contrib/]]~ +- Inside source: true +*** True Line Result + Source code for these diagnostics can be found at: [[https://github.com/dragonruby/dragonruby-game-toolkit-contrib/]] +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def framerate_warning_message~ +- Inside source: true +*** True Line Result + def framerate_warning_message +** Processing line: ~ <<-S~ +- Inside source: true +*** True Line Result + <<-S +** Processing line: ~ * WARNING:~ +- Inside source: true +*** True Line Result + * WARNING: +** Processing line: ~ Your average framerate dropped below 60 fps for two seconds.~ +- Inside source: true +*** True Line Result + Your average framerate dropped below 60 fps for two seconds. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ The average FPS was #{current_framerate}.~ +- Inside source: true +*** True Line Result + The average FPS was #{current_framerate}. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ ** How To Disable Warning~ +- Inside source: true +*** True Line Result + ** How To Disable Warning +** Processing line: ~ If this warning is getting annoying put the following in your tick method:~ +- Inside source: true +*** True Line Result + If this warning is getting annoying put the following in your tick method: +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #+begin_src~ +- Inside source: true +*** True Line Result + #+begin_src +** Processing line: ~ args.gtk.log_level = :off~ +- Inside source: true +*** True Line Result + args.gtk.log_level = :off +** Processing line: ~ #+end_src~ +- Inside source: true +*** True Line Result + #+end_src +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ #{framerate_get_diagnostics}~ +- Inside source: true +*** True Line Result + #{framerate_get_diagnostics} +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def current_framerate_primitives~ +- Inside source: true +*** True Line Result + def current_framerate_primitives +** Processing line: ~ framerate_diagnostics_primitives~ +- Inside source: true +*** True Line Result + framerate_diagnostics_primitives +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def framerate_diagnostics_primitives~ +- Inside source: true +*** True Line Result + def framerate_diagnostics_primitives +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** 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, +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ x: 5,~ +- Inside source: true +*** True Line Result + x: 5, +** Processing line: ~ y: 5.from_top,~ +- Inside source: true +*** True Line Result + y: 5.from_top, +** Processing line: ~ text: "More Info via DragonRuby Console: $gtk.framerate_diagnostics",~ +- Inside source: true +*** True Line Result + text: "More Info via DragonRuby Console: $gtk.framerate_diagnostics", +** 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: ~ size_enum: -2~ +- Inside source: true +*** True Line Result + size_enum: -2 +** Processing line: ~ }.label,~ +- Inside source: true +*** True Line Result + }.label, +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ x: 5,~ +- Inside source: true +*** True Line Result + x: 5, +** Processing line: ~ y: 20.from_top,~ +- Inside source: true +*** True Line Result + y: 20.from_top, +** Processing line: ~ text: "FPS: %.2f" % args.gtk.current_framerate,~ +- Inside source: true +*** True Line Result + text: "FPS: %.2f" % args.gtk.current_framerate, +** 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: ~ size_enum: -2~ +- Inside source: true +*** True Line Result + size_enum: -2 +** Processing line: ~ }.label,~ +- Inside source: true +*** True Line Result + }.label, +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ x: 5,~ +- Inside source: true +*** True Line Result + x: 5, +** Processing line: ~ y: 35.from_top,~ +- Inside source: true +*** True Line Result + y: 35.from_top, +** Processing line: ~ text: "Draw Calls: #{$perf_counter_outputs_push_count}",~ +- Inside source: true +*** True Line Result + text: "Draw Calls: #{$perf_counter_outputs_push_count}", +** 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: ~ size_enum: -2~ +- Inside source: true +*** True Line Result + size_enum: -2 +** Processing line: ~ }.label,~ +- Inside source: true +*** True Line Result + }.label, +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ x: 5,~ +- Inside source: true +*** True Line Result + x: 5, +** Processing line: ~ y: 50.from_top,~ +- Inside source: true +*** True Line Result + y: 50.from_top, +** Processing line: ~ text: "Array Primitives: #{$perf_counter_primitive_is_array}",~ +- Inside source: true +*** True Line Result + text: "Array Primitives: #{$perf_counter_primitive_is_array}", +** 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: ~ size_enum: -2~ +- Inside source: true +*** True Line Result + size_enum: -2 +** Processing line: ~ }.label,~ +- Inside source: true +*** True Line Result + }.label, +** Processing line: ~ {~ +- Inside source: true +*** True Line Result + { +** Processing line: ~ x: 5,~ +- Inside source: true +*** True Line Result + x: 5, +** Processing line: ~ y: 65.from_top,~ +- Inside source: true +*** True Line Result + y: 65.from_top, +** Processing line: ~ text: "Mouse: #{@args.inputs.mouse.point}",~ +- Inside source: true +*** True Line Result + text: "Mouse: #{@args.inputs.mouse.point}", +** 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: ~ size_enum: -2~ +- Inside source: true +*** True Line Result + size_enum: -2 +** 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: ~~ +- 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: ~#+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: ~*** runtime/hotload.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** runtime/hotload.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/hotload.rb~ +- Inside source: true +*** True Line Result + # ./dragon/runtime/hotload.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # hotlaod.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # hotlaod.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Runtime~ +- Inside source: true +*** True Line Result + class Runtime +** Processing line: ~ # @visibility private~ +- Inside source: true +*** True Line Result + # @visibility private +** Processing line: ~ module Hotload~ +- Inside source: true +*** True Line Result + module Hotload +** Processing line: ~ def hotload_init~ +- Inside source: true +*** True Line Result + def hotload_init +** Processing line: ~ @hotload_if_needed = 0~ +- Inside source: true +*** True Line Result + @hotload_if_needed = 0 +** Processing line: ~ @mailbox_if_needed = 0~ +- Inside source: true +*** True Line Result + @mailbox_if_needed = 0 +** Processing line: ~ @file_mtimes = { }~ +- Inside source: true +*** True Line Result + @file_mtimes = { } +** Processing line: ~ @suppress_mailbox = true~ +- Inside source: true +*** True Line Result + @suppress_mailbox = true +** Processing line: ~ files_to_reload.each { |f| init_mtimes f }~ +- Inside source: true +*** True Line Result + files_to_reload.each { |f| init_mtimes f } +** Processing line: ~ init_mtimes 'app/mailbox.rb'~ +- Inside source: true +*** True Line Result + init_mtimes 'app/mailbox.rb' +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def hotload_on_write_file file_name~ +- Inside source: true +*** True Line Result + def hotload_on_write_file file_name +** Processing line: ~ return unless file_name.include? 'mailbox.rb'~ +- Inside source: true +*** True Line Result + return unless file_name.include? 'mailbox.rb' +** Processing line: ~ @mailbox_if_needed = :force~ +- Inside source: true +*** True Line Result + @mailbox_if_needed = :force +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def files_to_reload~ +- Inside source: true +*** True Line Result + def files_to_reload +** Processing line: ~ if @rcb_release_mode~ +- Inside source: true +*** True Line Result + if @rcb_release_mode +** Processing line: ~ core_files_to_reload + @required_files~ +- Inside source: true +*** True Line Result + core_files_to_reload + @required_files +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ 'dragon/docs.rb',~ +- Inside source: true +*** True Line Result + 'dragon/docs.rb', +** Processing line: ~ 'dragon/help.rb',~ +- Inside source: true +*** True Line Result + 'dragon/help.rb', +** Processing line: ~ 'dragon/kernel_docs.rb',~ +- Inside source: true +*** True Line Result + 'dragon/kernel_docs.rb', +** Processing line: ~ 'dragon/kernel.rb',~ +- Inside source: true +*** True Line Result + 'dragon/kernel.rb', +** Processing line: ~ 'dragon/easing.rb',~ +- Inside source: true +*** True Line Result + 'dragon/easing.rb', +** Processing line: ~ 'dragon/top_level.rb',~ +- Inside source: true +*** True Line Result + 'dragon/top_level.rb', +** Processing line: ~ 'dragon/log.rb',~ +- Inside source: true +*** True Line Result + 'dragon/log.rb', +** Processing line: ~ 'dragon/geometry.rb',~ +- Inside source: true +*** True Line Result + 'dragon/geometry.rb', +** Processing line: ~ 'dragon/attr_gtk.rb',~ +- Inside source: true +*** True Line Result + 'dragon/attr_gtk.rb', +** Processing line: ~ 'dragon/attr_sprite.rb',~ +- Inside source: true +*** True Line Result + 'dragon/attr_sprite.rb', +** Processing line: ~ 'dragon/object.rb',~ +- Inside source: true +*** True Line Result + 'dragon/object.rb', +** Processing line: ~ 'dragon/class.rb',~ +- Inside source: true +*** True Line Result + 'dragon/class.rb', +** Processing line: ~ 'dragon/string.rb',~ +- Inside source: true +*** True Line Result + 'dragon/string.rb', +** Processing line: ~ 'dragon/entity.rb',~ +- Inside source: true +*** True Line Result + 'dragon/entity.rb', +** Processing line: ~ 'dragon/strict_entity.rb',~ +- Inside source: true +*** True Line Result + 'dragon/strict_entity.rb', +** Processing line: ~ 'dragon/open_entity.rb',~ +- Inside source: true +*** True Line Result + 'dragon/open_entity.rb', +** Processing line: ~ 'dragon/serialize.rb',~ +- Inside source: true +*** True Line Result + 'dragon/serialize.rb', +** Processing line: ~ 'dragon/primitive.rb',~ +- Inside source: true +*** True Line Result + 'dragon/primitive.rb', +** Processing line: ~ 'dragon/nil_class_false_class.rb',~ +- Inside source: true +*** True Line Result + 'dragon/nil_class_false_class.rb', +** Processing line: ~ 'dragon/symbol.rb',~ +- Inside source: true +*** True Line Result + 'dragon/symbol.rb', +** Processing line: ~ 'dragon/numeric_deprecated.rb',~ +- Inside source: true +*** True Line Result + 'dragon/numeric_deprecated.rb', +** Processing line: ~ 'dragon/numeric.rb',~ +- Inside source: true +*** True Line Result + 'dragon/numeric.rb', +** Processing line: ~ 'dragon/hash.rb',~ +- Inside source: true +*** True Line Result + 'dragon/hash.rb', +** Processing line: ~ 'dragon/outputs_deprecated.rb',~ +- Inside source: true +*** True Line Result + 'dragon/outputs_deprecated.rb', +** Processing line: ~ 'dragon/array_docs.rb',~ +- Inside source: true +*** True Line Result + 'dragon/array_docs.rb', +** Processing line: ~ 'dragon/array.rb',~ +- Inside source: true +*** True Line Result + 'dragon/array.rb', +** Processing line: ~ 'dragon/outputs.rb',~ +- Inside source: true +*** True Line Result + 'dragon/outputs.rb', +** Processing line: ~ 'dragon/inputs.rb',~ +- Inside source: true +*** True Line Result + 'dragon/inputs.rb', +** Processing line: ~ 'dragon/mouse_docs.rb',~ +- Inside source: true +*** True Line Result + 'dragon/mouse_docs.rb', +** Processing line: ~ 'dragon/recording.rb',~ +- Inside source: true +*** True Line Result + 'dragon/recording.rb', +** Processing line: ~ 'dragon/grid.rb',~ +- Inside source: true +*** True Line Result + 'dragon/grid.rb', +** Processing line: ~ 'dragon/layout.rb',~ +- Inside source: true +*** True Line Result + 'dragon/layout.rb', +** Processing line: ~ 'dragon/args_deprecated.rb',~ +- Inside source: true +*** True Line Result + 'dragon/args_deprecated.rb', +** Processing line: ~ 'dragon/fn.rb',~ +- Inside source: true +*** True Line Result + 'dragon/fn.rb', +** Processing line: ~ 'dragon/args.rb',~ +- Inside source: true +*** True Line Result + 'dragon/args.rb', +** Processing line: ~ 'dragon/console_prompt.rb',~ +- Inside source: true +*** True Line Result + 'dragon/console_prompt.rb', +** Processing line: ~ 'dragon/console_menu.rb',~ +- Inside source: true +*** True Line Result + 'dragon/console_menu.rb', +** Processing line: ~ 'dragon/console.rb',~ +- Inside source: true +*** True Line Result + 'dragon/console.rb', +** Processing line: ~ 'dragon/assert.rb',~ +- Inside source: true +*** True Line Result + 'dragon/assert.rb', +** Processing line: ~ 'dragon/tests.rb',~ +- Inside source: true +*** True Line Result + 'dragon/tests.rb', +** Processing line: ~ 'dragon/controller_config.rb',~ +- Inside source: true +*** True Line Result + 'dragon/controller_config.rb', +** Processing line: ~ 'dragon/runtime/draw.rb',~ +- Inside source: true +*** True Line Result + 'dragon/runtime/draw.rb', +** Processing line: ~ 'dragon/runtime/deprecated.rb',~ +- Inside source: true +*** True Line Result + 'dragon/runtime/deprecated.rb', +** Processing line: ~ 'dragon/runtime/framerate.rb',~ +- Inside source: true +*** True Line Result + 'dragon/runtime/framerate.rb', +** Processing line: ~ 'dragon/runtime/c_bridge.rb',~ +- Inside source: true +*** True Line Result + 'dragon/runtime/c_bridge.rb', +** Processing line: ~ 'dragon/runtime/hotload.rb',~ +- Inside source: true +*** True Line Result + 'dragon/runtime/hotload.rb', +** Processing line: ~ 'dragon/runtime/backup.rb',~ +- Inside source: true +*** True Line Result + 'dragon/runtime/backup.rb', +** Processing line: ~ 'dragon/runtime/async_require.rb',~ +- Inside source: true +*** True Line Result + 'dragon/runtime/async_require.rb', +** Processing line: ~ 'dragon/runtime/autocomplete.rb',~ +- Inside source: true +*** True Line Result + 'dragon/runtime/autocomplete.rb', +** Processing line: ~ 'dragon/api.rb',~ +- Inside source: true +*** True Line Result + 'dragon/api.rb', +** Processing line: ~ 'dragon/runtime.rb',~ +- Inside source: true +*** True Line Result + 'dragon/runtime.rb', +** Processing line: ~ 'dragon/trace.rb',~ +- Inside source: true +*** True Line Result + 'dragon/trace.rb', +** Processing line: ~ 'dragon/readme_docs.rb',~ +- Inside source: true +*** True Line Result + 'dragon/readme_docs.rb', +** Processing line: ~ 'dragon/hotload_client.rb',~ +- Inside source: true +*** True Line Result + 'dragon/hotload_client.rb', +** Processing line: ~ 'dragon/ios_wizard.rb',~ +- Inside source: true +*** True Line Result + 'dragon/ios_wizard.rb', +** Processing line: ~ 'dragon/itch_wizard.rb',~ +- Inside source: true +*** True Line Result + 'dragon/itch_wizard.rb', +** Processing line: ~ ] + core_files_to_reload + @required_files~ +- Inside source: true +*** True Line Result + ] + core_files_to_reload + @required_files +** 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 core_files_to_reload~ +- Inside source: true +*** True Line Result + def core_files_to_reload +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ 'repl.rb',~ +- Inside source: true +*** True Line Result + 'repl.rb', +** Processing line: ~ 'app/main.rb',~ +- Inside source: true +*** True Line Result + 'app/main.rb', +** Processing line: ~ 'app/repl.rb',~ +- Inside source: true +*** True Line Result + 'app/repl.rb', +** Processing line: ~ 'app/tests.rb',~ +- Inside source: true +*** True Line Result + 'app/tests.rb', +** Processing line: ~ 'app/test.rb',~ +- Inside source: true +*** True Line Result + 'app/test.rb', +** Processing line: ~ 'app/stdin.rb'~ +- Inside source: true +*** True Line Result + 'app/stdin.rb' +** 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 init_mtimes file~ +- Inside source: true +*** True Line Result + def init_mtimes file +** Processing line: ~ current_key = "current_#{file}".to_sym~ +- Inside source: true +*** True Line Result + current_key = "current_#{file}".to_sym +** Processing line: ~ last_key = "last_#{file}".to_sym~ +- 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) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def hotload_source_files~ +- Inside source: true +*** True Line Result + def hotload_source_files +** Processing line: ~ @hotload_if_needed += 1~ +- Inside source: true +*** True Line Result + @hotload_if_needed += 1 +** Processing line: ~ return unless @hotload_if_needed == 60~ +- Inside source: true +*** True Line Result + return unless @hotload_if_needed == 60 +** Processing line: ~ @hotload_if_needed = 0~ +- Inside source: true +*** True Line Result + @hotload_if_needed = 0 +** Processing line: ~ files_to_reload.each { |f| reload_if_needed f }~ +- Inside source: true +*** True Line Result + files_to_reload.each { |f| reload_if_needed f } +** Processing line: ~ console.enable~ +- Inside source: true +*** True Line Result + console.enable +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def mailbox_timeout~ +- Inside source: true +*** True Line Result + def mailbox_timeout +** Processing line: ~ if @suppress_mailbox~ +- Inside source: true +*** True Line Result + if @suppress_mailbox +** Processing line: ~ 60~ +- Inside source: true +*** True Line Result + 60 +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ 3~ +- Inside source: true +*** True Line Result + 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 check_mailbox~ +- Inside source: true +*** True Line Result + def check_mailbox +** Processing line: ~ if @mailbox_if_needed == :force # lol~ +- Inside source: true +*** True Line Result + if @mailbox_if_needed == :force # lol +** Processing line: ~ reload_if_needed 'app/mailbox.rb', true~ +- Inside source: true +*** True Line Result + reload_if_needed 'app/mailbox.rb', true +** Processing line: ~ @mailbox_if_needed = 1~ +- Inside source: true +*** True Line Result + @mailbox_if_needed = 1 +** Processing line: ~ return~ +- Inside source: true +*** True Line Result + return +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ @mailbox_if_needed += 1~ +- Inside source: true +*** True Line Result + @mailbox_if_needed += 1 +** Processing line: ~ return unless @mailbox_if_needed.mod_zero? mailbox_timeout~ +- Inside source: true +*** True Line Result + return unless @mailbox_if_needed.mod_zero? mailbox_timeout +** Processing line: ~ @mailbox_if_needed = 1~ +- Inside source: true +*** True Line Result + @mailbox_if_needed = 1 +** Processing line: ~ reload_if_needed 'app/mailbox.rb'~ +- Inside source: true +*** True Line Result + reload_if_needed 'app/mailbox.rb' +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def hotload_if_needed~ +- Inside source: true +*** True Line Result + def hotload_if_needed +** Processing line: ~ hotload_source_files~ +- Inside source: true +*** True Line Result + hotload_source_files +** Processing line: ~ check_mailbox~ +- Inside source: true +*** True Line Result + check_mailbox +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def on_load_succeeded file~ +- Inside source: true +*** True Line Result + def on_load_succeeded file +** Processing line: ~ @rcb_sender.files_reloaded << file~ +- Inside source: true +*** True Line Result + @rcb_sender.files_reloaded << file +** Processing line: ~ @rcb_sender.reloaded_files << file~ +- Inside source: true +*** True Line Result + @rcb_sender.reloaded_files << file +** Processing line: ~ Trace.untrace_classes!~ +- Inside source: true +*** True Line Result + Trace.untrace_classes! +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + 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: ~ current_key = "current_#{file}".to_sym~ +- Inside source: true +*** True Line Result + current_key = "current_#{file}".to_sym +** Processing line: ~ last_key = "last_#{file}".to_sym~ +- Inside source: true +*** True Line Result + last_key = "last_#{file}".to_sym +** Processing line: ~ @file_mtimes[current_key] ||= nil~ +- Inside source: true +*** True Line Result + @file_mtimes[current_key] ||= nil +** Processing line: ~ @file_mtimes[last_key] ||= nil~ +- Inside source: true +*** True Line Result + @file_mtimes[last_key] ||= nil +** 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: ~ return if !force && @file_mtimes[last_key] == @file_mtimes[current_key]~ +- Inside source: true +*** True Line Result + return if !force && @file_mtimes[last_key] == @file_mtimes[current_key] +** 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]~ +- Inside source: true +*** True Line Result + @file_mtimes[last_key] = @file_mtimes[current_key] +** 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: ~#+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: ~*** string.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** string.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/string.rb~ +- Inside source: true +*** True Line Result + # ./dragon/string.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # string.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # string.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ class String~ +- Inside source: true +*** True Line Result + class String +** Processing line: ~ include ValueType~ +- Inside source: true +*** True Line Result + include ValueType +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.wrapped_lines_recur word, rest, length, aggregate~ +- Inside source: true +*** True Line Result + def self.wrapped_lines_recur word, rest, length, aggregate +** Processing line: ~ if word.nil?~ +- Inside source: true +*** True Line Result + if word.nil? +** Processing line: ~ return aggregate~ +- Inside source: true +*** True Line Result + return aggregate +** Processing line: ~ elsif rest[0].nil?~ +- Inside source: true +*** True Line Result + elsif rest[0].nil? +** Processing line: ~ aggregate << word + "\n"~ +- Inside source: true +*** True Line Result + aggregate << word + "\n" +** Processing line: ~ return aggregate~ +- Inside source: true +*** True Line Result + return aggregate +** Processing line: ~ elsif (word + " " + rest[0]).length > length~ +- Inside source: true +*** True Line Result + elsif (word + " " + rest[0]).length > length +** Processing line: ~ aggregate << word + "\n"~ +- Inside source: true +*** True Line Result + aggregate << word + "\n" +** Processing line: ~ return wrapped_lines_recur rest[0], rest[1..-1], length, aggregate~ +- Inside source: true +*** True Line Result + return wrapped_lines_recur rest[0], rest[1..-1], length, aggregate +** Processing line: ~ elsif (word + " " + rest[0]).length <= length~ +- Inside source: true +*** True Line Result + elsif (word + " " + rest[0]).length <= length +** Processing line: ~ next_word = (word + " " + rest[0])~ +- Inside source: true +*** True Line Result + next_word = (word + " " + rest[0]) +** Processing line: ~ return wrapped_lines_recur next_word, rest[1..-1], length, aggregate~ +- Inside source: true +*** True Line Result + return wrapped_lines_recur next_word, rest[1..-1], length, aggregate +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ log <<-S~ +- Inside source: true +*** True Line Result + log <<-S +** Processing line: ~ WARNING:~ +- Inside source: true +*** True Line Result + WARNING: +** Processing line: ~ #{word} is too long to fit in length of #{length}.~ +- Inside source: true +*** True Line Result + #{word} is too long to fit in length of #{length}. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ next_word = (word + " " + rest[0])~ +- Inside source: true +*** True Line Result + next_word = (word + " " + rest[0]) +** Processing line: ~ return wrapped_lines_recur next_word, rest[1..-1], length, aggregate~ +- Inside source: true +*** True Line Result + return wrapped_lines_recur next_word, rest[1..-1], length, aggregate +** 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 end_with_bang?~ +- Inside source: true +*** True Line Result + def end_with_bang? +** Processing line: ~ self[-1] == "!"~ +- Inside source: true +*** True Line Result + self[-1] == "!" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def without_ending_bang~ +- Inside source: true +*** True Line Result + def without_ending_bang +** Processing line: ~ return self unless end_with_bang?~ +- Inside source: true +*** True Line Result + return self unless end_with_bang? +** Processing line: ~ self[0..-2]~ +- Inside source: true +*** True Line Result + self[0..-2] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.wrapped_lines string, length~ +- Inside source: true +*** True Line Result + def self.wrapped_lines string, length +** Processing line: ~ string.each_line.map do |l|~ +- Inside source: true +*** True Line Result + string.each_line.map do |l| +** Processing line: ~ l = l.rstrip~ +- Inside source: true +*** True Line Result + l = l.rstrip +** Processing line: ~ if l.length < length~ +- Inside source: true +*** True Line Result + if l.length < length +** Processing line: ~ l + "\n"~ +- Inside source: true +*** True Line Result + l + "\n" +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ words = l.split ' '~ +- Inside source: true +*** True Line Result + words = l.split ' ' +** Processing line: ~ wrapped_lines_recur(words[0], words[1..-1], length, []).flatten~ +- Inside source: true +*** True Line Result + wrapped_lines_recur(words[0], words[1..-1], length, []).flatten +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end.flatten~ +- Inside source: true +*** True Line Result + end.flatten +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def wrapped_lines length~ +- Inside source: true +*** True Line Result + def wrapped_lines length +** Processing line: ~ String.wrapped_lines self, length~ +- Inside source: true +*** True Line Result + String.wrapped_lines self, length +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def wrap length~ +- Inside source: true +*** True Line Result + def wrap length +** Processing line: ~ wrapped_lines(length).join.rstrip~ +- Inside source: true +*** True Line Result + wrapped_lines(length).join.rstrip +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def multiline?~ +- Inside source: true +*** True Line Result + def multiline? +** Processing line: ~ include? "\n"~ +- Inside source: true +*** True Line Result + include? "\n" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def indent_lines amount, char = " "~ +- Inside source: true +*** True Line Result + def indent_lines amount, char = " " +** Processing line: ~ self.each_line.each_with_index.map do |l, i|~ +- Inside source: true +*** True Line Result + self.each_line.each_with_index.map do |l, i| +** Processing line: ~ if i == 0~ +- Inside source: true +*** True Line Result + if i == 0 +** Processing line: ~ l~ +- Inside source: true +*** True Line Result + l +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ char * amount + l~ +- Inside source: true +*** True Line Result + char * amount + l +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end.join~ +- Inside source: true +*** True Line Result + end.join +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def quote~ +- Inside source: true +*** True Line Result + def quote +** Processing line: ~ "\"#{self}\""~ +- Inside source: true +*** True Line Result + "\"#{self}\"" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def trim~ +- Inside source: true +*** True Line Result + def trim +** Processing line: ~ strip~ +- Inside source: true +*** True Line Result + strip +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def trim!~ +- Inside source: true +*** True Line Result + def trim! +** Processing line: ~ strip!~ +- Inside source: true +*** True Line Result + strip! +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def ltrim~ +- Inside source: true +*** True Line Result + def ltrim +** Processing line: ~ lstrip~ +- Inside source: true +*** True Line Result + lstrip +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def ltrim!~ +- Inside source: true +*** True Line Result + def ltrim! +** Processing line: ~ lstrip!~ +- Inside source: true +*** True Line Result + lstrip! +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def rtrim~ +- Inside source: true +*** True Line Result + def rtrim +** Processing line: ~ rstrip~ +- Inside source: true +*** True Line Result + rstrip +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def rtrim!~ +- Inside source: true +*** True Line Result + def rtrim! +** Processing line: ~ rstrip!~ +- Inside source: true +*** True Line Result + rstrip! +** 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 + def serialize +** Processing line: ~ self~ +- Inside source: true +*** True Line Result + self +** 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: ~*** tests.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** 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: ~ # ./dragon/tests.rb~ +- Inside source: true +*** True Line Result + # ./dragon/tests.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # tests.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # tests.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Tests~ +- Inside source: true +*** True Line Result + class Tests +** Processing line: ~ attr_accessor :failed, :passed, :inconclusive~ +- Inside source: true +*** True Line Result + attr_accessor :failed, :passed, :inconclusive +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @failed = []~ +- Inside source: true +*** True Line Result + @failed = [] +** Processing line: ~ @passed = []~ +- Inside source: true +*** True Line Result + @passed = [] +** Processing line: ~ @inconclusive = []~ +- Inside source: true +*** True Line Result + @inconclusive = [] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def run_test m~ +- Inside source: true +*** True Line Result + def run_test m +** Processing line: ~ args = Args.new $gtk, nil~ +- Inside source: true +*** True Line Result + args = Args.new $gtk, nil +** Processing line: ~ assert = Assert.new~ +- Inside source: true +*** True Line Result + assert = Assert.new +** Processing line: ~ begin~ +- Inside source: true +*** True Line Result + begin +** Processing line: ~ log_test_running m~ +- Inside source: true +*** True Line Result + log_test_running m +** Processing line: ~ send(m, args, assert)~ +- Inside source: true +*** True Line Result + send(m, args, assert) +** Processing line: ~ if !assert.assertion_performed~ +- Inside source: true +*** True Line Result + if !assert.assertion_performed +** Processing line: ~ log_inconclusive m~ +- Inside source: true +*** True Line Result + log_inconclusive m +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ log_passed m~ +- Inside source: true +*** True Line Result + log_passed m +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ if test_signature_invalid_exception? e, m~ +- Inside source: true +*** True Line Result + if test_signature_invalid_exception? e, m +** Processing line: ~ log_test_signature_incorrect m~ +- Inside source: true +*** True Line Result + log_test_signature_incorrect m +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ mark_test_failed m, e~ +- Inside source: true +*** True Line Result + mark_test_failed m, e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def test_methods_focused~ +- Inside source: true +*** True Line Result + def test_methods_focused +** Processing line: ~ Object.methods.find_all { |m| m.start_with?( "focus_test_") }~ +- Inside source: true +*** True Line Result + Object.methods.find_all { |m| m.start_with?( "focus_test_") } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def test_methods~ +- Inside source: true +*** True Line Result + def test_methods +** Processing line: ~ Object.methods.find_all { |m| m.start_with? "test_" }~ +- Inside source: true +*** True Line Result + Object.methods.find_all { |m| m.start_with? "test_" } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def start~ +- Inside source: true +*** True Line Result + def start +** Processing line: ~ log "* TEST: gtk.test.start has been invoked."~ +- Inside source: true +*** True Line Result + log "* TEST: gtk.test.start has been invoked." +** Processing line: ~ if test_methods_focused.length != 0~ +- Inside source: true +*** True Line Result + if test_methods_focused.length != 0 +** Processing line: ~ @is_running = true~ +- Inside source: true +*** True Line Result + @is_running = true +** Processing line: ~ test_methods_focused.each { |m| run_test m }~ +- Inside source: true +*** True Line Result + test_methods_focused.each { |m| run_test m } +** Processing line: ~ print_summary~ +- Inside source: true +*** True Line Result + print_summary +** Processing line: ~ @is_running = false~ +- Inside source: true +*** True Line Result + @is_running = false +** Processing line: ~ elsif test_methods.length == 0~ +- Inside source: true +*** True Line Result + elsif test_methods.length == 0 +** Processing line: ~ log_no_tests_found~ +- Inside source: true +*** True Line Result + log_no_tests_found +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ @is_running = true~ +- Inside source: true +*** True Line Result + @is_running = true +** Processing line: ~ test_methods.each { |m| run_test m }~ +- Inside source: true +*** True Line Result + test_methods.each { |m| run_test m } +** Processing line: ~ print_summary~ +- Inside source: true +*** True Line Result + print_summary +** Processing line: ~ @is_running = false~ +- Inside source: true +*** True Line Result + @is_running = false +** 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 mark_test_failed m, e~ +- Inside source: true +*** True Line Result + def mark_test_failed m, e +** Processing line: ~ message = "Failed."~ +- Inside source: true +*** True Line Result + message = "Failed." +** Processing line: ~ self.failed << { m: m, e: e }~ +- Inside source: true +*** True Line Result + self.failed << { m: m, e: e } +** Processing line: ~ log message~ +- Inside source: true +*** True Line Result + log message +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def running?~ +- Inside source: true +*** True Line Result + def running? +** Processing line: ~ @is_running~ +- Inside source: true +*** True Line Result + @is_running +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_inconclusive m~ +- Inside source: true +*** True Line Result + def log_inconclusive m +** Processing line: ~ self.inconclusive << {m: m}~ +- Inside source: true +*** True Line Result + self.inconclusive << {m: m} +** Processing line: ~ log "Inconclusive."~ +- Inside source: true +*** True Line Result + log "Inconclusive." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_passed m~ +- Inside source: true +*** True Line Result + def log_passed m +** Processing line: ~ self.passed << {m: m}~ +- Inside source: true +*** True Line Result + self.passed << {m: m} +** Processing line: ~ log "Passed."~ +- Inside source: true +*** True Line Result + log "Passed." +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_no_tests_found~ +- Inside source: true +*** True Line Result + def log_no_tests_found +** Processing line: ~ log <<-S~ +- Inside source: true +*** True Line Result + log <<-S +** Processing line: ~ No tests were found. To create a test. Define a method~ +- Inside source: true +*** True Line Result + No tests were found. To create a test. Define a method +** Processing line: ~ that begins with test_. For example:~ +- Inside source: true +*** True Line Result + that begins with test_. For example: +** Processing line: ~ #+begin_src~ +- Inside source: true +*** True Line Result + #+begin_src +** Processing line: ~ def test_game_over args, assert~ +- Inside source: true +*** True Line Result + def test_game_over args, assert +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ #+end_src~ +- Inside source: true +*** True Line Result + #+end_src +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_test_running m~ +- Inside source: true +*** True Line Result + def log_test_running m +** Processing line: ~ log "** Running: #{m}"~ +- Inside source: true +*** True Line Result + log "** Running: #{m}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def test_signature_invalid_exception? e, m~ +- Inside source: true +*** True Line Result + def test_signature_invalid_exception? e, m +** Processing line: ~ e.to_s.include?(m.to_s) && e.to_s.include?("wrong number of arguments")~ +- Inside source: true +*** True Line Result + e.to_s.include?(m.to_s) && e.to_s.include?("wrong number of arguments") +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def log_test_signature_incorrect m~ +- Inside source: true +*** True Line Result + def log_test_signature_incorrect m +** Processing line: ~ log "TEST METHOD INVALID:", <<-S~ +- Inside source: true +*** True Line Result + log "TEST METHOD INVALID:", <<-S +** Processing line: ~ I found a test method called :#{m}. But it needs to have~ +- Inside source: true +*** True Line Result + I found a test method called :#{m}. But it needs to have +** Processing line: ~ the following method signature:~ +- Inside source: true +*** True Line Result + the following method signature: +** Processing line: ~ #+begin_src~ +- Inside source: true +*** True Line Result + #+begin_src +** Processing line: ~ def #{m} args, assert~ +- Inside source: true +*** True Line Result + def #{m} args, assert +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ #+end_src~ +- Inside source: true +*** True Line Result + #+end_src +** Processing line: ~ Please update the method signature to match the code above. If you~ +- Inside source: true +*** True Line Result + Please update the method signature to match the code above. If you +** Processing line: ~ did not intend this to be a test method. Rename the method so it does~ +- Inside source: true +*** True Line Result + did not intend this to be a test method. Rename the method so it does +** Processing line: ~ not start with "test_".~ +- Inside source: true +*** True Line Result + not start with "test_". +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def print_summary~ +- Inside source: true +*** True Line Result + def print_summary +** Processing line: ~ log "** Summary"~ +- Inside source: true +*** True Line Result + log "** Summary" +** Processing line: ~ log "*** Passed"~ +- Inside source: true +*** True Line Result + log "*** Passed" +** Processing line: ~ log "#{self.passed.length} test(s) passed."~ +- Inside source: true +*** True Line Result + log "#{self.passed.length} test(s) passed." +** Processing line: ~ self.passed.each { |h| log "**** :#{h[:m]}" }~ +- Inside source: true +*** True Line Result + self.passed.each { |h| log "**** :#{h[:m]}" } +** Processing line: ~ log "*** Inconclusive"~ +- Inside source: true +*** True Line Result + log "*** Inconclusive" +** Processing line: ~ if self.inconclusive.length > 0~ +- Inside source: true +*** True Line Result + if self.inconclusive.length > 0 +** Processing line: ~ log_once :assertion_ok_note, <<-S~ +- Inside source: true +*** True Line Result + log_once :assertion_ok_note, <<-S +** Processing line: ~ NOTE FOR INCONCLUSIVE TESTS: No assertion was performed in the test.~ +- Inside source: true +*** True Line Result + NOTE FOR INCONCLUSIVE TESTS: No assertion was performed in the test. +** Processing line: ~ Add assert.ok! at the end of the test if you are using your own assertions.~ +- Inside source: true +*** True Line Result + Add assert.ok! at the end of the test if you are using your own assertions. +** Processing line: ~ S~ +- Inside source: true +*** True Line Result + S +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ log "#{self.inconclusive.length} test(s) inconclusive."~ +- Inside source: true +*** True Line Result + log "#{self.inconclusive.length} test(s) inconclusive." +** Processing line: ~ self.inconclusive.each { |h| log "**** :#{h[:m]}" }~ +- Inside source: true +*** True Line Result + self.inconclusive.each { |h| log "**** :#{h[:m]}" } +** Processing line: ~ log "*** Failed"~ +- Inside source: true +*** True Line Result + log "*** Failed" +** Processing line: ~ log "#{self.failed.length} test(s) failed."~ +- Inside source: true +*** True Line Result + log "#{self.failed.length} test(s) failed." +** Processing line: ~ self.failed.each do |h|~ +- Inside source: true +*** True Line Result + self.failed.each do |h| +** Processing line: ~ log "**** Test name: :#{h[:m]}"~ +- Inside source: true +*** True Line Result + log "**** Test name: :#{h[:m]}" +** Processing line: ~ log "#{h[:e].to_s.gsub("* ERROR:", "").strip}"~ +- Inside source: true +*** True Line Result + log "#{h[:e].to_s.gsub("* ERROR:", "").strip}" +** 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: ~#+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: ~*** trace.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** trace.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/trace.rb~ +- Inside source: true +*** True Line Result + # ./dragon/trace.rb +** Processing line: ~ # coding: utf-8~ +- Inside source: true +*** True Line Result + # coding: utf-8 +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # trace.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # trace.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright:~ +- Inside source: true +*** True Line Result + # Contributors outside of DragonRuby who also hold Copyright: +** Processing line: ~ # - Dan Healy: https://github.com/danhealy~ +- Inside source: true +*** True Line Result + # - Dan Healy: https://github.com/danhealy +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ module Trace~ +- Inside source: true +*** True Line Result + module Trace +** Processing line: ~ IGNORED_METHODS = [~ +- Inside source: true +*** True Line Result + IGNORED_METHODS = [ +** Processing line: ~ :define_singleton_method, :raise_immediately, :instance_of?,~ +- Inside source: true +*** True Line Result + :define_singleton_method, :raise_immediately, :instance_of?, +** Processing line: ~ :raise_with_caller, :initialize_copy, :class_defined?,~ +- Inside source: true +*** True Line Result + :raise_with_caller, :initialize_copy, :class_defined?, +** Processing line: ~ :instance_variable_get, :format, :purge_class, :instance_variable_defined?,~ +- Inside source: true +*** True Line Result + :instance_variable_get, :format, :purge_class, :instance_variable_defined?, +** Processing line: ~ :metadata_object_id, :instance_variable_set, :__printstr__,~ +- Inside source: true +*** True Line Result + :metadata_object_id, :instance_variable_set, :__printstr__, +** Processing line: ~ :instance_variables, :is_a?, :p, :kind_of?, :==, :log_once,~ +- Inside source: true +*** True Line Result + :instance_variables, :is_a?, :p, :kind_of?, :==, :log_once, +** Processing line: ~ :protected_methods, :log_once_info, :private_methods, :open,~ +- Inside source: true +*** True Line Result + :protected_methods, :log_once_info, :private_methods, :open, +** Processing line: ~ :!=, :initialize, :object_id, :Hash, :methods, :tick, :!,~ +- Inside source: true +*** True Line Result + :!=, :initialize, :object_id, :Hash, :methods, :tick, :!, +** Processing line: ~ :respond_to?, :yield_self, :send, :instance_eval, :then,~ +- Inside source: true +*** True Line Result + :respond_to?, :yield_self, :send, :instance_eval, :then, +** Processing line: ~ :__method__, :__send__, :log_print, :dig, :itself, :log_info,~ +- Inside source: true +*** True Line Result + :__method__, :__send__, :log_print, :dig, :itself, :log_info, +** Processing line: ~ :remove_instance_variable, :raise, :public_methods, :instance_exec,~ +- Inside source: true +*** True Line Result + :remove_instance_variable, :raise, :public_methods, :instance_exec, +** Processing line: ~ :gets, :local_variables, :tap, :__id__, :class, :singleton_class,~ +- Inside source: true +*** True Line Result + :gets, :local_variables, :tap, :__id__, :class, :singleton_class, +** Processing line: ~ :block_given?, :_inspect, :puts, :global_variables, :getc, :iterator?,~ +- Inside source: true +*** True Line Result + :block_given?, :_inspect, :puts, :global_variables, :getc, :iterator?, +** Processing line: ~ :hash, :to_enum, :printf, :frozen?, :print, :original_puts,~ +- Inside source: true +*** True Line Result + :hash, :to_enum, :printf, :frozen?, :print, :original_puts, +** Processing line: ~ :srand, :freeze, :rand, :extend, :eql?, :equal?, :sprintf, :clone,~ +- Inside source: true +*** True Line Result + :srand, :freeze, :rand, :extend, :eql?, :equal?, :sprintf, :clone, +** Processing line: ~ :dup, :to_s, :primitive_determined?, :inspect, :primitive?, :help,~ +- Inside source: true +*** True Line Result + :dup, :to_s, :primitive_determined?, :inspect, :primitive?, :help, +** Processing line: ~ :__object_methods__, :proc, :__custom_object_methods__, :Float, :enum_for,~ +- Inside source: true +*** True Line Result + :__object_methods__, :proc, :__custom_object_methods__, :Float, :enum_for, +** Processing line: ~ :__supports_ivars__?, :nil?, :fast_rand, :or, :and,~ +- Inside source: true +*** True Line Result + :__supports_ivars__?, :nil?, :fast_rand, :or, :and, +** Processing line: ~ :__caller_without_noise__, :__gtk_ruby_string_contains_source_file_path__?,~ +- Inside source: true +*** True Line Result + :__caller_without_noise__, :__gtk_ruby_string_contains_source_file_path__?, +** Processing line: ~ :__pretty_print_exception__, :__gtk_ruby_source_files__,~ +- Inside source: true +*** True Line Result + :__pretty_print_exception__, :__gtk_ruby_source_files__, +** Processing line: ~ :String, :log, :Array, :putsc, :Integer, :===, :here,~ +- Inside source: true +*** True Line Result + :String, :log, :Array, :putsc, :Integer, :===, :here, +** Processing line: ~ :raise_error_with_kind_of_okay_message, :better_instance_information,~ +- Inside source: true +*** True Line Result + :raise_error_with_kind_of_okay_message, :better_instance_information, +** Processing line: ~ :lambda, :fail, :method_missing, :__case_eqq, :caller,~ +- Inside source: true +*** True Line Result + :lambda, :fail, :method_missing, :__case_eqq, :caller, +** Processing line: ~ :raise_method_missing_better_error, :require, :singleton_methods,~ +- Inside source: true +*** True Line Result + :raise_method_missing_better_error, :require, :singleton_methods, +** Processing line: ~ :!~, :loop, :numeric_or_default, :`, :state, :inputs, :outputs, "args=".to_sym,~ +- Inside source: true +*** True Line Result + :!~, :loop, :numeric_or_default, :`, :state, :inputs, :outputs, "args=".to_sym, +** Processing line: ~ :grid, :gtk, :dragon, :args, :passes, :tick, :grep_source, :grep_source_file,~ +- Inside source: true +*** True Line Result + :grid, :gtk, :dragon, :args, :passes, :tick, :grep_source, :grep_source_file, +** Processing line: ~ :numeric_or_default, :f_or_default, :s_or_default, :i_or_default,~ +- Inside source: true +*** True Line Result + :numeric_or_default, :f_or_default, :s_or_default, :i_or_default, +** Processing line: ~ :comment, :primitive_marker, :xrepl, :repl~ +- Inside source: true +*** True Line Result + :comment, :primitive_marker, :xrepl, :repl +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.traced_classes~ +- Inside source: true +*** True Line Result + def self.traced_classes +** Processing line: ~ @traced_classes ||= []~ +- Inside source: true +*** True Line Result + @traced_classes ||= [] +** Processing line: ~ @traced_classes~ +- Inside source: true +*** True Line Result + @traced_classes +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.mark_class_as_traced! klass~ +- Inside source: true +*** True Line Result + def self.mark_class_as_traced! klass +** Processing line: ~ @traced_classes << klass~ +- Inside source: true +*** True Line Result + @traced_classes << klass +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.untrace_classes!~ +- Inside source: true +*** True Line Result + def self.untrace_classes! +** Processing line: ~ traced_classes.each do |klass|~ +- Inside source: true +*** True Line Result + traced_classes.each do |klass| +** Processing line: ~ klass.class_eval do~ +- Inside source: true +*** True Line Result + klass.class_eval do +** Processing line: ~ all_methods = klass.instance_methods false~ +- Inside source: true +*** True Line Result + all_methods = klass.instance_methods false +** Processing line: ~ if klass.instance_methods.respond_to?(:__trace_call_depth__)~ +- Inside source: true +*** True Line Result + if klass.instance_methods.respond_to?(:__trace_call_depth__) +** Processing line: ~ undef_method :__trace_call_depth__~ +- Inside source: true +*** True Line Result + undef_method :__trace_call_depth__ +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ GTK::Trace.filter_methods_to_trace(all_methods).each do |m|~ +- Inside source: true +*** True Line Result + GTK::Trace.filter_methods_to_trace(all_methods).each do |m| +** Processing line: ~ original_method_name = m~ +- Inside source: true +*** True Line Result + original_method_name = m +** Processing line: ~ trace_method_name = GTK::Trace.trace_method_name_for m~ +- Inside source: true +*** True Line Result + trace_method_name = GTK::Trace.trace_method_name_for m +** Processing line: ~ if klass.instance_methods.include? trace_method_name~ +- Inside source: true +*** True Line Result + if klass.instance_methods.include? trace_method_name +** Processing line: ~ alias_method m, trace_method_name~ +- Inside source: true +*** True Line Result + alias_method m, trace_method_name +** 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: ~ $last_method_traced = nil~ +- Inside source: true +*** True Line Result + $last_method_traced = nil +** Processing line: ~ @traced_classes.clear~ +- Inside source: true +*** True Line Result + @traced_classes.clear +** Processing line: ~ $trace_enabled = false~ +- Inside source: true +*** True Line Result + $trace_enabled = false +** Processing line: ~ if !$gtk.production~ +- Inside source: true +*** True Line Result + if !$gtk.production +** Processing line: ~ $gtk.write_file_root 'logs/trace.txt', "Add trace!(SOMEOBJECT) to the top of ~tick~ and this file will be populated with invocation information.\n"~ +- Inside source: true +*** True Line Result + $gtk.write_file_root 'logs/trace.txt', "Add trace!(SOMEOBJECT) to the top of ~tick~ and this file will be populated with invocation information.\n" +** 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 self.trace_method_name_for m~ +- Inside source: true +*** True Line Result + def self.trace_method_name_for m +** Processing line: ~ "__trace_original_#{m}__".to_sym~ +- Inside source: true +*** True Line Result + "__trace_original_#{m}__".to_sym +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.original_method_name_for m~ +- Inside source: true +*** True Line Result + def self.original_method_name_for m +** Processing line: ~ return m unless m.to_s.start_with?("__trace_original_") && m.to_s.end_with?("__")~ +- Inside source: true +*** True Line Result + return m unless m.to_s.start_with?("__trace_original_") && m.to_s.end_with?("__") +** Processing line: ~ m[16..-3]~ +- Inside source: true +*** True Line Result + m[16..-3] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.filter_methods_to_trace methods~ +- Inside source: true +*** True Line Result + def self.filter_methods_to_trace methods +** Processing line: ~ methods.reject { |m| m.start_with? "__trace_" }.reject { |m| IGNORED_METHODS.include? m }~ +- Inside source: true +*** True Line Result + methods.reject { |m| m.start_with? "__trace_" }.reject { |m| IGNORED_METHODS.include? m } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.trace_times_string~ +- Inside source: true +*** True Line Result + def self.trace_times_string +** Processing line: ~ str = []~ +- Inside source: true +*** True Line Result + str = [] +** Processing line: ~ $trace_performance.sort_by {|method_name, times| -times[:avg] }.each do |method_name, times|~ +- Inside source: true +*** True Line Result + $trace_performance.sort_by {|method_name, times| -times[:avg] }.each do |method_name, times| +** Processing line: ~ str << "#{method_name}: #{times[:sum].round(2)}/#{times[:count]} #{times[:min]}ms min, #{times[:avg].round(2)}ms avg, #{times[:max]}ms max"~ +- Inside source: true +*** True Line Result + str << "#{method_name}: #{times[:sum].round(2)}/#{times[:count]} #{times[:min]}ms min, #{times[:avg].round(2)}ms avg, #{times[:max]}ms max" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ str.join("\n")~ +- Inside source: true +*** True Line Result + str.join("\n") +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def self.flush_trace pad_with_newline = false~ +- Inside source: true +*** True Line Result + def self.flush_trace pad_with_newline = false +** Processing line: ~ $trace_puts ||= []~ +- Inside source: true +*** True Line Result + $trace_puts ||= [] +** Processing line: ~ puts "(Trace info flushed!)"~ +- Inside source: true +*** True Line Result + puts "(Trace info flushed!)" +** Processing line: ~ if $trace_puts.length > 0~ +- Inside source: true +*** True Line Result + if $trace_puts.length > 0 +** Processing line: ~ text = $trace_puts.join("").strip + "\n" + self.trace_times_string + "\n"~ +- Inside source: true +*** True Line Result + text = $trace_puts.join("").strip + "\n" + self.trace_times_string + "\n" +** Processing line: ~ if pad_with_newline~ +- Inside source: true +*** True Line Result + if pad_with_newline +** Processing line: ~ $gtk.append_file_root 'logs/trace.txt', "\n" + text.strip~ +- Inside source: true +*** True Line Result + $gtk.append_file_root 'logs/trace.txt', "\n" + text.strip +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ $gtk.append_file_root 'logs/trace.txt', text.strip~ +- Inside source: true +*** True Line Result + $gtk.append_file_root 'logs/trace.txt', text.strip +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ $trace_puts.clear~ +- Inside source: true +*** True Line Result + $trace_puts.clear +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # @gtk~ +- Inside source: true +*** True Line Result + # @gtk +** Processing line: ~ def self.trace! instance = nil~ +- Inside source: true +*** True Line Result + def self.trace! instance = nil +** Processing line: ~ $trace_history ||= []~ +- Inside source: true +*** True Line Result + $trace_history ||= [] +** Processing line: ~ $trace_enabled = true~ +- Inside source: true +*** True Line Result + $trace_enabled = true +** Processing line: ~ $trace_call_depth ||=0~ +- Inside source: true +*** True Line Result + $trace_call_depth ||=0 +** Processing line: ~ $trace_performance = Hash.new {|h,k|~ +- Inside source: true +*** True Line Result + $trace_performance = Hash.new {|h,k| +** Processing line: ~ h[k] = {~ +- Inside source: true +*** True Line Result + h[k] = { +** Processing line: ~ min: 100000,~ +- Inside source: true +*** True Line Result + min: 100000, +** Processing line: ~ max: 0,~ +- Inside source: true +*** True Line Result + max: 0, +** Processing line: ~ avg: 0,~ +- Inside source: true +*** True Line Result + avg: 0, +** Processing line: ~ sum: 0,~ +- Inside source: true +*** True Line Result + sum: 0, +** Processing line: ~ count: 0~ +- Inside source: true +*** True Line Result + count: 0 +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ flush_trace~ +- Inside source: true +*** True Line Result + flush_trace +** Processing line: ~ instance = $top_level unless instance~ +- Inside source: true +*** True Line Result + instance = $top_level unless instance +** Processing line: ~ return if Trace.traced_classes.include? instance.class~ +- Inside source: true +*** True Line Result + return if Trace.traced_classes.include? instance.class +** Processing line: ~ all_methods = instance.class.instance_methods false~ +- Inside source: true +*** True Line Result + all_methods = instance.class.instance_methods false +** Processing line: ~ instance.class.class_eval do~ +- Inside source: true +*** True Line Result + instance.class.class_eval do +** Processing line: ~ attr_accessor :__trace_call_depth__ unless instance.class.instance_methods.include?(:__trace_call_depth__)~ +- Inside source: true +*** True Line Result + attr_accessor :__trace_call_depth__ unless instance.class.instance_methods.include?(:__trace_call_depth__) +** Processing line: ~ GTK::Trace.filter_methods_to_trace(all_methods).each do |m|~ +- Inside source: true +*** True Line Result + GTK::Trace.filter_methods_to_trace(all_methods).each do |m| +** Processing line: ~ original_method_name = m~ +- Inside source: true +*** True Line Result + original_method_name = m +** Processing line: ~ trace_method_name = GTK::Trace.trace_method_name_for m~ +- Inside source: true +*** True Line Result + trace_method_name = GTK::Trace.trace_method_name_for m +** Processing line: ~ alias_method trace_method_name, m~ +- Inside source: true +*** True Line Result + alias_method trace_method_name, m +** Processing line: ~ $trace_puts << "Tracing #{m} on #{instance.class}.\n"~ +- Inside source: true +*** True Line Result + $trace_puts << "Tracing #{m} on #{instance.class}.\n" +** Processing line: ~ define_method(m) do |*args|~ +- Inside source: true +*** True Line Result + define_method(m) do |*args| +** Processing line: ~ instance.__trace_call_depth__ ||= 0~ +- Inside source: true +*** True Line Result + instance.__trace_call_depth__ ||= 0 +** Processing line: ~ tab_width = " " * (instance.__trace_call_depth__ * 8)~ +- Inside source: true +*** True Line Result + tab_width = " " * (instance.__trace_call_depth__ * 8) +** Processing line: ~ instance.__trace_call_depth__ += 1~ +- Inside source: true +*** True Line Result + instance.__trace_call_depth__ += 1 +** Processing line: ~ $trace_call_depth = instance.__trace_call_depth__~ +- Inside source: true +*** True Line Result + $trace_call_depth = instance.__trace_call_depth__ +** Processing line: ~ parameters = "#{args}"[1..-2]~ +- Inside source: true +*** True Line Result + parameters = "#{args}"[1..-2] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ $trace_puts << "\n #{tab_width}#{m}(#{parameters})"~ +- Inside source: true +*** True Line Result + $trace_puts << "\n #{tab_width}#{m}(#{parameters})" +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ execution_time = Time.new~ +- Inside source: true +*** True Line Result + execution_time = Time.new +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ $last_method_traced = trace_method_name~ +- Inside source: true +*** True Line Result + $last_method_traced = trace_method_name +** Processing line: ~ $trace_history << [m, parameters]~ +- Inside source: true +*** True Line Result + $trace_history << [m, parameters] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ result = send(trace_method_name, *args)~ +- Inside source: true +*** True Line Result + result = send(trace_method_name, *args) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ class_m = "#{instance.class}##{m}"~ +- Inside source: true +*** True Line Result + class_m = "#{instance.class}##{m}" +** Processing line: ~ completion_time = ((Time.new - execution_time).to_f * 1000).round(2)~ +- Inside source: true +*** True Line Result + completion_time = ((Time.new - execution_time).to_f * 1000).round(2) +** Processing line: ~ $trace_performance[class_m][:min] = [$trace_performance[class_m][:min], completion_time].min~ +- Inside source: true +*** True Line Result + $trace_performance[class_m][:min] = [$trace_performance[class_m][:min], completion_time].min +** Processing line: ~ $trace_performance[class_m][:max] = [$trace_performance[class_m][:max], completion_time].max~ +- Inside source: true +*** True Line Result + $trace_performance[class_m][:max] = [$trace_performance[class_m][:max], completion_time].max +** Processing line: ~ $trace_performance[class_m][:count] += 1~ +- Inside source: true +*** True Line Result + $trace_performance[class_m][:count] += 1 +** Processing line: ~ $trace_performance[class_m][:sum] += completion_time~ +- Inside source: true +*** True Line Result + $trace_performance[class_m][:sum] += completion_time +** Processing line: ~ $trace_performance[class_m][:avg] = $trace_performance[class_m][:sum].fdiv($trace_performance[class_m][:count])~ +- Inside source: true +*** True Line Result + $trace_performance[class_m][:avg] = $trace_performance[class_m][:sum].fdiv($trace_performance[class_m][:count]) +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ instance.__trace_call_depth__ -= 1~ +- Inside source: true +*** True Line Result + instance.__trace_call_depth__ -= 1 +** Processing line: ~ instance.__trace_call_depth__ = instance.__trace_call_depth__.greater 0~ +- Inside source: true +*** True Line Result + instance.__trace_call_depth__ = instance.__trace_call_depth__.greater 0 +** Processing line: ~ $trace_puts << "\n #{tab_width} #{completion_time > 10 ? '!!! ' : ''}#{completion_time}ms success: #{m}"~ +- Inside source: true +*** True Line Result + $trace_puts << "\n #{tab_width} #{completion_time > 10 ? '!!! ' : ''}#{completion_time}ms success: #{m}" +** Processing line: ~ if instance.__trace_call_depth__ == 0~ +- Inside source: true +*** True Line Result + if instance.__trace_call_depth__ == 0 +** Processing line: ~ $trace_puts << "\n"~ +- Inside source: true +*** True Line Result + $trace_puts << "\n" +** Processing line: ~ $trace_history.clear~ +- Inside source: true +*** True Line Result + $trace_history.clear +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ result~ +- Inside source: true +*** True Line Result + result +** Processing line: ~ rescue Exception => e~ +- Inside source: true +*** True Line Result + rescue Exception => e +** Processing line: ~ instance.__trace_call_depth__ -= 1~ +- Inside source: true +*** True Line Result + instance.__trace_call_depth__ -= 1 +** Processing line: ~ instance.__trace_call_depth__ = instance.__trace_call_depth__.greater 0~ +- Inside source: true +*** True Line Result + instance.__trace_call_depth__ = instance.__trace_call_depth__.greater 0 +** Processing line: ~ $trace_puts << "\n #{tab_width} failed: #{m}"~ +- Inside source: true +*** True Line Result + $trace_puts << "\n #{tab_width} failed: #{m}" +** Processing line: ~ if instance.__trace_call_depth__ == 0~ +- Inside source: true +*** True Line Result + if instance.__trace_call_depth__ == 0 +** Processing line: ~ $trace_puts << "\n #{tab_width} #{e}"~ +- Inside source: true +*** True Line Result + $trace_puts << "\n #{tab_width} #{e}" +** Processing line: ~ $trace_puts << "\n"~ +- Inside source: true +*** True Line Result + $trace_puts << "\n" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ $trace_call_depth = 0~ +- Inside source: true +*** True Line Result + $trace_call_depth = 0 +** Processing line: ~ GTK::Trace.flush_trace true~ +- Inside source: true +*** True Line Result + GTK::Trace.flush_trace true +** Processing line: ~ raise e~ +- Inside source: true +*** True Line Result + raise e +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ mark_class_as_traced! instance.class~ +- Inside source: true +*** True Line Result + mark_class_as_traced! instance.class +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** wizards.rb~ +- Header detected. +*** True Line Result + +*** True Line Result +*** wizards.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/wizards.rb~ +- Inside source: true +*** True Line Result + # ./dragon/wizards.rb +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +- Inside source: true +*** True Line Result + # Copyright 2019 DragonRuby LLC +** Processing line: ~ # MIT License~ +- Inside source: true +*** True Line Result + # MIT License +** Processing line: ~ # wizards.rb has been released under MIT (*only this file*).~ +- Inside source: true +*** True Line Result + # wizards.rb has been released under MIT (*only this file*). +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ module GTK~ +- Inside source: true +*** True Line Result + module GTK +** Processing line: ~ class Wizards~ +- Inside source: true +*** True Line Result + class Wizards +** Processing line: ~ attr_accessor :ios, :itch~ +- Inside source: true +*** True Line Result + attr_accessor :ios, :itch +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize~ +- Inside source: true +*** True Line Result + def initialize +** Processing line: ~ @ios = IOSWizard.new~ +- Inside source: true +*** True Line Result + @ios = IOSWizard.new +** Processing line: ~ @itch = ItchWizard.new~ +- Inside source: true +*** True Line Result + @itch = ItchWizard.new +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +* Processing Html Given True Lines +** Processing line: ~* DragonRuby Game Toolkit Live Docs~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DragonRuby Game Toolkit Live Docs~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~The information contained here is all available via the DragonRuby Console. You can Open the DragonRuby Console by pressing [`] [~] [²] [^] [º] or [§] within your game.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The information contained here is all available via the DragonRuby Console. You can Open the DragonRuby Console by pressing [`] [~] [²] [^] [º] or [§] within your game.~ +- Line's tilde count is: 1 +- Line contains link marker: false +** Processing line: ~To search docs you can type ~docs_search "SEARCH TERM"~ or if you want to get fancy you can provide a ~lambda~ to filter documentation:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~To search docs you can type ~docs_search "SEARCH TERM"~ or if you want to get fancy you can provide a ~lambda~ to filter documentation:~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ docs_search { |entry| (entry.include? "Array") && (!entry.include? "Enumerable") }~ +** 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. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~Hello World~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Welcome to DragonRuby Game Toolkit. Take the steps below to get started.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Welcome to DragonRuby Game Toolkit. Take the steps below to get started.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~* Join the Discord and Subscribe to the News Letter~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~Join the Discord and Subscribe to the News Letter~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Our Discord channel is [[http://discord.dragonruby.org]].~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Our Discord channel is [[http://discord.dragonruby.org]].~ +- Line's tilde count is: 0 +- Line contains link marker: true +- LINK detected. +** Processing line: ~The News Letter will keep you in the loop with regards to current DragonRuby Events: [[http://dragonrubydispatch.com]].~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The News Letter will keep you in the loop with regards to current DragonRuby Events: [[http://dragonrubydispatch.com]].~ +- Line's tilde count is: 0 +- Line contains link marker: true +- LINK detected. +** Processing line: ~Those who use DragonRuby are called Dragon Riders. This identity is incredibly important to us. When someone asks you:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Those who use DragonRuby are called Dragon Riders. This identity is incredibly important to us. When someone asks you:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_quote~ +- BLOCKQUOTE start detected. +** Processing line: ~What game engine do you use?~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~What game engine do you use?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~#+end_quote~ +- BLOCKQUOTE end detected. +** Processing line: ~~ +** Processing line: ~Reply with:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Reply with:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_quote~ +- BLOCKQUOTE start detected. +** Processing line: ~I am a Dragon Rider.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~I am a Dragon Rider.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~#+end_quote~ +- BLOCKQUOTE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* Watch Some Intro Videos~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~Watch Some 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:~ +- 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:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~1. Beginner Introduction to DragonRuby Game Toolkit: [[https://youtu.be/ixw7TJhU08E]]~ +- OL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~ Beginner Introduction to DragonRuby Game Toolkit: [[https://youtu.be/ixw7TJhU08E]]~ +- 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]]~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~ Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]]~ +- 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]]~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~ Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]]~ +- 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. +- 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.~ +- 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 does not appear to be a header. +- 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: ~* Getting Started Tutorial~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~Getting Started Tutorial~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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: [[https://en.wikipedia.org/wiki/Ryan_C._Gordon]]).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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: [[https://en.wikipedia.org/wiki/Ryan_C._Gordon]]).~ +- Line's tilde count is: 0 +- Line contains link marker: true +- LINK detected. +** Processing line: ~~ +** Processing line: ~** Introduction~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Introduction~ +- 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: ~Introduction~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Welcome!~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Welcome!~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Here's just a little push to get you started if you're new to programming or game development.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Here's just a little push to get you started if you're new to programming or game development.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~If you want to write a game, it's no different than writing any other program for any other framework: there are a few simple rules that might be new to you, but more or less programming is programming no matter what you are building.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~If you want to write a game, it's no different than writing any other program for any other framework: there are a few simple rules that might be new to you, but more or less programming is programming no matter what you are building.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Did you not know that? Did you think you couldn't write a game because you're a "web guy" or you're writing Java at a desk job? Stop letting people tell you that you can't, because you already have everything you need.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Did you not know that? Did you think you couldn't write a game because you're a "web guy" or you're writing Java at a desk job? Stop letting people tell you that you can't, because you already have everything you need.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Here, we're going to be programming in a language called "Ruby." In the interest of full disclosure, I (Ryan Gordon) wrote the C parts of this toolkit and Ruby looks a little strange to me (Amir Rajan wrote the Ruby parts, discounting the parts I mangled), but I'm going to walk you through the basics because we're all learning together, and if you mostly think of yourself as someone that writes C (or C++, C#, Objective-C), PHP, or Java, then you're only a step behind me right now.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Here, we're going to be programming in a language called "Ruby." In the interest of full disclosure, I (Ryan Gordon) wrote the C parts of this toolkit and Ruby looks a little strange to me (Amir Rajan wrote the Ruby parts, discounting the parts I mangled), but I'm going to walk you through the basics because we're all learning together, and if you mostly think of yourself as someone that writes C (or C++, C#, Objective-C), PHP, or Java, then you're only a step behind me right now.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Prerequisites~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Prerequisites~ +- 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: ~Prerequisites~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Here's the most important thing you should know: Ruby lets you do some complicated things really easily, and you can learn that stuff later. I'm going to show you one or two cool tricks, but that's all.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Here's the most important thing you should know: Ruby lets you do some complicated things really easily, and you can learn that stuff later. I'm going to show you one or two cool tricks, but that's all.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Do you know what an if statement is? A for-loop? An array? That's all you'll need to start.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Do you know what an if statement is? A for-loop? An array? That's all you'll need to start.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** The Game Loop~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~The Game Loop~ +- 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: ~The Game Loop~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Ok, here are few rules with regards to game development with GTK:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Ok, here are few rules with regards to game development with GTK:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~- Your game is all going to happen under one function ...~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Your game is all going to happen under one function ...~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- that runs 60 times a second ...~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~that runs 60 times a second ...~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- and has to tell the computer what to draw each time.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~and has to tell the computer what to draw each time.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~That's an entire video game in one run-on sentence.~ +- UL end detected. +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~That's an entire video game in one run-on sentence.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Here's that function. You're going to want to put this in mygame/app/main.rb, because that's where we'll look for it by default. Load it up in your favorite text editor.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Here's that function. You're going to want to put this in mygame/app/main.rb, because that's where we'll look for it by default. Load it up in your favorite text editor.~ +- 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: ~ args.outputs.labels << [580, 400, 'Hello World!']~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~Now run ~dragonruby~ ...did you get a window with "Hello World!" written in it? Good, you're officially a game developer!~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Now run ~dragonruby~ ...did you get a window with "Hello World!" written in it? Good, you're officially a game developer!~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~** Breakdown Of The ~tick~ Method~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Breakdown Of The ~tick~ Method~ +- 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: ~Breakdown Of The ~tick~ Method~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~~mygame/app/main.rb~, is where the Ruby source code is located. This looks a little strange, so I'll break it down line by line. In Ruby, a '#' character starts a single-line comment, so I'll talk about this inline.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~mygame/app/main.rb~, is where the Ruby source code is located. This looks a little strange, so I'll break it down line by line. In Ruby, a '#' character starts a single-line comment, so I'll talk about this inline.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # This "def"ines a function, named "tick," which takes a single argument~ +** Processing line: ~ # named "args". DragonRuby looks for this function and calls it every~ +** Processing line: ~ # frame, 60 times a second. "args" is a magic structure with lots of~ +** Processing line: ~ # information in it. You can set variables in there for your own game state,~ +** Processing line: ~ # and every frame it will updated if keys are pressed, joysticks moved,~ +** Processing line: ~ # mice clicked, etc.~ +** Processing line: ~ def tick args~ +** Processing line: ~~ +** Processing line: ~ # One of the things in "args" is the "outputs" object that your game uses~ +** Processing line: ~ # to draw things. Afraid of rendering APIs? No problem. In DragonRuby,~ +** Processing line: ~ # you use arrays to draw things and we figure out the details.~ +** Processing line: ~ # If you want to draw text on the screen, you give it an array (the thing~ +** Processing line: ~ # in the [ brackets ]), with an X and Y coordinate and the text to draw.~ +** Processing line: ~ # The "<<" thing says "append this array onto the list of them at~ +** Processing line: ~ # args.outputs.labels)~ +** Processing line: ~ args.outputs.labels << [580, 400, 'Hello World!']~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~Once your ~tick~ function finishes, we look at all the arrays you made and figure out how to draw it. You don't need to know about graphics APIs. You're just setting up some arrays! DragonRuby clears out these arrays every frame, so you just need to add what you need _right now_ each time.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Once your ~tick~ function finishes, we look at all the arrays you made and figure out how to draw it. You don't need to know about graphics APIs. You're just setting up some arrays! DragonRuby clears out these arrays every frame, so you just need to add what you need _right now_ each time.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~** Rendering A Sprite~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Rendering A Sprite~ +- 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~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Now let's spice this up a little.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Now let's spice this up a little.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~We're going to add some graphics. Each 2D image in DragonRuby is called a "sprite," and to use them, you just make sure they exist in a reasonable file format (png, jpg, gif, bmp, etc) and specify them by filename. The first time you use one, DragonRuby will load it and keep it in video memory for fast access in the future. If you use a filename that doesn't exist, you get a fun checkerboard pattern!~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~We're going to add some graphics. Each 2D image in DragonRuby is called a "sprite," and to use them, you just make sure they exist in a reasonable file format (png, jpg, gif, bmp, etc) and specify them by filename. The first time you use one, DragonRuby will load it and keep it in video memory for fast access in the future. If you use a filename that doesn't exist, you get a fun checkerboard pattern!~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~There's a "dragonruby.png" file included, just to get you started. Let's have it draw every frame with our text:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~There's a "dragonruby.png" file included, just to get you started. Let's have it draw every frame with our text:~ +- 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: ~ args.outputs.labels << [580, 400, 'Hello World!']~ +** Processing line: ~ args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png']~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~(Pro Tip: you don't have to restart DragonRuby to test your changes; when you save main.rb, DragonRuby will notice and reload your program.)~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~(Pro Tip: you don't have to restart DragonRuby to test your changes; when you save main.rb, DragonRuby will notice and reload your program.)~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~That ~.sprites~ line says "add a sprite to the list of sprites we're drawing, and draw it at position (576, 100) at a size of 128x101 pixels". You can find the image to draw at dragonruby.png.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~That ~.sprites~ line says "add a sprite to the list of sprites we're drawing, and draw it at position (576, 100) at a size of 128x101 pixels". You can find the image to draw at dragonruby.png.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~** Coordinate System and Virtual Canvas~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Coordinate System and Virtual Canvas~ +- 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: ~Coordinate System and Virtual Canvas~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Quick note about coordinates: (0, 0) is the bottom left corner of the screen, and positive numbers go up and to the right. This is more "geometrically correct," even if it's not how you remember doing 2D graphics, but we chose this for a simpler reason: when you're making Super Mario Brothers and you want Mario to jump, you should be able to add to Mario's y position as he goes up and subtract as he falls. It makes things easier to understand.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Quick note about coordinates: (0, 0) is the bottom left corner of the screen, and positive numbers go up and to the right. This is more "geometrically correct," even if it's not how you remember doing 2D graphics, but we chose this for a simpler reason: when you're making Super Mario Brothers and you want Mario to jump, you should be able to add to Mario's y position as he goes up and subtract as he falls. It makes things easier to understand.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Also: your game screen is _always_ 1280x720 pixels. If you resize the window, we will scale and letterbox everything appropriately, so you never have to worry about different resolutions.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Also: your game screen is _always_ 1280x720 pixels. If you resize the window, we will scale and letterbox everything appropriately, so you never have to worry about different resolutions.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Ok, now we have an image on the screen, let's animate it:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Ok, now we have an image on the screen, let's animate it:~ +- 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: ~ args.state.rotation ||= 0~ +** Processing line: ~ args.outputs.labels << [580, 400, 'Hello World!' ]~ +** Processing line: ~ args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png', args.state.rotation]~ +** Processing line: ~ args.state.rotation -= 1~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~Now you can see that this function is getting called a lot!~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Now you can see that this function is getting called a lot!~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Game State~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Game State~ +- 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: ~Game State~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Here's a fun Ruby thing: ~args.state.rotation ||= 0~ is shorthand for "if args.state.rotation isn't initialized, set it to zero." It's a nice way to embed your initialization code right next to where you need the variable.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Here's a fun Ruby thing: ~args.state.rotation ||= 0~ is shorthand for "if args.state.rotation isn't initialized, set it to zero." It's a nice way to embed your initialization code right next to where you need the variable.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~~args.state~ is a place you can hang your own data. It's an open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of class.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.state~ is a place you can hang your own data. It's an open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of class.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~In this case, the current rotation of our sprite, which is happily spinning at 60 frames per second. If you don't specify rotation (or alpha, or color modulation, or a source rectangle, etc), DragonRuby picks a reasonable default, and the array is ordered by the most likely things you need to tell us: position, size, name.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~In this case, the current rotation of our sprite, which is happily spinning at 60 frames per second. If you don't specify rotation (or alpha, or color modulation, or a source rectangle, etc), DragonRuby picks a reasonable default, and the array is ordered by the most likely things you need to tell us: position, size, name.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** There Is No Delta Time~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~There Is No Delta Time~ +- 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: ~There Is No Delta Time~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~One thing we decided to do in DragonRuby is not make you worry about delta time: your function runs at 60 frames per second (about 16 milliseconds) and that's that. Having to worry about framerate is something massive triple-AAA games do, but for fun little 2D games? You'd have to work really hard to not hit 60fps. All your drawing is happening on a GPU designed to run Fortnite quickly; it can definitely handle this.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~One thing we decided to do in DragonRuby is not make you worry about delta time: your function runs at 60 frames per second (about 16 milliseconds) and that's that. Having to worry about framerate is something massive triple-AAA games do, but for fun little 2D games? You'd have to work really hard to not hit 60fps. All your drawing is happening on a GPU designed to run Fortnite quickly; it can definitely handle this.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Since we didn't make you worry about delta time, you can just move the rotation by 1 every time and it works without you having to keep track of time and math. Want it to move faster? Subtract 2.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Since we didn't make you worry about delta time, you can just move the rotation by 1 every time and it works without you having to keep track of time and math. Want it to move faster? Subtract 2.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Handling User Input~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Handling User Input~ +- 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: ~Handling User Input~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Now, let's move that image around.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Now, let's move that image around.~ +- 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: ~ args.state.rotation ||= 0~ +** Processing line: ~ args.state.x ||= 576~ +** Processing line: ~ args.state.y ||= 100~ +** Processing line: ~~ +** Processing line: ~ if args.inputs.mouse.click~ +** Processing line: ~ args.state.x = args.inputs.mouse.click.point.x - 64~ +** Processing line: ~ args.state.y = args.inputs.mouse.click.point.y - 50~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << [580, 400, 'Hello World!']~ +** Processing line: ~ args.outputs.sprites << [args.state.x,~ +** Processing line: ~ args.state.y,~ +** Processing line: ~ 128,~ +** Processing line: ~ 101,~ +** Processing line: ~ 'dragonruby.png',~ +** Processing line: ~ args.state.rotation]~ +** Processing line: ~~ +** Processing line: ~ args.state.rotation -= 1~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~Everywhere you click your mouse, the image moves there. We set a default location for it with ~args.state.x ||= 576~, and then we change those variables when we see the mouse button in action. You can get at the keyboard and game controllers in similar ways.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Everywhere you click your mouse, the image moves there. We set a default location for it with ~args.state.x ||= 576~, and then we change those variables when we see the mouse button in action. You can get at the keyboard and game controllers in similar ways.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~** Coding On A Raspberry Pi~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Coding On A Raspberry Pi~ +- 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: ~Coding On A Raspberry Pi~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~We have only tested DragonRuby on a Raspberry Pi 3, Models B and B+, but we believe it _should_ work on any model with comparable specs.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~We have only tested DragonRuby on a Raspberry Pi 3, Models B and B+, but we believe it _should_ work on any model with comparable specs.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~If you're running DragonRuby Game Toolkit on a Raspberry Pi, or trying to run a game made with the Toolkit on a Raspberry Pi, and it's really really slow-- like one frame every few seconds--then there's likely a simple fix.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~If you're running DragonRuby Game Toolkit on a Raspberry Pi, or trying to run a game made with the Toolkit on a Raspberry Pi, and it's really really slow-- like one frame every few seconds--then there's likely a simple fix.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~You're probably running a desktop environment: menus, apps, web browsers, etc. This is okay! Launch the terminal app and type:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You're probably running a desktop environment: menus, apps, web browsers, etc. This is okay! Launch the terminal app and type:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~sudo raspi-config~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~It'll ask you for your password (if you don't know, try "raspberry"), and then give you a menu of options. Find your way to "Advanced Options", then "GL Driver", and change this to "GL (Full KMS)" ... not "fake KMS," which is also listed there. Save and reboot. In theory, this should fix the problem.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~It'll ask you for your password (if you don't know, try "raspberry"), and then give you a menu of options. Find your way to "Advanced Options", then "GL Driver", and change this to "GL (Full KMS)" ... not "fake KMS," which is also listed there. Save and reboot. In theory, this should fix the problem.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~If you're _still_ having problems and have a Raspberry Pi 2 or better, go back to raspi-config and head over to "Advanced Options", "Memory split," and give the GPU 256 megabytes. You might be able to avoid this for simple games, as this takes RAM away from the system and reserves it for graphics. You can also try 128 megabytes as a gentler option.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~If you're _still_ having problems and have a Raspberry Pi 2 or better, go back to raspi-config and head over to "Advanced Options", "Memory split," and give the GPU 256 megabytes. You might be able to avoid this for simple games, as this takes RAM away from the system and reserves it for graphics. You can also try 128 megabytes as a gentler option.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Note that you can also run DragonRuby without X11 at all: if you run it from a virtual terminal it will render fullscreen and won't need the "Full KMS" option. This might be attractive if you want to use it as a game console sort of thing, or develop over ssh, or launch it from RetroPie, etc.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Note that you can also run DragonRuby without X11 at all: if you run it from a virtual terminal it will render fullscreen and won't need the "Full KMS" option. This might be attractive if you want to use it as a game console sort of thing, or develop over ssh, or launch it from RetroPie, etc.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Conclusion~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Conclusion~ +- 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: ~Conclusion~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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 ~args.output~ anymore.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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 ~args.output~ anymore.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* Deploying To Itch.io~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~Deploying To Itch.io~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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!~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Creating Your Game Landing Page~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Creating Your Game Landing Page~ +- 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: ~Creating Your Game Landing Page~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Log into Itch.io and go to [[https://itch.io/game/new]].~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Log into Itch.io and go to [[https://itch.io/game/new]].~ +- Line's tilde count is: 0 +- Line contains link marker: true +- LINK detected. +** Processing line: ~~ +** Processing line: ~- Title: Give your game a Title. This value represents your `gametitle`.~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Title: Give your game a Title. This value represents your `gametitle`.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- Project URL: Set your project url. This value represents your `gameid`.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Project URL: Set your project url. This value represents your `gameid`.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- Classification: Keep this as Game.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Classification: Keep this as Game.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- Kind of Project: Select HTML from the drop down list. Don't worry, + the HTML project type _also supports binary downloads_.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Kind of Project: Select HTML from the drop down list. Don't worry, + the HTML project type _also supports binary downloads_.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- Uploads: Skip this section for now.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Uploads: Skip this section for now.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~You can fill out all the other options later.~ +- UL end detected. +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You can fill out all the other options later.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Update Your Game's Metadata~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Update Your Game's Metadata~ +- 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: ~Update Your Game's Metadata~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Point your text editor at mygame/metadata/game_metadata.txt and make it look like this:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Point your text editor at mygame/metadata/game_metadata.txt and make it look like this:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~NOTE: Remove the ~#~ at the beginning of each line.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~NOTE: Remove the ~#~ at the beginning of each line.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ devid=bob~ +** Processing line: ~ devtitle=Bob The Game Developer~ +** Processing line: ~ gameid=mygame~ +** Processing line: ~ gametitle=My Game~ +** Processing line: ~ version=0.1~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~The ~devid~ property is the username you use to log into Itch.io. The ~devtitle~ is your name or company name (it can contain spaces). The ~gameid~ is the Project URL value. The ~gametitle~ is the name of your game (it can contain spaces). The ~version~ can be any ~major.minor~ number format.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The ~devid~ property is the username you use to log into Itch.io. The ~devtitle~ is your name or company name (it can contain spaces). The ~gameid~ is the Project URL value. The ~gametitle~ is the name of your game (it can contain spaces). The ~version~ can be any ~major.minor~ number format.~ +- Line's tilde count is: 12 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~** Building Your Game For Distribution~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Building Your Game For Distribution~ +- 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: ~Building Your Game For Distribution~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Open up the terminal and run this from the command line:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Open up the terminal and run this from the command line:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ ./dragonruby-publish --only-package mygame~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~(if you're on Windows, don't put the "./" on the front. That's a Mac and Linux thing.)~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~(if you're on Windows, don't put the "./" on the front. That's a Mac and Linux thing.)~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~A directory called ~./build~ will be created that contains your binaries. You can upload this to Itch.io manually.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~A directory called ~./build~ will be created that contains your binaries. You can upload this to Itch.io manually.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~For the HTML version of your game after you upload it. Check the checkbox labeled "This file will be played in the browser".~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~For the HTML version of your game after you upload it. Check the checkbox labeled "This file will be played in the browser".~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~For subsequent updates you can use an automated deployment to Itch.io:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~For subsequent updates you can use an automated deployment to Itch.io:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ ./dragonruby-publish mygame~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~DragonRuby will package _and publish_ your game to itch.io! Tell your friends to go to your game's very own webpage and buy it!~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~DragonRuby will package _and publish_ your game to itch.io! Tell your friends to go to your game's very own webpage and buy it!~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~If you make changes to your game, just re-run dragonruby-publish and it'll update the downloads for you.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~If you make changes to your game, just re-run dragonruby-publish and it'll update the downloads for you.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* Deploying To Mobile Devices~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~Deploying To Mobile Devices~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~If you have a Pro subscription, you also have the capability to deploy to mobile devices.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~If you have a Pro subscription, you also have the capability to deploy to mobile devices.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~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.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- 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:~ +- 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:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ > adb logcat -e mygame # you'll want to run this in a separate terminal~ +** Processing line: ~ > keytool -genkey -v -keystore mygame.keystore -alias mygame -keyalg RSA -keysize 2048 -validity 10000~ +** Processing line: ~ > apksigner sign --ks mygame.keystore mygame-android.apk~ +** Processing line: ~ > adb install mygame-android.apk~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DragonRuby's Philosophy~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DragonRuby's Philosophy~ +- 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.~ +- 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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Challenge The Status Quo~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Challenge The Status Quo~ +- 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: ~Challenge The Status Quo~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Game engines of today are in a local maximum and don't take into consideration the challenges of this day and age. Unity and GameMaker specifically rot your brain. It's not sufficient to say:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Game engines of today are in a local maximum and don't take into consideration the challenges of this day and age. Unity and GameMaker specifically rot your brain. It's not sufficient to say:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_quote~ +- BLOCKQUOTE start detected. +** Processing line: ~But that's how we've always done it.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~But that's how we've always done it.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~#+end_quote~ +- BLOCKQUOTE end detected. +** Processing line: ~~ +** Processing line: ~It's a hard pill to swallow, but forget blindly accepted best practices and try to figure out the underlying motivation for a specific approach to game development. Collaborate with us.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~It's a hard pill to swallow, but forget blindly accepted best practices and try to figure out the underlying motivation for a specific approach to game development. Collaborate with us.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Continuity of Design~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Continuity of Design~ +- 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: ~Continuity of Design~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing 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.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- 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).~ +- 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).~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Release Early and Often~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Release Early and Often~ +- 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: ~Release Early and Often~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~The biggest mistake game devs make is spending too much time in isolation building their game. Release something, however small, and release it soon.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The biggest mistake game devs make is spending too much time in isolation building their game. Release something, however small, and release it soon.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Stop worrying about everything being pixel perfect. Don't wait until your game is 100% complete. Build your game publicly and iterate. Post in the #show-and-tell channel in the community Discord. You'll find a lot of support and encouragement there.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Stop worrying about everything being pixel perfect. Don't wait until your game is 100% complete. Build your game publicly and iterate. Post in the #show-and-tell channel in the community Discord. You'll find a lot of support and encouragement there.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Real artists ship. Remember that.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Real artists ship. Remember that.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Sustainable And Ethical Monetization~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Sustainable And Ethical Monetization~ +- 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: ~Sustainable And Ethical Monetization~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~We all aspire to put food on the table doing what we love. Whether it is building games, writing tools to support game development, or anything in between.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~We all aspire to put food on the table doing what we love. Whether it is building games, writing tools to support game development, or anything in between.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Charge a fair amount of money for the things you create. It's expected and encouraged within the community. Give what you create away for free to those that can't afford it.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Charge a fair amount of money for the things you create. It's expected and encouraged within the community. Give what you create away for free to those that can't afford it.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~If you are gainfully employed, pay full price for the things you use. If you do end up getting something at a discount, pay the difference "forward" to someone else.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~If you are gainfully employed, pay full price for the things you use. If you do end up getting something at a discount, pay the difference "forward" to someone else.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Sustainable And Ethical Open Source~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Sustainable And Ethical Open Source~ +- 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: ~Sustainable And Ethical Open Source~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~This goes hand in hand with sustainable and ethical monetization. The current state of open source is not sustainable. There is an immense amount of contributor burnout. Users of open source expect everything to be free, and few give back. This is a problem we want to fix (we're still trying to figure out the best solution).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~This goes hand in hand with sustainable and ethical monetization. The current state of open source is not sustainable. There is an immense amount of contributor burnout. Users of open source expect everything to be free, and few give back. This is a problem we want to fix (we're still trying to figure out the best solution).~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~So, don't be "that guy" in the Discord that says "DragonRuby should be free and open source!" You will be personally flogged by Amir.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~So, don't be "that guy" in the Discord that says "DragonRuby should be free and open source!" You will be personally flogged by Amir.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** People Over Entities~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~People Over Entities~ +- 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: ~People Over Entities~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~We prioritize the endorsement of real people over faceless entities. This game engine, and other products we create, are not insignificant line items of a large company. And you aren't a generic "commodity" or "corporate resource". So be active in the community Discord and you'll reap the benefits as more devs use DragonRuby.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~We prioritize the endorsement of real people over faceless entities. This game engine, and other products we create, are not insignificant line items of a large company. And you aren't a generic "commodity" or "corporate resource". So be active in the community Discord and you'll reap the benefits as more devs use DragonRuby.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Building A Game Should Be Fun And Bring Happiness~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Building A Game Should Be Fun And Bring Happiness~ +- 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: ~Building A Game Should Be Fun And Bring Happiness~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~We will prioritize the removal of pain. The aesthetics of Ruby make it such a joy to work with, and we want to capture that within the engine.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~We will prioritize the removal of pain. The aesthetics of Ruby make it such a joy to work with, and we want to capture that within the engine.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Real World Application Drives Features~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Real World Application Drives Features~ +- 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: ~Real World Application Drives Features~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~We are bombarded by marketing speak day in and day out. We don't do that here. There are things that are really great in the engine, and things that need a lot of work. Collaborate with us so we can help you reach your goals. Ask for features you actually need as opposed to anything speculative.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~We are bombarded by marketing speak day in and day out. We don't do that here. There are things that are really great in the engine, and things that need a lot of work. Collaborate with us so we can help you reach your goals. Ask for features you actually need as opposed to anything speculative.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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).~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~* Frequently Asked Questions, Comments, and Concerns~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~Frequently Asked Questions, Comments, and Concerns~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Here are questions, comments, and concerns that frequently come up.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Here are questions, comments, and concerns that frequently come up.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Frequently Asked Questions~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Frequently Asked Questions~ +- 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: ~Frequently Asked Questions~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** What is DragonRuby LLP?~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~What is DragonRuby LLP?~ +- 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: ~What is DragonRuby LLP?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~DragonRuby LLP is a partnership of four devs who came together with the goal of bringing the aesthetics and joy of Ruby, everywhere possible.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Under DragonRuby LLP, we offer a number of products (with more on the way):~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Under DragonRuby LLP, we offer a number of products (with more on the way):~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~- Game Toolkit (GTK): A 2D game engine that is compatible with modern + gaming platforms.~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Game Toolkit (GTK): A 2D game engine that is compatible with modern + gaming platforms.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- RubyMotion (RM): A compiler toolchain that allows you to build native, cross-platform mobile + apps. [[http://rubymotion.com]]~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~RubyMotion (RM): A compiler toolchain that allows you to build native, cross-platform mobile + apps. [[http://rubymotion.com]]~ +- Line's tilde count is: 0 +- Line contains link marker: true +- LINK detected. +** Processing line: ~All of the products above leverage a shared core called DragonRuby.~ +- UL end detected. +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~All of the products above leverage a shared core called DragonRuby.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~NOTE: From an official branding standpoint each one of the products is suffixed with "A DragonRuby LLP Product" tagline. Also, DragonRuby is _one word, title cased_.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~NOTE: From an official branding standpoint each one of the products is suffixed with "A DragonRuby LLP Product" tagline. Also, DragonRuby is _one word, title cased_.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~NOTE: We leave the "A DragonRuby LLP Product" off of this one because that just sounds really weird.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~NOTE: We leave the "A DragonRuby LLP Product" off of this one because that just sounds really weird.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~NOTE: Devs who use DragonRuby are "Dragon Riders/Riders of Dragons". That's a bad ass identifier huh?~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~NOTE: Devs who use DragonRuby are "Dragon Riders/Riders of Dragons". That's a bad ass identifier huh?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~*** What is DragonRuby?~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~What is DragonRuby?~ +- 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: ~What is DragonRuby?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~The response to this question requires a few subparts. First we need to clarify some terms. Specifically _language specification_ vs _runtime_.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The response to this question requires a few subparts. First we need to clarify some terms. Specifically _language specification_ vs _runtime_.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~**** Okay... so what is the difference between a language specification and a runtime?~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~Okay... so what is the difference between a language specification and a runtime?~ +- 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: ~Okay... so what is the difference between a language specification and a runtime?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~A runtime is an _implementation_ of a language specification. When people say "Ruby," they are usually referring to "the Ruby 3.0+ language specification implemented via the CRuby/MRI Runtime."~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~A runtime is an _implementation_ of a language specification. When people say "Ruby," they are usually referring to "the Ruby 3.0+ language specification implemented via the CRuby/MRI Runtime."~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~But, there are many Ruby Runtimes: CRuby/MRI, JRuby, Truffle, Rubinius, Artichoke, and (last but certainly not least) DragonRuby.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~But, there are many Ruby Runtimes: CRuby/MRI, JRuby, Truffle, Rubinius, Artichoke, and (last but certainly not least) DragonRuby.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~**** Okay... what language specification does DragonRuby use then?~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~Okay... what language specification does DragonRuby use then?~ +- 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: ~Okay... what language specification does DragonRuby use then?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~DragonRuby's goal is to be compliant with the ISO/IEC 30170:2012 standard. It's syntax is Ruby 2.x compatible, but also contains semantic changes that help it natively interface with platform specific libraries.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~DragonRuby's goal is to be compliant with the ISO/IEC 30170:2012 standard. It's syntax is Ruby 2.x compatible, but also contains semantic changes that help it natively interface with platform specific libraries.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~**** So... why another runtime?~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~So... why another runtime?~ +- 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: ~So... why another runtime?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~The elevator pitch is:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- 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.~ +- 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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~**** What does Multilevel Cross-platform mean?~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~What does Multilevel Cross-platform mean?~ +- 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: ~What does Multilevel Cross-platform mean?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~There are complexities associated with targeting all the platforms we support. Because of this, the runtime had to be architected in such a way that new platforms could be easily added (which lead to us partitioning the runtime internally):~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~There are complexities associated with targeting all the platforms we support. Because of this, the runtime had to be architected in such a way that new platforms could be easily added (which lead to us partitioning the runtime internally):~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~- Level 1 we leverage a good portion of mRuby.~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Level 1 we leverage a good portion of mRuby.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- Level 2 consists of optimizations to mRuby we've made given that our + target platforms are well known.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Level 2 consists of optimizations to mRuby we've made given that our + target platforms are well known.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- Level 3 consists of portable C libraries and their Ruby + C-Extensions.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Level 3 consists of portable C libraries and their Ruby + C-Extensions.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Levels 1 through 3 are fairly commonplace in many runtime implementations (with level 1 being the most portable, and level 3 being the fastest). But the DragonRuby Runtime has taken things a bit further:~ +- UL end detected. +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Levels 1 through 3 are fairly commonplace in many runtime implementations (with level 1 being the most portable, and level 3 being the fastest). But the DragonRuby Runtime has taken things a bit further:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~- Level 4 consists of shared abstractions around hardware I/O and operating + system resources. This level leverages open source and proprietary components within Simple DirectMedia Layer (a low level multimedia component library that has been in active development for 22 years and counting).~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Level 4 consists of shared abstractions around hardware I/O and operating + system resources. This level leverages open source and proprietary components within Simple DirectMedia Layer (a low level multimedia component library that has been in active development for 22 years and counting).~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~- Level 5 is a code generation layer which creates metadata that allows + for native interoperability with host runtime libraries. It also includes OS specific message pump orchestrations.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Level 5 is a code generation layer which creates metadata that allows + for native interoperability with host runtime libraries. It also includes OS specific message pump orchestrations.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~- Level 6 is a Ahead of Time/Just in Time Ruby compiler built with LLVM. This + compiler outputs _very_ fast platform specific bitcode, but only supports a subset of the Ruby language specification.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Level 6 is a Ahead of Time/Just in Time Ruby compiler built with LLVM. This + compiler outputs _very_ fast platform specific bitcode, but only supports a subset of the Ruby language specification.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~These levels allow us to stay up to date with open source implementations of Ruby; provide fast, native code execution on proprietary platforms; ensure good separation between these two worlds; and provides a means to add new platforms without going insane.~ +- UL end detected. +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~These levels allow us to stay up to date with open source implementations of Ruby; provide fast, native code execution on proprietary platforms; ensure good separation between these two worlds; and provides a means to add new platforms without going insane.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~**** Cool cool. So given that I understand everything to this point, can we answer the original question? What is DragonRuby?~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~Cool cool. So given that I understand everything to this point, can we answer the original question? What is DragonRuby?~ +- 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: ~Cool cool. So given that I understand everything to this point, can we answer the original question? What is DragonRuby?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~*** How is DragonRuby different than MRI?~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~How is DragonRuby different than MRI?~ +- 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: ~How is DragonRuby different than MRI?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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).~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~**** Does DragonRuby support Gems?~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~Does DragonRuby support Gems?~ +- 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: ~Does DragonRuby support Gems?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~DragonRuby does not support gems because that requires the installation of MRI Ruby on the developer's machine (which is a non-starter given that we want DragonRuby to be a zero dependency runtime). While this seems easy for Mac and Linux, it is much harder on Windows and Raspberry Pi. mRuby has taken the approach of having a git repository for compatible gems and we will most likely follow suite: [[https://github.com/mruby/mgem-list]].~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~DragonRuby does not support gems because that requires the installation of MRI Ruby on the developer's machine (which is a non-starter given that we want DragonRuby to be a zero dependency runtime). While this seems easy for Mac and Linux, it is much harder on Windows and Raspberry Pi. mRuby has taken the approach of having a git repository for compatible gems and we will most likely follow suite: [[https://github.com/mruby/mgem-list]].~ +- Line's tilde count is: 0 +- Line contains link marker: true +- LINK detected. +** Processing line: ~~ +** Processing line: ~**** Does DragonRuby have a REPL/IRB?~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~Does DragonRuby have a REPL/IRB?~ +- 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: ~Does DragonRuby have a REPL/IRB?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~You can use DragonRuby's Console within the game to inspect object and execute small pieces of code. For more complex pieces of code create a file called ~repl.rb~ and put it in ~mygame/app/repl.rb~:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You can use DragonRuby's Console within the game to inspect object and execute small pieces of code. For more complex pieces of code create a file called ~repl.rb~ and put it in ~mygame/app/repl.rb~:~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~- Any code you write in there will be executed when you change the file. You can organize different pieces of code using the ~repl~ method:~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Any code you write in there will be executed when you change the file. You can organize different pieces of code using the ~repl~ method:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ repl do~ +** Processing line: ~ puts "hello world"~ +** Processing line: ~ puts 1 + 1~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~- 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).~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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).~ +- 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.~ +- 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.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** 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.~ +- UL end detected. +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~4. To ignore code in ~repl.rb~, instead of commenting it out, prefix ~repl~ with the letter ~x~ and it'll be ignored.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ xrepl do # <------- line is prefixed with an "x"~ +** Processing line: ~ puts "hello world"~ +** Processing line: ~ puts 1 + 1~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # This code will be executed when you save the file.~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "Hello"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "This code will also be executed."~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # use xrepl to "comment out" code~ +** Processing line: ~ xrepl do~ +** Processing line: ~ puts "This code will not be executed because of the x in front of repl".~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~**** Does DragonRuby support ~pry~ or have any other debugging facilities?~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~Does DragonRuby support ~pry~ or have any other debugging facilities?~ +- 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: ~Does DragonRuby support ~pry~ or have any other debugging facilities?~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~~pry~ is a gem that assumes you are using the MRI Runtime (which is incompatible with DragonRuby). Eventually DragonRuby will have a pry based experience that is compatible with a debugging infrastructure called LLDB. Take the time to read about LLDB as it shows the challenges in creating something that is compatible.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~pry~ is a gem that assumes you are using the MRI Runtime (which is incompatible with DragonRuby). Eventually DragonRuby will have a pry based experience that is compatible with a debugging infrastructure called LLDB. Take the time to read about LLDB as it shows the challenges in creating something that is compatible.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~You can use DragonRuby's replay capabilities to troubleshoot:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You can use DragonRuby's replay capabilities to troubleshoot:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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).~ +- OL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- 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"~.~ +- 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"~.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** 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~.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~ 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's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** 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.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~ 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's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~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.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~ 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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Frequent Comments About Ruby as a Language Choice~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Frequent Comments About Ruby as a Language Choice~ +- 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: ~Frequent Comments About Ruby as a Language Choice~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** But Ruby is dead.~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~But Ruby is dead.~ +- 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: ~But Ruby is dead.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Let's check the official source for the answer to this question: isrubydead.com: [[https://isrubydead.com/]].~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Let's check the official source for the answer to this question: isrubydead.com: [[https://isrubydead.com/]].~ +- 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.~ +- 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.~ +- 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].~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting 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].~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Let's stop making this comment shall we?~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Let's stop making this comment shall we?~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~*** But Ruby is slow.~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~But Ruby is slow.~ +- 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: ~But Ruby is slow.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~*** Dynamic languages are slow.~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Dynamic languages are slow.~ +- 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: ~Dynamic languages are slow.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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_.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Unless you are writing in some form of intermediate representation by hand, your language of choice also suffers this same fallacy of slow. Like, nothing is faster than a low level assembly-like language. So unless you're writing in that, let's stop making this comment.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Unless you are writing in some form of intermediate representation by hand, your language of choice also suffers this same fallacy of slow. Like, nothing is faster than a low level assembly-like language. So unless you're writing in that, let's stop making this comment.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~NOTE: If you _are_ hand writing LLVM IR, we are always open to bringing on new partners with such a skill set. Email us ^_^.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Frequent Concerns~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Frequent Concerns~ +- 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: ~Frequent Concerns~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** DragonRuby is not open source. That's not right.~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~DragonRuby is not open source. That's not right.~ +- 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: ~DragonRuby is not open source. That's not right.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~We believe in open source very strongly. Parts of DragonRuby are in fact, open source. Just not all of it (for legal reasons, and because the IP we've created has value). And we promise that we are looking for (or creating) ways to _sustainably_ open source everything we do.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~We believe in open source very strongly. Parts of DragonRuby are in fact, open source. Just not all of it (for legal reasons, and because the IP we've created has value). And we promise that we are looking for (or creating) ways to _sustainably_ open source everything we do.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~If you have ideas on how we can do this, email us!~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~If you have ideas on how we can do this, email us!~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~If the reason above isn't sufficient, then definitely use something else.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~If the reason above isn't sufficient, then definitely use something else.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~All this being said, we do have parts of the engine open sourced on GitHub: [[https://github.com/dragonruby/dragonruby-game-toolkit-contrib/]]~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~All this being said, we do have parts of the engine open sourced on GitHub: [[https://github.com/dragonruby/dragonruby-game-toolkit-contrib/]]~ +- Line's tilde count is: 0 +- Line contains link marker: true +- LINK detected. +** Processing line: ~~ +** Processing line: ~*** DragonRuby is for pay. You should offer a free version.~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~DragonRuby is for pay. You should offer a free version.~ +- 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: ~DragonRuby is for pay. You should offer a free version.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~That being said, we will _never_ put someone out financially. We have income assistance for anyone that can't afford a license to any one of our products.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~That being said, we will _never_ put someone out financially. We have income assistance for anyone that can't afford a license to any one of our products.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~You qualify for a free, unrestricted license to DragonRuby products if any of the following items pertain to you:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You qualify for a free, unrestricted license to DragonRuby products if any of the following items pertain to you:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~- Your income is below $2,000.00 (USD) per month.~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Your income is below $2,000.00 (USD) per month.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- You are under 18 years of age.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You are under 18 years of age.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- You are a student of any type: traditional public school, home + schooling, college, bootcamp, or online.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You are a student of any type: traditional public school, home + schooling, college, bootcamp, or online.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- You are a teacher, mentor, or parent who wants to teach a kid how to code.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You are a teacher, mentor, or parent who wants to teach a kid how to code.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- You work/worked in public service or at a charitable organization: + for example public office, army, or any 501(c)(3) organization.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You work/worked in public service or at a charitable organization: + for example public office, army, or any 501(c)(3) organization.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Just contact Amir at amir.rajan@dragonruby.org with a short explanation of your current situation and he'll set you up. No questions asked.~ +- UL end detected. +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Just contact Amir at amir.rajan@dragonruby.org with a short explanation of your current situation and he'll set you up. No questions asked.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~*** But still, you should offer a free version. So I can try it out and see if I like it.~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~But still, you should offer a free version. So I can try it out and see if I like it.~ +- 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: ~But still, you should offer a free version. So I can try it out and see if I like it.~ +- 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.~ +- 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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** 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. +- Line does not appear to be a header. +- Formatting line: ~Seriously just buy it. Get a refund if you don't like it. We make it stupid easy to do so.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~*** I still think you should do a free version. Think of all people who would give it a shot.~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~I still think you should do a free version. Think of all people who would give it a shot.~ +- 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: ~I still think you should do a free version. Think of all people who would give it a shot.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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).~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~*** What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.~ +- 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: ~What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~But, in the event that sad day comes, our partnership bylaws state that _all_ DragonRuby IP that can be legally open sourced, will be released under a permissive license.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~But, in the event that sad day comes, our partnership bylaws state that _all_ DragonRuby IP that can be legally open sourced, will be released under a permissive license.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~* RECIPIES:~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~RECIPIES:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** How To Determine What Frame You Are On~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~How To Determine What Frame You Are On~ +- 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: ~How To Determine What Frame You Are On~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~There is a property on ~state~ called ~tick_count~ that is incremented by DragonRuby every time the ~tick~ method is called. The following code renders a label that displays the current ~tick_count~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~There is a property on ~state~ called ~tick_count~ that is incremented by DragonRuby every time the ~tick~ method is called. The following code renders a label that displays the current ~tick_count~.~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.labels << [10, 670, "#{args.state.tick_count}"]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** How To Get Current Framerate~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~How To Get Current Framerate~ +- 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: ~How To Get Current Framerate~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Current framerate is a top level property on the Game Toolkit Runtime and is accessible via ~args.gtk.current_framerate~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Current framerate is a top level property on the Game Toolkit Runtime and is accessible via ~args.gtk.current_framerate~.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.labels << [10, 710, "framerate: #{args.gtk.current_framerate.round}"]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** How To Render A Sprite Using An Array~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~How To Render 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: ~How To Render A Sprite Using An Array~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~All file paths should use the forward slash ~/~ *not* backslash ~~. Game Toolkit includes a number of sprites in the ~sprites~ folder (everything about your game is located in the ~mygame~ directory).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~All file paths should use the forward slash ~/~ *not* backslash ~~. Game Toolkit includes a number of sprites in the ~sprites~ folder (everything about your game is located in the ~mygame~ directory).~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** Processing line: ~The following code renders a sprite with a ~width~ and ~height~ of ~100~ in the center of the screen.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The following code renders a sprite with a ~width~ and ~height~ of ~100~ in the center of the screen.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~args.outputs.sprites~ is used to render a sprite.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.outputs.sprites~ is used to render a sprite.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.sprites << [~ +** Processing line: ~ 640 - 50, # X~ +** Processing line: ~ 360 - 50, # Y~ +** Processing line: ~ 100, # W~ +** Processing line: ~ 100, # H~ +** Processing line: ~ 'sprites/square-blue.png' # PATH~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** More Sprite Properties As An Array~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~More Sprite Properties As 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: ~More Sprite Properties As An Array~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Here are all the properties you can set on a sprite.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Here are all the properties you can set on a sprite.~ +- 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: ~ args.outputs.sprites << [~ +** Processing line: ~ 100, # X~ +** Processing line: ~ 100, # Y~ +** Processing line: ~ 32, # W~ +** Processing line: ~ 64, # H~ +** Processing line: ~ 'sprites/square-blue.png', # PATH~ +** Processing line: ~ 0, # ANGLE~ +** Processing line: ~ 255, # ALPHA~ +** Processing line: ~ 0, # RED_SATURATION~ +** Processing line: ~ 255, # GREEN_SATURATION~ +** Processing line: ~ 0 # BLUE_SATURATION~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** Different Sprite Representations~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Different Sprite Representations~ +- 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: ~Different Sprite Representations~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Using ordinal positioning can get a little unruly given so many properties you have control over.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Using ordinal positioning can get a little unruly given so many properties you have control over.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~You can represent a sprite as a ~Hash~:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You can represent a sprite as a ~Hash~:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.sprites << {~ +** Processing line: ~ x: 640 - 50,~ +** Processing line: ~ y: 360 - 50,~ +** Processing line: ~ w: 100,~ +** Processing line: ~ h: 100,~ +** Processing line: ~ path: 'sprites/square-blue.png',~ +** Processing line: ~ angle: 0,~ +** Processing line: ~ a: 255,~ +** Processing line: ~ r: 255,~ +** Processing line: ~ g: 255,~ +** Processing line: ~ b: 255,~ +** Processing line: ~ source_x: 0,~ +** Processing line: ~ source_y: 0,~ +** Processing line: ~ source_w: -1,~ +** Processing line: ~ source_h: -1,~ +** 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: ~ }~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~You can represent a sprite as an ~object~:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You can represent a sprite as an ~object~:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- 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, :a, :r, :g, :b,~ +** 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: ~~ +** Processing line: ~ def primitive_marker~ +** Processing line: ~ :sprite~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ class BlueSquare < Sprite~ +** Processing line: ~ def initialize opts~ +** Processing line: ~ @x = opts[:x]~ +** Processing line: ~ @y = opts[:y]~ +** Processing line: ~ @w = opts[:w]~ +** Processing line: ~ @h = opts[:h]~ +** Processing line: ~ @path = 'sprites/square-blue.png'~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.sprites << (BlueSquare.new x: 640 - 50,~ +** Processing line: ~ y: 360 - 50,~ +** Processing line: ~ w: 50,~ +** Processing line: ~ h: 50)~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** How To Render A Label~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~How To Render A Label~ +- 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: ~How To Render A Label~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~args.outputs.labels~ is used to render labels.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.outputs.labels~ is used to render labels.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Labels are how you display text. This code will go directly inside of the ~def tick args~ method.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Labels are how you display text. This code will go directly inside of the ~def tick args~ method.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Here is the minimum code:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Here is the minimum code:~ +- 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 TEXT~ +** Processing line: ~ args.outputs.labels << [640, 360, "I am a black label."]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** A Colored Label~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~A Colored Label~ +- 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: ~A Colored Label~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # A colored label~ +** Processing line: ~ # X Y TEXT, RED GREEN BLUE ALPHA~ +** Processing line: ~ args.outputs.labels << [640, 360, "I am a redish label.", 255, 128, 128, 255]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** Extended Label Properties~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Extended Label Properties~ +- 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: ~Extended Label Properties~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # A colored label~ +** Processing line: ~ # X Y TEXT SIZE ALIGNMENT RED GREEN BLUE ALPHA FONT FILE~ +** Processing line: ~ args.outputs.labels << [~ +** Processing line: ~ 640, # X~ +** Processing line: ~ 360, # Y~ +** Processing line: ~ "Hello world", # TEXT~ +** Processing line: ~ 0, # SIZE_ENUM~ +** Processing line: ~ 1, # ALIGNMENT_ENUM~ +** Processing line: ~ 0, # RED~ +** Processing line: ~ 0, # GREEN~ +** Processing line: ~ 0, # BLUE~ +** Processing line: ~ 255, # ALPHA~ +** Processing line: ~ "fonts/coolfont.ttf" # FONT~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~A ~SIZE_ENUM~ of ~0~ represents "default size". A ~negative~ value will decrease the label size. A ~positive~ value will increase the label's size.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~A ~SIZE_ENUM~ of ~0~ represents "default size". A ~negative~ value will decrease the label size. A ~positive~ value will increase the label's size.~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** Processing line: ~An ~ALIGNMENT_ENUM~ of ~0~ represents "left aligned". ~1~ represents "center aligned". ~2~ represents "right aligned".~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~An ~ALIGNMENT_ENUM~ of ~0~ represents "left aligned". ~1~ represents "center aligned". ~2~ represents "right aligned".~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~** Rendering A Label As A ~Hash~~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Rendering A Label As A ~Hash~~ +- 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: ~Rendering A Label As A ~Hash~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~You can add additional metadata about your game within a label, which requires you to use a `Hash` instead.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You can add additional metadata about your game within a label, which requires you to use a `Hash` instead.~ +- 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.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: ~ # 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: {~ +** Processing line: ~ value_1: "value",~ +** Processing line: ~ value_2: "value two",~ +** Processing line: ~ a_number: 15~ +** Processing line: ~ }~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** Getting The Size Of A Piece Of Text~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Getting The Size Of A Piece Of Text~ +- 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: ~Getting The Size Of A Piece Of Text~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~You can get the render size of any string using ~args.gtk.calcstringbox~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You can get the render size of any string using ~args.gtk.calcstringbox~.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # TEXT SIZE_ENUM FONT~ +** Processing line: ~ w, h = args.gtk.calcstringbox("some string", 0, "font.ttf")~ +** Processing line: ~~ +** Processing line: ~ # NOTE: The SIZE_ENUM and FONT are optional arguments.~ +** Processing line: ~~ +** Processing line: ~ # Render a label showing the w and h of the text:~ +** Processing line: ~ args.outputs.labels << [~ +** Processing line: ~ 10,~ +** Processing line: ~ 710,~ +** Processing line: ~ # This string uses Ruby's string interpolation literal: #{}~ +** Processing line: ~ "'some string' has width: #{w}, and height: #{h}."~ +** Processing line: ~ ]~ +** 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. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~How To Play A Sound~ +- 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: ~How To Play A Sound~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Sounds that end ~.wav~ will play once:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Sounds that end ~.wav~ will play once:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # Play a sound every second~ +** Processing line: ~ if (args.state.tick_count % 60) == 0~ +** Processing line: ~ args.outputs.sounds << 'something.wav'~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~Sounds that end ~.ogg~ is considered background music and will loop:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Sounds that end ~.ogg~ is considered background music and will loop:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # Start a sound loop at the beginning of the game~ +** Processing line: ~ if args.state.tick_count == 0~ +** Processing line: ~ args.outputs.sounds << 'background_music.ogg'~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~If you want to play a ~.ogg~ once as if it were a sound effect, you can do:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~If you want to play a ~.ogg~ once as if it were a sound effect, you can do:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # Play a sound every second~ +** Processing line: ~ if (args.state.tick_count % 60) == 0~ +** Processing line: ~ args.gtk.queue_sound 'some-ogg.ogg'~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** Using ~args.state~ To Store Your Game State~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Using ~args.state~ To Store Your Game State~ +- 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: ~Using ~args.state~ To Store Your Game State~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~~args.state~ is a open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of ~class~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.state~ is a open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of ~class~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~To initialize your game state, use the ~||=~ operator. Any value on the right side of ~||=~ will only be assigned _once_.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~To initialize your game state, use the ~||=~ operator. Any value on the right side of ~||=~ will only be assigned _once_.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~To assign a value every frame, just use the ~=~ operator, but _make sure_ you've initialized a default value.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~To assign a value every frame, just use the ~=~ operator, but _make sure_ you've initialized a default value.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # initialize your game state ONCE~ +** Processing line: ~ args.state.player.x ||= 0~ +** Processing line: ~ args.state.player.y ||= 0~ +** Processing line: ~ args.state.player.hp ||= 100~ +** Processing line: ~~ +** Processing line: ~ # increment the x position of the character by one every frame~ +** Processing line: ~ args.state.player.x += 1~ +** Processing line: ~~ +** Processing line: ~ # Render a sprite with a label above the sprite~ +** Processing line: ~ args.outputs.sprites << [~ +** Processing line: ~ args.state.player.x,~ +** Processing line: ~ args.state.player.y,~ +** Processing line: ~ 32, 32,~ +** Processing line: ~ "player.png"~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << [~ +** Processing line: ~ args.state.player.x,~ +** Processing line: ~ args.state.player.y - 50,~ +** Processing line: ~ args.state.player.hp~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** Troubleshoot Performance~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Troubleshoot Performance~ +- 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: ~Troubleshoot Performance~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~1. If you're using ~Array~s for your primitives (~args.outputs.sprites << []~), use ~Hash~ instead (~args.outputs.sprites << { x: ... }~).~ +- OL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~ If you're using ~Array~s for your primitives (~args.outputs.sprites << []~), use ~Hash~ instead (~args.outputs.sprites << { x: ... }~).~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** Processing line: ~2. If you're using ~Entity~ for your primitives (~args.outputs.sprites << args.state.new_entity~), use ~StrictEntity~ instead (~args.outputs.sprites << args.state.new_entity_strict~).~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~ If you're using ~Entity~ for your primitives (~args.outputs.sprites << args.state.new_entity~), use ~StrictEntity~ instead (~args.outputs.sprites << args.state.new_entity_strict~).~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** Processing line: ~3. Use ~.each~ instead of ~.map~ if you don't care about the return value.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~ Use ~.each~ instead of ~.map~ if you don't care about the return value.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~4. When concatenating primitives to outputs, do them in bulk. Instead of:~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~ When concatenating primitives to outputs, do them in bulk. Instead of:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ args.state.bullets.each do |bullet|~ +** Processing line: ~ args.outputs.sprites << bullet.sprite~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~do~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~do~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ args.outputs.sprites << args.state.bullets.map do |b|~ +** Processing line: ~ b.sprite~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~5. Use ~args.outputs.static_~ variant for things that don't change often (take a look at the Basic Gorillas sample app and Dueling Starships sample app to see how ~static_~ is leveraged.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~5. Use ~args.outputs.static_~ variant for things that don't change often (take a look at the Basic Gorillas sample app and Dueling Starships sample app to see how ~static_~ is leveraged.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~6. Consider using a ~render_target~ if you're doing some form of a camera that moves a lot of primitives (take a look at the Render Target sample apps for more info).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~6. Consider using a ~render_target~ if you're doing some form of a camera that moves a lot of primitives (take a look at the Render Target sample apps for more info).~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::Runtime~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::Runtime~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~The GTK::Runtime class is the core of DragonRuby. It is globally accessible via ~$gtk~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The GTK::Runtime class is the core of DragonRuby. It is globally accessible via ~$gtk~.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~* SUMMARY: ~def tick args; end;~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~SUMMARY: ~def tick args; end;~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Most everything you will need to build your game is in the ~args~ parameter that is provided to your ~tick~ method. Follows is a high level summary of each function that is available from ~args~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Most everything you will need to build your game is in the ~args~ parameter that is provided to your ~tick~ method. Follows is a high level summary of each function that is available from ~args~.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~All the properties below hang off of ~args~ and can be accessed in the ~tick~ method:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~All the properties below hang off of ~args~ and can be accessed in the ~tick~ method:~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ args.PROPERTY~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~** ~args.state~~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~~args.state~~ +- 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: ~~args.state~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Store your game state inside of this ~state~. Properties with arbitrary nesting is allowed and a backing Entity will be created on your behalf.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Store your game state inside of this ~state~. Properties with arbitrary nesting is allowed and a backing Entity will be created on your behalf.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.player.x ||= 0~ +** Processing line: ~ args.state.player.y ||= 0~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~*** ~.*.entity_id~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.*.entity_id~~ +- 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: ~~.*.entity_id~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Entities automatically receive an ~entity_id~ of type ~Fixnum~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Entities automatically receive an ~entity_id~ of type ~Fixnum~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.*.entity_type~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.*.entity_type~~ +- 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: ~~.*.entity_type~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Entities can have an ~entity_type~ which is represented as a ~Symbol~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Entities can have an ~entity_type~ which is represented as a ~Symbol~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.*.created_at~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.*.created_at~~ +- 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: ~~.*.created_at~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Entities have ~created_at~ set to ~args.state.tick_count~ when they are created.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Entities have ~created_at~ set to ~args.state.tick_count~ when they are created.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.*.created_at_elapsed~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.*.created_at_elapsed~~ +- 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: ~~.*.created_at_elapsed~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the elapsed number of ticks since creation.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the elapsed number of ticks since creation.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.*.global_created_at~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.*.global_created_at~~ +- 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: ~~.*.global_created_at~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Entities have ~global_created_at~ set to ~Kernel.global_tick_count~ when they are created.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Entities have ~global_created_at~ set to ~Kernel.global_tick_count~ when they are created.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.*.global_created_at_elapsed~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.*.global_created_at_elapsed~~ +- 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: ~~.*.global_created_at_elapsed~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the elapsed number of global ticks since creation.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the elapsed number of global ticks since creation.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.*.as_hash~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.*.as_hash~~ +- 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: ~~.*.as_hash~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Entity cast to a ~Hash~ so you can update values as if you were updating a ~Hash~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Entity cast to a ~Hash~ so you can update values as if you were updating a ~Hash~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.new_entity~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.new_entity~~ +- 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: ~~.new_entity~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Creates a new Entity with a ~type~, and initial properties. An option block can be passed to change the newly created entity:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Creates a new Entity with a ~type~, and initial properties. An option block can be passed to change the newly created entity:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.player ||= args.state.new_entity :player, x: 0, y: 0 do |e|~ +** Processing line: ~ e.max_hp = 100~ +** Processing line: ~ e.hp = e.max_hp * rand~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~*** ~.new_entity_strict~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.new_entity_strict~~ +- 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: ~~.new_entity_strict~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Creates a new Strict Entity. While Entities created via ~args.state.new_entity~ can have new properties added later on, Entities created using ~args.state.new_entity~ must define all properties that are allowed during its initialization. Attempting to add new properties after initialization will result in an exception.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Creates a new Strict Entity. While Entities created via ~args.state.new_entity~ can have new properties added later on, Entities created using ~args.state.new_entity~ must define all properties that are allowed during its initialization. Attempting to add new properties after initialization will result in an exception.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.tick_count~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.tick_count~~ +- 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: ~~.tick_count~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the current tick of the game. ~args.state.tick_count~ is ~0~ when the game is first started or if the game is reset via ~$gtk.reset~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the current tick of the game. ~args.state.tick_count~ is ~0~ when the game is first started or if the game is reset via ~$gtk.reset~.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~** ~args.inputs~~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~~args.inputs~~ +- 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: ~~args.inputs~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Access using input using ~args.inputs~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Access using input using ~args.inputs~.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.up~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if: the ~up~ arrow or ~w~ key is pressed or held on the ~keyboard~; or if ~up~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted upwards.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if: the ~up~ arrow or ~w~ key is pressed or held on the ~keyboard~; or if ~up~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted upwards.~ +- Line's tilde count is: 16 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.down~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if: the ~down~ arrow or ~s~ key is pressed or held on the ~keyboard~; or if ~down~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted downwards.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if: the ~down~ arrow or ~s~ key is pressed or held on the ~keyboard~; or if ~down~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted downwards.~ +- Line's tilde count is: 16 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.left~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if: the ~left~ arrow or ~a~ key is pressed or held on the ~keyboard~; or if ~left~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the left.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if: the ~left~ arrow or ~a~ key is pressed or held on the ~keyboard~; or if ~left~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the left.~ +- Line's tilde count is: 16 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.right~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if: the ~right~ arrow or ~d~ key is pressed or held on the ~keyboard~; or if ~right~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the right.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if: the ~right~ arrow or ~d~ key is pressed or held on the ~keyboard~; or if ~right~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the right.~ +- Line's tilde count is: 16 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.left_right~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.left~ and ~args.inputs.right~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.left~ and ~args.inputs.right~.~ +- Line's tilde count is: 10 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.up_down~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- 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: 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~.~ +- 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~.~ +- Line's tilde count is: 10 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.text~ OR ~.history~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.text~ OR ~.history~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.text~ OR ~.history~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a string that represents the last key that was pressed on the keyboard.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a string that represents the last key that was pressed on the keyboard.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.mouse~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.mouse~~ +- 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: ~~.mouse~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Represents the user's~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Represents the user's~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~**** ~.x~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.x~~ +- 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: ~~.x~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the current ~x~ location of the mouse.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the current ~x~ location of the mouse.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~mouse.y~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~mouse.y~~ +- 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: ~~mouse.y~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Return.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Return.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~**** ~.inside_rect? rect~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.inside_rect? rect~~ +- 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: ~~.inside_rect? rect~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Return. ~args.inputs.mouse.inside_rect?~ takes in any primitive that responds to ~x, y, w, h~:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Return. ~args.inputs.mouse.inside_rect?~ takes in any primitive that responds to ~x, y, w, h~:~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.inside_circle? center_point, radius~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.inside_circle? center_point, radius~~ +- 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: ~~.inside_circle? center_point, radius~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if the mouse is inside of a specified circle. ~args.inputs.mouse.inside_circle?~ takes in any primitive that responds to ~x, y~ (which represents the circle's center), and takes in a ~radius~:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if the mouse is inside of a specified circle. ~args.inputs.mouse.inside_circle?~ takes in any primitive that responds to ~x, y~ (which represents the circle's center), and takes in a ~radius~:~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.moved~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.moved~~ +- 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: ~~.moved~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if the mouse has moved on the current frame.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if the mouse has moved on the current frame.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.button_left~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.button_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: ~~.button_left~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if the left mouse button is down.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if the left mouse button is down.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.button_middle~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.button_middle~~ +- 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: ~~.button_middle~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if the middle mouse button is down.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if the middle mouse button is down.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.button_right~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.button_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: ~~.button_right~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if the right mouse button is down.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if the right mouse button is down.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.button_bits~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.button_bits~~ +- 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: ~~.button_bits~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a bitmask for all buttons on the mouse: ~1~ for a button in the ~down~ state, ~0~ for a button in the ~up~ state.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a bitmask for all buttons on the mouse: ~1~ for a button in the ~down~ state, ~0~ for a button in the ~up~ state.~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~mouse.wheel~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~mouse.wheel~~ +- 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: ~~mouse.wheel~~ +- 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.~ +- 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 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.click~ OR ~.down~, ~.previous_click~, ~.up~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.click~ OR ~.down~, ~.previous_click~, ~.up~~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.click~ OR ~.down~, ~.previous_click~, ~.up~~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** 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 that has an ~x~, ~y~ properties along with helper functions to determine collision: ~inside_rect?~, ~inside_circle~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting 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 that has an ~x~, ~y~ properties along with helper functions to determine collision: ~inside_rect?~, ~inside_circle~.~ +- Line's tilde count is: 12 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.controller_one~, ~.controller_two~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.controller_one~, ~.controller_two~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.controller_one~, ~.controller_two~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Represents controllers connected to the usb ports.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Represents controllers connected to the usb ports.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** 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 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.up~ +- Line's tilde count is: 1 +- Line contains link marker: false +** Processing line: ~Returns ~true~ if ~up~ is pressed or held on the directional or left analog.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~up~ is pressed or held on the directional or left analog.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** 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 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.down~ +- Line's tilde count is: 1 +- Line contains link marker: false +** Processing line: ~Returns ~true~ if ~down~ is pressed or held on the directional or left analog.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~down~ is pressed or held on the directional or left analog.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** 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 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.left~ +- Line's tilde count is: 1 +- Line contains link marker: false +** Processing line: ~Returns ~true~ if ~left~ is pressed or held on the directional or left analog.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~left~ is pressed or held on the directional or left analog.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** 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 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.right~ +- Line's tilde count is: 1 +- Line contains link marker: false +** Processing line: ~Returns ~true~ if ~right~ is pressed or held on the directional or left analog.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~right~ is pressed or held on the directional or left analog.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** 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 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.left_right~ +- Line's tilde count is: 1 +- Line contains link marker: false +** 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. +- Line does not appear to be a header. +- Formatting 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~.~ +- Line's tilde count is: 10 +- Line contains link marker: false +- CODE detected. +** 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 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.up_down~ +- Line's tilde count is: 1 +- Line contains link marker: false +** 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. +- Line does not appear to be a header. +- Formatting 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~.~ +- Line's tilde count is: 10 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.(left_analog_x_raw|right_analog_x_raw)~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.(left_analog_x_raw|right_analog_x_raw)~~ +- 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_analog_x_raw|right_analog_x_raw)~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the raw integer value for the analog's horizontal movement (~-32,000 to +32,000~).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the raw integer value for the analog's horizontal movement (~-32,000 to +32,000~).~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.left_analog_y_raw|right_analog_y_raw)~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.left_analog_y_raw|right_analog_y_raw)~~ +- 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_analog_y_raw|right_analog_y_raw)~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the raw integer value for the analog's vertical movement (~-32,000 to +32,000~).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the raw integer value for the analog's vertical movement (~-32,000 to +32,000~).~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.left_analog_x_perc|right_analog_x_perc)~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.left_analog_x_perc|right_analog_x_perc)~~ +- 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_analog_x_perc|right_analog_x_perc)~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a number between ~-1~ and ~1~ which represents the percentage the analog is moved horizontally as a ratio of the maximum horizontal movement.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a number between ~-1~ and ~1~ which represents the percentage the analog is moved horizontally as a ratio of the maximum horizontal movement.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.left_analog_y_perc|right_analog_y_perc)~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.left_analog_y_perc|right_analog_y_perc)~~ +- 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_analog_y_perc|right_analog_y_perc)~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** 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.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting 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.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.directional_up)~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- 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)~~ +- 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.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~up~ is pressed or held on the directional.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.directional_down)~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- 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)~~ +- 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.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~down~ is pressed or held on the directional.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.directional_left)~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- 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)~~ +- 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.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~left~ is pressed or held on the directional.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.directional_right)~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- 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)~~ +- 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.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~right~ is pressed or held on the directional.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.(a|b|x|y|l1|r1|l2|r2|l3|r3|start|select)~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.(a|b|x|y|l1|r1|l2|r2|l3|r3|start|select)~~ +- 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: ~~.(a|b|x|y|l1|r1|l2|r2|l3|r3|start|select)~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if the specific button is pressed or held.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if the specific button is pressed or held.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.truthy_keys~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.truthy_keys~~ +- 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: ~~.truthy_keys~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a collection of ~Symbol~s that represent all keys that are in the pressed or held state.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a collection of ~Symbol~s that represent all keys that are in the pressed or held state.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.key_down~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.key_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: ~~.key_down~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if the specific button was pressed on this frame. ~args.inputs.controller_(one|two).key_down.BUTTON~ will only be true on the frame it was pressed.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if the specific button was pressed on this frame. ~args.inputs.controller_(one|two).key_down.BUTTON~ will only be true on the frame it was pressed.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.key_held~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.key_held~~ +- 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: ~~.key_held~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if the specific button is being held. ~args.inputs.controller_(one|two).key_held.BUTTON~ will be true for all frames after ~key_down~ (until released).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if the specific button is being held. ~args.inputs.controller_(one|two).key_held.BUTTON~ will be true for all frames after ~key_down~ (until released).~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~.key_up~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~.key_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: ~~.key_up~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if the specific button was released. ~args.inputs.controller_(one|two).key_up.BUTTON~ will be true only on the frame the button was released.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if the specific button was released. ~args.inputs.controller_(one|two).key_up.BUTTON~ will be true only on the frame the button was released.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.keyboard~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.keyboard~~ +- 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: ~~.keyboard~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Represents the user's keyboard~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Represents the user's keyboard~ +- Line's tilde count is: 0 +- Line contains link marker: false +** 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: 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if ~up~ or ~w~ is pressed or held on the keyboard.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~up~ or ~w~ is pressed or held on the keyboard.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** 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: 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if ~down~ or ~s~ is pressed or held on the keyboard.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~down~ or ~s~ is pressed or held on the keyboard.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** 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: 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if ~left~ or ~a~ is pressed or held on the keyboard.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~left~ or ~a~ is pressed or held on the keyboard.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** 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: 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if ~right~ or ~d~ is pressed or held on the keyboard.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~right~ or ~d~ is pressed or held on the keyboard.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** 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: 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.left~ and ~args.inputs.keyboard.right~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.left~ and ~args.inputs.keyboard.right~.~ +- Line's tilde count is: 10 +- Line contains link marker: false +- CODE detected. +** 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: 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.up~ and ~args.inputs.keyboard.up~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.up~ and ~args.inputs.keyboard.up~.~ +- Line's tilde count is: 10 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** keyboard properties~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~keyboard properties~ +- 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: ~keyboard properties~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~The following properties represent keys on the keyboard and are available on ~args.inputs.keyboard.KEY~, ~args.inputs.keyboard.key_down.KEY~, ~args.inputs.keyboard.key_held.KEY~, and ~args.inputs.keyboard.key_up.KEY~:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The following properties represent keys on the keyboard and are available on ~args.inputs.keyboard.KEY~, ~args.inputs.keyboard.key_down.KEY~, ~args.inputs.keyboard.key_held.KEY~, and ~args.inputs.keyboard.key_up.KEY~:~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~alt~~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~alt~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~meta~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~meta~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~control~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~control~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~shift~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~shift~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~ctrl_KEY~ (dynamic method, eg ~args.inputs.keyboard.ctrl_a~)~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~ctrl_KEY~ (dynamic method, eg ~args.inputs.keyboard.ctrl_a~)~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~exclamation_point~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~exclamation_point~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~zero~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~zero~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~one~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~one~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~two~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~two~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~three~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~three~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~four~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~four~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~five~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~five~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~six~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~six~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~seven~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~seven~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~eight~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~eight~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~nine~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~nine~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~backspace~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~backspace~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~delete~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~delete~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~escape~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~escape~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~enter~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~enter~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~tab~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~tab~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~open_round_brace~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~open_round_brace~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~close_round_brace~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~close_round_brace~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~open_curly_brace~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~open_curly_brace~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~close_curly_brace~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~close_curly_brace~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~open_square_brace~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~open_square_brace~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~close_square_brace~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~close_square_brace~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~colon~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~colon~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~semicolon~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~semicolon~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~equal_sign~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~equal_sign~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~hyphen~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~hyphen~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~space~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~space~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~dollar_sign~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~dollar_sign~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~double_quotation_mark~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~double_quotation_mark~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~single_quotation_mark~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~single_quotation_mark~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~backtick~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~backtick~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~tilde~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~tilde~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~period~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~period~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~comma~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~comma~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~pipe~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~pipe~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~underscore~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~underscore~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~a~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~a~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~b~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~b~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~c~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~c~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~d~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~d~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~e~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~e~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~f~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~f~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~g~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~g~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~h~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~h~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~i~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~i~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~j~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~j~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~k~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~k~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~l~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~l~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~m~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~m~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~n~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~n~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~o~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~o~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~p~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~p~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~q~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~q~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~r~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~r~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~s~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~s~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~t~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~t~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~u~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~u~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~v~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~v~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~w~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~w~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~x~~ +- LI 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: ~- ~y~~ +- LI 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: ~- ~z~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~z~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~shift~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~shift~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~control~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~control~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~alt~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~alt~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~meta~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~meta~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~left~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~left~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~right~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~right~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~up~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~up~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~down~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~down~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~pageup~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~pageup~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~pagedown~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~pagedown~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~char~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~char~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~plus~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~plus~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~at~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~at~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~forward_slash~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~forward_slash~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~back_slash~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~back_slash~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~asterisk~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~asterisk~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~less_than~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~less_than~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~greater_than~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~greater_than~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~carat~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~carat~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~ampersand~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~ampersand~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~superscript_two~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~superscript_two~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~circumflex~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~circumflex~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~question_mark~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~question_mark~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~section_sign~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~section_sign~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~ordinal_indicator~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~ordinal_indicator~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~raw_key~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~raw_key~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~raw_key~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~raw_key~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~left_right~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~left_right~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~up_down~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~up_down~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~directional_vector~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~directional_vector~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~truthy_keys~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~truthy_keys~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~**** ~inputs.keyboard.keys~~ +- H4 detected. +- Determining if line is a header. +- Line contains ~**** ~... gsub-ing empty string +- Formatting line: ~~inputs.keyboard.keys~~ +- 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: ~~inputs.keyboard.keys~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a ~Hash~ with all keys on the keyboard in their respective state. The ~Hash~ contains the following ~keys~~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a ~Hash~ with all keys on the keyboard in their respective state. The ~Hash~ contains the following ~keys~~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~:down~~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~:down~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~:held~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~:held~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~:down_or_held~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~:down_or_held~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~:up~~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~:up~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~** ~args.outputs~~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~~args.outputs~~ +- 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: ~~args.outputs~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~args.outputs.PROPERTY~ is how you render to the screen.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.outputs.PROPERTY~ is how you render to the screen.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.background_color~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.background_color~~ +- 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: ~~.background_color~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Set ~args.outputs.background_color~ to an ~Array~ with ~RGB~ values (eg. ~[255, 255, 255]~ for the color white).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Set ~args.outputs.background_color~ to an ~Array~ with ~RGB~ values (eg. ~[255, 255, 255]~ for the color white).~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.sounds~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.sounds~~ +- 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: ~~.sounds~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Send a file path to this collection to play a sound. The sound file must be under the ~mygame~ directory. Example: ~args.outputs.sounds << "sounds/jump.wav"~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Send a file path to this collection to play a sound. The sound file must be under the ~mygame~ directory. Example: ~args.outputs.sounds << "sounds/jump.wav"~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.solids~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.solids~~ +- 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: ~~.solids~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.static_solids~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.static_solids~~ +- 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: ~~.static_solids~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.sprites~, ~.static_sprites~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.sprites~, ~.static_sprites~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.sprites~, ~.static_sprites~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Send a Primitive 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: ~Send a Primitive to this collection to render a sprite to the screen.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.primitives~, ~.static_primitives~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.primitives~, ~.static_primitives~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.primitives~, ~.static_primitives~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Send a Primitive of any type and it'll be rendered. The Primitive must have a ~primitive_marker~ that returns ~:solid~, ~:sprite~, ~:label~, ~:line~, ~:border~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Send a Primitive of any type and it'll be rendered. The Primitive must have a ~primitive_marker~ that returns ~:solid~, ~:sprite~, ~:label~, ~:line~, ~:border~.~ +- Line's tilde count is: 12 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.labels~, ~.static_labels~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.labels~, ~.static_labels~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.labels~, ~.static_labels~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Send a Primitive to this collection to render text to the screen.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Send a Primitive to this collection to render text to the screen.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.lines~, ~.static_lines~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.lines~, ~.static_lines~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.lines~, ~.static_lines~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Send a Primitive to this collection to render a line to the screen.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Send a Primitive to this collection to render a line to the screen.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.borders~, ~.static_borders~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.borders~, ~.static_borders~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.borders~, ~.static_borders~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Send a Primitive to this collection to render an unfilled rectangle to the screen.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Send a Primitive to this collection to render an unfilled rectangle to the screen.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.debug~, ~.static_debug~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.debug~, ~.static_debug~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.debug~, ~.static_debug~~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~** ~args.geometry~~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~~args.geometry~~ +- 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: ~~args.geometry~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~This property contains geometric functions. Functions can be invoked via ~args.geometry.FUNCTION~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~This property contains geometric functions. Functions can be invoked via ~args.geometry.FUNCTION~.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.inside_rect? rect_1, rect_2~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.inside_rect? rect_1, rect_2~~ +- 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: ~~.inside_rect? rect_1, rect_2~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if ~rect_1~ is inside ~rect_2~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~rect_1~ is inside ~rect_2~.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.intersect_rect? rect_2, rect_2~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.intersect_rect? rect_2, rect_2~~ +- 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: ~~.intersect_rect? rect_2, rect_2~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if ~rect_1~ intersects ~rect_2~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if ~rect_1~ intersects ~rect_2~.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.scale_rect rect, x_percentage, y_percentage~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.scale_rect rect, x_percentage, y_percentage~~ +- 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: ~~.scale_rect rect, x_percentage, y_percentage~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a new rectangle that is scaled by the percentages provided.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a new rectangle that is scaled by the percentages provided.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.angle_to start_point, end_point~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.angle_to start_point, end_point~~ +- 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: ~~.angle_to start_point, end_point~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the angle in degrees between two points ~start_point~ to ~end_point~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the angle in degrees between two points ~start_point~ to ~end_point~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.angle_from start_point, end_point~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.angle_from start_point, end_point~~ +- 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: ~~.angle_from start_point, end_point~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the angle in degrees between two points ~start_point~ from ~end_point~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the angle in degrees between two points ~start_point~ from ~end_point~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.point_inside_circle? point, circle_center_point, radius~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.point_inside_circle? point, circle_center_point, radius~~ +- 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: ~~.point_inside_circle? point, circle_center_point, radius~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if a point is inside a circle defined by its center and radius.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if a point is inside a circle defined by its center and radius.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.center_inside_rect rect, other_rect~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.center_inside_rect rect, other_rect~~ +- 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: ~~.center_inside_rect rect, other_rect~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a new rectangle based of off ~rect~ that is centered inside of ~other_rect~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a new rectangle based of off ~rect~ that is centered inside of ~other_rect~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.center_inside_rect_x rect, other_rect~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.center_inside_rect_x rect, other_rect~~ +- 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: ~~.center_inside_rect_x rect, other_rect~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a new rectangle based of off ~rect~ that is centered horizontally inside of ~other_rect~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a new rectangle based of off ~rect~ that is centered horizontally inside of ~other_rect~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.center_inside_rect_y rect, other_rect~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.center_inside_rect_y rect, other_rect~~ +- 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: ~~.center_inside_rect_y rect, other_rect~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a new rectangle based of off ~rect~ that is centered vertically inside of ~other_rect~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a new rectangle based of off ~rect~ that is centered vertically inside of ~other_rect~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.anchor_rect rect, anchor_x, anchor_y~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.anchor_rect rect, anchor_x, anchor_y~~ +- 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: ~~.anchor_rect rect, anchor_x, anchor_y~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a new rectangle based of off ~rect~ that has been repositioned based on the percentages passed into anchor_x, and anchor_y.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a new rectangle based of off ~rect~ that has been repositioned based on the percentages passed into anchor_x, and anchor_y.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.shift_line line, x, y~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.shift_line line, x, y~~ +- 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: ~~.shift_line line, x, y~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a line that is offset by ~x~, and ~y~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a line that is offset by ~x~, and ~y~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.line_y_intercept line~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.line_y_intercept line~~ +- 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: ~~.line_y_intercept line~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Given a line, the ~b~ value is determined for the point slope form equation: ~y = mx + b~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Given a line, the ~b~ value is determined for the point slope form equation: ~y = mx + b~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.angle_between_lines line_one, line_two, replace_infinity:~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.angle_between_lines line_one, line_two, replace_infinity:~~ +- 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: ~~.angle_between_lines line_one, line_two, replace_infinity:~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.line_slope line, replace_infinity:~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.line_slope line, replace_infinity:~~ +- 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: ~~.line_slope line, replace_infinity:~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Given a line, the ~m~ value is determined for the point slope form equation: ~y = mx + b~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Given a line, the ~m~ value is determined for the point slope form equation: ~y = mx + b~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.line_rise_run~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.line_rise_run~~ +- 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: ~~.line_rise_run~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Given a line, a ~Hash~ is returned that returns the slope as ~x~ and ~y~ properties with normalized values (the number is between -1 and 1).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Given a line, a ~Hash~ is returned that returns the slope as ~x~ and ~y~ properties with normalized values (the number is between -1 and 1).~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.ray_test point, line~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.ray_test point, line~~ +- 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: ~~.ray_test point, line~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Given a point and a line, ~:on~, ~:left~, or ~:right~ which represents the location of the point relative to the line.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Given a point and a line, ~:on~, ~:left~, or ~:right~ which represents the location of the point relative to the line.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.line_rect line~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.line_rect line~~ +- 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: ~~.line_rect line~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the bounding rectangle for a line.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the bounding rectangle for a line.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.line_intersect line_one, line_two~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.line_intersect line_one, line_two~~ +- 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: ~~.line_intersect line_one, line_two~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a point that represents the intersection of the lines.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a point that represents the intersection of the lines.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.distance point_one, point_two~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.distance point_one, point_two~~ +- 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: ~~.distance point_one, point_two~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the distance between two points.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the distance between two points.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.cubic_bezier t, a, b, c, d~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.cubic_bezier t, a, b, c, d~~ +- 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: ~~.cubic_bezier t, a, b, c, d~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the cubic bezier function for tick_count ~t~ with anchors ~a~, ~b~, ~c~, and ~d~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the cubic bezier function for tick_count ~t~ with anchors ~a~, ~b~, ~c~, and ~d~.~ +- Line's tilde count is: 10 +- Line contains link marker: false +- CODE detected. +** Processing line: ~** ~args.easing~~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~~args.easing~~ +- 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: ~~args.easing~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~A set of functions that allow you to determine the current progression of an easing function.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~A set of functions that allow you to determine the current progression of an easing function.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.ease start_tick, current_tick, duration, easing_functions~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.ease start_tick, current_tick, duration, easing_functions~~ +- 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: ~~.ease start_tick, current_tick, duration, easing_functions~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Given a start, current, duration, and easing function names, ~ease~ returns a number between 0 and 1 that represents the progress of an easing function.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Given a start, current, duration, and easing function names, ~ease~ returns a number between 0 and 1 that represents the progress of an easing function.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~The built in easing definitions you have access to are ~:identity~, ~:flip~, ~:quad~, ~:cube~, ~:quart~, and ~:quint~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The built in easing definitions you have access to are ~:identity~, ~:flip~, ~:quad~, ~:cube~, ~:quart~, and ~:quint~.~ +- Line's tilde count is: 12 +- Line contains link marker: false +- CODE detected. +** Processing line: ~This example will move a box at a linear speed from 0 to 1280.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~This example will move a box at a linear speed from 0 to 1280.~ +- 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: ~ start_time = 10~ +** Processing line: ~ duration = 60~ +** Processing line: ~ current_progress = args.easing.ease start_time,~ +** Processing line: ~ args.state.tick_count,~ +** Processing line: ~ duration,~ +** Processing line: ~ :identity~ +** Processing line: ~ args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 }~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~*** ~.ease_spline start_tick, current_tick, duration, spline~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.ease_spline start_tick, current_tick, duration, spline~~ +- 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: ~~.ease_spline start_tick, current_tick, duration, spline~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~This example will move a box at a linear speed from 0 to 1280 and then back to 0 using two bezier definitions (represented as an array with four values).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~This example will move a box at a linear speed from 0 to 1280 and then back to 0 using two bezier definitions (represented as an array with four values).~ +- 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: ~ start_time = 10~ +** Processing line: ~ duration = 60~ +** Processing line: ~ spline = [~ +** Processing line: ~ [ 0, 0.25, 0.75, 1.0],~ +** Processing line: ~ [1.0, 0.75, 0.25, 0]~ +** Processing line: ~ ]~ +** Processing line: ~ current_progress = args.easing.ease_spline start_time,~ +** Processing line: ~ args.state.tick_count,~ +** Processing line: ~ duration,~ +** Processing line: ~ spline~ +** Processing line: ~ args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 }~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~** ~args.string~~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~~args.string~~ +- 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: ~~args.string~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Useful string functions not included in Ruby core libraries.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Useful string functions not included in Ruby core libraries.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.wrapped_lines string, max_character_length~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.wrapped_lines string, max_character_length~~ +- 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: ~~.wrapped_lines string, max_character_length~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~This function will return a collection of strings given an input ~string~ and ~max_character_length~. The collection of strings returned will split the input string into strings of ~length <= max_character_length~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~This function will return a collection of strings given an input ~string~ and ~max_character_length~. The collection of strings returned will split the input string into strings of ~length <= max_character_length~.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~The following example takes a string with new lines and creates a label for each one. Labels (~args.outputs.labels~) ignore newline characters ~\n~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The following example takes a string with new lines and creates a label for each one. Labels (~args.outputs.labels~) ignore newline characters ~\n~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** 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 elit.~ +** Processing line: ~Integer 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: ~** ~args.grid~~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~~args.grid~~ +- 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: ~~args.grid~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the virtual grid for the game.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the virtual grid for the game.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.name~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.name~~ +- 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: ~~.name~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns either ~:origin_bottom_left~ or ~:origin_center~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns either ~:origin_bottom_left~ or ~:origin_center~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.bottom~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.bottom~~ +- 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: ~~.bottom~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the ~y~ value that represents the bottom of the grid.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the ~y~ value that represents the bottom of the grid.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.top~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.top~~ +- 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: ~~.top~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the ~y~ value that represents the top of the grid.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the ~y~ value that represents the top of the grid.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.left~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the ~x~ value that represents the left of the grid.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the ~x~ value that represents the left of the grid.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.right~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the ~x~ value that represents the right of the grid.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the ~x~ value that represents the right of the grid.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.rect~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.rect~~ +- 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: ~~.rect~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a rectangle Primitive that represents the grid.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a rectangle Primitive that represents the grid.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.origin_bottom_left!~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.origin_bottom_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: ~~.origin_bottom_left!~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Change the grids coordinate system to 0, 0 at the bottom left corner.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Change the grids coordinate system to 0, 0 at the bottom left corner.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.origin_center!~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.origin_center!~~ +- 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: ~~.origin_center!~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Change the grids coordinate system to 0, 0 at the center of the screen.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Change the grids coordinate system to 0, 0 at the center of the screen.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.w~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.w~~ +- 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: ~~.w~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the grid's width (always 1280).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the grid's width (always 1280).~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.h~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.h~~ +- 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: ~~.h~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the grid's height (always 720).~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the grid's height (always 720).~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~** ~args.gtk~~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~~args.gtk~~ +- 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: ~~args.gtk~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~This represents the DragonRuby Game Toolkit's Runtime Environment and can be accessed via ~args.gtk.METHOD~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~This represents the DragonRuby Game Toolkit's Runtime Environment and can be accessed via ~args.gtk.METHOD~.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.argv~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.argv~~ +- 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: ~~.argv~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a ~String~ that represents the parameters passed into the ~./dragonruby~ binary.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a ~String~ that represents the parameters passed into the ~./dragonruby~ binary.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.platform~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.platform~~ +- 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: ~~.platform~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a ~String~ representing the operating system the game is running on.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a ~String~ representing the operating system the game is running on.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.request_quit~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.request_quit~~ +- 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: ~~.request_quit~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Request that the runtime quit the game.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Request that the runtime quit the game.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.write_file path, contents~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.write_file path, contents~~ +- 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: ~~.write_file path, contents~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Writes/overwrites a file within the game directory + path.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Writes/overwrites a file within the game directory + path.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.write_file_root~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.write_file_root~~ +- 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: ~~.write_file_root~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Writes/overwrites a file within the root dragonruby binary directory + path.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Writes/overwrites a file within the root dragonruby binary directory + path.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.append_file path, contents~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.append_file path, contents~~ +- 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: ~~.append_file path, contents~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Append content to a file located at the game directory + path.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Append content to a file located at the game directory + path.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.append_file_root path, contents~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.append_file_root path, contents~~ +- 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: ~~.append_file_root path, contents~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Append content to a file located at the root dragonruby binary directory + path.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Append content to a file located at the root dragonruby binary directory + path.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.read_file path~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.read_file path~~ +- 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: ~~.read_file path~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Reads a file from the sandboxed file system.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Reads a file from the sandboxed file system.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.parse_xml string, parse_xml_file path~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.parse_xml string, parse_xml_file path~~ +- 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: ~~.parse_xml string, parse_xml_file path~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a ~Hash~ for a ~String~ that represents XML.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a ~Hash~ for a ~String~ that represents XML.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.parse_json string, parse_json_file path~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.parse_json string, parse_json_file path~~ +- 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: ~~.parse_json string, parse_json_file path~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a ~Hash~ for a ~String~ that represents JSON.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a ~Hash~ for a ~String~ that represents JSON.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.http_get url, extra_headers = {}~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.http_get url, extra_headers = {}~~ +- 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: ~~.http_get url, extra_headers = {}~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Creates an async task to perform an HTTP GET.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Creates an async task to perform an HTTP GET.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.http_post url, form_fields = {}, extra_headers = {}~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.http_post url, form_fields = {}, extra_headers = {}~~ +- 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: ~~.http_post url, form_fields = {}, extra_headers = {}~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Creates an async task to perform an HTTP POST.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Creates an async task to perform an HTTP POST.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.reset~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.reset~~ +- 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: ~~.reset~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Resets the game by deleting all data in ~args.state~ and setting ~args.state.tick_count~ back to ~0~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Resets the game by deleting all data in ~args.state~ and setting ~args.state.tick_count~ back to ~0~.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.stop_music~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.stop_music~~ +- 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: ~~.stop_music~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Stops all background music.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Stops all background music.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.calcstringbox str, size_enum, font~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.calcstringbox str, size_enum, font~~ +- 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: ~~.calcstringbox str, size_enum, font~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns a tuple with width and height of a string being rendered.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a tuple with width and height of a string being rendered.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.slowmo! factor~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.slowmo! factor~~ +- 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: ~~.slowmo! factor~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Slows the game down by the factor provided.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Slows the game down by the factor provided.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.notify! string~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.notify! string~~ +- 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: ~~.notify! string~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Renders a toast message at the bottom of the screen.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Renders a toast message at the bottom of the screen.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.system~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.system~~ +- 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: ~~.system~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Invokes a shell command and prints the result to the console.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Invokes a shell command and prints the result to the console.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.exec~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.exec~~ +- 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: ~~.exec~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Invokes a shell command and returns a ~String~ that represents the result.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Invokes a shell command and returns a ~String~ that represents the result.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.save_state~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.save_state~~ +- 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: ~~.save_state~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Saves the game state to ~game_state.txt~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Saves the game state to ~game_state.txt~.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.load_state~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.load_state~~ +- 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: ~~.load_state~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Load ~args.state~ from ~game_state.txt~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Load ~args.state~ from ~game_state.txt~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.serialize_state file, state~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.serialize_state file, state~~ +- 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: ~~.serialize_state file, state~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~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 detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Saves entity state to a file. If only one parameter is provided a string is returned for state instead of writing to a file.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.deserialize_state file~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.deserialize_state file~~ +- 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: ~~.deserialize_state file~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns entity state from a file or serialization data represented as a ~String~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns entity state from a file or serialization data represented as a ~String~.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.reset_sprite path~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.reset_sprite path~~ +- 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: ~~.reset_sprite path~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Invalids the texture cache of a sprite.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Invalids the texture cache of a sprite.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.show_cursor~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.show_cursor~~ +- 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: ~~.show_cursor~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Shows the mouse cursor.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Shows the mouse cursor.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.hide_cursor~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.hide_cursor~~ +- 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: ~~.hide_cursor~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Hides the mouse cursor.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Hides the mouse cursor.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.cursor_shown?~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.cursor_shown?~~ +- 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: ~~.cursor_shown?~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns ~true~ if the mouse cursor is shown.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns ~true~ if the mouse cursor is shown.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.set_window_fullscreen enabled~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.set_window_fullscreen enabled~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.set_window_fullscreen enabled~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Sets the game to either fullscreen (~enabled=true~) or windowed (~enabled=false)~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Sets the game to either fullscreen (~enabled=true~) or windowed (~enabled=false)~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~*** ~.openurl url~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.openurl url~~ +- 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: ~~.openurl url~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Opens a url using the Operating System's default browser.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Opens a url using the Operating System's default browser.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.get_base_dir~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.get_base_dir~~ +- 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: ~~.get_base_dir~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the full path of the DragonRuby binary directory.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the full path of the DragonRuby binary directory.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~*** ~.get_game_dir~~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~~.get_game_dir~~ +- 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: ~~.get_game_dir~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns the full path of the game directory in its sandboxed environment.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the full path of the game directory in its sandboxed environment.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::Runtime#reset~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::Runtime#reset~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~This function will reset Kernel.tick_count to 0 and will remove all data from args.state.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~This function will reset Kernel.tick_count to 0 and will remove all data from args.state.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::Runtime#calcstringbox~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::Runtime#calcstringbox~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~This function returns the width and height of a string.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~This function returns the width and height of 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: ~ args.state.string_size ||= args.gtk.calcstringbox "Hello World"~ +** Processing line: ~ args.state.string_size_font_size ||= args.gtk.calcstringbox "Hello World"~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::Runtime#write_file~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::Runtime#write_file~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~This function takes in two parameters. The first parameter is the file path and assumes the the game directory is the root. The second parameter is the string that will be written. The method overwrites whatever is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~This function takes in two parameters. The first parameter is the file path and assumes the the game directory is the root. The second parameter is the string that will be written. The method overwrites whatever is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ if args.inputs.mouse.click~ +** Processing line: ~ args.gtk.write_file "last-mouse-click.txt", "Mouse was clicked at #{args.state.tick_count}."~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Array~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Array~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~The Array class has been extend to provide methods that will help in common game development tasks. Array is one of the most powerful classes in Ruby and a very fundamental component of Game Toolkit.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The Array class has been extend to provide methods that will help in common game development tasks. Array is one of the most powerful classes in Ruby and a very fundamental component of Game Toolkit.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Array#map~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Array#map~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~The function given a block returns a new ~Enumerable~ of values.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The function given a block returns a new ~Enumerable~ of values.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Example of using ~Array#map~ in conjunction with ~args.state~ and ~args.outputs.sprites~ to render sprites to the screen.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Example of using ~Array#map~ in conjunction with ~args.state~ and ~args.outputs.sprites~ to render sprites to the screen.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # define the colors of the rainbow in ~args.state~~ +** Processing line: ~ # as an ~Array~ of ~Hash~es with :order and :name.~ +** Processing line: ~ # :order will be used to determine render location~ +** Processing line: ~ # and :name will be used to determine sprite path.~ +** Processing line: ~ args.state.rainbow_colors ||= [~ +** Processing line: ~ { order: 0, name: :red },~ +** Processing line: ~ { order: 1, name: :orange },~ +** Processing line: ~ { order: 2, name: :yellow },~ +** Processing line: ~ { order: 3, name: :green },~ +** Processing line: ~ { order: 4, name: :blue },~ +** Processing line: ~ { order: 5, name: :indigo },~ +** Processing line: ~ { order: 6, name: :violet },~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ # render sprites diagonally to the screen~ +** Processing line: ~ # with a width and height of 50.~ +** Processing line: ~ args.outputs~ +** Processing line: ~ .sprites << args.state~ +** Processing line: ~ .rainbow_colors~ +** Processing line: ~ .map do |color| # <-- ~Array#map~ usage~ +** Processing line: ~ [~ +** Processing line: ~ color[:order] * 50,~ +** Processing line: ~ color[:order] * 50,~ +** Processing line: ~ 50,~ +** Processing line: ~ 50,~ +** Processing line: ~ "sprites/square-#{color[:name]}.png"~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Array#each~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Array#each~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~The function, given a block, invokes the block for each item in the ~Array~. ~Array#each~ is synonymous to foreach constructs in other languages.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The function, given a block, invokes the block for each item in the ~Array~. ~Array#each~ is synonymous to foreach constructs in other languages.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Example of using ~Array#each~ in conjunction with ~args.state~ and ~args.outputs.sprites~ to render sprites to the screen:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Example of using ~Array#each~ in conjunction with ~args.state~ and ~args.outputs.sprites~ to render sprites to the screen:~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # define the colors of the rainbow in ~args.state~~ +** Processing line: ~ # as an ~Array~ of ~Hash~es with :order and :name.~ +** Processing line: ~ # :order will be used to determine render location~ +** Processing line: ~ # and :name will be used to determine sprite path.~ +** Processing line: ~ args.state.rainbow_colors ||= [~ +** Processing line: ~ { order: 0, name: :red },~ +** Processing line: ~ { order: 1, name: :orange },~ +** Processing line: ~ { order: 2, name: :yellow },~ +** Processing line: ~ { order: 3, name: :green },~ +** Processing line: ~ { order: 4, name: :blue },~ +** Processing line: ~ { order: 5, name: :indigo },~ +** Processing line: ~ { order: 6, name: :violet },~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ # render sprites diagonally to the screen~ +** Processing line: ~ # with a width and height of 50.~ +** Processing line: ~ args.state~ +** Processing line: ~ .rainbow_colors~ +** Processing line: ~ .map do |color| # <-- ~Array#each~ usage~ +** Processing line: ~ args.outputs.sprites << [~ +** Processing line: ~ color[:order] * 50,~ +** Processing line: ~ color[:order] * 50,~ +** Processing line: ~ 50,~ +** Processing line: ~ 50,~ +** Processing line: ~ "sprites/square-#{color[:name]}.png"~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Array#reject_nil~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Array#reject_nil~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Returns an ~Enumerable~ rejecting items that are ~nil~, this is an alias for ~Array#compact~:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns an ~Enumerable~ rejecting items that are ~nil~, this is an alias for ~Array#compact~:~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ repl do~ +** Processing line: ~ a = [1, nil, 4, false, :a]~ +** Processing line: ~ puts a.reject_nil~ +** Processing line: ~ # => [1, 4, false, :a]~ +** Processing line: ~ puts a.compact~ +** Processing line: ~ # => [1, 4, false, :a]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Array#reject_false~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Array#reject_false~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Returns an `Enumerable` rejecting items that are `nil` or `false`.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns an `Enumerable` rejecting items that are `nil` or `false`.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ repl do~ +** Processing line: ~ a = [1, nil, 4, false, :a]~ +** Processing line: ~ puts a.reject_false~ +** Processing line: ~ # => [1, 4, :a]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Array#product~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Array#product~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Returns all combinations of values between two arrays.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns all combinations of values between two arrays.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Here are some examples of using ~product~. Paste the following code at the bottom of main.rb and save the file to see the results:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Here are some examples of using ~product~. Paste the following code at the bottom of main.rb and save the file to see the results:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ repl do~ +** Processing line: ~ a = [0, 1]~ +** Processing line: ~ puts a.product~ +** Processing line: ~ # => [[0, 0], [0, 1], [1, 0], [1, 1]]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ repl do~ +** Processing line: ~ a = [ 0, 1]~ +** Processing line: ~ b = [:a, :b]~ +** Processing line: ~ puts a.product b~ +** Processing line: ~ # => [[0, :a], [0, :b], [1, :a], [1, :b]]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Array#map_2d~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Array#map_2d~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Assuming the array is an array of arrays, Given a block, each 2D array index invoked against the block. A 2D array is a common way to store data/layout for a stage.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Assuming the array is an array of arrays, Given a block, each 2D array index invoked against the block. A 2D array is a common way to store data/layout for a stage.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ repl do~ +** Processing line: ~ stage = [~ +** Processing line: ~ [:enemy, :empty, :player],~ +** Processing line: ~ [:empty, :empty, :empty],~ +** Processing line: ~ [:enemy, :empty, :enemy],~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ occupied_tiles = stage.map_2d do |row, col, tile|~ +** Processing line: ~ if tile == :empty~ +** Processing line: ~ nil~ +** Processing line: ~ else~ +** Processing line: ~ [row, col, tile]~ +** Processing line: ~ end~ +** Processing line: ~ end.reject_nil~ +** Processing line: ~~ +** Processing line: ~ puts "Stage:"~ +** Processing line: ~ puts stage~ +** Processing line: ~~ +** Processing line: ~ puts "Occupied Tiles"~ +** Processing line: ~ puts occupied_tiles~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Array#include_any?~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Array#include_any?~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Given a collection of items, the function will return ~true~ if any of ~self~'s items exists in the collection of items passed in:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Given a collection of items, the function will return ~true~ if any of ~self~'s items exists in the collection of items passed in:~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Array#any_intersect_rect?~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Array#any_intersect_rect?~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Assuming the array contains objects that respond to ~left~, ~right~, ~top~, ~bottom~, this method returns ~true~ if any of the elements within the array intersect the object being passed in. You are given an optional parameter called ~tolerance~ which informs how close to the other rectangles the elements need to be for it to be considered intersecting.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Assuming the array contains objects that respond to ~left~, ~right~, ~top~, ~bottom~, this method returns ~true~ if any of the elements within the array intersect the object being passed in. You are given an optional parameter called ~tolerance~ which informs how close to the other rectangles the elements need to be for it to be considered intersecting.~ +- Line's tilde count is: 12 +- Line contains link marker: false +- CODE detected. +** Processing line: ~The default tolerance is set to ~0.1~, which means that the primitives are not considered intersecting unless they are overlapping by more than ~0.1~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The default tolerance is set to ~0.1~, which means that the primitives are not considered intersecting unless they are overlapping by more than ~0.1~.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ repl do~ +** Processing line: ~ # Here is a player class that has position and implement~ +** Processing line: ~ # the ~attr_rect~ contract.~ +** Processing line: ~ class Player~ +** Processing line: ~ attr_rect~ +** Processing line: ~ attr_accessor :x, :y, :w, :h~ +** Processing line: ~~ +** Processing line: ~ def initialize x, y, w, h~ +** Processing line: ~ @x = x~ +** Processing line: ~ @y = y~ +** Processing line: ~ @w = w~ +** Processing line: ~ @h = h~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def serialize~ +** Processing line: ~ { x: @x, y: @y, w: @w, h: @h }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def inspect~ +** Processing line: ~ "#{serialize}"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def to_s~ +** Processing line: ~ "#{serialize}"~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Here is a definition of two walls.~ +** Processing line: ~ walls = [~ +** Processing line: ~ [10, 10, 10, 10],~ +** Processing line: ~ { x: 20, y: 20, w: 10, h: 10 },~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ # Display the walls.~ +** Processing line: ~ puts "Walls."~ +** Processing line: ~ puts walls~ +** Processing line: ~ puts ""~ +** Processing line: ~~ +** Processing line: ~ # Check any_intersect_rect? on player~ +** Processing line: ~ player = Player.new 30, 20, 10, 10~ +** Processing line: ~ puts "Is Player #{player} touching wall?"~ +** Processing line: ~ puts (walls.any_intersect_rect? player)~ +** Processing line: ~ # => false~ +** Processing line: ~ # The value is false because of the default tolerance is 0.1.~ +** Processing line: ~ # The overlap of the player rect and any of the wall rects is~ +** Processing line: ~ # less than 0.1 (for those that intersect).~ +** Processing line: ~ puts ""~ +** Processing line: ~~ +** Processing line: ~ player = Player.new 9, 10, 10, 10~ +** Processing line: ~ puts "Is Player #{player} touching wall?"~ +** Processing line: ~ puts (walls.any_intersect_rect? player)~ +** Processing line: ~ # => true~ +** Processing line: ~ puts ""~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::Args#audio~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::Args#audio~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Hash that contains audio sources that are playing. If you want to add a new sound add a hash with keys/values as in the following example:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Hash that contains audio sources that are playing. If you want to add a new sound add a hash with keys/values as in the following example:~ +- 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: ~ # The values below (except for input of course) are the default values that apply if you don't~ +** Processing line: ~ # specify the value in the hash.~ +** Processing line: ~ args.audio[:my_audio] = {~ +** Processing line: ~ input: 'sound/boom.wav', # Filename~ +** Processing line: ~ x: 0.0, y: 0.0, z: 0.0, # Relative position to the listener, x, y, z from -1.0 to 1.0~ +** Processing line: ~ gain: 1.0, # Volume (0.0 to 1.0)~ +** Processing line: ~ pitch: 1.0, # Pitch of the sound (1.0 = original pitch)~ +** Processing line: ~ paused: false, # Set to true to pause the sound at the current playback position~ +** Processing line: ~ looping: false, # Set to true to loop the sound/music until you stop it~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~Sounds that don't specify ~looping: true~ will be removed automatically from the hash after the playback ends. Looping sounds or sounds that should stop early must be removed manually.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Sounds that don't specify ~looping: true~ will be removed automatically from the hash after the playback ends. Looping sounds or sounds that should stop early must be removed manually.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~** Audio synthesis (Pro only)~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Audio synthesis (Pro only)~ +- 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: ~Audio synthesis (Pro only)~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Instead of a path to an audio file you can specify an array ~[channels, sample_rate, sound_source]~ for ~input~ to procedurally generate sound. You do this by providing an array of float values between -1.0 and 1.0 that describe the waveform you want to play.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Instead of a path to an audio file you can specify an array ~[channels, sample_rate, sound_source]~ for ~input~ to procedurally generate sound. You do this by providing an array of float values between -1.0 and 1.0 that describe the waveform you want to play.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~- ~channels~ is the number of channels: 1 = mono, 2 = stereo~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~channels~ is the number of channels: 1 = mono, 2 = stereo~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~sample_rate~ is the number of values per seconds you will provide to describe the audio wave~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~sample_rate~ is the number of values per seconds you will provide to describe the audio wave~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~sound_source~ The source of your sound. See below~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~sound_source~ The source of your sound. See below~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~*** Sound source~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Sound source~ +- 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: ~Sound source~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~A sound source can be one of two things:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~A sound source can be one of two things:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~- A ~Proc~ object that is called on demand to generate the next samples to play. Every call should generate + enough samples for at least 0.1 to 0.5 seconds to get continuous playback without audio skips. The audio will continue playing endlessly until removed, so the ~looping~ option will have no effect.~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~A ~Proc~ object that is called on demand to generate the next samples to play. Every call should generate + enough samples for at least 0.1 to 0.5 seconds to get continuous playback without audio skips. The audio will continue playing endlessly until removed, so the ~looping~ option will have no effect.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~- An array of sample values that will be played back once. This is useful for procedurally generated one-off SFX. + ~looping~ will work as expected~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~An array of sample values that will be played back once. This is useful for procedurally generated one-off SFX. + ~looping~ will work as expected~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~When you specify 2 for ~channels~, then the generated sample array will be played back in an interleaved manner. The first element is the first sample for the left channel, the second element is the first sample for the right channel, the third element is the second sample for the left channel etc.~ +- UL end detected. +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~When you specify 2 for ~channels~, then the generated sample array will be played back in an interleaved manner. The first element is the first sample for the left channel, the second element is the first sample for the right channel, the third element is the second sample for the left channel etc.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~*** Example:~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Example:~ +- 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: ~Example:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ sample_rate = 48000~ +** Processing line: ~~ +** Processing line: ~ generate_sine_wave = lambda do~ +** Processing line: ~ frequency = 440.0 # A5~ +** Processing line: ~ samples_per_period = (sample_rate / frequency).ceil~ +** Processing line: ~ one_period = samples_per_period.map_with_index { |i|~ +** Processing line: ~ Math.sin((2 * Math::PI) * (i / samples_per_period))~ +** Processing line: ~ }~ +** Processing line: ~ one_period * frequency # Generate 1 second worth of sound~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.audio[:my_audio] ||= {~ +** Processing line: ~ input: [1, sample_rate, generate_sine_wave]~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::Outputs~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::Outputs~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Outputs is how you render primitives to the screen. The minimal setup for rendering something to the screen is via a ~tick~ method defined in mygame/app/main.rb~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Outputs is how you render primitives to the screen. The minimal setup for rendering something to the screen is via a ~tick~ method defined in mygame/app/main.rb~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # code goes here~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::Outputs#solids~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::Outputs#solids~~ +- 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 solid 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 solid to the screen.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Rendering a solid using an Array~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Rendering a solid 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 solid using an Array~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Creates a solid black rectangle 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 solid black rectangle 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~ +** Processing line: ~ args.outputs.solids << [100, 100, 160, 90]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** Rendering a solid 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 solid 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 solid 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 an 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.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Creates a green solid rectangle 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 solid rectangle 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 RED GREEN BLUE ALPHA~ +** Processing line: ~ args.outputs.solids << [100, 100, 160, 90, 0, 255, 0, 128]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** Rendering a solid using a Hash~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Rendering a solid 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 solid 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 solid. 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 solid. 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.solids << {~ +** Processing line: ~ x: 0,~ +** Processing line: ~ y: 0,~ +** Processing line: ~ w: 100,~ +** Processing line: ~ h: 100,~ +** Processing line: ~ r: 0,~ +** Processing line: ~ g: 255,~ +** Processing line: ~ b: 0,~ +** Processing line: ~ a: 255~ +** 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 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.~ +- 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 solid properties AND primitive_marker~ +** Processing line: ~ class Solid~ +** Processing line: ~ attr_accessor :x, :y, :w, :h, :r, :g, :b, :a~ +** Processing line: ~~ +** Processing line: ~ def primitive_marker~ +** Processing line: ~ :solid~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Inherit from type~ +** Processing line: ~ class Square < Solid~ +** Processing line: ~ # constructor~ +** Processing line: ~ def initialize x, y, size~ +** Processing line: ~ self.x = x~ +** Processing line: ~ self.y = y~ +** Processing line: ~ self.w = size~ +** Processing line: ~ self.h = size~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ # render solid/border~ +** Processing line: ~ args.outputs.solids << Square.new(10, 10, 32)~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::Outputs#borders~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::Outputs#borders~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Add primitives to this collection to render an unfilled solid to the screen. Take a look at the documentation for Outputs#solids.~ +- 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 an unfilled solid to the screen. Take a look at the documentation for Outputs#solids.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~The only difference between the two primitives is where they are added.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The only difference between the two primitives is where they are added.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Instead of using ~args.outputs.solids~:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Instead of using ~args.outputs.solids~:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # X Y WIDTH HEIGHT~ +** Processing line: ~ args.outputs.solids << [100, 100, 160, 90]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~You have to use ~args.outputs.borders~:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~You have to use ~args.outputs.borders~:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # X Y WIDTH HEIGHT~ +** Processing line: ~ args.outputs.borders << [100, 100, 160, 90]~ +** 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. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::Outputs#screenshots~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~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.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~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.~ +- 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.screenshots << {~ +** Processing line: ~ x: 0, y: 0, w: 100, h: 100, # Which portion of the screen should be captured~ +** Processing line: ~ path: 'screenshot.png', # Output path of PNG file (inside game directory)~ +** Processing line: ~ r: 255, g: 255, b: 255, a: 0 # Optional chroma key~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~** Chroma key (Making a color transparent)~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Chroma key (Making a color transparent)~ +- 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: ~Chroma key (Making a color transparent)~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~By specifying the r, g, b and a keys of the hash you change the transparency of a color in the resulting PNG file. This can be useful if you want to create files with transparent background like spritesheets. The transparency of the color specified by ~r~, ~g~, ~b~ will be set to the transparency specified by ~a~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~By specifying the r, g, b and a keys of the hash you change the transparency of a color in the resulting PNG file. This can be useful if you want to create files with transparent background like spritesheets. The transparency of the color specified by ~r~, ~g~, ~b~ will be set to the transparency specified by ~a~.~ +- Line's tilde count is: 8 +- Line contains link marker: false +- CODE detected. +** Processing line: ~The example above sets the color white (255, 255, 255) as transparent.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The example above sets the color white (255, 255, 255) as transparent.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::Mouse~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::Mouse~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~The mouse is accessible via ~args.inputs.mouse~:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The mouse is accessible via ~args.inputs.mouse~:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # Rendering a label that shows the mouse's x and y position (via args.inputs.mouse).~ +** Processing line: ~ args.outputs.labels << [~ +** Processing line: ~ 10,~ +** Processing line: ~ 710,~ +** Processing line: ~ "The mouse's position is: #{args.inputs.mouse.x} #{args.inputs.mouse.y}."~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~The mouse has the following properties.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The mouse has the following properties.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~- ~args.inputs.mouse.x~: Returns the x position of the mouse.~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.x~: Returns the x position of the mouse.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.y~: Returns the y position of the mouse.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.y~: Returns the y position of the mouse.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.moved~: Returns true if the mouse moved during the tick.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.moved~: Returns true if the mouse moved during the tick.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.moved_at~: Returns the tick_count (~args.state.tick_count~) that the mouse was moved at. This property will be ~nil~ if the mouse didn't move.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.moved_at~: Returns the tick_count (~args.state.tick_count~) that the mouse was moved at. This property will be ~nil~ if the mouse didn't move.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.global_moved_at~: Returns the global tick_count (~Kernel.global_tick_count~) that the mouse was moved at. This property will be ~nil~ if the mouse didn't move.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.global_moved_at~: Returns the global tick_count (~Kernel.global_tick_count~) that the mouse was moved at. This property will be ~nil~ if the mouse didn't move.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.click~: Returns a ~GTK::MousePoint~ for that specific frame (~args.state.tick_count~) if the mouse button was pressed.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.click~: Returns a ~GTK::MousePoint~ for that specific frame (~args.state.tick_count~) if the mouse button was pressed.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.previous_click~: Returns a ~GTK::MousePoint~ for the previous frame (~args.state.tick_count - 1~) if the mouse button was pressed.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.previous_click~: Returns a ~GTK::MousePoint~ for the previous frame (~args.state.tick_count - 1~) if the mouse button was pressed.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.up~: Returns true if for that specific frame (~args.state.tick_count~) if the mouse button was released.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.up~: Returns true if for that specific frame (~args.state.tick_count~) if the mouse button was released.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.point~ | ~args.inputs.mouse.position~: Returns an ~Array~ which contains the ~x~ and ~y~ position of the mouse.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.point~ | ~args.inputs.mouse.position~: Returns an ~Array~ which contains the ~x~ and ~y~ position of the mouse.~ +- Line's tilde count is: 10 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.has_focus~: Returns true if the game window has the mouse's focus.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.has_focus~: Returns true if the game window has the mouse's focus.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.wheel~: Returns an ~GTK::OpenEntity~ that contains an ~x~ and ~y~ property which represents how much the wheel has moved. If the wheel has not moved within the tick, this property will be ~nil~.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.wheel~: Returns an ~GTK::OpenEntity~ that contains an ~x~ and ~y~ property which represents how much the wheel has moved. If the wheel has not moved within the tick, this property will be ~nil~.~ +- Line's tilde count is: 10 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.button_left~: Returns true if the left mouse button is down.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.button_left~: Returns true if the left mouse button is down.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.button_right~: Returns true if the right mouse button is down.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.button_right~: Returns true if the right mouse button is down.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.button_middle~: Returns true if the middle mouse button is down.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.button_middle~: Returns true if the middle mouse button is down.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~args.inputs.mouse.button_bits~: Gives the bits for each mouse button and its current state.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~args.inputs.mouse.button_bits~: Gives the bits for each mouse button and its current state.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::MousePoint~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::MousePoint~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~The ~GTK::MousePoint~ has the following properties.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The ~GTK::MousePoint~ has the following properties.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~- ~x~: Integer representing the mouse's x.~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~x~: Integer representing the mouse's x.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~y~: Integer representing the mouse's y.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~y~: Integer representing the mouse's y.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~point~: Array with the ~x~ and ~y~ values.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~point~: Array with the ~x~ and ~y~ values.~ +- 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).~ +- 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).~ +- 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).~ +- 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).~ +- 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).~ +- 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).~ +- 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).~ +- 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).~ +- 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).~ +- 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).~ +- 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).~ +- 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).~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~created_at~: The tick (~args.state.tick_count~) that this structure was created.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~created_at~: The tick (~args.state.tick_count~) that this structure was created.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~- ~global_created_at~: The global tick (~Kernel.global_tick_count~) that this structure was created.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~global_created_at~: The global tick (~Kernel.global_tick_count~) that this structure was created.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::OpenEntity~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::OpenEntity~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~~GTK::OpenEntity~ is accessible within the DragonRuby's top level ~tick~ function via the ~args.state~ property.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~GTK::OpenEntity~ is accessible within the DragonRuby's top level ~tick~ function via the ~args.state~ property.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.x ||= 100~ +** Processing line: ~ args.outputs.labels << [10, 710, "value of x is: #{args.state.x}."]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~The primary benefit of using ~args.state~ as opposed to instance variables is that ~GTK::OpenEntity~ allows for arbitrary nesting of properties without the need to create intermediate objects.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The primary benefit of using ~args.state~ as opposed to instance variables is that ~GTK::OpenEntity~ allows for arbitrary nesting of properties without the need to create intermediate objects.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~For example:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~For example:~ +- 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: ~ # intermediate player object does not need to be created~ +** Processing line: ~ args.state.player.x ||= 100~ +** Processing line: ~ args.state.player.y ||= 100~ +** Processing line: ~ args.outputs.labels << [~ +** Processing line: ~ 10,~ +** Processing line: ~ 710,~ +** Processing line: ~ "player x, y is:#{args.state.player.x}, #{args.state.player.y}."~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::OpenEntity#as_hash~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::OpenEntity#as_hash~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Returns a reference to the ~GTK::OpenEntity~ as a ~Hash~. This property is useful when you want to treat ~args.state~ as a ~Hash~ and invoke methods such as ~Hash#each~.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns a reference to the ~GTK::OpenEntity~ as a ~Hash~. This property is useful when you want to treat ~args.state~ as a ~Hash~ and invoke methods such as ~Hash#each~.~ +- Line's tilde count is: 10 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Example:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Example:~ +- 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.state.x ||= 100~ +** Processing line: ~ args.state.y ||= 100~ +** Processing line: ~ values = args.state~ +** Processing line: ~ .as_hash~ +** Processing line: ~ .map { |k, v| "#{k} #{v}" }~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << values.map.with_index do |v, i|~ +** Processing line: ~ [~ +** Processing line: ~ 10,~ +** Processing line: ~ 710 - (30 * i),~ +** Processing line: ~ v~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Numeric#frame_index~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Numeric#frame_index~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~This function is helpful for determining the index of frame-by-frame sprite animation. The numeric value ~self~ represents the moment the animation started.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~This function is helpful for determining the index of frame-by-frame sprite animation. The numeric value ~self~ represents the moment the animation started.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~frame_index~ takes three additional parameters:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~frame_index~ takes three additional parameters:~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~- How many frames exist in the sprite animation.~ +- UL start detected. +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~How many frames exist in the sprite animation.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- How long to hold each animation for.~ +- LI detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~How long to hold each animation for.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- Whether the animation should repeat.~ - LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/02_input_basics~: This set of samples show you how to accept input from the ~mouse~, ~keyboard~, and ~controllers~.~ -- Line's tilde count is: 8 +- Line does not appear to be a header. +- Formatting line: ~Whether the animation should repeat.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~frame_index~ will return ~nil~ if the time for the animation is out of bounds of the parameter specification.~ +- UL end detected. +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~frame_index~ will return ~nil~ if the time for the animation is out of bounds of the parameter specification.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Example using variables:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Example using variables:~ +- 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: ~ start_looping_at = 0~ +** Processing line: ~ number_of_sprites = 6~ +** Processing line: ~ number_of_frames_to_show_each_sprite = 4~ +** Processing line: ~ does_sprite_loop = true~ +** Processing line: ~~ +** Processing line: ~ sprite_index =~ +** Processing line: ~ start_looping_at.frame_index number_of_sprites,~ +** Processing line: ~ number_of_frames_to_show_each_sprite,~ +** Processing line: ~ does_sprite_loop~ +** Processing line: ~~ +** Processing line: ~ sprite_index ||= 0~ +** Processing line: ~~ +** Processing line: ~ args.outputs.sprites << [~ +** Processing line: ~ 640 - 50,~ +** Processing line: ~ 360 - 50,~ +** Processing line: ~ 100,~ +** Processing line: ~ 100,~ +** Processing line: ~ "sprites/dragon-#{sprite_index}.png"~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~Example using named parameters:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Example using named parameters:~ +- 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: ~ start_looping_at = 0~ +** Processing line: ~~ +** Processing line: ~ sprite_index =~ +** Processing line: ~ start_looping_at.frame_index count: 6,~ +** Processing line: ~ hold_for: 4,~ +** Processing line: ~ repeat: true,~ +** Processing line: ~ tick_count_override: args.state.tick_count~ +** Processing line: ~~ +** Processing line: ~ sprite_index ||= 0~ +** Processing line: ~~ +** Processing line: ~ args.outputs.sprites << [~ +** Processing line: ~ 640 - 50,~ +** Processing line: ~ 360 - 50,~ +** Processing line: ~ 100,~ +** Processing line: ~ 100,~ +** Processing line: ~ "sprites/dragon-#{sprite_index}.png"~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Numeric#elapsed_time~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Numeric#elapsed_time~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~For a given number, the elapsed frames since that number is returned. `Kernel.tick_count` is used to determine how many frames have elapsed. An optional numeric argument can be passed in which will be used instead of `Kernel.tick_count`.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~For a given number, the elapsed frames since that number is returned. `Kernel.tick_count` is used to determine how many frames have elapsed. An optional numeric argument can be passed in which will be used instead of `Kernel.tick_count`.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Here is an example of how elapsed_time can be used.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Here is an example of how elapsed_time can be used.~ +- 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: ~ args.state.last_click_at ||= 0~ +** Processing line: ~~ +** Processing line: ~ # record when a mouse click occurs~ +** Processing line: ~ if args.inputs.mouse.click~ +** Processing line: ~ args.state.last_click_at = args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Use Numeric#elapsed_time to determine how long it's been~ +** Processing line: ~ if args.state.last_click_at.elapsed_time > 120~ +** Processing line: ~ args.outputs.labels << [10, 710, "It has been over 2 seconds since the mouse was clicked."]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~And here is an example where the override parameter is passed in:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~And here is an example where the override parameter is passed in:~ +- 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: ~ args.state.last_click_at ||= 0~ +** Processing line: ~~ +** Processing line: ~ # create a state variable that tracks time at half the speed of args.state.tick_count~ +** Processing line: ~ args.state.simulation_tick = args.state.tick_count.idiv 2~ +** Processing line: ~~ +** Processing line: ~ # record when a mouse click occurs~ +** Processing line: ~ if args.inputs.mouse.click~ +** Processing line: ~ args.state.last_click_at = args.state.simulation_tick~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Use Numeric#elapsed_time to determine how long it's been~ +** Processing line: ~ if (args.state.last_click_at.elapsed_time args.state.simulation_tick) > 120~ +** Processing line: ~ args.outputs.labels << [10, 710, "It has been over 4 seconds since the mouse was clicked."]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Numeric#elapsed?~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Numeric#elapsed?~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns true if ~Numeric#elapsed_time~ is greater than the number. An optional parameter can be passed into ~elapsed?~ which is added to the number before evaluating whether ~elapsed?~ is true.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns true if ~Numeric#elapsed_time~ is greater than the number. An optional parameter can be passed into ~elapsed?~ which is added to the number before evaluating whether ~elapsed?~ is true.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Example usage (no optional parameter):~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Example usage (no optional parameter):~ +- 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: ~ args.state.box_queue ||= []~ +** Processing line: ~~ +** Processing line: ~ if args.state.box_queue.empty?~ +** Processing line: ~ args.state.box_queue << { name: :red,~ +** Processing line: ~ destroy_at: args.state.tick_count + 60 }~ +** Processing line: ~ args.state.box_queue << { name: :green,~ +** Processing line: ~ destroy_at: args.state.tick_count + 60 }~ +** Processing line: ~ args.state.box_queue << { name: :blue,~ +** Processing line: ~ destroy_at: args.state.tick_count + 120 }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ boxes_to_destroy = args.state~ +** Processing line: ~ .box_queue~ +** Processing line: ~ .find_all { |b| b[:destroy_at].elapsed? }~ +** Processing line: ~~ +** Processing line: ~ if !boxes_to_destroy.empty?~ +** Processing line: ~ puts "boxes to destroy count: #{boxes_to_destroy.length}"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ boxes_to_destroy.each { |b| puts "box #{b} was elapsed? on #{args.state.tick_count}." }~ +** Processing line: ~~ +** Processing line: ~ args.state.box_queue -= boxes_to_destroy~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~Example usage (with optional parameter):~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Example usage (with optional parameter):~ +- 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: ~ args.state.box_queue ||= []~ +** Processing line: ~~ +** Processing line: ~ if args.state.box_queue.empty?~ +** Processing line: ~ args.state.box_queue << { name: :red,~ +** Processing line: ~ create_at: args.state.tick_count + 120,~ +** Processing line: ~ lifespan: 60 }~ +** Processing line: ~ args.state.box_queue << { name: :green,~ +** Processing line: ~ create_at: args.state.tick_count + 120,~ +** Processing line: ~ lifespan: 60 }~ +** Processing line: ~ args.state.box_queue << { name: :blue,~ +** Processing line: ~ create_at: args.state.tick_count + 120,~ +** Processing line: ~ lifespan: 120 }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # lifespan is passed in as a parameter to ~elapsed?~~ +** Processing line: ~ boxes_to_destroy = args.state~ +** Processing line: ~ .box_queue~ +** Processing line: ~ .find_all { |b| b[:create_at].elapsed? b[:lifespan] }~ +** Processing line: ~~ +** Processing line: ~ if !boxes_to_destroy.empty?~ +** Processing line: ~ puts "boxes to destroy count: #{boxes_to_destroy.length}"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ boxes_to_destroy.each { |b| puts "box #{b} was elapsed? on #{args.state.tick_count}." }~ +** Processing line: ~~ +** Processing line: ~ args.state.box_queue -= boxes_to_destroy~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Numeric#created?~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Numeric#created?~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Returns true if ~Numeric#elapsed_time == 0~. Essentially communicating that number is equal to the current frame.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns true if ~Numeric#elapsed_time == 0~. Essentially communicating that number is equal to the current frame.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~Example usage:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Example usage:~ +- 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: ~ args.state.box_queue ||= []~ +** Processing line: ~~ +** Processing line: ~ if args.state.box_queue.empty?~ +** Processing line: ~ args.state.box_queue << { name: :red,~ +** Processing line: ~ create_at: args.state.tick_count + 60 }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ boxes_to_spawn_this_frame = args.state~ +** Processing line: ~ .box_queue~ +** Processing line: ~ .find_all { |b| b[:create_at].new? }~ +** Processing line: ~~ +** Processing line: ~ boxes_to_spawn_this_frame.each { |b| puts "box #{b} was new? on #{args.state.tick_count}." }~ +** Processing line: ~~ +** Processing line: ~ args.state.box_queue -= boxes_to_spawn_this_frame~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Kernel~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Kernel~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Kernel in the DragonRuby Runtime has patches for how standard out is handled and also contains a unit of time in games called a tick.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Kernel in the DragonRuby Runtime has patches for how standard out is handled and also contains a unit of time in games called a tick.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Kernel::tick_count~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Kernel::tick_count~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Returns the current tick of the game. This value is reset if you call $gtk.reset.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the current tick of the game. This value is reset if you call $gtk.reset.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Kernel::global_tick_count~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Kernel::global_tick_count~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Returns the current tick of the application from the point it was started. This value is never reset.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Returns the current tick of the application from the point it was started. This value is never reset.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~Geometry~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~Geometry~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~The Geometry module contains methods for calculations that are frequently used in game development.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The Geometry module contains methods for calculations that are frequently used in game development.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* DOCS: ~GTK::Geometry#scale_rect~~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~DOCS: ~GTK::Geometry#scale_rect~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~Given an array with 4 elements representing a rect [x, y, w, h], this function returns a scaled rect. It accepts three arguments:~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Given an array with 4 elements representing a rect [x, y, w, h], this function returns a scaled rect. It accepts three arguments:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ratio~: the ratio by which to scale the rect. A ratio of 2 will double the dimensions of the rect while a ratio of 0.5 will halve its dimensions.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~ratio~: the ratio by which to scale the rect. A ratio of 2 will double the dimensions of the rect while a ratio of 0.5 will halve its dimensions.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~anchor_x~ and ~anchor_y~ specify the point within the rect from which to resize it. Setting both to 0 will affect the width and height of the rect, leaving x and y unchanged. Setting both to 0.5 will scale all sides of the rect proportionally from the center.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~~anchor_x~ and ~anchor_y~ specify the point within the rect from which to resize it. Setting both to 0 will affect the width and height of the rect, leaving x and y unchanged. Setting both to 0.5 will scale all sides of the rect proportionally from the center.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~The ~scale_rect~ method can be applied directly to a sprite or other primitives. See CHEATSHEET: How to Scale a Sprite.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~The ~scale_rect~ method can be applied directly to a sprite or other primitives. See CHEATSHEET: How to Scale a Sprite.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ def tick args~ +** Processing line: ~ # x, y, w, h~ +** Processing line: ~ my_rect = [100, 100, 200, 200]~ +** Processing line: ~~ +** Processing line: ~ # halve the dimensions of the rect:~ +** Processing line: ~ # ratio, anchor_x, anchor_y~ +** Processing line: ~ new_rect = my_rect.scale_rect(0.5, 0.5, 0.5)~ +** Processing line: ~~ +** Processing line: ~ puts new_rect # => [150.0, 150.0, 100.0, 100.0]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* Source Code~ +- H1 detected. +- Determining if line is a header. +- Line contains ~* ~... gsub-ing empty string +- Formatting line: ~Source Code~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Follows is a source code listing for all files that have been open sourced. This code can be found in the ~./samples~ directory.~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Follows is a source code listing for all files that have been open sourced. This code can be found in the ~./samples~ directory.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~** Samples~ +- H2 detected. +- Determining if line is a header. +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~Samples~ +- 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: ~Samples~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~*** Learn Ruby Optional - Beginner Ruby Primer - automation.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Beginner Ruby Primer - automation.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: ~Learn Ruby Optional - Beginner Ruby Primer - automation.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/00_learn_ruby_optional/00_beginner_ruby_primer/app/automation.rb~ +** Processing line: ~ # ==========================================================================~ +** Processing line: ~ # _ _ ________ __ _ _____ _____ _______ ______ _ _ _ _ _ _~ +** Processing line: ~ # | | | | ____\ \ / / | | |_ _|/ ____|__ __| ____| \ | | | | | |~ +** Processing line: ~ # | |__| | |__ \ \_/ / | | | | | (___ | | | |__ | \| | | | | |~ +** Processing line: ~ # | __ | __| \ / | | | | \___ \ | | | __| | . ` | | | | |~ +** Processing line: ~ # | | | | |____ | | | |____ _| |_ ____) | | | | |____| |\ |_|_|_|_|~ +** Processing line: ~ # |_| |_|______| |_| |______|_____|_____/ |_| |______|_| \_(_|_|_|_)~ +** Processing line: ~ #~ +** Processing line: ~ #~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # \ | /~ +** Processing line: ~ # \ | /~ +** Processing line: ~ # +~ +** Processing line: ~ #~ +** Processing line: ~ # If you are new to the programming language Ruby, then you may find the~ +** Processing line: ~ # following code a bit overwhelming. Come back to this file when you have~ +** Processing line: ~ # a better grasp of Ruby and Game Toolkit.~ +** Processing line: ~ #~ +** Processing line: ~ # What follows is an automations script # that can be run via terminal:~ +** Processing line: ~ # ./samples/00_beginner_ruby_primer $ ../../dragonruby . --eval app/automation.rb~ +** Processing line: ~ # ==========================================================================~ +** Processing line: ~~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~ $gtk.scheduled_callbacks.clear~ +** Processing line: ~ $gtk.schedule_callback 10 do~ +** Processing line: ~ $gtk.console.set_command 'puts "Hello DragonRuby!"'~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 20 do~ +** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 30 do~ +** Processing line: ~ $gtk.console.set_command 'outputs.solids << [910, 200, 100, 100, 255, 0, 0]'~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 40 do~ +** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 50 do~ +** Processing line: ~ $gtk.console.set_command 'outputs.solids << [1010, 200, 100, 100, 0, 0, 255]'~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 60 do~ +** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 70 do~ +** Processing line: ~ $gtk.console.set_command 'outputs.sprites << [1110, 200, 100, 100, "sprites/dragon_fly_0.png"]'~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 80 do~ +** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 90 do~ +** Processing line: ~ $gtk.console.set_command "outputs.labels << [1210, 200, state.tick_count, 0, 255, 0]"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 100 do~ +** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 110 do~ +** Processing line: ~ $gtk.console.set_command "state.sprite_frame = state.tick_count.idiv(4).mod(6)"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 120 do~ +** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 130 do~ +** Processing line: ~ $gtk.console.set_command "outputs.labels << [1210, 170, state.sprite_frame, 0, 255, 0]"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 140 do~ +** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 150 do~ +** Processing line: ~ $gtk.console.set_command "state.sprite_path = \"sprites/dragon_fly_\#{state.sprite_frame}.png\""~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 160 do~ +** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 170 do~ +** Processing line: ~ $gtk.console.set_command "outputs.labels << [910, 330, \"path: \#{state.sprite_path}\", 0, 255, 0]"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 180 do~ +** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 190 do~ +** Processing line: ~ $gtk.console.set_command "outputs.sprites << [910, 330, 370, 370, state.sprite_path]"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 200 do~ +** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 300 do~ +** Processing line: ~ $gtk.console.set_command ":wq"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.schedule_callback 400 do~ +** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Learn Ruby Optional - Beginner Ruby Primer - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Beginner Ruby Primer - 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: ~Learn Ruby Optional - Beginner Ruby Primer - 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/00_learn_ruby_optional/00_beginner_ruby_primer/app/main.rb~ +** Processing line: ~ # ==========================================================================~ +** Processing line: ~ # _ _ ________ __ _ _____ _____ _______ ______ _ _ _ _ _ _~ +** Processing line: ~ # | | | | ____\ \ / / | | |_ _|/ ____|__ __| ____| \ | | | | | |~ +** Processing line: ~ # | |__| | |__ \ \_/ / | | | | | (___ | | | |__ | \| | | | | |~ +** Processing line: ~ # | __ | __| \ / | | | | \___ \ | | | __| | . ` | | | | |~ +** Processing line: ~ # | | | | |____ | | | |____ _| |_ ____) | | | | |____| |\ |_|_|_|_|~ +** Processing line: ~ # |_| |_|______| |_| |______|_____|_____/ |_| |______|_| \_(_|_|_|_)~ +** Processing line: ~ #~ +** Processing line: ~ #~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # |~ +** Processing line: ~ # \ | /~ +** Processing line: ~ # \ | /~ +** Processing line: ~ # +~ +** Processing line: ~ #~ +** Processing line: ~ # If you are new to the programming language Ruby, then you may find the~ +** Processing line: ~ # following code a bit overwhelming. This sample is only designed to be~ +** Processing line: ~ # run interactively (as opposed to being manipulated via source code).~ +** Processing line: ~ #~ +** Processing line: ~ # Start up this sample and follow along by visiting:~ +** Processing line: ~ # https://s3.amazonaws.com/s3.dragonruby.org/dragonruby-gtk-primer.mp4~ +** Processing line: ~ #~ +** Processing line: ~ # It is STRONGLY recommended that you work through all the samples before~ +** Processing line: ~ # looking at the code in this file.~ +** Processing line: ~ # ==========================================================================~ +** Processing line: ~~ +** Processing line: ~ class TutorialOutputs~ +** Processing line: ~ attr_accessor :solids, :sprites, :labels, :lines, :borders~ +** Processing line: ~~ +** Processing line: ~ def initialize~ +** Processing line: ~ @solids = []~ +** Processing line: ~ @sprites = []~ +** Processing line: ~ @labels = []~ +** Processing line: ~ @lines = []~ +** Processing line: ~ @borders = []~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick~ +** Processing line: ~ @solids ||= []~ +** Processing line: ~ @sprites ||= []~ +** Processing line: ~ @labels ||= []~ +** Processing line: ~ @lines ||= []~ +** Processing line: ~ @borders ||= []~ +** Processing line: ~ @solids.each { |p| $gtk.args.outputs.reserved << p.solid }~ +** Processing line: ~ @sprites.each { |p| $gtk.args.outputs.reserved << p.sprite }~ +** Processing line: ~ @labels.each { |p| $gtk.args.outputs.reserved << p.label }~ +** Processing line: ~ @lines.each { |p| $gtk.args.outputs.reserved << p.line }~ +** Processing line: ~ @borders.each { |p| $gtk.args.outputs.reserved << p.border }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def clear~ +** Processing line: ~ @solids.clear~ +** Processing line: ~ @sprites.clear~ +** Processing line: ~ @labels.clear~ +** Processing line: ~ @borders.clear~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def defaults~ +** Processing line: ~ state.reset_button ||=~ +** Processing line: ~ state.new_entity(~ +** Processing line: ~ :button,~ +** Processing line: ~ label: [1190, 68, "RESTART", -2, 0, 0, 0, 0].label,~ +** Processing line: ~ background: [1160, 38, 120, 50, 255, 255, 255].solid~ +** Processing line: ~ )~ +** Processing line: ~ $gtk.log_level = :off~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_reset_button~ +** Processing line: ~ return unless state.hello_dragonruby_confirmed~ +** Processing line: ~ $gtk.args.outputs.reserved << state.reset_button.background~ +** Processing line: ~ $gtk.args.outputs.reserved << state.reset_button.label~ +** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.reset_button.background)~ +** Processing line: ~ restart_tutorial~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def seperator~ +** Processing line: ~ @seperator = "=" * 80~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_intro~ +** Processing line: ~ queue_message "Welcome to the DragonRuby GTK primer! Try typing the~ +** Processing line: ~ code below and press ENTER:~ +** Processing line: ~~ +** Processing line: ~ puts \"Hello DragonRuby!\"~ +** Processing line: ~ "~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_hello_dragonruby~ +** Processing line: ~ return unless console_has? "Hello DragonRuby!"~ +** Processing line: ~~ +** Processing line: ~ $gtk.args.state.hello_dragonruby_confirmed = true~ +** Processing line: ~~ +** Processing line: ~ queue_message "Well HELLO to you too!~ +** Processing line: ~~ +** Processing line: ~ If you ever want to RESTART the tutorial, just click the \"RESTART\"~ +** Processing line: ~ button in the bottom right-hand corner.~ +** Processing line: ~~ +** Processing line: ~ Let's continue shall we? Type the code below and press ENTER:~ +** Processing line: ~~ +** Processing line: ~ outputs.solids << [910, 200, 100, 100, 255, 0, 0]~ +** Processing line: ~ "~ +** Processing line: ~~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_explain_solid~ +** Processing line: ~ return unless $tutorial_outputs.solids.any? {|s| s == [910, 200, 100, 100, 255, 0, 0]}~ +** Processing line: ~~ +** Processing line: ~ queue_message "Sweet!~ +** Processing line: ~~ +** Processing line: ~ The code: outputs.solids << [910, 200, 100, 100, 255, 0, 0]~ +** Processing line: ~ Does the following:~ +** Processing line: ~ 1. GET the place where SOLIDS go: outputs.solids~ +** Processing line: ~ 2. Request that a new SOLID be ADDED: <<~ +** Processing line: ~ 3. The DEFINITION of a SOLID is the ARRAY:~ +** Processing line: ~ [910, 200, 100, 100, 255, 0, 0]~ +** Processing line: ~~ +** Processing line: ~ GET ADD X Y WIDTH HEIGHT RED GREEN BLUE~ +** Processing line: ~ | | | | | | | | |~ +** Processing line: ~ | | | | | | | | |~ +** Processing line: ~ outputs.solids << [910, 200, 100, 100, 255, 0, 0]~ +** Processing line: ~ |_________________________________________|~ +** Processing line: ~ |~ +** Processing line: ~ |~ +** Processing line: ~ ARRAY~ +** Processing line: ~~ +** Processing line: ~ Now let's create a blue SOLID. Type:~ +** Processing line: ~~ +** Processing line: ~ outputs.solids << [1010, 200, 100, 100, 0, 0, 255]~ +** Processing line: ~ "~ +** Processing line: ~~ +** Processing line: ~ state.explain_solid_confirmed = true~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_explain_solid_blue~ +** Processing line: ~ return unless state.explain_solid_confirmed~ +** Processing line: ~ return unless $tutorial_outputs.solids.any? {|s| s == [1010, 200, 100, 100, 0, 0, 255]}~ +** Processing line: ~ state.explain_solid_blue_confirmed = true~ +** Processing line: ~~ +** Processing line: ~ queue_message "And there is our blue SOLID!~ +** Processing line: ~~ +** Processing line: ~ The ARRAY is the MOST important thing in DragonRuby GTK.~ +** Processing line: ~~ +** Processing line: ~ Let's create a SPRITE using an ARRAY:~ +** Processing line: ~~ +** Processing line: ~ outputs.sprites << [1110, 200, 100, 100, 'sprites/dragon_fly_0.png']~ +** Processing line: ~ "~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_explain_tick_count~ +** Processing line: ~ return unless $tutorial_outputs.sprites.any? {|s| s == [1110, 200, 100, 100, 'sprites/dragon_fly_0.png']}~ +** Processing line: ~ return if $tutorial_outputs.labels.any? {|l| l == [1210, 200, state.tick_count, 255, 255, 255]}~ +** Processing line: ~ state.explain_tick_count_confirmed = true~ +** Processing line: ~~ +** Processing line: ~ queue_message "Look at the cute little dragon!~ +** Processing line: ~~ +** Processing line: ~ We can create a LABEL with ARRAYS too. Let's create a LABEL showing~ +** Processing line: ~ THE PASSAGE OF TIME, which is called TICK_COUNT.~ +** Processing line: ~~ +** Processing line: ~ outputs.labels << [1210, 200, state.tick_count, 0, 255, 0]~ +** Processing line: ~ "~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_explain_mod~ +** Processing line: ~ return unless $tutorial_outputs.labels.any? {|l| l == [1210, 200, state.tick_count, 0, 255, 0]}~ +** Processing line: ~ state.explain_mod_confirmed = true~ +** Processing line: ~ queue_message "~ +** Processing line: ~ The code: outputs.labels << [1210, 200, state.tick_count, 0, 255, 0]~ +** Processing line: ~ Does the following:~ +** Processing line: ~ 1. GET the place where labels go: outputs.labels~ +** Processing line: ~ 2. Request that a new label be ADDED: <<~ +** Processing line: ~ 3. The DEFINITION of a LABEL is the ARRAY:~ +** Processing line: ~ [1210, 200, state.tick_count, 0, 255, 0]~ +** Processing line: ~~ +** Processing line: ~ GET ADD X Y TEXT RED GREEN BLUE~ +** Processing line: ~ | | | | | | | |~ +** Processing line: ~ | | | | | | | |~ +** Processing line: ~ outputs.labels << [1210, 200, state.tick_count, 0, 255, 0]~ +** Processing line: ~ |______________________________________________|~ +** Processing line: ~ |~ +** Processing line: ~ |~ +** Processing line: ~ ARRAY~ +** Processing line: ~~ +** Processing line: ~ Now let's do some MATH, save the result to STATE, and create a LABEL:~ +** Processing line: ~~ +** Processing line: ~ state.sprite_frame = state.tick_count.idiv(4).mod(6)~ +** Processing line: ~ outputs.labels << [1210, 170, state.sprite_frame, 0, 255, 0]~ +** Processing line: ~~ +** Processing line: ~ Type the lines above (pressing ENTER after each line).~ +** Processing line: ~ "~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_explain_string_interpolation~ +** Processing line: ~ return unless state.explain_mod_confirmed~ +** Processing line: ~ return unless state.sprite_frame == state.tick_count.idiv(4).mod(6)~ +** Processing line: ~ return unless $tutorial_outputs.labels.any? {|l| l == [1210, 170, state.sprite_frame, 0, 255, 0]}~ +** Processing line: ~~ +** Processing line: ~ queue_message "Here is what the mathematical computation you just typed does:~ +** Processing line: ~~ +** Processing line: ~ 1. Create an item of STATE named SPRITE_FRAME: state.sprite_frame =~ +** Processing line: ~ 2. Set this SPRITE_FRAME to the PASSAGE OF TIME (tick_count),~ +** Processing line: ~ DIVIDED EVENLY (idiv) into 4,~ +** Processing line: ~ and then compute the REMAINDER (mod) of 6.~ +** Processing line: ~~ +** Processing line: ~ STATE SPRITE_FRAME PASSAGE OF HOW LONG HOW MANY~ +** Processing line: ~ | | TIME TO SHOW IMAGES~ +** Processing line: ~ | | | AN IMAGE TO FLIP THROUGH~ +** Processing line: ~ | | | | |~ +** Processing line: ~ state.sprite_frame = state.tick_count.idiv(4).mod(6)~ +** Processing line: ~ | |~ +** Processing line: ~ | +- REMAINDER OF DIVIDE~ +** Processing line: ~ DIVIDE EVENLY~ +** Processing line: ~ (NO DECIMALS)~ +** Processing line: ~~ +** Processing line: ~ With the information above, we can animate a SPRITE~ +** Processing line: ~ using STRING INTERPOLATION: \#{}~ +** Processing line: ~ which creates a unique SPRITE_PATH:~ +** Processing line: ~~ +** Processing line: ~ state.sprite_path = \"sprites/dragon_fly_\#{state.sprite_frame}.png\"~ +** Processing line: ~ outputs.labels << [910, 330, \"path: \#{state.sprite_path}\", 0, 255, 0]~ +** Processing line: ~ outputs.sprites << [910, 330, 370, 370, state.sprite_path]~ +** Processing line: ~~ +** Processing line: ~ Type the lines above (pressing ENTER after each line).~ +** Processing line: ~ "~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_reprint_on_error~ +** Processing line: ~ return unless console.last_command_errored~ +** Processing line: ~ puts $gtk.state.messages.last~ +** Processing line: ~ puts "\nWhoops! Try again."~ +** Processing line: ~ console.last_command_errored = false~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_evals~ +** Processing line: ~ state.evals ||= []~ +** Processing line: ~ if console.last_command && (console.last_command.start_with?("outputs.") || console.last_command.start_with?("state."))~ +** Processing line: ~ state.evals << console.last_command~ +** Processing line: ~ console.last_command = nil~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ state.evals.each do |l|~ +** Processing line: ~ Kernel.eval l~ +** Processing line: ~ end~ +** Processing line: ~ rescue Exception => e~ +** Processing line: ~ state.evals = state.evals[0..-2]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $tutorial_outputs ||= TutorialOutputs.new~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ $gtk.log_level = :off~ +** Processing line: ~ defaults~ +** Processing line: ~ console.show~ +** Processing line: ~ $tutorial_outputs.clear~ +** Processing line: ~ $tutorial_outputs.solids << [900, 37, 480, 700, 0, 0, 0, 255]~ +** Processing line: ~ $tutorial_outputs.borders << [900, 37, 380, 683, 255, 255, 255]~ +** Processing line: ~ tick_evals~ +** Processing line: ~ $tutorial_outputs.tick~ +** Processing line: ~ tick_intro~ +** Processing line: ~ tick_hello_dragonruby~ +** Processing line: ~ tick_reset_button~ +** Processing line: ~ tick_explain_solid~ +** Processing line: ~ tick_explain_solid_blue~ +** Processing line: ~ tick_reprint_on_error~ +** Processing line: ~ tick_explain_tick_count~ +** Processing line: ~ tick_explain_mod~ +** Processing line: ~ tick_explain_string_interpolation~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def console~ +** Processing line: ~ $gtk.console~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def queue_message message~ +** Processing line: ~ $gtk.args.state.messages ||= []~ +** Processing line: ~ return if $gtk.args.state.messages.include? message~ +** Processing line: ~ $gtk.args.state.messages << message~ +** Processing line: ~ last_three = [$gtk.console.log[-3], $gtk.console.log[-2], $gtk.console.log[-1]].reject_nil~ +** Processing line: ~ $gtk.console.log.clear~ +** Processing line: ~ puts seperator~ +** Processing line: ~ $gtk.console.log += last_three~ +** Processing line: ~ puts seperator~ +** Processing line: ~ puts message~ +** Processing line: ~ puts seperator~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def console_has? message~ +** Processing line: ~ console.log.map(&:upcase).include? "#{message.upcase}\n"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def restart_tutorial~ +** Processing line: ~ $tutorial_outputs.clear~ +** Processing line: ~ $gtk.console.log.clear~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~ puts "Starting the tutorial over!"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def state~ +** Processing line: ~ $gtk.args.state~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def inputs~ +** Processing line: ~ $gtk.args.inputs~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def outputs~ +** Processing line: ~ $tutorial_outputs~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - printing.txt~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - printing.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: ~Learn Ruby Optional - Intermediate Ruby Primer - printing.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/00_learn_ruby_optional/00_intermediate_ruby_primer/app/01_printing.txt~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Commenting Code~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #~ +** Processing line: ~ # Prefixing text with a pound sign (#) is how you comment code in Ruby. Example:~ +** Processing line: ~ #~ +** Processing line: ~ # I am commented code. And so are the lines above.~ +** Processing line: ~ #~ +** Processing line: ~ # I you want more than a quick primer on Ruby, check out https://poignant.guide/. It's~ +** Processing line: ~ # an entertaining read. Otherwise, go to the next txt file.~ +** Processing line: ~ #~ +** Processing line: ~ # Follow along by visiting:~ +** Processing line: ~ # https://s3.amazonaws.com/s3.dragonruby.org/dragonruby-gtk-intermediate.mp4~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Printing to the Console:~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #~ +** Processing line: ~ # Every time you save repl.rb file, DragonRuby runs the code within it. Copy this text~ +** Processing line: ~ # to repl.rb and save to see Hello World printed to the console.~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts '* RUBY PRIMER: Printing to the console using the ~puts~ function.'~ +** Processing line: ~ puts '===='~ +** Processing line: ~ puts '======'~ +** Processing line: ~ puts '================================'~ +** Processing line: ~ puts 'Hello World'~ +** Processing line: ~ puts '================================'~ +** Processing line: ~ puts '======'~ +** Processing line: ~ puts '===='~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - strings.txt~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - strings.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: ~Learn Ruby Optional - Intermediate Ruby Primer - strings.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/00_learn_ruby_optional/00_intermediate_ruby_primer/app/02_strings.txt~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Strings~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #~ +** Processing line: ~ # Here is how you work with strings in Ruby. Take the text~ +** Processing line: ~ # in this file and paste it into repl.rb and save:~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts '* RUBY PRIMER: strings'~ +** 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: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - numbers.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: ~Learn Ruby Optional - Intermediate Ruby Primer - numbers.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/00_learn_ruby_optional/00_intermediate_ruby_primer/app/03_numbers.txt~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Numerics~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #~ +** Processing line: ~ # Here is how you work with numbers in Ruby. Take the text~ +** Processing line: ~ # in this file and paste it into repl.rb and save:~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts '* RUBY PRIMER: Fixnum and Floats'~ +** 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: ~ puts ''~ +** Processing line: ~~ +** 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: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - booleans.txt~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - booleans.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: ~Learn Ruby Optional - Intermediate Ruby Primer - booleans.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/00_learn_ruby_optional/00_intermediate_ruby_primer/app/04_booleans.txt~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Booleans~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #~ +** Processing line: ~ # Here is how you work with numbers in Ruby. Take the text~ +** Processing line: ~ # in this file and paste it into repl.rb and save:~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts '* RUBY PRIMER: TrueClass, FalseClass, NilClass (truthy / falsey values)'~ +** Processing line: ~ puts "Anything that *isn't* false or nil is true."~ +** Processing line: ~~ +** 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: ~~ +** Processing line: ~ d = false~ +** Processing line: ~ puts "The value if d is #{d}. The type for d is #{d.class}."~ +** Processing line: ~~ +** Processing line: ~ if !d~ +** Processing line: ~ puts "This if statement ran because d is falsey, using the not operator (!)."~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ e = nil~ +** Processing line: ~ puts "Nil is also considered falsey. The value of e is: #{e} (a blank string when printed). Which is of type #{e.class}."~ +** Processing line: ~~ +** Processing line: ~ if !e~ +** Processing line: ~ puts "This if statement ran because e is nil and the if statement applied the NOT operator. !e yields a type of #{(!e).class}."~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - conditionals.txt~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - conditionals.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: ~Learn Ruby Optional - Intermediate Ruby Primer - conditionals.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/00_learn_ruby_optional/00_intermediate_ruby_primer/app/05_conditionals.txt~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Conditionals~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #~ +** Processing line: ~ # Here is how you create conditionals in Ruby. Take the text~ +** Processing line: ~ # in this file and paste it into repl.rb and save:~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "* RUBY PRIMER: Conditionals"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # if~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: 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: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # if/else~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: if/else statement"~ +** Processing line: ~ i_am_false = false~ +** 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: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # if/elsif/else~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: if/elsif/else statement"~ +** Processing line: ~ i_am_false = false~ +** Processing line: ~ i_am_true = true~ +** 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: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # case~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO case statement"~ +** Processing line: ~ i_am_one = 1 # change this value to see different results~ +** Processing line: ~~ +** Processing line: ~ case i_am_one~ +** Processing line: ~ when 10~ +** Processing line: ~ puts "the value of i_am_one is 10"~ +** Processing line: ~ when 9~ +** Processing line: ~ puts "the value of i_am_one is 9"~ +** Processing line: ~ when 5~ +** Processing line: ~ puts "the value of i_am_one is 5"~ +** Processing line: ~ when 1~ +** Processing line: ~ puts "the value of i_am_one is 1"~ +** Processing line: ~ else~ +** Processing line: ~ puts "Value wasn't cased."~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # comparison operators~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: Different types of comparisons"~ +** Processing line: ~ if 4 == 4~ +** Processing line: ~ puts "4 equals 4 (==)"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if 4 != 3~ +** Processing line: ~ puts "4 does not equal 3 (!=)"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if 3 < 4~ +** Processing line: ~ puts "3 is less than 4 (<)"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if 4 > 3~ +** Processing line: ~ puts "4 is greater than 3 (>)"~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # and/or conditionals~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: AND, OR operator (&&, ||)"~ +** Processing line: ~ if (4 > 3) || (3 < 4) || false~ +** Processing line: ~ puts "print this if 4 is greater than 3 OR 3 is less than 4 OR false is true (||)"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if (4 > 3) && (3 < 4)~ +** Processing line: ~ puts "print this if 4 is greater than 3 AND 3 is less than 4 (&&)"~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - looping.txt~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - looping.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: ~Learn Ruby Optional - Intermediate Ruby Primer - looping.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/00_learn_ruby_optional/00_intermediate_ruby_primer/app/06_looping.txt~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Looping~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #~ +** Processing line: ~ # Looping looks a whole lot different than other languages.~ +** Processing line: ~ # But it's pretty awesome when you get used to it.~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "* RUBY PRIMER: Loops"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # times~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: ~Numeric#times~ (for loop)"~ +** Processing line: ~ 3.times do |i|~ +** Processing line: ~ puts i~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # foreach~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: ~Array#each~ (for each loop)"~ +** Processing line: ~ array = ["a", "b", "c", "d"]~ +** Processing line: ~ array.each do |char|~ +** Processing line: ~ puts char~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ puts "** INFO: ~Array#each_with_index~ (for each loop)"~ +** Processing line: ~ array = ["a", "b", "c", "d"]~ +** Processing line: ~ array.each do |char, i|~ +** Processing line: ~ puts "index #{i}: #{char}"~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # ranges~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: range block exclusive (three dots)"~ +** Processing line: ~ (0...3).each do |i|~ +** Processing line: ~ puts i~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ puts "** INFO: range block inclusive (two dots)"~ +** Processing line: ~ (0..3).each do |i|~ +** Processing line: ~ puts i~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - functions.txt~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - functions.txt~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~4. ~samples/03_rendering_sprites~: This set of samples shows you all the different ways to render sprites (including how to use a sprite sheet).~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/03_rendering_sprites~: This set of samples shows you all the different ways to render sprites (including how to use a sprite sheet).~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - functions.txt~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~4. ~samples/04_physics_and_collision~: This set of samples shows how to do various types of collisions and physics.~ -- LI detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/07_functions.txt~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Functions~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ # The last statement of a function is implictly returned. Parenthesis for functions~ +** Processing line: ~ # are optional as long as the statement can be envaluated disambiguously.~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "* RUBY PRIMER: Functions"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Functions single parameter~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "* INFO: Function with one parameter"~ +** Processing line: ~~ +** Processing line: ~ # function definition~ +** Processing line: ~ def add_one_to n~ +** Processing line: ~ n + 1~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Parenthesis are optional in Ruby as long as the~ +** Processing line: ~ # parsing is disambiguous. Here are a couple of variations.~ +** Processing line: ~ # Generally speaking, don't put parenthesis is you don't have to.~ +** Processing line: ~~ +** Processing line: ~ # Conventional Usage of Parenthesis.~ +** Processing line: ~ puts add_one_to(3)~ +** Processing line: ~~ +** Processing line: ~ # DragonRuby's recommended use of parenthesis (inner function has parenthesis).~ +** Processing line: ~ puts (add_one_to 3)~ +** Processing line: ~~ +** Processing line: ~ # Full parens.~ +** Processing line: ~ puts(add_one_to(3))~ +** Processing line: ~~ +** Processing line: ~ # Outer function has parenthesis~ +** Processing line: ~ puts(add_one_to 3)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Functions with default parameter values~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "* INFO: 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 the argument three yields: #{function_with_default_value 3}"~ +** Processing line: ~ puts "Passing no argument yields: #{function_with_default_value}"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Nil default parameter value and ||= operator.~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "* INFO: Using the OR EQUAL operator (||=)"~ +** Processing line: ~ def function_with_nil_default_with_local a = nil~ +** Processing line: ~ result = a~ +** Processing line: ~ result ||= "DEFAULT_VALUE_OF_A_IS_NIL_OR_FALSE"~ +** Processing line: ~ "value is #{result}."~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ puts "Passing 'hi' as the argument yields: #{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: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/04_physics_and_collision~: This set of samples shows how to do various types of collisions and physics.~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~5. ~samples/05_mouse~: This set of samples show more advanced usages of the mouse.~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/05_mouse~: This set of samples show more advanced usages of the mouse.~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~6. ~samples/06_save_load~: This set of samples show how to save and load game data.~ -- LI detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/08_arrays.txt~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Arrays~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ # Arrays are incredibly powerful in Ruby. Learn to use them well.~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "* RUBY PRIMER: ARRAYS"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Enumerable ranges and .to_a~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: 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: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Finding elements~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: Finding elements in an array using ~Array#find_all~."~ +** Processing line: ~ puts "Create a new array that only contains even numbers from the previous array."~ +** Processing line: ~~ +** 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: ~~ +** Processing line: ~ puts evens~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Rejecting elements~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: Removing elements in an array using ~Array#reject~."~ +** Processing line: ~ puts "Create a new array that rejects odd numbers."~ +** Processing line: ~~ +** 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: ~~ +** Processing line: ~ puts also_even~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Array transform using the map function.~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: Creating new derived values from an array using ~Array#map~."~ +** Processing line: ~ puts "Create an array that doubles every number."~ +** Processing line: ~~ +** 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: ~~ +** Processing line: ~ puts doubled~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Combining array functions.~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: Combining ~Array#find_all~ along with ~Array#map~."~ +** Processing line: ~ puts "Create an array that selects only odd numbers and then multiply those by 10."~ +** Processing line: ~~ +** 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: ~~ +** Processing line: ~ puts odd_doubled~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Product function.~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: Create all combinations of array values using ~Array#product~."~ +** Processing line: ~ puts "All two-item pairs 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: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Uniq and sort function.~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: Providing uniq values using ~Array#uniq~ and ~Array#sort~."~ +** Processing line: ~ puts "All uniq combinations of numbers regardless of order."~ +** Processing line: ~ puts "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: ~ # Example of an advanced array transform.~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: Advanced chaining. Combining ~Array's ~map~, ~find_all~, ~sort~, and ~sort_by~."~ +** Processing line: ~ puts "All unique Pythagorean Triples between 1 and 100 sorted by area of the triangle."~ +** Processing line: ~~ +** Processing line: ~ one_to_hundred = (1..100).to_a~ +** Processing line: ~~ +** 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, _|~ +** Processing line: ~ puts "(#{width}, #{height}, #{hypotenuse})"~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Example of an sorting.~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~ repl do~ +** Processing line: ~ puts "** INFO: Implementing a custom sort function that operates on the ~Hash~ datatype."~ +** Processing line: ~~ +** Processing line: ~ things_to_sort = [~ +** Processing line: ~ { type: :background, order: 1 },~ +** Processing line: ~ { type: :foreground, order: 1 },~ +** Processing line: ~ { type: :foreground, order: 2 }~ +** Processing line: ~ ]~ +** Processing line: ~ puts "*** Original array."~ +** Processing line: ~ puts things_to_sort~ +** Processing line: ~~ +** Processing line: ~ puts "*** Simple sort using key."~ +** Processing line: ~ # For a simple sort, you can use sort_by~ +** Processing line: ~ results = things_to_sort.sort_by do |hash|~ +** Processing line: ~ hash[:order]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ puts results~ +** Processing line: ~~ +** Processing line: ~ puts "*** Custom sort."~ +** Processing line: ~ puts "**** Sorting process."~ +** Processing line: ~ # for a more complicated sort, you can provide a block that returns~ +** Processing line: ~ # -1, 0, 1 for a left and right operand~ +** Processing line: ~ results = things_to_sort.sort do |l, r|~ +** Processing line: ~ sort_result = 0~ +** Processing line: ~ puts "here is l: #{l}"~ +** Processing line: ~ puts "here is r: #{r || "nil"}"~ +** Processing line: ~ # if either value is nil/false return 0~ +** Processing line: ~ if !l || !r~ +** Processing line: ~ sort_result = 0~ +** Processing line: ~ # if the type of "left" is background and the~ +** Processing line: ~ # type of "right" is foreground, then return~ +** Processing line: ~ # -1 (which means "left" is less than "right"~ +** Processing line: ~ elsif l[:type] == :background && r[:type] == :foreground~ +** Processing line: ~ sort_result = -1~ +** Processing line: ~ # if the type of "left" is foreground and the~ +** Processing line: ~ # type of "right" is background, then return~ +** Processing line: ~ # 1 (which means "left" is greater than "right"~ +** Processing line: ~ elsif l[:type] == :foreground && r[:type] == :background~ +** Processing line: ~ sort_result = 1~ +** Processing line: ~ # if "left" and "right"'s type are the same, then~ +** Processing line: ~ # use the order as the tie breaker~ +** Processing line: ~ elsif l[:order] < r[:order]~ +** Processing line: ~ sort_result = -1~ +** Processing line: ~ elsif l[:order] > r[:order]~ +** Processing line: ~ sort_result = 1~ +** Processing line: ~ # returning 0 means both values are equal~ +** Processing line: ~ else~ +** Processing line: ~ sort_result = 0~ +** Processing line: ~ end~ +** Processing line: ~ sort_result~ +** Processing line: ~ end.to_a~ +** Processing line: ~~ +** Processing line: ~ puts "**** Sort result."~ +** Processing line: ~ puts results~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # Api documention for Array that is worth commiting to memory because arrays are so~ +** Processing line: ~ # awesome in Ruby: https://docs.ruby-lang.org/en/2.0.0/Array.html~ +** Processing line: ~ # ====================================================================================~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Learn Ruby Optional - Intermediate Ruby Primer - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/06_save_load~: This set of samples show how to save and load game data.~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - main.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~7. ~samples/07_advanced_rendering~: This set of samples show how to programmatically render sprites using render targets.~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/07_advanced_rendering~: This set of samples show how to programmatically render sprites using render targets.~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - main.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~8. ~samples/08_tweening_lerping_easing_functions~: This set of samples show how to perform animations.~ -- LI detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.labels << [640, 380, "Open repl.rb in the text editor of your choice and follow the document.", 0, 1]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Rendering Basics - Labels - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/08_tweening_lerping_easing_functions~: This set of samples show how to perform animations.~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Basics - Labels - main.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~9. ~samples/09_performance~: This set of samples show how to handle performance issues when a large number of sprites on the screen.~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/09_performance~: This set of samples show how to handle performance issues when a large number of sprites on the screen.~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Basics - Labels - main.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~10. ~samples/10_advanced_debugging~: This set of samples show how advanced debugging techniques and testing techniques.~ -- LI detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/01_rendering_basics/01_labels/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.labels: An array. Values in this array generate labels~ +** Processing line: ~ the screen.~ +** Processing line: ~ - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual~ +** Processing line: ~ 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).~ +** Processing line: ~ - Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction~ +** Processing line: ~ by adding or subracting.~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # Labels are used to represent text elements in DragonRuby~ +** Processing line: ~~ +** Processing line: ~ # An example of creating a label is:~ +** Processing line: ~ # args.outputs.labels << [320, 640, "Example", 3, 1, 255, 0, 0, 200, manaspace.ttf]~ +** Processing line: ~~ +** Processing line: ~ # The code above does the following:~ +** Processing line: ~ # 1. GET the place where labels go: args.outputs.labels~ +** Processing line: ~ # 2. Request a new LABEL be ADDED: <<~ +** Processing line: ~ # 3. The DEFINITION of a SOLID is the ARRAY:~ +** Processing line: ~ # [320, 640, "Example", 3, 1, 255, 0, 0, 200, manaspace.ttf]~ +** Processing line: ~ # [ X , Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # The tick method is called by DragonRuby every frame~ +** Processing line: ~ # args contains all the information regarding the game.~ +** Processing line: ~ def tick args~ +** Processing line: ~ tick_instructions args, "Sample app shows different version of label sizes and alignments. And how to use hashes instead of arrays."~ +** Processing line: ~ # Here are some examples of simple labels, with the minimum number of parameters~ +** Processing line: ~ # Note that the default values for the other parameters are 0, except for Alpha which is 255 and Font Style which is the default font~ +** Processing line: ~ args.outputs.labels << [400, 620, "Here is a label with just an x, y, and text"]~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << [args.grid.left.shift_right(5), args.grid.top.shift_down(5), "This is a label located at the top left."]~ +** Processing line: ~ args.outputs.labels << [args.grid.left.shift_right(5), args.grid.bottom.shift_up(30), "This is a label located at the bottom left."]~ +** Processing line: ~ args.outputs.labels << [args.grid.right.shift_left(420), args.grid.top.shift_down(5), "This is a label located at the top right."]~ +** Processing line: ~ args.outputs.labels << [args.grid.right.shift_left(440), args.grid.bottom.shift_up(30), "This is a label located at the bottom right."]~ +** Processing line: ~~ +** Processing line: ~ # Demonstration of the Size Parameter~ +** Processing line: ~ args.outputs.labels << [175 + 150, 610 - 50, "Smaller label.", -2]~ +** Processing line: ~ args.outputs.labels << [175 + 150, 580 - 50, "Small label.", -1]~ +** Processing line: ~ args.outputs.labels << [175 + 150, 550 - 50, "Medium label.", 0]~ +** Processing line: ~ args.outputs.labels << [175 + 150, 520 - 50, "Large label.", 1]~ +** Processing line: ~ args.outputs.labels << [175 + 150, 490 - 50, "Larger label.", 2]~ +** Processing line: ~~ +** Processing line: ~ # Demonstration of the Align Parameter~ +** Processing line: ~ args.outputs.labels << [260 + 150, 345 - 50, "Left aligned.", 0, 2]~ +** Processing line: ~ args.outputs.labels << [260 + 150, 325 - 50, "Center aligned.", 0, 1]~ +** Processing line: ~ args.outputs.labels << [260 + 150, 305 - 50, "Right aligned.", 0, 0]~ +** Processing line: ~~ +** Processing line: ~ # Demonstration of the RGBA parameters~ +** Processing line: ~ args.outputs.labels << [600 + 150, 590 - 50, "Red Label.", 0, 0, 255, 0, 0]~ +** Processing line: ~ args.outputs.labels << [600 + 150, 570 - 50, "Green Label.", 0, 0, 0, 255, 0]~ +** Processing line: ~ args.outputs.labels << [600 + 150, 550 - 50, "Blue Label.", 0, 0, 0, 0, 255]~ +** Processing line: ~ args.outputs.labels << [600 + 150, 530 - 50, "Faded Label.", 0, 0, 0, 0, 0, 128]~ +** Processing line: ~~ +** Processing line: ~ # Demonstration of the Font parameter~ +** Processing line: ~ # In order to use a font of your choice, add its ttf file to the project folder, where the app folder is~ +** Processing line: ~ args.outputs.labels << [690 + 150, 330 - 20, "Custom font (Array)", 0, 1, 125, 0, 200, 255, "manaspc.ttf" ]~ +** Processing line: ~ args.outputs.primitives << { x: 690 + 150,~ +** Processing line: ~ y: 330 - 50,~ +** Processing line: ~ text: "Custom font (Hash)",~ +** Processing line: ~ size_enum: 0,~ +** Processing line: ~ alignment_enum: 1,~ +** Processing line: ~ r: 125,~ +** Processing line: ~ g: 0,~ +** Processing line: ~ b: 200,~ +** Processing line: ~ a: 255,~ +** 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~ +** Processing line: ~~ +** Processing line: ~ args.outputs.primitives << { x: 690 + 150,~ +** Processing line: ~ y: 330 - 110,~ +** Processing line: ~ text: "Custom font (.primitives Hash)",~ +** Processing line: ~ size_enum: 0,~ +** Processing line: ~ alignment_enum: 1,~ +** Processing line: ~ r: 125,~ +** Processing line: ~ g: 0,~ +** Processing line: ~ b: 200,~ +** Processing line: ~ a: 255,~ +** Processing line: ~ font: "manaspc.ttf" }.label~ +** 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.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: ~*** Rendering Basics - Lines - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/10_advanced_debugging~: This set of samples show how advanced debugging techniques and testing techniques.~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Basics - Lines - main.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~11. ~samples/11_http~: This set of samples show how use http.~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ ~samples/11_http~: This set of samples show how use http.~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Basics - Lines - main.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. ** Processing line: ~~ -** Processing line: ~** Sample Games~ -- H2 detected. +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/01_rendering_basics/02_lines/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.lines: An array. Values in this array generate lines on~ +** Processing line: ~ the screen.~ +** Processing line: ~ - args.state.tick_count: This property contains an integer value that~ +** Processing line: ~ represents the current frame. GTK renders at 60 FPS. A value of 0~ +** Processing line: ~ for args.state.tick_count represents the initial load of the game.~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # The parameters required for lines are:~ +** Processing line: ~ # 1. The initial point (x, y)~ +** Processing line: ~ # 2. The end point (x2, y2)~ +** Processing line: ~ # 3. The rgba values for the color and transparency (r, g, b, a)~ +** Processing line: ~~ +** Processing line: ~ # An example of creating a line would be:~ +** Processing line: ~ # args.outputs.lines << [100, 100, 300, 300, 255, 0, 255, 255]~ +** Processing line: ~~ +** Processing line: ~ # This would create a line from (100, 100) to (300, 300)~ +** Processing line: ~ # The RGB code (255, 0, 255) would determine its color, a purple~ +** Processing line: ~ # It would have an Alpha value of 255, making it completely opaque~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ tick_instructions args, "Sample app shows how to create lines."~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << [480, 620, "Lines (x, y, x2, y2, r, g, b, a)"]~ +** Processing line: ~~ +** Processing line: ~ # Some simple lines~ +** Processing line: ~ args.outputs.lines << [380, 450, 675, 450]~ +** Processing line: ~ args.outputs.lines << [380, 410, 875, 410]~ +** Processing line: ~~ +** Processing line: ~ # These examples utilize args.state.tick_count to change the length of the lines over time~ +** Processing line: ~ # args.state.tick_count is the ticks that have occurred in the game~ +** Processing line: ~ # This is accomplished by making either the starting or ending point based on the args.state.tick_count~ +** Processing line: ~ args.outputs.lines << [380, 370, 875, 370, args.state.tick_count % 255, 0, 0, 255]~ +** Processing line: ~ args.outputs.lines << [380, 330 - args.state.tick_count % 25, 875, 330, 0, 0, 0, 255]~ +** Processing line: ~ args.outputs.lines << [380 + args.state.tick_count % 400, 290, 875, 290, 0, 0, 0, 255]~ +** 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.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: ~*** Rendering Basics - Solids Borders - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Basics - Solids Borders - 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 - Solids Borders - 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/03_solids_borders/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.solids: An array. Values in this array generate~ +** Processing line: ~ solid/filled rectangles on the screen.~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # Rects are outputted in DragonRuby as rectangles~ +** Processing line: ~ # If filled in, they are solids~ +** Processing line: ~ # If hollow, they are borders~ +** Processing line: ~~ +** Processing line: ~ # Solids are added to args.outputs.solids~ +** Processing line: ~ # Borders are added to args.outputs.borders~ +** Processing line: ~~ +** Processing line: ~ # The parameters required for rects are:~ +** Processing line: ~ # 1. The upper right corner (x, y)~ +** Processing line: ~ # 2. The width (w)~ +** Processing line: ~ # 3. The height (h)~ +** Processing line: ~ # 4. The rgba values for the color and transparency (r, g, b, a)~ +** Processing line: ~~ +** Processing line: ~ # Here is an example of a rect definition:~ +** Processing line: ~ # [100, 100, 400, 500, 0, 255, 0, 180]~ +** Processing line: ~~ +** Processing line: ~ # The example would create a rect from (100, 100)~ +** Processing line: ~ # Extending 400 pixels across the x axis~ +** Processing line: ~ # and 500 pixels across the y axis~ +** Processing line: ~ # The rect would be green (0, 255, 0)~ +** Processing line: ~ # and mostly opaque with some transparency (180)~ +** Processing line: ~~ +** Processing line: ~ # Whether the rect would be filled or not depends on if~ +** Processing line: ~ # it is added to args.outputs.solids or args.outputs.borders~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ tick_instructions args, "Sample app shows how to create solid squares."~ +** Processing line: ~ args.outputs.labels << [460, 600, "Solids (x, y, w, h, r, g, b, a)"]~ +** Processing line: ~ args.outputs.solids << [470, 520, 50, 50]~ +** Processing line: ~ args.outputs.solids << [530, 520, 50, 50, 0, 0, 0]~ +** Processing line: ~ args.outputs.solids << [590, 520, 50, 50, 255, 0, 0]~ +** Processing line: ~ args.outputs.solids << [650, 520, 50, 50, 255, 0, 0, 128]~ +** Processing line: ~ args.outputs.solids << [710, 520, 50, 50, 0, 0, 0, 128 + args.state.tick_count % 128]~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << [460, 400, "Borders (x, y, w, h, r, g, b, a)"]~ +** Processing line: ~ args.outputs.borders << [470, 320, 50, 50]~ +** Processing line: ~ args.outputs.borders << [530, 320, 50, 50, 0, 0, 0]~ +** Processing line: ~ args.outputs.borders << [590, 320, 50, 50, 255, 0, 0]~ +** Processing line: ~ args.outputs.borders << [650, 320, 50, 50, 255, 0, 0, 128]~ +** Processing line: ~ args.outputs.borders << [710, 320, 50, 50, 0, 0, 0, 128 + args.state.tick_count % 128]~ +** 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.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: ~*** Rendering Basics - Sprites - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Basics - Sprites - 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 - Sprites - 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/04_sprites/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.sprites: An array. Values in this array generate~ +** Processing line: ~ sprites on the screen. The location of the sprite is assumed to~ +** Processing line: ~ be under the mygame/ directory (the exception being dragonruby.png).~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # For all other display outputs, Sprites are your solution~ +** Processing line: ~ # Sprites import images and display them with a certain rectangular area~ +** Processing line: ~ # The image can be of any usual format and should be located within the folder,~ +** Processing line: ~ # similar to additional fonts.~ +** Processing line: ~~ +** Processing line: ~ # Sprites have the following parameters~ +** Processing line: ~ # Rectangular area (x, y, width, height)~ +** Processing line: ~ # The image (path)~ +** Processing line: ~ # Rotation (angle)~ +** Processing line: ~ # Alpha (a)~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ tick_instructions args, "Sample app shows how to render a sprite. Set its alpha, and rotate it."~ +** Processing line: ~ args.outputs.labels << [460, 600, "Sprites (x, y, w, h, path, angle, a)"]~ +** Processing line: ~ args.outputs.sprites << [460, 470, 128, 101, 'dragonruby.png']~ +** Processing line: ~ args.outputs.sprites << [610, 470, 128, 101, 'dragonruby.png', args.state.tick_count % 360]~ +** Processing line: ~ args.outputs.sprites << [760, 470, 128, 101, 'dragonruby.png', 0, args.state.tick_count % 255]~ +** 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.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: ~*** Rendering Basics - Sounds - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Basics - Sounds - 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 - Sounds - 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/05_sounds/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs Listing that haven't been encountered in previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - sample: Chooses random element from array.~ +** Processing line: ~ In this sample app, the target note is set by taking a sample from the collection~ +** Processing line: ~ of available notes.~ +** Processing line: ~~ +** Processing line: ~ Reminders:~ +** Processing line: ~~ +** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # This sample app allows users to test their musical skills by matching the piano sound that plays in each~ +** Processing line: ~ # level to the correct note.~ +** Processing line: ~~ +** Processing line: ~ # Runs all the methods necessary for the game to function properly.~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.labels << [640, 360, "Click anywhere to play a random sound.", 0, 1]~ +** Processing line: ~ args.state.notes ||= [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4]~ +** Processing line: ~~ +** Processing line: ~ if args.inputs.mouse.click~ +** Processing line: ~ # Play a sound by adding a string to args.outputs.sounds~ +** Processing line: ~ args.outputs.sounds << "sounds/#{args.state.notes.sample}.wav" # sound of target note is output~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- 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. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Sample Games~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Keyboard - 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: ~Sample Games~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Keyboard - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ -** Processing line: ~There are samples that contain the path ~samples/99_*~. The sample apps that are prefixed with ~99_~ show non-trivial implemementations for a real game:~ -- P detected. +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/02_input_basics/01_keyboard/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - args.inputs.keyboard.key_up.KEY: The value of the properties will be set~ +** Processing line: ~ to the frame that the key_up event occurred (the frame correlates~ +** Processing line: ~ to args.state.tick_count). Otherwise the value will be nil. For a~ +** Processing line: ~ full listing of keys, take a look at mygame/documentation/06-keyboard.md.~ +** Processing line: ~ - args.state.PROPERTY: The state property on args is a dynamic~ +** Processing line: ~ structure. You can define ANY property here with ANY type of~ +** Processing line: ~ arbitrary nesting. Properties defined on args.state will be retained~ +** Processing line: ~ across frames. If you attempt access a property that doesn't exist~ +** Processing line: ~ on args.state, it will simply return nil (no exception will be thrown).~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # Along with outputs, inputs are also an essential part of video game development~ +** Processing line: ~ # DragonRuby can take input from keyboards, mouse, and controllers.~ +** Processing line: ~ # This sample app will cover keyboard input.~ +** Processing line: ~~ +** Processing line: ~ # args.inputs.keyboard.key_up.a will check to see if the a key has been pressed~ +** Processing line: ~ # This will work with the other keys as well~ +** Processing line: ~~ +** Processing line: ~~ +** 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: ~~ +** 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~ +** Processing line: ~ args.state.h_pressed_at = args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # This code simplifies to if args.state.h_pressed_at has not been initialized, set it to false~ +** 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: ~ else~ +** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 4), "\"h\" has never been pressed.", small_font]~ +** 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: ~ # 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: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Don't worry about understanding the code within this method just yet.~ +** Processing line: ~ # This method shows you the help text within the game.~ +** Processing line: ~ def tick_help_text args~ +** Processing line: ~ return unless args.state.h_pressed_at~ +** Processing line: ~~ +** Processing line: ~ args.state.key_value_history ||= {}~ +** Processing line: ~ args.state.key_down_value_history ||= {}~ +** Processing line: ~ args.state.key_held_value_history ||= {}~ +** Processing line: ~ args.state.key_up_value_history ||= {}~ +** Processing line: ~~ +** Processing line: ~ if (args.inputs.keyboard.key_down.truthy_keys.length > 0 ||~ +** Processing line: ~ args.inputs.keyboard.key_held.truthy_keys.length > 0 ||~ +** Processing line: ~ args.inputs.keyboard.key_up.truthy_keys.length > 0)~ +** Processing line: ~ args.state.help_available = true~ +** Processing line: ~ args.state.no_activity_debounce = nil~ +** Processing line: ~ else~ +** Processing line: ~ args.state.no_activity_debounce ||= 5.seconds~ +** Processing line: ~ args.state.no_activity_debounce -= 1~ +** Processing line: ~ if args.state.no_activity_debounce <= 0~ +** Processing line: ~ args.state.help_available = false~ +** Processing line: ~ args.state.key_value_history = {}~ +** Processing line: ~ args.state.key_down_value_history = {}~ +** Processing line: ~ args.state.key_held_value_history = {}~ +** Processing line: ~ args.state.key_up_value_history = {}~ +** 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: ~~ +** 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: ~~ +** Processing line: ~ fill_history args, :key_value_history, :down_or_held, nil~ +** Processing line: ~ fill_history args, :key_down_value_history, :down, :key_down~ +** Processing line: ~ fill_history args, :key_held_value_history, :held, :key_held~ +** Processing line: ~ fill_history args, :key_up_value_history, :up, :key_up~ +** Processing line: ~~ +** Processing line: ~ render_help_labels args, :key_value_history, :down_or_held, nil, 10~ +** Processing line: ~ render_help_labels args, :key_down_value_history, :down, :key_down, 330~ +** Processing line: ~ render_help_labels args, :key_held_value_history, :held, :key_held, 650~ +** Processing line: ~ render_help_labels args, :key_up_value_history, :up, :key_up, 990~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def fill_history args, history_key, state_key, keyboard_method~ +** Processing line: ~ fill_single_history args, history_key, state_key, keyboard_method, :raw_key~ +** Processing line: ~ fill_single_history args, history_key, state_key, keyboard_method, :char~ +** Processing line: ~ args.inputs.keyboard.keys[state_key].each do |key_name|~ +** Processing line: ~ fill_single_history args, history_key, state_key, keyboard_method, key_name~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def fill_single_history args, history_key, state_key, keyboard_method, key_name~ +** Processing line: ~ current_value = args.inputs.keyboard.send(key_name)~ +** Processing line: ~ if keyboard_method~ +** Processing line: ~ current_value = args.inputs.keyboard.send(keyboard_method).send(key_name)~ +** Processing line: ~ end~ +** Processing line: ~ args.state.as_hash[history_key][key_name] ||= []~ +** Processing line: ~ args.state.as_hash[history_key][key_name] << current_value~ +** Processing line: ~ args.state.as_hash[history_key][key_name] = args.state.as_hash[history_key][key_name].reverse.uniq.take(3).reverse~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render_help_labels args, history_key, state_key, keyboard_method, x~ +** Processing line: ~ idx = 8~ +** Processing line: ~ args.outputs.labels << args.state~ +** Processing line: ~ .as_hash[history_key]~ +** Processing line: ~ .keys~ +** Processing line: ~ .reverse~ +** Processing line: ~ .map~ +** Processing line: ~ .with_index do |k, i|~ +** Processing line: ~ v = args.state.as_hash[history_key][k]~ +** Processing line: ~ current_value = args.inputs.keyboard.send(k)~ +** Processing line: ~ if keyboard_method~ +** Processing line: ~ current_value = args.inputs.keyboard.send(keyboard_method).send(k)~ +** 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: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** 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.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: ~*** Input Basics - Mouse - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~There are samples that contain the path ~samples/99_*~. The sample apps that are prefixed with ~99_~ show non-trivial implemementations for a real game:~ -- Line's tilde count is: 4 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Mouse - main.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~1. 3D Cube: Shows how to do faux 3D in DragonRuby.~ -- OL start detected. -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ 3D Cube: Shows how to do faux 3D in DragonRuby.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Mouse - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~2. Dueling Starships: A two player top-down versus game where each player controls a ship.~ -- LI detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/02_input_basics/02_mouse/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs that haven't been encountered in a previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ +** Processing line: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ +** Processing line: ~ - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in.~ +** Processing line: ~ - args.inputs.mouse.click.point.created_at_elapsed: How many frames have passed~ +** Processing line: ~ since the click event.~ +** Processing line: ~~ +** Processing line: ~ Reminder:~ +** Processing line: ~~ +** Processing line: ~ - args.state.PROPERTY: The state property on args is a dynamic~ +** Processing line: ~ structure. You can define ANY property here with ANY type of~ +** Processing line: ~ arbitrary nesting. Properties defined on args.state will be retained~ +** Processing line: ~ across frames. If you attempt access a property that doesn't exist~ +** Processing line: ~ on args.state, it will simply return nil (no exception will be thrown).~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # This code demonstrates DragonRuby mouse input~ +** Processing line: ~~ +** Processing line: ~ # To see if the a mouse click occurred~ +** Processing line: ~ # Use args.inputs.mouse.click~ +** Processing line: ~ # Which returns a boolean~ +** Processing line: ~~ +** Processing line: ~ # To see where a mouse click occurred~ +** Processing line: ~ # Use args.inputs.mouse.click.point.x AND~ +** Processing line: ~ # args.inputs.mouse.click.point.y~ +** Processing line: ~~ +** Processing line: ~ # To see which frame the click occurred~ +** Processing line: ~ # Use args.inputs.mouse.click.created_at~ +** Processing line: ~~ +** Processing line: ~ # To see how many frames its been since the click occurred~ +** Processing line: ~ # Use args.inputs.mouse.click.creat_at_elapsed~ +** Processing line: ~~ +** Processing line: ~ # Saving the click in args.state can be quite useful~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ tick_instructions args, "Sample app shows how mouse events are registered and how to measure elapsed time."~ +** Processing line: ~ x = 460~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 11, "Mouse input: args.inputs.mouse")~ +** Processing line: ~~ +** Processing line: ~ if args.inputs.mouse.click~ +** Processing line: ~ args.state.last_mouse_click = args.inputs.mouse.click~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if args.state.last_mouse_click~ +** Processing line: ~ click = args.state.last_mouse_click~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 12, "Mouse click happened at: #{click.created_at}")~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 13, "Mouse clicked #{click.created_at_elapsed} ticks ago")~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 14, "Mouse click location: #{click.point.x}, #{click.point.y}")~ +** Processing line: ~ else~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 12, "Mouse click has not occurred yet.")~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 13, "Please click mouse.")~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def small_label args, x, row, message~ +** 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: ~ 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: ~ 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.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: ~*** Input Basics - Mouse Point To Rect - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Dueling Starships: A two player top-down versus game where each player controls a ship.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Mouse Point To Rect - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~3. Flappy Dragon: DragonRuby's clone of Flappy Bird.~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Flappy Dragon: DragonRuby's clone of Flappy Bird.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Mouse Point To Rect - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~4. Pong: A simple implementation of the game Pong.~ -- LI detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/02_input_basics/03_mouse_point_to_rect/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs that haven't been encountered in a previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - args.outputus.borders: An array. Values in this array will be rendered as~ +** Processing line: ~ unfilled rectangles on the screen.~ +** Processing line: ~ - ARRAY#inside_rect?: An array with at least two values is considered a point. An array~ +** Processing line: ~ with at least four values is considered a rect. The inside_rect? function returns true~ +** Processing line: ~ or false depending on if the point is inside the rect.~ +** Processing line: ~~ +** Processing line: ~ ```~ +** Processing line: ~ # Point: x: 100, y: 100~ +** Processing line: ~ # Rect: x: 0, y: 0, w: 500, h: 500~ +** Processing line: ~ # Result: true~ +** Processing line: ~~ +** Processing line: ~ [100, 100].inside_rect? [0, 0, 500, 500]~ +** Processing line: ~ ```~ +** Processing line: ~~ +** Processing line: ~ ```~ +** Processing line: ~ # Point: x: 100, y: 100~ +** Processing line: ~ # Rect: x: 300, y: 300, w: 100, h: 100~ +** Processing line: ~ # Result: false~ +** Processing line: ~~ +** Processing line: ~ [100, 100].inside_rect? [300, 300, 100, 100]~ +** Processing line: ~ ```~ +** Processing line: ~~ +** Processing line: ~ - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in.~ +** Processing line: ~ - args.inputs.mouse.click.point.created_at_elapsed: How many frames have passed~ +** Processing line: ~ since the click event.~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # To determine whether a point is in a rect~ +** Processing line: ~ # Use point.inside_rect? rect~ +** Processing line: ~~ +** Processing line: ~ # This is useful to determine if a click occurred in a rect~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ tick_instructions args, "Sample app shows how to determing if a click happened inside a rectangle."~ +** Processing line: ~~ +** Processing line: ~ x = 460~ +** 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: ~ args.outputs.borders << box~ +** Processing line: ~~ +** Processing line: ~ # Saves the most recent click into args.state~ +** Processing line: ~ # Unlike the other components of args,~ +** Processing line: ~ # args.state does not reset every tick.~ +** Processing line: ~ if args.inputs.mouse.click~ +** Processing line: ~ args.state.last_mouse_click = args.inputs.mouse.click~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if args.state.last_mouse_click~ +** Processing line: ~ if args.state.last_mouse_click.point.inside_rect? box~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 16, "Mouse click happened *inside* the box.")~ +** Processing line: ~ else~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 16, "Mouse click happened *outside* the box.")~ +** Processing line: ~ end~ +** Processing line: ~ else~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 16, "Mouse click has not occurred yet.")~ +** Processing line: ~ end~ +** 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: ~ 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: ~ 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.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: ~*** Input Basics - Mouse Rect To Rect - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Pong: A simple implementation of the game Pong.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Mouse Rect To Rect - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~5. Snakemoji: The classic game of Snake but with all of the code written using emojis (sometimes you just have to have a little fun).~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Snakemoji: The classic game of Snake but with all of the code written using emojis (sometimes you just have to have a little fun).~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Mouse Rect To Rect - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~6. Solar System: A simulation of our solar system.~ -- LI detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/02_input_basics/04_mouse_rect_to_rect/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs that haven't been encountered in a previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.borders: An array. Values in this array will be rendered as~ +** Processing line: ~ unfilled rectangles on the screen.~ +** Processing line: ~ - ARRAY#intersect_rect?: An array with at least four values is~ +** Processing line: ~ considered a rect. The intersect_rect? function returns true~ +** Processing line: ~ or false depending on if the two rectangles intersect.~ +** Processing line: ~~ +** Processing line: ~ ```~ +** Processing line: ~ # Rect One: x: 100, y: 100, w: 100, h: 100~ +** Processing line: ~ # Rect Two: x: 0, y: 0, w: 500, h: 500~ +** Processing line: ~ # Result: true~ +** Processing line: ~~ +** Processing line: ~ [100, 100, 100, 100].intersect_rect? [0, 0, 500, 500]~ +** Processing line: ~ ```~ +** Processing line: ~~ +** Processing line: ~ ```~ +** Processing line: ~ # Rect One: x: 100, y: 100, w: 10, h: 10~ +** Processing line: ~ # Rect Two: x: 500, y: 500, w: 10, h: 10~ +** Processing line: ~ # Result: false~ +** Processing line: ~~ +** Processing line: ~ [100, 100, 10, 10].intersect_rect? [500, 500, 10, 10]~ +** Processing line: ~ ```~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # Similarly, whether rects intersect can be found through~ +** Processing line: ~ # rect1.intersect_rect? rect2~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ tick_instructions args, "Sample app shows how to determine if two rectangles intersect."~ +** Processing line: ~ x = 460~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 3, "Click anywhere on the screen")~ +** Processing line: ~ # red_box = [460, 250, 355, 90, 170, 0, 0]~ +** Processing line: ~ # args.outputs.borders << red_box~ +** Processing line: ~~ +** Processing line: ~ # args.state.box_collision_one and args.state.box_collision_two~ +** Processing line: ~ # Are given values of a solid when they should be rendered~ +** 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: ~ 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: ~ else~ +** Processing line: ~ args.state.box_collision_one = nil~ +** Processing line: ~ args.state.box_collision_two = nil~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if args.state.box_collision_one~ +** Processing line: ~ args.outputs.solids << args.state.box_collision_one~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if args.state.box_collision_two~ +** Processing line: ~ args.outputs.solids << args.state.box_collision_two~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if args.state.box_collision_one && args.state.box_collision_two~ +** Processing line: ~ if args.state.box_collision_one.intersect_rect? args.state.box_collision_two~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 4, 'The boxes intersect.')~ +** Processing line: ~ else~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 4, 'The boxes do not intersect.')~ +** Processing line: ~ end~ +** Processing line: ~ else~ +** Processing line: ~ args.outputs.labels << small_label(args, x, 4, '--')~ +** Processing line: ~ end~ +** 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: ~ 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: ~ 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.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: ~*** Input Basics - Controller - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Solar System: A simulation of our solar system.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Controller - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~7. Crafting Starting Point: A starting point for those that want to build a crafting game.~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Crafting Starting Point: A starting point for those that want to build a crafting game.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Controller - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~8. Dev Tools: A set of sample apps that show how you can extend DragonRuby's Console, starting point for a tile editor, and a starting point for a paint app.~ -- LI detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/02_input_basics/05_controller/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - args.inputs.controller_one.key_held.KEY: Will check to see if a specific key~ +** Processing line: ~ is being held down on the controller.~ +** Processing line: ~ If there is more than one controller being used, they can be differentiated by~ +** Processing line: ~ using names like controller_one and controller_two.~ +** Processing line: ~~ +** Processing line: ~ For a full listing of buttons, take a look at mygame/documentation/08-controllers.md.~ +** Processing line: ~~ +** Processing line: ~ Reminder:~ +** Processing line: ~~ +** Processing line: ~ - args.state.PROPERTY: The state property on args is a dynamic~ +** Processing line: ~ structure. You can define ANY property here with ANY type of~ +** Processing line: ~ arbitrary nesting. Properties defined on args.state will be retained~ +** Processing line: ~ across frames. If you attempt to access a property that doesn't exist~ +** Processing line: ~ on args.state, it will simply return nil (no exception will be thrown).~ +** Processing line: ~~ +** Processing line: ~ In this sample app, args.state.BUTTONS is an array that stores the buttons of the controller.~ +** Processing line: ~ The parameters of a button are:~ +** Processing line: ~ 1. the position (x, y)~ +** Processing line: ~ 2. the input key held on the controller~ +** Processing line: ~ 3. the text or name of the button~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # This sample app provides a visual demonstration of a standard controller, including~ +** Processing line: ~ # the placement and function of all buttons.~ +** Processing line: ~~ +** Processing line: ~ class ControllerDemo~ +** Processing line: ~ attr_accessor :inputs, :state, :outputs~ +** Processing line: ~~ +** Processing line: ~ # Calls the methods necessary for the app to run successfully.~ +** Processing line: ~ def tick~ +** Processing line: ~ process_inputs~ +** Processing line: ~ render~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Starts with an empty collection of buttons.~ +** Processing line: ~ # Adds buttons that are on the controller to the collection.~ +** 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: ~ 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: ~~ +** Processing line: ~ if 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: ~ 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: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $controller_demo = ControllerDemo.new~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ tick_instructions args, "Sample app shows how controller input is handled. You'll need to connect a USB controller."~ +** Processing line: ~ $controller_demo.inputs = args.inputs~ +** Processing line: ~ $controller_demo.state = args.state~ +** Processing line: ~ $controller_demo.outputs = args.outputs~ +** Processing line: ~ $controller_demo.tick~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Resets the app.~ +** Processing line: ~ def r~ +** Processing line: ~ $gtk.reset~ +** 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.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: ~*** Input Basics - Touch - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Dev Tools: A set of sample apps that show how you can extend DragonRuby's Console, starting point for a tile editor, and a starting point for a paint app.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Touch - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~9. LOWREZ: Sample apps that show how to render at different resolutions.~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ LOWREZ: Sample apps that show how to render at different resolutions.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Input Basics - Touch - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~10. RPG: Various sample apps that show how to create narrative, topdown, tactical grid-based, and roguelike RPGs.~ -- LI detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/02_input_basics/06_touch/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.background_color = [ 0, 0, 0 ]~ +** Processing line: ~ args.outputs.primitives << [640, 700, "Touch your screen.", 5, 1, 255, 255, 255].label~ +** Processing line: ~~ +** Processing line: ~ # If you don't want to get fancy, you can just look for finger_one~ +** Processing line: ~ # (and _two, if you like), which are assigned in the order new touches hit~ +** Processing line: ~ # the screen. If not nil, they are touching right now, and are just~ +** Processing line: ~ # references to specific items in the args.input.touch hash.~ +** Processing line: ~ # If finger_one lifts off, it will become nil, but finger_two, if it was~ +** Processing line: ~ # touching, remains until it also lifts off. When all fingers lift off, the~ +** 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: ~ 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: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Here's the more flexible interface: this will report as many simultaneous~ +** Processing line: ~ # touches as the system can handle, but it's a little more effort to track~ +** Processing line: ~ # them. Each item in the args.input.touch hash has a unique key (an~ +** Processing line: ~ # incrementing integer) that exists until the finger lifts off. You can~ +** Processing line: ~ # tell which order the touches happened globally by the key value, or~ +** Processing line: ~ # by the touch[id].touch_order field, which resets to zero each time all~ +** Processing line: ~ # touches have lifted.~ +** Processing line: ~~ +** Processing line: ~ args.state.colors ||= [~ +** Processing line: ~ 0xFF0000, 0x00FF00, 0x1010FF, 0xFFFF00, 0xFF00FF, 0x00FFFF, 0xFFFFFF~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ size = 100~ +** Processing line: ~ args.inputs.touch.each { |k,v|~ +** Processing line: ~ color = args.state.colors[v.touch_order % 7]~ +** 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: ~ }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Rendering Sprites - Animation Using Separate Pngs - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ RPG: Various sample apps that show how to create narrative, topdown, tactical grid-based, and roguelike RPGs.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Sprites - Animation Using Separate Pngs - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~11. Platformers: Various sample apps that show how to create different kinds of physics/collision based platformers.~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Platformers: Various sample apps that show how to create different kinds of physics/collision based platformers.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Sprites - Animation Using Separate Pngs - 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/03_rendering_sprites/01_animation_using_separate_pngs/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ Reminders:~ +** Processing line: ~~ +** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +** Processing line: ~~ +** Processing line: ~ In this sample app, we're using string interpolation to iterate through images in the~ +** Processing line: ~ sprites folder using their image path names.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.sprites: An array. Values in this array generate sprites on the screen.~ +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, IMAGE PATH]~ +** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.labels: An array. Values in the array generate labels on the screen.~ +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +** Processing line: ~~ +** Processing line: ~ - args.inputs.keyboard.key_down.KEY: Determines if a key is in the down state, or pressed.~ +** Processing line: ~ Stores the frame that key was pressed on.~ +** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # This sample app demonstrates how sprite animations work.~ +** Processing line: ~ # There are two sprites that animate forever and one sprite~ +** Processing line: ~ # that *only* animates when you press the "f" key on the keyboard.~ +** Processing line: ~~ +** Processing line: ~ # This is the entry point to your game. The `tick` method~ +** Processing line: ~ # executes at 60 frames per second. There are two methods~ +** 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: ~ looping_animation args~ +** Processing line: ~ one_time_animation args~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # This function shows how to animate a sprite that loops forever.~ +** Processing line: ~ def looping_animation args~ +** Processing line: ~ # Here we define a few local variables that will be sent~ +** Processing line: ~ # into the magic function that gives us the correct sprite image~ +** Processing line: ~ # over time. There are four things we need in order to figure~ +** Processing line: ~ # out which sprite to show.~ +** Processing line: ~~ +** Processing line: ~ # 1. When to start the animation.~ +** Processing line: ~ start_looping_at = 0~ +** Processing line: ~~ +** Processing line: ~ # 2. The number of pngs that represent the full animation.~ +** Processing line: ~ number_of_sprites = 6~ +** Processing line: ~~ +** Processing line: ~ # 3. How long to show each png.~ +** Processing line: ~ number_of_frames_to_show_each_sprite = 4~ +** Processing line: ~~ +** Processing line: ~ # 4. Whether the animation should loop once, or forever.~ +** Processing line: ~ does_sprite_loop = true~ +** Processing line: ~~ +** Processing line: ~ # With the variables defined above, we can get a number~ +** Processing line: ~ # which represents the sprite to show by calling the `frame_index` function.~ +** Processing line: ~ # In this case the number will be between 0, and 5 (you can see the sprites~ +** Processing line: ~ # in the ./sprites directory).~ +** Processing line: ~ sprite_index = start_looping_at.frame_index number_of_sprites,~ +** Processing line: ~ number_of_frames_to_show_each_sprite,~ +** 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: ~~ +** 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: ~ 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: ~~ +** 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: ~~ +** 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.~ +** Processing line: ~~ +** Processing line: ~ # Also IMPORTANT, you'll notice that the value of when to start looping~ +** Processing line: ~ # is stored in `args.state`. This construct's values are retained across~ +** Processing line: ~ # executions of the `tick` method.~ +** Processing line: ~ args.state.start_looping_at = args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # These are the same local variables that were defined~ +** Processing line: ~ # for the `looping_animation` function.~ +** Processing line: ~ number_of_sprites = 6~ +** Processing line: ~ number_of_frames_to_show_each_sprite = 4~ +** Processing line: ~~ +** Processing line: ~ # Except this sprite does not loop again. If the animation time has passed,~ +** Processing line: ~ # then the frame_index function returns nil.~ +** Processing line: ~ does_sprite_loop = false~ +** Processing line: ~~ +** Processing line: ~ sprite_index = args.state~ +** Processing line: ~ .start_looping_at~ +** Processing line: ~ .frame_index number_of_sprites,~ +** Processing line: ~ number_of_frames_to_show_each_sprite,~ +** Processing line: ~ does_sprite_loop~ +** Processing line: ~~ +** Processing line: ~ # This line sets the frame index to zero, if~ +** Processing line: ~ # the animation duration has passed (frame_index returned nil).~ +** Processing line: ~~ +** Processing line: ~ # Remeber: we are not looping forever here.~ +** 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: ~~ +** 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~ +** 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.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: ~* Deploying To Itch.io~ -- H1 detected. +** Processing line: ~*** Rendering Sprites - Animation Using Sprite Sheet - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Deploying To Itch.io~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Sprites - Animation Using Sprite Sheet - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~~ -** Processing line: ~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 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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!~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Sprites - Animation Using Sprite Sheet - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ -** Processing line: ~** Creating Your Game Landing Page~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Creating Your Game Landing Page~ -- 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: ~Creating Your Game Landing Page~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/03_rendering_sprites/02_animation_using_sprite_sheet/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.player.x ||= 100~ +** Processing line: ~ args.state.player.y ||= 100~ +** Processing line: ~ args.state.player.w ||= 64~ +** Processing line: ~ args.state.player.h ||= 64~ +** Processing line: ~ args.state.player.direction ||= 1~ ** Processing line: ~~ -** Processing line: ~Log into Itch.io and go to [[https://itch.io/game/new]].~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Log into Itch.io and go to [[https://itch.io/game/new]].~ -- Line's tilde count is: 0 -- Line contains link marker: true -- LINK detected. +** Processing line: ~ args.state.player.is_moving = false~ ** Processing line: ~~ -** Processing line: ~- Title: Give your game a Title. This value represents your `gametitle`.~ -- UL start detected. -- LI detected. +** Processing line: ~ # get the keyboard input and set player properties~ +** Processing line: ~ if args.inputs.keyboard.right~ +** Processing line: ~ args.state.player.x += 3~ +** Processing line: ~ args.state.player.direction = 1~ +** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ elsif args.inputs.keyboard.left~ +** Processing line: ~ args.state.player.x -= 3~ +** Processing line: ~ args.state.player.direction = -1~ +** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if args.inputs.keyboard.up~ +** Processing line: ~ args.state.player.y += 1~ +** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ elsif args.inputs.keyboard.down~ +** Processing line: ~ args.state.player.y -= 1~ +** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # if no arrow keys are being pressed, set the player as not moving~ +** Processing line: ~ if !args.inputs.keyboard.directional_vector~ +** Processing line: ~ args.state.player.started_running_at = nil~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # wrap player around the stage~ +** Processing line: ~ if args.state.player.x > 1280~ +** Processing line: ~ args.state.player.x = -64~ +** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ elsif args.state.player.x < -64~ +** Processing line: ~ args.state.player.x = 1280~ +** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if args.state.player.y > 720~ +** Processing line: ~ args.state.player.y = -64~ +** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ elsif args.state.player.y < -64~ +** Processing line: ~ args.state.player.y = 720~ +** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # render player as standing or running~ +** Processing line: ~ if args.state.player.started_running_at~ +** Processing line: ~ args.outputs.sprites << running_sprite(args)~ +** Processing line: ~ else~ +** Processing line: ~ args.outputs.sprites << standing_sprite(args)~ +** Processing line: ~ end~ +** Processing line: ~ args.outputs.labels << [30, 700, "Use arrow keys to move around."]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def standing_sprite args~ +** Processing line: ~ {~ +** Processing line: ~ 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/horizontal-stand.png",~ +** Processing line: ~ flip_horizontally: args.state.player.direction > 0~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def running_sprite args~ +** Processing line: ~ if !args.state.player.started_running_at~ +** Processing line: ~ tile_index = 0~ +** Processing line: ~ else~ +** Processing line: ~ how_many_frames_in_sprite_sheet = 6~ +** Processing line: ~ how_many_ticks_to_hold_each_frame = 3~ +** Processing line: ~ should_the_index_repeat = true~ +** Processing line: ~ tile_index = args.state~ +** Processing line: ~ .player~ +** Processing line: ~ .started_running_at~ +** Processing line: ~ .frame_index(how_many_frames_in_sprite_sheet,~ +** Processing line: ~ how_many_ticks_to_hold_each_frame,~ +** Processing line: ~ should_the_index_repeat)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ {~ +** Processing line: ~ 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/horizontal-run.png',~ +** Processing line: ~ tile_x: 0 + (tile_index * args.state.player.w),~ +** Processing line: ~ tile_y: 0,~ +** Processing line: ~ tile_w: args.state.player.w,~ +** Processing line: ~ tile_h: args.state.player.h,~ +** Processing line: ~ flip_horizontally: args.state.player.direction > 0,~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Rendering Sprites - Animation States - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Title: Give your game a Title. This value represents your `gametitle`.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Sprites - Animation States - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~- Project URL: Set your project url. This value represents your `gameid`.~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Project URL: Set your project url. This value represents your `gameid`.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Sprites - Animation States - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~- Classification: Keep this as Game.~ -- LI detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/03_rendering_sprites/03_animation_states/app/main.rb~ +** Processing line: ~ class Game~ +** Processing line: ~ attr_gtk~ +** Processing line: ~~ +** Processing line: ~ def defaults~ +** Processing line: ~ state.show_debug_layer = true if state.tick_count == 0~ +** Processing line: ~ player.tile_size = 64~ +** Processing line: ~ player.speed = 3~ +** Processing line: ~ player.slash_frames = 15~ +** Processing line: ~ player.x ||= 50~ +** Processing line: ~ player.y ||= 400~ +** Processing line: ~ player.dir_x ||= 1~ +** Processing line: ~ player.dir_y ||= -1~ +** Processing line: ~ player.is_moving ||= false~ +** Processing line: ~ state.watch_list ||= {}~ +** Processing line: ~ state.enemies ||= []~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def add_enemy~ +** Processing line: ~ state.enemies << { x: 1200 * rand, y: 600 * rand, w: 64, h: 64 }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def sprite_horizontal_run~ +** Processing line: ~ tile_index = 0.frame_index(6, 3, true)~ +** Processing line: ~ tile_index = 0 if !player.is_moving~ +** Processing line: ~~ +** Processing line: ~ {~ +** Processing line: ~ x: player.x,~ +** Processing line: ~ y: player.y,~ +** Processing line: ~ w: player.tile_size,~ +** Processing line: ~ h: player.tile_size,~ +** Processing line: ~ path: 'sprites/horizontal-run.png',~ +** Processing line: ~ tile_x: 0 + (tile_index * player.tile_size),~ +** Processing line: ~ tile_y: 0,~ +** Processing line: ~ tile_w: player.tile_size,~ +** Processing line: ~ tile_h: player.tile_size,~ +** Processing line: ~ flip_horizontally: player.dir_x > 0,~ +** Processing line: ~ # a: 40~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def sprite_horizontal_stand~ +** Processing line: ~ {~ +** Processing line: ~ x: player.x,~ +** Processing line: ~ y: player.y,~ +** Processing line: ~ w: player.tile_size,~ +** Processing line: ~ h: player.tile_size,~ +** Processing line: ~ path: 'sprites/horizontal-stand.png',~ +** Processing line: ~ flip_horizontally: player.dir_x > 0,~ +** Processing line: ~ # a: 40~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def sprite_horizontal_slash~ +** Processing line: ~ tile_index = player.slash_at.frame_index(5, player.slash_frames.idiv(5), false) || 0~ +** Processing line: ~~ +** Processing line: ~ {~ +** Processing line: ~ x: player.x - 41.25,~ +** Processing line: ~ y: player.y - 41.25,~ +** Processing line: ~ w: 165,~ +** Processing line: ~ h: 165,~ +** Processing line: ~ path: 'sprites/horizontal-slash.png',~ +** Processing line: ~ tile_x: 0 + (tile_index * 128),~ +** Processing line: ~ tile_y: 0,~ +** Processing line: ~ tile_w: 128,~ +** Processing line: ~ tile_h: 128,~ +** Processing line: ~ flip_horizontally: player.dir_x > 0~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render_player~ +** Processing line: ~ if player.slash_at~ +** Processing line: ~ outputs.sprites << sprite_horizontal_slash~ +** Processing line: ~ elsif player.is_moving~ +** Processing line: ~ outputs.sprites << sprite_horizontal_run~ +** Processing line: ~ else~ +** Processing line: ~ outputs.sprites << sprite_horizontal_stand~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render_enemies~ +** Processing line: ~ outputs.borders << state.enemies~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render_debug_layer~ +** Processing line: ~ return if !state.show_debug_layer~ +** Processing line: ~ outputs.labels << state.watch_list.map.with_index do |(k, v), i|~ +** Processing line: ~ [30, 710 - i * 28, "#{k}: #{v || "(nil)"}"]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ outputs.borders << player.slash_collision_rect~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def slash_initiate?~ +** Processing line: ~ # buffalo usb controller has a button and b button swapped lol~ +** Processing line: ~ inputs.controller_one.key_down.a || inputs.keyboard.key_down.j~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def input~ +** Processing line: ~ # player movement~ +** Processing line: ~ if slash_complete? && (vector = inputs.directional_vector)~ +** Processing line: ~ player.x += vector.x * player.speed~ +** Processing line: ~ player.y += vector.y * player.speed~ +** Processing line: ~ end~ +** Processing line: ~ player.slash_at = slash_initiate? if slash_initiate?~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def calc_movement~ +** Processing line: ~ # movement~ +** Processing line: ~ if vector = inputs.directional_vector~ +** Processing line: ~ state.debug_label = vector~ +** Processing line: ~ player.dir_x = vector.x~ +** Processing line: ~ player.dir_y = vector.y~ +** Processing line: ~ player.is_moving = true~ +** Processing line: ~ else~ +** Processing line: ~ state.debug_label = vector~ +** Processing line: ~ player.is_moving = false~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def calc_slash~ +** Processing line: ~ # re-calc the location of the swords collision box~ +** Processing line: ~ if player.dir_x.positive?~ +** Processing line: ~ player.slash_collision_rect = [player.x + player.tile_size,~ +** Processing line: ~ player.y + player.tile_size.half - 10,~ +** Processing line: ~ 40, 20]~ +** Processing line: ~ else~ +** Processing line: ~ player.slash_collision_rect = [player.x - 32 - 8,~ +** Processing line: ~ player.y + player.tile_size.half - 10,~ +** Processing line: ~ 40, 20]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # recalc sword's slash state~ +** Processing line: ~ player.slash_at = nil if slash_complete?~ +** Processing line: ~~ +** Processing line: ~ # determine collision if the sword is at it's point of damaging~ +** Processing line: ~ return unless slash_can_damage?~ +** Processing line: ~~ +** Processing line: ~ state.enemies.reject! { |e| e.intersect_rect? player.slash_collision_rect }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def slash_complete?~ +** Processing line: ~ !player.slash_at || player.slash_at.elapsed?(player.slash_frames)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def slash_can_damage?~ +** Processing line: ~ # damage occurs half way into the slash animation~ +** Processing line: ~ return false if slash_complete?~ +** Processing line: ~ return false if (player.slash_at + player.slash_frames.idiv(2)) != state.tick_count~ +** Processing line: ~ return true~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def calc~ +** Processing line: ~ # generate an enemy if there aren't any on the screen~ +** Processing line: ~ add_enemy if state.enemies.length == 0~ +** Processing line: ~ calc_movement~ +** Processing line: ~ calc_slash~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # source is at http://github.com/amirrajan/dragonruby-link-to-the-past~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ render_enemies~ +** Processing line: ~ render_player~ +** Processing line: ~ outputs.labels << [30, 30, "Gamepad: D-Pad to move. B button to attack."]~ +** Processing line: ~ outputs.labels << [30, 52, "Keyboard: WASD/Arrow keys to move. J to attack."]~ +** Processing line: ~ render_debug_layer~ +** Processing line: ~ input~ +** Processing line: ~ calc~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def player~ +** Processing line: ~ state.player~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $game = Game.new~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ $game.args = args~ +** Processing line: ~ $game.tick~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Rendering Sprites - Color And Rotation - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Classification: Keep this as Game.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Sprites - Color And Rotation - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~- Kind of Project: Select HTML from the drop down list. Don't worry, - the HTML project type _also supports binary downloads_.~ -- LI detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Kind of Project: Select HTML from the drop down list. Don't worry, - the HTML project type _also supports binary downloads_.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rendering Sprites - Color And Rotation - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~- Uploads: Skip this section for now.~ -- LI detected. +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/03_rendering_sprites/04_color_and_rotation/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - merge: Returns a hash containing the contents of two original hashes.~ +** Processing line: ~ Merge does not allow duplicate keys, so the value of a repeated key~ +** Processing line: ~ will be overwritten.~ +** Processing line: ~~ +** Processing line: ~ For example, if we had two hashes~ +** Processing line: ~ h1 = { "a" => 1, "b" => 2}~ +** Processing line: ~ h2 = { "b" => 3, "c" => 3}~ +** Processing line: ~ and we called the command~ +** Processing line: ~ h1.merge(h2)~ +** Processing line: ~ the result would the following hash~ +** Processing line: ~ { "a" => 1, "b" => 3, "c" => 3}.~ +** Processing line: ~~ +** Processing line: ~ Reminders:~ +** Processing line: ~~ +** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ +** Processing line: ~ using their keys.~ +** Processing line: ~ In this sample app, we're using a hash to create a sprite.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE]~ +** Processing line: ~ Before continuing with this sample app, it is HIGHLY recommended that you look~ +** Processing line: ~ at mygame/documentation/05-sprites.md.~ +** Processing line: ~~ +** Processing line: ~ - args.inputs.keyboard.key_held.KEY: Determines if a key is being pressed.~ +** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ +** Processing line: ~~ +** Processing line: ~ - args.inputs.controller_one: Takes input from the controller based on what key is pressed.~ +** Processing line: ~ For more information about the controller, go to mygame/documentation/08-controllers.md.~ +** Processing line: ~~ +** Processing line: ~ - num1.lesser(num2): Finds the lower value of the given options.~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # This sample app shows a car moving across the screen. It loops back around if it exceeds the dimensions of the screen,~ +** Processing line: ~ # and also can be moved in different directions through keyboard input from the user.~ +** Processing line: ~~ +** Processing line: ~ # Calls the methods necessary for the game to run successfully.~ +** Processing line: ~ def tick args~ +** Processing line: ~ default args~ +** Processing line: ~ render args.grid, args.outputs, args.state~ +** Processing line: ~ calc args.state~ +** Processing line: ~ process_inputs args~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Sets default values for the car sprite~ +** Processing line: ~ # Initialization ||= only happens in the first frame~ +** Processing line: ~ def default args~ +** Processing line: ~ args.state.sprite.width = 19~ +** Processing line: ~ args.state.sprite.height = 10~ +** Processing line: ~ args.state.sprite.scale = 4~ +** Processing line: ~ args.state.max_speed = 5~ +** Processing line: ~ args.state.x ||= 100~ +** Processing line: ~ args.state.y ||= 100~ +** Processing line: ~ args.state.speed ||= 1~ +** Processing line: ~ args.state.angle ||= 0~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Outputs sprite onto screen~ +** Processing line: ~ def render grid, outputs, state~ +** Processing line: ~ outputs.solids << [grid.rect, 70, 70, 70] # outputs gray background~ +** Processing line: ~ outputs.sprites << [destination_rect(state), # sets first four parameters of car sprite~ +** Processing line: ~ 'sprites/86.png', # image path of car~ +** Processing line: ~ state.angle,~ +** Processing line: ~ opacity, # transparency~ +** Processing line: ~ saturation,~ +** Processing line: ~ source_rect(state), # sprite sub division/tile (tile x, y, w, h)~ +** Processing line: ~ false, false, # don't flip sprites~ +** Processing line: ~ rotation_anchor]~ +** Processing line: ~~ +** Processing line: ~ # also look at the create_sprite helper method~ +** Processing line: ~ #~ +** Processing line: ~ # For example:~ +** Processing line: ~ #~ +** Processing line: ~ # dest = destination_rect(state)~ +** Processing line: ~ # source = source_rect(state),~ +** Processing line: ~ # outputs.sprites << create_sprite(~ +** Processing line: ~ # 'sprites/86.png',~ +** Processing line: ~ # x: dest.x,~ +** Processing line: ~ # y: dest.y,~ +** Processing line: ~ # w: dest.w,~ +** Processing line: ~ # h: dest.h,~ +** Processing line: ~ # angle: state.angle,~ +** Processing line: ~ # source_x: source.x,~ +** Processing line: ~ # source_y: source.y,~ +** Processing line: ~ # source_w: source.w,~ +** Processing line: ~ # source_h: source.h,~ +** Processing line: ~ # flip_h: false,~ +** Processing line: ~ # flip_v: false,~ +** Processing line: ~ # rotation_anchor_x: 0.7,~ +** Processing line: ~ # rotation_anchor_y: 0.5~ +** Processing line: ~ # )~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Creates sprite by setting values inside of a hash~ +** Processing line: ~ def create_sprite path, options = {}~ +** Processing line: ~ options = {~ +** Processing line: ~~ +** Processing line: ~ # dest x, y, w, h~ +** Processing line: ~ x: 0,~ +** Processing line: ~ y: 0,~ +** Processing line: ~ w: 100,~ +** Processing line: ~ h: 100,~ +** Processing line: ~~ +** Processing line: ~ # angle, rotation~ +** Processing line: ~ angle: 0,~ +** Processing line: ~ rotation_anchor_x: 0.5,~ +** Processing line: ~ rotation_anchor_y: 0.5,~ +** Processing line: ~~ +** Processing line: ~ # color saturation (red, green, blue), transparency~ +** Processing line: ~ r: 255,~ +** Processing line: ~ g: 255,~ +** Processing line: ~ b: 255,~ +** Processing line: ~ a: 255,~ +** Processing line: ~~ +** Processing line: ~ # source x, y, width, height~ +** Processing line: ~ source_x: 0,~ +** Processing line: ~ source_y: 0,~ +** Processing line: ~ source_w: -1,~ +** Processing line: ~ source_h: -1,~ +** Processing line: ~~ +** Processing line: ~ # flip horiztonally, flip vertically~ +** Processing line: ~ flip_h: false,~ +** Processing line: ~ flip_v: false,~ +** Processing line: ~~ +** Processing line: ~ }.merge options~ +** Processing line: ~~ +** Processing line: ~ [~ +** Processing line: ~ options[:x], options[:y], options[:w], options[:h], # dest rect keys~ +** Processing line: ~ path,~ +** Processing line: ~ options[:angle], options[:a], options[:r], options[:g], options[:b], # angle, color, alpha~ +** Processing line: ~ options[:source_x], options[:source_y], options[:source_w], options[:source_h], # source rect keys~ +** Processing line: ~ options[:flip_h], options[:flip_v], # flip~ +** Processing line: ~ options[:rotation_anchor_x], options[:rotation_anchor_y], # rotation anchor~ +** Processing line: ~ ] # hash keys contain corresponding values~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Calls the calc_pos and calc_wrap methods.~ +** Processing line: ~ def calc state~ +** Processing line: ~ calc_pos state~ +** Processing line: ~ calc_wrap state~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Changes sprite's position on screen~ +** Processing line: ~ # Vectors have magnitude and direction, so the incremented x and y values give the car direction~ +** Processing line: ~ def calc_pos state~ +** Processing line: ~ state.x += state.angle.vector_x * state.speed # increments x by product of angle's x vector and speed~ +** Processing line: ~ state.y += state.angle.vector_y * state.speed # increments y by product of angle's y vector and speed~ +** Processing line: ~ state.speed *= 1.1 # scales speed up~ +** Processing line: ~ state.speed = state.speed.lesser(state.max_speed) # speed is either current speed or max speed, whichever has a lesser value (ensures that the car doesn't go too fast or exceed the max speed)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # The screen's dimensions are 1280x720. If the car goes out of scope,~ +** Processing line: ~ # it loops back around on the screen.~ +** Processing line: ~ def calc_wrap state~ +** Processing line: ~~ +** Processing line: ~ # car returns to left side of screen if it disappears on right side of screen~ +** Processing line: ~ # sprite.width refers to tile's size, which is multipled by scale (4) to make it bigger~ +** Processing line: ~ state.x = -state.sprite.width * state.sprite.scale if state.x - 20 > 1280~ +** Processing line: ~~ +** Processing line: ~ # car wraps around to right side of screen if it disappears on the left side~ +** Processing line: ~ state.x = 1280 if state.x + state.sprite.width * state.sprite.scale + 20 < 0~ +** Processing line: ~~ +** Processing line: ~ # car wraps around to bottom of screen if it disappears at the top of the screen~ +** Processing line: ~ # if you subtract 520 pixels instead of 20 pixels, the car takes longer to reappear (try it!)~ +** Processing line: ~ state.y = 0 if state.y - 20 > 720 # if 20 pixels less than car's y position is greater than vertical scope~ +** Processing line: ~~ +** Processing line: ~ # car wraps around to top of screen if it disappears at the bottom of the screen~ +** Processing line: ~ state.y = 720 if state.y + state.sprite.height * state.sprite.scale + 20 < 0~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Changes angle of sprite based on user input from keyboard or controller~ +** Processing line: ~ def process_inputs args~ +** Processing line: ~~ +** Processing line: ~ # NOTE: increasing the angle doesn't mean that the car will continue to go~ +** Processing line: ~ # in a specific direction. The angle is increasing, which means that if the~ +** Processing line: ~ # left key was kept in the "down" state, the change in the angle would cause~ +** Processing line: ~ # the car to go in a counter-clockwise direction and form a circle (360 degrees)~ +** Processing line: ~ if args.inputs.keyboard.key_held.left # if left key is pressed~ +** Processing line: ~ args.state.angle += 2 # car's angle is incremented by 2~ +** Processing line: ~~ +** Processing line: ~ # The same applies to decreasing the angle. If the right key was kept in the~ +** Processing line: ~ # "down" state, the decreasing angle would cause the car to go in a clockwise~ +** Processing line: ~ # direction and form a circle (360 degrees)~ +** Processing line: ~ elsif args.inputs.keyboard.key_held.right # if right key is pressed~ +** Processing line: ~ args.state.angle -= 2 # car's angle is decremented by 2~ +** Processing line: ~~ +** Processing line: ~ # Input from a controller can also change the angle of the car~ +** Processing line: ~ elsif args.inputs.controller_one.left_analog_x_perc != 0~ +** Processing line: ~ args.state.angle += 2 * args.inputs.controller_one.left_analog_x_perc * -1~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # A sprite's center of rotation can be altered~ +** Processing line: ~ # Increasing either of these numbers would dramatically increase the~ +** Processing line: ~ # car's drift when it turns!~ +** Processing line: ~ def rotation_anchor~ +** Processing line: ~ [0.7, 0.5]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Sets opacity value of sprite to 255 so that it is not transparent at all~ +** Processing line: ~ # Change it to 0 and you won't be able to see the car sprite on the screen~ +** Processing line: ~ def opacity~ +** Processing line: ~ 255~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Sets the color of the sprite to white.~ +** Processing line: ~ def saturation~ +** Processing line: ~ [255, 255, 255]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Sets definition of destination_rect (used to define the car sprite)~ +** Processing line: ~ def destination_rect state~ +** Processing line: ~ [state.x, state.y,~ +** Processing line: ~ state.sprite.width * state.sprite.scale, # multiplies by 4 to set size~ +** Processing line: ~ state.sprite.height * state.sprite.scale]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Portion of a sprite (a tile)~ +** Processing line: ~ # Sub division of sprite is denoted as a rectangle directly related to original size of .png~ +** Processing line: ~ # Tile is located at bottom left corner within a 19x10 pixel rectangle (based on sprite.width, sprite.height)~ +** Processing line: ~ def source_rect state~ +** Processing line: ~ [0, 0, state.sprite.width, state.sprite.height]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Physics And Collisions - Simple - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Uploads: Skip this section for now.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Simple - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~You can fill out all the other options later.~ -- UL end detected. -- P detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You can fill out all the other options later.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Simple - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ -** Processing line: ~** Update Your Game's Metadata~ -- H2 detected. +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/04_physics_and_collisions/01_simple/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ Reminders:~ +** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # This sample app shows collisions between two boxes.~ +** Processing line: ~~ +** Processing line: ~ # Runs methods needed for game to run properly.~ +** Processing line: ~ def tick args~ +** Processing line: ~ tick_instructions args, "Sample app shows how to move a square over time and determine collision."~ +** Processing line: ~ defaults args~ +** Processing line: ~ render args~ +** Processing line: ~ calc args~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Sets default values.~ +** Processing line: ~ def defaults args~ +** Processing line: ~ # These values represent the moving box.~ +** Processing line: ~ args.state.moving_box_speed = 10~ +** Processing line: ~ args.state.moving_box_size = 100~ +** Processing line: ~ args.state.moving_box_dx ||= 1~ +** Processing line: ~ args.state.moving_box_dy ||= 1~ +** Processing line: ~ args.state.moving_box ||= [0, 0, args.state.moving_box_size, args.state.moving_box_size] # moving_box_size is set as the width and height~ +** Processing line: ~~ +** Processing line: ~ # These values represent the center box.~ +** Processing line: ~ args.state.center_box ||= [540, 260, 200, 200, 180]~ +** Processing line: ~ args.state.center_box_collision ||= false # initially no collision~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render args~ +** Processing line: ~ # If the game state denotes that a collision has occured,~ +** Processing line: ~ # render a solid square, otherwise render a border instead.~ +** Processing line: ~ if args.state.center_box_collision~ +** Processing line: ~ args.outputs.solids << args.state.center_box~ +** Processing line: ~ else~ +** Processing line: ~ args.outputs.borders << args.state.center_box~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Then render the moving box.~ +** Processing line: ~ args.outputs.solids << args.state.moving_box~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Generally in a pipeline for a game engine, you have rendering,~ +** Processing line: ~ # game simulation (calculation), and input processing.~ +** Processing line: ~ # This fuction represents the game simulation.~ +** Processing line: ~ def calc args~ +** Processing line: ~ position_moving_box args~ +** Processing line: ~ determine_collision_center_box args~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Changes the position of the moving box on the screen by multiplying the change in x (dx) and change in y (dy) by the speed,~ +** Processing line: ~ # and adding it to the current position.~ +** Processing line: ~ # dx and dy are positive if the box is moving right and up, respectively~ +** Processing line: ~ # dx and dy are negative if the box is moving left and down, respectively~ +** Processing line: ~ def position_moving_box args~ +** Processing line: ~ args.state.moving_box.x += args.state.moving_box_dx * args.state.moving_box_speed~ +** Processing line: ~ args.state.moving_box.y += args.state.moving_box_dy * args.state.moving_box_speed~ +** Processing line: ~~ +** Processing line: ~ # 1280x720 are the virtual pixels you work with (essentially 720p).~ +** Processing line: ~ screen_width = 1280~ +** Processing line: ~ screen_height = 720~ +** Processing line: ~~ +** Processing line: ~ # Position of the box is denoted by the bottom left hand corner, in~ +** Processing line: ~ # that case, we have to subtract the width of the box so that it stays~ +** Processing line: ~ # in the scene (you can try deleting the subtraction to see how it~ +** Processing line: ~ # impacts the box's movement).~ +** Processing line: ~ if args.state.moving_box.x > screen_width - args.state.moving_box_size~ +** Processing line: ~ args.state.moving_box_dx = -1 # moves left~ +** Processing line: ~ elsif args.state.moving_box.x < 0~ +** Processing line: ~ args.state.moving_box_dx = 1 # moves right~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Here, we're making sure the moving box remains within the vertical scope of the screen~ +** Processing line: ~ if args.state.moving_box.y > screen_height - args.state.moving_box_size # if the box moves too high~ +** Processing line: ~ args.state.moving_box_dy = -1 # moves down~ +** Processing line: ~ elsif args.state.moving_box.y < 0 # if the box moves too low~ +** Processing line: ~ args.state.moving_box_dy = 1 # moves up~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def determine_collision_center_box args~ +** Processing line: ~ # Collision is handled by the engine. You simply have to call the~ +** Processing line: ~ # `intersect_rect?` function.~ +** Processing line: ~ if args.state.moving_box.intersect_rect? args.state.center_box # if the two boxes intersect~ +** Processing line: ~ args.state.center_box_collision = true # then a collision happened~ +** Processing line: ~ else~ +** Processing line: ~ args.state.center_box_collision = false # otherwise, no collision happened~ +** 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.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: ~*** Physics And Collisions - Moving Objects - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Update Your Game's Metadata~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Moving Objects - 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: ~Update Your Game's Metadata~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Moving Objects - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ -** Processing line: ~Point your text editor at mygame/metadata/game_metadata.txt and make it look like this:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Point your text editor at mygame/metadata/game_metadata.txt and make it look like this:~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~NOTE: Remove the ~#~ at the beginning of each line.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~NOTE: Remove the ~#~ at the beginning of each line.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/04_physics_and_collisions/02_moving_objects/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ +** Processing line: ~ using their keys.~ +** Processing line: ~~ +** Processing line: ~ For example, if we have a "numbers" hash that stores numbers in English as the~ +** Processing line: ~ key and numbers in Spanish as the value, we'd have a hash that looks like this...~ +** Processing line: ~ numbers = { "one" => "uno", "two" => "dos", "three" => "tres" }~ +** Processing line: ~ and on it goes.~ +** Processing line: ~~ +** Processing line: ~ Now if we wanted to find the corresponding value of the "one" key, we could say~ +** Processing line: ~ puts numbers["one"]~ +** Processing line: ~ which would print "uno" to the console.~ +** Processing line: ~~ +** Processing line: ~ - num1.greater(num2): Returns the greater value.~ +** Processing line: ~ For example, if we have the command~ +** Processing line: ~ puts 4.greater(3)~ +** Processing line: ~ the number 4 would be printed to the console since it has a greater value than 3.~ +** Processing line: ~ Similar to lesser, which returns the lesser value.~ +** Processing line: ~~ +** Processing line: ~ - num1.lesser(num2): Finds the lower value of the given options.~ +** Processing line: ~ For example, in the statement~ +** Processing line: ~ a = 4.lesser(3)~ +** Processing line: ~ 3 has a lower value than 4, which means that the value of a would be set to 3,~ +** Processing line: ~ but if the statement had been~ +** Processing line: ~ a = 4.lesser(5)~ +** Processing line: ~ 4 has a lower value than 5, which means that the value of a would be set to 4.~ +** Processing line: ~~ +** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ +** Processing line: ~ For example, you can derive an array of odd numbers from an original array of~ +** Processing line: ~ numbers 1 through 10 by rejecting all elements that are even (or divisible by 2).~ +** Processing line: ~~ +** Processing line: ~ - find_all: Finds all values that satisfy specific requirements.~ +** Processing line: ~ For example, you can find all elements of a collection that are divisible by 2~ +** Processing line: ~ or find all objects that have intersected with another object.~ +** Processing line: ~~ +** Processing line: ~ - abs: Returns the absolute value.~ +** Processing line: ~ For example, the command~ +** Processing line: ~ (-30).abs~ +** Processing line: ~ would return 30 as a result.~ +** Processing line: ~~ +** Processing line: ~ - map: Ruby method used to transform data; used in arrays, hashes, and collections.~ +** Processing line: ~ Can be used to perform an action on every element of a collection, such as multiplying~ +** Processing line: ~ each element by 2 or declaring every element as a new entity.~ +** Processing line: ~~ +** Processing line: ~ Reminders:~ +** Processing line: ~~ +** Processing line: ~ - args.inputs.keyboard.KEY: Determines if a key has been pressed.~ +** Processing line: ~ For more information about the keyboard, take a look at mygame/documentation/06-keyboard.md.~ +** Processing line: ~~ +** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ +** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # Calls methods needed for game to run properly~ +** 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: ~ calc args~ +** Processing line: ~ input 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: ~ args.state.enemy.hammers ||= []~ +** Processing line: ~ args.state.enemy.hammer_queue ||= []~ +** 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.enemy.x ||= 800 # initializes enemy's properties~ +** Processing line: ~ args.state.enemy.y ||= 0~ +** Processing line: ~ args.state.enemy.w ||= 128~ +** Processing line: ~ args.state.enemy.h ||= 128~ +** Processing line: ~ args.state.enemy.dy ||= 0~ +** Processing line: ~ args.state.enemy.dx ||= 0~ +** Processing line: ~ args.state.game_over_at ||= 0~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # sets enemy, player, hammer values~ +** Processing line: ~ def fiddle args~ +** Processing line: ~ args.state.gravity = -0.3~ +** Processing line: ~ args.state.enemy_jump_power = 10 # sets enemy values~ +** Processing line: ~ args.state.enemy_jump_interval = 60~ +** Processing line: ~ args.state.hammer_throw_interval = 40 # sets hammer values~ +** Processing line: ~ args.state.hammer_launch_power_default = 5~ +** Processing line: ~ args.state.hammer_launch_power_near = 2~ +** Processing line: ~ args.state.hammer_launch_power_far = 7~ +** Processing line: ~ args.state.hammer_upward_launch_power = 15~ +** Processing line: ~ args.state.max_hammers_per_volley = 10~ +** Processing line: ~ args.state.gap_between_hammers = 10~ +** Processing line: ~ args.state.player_jump_power = 10 # sets player values~ +** Processing line: ~ args.state.player_jump_power_duration = 10~ +** Processing line: ~ args.state.player_max_run_speed = 10~ +** Processing line: ~ args.state.player_speed_slowdown_rate = 0.9~ +** Processing line: ~ args.state.player_acceleration = 1~ +** Processing line: ~ args.state.hammer_size = 32~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # outputs objects onto the screen~ +** Processing line: ~ def render args~ +** Processing line: ~ args.outputs.solids << 20.map_with_index do |i| # uses 20 squares to form bridge~ +** Processing line: ~ # sets x by multiplying 64 to index to find pixel value (places all squares side by side)~ +** Processing line: ~ # subtracts 64 from bridge_top because position is denoted by bottom left corner~ +** Processing line: ~ [i * 64, args.state.bridge_top - 64, 64, 64]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.outputs.solids << [args.state.x, args.state.y, args.state.w, args.state.h, 255, 0, 0]~ +** Processing line: ~ args.outputs.solids << [args.state.player.x, args.state.player.y, args.state.player.w, args.state.player.h, 255, 0, 0] # outputs player onto screen (red box)~ +** Processing line: ~ args.outputs.solids << [args.state.enemy.x, args.state.enemy.y, args.state.enemy.w, args.state.enemy.h, 0, 255, 0] # outputs enemy onto screen (green box)~ +** Processing line: ~ args.outputs.solids << args.state.enemy.hammers # outputs enemy's hammers onto screen~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Performs calculations to move objects on the screen~ +** Processing line: ~ def calc args~ +** Processing line: ~~ +** 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: ~~ +** Processing line: ~ args.state.enemy.x += args.state.enemy.dx # velocity; change in x increases by dx~ +** Processing line: ~ args.state.enemy.y += args.state.enemy.dy # same with y and dy~ +** Processing line: ~~ +** Processing line: ~ # ensures that the enemy never goes below the bridge~ +** Processing line: ~ args.state.enemy.y = args.state.enemy.y.greater(args.state.bridge_top)~ +** Processing line: ~~ +** Processing line: ~ # ensures that the enemy never goes too far left (outside the screen's scope)~ +** Processing line: ~ args.state.enemy.x = args.state.enemy.x.greater(0)~ +** Processing line: ~~ +** Processing line: ~ # objects that go up must come down because of gravity~ +** Processing line: ~ args.state.enemy.dy += args.state.gravity~ +** Processing line: ~~ +** Processing line: ~ args.state.enemy.y = args.state.enemy.y.greater(args.state.bridge_top)~ +** Processing line: ~~ +** Processing line: ~ #sets definition of enemy~ +** Processing line: ~ args.state.enemy.rect = [args.state.enemy.x, args.state.enemy.y, args.state.enemy.h, args.state.enemy.w]~ +** Processing line: ~~ +** Processing line: ~ if args.state.enemy.y == args.state.bridge_top # if enemy is located on the top of the bridge~ +** Processing line: ~ args.state.enemy.dy = 0 # there is no change in y~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # if 60 frames have passed and the enemy is not moving vertically~ +** Processing line: ~ if args.state.tick_count.mod_zero?(args.state.enemy_jump_interval) && args.state.enemy.dy == 0~ +** Processing line: ~ args.state.enemy.dy = args.state.enemy_jump_power # the enemy jumps up~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # if 40 frames have passed or 5 frames have passed since the game ended~ +** Processing line: ~ if args.state.tick_count.mod_zero?(args.state.hammer_throw_interval) || args.state.game_over_at.elapsed_time == 5~ +** Processing line: ~ # rand will return a number greater than or equal to 0 and less than given variable's value (since max is excluded)~ +** Processing line: ~ # that is why we're adding 1, to include the max possibility~ +** Processing line: ~ volley_dx = (rand(args.state.hammer_launch_power_default) + 1) * -1 # horizontal movement (follow order of operations)~ +** Processing line: ~~ +** Processing line: ~ # if the horizontal distance between the player and enemy is less than 128 pixels~ +** Processing line: ~ if (args.state.player.x - args.state.enemy.x).abs < 128~ +** Processing line: ~ # the change in x won't be that great since the enemy and player are closer to each other~ +** Processing line: ~ volley_dx = (rand(args.state.hammer_launch_power_near) + 1) * -1~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # if the horizontal distance between the player and enemy is greater than 300 pixels~ +** Processing line: ~ if (args.state.player.x - args.state.enemy.x).abs > 300~ +** Processing line: ~ # change in x will be more drastic since player and enemy are so far apart~ +** Processing line: ~ volley_dx = (rand(args.state.hammer_launch_power_far) + 1) * -1 # more drastic change~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ (rand(args.state.max_hammers_per_volley) + 1).map_with_index do |i|~ +** Processing line: ~ args.state.enemy.hammer_queue << { # stores hammer values in a hash~ +** Processing line: ~ x: args.state.enemy.x,~ +** Processing line: ~ w: args.state.hammer_size,~ +** Processing line: ~ h: args.state.hammer_size,~ +** Processing line: ~ dx: volley_dx, # change in horizontal position~ +** Processing line: ~ # multiplication operator takes precedence over addition operator~ +** Processing line: ~ throw_at: args.state.tick_count + i * args.state.gap_between_hammers~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # add elements from hammer_queue collection to the hammers collection by~ +** Processing line: ~ # finding all hammers that were thrown before the current frame (have already been thrown)~ +** Processing line: ~ args.state.enemy.hammers += args.state.enemy.hammer_queue.find_all do |h|~ +** Processing line: ~ h[:throw_at] < args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.state.enemy.hammers.each do |h| # sets values for all hammers in collection~ +** Processing line: ~ h[:y] ||= args.state.enemy.y + 130~ +** Processing line: ~ h[:dy] ||= args.state.hammer_upward_launch_power~ +** Processing line: ~ h[:dy] += args.state.gravity # acceleration is change in gravity~ +** Processing line: ~ h[:x] += h[:dx] # incremented by change in position~ +** Processing line: ~ h[:y] += h[:dy]~ +** Processing line: ~ h[:rect] = [h[:x], h[:y], h[:w], h[:h]] # sets definition of hammer's rect~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # reject hammers that have been thrown before current frame (have already been thrown)~ +** Processing line: ~ args.state.enemy.hammer_queue = args.state.enemy.hammer_queue.reject do |h|~ +** Processing line: ~ h[:throw_at] < args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # any hammers with a y position less than 0 are rejected from the hammers collection~ +** Processing line: ~ # since they have gone too far down (outside the scope's screen)~ +** Processing line: ~ args.state.enemy.hammers = args.state.enemy.hammers.reject { |h| h[:y] < 0 }~ +** Processing line: ~~ +** Processing line: ~ # if there are any hammers that intersect with (or hit) the player,~ +** Processing line: ~ # the reset_player method is called (so the game can start over)~ +** Processing line: ~ if args.state.enemy.hammers.any? { |h| h[:rect].intersect_rect?(args.state.player.rect) }~ +** Processing line: ~ reset_player args~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # if the enemy's rect intersects with (or hits) the player,~ +** Processing line: ~ # the reset_player method is called (so the game can start over)~ +** Processing line: ~ if args.state.enemy.rect.intersect_rect? args.state.player.rect~ +** Processing line: ~ reset_player args~ +** Processing line: ~ end~ +** 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.inputs.keyboard.space # 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~ +** 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.keyboard.left # if left key is pressed~ +** Processing line: ~ args.state.player.dx -= args.state.player_acceleration # dx decreases by acceleration (player goes left)~ +** Processing line: ~ # dx is either set to current dx or the negative max run speed (which would be -10),~ +** Processing line: ~ # whichever has a greater value~ +** Processing line: ~ args.state.player.dx = args.state.player.dx.greater(-args.state.player_max_run_speed)~ +** Processing line: ~ elsif args.inputs.keyboard.right # if right key is pressed~ +** Processing line: ~ args.state.player.dx += args.state.player_acceleration # dx increases by acceleration (player goes right)~ +** Processing line: ~ # dx is either set to current dx or max run speed (which would be 10),~ +** Processing line: ~ # whichever has a lesser value~ +** Processing line: ~ args.state.player.dx = args.state.player.dx.lesser(args.state.player_max_run_speed)~ +** Processing line: ~ else~ +** Processing line: ~ args.state.player.dx *= args.state.player_speed_slowdown_rate # dx is scaled down~ +** 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: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ devid=bob~ -** Processing line: ~ devtitle=Bob The Game Developer~ -** Processing line: ~ gameid=mygame~ -** Processing line: ~ gametitle=My Game~ -** Processing line: ~ version=0.1~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ -** Processing line: ~The ~devid~ property is the username you use to log into Itch.io. The ~devtitle~ is your name or company name (it can contain spaces). The ~gameid~ is the Project URL value. The ~gametitle~ is the name of your game (it can contain spaces). The ~version~ can be any ~major.minor~ number format.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The ~devid~ property is the username you use to log into Itch.io. The ~devtitle~ is your name or company name (it can contain spaces). The ~gameid~ is the Project URL value. The ~gametitle~ is the name of your game (it can contain spaces). The ~version~ can be any ~major.minor~ number format.~ -- Line's tilde count is: 12 -- Line contains link marker: false -- CODE detected. ** Processing line: ~~ -** Processing line: ~** Building Your Game For Distribution~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Building Your Game For Distribution~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~*** Physics And Collisions - Entities - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Building Your Game For Distribution~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Entities - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Open up the terminal and run this from the command line:~ -- P detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Open up the terminal and run this from the command line:~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Entities - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ -** Processing line: ~#+begin_src~ +** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ ./dragonruby-publish --only-package mygame~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # ./samples/04_physics_and_collisions/03_entities/app/main.rb~ +** Processing line: ~ =begin~ ** Processing line: ~~ -** Processing line: ~(if you're on Windows, don't put the "./" on the front. That's a Mac and Linux thing.)~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~(if you're on Windows, don't put the "./" on the front. That's a Mac and Linux thing.)~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~A directory called ~./build~ will be created that contains your binaries. You can upload this to Itch.io manually.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~A directory called ~./build~ will be created that contains your binaries. You can upload this to Itch.io manually.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~For the HTML version of your game after you upload it. Check the checkbox labeled "This file will be played in the browser".~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~For the HTML version of your game after you upload it. Check the checkbox labeled "This file will be played in the browser".~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~For subsequent updates you can use an automated deployment to Itch.io:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~For subsequent updates you can use an automated deployment to Itch.io:~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ Reminders:~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ ./dragonruby-publish mygame~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ - map: Ruby method used to transform data; used in arrays, hashes, and collections.~ +** Processing line: ~ Can be used to perform an action on every element of a collection, such as multiplying~ +** Processing line: ~ each element by 2 or declaring every element as a new entity.~ ** Processing line: ~~ -** Processing line: ~DragonRuby will package _and publish_ your game to itch.io! Tell your friends to go to your game's very own webpage and buy it!~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~DragonRuby will package _and publish_ your game to itch.io! Tell your friends to go to your game's very own webpage and buy it!~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~If you make changes to your game, just re-run dragonruby-publish and it'll update the downloads for you.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~If you make changes to your game, just re-run dragonruby-publish and it'll update the downloads for you.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ +** Processing line: ~ For example, you can derive an array of odd numbers from an original array of~ +** Processing line: ~ numbers 1 through 10 by rejecting all elements that are even (or divisible by 2).~ ** Processing line: ~~ +** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ +** Processing line: ~ In this sample app, new_entity is used to define the properties of enemies and bullets.~ +** Processing line: ~ (Remember, you can use state to define ANY property and it will be retained across frames.)~ ** Processing line: ~~ -** Processing line: ~* Deploying To Mobile Devices~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Deploying To Mobile Devices~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - args.outputs.labels: An array. The values generate a label on the screen.~ +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ ** Processing line: ~~ -** Processing line: ~If you have a Pro subscription, you also have the capability to deploy to mobile devices.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~If you have a Pro subscription, you also have the capability to deploy to mobile devices.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~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.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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.~ -- 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:~ -- 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:~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect.~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ > adb logcat -e mygame # you'll want to run this in a separate terminal~ -** Processing line: ~ > keytool -genkey -v -keystore mygame.keystore -alias mygame -keyalg RSA -keysize 2048 -validity 10000~ -** Processing line: ~ > apksigner sign --ks mygame.keystore mygame-android.apk~ -** Processing line: ~ > adb install mygame-android.apk~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ ** Processing line: ~~ +** Processing line: ~ =end~ ** Processing line: ~~ -** Processing line: ~* DragonRuby's Philosophy~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DragonRuby's Philosophy~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # This sample app shows enemies that contain an id value and the time they were created.~ +** Processing line: ~ # These enemies can be removed by shooting at them with bullets.~ ** 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.~ -- 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.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Calls all methods necessary for the game to function properly.~ +** Processing line: ~ def tick args~ +** Processing line: ~ tick_instructions args, "Sample app shows how to use args.state.new_entity along with collisions. CLICK to shoot a bullet."~ +** Processing line: ~ defaults args~ +** Processing line: ~ render args~ +** Processing line: ~ calc args~ +** Processing line: ~ process_inputs args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~** Challenge The Status Quo~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Challenge The Status Quo~ -- 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: ~Challenge The Status Quo~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Sets default values~ +** Processing line: ~ # Enemies and bullets start off as empty collections~ +** Processing line: ~ def defaults args~ +** Processing line: ~ args.state.enemies ||= []~ +** Processing line: ~ args.state.bullets ||= []~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~Game engines of today are in a local maximum and don't take into consideration the challenges of this day and age. Unity and GameMaker specifically rot your brain. It's not sufficient to say:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Game engines of today are in a local maximum and don't take into consideration the challenges of this day and age. Unity and GameMaker specifically rot your brain. It's not sufficient to say:~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Provides each enemy in enemies collection with rectangular border,~ +** Processing line: ~ # as well as a label showing id and when they were created~ +** Processing line: ~ def render args~ +** Processing line: ~ # When you're calling a method that takes no arguments, you can use this & syntax on map.~ +** Processing line: ~ # Numbers are being added to x and y in order to keep the text within the enemy's borders.~ +** Processing line: ~ args.outputs.borders << args.state.enemies.map(&:rect)~ +** Processing line: ~ args.outputs.labels << args.state.enemies.flat_map do |enemy|~ +** Processing line: ~ [~ +** Processing line: ~ [enemy.x + 4, enemy.y + 29, "id: #{enemy.entity_id}", -3, 0],~ +** Processing line: ~ [enemy.x + 4, enemy.y + 17, "created_at: #{enemy.created_at}", -3, 0] # frame enemy was created~ +** Processing line: ~ ]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_quote~ -- BLOCKQUOTE start detected. -** Processing line: ~But that's how we've always done it.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~But that's how we've always done it.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~#+end_quote~ -- BLOCKQUOTE end detected. +** Processing line: ~ # Outputs bullets in bullets collection as rectangular solids~ +** Processing line: ~ args.outputs.solids << args.state.bullets.map(&:rect)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~It's a hard pill to swallow, but forget blindly accepted best practices and try to figure out the underlying motivation for a specific approach to game development. Collaborate with us.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~It's a hard pill to swallow, but forget blindly accepted best practices and try to figure out the underlying motivation for a specific approach to game development. Collaborate with us.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Calls all methods necessary for performing calculations~ +** Processing line: ~ def calc args~ +** Processing line: ~ add_new_enemies_if_needed args~ +** Processing line: ~ move_bullets args~ +** Processing line: ~ calculate_collisions args~ +** Processing line: ~ remove_bullets_of_screen args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~** Continuity of Design~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Continuity of Design~ -- 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: ~Continuity of Design~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Adds enemies to the enemies collection and sets their values~ +** Processing line: ~ def add_new_enemies_if_needed args~ +** Processing line: ~ return if args.state.enemies.length >= 10 # if 10 or more enemies, enemies are not added~ +** Processing line: ~ return unless args.state.bullets.length == 0 # if user has not yet shot bullet, no enemies are added~ ** Processing line: ~~ -** Processing line: ~There is a programming idiom in software called "the pit of success". The term normalizes up front pain as a necessity in the (hopes that the investment will yield dividends "when you become successful"). This results in more "Enterprise TM" code upfront, and makes it more difficult to get started when you are new to programming.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~There is a programming idiom in software called "the pit of success". The term normalizes up front pain as a necessity in the (hopes that the investment will yield dividends "when you become successful"). This results in more "Enterprise TM" code upfront, and makes it more difficult to get started when you are new to programming.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~DragonRuby's philosophy is to provide a spectrum across the "make it fast" vs "make it right" spectrum and provide incremental, intuitive transitions between points on that spectrum. This is captured in how render primitives can be represented as tuples/arrays, hashes, open structs/entities, and then finally classes (as opposed to forcing devs to use classes upfront).~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~DragonRuby's philosophy is to provide a spectrum across the "make it fast" vs "make it right" spectrum and provide incremental, intuitive transitions between points on that spectrum. This is captured in how render primitives can be represented as tuples/arrays, hashes, open structs/entities, and then finally classes (as opposed to forcing devs to use classes upfront).~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ args.state.enemies += (10 - args.state.enemies.length).map do # adds enemies so there are 10 total~ +** Processing line: ~ args.state.new_entity(:enemy) do |e| # each enemy is declared as a new entity~ +** Processing line: ~ e.x = 640 + 500 * rand # each enemy is given random position on screen~ +** Processing line: ~ e.y = 600 * rand + 50~ +** Processing line: ~ e.rect = [e.x, e.y, 130, 30] # sets definition for enemy's rect~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~** Release Often And Soon~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Release Often And Soon~ -- 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: ~Release Often And Soon~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Moves bullets across screen~ +** Processing line: ~ # Sets definition of the bullets~ +** Processing line: ~ def move_bullets args~ +** Processing line: ~ args.state.bullets.each do |bullet| # perform action on each bullet in collection~ +** Processing line: ~ bullet.x += bullet.speed # increment x by speed (bullets fly horizontally across screen)~ ** Processing line: ~~ -** Processing line: ~The biggest mistake game devs make is spending too much time in isolation building their game. Release something, however small, and release it quickly.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The biggest mistake game devs make is spending too much time in isolation building their game. Release something, however small, and release it quickly.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Stop worrying about everything being pixel perfect. Don't wait until your game is 100% complete. Build your game publicly and iterate. Post in the #show-and-tell channel in the community Discord. You'll find a lot of support and encouragement there.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Stop worrying about everything being pixel perfect. Don't wait until your game is 100% complete. Build your game publicly and iterate. Post in the #show-and-tell channel in the community Discord. You'll find a lot of support and encouragement there.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Remember:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Remember:~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # By randomizing the value that increments bullet.y, the bullet does not fly straight up and out~ +** Processing line: ~ # of the scope of the screen. Try removing what follows bullet.speed, or changing 0.25 to 1.25 to~ +** Processing line: ~ # see what happens to the bullet's movement.~ +** Processing line: ~ bullet.y += bullet.speed.*(0.25).randomize(:ratio, :sign)~ +** Processing line: ~ bullet.rect = [bullet.x, bullet.y, bullet.size, bullet.size] # sets definition of bullet's rect~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_quote~ -- BLOCKQUOTE start detected. -** Processing line: ~Real artists ship.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Real artists ship.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~#+end_quote~ -- BLOCKQUOTE end detected. +** Processing line: ~ # Determines if a bullet hits an enemy~ +** Processing line: ~ def calculate_collisions args~ +** Processing line: ~ args.state.bullets.each do |bullet| # perform action on every bullet and enemy in collections~ +** Processing line: ~ args.state.enemies.each do |enemy|~ +** Processing line: ~ # if bullet has not exploded yet and the bullet hits an enemy~ +** Processing line: ~ if !bullet.exploded && bullet.rect.intersect_rect?(enemy.rect)~ +** Processing line: ~ bullet.exploded = true # bullet explodes~ +** Processing line: ~ enemy.dead = true # enemy is killed~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # All exploded bullets are rejected or removed from the bullets collection~ +** Processing line: ~ # and any dead enemy is rejected from the enemies collection.~ +** Processing line: ~ args.state.bullets = args.state.bullets.reject(&:exploded)~ +** Processing line: ~ args.state.enemies = args.state.enemies.reject(&:dead)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~** Sustainable And Ethical Monetization~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Sustainable And Ethical Monetization~ -- 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: ~Sustainable And Ethical Monetization~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Bullets are rejected from bullets collection once their position exceeds the width of screen~ +** Processing line: ~ def remove_bullets_of_screen args~ +** Processing line: ~ args.state.bullets = args.state.bullets.reject { |bullet| bullet.x > 1280 } # screen width is 1280~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~We all aspire to put food on the table doing what we love. Whether it is building games, writing tools to support game development, or anything in between.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~We all aspire to put food on the table doing what we love. Whether it is building games, writing tools to support game development, or anything in between.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Charge a fair amount of money for the things you create. It's expected and encouraged within the community. Give what you create away for free to those that can't afford it.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Charge a fair amount of money for the things you create. It's expected and encouraged within the community. Give what you create away for free to those that can't afford it.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Calls fire_bullet method~ +** Processing line: ~ def process_inputs args~ +** Processing line: ~ fire_bullet args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~** Sustainable And Ethical Open Source~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Sustainable And Ethical Open Source~ -- 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: ~Sustainable And Ethical Open Source~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Once mouse is clicked by the user to fire a bullet, a new bullet is added to bullets collection~ +** Processing line: ~ def fire_bullet args~ +** Processing line: ~ return unless args.inputs.mouse.click # return unless mouse is clicked~ +** Processing line: ~ args.state.bullets << args.state.new_entity(:bullet) do |bullet| # new bullet is declared a new entity~ +** Processing line: ~ bullet.y = args.inputs.mouse.click.point.y # set to the y value of where the mouse was clicked~ +** Processing line: ~ bullet.x = 0 # starts on the left side of the screen~ +** Processing line: ~ bullet.size = 10~ +** Processing line: ~ bullet.speed = 10 * rand + 2 # speed of a bullet is randomized~ +** Processing line: ~ bullet.rect = [bullet.x, bullet.y, bullet.size, bullet.size] # definition is set~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~This goes hand in hand with sustainable and ethical monetization. The current state of open source is not sustainable. There is an immense amount of contributor burnout. Users of open source expect everything to be free, and few give back. This is a problem we want to fix (we're still trying to figure out the best solution).~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~This goes hand in hand with sustainable and ethical monetization. The current state of open source is not sustainable. There is an immense amount of contributor burnout. Users of open source expect everything to be free, and few give back. This is a problem we want to fix (we're still trying to figure out the best solution).~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~So, don't be "that guy" in the Discord that says "DragonRuby should be free and open source!" You will be personally flogged by Amir.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~So, don't be "that guy" in the Discord that says "DragonRuby should be free and open source!" You will be personally flogged by Amir.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** 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: ~** People Over Entities~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~People Over Entities~ -- 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: ~People Over Entities~ -- Line's tilde count is: 0 -- Line contains link marker: false +** 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: ~We prioritize the endorsement of real people over faceless entities. This game engine, and other products we create, are not insignificant line items of a large company. And you aren't a generic "commodity" or "corporate resource". So be active in the community Discord and you'll reap the benefits as more devs use DragonRuby.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~We prioritize the endorsement of real people over faceless entities. This game engine, and other products we create, are not insignificant line items of a large company. And you aren't a generic "commodity" or "corporate resource". So be active in the community Discord and you'll reap the benefits as more devs use DragonRuby.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~** Building A Game Should Be Fun And Bring Happiness~ -- H2 detected. +** Processing line: ~~ +** Processing line: ~*** Physics And Collisions - Box Collision - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Building A Game Should Be Fun And Bring Happiness~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Box Collision - 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: ~Building A Game Should Be Fun And Bring Happiness~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Box Collision - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ -** Processing line: ~We will prioritize the removal of pain. The aesthetics of Ruby make it such a joy to work with, and we want to capture that within the engine.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~We will prioritize the removal of pain. The aesthetics of Ruby make it such a joy to work with, and we want to capture that within the engine.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/04_physics_and_collisions/04_box_collision/app/main.rb~ +** Processing line: ~ =begin~ ** Processing line: ~~ -** Processing line: ~** Real World Application Drives Features~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Real World Application Drives Features~ -- 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: ~Real World Application Drives Features~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ ** Processing line: ~~ -** Processing line: ~We are bombarded by marketing speak day in and day out. We don't do that here. There are things that are really great in the engine, and things that need a lot of work. Collaborate with us so we can help you reach your goals. Ask for features you actually need as opposed to anything speculative.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~We are bombarded by marketing speak day in and day out. We don't do that here. There are things that are really great in the engine, and things that need a lot of work. Collaborate with us so we can help you reach your goals. Ask for features you actually need as opposed to anything speculative.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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).~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - first: Returns the first element of the array.~ +** Processing line: ~ For example, if we have an array~ +** Processing line: ~ numbers = [1, 2, 3, 4, 5]~ +** Processing line: ~ and we call first by saying~ +** Processing line: ~ numbers.first~ +** Processing line: ~ the number 1 will be returned because it is the first element of the numbers array.~ ** Processing line: ~~ -** Processing line: ~* Frequently Asked Questions, Comments, and Concerns~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Frequently Asked Questions, Comments, and Concerns~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - num1.idiv(num2): Divides two numbers and returns an integer.~ +** Processing line: ~ For example,~ +** Processing line: ~ 16.idiv(3) = 5, because 16 / 3 is 5.33333 returned as an integer.~ +** Processing line: ~ 16.idiv(4) = 4, because 16 / 4 is 4 and already has no decimal.~ ** Processing line: ~~ -** Processing line: ~Here are questions, comments, and concerns that frequently come up.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Here are questions, comments, and concerns that frequently come up.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ Reminders:~ ** Processing line: ~~ -** Processing line: ~** Frequently Asked Questions~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Frequently Asked Questions~ -- 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: ~Frequently Asked Questions~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - find_all: Finds all values that satisfy specific requirements.~ ** Processing line: ~~ +** Processing line: ~ - ARRAY#intersect_rect?: An array with at least four values is~ +** Processing line: ~ considered a rect. The intersect_rect? function returns true~ +** Processing line: ~ or false depending on if the two rectangles intersect.~ ** Processing line: ~~ -** Processing line: ~*** What is DragonRuby LLP?~ -- H3 detected. -- Determining if line is a header. -- Line contains ~*** ~... gsub-ing empty string -- Formatting line: ~What is DragonRuby LLP?~ -- 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: ~What is DragonRuby LLP?~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ ** Processing line: ~~ -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~DragonRuby LLP is a partnership of four devs who came together with the goal of bringing the aesthetics and joy of Ruby, everywhere possible.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Under DragonRuby LLP, we offer a number of products (with more on the way):~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Under DragonRuby LLP, we offer a number of products (with more on the way):~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ =end~ ** Processing line: ~~ -** Processing line: ~- Game Toolkit (GTK): A 2D game engine that is compatible with modern - gaming platforms.~ -- UL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Game Toolkit (GTK): A 2D game engine that is compatible with modern - gaming platforms.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~- RubyMotion (RM): A compiler toolchain that allows you to build native, cross-platform mobile - apps. [[http://rubymotion.com]]~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~RubyMotion (RM): A compiler toolchain that allows you to build native, cross-platform mobile - apps. [[http://rubymotion.com]]~ -- Line's tilde count is: 0 -- Line contains link marker: true -- LINK detected. -** Processing line: ~All of the products above leverage a shared core called DragonRuby.~ -- UL end detected. -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~All of the products above leverage a shared core called DragonRuby.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~NOTE: From an official branding standpoint each one of the products is suffixed with "A DragonRuby LLP Product" tagline. Also, DragonRuby is _one word, title cased_.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~NOTE: From an official branding standpoint each one of the products is suffixed with "A DragonRuby LLP Product" tagline. Also, DragonRuby is _one word, title cased_.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~NOTE: We leave the "A DragonRuby LLP Product" off of this one because that just sounds really weird.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~NOTE: We leave the "A DragonRuby LLP Product" off of this one because that just sounds really weird.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~NOTE: Devs who use DragonRuby are "Dragon Riders/Riders of Dragons". That's a bad ass identifier huh?~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~NOTE: Devs who use DragonRuby are "Dragon Riders/Riders of Dragons". That's a bad ass identifier huh?~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # This sample app allows users to create tiles and place them anywhere on the screen as obstacles.~ +** Processing line: ~ # The player can then move and maneuver around them.~ ** Processing line: ~~ -** Processing line: ~*** What is DragonRuby?~ -- H3 detected. -- Determining if line is a header. -- Line contains ~*** ~... gsub-ing empty string -- Formatting line: ~What is DragonRuby?~ -- 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: ~What is DragonRuby?~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ class PoorManPlatformerPhysics~ +** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs~ ** Processing line: ~~ -** Processing line: ~The response to this question requires a few subparts. First we need to clarify some terms. Specifically _language specification_ vs _runtime_.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The response to this question requires a few subparts. First we need to clarify some terms. Specifically _language specification_ vs _runtime_.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Calls all methods necessary for the app to run successfully.~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ render~ +** Processing line: ~ calc~ +** Processing line: ~ process_inputs~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~**** Okay... so what is the difference between a language specification and a runtime?~ -- H4 detected. -- Determining if line is a header. -- Line contains ~**** ~... gsub-ing empty string -- Formatting line: ~Okay... so what is the difference between a language specification and a runtime?~ -- 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: ~Okay... so what is the difference between a language specification and a runtime?~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Sets default values for variables.~ +** Processing line: ~ # The ||= sign means that the variable will only be set to the value following the = sign if the value has~ +** Processing line: ~ # not already been set before. Intialization happens only in the first frame.~ +** Processing line: ~ def defaults~ +** Processing line: ~ state.tile_size = 64~ +** Processing line: ~ state.gravity = -0.2~ +** Processing line: ~ state.previous_tile_size ||= state.tile_size~ +** Processing line: ~ state.x ||= 0~ +** Processing line: ~ state.y ||= 800~ +** Processing line: ~ state.dy ||= 0~ +** Processing line: ~ state.dx ||= 0~ +** Processing line: ~ state.world ||= []~ +** Processing line: ~ state.world_lookup ||= {}~ +** Processing line: ~ state.world_collision_rects ||= []~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~A runtime is an _implementation_ of a language specification. When people say "Ruby," they are usually referring to "the Ruby 3.0+ language specification implemented via the CRuby/MRI Runtime."~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~A runtime is an _implementation_ of a language specification. When people say "Ruby," they are usually referring to "the Ruby 3.0+ language specification implemented via the CRuby/MRI Runtime."~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~But, there are many Ruby Runtimes: CRuby/MRI, JRuby, Truffle, Rubinius, Artichoke, and (last but certainly not least) DragonRuby.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~But, there are many Ruby Runtimes: CRuby/MRI, JRuby, Truffle, Rubinius, Artichoke, and (last but certainly not least) DragonRuby.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Outputs solids and borders of different colors for the world and collision_rects collections.~ +** Processing line: ~ def render~ ** Processing line: ~~ -** Processing line: ~**** Okay... what language specification does DragonRuby use then?~ -- H4 detected. -- Determining if line is a header. -- Line contains ~**** ~... gsub-ing empty string -- Formatting line: ~Okay... what language specification does DragonRuby use then?~ -- 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: ~Okay... what language specification does DragonRuby use then?~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Sets a black background on the screen (Comment this line out and the background will become white.)~ +** Processing line: ~ # Also note that black is the default color for when no color is assigned.~ +** Processing line: ~ outputs.solids << grid.rect~ ** Processing line: ~~ -** Processing line: ~DragonRuby's goal is to be compliant with the ISO/IEC 30170:2012 standard. It's syntax is Ruby 2.x compatible, but also contains semantic changes that help it natively interface with platform specific libraries.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~DragonRuby's goal is to be compliant with the ISO/IEC 30170:2012 standard. It's syntax is Ruby 2.x compatible, but also contains semantic changes that help it natively interface with platform specific libraries.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # The position, size, and color (white) are set for borders given to the world collection.~ +** Processing line: ~ # Try changing the color by assigning different numbers (between 0 and 255) to the last three parameters.~ +** Processing line: ~ outputs.borders << state.world.map do |x, y|~ +** Processing line: ~ [x * state.tile_size,~ +** Processing line: ~ y * state.tile_size,~ +** Processing line: ~ state.tile_size,~ +** Processing line: ~ state.tile_size, 255, 255, 255]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~**** So... why another runtime?~ -- H4 detected. -- Determining if line is a header. -- Line contains ~**** ~... gsub-ing empty string -- Formatting line: ~So... why another runtime?~ -- 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: ~So... why another runtime?~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # The top, bottom, and sides of the borders for collision_rects are different colors.~ +** Processing line: ~ outputs.borders << state.world_collision_rects.map do |e|~ +** Processing line: ~ [~ +** Processing line: ~ [e[:top], 0, 170, 0], # top is a shade of green~ +** Processing line: ~ [e[:bottom], 0, 100, 170], # bottom is a shade of greenish-blue~ +** Processing line: ~ [e[:left_right], 170, 0, 0], # left and right are a shade of red~ +** Processing line: ~ ]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~The elevator pitch is:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- 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.~ -- 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.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Sets the position, size, and color (a shade of green) of the borders of only the player's~ +** Processing line: ~ # box and outputs it. If you change the 180 to 0, the player's box will be black and you~ +** Processing line: ~ # won't be able to see it (because it will match the black background).~ +** Processing line: ~ outputs.borders << [state.x,~ +** Processing line: ~ state.y,~ +** Processing line: ~ state.tile_size,~ +** Processing line: ~ state.tile_size, 0, 180, 0]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~**** What does Multilevel Cross-platform mean?~ -- H4 detected. -- Determining if line is a header. -- Line contains ~**** ~... gsub-ing empty string -- Formatting line: ~What does Multilevel Cross-platform mean?~ -- 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: ~What does Multilevel Cross-platform mean?~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Calls methods needed to perform calculations.~ +** Processing line: ~ def calc~ +** Processing line: ~ calc_world_lookup~ +** Processing line: ~ calc_player~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~There are complexities associated with targeting all the platforms we support. Because of this, the runtime had to be architected in such a way that new platforms could be easily added (which lead to us partitioning the runtime internally):~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~There are complexities associated with targeting all the platforms we support. Because of this, the runtime had to be architected in such a way that new platforms could be easily added (which lead to us partitioning the runtime internally):~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Performs calculations on world_lookup and sets values.~ +** Processing line: ~ def calc_world_lookup~ ** Processing line: ~~ -** Processing line: ~- Level 1 we leverage a good portion of mRuby.~ -- UL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Level 1 we leverage a good portion of mRuby.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~- Level 2 consists of optimizations to mRuby we've made given that our - target platforms are well known.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Level 2 consists of optimizations to mRuby we've made given that our - target platforms are well known.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~- Level 3 consists of portable C libraries and their Ruby - C-Extensions.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Level 3 consists of portable C libraries and their Ruby - C-Extensions.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Levels 1 through 3 are fairly commonplace in many runtime implementations (with level 1 being the most portable, and level 3 being the fastest). But the DragonRuby Runtime has taken things a bit further:~ -- UL end detected. -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Levels 1 through 3 are fairly commonplace in many runtime implementations (with level 1 being the most portable, and level 3 being the fastest). But the DragonRuby Runtime has taken things a bit further:~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # If the tile size isn't equal to the previous tile size,~ +** Processing line: ~ # the previous tile size is set to the tile size,~ +** Processing line: ~ # and world_lookup hash is set to empty.~ +** Processing line: ~ if state.tile_size != state.previous_tile_size~ +** Processing line: ~ state.previous_tile_size = state.tile_size~ +** Processing line: ~ state.world_lookup = {} # empty hash~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~- Level 4 consists of shared abstractions around hardware I/O and operating - system resources. This level leverages open source and proprietary components within Simple DirectMedia Layer (a low level multimedia component library that has been in active development for 22 years and counting).~ -- UL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Level 4 consists of shared abstractions around hardware I/O and operating - system resources. This level leverages open source and proprietary components within Simple DirectMedia Layer (a low level multimedia component library that has been in active development for 22 years and counting).~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # return if the world_lookup hash has keys (or, in other words, is not empty)~ +** Processing line: ~ # return unless the world collection has values inside of it (or is not empty)~ +** Processing line: ~ return if state.world_lookup.keys.length > 0~ +** Processing line: ~ return unless state.world.length > 0~ ** Processing line: ~~ -** Processing line: ~- Level 5 is a code generation layer which creates metadata that allows - for native interoperability with host runtime libraries. It also includes OS specific message pump orchestrations.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Level 5 is a code generation layer which creates metadata that allows - for native interoperability with host runtime libraries. It also includes OS specific message pump orchestrations.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Starts with an empty hash for world_lookup.~ +** Processing line: ~ # Searches through the world and finds the coordinates that exist.~ +** Processing line: ~ state.world_lookup = {}~ +** Processing line: ~ state.world.each { |x, y| state.world_lookup[[x, y]] = true }~ ** Processing line: ~~ -** Processing line: ~- Level 6 is a Ahead of Time/Just in Time Ruby compiler built with LLVM. This - compiler outputs _very_ fast platform specific bitcode, but only supports a subset of the Ruby language specification.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Level 6 is a Ahead of Time/Just in Time Ruby compiler built with LLVM. This - compiler outputs _very_ fast platform specific bitcode, but only supports a subset of the Ruby language specification.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~These levels allow us to stay up to date with open source implementations of Ruby; provide fast, native code execution on proprietary platforms; ensure good separation between these two worlds; and provides a means to add new platforms without going insane.~ -- UL end detected. -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~These levels allow us to stay up to date with open source implementations of Ruby; provide fast, native code execution on proprietary platforms; ensure good separation between these two worlds; and provides a means to add new platforms without going insane.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Assigns world_collision_rects for every sprite drawn.~ +** Processing line: ~ state.world_collision_rects =~ +** Processing line: ~ state.world_lookup~ +** Processing line: ~ .keys~ +** Processing line: ~ .map do |coord_x, coord_y|~ +** Processing line: ~ s = state.tile_size~ +** Processing line: ~ # multiply by tile size so the grid coordinates; sets pixel value~ +** Processing line: ~ # don't forget that position is denoted by bottom left corner~ +** Processing line: ~ # set x = coord_x or y = coord_y and see what happens!~ +** Processing line: ~ x = s * coord_x~ +** Processing line: ~ y = s * coord_y~ +** Processing line: ~ {~ +** Processing line: ~ # The values added to x, y, and s position the world_collision_rects so they all appear~ +** Processing line: ~ # stacked (on top of world rects) but don't directly overlap.~ +** Processing line: ~ # Remove these added values and mess around with the rect placement!~ +** Processing line: ~ args: [coord_x, coord_y],~ +** Processing line: ~ left_right: [x, y + 4, s, s - 6], # hash keys and values~ +** Processing line: ~ top: [x + 4, y + 6, s - 8, s - 6],~ +** Processing line: ~ bottom: [x + 1, y - 1, s - 2, s - 8],~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~**** Cool cool. So given that I understand everything to this point, can we answer the original question? What is DragonRuby?~ -- H4 detected. -- Determining if line is a header. -- Line contains ~**** ~... gsub-ing empty string -- Formatting line: ~Cool cool. So given that I understand everything to this point, can we answer the original question? What is DragonRuby?~ -- 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: ~Cool cool. So given that I understand everything to this point, can we answer the original question? What is DragonRuby?~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Performs calculations to change the x and y values of the player's box.~ +** Processing line: ~ def calc_player~ ** Processing line: ~~ -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Since acceleration is the change in velocity, the change in y (dy) increases every frame.~ +** Processing line: ~ # What goes up must come down because of gravity.~ +** Processing line: ~ state.dy += state.gravity~ ** Processing line: ~~ -** Processing line: ~*** How is DragonRuby different than MRI?~ -- H3 detected. -- Determining if line is a header. -- Line contains ~*** ~... gsub-ing empty string -- Formatting line: ~How is DragonRuby different than MRI?~ -- 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: ~How is DragonRuby different than MRI?~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Calls the calc_box_collision and calc_edge_collision methods.~ +** Processing line: ~ calc_box_collision~ +** Processing line: ~ calc_edge_collision~ +** Processing line: ~~ +** Processing line: ~ # Since velocity is the change in position, the change in y increases by dy. Same with x and dx.~ +** Processing line: ~ state.y += state.dy~ +** Processing line: ~ state.x += state.dx~ +** Processing line: ~~ +** Processing line: ~ # Scales dx down.~ +** Processing line: ~ state.dx *= 0.8~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Calls methods needed to determine collisions between player and world_collision rects.~ +** Processing line: ~ def calc_box_collision~ +** Processing line: ~ return unless state.world_lookup.keys.length > 0 # return unless hash has atleast 1 key~ +** Processing line: ~ collision_floor!~ +** Processing line: ~ collision_left!~ +** Processing line: ~ collision_right!~ +** Processing line: ~ collision_ceiling!~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Finds collisions between the bottom of the player's rect and the top of a world_collision_rect.~ +** Processing line: ~ def collision_floor!~ +** Processing line: ~ return unless state.dy <= 0 # return unless player is going down or is as far down as possible~ +** Processing line: ~ player_rect = [state.x, state.y - 0.1, state.tile_size, state.tile_size] # definition of player~ +** Processing line: ~~ +** Processing line: ~ # Goes through world_collision_rects to find all intersections between the bottom of player's rect and~ +** Processing line: ~ # the top of a world_collision_rect (hence the "-0.1" above)~ +** Processing line: ~ floor_collisions = state.world_collision_rects~ +** Processing line: ~ .find_all { |r| r[:top].intersect_rect?(player_rect, collision_tollerance) }~ +** Processing line: ~ .first~ +** Processing line: ~~ +** Processing line: ~ return unless floor_collisions # return unless collision occurred~ +** Processing line: ~ state.y = floor_collisions[:top].top # player's y is set to the y of the top of the collided rect~ +** Processing line: ~ state.dy = 0 # if a collision occurred, the player's rect isn't moving because its path is blocked~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Finds collisions between the player's left side and the right side of a world_collision_rect.~ +** Processing line: ~ def collision_left!~ +** Processing line: ~ return unless state.dx < 0 # return unless player is moving left~ +** Processing line: ~ player_rect = [state.x - 0.1, state.y, state.tile_size, state.tile_size]~ +** Processing line: ~~ +** Processing line: ~ # Goes through world_collision_rects to find all intersections beween the player's left side and the~ +** Processing line: ~ # right side of a world_collision_rect.~ +** Processing line: ~ left_side_collisions = state.world_collision_rects~ +** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, collision_tollerance) }~ +** Processing line: ~ .first~ +** Processing line: ~~ +** Processing line: ~ return unless left_side_collisions # return unless collision occurred~ +** Processing line: ~~ +** Processing line: ~ # player's x is set to the value of the x of the collided rect's right side~ +** Processing line: ~ state.x = left_side_collisions[:left_right].right~ +** Processing line: ~ state.dx = 0 # player isn't moving left because its path is blocked~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Finds collisions between the right side of the player and the left side of a world_collision_rect.~ +** Processing line: ~ def collision_right!~ +** Processing line: ~ return unless state.dx > 0 # return unless player is moving right~ +** Processing line: ~ player_rect = [state.x + 0.1, state.y, state.tile_size, state.tile_size]~ +** Processing line: ~~ +** Processing line: ~ # Goes through world_collision_rects to find all intersections between the player's right side~ +** Processing line: ~ # and the left side of a world_collision_rect (hence the "+0.1" above)~ +** Processing line: ~ right_side_collisions = state.world_collision_rects~ +** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, collision_tollerance) }~ +** Processing line: ~ .first~ +** Processing line: ~~ +** Processing line: ~ return unless right_side_collisions # return unless collision occurred~ +** Processing line: ~~ +** Processing line: ~ # player's x is set to the value of the collided rect's left, minus the size of a rect~ +** Processing line: ~ # tile size is subtracted because player's position is denoted by bottom left corner~ +** Processing line: ~ state.x = right_side_collisions[:left_right].left - state.tile_size~ +** Processing line: ~ state.dx = 0 # player isn't moving right because its path is blocked~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Finds collisions between the top of the player's rect and the bottom of a world_collision_rect.~ +** Processing line: ~ def collision_ceiling!~ +** Processing line: ~ return unless state.dy > 0 # return unless player is moving up~ +** Processing line: ~ player_rect = [state.x, state.y + 0.1, state.tile_size, state.tile_size]~ +** Processing line: ~~ +** Processing line: ~ # Goes through world_collision_rects to find intersections between the bottom of a~ +** Processing line: ~ # world_collision_rect and the top of the player's rect (hence the "+0.1" above)~ +** Processing line: ~ ceil_collisions = state.world_collision_rects~ +** Processing line: ~ .find_all { |r| r[:bottom].intersect_rect?(player_rect, collision_tollerance) }~ +** Processing line: ~ .first~ ** Processing line: ~~ -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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).~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ return unless ceil_collisions # return unless collision occurred~ ** Processing line: ~~ -** Processing line: ~**** Does DragonRuby support Gems?~ -- H4 detected. -- Determining if line is a header. -- Line contains ~**** ~... gsub-ing empty string -- Formatting line: ~Does DragonRuby support Gems?~ -- 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: ~Does DragonRuby support Gems?~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # player's y is set to the bottom y of the rect it collided with, minus the size of a rect~ +** Processing line: ~ state.y = ceil_collisions[:bottom].y - state.tile_size~ +** Processing line: ~ state.dy = 0 # if a collision occurred, the player isn't moving up because its path is blocked~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~DragonRuby does not support gems because that requires the installation of MRI Ruby on the developer's machine (which is a non-starter given that we want DragonRuby to be a zero dependency runtime). While this seems easy for Mac and Linux, it is much harder on Windows and Raspberry Pi. mRuby has taken the approach of having a git repository for compatible gems and we will most likely follow suite: [[https://github.com/mruby/mgem-list]].~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~DragonRuby does not support gems because that requires the installation of MRI Ruby on the developer's machine (which is a non-starter given that we want DragonRuby to be a zero dependency runtime). While this seems easy for Mac and Linux, it is much harder on Windows and Raspberry Pi. mRuby has taken the approach of having a git repository for compatible gems and we will most likely follow suite: [[https://github.com/mruby/mgem-list]].~ -- Line's tilde count is: 0 -- Line contains link marker: true -- LINK detected. +** Processing line: ~ # Makes sure the player remains within the screen's dimensions.~ +** Processing line: ~ def calc_edge_collision~ ** Processing line: ~~ -** Processing line: ~**** Does DragonRuby have a REPL/IRB?~ -- H4 detected. -- Determining if line is a header. -- Line contains ~**** ~... gsub-ing empty string -- Formatting line: ~Does DragonRuby have a REPL/IRB?~ -- 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: ~Does DragonRuby have a REPL/IRB?~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ #Ensures that the player doesn't fall below the map.~ +** Processing line: ~ if state.y < 0~ +** Processing line: ~ state.y = 0~ +** Processing line: ~ state.dy = 0~ ** Processing line: ~~ -** Processing line: ~You can use DragonRuby's Console within the game to inspect object and execute small pieces of code. For more complex pieces of code create a file called ~repl.rb~ and put it in ~mygame/app/repl.rb~:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You can use DragonRuby's Console within the game to inspect object and execute small pieces of code. For more complex pieces of code create a file called ~repl.rb~ and put it in ~mygame/app/repl.rb~:~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ #Ensures that the player doesn't go too high.~ +** Processing line: ~ # Position of player is denoted by bottom left hand corner, which is why we have to subtract the~ +** Processing line: ~ # size of the player's box (so it remains visible on the screen)~ +** Processing line: ~ elsif state.y > 720 - state.tile_size # if the player's y position exceeds the height of screen~ +** Processing line: ~ state.y = 720 - state.tile_size # the player will remain as high as possible while staying on screen~ +** Processing line: ~ state.dy = 0~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~- Any code you write in there will be executed when you change the file. You can organize different pieces of code using the ~repl~ method:~ -- UL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Any code you write in there will be executed when you change the file. You can organize different pieces of code using the ~repl~ method:~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ # Ensures that the player remains in the horizontal range that it is supposed to.~ +** Processing line: ~ if state.x >= 1280 - state.tile_size && state.dx > 0 # if player moves too far right~ +** Processing line: ~ state.x = 1280 - state.tile_size # player will remain as right as possible while staying on screen~ +** Processing line: ~ state.dx = 0~ +** Processing line: ~ elsif state.x <= 0 && state.dx < 0 # if player moves too far left~ +** Processing line: ~ state.x = 0 # player will remain as left as possible while remaining on screen~ +** Processing line: ~ state.dx = 0~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ repl do~ -** Processing line: ~ puts "hello world"~ -** Processing line: ~ puts 1 + 1~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Processes input from the user on the keyboard.~ +** Processing line: ~ def process_inputs~ +** Processing line: ~ if inputs.mouse.down~ +** Processing line: ~ state.world_lookup = {}~ +** Processing line: ~ x, y = to_coord inputs.mouse.down.point # gets x, y coordinates for the grid~ ** Processing line: ~~ +** Processing line: ~ if state.world.any? { |loc| loc == [x, y] } # checks if coordinates duplicate~ +** Processing line: ~ state.world = state.world.reject { |loc| loc == [x, y] } # erases tile space~ +** Processing line: ~ else~ +** Processing line: ~ state.world << [x, y] # If no duplicates, adds to world collection~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~- 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).~ -- UL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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).~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Sets dx to 0 if the player lets go of arrow keys.~ +** Processing line: ~ if inputs.keyboard.key_up.right~ +** Processing line: ~ state.dx = 0~ +** Processing line: ~ elsif inputs.keyboard.key_up.left~ +** Processing line: ~ state.dx = 0~ +** Processing line: ~ end~ ** 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.~ -- 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.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. -** 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.~ -- UL end detected. -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~4. To ignore code in ~repl.rb~, instead of commenting it out, prefix ~repl~ with the letter ~x~ and it'll be ignored.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ # Sets dx to 3 in whatever direction the player chooses.~ +** Processing line: ~ if inputs.keyboard.key_held.right # if right key is pressed~ +** Processing line: ~ state.dx = 3~ +** Processing line: ~ elsif inputs.keyboard.key_held.left # if left key is pressed~ +** Processing line: ~ state.dx = -3~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ xrepl do # <------- line is prefixed with an "x"~ -** Processing line: ~ puts "hello world"~ -** Processing line: ~ puts 1 + 1~ -** Processing line: ~ end~ +** Processing line: ~ #Sets dy to 5 to make the player ~fly~ when they press the space bar~ +** Processing line: ~ if inputs.keyboard.key_held.space~ +** Processing line: ~ state.dy = 5~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # This code will be executed when you save the file.~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "Hello"~ -** Processing line: ~ end~ +** Processing line: ~ def to_coord point~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "This code will also be executed."~ -** Processing line: ~ end~ +** Processing line: ~ # Integer divides (idiv) point.x to turn into grid~ +** Processing line: ~ # Then, you can just multiply each integer by state.tile_size later so the grid coordinates.~ +** Processing line: ~ [point.x.idiv(state.tile_size), point.y.idiv(state.tile_size)]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # use xrepl to "comment out" code~ -** Processing line: ~ xrepl do~ -** Processing line: ~ puts "This code will not be executed because of the x infront of repl".~ +** Processing line: ~ # Represents the tolerance for a collision between the player's rect and another rect.~ +** Processing line: ~ def collision_tollerance~ +** Processing line: ~ 0.0~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. ** Processing line: ~~ +** Processing line: ~ $platformer_physics = PoorManPlatformerPhysics.new~ ** Processing line: ~~ -** Processing line: ~**** Does DragonRuby support ~pry~ or have any other debugging facilities?~ -- H4 detected. -- Determining if line is a header. -- Line contains ~**** ~... gsub-ing empty string -- Formatting line: ~Does DragonRuby support ~pry~ or have any other debugging facilities?~ -- 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: ~Does DragonRuby support ~pry~ or have any other debugging facilities?~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def tick args~ +** Processing line: ~ $platformer_physics.grid = args.grid~ +** Processing line: ~ $platformer_physics.inputs = args.inputs~ +** Processing line: ~ $platformer_physics.state = args.state~ +** Processing line: ~ $platformer_physics.outputs = args.outputs~ +** Processing line: ~ $platformer_physics.tick~ +** Processing line: ~ tick_instructions args, "Sample app shows platformer collisions. CLICK to place box. ARROW keys to move around. SPACE to jump."~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~~pry~ is a gem that assumes you are using the MRI Runtime (which is incompatible with DragonRuby). Eventually DragonRuby will have a pry based experience that is compatible with a debugging infrastructure called LLDB. Take the time to read about LLDB as it shows the challenges in creating something that is compatible.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~pry~ is a gem that assumes you are using the MRI Runtime (which is incompatible with DragonRuby). Eventually DragonRuby will have a pry based experience that is compatible with a debugging infrastructure called LLDB. Take the time to read about LLDB as it shows the challenges in creating something that is compatible.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~You can use DragonRuby's replay capabilities to troubleshoot:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You can use DragonRuby's replay capabilities to troubleshoot:~ -- Line's tilde count is: 0 -- Line contains link marker: false +** 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.escape~ +** Processing line: ~ args.state.key_event_occurred = true~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~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).~ -- OL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- 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"~.~ -- 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"~.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. -** 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~.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ 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's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** 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.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ 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's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~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.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ 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.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** 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: ~** Frequent Comments About Ruby as a Language Choice~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Frequent Comments About Ruby as a Language Choice~ -- 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: ~Frequent Comments About Ruby as a Language Choice~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~*** But Ruby is dead.~ +** Processing line: ~*** Physics And Collisions - Box Collision 2 - main.rb~ - H3 detected. - Determining if line is a header. - Line contains ~*** ~... gsub-ing empty string -- Formatting line: ~But Ruby is dead.~ +- Formatting line: ~Physics And Collisions - Box Collision 2 - 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: ~But Ruby is dead.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Let's check the official source for the answer to this question: isrubydead.com: [[https://isrubydead.com/]].~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Let's check the official source for the answer to this question: isrubydead.com: [[https://isrubydead.com/]].~ -- 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.~ -- 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.~ -- 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].~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting 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].~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Let's stop making this comment shall we?~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Let's stop making this comment shall we?~ +- Formatting line: ~Physics And Collisions - Box Collision 2 - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ -** Processing line: ~*** But Ruby is slow.~ -- H3 detected. -- Determining if line is a header. -- Line contains ~*** ~... gsub-ing empty string -- Formatting line: ~But Ruby is slow.~ -- 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: ~But Ruby is slow.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/04_physics_and_collisions/05_box_collision_2/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ ** Processing line: ~~ -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - times: Performs an action a specific number of times.~ +** Processing line: ~ For example, if we said~ +** Processing line: ~ 5.times puts "Hello DragonRuby",~ +** Processing line: ~ then we'd see the words "Hello DragonRuby" printed on the console 5 times.~ ** Processing line: ~~ -** Processing line: ~*** Dynamic languages are slow.~ -- H3 detected. -- Determining if line is a header. -- Line contains ~*** ~... gsub-ing empty string -- Formatting line: ~Dynamic languages are slow.~ -- 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: ~Dynamic languages are slow.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - split: Divides a string into substrings based on a delimiter.~ +** Processing line: ~ For example, if we had a command~ +** Processing line: ~ "DragonRuby is awesome".split(" ")~ +** Processing line: ~ then the result would be~ +** Processing line: ~ ["DragonRuby", "is", "awesome"] because the words are separated by a space delimiter.~ ** Processing line: ~~ -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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_.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Unless you are writing in some form of intermediate representation by hand, your language of choice also suffers this same fallacy of slow. Like, nothing is faster than a low level assembly-like language. So unless you're writing in that, let's stop making this comment.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Unless you are writing in some form of intermediate representation by hand, your language of choice also suffers this same fallacy of slow. Like, nothing is faster than a low level assembly-like language. So unless you're writing in that, let's stop making this comment.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~NOTE: If you _are_ hand writing LLVM IR, we are always open to bringing on new partners with such a skill set. Email us ^_^.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - join: Opposite of split; converts each element of array to a string separated by delimiter.~ +** Processing line: ~ For example, if we had a command~ +** Processing line: ~ ["DragonRuby","is","awesome"].join(" ")~ +** Processing line: ~ then the result would be~ +** Processing line: ~ "DragonRuby is awesome".~ ** Processing line: ~~ -** Processing line: ~** Frequent Concerns~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Frequent Concerns~ -- 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: ~Frequent Concerns~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ Reminders:~ ** Processing line: ~~ +** Processing line: ~ - to_s: Returns a string representation of an object.~ +** Processing line: ~ For example, if we had~ +** Processing line: ~ 500.to_s~ +** Processing line: ~ the string "500" would be returned.~ +** Processing line: ~ Similar to to_i, which returns an integer representation of an object.~ ** Processing line: ~~ -** Processing line: ~*** DragonRuby is not open source. That's not right.~ -- H3 detected. -- Determining if line is a header. -- Line contains ~*** ~... gsub-ing empty string -- Formatting line: ~DragonRuby is not open source. That's not right.~ -- 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: ~DragonRuby is not open source. That's not right.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - elapsed_time: How many frames have passed since the click event.~ ** Processing line: ~~ -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~We believe in open source very strongly. Parts of DragonRuby are in fact, open source. Just not all of it (for legal reasons, and because the IP we've created has value). And we promise that we are looking for (or creating) ways to _sustainably_ open source everything we do.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~We believe in open source very strongly. Parts of DragonRuby are in fact, open source. Just not all of it (for legal reasons, and because the IP we've created has value). And we promise that we are looking for (or creating) ways to _sustainably_ open source everything we do.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~If you have ideas on how we can do this, email us!~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~If you have ideas on how we can do this, email us!~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~If the reason above isn't sufficient, then definitely use something else.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~If the reason above isn't sufficient, then definitely use something else.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~All this being said, we do have parts of the engine open sourced on GitHub: [[https://github.com/dragonruby/dragonruby-game-toolkit-contrib/]]~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~All this being said, we do have parts of the engine open sourced on GitHub: [[https://github.com/dragonruby/dragonruby-game-toolkit-contrib/]]~ -- Line's tilde count is: 0 -- Line contains link marker: true -- LINK detected. +** Processing line: ~ - args.outputs.labels: An array. Values in the array generate labels on the screen.~ +** Processing line: ~ The parameters are: [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ ** Processing line: ~~ -** Processing line: ~*** DragonRuby is for pay. You should offer a free version.~ -- H3 detected. -- Determining if line is a header. -- Line contains ~*** ~... gsub-ing empty string -- Formatting line: ~DragonRuby is for pay. You should offer a free version.~ -- 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: ~DragonRuby is for pay. You should offer a free version.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - inputs.mouse.down: Determines whether or not the mouse is being pressed down.~ +** Processing line: ~ The position of the mouse when it is pressed down can be found using inputs.mouse.down.point.(x|y).~ ** Processing line: ~~ -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~That being said, we will _never_ put someone out financially. We have income assistance for anyone that can't afford a license to any one of our products.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~That being said, we will _never_ put someone out financially. We have income assistance for anyone that can't afford a license to any one of our products.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~You qualify for a free, unrestricted license to DragonRuby products if any of the following items pertain to you:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You qualify for a free, unrestricted license to DragonRuby products if any of the following items pertain to you:~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - first: Returns the first element of the array.~ ** Processing line: ~~ -** Processing line: ~- Your income is below $2,000.00 (USD) per month.~ -- UL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Your income is below $2,000.00 (USD) per month.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~- You are under 18 years of age.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You are under 18 years of age.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~- You are a student of any type: traditional public school, home - schooling, college, bootcamp, or online.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You are a student of any type: traditional public school, home - schooling, college, bootcamp, or online.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~- You are a teacher, mentor, or parent who wants to teach a kid how to code.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You are a teacher, mentor, or parent who wants to teach a kid how to code.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~- You work/worked in public service or at a charitable organization: - for example public office, army, or any 501(c)(3) organization.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You work/worked in public service or at a charitable organization: - for example public office, army, or any 501(c)(3) organization.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Just contact Amir at amir.rajan@dragonruby.org with a short explanation of your current situation and he'll set you up. No questions asked.~ -- UL end detected. -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Just contact Amir at amir.rajan@dragonruby.org with a short explanation of your current situation and he'll set you up. No questions asked.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - num1.idiv(num2): Divides two numbers and returns an integer.~ ** Processing line: ~~ -** Processing line: ~*** But still, you should offer a free version. So I can try it out and see if I like it.~ -- H3 detected. -- Determining if line is a header. -- Line contains ~*** ~... gsub-ing empty string -- Formatting line: ~But still, you should offer a free version. So I can try it out and see if I like it.~ -- 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: ~But still, you should offer a free version. So I can try it out and see if I like it.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - find_all: Finds all values that satisfy specific requirements.~ ** 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.~ -- 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.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** 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. -- Line does not appear to be a header. -- Formatting line: ~Seriously just buy it. Get a refund if you don't like it. We make it stupid easy to do so.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect.~ ** Processing line: ~~ -** Processing line: ~*** I still think you should do a free version. Think of all people who would give it a shot.~ -- H3 detected. -- Determining if line is a header. -- Line contains ~*** ~... gsub-ing empty string -- Formatting line: ~I still think you should do a free version. Think of all people who would give it a shot.~ -- 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: ~I still think you should do a free version. Think of all people who would give it a shot.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ ** Processing line: ~~ -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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).~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ ** Processing line: ~~ -** Processing line: ~*** What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.~ -- H3 detected. -- Determining if line is a header. -- Line contains ~*** ~... gsub-ing empty string -- Formatting line: ~What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.~ -- 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: ~What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ =end~ ** Processing line: ~~ -** Processing line: ~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 detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~But, in the event that sad day comes, our partnership bylaws state that _all_ DragonRuby IP that can be legally open sourced, will be released under a permissive license.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~But, in the event that sad day comes, our partnership bylaws state that _all_ DragonRuby IP that can be legally open sourced, will be released under a permissive license.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ MAP_FILE_PATH = 'app/map.txt' # the map.txt file in the app folder contains exported map~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: How To Determine What Frame You Are On~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: How To Determine What Frame You Are On~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ class MetroidvaniaStarter~ +** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs, :gtk~ ** Processing line: ~~ -** Processing line: ~There is a property on ~state~ called ~tick_count~ that is incremented by DragonRuby every time the ~tick~ method is called. The following code renders a label that displays the current ~tick_count~.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~There is a property on ~state~ called ~tick_count~ that is incremented by DragonRuby every time the ~tick~ method is called. The following code renders a label that displays the current ~tick_count~.~ -- Line's tilde count is: 8 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ # Calls methods needed to run the game properly.~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ render~ +** Processing line: ~ calc~ +** Processing line: ~ process_inputs~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.labels << [10, 670, "#{args.state.tick_count}"]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Sets all the default variables.~ +** Processing line: ~ # '||' states that initialization occurs only in the first frame.~ +** Processing line: ~ def defaults~ +** Processing line: ~ state.tile_size = 64~ +** Processing line: ~ state.gravity = -0.2~ +** Processing line: ~ state.player_width = 60~ +** Processing line: ~ state.player_height = 64~ +** Processing line: ~ state.collision_tolerance = 0.0~ +** Processing line: ~ state.previous_tile_size ||= state.tile_size~ +** Processing line: ~ state.x ||= 0~ +** Processing line: ~ state.y ||= 800~ +** Processing line: ~ state.dy ||= 0~ +** Processing line: ~ state.dx ||= 0~ +** Processing line: ~ attempt_load_world_from_file~ +** Processing line: ~ state.world_lookup ||= { }~ +** Processing line: ~ state.world_collision_rects ||= []~ +** Processing line: ~ state.mode ||= :creating # alternates between :creating and :selecting for sprite selection~ +** Processing line: ~ state.select_menu ||= [0, 720, 1280, 720]~ +** Processing line: ~ #=======================================IMPORTANT=======================================#~ +** Processing line: ~ # When adding sprites, please label them "image1.png", "image2.png", image3".png", etc.~ +** Processing line: ~ # Once you have done that, adjust "state.sprite_quantity" to how many sprites you have.~ +** Processing line: ~ #=======================================================================================#~ +** Processing line: ~ state.sprite_quantity ||= 20 # IMPORTANT TO ALTER IF SPRITES ADDED IF YOU ADD MORE SPRITES~ +** Processing line: ~ state.sprite_coords ||= []~ +** Processing line: ~ state.banner_coords ||= [640, 680 + 720]~ +** Processing line: ~ state.sprite_selected ||= 1~ +** Processing line: ~ state.map_saved_at ||= 0~ ** Processing line: ~~ +** Processing line: ~ # Sets all the cordinate values for the sprite selection screen into a grid~ +** Processing line: ~ # Displayed when 's' is pressed by player to access sprites~ +** Processing line: ~ if state.sprite_coords == [] # if sprite_coords is an empty array~ +** Processing line: ~ count = 1~ +** Processing line: ~ temp_x = 165 # sets a starting x and y position for display~ +** Processing line: ~ temp_y = 500 + 720~ +** Processing line: ~ state.sprite_quantity.times do # for the number of sprites you have~ +** Processing line: ~ state.sprite_coords += [[temp_x, temp_y, count]] # add element to sprite_coords array~ +** Processing line: ~ temp_x += 100 # increment temp_x~ +** Processing line: ~ count += 1 # increment count~ +** Processing line: ~ if temp_x > 1280 - (165 + 50) # if exceeding specific horizontal width on screen~ +** Processing line: ~ temp_x = 165 # a new row of sprites starts~ +** Processing line: ~ temp_y -= 75 # new row of sprites starts 75 units lower than the previous row~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: How To Get Current Framerate~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: How To Get Current Framerate~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Places sprites~ +** Processing line: ~ def render~ ** Processing line: ~~ -** Processing line: ~Current framerate is a top level property on the Game Toolkit Runtime and is accessible via ~args.gtk.current_framerate~.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Current framerate is a top level property on the Game Toolkit Runtime and is accessible via ~args.gtk.current_framerate~.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ # Sets the x, y, width, height, and image path for each sprite in the world collection.~ +** Processing line: ~ outputs.sprites << state.world.map do |x, y, sprite|~ +** Processing line: ~ [x * state.tile_size, # multiply by size so grid coordinates; pixel value of location~ +** Processing line: ~ y * state.tile_size,~ +** Processing line: ~ state.tile_size,~ +** Processing line: ~ state.tile_size,~ +** Processing line: ~ 'sprites/image' + sprite.to_s + '.png'] # uses concatenation to create unique image path~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.labels << [10, 710, "framerate: #{args.gtk.current_framerate.round}"]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Outputs sprite for the player by setting x, y, width, height, and image path~ +** Processing line: ~ outputs.sprites << [state.x,~ +** Processing line: ~ state.y,~ +** Processing line: ~ state.player_width,~ +** Processing line: ~ state.player_height,'sprites/player.png']~ ** Processing line: ~~ +** Processing line: ~ # Outputs labels as primitives in top right of the screen~ +** Processing line: ~ outputs.primitives << [920, 700, 'Press \'s\' to access sprites.', 1, 0].label~ +** Processing line: ~ outputs.primitives << [920, 675, 'Click existing sprite to delete.', 1, 0].label~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: How To Render A Sprite Using An Array~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: How To Render A Sprite Using An Array~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ outputs.primitives << [920, 640, '<- and -> to move.', 1, 0].label~ +** Processing line: ~ outputs.primitives << [920, 615, 'Press and hold space to jump.', 1, 0].label~ ** Processing line: ~~ -** Processing line: ~All file paths should use the forward slash ~/~ *not* backslash ~~. Game Toolkit includes a number of sprites in the ~sprites~ folder (everything about your game is located in the ~mygame~ directory).~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~All file paths should use the forward slash ~/~ *not* backslash ~~. Game Toolkit includes a number of sprites in the ~sprites~ folder (everything about your game is located in the ~mygame~ directory).~ -- Line's tilde count is: 8 -- Line contains link marker: false -- CODE detected. -** Processing line: ~The following code renders a sprite with a ~width~ and ~height~ of ~100~ in the center of the screen.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The following code renders a sprite with a ~width~ and ~height~ of ~100~ in the center of the screen.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~args.outputs.sprites~ is used to render a sprite.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.outputs.sprites~ is used to render a sprite.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ outputs.primitives << [920, 580, 'Press \'e\' to export current map.', 1, 0].label~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.sprites << [~ -** Processing line: ~ 640 - 50, # X~ -** Processing line: ~ 360 - 50, # Y~ -** Processing line: ~ 100, # W~ -** Processing line: ~ 100, # H~ -** Processing line: ~ 'sprites/square-blue.png' # PATH~ -** Processing line: ~ ]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # if the map is saved and less than 120 frames have passed, the label is displayed~ +** Processing line: ~ if state.map_saved_at > 0 && state.map_saved_at.elapsed_time < 120~ +** Processing line: ~ outputs.primitives << [920, 555, 'Map has been exported!', 1, 0, 50, 100, 50].label~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # If player hits 's', following appears~ +** Processing line: ~ if state.mode == :selecting~ +** Processing line: ~ # White background for sprite selection~ +** Processing line: ~ outputs.primitives << [state.select_menu, 255, 255, 255].solid~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: More Sprite Properties As An Array~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: More Sprite Properties As An Array~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Select tile label at the top of the screen~ +** Processing line: ~ outputs.primitives << [state.banner_coords.x, state.banner_coords.y, "Select Sprite (sprites located in \"sprites\" folder)", 10, 1, 0, 0, 0, 255].label~ ** Processing line: ~~ -** Processing line: ~Here are all the properties you can set on a sprite.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Here are all the properties you can set on a sprite.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Places sprites in locations calculated in the defaults function~ +** Processing line: ~ outputs.primitives << state.sprite_coords.map do |x, y, order|~ +** Processing line: ~ [x, y, 50, 50, 'sprites/image' + order.to_s + ".png"].sprite~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.sprites << [~ -** Processing line: ~ 100, # X~ -** Processing line: ~ 100, # Y~ -** Processing line: ~ 32, # W~ -** Processing line: ~ 64, # H~ -** Processing line: ~ 'sprites/square-blue.png', # PATH~ -** Processing line: ~ 0, # ANGLE~ -** Processing line: ~ 255, # ALPHA~ -** Processing line: ~ 0, # RED_SATURATION~ -** Processing line: ~ 255, # GREEN_SATURATION~ -** Processing line: ~ 0 # BLUE_SATURATION~ -** Processing line: ~ ]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Creates sprite following mouse to help indicate which sprite you have selected~ +** Processing line: ~ # 10 is subtracted from the mouse's x position so that the sprite is not covered by the mouse icon~ +** Processing line: ~ outputs.primitives << [inputs.mouse.position.x - 10, inputs.mouse.position.y,~ +** Processing line: ~ 10, 10, 'sprites/image' + state.sprite_selected.to_s + ".png"].sprite~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Calls methods that perform calculations~ +** Processing line: ~ def calc~ +** Processing line: ~ calc_in_game~ +** Processing line: ~ calc_sprite_selection~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: Different Sprite Representations~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: Different Sprite Representations~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Calls methods that perform calculations (if in creating mode)~ +** Processing line: ~ def calc_in_game~ +** Processing line: ~ return unless state.mode == :creating~ +** Processing line: ~ calc_world_lookup~ +** Processing line: ~ calc_player~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~Using ordinal positioning can get a little unruly given so many properties you have control over.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Using ordinal positioning can get a little unruly given so many properties you have control over.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~You can represent a sprite as a ~Hash~:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You can represent a sprite as a ~Hash~:~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def calc_world_lookup~ +** Processing line: ~ # If the tile size isn't equal to the previous tile size,~ +** Processing line: ~ # the previous tile size is set to the tile size,~ +** Processing line: ~ # and world_lookup hash is set to empty.~ +** Processing line: ~ if state.tile_size != state.previous_tile_size~ +** Processing line: ~ state.previous_tile_size = state.tile_size~ +** Processing line: ~ state.world_lookup = {}~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.sprites << {~ -** Processing line: ~ x: 640 - 50,~ -** Processing line: ~ y: 360 - 50,~ -** Processing line: ~ w: 100,~ -** Processing line: ~ h: 100,~ -** Processing line: ~ path: 'sprites/square-blue.png',~ -** Processing line: ~ angle: 0,~ -** Processing line: ~ a: 255,~ -** Processing line: ~ r: 255,~ -** Processing line: ~ g: 255,~ -** Processing line: ~ b: 255,~ -** Processing line: ~ source_x: 0,~ -** Processing line: ~ source_y: 0,~ -** Processing line: ~ source_w: -1,~ -** Processing line: ~ source_h: -1,~ -** 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: ~ }~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # return if world_lookup is not empty or if world is empty~ +** Processing line: ~ return if state.world_lookup.keys.length > 0~ +** Processing line: ~ return unless state.world.length > 0~ ** Processing line: ~~ -** Processing line: ~You can represent a sprite as an ~object~:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You can represent a sprite as an ~object~:~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ # Searches through the world and finds the coordinates that exist~ +** Processing line: ~ state.world_lookup = {}~ +** Processing line: ~ state.world.each { |x, y| state.world_lookup[[x, y]] = true }~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- 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, :a, :r, :g, :b,~ -** 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: ~ # Assigns collision rects for every sprite drawn~ +** Processing line: ~ state.world_collision_rects =~ +** Processing line: ~ state.world_lookup~ +** Processing line: ~ .keys~ +** Processing line: ~ .map do |coord_x, coord_y|~ +** Processing line: ~ s = state.tile_size~ +** Processing line: ~ # Multiplying by s (the size of a tile) ensures that the rect is~ +** Processing line: ~ # placed exactly where you want it to be placed (causes grid to coordinate)~ +** Processing line: ~ # How many pixels horizontally across and vertically up and down~ +** Processing line: ~ x = s * coord_x~ +** Processing line: ~ y = s * coord_y~ +** Processing line: ~ {~ +** Processing line: ~ args: [coord_x, coord_y],~ +** Processing line: ~ left_right: [x, y + 4, s, s - 6], # hash keys and values~ +** Processing line: ~ top: [x + 4, y + 6, s - 8, s - 6],~ +** Processing line: ~ bottom: [x + 1, y - 1, s - 2, s - 8],~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def primitive_marker~ -** Processing line: ~ :sprite~ +** Processing line: ~ # Calculates movement of player and calls methods that perform collision calculations~ +** Processing line: ~ def calc_player~ +** Processing line: ~ state.dy += state.gravity # what goes up must come down because of gravity~ +** Processing line: ~ calc_box_collision~ +** Processing line: ~ calc_edge_collision~ +** Processing line: ~ state.y += state.dy # Since velocity is the change in position, the change in y increases by dy~ +** Processing line: ~ state.x += state.dx # Ditto line above but dx and x~ +** Processing line: ~ state.dx *= 0.8 # Scales dx down~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ class BlueSquare < Sprite~ -** Processing line: ~ def initialize opts~ -** Processing line: ~ @x = opts[:x]~ -** Processing line: ~ @y = opts[:y]~ -** Processing line: ~ @w = opts[:w]~ -** Processing line: ~ @h = opts[:h]~ -** Processing line: ~ @path = 'sprites/square-blue.png'~ +** Processing line: ~ # Calls methods that determine whether the player collides with any world_collision_rects.~ +** Processing line: ~ def calc_box_collision~ +** Processing line: ~ return unless state.world_lookup.keys.length > 0 # return unless hash has atleast 1 key~ +** Processing line: ~ collision_floor~ +** Processing line: ~ collision_left~ +** Processing line: ~ collision_right~ +** Processing line: ~ collision_ceiling~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.sprites << (BlueSquare.new x: 640 - 50,~ -** Processing line: ~ y: 360 - 50,~ -** Processing line: ~ w: 50,~ -** Processing line: ~ h: 50)~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Finds collisions between the bottom of the player's rect and the top of a world_collision_rect.~ +** Processing line: ~ def collision_floor~ +** Processing line: ~ return unless state.dy <= 0 # return unless player is going down or is as far down as possible~ +** Processing line: ~ player_rect = [state.x, next_y, state.tile_size, state.tile_size] # definition of player~ ** Processing line: ~~ +** Processing line: ~ # Runs through all the sprites on the field and finds all intersections between player's~ +** Processing line: ~ # bottom and the top of a rect.~ +** Processing line: ~ floor_collisions = state.world_collision_rects~ +** Processing line: ~ .find_all { |r| r[:top].intersect_rect?(player_rect, state.collision_tolerance) }~ +** Processing line: ~ .first~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: How To Render A Label~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: How To Render A Label~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ return unless floor_collisions # performs following changes if a collision has occurred~ +** Processing line: ~ state.y = floor_collisions[:top].top # y of player is set to the y of the colliding rect's top~ +** Processing line: ~ state.dy = 0 # no change in y because the player's path is blocked~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~~args.outputs.labels~ is used to render labels.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.outputs.labels~ is used to render labels.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~Labels are how you display text. This code will go directly inside of the ~def tick args~ method.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Labels are how you display text. This code will go directly inside of the ~def tick args~ method.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~Here is the minimum code:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Here is the minimum code:~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Finds collisions between the player's left side and the right side of a world_collision_rect.~ +** Processing line: ~ def collision_left~ +** Processing line: ~ return unless state.dx < 0 # return unless player is moving left~ +** Processing line: ~ player_rect = [next_x, state.y, state.tile_size, state.tile_size]~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # X Y TEXT~ -** Processing line: ~ args.outputs.labels << [640, 360, "I am a black label."]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Runs through all the sprites on the field and finds all intersections between the player's left side~ +** Processing line: ~ # and the right side of a rect.~ +** Processing line: ~ left_side_collisions = state.world_collision_rects~ +** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) }~ +** Processing line: ~ .first~ ** Processing line: ~~ +** Processing line: ~ return unless left_side_collisions # return unless collision occurred~ +** Processing line: ~ state.x = left_side_collisions[:left_right].right # sets player's x to the x of the colliding rect's right side~ +** Processing line: ~ state.dx = 0 # no change in x because the player's path is blocked~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: A Colored Label~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: A Colored Label~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Finds collisions between the right side of the player and the left side of a world_collision_rect.~ +** Processing line: ~ def collision_right~ +** Processing line: ~ return unless state.dx > 0 # return unless player is moving right~ +** Processing line: ~ player_rect = [next_x, state.y, state.tile_size, state.tile_size]~ ** Processing line: ~~ +** Processing line: ~ # Runs through all the sprites on the field and finds all intersections between the player's~ +** Processing line: ~ # right side and the left side of a rect.~ +** Processing line: ~ right_side_collisions = state.world_collision_rects~ +** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) }~ +** Processing line: ~ .first~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # A colored label~ -** Processing line: ~ # X Y TEXT, RED GREEN BLUE ALPHA~ -** Processing line: ~ args.outputs.labels << [640, 360, "I am a redish label.", 255, 128, 128, 255]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ return unless right_side_collisions # return unless collision occurred~ +** Processing line: ~ state.x = right_side_collisions[:left_right].left - state.tile_size # player's x is set to the x of colliding rect's left side (minus tile size since x is the player's bottom left corner)~ +** Processing line: ~ state.dx = 0 # no change in x because the player's path is blocked~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Finds collisions between the top of the player's rect and the bottom of a world_collision_rect.~ +** Processing line: ~ def collision_ceiling~ +** Processing line: ~ return unless state.dy > 0 # return unless player is moving up~ +** Processing line: ~ player_rect = [state.x, next_y, state.player_width, state.player_height]~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: Extended Label Properties~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: Extended Label Properties~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Runs through all the sprites on the field and finds all intersections between the player's top~ +** Processing line: ~ # and the bottom of a rect.~ +** Processing line: ~ ceil_collisions = state.world_collision_rects~ +** Processing line: ~ .find_all { |r| r[:bottom].intersect_rect?(player_rect, state.collision_tolerance) }~ +** Processing line: ~ .first~ ** Processing line: ~~ +** Processing line: ~ return unless ceil_collisions # return unless collision occurred~ +** Processing line: ~ state.y = ceil_collisions[:bottom].y - state.tile_size # player's y is set to the y of the colliding rect's bottom (minus tile size)~ +** Processing line: ~ state.dy = 0 # no change in y because the player's path is blocked~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # A colored label~ -** Processing line: ~ # X Y TEXT SIZE ALIGNMENT RED GREEN BLUE ALPHA FONT FILE~ -** Processing line: ~ args.outputs.labels << [~ -** Processing line: ~ 640, # X~ -** Processing line: ~ 360, # Y~ -** Processing line: ~ "Hello world", # TEXT~ -** Processing line: ~ 0, # SIZE_ENUM~ -** Processing line: ~ 1, # ALIGNMENT_ENUM~ -** Processing line: ~ 0, # RED~ -** Processing line: ~ 0, # GREEN~ -** Processing line: ~ 0, # BLUE~ -** Processing line: ~ 255, # ALPHA~ -** Processing line: ~ "fonts/coolfont.ttf" # FONT~ -** Processing line: ~ ]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Makes sure the player remains within the screen's dimensions.~ +** Processing line: ~ def calc_edge_collision~ +** Processing line: ~ # Ensures that player doesn't fall below the map~ +** Processing line: ~ if next_y < 0 && state.dy < 0 # if player is moving down and is about to fall (next_y) below the map's scope~ +** Processing line: ~ state.y = 0 # 0 is the lowest the player can be while staying on the screen~ +** Processing line: ~ state.dy = 0~ +** Processing line: ~ # Ensures player doesn't go insanely high~ +** Processing line: ~ elsif next_y > 720 - state.tile_size && state.dy > 0 # if player is moving up, about to exceed map's scope~ +** Processing line: ~ state.y = 720 - state.tile_size # if we don't subtract tile_size, we won't be able to see the player on the screen~ +** Processing line: ~ state.dy = 0~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~A ~SIZE_ENUM~ of ~0~ represents "default size". A ~negative~ value will decrease the label size. A ~positive~ value will increase the label's size.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~A ~SIZE_ENUM~ of ~0~ represents "default size". A ~negative~ value will decrease the label size. A ~positive~ value will increase the label's size.~ -- Line's tilde count is: 8 -- Line contains link marker: false -- CODE detected. -** Processing line: ~An ~ALIGNMENT_ENUM~ of ~0~ represents "left aligned". ~1~ represents "center aligned". ~2~ represents "right aligned".~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~An ~ALIGNMENT_ENUM~ of ~0~ represents "left aligned". ~1~ represents "center aligned". ~2~ represents "right aligned".~ -- Line's tilde count is: 8 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ # Ensures that player remains in the horizontal range its supposed to~ +** Processing line: ~ if state.x >= 1280 - state.tile_size && state.dx > 0 # if the player is moving too far right~ +** Processing line: ~ state.x = 1280 - state.tile_size # farthest right the player can be while remaining in the screen's scope~ +** Processing line: ~ state.dx = 0~ +** Processing line: ~ elsif state.x <= 0 && state.dx < 0 # if the player is moving too far left~ +** Processing line: ~ state.x = 0 # farthest left the player can be while remaining in the screen's scope~ +** Processing line: ~ state.dx = 0~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: Rendering A Label As A ~Hash~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: Rendering A Label As A ~Hash~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def calc_sprite_selection~ +** Processing line: ~ # Does the transition to bring down the select sprite screen~ +** Processing line: ~ if state.mode == :selecting && state.select_menu.y != 0~ +** Processing line: ~ state.select_menu.y = 0 # sets y position of select menu (shown when 's' is pressed)~ +** Processing line: ~ state.banner_coords.y = 680 # sets y position of Select Sprite banner~ +** Processing line: ~ state.sprite_coords = state.sprite_coords.map do |x, y, w, h|~ +** Processing line: ~ [x, y - 720, w, h] # sets definition of sprites (change '-' to '+' and the sprites can't be seen)~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~You can add additional metadata about your game within a label, which requires you to use a `Hash` instead.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You can add additional metadata about your game within a label, which requires you to use a `Hash` instead.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Does the transition to leave the select sprite screen~ +** Processing line: ~ if state.mode == :creating && state.select_menu.y != 720~ +** Processing line: ~ state.select_menu.y = 720 # sets y position of select menu (menu is retreated back up)~ +** Processing line: ~ state.banner_coords.y = 1000 # sets y position of Select Sprite banner~ +** Processing line: ~ state.sprite_coords = state.sprite_coords.map do |x, y, w, h|~ +** Processing line: ~ [x, y + 720, w, h] # sets definition of all elements in collection~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- 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: ~ # 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: {~ -** Processing line: ~ value_1: "value",~ -** Processing line: ~ value_2: "value two",~ -** Processing line: ~ a_number: 15~ -** Processing line: ~ }~ -** Processing line: ~ }~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def process_inputs~ +** Processing line: ~ # If the state.mode is back and if the menu has retreated back up~ +** Processing line: ~ # call methods that process user inputs~ +** Processing line: ~ if state.mode == :creating~ +** Processing line: ~ process_inputs_player_movement~ +** Processing line: ~ process_inputs_place_tile~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # For each sprite_coordinate added, check what sprite was selected~ +** Processing line: ~ if state.mode == :selecting~ +** Processing line: ~ state.sprite_coords.map do |x, y, order| # goes through all sprites in collection~ +** Processing line: ~ # checks that a specific sprite was pressed based on x, y position~ +** Processing line: ~ if inputs.mouse.down && # the && (and) sign means ALL statements must be true for the evaluation to be true~ +** Processing line: ~ inputs.mouse.down.point.x >= x && # x is greater than or equal to sprite's x and~ +** Processing line: ~ inputs.mouse.down.point.x <= x + 50 && # x is less than or equal to 50 pixels to the right~ +** Processing line: ~ inputs.mouse.down.point.y >= y && # y is greater than or equal to sprite's y~ +** Processing line: ~ inputs.mouse.down.point.y <= y + 50 # y is less than or equal to 50 pixels up~ +** Processing line: ~ state.sprite_selected = order # sprite is chosen~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: Getting The Size Of A Piece Of Text~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: Getting The Size Of A Piece Of Text~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ inputs_export_stage~ +** Processing line: ~ process_inputs_show_available_sprites~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~You can get the render size of any string using ~args.gtk.calcstringbox~.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You can get the render size of any string using ~args.gtk.calcstringbox~.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ # Moves the player based on the keys they press on their keyboard~ +** Processing line: ~ def process_inputs_player_movement~ +** Processing line: ~ # Sets dx to 0 if the player lets go of arrow keys (player won't move left or right)~ +** Processing line: ~ if inputs.keyboard.key_up.right~ +** Processing line: ~ state.dx = 0~ +** Processing line: ~ elsif inputs.keyboard.key_up.left~ +** Processing line: ~ state.dx = 0~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # TEXT SIZE_ENUM FONT~ -** Processing line: ~ w, h = args.gtk.calcstringbox("some string", 0, "font.ttf")~ +** Processing line: ~ # Sets dx to 3 in whatever direction the player chooses when they hold down (or press) the left or right keys~ +** Processing line: ~ if inputs.keyboard.key_held.right~ +** Processing line: ~ state.dx = 3~ +** Processing line: ~ elsif inputs.keyboard.key_held.left~ +** Processing line: ~ state.dx = -3~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # NOTE: The SIZE_ENUM and FONT are optional arguments.~ +** Processing line: ~ # Sets dy to 5 to make the player ~fly~ when they press the space bar on their keyboard~ +** Processing line: ~ if inputs.keyboard.key_held.space~ +** Processing line: ~ state.dy = 5~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Render a label showing the w and h of the text:~ -** Processing line: ~ args.outputs.labels << [~ -** Processing line: ~ 10,~ -** Processing line: ~ 710,~ -** Processing line: ~ # This string uses Ruby's string interpolation literal: #{}~ -** Processing line: ~ "'some string' has width: #{w}, and height: #{h}."~ -** Processing line: ~ ]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Adds tile in the place the user holds down the mouse~ +** Processing line: ~ def process_inputs_place_tile~ +** Processing line: ~ if inputs.mouse.down # if mouse is pressed~ +** Processing line: ~ state.world_lookup = {}~ +** Processing line: ~ x, y = to_coord inputs.mouse.down.point # gets x, y coordinates for the grid~ ** Processing line: ~~ +** Processing line: ~ # Checks if any coordinates duplicate (already exist in world)~ +** Processing line: ~ if state.world.any? { |existing_x, existing_y, n| existing_x == x && existing_y == y }~ +** Processing line: ~ #erases existing tile space by rejecting them from world~ +** Processing line: ~ state.world = state.world.reject do |existing_x, existing_y, n|~ +** Processing line: ~ existing_x == x && existing_y == y~ +** Processing line: ~ end~ +** Processing line: ~ else~ +** Processing line: ~ state.world << [x, y, state.sprite_selected] # If no duplicates, add the sprite~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: How To Play A Sound~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: How To Play A Sound~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Stores/exports world collection's info (coordinates, sprite number) into a file~ +** Processing line: ~ def inputs_export_stage~ +** Processing line: ~ if inputs.keyboard.key_down.e # if "e" is pressed~ +** Processing line: ~ export_string = state.world.map do |x, y, sprite_number| # stores world info in a string~ +** Processing line: ~ "#{x},#{y},#{sprite_number}" # using string interpolation~ +** Processing line: ~ end~ +** Processing line: ~ gtk.write_file(MAP_FILE_PATH, export_string.join("\n")) # writes string into a file~ +** Processing line: ~ state.map_saved_at = state.tick_count # frame number (passage of time) when the map was saved~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~Sounds that end ~.wav~ will play once:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Sounds that end ~.wav~ will play once:~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def process_inputs_show_available_sprites~ +** Processing line: ~ # Based on keyboard input, the entity (:creating and :selecting) switch~ +** Processing line: ~ if inputs.keyboard.key_held.s && state.mode == :creating # if "s" is pressed and currently creating~ +** Processing line: ~ state.mode = :selecting # will change to selecting~ +** Processing line: ~ inputs.keyboard.clear # VERY IMPORTANT! If not present, it'll flicker between on and off~ +** Processing line: ~ elsif inputs.keyboard.key_held.s && state.mode == :selecting # if "s" is pressed and currently selecting~ +** Processing line: ~ state.mode = :creating # will change to creating~ +** Processing line: ~ inputs.keyboard.clear # VERY IMPORTANT! If not present, it'll flicker between on and off~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # Play a sound every second~ -** Processing line: ~ if (args.state.tick_count % 60) == 0~ -** Processing line: ~ args.outputs.sounds << 'something.wav'~ +** Processing line: ~ # Loads the world collection by reading from the map.txt file in the app folder~ +** Processing line: ~ def attempt_load_world_from_file~ +** Processing line: ~ return if state.world # return if the world collection is already populated~ +** Processing line: ~ state.world ||= [] # initialized as an empty collection~ +** Processing line: ~ exported_world = gtk.read_file(MAP_FILE_PATH) # reads the file using the path mentioned at top of code~ +** Processing line: ~ return unless exported_world # return unless the file read was successful~ +** Processing line: ~ state.world = exported_world.each_line.map do |l| # perform action on each line of exported_world~ +** Processing line: ~ l.split(',').map(&:to_i) # calls split using ',' as a delimiter, and invokes .map on the collection,~ +** Processing line: ~ # calling to_i (converts to integers) on each element~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. ** Processing line: ~~ -** Processing line: ~Sounds that end ~.ogg~ is considered background music and will loop:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Sounds that end ~.ogg~ is considered background music and will loop:~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ # Adds the change in y to y to determine the next y position of the player.~ +** Processing line: ~ def next_y~ +** Processing line: ~ state.y + state.dy~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # Start a sound loop at the beginning of the game~ -** Processing line: ~ if args.state.tick_count == 0~ -** Processing line: ~ args.outputs.sounds << 'background_music.ogg'~ +** Processing line: ~ # Determines next x position of player~ +** Processing line: ~ def next_x~ +** Processing line: ~ if state.dx < 0 # if the player moves left~ +** Processing line: ~ return state.x - (state.tile_size - state.player_width) # subtracts since the change in x is negative (player is moving left)~ +** Processing line: ~ else~ +** Processing line: ~ return state.x + (state.tile_size - state.player_width) # adds since the change in x is positive (player is moving right)~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def to_coord point~ +** Processing line: ~ # Integer divides (idiv) point.x to turn into grid~ +** Processing line: ~ # Then, you can just multiply each integer by state.tile_size~ +** Processing line: ~ # later and huzzah. Grid coordinates~ +** Processing line: ~ [point.x.idiv(state.tile_size), point.y.idiv(state.tile_size)]~ ** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. ** Processing line: ~~ -** Processing line: ~If you want to play a ~.ogg~ once as if it were a sound effect, you can do:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~If you want to play a ~.ogg~ once as if it were a sound effect, you can do:~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ $metroidvania_starter = MetroidvaniaStarter.new~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. ** Processing line: ~ def tick args~ -** Processing line: ~ # Play a sound every second~ -** Processing line: ~ if (args.state.tick_count % 60) == 0~ -** Processing line: ~ args.gtk.queue_sound 'some-ogg.ogg'~ -** Processing line: ~ end~ +** Processing line: ~ $metroidvania_starter.grid = args.grid~ +** Processing line: ~ $metroidvania_starter.inputs = args.inputs~ +** Processing line: ~ $metroidvania_starter.state = args.state~ +** Processing line: ~ $metroidvania_starter.outputs = args.outputs~ +** Processing line: ~ $metroidvania_starter.gtk = args.gtk~ +** Processing line: ~ $metroidvania_starter.tick~ ** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: Using ~args.state~ To Store Your Game State~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: Using ~args.state~ To Store Your Game State~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~~args.state~ is a open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of ~class~.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.state~ is a open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of ~class~.~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. -** Processing line: ~To initialize your game state, use the ~||=~ operator. Any value on the right side of ~||=~ will only be assigned _once_.~ -- P detected. +** Processing line: ~*** Physics And Collisions - Box Collision 3 - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~To initialize your game state, use the ~||=~ operator. Any value on the right side of ~||=~ will only be assigned _once_.~ -- Line's tilde count is: 4 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Box Collision 3 - main.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~To assign a value every frame, just use the ~=~ operator, but _make sure_ you've initialized a default value.~ -- P detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~To assign a value every frame, just use the ~=~ operator, but _make sure_ you've initialized a default value.~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Box Collision 3 - main.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. ** Processing line: ~~ -** Processing line: ~#+begin_src~ +** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # initialize your game state ONCE~ -** Processing line: ~ args.state.player.x ||= 0~ -** Processing line: ~ args.state.player.y ||= 0~ -** Processing line: ~ args.state.player.hp ||= 100~ -** Processing line: ~~ -** Processing line: ~ # increment the x position of the character by one every frame~ -** Processing line: ~ args.state.player.x += 1~ +** Processing line: ~ # ./samples/04_physics_and_collisions/06_box_collision_3/app/main.rb~ +** Processing line: ~ class Game~ +** Processing line: ~ attr_gtk~ ** Processing line: ~~ -** Processing line: ~ # Render a sprite with a label above the sprite~ -** Processing line: ~ args.outputs.sprites << [~ -** Processing line: ~ args.state.player.x,~ -** Processing line: ~ args.state.player.y,~ -** Processing line: ~ 32, 32,~ -** Processing line: ~ "player.png"~ -** Processing line: ~ ]~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ render~ +** Processing line: ~ input_edit_map~ +** Processing line: ~ input_player~ +** Processing line: ~ calc_player~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.labels << [~ -** Processing line: ~ args.state.player.x,~ -** Processing line: ~ args.state.player.y - 50,~ -** Processing line: ~ args.state.player.hp~ -** Processing line: ~ ]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def defaults~ +** Processing line: ~ state.gravity = -0.4~ +** Processing line: ~ state.drag = 0.15~ +** Processing line: ~ state.tile_size = 32~ +** Processing line: ~ state.player.size = 16~ +** Processing line: ~ state.player.jump_power = 12~ ** Processing line: ~~ +** Processing line: ~ state.tiles ||= []~ +** Processing line: ~ state.player.y ||= 800~ +** Processing line: ~ state.player.x ||= 100~ +** Processing line: ~ state.player.dy ||= 0~ +** Processing line: ~ state.player.dx ||= 0~ +** Processing line: ~ state.player.jumped_down_at ||= 0~ +** Processing line: ~ state.player.jumped_at ||= 0~ ** Processing line: ~~ -** Processing line: ~* CHEATSHEET: Troubleshoot Performance~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~CHEATSHEET: Troubleshoot Performance~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ calc_player_rect if !state.player.rect~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def render~ +** Processing line: ~ outputs.labels << [10, 10.from_top, "tile: click to add a tile, hold X key and click to delete a tile."]~ +** Processing line: ~ outputs.labels << [10, 35.from_top, "move: use left and right to move, space to jump, down and space to jump down."]~ +** Processing line: ~ outputs.labels << [10, 55.from_top, " You can jump through or jump down through tiles with a height of 1."]~ +** Processing line: ~ outputs.background_color = [80, 80, 80]~ +** Processing line: ~ outputs.sprites << tiles.map(&:sprite)~ +** Processing line: ~ outputs.sprites << (player.rect.merge path: 'sprites/square/green.png')~ +** Processing line: ~~ +** Processing line: ~ mouse_overlay = {~ +** Processing line: ~ x: (inputs.mouse.x.ifloor state.tile_size),~ +** Processing line: ~ y: (inputs.mouse.y.ifloor state.tile_size),~ +** Processing line: ~ w: state.tile_size,~ +** Processing line: ~ h: state.tile_size,~ +** Processing line: ~ a: 100~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~1. If you're using ~Array~s for your primitives (~args.outputs.sprites << []~), use ~Hash~ instead (~args.outputs.sprites << { x: ... }~).~ -- OL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ If you're using ~Array~s for your primitives (~args.outputs.sprites << []~), use ~Hash~ instead (~args.outputs.sprites << { x: ... }~).~ -- Line's tilde count is: 8 -- Line contains link marker: false -- CODE detected. -** Processing line: ~2. If you're using ~Entity~ for your primitives (~args.outputs.sprites << args.state.new_entity~), use ~StrictEntity~ instead (~args.outputs.sprites << args.state.new_entity_strict~).~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ If you're using ~Entity~ for your primitives (~args.outputs.sprites << args.state.new_entity~), use ~StrictEntity~ instead (~args.outputs.sprites << args.state.new_entity_strict~).~ -- Line's tilde count is: 8 -- Line contains link marker: false -- CODE detected. -** Processing line: ~3. Use ~.each~ instead of ~.map~ if you don't care about the return value.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ Use ~.each~ instead of ~.map~ if you don't care about the return value.~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. -** Processing line: ~4. When concatenating primitives to outputs, do them in bulk. Instead of:~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~ When concatenating primitives to outputs, do them in bulk. Instead of:~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ args.state.bullets.each do |bullet|~ -** Processing line: ~ args.outputs.sprites << bullet.sprite~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. -** Processing line: ~do~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~do~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ args.outputs.sprites << args.state.bullets.map do |b|~ -** Processing line: ~ b.sprite~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ mouse_overlay = mouse_overlay.merge r: 255 if state.delete_mode~ ** Processing line: ~~ -** Processing line: ~5. Use ~args.outputs.static_~ variant for things that don't change often (take a look at the Basic Gorillas sample app and Dueling Starships sample app to see how ~static_~ is leveraged.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~5. Use ~args.outputs.static_~ variant for things that don't change often (take a look at the Basic Gorillas sample app and Dueling Starships sample app to see how ~static_~ is leveraged.~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. -** Processing line: ~6. Consider using a ~render_target~ if you're doing some form of a camera that moves a lot of primitives (take a look at the Render Target sample apps for more info).~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~6. Consider using a ~render_target~ if you're doing some form of a camera that moves a lot of primitives (take a look at the Render Target sample apps for more info).~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ if state.mouse_held~ +** Processing line: ~ outputs.primitives << mouse_overlay.border~ +** Processing line: ~ else~ +** Processing line: ~ outputs.primitives << mouse_overlay.solid~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::Runtime~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::Runtime~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~The GTK::Runtime class is the core of DragonRuby. It is globally accessible via ~$gtk~.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The GTK::Runtime class is the core of DragonRuby. It is globally accessible via ~$gtk~.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def input_edit_map~ +** Processing line: ~ state.mouse_held = true if inputs.mouse.down~ +** Processing line: ~ state.mouse_held = false if inputs.mouse.up~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::Runtime#write_file~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::Runtime#write_file~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~This function takes in two parameters. The first paramter is the file path and assumes the the game directory is the root. The second parameter is the string that will be written. The method overwrites whatever is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~This function takes in two parameters. The first paramter is the file path and assumes the the game directory is the root. The second parameter is the string that will be written. The method overwrites whatever is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ if inputs.keyboard.x~ +** Processing line: ~ state.delete_mode = true~ +** Processing line: ~ elsif inputs.keyboard.key_up.x~ +** Processing line: ~ state.delete_mode = false~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ if args.inputs.mouse.click~ -** Processing line: ~ args.gtk.write_file "last-mouse-click.txt", "Mouse was clicked at #{args.state.tick_count}."~ -** Processing line: ~ end~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ return unless state.mouse_held~ ** Processing line: ~~ +** Processing line: ~ ordinal = { x: (inputs.mouse.x.idiv state.tile_size),~ +** Processing line: ~ y: (inputs.mouse.y.idiv state.tile_size) }~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::Runtime#reset~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::Runtime#reset~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~This function will reset Kernel.tick_count to 0 and will remove all data from args.state.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~This function will reset Kernel.tick_count to 0 and will remove all data from args.state.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ found = find_tile ordinal~ +** Processing line: ~ if !found && !state.delete_mode~ +** Processing line: ~ tiles << (state.new_entity :tile, ordinal)~ +** Processing line: ~ recompute_tiles~ +** Processing line: ~ elsif found && state.delete_mode~ +** Processing line: ~ tiles.delete found~ +** Processing line: ~ recompute_tiles~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::Runtime#calcstringbox~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::Runtime#calcstringbox~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~This function returns the width and height of a string.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~This function returns the width and height of a string.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def input_player~ +** Processing line: ~ player.dx += inputs.left_right~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.string_size ||= args.gtk.calcstringbox "Hello World"~ -** Processing line: ~ args.state.string_size_font_size ||= args.gtk.calcstringbox "Hello World"~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ if inputs.keyboard.key_down.space && inputs.keyboard.down~ +** Processing line: ~ player.dy = player.jump_power * -1~ +** Processing line: ~ player.jumped_at = 0~ +** Processing line: ~ player.jumped_down_at = state.tick_count~ +** Processing line: ~ elsif inputs.keyboard.key_down.space~ +** Processing line: ~ player.dy = player.jump_power~ +** Processing line: ~ player.jumped_at = state.tick_count~ +** Processing line: ~ player.jumped_down_at = 0~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def calc_player~ +** Processing line: ~ calc_player_rect~ +** Processing line: ~ calc_below~ +** Processing line: ~ calc_left~ +** Processing line: ~ calc_right~ +** Processing line: ~ calc_above~ +** Processing line: ~ calc_player_dy~ +** Processing line: ~ calc_player_dx~ +** Processing line: ~ reset_player if player_off_stage?~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def calc_player_rect~ +** Processing line: ~ player.rect = current_player_rect~ +** Processing line: ~ player.next_rect = player.rect.merge x: player.x + player.dx,~ +** Processing line: ~ y: player.y + player.dy~ +** Processing line: ~ player.prev_rect = player.rect.merge x: player.x - player.dx,~ +** Processing line: ~ y: player.y - player.dy~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def calc_below~ +** Processing line: ~ return unless player.dy <= 0~ +** Processing line: ~ tiles_below = find_tiles { |t| t.rect.top <= player.y }~ +** Processing line: ~ collision = find_colliding_tile tiles_below, (player.rect.merge y: player.next_rect.y)~ +** Processing line: ~ return unless collision~ +** Processing line: ~ if collision.neighbors.b == :none && player.jumped_down_at.elapsed_time < 10~ +** Processing line: ~ player.dy = -1~ +** Processing line: ~ else~ +** Processing line: ~ player.y = collision.rect.y + state.tile_size~ +** Processing line: ~ player.dy = 0~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Array~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Array~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def calc_left~ +** Processing line: ~ return unless player.dx < 0~ +** Processing line: ~ tiles_left = find_tiles { |t| t.rect.right <= player.prev_rect.left }~ +** Processing line: ~ collision = find_colliding_tile tiles_left, (player.rect.merge x: player.next_rect.x)~ +** Processing line: ~ return unless collision~ +** Processing line: ~ player.x = collision.rect.right~ +** Processing line: ~ player.dx = 0~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~The Array class has been extend to provide methods that will help in common game development tasks. Array is one of the most powerful classes in Ruby and a very fundamental component of Game Toolkit.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The Array class has been extend to provide methods that will help in common game development tasks. Array is one of the most powerful classes in Ruby and a very fundamental component of Game Toolkit.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def calc_right~ +** Processing line: ~ return unless player.dx > 0~ +** Processing line: ~ tiles_right = find_tiles { |t| t.rect.left >= player.prev_rect.right }~ +** Processing line: ~ collision = find_colliding_tile tiles_right, (player.rect.merge x: player.next_rect.x)~ +** Processing line: ~ return unless collision~ +** Processing line: ~ player.x = collision.rect.left - player.rect.w~ +** Processing line: ~ player.dx = 0~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def calc_above~ +** Processing line: ~ return unless player.dy > 0~ +** Processing line: ~ tiles_above = find_tiles { |t| t.rect.y >= player.y }~ +** Processing line: ~ collision = find_colliding_tile tiles_above, (player.rect.merge y: player.next_rect.y)~ +** Processing line: ~ return unless collision~ +** Processing line: ~ return if collision.neighbors.t == :none~ +** Processing line: ~ player.dy = 0~ +** Processing line: ~ player.y = collision.rect.bottom - player.rect.h~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Array#map~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Array#map~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def calc_player_dx~ +** Processing line: ~ player.y += player.dy~ +** Processing line: ~ player.dy += state.gravity~ +** Processing line: ~ player.dy += player.dy * state.drag ** 2 * -1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~The function given a block returns a new ~Enumerable~ of values.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The function given a block returns a new ~Enumerable~ of values.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~Example of using ~Array#map~ in conjunction with ~args.state~ and ~args.outputs.sprites~ to render sprites to the screen.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Example of using ~Array#map~ in conjunction with ~args.state~ and ~args.outputs.sprites~ to render sprites to the screen.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def calc_player_dy~ +** Processing line: ~ player.dx = player.dx.clamp(-5, 5)~ +** Processing line: ~ player.dx *= 0.9~ +** Processing line: ~ player.x += player.dx~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # define the colors of the rainbow in ~args.state~~ -** Processing line: ~ # as an ~Array~ of ~Hash~es with :order and :name.~ -** Processing line: ~ # :order will be used to determine render location~ -** Processing line: ~ # and :name will be used to determine sprite path.~ -** Processing line: ~ args.state.rainbow_colors ||= [~ -** Processing line: ~ { order: 0, name: :red },~ -** Processing line: ~ { order: 1, name: :orange },~ -** Processing line: ~ { order: 2, name: :yellow },~ -** Processing line: ~ { order: 3, name: :green },~ -** Processing line: ~ { order: 4, name: :blue },~ -** Processing line: ~ { order: 5, name: :indigo },~ -** Processing line: ~ { order: 6, name: :violet },~ -** Processing line: ~ ]~ +** Processing line: ~ def reset_player~ +** Processing line: ~ player.x = 100~ +** Processing line: ~ player.y = 720~ +** Processing line: ~ player.dy = 0~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # render sprites diagonally to the screen~ -** Processing line: ~ # with a width and height of 50.~ -** Processing line: ~ args.outputs~ -** Processing line: ~ .sprites << args.state~ -** Processing line: ~ .rainbow_colors~ -** Processing line: ~ .map do |color| # <-- ~Array#map~ usage~ -** Processing line: ~ [~ -** Processing line: ~ color[:order] * 50,~ -** Processing line: ~ color[:order] * 50,~ -** Processing line: ~ 50,~ -** Processing line: ~ 50,~ -** Processing line: ~ "sprites/square-#{color[:name]}.png"~ -** Processing line: ~ ]~ -** Processing line: ~ end~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def recompute_tiles~ +** Processing line: ~ tiles.each do |t|~ +** Processing line: ~ t.w = state.tile_size~ +** Processing line: ~ t.h = state.tile_size~ +** Processing line: ~ t.neighbors = tile_neighbors t, tiles~ ** Processing line: ~~ +** Processing line: ~ t.rect = [t.x * state.tile_size,~ +** Processing line: ~ t.y * state.tile_size,~ +** Processing line: ~ state.tile_size,~ +** Processing line: ~ state.tile_size].rect.to_hash~ ** Processing line: ~~ +** Processing line: ~ sprite_sub_path = t.neighbors.mask.map { |m| flip_bit m }.join("")~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Array#each~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Array#each~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ t.sprite = {~ +** Processing line: ~ x: t.x * state.tile_size,~ +** Processing line: ~ y: t.y * state.tile_size,~ +** Processing line: ~ w: state.tile_size,~ +** Processing line: ~ h: state.tile_size,~ +** Processing line: ~ path: "sprites/tile/wall-#{sprite_sub_path}.png"~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~The function, given a block, invokes the block for each item in the ~Array~. ~Array#each~ is synonymous to foreach constructs in other languages.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The function, given a block, invokes the block for each item in the ~Array~. ~Array#each~ is synonymous to foreach constructs in other languages.~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. -** Processing line: ~Example of using ~Array#each~ in conjunction with ~args.state~ and ~args.outputs.sprites~ to render sprites to the screen:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Example of using ~Array#each~ in conjunction with ~args.state~ and ~args.outputs.sprites~ to render sprites to the screen:~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def flip_bit bit~ +** Processing line: ~ return 0 if bit == 1~ +** Processing line: ~ return 1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # define the colors of the rainbow in ~args.state~~ -** Processing line: ~ # as an ~Array~ of ~Hash~es with :order and :name.~ -** Processing line: ~ # :order will be used to determine render location~ -** Processing line: ~ # and :name will be used to determine sprite path.~ -** Processing line: ~ args.state.rainbow_colors ||= [~ -** Processing line: ~ { order: 0, name: :red },~ -** Processing line: ~ { order: 1, name: :orange },~ -** Processing line: ~ { order: 2, name: :yellow },~ -** Processing line: ~ { order: 3, name: :green },~ -** Processing line: ~ { order: 4, name: :blue },~ -** Processing line: ~ { order: 5, name: :indigo },~ -** Processing line: ~ { order: 6, name: :violet },~ -** Processing line: ~ ]~ +** Processing line: ~ def player~ +** Processing line: ~ state.player~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # render sprites diagonally to the screen~ -** Processing line: ~ # with a width and height of 50.~ -** Processing line: ~ args.state~ -** Processing line: ~ .rainbow_colors~ -** Processing line: ~ .map do |color| # <-- ~Array#each~ usage~ -** Processing line: ~ args.outputs.sprites << [~ -** Processing line: ~ color[:order] * 50,~ -** Processing line: ~ color[:order] * 50,~ -** Processing line: ~ 50,~ -** Processing line: ~ 50,~ -** Processing line: ~ "sprites/square-#{color[:name]}.png"~ -** Processing line: ~ ]~ -** Processing line: ~ end~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def player_off_stage?~ +** Processing line: ~ player.rect.top < grid.bottom ||~ +** Processing line: ~ player.rect.right < grid.left ||~ +** Processing line: ~ player.rect.left > grid.right~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def current_player_rect~ +** Processing line: ~ { x: player.x, y: player.y, w: player.size, h: player.size }~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def tiles~ +** Processing line: ~ state.tiles~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Array#reject_nil~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Array#reject_nil~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def find_tile ordinal~ +** Processing line: ~ tiles.find { |t| t.x == ordinal.x && t.y == ordinal.y }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~Returns an ~Enumerable~ rejecting items that are ~nil~, this is an alias for ~Array#compact~:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Returns an ~Enumerable~ rejecting items that are ~nil~, this is an alias for ~Array#compact~:~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def find_tiles &block~ +** Processing line: ~ tiles.find_all(&block)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ repl do~ -** Processing line: ~ a = [1, nil, 4, false, :a]~ -** Processing line: ~ puts a.reject_nil~ -** Processing line: ~ # => [1, 4, false, :a]~ -** Processing line: ~ puts a.compact~ -** Processing line: ~ # => [1, 4, false, :a]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def find_colliding_tile tiles, target~ +** Processing line: ~ tiles.find { |t| t.rect.intersect_rect? target }~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def tile_neighbors tile, other_points~ +** Processing line: ~ t = find_tile x: tile.x + 0, y: tile.y + 1~ +** Processing line: ~ r = find_tile x: tile.x + 1, y: tile.y + 0~ +** Processing line: ~ b = find_tile x: tile.x + 0, y: tile.y - 1~ +** Processing line: ~ l = find_tile x: tile.x - 1, y: tile.y + 0~ ** Processing line: ~~ +** Processing line: ~ tile_t, tile_r, tile_b, tile_l = 0~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Array#reject_false~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Array#reject_false~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ tile_t = 1 if t~ +** Processing line: ~ tile_r = 1 if r~ +** Processing line: ~ tile_b = 1 if b~ +** Processing line: ~ tile_l = 1 if l~ ** Processing line: ~~ -** Processing line: ~Returns an `Enumerable` rejecting items that are `nil` or `false`.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Returns an `Enumerable` rejecting items that are `nil` or `false`.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ state.new_entity :neighbors, mask: [tile_t, tile_r, tile_b, tile_l],~ +** Processing line: ~ t: t ? :some : :none,~ +** Processing line: ~ b: b ? :some : :none,~ +** Processing line: ~ l: l ? :some : :none,~ +** Processing line: ~ r: r ? :some : :none~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ repl do~ -** Processing line: ~ a = [1, nil, 4, false, :a]~ -** Processing line: ~ puts a.reject_false~ -** Processing line: ~ # => [1, 4, :a]~ +** 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: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~* DOCS: ~Array#product~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Array#product~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~Returns all combinations of values between two arrays.~ -- P detected. +** Processing line: ~*** Physics And Collisions - Jump Physics - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Returns all combinations of values between two arrays.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Jump Physics - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~Here are some examples of using ~product~. Paste the following code at the bottom of main.rb and save the file to see the results:~ -- P detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Here are some examples of using ~product~. Paste the following code at the bottom of main.rb and save the file to see the results:~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Jump Physics - main.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. ** Processing line: ~~ -** Processing line: ~#+begin_src~ +** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ repl do~ -** Processing line: ~ a = [0, 1]~ -** Processing line: ~ puts a.product~ -** Processing line: ~ # => [[0, 0], [0, 1], [1, 0], [1, 1]]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # ./samples/04_physics_and_collisions/07_jump_physics/app/main.rb~ +** Processing line: ~ =begin~ ** Processing line: ~~ +** Processing line: ~ Reminders:~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ repl do~ -** Processing line: ~ a = [ 0, 1]~ -** Processing line: ~ b = [:a, :b]~ -** Processing line: ~ puts a.product b~ -** Processing line: ~ # => [[0, :a], [0, :b], [1, :a], [1, :b]]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ +** Processing line: ~ For example, if we want to create a new button, we would declare it as a new entity and~ +** Processing line: ~ then define its properties. (Remember, you can use state to define ANY property and it will~ +** Processing line: ~ be retained across frames.)~ ** Processing line: ~~ +** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ +** Processing line: ~ The parameters for a solid are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ +** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ ** Processing line: ~~ +** Processing line: ~ - num1.greater(num2): Returns the greater value.~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Array#map_2d~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Array#map_2d~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ +** Processing line: ~ using their keys.~ ** Processing line: ~~ -** Processing line: ~Assuming the array is an array of arrays, Given a block, each 2D array index invoked against the block. A 2D array is a common way to store data/layout for a stage.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Assuming the array is an array of arrays, Given a block, each 2D array index invoked against the block. A 2D array is a common way to store data/layout for a stage.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect.~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ repl do~ -** Processing line: ~ stage = [~ -** Processing line: ~ [:enemy, :empty, :player],~ -** Processing line: ~ [:empty, :empty, :empty],~ -** Processing line: ~ [:enemy, :empty, :enemy],~ -** Processing line: ~ ]~ +** Processing line: ~ =end~ ** Processing line: ~~ -** Processing line: ~ occupied_tiles = stage.map_2d do |row, col, tile|~ -** Processing line: ~ if tile == :empty~ -** Processing line: ~ nil~ -** Processing line: ~ else~ -** Processing line: ~ [row, col, tile]~ -** Processing line: ~ end~ -** Processing line: ~ end.reject_nil~ +** Processing line: ~ # This sample app is a game that requires the user to jump from one platform to the next.~ +** Processing line: ~ # As the player successfully clears platforms, they become smaller and move faster.~ ** Processing line: ~~ -** Processing line: ~ puts "Stage:"~ -** Processing line: ~ puts stage~ +** Processing line: ~ class VerticalPlatformer~ +** Processing line: ~ attr_gtk~ ** Processing line: ~~ -** Processing line: ~ puts "Occupied Tiles"~ -** Processing line: ~ puts occupied_tiles~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # declares vertical platformer as new entity~ +** Processing line: ~ def s~ +** Processing line: ~ state.vertical_platformer ||= state.new_entity(:vertical_platformer)~ +** Processing line: ~ state.vertical_platformer~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # creates a new platform using a hash~ +** Processing line: ~ def new_platform hash~ +** Processing line: ~ s.new_entity_strict(:platform, hash) # platform key~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # calls methods needed for game to run properly~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ render~ +** Processing line: ~ calc~ +** Processing line: ~ input~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Array#include_any?~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Array#include_any?~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ # Sets default values~ +** Processing line: ~ def defaults~ +** Processing line: ~ s.platforms ||= [ # initializes platforms collection with two platforms using hashes~ +** Processing line: ~ new_platform(x: 0, y: 0, w: 700, h: 32, dx: 1, speed: 0, rect: nil),~ +** Processing line: ~ new_platform(x: 0, y: 300, w: 700, h: 32, dx: 1, speed: 0, rect: nil), # 300 pixels higher~ +** Processing line: ~ ]~ ** Processing line: ~~ -** Processing line: ~Given a collection of items, the function will return ~true~ if any of ~self~'s items exists in the collection of items passed in:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Given a collection of items, the function will return ~true~ if any of ~self~'s items exists in the collection of items passed in:~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ s.tick_count = args.state.tick_count~ +** Processing line: ~ s.gravity = -0.3 # what goes up must come down because of gravity~ +** Processing line: ~ s.player.platforms_cleared ||= 0 # counts how many platforms the player has successfully cleared~ +** Processing line: ~ s.player.x ||= 0 # sets player values~ +** Processing line: ~ s.player.y ||= 100~ +** Processing line: ~ s.player.w ||= 64~ +** Processing line: ~ s.player.h ||= 64~ +** Processing line: ~ s.player.dy ||= 0 # change in position~ +** Processing line: ~ s.player.dx ||= 0~ +** Processing line: ~ s.player_jump_power = 15~ +** Processing line: ~ s.player_jump_power_duration = 10~ +** Processing line: ~ s.player_max_run_speed = 5~ +** Processing line: ~ s.player_speed_slowdown_rate = 0.9~ +** Processing line: ~ s.player_acceleration = 1~ +** Processing line: ~ s.camera ||= { y: -100 } # shows view on screen (as the player moves upward, the camera does too)~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Outputs objects onto the screen~ +** Processing line: ~ def render~ +** Processing line: ~ outputs.solids << s.platforms.map do |p| # outputs platforms onto screen~ +** Processing line: ~ [p.x + 300, p.y - s.camera[:y], p.w, p.h] # add 300 to place platform in horizontal center~ +** Processing line: ~ # don't forget, position of platform is denoted by bottom left hand corner~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Array#any_intersect_rect?~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Array#any_intersect_rect?~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ # outputs player using hash~ +** Processing line: ~ outputs.solids << {~ +** Processing line: ~ x: s.player.x + 300, # player positioned on top of platform~ +** Processing line: ~ y: s.player.y - s.camera[:y],~ +** Processing line: ~ w: s.player.w,~ +** Processing line: ~ h: s.player.h,~ +** Processing line: ~ r: 100, # color saturation~ +** Processing line: ~ g: 100,~ +** Processing line: ~ b: 200~ +** Processing line: ~ }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~Assuming the array contains objects that respond to ~left~, ~right~, ~top~, ~bottom~, this method returns ~true~ if any of the elements within the array intersect the object being passed in. You are given an optional parameter called ~tolerance~ which informs how close to the other rectangles the elements need to be for it to be considered intersecting.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Assuming the array contains objects that respond to ~left~, ~right~, ~top~, ~bottom~, this method returns ~true~ if any of the elements within the array intersect the object being passed in. You are given an optional parameter called ~tolerance~ which informs how close to the other rectangles the elements need to be for it to be considered intersecting.~ -- Line's tilde count is: 12 -- Line contains link marker: false -- CODE detected. -** Processing line: ~The default tolerance is set to ~0.1~, which means that the primitives are not considered intersecting unless they are overlapping by more than ~0.1~.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The default tolerance is set to ~0.1~, which means that the primitives are not considered intersecting unless they are overlapping by more than ~0.1~.~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ # Performs calculations~ +** Processing line: ~ def calc~ +** Processing line: ~ s.platforms.each do |p| # for each platform in the collection~ +** Processing line: ~ p.rect = [p.x, p.y, p.w, p.h] # set the definition~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ repl do~ -** Processing line: ~ # Here is a player class that has position and implement~ -** Processing line: ~ # the ~attr_rect~ contract.~ -** Processing line: ~ class Player~ -** Processing line: ~ attr_rect~ -** Processing line: ~ attr_accessor :x, :y, :w, :h~ +** Processing line: ~ # sets player point by adding half the player's width to the player's x~ +** Processing line: ~ s.player.point = [s.player.x + s.player.w.half, s.player.y] # change + to - and see what happens!~ ** Processing line: ~~ -** Processing line: ~ def initialize x, y, w, h~ -** Processing line: ~ @x = x~ -** Processing line: ~ @y = y~ -** Processing line: ~ @w = w~ -** Processing line: ~ @h = h~ +** Processing line: ~ # search the platforms collection to find if the player's point is inside the rect of a platform~ +** Processing line: ~ collision = s.platforms.find { |p| s.player.point.inside_rect? p.rect }~ +** Processing line: ~~ +** Processing line: ~ # if collision occurred and player is moving down (or not moving vertically at all)~ +** Processing line: ~ if collision && s.player.dy <= 0~ +** Processing line: ~ s.player.y = collision.rect.y + collision.rect.h - 2 # player positioned on top of platform~ +** Processing line: ~ s.player.dy = 0 if s.player.dy < 0 # player stops moving vertically~ +** Processing line: ~ if !s.player.platform~ +** Processing line: ~ s.player.dx = 0 # no horizontal movement~ +** Processing line: ~ end~ +** Processing line: ~ # changes horizontal position of player by multiplying collision change in x (dx) by speed and adding it to current x~ +** Processing line: ~ s.player.x += collision.dx * collision.speed~ +** Processing line: ~ s.player.platform = collision # player is on the platform that it collided with (or landed on)~ +** Processing line: ~ if s.player.falling # if player is falling~ +** Processing line: ~ s.player.dx = 0 # no horizontal movement~ +** Processing line: ~ end~ +** Processing line: ~ s.player.falling = false~ +** Processing line: ~ s.player.jumped_at = nil~ +** Processing line: ~ else~ +** Processing line: ~ s.player.platform = nil # player is not on a platform~ +** Processing line: ~ s.player.y += s.player.dy # velocity is the change in position~ +** Processing line: ~ s.player.dy += s.gravity # acceleration is the change in velocity; what goes up must come down~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def serialize~ -** Processing line: ~ { x: @x, y: @y, w: @w, h: @h }~ +** Processing line: ~ s.platforms.each do |p| # for each platform in the collection~ +** Processing line: ~ p.x += p.dx * p.speed # x is incremented by product of dx and speed (causes platform to move horizontally)~ +** Processing line: ~ # changes platform's x so it moves left and right across the screen (between -300 and 300 pixels)~ +** Processing line: ~ if p.x < -300 # if platform goes too far left~ +** Processing line: ~ p.dx *= -1 # dx is scaled down~ +** Processing line: ~ p.x = -300 # as far left as possible within scope~ +** Processing line: ~ elsif p.x > (1000 - p.w) # if platform's x is greater than 300~ +** Processing line: ~ p.dx *= -1~ +** Processing line: ~ p.x = (1000 - p.w) # set to 300 (as far right as possible within scope)~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def inspect~ -** Processing line: ~ "#{serialize}"~ -** Processing line: ~ end~ +** Processing line: ~ delta = (s.player.y - s.camera[:y] - 100) # used to position camera view~ ** Processing line: ~~ -** Processing line: ~ def to_s~ -** Processing line: ~ "#{serialize}"~ +** Processing line: ~ if delta > -200~ +** Processing line: ~ s.camera[:y] += delta * 0.01 # allows player to see view as they move upwards~ +** Processing line: ~ s.player.x += s.player.dx # velocity is change in position; change in x increases by dx~ +** Processing line: ~~ +** Processing line: ~ # searches platform collection to find platforms located more than 300 pixels above the player~ +** Processing line: ~ has_platforms = s.platforms.find { |p| p.y > (s.player.y + 300) }~ +** Processing line: ~ if !has_platforms # if there are no platforms 300 pixels above the player~ +** Processing line: ~ width = 700 - (700 * (0.1 * s.player.platforms_cleared)) # the next platform is smaller than previous~ +** Processing line: ~ s.player.platforms_cleared += 1 # player successfully cleared another platform~ +** Processing line: ~ last_platform = s.platforms[-1] # platform just cleared becomes last platform~ +** Processing line: ~ # another platform is created 300 pixels above the last platform, and this~ +** Processing line: ~ # new platform has a smaller width and moves faster than all previous platforms~ +** Processing line: ~ s.platforms << new_platform(x: (700 - width) * rand, # random x position~ +** Processing line: ~ y: last_platform.y + 300,~ +** Processing line: ~ w: width,~ +** Processing line: ~ h: 32,~ +** Processing line: ~ dx: 1.randomize(:sign), # random change in x~ +** Processing line: ~ speed: 2 * s.player.platforms_cleared,~ +** Processing line: ~ rect: nil)~ +** Processing line: ~ end~ +** Processing line: ~ else~ +** Processing line: ~ s.as_hash.clear # otherwise clear the hash (no new platform is necessary)~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Here is a definition of two walls.~ -** Processing line: ~ walls = [~ -** Processing line: ~ [10, 10, 10, 10],~ -** Processing line: ~ { x: 20, y: 20, w: 10, h: 10 },~ -** Processing line: ~ ]~ +** Processing line: ~ # Takes input from the user to move the player~ +** Processing line: ~ def input~ +** Processing line: ~ if inputs.keyboard.space # if the space bar is pressed~ +** Processing line: ~ s.player.jumped_at ||= s.tick_count # set to current frame~ ** Processing line: ~~ -** Processing line: ~ # Display the walls.~ -** Processing line: ~ puts "Walls."~ -** Processing line: ~ puts walls~ -** Processing line: ~ puts ""~ +** Processing line: ~ # if the time that has passed since the jump is less than the duration of a jump (10 frames)~ +** Processing line: ~ # and the player is not falling~ +** Processing line: ~ if s.player.jumped_at.elapsed_time < s.player_jump_power_duration && !s.player.falling~ +** Processing line: ~ s.player.dy = s.player_jump_power # player jumps up~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Check any_intersect_rect? on player~ -** Processing line: ~ player = Player.new 30, 20, 10, 10~ -** Processing line: ~ puts "Is Player #{player} touching wall?"~ -** Processing line: ~ puts (walls.any_intersect_rect? player)~ -** Processing line: ~ # => false~ -** Processing line: ~ # The value is false because of the default tolerance is 0.1.~ -** Processing line: ~ # The overlap of the player rect and any of the wall rects is~ -** Processing line: ~ # less than 0.1 (for those that intersect).~ -** Processing line: ~ puts ""~ +** Processing line: ~ if inputs.keyboard.key_up.space # if space bar is in "up" state~ +** Processing line: ~ s.player.falling = true # player is falling~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ player = Player.new 9, 10, 10, 10~ -** Processing line: ~ puts "Is Player #{player} touching wall?"~ -** Processing line: ~ puts (walls.any_intersect_rect? player)~ -** Processing line: ~ # => true~ -** Processing line: ~ puts ""~ +** Processing line: ~ if inputs.keyboard.left # if left key is pressed~ +** Processing line: ~ s.player.dx -= s.player_acceleration # player's position changes, decremented by acceleration~ +** Processing line: ~ s.player.dx = s.player.dx.greater(-s.player_max_run_speed) # dx is either current dx or -5, whichever is greater~ +** Processing line: ~ elsif inputs.keyboard.right # if right key is pressed~ +** Processing line: ~ s.player.dx += s.player_acceleration # player's position changes, incremented by acceleration~ +** Processing line: ~ s.player.dx = s.player.dx.lesser(s.player_max_run_speed) # dx is either current dx or 5, whichever is lesser~ +** Processing line: ~ else~ +** Processing line: ~ s.player.dx *= s.player_speed_slowdown_rate # scales dx down~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. -** Processing line: ~~ -** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::Outputs~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::Outputs~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~Outputs is how you render primitives to the screen. The minimal setup for rendering something to the screen is via a ~tick~ method defined in mygame/app/main.rb~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Outputs is how you render primitives to the screen. The minimal setup for rendering something to the screen is via a ~tick~ method defined in mygame/app/main.rb~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ $game = VerticalPlatformer.new~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. ** Processing line: ~ def tick args~ -** Processing line: ~ # code goes here~ +** Processing line: ~ $game.args = args~ +** Processing line: ~ $game.tick~ ** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. -** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::Outputs#solids~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::Outputs#solids~~ -- 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 solid 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 solid to the screen.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~** Rendering a solid using an Array~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Rendering a solid 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 solid using an Array~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~~ -** Processing line: ~Creates a solid black rectangle 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 solid black rectangle 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~ -** Processing line: ~ args.outputs.solids << [100, 100, 160, 90]~ -** Processing line: ~ end~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~** Rendering a solid 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 solid using an Array with colors and alpha~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - ball.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Rendering a solid using an Array with colors and alpha~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Bouncing On Collision - ball.rb~ - 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.~ -- 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.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. -** Processing line: ~Creates a green solid rectangle 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 solid rectangle with an opacity of 50%.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Bouncing On Collision - ball.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ -** Processing line: ~#+begin_src~ +** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # X Y WIDTH HEIGHT RED GREEN BLUE ALPHA~ -** Processing line: ~ args.outputs.solids << [100, 100, 160, 90, 0, 255, 0, 128]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/ball.rb~ +** Processing line: ~ GRAVITY = -0.08~ ** Processing line: ~~ +** Processing line: ~ class Ball~ +** Processing line: ~ attr_accessor :velocity, :center, :radius, :collision_enabled~ ** Processing line: ~~ -** Processing line: ~** Rendering a solid using a Hash~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Rendering a solid 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 solid using a Hash~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def initialize args~ +** Processing line: ~ #Start the ball in the top center~ +** Processing line: ~ #@x = args.grid.w / 2~ +** Processing line: ~ #@y = args.grid.h - 20~ ** Processing line: ~~ -** Processing line: ~If you want a more readable invocation. You can use the following hash to create a solid. 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 solid. 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: ~ @velocity = {x: 0, y: 0}~ +** Processing line: ~ #@width = 20~ +** Processing line: ~ #@height = @width~ +** Processing line: ~ @radius = 20.0 / 2.0~ +** Processing line: ~ @center = {x: (args.grid.w / 2), y: (args.grid.h)}~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.solids << {~ -** Processing line: ~ x: 0,~ -** Processing line: ~ y: 0,~ -** Processing line: ~ w: 100,~ -** Processing line: ~ h: 100,~ -** Processing line: ~ r: 0,~ -** Processing line: ~ g: 255,~ -** Processing line: ~ b: 0,~ -** Processing line: ~ a: 255~ -** Processing line: ~ }~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ #@left_wall = (args.state.board_width + args.grid.w / 8)~ +** Processing line: ~ #@right_wall = @left_wall + args.state.board_width~ +** Processing line: ~ @left_wall = 0~ +** Processing line: ~ @right_wall = $args.grid.right~ ** Processing line: ~~ +** Processing line: ~ @max_velocity = 7~ +** Processing line: ~ @collision_enabled = true~ +** Processing line: ~ end~ ** 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: ~ #Move the ball according to its velocity~ +** Processing line: ~ def update args~ +** Processing line: ~ @center.x += @velocity.x~ +** Processing line: ~ @center.y += @velocity.y~ +** Processing line: ~ @velocity.y += GRAVITY~ ** 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.~ -- 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.~ -- 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: ~ alpha = 0.2~ +** Processing line: ~ if @center.y-@radius <= 0~ +** Processing line: ~ @velocity.y = (@velocity.y.abs*0.7).abs~ +** Processing line: ~ @velocity.x = (@velocity.x.abs*0.9).abs * ((@velocity.x < 0) ? -1 : 1)~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ # Create type with ALL solid properties AND primitive_marker~ -** Processing line: ~ class Solid~ -** Processing line: ~ attr_accessor :x, :y, :w, :h, :r, :g, :b, :a~ +** Processing line: ~ if @velocity.y.abs() < alpha~ +** Processing line: ~ @velocity.y=0~ +** Processing line: ~ end~ +** Processing line: ~ if @velocity.x.abs() < alpha~ +** Processing line: ~ @velocity.x=0~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def primitive_marker~ -** Processing line: ~ :solid~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ if @center.x > args.grid.right+@radius*2~ +** Processing line: ~ @center.x = 0-@radius~ +** Processing line: ~ elsif @center.x< 0-@radius*2~ +** Processing line: ~ @center.x = args.grid.right + @radius~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Inherit from type~ -** Processing line: ~ class Square < Solid~ -** Processing line: ~ # constructor~ -** Processing line: ~ def initialize x, y, size~ -** Processing line: ~ self.x = x~ -** Processing line: ~ self.y = y~ -** Processing line: ~ self.w = size~ -** Processing line: ~ self.h = size~ +** Processing line: ~ def wallBounds args~ +** Processing line: ~ #if @x < @left_wall || @x + @width > @right_wall~ +** Processing line: ~ #@velocity.x *= -1.1~ +** Processing line: ~ #if @velocity.x > @max_velocity~ +** Processing line: ~ #@velocity.x = @max_velocity~ +** Processing line: ~ #elsif @velocity.x < @max_velocity * -1~ +** Processing line: ~ #@velocity.x = @max_velocity * -1~ +** Processing line: ~ #end~ +** Processing line: ~ #end~ +** Processing line: ~ #if @y < 0 || @y + @height > args.grid.h~ +** Processing line: ~ #@velocity.y *= -1.1~ +** Processing line: ~ #if @velocity.y > @max_velocity~ +** Processing line: ~ #@velocity.y = @max_velocity~ +** Processing line: ~ #elsif @velocity.y < @max_velocity * -1~ +** Processing line: ~ #@velocity.y = @max_velocity * -1~ +** Processing line: ~ #end~ +** Processing line: ~ #end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #render the ball to the screen~ +** Processing line: ~ def draw args~ +** Processing line: ~ #args.outputs.solids << [@x, @y, @width, @height, 255, 255, 0];~ +** Processing line: ~ args.outputs.sprites << [~ +** Processing line: ~ @center.x-@radius,~ +** Processing line: ~ @center.y-@radius,~ +** Processing line: ~ @radius*2,~ +** Processing line: ~ @radius*2,~ +** Processing line: ~ "sprites/circle-white.png",~ +** Processing line: ~ 0,~ +** Processing line: ~ 255,~ +** Processing line: ~ 255, #r~ +** Processing line: ~ 0, #g~ +** Processing line: ~ 255 #b~ +** Processing line: ~ ]~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ # render solid/border~ -** Processing line: ~ args.outputs.solids << Square.new(10, 10, 32)~ -** Processing line: ~ end~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::Outputs#borders~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::Outputs#borders~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~Add primitives to this collection to render an unfilled solid to the screen. Take a look at the documentation for Outputs#solids.~ -- P detected. +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - block.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Add primitives to this collection to render an unfilled solid to the screen. Take a look at the documentation for Outputs#solids.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Bouncing On Collision - block.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~The only difference between the two primitives is where they are added.~ -- P detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The only difference between the two primitives is where they are added.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Bouncing On Collision - block.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~Instead of using ~args.outputs.solids~:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Instead of using ~args.outputs.solids~:~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. ** Processing line: ~~ -** Processing line: ~#+begin_src~ +** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # X Y WIDTH HEIGHT~ -** Processing line: ~ args.outputs.solids << [100, 100, 160, 90]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/block.rb~ +** Processing line: ~ DEGREES_TO_RADIANS = Math::PI / 180~ +** Processing line: ~~ +** Processing line: ~ class Block~ +** Processing line: ~ def initialize(x, y, block_size, rotation)~ +** Processing line: ~ @x = x~ +** Processing line: ~ @y = y~ +** Processing line: ~ @block_size = block_size~ +** Processing line: ~ @rotation = rotation~ +** Processing line: ~~ +** Processing line: ~ #The repel velocity?~ +** Processing line: ~ @velocity = {x: 2, y: 0}~ +** Processing line: ~~ +** Processing line: ~ horizontal_offset = (3 * block_size) * Math.cos(rotation * DEGREES_TO_RADIANS)~ +** Processing line: ~ vertical_offset = block_size * Math.sin(rotation * DEGREES_TO_RADIANS)~ +** Processing line: ~~ +** Processing line: ~ if rotation >= 0~ +** Processing line: ~ theta = 90 - rotation~ +** Processing line: ~ #The line doesn't visually line up exactly with the edge of the sprite, so artificially move it a bit~ +** Processing line: ~ modifier = 5~ +** Processing line: ~ x_offset = modifier * Math.cos(theta * DEGREES_TO_RADIANS)~ +** Processing line: ~ y_offset = modifier * Math.sin(theta * DEGREES_TO_RADIANS)~ +** Processing line: ~ @x1 = @x - x_offset~ +** Processing line: ~ @y1 = @y + y_offset~ +** Processing line: ~ @x2 = @x1 + horizontal_offset~ +** Processing line: ~ @y2 = @y1 + (vertical_offset * 3)~ +** Processing line: ~~ +** Processing line: ~ @imaginary_line = [ @x1, @y1, @x2, @y2 ]~ +** Processing line: ~ else~ +** Processing line: ~ theta = 90 + rotation~ +** Processing line: ~ x_offset = @block_size * Math.cos(theta * DEGREES_TO_RADIANS)~ +** Processing line: ~ y_offset = @block_size * Math.sin(theta * DEGREES_TO_RADIANS)~ +** Processing line: ~ @x1 = @x + x_offset~ +** Processing line: ~ @y1 = @y + y_offset + 19~ +** Processing line: ~ @x2 = @x1 + horizontal_offset~ +** Processing line: ~ @y2 = @y1 + (vertical_offset * 3)~ ** Processing line: ~~ -** Processing line: ~You have to use ~args.outputs.borders~:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~You have to use ~args.outputs.borders~:~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ @imaginary_line = [ @x1, @y1, @x2, @y2 ]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # X Y WIDTH HEIGHT~ -** Processing line: ~ args.outputs.borders << [100, 100, 160, 90]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def draw args~ +** Processing line: ~ args.outputs.sprites << [~ +** Processing line: ~ @x,~ +** Processing line: ~ @y,~ +** Processing line: ~ @block_size*3,~ +** Processing line: ~ @block_size,~ +** Processing line: ~ "sprites/square-green.png",~ +** Processing line: ~ @rotation~ +** Processing line: ~ ]~ ** Processing line: ~~ +** Processing line: ~ args.outputs.lines << @imaginary_line~ +** Processing line: ~ args.outputs.solids << @debug_shape~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::Outputs#screenshots~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::Outputs#screenshots~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def multiply_matricies~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~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.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~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.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def calc args~ +** Processing line: ~ if collision? args~ +** Processing line: ~ collide args~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.screenshots << {~ -** Processing line: ~ x: 0, y: 0, w: 100, h: 100, # Which portion of the screen should be captured~ -** Processing line: ~ path: 'screenshot.png', # Output path of PNG file (inside game directory)~ -** Processing line: ~ r: 255, g: 255, b: 255, a: 0 # Optional chroma key~ -** Processing line: ~ }~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ #Determine if the ball and block are touching~ +** Processing line: ~ def collision? args~ +** Processing line: ~ #The minimum area enclosed by the center of the ball and the 2 corners of the block~ +** Processing line: ~ #If the area ever drops below this value, we know there is a collision~ +** Processing line: ~ min_area = ((@block_size * 3) * args.state.ball.radius) / 2~ ** Processing line: ~~ +** Processing line: ~ #https://www.mathopenref.com/coordtrianglearea.html~ +** Processing line: ~ ax = @x1~ +** Processing line: ~ ay = @y1~ +** Processing line: ~ bx = @x2~ +** Processing line: ~ by = @y2~ +** Processing line: ~ cx = args.state.ball.center.x~ +** Processing line: ~ cy = args.state.ball.center.y~ ** Processing line: ~~ -** Processing line: ~** Chroma key (Making a color transparent)~ -- H2 detected. -- Determining if line is a header. -- Line contains ~** ~... gsub-ing empty string -- Formatting line: ~Chroma key (Making a color transparent)~ -- 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: ~Chroma key (Making a color transparent)~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ current_area = (ax*(by-cy)+bx*(cy-ay)+cx*(ay-by))/2~ ** Processing line: ~~ -** Processing line: ~By specifying the r, g, b and a keys of the hash you change the transparency of a color in the resulting PNG file. This can be useful if you want to create files with transparent background like spritesheets. The transparency of the color specified by ~r~, ~g~, ~b~ will be set to the transparency specified by ~a~.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~By specifying the r, g, b and a keys of the hash you change the transparency of a color in the resulting PNG file. This can be useful if you want to create files with transparent background like spritesheets. The transparency of the color specified by ~r~, ~g~, ~b~ will be set to the transparency specified by ~a~.~ -- Line's tilde count is: 8 -- Line contains link marker: false -- CODE detected. -** Processing line: ~The example above sets the color white (255, 255, 255) as transparent.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The example above sets the color white (255, 255, 255) as transparent.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ collision = false~ +** Processing line: ~ if @rotation >= 0~ +** Processing line: ~ if (current_area < min_area &&~ +** Processing line: ~ current_area > 0 &&~ +** Processing line: ~ args.state.ball.center.y > @y1 &&~ +** Processing line: ~ args.state.ball.center.x < @x2)~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::Mouse~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::Mouse~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ collision = true~ +** Processing line: ~ end~ +** Processing line: ~ else~ +** Processing line: ~ if (current_area < min_area &&~ +** Processing line: ~ current_area > 0 &&~ +** Processing line: ~ args.state.ball.center.y > @y2 &&~ +** Processing line: ~ args.state.ball.center.x > @x1)~ ** Processing line: ~~ -** Processing line: ~The mouse is accessible via ~args.inputs.mouse~:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The mouse is accessible via ~args.inputs.mouse~:~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ collision = true~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # Rendering a label that shows the mouse's x and y position (via args.inputs.mouse).~ -** Processing line: ~ args.outputs.labels << [~ -** Processing line: ~ 10,~ -** Processing line: ~ 710,~ -** Processing line: ~ "The mouse's position is: #{args.inputs.mouse.x} #{args.inputs.mouse.y}."~ -** Processing line: ~ ]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ return collision~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~The mouse has the following properties.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The mouse has the following properties.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def collide args~ +** Processing line: ~ #Slope of the block~ +** Processing line: ~ slope = (@y2 - @y1) / (@x2 - @x1)~ ** Processing line: ~~ -** Processing line: ~- ~args.inputs.mouse.x~: Returns the x position of the mouse.~ -- UL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.x~: Returns the x position of the mouse.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.y~: Returns the y position of the mouse.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.y~: Returns the y position of the mouse.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.moved~: Returns true if the mouse moved during the tick.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.moved~: Returns true if the mouse moved during the tick.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.moved_at~: Returns the tick_count (~args.state.tick_count~) that the mouse was moved at. This property will be ~nil~ if the mouse didn't move.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.moved_at~: Returns the tick_count (~args.state.tick_count~) that the mouse was moved at. This property will be ~nil~ if the mouse didn't move.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.global_moved_at~: Returns the global tick_count (~Kernel.global_tick_count~) that the mouse was moved at. This property will be ~nil~ if the mouse didn't move.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.global_moved_at~: Returns the global tick_count (~Kernel.global_tick_count~) that the mouse was moved at. This property will be ~nil~ if the mouse didn't move.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.click~: Returns a ~GTK::MousePoint~ for that specific frame (~args.state.tick_count~) if the mouse button was pressed.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.click~: Returns a ~GTK::MousePoint~ for that specific frame (~args.state.tick_count~) if the mouse button was pressed.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.previous_click~: Returns a ~GTK::MousePoint~ for the previous frame (~args.state.tick_count - 1~) if the mouse button was pressed.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.previous_click~: Returns a ~GTK::MousePoint~ for the previous frame (~args.state.tick_count - 1~) if the mouse button was pressed.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.up~: Returns true if for that specific frame (~args.state.tick_count~) if the mouse button was released.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.up~: Returns true if for that specific frame (~args.state.tick_count~) if the mouse button was released.~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.point~ | ~args.inputs.mouse.position~: Returns an ~Array~ which contains the ~x~ and ~y~ position of the mouse.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.point~ | ~args.inputs.mouse.position~: Returns an ~Array~ which contains the ~x~ and ~y~ position of the mouse.~ -- Line's tilde count is: 10 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.has_focus~: Returns true if the game window has the mouse's focus.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.has_focus~: Returns true if the game window has the mouse's focus.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.wheel~: Returns an ~GTK::OpenEntity~ that contains an ~x~ and ~y~ property which represents how much the wheel has moved. If the wheel has not moved within the tick, this property will be ~nil~.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.wheel~: Returns an ~GTK::OpenEntity~ that contains an ~x~ and ~y~ property which represents how much the wheel has moved. If the wheel has not moved within the tick, this property will be ~nil~.~ -- Line's tilde count is: 10 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.button_left~: Returns true if the left mouse button is down.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.button_left~: Returns true if the left mouse button is down.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.button_right~: Returns true if the right mouse button is down.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.button_right~: Returns true if the right mouse button is down.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.button_middle~: Returns true if the middle mouse button is down.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.button_middle~: Returns true if the middle mouse button is down.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~args.inputs.mouse.button_bits~: Gives the bits for each mouse button and its current state.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~args.inputs.mouse.button_bits~: Gives the bits for each mouse button and its current state.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ #Create a unit vector and tilt it (@rotation) number of degrees~ +** Processing line: ~ x = -Math.cos(@rotation * DEGREES_TO_RADIANS)~ +** Processing line: ~ y = Math.sin(@rotation * DEGREES_TO_RADIANS)~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::MousePoint~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::MousePoint~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ #Find the vector that is perpendicular to the slope~ +** Processing line: ~ perpVect = { x: x, y: y }~ +** Processing line: ~ mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magniude of the perpVect~ +** Processing line: ~ perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magniude to make it a unit vector~ ** Processing line: ~~ -** Processing line: ~The ~GTK::MousePoint~ has the following properties.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The ~GTK::MousePoint~ has the following properties.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ previousPosition = { # calculate an ESTIMATE of the previousPosition of the ball~ +** Processing line: ~ x:args.state.ball.center.x-args.state.ball.velocity.x,~ +** Processing line: ~ y:args.state.ball.center.y-args.state.ball.velocity.y~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~- ~x~: Integer representing the mouse's x.~ -- UL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~x~: Integer representing the mouse's x.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~y~: Integer representing the mouse's y.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~y~: Integer representing the mouse's y.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~point~: Array with the ~x~ and ~y~ values.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~point~: Array with the ~x~ and ~y~ values.~ -- 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).~ -- 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).~ -- 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).~ -- 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).~ -- 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).~ -- 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).~ -- 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).~ -- 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).~ -- 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).~ -- 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).~ -- 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).~ -- 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).~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~created_at~: The tick (~args.state.tick_count~) that this structure was created.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~created_at~: The tick (~args.state.tick_count~) that this structure was created.~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. -** Processing line: ~- ~global_created_at~: The global tick (~Kernel.global_tick_count~) that this structure was created.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~global_created_at~: The global tick (~Kernel.global_tick_count~) that this structure was created.~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ velocityMag = (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5 # the current velocity magnitude of the ball~ +** Processing line: ~ theta_ball = Math.atan2(args.state.ball.velocity.y, args.state.ball.velocity.x) #the angle of the ball's velocity~ +** Processing line: ~ theta_repel = (180 * DEGREES_TO_RADIANS) - theta_ball + (@rotation * DEGREES_TO_RADIANS)~ ** Processing line: ~~ +** Processing line: ~ fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity~ +** Processing line: ~ fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::OpenEntity~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::OpenEntity~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ frx = velocityMag * Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx~ +** Processing line: ~ fry = velocityMag * Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby~ ** Processing line: ~~ -** Processing line: ~~GTK::OpenEntity~ is accessible within the DragonRuby's top level ~tick~ function via the ~args.state~ property.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~GTK::OpenEntity~ is accessible within the DragonRuby's top level ~tick~ function via the ~args.state~ property.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ args.state.display_value = velocityMag~ +** Processing line: ~ fsumx = fbx+frx #sum of x forces~ +** Processing line: ~ fsumy = fby+fry #sum of y forces~ +** Processing line: ~ fr = velocityMag #fr is the resulting magnitude~ +** Processing line: ~ thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.x ||= 100~ -** Processing line: ~ args.outputs.labels << [10, 710, "value of x is: #{args.state.x}."]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ xnew = fr*Math.cos(thetaNew) #resulting x velocity~ +** Processing line: ~ ynew = fr*Math.sin(thetaNew) #resulting y velocity~ ** Processing line: ~~ -** Processing line: ~The primary benefit of using ~args.state~ as opposed to instance variables is that ~GTK::OpenEntity~ allows for arbitrary nesting of properties without the need to create intermediate objects.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~The primary benefit of using ~args.state~ as opposed to instance variables is that ~GTK::OpenEntity~ allows for arbitrary nesting of properties without the need to create intermediate objects.~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. -** Processing line: ~For example:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~For example:~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ dampener = 0.3~ +** Processing line: ~ ynew *= dampener * 0.5~ ** Processing line: ~~ -** Processing line: ~#+begin_src~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ # intermediate player object does not need to be created~ -** Processing line: ~ args.state.player.x ||= 100~ -** Processing line: ~ args.state.player.y ||= 100~ -** Processing line: ~ args.outputs.labels << [~ -** Processing line: ~ 10,~ -** Processing line: ~ 710,~ -** Processing line: ~ "player x, y is:#{args.state.player.x}, #{args.state.player.y}."~ -** Processing line: ~ ]~ +** Processing line: ~ #If the bounce is very low, that means the ball is rolling and we don't want to dampenen the X velocity~ +** Processing line: ~ if ynew > -0.1~ +** Processing line: ~ xnew *= dampener~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #Add the sine component of gravity back in (X component)~ +** Processing line: ~ gravity_x = 4 * Math.sin(@rotation * DEGREES_TO_RADIANS)~ +** Processing line: ~ xnew += gravity_x~ +** Processing line: ~~ +** Processing line: ~ args.state.ball.velocity.x = -xnew~ +** Processing line: ~ args.state.ball.velocity.y = -ynew~ +** Processing line: ~~ +** Processing line: ~ #Set the position of the ball to the previous position so it doesn't warp throught the block~ +** Processing line: ~ args.state.ball.center.x = previousPosition.x~ +** Processing line: ~ args.state.ball.center.y = previousPosition.y~ +** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~* DOCS: ~GTK::OpenEntity#as_hash~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~GTK::OpenEntity#as_hash~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~Returns a reference to the ~GTK::OpenEntity~ as a ~Hash~. This property is useful when you want to treat ~args.state~ as a ~Hash~ and invoke methods such as ~Hash#each~.~ -- P detected. +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - cannon.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Returns a reference to the ~GTK::OpenEntity~ as a ~Hash~. This property is useful when you want to treat ~args.state~ as a ~Hash~ and invoke methods such as ~Hash#each~.~ -- Line's tilde count is: 10 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Bouncing On Collision - cannon.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~Example:~ -- P detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Example:~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Bouncing On Collision - cannon.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ -** Processing line: ~#+begin_src~ +** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.x ||= 100~ -** Processing line: ~ args.state.y ||= 100~ -** Processing line: ~ values = args.state~ -** Processing line: ~ .as_hash~ -** Processing line: ~ .map { |k, v| "#{k} #{v}" }~ +** Processing line: ~ # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/cannon.rb~ +** Processing line: ~ class Cannon~ +** Processing line: ~ def initialize args~ +** Processing line: ~ @pointA = {x: args.grid.right/2,y: args.grid.top}~ +** Processing line: ~ @pointB = {x: args.inputs.mouse.x, y: args.inputs.mouse.y}~ +** Processing line: ~ end~ +** Processing line: ~ def update args~ +** Processing line: ~ activeBall = args.state.ball~ +** Processing line: ~ @pointB = {x: args.inputs.mouse.x, y: args.inputs.mouse.y}~ ** Processing line: ~~ -** Processing line: ~ args.outputs.labels << values.map.with_index do |v, i|~ -** Processing line: ~ [~ -** Processing line: ~ 10,~ -** Processing line: ~ 710 - (30 * i),~ -** Processing line: ~ v~ -** Processing line: ~ ]~ +** Processing line: ~ if args.inputs.mouse.click~ +** Processing line: ~ alpha = 0.01~ +** Processing line: ~ activeBall.velocity.y = (@pointB.y - @pointA.y) * alpha~ +** Processing line: ~ activeBall.velocity.x = (@pointB.x - @pointA.x) * alpha~ +** Processing line: ~ activeBall.center = {x: (args.grid.w / 2), y: (args.grid.h)}~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ def render args~ +** Processing line: ~ args.outputs.lines << [@pointA.x, @pointA.y, @pointB.x, @pointB.y]~ ** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~* DOCS: ~Numeric#frame_index~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Numeric#frame_index~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~This function is helpful for determining the index of frame-by-frame sprite animation. The numeric value ~self~ represents the moment the animation started.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~This function is helpful for determining the index of frame-by-frame sprite animation. The numeric value ~self~ represents the moment the animation started.~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~frame_index~ takes three additional parameters:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~frame_index~ takes three additional parameters:~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~~ -** Processing line: ~- How many frames exist in the sprite animation.~ -- UL start detected. -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~How many frames exist in the sprite animation.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~- How long to hold each animation for.~ -- LI detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~How long to hold each animation for.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~- Whether the animation should repeat.~ -- LI detected. +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - main.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Whether the animation should repeat.~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Bouncing On Collision - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~~frame_index~ will return ~nil~ if the time for the animation is out of bounds of the parameter specification.~ -- UL end detected. -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~~frame_index~ will return ~nil~ if the time for the animation is out of bounds of the parameter specification.~ -- Line's tilde count is: 4 -- Line contains link marker: false -- CODE detected. -** Processing line: ~Example using variables:~ -- P detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Example using variables:~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Bouncing On Collision - 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: ~ def tick args~ -** Processing line: ~ start_looping_at = 0~ -** Processing line: ~ number_of_sprites = 6~ -** Processing line: ~ number_of_frames_to_show_each_sprite = 4~ -** Processing line: ~ does_sprite_loop = true~ +** Processing line: ~ # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/main.rb~ +** Processing line: ~ INFINITY= 10**10~ ** Processing line: ~~ -** Processing line: ~ sprite_index =~ -** Processing line: ~ start_looping_at.frame_index number_of_sprites,~ -** Processing line: ~ number_of_frames_to_show_each_sprite,~ -** Processing line: ~ does_sprite_loop~ +** Processing line: ~ require 'app/vector2d.rb'~ +** Processing line: ~ require 'app/peg.rb'~ +** Processing line: ~ require 'app/block.rb'~ +** Processing line: ~ require 'app/ball.rb'~ +** Processing line: ~ require 'app/cannon.rb'~ ** Processing line: ~~ -** Processing line: ~ sprite_index ||= 0~ ** Processing line: ~~ -** Processing line: ~ args.outputs.sprites << [~ -** Processing line: ~ 640 - 50,~ -** Processing line: ~ 360 - 50,~ -** Processing line: ~ 100,~ -** Processing line: ~ 100,~ -** Processing line: ~ "sprites/dragon-#{sprite_index}.png"~ -** Processing line: ~ ]~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ #Method to init default values~ +** Processing line: ~ def defaults args~ +** Processing line: ~ args.state.pegs ||= []~ +** Processing line: ~ args.state.blocks ||= []~ +** Processing line: ~ args.state.cannon ||= Cannon.new args~ +** Processing line: ~ args.state.ball ||= Ball.new args~ +** Processing line: ~ args.state.horizontal_offset ||= 0~ +** Processing line: ~ init_pegs args~ +** Processing line: ~ init_blocks args~ +** Processing line: ~~ +** Processing line: ~ args.state.display_value ||= "test"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ begin :default_methods~ +** Processing line: ~ def init_pegs args~ +** Processing line: ~ num_horizontal_pegs = 14~ +** Processing line: ~ num_rows = 5~ +** Processing line: ~~ +** Processing line: ~ return unless args.state.pegs.count < num_rows * num_horizontal_pegs~ +** Processing line: ~~ +** Processing line: ~ block_size = 32~ +** Processing line: ~ block_spacing = 50~ +** Processing line: ~ total_width = num_horizontal_pegs * (block_size + block_spacing)~ +** Processing line: ~ starting_offset = (args.grid.w - total_width) / 2 + block_size~ +** Processing line: ~~ +** Processing line: ~ for i in (0...num_rows)~ +** Processing line: ~ for j in (0...num_horizontal_pegs)~ +** Processing line: ~ row_offset = 0~ +** Processing line: ~ if i % 2 == 0~ +** Processing line: ~ row_offset = 20~ +** Processing line: ~ else~ +** Processing line: ~ row_offset = -20~ +** Processing line: ~ end~ +** Processing line: ~ args.state.pegs.append(Peg.new(j * (block_size+block_spacing) + starting_offset + row_offset, (args.grid.h - block_size * 2) - (i * block_size * 2)-90, block_size))~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~Example using named parameters:~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Example using named parameters:~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ start_looping_at = 0~ +** Processing line: ~ def init_blocks args~ +** Processing line: ~ return unless args.state.blocks.count < 10~ ** Processing line: ~~ -** Processing line: ~ sprite_index =~ -** Processing line: ~ start_looping_at.frame_index count: 6,~ -** Processing line: ~ hold_for: 4,~ -** Processing line: ~ repeat: true,~ -** Processing line: ~ tick_count_override: args.state.tick_count~ +** Processing line: ~ #Sprites are rotated in degrees, but the Ruby math functions work on radians~ +** Processing line: ~ radians_to_degrees = Math::PI / 180~ ** Processing line: ~~ -** Processing line: ~ sprite_index ||= 0~ +** Processing line: ~ block_size = 25~ +** Processing line: ~ #Rotation angle (in degrees) of the blocks~ +** Processing line: ~ rotation = 30~ +** Processing line: ~ vertical_offset = block_size * Math.sin(rotation * radians_to_degrees)~ +** Processing line: ~ horizontal_offset = (3 * block_size) * Math.cos(rotation * radians_to_degrees)~ +** Processing line: ~ center = args.grid.w / 2~ ** Processing line: ~~ -** Processing line: ~ args.outputs.sprites << [~ -** Processing line: ~ 640 - 50,~ -** Processing line: ~ 360 - 50,~ -** Processing line: ~ 100,~ -** Processing line: ~ 100,~ -** Processing line: ~ "sprites/dragon-#{sprite_index}.png"~ -** Processing line: ~ ]~ +** Processing line: ~ for i in (0...5)~ +** Processing line: ~ #Create a ramp of blocks. Not going to be perfect because of the float to integer conversion and anisotropic to isotropic coversion~ +** Processing line: ~ args.state.blocks.append(Block.new((center + 100 + (i * horizontal_offset)).to_i, 100 + (vertical_offset * i) + (i * block_size), block_size, rotation))~ +** Processing line: ~ args.state.blocks.append(Block.new((center - 100 - (i * horizontal_offset)).to_i, 100 + (vertical_offset * i) + (i * block_size), block_size, -rotation))~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. ** Processing line: ~~ +** Processing line: ~ #Render loop~ +** Processing line: ~ def render args~ +** Processing line: ~ args.outputs.borders << args.state.game_area~ +** Processing line: ~ render_pegs args~ +** Processing line: ~ render_blocks args~ +** Processing line: ~ args.state.cannon.render args~ +** Processing line: ~ args.state.ball.draw args~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ begin :render_methods~ +** Processing line: ~ #Draw the pegs in a grid pattern~ +** Processing line: ~ def render_pegs args~ +** Processing line: ~ args.state.pegs.each do |peg|~ +** Processing line: ~ peg.draw args~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Numeric#elapsed_time~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Numeric#elapsed_time~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~For a given number, the elapsed frames since that number is returned. `Kernel.tick_count` is used to determine how many frames have elapsed. An optional numeric argument can be passed in which will be used instead of `Kernel.tick_count`.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~For a given number, the elapsed frames since that number is returned. `Kernel.tick_count` is used to determine how many frames have elapsed. An optional numeric argument can be passed in which will be used instead of `Kernel.tick_count`.~ -- Line's tilde count is: 0 -- Line contains link marker: false -** Processing line: ~Here is an example of how elapsed_time can be used.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Here is an example of how elapsed_time can be used.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def render_blocks args~ +** Processing line: ~ args.state.blocks.each do |block|~ +** Processing line: ~ block.draw args~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.last_click_at ||= 0~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # record when a mouse click occurs~ -** Processing line: ~ if args.inputs.mouse.click~ -** Processing line: ~ args.state.last_click_at = args.state.tick_count~ +** Processing line: ~ #Calls all methods necessary for performing calculations~ +** Processing line: ~ def calc args~ +** Processing line: ~ args.state.pegs.each do |peg|~ +** Processing line: ~ peg.calc args~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Use Numeric#elapsed_time to determine how long it's been~ -** Processing line: ~ if args.state.last_click_at.elapsed_time > 120~ -** Processing line: ~ args.outputs.labels << [10, 710, "It has been over 2 seconds since the mouse was clicked."]~ +** Processing line: ~ args.state.blocks.each do |block|~ +** Processing line: ~ block.calc args~ ** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.state.ball.update args~ +** Processing line: ~ args.state.cannon.update args~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ begin :calc_methods~ +** Processing line: ~~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ defaults args~ +** Processing line: ~ render args~ +** Processing line: ~ calc args~ ** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ -** Processing line: ~And here is an example where the override parameter is passed in:~ -- P detected. +** Processing line: ~~ +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - peg.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~And here is an example where the override parameter is passed in:~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Bouncing On Collision - peg.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: ~Physics And Collisions - Bouncing On Collision - peg.rb~ - 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: ~ args.state.last_click_at ||= 0~ +** Processing line: ~ # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/peg.rb~ +** Processing line: ~ class Peg~ +** Processing line: ~ def initialize(x, y, block_size)~ +** Processing line: ~ @x = x # x cordinate of the LEFT side of the peg~ +** Processing line: ~ @y = y # y cordinate of the RIGHT side of the peg~ +** Processing line: ~ @block_size = block_size # diameter of the peg~ +** Processing line: ~~ +** Processing line: ~ @radius = @block_size/2.0 # radius of the peg~ +** Processing line: ~ @center = { # cordinatees of the CENTER of the peg~ +** Processing line: ~ x: @x+@block_size/2.0,~ +** Processing line: ~ y: @y+@block_size/2.0~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~ # create a state variable that tracks time at half the speed of args.state.tick_count~ -** Processing line: ~ args.state.simulation_tick = args.state.tick_count.idiv 2~ +** Processing line: ~ @r = 255 # color of the peg~ +** Processing line: ~ @g = 0~ +** Processing line: ~ @b = 0~ +** Processing line: ~~ +** Processing line: ~ @velocity = {x: 2, y: 0}~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def draw args~ +** Processing line: ~ args.outputs.sprites << [ # draw the peg according to the @x, @y, @radius, and the RGB~ +** Processing line: ~ @x,~ +** Processing line: ~ @y,~ +** Processing line: ~ @radius*2.0,~ +** Processing line: ~ @radius*2.0,~ +** Processing line: ~ "sprites/circle-white.png",~ +** Processing line: ~ 0,~ +** Processing line: ~ 255,~ +** Processing line: ~ @r, #r~ +** Processing line: ~ @g, #g~ +** Processing line: ~ @b #b~ +** Processing line: ~ ]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # record when a mouse click occurs~ -** Processing line: ~ if args.inputs.mouse.click~ -** Processing line: ~ args.state.last_click_at = args.state.simulation_tick~ +** Processing line: ~~ +** Processing line: ~ def calc args~ +** Processing line: ~ if collisionWithBounce? args # if the is a collision with the bouncing ball~ +** Processing line: ~ collide args~ +** Processing line: ~ @r = 0~ +** Processing line: ~ @b = 0~ +** Processing line: ~ @g = 255~ +** Processing line: ~ else~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Use Numeric#elapsed_time to determine how long it's been~ -** Processing line: ~ if (args.state.last_click_at.elapsed_time args.state.simulation_tick) > 120~ -** Processing line: ~ args.outputs.labels << [10, 710, "It has been over 4 seconds since the mouse was clicked."]~ +** Processing line: ~~ +** Processing line: ~ # do two circles (the ball and this peg) intersect~ +** Processing line: ~ def collisionWithBounce? args~ +** Processing line: ~ squareDistance = ( # the squared distance between the ball's center and this peg's center~ +** Processing line: ~ (args.state.ball.center.x - @center.x) ** 2.0 +~ +** Processing line: ~ (args.state.ball.center.y - @center.y) ** 2.0~ +** Processing line: ~ )~ +** Processing line: ~ radiusSum = ( # the sum of the radius squared of the this peg and the ball~ +** Processing line: ~ (args.state.ball.radius + @radius) ** 2.0~ +** Processing line: ~ )~ +** Processing line: ~ # if the squareDistance is less or equal to radiusSum, then there is a radial intersection between the ball and this peg~ +** Processing line: ~ return (squareDistance <= radiusSum)~ ** Processing line: ~ end~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. ** Processing line: ~~ +** Processing line: ~ # ! The following links explain the getRepelMagnitude function !~ +** Processing line: ~ # https://raw.githubusercontent.com/DragonRuby/dragonruby-game-toolkit-physics/master/docs/docImages/LinearCollider_4.png~ +** Processing line: ~ # https://raw.githubusercontent.com/DragonRuby/dragonruby-game-toolkit-physics/master/docs/docImages/LinearCollider_5.png~ +** Processing line: ~ # https://github.com/DragonRuby/dragonruby-game-toolkit-physics/blob/master/docs/LinearCollider.md~ +** Processing line: ~ def getRepelMagnitude (args, fbx, fby, vrx, vry, ballMag)~ +** Processing line: ~ a = fbx ; b = vrx ; c = fby~ +** Processing line: ~ d = vry ; e = ballMag~ +** Processing line: ~ if b**2 + d**2 == 0~ +** Processing line: ~ #unexpected~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)~ +** Processing line: ~ x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2))~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Numeric#elapsed?~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Numeric#elapsed?~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~Returns true if ~Numeric#elapsed_time~ is greater than the number. An optional parameter can be passed into ~elapsed?~ which is added to the number before evaluating whether ~elapsed?~ is true.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Returns true if ~Numeric#elapsed_time~ is greater than the number. An optional parameter can be passed into ~elapsed?~ which is added to the number before evaluating whether ~elapsed?~ is true.~ -- Line's tilde count is: 6 -- Line contains link marker: false -- CODE detected. -** Processing line: ~Example usage (no optional parameter):~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Example usage (no optional parameter):~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ err = 0.00001~ +** Processing line: ~ o = ((fbx + x1*vrx)**2 + (fby + x1*vry)**2 ) ** 0.5~ +** Processing line: ~ p = ((fbx + x2*vrx)**2 + (fby + x2*vry)**2 ) ** 0.5~ +** Processing line: ~ r = 0~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.box_queue ||= []~ +** Processing line: ~ if (ballMag >= o-err and ballMag <= o+err)~ +** Processing line: ~ r = x1~ +** Processing line: ~ elsif (ballMag >= p-err and ballMag <= p+err)~ +** Processing line: ~ r = x2~ +** Processing line: ~ else~ +** Processing line: ~ #unexpected~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.state.box_queue.empty?~ -** Processing line: ~ args.state.box_queue << { name: :red,~ -** Processing line: ~ destroy_at: args.state.tick_count + 60 }~ -** Processing line: ~ args.state.box_queue << { name: :green,~ -** Processing line: ~ destroy_at: args.state.tick_count + 60 }~ -** Processing line: ~ args.state.box_queue << { name: :blue,~ -** Processing line: ~ destroy_at: args.state.tick_count + 120 }~ +** Processing line: ~ if (args.state.ball.center.x > @center.x)~ +** Processing line: ~ return x2*-1~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ return x2~ +** Processing line: ~~ +** Processing line: ~ #return r~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ boxes_to_destroy = args.state~ -** Processing line: ~ .box_queue~ -** Processing line: ~ .find_all { |b| b[:destroy_at].elapsed? }~ +** Processing line: ~ #this sets the new velocity of the ball once it has collided with this peg~ +** Processing line: ~ def collide args~ +** Processing line: ~ normalOfRCCollision = [ #this is the normal of the collision in COMPONENT FORM~ +** Processing line: ~ {x: @center.x, y: @center.y}, #see https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.mathscard.co.uk%2Fonline%2Fcircle-coordinate-geometry%2F&psig=AOvVaw2GcD-e2-nJR_IUKpw3hO98&ust=1605731315521000&source=images&cd=vfe&ved=0CAIQjRxqFwoTCMjBo7e1iu0CFQAAAAAdAAAAABAD~ +** Processing line: ~ {x: args.state.ball.center.x, y: args.state.ball.center.y},~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ normalSlope = ( #normalSlope is the slope of normalOfRCCollision~ +** Processing line: ~ (normalOfRCCollision[1].y - normalOfRCCollision[0].y) /~ +** Processing line: ~ (normalOfRCCollision[1].x - normalOfRCCollision[0].x)~ +** Processing line: ~ )~ +** Processing line: ~ slope = normalSlope**-1.0 * -1 # slope is the slope of the tangent~ +** Processing line: ~ # args.state.display_value = slope~ +** Processing line: ~ pointA = { # pointA and pointB are using the var slope to tangent in COMPONENT FORM~ +** Processing line: ~ x: args.state.ball.center.x-1,~ +** Processing line: ~ y: -(slope-args.state.ball.center.y)~ +** Processing line: ~ }~ +** Processing line: ~ pointB = {~ +** Processing line: ~ x: args.state.ball.center.x+1,~ +** Processing line: ~ y: slope+args.state.ball.center.y~ +** Processing line: ~ }~ +** Processing line: ~~ +** Processing line: ~ perpVect = {x: pointB.x - pointA.x, y:pointB.y - pointA.y} # perpVect is to be VECTOR of the perpendicular tangent~ +** Processing line: ~ mag = (perpVect.x**2 + perpVect.y**2)**0.5 # find the magniude of the perpVect~ +** Processing line: ~ perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)} # divide the perpVect by the magniude to make it a unit vector~ +** Processing line: ~ perpVect = {x: -perpVect.y, y: perpVect.x} # swap the x and y and multiply by -1 to make the vector perpendicular~ +** Processing line: ~ args.state.display_value = perpVect~ +** Processing line: ~ if perpVect.y > 0 #ensure perpVect points upward~ +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if !boxes_to_destroy.empty?~ -** Processing line: ~ puts "boxes to destroy count: #{boxes_to_destroy.length}"~ -** Processing line: ~ end~ +** Processing line: ~ previousPosition = { # calculate an ESTIMATE of the previousPosition of the ball~ +** Processing line: ~ x:args.state.ball.center.x-args.state.ball.velocity.x,~ +** Processing line: ~ y:args.state.ball.center.y-args.state.ball.velocity.y~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~ boxes_to_destroy.each { |b| puts "box #{b} was elapsed? on #{args.state.tick_count}." }~ +** Processing line: ~ yInterc = pointA.y + -slope*pointA.x~ +** Processing line: ~ if slope == INFINITY # the perpVect presently either points in the correct dirrection or it is 180 degrees off we need to correct this~ +** Processing line: ~ if previousPosition.x < pointA.x~ +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ +** Processing line: ~ yInterc = -INFINITY~ +** Processing line: ~ end~ +** Processing line: ~ elsif previousPosition.y < slope*previousPosition.x + yInterc # check if ball is bellow or above the collider to determine if perpVect is - or +~ +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ velocityMag = # the current velocity magnitude of the ball~ +** Processing line: ~ (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5~ +** Processing line: ~ theta_ball=~ +** Processing line: ~ Math.atan2(args.state.ball.velocity.y,args.state.ball.velocity.x) #the angle of the ball's velocity~ +** Processing line: ~ theta_repel=~ +** Processing line: ~ Math.atan2(args.state.ball.center.y,args.state.ball.center.x) #the angle of the repelling force(perpVect)~ +** Processing line: ~~ +** Processing line: ~ fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity~ +** Processing line: ~ fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity~ +** Processing line: ~ repelMag = getRepelMagnitude( # the magniude of the collision vector~ +** Processing line: ~ args,~ +** Processing line: ~ fbx,~ +** Processing line: ~ fby,~ +** Processing line: ~ perpVect.x,~ +** Processing line: ~ perpVect.y,~ +** Processing line: ~ (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5~ +** Processing line: ~ )~ +** Processing line: ~ frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx~ +** Processing line: ~ fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby~ +** Processing line: ~~ +** Processing line: ~ fsumx = fbx+frx # sum of x forces~ +** Processing line: ~ fsumy = fby+fry # sum of y forces~ +** Processing line: ~ fr = velocityMag # fr is the resulting magnitude~ +** Processing line: ~ thetaNew = Math.atan2(fsumy, fsumx) # thetaNew is the resulting angle~ +** Processing line: ~ xnew = fr*Math.cos(thetaNew) # resulting x velocity~ +** Processing line: ~ ynew = fr*Math.sin(thetaNew) # resulting y velocity~ +** Processing line: ~ if (args.state.ball.center.x >= @center.x) # this is necessary for the ball colliding on the right side of the peg~ +** Processing line: ~ xnew=xnew.abs~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.state.ball.velocity.x = xnew # set the x-velocity to the new velocity~ +** Processing line: ~ if args.state.ball.center.y > @center.y # if the ball is above the middle of the peg we need to temporarily ignore some of the gravity~ +** Processing line: ~ args.state.ball.velocity.y = ynew + GRAVITY * 0.01~ +** Processing line: ~ else~ +** Processing line: ~ args.state.ball.velocity.y = ynew - GRAVITY * 0.01 # if the ball is bellow the middle of the peg we need to temporarily increase the power of the gravity~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.box_queue -= boxes_to_destroy~ +** Processing line: ~ args.state.ball.center.x+= args.state.ball.velocity.x # update the position of the ball so it never looks like the ball is intersecting the circle~ +** Processing line: ~ args.state.ball.center.y+= args.state.ball.velocity.y~ +** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ -** Processing line: ~Example usage (with optional parameter):~ -- P detected. +** Processing line: ~~ +** Processing line: ~*** Physics And Collisions - Bouncing On Collision - vector2d.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Example usage (with optional parameter):~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Bouncing On Collision - vector2d.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: ~Physics And Collisions - Bouncing On Collision - vector2d.rb~ - 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: ~ args.state.box_queue ||= []~ +** Processing line: ~ # ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/vector2d.rb~ +** Processing line: ~ class Vector2d~ +** Processing line: ~ attr_accessor :x, :y~ ** Processing line: ~~ -** Processing line: ~ if args.state.box_queue.empty?~ -** Processing line: ~ args.state.box_queue << { name: :red,~ -** Processing line: ~ create_at: args.state.tick_count + 120,~ -** Processing line: ~ lifespan: 60 }~ -** Processing line: ~ args.state.box_queue << { name: :green,~ -** Processing line: ~ create_at: args.state.tick_count + 120,~ -** Processing line: ~ lifespan: 60 }~ -** Processing line: ~ args.state.box_queue << { name: :blue,~ -** Processing line: ~ create_at: args.state.tick_count + 120,~ -** Processing line: ~ lifespan: 120 }~ -** Processing line: ~ end~ +** Processing line: ~ def initialize x=0, y=0~ +** Processing line: ~ @x=x~ +** Processing line: ~ @y=y~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # lifespan is passed in as a parameter to ~elapsed?~~ -** Processing line: ~ boxes_to_destroy = args.state~ -** Processing line: ~ .box_queue~ -** Processing line: ~ .find_all { |b| b[:create_at].elapsed? b[:lifespan] }~ +** Processing line: ~ #returns a vector multiplied by scalar x~ +** Processing line: ~ #x [float] scalar~ +** Processing line: ~ def mult x~ +** Processing line: ~ r = Vector2d.new(0,0)~ +** Processing line: ~ r.x=@x*x~ +** Processing line: ~ r.y=@y*x~ +** Processing line: ~ r~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if !boxes_to_destroy.empty?~ -** Processing line: ~ puts "boxes to destroy count: #{boxes_to_destroy.length}"~ -** Processing line: ~ end~ +** Processing line: ~ # vect [Vector2d] vector to copy~ +** Processing line: ~ def copy vect~ +** Processing line: ~ Vector2d.new(@x, @y)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ boxes_to_destroy.each { |b| puts "box #{b} was elapsed? on #{args.state.tick_count}." }~ +** Processing line: ~ #returns a new vector equivalent to this+vect~ +** Processing line: ~ #vect [Vector2d] vector to add to self~ +** Processing line: ~ def add vect~ +** Processing line: ~ Vector2d.new(@x+vect.x,@y+vect.y)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.box_queue -= boxes_to_destroy~ -** Processing line: ~ end~ +** Processing line: ~ #returns a new vector equivalent to this-vect~ +** Processing line: ~ #vect [Vector2d] vector to subtract to self~ +** Processing line: ~ def sub vect~ +** Processing line: ~ Vector2d.new(@x-vect.c, @y-vect.y)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #return the magnitude of the vector~ +** Processing line: ~ def mag~ +** Processing line: ~ ((@x**2)+(@y**2))**0.5~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #returns a new normalize version of the vector~ +** Processing line: ~ def normalize~ +** Processing line: ~ Vector2d.new(@x/mag, @y/mag)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #TODO delet?~ +** Processing line: ~ def distABS vect~ +** Processing line: ~ (((vect.x-@x)**2+(vect.y-@y)**2)**0.5).abs()~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~* DOCS: ~Numeric#created?~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Numeric#created?~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. -** Processing line: ~Returns true if ~Numeric#elapsed_time == 0~. Essentially communicating that number is equal to the current frame.~ -- P detected. +** Processing line: ~*** Physics And Collisions - Arbitrary Collision - ball.rb~ +- H3 detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Returns true if ~Numeric#elapsed_time == 0~. Essentially communicating that number is equal to the current frame.~ -- Line's tilde count is: 2 +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Arbitrary Collision - ball.rb~ +- Line's tilde count is: 0 - Line contains link marker: false -- CODE detected. -** Processing line: ~Example usage:~ -- P detected. - Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Example usage:~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Arbitrary Collision - ball.rb~ - 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: ~ args.state.box_queue ||= []~ +** Processing line: ~ # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/ball.rb~ ** Processing line: ~~ -** Processing line: ~ if args.state.box_queue.empty?~ -** Processing line: ~ args.state.box_queue << { name: :red,~ -** Processing line: ~ create_at: args.state.tick_count + 60 }~ -** Processing line: ~ end~ +** Processing line: ~ class Ball~ +** Processing line: ~ attr_accessor :velocity, :child, :parent, :number, :leastChain~ +** Processing line: ~ attr_reader :x, :y, :hypotenuse, :width, :height~ ** Processing line: ~~ -** Processing line: ~ boxes_to_spawn_this_frame = args.state~ -** Processing line: ~ .box_queue~ -** Processing line: ~ .find_all { |b| b[:create_at].new? }~ +** Processing line: ~ def initialize args, number, leastChain, parent, child~ +** Processing line: ~ #Start the ball in the top center~ +** Processing line: ~ @number = number~ +** Processing line: ~ @leastChain = leastChain~ +** Processing line: ~ @x = args.grid.w / 2~ +** Processing line: ~ @y = args.grid.h - 20~ ** Processing line: ~~ -** Processing line: ~ boxes_to_spawn_this_frame.each { |b| puts "box #{b} was new? on #{args.state.tick_count}." }~ +** Processing line: ~ @velocity = Vector2d.new(2, -2)~ +** Processing line: ~ @width = 10~ +** Processing line: ~ @height = 10~ ** Processing line: ~~ -** Processing line: ~ args.state.box_queue -= boxes_to_spawn_this_frame~ -** Processing line: ~ end~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ @left_wall = (args.state.board_width + args.grid.w / 8)~ +** Processing line: ~ @right_wall = @left_wall + args.state.board_width~ ** Processing line: ~~ +** Processing line: ~ @max_velocity = MAX_VELOCITY~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Kernel~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Kernel~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ @child = child~ +** Processing line: ~ @parent = parent~ ** Processing line: ~~ -** Processing line: ~Kernel in the DragonRuby Runtime has patches for how standard out is handled and also contains a unit of time in games called a tick.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Kernel in the DragonRuby Runtime has patches for how standard out is handled and also contains a unit of time in games called a tick.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ @past = [{x: @x, y: @y}]~ +** Processing line: ~ @next = nil~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def reassignLeastChain (lc=nil)~ +** Processing line: ~ if (lc == nil)~ +** Processing line: ~ lc = @number~ +** Processing line: ~ end~ +** Processing line: ~ @leastChain = lc~ +** Processing line: ~ if (parent != nil)~ +** Processing line: ~ @parent.reassignLeastChain(lc)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Kernel::tick_count~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Kernel::tick_count~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~Returns the current tick of the game. This value is reset if you call $gtk.reset.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Returns the current tick of the game. This value is reset if you call $gtk.reset.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def makeLeader args~ +** Processing line: ~ if isLeader~ +** Processing line: ~ return~ +** Processing line: ~ end~ +** Processing line: ~ @parent.reassignLeastChain~ +** Processing line: ~ args.state.ballParents.push(self)~ +** Processing line: ~ @parent = nil~ ** Processing line: ~~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* DOCS: ~Kernel::global_tick_count~~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~DOCS: ~Kernel::global_tick_count~~ -- Line's tilde count is: 2 -- Line contains link marker: false -- CODE detected. +** Processing line: ~ def isLeader~ +** Processing line: ~ return (parent == nil)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~Returns the current tick of the application from the point it was started. This value is never reset.~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Returns the current tick of the application from the point it was started. This value is never reset.~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def receiveNext (p)~ +** Processing line: ~ #trace!~ +** Processing line: ~ if parent != nil~ +** Processing line: ~ @x = p[:x]~ +** Processing line: ~ @y = p[:y]~ +** Processing line: ~ @velocity = p[:velocity]~ +** Processing line: ~ #puts @x.to_s + "|" + @y.to_s + "|"+@velocity.to_s~ +** Processing line: ~ @past.append(p)~ +** Processing line: ~ if (@past.length >= BALL_DISTANCE)~ +** Processing line: ~ if (@child != nil)~ +** Processing line: ~ @child.receiveNext(@past[0])~ +** Processing line: ~ @past.shift~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ #Move the ball according to its velocity~ +** Processing line: ~ def update args~ ** Processing line: ~~ +** Processing line: ~ if isLeader~ +** Processing line: ~ wallBounds args~ +** Processing line: ~ @x += @velocity.x~ +** Processing line: ~ @y += @velocity.y~ +** Processing line: ~ @past.append({x: @x, y: @y, velocity: @velocity})~ +** Processing line: ~ #puts @past~ ** Processing line: ~~ -** Processing line: ~* Open Source~ -- H1 detected. +** Processing line: ~ if (@past.length >= BALL_DISTANCE)~ +** Processing line: ~ if (@child != nil)~ +** Processing line: ~ @child.receiveNext(@past[0])~ +** Processing line: ~ @past.shift~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ else~ +** Processing line: ~ puts "unexpected"~ +** Processing line: ~ raise "unexpected"~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def wallBounds args~ +** Processing line: ~ b= false~ +** Processing line: ~ if @x < @left_wall~ +** Processing line: ~ @velocity.x = @velocity.x.abs() * 1~ +** Processing line: ~ b=true~ +** Processing line: ~ elsif @x + @width > @right_wall~ +** Processing line: ~ @velocity.x = @velocity.x.abs() * -1~ +** Processing line: ~ b=true~ +** Processing line: ~ end~ +** Processing line: ~ if @y < 0~ +** Processing line: ~ @velocity.y = @velocity.y.abs() * 1~ +** Processing line: ~ b=true~ +** Processing line: ~ elsif @y + @height > args.grid.h~ +** Processing line: ~ @velocity.y = @velocity.y.abs() * -1~ +** Processing line: ~ b=true~ +** Processing line: ~ end~ +** Processing line: ~ mag = (@velocity.x**2.0 + @velocity.y**2.0)**0.5~ +** Processing line: ~ if (b == true && mag < MAX_VELOCITY)~ +** Processing line: ~ @velocity.x*=1.1;~ +** Processing line: ~ @velocity.y*=1.1;~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #render the ball to the screen~ +** Processing line: ~ def draw args~ +** Processing line: ~~ +** Processing line: ~ #update args~ +** Processing line: ~ #args.outputs.solids << [@x, @y, @width, @height, 255, 255, 0];~ +** Processing line: ~ #args.outputs.sprits << {~ +** Processing line: ~ #x: @x,~ +** Processing line: ~ #y: @y,~ +** Processing line: ~ #w: @width,~ +** Processing line: ~ #h: @height,~ +** Processing line: ~ #path: "sprites/ball10.png"~ +** Processing line: ~ #}~ +** Processing line: ~ #args.outputs.sprites <<[@x, @y, @width, @height, "sprites/ball10.png"]~ +** Processing line: ~ args.outputs.sprites << {x: @x, y: @y, w: @width, h: @height, path:"sprites/ball10.png" }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def getDraw args~ +** Processing line: ~ #wallBounds args~ +** Processing line: ~ #update args~ +** Processing line: ~ #args.outputs.labels << [@x, @y, @number.to_s + "|" + @leastChain.to_s]~ +** Processing line: ~ return [@x, @y, @width, @height, "sprites/ball10.png"]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def getPoints args~ +** Processing line: ~ points = [~ +** Processing line: ~ {x:@x+@width/2, y: @y},~ +** Processing line: ~ {x:@x+@width, y:@y+@height/2},~ +** Processing line: ~ {x:@x+@width/2,y:@y+@height},~ +** Processing line: ~ {x:@x,y:@y+@height/2}~ +** Processing line: ~ ]~ +** Processing line: ~ #psize = 5.0~ +** Processing line: ~ #for p in points~ +** Processing line: ~ #args.outputs.solids << [p.x-psize/2.0, p.y-psize/2.0, psize, psize, 0, 0, 0];~ +** Processing line: ~ #end~ +** Processing line: ~ return points~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def serialize~ +** Processing line: ~ {x: @x, y:@y}~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def inspect~ +** Processing line: ~ serialize.to_s~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def to_s~ +** Processing line: ~ serialize.to_s~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Physics And Collisions - Arbitrary Collision - blocks.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Open Source~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Arbitrary Collision - blocks.rb~ - Line's tilde count is: 0 - Line contains link marker: false -** Processing line: ~Follows is a source code listing for all files that have been open sourced. This code can be found in the ~./samples~ directory and online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]].~ -- P detected. -- Determining if line is a header. -- Line does not appear to be a header. -- Formatting line: ~Follows is a source code listing for all files that have been open sourced. This code can be found in the ~./samples~ directory and online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]].~ -- Line's tilde count is: 2 -- Line contains link marker: true -- CODE detected. -- LINK detected. -** Processing line: ~* Learn Ruby Optional - Beginner Ruby Primer - automation.rb~ -- H1 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Learn Ruby Optional - Beginner Ruby Primer - automation.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Arbitrary Collision - blocks.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/00_learn_ruby_optional/00_beginner_ruby_primer/app/automation.rb~ -** Processing line: ~ # ==========================================================================~ -** Processing line: ~ # _ _ ________ __ _ _____ _____ _______ ______ _ _ _ _ _ _~ -** Processing line: ~ # | | | | ____\ \ / / | | |_ _|/ ____|__ __| ____| \ | | | | | |~ -** Processing line: ~ # | |__| | |__ \ \_/ / | | | | | (___ | | | |__ | \| | | | | |~ -** Processing line: ~ # | __ | __| \ / | | | | \___ \ | | | __| | . ` | | | | |~ -** Processing line: ~ # | | | | |____ | | | |____ _| |_ ____) | | | | |____| |\ |_|_|_|_|~ -** Processing line: ~ # |_| |_|______| |_| |______|_____|_____/ |_| |______|_| \_(_|_|_|_)~ -** Processing line: ~ #~ -** Processing line: ~ #~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # \ | /~ -** Processing line: ~ # \ | /~ -** Processing line: ~ # +~ -** Processing line: ~ #~ -** Processing line: ~ # If you are new to the programming language Ruby, then you may find the~ -** Processing line: ~ # following code a bit overwhelming. Come back to this file when you have~ -** Processing line: ~ # a better grasp of Ruby and Game Toolkit.~ -** Processing line: ~ #~ -** Processing line: ~ # What follows is an automations script # that can be run via terminal:~ -** Processing line: ~ # ./samples/00_beginner_ruby_primer $ ../../dragonruby . --eval app/automation.rb~ -** Processing line: ~ # ==========================================================================~ +** Processing line: ~ # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/blocks.rb~ +** Processing line: ~ MAX_COUNT=100~ +** Processing line: ~~ +** Processing line: ~ def universalUpdateOne args, shape~ +** Processing line: ~ didHit = false~ +** Processing line: ~ hitters = []~ +** Processing line: ~ #puts shape.to_s~ +** Processing line: ~ toCollide = nil~ +** Processing line: ~ for b in args.state.balls~ +** Processing line: ~ if [b.x, b.y, b.width, b.height].intersect_rect?(shape.bold)~ +** Processing line: ~ didSquare = false~ +** Processing line: ~ for s in shape.squareColliders~ +** Processing line: ~ if (s.collision?(args, b))~ +** Processing line: ~ didSquare = true~ +** Processing line: ~ didHit = true~ +** Processing line: ~ #s.collide(args, b)~ +** Processing line: ~ toCollide = s~ +** Processing line: ~ #hitter = b~ +** Processing line: ~ hitters.append(b)~ +** Processing line: ~ end #end if~ +** Processing line: ~ end #end for~ +** Processing line: ~ if (didSquare == false)~ +** Processing line: ~ for c in shape.colliders~ +** Processing line: ~ #puts args.state.ball.velocity~ +** Processing line: ~ if c.collision?(args, b.getPoints(args),b)~ +** Processing line: ~ #c.collide args, b~ +** Processing line: ~ toCollide = c~ +** Processing line: ~ didHit = true~ +** Processing line: ~ hitters.append(b)~ +** Processing line: ~ end #end if~ +** Processing line: ~ end #end for~ +** Processing line: ~ end #end if~ +** Processing line: ~ end#end if~ +** Processing line: ~ end#end for~ +** Processing line: ~ if (didHit)~ +** Processing line: ~ shape.count=0~ +** Processing line: ~ hitters = hitters.uniq~ +** Processing line: ~ for hitter in hitters~ +** Processing line: ~ hitter.makeLeader args~ +** Processing line: ~ #toCollide.collide(args, hitter)~ +** Processing line: ~ if shape.home == "squares"~ +** Processing line: ~ args.state.squares.delete(shape)~ +** Processing line: ~ elsif shape.home == "tshapes"~ +** Processing line: ~ args.state.tshapes.delete(shape)~ +** Processing line: ~ else shape.home == "lines"~ +** Processing line: ~ args.state.lines.delete(shape)~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.reset~ -** Processing line: ~ $gtk.scheduled_callbacks.clear~ -** Processing line: ~ $gtk.schedule_callback 10 do~ -** Processing line: ~ $gtk.console.set_command 'puts "Hello DragonRuby!"'~ +** Processing line: ~ #puts "HIT!" + hitter.number~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 20 do~ -** Processing line: ~ $gtk.console.eval_the_set_command~ -** Processing line: ~ end~ +** Processing line: ~ def universalUpdate args, shape~ +** Processing line: ~ #puts shape.home~ +** Processing line: ~ if (shape.count <= 1)~ +** Processing line: ~ universalUpdateOne args, shape~ +** Processing line: ~ return~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 30 do~ -** Processing line: ~ $gtk.console.set_command 'outputs.solids << [910, 200, 100, 100, 255, 0, 0]'~ -** Processing line: ~ end~ +** Processing line: ~ didHit = false~ +** Processing line: ~ hitter = nil~ +** Processing line: ~ for b in args.state.ballParents~ +** Processing line: ~ if [b.x, b.y, b.width, b.height].intersect_rect?(shape.bold)~ +** Processing line: ~ didSquare = false~ +** Processing line: ~ for s in shape.squareColliders~ +** Processing line: ~ if (s.collision?(args, b))~ +** Processing line: ~ didSquare = true~ +** Processing line: ~ didHit = true~ +** Processing line: ~ s.collide(args, b)~ +** Processing line: ~ hitter = b~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ if (didSquare == false)~ +** Processing line: ~ for c in shape.colliders~ +** Processing line: ~ #puts args.state.ball.velocity~ +** Processing line: ~ if c.collision?(args, b.getPoints(args),b)~ +** Processing line: ~ c.collide args, b~ +** Processing line: ~ didHit = true~ +** Processing line: ~ hitter = b~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ if (didHit)~ +** Processing line: ~ shape.count=shape.count-1~ +** Processing line: ~ shape.damageCount.append([(hitter.leastChain+1 - hitter.number)-1, args.state.tick_count])~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 40 do~ -** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ end~ +** Processing line: ~ i=0~ +** Processing line: ~ while i < shape.damageCount.length~ +** Processing line: ~ if shape.damageCount[i][0] <= 0~ +** Processing line: ~ shape.damageCount.delete_at(i)~ +** Processing line: ~ i-=1~ +** Processing line: ~ elsif shape.damageCount[i][1].elapsed_time > BALL_DISTANCE and shape.damageCount[i][0] > 1~ +** Processing line: ~ shape.count-=1~ +** Processing line: ~ shape.damageCount[i][0]-=1~ +** Processing line: ~ shape.damageCount[i][1] = args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~ i+=1~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 50 do~ -** Processing line: ~ $gtk.console.set_command 'outputs.solids << [1010, 200, 100, 100, 0, 0, 255]'~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 60 do~ -** Processing line: ~ $gtk.console.eval_the_set_command~ -** Processing line: ~ end~ +** Processing line: ~ class Square~ +** Processing line: ~ attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount~ +** Processing line: ~ def initialize(args, x, y, block_size, orientation, block_offset)~ +** Processing line: ~ @x = x * block_size~ +** Processing line: ~ @y = y * block_size~ +** Processing line: ~ @block_size = block_size~ +** Processing line: ~ @block_offset = block_offset~ +** Processing line: ~ @orientation = orientation~ +** Processing line: ~ @damageCount = []~ +** Processing line: ~ @home = 'squares'~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 70 do~ -** Processing line: ~ $gtk.console.set_command 'outputs.sprites << [1110, 200, 100, 100, "sprites/dragon_fly_0.png"]'~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 80 do~ -** Processing line: ~ $gtk.console.eval_the_set_command~ -** Processing line: ~ end~ +** Processing line: ~ Kernel.srand()~ +** Processing line: ~ @r = rand(255)~ +** Processing line: ~ @g = rand(255)~ +** Processing line: ~ @b = rand(255)~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 90 do~ -** Processing line: ~ $gtk.console.set_command "outputs.labels << [1210, 200, state.tick_count, 0, 255, 0]"~ -** Processing line: ~ end~ +** Processing line: ~ @count = rand(MAX_COUNT)+1~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 100 do~ -** Processing line: ~ $gtk.console.eval_the_set_command~ -** Processing line: ~ end~ +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2~ +** Processing line: ~ @x_adjusted = @x + x_offset~ +** Processing line: ~ @y_adjusted = @y~ +** Processing line: ~ @size_adjusted = @block_size * 2 - @block_offset~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 110 do~ -** Processing line: ~ $gtk.console.set_command "state.sprite_frame = state.tick_count.idiv(4).mod(6)"~ -** Processing line: ~ end~ +** Processing line: ~ hypotenuse=args.state.ball_hypotenuse~ +** Processing line: ~ @bold = [(@x_adjusted-hypotenuse/2)-1, (@y_adjusted-hypotenuse/2)-1, @size_adjusted + hypotenuse + 2, @size_adjusted + hypotenuse + 2]~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 120 do~ -** Processing line: ~ $gtk.console.eval_the_set_command~ -** Processing line: ~ end~ +** Processing line: ~ @points = [~ +** Processing line: ~ {x:@x_adjusted, y:@y_adjusted},~ +** Processing line: ~ {x:@x_adjusted+@size_adjusted, y:@y_adjusted},~ +** Processing line: ~ {x:@x_adjusted+@size_adjusted, y:@y_adjusted+@size_adjusted},~ +** Processing line: ~ {x:@x_adjusted, y:@y_adjusted+@size_adjusted}~ +** Processing line: ~ ]~ +** Processing line: ~ @squareColliders = [~ +** Processing line: ~ SquareCollider.new(@points[0].x,@points[0].y,{x:-1,y:-1}),~ +** Processing line: ~ SquareCollider.new(@points[1].x-COLLISIONWIDTH,@points[1].y,{x:1,y:-1}),~ +** Processing line: ~ SquareCollider.new(@points[2].x-COLLISIONWIDTH,@points[2].y-COLLISIONWIDTH,{x:1,y:1}),~ +** Processing line: ~ SquareCollider.new(@points[3].x,@points[3].y-COLLISIONWIDTH,{x:-1,y:1}),~ +** Processing line: ~ ]~ +** Processing line: ~ @colliders = [~ +** Processing line: ~ LinearCollider.new(@points[0],@points[1], :neg),~ +** Processing line: ~ LinearCollider.new(@points[1],@points[2], :neg),~ +** Processing line: ~ LinearCollider.new(@points[2],@points[3], :pos),~ +** Processing line: ~ LinearCollider.new(@points[0],@points[3], :pos)~ +** Processing line: ~ ]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 130 do~ -** Processing line: ~ $gtk.console.set_command "outputs.labels << [1210, 170, state.sprite_frame, 0, 255, 0]"~ -** Processing line: ~ end~ +** Processing line: ~ def draw(args)~ +** Processing line: ~ #Offset the coordinates to the edge of the game area~ +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size * 2 - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b]~ +** Processing line: ~ args.outputs.solids <<{x: (@x + x_offset), y: (@y), w: (@block_size * 2 - @block_offset), h: (@block_size * 2 - @block_offset), r: @r , g: @g , b: @b }~ +** Processing line: ~ #args.outputs.solids << @bold.append([255,0,0])~ +** Processing line: ~ args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s]~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 140 do~ -** Processing line: ~ $gtk.console.eval_the_set_command~ -** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 150 do~ -** Processing line: ~ $gtk.console.set_command "state.sprite_path = \"sprites/dragon_fly_\#{state.sprite_frame}.png\""~ +** Processing line: ~ def update args~ +** Processing line: ~ universalUpdate args, self~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 160 do~ -** Processing line: ~ $gtk.console.eval_the_set_command~ -** Processing line: ~ end~ +** Processing line: ~ class TShape~ +** Processing line: ~ attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount~ +** Processing line: ~ def initialize(args, x, y, block_size, orientation, block_offset)~ +** Processing line: ~ @x = x * block_size~ +** Processing line: ~ @y = y * block_size~ +** Processing line: ~ @block_size = block_size~ +** Processing line: ~ @block_offset = block_offset~ +** Processing line: ~ @orientation = orientation~ +** Processing line: ~ @damageCount = []~ +** Processing line: ~ @home = "tshapes"~ +** Processing line: ~~ +** Processing line: ~ Kernel.srand()~ +** Processing line: ~ @r = rand(255)~ +** Processing line: ~ @g = rand(255)~ +** Processing line: ~ @b = rand(255)~ +** Processing line: ~~ +** Processing line: ~ @count = rand(MAX_COUNT)+1~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ @shapePoints = getShapePoints(args)~ +** Processing line: ~ minX={x:INFINITY, y:0}~ +** Processing line: ~ minY={x:0, y:INFINITY}~ +** Processing line: ~ maxX={x:-INFINITY, y:0}~ +** Processing line: ~ maxY={x:0, y:-INFINITY}~ +** Processing line: ~ for p in @shapePoints~ +** Processing line: ~ if p.x < minX.x~ +** Processing line: ~ minX = p~ +** Processing line: ~ end~ +** Processing line: ~ if p.x > maxX.x~ +** Processing line: ~ maxX = p~ +** Processing line: ~ end~ +** Processing line: ~ if p.y < minY.y~ +** Processing line: ~ minY = p~ +** Processing line: ~ end~ +** Processing line: ~ if p.y > maxY.y~ +** Processing line: ~ maxY = p~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 170 do~ -** Processing line: ~ $gtk.console.set_command "outputs.labels << [910, 330, \"path: \#{state.sprite_path}\", 0, 255, 0]"~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 180 do~ -** Processing line: ~ $gtk.console.eval_the_set_command~ -** Processing line: ~ end~ +** Processing line: ~ hypotenuse=args.state.ball_hypotenuse~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 190 do~ -** Processing line: ~ $gtk.console.set_command "outputs.sprites << [910, 330, 370, 370, state.sprite_path]"~ -** Processing line: ~ end~ +** Processing line: ~ @bold = [(minX.x-hypotenuse/2)-1, (minY.y-hypotenuse/2)-1, -((minX.x-hypotenuse/2)-1)+(maxX.x + hypotenuse + 2), -((minY.y-hypotenuse/2)-1)+(maxY.y + hypotenuse + 2)]~ +** Processing line: ~ end~ +** Processing line: ~ def getShapePoints(args)~ +** Processing line: ~ points=[]~ +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2)~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 200 do~ -** Processing line: ~ $gtk.console.eval_the_set_command~ -** Processing line: ~ end~ +** Processing line: ~ if @orientation == :right~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2, @block_size, @r, @g, @b]~ +** Processing line: ~ points = [~ +** Processing line: ~ {x:@x + x_offset, y:@y},~ +** Processing line: ~ {x:(@x + x_offset)+(@block_size - @block_offset), y:@y},~ +** Processing line: ~ {x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size},~ +** Processing line: ~ {x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size},~ +** Processing line: ~ {x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size+@block_size},~ +** Processing line: ~ {x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size+@block_size},~ +** Processing line: ~ {x:(@x + x_offset)+(@block_size - @block_offset), y:@y+ @block_size * 3 - @block_offset},~ +** Processing line: ~ {x:@x + x_offset , y:@y+ @block_size * 3 - @block_offset}~ +** Processing line: ~ ]~ +** Processing line: ~ @squareColliders = [~ +** Processing line: ~ SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[2].x,points[2].y-COLLISIONWIDTH,{x:1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[3].x-COLLISIONWIDTH,points[3].y,{x:1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y-COLLISIONWIDTH,{x:1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[5].x,points[5].y,{x:1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y-COLLISIONWIDTH,{x:1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[7].x,points[7].y-COLLISIONWIDTH,{x:-1,y:1}),~ +** Processing line: ~ ]~ +** Processing line: ~ @colliders = [~ +** Processing line: ~ LinearCollider.new(points[0],points[1], :neg),~ +** Processing line: ~ LinearCollider.new(points[1],points[2], :neg),~ +** Processing line: ~ LinearCollider.new(points[2],points[3], :neg),~ +** Processing line: ~ LinearCollider.new(points[3],points[4], :neg),~ +** Processing line: ~ LinearCollider.new(points[4],points[5], :pos),~ +** Processing line: ~ LinearCollider.new(points[5],points[6], :neg),~ +** Processing line: ~ LinearCollider.new(points[6],points[7], :pos),~ +** Processing line: ~ LinearCollider.new(points[0],points[7], :pos)~ +** Processing line: ~ ]~ +** Processing line: ~ elsif @orientation == :up~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size, @block_size * 2, @r, @g, @b]~ +** Processing line: ~ points = [~ +** Processing line: ~ {x:@x + x_offset, y:@y},~ +** Processing line: ~ {x:(@x + x_offset)+(@block_size * 3 - @block_offset), y:@y},~ +** Processing line: ~ {x:(@x + x_offset)+(@block_size * 3 - @block_offset), y:@y+(@block_size - @block_offset)},~ +** Processing line: ~ {x:@x + x_offset + @block_size + @block_size, y:@y+(@block_size - @block_offset)},~ +** Processing line: ~ {x:@x + x_offset + @block_size + @block_size, y:@y+@block_size*2},~ +** Processing line: ~ {x:@x + x_offset + @block_size, y:@y+@block_size*2},~ +** Processing line: ~ {x:@x + x_offset + @block_size, y:@y+(@block_size - @block_offset)},~ +** Processing line: ~ {x:@x + x_offset, y:@y+(@block_size - @block_offset)}~ +** Processing line: ~ ]~ +** Processing line: ~ @squareColliders = [~ +** Processing line: ~ SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[3].x,points[3].y,{x:1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y-COLLISIONWIDTH,{x:1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[5].x,points[5].y-COLLISIONWIDTH,{x:-1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y,{x:-1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[7].x,points[7].y-COLLISIONWIDTH,{x:-1,y:1}),~ +** Processing line: ~ ]~ +** Processing line: ~ @colliders = [~ +** Processing line: ~ LinearCollider.new(points[0],points[1], :neg),~ +** Processing line: ~ LinearCollider.new(points[1],points[2], :neg),~ +** Processing line: ~ LinearCollider.new(points[2],points[3], :pos),~ +** Processing line: ~ LinearCollider.new(points[3],points[4], :neg),~ +** Processing line: ~ LinearCollider.new(points[4],points[5], :pos),~ +** Processing line: ~ LinearCollider.new(points[5],points[6], :neg),~ +** Processing line: ~ LinearCollider.new(points[6],points[7], :pos),~ +** Processing line: ~ LinearCollider.new(points[0],points[7], :pos)~ +** Processing line: ~ ]~ +** Processing line: ~ elsif @orientation == :left~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ +** Processing line: ~ xh = @x + x_offset~ +** Processing line: ~ #points = [~ +** Processing line: ~ #{x:@x + x_offset, y:@y},~ +** Processing line: ~ #{x:(@x + x_offset)+(@block_size - @block_offset), y:@y},~ +** Processing line: ~ #{x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size},~ +** Processing line: ~ #{x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size},~ +** Processing line: ~ #{x:(@x + x_offset)+ @block_size * 2,y:@y + @block_size+@block_size},~ +** Processing line: ~ #{x:(@x + x_offset)+(@block_size - @block_offset),y:@y + @block_size+@block_size},~ +** Processing line: ~ #{x:(@x + x_offset)+(@block_size - @block_offset), y:@y+ @block_size * 3 - @block_offset},~ +** Processing line: ~ #{x:@x + x_offset , y:@y+ @block_size * 3 - @block_offset}~ +** Processing line: ~ #]~ +** Processing line: ~ points = [~ +** Processing line: ~ {x:@x + x_offset + @block_size, y:@y},~ +** Processing line: ~ {x:@x + x_offset + @block_size + (@block_size - @block_offset), y:@y},~ +** Processing line: ~ {x:@x + x_offset + @block_size + (@block_size - @block_offset),y:@y+@block_size*3- @block_offset},~ +** Processing line: ~ {x:@x + x_offset + @block_size, y:@y+@block_size*3- @block_offset},~ +** Processing line: ~ {x:@x + x_offset+@block_size, y:@y+@block_size*2- @block_offset},~ +** Processing line: ~ {x:@x + x_offset, y:@y+@block_size*2- @block_offset},~ +** Processing line: ~ {x:@x + x_offset, y:@y+@block_size},~ +** Processing line: ~ {x:@x + x_offset+@block_size, y:@y+@block_size}~ +** Processing line: ~ ]~ +** Processing line: ~ @squareColliders = [~ +** Processing line: ~ SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:-1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y,{x:-1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[5].x,points[5].y-COLLISIONWIDTH,{x:-1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[6].x,points[6].y,{x:-1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[7].x-COLLISIONWIDTH,points[7].y-COLLISIONWIDTH,{x:-1,y:-1}),~ +** Processing line: ~ ]~ +** Processing line: ~ @colliders = [~ +** Processing line: ~ LinearCollider.new(points[0],points[1], :neg),~ +** Processing line: ~ LinearCollider.new(points[1],points[2], :neg),~ +** Processing line: ~ LinearCollider.new(points[2],points[3], :pos),~ +** Processing line: ~ LinearCollider.new(points[3],points[4], :neg),~ +** Processing line: ~ LinearCollider.new(points[4],points[5], :pos),~ +** Processing line: ~ LinearCollider.new(points[5],points[6], :neg),~ +** Processing line: ~ LinearCollider.new(points[6],points[7], :neg),~ +** Processing line: ~ LinearCollider.new(points[0],points[7], :pos)~ +** Processing line: ~ ]~ +** Processing line: ~ elsif @orientation == :down~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b]~ +** Processing line: ~~ +** Processing line: ~ points = [~ +** Processing line: ~ {x:@x + x_offset, y:@y+(@block_size*2)-@block_offset},~ +** Processing line: ~ {x:@x + x_offset+ @block_size*3-@block_offset, y:@y+(@block_size*2)-@block_offset},~ +** Processing line: ~ {x:@x + x_offset+ @block_size*3-@block_offset, y:@y+(@block_size)},~ +** Processing line: ~ {x:@x + x_offset+ @block_size*2-@block_offset, y:@y+(@block_size)},~ +** Processing line: ~ {x:@x + x_offset+ @block_size*2-@block_offset, y:@y},#~ +** Processing line: ~ {x:@x + x_offset+ @block_size, y:@y},#~ +** Processing line: ~ {x:@x + x_offset + @block_size, y:@y+(@block_size)},~ +** Processing line: ~ {x:@x + x_offset, y:@y+(@block_size)}~ +** Processing line: ~ ]~ +** Processing line: ~ @squareColliders = [~ +** Processing line: ~ SquareCollider.new(points[0].x,points[0].y-COLLISIONWIDTH,{x:-1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y-COLLISIONWIDTH,{x:1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y,{x:1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[4].x-COLLISIONWIDTH,points[4].y,{x:1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[5].x,points[5].y,{x:-1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[6].x-COLLISIONWIDTH,points[6].y-COLLISIONWIDTH,{x:-1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[7].x,points[7].y,{x:-1,y:-1}),~ +** Processing line: ~ ]~ +** Processing line: ~ @colliders = [~ +** Processing line: ~ LinearCollider.new(points[0],points[1], :pos),~ +** Processing line: ~ LinearCollider.new(points[1],points[2], :pos),~ +** Processing line: ~ LinearCollider.new(points[2],points[3], :neg),~ +** Processing line: ~ LinearCollider.new(points[3],points[4], :pos),~ +** Processing line: ~ LinearCollider.new(points[4],points[5], :neg),~ +** Processing line: ~ LinearCollider.new(points[5],points[6], :pos),~ +** Processing line: ~ LinearCollider.new(points[6],points[7], :neg),~ +** Processing line: ~ LinearCollider.new(points[0],points[7], :neg)~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~ return points~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def draw(args)~ +** Processing line: ~ #Offset the coordinates to the edge of the game area~ +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2)~ +** Processing line: ~~ +** Processing line: ~ if @orientation == :right~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset), y: @y, w: @block_size - @block_offset, h: (@block_size * 3 - @block_offset), r: @r , g: @g, b: @b}~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2, @block_size, @r, @g, @b]~ +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 2), h: (@block_size), r: @r , g: @g, b: @b }~ +** Processing line: ~ elsif @orientation == :up~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset), y: (@y), w: (@block_size * 3 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b}~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size, @block_size * 2, @r, @g, @b]~ +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size), h: (@block_size * 2), r: @r , g: @g, b: @b}~ +** Processing line: ~ elsif @orientation == :left~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size - @block_offset), h: (@block_size * 3 - @block_offset), r: @r , g: @g, b: @b}~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 2 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 2 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b}~ +** Processing line: ~ elsif @orientation == :down~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y + @block_size, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset), y: (@y + @block_size), w: (@block_size * 3 - @block_offset), h: (@block_size - @block_offset), r: @r , g: @g, b: @b}~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset + @block_size, @y, @block_size - @block_offset, @block_size * 2 - @block_offset, @r, @g, @b]~ +** Processing line: ~ args.outputs.solids << {x: (@x + x_offset + @block_size), y: (@y), w: (@block_size - @block_offset), h: ( @block_size * 2 - @block_offset), r: @r , g: @g, b: @b}~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #psize = 5.0~ +** Processing line: ~ #for p in @shapePoints~ +** Processing line: ~ #args.outputs.solids << [p.x-psize/2, p.y-psize/2, psize, psize, 0, 0, 0]~ +** Processing line: ~ #end~ +** Processing line: ~ args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s]~ +** Processing line: ~~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def updateOne_old args~ +** Processing line: ~ didHit = false~ +** Processing line: ~ hitter = nil~ +** Processing line: ~ toCollide = nil~ +** Processing line: ~ for b in args.state.balls~ +** Processing line: ~ if [b.x, b.y, b.width, b.height].intersect_rect?(@bold)~ +** Processing line: ~ didSquare = false~ +** Processing line: ~ for s in @squareColliders~ +** Processing line: ~ if (s.collision?(args, b))~ +** Processing line: ~ didSquare = true~ +** Processing line: ~ didHit = true~ +** Processing line: ~ #s.collide(args, b)~ +** Processing line: ~ toCollide = s~ +** Processing line: ~ hitter = b~ +** Processing line: ~ break~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ if (didSquare == false)~ +** Processing line: ~ for c in @colliders~ +** Processing line: ~ #puts args.state.ball.velocity~ +** Processing line: ~ if c.collision?(args, b.getPoints(args),b)~ +** Processing line: ~ #c.collide args, b~ +** Processing line: ~ toCollide = c~ +** Processing line: ~ didHit = true~ +** Processing line: ~ hitter = b~ +** Processing line: ~ break~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ if didHit~ +** Processing line: ~ break~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ if (didHit)~ +** Processing line: ~ @count=0~ +** Processing line: ~ hitter.makeLeader args~ +** Processing line: ~ #toCollide.collide(args, hitter)~ +** Processing line: ~ args.state.tshapes.delete(self)~ +** Processing line: ~ #puts "HIT!" + hitter.number~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def update_old args~ +** Processing line: ~ if (@count == 1)~ +** Processing line: ~ updateOne args~ +** Processing line: ~ return~ +** Processing line: ~ end~ +** Processing line: ~ didHit = false~ +** Processing line: ~ hitter = nil~ +** Processing line: ~ for b in args.state.ballParents~ +** Processing line: ~ if [b.x, b.y, b.width, b.height].intersect_rect?(@bold)~ +** Processing line: ~ didSquare = false~ +** Processing line: ~ for s in @squareColliders~ +** Processing line: ~ if (s.collision?(args, b))~ +** Processing line: ~ didSquare = true~ +** Processing line: ~ didHit=true~ +** Processing line: ~ s.collide(args, b)~ +** Processing line: ~ hitter = b~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ if (didSquare == false)~ +** Processing line: ~ for c in @colliders~ +** Processing line: ~ #puts args.state.ball.velocity~ +** Processing line: ~ if c.collision?(args, b.getPoints(args), b)~ +** Processing line: ~ c.collide args, b~ +** Processing line: ~ didHit=true~ +** Processing line: ~ hitter = b~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ if (didHit)~ +** Processing line: ~ @count=@count-1~ +** Processing line: ~ @damageCount.append([(hitter.leastChain+1 - hitter.number)-1, args.state.tick_count])~ +** Processing line: ~~ +** Processing line: ~ if (@count == 0)~ +** Processing line: ~ args.state.tshapes.delete(self)~ +** Processing line: ~ return~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ i=0~ +** Processing line: ~~ +** Processing line: ~ while i < @damageCount.length~ +** Processing line: ~ if @damageCount[i][0] <= 0~ +** Processing line: ~ @damageCount.delete_at(i)~ +** Processing line: ~ i-=1~ +** Processing line: ~ elsif @damageCount[i][1].elapsed_time > BALL_DISTANCE~ +** Processing line: ~ @count-=1~ +** Processing line: ~ @damageCount[i][0]-=1~ +** Processing line: ~ end~ +** Processing line: ~ if (@count == 0)~ +** Processing line: ~ args.state.tshapes.delete(self)~ +** Processing line: ~ return~ +** Processing line: ~ end~ +** Processing line: ~ i+=1~ +** Processing line: ~ end~ +** Processing line: ~ end #end update~ +** Processing line: ~~ +** Processing line: ~ def update args~ +** Processing line: ~ universalUpdate args, self~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 300 do~ -** Processing line: ~ $gtk.console.set_command ":wq"~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.schedule_callback 400 do~ -** Processing line: ~ $gtk.console.eval_the_set_command~ +** Processing line: ~ class Line~ +** Processing line: ~ attr_accessor :count, :x, :y, :home, :bold, :squareColliders, :colliders, :damageCount~ +** Processing line: ~ def initialize(args, x, y, block_size, orientation, block_offset)~ +** Processing line: ~ @x = x * block_size~ +** Processing line: ~ @y = y * block_size~ +** Processing line: ~ @block_size = block_size~ +** Processing line: ~ @block_offset = block_offset~ +** Processing line: ~ @orientation = orientation~ +** Processing line: ~ @damageCount = []~ +** Processing line: ~ @home = "lines"~ +** Processing line: ~~ +** Processing line: ~ Kernel.srand()~ +** Processing line: ~ @r = rand(255)~ +** Processing line: ~ @g = rand(255)~ +** Processing line: ~ @b = rand(255)~ +** Processing line: ~~ +** Processing line: ~ @count = rand(MAX_COUNT)+1~ +** Processing line: ~~ +** Processing line: ~ @shapePoints = getShapePoints(args)~ +** Processing line: ~ minX={x:INFINITY, y:0}~ +** Processing line: ~ minY={x:0, y:INFINITY}~ +** Processing line: ~ maxX={x:-INFINITY, y:0}~ +** Processing line: ~ maxY={x:0, y:-INFINITY}~ +** Processing line: ~ for p in @shapePoints~ +** Processing line: ~ if p.x < minX.x~ +** Processing line: ~ minX = p~ +** Processing line: ~ end~ +** Processing line: ~ if p.x > maxX.x~ +** Processing line: ~ maxX = p~ +** Processing line: ~ end~ +** Processing line: ~ if p.y < minY.y~ +** Processing line: ~ minY = p~ +** Processing line: ~ end~ +** Processing line: ~ if p.y > maxY.y~ +** Processing line: ~ maxY = p~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ hypotenuse=args.state.ball_hypotenuse~ +** Processing line: ~~ +** Processing line: ~ @bold = [(minX.x-hypotenuse/2)-1, (minY.y-hypotenuse/2)-1, -((minX.x-hypotenuse/2)-1)+(maxX.x + hypotenuse + 2), -((minY.y-hypotenuse/2)-1)+(maxY.y + hypotenuse + 2)]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def getShapePoints(args)~ +** Processing line: ~ points=[]~ +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + (@block_offset / 2)~ +** Processing line: ~~ +** Processing line: ~ if @orientation == :right~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ +** Processing line: ~ xa =@x + x_offset~ +** Processing line: ~ ya =@y~ +** Processing line: ~ wa =@block_size * 3 - @block_offset~ +** Processing line: ~ ha =(@block_size - @block_offset)~ +** Processing line: ~ elsif @orientation == :up~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ +** Processing line: ~ xa =@x + x_offset~ +** Processing line: ~ ya =@y~ +** Processing line: ~ wa =@block_size - @block_offset~ +** Processing line: ~ ha =@block_size * 3 - @block_offset~ +** Processing line: ~~ +** Processing line: ~ elsif @orientation == :left~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ +** Processing line: ~ xa =@x + x_offset~ +** Processing line: ~ ya =@y~ +** Processing line: ~ wa =@block_size * 3 - @block_offset~ +** Processing line: ~ ha =@block_size - @block_offset~ +** Processing line: ~ elsif @orientation == :down~ +** Processing line: ~ #args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ +** Processing line: ~ xa =@x + x_offset~ +** Processing line: ~ ya =@y~ +** Processing line: ~ wa =@block_size - @block_offset~ +** Processing line: ~ ha =@block_size * 3 - @block_offset~ +** Processing line: ~ end~ +** Processing line: ~ points = [~ +** Processing line: ~ {x: xa, y:ya},~ +** Processing line: ~ {x: xa + wa,y:ya},~ +** Processing line: ~ {x: xa + wa,y:ya+ha},~ +** Processing line: ~ {x: xa, y:ya+ha},~ +** Processing line: ~ ]~ +** Processing line: ~ @squareColliders = [~ +** Processing line: ~ SquareCollider.new(points[0].x,points[0].y,{x:-1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[1].x-COLLISIONWIDTH,points[1].y,{x:1,y:-1}),~ +** Processing line: ~ SquareCollider.new(points[2].x-COLLISIONWIDTH,points[2].y-COLLISIONWIDTH,{x:1,y:1}),~ +** Processing line: ~ SquareCollider.new(points[3].x,points[3].y-COLLISIONWIDTH,{x:-1,y:1}),~ +** Processing line: ~ ]~ +** Processing line: ~ @colliders = [~ +** Processing line: ~ LinearCollider.new(points[0],points[1], :neg),~ +** Processing line: ~ LinearCollider.new(points[1],points[2], :neg),~ +** Processing line: ~ LinearCollider.new(points[2],points[3], :pos),~ +** Processing line: ~ LinearCollider.new(points[0],points[3], :pos),~ +** Processing line: ~ ]~ +** Processing line: ~ return points~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def update args~ +** Processing line: ~ universalUpdate args, self~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def draw(args)~ +** Processing line: ~ x_offset = (args.state.board_width + args.grid.w / 8) + @block_offset / 2~ +** Processing line: ~~ +** Processing line: ~ if @orientation == :right~ +** Processing line: ~ args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ +** Processing line: ~ elsif @orientation == :up~ +** Processing line: ~ args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ +** Processing line: ~ elsif @orientation == :left~ +** Processing line: ~ args.outputs.solids << [@x + x_offset, @y, @block_size * 3 - @block_offset, @block_size - @block_offset, @r, @g, @b]~ +** Processing line: ~ elsif @orientation == :down~ +** Processing line: ~ args.outputs.solids << [@x + x_offset, @y, @block_size - @block_offset, @block_size * 3 - @block_offset, @r, @g, @b]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << [@x + x_offset + (@block_size * 2 - @block_offset)/2, (@y) + (@block_size * 2 - @block_offset)/2, @count.to_s]~ +** Processing line: ~~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Learn Ruby Optional - Beginner Ruby Primer - main.rb~ -- H1 detected. +** Processing line: ~*** Physics And Collisions - Arbitrary Collision - linear_collider.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Learn Ruby Optional - Beginner Ruby Primer - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Arbitrary Collision - linear_collider.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: ~Physics And Collisions - Arbitrary Collision - linear_collider.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/00_learn_ruby_optional/00_beginner_ruby_primer/app/main.rb~ -** Processing line: ~ # ==========================================================================~ -** Processing line: ~ # _ _ ________ __ _ _____ _____ _______ ______ _ _ _ _ _ _~ -** Processing line: ~ # | | | | ____\ \ / / | | |_ _|/ ____|__ __| ____| \ | | | | | |~ -** Processing line: ~ # | |__| | |__ \ \_/ / | | | | | (___ | | | |__ | \| | | | | |~ -** Processing line: ~ # | __ | __| \ / | | | | \___ \ | | | __| | . ` | | | | |~ -** Processing line: ~ # | | | | |____ | | | |____ _| |_ ____) | | | | |____| |\ |_|_|_|_|~ -** Processing line: ~ # |_| |_|______| |_| |______|_____|_____/ |_| |______|_| \_(_|_|_|_)~ -** Processing line: ~ #~ -** Processing line: ~ #~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # |~ -** Processing line: ~ # \ | /~ -** Processing line: ~ # \ | /~ -** Processing line: ~ # +~ -** Processing line: ~ #~ -** Processing line: ~ # If you are new to the programming language Ruby, then you may find the~ -** Processing line: ~ # following code a bit overwhelming. This sample is only designed to be~ -** Processing line: ~ # run interactively (as opposed to being manipulated via source code).~ -** Processing line: ~ #~ -** Processing line: ~ # Start up this sample and follow along by visiting:~ -** Processing line: ~ # https://s3.amazonaws.com/s3.dragonruby.org/dragonruby-gtk-primer.mp4~ -** Processing line: ~ #~ -** Processing line: ~ # It is STRONGLY recommended that you work through all the samples before~ -** Processing line: ~ # looking at the code in this file.~ -** Processing line: ~ # ==========================================================================~ +** Processing line: ~ # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/linear_collider.rb~ ** Processing line: ~~ -** Processing line: ~ class TutorialOutputs~ -** Processing line: ~ attr_accessor :solids, :sprites, :labels, :lines, :borders~ +** Processing line: ~ COLLISIONWIDTH=8~ ** Processing line: ~~ -** Processing line: ~ def initialize~ -** Processing line: ~ @solids = []~ -** Processing line: ~ @sprites = []~ -** Processing line: ~ @labels = []~ -** Processing line: ~ @lines = []~ -** Processing line: ~ @borders = []~ -** Processing line: ~ end~ +** Processing line: ~ class LinearCollider~ +** Processing line: ~ attr_reader :pointA, :pointB~ +** Processing line: ~ def initialize (pointA, pointB, mode,collisionWidth=COLLISIONWIDTH)~ +** Processing line: ~ @pointA = pointA~ +** Processing line: ~ @pointB = pointB~ +** Processing line: ~ @mode = mode~ +** Processing line: ~ @collisionWidth = collisionWidth~ ** Processing line: ~~ -** Processing line: ~ def tick~ -** Processing line: ~ @solids ||= []~ -** Processing line: ~ @sprites ||= []~ -** Processing line: ~ @labels ||= []~ -** Processing line: ~ @lines ||= []~ -** Processing line: ~ @borders ||= []~ -** Processing line: ~ @solids.each { |p| $gtk.args.outputs.reserved << p.solid }~ -** Processing line: ~ @sprites.each { |p| $gtk.args.outputs.reserved << p.sprite }~ -** Processing line: ~ @labels.each { |p| $gtk.args.outputs.reserved << p.label }~ -** Processing line: ~ @lines.each { |p| $gtk.args.outputs.reserved << p.line }~ -** Processing line: ~ @borders.each { |p| $gtk.args.outputs.reserved << p.border }~ -** Processing line: ~ end~ +** Processing line: ~ if (@pointA.x > @pointB.x)~ +** Processing line: ~ @pointA, @pointB = @pointB, @pointA~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def clear~ -** Processing line: ~ @solids.clear~ -** Processing line: ~ @sprites.clear~ -** Processing line: ~ @labels.clear~ -** Processing line: ~ @borders.clear~ +** Processing line: ~ @linearCollider_collision_once = false~ ** Processing line: ~ end~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ def defaults~ -** Processing line: ~ state.reset_button ||=~ -** Processing line: ~ state.new_entity(~ -** Processing line: ~ :button,~ -** Processing line: ~ label: [1190, 68, "RESTART", -2, 0, 0, 0, 0].label,~ -** Processing line: ~ background: [1160, 38, 120, 50, 255, 255, 255].solid~ -** Processing line: ~ )~ -** Processing line: ~ $gtk.log_level = :off~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick_reset_button~ -** Processing line: ~ return unless state.hello_dragonruby_confirmed~ -** Processing line: ~ $gtk.args.outputs.reserved << state.reset_button.background~ -** Processing line: ~ $gtk.args.outputs.reserved << state.reset_button.label~ -** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.reset_button.background)~ -** Processing line: ~ restart_tutorial~ +** Processing line: ~ def collisionSlope args~ +** Processing line: ~ if (@pointB.x-@pointA.x == 0)~ +** Processing line: ~ return INFINITY~ +** Processing line: ~ end~ +** Processing line: ~ return (@pointB.y - @pointA.y) / (@pointB.x - @pointA.x)~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def seperator~ -** Processing line: ~ @seperator = "=" * 80~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick_intro~ -** Processing line: ~ queue_message "Welcome to the DragonRuby GTK primer! Try typing the~ -** Processing line: ~ code below and press ENTER:~ +** Processing line: ~ def collision? (args, points, ball=nil)~ ** Processing line: ~~ -** Processing line: ~ puts \"Hello DragonRuby!\"~ -** Processing line: ~ "~ -** Processing line: ~ end~ +** Processing line: ~ slope = collisionSlope args~ +** Processing line: ~ result = false~ ** Processing line: ~~ -** Processing line: ~ def tick_hello_dragonruby~ -** Processing line: ~ return unless console_has? "Hello DragonRuby!"~ +** Processing line: ~ # calculate a vector with a magnitude of (1/2)collisionWidth and a direction perpendicular to the collision line~ +** Processing line: ~ vect=nil;mag=nil;vect=nil;~ +** Processing line: ~ if @mode == :both~ +** Processing line: ~ vect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y}~ +** Processing line: ~ mag = (vect.x**2 + vect.y**2)**0.5~ +** Processing line: ~ vect = {y: -1*(vect.x/(mag))*@collisionWidth*0.5, x: (vect.y/(mag))*@collisionWidth*0.5}~ +** Processing line: ~ else~ +** Processing line: ~ vect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y}~ +** Processing line: ~ mag = (vect.x**2 + vect.y**2)**0.5~ +** Processing line: ~ vect = {y: -1*(vect.x/(mag))*@collisionWidth, x: (vect.y/(mag))*@collisionWidth}~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ rpointA=nil;rpointB=nil;rpointC=nil;rpointD=nil;~ +** Processing line: ~ if @mode == :pos~ +** Processing line: ~ rpointA = {x:@pointA.x + vect.x, y:@pointA.y + vect.y}~ +** Processing line: ~ rpointB = {x:@pointB.x + vect.x, y:@pointB.y + vect.y}~ +** Processing line: ~ rpointC = {x:@pointB.x, y:@pointB.y}~ +** Processing line: ~ rpointD = {x:@pointA.x, y:@pointA.y}~ +** Processing line: ~ elsif @mode == :neg~ +** Processing line: ~ rpointA = {x:@pointA.x, y:@pointA.y}~ +** Processing line: ~ rpointB = {x:@pointB.x, y:@pointB.y}~ +** Processing line: ~ rpointC = {x:@pointB.x - vect.x, y:@pointB.y - vect.y}~ +** Processing line: ~ rpointD = {x:@pointA.x - vect.x, y:@pointA.y - vect.y}~ +** Processing line: ~ elsif @mode == :both~ +** Processing line: ~ rpointA = {x:@pointA.x + vect.x, y:@pointA.y + vect.y}~ +** Processing line: ~ rpointB = {x:@pointB.x + vect.x, y:@pointB.y + vect.y}~ +** Processing line: ~ rpointC = {x:@pointB.x - vect.x, y:@pointB.y - vect.y}~ +** Processing line: ~ rpointD = {x:@pointA.x - vect.x, y:@pointA.y - vect.y}~ +** Processing line: ~ end~ +** Processing line: ~ #four point rectangle~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ if ball != nil~ +** Processing line: ~ xs = [rpointA.x,rpointB.x,rpointC.x,rpointD.x]~ +** Processing line: ~ ys = [rpointA.y,rpointB.y,rpointC.y,rpointD.y]~ +** Processing line: ~ correct = 1~ +** Processing line: ~ rect1 = [ball.x, ball.y, ball.width, ball.height]~ +** Processing line: ~ #$r1 = rect1~ +** Processing line: ~ rect2 = [xs.min-correct,ys.min-correct,(xs.max-xs.min)+correct*2,(ys.max-ys.min)+correct*2]~ +** Processing line: ~ #$r2 = rect2~ +** Processing line: ~ if rect1.intersect_rect?(rect2) == false~ +** Processing line: ~ return false~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.args.state.hello_dragonruby_confirmed = true~ ** Processing line: ~~ -** Processing line: ~ queue_message "Well HELLO to you too!~ +** Processing line: ~ #area of a triangle~ +** Processing line: ~ triArea = -> (a,b,c) { ((a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y))/2.0).abs }~ ** Processing line: ~~ -** Processing line: ~ If you ever want to RESTART the tutorial, just click the \"RESTART\"~ -** Processing line: ~ button in the bottom right-hand corner.~ +** Processing line: ~ #if at least on point is in the rectangle then collision? is true - otherwise false~ +** Processing line: ~ for point in points~ +** Processing line: ~ #Check whether a given point lies inside a rectangle or not:~ +** Processing line: ~ #if the sum of the area of traingls, PAB, PBC, PCD, PAD equal the area of the rec, then an intersection has occured~ +** Processing line: ~ areaRec = triArea.call(rpointA, rpointB, rpointC)+triArea.call(rpointA, rpointC, rpointD)~ +** Processing line: ~ areaSum = [~ +** Processing line: ~ triArea.call(point, rpointA, rpointB),triArea.call(point, rpointB, rpointC),~ +** Processing line: ~ triArea.call(point, rpointC, rpointD),triArea.call(point, rpointA, rpointD)~ +** Processing line: ~ ].inject(0){|sum,x| sum + x }~ +** Processing line: ~ e = 0.0001 #allow for minor error~ +** Processing line: ~ if areaRec>= areaSum-e and areaRec<= areaSum+e~ +** Processing line: ~ result = true~ +** Processing line: ~ #return true~ +** Processing line: ~ break~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ Let's continue shall we? Type the code below and press ENTER:~ +** Processing line: ~ #args.outputs.lines << [@pointA.x, @pointA.y, @pointB.x, @pointB.y, 000, 000, 000]~ +** Processing line: ~ #args.outputs.lines << [rpointA.x, rpointA.y, rpointB.x, rpointB.y, 255, 000, 000]~ +** Processing line: ~ #args.outputs.lines << [rpointC.x, rpointC.y, rpointD.x, rpointD.y, 000, 000, 255]~ ** Processing line: ~~ -** Processing line: ~ outputs.solids << [910, 200, 100, 100, 255, 0, 0]~ -** Processing line: ~ "~ ** Processing line: ~~ -** Processing line: ~ end~ +** Processing line: ~ #puts (rpointA.x.to_s + " " + rpointA.y.to_s + " " + rpointB.x.to_s + " "+ rpointB.y.to_s)~ +** Processing line: ~ return result~ +** Processing line: ~ end #end collision?~ ** Processing line: ~~ -** Processing line: ~ def tick_explain_solid~ -** Processing line: ~ return unless $tutorial_outputs.solids.any? {|s| s == [910, 200, 100, 100, 255, 0, 0]}~ +** Processing line: ~ def getRepelMagnitude (fbx, fby, vrx, vry, ballMag)~ +** Processing line: ~ a = fbx ; b = vrx ; c = fby~ +** Processing line: ~ d = vry ; e = ballMag~ +** Processing line: ~ if b**2 + d**2 == 0~ +** Processing line: ~ #unexpected~ +** Processing line: ~ end~ +** Processing line: ~ x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)~ +** Processing line: ~ x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2))~ +** Processing line: ~ err = 0.00001~ +** Processing line: ~ o = ((fbx + x1*vrx)**2 + (fby + x1*vry)**2 ) ** 0.5~ +** Processing line: ~ p = ((fbx + x2*vrx)**2 + (fby + x2*vry)**2 ) ** 0.5~ +** Processing line: ~ r = 0~ +** Processing line: ~ if (ballMag >= o-err and ballMag <= o+err)~ +** Processing line: ~ r = x1~ +** Processing line: ~ elsif (ballMag >= p-err and ballMag <= p+err)~ +** Processing line: ~ r = x2~ +** Processing line: ~ else~ +** Processing line: ~ #unexpected~ +** Processing line: ~ end~ +** Processing line: ~ return r~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ queue_message "Sweet!~ +** Processing line: ~ def collide args, ball~ +** Processing line: ~ slope = collisionSlope args~ ** Processing line: ~~ -** Processing line: ~ The code: outputs.solids << [910, 200, 100, 100, 255, 0, 0]~ -** Processing line: ~ Does the following:~ -** Processing line: ~ 1. GET the place where SOLIDS go: outputs.solids~ -** Processing line: ~ 2. Request that a new SOLID be ADDED: <<~ -** Processing line: ~ 3. The DEFINITION of a SOLID is the ARRAY:~ -** Processing line: ~ [910, 200, 100, 100, 255, 0, 0]~ +** Processing line: ~ # perpVect: normal vector perpendicular to collision~ +** Processing line: ~ perpVect = {x: @pointB.x - @pointA.x, y:@pointB.y - @pointA.y}~ +** Processing line: ~ mag = (perpVect.x**2 + perpVect.y**2)**0.5~ +** Processing line: ~ perpVect = {x: perpVect.x/(mag), y: perpVect.y/(mag)}~ +** Processing line: ~ perpVect = {x: -perpVect.y, y: perpVect.x}~ +** Processing line: ~ if perpVect.y > 0 #ensure perpVect points upward~ +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ +** Processing line: ~ end~ +** Processing line: ~ previousPosition = {~ +** Processing line: ~ x:ball.x-ball.velocity.x,~ +** Processing line: ~ y:ball.y-ball.velocity.y~ +** Processing line: ~ }~ +** Processing line: ~ yInterc = @pointA.y + -slope*@pointA.x~ +** Processing line: ~ if slope == INFINITY~ +** Processing line: ~ if previousPosition.x < @pointA.x~ +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ +** Processing line: ~ yInterc = -INFINITY~ +** Processing line: ~ end~ +** Processing line: ~ elsif previousPosition.y < slope*previousPosition.x + yInterc #check if ball is bellow or above the collider to determine if perpVect is - or +~ +** Processing line: ~ perpVect = {x: perpVect.x*-1, y: perpVect.y*-1}~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ velocityMag = (ball.velocity.x**2 + ball.velocity.y**2)**0.5~ +** Processing line: ~ theta_ball=Math.atan2(ball.velocity.y,ball.velocity.x) #the angle of the ball's velocity~ +** Processing line: ~ theta_repel=Math.atan2(perpVect.y,perpVect.x) #the angle of the repelling force(perpVect)~ +** Processing line: ~~ +** Processing line: ~ fbx = velocityMag * Math.cos(theta_ball) #the x component of the ball's velocity~ +** Processing line: ~ fby = velocityMag * Math.sin(theta_ball) #the y component of the ball's velocity~ +** Processing line: ~~ +** Processing line: ~ #the magnitude of the repelling force~ +** Processing line: ~ repelMag = getRepelMagnitude(fbx, fby, perpVect.x, perpVect.y, (ball.velocity.x**2 + ball.velocity.y**2)**0.5)~ +** Processing line: ~ frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx~ +** Processing line: ~ fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby~ +** Processing line: ~~ +** Processing line: ~ fsumx = fbx+frx #sum of x forces~ +** Processing line: ~ fsumy = fby+fry #sum of y forces~ +** Processing line: ~ fr = velocityMag#fr is the resulting magnitude~ +** Processing line: ~ thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle~ +** Processing line: ~ xnew = fr*Math.cos(thetaNew)#resulting x velocity~ +** Processing line: ~ ynew = fr*Math.sin(thetaNew)#resulting y velocity~ +** Processing line: ~ if (velocityMag < MAX_VELOCITY)~ +** Processing line: ~ ball.velocity = Vector2d.new(xnew*1.1, ynew*1.1)~ +** Processing line: ~ else~ +** Processing line: ~ ball.velocity = Vector2d.new(xnew, ynew)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ GET ADD X Y WIDTH HEIGHT RED GREEN BLUE~ -** Processing line: ~ | | | | | | | | |~ -** Processing line: ~ | | | | | | | | |~ -** Processing line: ~ outputs.solids << [910, 200, 100, 100, 255, 0, 0]~ -** Processing line: ~ |_________________________________________|~ -** Processing line: ~ |~ -** Processing line: ~ |~ -** Processing line: ~ ARRAY~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ Now let's create a blue SOLID. Type:~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ outputs.solids << [1010, 200, 100, 100, 0, 0, 255]~ -** Processing line: ~ "~ ** Processing line: ~~ -** Processing line: ~ state.explain_solid_confirmed = true~ -** Processing line: ~ end~ +** Processing line: ~*** Physics And Collisions - Arbitrary Collision - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Arbitrary Collision - 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: ~Physics And Collisions - Arbitrary Collision - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ def tick_explain_solid_blue~ -** Processing line: ~ return unless state.explain_solid_confirmed~ -** Processing line: ~ return unless $tutorial_outputs.solids.any? {|s| s == [1010, 200, 100, 100, 0, 0, 255]}~ -** Processing line: ~ state.explain_solid_blue_confirmed = true~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/main.rb~ +** Processing line: ~ INFINITY= 10**10~ +** Processing line: ~ MAX_VELOCITY = 8.0~ +** Processing line: ~ BALL_COUNT = 90~ +** Processing line: ~ BALL_DISTANCE = 20~ +** Processing line: ~ require 'app/vector2d.rb'~ +** Processing line: ~ require 'app/blocks.rb'~ +** Processing line: ~ require 'app/ball.rb'~ +** Processing line: ~ require 'app/rectangle.rb'~ +** Processing line: ~ require 'app/linear_collider.rb'~ +** Processing line: ~ require 'app/square_collider.rb'~ ** Processing line: ~~ -** Processing line: ~ queue_message "And there is our blue SOLID!~ ** Processing line: ~~ -** Processing line: ~ The ARRAY is the MOST important thing in DragonRuby GTK.~ ** Processing line: ~~ -** Processing line: ~ Let's create a SPRITE using an ARRAY:~ +** Processing line: ~ #Method to init default values~ +** Processing line: ~ def defaults args~ +** Processing line: ~ args.state.board_width ||= args.grid.w / 4~ +** Processing line: ~ args.state.board_height ||= args.grid.h~ +** Processing line: ~ args.state.game_area ||= [(args.state.board_width + args.grid.w / 8), 0, args.state.board_width, args.grid.h]~ +** Processing line: ~ args.state.balls ||= []~ +** Processing line: ~ args.state.num_balls ||= 0~ +** Processing line: ~ args.state.ball_created_at ||= args.state.tick_count~ +** Processing line: ~ args.state.ball_hypotenuse = (10**2 + 10**2)**0.5~ +** Processing line: ~ args.state.ballParents ||=nil~ +** Processing line: ~~ +** Processing line: ~ init_blocks args~ +** Processing line: ~ init_balls args~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ begin :default_methods~ +** Processing line: ~ def init_blocks args~ +** Processing line: ~ block_size = args.state.board_width / 8~ +** Processing line: ~ #Space inbetween each block~ +** Processing line: ~ block_offset = 4~ +** Processing line: ~~ +** Processing line: ~ args.state.squares ||=[~ +** Processing line: ~ Square.new(args, 2, 0, block_size, :right, block_offset),~ +** Processing line: ~ Square.new(args, 5, 0, block_size, :right, block_offset),~ +** Processing line: ~ Square.new(args, 6, 7, block_size, :right, block_offset)~ +** Processing line: ~ ]~ ** Processing line: ~~ -** Processing line: ~ outputs.sprites << [1110, 200, 100, 100, 'sprites/dragon_fly_0.png']~ -** Processing line: ~ "~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick_explain_tick_count~ -** Processing line: ~ return unless $tutorial_outputs.sprites.any? {|s| s == [1110, 200, 100, 100, 'sprites/dragon_fly_0.png']}~ -** Processing line: ~ return if $tutorial_outputs.labels.any? {|l| l == [1210, 200, state.tick_count, 255, 255, 255]}~ -** Processing line: ~ state.explain_tick_count_confirmed = true~ +** Processing line: ~ #Possible orientations are :right, :left, :up, :down~ ** Processing line: ~~ -** Processing line: ~ queue_message "Look at the cute little dragon!~ ** Processing line: ~~ -** Processing line: ~ We can create a LABEL with ARRAYS too. Let's create a LABEL showing~ -** Processing line: ~ THE PASSAGE OF TIME, which is called TICK_COUNT.~ +** Processing line: ~ args.state.tshapes ||= [~ +** Processing line: ~ TShape.new(args, 0, 6, block_size, :left, block_offset),~ +** Processing line: ~ TShape.new(args, 3, 3, block_size, :down, block_offset),~ +** Processing line: ~ TShape.new(args, 0, 3, block_size, :right, block_offset),~ +** Processing line: ~ TShape.new(args, 0, 11, block_size, :up, block_offset)~ +** Processing line: ~ ]~ ** Processing line: ~~ -** Processing line: ~ outputs.labels << [1210, 200, state.tick_count, 0, 255, 0]~ -** Processing line: ~ "~ -** Processing line: ~ end~ +** Processing line: ~ args.state.lines ||= [~ +** Processing line: ~ Line.new(args,3, 8, block_size, :down, block_offset),~ +** Processing line: ~ Line.new(args, 7, 3, block_size, :up, block_offset),~ +** Processing line: ~ Line.new(args, 3, 7, block_size, :right, block_offset)~ +** Processing line: ~ ]~ ** Processing line: ~~ -** Processing line: ~ def tick_explain_mod~ -** Processing line: ~ return unless $tutorial_outputs.labels.any? {|l| l == [1210, 200, state.tick_count, 0, 255, 0]}~ -** Processing line: ~ state.explain_mod_confirmed = true~ -** Processing line: ~ queue_message "~ -** Processing line: ~ The code: outputs.labels << [1210, 200, state.tick_count, 0, 255, 0]~ -** Processing line: ~ Does the following:~ -** Processing line: ~ 1. GET the place where labels go: outputs.labels~ -** Processing line: ~ 2. Request that a new label be ADDED: <<~ -** Processing line: ~ 3. The DEFINITION of a LABEL is the ARRAY:~ -** Processing line: ~ [1210, 200, state.tick_count, 0, 255, 0]~ +** Processing line: ~ #exit()~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ GET ADD X Y TEXT RED GREEN BLUE~ -** Processing line: ~ | | | | | | | |~ -** Processing line: ~ | | | | | | | |~ -** Processing line: ~ outputs.labels << [1210, 200, state.tick_count, 0, 255, 0]~ -** Processing line: ~ |______________________________________________|~ -** Processing line: ~ |~ -** Processing line: ~ |~ -** Processing line: ~ ARRAY~ +** Processing line: ~ def init_balls args~ +** Processing line: ~ return unless args.state.num_balls < BALL_COUNT~ ** Processing line: ~~ -** Processing line: ~ Now let's do some MATH, save the result to STATE, and create a LABEL:~ ** Processing line: ~~ -** Processing line: ~ state.sprite_frame = state.tick_count.idiv(4).mod(6)~ -** Processing line: ~ outputs.labels << [1210, 170, state.sprite_frame, 0, 255, 0]~ +** Processing line: ~ #only create a new ball every 10 ticks~ +** Processing line: ~ return unless args.state.ball_created_at.elapsed_time > 10~ ** Processing line: ~~ -** Processing line: ~ Type the lines above (pressing ENTER after each line).~ -** Processing line: ~ "~ +** Processing line: ~ if (args.state.num_balls == 0)~ +** Processing line: ~ args.state.balls.append(Ball.new(args,args.state.num_balls,BALL_COUNT-1, nil, nil))~ +** Processing line: ~ args.state.ballParents = [args.state.balls[0]]~ +** Processing line: ~ else~ +** Processing line: ~ args.state.balls.append(Ball.new(args,args.state.num_balls,BALL_COUNT-1, args.state.balls.last, nil) )~ +** Processing line: ~ args.state.balls[-2].child = args.state.balls[-1]~ +** Processing line: ~ end~ +** Processing line: ~ args.state.ball_created_at = args.state.tick_count~ +** Processing line: ~ args.state.num_balls += 1~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick_explain_string_interpolation~ -** Processing line: ~ return unless state.explain_mod_confirmed~ -** Processing line: ~ return unless state.sprite_frame == state.tick_count.idiv(4).mod(6)~ -** Processing line: ~ return unless $tutorial_outputs.labels.any? {|l| l == [1210, 170, state.sprite_frame, 0, 255, 0]}~ +** Processing line: ~ #Render loop~ +** Processing line: ~ def render args~ +** Processing line: ~ bgClr = {r:10, g:10, b:200}~ +** Processing line: ~ bgClr = {r:255-30, g:255-30, b:255-30}~ ** Processing line: ~~ -** Processing line: ~ queue_message "Here is what the mathematical computation you just typed does:~ +** Processing line: ~ args.outputs.solids << [0, 0, $args.grid.right, $args.grid.top, bgClr[:r], bgClr[:g], bgClr[:b]];~ +** Processing line: ~ args.outputs.borders << args.state.game_area~ ** Processing line: ~~ -** Processing line: ~ 1. Create an item of STATE named SPRITE_FRAME: state.sprite_frame =~ -** Processing line: ~ 2. Set this SPRITE_FRAME to the PASSAGE OF TIME (tick_count),~ -** Processing line: ~ DIVIDED EVENLY (idiv) into 4,~ -** Processing line: ~ and then compute the REMAINDER (mod) of 6.~ +** Processing line: ~ render_instructions args~ +** Processing line: ~ render_shapes args~ ** Processing line: ~~ -** Processing line: ~ STATE SPRITE_FRAME PASSAGE OF HOW LONG HOW MANY~ -** Processing line: ~ | | TIME TO SHOW IMAGES~ -** Processing line: ~ | | | AN IMAGE TO FLIP THROUGH~ -** Processing line: ~ | | | | |~ -** Processing line: ~ state.sprite_frame = state.tick_count.idiv(4).mod(6)~ -** Processing line: ~ | |~ -** Processing line: ~ | +- REMAINDER OF DIVIDE~ -** Processing line: ~ DIVIDE EVENLY~ -** Processing line: ~ (NO DECIMALS)~ +** Processing line: ~ render_balls args~ ** Processing line: ~~ -** Processing line: ~ With the information above, we can animate a SPRITE~ -** Processing line: ~ using STRING INTERPOLATION: \#{}~ -** Processing line: ~ which creates a unique SPRITE_PATH:~ +** Processing line: ~ #args.state.rectangle.draw args~ ** Processing line: ~~ -** Processing line: ~ state.sprite_path = \"sprites/dragon_fly_\#{state.sprite_frame}.png\"~ -** Processing line: ~ outputs.labels << [910, 330, \"path: \#{state.sprite_path}\", 0, 255, 0]~ -** Processing line: ~ outputs.sprites << [910, 330, 370, 370, state.sprite_path]~ +** Processing line: ~ args.outputs.sprites << [$args.grid.right-(args.state.board_width + args.grid.w / 8), 0, $args.grid.right, $args.grid.top, "sprites/square-white-2.png", 0, 255, bgClr[:r], bgClr[:g], bgClr[:b]]~ +** Processing line: ~ args.outputs.sprites << [0, 0, (args.state.board_width + args.grid.w / 8), $args.grid.top, "sprites/square-white-2.png", 0, 255, bgClr[:r], bgClr[:g], bgClr[:b]]~ ** Processing line: ~~ -** Processing line: ~ Type the lines above (pressing ENTER after each line).~ -** Processing line: ~ "~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick_reprint_on_error~ -** Processing line: ~ return unless console.last_command_errored~ -** Processing line: ~ puts $gtk.state.messages.last~ -** Processing line: ~ puts "\nWhoops! Try again."~ -** Processing line: ~ console.last_command_errored = false~ -** Processing line: ~ end~ +** Processing line: ~ begin :render_methods~ +** Processing line: ~ def render_instructions args~ +** Processing line: ~ #gtk.current_framerate~ +** Processing line: ~ args.outputs.labels << [20, $args.grid.top-20, "FPS: " + $gtk.current_framerate.to_s]~ +** Processing line: ~ if (args.state.balls != nil && args.state.balls[0] != nil)~ +** Processing line: ~ bx = args.state.balls[0].velocity.x~ +** Processing line: ~ by = args.state.balls[0].velocity.y~ +** Processing line: ~ bmg = (bx**2.0 + by**2.0)**0.5~ +** Processing line: ~ args.outputs.labels << [20, $args.grid.top-20-20, "V: " + bmg.to_s ]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick_evals~ -** Processing line: ~ state.evals ||= []~ -** Processing line: ~ if console.last_command && (console.last_command.start_with?("outputs.") || console.last_command.start_with?("state."))~ -** Processing line: ~ state.evals << console.last_command~ -** Processing line: ~ console.last_command = nil~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ state.evals.each do |l|~ -** Processing line: ~ Kernel.eval l~ ** Processing line: ~ end~ -** Processing line: ~ rescue Exception => e~ -** Processing line: ~ state.evals = state.evals[0..-2]~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ $tutorial_outputs ||= TutorialOutputs.new~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ $gtk.log_level = :off~ -** Processing line: ~ defaults~ -** Processing line: ~ console.show~ -** Processing line: ~ $tutorial_outputs.clear~ -** Processing line: ~ $tutorial_outputs.solids << [900, 37, 480, 700, 0, 0, 0, 255]~ -** Processing line: ~ $tutorial_outputs.borders << [900, 37, 380, 683, 255, 255, 255]~ -** Processing line: ~ tick_evals~ -** Processing line: ~ $tutorial_outputs.tick~ -** Processing line: ~ tick_intro~ -** Processing line: ~ tick_hello_dragonruby~ -** Processing line: ~ tick_reset_button~ -** Processing line: ~ tick_explain_solid~ -** Processing line: ~ tick_explain_solid_blue~ -** Processing line: ~ tick_reprint_on_error~ -** Processing line: ~ tick_explain_tick_count~ -** Processing line: ~ tick_explain_mod~ -** Processing line: ~ tick_explain_string_interpolation~ -** Processing line: ~ end~ +** Processing line: ~ def render_shapes args~ +** Processing line: ~ for s in args.state.squares~ +** Processing line: ~ s.draw args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def console~ -** Processing line: ~ $gtk.console~ -** Processing line: ~ end~ +** Processing line: ~ for l in args.state.lines~ +** Processing line: ~ l.draw args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def queue_message message~ -** Processing line: ~ $gtk.args.state.messages ||= []~ -** Processing line: ~ return if $gtk.args.state.messages.include? message~ -** Processing line: ~ $gtk.args.state.messages << message~ -** Processing line: ~ last_three = [$gtk.console.log[-3], $gtk.console.log[-2], $gtk.console.log[-1]].reject_nil~ -** Processing line: ~ $gtk.console.log.clear~ -** Processing line: ~ puts seperator~ -** Processing line: ~ $gtk.console.log += last_three~ -** Processing line: ~ puts seperator~ -** Processing line: ~ puts message~ -** Processing line: ~ puts seperator~ -** Processing line: ~ end~ +** Processing line: ~ for t in args.state.tshapes~ +** Processing line: ~ t.draw args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def console_has? message~ -** Processing line: ~ console.log.map(&:upcase).include? "#{message.upcase}\n"~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def restart_tutorial~ -** Processing line: ~ $tutorial_outputs.clear~ -** Processing line: ~ $gtk.console.log.clear~ -** Processing line: ~ $gtk.reset~ -** Processing line: ~ puts "Starting the tutorial over!"~ -** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def state~ -** Processing line: ~ $gtk.args.state~ -** Processing line: ~ end~ +** Processing line: ~ def render_balls args~ +** Processing line: ~ #args.state.balls.each do |ball|~ +** Processing line: ~ #ball.draw args~ +** Processing line: ~ #end~ ** Processing line: ~~ -** Processing line: ~ def inputs~ -** Processing line: ~ $gtk.args.inputs~ +** Processing line: ~ args.outputs.sprites << args.state.balls.map do |ball|~ +** Processing line: ~ ball.getDraw args~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def outputs~ -** Processing line: ~ $tutorial_outputs~ -** Processing line: ~ end~ +** Processing line: ~ #Calls all methods necessary for performing calculations~ +** Processing line: ~ def calc args~ +** Processing line: ~ for b in args.state.ballParents~ +** Processing line: ~ b.update args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ for s in args.state.squares~ +** Processing line: ~ s.update args~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ for l in args.state.lines~ +** Processing line: ~ l.update args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - printing.txt~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - printing.txt~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ for t in args.state.tshapes~ +** Processing line: ~ t.update args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/01_printing.txt~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Commenting Code~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ #~ -** Processing line: ~ # Prefixing text with a pound sign (#) is how you comment code in Ruby. Example:~ -** Processing line: ~ #~ -** Processing line: ~ # I am commented code. And so are the lines above.~ -** Processing line: ~ #~ -** Processing line: ~ # I you want more than a quick primer on Ruby, check out https://poignant.guide/. It's~ -** Processing line: ~ # an entertaining read. Otherwise, go to the next txt file.~ -** Processing line: ~ #~ -** Processing line: ~ # Follow along by visiting:~ -** Processing line: ~ # https://s3.amazonaws.com/s3.dragonruby.org/dragonruby-gtk-intermediate.mp4~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Printing to the Console:~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ #~ -** Processing line: ~ # Every time you save repl.rb file, DragonRuby runs the code within it. Copy this text~ -** Processing line: ~ # to repl.rb and save to see Hello World printed to the console.~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts '* RUBY PRIMER: Printing to the console using the ~puts~ function.'~ -** Processing line: ~ puts '===='~ -** Processing line: ~ puts '======'~ -** Processing line: ~ puts '================================'~ -** Processing line: ~ puts 'Hello World'~ -** Processing line: ~ puts '================================'~ -** Processing line: ~ puts '======'~ -** Processing line: ~ puts '===='~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. -** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - strings.txt~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - strings.txt~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ begin :calc_methods~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/02_strings.txt~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Strings~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ #~ -** Processing line: ~ # Here is how you work with strings in Ruby. Take the text~ -** Processing line: ~ # in this file and paste it into repl.rb and save:~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts '* RUBY PRIMER: strings'~ -** 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: ~ def tick args~ +** Processing line: ~ defaults args~ +** Processing line: ~ render args~ +** Processing line: ~ calc args~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt~ -- H1 detected. +** Processing line: ~*** Physics And Collisions - Arbitrary Collision - paddle.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Arbitrary Collision - paddle.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: ~Physics And Collisions - Arbitrary Collision - paddle.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/00_learn_ruby_optional/00_intermediate_ruby_primer/app/03_numbers.txt~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Numerics~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ #~ -** Processing line: ~ # Here is how you work with numbers in Ruby. Take the text~ -** Processing line: ~ # in this file and paste it into repl.rb and save:~ +** Processing line: ~ # ./samples/04_physics_and_collisions/09_arbitrary_collision/app/paddle.rb~ +** Processing line: ~ class Paddle~ +** Processing line: ~ attr_accessor :enabled~ +** Processing line: ~~ +** Processing line: ~ def initialize ()~ +** Processing line: ~ @x=WIDTH/2~ +** Processing line: ~ @y=100~ +** Processing line: ~ @width=100~ +** Processing line: ~ @height=20~ +** Processing line: ~ @speed=10~ +** Processing line: ~~ +** Processing line: ~ @xyCollision = LinearCollider.new({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5})~ +** Processing line: ~ @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos)~ +** Processing line: ~ @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height+5})~ +** Processing line: ~ @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}, :pos)~ +** Processing line: ~~ +** Processing line: ~ @enabled = true~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def update args~ +** Processing line: ~ @xyCollision.resetPoints({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5})~ +** Processing line: ~ @xyCollision2.resetPoints({x: @x,y: @y}, {x: @x+@width, y: @y})~ +** Processing line: ~ @xyCollision3.resetPoints({x: @x,y: @y}, {x: @x, y: @y+@height+5})~ +** Processing line: ~ @xyCollision4.resetPoints({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5})~ +** Processing line: ~~ +** Processing line: ~ @xyCollision.update args~ +** Processing line: ~ @xyCollision2.update args~ +** Processing line: ~ @xyCollision3.update args~ +** Processing line: ~ @xyCollision4.update args~ +** Processing line: ~~ +** Processing line: ~ args.inputs.keyboard.key_held.left ||= false~ +** Processing line: ~ args.inputs.keyboard.key_held.right ||= false~ +** Processing line: ~~ +** Processing line: ~ if not (args.inputs.keyboard.key_held.left == args.inputs.keyboard.key_held.right)~ +** Processing line: ~ if args.inputs.keyboard.key_held.left && @enabled~ +** Processing line: ~ @x-=@speed~ +** Processing line: ~ elsif args.inputs.keyboard.key_held.right && @enabled~ +** Processing line: ~ @x+=@speed~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts '* RUBY PRIMER: Fixnum and Floats'~ -** 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: ~ puts ''~ +** Processing line: ~ xmin =WIDTH/4~ +** Processing line: ~ xmax = 3*(WIDTH/4)~ +** Processing line: ~ @x = (@x+@width > xmax) ? xmax-@width : (@x 3~ -** Processing line: ~ puts "4 is greater than 3 (>)"~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ #returns a new vector equivalent to this+vect~ +** Processing line: ~ #vect [Vector2d] vector to add to self~ +** Processing line: ~ def add vect~ +** Processing line: ~ Vector2d.new(@x+vect.x,@y+vect.y)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # and/or conditionals~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #returns a new vector equivalent to this-vect~ +** Processing line: ~ #vect [Vector2d] vector to subtract to self~ +** Processing line: ~ def sub vect~ +** Processing line: ~ Vector2d.new(@x-vect.c, @y-vect.y)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: AND, OR operator (&&, ||)"~ -** Processing line: ~ if (4 > 3) || (3 < 4) || false~ -** Processing line: ~ puts "print this if 4 is greater than 3 OR 3 is less than 4 OR false is true (||)"~ -** Processing line: ~ end~ +** Processing line: ~ #return the magnitude of the vector~ +** Processing line: ~ def mag~ +** Processing line: ~ ((@x**2)+(@y**2))**0.5~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if (4 > 3) && (3 < 4)~ -** Processing line: ~ puts "print this if 4 is greater than 3 AND 3 is less than 4 (&&)"~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ #returns a new normalize version of the vector~ +** Processing line: ~ def normalize~ +** Processing line: ~ Vector2d.new(@x/mag, @y/mag)~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ #TODO delet?~ +** Processing line: ~ def distABS vect~ +** Processing line: ~ (((vect.x-@x)**2+(vect.y-@y)**2)**0.5).abs()~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - looping.txt~ -- H1 detected. +** Processing line: ~*** Physics And Collisions - Collision With Object Removal - ball.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - looping.txt~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Collision With Object Removal - ball.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: ~Physics And Collisions - Collision With Object Removal - ball.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/00_learn_ruby_optional/00_intermediate_ruby_primer/app/06_looping.txt~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Looping~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ #~ -** Processing line: ~ # Looping looks a whole lot different than other languages.~ -** Processing line: ~ # But it's pretty awesome when you get used to it.~ -** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "* RUBY PRIMER: Loops"~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # times~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: ~Numeric#times~ (for loop)"~ -** Processing line: ~ 3.times do |i|~ -** Processing line: ~ puts i~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ # ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/ball.rb~ +** Processing line: ~ class Ball~ +** Processing line: ~ #TODO limit accessors?~ +** Processing line: ~ attr_accessor :xy, :width, :height, :velocity~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # foreach~ -** Processing line: ~ # ====================================================================================~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: ~Array#each~ (for each loop)"~ -** Processing line: ~ array = ["a", "b", "c", "d"]~ -** Processing line: ~ array.each do |char|~ -** Processing line: ~ puts char~ +** Processing line: ~ #@xy [Vector2d] x,y position~ +** Processing line: ~ #@velocity [Vector2d] velocity of ball~ +** Processing line: ~ def initialize~ +** Processing line: ~ @xy = Vector2d.new(WIDTH/2,500)~ +** Processing line: ~ @velocity = Vector2d.new(4,-4)~ +** Processing line: ~ @width = 20~ +** Processing line: ~ @height = 20~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ puts "** INFO: ~Array#each_with_index~ (for each loop)"~ -** Processing line: ~ array = ["a", "b", "c", "d"]~ -** Processing line: ~ array.each do |char, i|~ -** Processing line: ~ puts "index #{i}: #{char}"~ +** Processing line: ~ #move the ball according to its velocity~ +** Processing line: ~ def update args~ +** Processing line: ~ @xy.x+=@velocity.x~ +** Processing line: ~ @xy.y+=@velocity.y~ ** Processing line: ~ end~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # ranges~ -** Processing line: ~ # ====================================================================================~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: range block exclusive (three dots)"~ -** Processing line: ~ (0...3).each do |i|~ -** Processing line: ~ puts i~ +** Processing line: ~ #render the ball to the screen~ +** Processing line: ~ def render args~ +** Processing line: ~ args.outputs.solids << [@xy.x,@xy.y,@width,@height,255,0,255];~ +** Processing line: ~ #args.outputs.labels << [20,HEIGHT-50,"velocity: " +@velocity.x.to_s+","+@velocity.y.to_s + " magnitude:" + @velocity.mag.to_s]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ puts "** INFO: range block inclusive (two dots)"~ -** Processing line: ~ (0..3).each do |i|~ -** Processing line: ~ puts i~ +** Processing line: ~ def rect~ +** Processing line: ~ [@xy.x,@xy.y,@width,@height]~ ** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - functions.txt~ -- H1 detected. +** Processing line: ~*** Physics And Collisions - Collision With Object Removal - linear_collider.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - functions.txt~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Collision With Object Removal - linear_collider.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: ~Physics And Collisions - Collision With Object Removal - linear_collider.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/00_learn_ruby_optional/00_intermediate_ruby_primer/app/07_functions.txt~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Functions~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ # ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/linear_collider.rb~ +** Processing line: ~ #The LinearCollider (theoretically) produces collisions upon a line segment defined point.y two x,y cordinates~ ** Processing line: ~~ -** Processing line: ~ # The last statement of a function is implictly returned. Parenthesis for functions~ -** Processing line: ~ # are optional as long as the statement can be envaluated disambiguously.~ +** Processing line: ~ class LinearCollider~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "* RUBY PRIMER: Functions"~ -** Processing line: ~ end~ +** Processing line: ~ #start [Array of length 2] start of the line segment as a x,y cordinate~ +** Processing line: ~ #last [Array of length 2] end of the line segment as a x,y cordinate~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Functions single parameter~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #inorder for the LinearCollider to be functional the line segment must be said to have a thickness~ +** Processing line: ~ #(as it is unlikly that a colliding object will land exactly on the linesegment)~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "* INFO: Function with one parameter"~ +** Processing line: ~ #extension defines if the line's thickness extends negatively or positively~ +** Processing line: ~ #extension :pos extends positively~ +** Processing line: ~ #extension :neg extends negatively~ +** Processing line: ~~ +** Processing line: ~ #thickness [float] how thick the line should be (should always be atleast as large as the magnitude of the colliding object)~ +** Processing line: ~ def initialize (pointA, pointB, extension=:neg, thickness=10)~ +** Processing line: ~ @pointA = pointA~ +** Processing line: ~ @pointB = pointB~ +** Processing line: ~ @thickness = thickness~ +** Processing line: ~ @extension = extension~ +** Processing line: ~~ +** Processing line: ~ @pointAExtended={~ +** Processing line: ~ x: @pointA.x + @thickness*(@extension == :neg ? -1 : 1),~ +** Processing line: ~ y: @pointA.y + @thickness*(@extension == :neg ? -1 : 1)~ +** Processing line: ~ }~ +** Processing line: ~ @pointBExtended={~ +** Processing line: ~ x: @pointB.x + @thickness*(@extension == :neg ? -1 : 1),~ +** Processing line: ~ y: @pointB.y + @thickness*(@extension == :neg ? -1 : 1)~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~ # function definition~ -** Processing line: ~ def add_one_to n~ -** Processing line: ~ n + 1~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Parenthesis are optional in Ruby as long as the~ -** Processing line: ~ # parsing is disambiguous. Here are a couple of variations.~ -** Processing line: ~ # Generally speaking, don't put parenthesis is you don't have to.~ +** Processing line: ~ def resetPoints(pointA,pointB)~ +** Processing line: ~ @pointA = pointA~ +** Processing line: ~ @pointB = pointB~ ** Processing line: ~~ -** Processing line: ~ # Conventional Usage of Parenthesis.~ -** Processing line: ~ puts add_one_to(3)~ +** Processing line: ~ @pointAExtended={~ +** Processing line: ~ x:@pointA.x + @thickness*(@extension == :neg ? -1 : 1),~ +** Processing line: ~ y:@pointA.y + @thickness*(@extension == :neg ? -1 : 1)~ +** Processing line: ~ }~ +** Processing line: ~ @pointBExtended={~ +** Processing line: ~ x:@pointB.x + @thickness*(@extension == :neg ? -1 : 1),~ +** Processing line: ~ y:@pointB.y + @thickness*(@extension == :neg ? -1 : 1)~ +** Processing line: ~ }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # DragonRuby's recommended use of parenthesis (inner function has parenthesis).~ -** Processing line: ~ puts (add_one_to 3)~ +** Processing line: ~ #TODO: Ugly function~ +** Processing line: ~ def slope (pointA, pointB)~ +** Processing line: ~ return (pointB.x==pointA.x) ? INFINITY : (pointB.y+-pointA.y)/(pointB.x+-pointA.x)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Full parens.~ -** Processing line: ~ puts(add_one_to(3))~ +** Processing line: ~ #TODO: Ugly function~ +** Processing line: ~ def intercept(pointA, pointB)~ +** Processing line: ~ if (slope(pointA, pointB) == INFINITY)~ +** Processing line: ~ -INFINITY~ +** Processing line: ~ elsif slope(pointA, pointB) == -1*INFINITY~ +** Processing line: ~ INFINITY~ +** Processing line: ~ else~ +** Processing line: ~ pointA.y+-1.0*(slope(pointA, pointB)*pointA.x)~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outer function has parenthesis~ -** Processing line: ~ puts(add_one_to 3)~ -** Processing line: ~ end~ +** Processing line: ~ def calcY(pointA, pointB, x)~ +** Processing line: ~ return slope(pointA, pointB)*x + intercept(pointA, pointB)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Functions with default parameter values~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #test if a collision has occurred~ +** Processing line: ~ def isCollision? (point)~ +** Processing line: ~ #INFINITY slop breaks down when trying to determin collision, ergo it requires a special test~ +** Processing line: ~ if slope(@pointA, @pointB) == INFINITY &&~ +** Processing line: ~ point.x >= [@pointA.x,@pointB.x].min+(@extension == :pos ? -@thickness : 0) &&~ +** Processing line: ~ point.x <= [@pointA.x,@pointB.x].max+(@extension == :neg ? @thickness : 0) &&~ +** Processing line: ~ point.y >= [@pointA.y,@pointB.y].min && point.y <= [@pointA.y,@pointB.y].max~ +** Processing line: ~ return true~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ isNegInLine = @extension == :neg &&~ +** Processing line: ~ point.y <= slope(@pointA, @pointB)*point.x+intercept(@pointA,@pointB) &&~ +** Processing line: ~ point.y >= point.x*slope(@pointAExtended, @pointBExtended)+intercept(@pointAExtended,@pointBExtended)~ +** Processing line: ~ isPosInLine = @extension == :pos &&~ +** Processing line: ~ point.y >= slope(@pointA, @pointB)*point.x+intercept(@pointA,@pointB) &&~ +** Processing line: ~ point.y <= point.x*slope(@pointAExtended, @pointBExtended)+intercept(@pointAExtended,@pointBExtended)~ +** Processing line: ~ isInBoxBounds = point.x >= [@pointA.x,@pointB.x].min &&~ +** Processing line: ~ point.x <= [@pointA.x,@pointB.x].max &&~ +** Processing line: ~ point.y >= [@pointA.y,@pointB.y].min+(@extension == :neg ? -@thickness : 0) &&~ +** Processing line: ~ point.y <= [@pointA.y,@pointB.y].max+(@extension == :pos ? @thickness : 0)~ +** Processing line: ~~ +** Processing line: ~ return isInBoxBounds && (isNegInLine || isPosInLine)~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "* INFO: 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 the argument three yields: #{function_with_default_value 3}"~ -** Processing line: ~ puts "Passing no argument yields: #{function_with_default_value}"~ -** Processing line: ~ end~ +** Processing line: ~ def getRepelMagnitude (fbx, fby, vrx, vry, args)~ +** Processing line: ~ a = fbx ; b = vrx ; c = fby~ +** Processing line: ~ d = vry ; e = args.state.ball.velocity.mag~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Nil default parameter value and ||= operator.~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ if b**2 + d**2 == 0~ +** Processing line: ~ puts "magnitude error"~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "* INFO: Using the OR EQUAL operator (||=)"~ -** Processing line: ~ def function_with_nil_default_with_local a = nil~ -** Processing line: ~ result = a~ -** Processing line: ~ result ||= "DEFAULT_VALUE_OF_A_IS_NIL_OR_FALSE"~ -** Processing line: ~ "value is #{result}."~ +** Processing line: ~ x1 = (-a*b+-c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 + d**2 - a**2 * d**2)**0.5)/(b**2 + d**2)~ +** Processing line: ~ x2 = -((a*b + c*d + (e**2 * b**2 - b**2 * c**2 + 2*a*b*c*d + e**2 * d**2 - a**2 * d**2)**0.5)/(b**2 + d**2))~ +** Processing line: ~ return ((a+x1*b)**2 + (c+x1*d)**2 == e**2) ? x1 : x2~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ puts "Passing 'hi' as the argument yields: #{function_with_nil_default_with_local 'hi'}"~ -** Processing line: ~ puts "Passing nil: #{function_with_nil_default_with_local}"~ +** Processing line: ~ def update args~ +** Processing line: ~ #each of the four points on the square ball - NOTE simple to extend to a circle~ +** Processing line: ~ points= [ {x: args.state.ball.xy.x, y: args.state.ball.xy.y},~ +** Processing line: ~ {x: args.state.ball.xy.x+args.state.ball.width, y: args.state.ball.xy.y},~ +** Processing line: ~ {x: args.state.ball.xy.x, y: args.state.ball.xy.y+args.state.ball.height},~ +** Processing line: ~ {x: args.state.ball.xy.x+args.state.ball.width, y: args.state.ball.xy.y + args.state.ball.height}~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ #for each point p in points~ +** Processing line: ~ for point in points~ +** Processing line: ~ #isCollision.md has more information on this section~ +** Processing line: ~ #TODO: section can certainly be simplifyed~ +** Processing line: ~ if isCollision?(point)~ +** Processing line: ~ u = Vector2d.new(1.0,((slope(@pointA, @pointB)==0) ? INFINITY : -1/slope(@pointA, @pointB))*1.0).normalize #normal perpendicular (to line segment) vector~ +** Processing line: ~~ +** Processing line: ~ #the vector with the repeling force can be u or -u depending of where the ball was coming from in relation to the line segment~ +** Processing line: ~ previousBallPosition=Vector2d.new(point.x-args.state.ball.velocity.x,point.y-args.state.ball.velocity.y)~ +** Processing line: ~ choiceA = (u.mult(1))~ +** Processing line: ~ choiceB = (u.mult(-1))~ +** Processing line: ~ vectorRepel = nil~ +** Processing line: ~~ +** Processing line: ~ if (slope(@pointA, @pointB))!=INFINITY && u.y < 0~ +** Processing line: ~ choiceA, choiceB = choiceB, choiceA~ +** Processing line: ~ end~ +** Processing line: ~ vectorRepel = (previousBallPosition.y > calcY(@pointA, @pointB, previousBallPosition.x)) ? choiceA : choiceB~ +** Processing line: ~~ +** Processing line: ~ #vectorRepel = (previousBallPosition.y > slope(@pointA, @pointB)*previousBallPosition.x+intercept(@pointA,@pointB)) ? choiceA : choiceB)~ +** Processing line: ~ if (slope(@pointA, @pointB) == INFINITY) #slope INFINITY breaks down in the above test, ergo it requires a custom test~ +** Processing line: ~ vectorRepel = (previousBallPosition.x > @pointA.x) ? (u.mult(1)) : (u.mult(-1))~ +** Processing line: ~ end~ +** Processing line: ~ #puts (" " + $t[0].to_s + "," + $t[1].to_s + " " + $t[2].to_s + "," + $t[3].to_s + " " + " " + u.x.to_s + "," + u.y.to_s)~ +** Processing line: ~ #vectorRepel now has the repeling force~ +** Processing line: ~~ +** Processing line: ~ mag = args.state.ball.velocity.mag~ +** Processing line: ~ theta_ball=Math.atan2(args.state.ball.velocity.y,args.state.ball.velocity.x) #the angle of the ball's velocity~ +** Processing line: ~ theta_repel=Math.atan2(vectorRepel.y,vectorRepel.x) #the angle of the repeling force~ +** Processing line: ~ #puts ("theta:" + theta_ball.to_s + " " + theta_repel.to_s) #theta okay~ +** Processing line: ~~ +** Processing line: ~ fbx = mag * Math.cos(theta_ball) #the x component of the ball's velocity~ +** Processing line: ~ fby = mag * Math.sin(theta_ball) #the y component of the ball's velocity~ +** Processing line: ~~ +** Processing line: ~ repelMag = getRepelMagnitude(fbx, fby, vectorRepel.x, vectorRepel.y, args)~ +** Processing line: ~~ +** Processing line: ~ frx = repelMag* Math.cos(theta_repel) #the x component of the repel's velocity | magnitude is set to twice of fbx~ +** Processing line: ~ fry = repelMag* Math.sin(theta_repel) #the y component of the repel's velocity | magnitude is set to twice of fby~ +** Processing line: ~~ +** Processing line: ~ fsumx = fbx+frx #sum of x forces~ +** Processing line: ~ fsumy = fby+fry #sum of y forces~ +** Processing line: ~ fr = mag#fr is the resulting magnitude~ +** Processing line: ~ thetaNew = Math.atan2(fsumy, fsumx) #thetaNew is the resulting angle~ +** Processing line: ~ xnew = fr*Math.cos(thetaNew) #resulting x velocity~ +** Processing line: ~ ynew = fr*Math.sin(thetaNew) #resulting y velocity~ +** Processing line: ~~ +** Processing line: ~ args.state.ball.velocity = Vector2d.new(xnew,ynew)~ +** Processing line: ~ #args.state.ball.xy.add(args.state.ball.velocity)~ +** Processing line: ~ break #no need to check the other points ?~ +** Processing line: ~ else~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end #end update~ +** Processing line: ~~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt~ -- H1 detected. +** Processing line: ~*** Physics And Collisions - Collision With Object Removal - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Collision With Object Removal - 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: ~Physics And Collisions - Collision With Object Removal - 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/00_learn_ruby_optional/00_intermediate_ruby_primer/app/08_arrays.txt~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Arrays~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~~ -** Processing line: ~ # Arrays are incredibly powerful in Ruby. Learn to use them well.~ +** Processing line: ~ # ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/main.rb~ +** Processing line: ~ # coding: utf-8~ +** Processing line: ~ INFINITY= 10**10~ +** Processing line: ~ WIDTH=1280~ +** Processing line: ~ HEIGHT=720~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "* RUBY PRIMER: ARRAYS"~ -** Processing line: ~ end~ +** Processing line: ~ require 'app/vector2d.rb'~ +** Processing line: ~ require 'app/paddle.rb'~ +** Processing line: ~ require 'app/ball.rb'~ +** Processing line: ~ require 'app/linear_collider.rb'~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Enumerable ranges and .to_a~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #Method to init default values~ +** Processing line: ~ def defaults args~ +** Processing line: ~ args.state.game_board ||= [(args.grid.w / 2 - args.grid.w / 4), 0, (args.grid.w / 2), args.grid.h]~ +** Processing line: ~ args.state.bricks ||= []~ +** Processing line: ~ args.state.num_bricks ||= 0~ +** Processing line: ~ args.state.game_over_at ||= 0~ +** Processing line: ~ args.state.paddle ||= Paddle.new~ +** Processing line: ~ args.state.ball ||= Ball.new~ +** Processing line: ~ args.state.westWall ||= LinearCollider.new({x: args.grid.w/4, y: 0}, {x: args.grid.w/4, y: args.grid.h}, :pos)~ +** Processing line: ~ args.state.eastWall ||= LinearCollider.new({x: 3*args.grid.w*0.25, y: 0}, {x: 3*args.grid.w*0.25, y: args.grid.h})~ +** Processing line: ~ args.state.southWall ||= LinearCollider.new({x: 0, y: 0}, {x: args.grid.w, y: 0})~ +** Processing line: ~ args.state.northWall ||= LinearCollider.new({x: 0, y:args.grid.h}, {x: args.grid.w, y: args.grid.h}, :pos)~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: 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: ~ #args.state.testWall ||= LinearCollider.new({x:0 , y:0},{x:args.grid.w, y:args.grid.h})~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Finding elements~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #Render loop~ +** Processing line: ~ def render args~ +** Processing line: ~ render_instructions args~ +** Processing line: ~ render_board args~ +** Processing line: ~ render_bricks args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: Finding elements in an array using ~Array#find_all~."~ -** Processing line: ~ puts "Create a new array that only contains even numbers from the previous array."~ +** Processing line: ~ begin :render_methods~ +** Processing line: ~ #Method to display the instructions of the game~ +** Processing line: ~ def render_instructions args~ +** Processing line: ~ args.outputs.labels << [225, args.grid.h - 30, "← and → to move the paddle left and right", 0, 1]~ +** Processing line: ~ end~ ** Processing line: ~~ -** 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: ~ def render_board args~ +** Processing line: ~ args.outputs.borders << args.state.game_board~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ puts evens~ +** Processing line: ~ def render_bricks args~ +** Processing line: ~ args.outputs.solids << args.state.bricks.map(&:rect)~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Rejecting elements~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #Calls all methods necessary for performing calculations~ +** Processing line: ~ def calc args~ +** Processing line: ~ add_new_bricks args~ +** Processing line: ~ reset_game args~ +** Processing line: ~ calc_collision args~ +** Processing line: ~ win_game args~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: Removing elements in an array using ~Array#reject~."~ -** Processing line: ~ puts "Create a new array that rejects odd numbers."~ +** Processing line: ~ args.state.westWall.update args~ +** Processing line: ~ args.state.eastWall.update args~ +** Processing line: ~ args.state.southWall.update args~ +** Processing line: ~ args.state.northWall.update args~ +** Processing line: ~ args.state.paddle.update args~ +** Processing line: ~ args.state.ball.update args~ ** Processing line: ~~ -** 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: ~ #args.state.testWall.update args~ ** Processing line: ~~ -** Processing line: ~ puts also_even~ +** Processing line: ~ args.state.paddle.render args~ +** Processing line: ~ args.state.ball.render args~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Array transform using the map function.~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ begin :calc_methods~ +** Processing line: ~ def add_new_bricks args~ +** Processing line: ~ return if args.state.num_bricks > 40~ +** Processing line: ~~ +** Processing line: ~ #Width of the game board is 640px~ +** Processing line: ~ brick_width = (args.grid.w / 2) / 10~ +** Processing line: ~ brick_height = brick_width / 2~ +** Processing line: ~~ +** Processing line: ~ (4).map_with_index do |y|~ +** Processing line: ~ #Make a box that is 10 bricks wide and 4 bricks tall~ +** Processing line: ~ args.state.bricks += (10).map_with_index do |x|~ +** Processing line: ~ args.state.new_entity(:brick) do |b|~ +** Processing line: ~ b.x = x * brick_width + (args.grid.w / 2 - args.grid.w / 4)~ +** Processing line: ~ b.y = args.grid.h - ((y + 1) * brick_height)~ +** Processing line: ~ b.rect = [b.x + 1, b.y - 1, brick_width - 2, brick_height - 2, 235, 50 * y, 52]~ +** Processing line: ~~ +** Processing line: ~ #Add linear colliders to the brick~ +** Processing line: ~ b.collider_bottom = LinearCollider.new([(b.x-2), (b.y-5)], [(b.x+brick_width+1), (b.y-5)], :pos, brick_height)~ +** Processing line: ~ b.collider_right = LinearCollider.new([(b.x+brick_width+1), (b.y-5)], [(b.x+brick_width+1), (b.y+brick_height+1)], :pos)~ +** Processing line: ~ b.collider_left = LinearCollider.new([(b.x-2), (b.y-5)], [(b.x-2), (b.y+brick_height+1)], :neg)~ +** Processing line: ~ b.collider_top = LinearCollider.new([(b.x-2), (b.y+brick_height+1)], [(b.x+brick_width+1), (b.y+brick_height+1)], :neg)~ +** Processing line: ~~ +** Processing line: ~ # @xyCollision = LinearCollider.new({x: @x,y: @y+@height}, {x: @x+@width, y: @y+@height})~ +** Processing line: ~ # @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos)~ +** Processing line: ~ # @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height})~ +** Processing line: ~ # @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height}, :pos)~ +** Processing line: ~~ +** Processing line: ~ b.broken = false~ +** Processing line: ~~ +** Processing line: ~ args.state.num_bricks += 1~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: Creating new derived values from an array using ~Array#map~."~ -** Processing line: ~ puts "Create an array that doubles every number."~ +** Processing line: ~ def reset_game args~ +** Processing line: ~ if args.state.ball.xy.y < 20 && args.state.game_over_at.elapsed_time > 60~ +** Processing line: ~ #Freeze the ball~ +** Processing line: ~ args.state.ball.velocity.x = 0~ +** Processing line: ~ args.state.ball.velocity.y = 0~ +** Processing line: ~ #Freeze the paddle~ +** Processing line: ~ args.state.paddle.enabled = false~ ** Processing line: ~~ -** Processing line: ~ one_to_ten = (1..10).to_a~ -** Processing line: ~ doubled = one_to_ten.map do |number|~ -** Processing line: ~ number * 2~ +** Processing line: ~ args.state.game_over_at = args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if args.state.game_over_at.elapsed_time < 60 && args.state.tick_count > 60 && args.state.bricks.count != 0~ +** Processing line: ~ #Display a "Game over" message~ +** Processing line: ~ args.outputs.labels << [100, 100, "GAME OVER", 10]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #If 60 frames have passed since the game ended, restart the game~ +** Processing line: ~ if args.state.game_over_at != 0 && args.state.game_over_at.elapsed_time == 60~ +** Processing line: ~ # FIXME: only put value types in state~ +** Processing line: ~ args.state.ball = Ball.new~ +** Processing line: ~~ +** Processing line: ~ # FIXME: only put value types in state~ +** Processing line: ~ args.state.paddle = Paddle.new~ +** Processing line: ~~ +** Processing line: ~ args.state.bricks = []~ +** Processing line: ~ args.state.num_bricks = 0~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ puts doubled~ -** Processing line: ~ end~ +** Processing line: ~ def calc_collision args~ +** Processing line: ~ #Remove the brick if it is hit with the ball~ +** Processing line: ~ ball = args.state.ball~ +** Processing line: ~ ball_rect = [ball.xy.x, ball.xy.y, 20, 20]~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Combining array functions.~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ #Loop through each brick to see if the ball is colliding with it~ +** Processing line: ~ args.state.bricks.each do |b|~ +** Processing line: ~ if b.rect.intersect_rect?(ball_rect)~ +** Processing line: ~ #Run the linear collider for the brick if there is a collision~ +** Processing line: ~ b[:collider_bottom].update args~ +** Processing line: ~ b[:collider_right].update args~ +** Processing line: ~ b[:collider_left].update args~ +** Processing line: ~ b[:collider_top].update args~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: Combining ~Array#find_all~ along with ~Array#map~."~ -** Processing line: ~ puts "Create an array that selects only odd numbers and then multiply those by 10."~ +** Processing line: ~ b.broken = true~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** 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: ~ args.state.bricks = args.state.bricks.reject(&:broken)~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ puts odd_doubled~ -** Processing line: ~ end~ +** Processing line: ~ def win_game args~ +** Processing line: ~ if args.state.bricks.count == 0 && args.state.game_over_at.elapsed_time > 60~ +** Processing line: ~ #Freeze the ball~ +** Processing line: ~ args.state.ball.velocity.x = 0~ +** Processing line: ~ args.state.ball.velocity.y = 0~ +** Processing line: ~ #Freeze the paddle~ +** Processing line: ~ args.state.paddle.enabled = false~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Product function.~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ args.state.game_over_at = args.state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if args.state.game_over_at.elapsed_time < 60 && args.state.tick_count > 60 && args.state.bricks.count == 0~ +** Processing line: ~ #Display a "Game over" message~ +** Processing line: ~ args.outputs.labels << [100, 100, "CONGRATULATIONS!", 10]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: Create all combinations of array values using ~Array#product~."~ -** Processing line: ~ puts "All two-item pairs 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: ~ end~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Uniq and sort function.~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~ def tick args~ +** Processing line: ~ defaults args~ +** Processing line: ~ render args~ +** Processing line: ~ calc args~ ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: Providing uniq values using ~Array#uniq~ and ~Array#sort~."~ -** Processing line: ~ puts "All uniq combinations of numbers regardless of order."~ -** Processing line: ~ puts "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: ~ #args.outputs.lines << [0, 0, args.grid.w, args.grid.h]~ +** Processing line: ~~ +** Processing line: ~ #$tc+=1~ +** Processing line: ~ #if $tc == 5~ +** Processing line: ~ #$train << [args.state.ball.xy.x, args.state.ball.xy.y]~ +** Processing line: ~ #$tc = 0~ +** Processing line: ~ #end~ +** Processing line: ~ #for t in $train~ +** Processing line: ~~ +** Processing line: ~ #args.outputs.solids << [t[0],t[1],5,5,255,0,0];~ +** Processing line: ~ #end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # ====================================================================================~ -** Processing line: ~ # Example of an advanced array transform.~ -** Processing line: ~ # ====================================================================================~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ repl do~ -** Processing line: ~ puts "** INFO: Advanced chaining. Combining ~Array's ~map~, ~find_all~, ~sort~, and ~sort_by~."~ -** Processing line: ~ puts "All unique Pythagorean Triples between 1 and 100 sorted by area of the triangle."~ ** Processing line: ~~ -** Processing line: ~ one_to_hundred = (1..100).to_a~ +** Processing line: ~*** Physics And Collisions - Collision With Object Removal - paddle.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Collision With Object Removal - paddle.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: ~Physics And Collisions - Collision With Object Removal - paddle.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** 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: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/paddle.rb~ +** Processing line: ~ class Paddle~ +** Processing line: ~ attr_accessor :enabled~ +** Processing line: ~~ +** Processing line: ~ def initialize ()~ +** Processing line: ~ @x=WIDTH/2~ +** Processing line: ~ @y=100~ +** Processing line: ~ @width=100~ +** Processing line: ~ @height=20~ +** Processing line: ~ @speed=10~ +** Processing line: ~~ +** Processing line: ~ @xyCollision = LinearCollider.new({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5})~ +** Processing line: ~ @xyCollision2 = LinearCollider.new({x: @x,y: @y}, {x: @x+@width, y: @y}, :pos)~ +** Processing line: ~ @xyCollision3 = LinearCollider.new({x: @x,y: @y}, {x: @x, y: @y+@height+5})~ +** Processing line: ~ @xyCollision4 = LinearCollider.new({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5}, :pos)~ +** Processing line: ~~ +** Processing line: ~ @enabled = true~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def update args~ +** Processing line: ~ @xyCollision.resetPoints({x: @x,y: @y+@height+5}, {x: @x+@width, y: @y+@height+5})~ +** Processing line: ~ @xyCollision2.resetPoints({x: @x,y: @y}, {x: @x+@width, y: @y})~ +** Processing line: ~ @xyCollision3.resetPoints({x: @x,y: @y}, {x: @x, y: @y+@height+5})~ +** Processing line: ~ @xyCollision4.resetPoints({x: @x+@width,y: @y}, {x: @x+@width, y: @y+@height+5})~ +** Processing line: ~~ +** Processing line: ~ @xyCollision.update args~ +** Processing line: ~ @xyCollision2.update args~ +** Processing line: ~ @xyCollision3.update args~ +** Processing line: ~ @xyCollision4.update args~ +** Processing line: ~~ +** Processing line: ~ args.inputs.keyboard.key_held.left ||= false~ +** Processing line: ~ args.inputs.keyboard.key_held.right ||= false~ +** Processing line: ~~ +** Processing line: ~ if not (args.inputs.keyboard.key_held.left == args.inputs.keyboard.key_held.right)~ +** Processing line: ~ if args.inputs.keyboard.key_held.left && @enabled~ +** Processing line: ~ @x-=@speed~ +** Processing line: ~ elsif args.inputs.keyboard.key_held.right && @enabled~ +** Processing line: ~ @x+=@speed~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ triples.each do |width, height, hypotenuse, _|~ -** Processing line: ~ puts "(#{width}, #{height}, #{hypotenuse})"~ +** Processing line: ~ xmin =WIDTH/4~ +** Processing line: ~ xmax = 3*(WIDTH/4)~ +** Processing line: ~ @x = (@x+@width > xmax) ? xmax-@width : (@x r[:order]~ -** Processing line: ~ sort_result = 1~ -** Processing line: ~ # returning 0 means both values are equal~ -** Processing line: ~ else~ -** Processing line: ~ sort_result = 0~ -** Processing line: ~ end~ -** Processing line: ~ sort_result~ -** Processing line: ~ end.to_a~ +** Processing line: ~ # To run the test: ./dragonruby mygame --eval app/tests.rb --no-tick~ ** Processing line: ~~ -** Processing line: ~ puts "**** Sort result."~ -** Processing line: ~ puts results~ +** 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: ~ # ====================================================================================~ -** Processing line: ~ # Api documention for Array that is worth commiting to memory because arrays are so~ -** Processing line: ~ # awesome in Ruby: https://docs.ruby-lang.org/en/2.0.0/Array.html~ -** 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: ~* Learn Ruby Optional - Intermediate Ruby Primer - main.rb~ -- H1 detected. +** Processing line: ~*** Physics And Collisions - Collision With Object Removal - vector2d.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Learn Ruby Optional - Intermediate Ruby Primer - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Physics And Collisions - Collision With Object Removal - vector2d.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: ~Physics And Collisions - Collision With Object Removal - vector2d.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/00_learn_ruby_optional/00_intermediate_ruby_primer/app/main.rb~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.labels << [640, 380, "Open repl.rb in the text editor of your choice and follow the document.", 0, 1]~ +** Processing line: ~ # ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/vector2d.rb~ +** Processing line: ~~ +** Processing line: ~ class Vector2d~ +** Processing line: ~ attr_accessor :x, :y~ +** Processing line: ~~ +** Processing line: ~ def initialize x=0, y=0~ +** Processing line: ~ @x=x~ +** Processing line: ~ @y=y~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #returns a vector multiplied by scalar x~ +** Processing line: ~ #x [float] scalar~ +** Processing line: ~ def mult x~ +** Processing line: ~ r = Vector2d.new(0,0)~ +** Processing line: ~ r.x=@x*x~ +** Processing line: ~ r.y=@y*x~ +** Processing line: ~ r~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # vect [Vector2d] vector to copy~ +** Processing line: ~ def copy vect~ +** Processing line: ~ Vector2d.new(@x, @y)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #returns a new vector equivalent to this+vect~ +** Processing line: ~ #vect [Vector2d] vector to add to self~ +** Processing line: ~ def add vect~ +** Processing line: ~ Vector2d.new(@x+vect.x,@y+vect.y)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #returns a new vector equivalent to this-vect~ +** Processing line: ~ #vect [Vector2d] vector to subtract to self~ +** Processing line: ~ def sub vect~ +** Processing line: ~ Vector2d.new(@x-vect.c, @y-vect.y)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #return the magnitude of the vector~ +** Processing line: ~ def mag~ +** Processing line: ~ ((@x**2)+(@y**2))**0.5~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #returns a new normalize version of the vector~ +** Processing line: ~ def normalize~ +** Processing line: ~ Vector2d.new(@x/mag, @y/mag)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #TODO delet?~ +** Processing line: ~ def distABS vect~ +** Processing line: ~ (((vect.x-@x)**2+(vect.y-@y)**2)**0.5).abs()~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rendering Basics - Labels - main.rb~ -- H1 detected. +** Processing line: ~*** Mouse - Mouse Click - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rendering Basics - Labels - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Mouse - Mouse Click - 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: ~Mouse - Mouse Click - 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/01_labels/app/main.rb~ +** Processing line: ~ # ./samples/05_mouse/01_mouse_click/app/main.rb~ ** Processing line: ~ =begin~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.labels: An array. Values in this array generate labels~ -** Processing line: ~ the screen.~ -** Processing line: ~ - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual~ -** Processing line: ~ 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).~ -** Processing line: ~ - Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction~ -** Processing line: ~ by adding or subracting.~ +** Processing line: ~ - product: Returns an array of all combinations of elements from all arrays.~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ For example, [1,2].product([1,2]) would return the following array...~ +** Processing line: ~ [[1,1], [1,2], [2,1], [2,2]]~ +** Processing line: ~ More than two arrays can be given to product and it will still work,~ +** Processing line: ~ such as [1,2].product([1,2],[3,4]). What would product return in this case?~ ** Processing line: ~~ -** Processing line: ~ # Labels are used to represent text elements in DragonRuby~ +** Processing line: ~ Answer:~ +** Processing line: ~ [[1,1,3],[1,1,4],[1,2,3],[1,2,4],[2,1,3],[2,1,4],[2,2,3],[2,2,4]]~ ** Processing line: ~~ -** Processing line: ~ # An example of creating a label is:~ -** Processing line: ~ # args.outputs.labels << [320, 640, "Example", 3, 1, 255, 0, 0, 200, manaspace.ttf]~ +** Processing line: ~ - num1.fdiv(num2): Returns the float division (will have a decimal) of the two given numbers.~ +** Processing line: ~ For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0~ ** Processing line: ~~ -** Processing line: ~ # The code above does the following:~ -** Processing line: ~ # 1. GET the place where labels go: args.outputs.labels~ -** Processing line: ~ # 2. Request a new LABEL be ADDED: <<~ -** Processing line: ~ # 3. The DEFINITION of a SOLID is the ARRAY:~ -** Processing line: ~ # [320, 640, "Example", 3, 1, 255, 0, 0, 200, manaspace.ttf]~ -** Processing line: ~ # [ X , Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +** Processing line: ~ - yield: Allows you to call a method with a code block and yield to that block.~ ** Processing line: ~~ +** Processing line: ~ Reminders:~ ** Processing line: ~~ -** Processing line: ~ # The tick method is called by DragonRuby every frame~ -** Processing line: ~ # args contains all the information regarding the game.~ -** Processing line: ~ def tick args~ -** Processing line: ~ tick_instructions args, "Sample app shows different version of label sizes and alignments. And how to use hashes instead of arrays."~ -** Processing line: ~ # Here are some examples of simple labels, with the minimum number of parameters~ -** Processing line: ~ # Note that the default values for the other parameters are 0, except for Alpha which is 255 and Font Style which is the default font~ -** Processing line: ~ args.outputs.labels << [400, 620, "Here is a label with just an x, y, and text"]~ +** Processing line: ~ - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect.~ ** Processing line: ~~ -** Processing line: ~ args.outputs.labels << [args.grid.left.shift_right(5), args.grid.top.shift_down(5), "This is a label located at the top left."]~ -** Processing line: ~ args.outputs.labels << [args.grid.left.shift_right(5), args.grid.bottom.shift_up(30), "This is a label located at the bottom left."]~ -** Processing line: ~ args.outputs.labels << [args.grid.right.shift_left(420), args.grid.top.shift_down(5), "This is a label located at the top right."]~ -** Processing line: ~ args.outputs.labels << [args.grid.right.shift_left(440), args.grid.bottom.shift_up(30), "This is a label located at the bottom right."]~ +** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ ** Processing line: ~~ -** Processing line: ~ # Demonstration of the Size Parameter~ -** Processing line: ~ args.outputs.labels << [175 + 150, 610 - 50, "Smaller label.", -2]~ -** Processing line: ~ args.outputs.labels << [175 + 150, 580 - 50, "Small label.", -1]~ -** Processing line: ~ args.outputs.labels << [175 + 150, 550 - 50, "Medium label.", 0]~ -** Processing line: ~ args.outputs.labels << [175 + 150, 520 - 50, "Large label.", 1]~ -** Processing line: ~ args.outputs.labels << [175 + 150, 490 - 50, "Larger label.", 2]~ +** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ ** Processing line: ~~ -** Processing line: ~ # Demonstration of the Align Parameter~ -** Processing line: ~ args.outputs.labels << [260 + 150, 345 - 50, "Left aligned.", 0, 2]~ -** Processing line: ~ args.outputs.labels << [260 + 150, 325 - 50, "Center aligned.", 0, 1]~ -** Processing line: ~ args.outputs.labels << [260 + 150, 305 - 50, "Right aligned.", 0, 0]~ +** Processing line: ~ - Ternary operator (?): Will evaluate a statement (just like an if statement)~ +** Processing line: ~ and perform an action if the result is true or another action if it is false.~ ** Processing line: ~~ -** Processing line: ~ # Demonstration of the RGBA parameters~ -** Processing line: ~ args.outputs.labels << [600 + 150, 590 - 50, "Red Label.", 0, 0, 255, 0, 0]~ -** Processing line: ~ args.outputs.labels << [600 + 150, 570 - 50, "Green Label.", 0, 0, 0, 255, 0]~ -** Processing line: ~ args.outputs.labels << [600 + 150, 550 - 50, "Blue Label.", 0, 0, 0, 0, 255]~ -** Processing line: ~ args.outputs.labels << [600 + 150, 530 - 50, "Faded Label.", 0, 0, 0, 0, 0, 128]~ +** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ ** Processing line: ~~ -** Processing line: ~ # Demonstration of the Font parameter~ -** Processing line: ~ # In order to use a font of your choice, add its ttf file to the project folder, where the app folder is~ -** Processing line: ~ args.outputs.labels << [690 + 150, 330 - 20, "Custom font (Array)", 0, 1, 125, 0, 200, 255, "manaspc.ttf" ]~ -** Processing line: ~ args.outputs.primitives << { x: 690 + 150,~ -** Processing line: ~ y: 330 - 50,~ -** Processing line: ~ text: "Custom font (Hash)",~ -** Processing line: ~ size_enum: 0,~ -** Processing line: ~ alignment_enum: 1,~ -** Processing line: ~ r: 125,~ -** Processing line: ~ g: 0,~ -** Processing line: ~ b: 200,~ -** Processing line: ~ a: 255,~ -** Processing line: ~ font: "manaspc.ttf" }.label~ +** Processing line: ~ - args.outputs.borders: An array. The values generate a border.~ +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ +** Processing line: ~ For more information about borders, go to mygame/documentation/03-solids-and-borders.md.~ ** 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~ +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.~ ** Processing line: ~~ -** Processing line: ~ args.outputs.primitives << { x: 690 + 150,~ -** Processing line: ~ y: 330 - 110,~ -** Processing line: ~ text: "Custom font (.primitives Hash)",~ -** Processing line: ~ size_enum: 0,~ -** Processing line: ~ alignment_enum: 1,~ -** Processing line: ~ r: 125,~ -** Processing line: ~ g: 0,~ -** Processing line: ~ b: 200,~ -** Processing line: ~ a: 255,~ -** Processing line: ~ font: "manaspc.ttf" }.label~ -** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ +** Processing line: ~ # This sample app is a classic game of Tic Tac Toe.~ +** Processing line: ~~ +** Processing line: ~ class TicTacToe~ +** Processing line: ~ attr_accessor :_, :state, :outputs, :inputs, :grid, :gtk~ +** Processing line: ~~ +** Processing line: ~ # Starts the game with player x's turn and creates an array (to_a) for space combinations.~ +** Processing line: ~ # Calls methods necessary for the game to run properly.~ +** Processing line: ~ def tick~ +** Processing line: ~ state.current_turn ||= :x~ +** Processing line: ~ state.space_combinations = [-1, 0, 1].product([-1, 0, 1]).to_a~ +** Processing line: ~ render_board~ +** Processing line: ~ input_board~ ** 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: ~ # Uses borders to create grid squares for the game's board. Also outputs the game pieces using labels.~ +** Processing line: ~ def render_board~ +** Processing line: ~ square_size = 80~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Positions the game's board in the center of the screen.~ +** Processing line: ~ # Try removing what follows grid.w_half or grid.h_half and see how the position changes!~ +** Processing line: ~ board_left = grid.w_half - square_size * 1.5~ +** Processing line: ~ board_top = grid.h_half - square_size * 1.5~ ** Processing line: ~~ +** Processing line: ~ # At first glance, the add(1) looks pretty trivial. But if you remove it,~ +** Processing line: ~ # you'll see that the positioning of the board would be skewed without it!~ +** Processing line: ~ # Or if you put 2 in the parenthesis, the pieces will be placed in the wrong squares~ +** Processing line: ~ # due to the change in board placement.~ +** Processing line: ~ outputs.borders << all_spaces do |x, y, space| # outputs borders for all board spaces~ +** Processing line: ~ space.border ||= [~ +** Processing line: ~ board_left + x.add(1) * square_size, # space.border is initialized using this definition~ +** Processing line: ~ board_top + y.add(1) * square_size,~ +** Processing line: ~ square_size,~ +** Processing line: ~ square_size~ +** Processing line: ~ ]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Rendering Basics - Lines - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rendering Basics - Lines - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Again, the calculations ensure that the piece is placed in the center of the grid square.~ +** Processing line: ~ # Remove the '- 20' and the piece will be placed at the top of the grid square instead of the center.~ +** Processing line: ~ outputs.labels << filled_spaces do |x, y, space| # put label in each filled space of board~ +** Processing line: ~ label board_left + x.add(1) * square_size + square_size.fdiv(2),~ +** Processing line: ~ board_top + y.add(1) * square_size + square_size - 20,~ +** Processing line: ~ space.piece # text of label, either "x" or "o"~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/01_rendering_basics/02_lines/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # Uses a label to output whether x or o won, or if a draw occurred.~ +** Processing line: ~ # If the game is ongoing, a label shows whose turn it currently is.~ +** Processing line: ~ outputs.labels << if state.x_won~ +** Processing line: ~ label grid.w_half, grid.top - 80, "x won" # the '-80' positions the label 80 pixels lower than top~ +** Processing line: ~ elsif state.o_won~ +** Processing line: ~ label grid.w_half, grid.top - 80, "o won" # grid.w_half positions the label in the center horizontally~ +** Processing line: ~ elsif state.draw~ +** Processing line: ~ label grid.w_half, grid.top - 80, "a draw"~ +** Processing line: ~ else # if no one won and the game is ongoing~ +** Processing line: ~ label grid.w_half, grid.top - 80, "turn: #{state.current_turn}"~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ +** Processing line: ~ # Calls the methods responsible for handling user input and determining the winner.~ +** Processing line: ~ # Does nothing unless the mouse is clicked.~ +** Processing line: ~ def input_board~ +** Processing line: ~ return unless inputs.mouse.click~ +** Processing line: ~ input_place_piece~ +** Processing line: ~ input_restart_game~ +** Processing line: ~ determine_winner~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.lines: An array. Values in this array generate lines on~ -** Processing line: ~ the screen.~ -** Processing line: ~ - args.state.tick_count: This property contains an integer value that~ -** Processing line: ~ represents the current frame. GTK renders at 60 FPS. A value of 0~ -** Processing line: ~ for args.state.tick_count represents the initial load of the game.~ +** Processing line: ~ # Handles user input for placing pieces on the board.~ +** Processing line: ~ def input_place_piece~ +** Processing line: ~ return if state.game_over~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ # Checks to find the space that the mouse was clicked inside of, and makes sure the space does not already~ +** Processing line: ~ # have a piece in it.~ +** Processing line: ~ __, __, space = all_spaces.find do |__, __, space|~ +** Processing line: ~ inputs.mouse.click.point.inside_rect?(space.border) && !space.piece~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The parameters required for lines are:~ -** Processing line: ~ # 1. The initial point (x, y)~ -** Processing line: ~ # 2. The end point (x2, y2)~ -** Processing line: ~ # 3. The rgba values for the color and transparency (r, g, b, a)~ +** Processing line: ~ # The piece that goes into the space belongs to the player whose turn it currently is.~ +** Processing line: ~ return unless space~ +** Processing line: ~ space.piece = state.current_turn~ ** Processing line: ~~ -** Processing line: ~ # An example of creating a line would be:~ -** Processing line: ~ # args.outputs.lines << [100, 100, 300, 300, 255, 0, 255, 255]~ +** Processing line: ~ # This ternary operator statement allows us to change the current player's turn.~ +** Processing line: ~ # If it is currently x's turn, it becomes o's turn. If it is not x's turn, it become's x's turn.~ +** Processing line: ~ state.current_turn = state.current_turn == :x ? :o : :x~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # This would create a line from (100, 100) to (300, 300)~ -** Processing line: ~ # The RGB code (255, 0, 255) would determine its color, a purple~ -** Processing line: ~ # It would have an Alpha value of 255, making it completely opaque~ +** Processing line: ~ # Resets the game.~ +** Processing line: ~ def input_restart_game~ +** Processing line: ~ return unless state.game_over~ +** Processing line: ~ gtk.reset~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ tick_instructions args, "Sample app shows how to create lines."~ +** Processing line: ~ # Checks if x or o won the game.~ +** Processing line: ~ # If neither player wins and all nine squares are filled, a draw happens.~ +** Processing line: ~ # Once a player is chosen as the winner or a draw happens, the game is over.~ +** Processing line: ~ def determine_winner~ +** Processing line: ~ state.x_won = won? :x # evaluates to either true or false (boolean values)~ +** Processing line: ~ state.o_won = won? :o~ +** Processing line: ~ state.draw = true if filled_spaces.length == 9 && !state.x_won && !state.o_won~ +** Processing line: ~ state.game_over = state.x_won || state.o_won || state.draw~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.labels << [480, 620, "Lines (x, y, x2, y2, r, g, b, a)"]~ +** Processing line: ~ # Determines if a player won by checking if there is a horizontal match or vertical match.~ +** Processing line: ~ # Horizontal_match and vertical_match have boolean values. If either is true, the game has been won.~ +** Processing line: ~ def won? piece~ +** Processing line: ~ # performs action on all space combinations~ +** Processing line: ~ won = [[-1, 0, 1]].product([-1, 0, 1]).map do |xs, y|~ ** Processing line: ~~ -** Processing line: ~ # Some simple lines~ -** Processing line: ~ args.outputs.lines << [380, 450, 675, 450]~ -** Processing line: ~ args.outputs.lines << [380, 410, 875, 410]~ +** Processing line: ~ # Checks if the 3 grid spaces with the same y value (or same row) and~ +** Processing line: ~ # x values that are next to each other have pieces that belong to the same player.~ +** Processing line: ~ # Remember, the value of piece is equal to the current turn (which is the player).~ +** Processing line: ~ horizontal_match = state.spaces[xs[0]][y].piece == piece &&~ +** Processing line: ~ state.spaces[xs[1]][y].piece == piece &&~ +** Processing line: ~ state.spaces[xs[2]][y].piece == piece~ ** Processing line: ~~ -** Processing line: ~ # These examples utilize args.state.tick_count to change the length of the lines over time~ -** Processing line: ~ # args.state.tick_count is the ticks that have occurred in the game~ -** Processing line: ~ # This is accomplished by making either the starting or ending point based on the args.state.tick_count~ -** Processing line: ~ args.outputs.lines << [380, 370, 875, 370, args.state.tick_count % 255, 0, 0, 255]~ -** Processing line: ~ args.outputs.lines << [380, 330 - args.state.tick_count % 25, 875, 330, 0, 0, 0, 255]~ -** Processing line: ~ args.outputs.lines << [380 + args.state.tick_count % 400, 290, 875, 290, 0, 0, 0, 255]~ +** Processing line: ~ # Checks if the 3 grid spaces with the same x value (or same column) and~ +** Processing line: ~ # y values that are next to each other have pieces that belong to the same player.~ +** Processing line: ~ # The && represents an "and" statement: if even one part of the statement is false,~ +** Processing line: ~ # the entire statement evaluates to false.~ +** Processing line: ~ vertical_match = state.spaces[y][xs[0]].piece == piece &&~ +** Processing line: ~ state.spaces[y][xs[1]].piece == piece &&~ +** Processing line: ~ state.spaces[y][xs[2]].piece == piece~ +** Processing line: ~~ +** Processing line: ~ horizontal_match || vertical_match # if either is true, true is returned~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Sees if there is a diagonal match, starting from the bottom left and ending at the top right.~ +** Processing line: ~ # Is added to won regardless of whether the statement is true or false.~ +** Processing line: ~ won << (state.spaces[-1][-1].piece == piece && # bottom left~ +** Processing line: ~ state.spaces[ 0][ 0].piece == piece && # center~ +** Processing line: ~ state.spaces[ 1][ 1].piece == piece) # top right~ +** Processing line: ~~ +** Processing line: ~ # Sees if there is a diagonal match, starting at the bottom right and ending at the top left~ +** Processing line: ~ # and is added to won.~ +** Processing line: ~ won << (state.spaces[ 1][-1].piece == piece && # bottom right~ +** Processing line: ~ state.spaces[ 0][ 0].piece == piece && # center~ +** Processing line: ~ state.spaces[-1][ 1].piece == piece) # top left~ +** Processing line: ~~ +** Processing line: ~ # Any false statements (meaning false diagonal matches) are rejected from won~ +** Processing line: ~ won.reject_false.any?~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Defines filled spaces on the board by rejecting all spaces that do not have game pieces in them.~ +** Processing line: ~ # The ! before a statement means "not". For example, we are rejecting any space combinations that do~ +** Processing line: ~ # NOT have pieces in them.~ +** Processing line: ~ def filled_spaces~ +** Processing line: ~ state.space_combinations~ +** Processing line: ~ .reject { |x, y| !state.spaces[x][y].piece } # reject spaces with no pieces in them~ +** Processing line: ~ .map do |x, y|~ +** Processing line: ~ if block_given?~ +** Processing line: ~ yield x, y, state.spaces[x][y]~ +** Processing line: ~ else~ +** Processing line: ~ [x, y, state.spaces[x][y]] # sets definition of space~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Defines all spaces on the board.~ +** Processing line: ~ def all_spaces~ +** Processing line: ~ if !block_given?~ +** Processing line: ~ state.space_combinations.map do |x, y|~ +** Processing line: ~ [x, y, state.spaces[x][y]] # sets definition of space~ +** Processing line: ~ end~ +** Processing line: ~ else # if a block is given (block_given? is true)~ +** Processing line: ~ state.space_combinations.map do |x, y|~ +** Processing line: ~ yield x, y, state.spaces[x][y] # yield if a block is given~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Sets values for a label, such as the position, value, size, alignment, and color.~ +** Processing line: ~ def label x, y, value~ +** Processing line: ~ [x, y + 10, value, 20, 1, 0, 0, 0]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $tic_tac_toe = TicTacToe.new~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ $tic_tac_toe._ = args~ +** Processing line: ~ $tic_tac_toe.state = args.state~ +** Processing line: ~ $tic_tac_toe.outputs = args.outputs~ +** Processing line: ~ $tic_tac_toe.inputs = args.inputs~ +** Processing line: ~ $tic_tac_toe.grid = args.grid~ +** Processing line: ~ $tic_tac_toe.gtk = args.gtk~ +** Processing line: ~ $tic_tac_toe.tick~ +** Processing line: ~ tick_instructions args, "Sample app shows how to work with mouse clicks."~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def tick_instructions args, text, y = 715~ @@ -123997,127 +192192,303 @@ 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 - Solids Borders - main.rb~ -- H1 detected. +** Processing line: ~*** Mouse - Mouse Move - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rendering Basics - Solids Borders - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Mouse - Mouse Move - 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: ~Mouse - Mouse Move - 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/03_solids_borders/app/main.rb~ +** Processing line: ~ # ./samples/05_mouse/02_mouse_move/app/main.rb~ ** Processing line: ~ =begin~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ +** Processing line: ~ Reminders:~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.solids: An array. Values in this array generate~ -** Processing line: ~ solid/filled rectangles on the screen.~ +** Processing line: ~ - num1.greater(num2): Returns the greater value.~ +** Processing line: ~ For example, if we have the command~ +** Processing line: ~ puts 4.greater(3)~ +** Processing line: ~ the number 4 would be printed to the console since it has a greater value than 3.~ +** Processing line: ~ Similar to lesser, which returns the lesser value.~ +** Processing line: ~~ +** Processing line: ~ - find_all: Finds all elements of a collection that meet certain requirements.~ +** Processing line: ~ For example, in this sample app, we're using find_all to find all zombies that have intersected~ +** Processing line: ~ or hit the player's sprite since these zombies have been killed.~ +** Processing line: ~~ +** Processing line: ~ - args.inputs.keyboard.key_down.KEY: Determines if a key is being held or pressed.~ +** Processing line: ~ Stores the frame the "down" event occurred.~ +** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE]~ +** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ +** Processing line: ~~ +** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ +** Processing line: ~ When we want to create a new object, we can declare it as a new entity and then define~ +** Processing line: ~ its properties. (Remember, you can use state to define ANY property and it will~ +** Processing line: ~ be retained across frames.)~ +** Processing line: ~~ +** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +** Processing line: ~~ +** Processing line: ~ - map: Ruby method used to transform data; used in arrays, hashes, and collections.~ +** Processing line: ~ Can be used to perform an action on every element of a collection, such as multiplying~ +** Processing line: ~ each element by 2 or declaring every element as a new entity.~ +** Processing line: ~~ +** Processing line: ~ - sample: Chooses a random element from the array.~ +** Processing line: ~~ +** Processing line: ~ - reject: Removes elements that meet certain requirements.~ +** Processing line: ~ In this sample app, we're removing/rejecting zombies that reach the center of the screen. We're also~ +** Processing line: ~ rejecting zombies that were killed more than 30 frames ago.~ ** Processing line: ~~ ** Processing line: ~ =end~ ** Processing line: ~~ -** Processing line: ~ # Rects are outputted in DragonRuby as rectangles~ -** Processing line: ~ # If filled in, they are solids~ -** Processing line: ~ # If hollow, they are borders~ +** Processing line: ~ # This sample app allows users to move around the screen in order to kill zombies. Zombies appear from every direction so the goal~ +** Processing line: ~ # is to kill the zombies as fast as possible!~ ** Processing line: ~~ -** Processing line: ~ # Solids are added to args.outputs.solids~ -** Processing line: ~ # Borders are added to args.outputs.borders~ +** Processing line: ~ class ProtectThePuppiesFromTheZombies~ +** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs~ ** Processing line: ~~ -** Processing line: ~ # The parameters required for rects are:~ -** Processing line: ~ # 1. The upper right corner (x, y)~ -** Processing line: ~ # 2. The width (w)~ -** Processing line: ~ # 3. The height (h)~ -** Processing line: ~ # 4. The rgba values for the color and transparency (r, g, b, a)~ +** Processing line: ~ # Calls the methods necessary for the game to run properly.~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ render~ +** Processing line: ~ calc~ +** Processing line: ~ input~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Here is an example of a rect definition:~ -** Processing line: ~ # [100, 100, 400, 500, 0, 255, 0, 180]~ +** Processing line: ~ # Sets default values for the zombies and for the player.~ +** Processing line: ~ # Initialization happens only in the first frame.~ +** Processing line: ~ def defaults~ +** Processing line: ~ state.flash_at ||= 0~ +** Processing line: ~ state.zombie_min_spawn_rate ||= 60~ +** Processing line: ~ state.zombie_spawn_countdown ||= random_spawn_countdown state.zombie_min_spawn_rate~ +** Processing line: ~ state.zombies ||= []~ +** Processing line: ~ state.killed_zombies ||= []~ ** Processing line: ~~ -** Processing line: ~ # The example would create a rect from (100, 100)~ -** Processing line: ~ # Extending 400 pixels across the x axis~ -** Processing line: ~ # and 500 pixels across the y axis~ -** Processing line: ~ # The rect would be green (0, 255, 0)~ -** Processing line: ~ # and mostly opaque with some transparency (180)~ +** Processing line: ~ # Declares player as a new entity and sets its properties.~ +** Processing line: ~ # The player begins the game in the center of the screen, not moving in any direction.~ +** Processing line: ~ state.player ||= state.new_entity(:player, { x: 640,~ +** Processing line: ~ y: 360,~ +** Processing line: ~ attack_angle: 0,~ +** Processing line: ~ dx: 0,~ +** Processing line: ~ dy: 0 })~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Whether the rect would be filled or not depends on if~ -** Processing line: ~ # it is added to args.outputs.solids or args.outputs.borders~ +** Processing line: ~ # Outputs a gray background.~ +** Processing line: ~ # Calls the methods needed to output the player, zombies, etc onto the screen.~ +** Processing line: ~ def render~ +** Processing line: ~ outputs.solids << [grid.rect, 100, 100, 100]~ +** Processing line: ~ render_zombies~ +** Processing line: ~ render_killed_zombies~ +** Processing line: ~ render_player~ +** Processing line: ~ render_flash~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Outputs the zombies on the screen and sets values for the sprites, such as the position, width, height, and animation.~ +** Processing line: ~ def render_zombies~ +** Processing line: ~ outputs.sprites << state.zombies.map do |z| # performs action on all zombies in the collection~ +** Processing line: ~ z.sprite = [z.x, z.y, 4 * 3, 8 * 3, animation_sprite(z)].sprite # sets definition for sprite, calls animation_sprite method~ +** Processing line: ~ z.sprite~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ tick_instructions args, "Sample app shows how to create solid squares."~ -** Processing line: ~ args.outputs.labels << [460, 600, "Solids (x, y, w, h, r, g, b, a)"]~ -** Processing line: ~ args.outputs.solids << [470, 520, 50, 50]~ -** Processing line: ~ args.outputs.solids << [530, 520, 50, 50, 0, 0, 0]~ -** Processing line: ~ args.outputs.solids << [590, 520, 50, 50, 255, 0, 0]~ -** Processing line: ~ args.outputs.solids << [650, 520, 50, 50, 255, 0, 0, 128]~ -** Processing line: ~ args.outputs.solids << [710, 520, 50, 50, 0, 0, 0, 128 + args.state.tick_count % 128]~ +** Processing line: ~ # Outputs sprites of killed zombies, and displays a slash image to show that a zombie has been killed.~ +** Processing line: ~ def render_killed_zombies~ +** Processing line: ~ outputs.sprites << state.killed_zombies.map do |z| # performs action on all killed zombies in collection~ +** Processing line: ~ z.sprite = [z.x,~ +** Processing line: ~ z.y,~ +** Processing line: ~ 4 * 3,~ +** Processing line: ~ 8 * 3,~ +** Processing line: ~ animation_sprite(z, z.death_at), # calls animation_sprite method~ +** Processing line: ~ 0, # angle~ +** Processing line: ~ 255 * z.death_at.ease(30, :flip)].sprite # transparency of a zombie changes when they die~ +** Processing line: ~ # change the value of 30 and see what happens when a zombie is killed~ ** Processing line: ~~ +** Processing line: ~ # Sets values to output the slash over the zombie's sprite when a zombie is killed.~ +** Processing line: ~ # The slash is tilted 45 degrees from the angle of the player's attack.~ +** Processing line: ~ # Change the 3 inside scale_rect to 30 and the slash will be HUGE! Scale_rect positions~ +** Processing line: ~ # the slash over the killed zombie's sprite.~ +** Processing line: ~ [z.sprite, [z.sprite.rect, 'sprites/slash.png', 45 + state.player.attack_angle_on_click, z.sprite.a].scale_rect(3, 0.5, 0.5)]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.labels << [460, 400, "Borders (x, y, w, h, r, g, b, a)"]~ -** Processing line: ~ args.outputs.borders << [470, 320, 50, 50]~ -** Processing line: ~ args.outputs.borders << [530, 320, 50, 50, 0, 0, 0]~ -** Processing line: ~ args.outputs.borders << [590, 320, 50, 50, 255, 0, 0]~ -** Processing line: ~ args.outputs.borders << [650, 320, 50, 50, 255, 0, 0, 128]~ -** Processing line: ~ args.outputs.borders << [710, 320, 50, 50, 0, 0, 0, 128 + args.state.tick_count % 128]~ -** Processing line: ~ end~ +** Processing line: ~ # Outputs the player sprite using the images in the sprites folder.~ +** Processing line: ~ def render_player~ +** Processing line: ~ state.player_sprite = [state.player.x,~ +** Processing line: ~ state.player.y,~ +** Processing line: ~ 4 * 3,~ +** Processing line: ~ 8 * 3, "sprites/player-#{animation_index(state.player.created_at_elapsed)}.png"] # string interpolation~ +** Processing line: ~ outputs.sprites << state.player_sprite~ ** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ +** Processing line: ~ # Outputs a small red square that previews the angles that the player can attack in.~ +** Processing line: ~ # It can be moved in a perfect circle around the player to show possible movements.~ +** Processing line: ~ # Change the 60 in the parenthesis and see what happens to the movement of the red square.~ +** Processing line: ~ outputs.solids << [state.player.x + state.player.attack_angle.vector_x(60),~ +** Processing line: ~ state.player.y + state.player.attack_angle.vector_y(60),~ +** Processing line: ~ 3, 3, 255, 0, 0]~ ** 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: ~ # Renders flash as a solid. The screen turns white for 10 frames when a zombie is killed.~ +** Processing line: ~ def render_flash~ +** Processing line: ~ return if state.flash_at.elapsed_time > 10 # return if more than 10 frames have passed since flash.~ +** Processing line: ~ # Transparency gradually changes (or eases) during the 10 frames of flash.~ +** Processing line: ~ outputs.primitives << [grid.rect, 255, 255, 255, 255 * state.flash_at.ease(10, :flip)].solid~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Calls all methods necessary for performing calculations.~ +** Processing line: ~ def calc~ +** Processing line: ~ calc_spawn_zombie~ +** Processing line: ~ calc_move_zombies~ +** Processing line: ~ calc_player~ +** Processing line: ~ calc_kill_zombie~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Decreases the zombie spawn countdown by 1 if it has a value greater than 0.~ +** Processing line: ~ def calc_spawn_zombie~ +** Processing line: ~ if state.zombie_spawn_countdown > 0~ +** Processing line: ~ state.zombie_spawn_countdown -= 1~ +** Processing line: ~ return~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Rendering Basics - Sprites - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rendering Basics - Sprites - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # New zombies are created, positioned on the screen, and added to the zombies collection.~ +** Processing line: ~ state.zombies << state.new_entity(:zombie) do |z| # each zombie is declared a new entity~ +** Processing line: ~ if rand > 0.5~ +** Processing line: ~ z.x = grid.rect.w.randomize(:ratio) # random x position on screen (within grid scope)~ +** Processing line: ~ z.y = [-10, 730].sample # y position is set to either -10 or 730 (randomly chosen)~ +** Processing line: ~ # the possible values exceed the screen's scope so zombies appear to be coming from far away~ +** Processing line: ~ else~ +** Processing line: ~ z.x = [-10, 1290].sample # x position is set to either -10 or 1290 (randomly chosen)~ +** Processing line: ~ z.y = grid.rect.w.randomize(:ratio) # random y position on screen~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/01_rendering_basics/04_sprites/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # Calls random_spawn_countdown method (determines how fast new zombies appear)~ +** Processing line: ~ state.zombie_spawn_countdown = random_spawn_countdown state.zombie_min_spawn_rate~ +** Processing line: ~ state.zombie_min_spawn_rate -= 1~ +** Processing line: ~ # set to either the current zombie_min_spawn_rate or 0, depending on which value is greater~ +** Processing line: ~ state.zombie_min_spawn_rate = state.zombie_min_spawn_rate.greater(0)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ +** Processing line: ~ # Moves all zombies towards the center of the screen.~ +** Processing line: ~ # All zombies that reach the center (640, 360) are rejected from the zombies collection and disappear.~ +** Processing line: ~ def calc_move_zombies~ +** Processing line: ~ state.zombies.each do |z| # for each zombie in the collection~ +** Processing line: ~ z.y = z.y.towards(360, 0.1) # move the zombie towards the center (640, 360) at a rate of 0.1~ +** Processing line: ~ z.x = z.x.towards(640, 0.1) # change 0.1 to 1.1 and see how much faster the zombies move to the center~ +** Processing line: ~ end~ +** Processing line: ~ state.zombies = state.zombies.reject { |z| z.y == 360 && z.x == 640 } # remove zombies that are in center~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.sprites: An array. Values in this array generate~ -** Processing line: ~ sprites on the screen. The location of the sprite is assumed to~ -** Processing line: ~ be under the mygame/ directory (the exception being dragonruby.png).~ +** Processing line: ~ # Calculates the position and movement of the player on the screen.~ +** Processing line: ~ def calc_player~ +** Processing line: ~ state.player.x += state.player.dx # changes x based on dx (change in x)~ +** Processing line: ~ state.player.y += state.player.dy # changes y based on dy (change in y)~ +** Processing line: ~~ +** Processing line: ~ state.player.dx *= 0.9 # scales dx down~ +** Processing line: ~ state.player.dy *= 0.9 # scales dy down~ +** Processing line: ~~ +** Processing line: ~ # Compares player's x to 1280 to find lesser value, then compares result to 0 to find greater value.~ +** Processing line: ~ # This ensures that the player remains within the screen's scope.~ +** Processing line: ~ state.player.x = state.player.x.lesser(1280).greater(0)~ +** Processing line: ~ state.player.y = state.player.y.lesser(720).greater(0) # same with player's y~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Finds all zombies that intersect with the player's sprite. These zombies are removed from the zombies collection~ +** Processing line: ~ # and added to the killed_zombies collection since any zombie that intersects with the player is killed.~ +** Processing line: ~ def calc_kill_zombie~ +** Processing line: ~~ +** Processing line: ~ # Find all zombies that intersect with the player. They are considered killed.~ +** Processing line: ~ killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite }~ +** Processing line: ~ state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection~ +** Processing line: ~ state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies~ +** Processing line: ~~ +** Processing line: ~ if killed_this_frame.length > 0 # if atleast one zombie was killed in the frame~ +** Processing line: ~ state.flash_at = state.tick_count # flash_at set to the frame when the zombie was killed~ +** Processing line: ~ # Don't forget, the rendered flash lasts for 10 frames after the zombie is killed (look at render_flash method)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Sets the tick_count (passage of time) as the value of the death_at variable for each killed zombie.~ +** Processing line: ~ # Death_at stores the frame a zombie was killed.~ +** Processing line: ~ killed_this_frame.each do |z|~ +** Processing line: ~ z.death_at = state.tick_count~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Zombies are rejected from the killed_zombies collection depending on when they were killed.~ +** Processing line: ~ # They are rejected if more than 30 frames have passed since their death.~ +** Processing line: ~ state.killed_zombies = state.killed_zombies.reject { |z| state.tick_count - z.death_at > 30 }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Uses input from the user to move the player around the screen.~ +** Processing line: ~ def input~ +** Processing line: ~~ +** Processing line: ~ # If the "a" key or left key is pressed, the x position of the player decreases.~ +** Processing line: ~ # Otherwise, if the "d" key or right key is pressed, the x position of the player increases.~ +** Processing line: ~ if inputs.keyboard.key_held.a || inputs.keyboard.key_held.left~ +** Processing line: ~ state.player.x -= 5~ +** Processing line: ~ elsif inputs.keyboard.key_held.d || inputs.keyboard.key_held.right~ +** Processing line: ~ state.player.x += 5~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # If the "w" or up key is pressed, the y position of the player increases.~ +** Processing line: ~ # Otherwise, if the "s" or down key is pressed, the y position of the player decreases.~ +** Processing line: ~ if inputs.keyboard.key_held.w || inputs.keyboard.key_held.up~ +** Processing line: ~ state.player.y += 5~ +** Processing line: ~ elsif inputs.keyboard.key_held.s || inputs.keyboard.key_held.down~ +** Processing line: ~ state.player.y -= 5~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Sets the attack angle so the player can move and attack in the precise direction it wants to go.~ +** Processing line: ~ # If the mouse is moved, the attack angle is changed (based on the player's position and mouse position).~ +** Processing line: ~ # Attack angle also contributes to the position of red square.~ +** Processing line: ~ if inputs.mouse.moved~ +** Processing line: ~ state.player.attack_angle = inputs.mouse.position.angle_from [state.player.x, state.player.y]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ if inputs.mouse.click && state.player.dx < 0.5 && state.player.dy < 0.5~ +** Processing line: ~ state.player.attack_angle_on_click = inputs.mouse.position.angle_from [state.player.x, state.player.y]~ +** Processing line: ~ state.player.attack_angle = state.player.attack_angle_on_click # player's attack angle is set~ +** Processing line: ~ state.player.dx = state.player.attack_angle.vector_x(25) # change in player's position~ +** Processing line: ~ state.player.dy = state.player.attack_angle.vector_y(25)~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Sets the zombie spawn's countdown to a random number.~ +** Processing line: ~ # How fast zombies appear (change the 60 to 6 and too many zombies will appear at once!)~ +** Processing line: ~ def random_spawn_countdown minimum~ +** Processing line: ~ 10.randomize(:ratio, :sign).to_i + 60~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # For all other display outputs, Sprites are your solution~ -** Processing line: ~ # Sprites import images and display them with a certain rectangular area~ -** Processing line: ~ # The image can be of any usual format and should be located within the folder,~ -** Processing line: ~ # similar to additional fonts.~ +** Processing line: ~ # Helps to iterate through the images in the sprites folder by setting the animation index.~ +** Processing line: ~ # 3 frames is how long to show an image, and 6 is how many images to flip through.~ +** Processing line: ~ def animation_index at~ +** Processing line: ~ at.idiv(3).mod(6)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sprites have the following parameters~ -** Processing line: ~ # Rectangular area (x, y, width, height)~ -** Processing line: ~ # The image (path)~ -** Processing line: ~ # Rotation (angle)~ -** Processing line: ~ # Alpha (a)~ +** Processing line: ~ # Animates the zombies by using the animation index to go through the images in the sprites folder.~ +** Processing line: ~ def animation_sprite zombie, at = nil~ +** Processing line: ~ at ||= zombie.created_at_elapsed # how long it is has been since a zombie was created~ +** Processing line: ~ index = animation_index at~ +** Processing line: ~ "sprites/zombie-#{index}.png" # string interpolation to iterate through images~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $protect_the_puppies_from_the_zombies = ProtectThePuppiesFromTheZombies.new~ ** Processing line: ~~ ** Processing line: ~ def tick args~ -** Processing line: ~ tick_instructions args, "Sample app shows how to render a sprite. Set its alpha, and rotate it."~ -** Processing line: ~ args.outputs.labels << [460, 600, "Sprites (x, y, w, h, path, angle, a)"]~ -** Processing line: ~ args.outputs.sprites << [460, 470, 128, 101, 'dragonruby.png']~ -** Processing line: ~ args.outputs.sprites << [610, 470, 128, 101, 'dragonruby.png', args.state.tick_count % 360]~ -** Processing line: ~ args.outputs.sprites << [760, 470, 128, 101, 'dragonruby.png', 0, args.state.tick_count % 255]~ +** Processing line: ~ $protect_the_puppies_from_the_zombies.grid = args.grid~ +** Processing line: ~ $protect_the_puppies_from_the_zombies.inputs = args.inputs~ +** Processing line: ~ $protect_the_puppies_from_the_zombies.state = args.state~ +** Processing line: ~ $protect_the_puppies_from_the_zombies.outputs = args.outputs~ +** Processing line: ~ $protect_the_puppies_from_the_zombies.tick~ +** Processing line: ~ tick_instructions args, "How to get the mouse position and translate it to an x, y position using .vector_x and .vector_y. CLICK to play."~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def tick_instructions args, text, y = 715~ @@ -124138,191 +192509,247 @@ 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 - Sounds - main.rb~ -- H1 detected. +** Processing line: ~*** Mouse - Mouse Move Paint App - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rendering Basics - Sounds - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Mouse - Mouse Move Paint App - 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: ~Mouse - Mouse Move Paint App - 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/05_sounds/app/main.rb~ +** Processing line: ~ # ./samples/05_mouse/03_mouse_move_paint_app/app/main.rb~ ** Processing line: ~ =begin~ ** Processing line: ~~ -** Processing line: ~ APIs Listing that haven't been encountered in previous sample apps:~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ ** Processing line: ~~ -** Processing line: ~ - sample: Chooses random element from array.~ -** Processing line: ~ In this sample app, the target note is set by taking a sample from the collection~ -** Processing line: ~ of available notes.~ +** Processing line: ~ - Floor: Method that returns an integer number smaller than or equal to the original with no decimal.~ +** Processing line: ~~ +** Processing line: ~ For example, if we have a variable, a = 13.7, and we called floor on it, it would look like this...~ +** Processing line: ~ puts a.floor()~ +** Processing line: ~ which would print out 13.~ +** Processing line: ~ (There is also a ceil method, which returns an integer number greater than or equal to the original~ +** Processing line: ~ with no decimal. If we had called ceil on the variable a, the result would have been 14.)~ ** Processing line: ~~ ** Processing line: ~ Reminders:~ -** Processing line: ~ - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual~ -** Processing line: ~ 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).~ +** Processing line: ~~ +** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ +** Processing line: ~ using their keys.~ +** Processing line: ~~ +** Processing line: ~ For example, if we have a "numbers" hash that stores numbers in English as the~ +** Processing line: ~ key and numbers in Spanish as the value, we'd have a hash that looks like this...~ +** Processing line: ~ numbers = { "one" => "uno", "two" => "dos", "three" => "tres" }~ +** Processing line: ~ and on it goes.~ +** Processing line: ~~ +** Processing line: ~ Now if we wanted to find the corresponding value of the "one" key, we could say~ +** Processing line: ~ puts numbers["one"]~ +** Processing line: ~ which would print "uno" to the console.~ ** Processing line: ~~ ** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ -** Processing line: ~ For example, if we want to create a new button, we would declare it as a new entity and~ -** Processing line: ~ then define its properties.~ +** Processing line: ~ In this sample app, new_entity is used to create a new button that clears the grid.~ +** Processing line: ~ (Remember, you can use state to define ANY property and it will be retained across frames.)~ ** Processing line: ~~ -** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +** Processing line: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +** Processing line: ~ - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.labels: An array. The values in the array generate a label.~ +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ ** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ ** Processing line: ~~ -** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ +** Processing line: ~ - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect.~ ** Processing line: ~~ -** Processing line: ~ - first: Returns the first element of an array.~ +** Processing line: ~ =end~ ** Processing line: ~~ -** Processing line: ~ - inside_rect: Returns true or false depending on if the point is inside the rect.~ +** Processing line: ~ # This sample app shows an empty grid that the user can paint on.~ +** Processing line: ~ # To paint, the user must keep their mouse presssed and drag it around the grid.~ +** Processing line: ~ # The "clear" button allows users to clear the grid so they can start over.~ ** Processing line: ~~ -** Processing line: ~ - to_sym: Returns symbol corresponding to string. Will create a symbol if it does~ -** Processing line: ~ not already exist.~ +** Processing line: ~ class PaintApp~ +** Processing line: ~ attr_accessor :inputs, :state, :outputs, :grid, :args~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ # Runs methods necessary for the game to function properly.~ +** Processing line: ~ def tick~ +** Processing line: ~ print_title~ +** Processing line: ~ add_grid~ +** Processing line: ~ check_click~ +** Processing line: ~ draw_buttons~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # This sample app allows users to test their musical skills by matching the piano sound that plays in each~ -** Processing line: ~ # level to the correct note.~ +** Processing line: ~ # Prints the title onto the screen by using a label.~ +** Processing line: ~ # Also separates the title from the grid with a line as a horizontal separator.~ +** Processing line: ~ def print_title~ +** Processing line: ~ args.outputs.labels << [ 640, 700, 'Paint!', 0, 1 ]~ +** Processing line: ~ outputs.lines << horizontal_separator(660, 0, 1280)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Runs all the methods necessary for the game to function properly.~ -** Processing line: ~ def tick args~ -** Processing line: ~ defaults args~ -** Processing line: ~ render args~ -** Processing line: ~ calc args~ -** Processing line: ~ input_mouse args~ -** Processing line: ~ tick_instructions args, "Sample app shows how to play sounds. args.outputs.sounds << \"path_to_wav.wav\""~ -** Processing line: ~ end~ +** Processing line: ~ # Sets the starting position, ending position, and color for the horizontal separator.~ +** Processing line: ~ # The starting and ending positions have the same y values.~ +** Processing line: ~ def horizontal_separator y, x, x2~ +** Processing line: ~ [x, y, x2, y, 150, 150, 150]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets default values and creates empty collections~ -** Processing line: ~ # Initialization happens in the first frame only~ -** Processing line: ~ def defaults _~ -** Processing line: ~ _.state.notes ||= []~ -** Processing line: ~ _.state.click_feedbacks ||= []~ -** Processing line: ~ _.state.current_level ||= 1~ -** Processing line: ~ _.state.times_wrong ||= 0 # when game starts, user hasn't guessed wrong yet~ -** Processing line: ~ end~ +** Processing line: ~ # Sets the starting position, ending position, and color for the vertical separator.~ +** Processing line: ~ # The starting and ending positions have the same x values.~ +** Processing line: ~ def vertical_separator x, y, y2~ +** Processing line: ~ [x, y, x, y2, 150, 150, 150]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Uses a label to display current level, and shows the score~ -** Processing line: ~ # Creates a button to play the sample note, and displays the available notes that could be a potential match~ -** Processing line: ~ def render _~ +** Processing line: ~ # Outputs a border and a grid containing empty squares onto the screen.~ +** Processing line: ~ def add_grid~ ** Processing line: ~~ -** Processing line: ~ # grid.w_half positions the label in the horizontal center of the screen.~ -** Processing line: ~ _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(40), "Hole #{_.state.current_level} of 9", 0, 1, 0, 0, 0]~ +** Processing line: ~ # Sets the x, y, height, and width of the grid.~ +** Processing line: ~ # There are 31 horizontal lines and 31 vertical lines in the grid.~ +** Processing line: ~ # Feel free to count them yourself before continuing!~ +** Processing line: ~ x, y, h, w = 640 - 500/2, 640 - 500, 500, 500 # calculations done so the grid appears in screen's center~ +** Processing line: ~ lines_h = 31~ +** Processing line: ~ lines_v = 31~ ** Processing line: ~~ -** Processing line: ~ render_score _ # shows score on screen~ +** Processing line: ~ # Sets values for the grid's border, grid lines, and filled squares.~ +** Processing line: ~ # The filled_squares variable is initially set to an empty array.~ +** Processing line: ~ state.grid_border ||= [ x, y, h, w ] # definition of grid's outer border~ +** Processing line: ~ state.grid_lines ||= draw_grid(x, y, h, w, lines_h, lines_v) # calls draw_grid method~ +** Processing line: ~ state.filled_squares ||= [] # there are no filled squares until the user fills them in~ ** Processing line: ~~ -** Processing line: ~ if _.state.game_over # if game is over, a "play again" button is shown~ -** Processing line: ~ # Calculations ensure that Play Again label is displayed in center of border~ -** Processing line: ~ # Remove calculations from y parameters and see what happens to border and label placement~ -** Processing line: ~ _.state.play_again_border ||= _.state.with_meta([560, _.grid.h * 3 / 4 - 40, 160, 60], 'again') # array definition, text/title~ -** Processing line: ~ _.outputs.labels << [_.grid.w_half, _.grid.h * 3 / 4, "Play Again", 0, 1, 0, 0, 0] # outputs label~ -** Processing line: ~ _.outputs.borders << _.state.play_again_border # outputs border~ -** Processing line: ~ else # otherwise, if game is not over~ -** Processing line: ~ # Calculations ensure that label appears in center of border~ -** Processing line: ~ _.state.play_note_border ||= _.state.with_meta([560, _.grid.h * 3 / 4 - 40, 160, 60], 'play') # array definition, text/title~ -** Processing line: ~ _.outputs.labels << [_.grid.w_half, _.grid.h * 3 / 4, "Play Note ##{_.state.current_level}", 0, 1, 0, 0, 0] # outputs label~ -** Processing line: ~ _.outputs.borders << _.state.play_note_border # outputs border~ +** Processing line: ~ # Outputs the grid lines, border, and filled squares onto the screen.~ +** Processing line: ~ outputs.lines.concat state.grid_lines~ +** Processing line: ~ outputs.borders << state.grid_border~ +** Processing line: ~ outputs.solids << state.filled_squares~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ return if _.state.game_over # return if game is over~ +** Processing line: ~ # Draws the grid by adding in vertical and horizontal separators.~ +** Processing line: ~ def draw_grid x, y, h, w, lines_h, lines_v~ ** Processing line: ~~ -** Processing line: ~ _.outputs.labels << [_.grid.w_half, 400, "I think the note is a(n)...", 0, 1, 0, 0, 0] # outputs label~ +** Processing line: ~ # The grid starts off empty.~ +** Processing line: ~ grid = []~ ** Processing line: ~~ -** Processing line: ~ # Shows all of the available notes that can be potential matches.~ -** Processing line: ~ available_notes.each_with_index do |note, i|~ -** Processing line: ~ _.state.notes[i] ||= piano_button(_, note, i + 1) # calls piano_button method on each note (creates label and border)~ -** Processing line: ~ _.outputs.labels << _.state.notes[i].label # outputs note on screen with a label and a border~ -** Processing line: ~ _.outputs.borders << _.state.notes[i].border~ -** Processing line: ~ end~ +** Processing line: ~ # Calculates the placement and adds horizontal lines or separators into the grid.~ +** Processing line: ~ curr_y = y # start at the bottom of the box~ +** Processing line: ~ dist_y = h / (lines_h + 1) # finds distance to place horizontal lines evenly throughout 500 height of grid~ +** Processing line: ~ lines_h.times do~ +** Processing line: ~ curr_y += dist_y # increment curr_y by the distance between the horizontal lines~ +** Processing line: ~ grid << horizontal_separator(curr_y, x, x + w - 1) # add a separator into the grid~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Shows whether or not the user is correct by filling the screen with either red or green~ -** Processing line: ~ _.outputs.solids << _.state.click_feedbacks.map { |c| c.solid }~ -** Processing line: ~ end~ +** Processing line: ~ # Calculates the placement and adds vertical lines or separators into the grid.~ +** Processing line: ~ curr_x = x # now start at the left of the box~ +** Processing line: ~ dist_x = w / (lines_v + 1) # finds distance to place vertical lines evenly throughout 500 width of grid~ +** Processing line: ~ lines_v.times do~ +** Processing line: ~ curr_x += dist_x # increment curr_x by the distance between the vertical lines~ +** Processing line: ~ grid << vertical_separator(curr_x, y + 1, y + h) # add separator~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Shows the score (number of times the user guesses wrong) onto the screen using labels.~ -** Processing line: ~ def render_score _~ -** Processing line: ~ if _.state.times_wrong == 0 # if the user has guessed wrong zero times, the score is par~ -** Processing line: ~ _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(80), "Score: PAR", 0, 1, 0, 0, 0]~ -** Processing line: ~ else # otherwise, number of times the user has guessed wrong is shown~ -** Processing line: ~ _.outputs.labels << [_.grid.w_half, _.grid.top.shift_down(80), "Score: +#{_.state.times_wrong}", 0, 1, 0, 0, 0] # shows score using string interpolation~ +** Processing line: ~ # paint_grid uses a hash to assign values to keys.~ +** Processing line: ~ state.paint_grid ||= {"x" => x, "y" => y, "h" => h, "w" => w, "lines_h" => lines_h,~ +** Processing line: ~ "lines_v" => lines_v, "dist_x" => dist_x,~ +** Processing line: ~ "dist_y" => dist_y }~ +** Processing line: ~~ +** Processing line: ~ return grid~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the target note for the level and performs calculations on click_feedbacks.~ -** Processing line: ~ def calc _~ -** Processing line: ~ _.state.target_note ||= available_notes.sample # chooses a note from available_notes collection as target note~ -** Processing line: ~ _.state.click_feedbacks.each { |c| c.solid[-1] -= 5 } # remove this line and solid color will remain on screen indefinitely~ -** Processing line: ~ # comment this line out and the solid color will keep flashing on screen instead of being removed from click_feedbacks collection~ -** Processing line: ~ _.state.click_feedbacks.reject! { |c| c.solid[-1] <= 0 }~ -** Processing line: ~ end~ +** Processing line: ~ # Checks if the user is keeping the mouse pressed down and sets the mouse_hold variable accordingly using boolean values.~ +** Processing line: ~ # If the mouse is up, the user cannot drag the mouse.~ +** Processing line: ~ def check_click~ +** Processing line: ~ if inputs.mouse.down #is mouse up or down?~ +** Processing line: ~ state.mouse_held = true # mouse is being held down~ +** Processing line: ~ elsif inputs.mouse.up # if mouse is up~ +** Processing line: ~ state.mouse_held = false # mouse is not being held down or dragged~ +** Processing line: ~ state.mouse_dragging = false~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Uses input from the user to play the target note, as well as the other notes that could be a potential match.~ -** Processing line: ~ def input_mouse _~ -** Processing line: ~ return unless _.inputs.mouse.click # return unless the mouse is clicked~ +** Processing line: ~ if state.mouse_held && # mouse needs to be down~ +** Processing line: ~ !inputs.mouse.click && # must not be first click~ +** Processing line: ~ ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15) # Need to move 15 pixels before "drag"~ +** Processing line: ~ state.mouse_dragging = true~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # finds button that was clicked by user~ -** Processing line: ~ button_clicked = _.outputs.borders.find_all do |b| # go through borders collection to find all borders that meet requirements~ -** Processing line: ~ _.inputs.mouse.click.point.inside_rect? b # find button border that mouse was clicked inside of~ -** Processing line: ~ end.reject {|b| !_.state.meta(b)}.first # reject, return first element~ +** Processing line: ~ # If the user clicks their mouse inside the grid, the search_lines method is called with a click input type.~ +** Processing line: ~ if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border))~ +** Processing line: ~ search_lines(inputs.mouse.click.point, :click)~ ** Processing line: ~~ -** Processing line: ~ return unless button_clicked # return unless button_clicked as a value (a button was clicked)~ +** Processing line: ~ # If the user drags their mouse inside the grid, the search_lines method is called with a drag input type.~ +** Processing line: ~ elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border))~ +** Processing line: ~ search_lines(inputs.mouse.position, :drag)~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ queue_click_feedback _, # calls queue_click_feedback method on the button that was clicked~ -** Processing line: ~ button_clicked.x,~ -** Processing line: ~ button_clicked.y,~ -** Processing line: ~ button_clicked.w,~ -** Processing line: ~ button_clicked.h,~ -** Processing line: ~ 150, 100, 200 # sets color of button to shade of purple~ +** Processing line: ~ # Sets the definition of a grid box and handles user input to fill in or clear grid boxes.~ +** Processing line: ~ def search_lines (point, input_type)~ +** Processing line: ~ point.x -= state.paint_grid["x"] # subtracts the value assigned to the "x" key in the paint_grid hash~ +** Processing line: ~ point.y -= state.paint_grid["y"] # subtracts the value assigned to the "y" key in the paint_grid hash~ ** Processing line: ~~ -** Processing line: ~ if _.state.meta(button_clicked) == 'play' # if "play note" button is pressed~ -** Processing line: ~ _.outputs.sounds << "sounds/#{_.state.target_note}.wav" # sound of target note is output~ -** Processing line: ~ elsif _.state.meta(button_clicked) == 'again' # if "play game again" button is pressed~ -** Processing line: ~ _.state.target_note = nil # no target note~ -** Processing line: ~ _.state.current_level = 1 # starts at level 1 again~ -** Processing line: ~ _.state.times_wrong = 0 # starts off with 0 wrong guesses~ -** Processing line: ~ _.state.game_over = false # the game is not over (because it has just been restarted)~ -** Processing line: ~ else # otherwise if neither of those buttons were pressed~ -** Processing line: ~ _.outputs.sounds << "sounds/#{_.state.meta(button_clicked)}.wav" # sound of clicked note is played~ -** Processing line: ~ if _.state.meta(button_clicked).to_sym == _.state.target_note # if clicked note is target note~ -** Processing line: ~ _.state.target_note = nil # target note is emptied~ +** Processing line: ~ # Remove code following the .floor and see what happens when you try to fill in grid squares~ +** Processing line: ~ point.x = (point.x / state.paint_grid["dist_x"]).floor * state.paint_grid["dist_x"]~ +** Processing line: ~ point.y = (point.y / state.paint_grid["dist_y"]).floor * state.paint_grid["dist_y"]~ ** Processing line: ~~ -** Processing line: ~ if _.state.current_level < 9 # if game hasn't reached level 9~ -** Processing line: ~ _.state.current_level += 1 # game goes to next level~ -** Processing line: ~ else # otherwise, if game has reached level 9~ -** Processing line: ~ _.state.game_over = true # the game is over~ -** Processing line: ~ end~ +** Processing line: ~ point.x += state.paint_grid["x"]~ +** Processing line: ~ point.y += state.paint_grid["y"]~ ** Processing line: ~~ -** Processing line: ~ queue_click_feedback _, 0, 0, _.grid.w, _.grid.h, 100, 200, 100 # green shown if user guesses correctly~ -** Processing line: ~ else # otherwise, if clicked note is not target note~ -** Processing line: ~ _.state.times_wrong += 1 # increments times user guessed wrong~ -** Processing line: ~ queue_click_feedback _, 0, 0, _.grid.w, _.grid.h, 200, 100, 100 # red shown is user guesses wrong~ +** Processing line: ~ # Sets definition of a grid box, meaning its x, y, width, and height.~ +** Processing line: ~ # Floor is called on the point.x and point.y variables.~ +** Processing line: ~ # Ceil method is called on values of the distance hash keys, setting the width and height of a box.~ +** Processing line: ~ grid_box = [ point.x.floor, point.y.floor, state.paint_grid["dist_x"].ceil, state.paint_grid["dist_y"].ceil ]~ +** Processing line: ~~ +** Processing line: ~ if input_type == :click # if user clicks their mouse~ +** Processing line: ~ if state.filled_squares.include? grid_box # if grid box is already filled in~ +** Processing line: ~ state.filled_squares.delete grid_box # box is cleared and removed from filled_squares~ +** Processing line: ~ else~ +** Processing line: ~ state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares~ +** Processing line: ~ end~ +** Processing line: ~ elsif input_type == :drag # if user drags mouse~ +** Processing line: ~ unless state.filled_squares.include? grid_box # unless the grid box dragged over is already filled in~ +** Processing line: ~ state.filled_squares << grid_box # the box is filled in and added to filled_squares~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Creates a collection of all of the available notes as symbols~ -** Processing line: ~ def available_notes~ -** Processing line: ~ [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4]~ -** Processing line: ~ end~ +** Processing line: ~ # Creates and outputs a "Clear" button on the screen using a label and a border.~ +** Processing line: ~ # If the button is clicked, the filled squares are cleared, making the filled_squares collection empty.~ +** Processing line: ~ def draw_buttons~ +** Processing line: ~ x, y, w, h = 390, 50, 240, 50~ +** Processing line: ~ state.clear_button ||= state.new_entity(:button_with_fade)~ ** Processing line: ~~ -** Processing line: ~ # Creates buttons for each note, and sets a label (the note's name) and border for each note's button.~ -** Processing line: ~ def piano_button _, note, position~ -** Processing line: ~ _.state.new_entity(:button) do |b| # declares button as new entity~ -** Processing line: ~ b.label = [460 + 40.mult(position), _.grid.h * 0.4, "#{note}", 0, 1, 0, 0, 0] # label definition~ -** Processing line: ~ b.border = _.state.with_meta([460 + 40.mult(position) - 20, _.grid.h * 0.4 - 32, 40, 40], note) # border definition, text/title; 20 subtracted so label is in center of border~ +** Processing line: ~ # The x and y positions are set to display the label in the center of the button.~ +** Processing line: ~ # Try changing the first two parameters to simply x, y and see what happens to the text placement!~ +** Processing line: ~ state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] # placed in center of border~ +** Processing line: ~ state.clear_button.border ||= [x, y, w, h]~ +** Processing line: ~~ +** Processing line: ~ # If the mouse is clicked inside the borders of the clear button,~ +** Processing line: ~ # the filled_squares collection is emptied and the squares are cleared.~ +** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border)~ +** Processing line: ~ state.clear_button.clicked_at = inputs.mouse.click.created_at # time (frame) the click occurred~ +** Processing line: ~ state.filled_squares.clear~ +** Processing line: ~ inputs.mouse.previous_click = nil~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ outputs.labels << state.clear_button.label~ +** Processing line: ~ outputs.borders << state.clear_button.border~ +** Processing line: ~~ +** Processing line: ~ # When the clear button is clicked, the color of the button changes~ +** Processing line: ~ # and the transparency changes, as well. If you change the time from~ +** Processing line: ~ # 0.25.seconds to 1.25.seconds or more, the change will last longer.~ +** Processing line: ~ if state.clear_button.clicked_at~ +** Processing line: ~ outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Color of click feedback changes depending on what button was clicked, and whether the guess is right or wrong~ -** Processing line: ~ # If a button is clicked, the inside of button is purple (see input_mouse method)~ -** Processing line: ~ # If correct note is clicked, screen turns green~ -** Processing line: ~ # If incorrect note is clicked, screen turns red (again, see input_mouse method)~ -** Processing line: ~ def queue_click_feedback _, x, y, w, h, *color~ -** Processing line: ~ _.state.click_feedbacks << _.state.new_entity(:click_feedback) do |c| # declares feedback as new entity~ -** Processing line: ~ c.solid = [x, y, w, h, *color, 255] # sets color~ -** Processing line: ~ end~ +** Processing line: ~ $paint_app = PaintApp.new~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ $paint_app.inputs = args.inputs~ +** Processing line: ~ $paint_app.state = args.state~ +** Processing line: ~ $paint_app.grid = args.grid~ +** Processing line: ~ $paint_app.args = args~ +** Processing line: ~ $paint_app.outputs = args.outputs~ +** Processing line: ~ $paint_app.tick~ +** Processing line: ~ tick_instructions args, "How to create a simple paint app. CLICK and HOLD to draw."~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def tick_instructions args, text, y = 715~ @@ -124343,721 +192770,569 @@ 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~ -- H1 detected. +** Processing line: ~*** Mouse - Coordinate Systems - 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 contains ~*** ~... gsub-ing empty string +- Formatting line: ~Mouse - Coordinate Systems - 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: ~Mouse - Coordinate Systems - 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: ~ # ./samples/05_mouse/04_coordinate_systems/app/main.rb~ +** Processing line: ~ =begin~ ** 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: ~ APIs listing that haven't been encountered in previous sample apps:~ ** 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: ~ - args.inputs.mouse.click.position: Coordinates of the mouse's position on the screen.~ +** Processing line: ~ Unlike args.inputs.mouse.click.point, the mouse does not need to be pressed down for~ +** Processing line: ~ position to know the mouse's coordinates.~ +** Processing line: ~ For more information about the mouse, go to mygame/documentation/07-mouse.md.~ ** 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: ~ Reminders:~ ** 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: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ ** 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: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ ** 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: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ ** 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: ~ In this sample app, string interpolation is used to show the current position of the mouse~ +** Processing line: ~ in a 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: ~ - args.outputs.labels: An array that generates a label.~ +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ ** 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: ~ - args.outputs.solids: An array that generates a solid.~ +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ +** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ ** 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: ~ - args.outputs.lines: An array that generates a line.~ +** Processing line: ~ The parameters are [X, Y, X2, Y2, RED, GREEN, BLUE, ALPHA]~ +** Processing line: ~ For more information about lines, go to mygame/documentation/04-lines.md.~ ** 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: ~ =end~ ** 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: ~ # This sample app shows a coordinate system or grid. The user can move their mouse around the screen and the~ +** Processing line: ~ # coordinates of their position on the screen will be displayed. Users can choose to view one quadrant or~ +** Processing line: ~ # four quadrants by pressing the button.~ ** Processing line: ~~ -** Processing line: ~ args.state.next_sound_index += 1~ +** Processing line: ~ def tick args~ ** 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: ~ # The addition and subtraction in the first two parameters of the label and solid~ +** Processing line: ~ # ensure that the outputs don't overlap each other. Try removing them and see what happens.~ +** Processing line: ~ pos = args.inputs.mouse.position # stores coordinates of mouse's position~ +** Processing line: ~ args.outputs.labels << [pos.x + 10, pos.y + 10, "#{pos}"] # outputs label of coordinates~ +** Processing line: ~ args.outputs.solids << [pos.x - 2, pos.y - 2, 5, 5] # outputs small blackk box placed where mouse is hovering~ ** Processing line: ~~ -** Processing line: ~ args.state.selected = args.state.next_sound_index~ -** Processing line: ~ end~ +** Processing line: ~ button = [0, 0, 370, 50] # sets definition of toggle button~ +** Processing line: ~ args.outputs.borders << button # outputs button as border (not filled in)~ +** Processing line: ~ args.outputs.labels << [10, 35, "click here toggle coordinate system"] # label of button~ +** Processing line: ~ args.outputs.lines << [ 0, -720, 0, 720] # vertical line dividing quadrants~ +** Processing line: ~ args.outputs.lines << [-1280, 0, 1280, 0] # horizontal line dividing quadrants~ ** 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: ~ if args.inputs.mouse.click # if the user clicks the mouse~ +** Processing line: ~ pos = args.inputs.mouse.click.point # pos's value is point where user clicked (coordinates)~ +** Processing line: ~ if pos.inside_rect? button # if the click occurred inside the button~ +** Processing line: ~ if args.grid.name == :bottom_left # if the grid shows bottom left as origin~ +** Processing line: ~ args.grid.origin_center! # origin will be shown in center~ +** Processing line: ~ else~ +** Processing line: ~ args.grid.origin_bottom_left! # otherwise, the view will change to show bottom left as origin~ +** Processing line: ~ end~ ** 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: ~ tick_instructions args, "Sample app shows the two supported coordinate systems in Game Toolkit."~ ** 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: ~ 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.escape~ +** Processing line: ~ args.state.key_event_occurred = true~ ** 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: ~ 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: ~* Rendering Basics - Sound Synthesis - main.rb~ -- H1 detected. +** Processing line: ~*** Save Load - Save Load Game - 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 contains ~*** ~... gsub-ing empty string +- Formatting line: ~Save Load - Save Load Game - 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: ~Save Load - Save Load Game - 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: ~ 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: ~ # ./samples/06_save_load/01_save_load_game/app/main.rb~ +** Processing line: ~ =begin~ ** Processing line: ~~ -** Processing line: ~ def defaults args~ -** Processing line: ~ args.state.sine_waves ||= {}~ -** Processing line: ~ args.state.audio_queue ||= []~ -** Processing line: ~ args.state.buttons ||= [~ -** Processing line: ~ (frequency_buttons args),~ -** Processing line: ~ (note_buttons args),~ -** Processing line: ~ (bell_buttons args)~ -** Processing line: ~ ].flatten~ -** Processing line: ~ end~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ ** 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: ~ - Symbol (:): Ruby object with a name and an internal ID. Symbols are useful~ +** Processing line: ~ because with a given symbol name, you can refer to the same object throughout~ +** Processing line: ~ a Ruby program.~ ** 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: ~ In this sample app, we're using symbols for our buttons. We have buttons that~ +** Processing line: ~ light fires, save, load, etc. Each of these buttons has a distinct symbol like~ +** Processing line: ~ :light_fire, :save_game, :load_game, etc.~ ** Processing line: ~~ +** Processing line: ~ - to_sym: Returns the symbol corresponding to the given string; creates the symbol~ +** Processing line: ~ if it does not already exist.~ +** Processing line: ~ For example,~ +** Processing line: ~ 'car'.to_sym~ +** Processing line: ~ would return the symbol :car.~ ** Processing line: ~~ -** Processing line: ~ def note_buttons args~ -** Processing line: ~ [~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 1.5, col: 3, text: "C4",~ -** Processing line: ~ note: :c, octave: 4, method_to_call: :play_note),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 2.5, col: 3, text: "D4",~ -** Processing line: ~ note: :d, octave: 4, method_to_call: :play_note),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 3.5, col: 3, text: "E4",~ -** Processing line: ~ note: :e, octave: 4, method_to_call: :play_note),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 4.5, col: 3, text: "F4",~ -** Processing line: ~ note: :f, octave: 4, method_to_call: :play_note),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 5.5, col: 3, text: "G4",~ -** Processing line: ~ note: :g, octave: 4, method_to_call: :play_note),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 6.5, col: 3, text: "A5",~ -** Processing line: ~ note: :a, octave: 5, method_to_call: :play_note),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 7.5, col: 3, text: "B5",~ -** Processing line: ~ note: :b, octave: 5, method_to_call: :play_note),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 8.5, col: 3, text: "C5",~ -** Processing line: ~ note: :c, octave: 5, method_to_call: :play_note),~ -** Processing line: ~ ]~ -** Processing line: ~ end~ +** Processing line: ~ - last: Returns the last element of an array.~ ** Processing line: ~~ -** Processing line: ~ def play_note args, sender~ -** Processing line: ~ queue_sine_wave args,~ -** Processing line: ~ frequency: (frequency_for note: sender[:note],~ -** Processing line: ~ octave: sender[:octave]),~ -** Processing line: ~ duration: 1.seconds,~ -** Processing line: ~ fade_out: true~ -** Processing line: ~ end~ +** Processing line: ~ Reminders:~ ** Processing line: ~~ -** Processing line: ~ def bell_buttons args~ -** Processing line: ~ [~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 1.5, col: 6, text: "Bell C4",~ -** Processing line: ~ note: :c, octave: 4, method_to_call: :play_bell),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 2.5, col: 6, text: "Bell D4",~ -** Processing line: ~ note: :d, octave: 4, method_to_call: :play_bell),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 3.5, col: 6, text: "Bell E4",~ -** Processing line: ~ note: :e, octave: 4, method_to_call: :play_bell),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 4.5, col: 6, text: "Bell F4",~ -** Processing line: ~ note: :f, octave: 4, method_to_call: :play_bell),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 5.5, col: 6, text: "Bell G4",~ -** Processing line: ~ note: :g, octave: 4, method_to_call: :play_bell),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 6.5, col: 6, text: "Bell A5",~ -** Processing line: ~ note: :a, octave: 5, method_to_call: :play_bell),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 7.5, col: 6, text: "Bell B5",~ -** Processing line: ~ note: :b, octave: 5, method_to_call: :play_bell),~ -** Processing line: ~ (button args,~ -** Processing line: ~ row: 8.5, col: 6, text: "Bell C5",~ -** Processing line: ~ note: :c, octave: 5, method_to_call: :play_bell),~ -** Processing line: ~ ]~ -** Processing line: ~ end~ +** Processing line: ~ - num1.lesser(num2): finds the lower value of the given options.~ +** Processing line: ~ For example, in the statement~ +** Processing line: ~ a = 4.lesser(3)~ +** Processing line: ~ 3 has a lower value than 4, which means that the value of a would be set to 3,~ +** Processing line: ~ but if the statement had been~ +** Processing line: ~ a = 4.lesser(5)~ +** Processing line: ~ 4 has a lower value than 5, which means that the value of a would be set to 4.~ ** Processing line: ~~ -** Processing line: ~ def play_bell args, sender~ -** Processing line: ~ queue_bell args,~ -** Processing line: ~ frequency: (frequency_for note: sender[:note],~ -** Processing line: ~ octave: sender[:octave]),~ -** Processing line: ~ duration: 2.seconds,~ -** Processing line: ~ fade_out: true~ -** Processing line: ~ end~ +** Processing line: ~ - num1.fdiv(num2): returns the float division (will have a decimal) of the two given numbers.~ +** Processing line: ~ For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0~ ** 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,~ -** Processing line: ~ 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: ~ - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated~ +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ ** Processing line: ~~ -** Processing line: ~ def input args~ -** Processing line: ~ args.state.buttons.each do |b|~ -** Processing line: ~ if 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: ~ - args.outputs.labels: An array. Values generate a label.~ +** Processing line: ~ Parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +** Processing line: ~ For more information, go to mygame/documentation/02-labels.md.~ ** Processing line: ~~ -** Processing line: ~ if 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: ~ - ARRAY#inside_rect?: An array with at least two values is considered a point. An array~ +** Processing line: ~ with at least four values is considered a rect. The inside_rect? function returns true~ +** Processing line: ~ or false depending on if the point is inside the rect.~ ** 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: ~ =end~ ** Processing line: ~~ -** Processing line: ~ to_queue.each do |a|~ -** Processing line: ~ args.audio[a[:id]] = a~ -** Processing line: ~ end~ +** Processing line: ~ # This code allows users to perform different tasks, such as saving and loading the game.~ +** Processing line: ~ # Users also have options to reset the game and light a fire.~ ** Processing line: ~~ -** Processing line: ~ args.audio.each do |k, v|~ -** Processing line: ~ if v[:decay_rate]~ -** Processing line: ~ v[:gain] -= v[:decay_rate]~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ class TextedBasedGame~ ** Processing line: ~~ -** Processing line: ~ sounds_to_stop = args.audio.find_all do |k, v|~ -** Processing line: ~ v[:stop_at] && args.state.tick_count >= v[:stop_at]~ +** Processing line: ~ # Contains methods needed for game to run properly.~ +** Processing line: ~ # Increments tick count by 1 each time it runs (60 times in a single second)~ +** Processing line: ~ def tick~ +** Processing line: ~ default~ +** Processing line: ~ show_intro~ +** Processing line: ~ state.engine_tick_count += 1~ +** Processing line: ~ tick_fire~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ sounds_to_stop.each do |(k, v)|~ -** Processing line: ~ args.audio.delete k~ +** Processing line: ~ # Sets default values.~ +** Processing line: ~ # The ||= ensures that a variable's value is only set to the value following the = sign~ +** Processing line: ~ # if the value has not already been set before. Intialization happens only in the first frame.~ +** Processing line: ~ def default~ +** Processing line: ~ state.engine_tick_count ||= 0~ +** Processing line: ~ state.active_module ||= :room~ +** Processing line: ~ state.fire_progress ||= 0~ +** Processing line: ~ state.fire_ready_in ||= 10~ +** Processing line: ~ state.previous_fire ||= :dead~ +** Processing line: ~ state.fire ||= :dead~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def graph_sine_wave args, sine_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: ~ def show_intro~ +** Processing line: ~ return unless state.engine_tick_count == 0 # return unless the game just started~ +** Processing line: ~ set_story_line "awake." # calls set_story_line method, sets to "awake"~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ r, g, b = frequency.to_i % 80, frequency.to_i % 128, frequency.to_i % 255~ -** Processing line: ~ center_row = args.layout.rect(row: 5, col: 9)~ -** Processing line: ~ x_scale = 20~ -** Processing line: ~ y_scale = 100~ -** Processing line: ~ max_points = 20~ +** Processing line: ~ # Sets story line.~ +** Processing line: ~ def set_story_line story_line~ +** Processing line: ~ state.story_line = story_line # story line set to value of parameter~ +** Processing line: ~ state.active_module = :alert # active module set to alert~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ points = sine_wave~ -** Processing line: ~ if sine_wave.length > max_points~ -** Processing line: ~ resolution = sine_wave.length.idiv max_points~ -** Processing line: ~ points = sine_wave.find_all~ -** Processing line: ~ .with_index { |y, i| i % resolution == 0 }~ +** Processing line: ~ # Clears story line.~ +** Processing line: ~ def clear_storyline~ +** Processing line: ~ state.active_module = :none # active module set to none~ +** Processing line: ~ state.story_line = nil # story line is cleared, set to nil (or empty)~ ** 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: ~ # Determines fire progress (how close the fire is to being ready to light).~ +** Processing line: ~ def tick_fire~ +** Processing line: ~ return if state.active_module == :alert # return if active module is alert~ +** Processing line: ~ state.fire_progress += 1 # increment fire progress~ +** Processing line: ~ # fire_ready_in is 10. The fire_progress is either the current value or 10, whichever has a lower value.~ +** Processing line: ~ state.fire_progress = state.fire_progress.lesser(state.fire_ready_in)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if next_y~ -** Processing line: ~ {~ -** Processing line: ~ x: center_row.x + (x * x_scale),~ -** Processing line: ~ y: center_row.y + center_row.h.half + y_scale * y,~ -** Processing line: ~ x2: center_row.x + ((x + 1) * x_scale),~ -** Processing line: ~ y2: center_row.y + center_row.h.half + y_scale * next_y,~ -** Processing line: ~ r: r,~ -** Processing line: ~ g: g,~ -** Processing line: ~ b: b~ -** Processing line: ~ }~ +** Processing line: ~ # Sets the value of fire (whether it is dead or roaring), and the story line~ +** Processing line: ~ def light_fire~ +** Processing line: ~ return unless fire_ready? # returns unless the fire is ready to be lit~ +** Processing line: ~ state.fire = :roaring # fire is lit, set to roaring~ +** Processing line: ~ state.fire_progress = 0 # the fire progress returns to 0, since the fire has been lit~ +** Processing line: ~ if state.fire != state.previous_fire~ +** Processing line: ~ set_story_line "the fire is #{state.fire}." # the story line is set using string interpolation~ +** Processing line: ~ state.previous_fire = state.fire~ ** 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: (center_row.x + (x * x_scale)) - 1,~ -** Processing line: ~ y: (center_row.y + center_row.h.half + y_scale * y) - 1,~ -** Processing line: ~ w: 2,~ -** Processing line: ~ h: 2,~ -** Processing line: ~ path: 'sprites/square-black.png'~ -** Processing line: ~ }~ +** Processing line: ~ # Checks if the fire is ready to be lit. Returns a boolean value.~ +** Processing line: ~ def fire_ready?~ +** Processing line: ~ # If fire_progress (value between 0 and 10) is equal to fire_ready_in (value of 10),~ +** Processing line: ~ # the fire is ready to be lit.~ +** Processing line: ~ state.fire_progress == state.fire_ready_in~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.graphed_at = args.state.tick_count~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ def defaults_period_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_period_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 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_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: ~ 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: ~ audio_state = {~ -** 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: ~ # Divides the value of the fire_progress variable by 10 to determine how close the user is to~ +** Processing line: ~ # being able to light a fire.~ +** Processing line: ~ def light_fire_progress~ +** Processing line: ~ state.fire_progress.fdiv(10) # float division~ +** Processing line: ~ end~ ** 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: ~ # Defines fire as the state.fire variable.~ +** Processing line: ~ def fire~ +** Processing line: ~ state.fire~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ proc = lambda do~ -** Processing line: ~ generate_audio_data args.state.sine_waves[frequency], sample_rate~ +** Processing line: ~ # Sets the title of the room.~ +** Processing line: ~ def room_title~ +** Processing line: ~ return "a room that is dark" if state.fire == :dead # room is dark if the fire is dead~ +** Processing line: ~ return "a room that is lit" # room is lit if the fire is not dead~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~ -** Processing line: ~ graph_sine_wave args, sine_wave, frequency~ -** Processing line: ~ args.state.audio_queue << audio_state~ -** Processing line: ~ end~ +** Processing line: ~ # Sets the active_module to room.~ +** Processing line: ~ def go_to_room~ +** Processing line: ~ state.active_module = :room~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def defaults_queue_bell~ -** Processing line: ~ { frequency: 440, duration: 1.seconds, queue_in: 0 }~ -** Processing line: ~ end~ +** Processing line: ~ # Defines active_module as the state.active_module variable.~ +** Processing line: ~ def active_module~ +** Processing line: ~ state.active_module~ +** 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: ~ # Defines story_line as the state.story_line variable.~ +** Processing line: ~ def story_line~ +** Processing line: ~ state.story_line~ +** 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: ~ # Update every 60 frames (or every second)~ +** Processing line: ~ def should_tick?~ +** Processing line: ~ state.tick_count.mod_zero?(60)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def bell_to_sine_waves 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: ~ # Sets the value of the game state provider.~ +** Processing line: ~ def initialize game_state_provider~ +** Processing line: ~ @game_state_provider = game_state_provider~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def defaults_frequency_for~ -** Processing line: ~ { note: :a, octave: 5, sharp: false, flat: false }~ -** Processing line: ~ end~ +** Processing line: ~ # Defines the game state.~ +** Processing line: ~ # Any variable prefixed with an @ symbol is an instance variable.~ +** Processing line: ~ def state~ +** Processing line: ~ @game_state_provider.state~ +** 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: ~ # Saves the state of the game in a text file called game_state.txt.~ +** Processing line: ~ def save~ +** Processing line: ~ $gtk.serialize_state('game_state.txt', state)~ ** 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: ~ # Loads the game state from the game_state.txt text file.~ +** Processing line: ~ # If the load is unsuccessful, the user is informed since the story line indicates the failure.~ +** Processing line: ~ def load~ +** Processing line: ~ parsed_state = $gtk.deserialize_state('game_state.txt')~ +** Processing line: ~ if !parsed_state~ +** Processing line: ~ set_story_line "no game to load. press save first."~ +** Processing line: ~ else~ +** Processing line: ~ $gtk.args.state = parsed_state~ +** Processing line: ~ end~ +** 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: ~ # Resets the game.~ +** Processing line: ~ def reset~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def button args, opts~ -** Processing line: ~ button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))~ +** Processing line: ~ class TextedBasedGamePresenter~ +** Processing line: ~ attr_accessor :state, :outputs, :inputs~ ** Processing line: ~~ -** Processing line: ~ button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0~ +** Processing line: ~ # Creates empty collection called highlights.~ +** Processing line: ~ # Calls methods necessary to run the game.~ +** Processing line: ~ def tick~ +** Processing line: ~ state.layout.highlights ||= []~ +** Processing line: ~ game.tick if game.should_tick?~ +** Processing line: ~ render~ +** Processing line: ~ process_input~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ font_size_enum = args.layout.font_relative_size_enum 0~ -** Processing line: ~ label_offset_x = 4~ -** Processing line: ~ label_offset_y = button_def[:rect].h.half + button_def[:rect].h.idiv(4)~ +** Processing line: ~ # Outputs a label of the tick count (passage of time) and calls all render methods.~ +** Processing line: ~ def render~ +** Processing line: ~ outputs.labels << [10, 30, state.tick_count]~ +** Processing line: ~ render_alert~ +** Processing line: ~ render_room~ +** Processing line: ~ render_highlights~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ button_def[:label] = button_def[:rect].merge text: opts[:text],~ -** Processing line: ~ size_enum: font_size_enum,~ -** Processing line: ~ x: button_def[:rect].x + label_offset_x,~ -** Processing line: ~ y: button_def[:rect].y + label_offset_y~ +** Processing line: ~ # Outputs a label onto the screen that shows the story line, and also outputs a "close" button.~ +** Processing line: ~ def render_alert~ +** Processing line: ~ return unless game.active_module == :alert~ ** Processing line: ~~ -** Processing line: ~ button_def~ -** Processing line: ~ end~ +** Processing line: ~ outputs.labels << [640, 480, game.story_line, 5, 1] # outputs story line label~ +** Processing line: ~ outputs.primitives << button(:alert_dismiss, 490, 380, "close") # positions "close" button under story line~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.reset~ +** Processing line: ~ def render_room~ +** Processing line: ~ return unless game.active_module == :room~ +** Processing line: ~ outputs.labels << [640, 700, game.room_title, 4, 1] # outputs room title label at top of screen~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # The parameters for these outputs are (symbol, x, y, text, value/percentage) and each has a y value~ +** Processing line: ~ # that positions it 60 pixels lower than the previous output.~ ** Processing line: ~~ +** Processing line: ~ # outputs the light_fire_progress bar, uses light_fire_progress for its percentage (which changes bar's appearance)~ +** Processing line: ~ outputs.primitives << progress_bar(:light_fire, 490, 600, "light fire", game.light_fire_progress)~ +** Processing line: ~ outputs.primitives << button( :save_game, 490, 540, "save") # outputs save button~ +** Processing line: ~ outputs.primitives << button( :load_game, 490, 480, "load") # outputs load button~ +** Processing line: ~ outputs.primitives << button( :reset_game, 490, 420, "reset") # outputs reset button~ +** Processing line: ~ outputs.labels << [640, 30, "the fire is #{game.fire}", 0, 1] # outputs fire label at bottom of screen~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Input Basics - Keyboard - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Input Basics - Keyboard - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Outputs a collection of highlights using an array to set their values, and also rejects certain values from the collection.~ +** Processing line: ~ def render_highlights~ +** Processing line: ~ state.layout.highlights.each do |h| # for each highlight in the collection~ +** Processing line: ~ h.lifetime -= 1 # decrease the value of its lifetime~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/02_input_basics/01_keyboard/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ outputs.solids << state.layout.highlights.map do |h| # outputs highlights collection~ +** Processing line: ~ [h.x, h.y, h.w, h.h, h.color, 255 * h.lifetime / h.max_lifetime] # sets definition for each highlight~ +** Processing line: ~ # transparency changes; divide lifetime by max_lifetime, multiply result by 255~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in a previous sample apps:~ +** Processing line: ~ # reject highlights from collection that have no remaining lifetime~ +** Processing line: ~ state.layout.highlights = state.layout.highlights.reject { |h| h.lifetime <= 0 }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.keyboard.key_up.KEY: The value of the properties will be set~ -** Processing line: ~ to the frame that the key_up event occurred (the frame correlates~ -** Processing line: ~ to args.state.tick_count). Otherwise the value will be nil. For a~ -** Processing line: ~ full listing of keys, take a look at mygame/documentation/06-keyboard.md.~ -** Processing line: ~ - args.state.PROPERTY: The state property on args is a dynamic~ -** Processing line: ~ structure. You can define ANY property here with ANY type of~ -** Processing line: ~ arbitrary nesting. Properties defined on args.state will be retained~ -** Processing line: ~ across frames. If you attempt access a property that doesn't exist~ -** Processing line: ~ on args.state, it will simply return nil (no exception will be thrown).~ +** Processing line: ~ # Checks whether or not a button was clicked.~ +** Processing line: ~ # Returns a boolean value.~ +** Processing line: ~ def process_input~ +** Processing line: ~ button = button_clicked? # calls button_clicked? method~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ # Returns a boolean value.~ +** Processing line: ~ # Finds the button that was clicked from the button list and determines what method to call.~ +** Processing line: ~ # Adds a highlight to the highlights collection.~ +** Processing line: ~ def button_clicked?~ +** Processing line: ~ return nil unless click_pos # return nil unless click_pos holds coordinates of mouse click~ +** Processing line: ~ button = @button_list.find do |k, v| # goes through button_list to find button clicked~ +** Processing line: ~ click_pos.inside_rect? v[:primitives].last.rect # was the mouse clicked inside the rect of button?~ +** Processing line: ~ end~ +** Processing line: ~ return unless button # return unless a button was clicked~ +** Processing line: ~ method_to_call = "#{button[0]}_clicked".to_sym # sets method_to_call to symbol (like :save_game or :load_game)~ +** Processing line: ~ if self.respond_to? method_to_call # returns true if self responds to the given method (method actually exists)~ +** Processing line: ~ border = button[1][:primitives].last # sets border definition using value of last key in button list hash~ ** Processing line: ~~ -** Processing line: ~ # Along with outputs, inputs are also an essential part of video game development~ -** Processing line: ~ # DragonRuby can take input from keyboards, mouse, and controllers.~ -** Processing line: ~ # This sample app will cover keyboard input.~ +** Processing line: ~ # declares each highlight as a new entity, sets properties~ +** Processing line: ~ state.layout.highlights << state.new_entity(:highlight) do |h|~ +** Processing line: ~ h.x = border.x~ +** Processing line: ~ h.y = border.y~ +** Processing line: ~ h.w = border.w~ +** Processing line: ~ h.h = border.h~ +** Processing line: ~ h.max_lifetime = 10~ +** Processing line: ~ h.lifetime = h.max_lifetime~ +** Processing line: ~ h.color = [120, 120, 180] # sets color to shade of purple~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # args.inputs.keyboard.key_up.a will check to see if the a key has been pressed~ -** Processing line: ~ # This will work with the other keys as well~ +** Processing line: ~ self.send method_to_call # invoke method identified by symbol~ +** Processing line: ~ else # otherwise, if self doesn't respond to given method~ +** Processing line: ~ border = button[1][:primitives].last # sets border definition using value of last key in hash~ ** Processing line: ~~ +** Processing line: ~ # declares each highlight as a new entity, sets properties~ +** Processing line: ~ state.layout.highlights << state.new_entity(:highlight) do |h|~ +** Processing line: ~ h.x = border.x~ +** Processing line: ~ h.y = border.y~ +** Processing line: ~ h.w = border.w~ +** Processing line: ~ h.h = border.h~ +** Processing line: ~ h.max_lifetime = 4 # different max_lifetime than the one set if respond_to? had been true~ +** Processing line: ~ h.lifetime = h.max_lifetime~ +** Processing line: ~ h.color = [120, 80, 80] # sets color to dark color~ +** Processing line: ~ end~ ** Processing line: ~~ -** 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: ~ # instructions for users on how to add the missing method_to_call to the code~ +** Processing line: ~ puts "It looks like #{method_to_call} doesn't exists on TextedBasedGamePresenter. Please add this method:"~ +** Processing line: ~ puts "Just copy the code below and put it in the #{TextedBasedGamePresenter} class definition."~ +** Processing line: ~ puts ""~ +** Processing line: ~ puts "```"~ +** Processing line: ~ puts "class TextedBasedGamePresenter <--- find this class and put the method below in it"~ +** Processing line: ~ puts ""~ +** Processing line: ~ puts " def #{method_to_call}"~ +** Processing line: ~ puts " puts 'Yay that worked!'"~ +** Processing line: ~ puts " end"~ +** Processing line: ~ puts ""~ +** Processing line: ~ puts "end <-- make sure to put the #{method_to_call} method in between the `class` word and the final `end` statement."~ +** Processing line: ~ puts "```"~ +** Processing line: ~ puts ""~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** 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~ -** Processing line: ~ args.state.h_pressed_at = args.state.tick_count~ +** Processing line: ~ # Returns the position of the mouse when it is clicked.~ +** Processing line: ~ def click_pos~ +** Processing line: ~ return nil unless inputs.mouse.click # returns nil unless the mouse was clicked~ +** Processing line: ~ return inputs.mouse.click.point # returns location of mouse click (coordinates)~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # This code simplifies to if args.state.h_pressed_at has not been initialized, set it to false~ -** Processing line: ~ args.state.h_pressed_at ||= false~ +** Processing line: ~ # Creates buttons for the button_list and sets their values using a hash (uses symbols as keys)~ +** Processing line: ~ def button id, x, y, text~ +** Processing line: ~ @button_list[id] ||= { # assigns values to hash keys~ +** Processing line: ~ id: id,~ +** Processing line: ~ text: text,~ +** Processing line: ~ primitives: [~ +** Processing line: ~ [x + 10, y + 30, text, 2, 0].label, # positions label inside border~ +** Processing line: ~ [x, y, 300, 50].border, # sets definition of border~ +** Processing line: ~ ]~ +** Processing line: ~ }~ ** 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: ~ else~ -** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 4), "\"h\" has never been pressed.", small_font]~ +** Processing line: ~ @button_list[id][:primitives] # returns label and border for buttons~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ tick_help_text args~ -** Processing line: ~ end~ +** Processing line: ~ # Creates a progress bar (used for lighting the fire) and sets its values.~ +** Processing line: ~ def progress_bar id, x, y, text, percentage~ +** Processing line: ~ @button_list[id] = { # assigns values to hash keys~ +** Processing line: ~ id: id,~ +** Processing line: ~ text: text,~ +** Processing line: ~ primitives: [~ +** Processing line: ~ [x, y, 300, 50, 100, 100, 100].solid, # sets definition for solid (which fills the bar with gray)~ +** Processing line: ~ [x + 10, y + 30, text, 2, 0].label, # sets definition for label, positions inside border~ +** Processing line: ~ [x, y, 300, 50].border, # sets definition of border~ +** Processing line: ~ ]~ +** Processing line: ~ }~ ** 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: ~ # Fills progress bar based on percentage. If the fire was ready to be lit (100%) and we multiplied by~ +** Processing line: ~ # 100, only 1/3 of the bar would only be filled in. 200 would cause only 2/3 to be filled in.~ +** Processing line: ~ @button_list[id][:primitives][0][2] = 300 * percentage~ +** Processing line: ~ @button_list[id][:primitives]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def row_to_px args, row_number~ -** 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: ~ end~ +** Processing line: ~ # Defines the game.~ +** Processing line: ~ def game~ +** Processing line: ~ @game~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Don't worry about understanding the code within this method just yet.~ -** Processing line: ~ # This method shows you the help text within the game.~ -** Processing line: ~ def tick_help_text args~ -** Processing line: ~ return unless args.state.h_pressed_at~ +** Processing line: ~ # Initalizes the game and creates an empty list of buttons.~ +** Processing line: ~ def initialize~ +** Processing line: ~ @game = TextedBasedGame.new self~ +** Processing line: ~ @button_list ||= {}~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.key_value_history ||= {}~ -** Processing line: ~ args.state.key_down_value_history ||= {}~ -** Processing line: ~ args.state.key_held_value_history ||= {}~ -** Processing line: ~ args.state.key_up_value_history ||= {}~ +** Processing line: ~ # Clears the storyline and takes the user to the room.~ +** Processing line: ~ def alert_dismiss_clicked~ +** Processing line: ~ game.clear_storyline~ +** Processing line: ~ game.go_to_room~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if (args.inputs.keyboard.key_down.truthy_keys.length > 0 ||~ -** Processing line: ~ args.inputs.keyboard.key_held.truthy_keys.length > 0 ||~ -** Processing line: ~ args.inputs.keyboard.key_up.truthy_keys.length > 0)~ -** Processing line: ~ args.state.help_available = true~ -** Processing line: ~ args.state.no_activity_debounce = nil~ -** Processing line: ~ else~ -** Processing line: ~ args.state.no_activity_debounce ||= 5.seconds~ -** Processing line: ~ args.state.no_activity_debounce -= 1~ -** Processing line: ~ if args.state.no_activity_debounce <= 0~ -** Processing line: ~ args.state.help_available = false~ -** Processing line: ~ args.state.key_value_history = {}~ -** Processing line: ~ args.state.key_down_value_history = {}~ -** Processing line: ~ args.state.key_held_value_history = {}~ -** Processing line: ~ args.state.key_up_value_history = {}~ -** Processing line: ~ end~ +** Processing line: ~ # Lights the fire when the user clicks the "light fire" option.~ +** Processing line: ~ def light_fire_clicked~ +** Processing line: ~ game.light_fire~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.labels << [10, row_to_px(args, 6), "Advanced Help:", small_font]~ +** Processing line: ~ # Saves the game when the user clicks the "save" option.~ +** Processing line: ~ def save_game_clicked~ +** Processing line: ~ game.save~ +** Processing line: ~ end~ ** 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: ~ # Resets the game when the user clicks the "reset" option.~ +** Processing line: ~ def reset_game_clicked~ +** Processing line: ~ game.reset~ ** 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: ~ # Loads the game when the user clicks the "load" option.~ +** Processing line: ~ def load_game_clicked~ +** Processing line: ~ game.load~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** 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~ -** Processing line: ~ fill_history args, :key_held_value_history, :held, :key_held~ -** Processing line: ~ fill_history args, :key_up_value_history, :up, :key_up~ +** Processing line: ~ $text_based_rpg = TextedBasedGamePresenter.new~ ** Processing line: ~~ -** Processing line: ~ render_help_labels args, :key_value_history, :down_or_held, nil, 10~ -** Processing line: ~ render_help_labels args, :key_down_value_history, :down, :key_down, 330~ -** Processing line: ~ render_help_labels args, :key_held_value_history, :held, :key_held, 650~ -** Processing line: ~ render_help_labels args, :key_up_value_history, :up, :key_up, 990~ +** Processing line: ~ def tick args~ +** Processing line: ~ $text_based_rpg.state = args.state~ +** Processing line: ~ $text_based_rpg.outputs = args.outputs~ +** Processing line: ~ $text_based_rpg.inputs = args.inputs~ +** Processing line: ~ $text_based_rpg.tick~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def fill_history args, history_key, state_key, keyboard_method~ -** Processing line: ~ fill_single_history args, history_key, state_key, keyboard_method, :raw_key~ -** Processing line: ~ fill_single_history args, history_key, state_key, keyboard_method, :char~ -** Processing line: ~ args.inputs.keyboard.keys[state_key].each do |key_name|~ -** Processing line: ~ fill_single_history args, history_key, state_key, keyboard_method, key_name~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** 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. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Rendering - Simple Render Targets - 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 Render Targets - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ def fill_single_history args, history_key, state_key, keyboard_method, key_name~ -** Processing line: ~ current_value = args.inputs.keyboard.send(key_name)~ -** Processing line: ~ if keyboard_method~ -** Processing line: ~ current_value = args.inputs.keyboard.send(keyboard_method).send(key_name)~ -** Processing line: ~ end~ -** Processing line: ~ args.state.as_hash[history_key][key_name] ||= []~ -** Processing line: ~ args.state.as_hash[history_key][key_name] << current_value~ -** Processing line: ~ args.state.as_hash[history_key][key_name] = args.state.as_hash[history_key][key_name].reverse.uniq.take(3).reverse~ -** Processing line: ~ end~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/07_advanced_rendering/01_simple_render_targets/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ # args.outputs.render_targets are really really powerful.~ +** Processing line: ~ # They essentially allow you to create a sprite programmatically and cache the result.~ ** Processing line: ~~ -** Processing line: ~ def render_help_labels args, history_key, state_key, keyboard_method, x~ -** Processing line: ~ idx = 8~ -** Processing line: ~ args.outputs.labels << args.state~ -** Processing line: ~ .as_hash[history_key]~ -** Processing line: ~ .keys~ -** Processing line: ~ .reverse~ -** Processing line: ~ .map~ -** Processing line: ~ .with_index do |k, i|~ -** Processing line: ~ v = args.state.as_hash[history_key][k]~ -** Processing line: ~ current_value = args.inputs.keyboard.send(k)~ -** Processing line: ~ if keyboard_method~ -** Processing line: ~ current_value = args.inputs.keyboard.send(keyboard_method).send(k)~ +** Processing line: ~ # Create a render_target of a :block and a :gradient on tick zero.~ +** Processing line: ~ if args.state.tick_count == 0~ +** Processing line: ~ args.render_target(:block).solids << [0, 0, 1280, 100]~ +** Processing line: ~~ +** Processing line: ~ # The gradient is actually just a collection of black solids with increasing~ +** Processing line: ~ # opacities.~ +** Processing line: ~ args.render_target(:gradient).solids << 90.map_with_index do |x|~ +** Processing line: ~ 50.map_with_index do |y|~ +** Processing line: ~ [x * 15, y * 15, 15, 15, 0, 0, 0, (x * 3).fdiv(255) * 255]~ +** Processing line: ~ end~ ** 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: ~ ]~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Take the :block render_target and present it horizontally centered.~ +** Processing line: ~ # Use a subsection of the render_targetd specified by source_x,~ +** Processing line: ~ # source_y, source_w, source_h.~ +** Processing line: ~ args.outputs.sprites << { x: 0,~ +** Processing line: ~ y: 310,~ +** Processing line: ~ w: 1280,~ +** Processing line: ~ h: 100,~ +** Processing line: ~ path: :block,~ +** Processing line: ~ source_x: 0,~ +** Processing line: ~ source_y: 0,~ +** Processing line: ~ source_w: 1280,~ +** Processing line: ~ source_h: 100 }~ +** Processing line: ~~ +** Processing line: ~ # After rendering :block, render gradient on top of :block.~ +** Processing line: ~ args.outputs.sprites << [0, 0, 1280, 720, :gradient]~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << [1270, 710, args.gtk.current_framerate, 0, 2, 255, 255, 255]~ +** Processing line: ~ tick_instructions args, "Sample app shows how to use render_targets (programmatically create cached sprites)."~ +** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def tick_instructions args, text, y = 715~ ** Processing line: ~ return if args.state.key_event_occurred~ @@ -125073,93 +193348,108 @@ Follows is a source code listing for all files that have been open sourced. This ** 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: ~ $gtk.reset~ +** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Input Basics - Mouse - main.rb~ -- H1 detected. +** Processing line: ~*** Advanced Rendering - Render Targets With Tile Manipulation - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Input Basics - Mouse - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Rendering - Render Targets With Tile Manipulation - 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 - Render Targets With Tile Manipulation - 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/02_mouse/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # ./samples/07_advanced_rendering/02_render_targets_with_tile_manipulation/app/main.rb~ +** Processing line: ~ # This sample is meant to show you how to do that dripping transition thing~ +** Processing line: ~ # at the start of the original Doom. Most of this file is here to animate~ +** Processing line: ~ # a scene to wipe away; the actual wipe effect is in the last 20 lines or~ +** Processing line: ~ # so.~ ** Processing line: ~~ -** Processing line: ~ APIs that haven't been encountered in a previous sample apps:~ +** Processing line: ~ $gtk.reset # reset all game state if reloaded.~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ -** Processing line: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ -** Processing line: ~ - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in.~ -** Processing line: ~ - args.inputs.mouse.click.point.created_at_elapsed: How many frames have passed~ -** Processing line: ~ since the click event.~ +** Processing line: ~ def circle_of_blocks pass, xoffset, yoffset, angleoffset, blocksize, distance~ +** Processing line: ~ numblocks = 10~ ** Processing line: ~~ -** Processing line: ~ Reminder:~ +** Processing line: ~ for i in 1..numblocks do~ +** Processing line: ~ angle = ((360 / numblocks) * i) + angleoffset~ +** Processing line: ~ radians = angle * (Math::PI / 180)~ +** Processing line: ~ x = (xoffset + (distance * Math.cos(radians))).round~ +** Processing line: ~ y = (yoffset + (distance * Math.sin(radians))).round~ +** Processing line: ~ pass.solids << [ x, y, blocksize, blocksize, 255, 255, 0 ]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.state.PROPERTY: The state property on args is a dynamic~ -** Processing line: ~ structure. You can define ANY property here with ANY type of~ -** Processing line: ~ arbitrary nesting. Properties defined on args.state will be retained~ -** Processing line: ~ across frames. If you attempt access a property that doesn't exist~ -** Processing line: ~ on args.state, it will simply return nil (no exception will be thrown).~ +** Processing line: ~ def draw_scene args, pass~ +** Processing line: ~ pass.solids << [0, 360, 1280, 360, 0, 0, 200]~ +** Processing line: ~ pass.solids << [0, 0, 1280, 360, 0, 127, 0]~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ blocksize = 100~ +** Processing line: ~ angleoffset = args.state.tick_count * 2.5~ +** Processing line: ~ centerx = (1280 - blocksize) / 2~ +** Processing line: ~ centery = (720 - blocksize) / 2~ ** Processing line: ~~ -** Processing line: ~ # This code demonstrates DragonRuby mouse input~ +** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize * 2, 500~ +** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize, 325~ +** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 2, 200~ +** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 4, 100~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # To see if the a mouse click occurred~ -** Processing line: ~ # Use args.inputs.mouse.click~ -** Processing line: ~ # Which returns a boolean~ +** Processing line: ~ def tick args~ +** Processing line: ~ segments = 160~ ** Processing line: ~~ -** Processing line: ~ # To see where a mouse click occurred~ -** Processing line: ~ # Use args.inputs.mouse.click.point.x AND~ -** Processing line: ~ # args.inputs.mouse.click.point.y~ +** Processing line: ~ # On the first tick, initialize some stuff.~ +** Processing line: ~ if !args.state.yoffsets~ +** Processing line: ~ args.state.baseyoff = 0~ +** Processing line: ~ args.state.yoffsets = []~ +** Processing line: ~ for i in 0..segments do~ +** Processing line: ~ args.state.yoffsets << rand * 100~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # To see which frame the click occurred~ -** Processing line: ~ # Use args.inputs.mouse.click.created_at~ +** Processing line: ~ # Just draw some random stuff for a few seconds.~ +** Processing line: ~ args.state.static_debounce ||= 60 * 2.5~ +** Processing line: ~ if args.state.static_debounce > 0~ +** Processing line: ~ last_frame = args.state.static_debounce == 1~ +** Processing line: ~ target = last_frame ? args.render_target(:last_frame) : args.outputs~ +** Processing line: ~ draw_scene args, target~ +** Processing line: ~ args.state.static_debounce -= 1~ +** Processing line: ~ return unless last_frame~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # To see how many frames its been since the click occurred~ -** Processing line: ~ # Use args.inputs.mouse.click.creat_at_elapsed~ +** Processing line: ~ # build up the wipe...~ ** Processing line: ~~ -** Processing line: ~ # Saving the click in args.state can be quite useful~ +** Processing line: ~ # this is the thing we're wiping to.~ +** Processing line: ~ args.outputs.sprites << [ 0, 0, 1280, 720, 'dragonruby.png' ]~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ tick_instructions args, "Sample app shows how mouse events are registered and how to measure elapsed time."~ -** Processing line: ~ x = 460~ +** Processing line: ~ return if (args.state.baseyoff > (1280 + 100)) # stop when done sliding~ ** Processing line: ~~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 11, "Mouse input: args.inputs.mouse")~ +** Processing line: ~ segmentw = 1280 / segments~ ** Processing line: ~~ -** Processing line: ~ if args.inputs.mouse.click~ -** Processing line: ~ args.state.last_mouse_click = args.inputs.mouse.click~ -** Processing line: ~ end~ +** Processing line: ~ x = 0~ +** Processing line: ~ for i in 0..segments do~ +** Processing line: ~ yoffset = 0~ +** Processing line: ~ if args.state.yoffsets[i] < args.state.baseyoff~ +** Processing line: ~ yoffset = args.state.baseyoff - args.state.yoffsets[i]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.state.last_mouse_click~ -** Processing line: ~ click = args.state.last_mouse_click~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 12, "Mouse click happened at: #{click.created_at}")~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 13, "Mouse clicked #{click.created_at_elapsed} ticks ago")~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 14, "Mouse click location: #{click.point.x}, #{click.point.y}")~ -** Processing line: ~ else~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 12, "Mouse click has not occurred yet.")~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 13, "Please click mouse.")~ +** Processing line: ~ # (720 - yoffset) flips the coordinate system, (- 720) adjusts for the height of the segment.~ +** Processing line: ~ args.outputs.sprites << [ x, (720 - yoffset) - 720, segmentw, 720, 'last_frame', 0, 255, 255, 255, 255, x, 0, segmentw, 720 ]~ +** Processing line: ~ x += segmentw~ ** Processing line: ~ end~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ def small_label args, x, row, message~ -** 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: ~ end~ +** Processing line: ~ args.state.baseyoff += 4~ ** 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: ~ tick_instructions args, "Sample app shows an advanced usage of render_target."~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def tick_instructions args, text, y = 715~ @@ -125180,205 +193470,475 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Input Basics - Mouse Point To Rect - main.rb~ -- H1 detected. +** Processing line: ~*** Advanced Rendering - Render Target Viewports - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Input Basics - Mouse Point To Rect - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Rendering - Render Target Viewports - 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 - Render Target Viewports - 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/03_mouse_point_to_rect/app/main.rb~ +** Processing line: ~ # ./samples/07_advanced_rendering/03_render_target_viewports/app/main.rb~ ** Processing line: ~ =begin~ ** Processing line: ~~ -** Processing line: ~ APIs that haven't been encountered in a previous sample apps:~ +** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ ** Processing line: ~~ -** Processing line: ~ - args.outputus.borders: An array. Values in this array will be rendered as~ -** Processing line: ~ unfilled rectangles on the screen.~ -** Processing line: ~ - ARRAY#inside_rect?: An array with at least two values is considered a point. An array~ -** Processing line: ~ with at least four values is considered a rect. The inside_rect? function returns true~ -** Processing line: ~ or false depending on if the point is inside the rect.~ +** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ +** Processing line: ~ For example, if we want to create a new button, we would declare it as a new entity and~ +** Processing line: ~ then define its properties. (Remember, you can use state to define ANY property and it will~ +** Processing line: ~ be retained across frames.)~ ** Processing line: ~~ -** Processing line: ~ ```~ -** Processing line: ~ # Point: x: 100, y: 100~ -** Processing line: ~ # Rect: x: 0, y: 0, w: 500, h: 500~ -** Processing line: ~ # Result: true~ +** Processing line: ~ If you have a solar system and you're creating args.state.sun and setting its image path to an~ +** Processing line: ~ image in the sprites folder, you would do the following:~ +** Processing line: ~ (See samples/99_sample_nddnug_workshop for more details.)~ ** Processing line: ~~ -** Processing line: ~ [100, 100].inside_rect? [0, 0, 500, 500]~ -** Processing line: ~ ```~ +** Processing line: ~ args.state.sun ||= args.state.new_entity(:sun) do |s|~ +** Processing line: ~ s.path = 'sprites/sun.png'~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ ```~ -** Processing line: ~ # Point: x: 100, y: 100~ -** Processing line: ~ # Rect: x: 300, y: 300, w: 100, h: 100~ -** Processing line: ~ # Result: false~ +** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ ** Processing line: ~~ -** Processing line: ~ [100, 100].inside_rect? [300, 300, 100, 100]~ -** Processing line: ~ ```~ +** Processing line: ~ For example, if we have a variable~ +** Processing line: ~ name = "Ruby"~ +** Processing line: ~ then the line~ +** Processing line: ~ puts "How are you, #{name}?"~ +** Processing line: ~ would print "How are you, Ruby?" to the console.~ +** Processing line: ~ (Remember, string interpolation only works with double quotes!)~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in.~ -** Processing line: ~ - args.inputs.mouse.click.point.created_at_elapsed: How many frames have passed~ -** Processing line: ~ since the click event.~ +** Processing line: ~ - Ternary operator (?): Similar to if statement; first evalulates whether a statement is~ +** Processing line: ~ true or false, and then executes a command depending on that result.~ +** Processing line: ~ For example, if we had a variable~ +** Processing line: ~ grade = 75~ +** Processing line: ~ and used the ternary operator in the command~ +** Processing line: ~ pass_or_fail = grade > 65 ? "pass" : "fail"~ +** Processing line: ~ then the value of pass_or_fail would be "pass" since grade's value was greater than 65.~ +** Processing line: ~~ +** Processing line: ~ Reminders:~ +** Processing line: ~~ +** Processing line: ~ - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual~ +** Processing line: ~ 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).~ +** Processing line: ~~ +** Processing line: ~ - Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction~ +** Processing line: ~ by adding or subracting.~ +** Processing line: ~~ +** Processing line: ~ - ARRAY#inside_rect?: An array with at least two values is considered a point. An array~ +** Processing line: ~ with at least four values is considered a rect. The inside_rect? function returns true~ +** Processing line: ~ or false depending on if the point is inside the rect.~ +** Processing line: ~~ +** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect.~ +** Processing line: ~~ +** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ +** Processing line: ~ For more information about the mouse, go to mygame/documentation/07-mouse.md.~ +** Processing line: ~~ +** Processing line: ~ - args.inputs.keyboard.key_up.KEY: The value of the properties will be set~ +** Processing line: ~ to the frame that the key_up event occurred (the frame correlates~ +** Processing line: ~ to args.state.tick_count).~ +** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ +** Processing line: ~~ +** Processing line: ~ - args.state.labels:~ +** Processing line: ~ The parameters for a label are~ +** Processing line: ~ 1. the position (x, y)~ +** Processing line: ~ 2. the text~ +** Processing line: ~ 3. the size~ +** Processing line: ~ 4. the alignment~ +** Processing line: ~ 5. the color (red, green, and blue saturations)~ +** Processing line: ~ 6. the alpha (or transparency)~ +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +** Processing line: ~~ +** Processing line: ~ - args.state.lines:~ +** Processing line: ~ The parameters for a line are~ +** Processing line: ~ 1. the starting position (x, y)~ +** Processing line: ~ 2. the ending position (x2, y2)~ +** Processing line: ~ 3. the color (red, green, and blue saturations)~ +** Processing line: ~ 4. the alpha (or transparency)~ +** Processing line: ~ For more information about lines, go to mygame/documentation/04-lines.md.~ +** Processing line: ~~ +** Processing line: ~ - args.state.solids (and args.state.borders):~ +** Processing line: ~ The parameters for a solid (or border) are~ +** Processing line: ~ 1. the position (x, y)~ +** Processing line: ~ 2. the width (w)~ +** Processing line: ~ 3. the height (h)~ +** Processing line: ~ 4. the color (r, g, b)~ +** Processing line: ~ 5. the alpha (or transparency)~ +** Processing line: ~ For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md.~ ** Processing line: ~~ +** Processing line: ~ - args.state.sprites:~ +** Processing line: ~ The parameters for a sprite are~ +** Processing line: ~ 1. the position (x, y)~ +** Processing line: ~ 2. the width (w)~ +** Processing line: ~ 3. the height (h)~ +** Processing line: ~ 4. the image path~ +** Processing line: ~ 5. the angle~ +** Processing line: ~ 6. the alpha (or transparency)~ +** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ ** Processing line: ~ =end~ ** Processing line: ~~ -** Processing line: ~ # To determine whether a point is in a rect~ -** Processing line: ~ # Use point.inside_rect? rect~ +** Processing line: ~ # This sample app shows different objects that can be used when making games, such as labels,~ +** Processing line: ~ # lines, sprites, solids, buttons, etc. Each demo section shows how these objects can be used.~ ** Processing line: ~~ -** Processing line: ~ # This is useful to determine if a click occurred in a rect~ +** Processing line: ~ # Also note that state.tick_count refers to the passage of time, or current frame.~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ tick_instructions args, "Sample app shows how to determing if a click happened inside a rectangle."~ +** Processing line: ~ class TechDemo~ +** Processing line: ~ attr_accessor :inputs, :state, :outputs, :grid, :args~ ** Processing line: ~~ -** Processing line: ~ x = 460~ +** Processing line: ~ # Calls all methods necessary for the app to run properly.~ +** Processing line: ~ def tick~ +** Processing line: ~ labels_tech_demo~ +** Processing line: ~ lines_tech_demo~ +** Processing line: ~ solids_tech_demo~ +** Processing line: ~ borders_tech_demo~ +** Processing line: ~ sprites_tech_demo~ +** Processing line: ~ keyboards_tech_demo~ +** Processing line: ~ controller_tech_demo~ +** Processing line: ~ mouse_tech_demo~ +** Processing line: ~ point_to_rect_tech_demo~ +** Processing line: ~ rect_to_rect_tech_demo~ +** Processing line: ~ button_tech_demo~ +** Processing line: ~ export_game_state_demo~ +** Processing line: ~ window_state_demo~ +** Processing line: ~ render_seperators~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 15, "Click inside the blue box maybe ---->")~ +** Processing line: ~ # Shows output of different kinds of labels on the screen~ +** Processing line: ~ def labels_tech_demo~ +** Processing line: ~ outputs.labels << [grid.left.shift_right(5), grid.top.shift_down(5), "This is a label located at the top left."]~ +** Processing line: ~ outputs.labels << [grid.left.shift_right(5), grid.bottom.shift_up(30), "This is a label located at the bottom left."]~ +** Processing line: ~ outputs.labels << [ 5, 690, "Labels (x, y, text, size, align, r, g, b, a)"]~ +** Processing line: ~ outputs.labels << [ 5, 660, "Smaller label.", -2]~ +** Processing line: ~ outputs.labels << [ 5, 630, "Small label.", -1]~ +** Processing line: ~ outputs.labels << [ 5, 600, "Medium label.", 0]~ +** Processing line: ~ outputs.labels << [ 5, 570, "Large label.", 1]~ +** Processing line: ~ outputs.labels << [ 5, 540, "Larger label.", 2]~ +** Processing line: ~ outputs.labels << [300, 660, "Left aligned.", 0, 2]~ +** Processing line: ~ outputs.labels << [300, 640, "Center aligned.", 0, 1]~ +** Processing line: ~ outputs.labels << [300, 620, "Right aligned.", 0, 0]~ +** Processing line: ~ outputs.labels << [175, 595, "Red Label.", 0, 0, 255, 0, 0]~ +** Processing line: ~ outputs.labels << [175, 575, "Green Label.", 0, 0, 0, 255, 0]~ +** Processing line: ~ outputs.labels << [175, 555, "Blue Label.", 0, 0, 0, 0, 255]~ +** Processing line: ~ outputs.labels << [175, 535, "Faded Label.", 0, 0, 0, 0, 0, 128]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ box = [785, 370, 50, 50, 0, 0, 170]~ -** Processing line: ~ args.outputs.borders << box~ +** Processing line: ~ # Shows output of lines on the screen~ +** Processing line: ~ def lines_tech_demo~ +** Processing line: ~ outputs.labels << [5, 500, "Lines (x, y, x2, y2, r, g, b, a)"]~ +** Processing line: ~ outputs.lines << [5, 450, 100, 450]~ +** Processing line: ~ outputs.lines << [5, 430, 300, 430]~ +** Processing line: ~ outputs.lines << [5, 410, 300, 410, state.tick_count % 255, 0, 0, 255] # red saturation changes~ +** Processing line: ~ outputs.lines << [5, 390 - state.tick_count % 25, 300, 390, 0, 0, 0, 255] # y position changes~ +** Processing line: ~ outputs.lines << [5 + state.tick_count % 200, 360, 300, 360, 0, 0, 0, 255] # x position changes~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Saves the most recent click into args.state~ -** Processing line: ~ # Unlike the other components of args,~ -** Processing line: ~ # args.state does not reset every tick.~ -** Processing line: ~ if args.inputs.mouse.click~ -** Processing line: ~ args.state.last_mouse_click = args.inputs.mouse.click~ +** Processing line: ~ # Shows output of different kinds of solids on the screen~ +** Processing line: ~ def solids_tech_demo~ +** Processing line: ~ outputs.labels << [ 5, 350, "Solids (x, y, w, h, r, g, b, a)"]~ +** Processing line: ~ outputs.solids << [ 10, 270, 50, 50]~ +** Processing line: ~ outputs.solids << [ 70, 270, 50, 50, 0, 0, 0]~ +** Processing line: ~ outputs.solids << [130, 270, 50, 50, 255, 0, 0]~ +** Processing line: ~ outputs.solids << [190, 270, 50, 50, 255, 0, 0, 128]~ +** Processing line: ~ outputs.solids << [250, 270, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.state.last_mouse_click~ -** Processing line: ~ if args.state.last_mouse_click.point.inside_rect? box~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 16, "Mouse click happened *inside* the box.")~ -** Processing line: ~ else~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 16, "Mouse click happened *outside* the box.")~ -** Processing line: ~ end~ -** Processing line: ~ else~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 16, "Mouse click has not occurred yet.")~ +** Processing line: ~ # Shows output of different kinds of borders on the screen~ +** Processing line: ~ # The parameters for a border are the same as the parameters for a solid~ +** Processing line: ~ def borders_tech_demo~ +** Processing line: ~ outputs.labels << [ 5, 260, "Borders (x, y, w, h, r, g, b, a)"]~ +** Processing line: ~ outputs.borders << [ 10, 180, 50, 50]~ +** Processing line: ~ outputs.borders << [ 70, 180, 50, 50, 0, 0, 0]~ +** Processing line: ~ outputs.borders << [130, 180, 50, 50, 255, 0, 0]~ +** Processing line: ~ outputs.borders << [190, 180, 50, 50, 255, 0, 0, 128]~ +** Processing line: ~ outputs.borders << [250, 180, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes~ ** Processing line: ~ end~ -** 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: ~ # Shows output of different kinds of sprites on the screen~ +** Processing line: ~ def sprites_tech_demo~ +** Processing line: ~ outputs.labels << [ 5, 170, "Sprites (x, y, w, h, path, angle, a)"]~ +** Processing line: ~ outputs.sprites << [ 10, 40, 128, 101, 'dragonruby.png']~ +** Processing line: ~ outputs.sprites << [ 150, 40, 128, 101, 'dragonruby.png', state.tick_count % 360] # angle changes~ +** Processing line: ~ outputs.sprites << [ 300, 40, 128, 101, 'dragonruby.png', 0, state.tick_count % 255] # transparency changes~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def small_font~ -** Processing line: ~ [-2, 0, 0, 0, 0, 255]~ -** Processing line: ~ end~ +** Processing line: ~ # Holds size, alignment, color (black), and alpha (transparency) parameters~ +** Processing line: ~ # Using small_font as a parameter accounts for all remaining parameters~ +** Processing line: ~ # so they don't have to be repeatedly typed~ +** Processing line: ~ def small_font~ +** Processing line: ~ [-2, 0, 0, 0, 0, 255]~ +** 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: ~ end~ +** Processing line: ~ # Sets position of each row~ +** Processing line: ~ # Converts given row value to pixels that DragonRuby understands~ +** Processing line: ~ def row_to_px row_number~ ** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ +** Processing line: ~ # Row 0 starts 5 units below the top of the grid.~ +** Processing line: ~ # Each row afterward is 20 units lower.~ +** Processing line: ~ grid.top.shift_down(5).shift_down(20 * row_number)~ ** 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: ~ # Uses labels to output current game time (passage of time), and whether or not "h" was pressed~ +** Processing line: ~ # If "h" is pressed, the frame is output when the key_up event occurred~ +** Processing line: ~ def keyboards_tech_demo~ +** Processing line: ~ outputs.labels << [460, row_to_px(0), "Current game time: #{state.tick_count}", small_font]~ +** Processing line: ~ outputs.labels << [460, row_to_px(2), "Keyboard input: inputs.keyboard.key_up.h", small_font]~ +** Processing line: ~ outputs.labels << [460, row_to_px(3), "Press \"h\" on the keyboard.", small_font]~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ if inputs.keyboard.key_up.h # if "h" key_up event occurs~ +** Processing line: ~ state.h_pressed_at = state.tick_count # frame it occurred is stored~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # h_pressed_at is initially set to false, and changes once the user presses the "h" key.~ +** Processing line: ~ state.h_pressed_at ||= false~ ** Processing line: ~~ -** Processing line: ~* Input Basics - Mouse Rect To Rect - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Input Basics - Mouse Rect To Rect - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ if state.h_pressed_at # if h is pressed (pressed_at has a frame number and is no longer false)~ +** Processing line: ~ outputs.labels << [460, row_to_px(4), "\"h\" was pressed at time: #{state.h_pressed_at}", small_font]~ +** Processing line: ~ else # otherwise, label says "h" was never pressed~ +** Processing line: ~ outputs.labels << [460, row_to_px(4), "\"h\" has never been pressed.", small_font]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/02_input_basics/04_mouse_rect_to_rect/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # border around keyboard input demo section~ +** Processing line: ~ outputs.borders << [455, row_to_px(5), 360, row_to_px(2).shift_up(5) - row_to_px(5)]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ APIs that haven't been encountered in a previous sample apps:~ +** Processing line: ~ # Sets definition for a small label~ +** Processing line: ~ # Makes it easier to position labels in respect to the position of other labels~ +** Processing line: ~ def small_label x, row, message~ +** Processing line: ~ [x, row_to_px(row), message, small_font]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.borders: An array. Values in this array will be rendered as~ -** Processing line: ~ unfilled rectangles on the screen.~ -** Processing line: ~ - ARRAY#intersect_rect?: An array with at least four values is~ -** Processing line: ~ considered a rect. The intersect_rect? function returns true~ -** Processing line: ~ or false depending on if the two rectangles intersect.~ +** Processing line: ~ # Uses small labels to show whether the "a" button on the controller is down, held, or up.~ +** Processing line: ~ # y value of each small label is set by calling the row_to_px method~ +** Processing line: ~ def controller_tech_demo~ +** Processing line: ~ x = 460~ +** Processing line: ~ outputs.labels << small_label(x, 6, "Controller one input: inputs.controller_one")~ +** Processing line: ~ outputs.labels << small_label(x, 7, "Current state of the \"a\" button.")~ +** Processing line: ~ outputs.labels << small_label(x, 8, "Check console window for more info.")~ ** Processing line: ~~ -** Processing line: ~ ```~ -** Processing line: ~ # Rect One: x: 100, y: 100, w: 100, h: 100~ -** Processing line: ~ # Rect Two: x: 0, y: 0, w: 500, h: 500~ -** Processing line: ~ # Result: true~ +** Processing line: ~ if inputs.controller_one.key_down.a # if "a" is in "down" state~ +** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button down: #{inputs.controller_one.key_down.a}")~ +** Processing line: ~ puts "\"a\" button down at #{inputs.controller_one.key_down.a}" # prints frame the event occurred~ +** Processing line: ~ elsif inputs.controller_one.key_held.a # if "a" is held down~ +** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button held: #{inputs.controller_one.key_held.a}")~ +** Processing line: ~ elsif inputs.controller_one.key_up.a # if "a" is in up state~ +** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button up: #{inputs.controller_one.key_up.a}")~ +** Processing line: ~ puts "\"a\" key up at #{inputs.controller_one.key_up.a}"~ +** Processing line: ~ else # if no event has occurred~ +** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button state is nil.")~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ [100, 100, 100, 100].intersect_rect? [0, 0, 500, 500]~ -** Processing line: ~ ```~ +** Processing line: ~ # border around controller input demo section~ +** Processing line: ~ outputs.borders << [455, row_to_px(10), 360, row_to_px(6).shift_up(5) - row_to_px(10)]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ ```~ -** Processing line: ~ # Rect One: x: 100, y: 100, w: 10, h: 10~ -** Processing line: ~ # Rect Two: x: 500, y: 500, w: 10, h: 10~ -** Processing line: ~ # Result: false~ +** Processing line: ~ # Outputs when the mouse was clicked, as well as the coordinates on the screen~ +** Processing line: ~ # of where the click occurred~ +** Processing line: ~ def mouse_tech_demo~ +** Processing line: ~ x = 460~ ** Processing line: ~~ -** Processing line: ~ [100, 100, 10, 10].intersect_rect? [500, 500, 10, 10]~ -** Processing line: ~ ```~ +** Processing line: ~ outputs.labels << small_label(x, 11, "Mouse input: inputs.mouse")~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ if inputs.mouse.click # if click has a value and is not nil~ +** Processing line: ~ state.last_mouse_click = inputs.mouse.click # coordinates of click are stored~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Similarly, whether rects intersect can be found through~ -** Processing line: ~ # rect1.intersect_rect? rect2~ +** Processing line: ~ if state.last_mouse_click # if mouse is clicked (has coordinates as value)~ +** Processing line: ~ # outputs the time (frame) the click occurred, as well as how many frames have passed since the event~ +** Processing line: ~ outputs.labels << small_label(x, 12, "Mouse click happened at: #{state.last_mouse_click.created_at}, #{state.last_mouse_click.created_at_elapsed}")~ +** Processing line: ~ # outputs coordinates of click~ +** Processing line: ~ outputs.labels << small_label(x, 13, "Mouse click location: #{state.last_mouse_click.point.x}, #{state.last_mouse_click.point.y}")~ +** Processing line: ~ else # otherwise if the mouse has not been clicked~ +** Processing line: ~ outputs.labels << small_label(x, 12, "Mouse click has not occurred yet.")~ +** Processing line: ~ outputs.labels << small_label(x, 13, "Please click mouse.")~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ tick_instructions args, "Sample app shows how to determine if two rectangles intersect."~ -** Processing line: ~ x = 460~ +** Processing line: ~ # Outputs whether a mouse click occurred inside or outside of a box~ +** Processing line: ~ def point_to_rect_tech_demo~ +** Processing line: ~ x = 460~ ** Processing line: ~~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 3, "Click anywhere on the screen")~ -** Processing line: ~ # red_box = [460, 250, 355, 90, 170, 0, 0]~ -** Processing line: ~ # args.outputs.borders << red_box~ +** Processing line: ~ outputs.labels << small_label(x, 15, "Click inside the blue box maybe ---->")~ ** Processing line: ~~ -** Processing line: ~ # args.state.box_collision_one and args.state.box_collision_two~ -** Processing line: ~ # Are given values of a solid when they should be rendered~ -** 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: ~ 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: ~ box = [765, 370, 50, 50, 0, 0, 170] # blue box~ +** Processing line: ~ outputs.borders << box~ +** Processing line: ~~ +** Processing line: ~ if state.last_mouse_click # if the mouse was clicked~ +** Processing line: ~ if state.last_mouse_click.point.inside_rect? box # if mouse clicked inside box~ +** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click happened inside the box.")~ +** Processing line: ~ else # otherwise, if mouse was clicked outside the box~ +** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click happened outside the box.")~ +** Processing line: ~ end~ +** Processing line: ~ else # otherwise, if was not clicked at all~ +** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click has not occurred yet.") # output if the mouse was not clicked~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # border around mouse input demo section~ +** Processing line: ~ outputs.borders << [455, row_to_px(14), 360, row_to_px(11).shift_up(5) - row_to_px(14)]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Outputs a red box onto the screen. A mouse click from the user inside of the red box will output~ +** Processing line: ~ # a smaller box. If two small boxes are inside of the red box, it will be determined whether or not~ +** Processing line: ~ # they intersect.~ +** Processing line: ~ def rect_to_rect_tech_demo~ +** Processing line: ~ x = 460~ +** Processing line: ~~ +** Processing line: ~ outputs.labels << small_label(x, 17.5, "Click inside the red box below.") # label with instructions~ +** Processing line: ~ red_box = [460, 250, 355, 90, 170, 0, 0] # definition of the red box~ +** Processing line: ~ outputs.borders << red_box # output as a border (not filled in)~ +** Processing line: ~~ +** Processing line: ~ # If the mouse is clicked inside the red box, two collision boxes are created.~ +** Processing line: ~ if inputs.mouse.click~ +** Processing line: ~ if inputs.mouse.click.point.inside_rect? red_box~ +** Processing line: ~ if !state.box_collision_one # if the collision_one box does not yet have a definition~ +** Processing line: ~ # Subtracts 25 from the x and y positions of the click point in order to make the click point the center of the box.~ +** Processing line: ~ # You can try deleting the subtraction to see how it impacts the box placement.~ +** Processing line: ~ state.box_collision_one = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 180, 0, 0, 180] # sets definition~ +** Processing line: ~ elsif !state.box_collision_two # if collision_two does not yet have a definition~ +** Processing line: ~ state.box_collision_two = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 0, 0, 180, 180] # sets definition~ +** Processing line: ~ else~ +** Processing line: ~ state.box_collision_one = nil # both boxes are empty~ +** Processing line: ~ state.box_collision_two = nil~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # If collision boxes exist, they are output onto screen inside the red box as solids~ +** Processing line: ~ if state.box_collision_one~ +** Processing line: ~ outputs.solids << state.box_collision_one~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if state.box_collision_two~ +** Processing line: ~ outputs.solids << state.box_collision_two~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Outputs whether or not the two collision boxes intersect.~ +** Processing line: ~ if state.box_collision_one && state.box_collision_two # if both collision_boxes are defined (and not nil or empty)~ +** Processing line: ~ if state.box_collision_one.intersect_rect? state.box_collision_two # if the two boxes intersect~ +** Processing line: ~ outputs.labels << small_label(x, 23.5, 'The boxes intersect.')~ +** Processing line: ~ else # otherwise, if the two boxes do not intersect~ +** Processing line: ~ outputs.labels << small_label(x, 23.5, 'The boxes do not intersect.')~ +** Processing line: ~ end~ ** Processing line: ~ else~ -** Processing line: ~ args.state.box_collision_one = nil~ -** Processing line: ~ args.state.box_collision_two = nil~ +** Processing line: ~ outputs.labels << small_label(x, 23.5, '--') # if the two boxes are not defined (are nil or empty), this label is output~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.state.box_collision_one~ -** Processing line: ~ args.outputs.solids << args.state.box_collision_one~ +** Processing line: ~ # Creates a button and outputs it onto the screen using labels and borders.~ +** Processing line: ~ # If the button is clicked, the color changes to make it look faded.~ +** Processing line: ~ def button_tech_demo~ +** Processing line: ~ x, y, w, h = 460, 160, 300, 50~ +** Processing line: ~ state.button ||= state.new_entity(:button_with_fade)~ +** Processing line: ~~ +** Processing line: ~ # Adds w.half to x and h.half + 10 to y in order to display the text inside the button's borders.~ +** Processing line: ~ state.button.label ||= [x + w.half, y + h.half + 10, "click me and watch me fade", 0, 1]~ +** Processing line: ~ state.button.border ||= [x, y, w, h]~ +** Processing line: ~~ +** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.button.border) # if mouse is clicked, and clicked inside button's border~ +** Processing line: ~ state.button.clicked_at = inputs.mouse.click.created_at # stores the time the click occurred~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ outputs.labels << state.button.label~ +** Processing line: ~ outputs.borders << state.button.border~ +** Processing line: ~~ +** Processing line: ~ if state.button.clicked_at # if button was clicked (variable has a value and is not nil)~ +** Processing line: ~~ +** Processing line: ~ # The appearance of the button changes for 0.25 seconds after the time the button is clicked at.~ +** Processing line: ~ # The color changes (rgb is set to 0, 180, 80) and the transparency gradually changes.~ +** Processing line: ~ # Change 0.25 to 1.25 and notice that the transparency takes longer to return to normal.~ +** Processing line: ~ outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.button.clicked_at.ease(0.25.seconds, :flip)]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.state.box_collision_two~ -** Processing line: ~ args.outputs.solids << args.state.box_collision_two~ +** Processing line: ~ # Creates a new button by declaring it as a new entity, and sets values.~ +** Processing line: ~ def new_button_prefab x, y, message~ +** Processing line: ~ w, h = 300, 50~ +** Processing line: ~ button = state.new_entity(:button_with_fade)~ +** Processing line: ~ button.label = [x + w.half, y + h.half + 10, message, 0, 1] # '+ 10' keeps label's text within button's borders~ +** Processing line: ~ button.border = [x, y, w, h] # sets border definition~ +** Processing line: ~ button~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.state.box_collision_one && args.state.box_collision_two~ -** Processing line: ~ if args.state.box_collision_one.intersect_rect? args.state.box_collision_two~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 4, 'The boxes intersect.')~ -** Processing line: ~ else~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 4, 'The boxes do not intersect.')~ +** Processing line: ~ # If the mouse has been clicked and the click's location is inside of the button's border, that means~ +** Processing line: ~ # that the button has been clicked. This method returns a boolean value.~ +** Processing line: ~ def button_clicked? button~ +** Processing line: ~ inputs.mouse.click && inputs.mouse.click.point.inside_rect?(button.border)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Determines if button was clicked, and changes its appearance if it is clicked~ +** Processing line: ~ def tick_button_prefab button~ +** Processing line: ~ outputs.labels << button.label # outputs button's label and border~ +** Processing line: ~ outputs.borders << button.border~ +** Processing line: ~~ +** Processing line: ~ if button_clicked? button # if button is clicked~ +** Processing line: ~ button.clicked_at = inputs.mouse.click.created_at # stores the time that the button was clicked~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if button.clicked_at # if clicked_at has a frame value and is not nil~ +** Processing line: ~ # button is output; color changes and transparency changes for 0.25 seconds after click occurs~ +** Processing line: ~ outputs.solids << [button.border.x, button.border.y, button.border.w, button.border.h,~ +** Processing line: ~ 0, 180, 80, 255 * button.clicked_at.ease(0.25.seconds, :flip)] # transparency changes for 0.25 seconds~ ** Processing line: ~ end~ -** Processing line: ~ else~ -** Processing line: ~ args.outputs.labels << small_label(args, x, 4, '--')~ ** Processing line: ~ end~ -** 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: ~ # Exports the app's game state if the export button is clicked.~ +** Processing line: ~ def export_game_state_demo~ +** Processing line: ~ state.export_game_state_button ||= new_button_prefab(460, 100, "click to export app state")~ +** Processing line: ~ tick_button_prefab(state.export_game_state_button) # calls method to output button~ +** Processing line: ~ if button_clicked? state.export_game_state_button # if the export button is clicked~ +** Processing line: ~ args.gtk.export! "Exported from clicking the export button in the tech demo." # the export occurs~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def small_font~ -** Processing line: ~ [-2, 0, 0, 0, 0, 255]~ +** Processing line: ~ # The mouse and keyboard focus are set to "yes" when the Dragonruby window is the active window.~ +** Processing line: ~ def window_state_demo~ +** Processing line: ~ m = $gtk.args.inputs.mouse.has_focus ? 'Y' : 'N' # ternary operator (similar to if statement)~ +** Processing line: ~ k = $gtk.args.inputs.keyboard.has_focus ? 'Y' : 'N'~ +** Processing line: ~ outputs.labels << [460, 20, "mouse focus: #{m} keyboard focus: #{k}", small_font]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #Sets values for the horizontal separator (divides demo sections)~ +** Processing line: ~ def horizontal_seperator y, x, x2~ +** Processing line: ~ [x, y, x2, y, 150, 150, 150]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ #Sets the values for the vertical separator (divides demo sections)~ +** Processing line: ~ def vertical_seperator x, y, y2~ +** Processing line: ~ [x, y, x, y2, 150, 150, 150]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Outputs vertical and horizontal separators onto the screen to separate each demo section.~ +** Processing line: ~ def render_seperators~ +** Processing line: ~ outputs.lines << horizontal_seperator(505, grid.left, 445)~ +** Processing line: ~ outputs.lines << horizontal_seperator(353, grid.left, 445)~ +** Processing line: ~ outputs.lines << horizontal_seperator(264, grid.left, 445)~ +** Processing line: ~ outputs.lines << horizontal_seperator(174, grid.left, 445)~ +** Processing line: ~~ +** Processing line: ~ outputs.lines << vertical_seperator(445, grid.top, grid.bottom)~ +** Processing line: ~~ +** Processing line: ~ outputs.lines << horizontal_seperator(690, 445, 820)~ +** Processing line: ~ outputs.lines << horizontal_seperator(426, 445, 820)~ +** Processing line: ~~ +** Processing line: ~ outputs.lines << vertical_seperator(820, grid.top, grid.bottom)~ +** Processing line: ~ end~ ** 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: ~ $tech_demo = TechDemo.new~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ $tech_demo.inputs = args.inputs~ +** Processing line: ~ $tech_demo.state = args.state~ +** Processing line: ~ $tech_demo.grid = args.grid~ +** Processing line: ~ $tech_demo.args = args~ +** Processing line: ~ $tech_demo.outputs = args.render_target(:mini_map)~ +** Processing line: ~ $tech_demo.tick~ +** Processing line: ~ args.outputs.labels << [830, 715, "Render target:", [-2, 0, 0, 0, 0, 255]]~ +** Processing line: ~ args.outputs.sprites << [0, 0, 1280, 720, :mini_map]~ +** Processing line: ~ args.outputs.sprites << [830, 300, 675, 379, :mini_map]~ +** Processing line: ~ tick_instructions args, "Sample app shows all the rendering apis available."~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def tick_instructions args, text, y = 715~ @@ -125399,6881 +193959,10355 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Input Basics - Controller - main.rb~ -- H1 detected. +** Processing line: ~*** Advanced Rendering - Render Primitive Hierarchies - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Input Basics - Controller - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Rendering - Render Primitive Hierarchies - 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 - Render Primitive Hierarchies - 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/05_controller/app/main.rb~ +** Processing line: ~ # ./samples/07_advanced_rendering/04_render_primitive_hierarchies/app/main.rb~ ** Processing line: ~ =begin~ ** Processing line: ~~ ** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.controller_one.key_held.KEY: Will check to see if a specific key~ -** Processing line: ~ is being held down on the controller.~ -** Processing line: ~ If there is more than one controller being used, they can be differentiated by~ -** Processing line: ~ using names like controller_one and controller_two.~ -** Processing line: ~~ -** Processing line: ~ For a full listing of buttons, take a look at mygame/documentation/08-controllers.md.~ -** Processing line: ~~ -** Processing line: ~ Reminder:~ -** Processing line: ~~ -** Processing line: ~ - args.state.PROPERTY: The state property on args is a dynamic~ -** Processing line: ~ structure. You can define ANY property here with ANY type of~ -** Processing line: ~ arbitrary nesting. Properties defined on args.state will be retained~ -** Processing line: ~ across frames. If you attempt to access a property that doesn't exist~ -** Processing line: ~ on args.state, it will simply return nil (no exception will be thrown).~ +** Processing line: ~ - Nested array: An array whose individual elements are also arrays; useful for~ +** Processing line: ~ storing groups of similar data. Also called multidimensional arrays.~ ** Processing line: ~~ -** Processing line: ~ In this sample app, args.state.BUTTONS is an array that stores the buttons of the controller.~ -** Processing line: ~ The parameters of a button are:~ -** Processing line: ~ 1. the position (x, y)~ -** Processing line: ~ 2. the input key held on the controller~ -** Processing line: ~ 3. the text or name of the button~ +** Processing line: ~ In this sample app, we see nested arrays being used in object definitions.~ +** Processing line: ~ Notice the parameters for solids, listed below. Parameters 1-3 set the~ +** Processing line: ~ definition for the rect, and parameter 4 sets the definition of the color.~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ Instead of having a solid definition that looks like this,~ +** Processing line: ~ [X, Y, W, H, R, G, B]~ +** Processing line: ~ we can separate it into two separate array definitions in one, like this~ +** Processing line: ~ [[X, Y, W, H], [R, G, B]]~ +** Processing line: ~ and both options work fine in defining our solid (or any object).~ ** Processing line: ~~ -** Processing line: ~ # This sample app provides a visual demonstration of a standard controller, including~ -** Processing line: ~ # the placement and function of all buttons.~ +** Processing line: ~ - Collections: Lists of data; useful for organizing large amounts of data.~ +** Processing line: ~ One element of a collection could be an array (which itself contains many elements).~ +** Processing line: ~ For example, a collection that stores two solid objects would look like this:~ +** Processing line: ~ [~ +** Processing line: ~ [100, 100, 50, 50, 0, 0, 0],~ +** Processing line: ~ [100, 150, 50, 50, 255, 255, 255]~ +** Processing line: ~ ]~ +** Processing line: ~ If this collection was added to args.outputs.solids, two solids would be output~ +** Processing line: ~ next to each other, one black and one white.~ +** Processing line: ~ Nested arrays can be used in collections, as you will see in this sample app.~ ** Processing line: ~~ -** Processing line: ~ class ControllerDemo~ -** Processing line: ~ attr_accessor :inputs, :state, :outputs~ +** Processing line: ~ Reminders:~ ** Processing line: ~~ -** Processing line: ~ # Calls the methods necessary for the app to run successfully.~ -** Processing line: ~ def tick~ -** Processing line: ~ process_inputs~ -** Processing line: ~ render~ -** Processing line: ~ end~ +** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ +** Processing line: ~ The parameters for a solid are~ +** Processing line: ~ 1. The position on the screen (x, y)~ +** Processing line: ~ 2. The width (w)~ +** Processing line: ~ 3. The height (h)~ +** Processing line: ~ 4. The color (r, g, b) (if a color is not assigned, the object's default color will be black)~ +** Processing line: ~ NOTE: THE PARAMETERS ARE THE SAME FOR BORDERS!~ ** Processing line: ~~ -** Processing line: ~ # Starts with an empty collection of buttons.~ -** Processing line: ~ # Adds buttons that are on the controller to the collection.~ -** Processing line: ~ def process_inputs~ -** Processing line: ~ state.buttons = []~ +** Processing line: ~ Here is an example of a (red) border or solid definition:~ +** Processing line: ~ [100, 100, 400, 500, 255, 0, 0]~ +** Processing line: ~ It will be a solid or border depending on if it is added to args.outputs.solids or args.outputs.borders.~ +** Processing line: ~ For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md.~ ** 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: ~ - args.outputs.sprites: An array. The values generate a sprite.~ +** Processing line: ~ The parameters for sprites are~ +** Processing line: ~ 1. The position on the screen (x, y)~ +** Processing line: ~ 2. The width (w)~ +** Processing line: ~ 3. The height (h)~ +** Processing line: ~ 4. The image path (p)~ ** 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: ~ Here is an example of a sprite definition:~ +** Processing line: ~ [100, 100, 400, 500, 'sprites/dragonruby.png']~ +** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ ** 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: ~ =end~ ** 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: ~ # This code demonstrates the creation and output of objects like sprites, borders, and solids~ +** Processing line: ~ # If filled in, they are solids~ +** Processing line: ~ # If hollow, they are borders~ +** Processing line: ~ # If images, they are sprites~ ** 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: ~ # Solids are added to args.outputs.solids~ +** Processing line: ~ # Borders are added to args.outputs.borders~ +** Processing line: ~ # Sprites are added to args.outputs.sprites~ ** 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: ~ # The tick method runs 60 frames every second.~ +** Processing line: ~ # Your game is going to happen under this one function.~ +** Processing line: ~ def tick args~ +** Processing line: ~ border_as_solid_and_solid_as_border args~ +** Processing line: ~ sprite_as_border_or_solids args~ +** Processing line: ~ collection_of_borders_and_solids args~ +** Processing line: ~ collection_of_sprites args~ +** Processing line: ~ end~ ** 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: ~ end~ +** Processing line: ~ # Shows a border being output onto the screen as a border and a solid~ +** Processing line: ~ # Also shows how colors can be set~ +** Processing line: ~ def border_as_solid_and_solid_as_border args~ +** Processing line: ~ border = [0, 0, 50, 50]~ +** Processing line: ~ args.outputs.borders << border~ +** Processing line: ~ args.outputs.solids << border~ ** 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: ~ # Red, green, blue saturations (last three parameters) can be any number between 0 and 255~ +** Processing line: ~ border_with_color = [0, 100, 50, 50, 255, 0, 0]~ +** Processing line: ~ args.outputs.borders << border_with_color~ +** Processing line: ~ args.outputs.solids << border_with_color~ ** Processing line: ~~ -** Processing line: ~ if 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: ~ border_with_nested_color = [0, 200, 50, 50, [0, 255, 0]] # nested color~ +** Processing line: ~ args.outputs.borders << border_with_nested_color~ +** Processing line: ~ args.outputs.solids << border_with_nested_color~ ** 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: ~ end~ +** Processing line: ~ border_with_nested_rect = [[0, 300, 50, 50], 0, 0, 255] # nested rect~ +** Processing line: ~ args.outputs.borders << border_with_nested_rect~ +** Processing line: ~ args.outputs.solids << border_with_nested_rect~ ** 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: ~ end~ +** Processing line: ~ border_with_nested_color_and_rect = [[0, 400, 50, 50], [255, 0, 255]] # nested rect and color~ +** Processing line: ~ args.outputs.borders << border_with_nested_color_and_rect~ +** Processing line: ~ args.outputs.solids << border_with_nested_color_and_rect~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $controller_demo = ControllerDemo.new~ +** Processing line: ~ # Shows a sprite output onto the screen as a sprite, border, and solid~ +** Processing line: ~ # Demonstrates that all three outputs appear differently on screen~ +** Processing line: ~ def sprite_as_border_or_solids args~ +** Processing line: ~ sprite = [100, 0, 50, 50, 'sprites/ship.png']~ +** Processing line: ~ args.outputs.sprites << sprite~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ tick_instructions args, "Sample app shows how controller input is handled. You'll need to connect a USB controller."~ -** Processing line: ~ $controller_demo.inputs = args.inputs~ -** Processing line: ~ $controller_demo.state = args.state~ -** Processing line: ~ $controller_demo.outputs = args.outputs~ -** Processing line: ~ $controller_demo.tick~ -** Processing line: ~ end~ +** Processing line: ~ # Sprite_as_border variable has same parameters (excluding position) as above object,~ +** Processing line: ~ # but will appear differently on screen because it is added to args.outputs.borders~ +** Processing line: ~ sprite_as_border = [100, 100, 50, 50, 'sprites/ship.png']~ +** Processing line: ~ args.outputs.borders << sprite_as_border~ ** Processing line: ~~ -** Processing line: ~ # Resets the app.~ -** Processing line: ~ def r~ -** Processing line: ~ $gtk.reset~ +** Processing line: ~ # Sprite_as_solid variable has same parameters (excluding position) as above object,~ +** Processing line: ~ # but will appear differently on screen because it is added to args.outputs.solids~ +** Processing line: ~ sprite_as_solid = [100, 200, 50, 50, 'sprites/ship.png']~ +** Processing line: ~ args.outputs.solids << sprite_as_solid~ ** 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.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: ~ # Holds and outputs a collection of borders and a collection of solids~ +** Processing line: ~ # Collections are created by using arrays to hold parameters of each individual object~ +** Processing line: ~ def collection_of_borders_and_solids args~ +** Processing line: ~ collection_borders = [~ +** Processing line: ~ [~ +** Processing line: ~ [200, 0, 50, 50], # black border~ +** Processing line: ~ [200, 100, 50, 50, 255, 0, 0], # red border~ +** Processing line: ~ [200, 200, 50, 50, [0, 255, 0]], # nested color~ +** Processing line: ~ ],~ +** Processing line: ~ [[200, 300, 50, 50], 0, 0, 255], # nested rect~ +** Processing line: ~ [[200, 400, 50, 50], [255, 0, 255]] # nested rect and nested color~ +** Processing line: ~ ]~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ args.outputs.borders << collection_borders~ ** Processing line: ~~ +** Processing line: ~ collection_solids = [~ +** Processing line: ~ [~ +** Processing line: ~ [[300, 300, 50, 50], 0, 0, 255], # nested rect~ +** Processing line: ~ [[300, 400, 50, 50], [255, 0, 255]] # nested rect and nested color~ +** Processing line: ~ ],~ +** Processing line: ~ [300, 0, 50, 50],~ +** Processing line: ~ [300, 100, 50, 50, 255, 0, 0],~ +** Processing line: ~ [300, 200, 50, 50, [0, 255, 0]], # nested color~ +** Processing line: ~ ]~ ** Processing line: ~~ -** Processing line: ~* Input Basics - Touch - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Input Basics - Touch - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ args.outputs.solids << collection_solids~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/02_input_basics/06_touch/app/main.rb~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.background_color = [ 0, 0, 0 ]~ -** Processing line: ~ args.outputs.primitives << [640, 700, "Touch your screen.", 5, 1, 255, 255, 255].label~ +** Processing line: ~ # Holds and outputs a collection of sprites by adding it to args.outputs.sprites~ +** Processing line: ~ # Also outputs a collection with same parameters (excluding position) by adding~ +** Processing line: ~ # it to args.outputs.solids and another to args.outputs.borders~ +** Processing line: ~ def collection_of_sprites args~ +** Processing line: ~ sprites_collection = [~ +** Processing line: ~ [~ +** Processing line: ~ [400, 0, 50, 50, 'sprites/ship.png'],~ +** Processing line: ~ [400, 100, 50, 50, 'sprites/ship.png'],~ +** Processing line: ~ ],~ +** Processing line: ~ [400, 200, 50, 50, 'sprites/ship.png']~ +** Processing line: ~ ]~ ** Processing line: ~~ -** Processing line: ~ # If you don't want to get fancy, you can just look for finger_one~ -** Processing line: ~ # (and _two, if you like), which are assigned in the order new touches hit~ -** Processing line: ~ # the screen. If not nil, they are touching right now, and are just~ -** Processing line: ~ # references to specific items in the args.input.touch hash.~ -** Processing line: ~ # If finger_one lifts off, it will become nil, but finger_two, if it was~ -** Processing line: ~ # touching, remains until it also lifts off. When all fingers lift off, the~ -** 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: ~ 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: ~ end~ +** Processing line: ~ args.outputs.sprites << sprites_collection~ ** Processing line: ~~ -** Processing line: ~ # Here's the more flexible interface: this will report as many simultaneous~ -** Processing line: ~ # touches as the system can handle, but it's a little more effort to track~ -** Processing line: ~ # them. Each item in the args.input.touch hash has a unique key (an~ -** Processing line: ~ # incrementing integer) that exists until the finger lifts off. You can~ -** Processing line: ~ # tell which order the touches happened globally by the key value, or~ -** Processing line: ~ # by the touch[id].touch_order field, which resets to zero each time all~ -** Processing line: ~ # touches have lifted.~ +** Processing line: ~ args.outputs.solids << [~ +** Processing line: ~ [500, 0, 50, 50, 'sprites/ship.png'],~ +** Processing line: ~ [500, 100, 50, 50, 'sprites/ship.png'],~ +** Processing line: ~ [[[500, 200, 50, 50, 'sprites/ship.png']]]~ +** Processing line: ~ ]~ ** Processing line: ~~ -** Processing line: ~ args.state.colors ||= [~ -** Processing line: ~ 0xFF0000, 0x00FF00, 0x1010FF, 0xFFFF00, 0xFF00FF, 0x00FFFF, 0xFFFFFF~ +** Processing line: ~ args.outputs.borders << [~ +** Processing line: ~ [~ +** Processing line: ~ [600, 0, 50, 50, 'sprites/ship.png'],~ +** Processing line: ~ [600, 100, 50, 50, 'sprites/ship.png'],~ +** Processing line: ~ ],~ +** Processing line: ~ [600, 200, 50, 50, 'sprites/ship.png']~ ** Processing line: ~ ]~ -** Processing line: ~~ -** Processing line: ~ size = 100~ -** Processing line: ~ args.inputs.touch.each { |k,v|~ -** Processing line: ~ color = args.state.colors[v.touch_order % 7]~ -** 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: ~ }~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rendering Sprites - Animation Using Separate Pngs - main.rb~ -- H1 detected. +** Processing line: ~*** Advanced Rendering - Render Primitives As Hash - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rendering Sprites - Animation Using Separate Pngs - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Rendering - Render Primitives As Hash - 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 - Render Primitives As Hash - 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/03_rendering_sprites/01_animation_using_separate_pngs/app/main.rb~ +** Processing line: ~ # ./samples/07_advanced_rendering/05_render_primitives_as_hash/app/main.rb~ ** Processing line: ~ =begin~ ** Processing line: ~~ ** Processing line: ~ Reminders:~ ** Processing line: ~~ -** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ +** Processing line: ~ using their keys.~ ** Processing line: ~~ -** Processing line: ~ In this sample app, we're using string interpolation to iterate through images in the~ -** Processing line: ~ sprites folder using their image path names.~ +** Processing line: ~ For example, if we have a "numbers" hash that stores numbers in English as the~ +** Processing line: ~ key and numbers in Spanish as the value, we'd have a hash that looks like this...~ +** Processing line: ~ numbers = { "one" => "uno", "two" => "dos", "three" => "tres" }~ +** Processing line: ~ and on it goes.~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.sprites: An array. Values in this array generate sprites on the screen.~ -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, IMAGE PATH]~ +** Processing line: ~ Now if we wanted to find the corresponding value of the "one" key, we could say~ +** Processing line: ~ puts numbers["one"]~ +** Processing line: ~ which would print "uno" to the console.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE]~ ** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.labels: An array. Values in the array generate labels on the screen.~ +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ ** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ ** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.keyboard.key_down.KEY: Determines if a key is in the down state, or pressed.~ -** Processing line: ~ Stores the frame that key was pressed on.~ -** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ +** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ +** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.borders: An array. The values generate a border.~ +** Processing line: ~ The parameters are the same as a solid.~ +** Processing line: ~ For more information about borders, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.lines: An array. The values generate a line.~ +** Processing line: ~ The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE]~ +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ ** Processing line: ~~ ** Processing line: ~ =end~ ** Processing line: ~~ -** Processing line: ~ # This sample app demonstrates how sprite animations work.~ -** Processing line: ~ # There are two sprites that animate forever and one sprite~ -** Processing line: ~ # that *only* animates when you press the "f" key on the keyboard.~ +** Processing line: ~ # This sample app demonstrates how hashes can be used to output different kinds of objects.~ ** Processing line: ~~ -** Processing line: ~ # This is the entry point to your game. The `tick` method~ -** Processing line: ~ # executes at 60 frames per second. There are two methods~ -** 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: ~ looping_animation args~ -** Processing line: ~ one_time_animation args~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # This function shows how to animate a sprite that loops forever.~ -** Processing line: ~ def looping_animation args~ -** Processing line: ~ # Here we define a few local variables that will be sent~ -** Processing line: ~ # into the magic function that gives us the correct sprite image~ -** Processing line: ~ # over time. There are four things we need in order to figure~ -** Processing line: ~ # out which sprite to show.~ +** Processing line: ~ args.state.angle ||= 0 # initializes angle to 0~ +** Processing line: ~ args.state.angle += 1 # increments angle by 1 every frame (60 times a second)~ ** Processing line: ~~ -** Processing line: ~ # 1. When to start the animation.~ -** Processing line: ~ start_looping_at = 0~ +** Processing line: ~ # Outputs sprite using a hash~ +** Processing line: ~ args.outputs.sprites << {~ +** Processing line: ~ x: 30, # sprite position~ +** Processing line: ~ y: 550,~ +** Processing line: ~ w: 128, # sprite size~ +** Processing line: ~ h: 101,~ +** Processing line: ~ path: "dragonruby.png", # image path~ +** Processing line: ~ angle: args.state.angle, # angle~ +** Processing line: ~ a: 255, # alpha (transparency)~ +** Processing line: ~ r: 255, # color saturation~ +** Processing line: ~ g: 255,~ +** Processing line: ~ b: 255,~ +** Processing line: ~ tile_x: 0, # sprite sub division/tile~ +** Processing line: ~ tile_y: 0,~ +** Processing line: ~ tile_w: -1,~ +** Processing line: ~ tile_h: -1,~ +** Processing line: ~ flip_vertically: false, # don't flip sprite~ +** 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: ~ }~ ** Processing line: ~~ -** Processing line: ~ # 2. The number of pngs that represent the full animation.~ -** Processing line: ~ number_of_sprites = 6~ +** Processing line: ~ # Outputs label using a hash~ +** Processing line: ~ args.outputs.labels << {~ +** Processing line: ~ x: 200, # label position~ +** Processing line: ~ y: 550,~ +** Processing line: ~ text: "dragonruby", # label text~ +** Processing line: ~ size_enum: 2,~ +** Processing line: ~ alignment_enum: 1,~ +** Processing line: ~ r: 155, # color saturation~ +** Processing line: ~ g: 50,~ +** Processing line: ~ b: 50,~ +** Processing line: ~ a: 255, # transparency~ +** Processing line: ~ font: "fonts/manaspc.ttf" # font style; without mentioned file, label won't output correctly~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~ # 3. How long to show each png.~ -** Processing line: ~ number_of_frames_to_show_each_sprite = 4~ +** Processing line: ~ # Outputs solid using a hash~ +** Processing line: ~ # [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ +** Processing line: ~ args.outputs.solids << {~ +** Processing line: ~ x: 400, # position~ +** Processing line: ~ y: 550,~ +** Processing line: ~ w: 160, # size~ +** Processing line: ~ h: 90,~ +** Processing line: ~ r: 120, # color saturation~ +** Processing line: ~ g: 50,~ +** Processing line: ~ b: 50,~ +** Processing line: ~ a: 255 # transparency~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~ # 4. Whether the animation should loop once, or forever.~ -** Processing line: ~ does_sprite_loop = true~ +** Processing line: ~ # Outputs border using a hash~ +** Processing line: ~ # Same parameters as a solid~ +** Processing line: ~ args.outputs.borders << {~ +** Processing line: ~ x: 600,~ +** Processing line: ~ y: 550,~ +** Processing line: ~ w: 160,~ +** Processing line: ~ h: 90,~ +** Processing line: ~ r: 120,~ +** Processing line: ~ g: 50,~ +** Processing line: ~ b: 50,~ +** Processing line: ~ a: 255~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~ # With the variables defined above, we can get a number~ -** Processing line: ~ # which represents the sprite to show by calling the `frame_index` function.~ -** Processing line: ~ # In this case the number will be between 0, and 5 (you can see the sprites~ -** Processing line: ~ # in the ./sprites directory).~ -** Processing line: ~ sprite_index = start_looping_at.frame_index number_of_sprites,~ -** Processing line: ~ number_of_frames_to_show_each_sprite,~ -** Processing line: ~ does_sprite_loop~ +** Processing line: ~ # Outputs line using a hash~ +** Processing line: ~ args.outputs.lines << {~ +** Processing line: ~ x: 900, # starting position~ +** Processing line: ~ y: 550,~ +** Processing line: ~ x2: 1200, # ending position~ +** Processing line: ~ y2: 550,~ +** Processing line: ~ r: 120, # color saturation~ +** Processing line: ~ g: 50,~ +** Processing line: ~ b: 50,~ +** Processing line: ~ a: 255 # transparency~ +** Processing line: ~ }~ ** 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: ~ # Outputs sprite as a primitive using a hash~ +** Processing line: ~ args.outputs.primitives << {~ +** Processing line: ~ x: 30, # position~ +** Processing line: ~ y: 200,~ +** Processing line: ~ w: 128, # size~ +** Processing line: ~ h: 101,~ +** Processing line: ~ path: "dragonruby.png", # image path~ +** Processing line: ~ angle: args.state.angle, # angle~ +** Processing line: ~ a: 255, # transparency~ +** Processing line: ~ r: 255, # color saturation~ +** Processing line: ~ g: 255,~ +** Processing line: ~ b: 255,~ +** Processing line: ~ tile_x: 0, # sprite sub division/tile~ +** Processing line: ~ tile_y: 0,~ +** Processing line: ~ tile_w: -1,~ +** Processing line: ~ tile_h: -1,~ +** Processing line: ~ flip_vertically: false, # don't flip~ +** 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: ~~ -** 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: ~ end~ +** Processing line: ~ # Outputs label as primitive using a hash~ +** Processing line: ~ args.outputs.primitives << {~ +** Processing line: ~ x: 200, # position~ +** Processing line: ~ y: 200,~ +** Processing line: ~ text: "dragonruby", # text~ +** Processing line: ~ size: 2,~ +** Processing line: ~ alignment: 1,~ +** Processing line: ~ r: 155, # color saturation~ +** Processing line: ~ g: 50,~ +** Processing line: ~ b: 50,~ +** Processing line: ~ a: 255, # transparency~ +** Processing line: ~ font: "fonts/manaspc.ttf" # font style~ +** Processing line: ~ }.label~ ** 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: ~ # Outputs solid as primitive using a hash~ +** Processing line: ~ args.outputs.primitives << {~ +** Processing line: ~ x: 400, # position~ +** Processing line: ~ y: 200,~ +** Processing line: ~ w: 160, # size~ +** Processing line: ~ h: 90,~ +** Processing line: ~ r: 120, # color saturation~ +** Processing line: ~ g: 50,~ +** Processing line: ~ b: 50,~ +** Processing line: ~ a: 255 # transparency~ +** Processing line: ~ }.solid~ ** 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: ~ # Outputs border as primitive using a hash~ +** Processing line: ~ # Same parameters as solid~ +** Processing line: ~ args.outputs.primitives << {~ +** Processing line: ~ x: 600, # position~ +** Processing line: ~ y: 200,~ +** Processing line: ~ w: 160, # size~ +** Processing line: ~ h: 90,~ +** Processing line: ~ r: 120, # color saturation~ +** Processing line: ~ g: 50,~ +** Processing line: ~ b: 50,~ +** Processing line: ~ a: 255 # transparency~ +** Processing line: ~ }.border~ ** 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.~ +** Processing line: ~ # Outputs line as primitive using a hash~ +** Processing line: ~ args.outputs.primitives << {~ +** Processing line: ~ x: 900, # starting position~ +** Processing line: ~ y: 200,~ +** Processing line: ~ x2: 1200, # ending position~ +** Processing line: ~ y2: 200,~ +** Processing line: ~ r: 120, # color saturation~ +** Processing line: ~ g: 50,~ +** Processing line: ~ b: 50,~ +** Processing line: ~ a: 255 # transparency~ +** Processing line: ~ }.line~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Also IMPORTANT, you'll notice that the value of when to start looping~ -** Processing line: ~ # is stored in `args.state`. This construct's values are retained across~ -** Processing line: ~ # executions of the `tick` method.~ -** Processing line: ~ args.state.start_looping_at = args.state.tick_count~ -** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # These are the same local variables that were defined~ -** Processing line: ~ # for the `looping_animation` function.~ -** Processing line: ~ number_of_sprites = 6~ -** Processing line: ~ number_of_frames_to_show_each_sprite = 4~ ** Processing line: ~~ -** Processing line: ~ # Except this sprite does not loop again. If the animation time has passed,~ -** Processing line: ~ # then the frame_index function returns nil.~ -** Processing line: ~ does_sprite_loop = false~ +** Processing line: ~*** Advanced Rendering - Pixel Arrays - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Rendering - Pixel Arrays - 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 - Pixel Arrays - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ sprite_index = args.state~ -** Processing line: ~ .start_looping_at~ -** Processing line: ~ .frame_index number_of_sprites,~ -** Processing line: ~ number_of_frames_to_show_each_sprite,~ -** Processing line: ~ does_sprite_loop~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/07_advanced_rendering/06_pixel_arrays/app/main.rb~ +** Processing line: ~ $gtk.reset~ ** Processing line: ~~ -** Processing line: ~ # This line sets the frame index to zero, if~ -** Processing line: ~ # the animation duration has passed (frame_index returned nil).~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.posinc ||= 1~ +** Processing line: ~ args.state.pos ||= 0~ +** Processing line: ~ args.state.rotation ||= 0~ ** Processing line: ~~ -** Processing line: ~ # Remeber: we are not looping forever here.~ -** Processing line: ~ sprite_index ||= 0~ +** Processing line: ~ dimension = 10 # keep it small and let the GPU scale it when rendering the sprite.~ ** Processing line: ~~ -** Processing line: ~ # Present the sprite.~ -** Processing line: ~ args.outputs.sprites << [100, 300, 100, 100, "sprites/dragon_fly_#{sprite_index}.png"]~ +** Processing line: ~ # Set up our "scanner" pixel array and fill it with black pixels.~ +** Processing line: ~ args.pixel_array(:scanner).width = dimension~ +** Processing line: ~ args.pixel_array(:scanner).height = dimension~ +** Processing line: ~ args.pixel_array(:scanner).pixels.fill(0xFF000000, 0, dimension * dimension) # black, full alpha~ ** 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~ +** Processing line: ~ # Draw a green line that bounces up and down the sprite.~ +** Processing line: ~ args.pixel_array(:scanner).pixels.fill(0xFF00FF00, dimension * args.state.pos, dimension) # green, full alpha~ ** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ +** Processing line: ~ # Adjust position for next frame.~ +** Processing line: ~ args.state.pos += args.state.posinc~ +** Processing line: ~ if args.state.posinc > 0 && args.state.pos >= dimension~ +** Processing line: ~ args.state.posinc = -1~ +** Processing line: ~ args.state.pos = dimension - 1~ +** Processing line: ~ elsif args.state.posinc < 0 && args.state.pos < 0~ +** Processing line: ~ args.state.posinc = 1~ +** Processing line: ~ args.state.pos = 1~ ** 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: ~ # New/changed pixel arrays get uploaded to the GPU before we render~ +** Processing line: ~ # anything. At that point, they can be scaled, rotated, and otherwise~ +** Processing line: ~ # used like any other sprite.~ +** Processing line: ~ w = 100~ +** Processing line: ~ h = 100~ +** Processing line: ~ x = (1280 - w) / 2~ +** Processing line: ~ y = (720 - h) / 2~ +** Processing line: ~ args.outputs.background_color = [64, 0, 128]~ +** Processing line: ~ args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite~ +** Processing line: ~ args.state.rotation += 1~ +** Processing line: ~~ +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rendering Sprites - Animation Using Sprite Sheet - main.rb~ -- H1 detected. +** Processing line: ~*** Advanced Rendering - Splitscreen Camera - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rendering Sprites - Animation Using Sprite Sheet - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Rendering - Splitscreen 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 - Splitscreen 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/03_rendering_sprites/02_animation_using_sprite_sheet/app/main.rb~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.player.x ||= 100~ -** Processing line: ~ args.state.player.y ||= 100~ -** Processing line: ~ args.state.player.w ||= 64~ -** Processing line: ~ args.state.player.h ||= 64~ -** Processing line: ~ args.state.player.direction ||= 1~ -** Processing line: ~~ -** Processing line: ~ args.state.player.is_moving = false~ +** Processing line: ~ # ./samples/07_advanced_rendering/07_splitscreen_camera/app/main.rb~ +** Processing line: ~ class CameraMovement~ +** Processing line: ~ attr_accessor :state, :inputs, :outputs, :grid~ ** Processing line: ~~ -** Processing line: ~ # get the keyboard input and set player properties~ -** Processing line: ~ if args.inputs.keyboard.right~ -** Processing line: ~ args.state.player.x += 3~ -** Processing line: ~ args.state.player.direction = 1~ -** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ -** Processing line: ~ elsif args.inputs.keyboard.left~ -** Processing line: ~ args.state.player.x -= 3~ -** Processing line: ~ args.state.player.direction = -1~ -** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ #==============================================================================================~ +** Processing line: ~ #Serialize~ +** Processing line: ~ def serialize~ +** Processing line: ~ {state: state, inputs: inputs, outputs: outputs, grid: grid }~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.inputs.keyboard.up~ -** Processing line: ~ args.state.player.y += 1~ -** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ -** Processing line: ~ elsif args.inputs.keyboard.down~ -** Processing line: ~ args.state.player.y -= 1~ -** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ def inspect~ +** Processing line: ~ serialize.to_s~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # if no arrow keys are being pressed, set the player as not moving~ -** Processing line: ~ if !args.inputs.keyboard.directional_vector~ -** Processing line: ~ args.state.player.started_running_at = nil~ +** Processing line: ~ def to_s~ +** Processing line: ~ serialize.to_s~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # wrap player around the stage~ -** Processing line: ~ if args.state.player.x > 1280~ -** Processing line: ~ args.state.player.x = -64~ -** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ -** Processing line: ~ elsif args.state.player.x < -64~ -** Processing line: ~ args.state.player.x = 1280~ -** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ #==============================================================================================~ +** Processing line: ~ #Tick~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ calc~ +** Processing line: ~ render~ +** Processing line: ~ input~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.state.player.y > 720~ -** Processing line: ~ args.state.player.y = -64~ -** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ -** Processing line: ~ elsif args.state.player.y < -64~ -** Processing line: ~ args.state.player.y = 720~ -** Processing line: ~ args.state.player.started_running_at ||= args.state.tick_count~ +** Processing line: ~ #==============================================================================================~ +** Processing line: ~ #Default functions~ +** Processing line: ~ def defaults~ +** Processing line: ~ outputs[:scene].background_color = [0,0,0]~ +** Processing line: ~ state.trauma ||= 0.0~ +** Processing line: ~ state.trauma_power ||= 2~ +** Processing line: ~ state.player_cyan ||= new_player_cyan~ +** Processing line: ~ state.player_magenta ||= new_player_magenta~ +** Processing line: ~ state.camera_magenta ||= new_camera_magenta~ +** Processing line: ~ state.camera_cyan ||= new_camera_cyan~ +** Processing line: ~ state.camera_center ||= new_camera_center~ +** Processing line: ~ state.room ||= new_room~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # render player as standing or running~ -** Processing line: ~ if args.state.player.started_running_at~ -** Processing line: ~ args.outputs.sprites << running_sprite(args)~ -** Processing line: ~ else~ -** Processing line: ~ args.outputs.sprites << standing_sprite(args)~ +** Processing line: ~ def default_player x, y, w, h, sprite_path~ +** Processing line: ~ state.new_entity(:player,~ +** Processing line: ~ { x: x,~ +** Processing line: ~ y: y,~ +** Processing line: ~ dy: 0,~ +** Processing line: ~ dx: 0,~ +** Processing line: ~ w: w,~ +** Processing line: ~ h: h,~ +** Processing line: ~ damage: 0,~ +** Processing line: ~ dead: false,~ +** Processing line: ~ orientation: "down",~ +** Processing line: ~ max_alpha: 255,~ +** Processing line: ~ sprite_path: sprite_path})~ ** Processing line: ~ end~ -** Processing line: ~ args.outputs.labels << [30, 700, "Use arrow keys to move around."]~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ def standing_sprite args~ -** Processing line: ~ {~ -** Processing line: ~ 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/horizontal-stand.png",~ -** Processing line: ~ flip_horizontally: args.state.player.direction > 0~ -** Processing line: ~ }~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def running_sprite args~ -** Processing line: ~ if !args.state.player.started_running_at~ -** Processing line: ~ tile_index = 0~ -** Processing line: ~ else~ -** Processing line: ~ how_many_frames_in_sprite_sheet = 6~ -** Processing line: ~ how_many_ticks_to_hold_each_frame = 3~ -** Processing line: ~ should_the_index_repeat = true~ -** Processing line: ~ tile_index = args.state~ -** Processing line: ~ .player~ -** Processing line: ~ .started_running_at~ -** Processing line: ~ .frame_index(how_many_frames_in_sprite_sheet,~ -** Processing line: ~ how_many_ticks_to_hold_each_frame,~ -** Processing line: ~ should_the_index_repeat)~ +** Processing line: ~ def default_floor_tile x, y, w, h, sprite_path~ +** Processing line: ~ state.new_entity(:room,~ +** Processing line: ~ { x: x,~ +** Processing line: ~ y: y,~ +** Processing line: ~ w: w,~ +** Processing line: ~ h: h,~ +** Processing line: ~ sprite_path: sprite_path})~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ {~ -** Processing line: ~ 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/horizontal-run.png',~ -** Processing line: ~ tile_x: 0 + (tile_index * args.state.player.w),~ -** Processing line: ~ tile_y: 0,~ -** Processing line: ~ tile_w: args.state.player.w,~ -** Processing line: ~ tile_h: args.state.player.h,~ -** Processing line: ~ flip_horizontally: args.state.player.direction > 0,~ -** Processing line: ~ }~ -** Processing line: ~ end~ +** Processing line: ~ def default_camera x, y, w, h~ +** Processing line: ~ state.new_entity(:camera,~ +** Processing line: ~ { x: x,~ +** Processing line: ~ y: y,~ +** Processing line: ~ dx: 0,~ +** Processing line: ~ dy: 0,~ +** Processing line: ~ w: w,~ +** Processing line: ~ h: h})~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def new_player_cyan~ +** Processing line: ~ default_player(0, 0, 64, 64,~ +** Processing line: ~ "sprites/player/player_#{state.player_cyan.orientation}_standing.png")~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def new_player_magenta~ +** Processing line: ~ default_player(64, 0, 64, 64,~ +** Processing line: ~ "sprites/player/player_#{state.player_magenta.orientation}_standing.png")~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Rendering Sprites - Animation States - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rendering Sprites - Animation States - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def new_camera_magenta~ +** Processing line: ~ default_camera(0,0,720,720)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/03_rendering_sprites/03_animation_states/app/main.rb~ -** Processing line: ~ class Game~ -** Processing line: ~ attr_gtk~ +** Processing line: ~ def new_camera_cyan~ +** Processing line: ~ default_camera(0,0,720,720)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def defaults~ -** Processing line: ~ state.show_debug_layer = true if state.tick_count == 0~ -** Processing line: ~ player.tile_size = 64~ -** Processing line: ~ player.speed = 3~ -** Processing line: ~ player.slash_frames = 15~ -** Processing line: ~ player.x ||= 50~ -** Processing line: ~ player.y ||= 400~ -** Processing line: ~ player.dir_x ||= 1~ -** Processing line: ~ player.dir_y ||= -1~ -** Processing line: ~ player.is_moving ||= false~ -** Processing line: ~ state.watch_list ||= {}~ -** Processing line: ~ state.enemies ||= []~ +** Processing line: ~ def new_camera_center~ +** Processing line: ~ default_camera(0,0,1280,720)~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def add_enemy~ -** Processing line: ~ state.enemies << { x: 1200 * rand, y: 600 * rand, w: 64, h: 64 }~ +** Processing line: ~ def new_room~ +** Processing line: ~ default_floor_tile(0,0,1024,1024,'sprites/rooms/camera_room.png')~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def sprite_horizontal_run~ -** Processing line: ~ tile_index = 0.frame_index(6, 3, true)~ -** Processing line: ~ tile_index = 0 if !player.is_moving~ +** Processing line: ~ #==============================================================================================~ +** Processing line: ~ #Calculation functions~ +** Processing line: ~ def calc~ +** Processing line: ~ calc_camera_magenta~ +** Processing line: ~ calc_camera_cyan~ +** Processing line: ~ calc_camera_center~ +** Processing line: ~ calc_player_cyan~ +** Processing line: ~ calc_player_magenta~ +** Processing line: ~ calc_trauma_decay~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ {~ -** Processing line: ~ x: player.x,~ -** Processing line: ~ y: player.y,~ -** Processing line: ~ w: player.tile_size,~ -** Processing line: ~ h: player.tile_size,~ -** Processing line: ~ path: 'sprites/horizontal-run.png',~ -** Processing line: ~ tile_x: 0 + (tile_index * player.tile_size),~ -** Processing line: ~ tile_y: 0,~ -** Processing line: ~ tile_w: player.tile_size,~ -** Processing line: ~ tile_h: player.tile_size,~ -** Processing line: ~ flip_horizontally: player.dir_x > 0,~ -** Processing line: ~ # a: 40~ -** Processing line: ~ }~ +** Processing line: ~ def center_camera_tolerance~ +** Processing line: ~ return Math.sqrt(((state.player_magenta.x - state.player_cyan.x) ** 2) +~ +** Processing line: ~ ((state.player_magenta.y - state.player_cyan.y) ** 2)) > 640~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def sprite_horizontal_stand~ -** Processing line: ~ {~ -** Processing line: ~ x: player.x,~ -** Processing line: ~ y: player.y,~ -** Processing line: ~ w: player.tile_size,~ -** Processing line: ~ h: player.tile_size,~ -** Processing line: ~ path: 'sprites/horizontal-stand.png',~ -** Processing line: ~ flip_horizontally: player.dir_x > 0,~ -** Processing line: ~ # a: 40~ -** Processing line: ~ }~ +** Processing line: ~ def calc_player_cyan~ +** Processing line: ~ state.player_cyan.x += state.player_cyan.dx~ +** Processing line: ~ state.player_cyan.y += state.player_cyan.dy~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def sprite_horizontal_slash~ -** Processing line: ~ tile_index = player.slash_at.frame_index(5, player.slash_frames.idiv(5), false) || 0~ +** Processing line: ~ def calc_player_magenta~ +** Processing line: ~ state.player_magenta.x += state.player_magenta.dx~ +** Processing line: ~ state.player_magenta.y += state.player_magenta.dy~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ {~ -** Processing line: ~ x: player.x - 41.25,~ -** Processing line: ~ y: player.y - 41.25,~ -** Processing line: ~ w: 165,~ -** Processing line: ~ h: 165,~ -** Processing line: ~ path: 'sprites/horizontal-slash.png',~ -** Processing line: ~ tile_x: 0 + (tile_index * 128),~ -** Processing line: ~ tile_y: 0,~ -** Processing line: ~ tile_w: 128,~ -** Processing line: ~ tile_h: 128,~ -** Processing line: ~ flip_horizontally: player.dir_x > 0~ -** Processing line: ~ }~ +** Processing line: ~ def calc_camera_center~ +** Processing line: ~ timeScale = 1~ +** Processing line: ~ midX = (state.player_magenta.x + state.player_cyan.x)/2~ +** Processing line: ~ midY = (state.player_magenta.y + state.player_cyan.y)/2~ +** Processing line: ~ targetX = midX - state.camera_center.w/2~ +** Processing line: ~ targetY = midY - state.camera_center.h/2~ +** Processing line: ~ state.camera_center.x += (targetX - state.camera_center.x) * 0.1 * timeScale~ +** Processing line: ~ state.camera_center.y += (targetY - state.camera_center.y) * 0.1 * timeScale~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def render_player~ -** Processing line: ~ if player.slash_at~ -** Processing line: ~ outputs.sprites << sprite_horizontal_slash~ -** Processing line: ~ elsif player.is_moving~ -** Processing line: ~ outputs.sprites << sprite_horizontal_run~ -** Processing line: ~ else~ -** Processing line: ~ outputs.sprites << sprite_horizontal_stand~ -** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def calc_camera_magenta~ +** Processing line: ~ timeScale = 1~ +** Processing line: ~ targetX = state.player_magenta.x + state.player_magenta.w - state.camera_magenta.w/2~ +** Processing line: ~ targetY = state.player_magenta.y + state.player_magenta.h - state.camera_magenta.h/2~ +** Processing line: ~ state.camera_magenta.x += (targetX - state.camera_magenta.x) * 0.1 * timeScale~ +** Processing line: ~ state.camera_magenta.y += (targetY - state.camera_magenta.y) * 0.1 * timeScale~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def render_enemies~ -** Processing line: ~ outputs.borders << state.enemies~ +** Processing line: ~ def calc_camera_cyan~ +** Processing line: ~ timeScale = 1~ +** Processing line: ~ targetX = state.player_cyan.x + state.player_cyan.w - state.camera_cyan.w/2~ +** Processing line: ~ targetY = state.player_cyan.y + state.player_cyan.h - state.camera_cyan.h/2~ +** Processing line: ~ state.camera_cyan.x += (targetX - state.camera_cyan.x) * 0.1 * timeScale~ +** Processing line: ~ state.camera_cyan.y += (targetY - state.camera_cyan.y) * 0.1 * timeScale~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def render_debug_layer~ -** Processing line: ~ return if !state.show_debug_layer~ -** Processing line: ~ outputs.labels << state.watch_list.map.with_index do |(k, v), i|~ -** Processing line: ~ [30, 710 - i * 28, "#{k}: #{v || "(nil)"}"]~ +** Processing line: ~ def calc_player_quadrant angle~ +** Processing line: ~ if angle < 45 and angle > -45 and state.player_cyan.x < state.player_magenta.x~ +** Processing line: ~ return 1~ +** Processing line: ~ elsif angle < 45 and angle > -45 and state.player_cyan.x > state.player_magenta.x~ +** Processing line: ~ return 3~ +** Processing line: ~ elsif (angle > 45 or angle < -45) and state.player_cyan.y < state.player_magenta.y~ +** Processing line: ~ return 2~ +** Processing line: ~ elsif (angle > 45 or angle < -45) and state.player_cyan.y > state.player_magenta.y~ +** Processing line: ~ return 4~ ** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ outputs.borders << player.slash_collision_rect~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def slash_initiate?~ -** Processing line: ~ # buffalo usb controller has a button and b button swapped lol~ -** Processing line: ~ inputs.controller_one.key_down.a || inputs.keyboard.key_down.j~ +** Processing line: ~ def calc_camera_shake~ +** Processing line: ~ state.trauma~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def input~ -** Processing line: ~ # player movement~ -** Processing line: ~ if slash_complete? && (vector = inputs.directional_vector)~ -** Processing line: ~ player.x += vector.x * player.speed~ -** Processing line: ~ player.y += vector.y * player.speed~ -** Processing line: ~ end~ -** Processing line: ~ player.slash_at = slash_initiate? if slash_initiate?~ +** Processing line: ~ def calc_trauma_decay~ +** Processing line: ~ state.trauma = state.trauma * 0.9~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def calc_movement~ -** Processing line: ~ # movement~ -** Processing line: ~ if vector = inputs.directional_vector~ -** Processing line: ~ state.debug_label = vector~ -** Processing line: ~ player.dir_x = vector.x~ -** Processing line: ~ player.dir_y = vector.y~ -** Processing line: ~ player.is_moving = true~ -** Processing line: ~ else~ -** Processing line: ~ state.debug_label = vector~ -** Processing line: ~ player.is_moving = false~ -** Processing line: ~ end~ +** Processing line: ~ def calc_random_float_range(min, max)~ +** Processing line: ~ rand * (max-min) + min~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def calc_slash~ -** Processing line: ~ # re-calc the location of the swords collision box~ -** Processing line: ~ if player.dir_x.positive?~ -** Processing line: ~ player.slash_collision_rect = [player.x + player.tile_size,~ -** Processing line: ~ player.y + player.tile_size.half - 10,~ -** Processing line: ~ 40, 20]~ +** Processing line: ~ #==============================================================================================~ +** Processing line: ~ #Render Functions~ +** Processing line: ~ def render~ +** Processing line: ~ render_floor~ +** Processing line: ~ render_player_cyan~ +** Processing line: ~ render_player_magenta~ +** Processing line: ~ if center_camera_tolerance~ +** Processing line: ~ render_split_camera_scene~ ** Processing line: ~ else~ -** Processing line: ~ player.slash_collision_rect = [player.x - 32 - 8,~ -** Processing line: ~ player.y + player.tile_size.half - 10,~ -** Processing line: ~ 40, 20]~ +** Processing line: ~ render_camera_center_scene~ ** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # recalc sword's slash state~ -** Processing line: ~ player.slash_at = nil if slash_complete?~ -** Processing line: ~~ -** Processing line: ~ # determine collision if the sword is at it's point of damaging~ -** Processing line: ~ return unless slash_can_damage?~ -** Processing line: ~~ -** Processing line: ~ state.enemies.reject! { |e| e.intersect_rect? player.slash_collision_rect }~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def slash_complete?~ -** Processing line: ~ !player.slash_at || player.slash_at.elapsed?(player.slash_frames)~ +** Processing line: ~ def render_player_cyan~ +** Processing line: ~ outputs[:scene].sprites << {x: state.player_cyan.x,~ +** Processing line: ~ y: state.player_cyan.y,~ +** Processing line: ~ w: state.player_cyan.w,~ +** Processing line: ~ h: state.player_cyan.h,~ +** Processing line: ~ path: "sprites/player/player_#{state.player_cyan.orientation}_standing.png",~ +** Processing line: ~ r: 0,~ +** Processing line: ~ g: 255,~ +** Processing line: ~ b: 255}~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def slash_can_damage?~ -** Processing line: ~ # damage occurs half way into the slash animation~ -** Processing line: ~ return false if slash_complete?~ -** Processing line: ~ return false if (player.slash_at + player.slash_frames.idiv(2)) != state.tick_count~ -** Processing line: ~ return true~ +** Processing line: ~ def render_player_magenta~ +** Processing line: ~ outputs[:scene].sprites << {x: state.player_magenta.x,~ +** Processing line: ~ y: state.player_magenta.y,~ +** Processing line: ~ w: state.player_magenta.w,~ +** Processing line: ~ h: state.player_magenta.h,~ +** Processing line: ~ path: "sprites/player/player_#{state.player_magenta.orientation}_standing.png",~ +** Processing line: ~ r: 255,~ +** Processing line: ~ g: 0,~ +** Processing line: ~ b: 255}~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def calc~ -** Processing line: ~ # generate an enemy if there aren't any on the screen~ -** Processing line: ~ add_enemy if state.enemies.length == 0~ -** Processing line: ~ calc_movement~ -** Processing line: ~ calc_slash~ +** Processing line: ~ def render_floor~ +** Processing line: ~ outputs[:scene].sprites << [state.room.x, state.room.y,~ +** Processing line: ~ state.room.w, state.room.h,~ +** Processing line: ~ state.room.sprite_path]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # source is at http://github.com/amirrajan/dragonruby-link-to-the-past~ -** Processing line: ~ def tick~ -** Processing line: ~ defaults~ -** Processing line: ~ render_enemies~ -** Processing line: ~ render_player~ -** Processing line: ~ outputs.labels << [30, 30, "Gamepad: D-Pad to move. B button to attack."]~ -** Processing line: ~ outputs.labels << [30, 52, "Keyboard: WASD/Arrow keys to move. J to attack."]~ -** Processing line: ~ render_debug_layer~ -** Processing line: ~ input~ -** Processing line: ~ calc~ -** Processing line: ~ end~ +** Processing line: ~ def render_camera_center_scene~ +** Processing line: ~ zoomFactor = 1~ +** Processing line: ~ outputs[:scene].width = state.room.w~ +** Processing line: ~ outputs[:scene].height = state.room.h~ ** Processing line: ~~ -** Processing line: ~ def player~ -** Processing line: ~ state.player~ +** Processing line: ~ maxAngle = 10.0~ +** Processing line: ~ maxOffset = 20.0~ +** Processing line: ~ angle = maxAngle * calc_camera_shake * calc_random_float_range(-1,1)~ +** Processing line: ~ offsetX = 32 - (maxOffset * calc_camera_shake * calc_random_float_range(-1,1))~ +** Processing line: ~ offsetY = 32 - (maxOffset * calc_camera_shake * calc_random_float_range(-1,1))~ +** Processing line: ~~ +** Processing line: ~ outputs.sprites << {x: (-state.camera_center.x - offsetX)/zoomFactor,~ +** Processing line: ~ y: (-state.camera_center.y - offsetY)/zoomFactor,~ +** Processing line: ~ w: outputs[:scene].width/zoomFactor,~ +** Processing line: ~ h: outputs[:scene].height/zoomFactor,~ +** Processing line: ~ path: :scene,~ +** Processing line: ~ angle: angle,~ +** Processing line: ~ source_w: -1,~ +** Processing line: ~ source_h: -1}~ +** Processing line: ~ outputs.labels << [128,64,"#{state.trauma.round(1)}",8,2,255,0,255,255]~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $game = Game.new~ +** Processing line: ~ def render_split_camera_scene~ +** Processing line: ~ outputs[:scene].width = state.room.w~ +** Processing line: ~ outputs[:scene].height = state.room.h~ +** Processing line: ~ render_camera_magenta_scene~ +** Processing line: ~ render_camera_cyan_scene~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ $game.args = args~ -** Processing line: ~ $game.tick~ -** Processing line: ~ end~ +** Processing line: ~ angle = Math.atan((state.player_magenta.y - state.player_cyan.y)/(state.player_magenta.x- state.player_cyan.x)) * 180/Math::PI~ +** Processing line: ~ output_split_camera angle~ ** Processing line: ~~ -** Processing line: ~ $gtk.reset~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def render_camera_magenta_scene~ +** Processing line: ~ zoomFactor = 1~ +** Processing line: ~ offsetX = 32~ +** Processing line: ~ offsetY = 32~ ** Processing line: ~~ +** Processing line: ~ outputs[:scene_magenta].sprites << {x: (-state.camera_magenta.x*2),~ +** Processing line: ~ y: (-state.camera_magenta.y),~ +** Processing line: ~ w: outputs[:scene].width*2,~ +** Processing line: ~ h: outputs[:scene].height,~ +** Processing line: ~ path: :scene}~ ** Processing line: ~~ -** Processing line: ~* Rendering Sprites - Color And Rotation - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rendering Sprites - Color And Rotation - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/03_rendering_sprites/04_color_and_rotation/app/main.rb~ -** Processing line: ~ =begin~ -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~ def render_camera_cyan_scene~ +** Processing line: ~ zoomFactor = 1~ +** Processing line: ~ offsetX = 32~ +** Processing line: ~ offsetY = 32~ +** Processing line: ~ outputs[:scene_cyan].sprites << {x: (-state.camera_cyan.x*2),~ +** Processing line: ~ y: (-state.camera_cyan.y),~ +** Processing line: ~ w: outputs[:scene].width*2,~ +** Processing line: ~ h: outputs[:scene].height,~ +** Processing line: ~ path: :scene}~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - merge: Returns a hash containing the contents of two original hashes.~ -** Processing line: ~ Merge does not allow duplicate keys, so the value of a repeated key~ -** Processing line: ~ will be overwritten.~ +** Processing line: ~ def output_split_camera angle~ +** Processing line: ~ #TODO: Clean this up!~ +** Processing line: ~ quadrant = calc_player_quadrant angle~ +** Processing line: ~ outputs.labels << [128,64,"#{quadrant}",8,2,255,0,255,255]~ +** Processing line: ~ if quadrant == 1~ +** Processing line: ~ set_camera_attributes(w: 640, h: 720, m_x: 640, m_y: 0, c_x: 0, c_y: 0)~ ** Processing line: ~~ -** Processing line: ~ For example, if we had two hashes~ -** Processing line: ~ h1 = { "a" => 1, "b" => 2}~ -** Processing line: ~ h2 = { "b" => 3, "c" => 3}~ -** Processing line: ~ and we called the command~ -** Processing line: ~ h1.merge(h2)~ -** Processing line: ~ the result would the following hash~ -** Processing line: ~ { "a" => 1, "b" => 3, "c" => 3}.~ +** Processing line: ~ elsif quadrant == 2~ +** Processing line: ~ set_camera_attributes(w: 1280, h: 360, m_x: 0, m_y: 360, c_x: 0, c_y: 0)~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ +** Processing line: ~ elsif quadrant == 3~ +** Processing line: ~ set_camera_attributes(w: 640, h: 720, m_x: 0, m_y: 0, c_x: 640, c_y: 0)~ ** Processing line: ~~ -** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ -** Processing line: ~ using their keys.~ -** Processing line: ~ In this sample app, we're using a hash to create a sprite.~ +** Processing line: ~ elsif quadrant == 4~ +** Processing line: ~ set_camera_attributes(w: 1280, h: 360, m_x: 0, m_y: 0, c_x: 0, c_y: 360)~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE]~ -** Processing line: ~ Before continuing with this sample app, it is HIGHLY recommended that you look~ -** Processing line: ~ at mygame/documentation/05-sprites.md.~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.keyboard.key_held.KEY: Determines if a key is being pressed.~ -** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ +** Processing line: ~ def set_camera_attributes(w: 0, h: 0, m_x: 0, m_y: 0, c_x: 0, c_y: 0)~ +** Processing line: ~ state.camera_cyan.w = w + 64~ +** Processing line: ~ state.camera_cyan.h = h + 64~ +** Processing line: ~ outputs[:scene_cyan].width = (w) * 2~ +** Processing line: ~ outputs[:scene_cyan].height = h~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.controller_one: Takes input from the controller based on what key is pressed.~ -** Processing line: ~ For more information about the controller, go to mygame/documentation/08-controllers.md.~ +** Processing line: ~ state.camera_magenta.w = w + 64~ +** Processing line: ~ state.camera_magenta.h = h + 64~ +** Processing line: ~ outputs[:scene_magenta].width = (w) * 2~ +** Processing line: ~ outputs[:scene_magenta].height = h~ +** Processing line: ~ outputs.sprites << {x: m_x,~ +** Processing line: ~ y: m_y,~ +** Processing line: ~ w: w,~ +** Processing line: ~ h: h,~ +** Processing line: ~ path: :scene_magenta}~ +** Processing line: ~ outputs.sprites << {x: c_x,~ +** Processing line: ~ y: c_y,~ +** Processing line: ~ w: w,~ +** Processing line: ~ h: h,~ +** Processing line: ~ path: :scene_cyan}~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - num1.lesser(num2): Finds the lower value of the given options.~ +** Processing line: ~ def add_trauma amount~ +** Processing line: ~ state.trauma = [state.trauma + amount, 1.0].min~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ def remove_trauma amount~ +** Processing line: ~ state.trauma = [state.trauma - amount, 0.0].max~ +** Processing line: ~ end~ +** Processing line: ~ #==============================================================================================~ +** Processing line: ~ #Input functions~ +** Processing line: ~ def input~ +** Processing line: ~ input_move_cyan~ +** Processing line: ~ input_move_magenta~ ** Processing line: ~~ -** Processing line: ~ # This sample app shows a car moving across the screen. It loops back around if it exceeds the dimensions of the screen,~ -** Processing line: ~ # and also can be moved in different directions through keyboard input from the user.~ +** Processing line: ~ if inputs.keyboard.key_down.t~ +** Processing line: ~ add_trauma(0.5)~ +** Processing line: ~ elsif inputs.keyboard.key_down.y~ +** Processing line: ~ remove_trauma(0.1)~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calls the methods necessary for the game to run successfully.~ -** Processing line: ~ def tick args~ -** Processing line: ~ default args~ -** Processing line: ~ render args.grid, args.outputs, args.state~ -** Processing line: ~ calc args.state~ -** Processing line: ~ process_inputs args~ -** Processing line: ~ end~ +** Processing line: ~ def input_move_cyan~ +** Processing line: ~ if inputs.keyboard.key_held.up~ +** Processing line: ~ state.player_cyan.dy = 5~ +** Processing line: ~ state.player_cyan.orientation = "up"~ +** Processing line: ~ elsif inputs.keyboard.key_held.down~ +** Processing line: ~ state.player_cyan.dy = -5~ +** Processing line: ~ state.player_cyan.orientation = "down"~ +** Processing line: ~ else~ +** Processing line: ~ state.player_cyan.dy *= 0.8~ +** Processing line: ~ end~ +** Processing line: ~ if inputs.keyboard.key_held.left~ +** Processing line: ~ state.player_cyan.dx = -5~ +** Processing line: ~ state.player_cyan.orientation = "left"~ +** Processing line: ~ elsif inputs.keyboard.key_held.right~ +** Processing line: ~ state.player_cyan.dx = 5~ +** Processing line: ~ state.player_cyan.orientation = "right"~ +** Processing line: ~ else~ +** Processing line: ~ state.player_cyan.dx *= 0.8~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets default values for the car sprite~ -** Processing line: ~ # Initialization ||= only happens in the first frame~ -** Processing line: ~ def default args~ -** Processing line: ~ args.state.sprite.width = 19~ -** Processing line: ~ args.state.sprite.height = 10~ -** Processing line: ~ args.state.sprite.scale = 4~ -** Processing line: ~ args.state.max_speed = 5~ -** Processing line: ~ args.state.x ||= 100~ -** Processing line: ~ args.state.y ||= 100~ -** Processing line: ~ args.state.speed ||= 1~ -** Processing line: ~ args.state.angle ||= 0~ -** Processing line: ~ end~ +** Processing line: ~ outputs.labels << [128,512,"#{state.player_cyan.x.round()}",8,2,0,255,255,255]~ +** Processing line: ~ outputs.labels << [128,480,"#{state.player_cyan.y.round()}",8,2,0,255,255,255]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs sprite onto screen~ -** Processing line: ~ def render grid, outputs, state~ -** Processing line: ~ outputs.solids << [grid.rect, 70, 70, 70] # outputs gray background~ -** Processing line: ~ outputs.sprites << [destination_rect(state), # sets first four parameters of car sprite~ -** Processing line: ~ 'sprites/86.png', # image path of car~ -** Processing line: ~ state.angle,~ -** Processing line: ~ opacity, # transparency~ -** Processing line: ~ saturation,~ -** Processing line: ~ source_rect(state), # sprite sub division/tile (tile x, y, w, h)~ -** Processing line: ~ false, false, # don't flip sprites~ -** Processing line: ~ rotation_anchor]~ +** Processing line: ~ def input_move_magenta~ +** Processing line: ~ if inputs.keyboard.key_held.w~ +** Processing line: ~ state.player_magenta.dy = 5~ +** Processing line: ~ state.player_magenta.orientation = "up"~ +** Processing line: ~ elsif inputs.keyboard.key_held.s~ +** Processing line: ~ state.player_magenta.dy = -5~ +** Processing line: ~ state.player_magenta.orientation = "down"~ +** Processing line: ~ else~ +** Processing line: ~ state.player_magenta.dy *= 0.8~ +** Processing line: ~ end~ +** Processing line: ~ if inputs.keyboard.key_held.a~ +** Processing line: ~ state.player_magenta.dx = -5~ +** Processing line: ~ state.player_magenta.orientation = "left"~ +** Processing line: ~ elsif inputs.keyboard.key_held.d~ +** Processing line: ~ state.player_magenta.dx = 5~ +** Processing line: ~ state.player_magenta.orientation = "right"~ +** Processing line: ~ else~ +** Processing line: ~ state.player_magenta.dx *= 0.8~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # also look at the create_sprite helper method~ -** Processing line: ~ #~ -** Processing line: ~ # For example:~ -** Processing line: ~ #~ -** Processing line: ~ # dest = destination_rect(state)~ -** Processing line: ~ # source = source_rect(state),~ -** Processing line: ~ # outputs.sprites << create_sprite(~ -** Processing line: ~ # 'sprites/86.png',~ -** Processing line: ~ # x: dest.x,~ -** Processing line: ~ # y: dest.y,~ -** Processing line: ~ # w: dest.w,~ -** Processing line: ~ # h: dest.h,~ -** Processing line: ~ # angle: state.angle,~ -** Processing line: ~ # source_x: source.x,~ -** Processing line: ~ # source_y: source.y,~ -** Processing line: ~ # source_w: source.w,~ -** Processing line: ~ # source_h: source.h,~ -** Processing line: ~ # flip_h: false,~ -** Processing line: ~ # flip_v: false,~ -** Processing line: ~ # rotation_anchor_x: 0.7,~ -** Processing line: ~ # rotation_anchor_y: 0.5~ -** Processing line: ~ # )~ +** Processing line: ~ outputs.labels << [128,360,"#{state.player_magenta.x.round()}",8,2,255,0,255,255]~ +** Processing line: ~ outputs.labels << [128,328,"#{state.player_magenta.y.round()}",8,2,255,0,255,255]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Creates sprite by setting values inside of a hash~ -** Processing line: ~ def create_sprite path, options = {}~ -** Processing line: ~ options = {~ -** Processing line: ~~ -** Processing line: ~ # dest x, y, w, h~ -** Processing line: ~ x: 0,~ -** Processing line: ~ y: 0,~ -** Processing line: ~ w: 100,~ -** Processing line: ~ h: 100,~ +** Processing line: ~ $camera_movement = CameraMovement.new~ ** Processing line: ~~ -** Processing line: ~ # angle, rotation~ -** Processing line: ~ angle: 0,~ -** Processing line: ~ rotation_anchor_x: 0.5,~ -** Processing line: ~ rotation_anchor_y: 0.5,~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.background_color = [0,0,0]~ +** Processing line: ~ $camera_movement.inputs = args.inputs~ +** Processing line: ~ $camera_movement.outputs = args.outputs~ +** Processing line: ~ $camera_movement.state = args.state~ +** Processing line: ~ $camera_movement.grid = args.grid~ +** Processing line: ~ $camera_movement.tick~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # color saturation (red, green, blue), transparency~ -** Processing line: ~ r: 255,~ -** Processing line: ~ g: 255,~ -** Processing line: ~ b: 255,~ -** Processing line: ~ a: 255,~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # source x, y, width, height~ -** Processing line: ~ source_x: 0,~ -** Processing line: ~ source_y: 0,~ -** Processing line: ~ source_w: -1,~ -** Processing line: ~ source_h: -1,~ ** Processing line: ~~ -** Processing line: ~ # flip horiztonally, flip vertically~ -** Processing line: ~ flip_h: false,~ -** Processing line: ~ flip_v: false,~ +** Processing line: ~*** Advanced Rendering - Z Targeting Camera - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Rendering - Z Targeting 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 - Z Targeting Camera - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ }.merge options~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/07_advanced_rendering/08_z_targeting_camera/app/main.rb~ +** Processing line: ~ class Game~ +** Processing line: ~ attr_gtk~ ** Processing line: ~~ -** Processing line: ~ [~ -** Processing line: ~ options[:x], options[:y], options[:w], options[:h], # dest rect keys~ -** Processing line: ~ path,~ -** Processing line: ~ options[:angle], options[:a], options[:r], options[:g], options[:b], # angle, color, alpha~ -** Processing line: ~ options[:source_x], options[:source_y], options[:source_w], options[:source_h], # source rect keys~ -** Processing line: ~ options[:flip_h], options[:flip_v], # flip~ -** Processing line: ~ options[:rotation_anchor_x], options[:rotation_anchor_y], # rotation anchor~ -** Processing line: ~ ] # hash keys contain corresponding values~ -** Processing line: ~ end~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ render~ +** Processing line: ~ input~ +** Processing line: ~ calc~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calls the calc_pos and calc_wrap methods.~ -** Processing line: ~ def calc state~ -** Processing line: ~ calc_pos state~ -** Processing line: ~ calc_wrap state~ -** Processing line: ~ end~ +** Processing line: ~ def defaults~ +** Processing line: ~ outputs.background_color = [219, 208, 191]~ +** Processing line: ~ player.x ||= 634~ +** Processing line: ~ player.y ||= 153~ +** Processing line: ~ player.angle ||= 90~ +** Processing line: ~ player.distance ||= arena_radius~ +** Processing line: ~ target.x ||= 634~ +** Processing line: ~ target.y ||= 359~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Changes sprite's position on screen~ -** Processing line: ~ # Vectors have magnitude and direction, so the incremented x and y values give the car direction~ -** Processing line: ~ def calc_pos state~ -** Processing line: ~ state.x += state.angle.vector_x * state.speed # increments x by product of angle's x vector and speed~ -** Processing line: ~ state.y += state.angle.vector_y * state.speed # increments y by product of angle's y vector and speed~ -** Processing line: ~ state.speed *= 1.1 # scales speed up~ -** Processing line: ~ state.speed = state.speed.lesser(state.max_speed) # speed is either current speed or max speed, whichever has a lesser value (ensures that the car doesn't go too fast or exceed the max speed)~ -** Processing line: ~ end~ +** Processing line: ~ def render~ +** Processing line: ~ outputs[:scene].sprites << ([0, 0, 933, 700, 'sprites/arena.png'].center_inside_rect grid.rect)~ +** Processing line: ~ outputs[:scene].sprites << target_sprite~ +** Processing line: ~ outputs[:scene].sprites << player_sprite~ +** Processing line: ~ outputs.sprites << scene~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The screen's dimensions are 1280x720. If the car goes out of scope,~ -** Processing line: ~ # it loops back around on the screen.~ -** Processing line: ~ def calc_wrap state~ +** Processing line: ~ def target_sprite~ +** Processing line: ~ {~ +** Processing line: ~ x: target.x, y: target.y,~ +** Processing line: ~ w: 10, h: 10,~ +** Processing line: ~ path: 'sprites/square/black.png'~ +** Processing line: ~ }.anchor_rect 0.5, 0.5~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # car returns to left side of screen if it disappears on right side of screen~ -** Processing line: ~ # sprite.width refers to tile's size, which is multipled by scale (4) to make it bigger~ -** Processing line: ~ state.x = -state.sprite.width * state.sprite.scale if state.x - 20 > 1280~ +** Processing line: ~ def input~ +** Processing line: ~ if inputs.up && player.distance > 30~ +** Processing line: ~ player.distance -= 2~ +** Processing line: ~ elsif inputs.down && player.distance < 200~ +** Processing line: ~ player.distance += 2~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # car wraps around to right side of screen if it disappears on the left side~ -** Processing line: ~ state.x = 1280 if state.x + state.sprite.width * state.sprite.scale + 20 < 0~ +** Processing line: ~ player.angle += inputs.left_right * -1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # car wraps around to bottom of screen if it disappears at the top of the screen~ -** Processing line: ~ # if you subtract 520 pixels instead of 20 pixels, the car takes longer to reappear (try it!)~ -** Processing line: ~ state.y = 0 if state.y - 20 > 720 # if 20 pixels less than car's y position is greater than vertical scope~ +** Processing line: ~ def calc~ +** Processing line: ~ player.x = target.x + ((player.angle * 1).vector_x player.distance)~ +** Processing line: ~ player.y = target.y + ((player.angle * -1).vector_y player.distance)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # car wraps around to top of screen if it disappears at the bottom of the screen~ -** Processing line: ~ state.y = 720 if state.y + state.sprite.height * state.sprite.scale + 20 < 0~ -** Processing line: ~ end~ +** Processing line: ~ def player_sprite~ +** Processing line: ~ {~ +** Processing line: ~ x: player.x,~ +** Processing line: ~ y: player.y,~ +** Processing line: ~ w: 50,~ +** Processing line: ~ h: 100,~ +** Processing line: ~ path: 'sprites/player.png',~ +** Processing line: ~ angle: (player.angle * -1) + 90~ +** Processing line: ~ }.anchor_rect 0.5, 0~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Changes angle of sprite based on user input from keyboard or controller~ -** Processing line: ~ def process_inputs args~ +** Processing line: ~ def center_map~ +** Processing line: ~ { x: 634, y: 359 }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # NOTE: increasing the angle doesn't mean that the car will continue to go~ -** Processing line: ~ # in a specific direction. The angle is increasing, which means that if the~ -** Processing line: ~ # left key was kept in the "down" state, the change in the angle would cause~ -** Processing line: ~ # the car to go in a counter-clockwise direction and form a circle (360 degrees)~ -** Processing line: ~ if args.inputs.keyboard.key_held.left # if left key is pressed~ -** Processing line: ~ args.state.angle += 2 # car's angle is incremented by 2~ +** Processing line: ~ def zoom_factor_single~ +** Processing line: ~ 2 - ((args.geometry.distance player, center_map).fdiv arena_radius)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The same applies to decreasing the angle. If the right key was kept in the~ -** Processing line: ~ # "down" state, the decreasing angle would cause the car to go in a clockwise~ -** Processing line: ~ # direction and form a circle (360 degrees)~ -** Processing line: ~ elsif args.inputs.keyboard.key_held.right # if right key is pressed~ -** Processing line: ~ args.state.angle -= 2 # car's angle is decremented by 2~ +** Processing line: ~ def zoom_factor~ +** Processing line: ~ zoom_factor_single ** 2~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Input from a controller can also change the angle of the car~ -** Processing line: ~ elsif args.inputs.controller_one.left_analog_x_perc != 0~ -** Processing line: ~ args.state.angle += 2 * args.inputs.controller_one.left_analog_x_perc * -1~ +** Processing line: ~ def arena_radius~ +** Processing line: ~ 206~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # A sprite's center of rotation can be altered~ -** Processing line: ~ # Increasing either of these numbers would dramatically increase the~ -** Processing line: ~ # car's drift when it turns!~ -** Processing line: ~ def rotation_anchor~ -** Processing line: ~ [0.7, 0.5]~ -** Processing line: ~ end~ +** Processing line: ~ def scene~ +** Processing line: ~ {~ +** Processing line: ~ x: (640 - player.x) + (640 - (640 * zoom_factor)),~ +** Processing line: ~ y: (360 - player.y - (75 * zoom_factor)) + (320 - (320 * zoom_factor)),~ +** Processing line: ~ w: 1280 * zoom_factor,~ +** Processing line: ~ h: 720 * zoom_factor,~ +** Processing line: ~ path: :scene,~ +** Processing line: ~ angle: player.angle - 90,~ +** Processing line: ~ angle_anchor_x: (player.x.fdiv 1280),~ +** Processing line: ~ angle_anchor_y: (player.y.fdiv 720)~ +** Processing line: ~ }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets opacity value of sprite to 255 so that it is not transparent at all~ -** Processing line: ~ # Change it to 0 and you won't be able to see the car sprite on the screen~ -** Processing line: ~ def opacity~ -** Processing line: ~ 255~ -** Processing line: ~ end~ +** Processing line: ~ def player~ +** Processing line: ~ state.player~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the color of the sprite to white.~ -** Processing line: ~ def saturation~ -** Processing line: ~ [255, 255, 255]~ +** Processing line: ~ def target~ +** Processing line: ~ state.target~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets definition of destination_rect (used to define the car sprite)~ -** Processing line: ~ def destination_rect state~ -** Processing line: ~ [state.x, state.y,~ -** Processing line: ~ state.sprite.width * state.sprite.scale, # multiplies by 4 to set size~ -** Processing line: ~ state.sprite.height * state.sprite.scale]~ +** 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: ~ # Portion of a sprite (a tile)~ -** Processing line: ~ # Sub division of sprite is denoted as a rectangle directly related to original size of .png~ -** Processing line: ~ # Tile is located at bottom left corner within a 19x10 pixel rectangle (based on sprite.width, sprite.height)~ -** Processing line: ~ def source_rect state~ -** Processing line: ~ [0, 0, state.sprite.width, state.sprite.height]~ -** Processing line: ~ end~ +** Processing line: ~ $gtk.reset~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Physics And Collisions - Simple - main.rb~ -- H1 detected. +** Processing line: ~*** Tweening Lerping Easing Functions - Easing Functions - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Physics And Collisions - Simple - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Tweening Lerping Easing Functions - Easing Functions - 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: ~Tweening Lerping Easing Functions - Easing Functions - 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/04_physics_and_collisions/01_simple/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # ./samples/08_tweening_lerping_easing_functions/01_easing_functions/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ # STOP! Watch the following presentation first!!!!~ +** Processing line: ~ # Math for Game Programmers: Fast and Funky 1D Nonlinear Transformations~ +** Processing line: ~ # https://www.youtube.com/watch?v=mr5xkf6zSzk~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ -** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect.~ +** Processing line: ~ # You've watched the talk, yes? YES???~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ +** Processing line: ~ # define starting and ending points of properties to animate~ +** Processing line: ~ args.state.target_x = 1180~ +** Processing line: ~ args.state.target_y = 620~ +** Processing line: ~ args.state.target_w = 100~ +** Processing line: ~ args.state.target_h = 100~ +** Processing line: ~ args.state.starting_x = 0~ +** Processing line: ~ args.state.starting_y = 0~ +** Processing line: ~ args.state.starting_w = 300~ +** Processing line: ~ args.state.starting_h = 300~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ # define start time and duration of animation~ +** Processing line: ~ args.state.start_animate_at = 3.seconds # this is the same as writing 60 * 5 (or 300)~ +** Processing line: ~ args.state.duration = 2.seconds # this is the same as writing 60 * 2 (or 120)~ ** Processing line: ~~ -** Processing line: ~ # This sample app shows collisions between two boxes.~ +** Processing line: ~ # define type of animations~ +** Processing line: ~ # Here are all the options you have for values you can put in the array:~ +** Processing line: ~ # :identity, :quad, :cube, :quart, :quint, :flip~ ** Processing line: ~~ -** Processing line: ~ # Runs methods needed for game to run properly.~ -** Processing line: ~ def tick args~ -** Processing line: ~ tick_instructions args, "Sample app shows how to move a square over time and determine collision."~ -** Processing line: ~ defaults args~ -** Processing line: ~ render args~ -** Processing line: ~ calc args~ -** Processing line: ~ end~ +** Processing line: ~ # Linear is defined as:~ +** Processing line: ~ # [:identity]~ +** Processing line: ~ #~ +** Processing line: ~ # Smooth start variations are:~ +** Processing line: ~ # [:quad]~ +** Processing line: ~ # [:cube]~ +** Processing line: ~ # [:quart]~ +** Processing line: ~ # [:quint]~ ** Processing line: ~~ -** Processing line: ~ # Sets default values.~ -** Processing line: ~ def defaults args~ -** Processing line: ~ # These values represent the moving box.~ -** Processing line: ~ args.state.moving_box_speed = 10~ -** Processing line: ~ args.state.moving_box_size = 100~ -** Processing line: ~ args.state.moving_box_dx ||= 1~ -** Processing line: ~ args.state.moving_box_dy ||= 1~ -** Processing line: ~ args.state.moving_box ||= [0, 0, args.state.moving_box_size, args.state.moving_box_size] # moving_box_size is set as the width and height~ +** Processing line: ~ # Linear reversed, and smooth stop are the same as the animations defined above, but reversed:~ +** Processing line: ~ # [:flip, :identity]~ +** Processing line: ~ # [:flip, :quad, :flip]~ +** Processing line: ~ # [:flip, :cube, :flip]~ +** Processing line: ~ # [:flip, :quart, :flip]~ +** Processing line: ~ # [:flip, :quint, :flip]~ ** Processing line: ~~ -** Processing line: ~ # These values represent the center box.~ -** Processing line: ~ args.state.center_box ||= [540, 260, 200, 200, 180]~ -** Processing line: ~ args.state.center_box_collision ||= false # initially no collision~ -** Processing line: ~ end~ +** Processing line: ~ # You can also do custom definitions. See the bottom of the file details~ +** Processing line: ~ # on how to do that. I've defined a couple for you:~ +** Processing line: ~ # [:smoothest_start]~ +** Processing line: ~ # [:smoothest_stop]~ ** Processing line: ~~ -** Processing line: ~ def render args~ -** Processing line: ~ # If the game state denotes that a collision has occured,~ -** Processing line: ~ # render a solid square, otherwise render a border instead.~ -** Processing line: ~ if args.state.center_box_collision~ -** Processing line: ~ args.outputs.solids << args.state.center_box~ -** Processing line: ~ else~ -** Processing line: ~ args.outputs.borders << args.state.center_box~ -** Processing line: ~ end~ +** Processing line: ~ # CHANGE THIS LINE TO ONE OF THE LINES ABOVE TO SEE VARIATIONS~ +** Processing line: ~ args.state.animation_type = [:identity]~ +** Processing line: ~ # args.state.animation_type = [:quad]~ +** Processing line: ~ # args.state.animation_type = [:cube]~ +** Processing line: ~ # args.state.animation_type = [:quart]~ +** Processing line: ~ # args.state.animation_type = [:quint]~ +** Processing line: ~ # args.state.animation_type = [:flip, :identity]~ +** Processing line: ~ # args.state.animation_type = [:flip, :quad, :flip]~ +** Processing line: ~ # args.state.animation_type = [:flip, :cube, :flip]~ +** Processing line: ~ # args.state.animation_type = [:flip, :quart, :flip]~ +** Processing line: ~ # args.state.animation_type = [:flip, :quint, :flip]~ +** Processing line: ~ # args.state.animation_type = [:smoothest_start]~ +** Processing line: ~ # args.state.animation_type = [:smoothest_stop]~ ** Processing line: ~~ -** Processing line: ~ # Then render the moving box.~ -** Processing line: ~ args.outputs.solids << args.state.moving_box~ -** Processing line: ~ end~ +** Processing line: ~ # THIS IS WHERE THE MAGIC HAPPENS!~ +** Processing line: ~ # Numeric#ease~ +** Processing line: ~ progress = args.state.start_animate_at.ease(args.state.duration, args.state.animation_type)~ ** Processing line: ~~ -** Processing line: ~ # Generally in a pipeline for a game engine, you have rendering,~ -** Processing line: ~ # game simulation (calculation), and input processing.~ -** Processing line: ~ # This fuction represents the game simulation.~ -** Processing line: ~ def calc args~ -** Processing line: ~ position_moving_box args~ -** Processing line: ~ determine_collision_center_box args~ +** Processing line: ~ # Numeric#ease needs to called:~ +** Processing line: ~ # 1. On the number that represents the point in time you want to start, and takes two parameters:~ +** Processing line: ~ # a. The first parameter is how long the animation should take.~ +** Processing line: ~ # b. The second parameter represents the functions that need to be called.~ +** Processing line: ~ #~ +** Processing line: ~ # For example, if I wanted an animate to start 3 seconds in, and last for 10 seconds,~ +** Processing line: ~ # and I want to animation to start fast and end slow, I would do:~ +** Processing line: ~ # (60 * 3).ease(60 * 10, :flip, :quint, :flip)~ +** Processing line: ~~ +** Processing line: ~ # initial value delta to the final value~ +** Processing line: ~ calc_x = args.state.starting_x + (args.state.target_x - args.state.starting_x) * progress~ +** Processing line: ~ calc_y = args.state.starting_y + (args.state.target_y - args.state.starting_y) * progress~ +** Processing line: ~ calc_w = args.state.starting_w + (args.state.target_w - args.state.starting_w) * progress~ +** Processing line: ~ calc_h = args.state.starting_h + (args.state.target_h - args.state.starting_h) * progress~ +** Processing line: ~~ +** Processing line: ~ args.outputs.solids << [calc_x, calc_y, calc_w, calc_h, 0, 0, 0]~ +** Processing line: ~~ +** Processing line: ~ # count down~ +** Processing line: ~ count_down = args.state.start_animate_at - args.state.tick_count~ +** Processing line: ~ if count_down > 0~ +** Processing line: ~ args.outputs.labels << [640, 375, "Running: #{args.state.animation_type} in...", 3, 1]~ +** Processing line: ~ args.outputs.labels << [640, 345, "%.2f" % count_down.fdiv(60), 3, 1]~ +** Processing line: ~ elsif progress >= 1~ +** Processing line: ~ args.outputs.labels << [640, 360, "Click screen to reset.", 3, 1]~ +** Processing line: ~ if args.inputs.click~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Changes the position of the moving box on the screen by multiplying the change in x (dx) and change in y (dy) by the speed,~ -** Processing line: ~ # and adding it to the current position.~ -** Processing line: ~ # dx and dy are positive if the box is moving right and up, respectively~ -** Processing line: ~ # dx and dy are negative if the box is moving left and down, respectively~ -** Processing line: ~ def position_moving_box args~ -** Processing line: ~ args.state.moving_box.x += args.state.moving_box_dx * args.state.moving_box_speed~ -** Processing line: ~ args.state.moving_box.y += args.state.moving_box_dy * args.state.moving_box_speed~ +** Processing line: ~ # $gtk.reset~ ** Processing line: ~~ -** Processing line: ~ # 1280x720 are the virtual pixels you work with (essentially 720p).~ -** Processing line: ~ screen_width = 1280~ -** Processing line: ~ screen_height = 720~ +** Processing line: ~ # you can make own variations of animations using this~ +** Processing line: ~ module Easing~ +** Processing line: ~ # you have access to all the built in functions: identity, flip, quad, cube, quart, quint~ +** Processing line: ~ def self.smoothest_start x~ +** Processing line: ~ quad(quint(x))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.smoothest_stop x~ +** Processing line: ~ flip(quad(quint(flip(x))))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Position of the box is denoted by the bottom left hand corner, in~ -** Processing line: ~ # that case, we have to subtract the width of the box so that it stays~ -** Processing line: ~ # in the scene (you can try deleting the subtraction to see how it~ -** Processing line: ~ # impacts the box's movement).~ -** Processing line: ~ if args.state.moving_box.x > screen_width - args.state.moving_box_size~ -** Processing line: ~ args.state.moving_box_dx = -1 # moves left~ -** Processing line: ~ elsif args.state.moving_box.x < 0~ -** Processing line: ~ args.state.moving_box_dx = 1 # moves right~ +** Processing line: ~ # this is the source for the existing easing functions~ +** Processing line: ~ def self.identity x~ +** Processing line: ~ x~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Here, we're making sure the moving box remains within the vertical scope of the screen~ -** Processing line: ~ if args.state.moving_box.y > screen_height - args.state.moving_box_size # if the box moves too high~ -** Processing line: ~ args.state.moving_box_dy = -1 # moves down~ -** Processing line: ~ elsif args.state.moving_box.y < 0 # if the box moves too low~ -** Processing line: ~ args.state.moving_box_dy = 1 # moves up~ +** Processing line: ~ def self.flip x~ +** Processing line: ~ 1 - x~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def determine_collision_center_box args~ -** Processing line: ~ # Collision is handled by the engine. You simply have to call the~ -** Processing line: ~ # `intersect_rect?` function.~ -** Processing line: ~ if args.state.moving_box.intersect_rect? args.state.center_box # if the two boxes intersect~ -** Processing line: ~ args.state.center_box_collision = true # then a collision happened~ -** Processing line: ~ else~ -** Processing line: ~ args.state.center_box_collision = false # otherwise, no collision happened~ +** Processing line: ~ def self.quad x~ +** Processing line: ~ x * x~ ** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ +** Processing line: ~ def self.cube x~ +** Processing line: ~ x * x * x~ ** 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: ~ def self.quart x~ +** Processing line: ~ x * x * x * x * x~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.quint x~ +** Processing line: ~ x * x * x * x * x * x~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Physics And Collisions - Moving Objects - main.rb~ -- H1 detected. +** Processing line: ~*** Tweening Lerping Easing Functions - Cubic Bezier - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Physics And Collisions - Moving Objects - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Tweening Lerping Easing Functions - Cubic Bezier - 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: ~Tweening Lerping Easing Functions - Cubic Bezier - 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/04_physics_and_collisions/02_moving_objects/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # ./samples/08_tweening_lerping_easing_functions/02_cubic_bezier/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.background_color = [33, 33, 33]~ +** Processing line: ~ args.outputs.lines << bezier(100, 100,~ +** Processing line: ~ 100, 620,~ +** Processing line: ~ 1180, 620,~ +** Processing line: ~ 1180, 100,~ +** Processing line: ~ 0)~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~ args.outputs.lines << bezier(100, 100,~ +** Processing line: ~ 100, 620,~ +** Processing line: ~ 1180, 620,~ +** Processing line: ~ 1180, 100,~ +** Processing line: ~ 20)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ -** Processing line: ~ using their keys.~ ** Processing line: ~~ -** Processing line: ~ For example, if we have a "numbers" hash that stores numbers in English as the~ -** Processing line: ~ key and numbers in Spanish as the value, we'd have a hash that looks like this...~ -** Processing line: ~ numbers = { "one" => "uno", "two" => "dos", "three" => "tres" }~ -** Processing line: ~ and on it goes.~ +** Processing line: ~ def bezier x1, y1, x2, y2, x3, y3, x4, y4, step~ +** Processing line: ~ step ||= 0~ +** Processing line: ~ color = [200, 200, 200]~ +** Processing line: ~ points = points_for_bezier [x1, y1], [x2, y2], [x3, y3], [x4, y4], step~ ** Processing line: ~~ -** Processing line: ~ Now if we wanted to find the corresponding value of the "one" key, we could say~ -** Processing line: ~ puts numbers["one"]~ -** Processing line: ~ which would print "uno" to the console.~ +** Processing line: ~ points.each_cons(2).map do |p1, p2|~ +** Processing line: ~ [p1, p2, color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - num1.greater(num2): Returns the greater value.~ -** Processing line: ~ For example, if we have the command~ -** Processing line: ~ puts 4.greater(3)~ -** Processing line: ~ the number 4 would be printed to the console since it has a greater value than 3.~ -** Processing line: ~ Similar to lesser, which returns the lesser value.~ +** Processing line: ~ def points_for_bezier p1, p2, p3, p4, step~ +** Processing line: ~ points = []~ +** Processing line: ~ if step == 0~ +** Processing line: ~ [p1, p2, p3, p4]~ +** Processing line: ~ else~ +** Processing line: ~ t_step = 1.fdiv(step + 1)~ +** Processing line: ~ t = 0~ +** Processing line: ~ t += t_step~ +** Processing line: ~ points = []~ +** Processing line: ~ while t < 1~ +** Processing line: ~ points << [~ +** Processing line: ~ b_for_t(p1.x, p2.x, p3.x, p4.x, t),~ +** Processing line: ~ b_for_t(p1.y, p2.y, p3.y, p4.y, t),~ +** Processing line: ~ ]~ +** Processing line: ~ t += t_step~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - num1.lesser(num2): Finds the lower value of the given options.~ -** Processing line: ~ For example, in the statement~ -** Processing line: ~ a = 4.lesser(3)~ -** Processing line: ~ 3 has a lower value than 4, which means that the value of a would be set to 3,~ -** Processing line: ~ but if the statement had been~ -** Processing line: ~ a = 4.lesser(5)~ -** Processing line: ~ 4 has a lower value than 5, which means that the value of a would be set to 4.~ +** Processing line: ~ [~ +** Processing line: ~ p1,~ +** Processing line: ~ *points,~ +** Processing line: ~ p4~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ -** Processing line: ~ For example, you can derive an array of odd numbers from an original array of~ -** Processing line: ~ numbers 1 through 10 by rejecting all elements that are even (or divisible by 2).~ +** Processing line: ~ def b_for_t v0, v1, v2, v3, t~ +** Processing line: ~ pow(1 - t, 3) * v0 +~ +** Processing line: ~ 3 * pow(1 - t, 2) * t * v1 +~ +** Processing line: ~ 3 * (1 - t) * pow(t, 2) * v2 +~ +** Processing line: ~ pow(t, 3) * v3~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - find_all: Finds all values that satisfy specific requirements.~ -** Processing line: ~ For example, you can find all elements of a collection that are divisible by 2~ -** Processing line: ~ or find all objects that have intersected with another object.~ +** Processing line: ~ def pow n, to~ +** Processing line: ~ n ** to~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - abs: Returns the absolute value.~ -** Processing line: ~ For example, the command~ -** Processing line: ~ (-30).abs~ -** Processing line: ~ would return 30 as a result.~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ - map: Ruby method used to transform data; used in arrays, hashes, and collections.~ -** Processing line: ~ Can be used to perform an action on every element of a collection, such as multiplying~ -** Processing line: ~ each element by 2 or declaring every element as a new entity.~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ +** Processing line: ~*** Tweening Lerping Easing Functions - Easing Using Spline - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Tweening Lerping Easing Functions - Easing Using Spline - 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: ~Tweening Lerping Easing Functions - Easing Using Spline - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ - args.inputs.keyboard.KEY: Determines if a key has been pressed.~ -** Processing line: ~ For more information about the keyboard, take a look at mygame/documentation/06-keyboard.md.~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/08_tweening_lerping_easing_functions/03_easing_using_spline/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.duration = 10.seconds~ +** Processing line: ~ args.state.spline = [~ +** Processing line: ~ [0.0, 0.33, 0.66, 1.0],~ +** Processing line: ~ [1.0, 1.0, 1.0, 1.0],~ +** Processing line: ~ [1.0, 0.66, 0.33, 0.0],~ +** Processing line: ~ ]~ ** Processing line: ~~ -** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect.~ +** Processing line: ~ args.state.simulation_tick = args.state.tick_count % args.state.duration~ +** Processing line: ~ progress = 0.ease_spline_extended args.state.simulation_tick, args.state.duration, args.state.spline~ +** Processing line: ~ args.outputs.borders << args.grid.rect~ +** Processing line: ~ args.outputs.solids << [20 + 1240 * progress,~ +** Processing line: ~ 20 + 680 * progress,~ +** Processing line: ~ 20, 20].anchor_rect(0.5, 0.5)~ +** Processing line: ~ args.outputs.labels << [10,~ +** Processing line: ~ 710,~ +** Processing line: ~ "perc: #{"%.2f" % (args.state.simulation_tick / args.state.duration)} t: #{args.state.simulation_tick}"]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ -** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ =end~ ** Processing line: ~~ -** Processing line: ~ # Calls methods needed for game to run properly~ -** 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: ~ calc args~ -** Processing line: ~ input args~ -** Processing line: ~ end~ +** Processing line: ~*** Tweening Lerping Easing Functions - Parametric Enemy Movement - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Tweening Lerping Easing Functions - Parametric Enemy Movement - 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: ~Tweening Lerping Easing Functions - Parametric Enemy Movement - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** 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: ~ args.state.enemy.hammers ||= []~ -** Processing line: ~ args.state.enemy.hammer_queue ||= []~ -** 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.enemy.x ||= 800 # initializes enemy's properties~ -** Processing line: ~ args.state.enemy.y ||= 0~ -** Processing line: ~ args.state.enemy.w ||= 128~ -** Processing line: ~ args.state.enemy.h ||= 128~ -** Processing line: ~ args.state.enemy.dy ||= 0~ -** Processing line: ~ args.state.enemy.dx ||= 0~ -** Processing line: ~ args.state.game_over_at ||= 0~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/08_tweening_lerping_easing_functions/04_parametric_enemy_movement/app/main.rb~ +** Processing line: ~ def new_star args~ +** Processing line: ~ { x: 1280.randomize(:ratio),~ +** Processing line: ~ starting_y: 800,~ +** Processing line: ~ distance_to_travel: 900 + 100.randomize(:ratio),~ +** Processing line: ~ duration: 100.randomize(:ratio) + 60,~ +** Processing line: ~ created_at: args.state.tick_count,~ +** Processing line: ~ max_alpha: 128.randomize(:ratio) + 128,~ +** Processing line: ~ b: 255.randomize(:ratio),~ +** Processing line: ~ g: 200.randomize(:ratio),~ +** Processing line: ~ w: 1.randomize(:ratio) + 1,~ +** Processing line: ~ h: 1.randomize(:ratio) + 1 }~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # sets enemy, player, hammer values~ -** Processing line: ~ def fiddle args~ -** Processing line: ~ args.state.gravity = -0.3~ -** Processing line: ~ args.state.enemy_jump_power = 10 # sets enemy values~ -** Processing line: ~ args.state.enemy_jump_interval = 60~ -** Processing line: ~ args.state.hammer_throw_interval = 40 # sets hammer values~ -** Processing line: ~ args.state.hammer_launch_power_default = 5~ -** Processing line: ~ args.state.hammer_launch_power_near = 2~ -** Processing line: ~ args.state.hammer_launch_power_far = 7~ -** Processing line: ~ args.state.hammer_upward_launch_power = 15~ -** Processing line: ~ args.state.max_hammers_per_volley = 10~ -** Processing line: ~ args.state.gap_between_hammers = 10~ -** Processing line: ~ args.state.player_jump_power = 10 # sets player values~ -** Processing line: ~ args.state.player_jump_power_duration = 10~ -** Processing line: ~ args.state.player_max_run_speed = 10~ -** Processing line: ~ args.state.player_speed_slowdown_rate = 0.9~ -** Processing line: ~ args.state.player_acceleration = 1~ -** Processing line: ~ args.state.hammer_size = 32~ +** Processing line: ~ def new_enemy args~ +** Processing line: ~ { x: 1280.randomize(:ratio),~ +** Processing line: ~ starting_y: 800,~ +** Processing line: ~ distance_to_travel: -900,~ +** Processing line: ~ duration: 60.randomize(:ratio) + 180,~ +** Processing line: ~ created_at: args.state.tick_count,~ +** Processing line: ~ w: 32,~ +** Processing line: ~ h: 32,~ +** Processing line: ~ fire_rate: (30.randomize(:ratio) + (60 - args.state.score)).to_i }~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # outputs objects onto the screen~ -** Processing line: ~ def render args~ -** Processing line: ~ args.outputs.solids << 20.map_with_index do |i| # uses 20 squares to form bridge~ -** Processing line: ~ # sets x by multiplying 64 to index to find pixel value (places all squares side by side)~ -** Processing line: ~ # subtracts 64 from bridge_top because position is denoted by bottom left corner~ -** Processing line: ~ [i * 64, args.state.bridge_top - 64, 64, 64]~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ args.outputs.solids << [args.state.x, args.state.y, args.state.w, args.state.h, 255, 0, 0]~ -** Processing line: ~ args.outputs.solids << [args.state.player.x, args.state.player.y, args.state.player.w, args.state.player.h, 255, 0, 0] # outputs player onto screen (red box)~ -** Processing line: ~ args.outputs.solids << [args.state.enemy.x, args.state.enemy.y, args.state.enemy.w, args.state.enemy.h, 0, 255, 0] # outputs enemy onto screen (green box)~ -** Processing line: ~ args.outputs.solids << args.state.enemy.hammers # outputs enemy's hammers onto screen~ +** Processing line: ~ def new_bullet args, starting_x, starting_y, enemy_speed~ +** Processing line: ~ { x: starting_x,~ +** Processing line: ~ starting_y: starting_y,~ +** Processing line: ~ distance_to_travel: -900,~ +** Processing line: ~ created_at: args.state.tick_count,~ +** Processing line: ~ duration: 900 / (enemy_speed.abs + 2.0 + (5.0 * args.state.score.fdiv(100))).abs,~ +** Processing line: ~ w: 5,~ +** Processing line: ~ h: 5 }~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Performs calculations to move objects on the screen~ -** Processing line: ~ def calc args~ -** Processing line: ~~ -** 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: ~ def new_player_bullet args, starting_x, starting_y, player_speed~ +** Processing line: ~ { x: starting_x,~ +** Processing line: ~ starting_y: starting_y,~ +** Processing line: ~ distance_to_travel: 900,~ +** Processing line: ~ created_at: args.state.tick_count,~ +** Processing line: ~ duration: 900 / (player_speed + 2.0),~ +** Processing line: ~ w: 5,~ +** Processing line: ~ h: 5 }~ +** Processing line: ~ end~ ** 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: ~ def defaults args~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +** Processing line: ~ args.state.score ||= 0~ +** Processing line: ~ args.state.stars ||= []~ +** Processing line: ~ args.state.enemies ||= []~ +** Processing line: ~ args.state.bullets ||= []~ +** Processing line: ~ args.state.player_bullets ||= []~ +** Processing line: ~ args.state.max_stars = 50~ +** Processing line: ~ args.state.max_enemies = 10~ +** Processing line: ~ args.state.player.x ||= 640~ +** Processing line: ~ args.state.player.y ||= 100~ +** Processing line: ~ args.state.player.w ||= 32~ +** Processing line: ~ args.state.player.h ||= 32~ ** 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: ~ if args.state.tick_count == 0~ +** Processing line: ~ args.state.stars.clear~ +** Processing line: ~ args.state.max_stars.times do~ +** Processing line: ~ s = new_star args~ +** Processing line: ~ s[:created_at] += s[:duration].randomize(:ratio)~ +** Processing line: ~ args.state.stars << s~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.enemy.x += args.state.enemy.dx # velocity; change in x increases by dx~ -** Processing line: ~ args.state.enemy.y += args.state.enemy.dy # same with y and dy~ +** Processing line: ~ if args.state.tick_count == 0~ +** Processing line: ~ args.state.enemies.clear~ +** Processing line: ~ args.state.max_enemies.times do~ +** Processing line: ~ s = new_enemy args~ +** Processing line: ~ s[:created_at] += s[:duration].randomize(:ratio)~ +** Processing line: ~ args.state.enemies << s~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # ensures that the enemy never goes below the bridge~ -** Processing line: ~ args.state.enemy.y = args.state.enemy.y.greater(args.state.bridge_top)~ +** Processing line: ~ def input args~ +** Processing line: ~ if args.inputs.keyboard.left~ +** Processing line: ~ args.state.player.x -= 5~ +** Processing line: ~ elsif args.inputs.keyboard.right~ +** Processing line: ~ args.state.player.x += 5~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # ensures that the enemy never goes too far left (outside the screen's scope)~ -** Processing line: ~ args.state.enemy.x = args.state.enemy.x.greater(0)~ +** Processing line: ~ if args.inputs.keyboard.up~ +** Processing line: ~ args.state.player.y += 5~ +** Processing line: ~ elsif args.inputs.keyboard.down~ +** Processing line: ~ args.state.player.y -= 5~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # objects that go up must come down because of gravity~ -** Processing line: ~ args.state.enemy.dy += args.state.gravity~ +** Processing line: ~ if args.inputs.keyboard.key_down.space~ +** Processing line: ~ args.state.player_bullets << new_player_bullet(args,~ +** Processing line: ~ args.state.player.x + args.state.player.w.half,~ +** Processing line: ~ args.state.player.y + args.state.player.h, 5)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.enemy.y = args.state.enemy.y.greater(args.state.bridge_top)~ +** Processing line: ~ args.state.player.y = args.state.player.y.greater(0).lesser(720 - args.state.player.w)~ +** Processing line: ~ args.state.player.x = args.state.player.x.greater(0).lesser(1280 - args.state.player.h)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ #sets definition of enemy~ -** Processing line: ~ args.state.enemy.rect = [args.state.enemy.x, args.state.enemy.y, args.state.enemy.h, args.state.enemy.w]~ +** Processing line: ~ def completed? entity~ +** Processing line: ~ (entity[:created_at] + entity[:duration]).elapsed_time > 0~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.state.enemy.y == args.state.bridge_top # if enemy is located on the top of the bridge~ -** Processing line: ~ args.state.enemy.dy = 0 # there is no change in y~ +** Processing line: ~ def calc_stars args~ +** Processing line: ~ if (stars_to_add = args.state.max_stars - args.state.stars.length) > 0~ +** Processing line: ~ stars_to_add.times { args.state.stars << new_star(args) }~ ** Processing line: ~ end~ +** Processing line: ~ args.state.stars = args.state.stars.reject { |s| completed? s }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # if 60 frames have passed and the enemy is not moving vertically~ -** Processing line: ~ if args.state.tick_count.mod_zero?(args.state.enemy_jump_interval) && args.state.enemy.dy == 0~ -** Processing line: ~ args.state.enemy.dy = args.state.enemy_jump_power # the enemy jumps up~ +** Processing line: ~ def move_enemies args~ +** Processing line: ~ if (enemies_to_add = args.state.max_enemies - args.state.enemies.length) > 0~ +** Processing line: ~ enemies_to_add.times { args.state.enemies << new_enemy(args) }~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # if 40 frames have passed or 5 frames have passed since the game ended~ -** Processing line: ~ if args.state.tick_count.mod_zero?(args.state.hammer_throw_interval) || args.state.game_over_at.elapsed_time == 5~ -** Processing line: ~ # rand will return a number greater than or equal to 0 and less than given variable's value (since max is excluded)~ -** Processing line: ~ # that is why we're adding 1, to include the max possibility~ -** Processing line: ~ volley_dx = (rand(args.state.hammer_launch_power_default) + 1) * -1 # horizontal movement (follow order of operations)~ -** Processing line: ~~ -** Processing line: ~ # if the horizontal distance between the player and enemy is less than 128 pixels~ -** Processing line: ~ if (args.state.player.x - args.state.enemy.x).abs < 128~ -** Processing line: ~ # the change in x won't be that great since the enemy and player are closer to each other~ -** Processing line: ~ volley_dx = (rand(args.state.hammer_launch_power_near) + 1) * -1~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # if the horizontal distance between the player and enemy is greater than 300 pixels~ -** Processing line: ~ if (args.state.player.x - args.state.enemy.x).abs > 300~ -** Processing line: ~ # change in x will be more drastic since player and enemy are so far apart~ -** Processing line: ~ volley_dx = (rand(args.state.hammer_launch_power_far) + 1) * -1 # more drastic change~ -** Processing line: ~ end~ +** Processing line: ~ args.state.enemies = args.state.enemies.reject { |s| completed? s }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ (rand(args.state.max_hammers_per_volley) + 1).map_with_index do |i|~ -** Processing line: ~ args.state.enemy.hammer_queue << { # stores hammer values in a hash~ -** Processing line: ~ x: args.state.enemy.x,~ -** Processing line: ~ w: args.state.hammer_size,~ -** Processing line: ~ h: args.state.hammer_size,~ -** Processing line: ~ dx: volley_dx, # change in horizontal position~ -** Processing line: ~ # multiplication operator takes precedence over addition operator~ -** Processing line: ~ throw_at: args.state.tick_count + i * args.state.gap_between_hammers~ -** Processing line: ~ }~ +** Processing line: ~ def move_bullets args~ +** Processing line: ~ args.state.enemies.each do |e|~ +** Processing line: ~ if args.state.tick_count.mod_zero?(e[:fire_rate])~ +** Processing line: ~ args.state.bullets << new_bullet(args, e[:x] + e[:w].half, current_y(e), e[:distance_to_travel] / e[:duration])~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # add elements from hammer_queue collection to the hammers collection by~ -** Processing line: ~ # finding all hammers that were thrown before the current frame (have already been thrown)~ -** Processing line: ~ args.state.enemy.hammers += args.state.enemy.hammer_queue.find_all do |h|~ -** Processing line: ~ h[:throw_at] < args.state.tick_count~ -** Processing line: ~ end~ +** Processing line: ~ args.state.bullets = args.state.bullets.reject { |s| completed? s }~ +** Processing line: ~ args.state.player_bullets = args.state.player_bullets.reject { |s| completed? s }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.enemy.hammers.each do |h| # sets values for all hammers in collection~ -** Processing line: ~ h[:y] ||= args.state.enemy.y + 130~ -** Processing line: ~ h[:dy] ||= args.state.hammer_upward_launch_power~ -** Processing line: ~ h[:dy] += args.state.gravity # acceleration is change in gravity~ -** Processing line: ~ h[:x] += h[:dx] # incremented by change in position~ -** Processing line: ~ h[:y] += h[:dy]~ -** Processing line: ~ h[:rect] = [h[:x], h[:y], h[:w], h[:h]] # sets definition of hammer's rect~ -** Processing line: ~ end~ +** Processing line: ~ def intersect? entity_one, entity_two~ +** Processing line: ~ entity_one.merge(y: current_y(entity_one))~ +** Processing line: ~ .intersect_rect? entity_two.merge(y: current_y(entity_two))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # reject hammers that have been thrown before current frame (have already been thrown)~ -** Processing line: ~ args.state.enemy.hammer_queue = args.state.enemy.hammer_queue.reject do |h|~ -** Processing line: ~ h[:throw_at] < args.state.tick_count~ +** Processing line: ~ def kill args~ +** Processing line: ~ bullets_hitting_enemies = []~ +** Processing line: ~ dead_bullets = []~ +** Processing line: ~ dead_enemies = []~ +** Processing line: ~~ +** Processing line: ~ args.state.player_bullets.each do |b|~ +** Processing line: ~ args.state.enemies.each do |e|~ +** Processing line: ~ if intersect? b, e~ +** Processing line: ~ dead_bullets << b~ +** Processing line: ~ dead_enemies << e~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # any hammers with a y position less than 0 are rejected from the hammers collection~ -** Processing line: ~ # since they have gone too far down (outside the scope's screen)~ -** Processing line: ~ args.state.enemy.hammers = args.state.enemy.hammers.reject { |h| h[:y] < 0 }~ +** Processing line: ~ args.state.score += dead_enemies.length~ ** Processing line: ~~ -** Processing line: ~ # if there are any hammers that intersect with (or hit) the player,~ -** Processing line: ~ # the reset_player method is called (so the game can start over)~ -** Processing line: ~ if args.state.enemy.hammers.any? { |h| h[:rect].intersect_rect?(args.state.player.rect) }~ -** Processing line: ~ reset_player args~ -** Processing line: ~ end~ +** Processing line: ~ args.state.player_bullets.reject! { |b| dead_bullets.include? b }~ +** Processing line: ~ args.state.enemies.reject! { |e| dead_enemies.include? e }~ ** Processing line: ~~ -** Processing line: ~ # if the enemy's rect intersects with (or hits) the player,~ -** Processing line: ~ # the reset_player method is called (so the game can start over)~ -** Processing line: ~ if args.state.enemy.rect.intersect_rect? args.state.player.rect~ -** Processing line: ~ reset_player args~ +** Processing line: ~ dead = args.state.bullets.any? do |b|~ +** Processing line: ~ [args.state.player.x,~ +** Processing line: ~ args.state.player.y,~ +** Processing line: ~ args.state.player.w,~ +** Processing line: ~ args.state.player.h].intersect_rect? b.merge(y: current_y(b))~ ** Processing line: ~ end~ +** Processing line: ~ return unless dead~ +** Processing line: ~ args.gtk.reset~ +** Processing line: ~ defaults args~ ** 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: ~ def calc args~ +** Processing line: ~ calc_stars args~ +** Processing line: ~ move_enemies args~ +** Processing line: ~ move_bullets args~ +** Processing line: ~ kill args~ ** 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.inputs.keyboard.space # 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: ~ def current_y entity~ +** Processing line: ~ entity[:starting_y] + (entity[:distance_to_travel] * entity[:created_at].ease(entity[:duration], :identity))~ +** Processing line: ~ end~ ** 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: ~ def render args~ +** Processing line: ~ args.outputs.solids << args.state.stars.map do |s|~ +** Processing line: ~ [s[:x],~ +** Processing line: ~ current_y(s),~ +** Processing line: ~ s[:w], s[:h], 0, s[:g], s[:b], s[:max_alpha] * s[:created_at].ease(20, :identity)]~ ** 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~ -** 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: ~ args.outputs.borders << args.state.enemies.map do |s|~ +** Processing line: ~ [s[:x],~ +** Processing line: ~ current_y(s),~ +** Processing line: ~ s[:w], s[:h], 255, 0, 0]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.inputs.keyboard.left # if left key is pressed~ -** Processing line: ~ args.state.player.dx -= args.state.player_acceleration # dx decreases by acceleration (player goes left)~ -** Processing line: ~ # dx is either set to current dx or the negative max run speed (which would be -10),~ -** Processing line: ~ # whichever has a greater value~ -** Processing line: ~ args.state.player.dx = args.state.player.dx.greater(-args.state.player_max_run_speed)~ -** Processing line: ~ elsif args.inputs.keyboard.right # if right key is pressed~ -** Processing line: ~ args.state.player.dx += args.state.player_acceleration # dx increases by acceleration (player goes right)~ -** Processing line: ~ # dx is either set to current dx or max run speed (which would be 10),~ -** Processing line: ~ # whichever has a lesser value~ -** Processing line: ~ args.state.player.dx = args.state.player.dx.lesser(args.state.player_max_run_speed)~ -** Processing line: ~ else~ -** Processing line: ~ args.state.player.dx *= args.state.player_speed_slowdown_rate # dx is scaled down~ +** Processing line: ~ args.outputs.borders << args.state.bullets.map do |b|~ +** Processing line: ~ [b[:x],~ +** Processing line: ~ current_y(b),~ +** Processing line: ~ b[:w], b[:h], 255, 0, 0]~ ** 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: ~ args.outputs.borders << args.state.player_bullets.map do |b|~ +** Processing line: ~ [b[:x],~ +** Processing line: ~ current_y(b),~ +** Processing line: ~ b[:w], b[:h], 255, 255, 255]~ ** 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.borders << [args.state.player.x,~ +** Processing line: ~ args.state.player.y,~ +** Processing line: ~ args.state.player.w,~ +** Processing line: ~ args.state.player.h, 255, 255, 255]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ defaults args~ +** Processing line: ~ input args~ +** Processing line: ~ calc args~ +** Processing line: ~ render args~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Physics And Collisions - Entities - main.rb~ -- H1 detected. +** Processing line: ~*** Performance - Sprites As Hash - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Physics And Collisions - Entities - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Sprites As Hash - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Sprites As Hash - 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/04_physics_and_collisions/03_entities/app/main.rb~ -** Processing line: ~ =begin~ -** Processing line: ~~ -** Processing line: ~ Reminders:~ -** Processing line: ~~ -** Processing line: ~ - map: Ruby method used to transform data; used in arrays, hashes, and collections.~ -** Processing line: ~ Can be used to perform an action on every element of a collection, such as multiplying~ -** Processing line: ~ each element by 2 or declaring every element as a new entity.~ -** Processing line: ~~ -** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ -** Processing line: ~ For example, you can derive an array of odd numbers from an original array of~ -** Processing line: ~ numbers 1 through 10 by rejecting all elements that are even (or divisible by 2).~ -** Processing line: ~~ -** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ -** Processing line: ~ In this sample app, new_entity is used to define the properties of enemies and bullets.~ -** Processing line: ~ (Remember, you can use state to define ANY property and it will be retained across frames.)~ -** Processing line: ~~ -** Processing line: ~ - args.outputs.labels: An array. The values generate a label on the screen.~ -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ -** Processing line: ~~ -** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect.~ -** Processing line: ~~ -** Processing line: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ -** Processing line: ~~ -** Processing line: ~ =end~ -** Processing line: ~~ -** Processing line: ~ # This sample app shows enemies that contain an id value and the time they were created.~ -** Processing line: ~ # These enemies can be removed by shooting at them with bullets.~ +** Processing line: ~ # ./samples/09_performance/01_sprites_as_hash/app/main.rb~ ** Processing line: ~~ -** Processing line: ~ # Calls all methods necessary for the game to function properly.~ -** Processing line: ~ def tick args~ -** Processing line: ~ tick_instructions args, "Sample app shows how to use args.state.new_entity along with collisions. CLICK to shoot a bullet."~ -** Processing line: ~ defaults args~ -** Processing line: ~ render args~ -** Processing line: ~ calc args~ -** Processing line: ~ process_inputs args~ +** Processing line: ~ # Sprites represented as Hashes using the queue ~args.outputs.sprites~~ +** Processing line: ~ # code up, but are the "slowest" to render.~ +** Processing line: ~ # The reason for this is the access of the key in the Hash and also~ +** Processing line: ~ # because the data args.outputs.sprites is cleared every tick.~ +** Processing line: ~ def random_x args~ +** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets default values~ -** Processing line: ~ # Enemies and bullets start off as empty collections~ -** Processing line: ~ def defaults args~ -** Processing line: ~ args.state.enemies ||= []~ -** Processing line: ~ args.state.bullets ||= []~ +** Processing line: ~ def random_y args~ +** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Provides each enemy in enemies collection with rectangular border,~ -** Processing line: ~ # as well as a label showing id and when they were created~ -** Processing line: ~ def render args~ -** Processing line: ~ # When you're calling a method that takes no arguments, you can use this & syntax on map.~ -** Processing line: ~ # Numbers are being added to x and y in order to keep the text within the enemy's borders.~ -** Processing line: ~ args.outputs.borders << args.state.enemies.map(&:rect)~ -** Processing line: ~ args.outputs.labels << args.state.enemies.flat_map do |enemy|~ -** Processing line: ~ [~ -** Processing line: ~ [enemy.x + 4, enemy.y + 29, "id: #{enemy.entity_id}", -3, 0],~ -** Processing line: ~ [enemy.x + 4, enemy.y + 17, "created_at: #{enemy.created_at}", -3, 0] # frame enemy was created~ -** Processing line: ~ ]~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # Outputs bullets in bullets collection as rectangular solids~ -** Processing line: ~ args.outputs.solids << args.state.bullets.map(&:rect)~ +** Processing line: ~ def random_speed~ +** Processing line: ~ 1 + (4.randomize :ratio)~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calls all methods necessary for performing calculations~ -** Processing line: ~ def calc args~ -** Processing line: ~ add_new_enemies_if_needed args~ -** Processing line: ~ move_bullets args~ -** Processing line: ~ calculate_collisions args~ -** Processing line: ~ remove_bullets_of_screen args~ +** Processing line: ~ def new_star args~ +** Processing line: ~ {~ +** Processing line: ~ x: (random_x args),~ +** Processing line: ~ y: (random_y args),~ +** Processing line: ~ w: 4, h: 4, path: 'sprites/tiny-star.png',~ +** Processing line: ~ s: random_speed~ +** Processing line: ~ }~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Adds enemies to the enemies collection and sets their values~ -** Processing line: ~ def add_new_enemies_if_needed args~ -** Processing line: ~ return if args.state.enemies.length >= 10 # if 10 or more enemies, enemies are not added~ -** Processing line: ~ return unless args.state.bullets.length == 0 # if user has not yet shot bullet, no enemies are added~ -** Processing line: ~~ -** Processing line: ~ args.state.enemies += (10 - args.state.enemies.length).map do # adds enemies so there are 10 total~ -** Processing line: ~ args.state.new_entity(:enemy) do |e| # each enemy is declared as a new entity~ -** Processing line: ~ e.x = 640 + 500 * rand # each enemy is given random position on screen~ -** Processing line: ~ e.y = 600 * rand + 50~ -** Processing line: ~ e.rect = [e.x, e.y, 130, 30] # sets definition for enemy's rect~ -** Processing line: ~ end~ +** Processing line: ~ def move_star args, star~ +** Processing line: ~ star.x += star[:s]~ +** Processing line: ~ star.y += star[:s]~ +** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ +** Processing line: ~ star.x = (random_x args)~ +** Processing line: ~ star.y = (random_y args)~ +** Processing line: ~ star[:s] = random_speed~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Moves bullets across screen~ -** Processing line: ~ # Sets definition of the bullets~ -** Processing line: ~ def move_bullets args~ -** Processing line: ~ args.state.bullets.each do |bullet| # perform action on each bullet in collection~ -** Processing line: ~ bullet.x += bullet.speed # increment x by speed (bullets fly horizontally across screen)~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.star_count ||= 0~ ** Processing line: ~~ -** Processing line: ~ # By randomizing the value that increments bullet.y, the bullet does not fly straight up and out~ -** Processing line: ~ # of the scope of the screen. Try removing what follows bullet.speed, or changing 0.25 to 1.25 to~ -** Processing line: ~ # see what happens to the bullet's movement.~ -** Processing line: ~ bullet.y += bullet.speed.*(0.25).randomize(:ratio, :sign)~ -** Processing line: ~ bullet.rect = [bullet.x, bullet.y, bullet.size, bullet.size] # sets definition of bullet's rect~ +** 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: ~ args.gtk.console.set_command "reset_with count: 100"~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Determines if a bullet hits an enemy~ -** Processing line: ~ def calculate_collisions args~ -** Processing line: ~ args.state.bullets.each do |bullet| # perform action on every bullet and enemy in collections~ -** Processing line: ~ args.state.enemies.each do |enemy|~ -** Processing line: ~ # if bullet has not exploded yet and the bullet hits an enemy~ -** Processing line: ~ if !bullet.exploded && bullet.rect.intersect_rect?(enemy.rect)~ -** Processing line: ~ bullet.exploded = true # bullet explodes~ -** Processing line: ~ enemy.dead = true # enemy is killed~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ # init~ +** Processing line: ~ if args.state.tick_count == 0~ +** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # All exploded bullets are rejected or removed from the bullets collection~ -** Processing line: ~ # and any dead enemy is rejected from the enemies collection.~ -** Processing line: ~ args.state.bullets = args.state.bullets.reject(&:exploded)~ -** Processing line: ~ args.state.enemies = args.state.enemies.reject(&:dead)~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # Bullets are rejected from bullets collection once their position exceeds the width of screen~ -** Processing line: ~ def remove_bullets_of_screen args~ -** Processing line: ~ args.state.bullets = args.state.bullets.reject { |bullet| bullet.x > 1280 } # screen width is 1280~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # Calls fire_bullet method~ -** Processing line: ~ def process_inputs args~ -** Processing line: ~ fire_bullet args~ -** Processing line: ~ end~ +** Processing line: ~ # update~ +** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ ** Processing line: ~~ -** Processing line: ~ # Once mouse is clicked by the user to fire a bullet, a new bullet is added to bullets collection~ -** Processing line: ~ def fire_bullet args~ -** Processing line: ~ return unless args.inputs.mouse.click # return unless mouse is clicked~ -** Processing line: ~ args.state.bullets << args.state.new_entity(:bullet) do |bullet| # new bullet is declared a new entity~ -** Processing line: ~ bullet.y = args.inputs.mouse.click.point.y # set to the y value of where the mouse was clicked~ -** Processing line: ~ bullet.x = 0 # starts on the left side of the screen~ -** Processing line: ~ bullet.size = 10~ -** Processing line: ~ bullet.speed = 10 * rand + 2 # speed of a bullet is randomized~ -** Processing line: ~ bullet.rect = [bullet.x, bullet.y, bullet.size, bullet.size] # definition is set~ -** Processing line: ~ end~ +** Processing line: ~ # render~ +** Processing line: ~ args.outputs.sprites << args.state.stars~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ 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: ~ # resets game, and assigns star count given by user~ +** Processing line: ~ def reset_with count: count~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~ $gtk.args.state.star_count = count~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Physics And Collisions - Box Collision - main.rb~ -- H1 detected. +** Processing line: ~*** Performance - Sprites As Entities - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Physics And Collisions - Box Collision - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Sprites As Entities - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Sprites As Entities - 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/04_physics_and_collisions/04_box_collision/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # ./samples/09_performance/02_sprites_as_entities/app/main.rb~ +** Processing line: ~ # Sprites represented as Entities using the queue ~args.outputs.sprites~~ +** Processing line: ~ # yields nicer access apis over Hashes, but require a bit more code upfront.~ +** Processing line: ~ # The hash sample has to use star[:s] to get the speed of the star, but~ +** Processing line: ~ # an entity can use .s instead.~ +** Processing line: ~ def random_x args~ +** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~ def random_y args~ +** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - first: Returns the first element of the array.~ -** Processing line: ~ For example, if we have an array~ -** Processing line: ~ numbers = [1, 2, 3, 4, 5]~ -** Processing line: ~ and we call first by saying~ -** Processing line: ~ numbers.first~ -** Processing line: ~ the number 1 will be returned because it is the first element of the numbers array.~ +** Processing line: ~ def random_speed~ +** Processing line: ~ 1 + (4.randomize :ratio)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - num1.idiv(num2): Divides two numbers and returns an integer.~ -** Processing line: ~ For example,~ -** Processing line: ~ 16.idiv(3) = 5, because 16 / 3 is 5.33333 returned as an integer.~ -** Processing line: ~ 16.idiv(4) = 4, because 16 / 4 is 4 and already has no decimal.~ +** Processing line: ~ def new_star args~ +** Processing line: ~ args.state.new_entity :star, {~ +** Processing line: ~ x: (random_x args),~ +** Processing line: ~ y: (random_y args),~ +** Processing line: ~ w: 4, h: 4,~ +** Processing line: ~ path: 'sprites/tiny-star.png',~ +** Processing line: ~ s: random_speed~ +** Processing line: ~ }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ +** Processing line: ~ def move_star args, star~ +** Processing line: ~ star.x += star.s~ +** Processing line: ~ star.y += star.s~ +** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ +** Processing line: ~ star.x = (random_x args)~ +** Processing line: ~ star.y = (random_y args)~ +** Processing line: ~ star.s = random_speed~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - find_all: Finds all values that satisfy specific requirements.~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.star_count ||= 0~ ** Processing line: ~~ -** Processing line: ~ - ARRAY#intersect_rect?: An array with at least four values is~ -** Processing line: ~ considered a rect. The intersect_rect? function returns true~ -** Processing line: ~ or false depending on if the two rectangles intersect.~ +** 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: ~ args.gtk.console.set_command "reset_with count: 100"~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ +** Processing line: ~ # init~ +** Processing line: ~ if args.state.tick_count == 0~ +** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ # update~ +** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ ** Processing line: ~~ -** Processing line: ~ # This sample app allows users to create tiles and place them anywhere on the screen as obstacles.~ -** Processing line: ~ # The player can then move and maneuver around them.~ +** Processing line: ~ # render~ +** Processing line: ~ args.outputs.sprites << args.state.stars~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ class PoorManPlatformerPhysics~ -** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs~ +** Processing line: ~ # resets game, and assigns star count given by user~ +** Processing line: ~ def reset_with count: count~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~ $gtk.args.state.star_count = count~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calls all methods necessary for the app to run successfully.~ -** Processing line: ~ def tick~ -** Processing line: ~ defaults~ -** Processing line: ~ render~ -** Processing line: ~ calc~ -** Processing line: ~ process_inputs~ -** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # Sets default values for variables.~ -** Processing line: ~ # The ||= sign means that the variable will only be set to the value following the = sign if the value has~ -** Processing line: ~ # not already been set before. Intialization happens only in the first frame.~ -** Processing line: ~ def defaults~ -** Processing line: ~ state.tile_size = 64~ -** Processing line: ~ state.gravity = -0.2~ -** Processing line: ~ state.previous_tile_size ||= state.tile_size~ -** Processing line: ~ state.x ||= 0~ -** Processing line: ~ state.y ||= 800~ -** Processing line: ~ state.dy ||= 0~ -** Processing line: ~ state.dx ||= 0~ -** Processing line: ~ state.world ||= []~ -** Processing line: ~ state.world_lookup ||= {}~ -** Processing line: ~ state.world_collision_rects ||= []~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs solids and borders of different colors for the world and collision_rects collections.~ -** Processing line: ~ def render~ +** Processing line: ~*** Performance - Sprites As Strict Entities - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Sprites As Strict Entities - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Sprites As Strict Entities - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ # Sets a black background on the screen (Comment this line out and the background will become white.)~ -** Processing line: ~ # Also note that black is the default color for when no color is assigned.~ -** Processing line: ~ outputs.solids << grid.rect~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb~ +** Processing line: ~ # Sprites represented as StrictEntities using the queue ~args.outputs.sprites~~ +** Processing line: ~ # yields apis access similar to Entities, but all properties that can be set on the~ +** Processing line: ~ # entity must be predefined with a default value. Strict entities do not support the~ +** Processing line: ~ # addition of new properties after the fact. They are more performant than OpenEntities~ +** Processing line: ~ # because of this constraint.~ +** Processing line: ~ def random_x args~ +** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The position, size, and color (white) are set for borders given to the world collection.~ -** Processing line: ~ # Try changing the color by assigning different numbers (between 0 and 255) to the last three parameters.~ -** Processing line: ~ outputs.borders << state.world.map do |x, y|~ -** Processing line: ~ [x * state.tile_size,~ -** Processing line: ~ y * state.tile_size,~ -** Processing line: ~ state.tile_size,~ -** Processing line: ~ state.tile_size, 255, 255, 255]~ -** Processing line: ~ end~ +** Processing line: ~ def random_y args~ +** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The top, bottom, and sides of the borders for collision_rects are different colors.~ -** Processing line: ~ outputs.borders << state.world_collision_rects.map do |e|~ -** Processing line: ~ [~ -** Processing line: ~ [e[:top], 0, 170, 0], # top is a shade of green~ -** Processing line: ~ [e[:bottom], 0, 100, 170], # bottom is a shade of greenish-blue~ -** Processing line: ~ [e[:left_right], 170, 0, 0], # left and right are a shade of red~ -** Processing line: ~ ]~ -** Processing line: ~ end~ +** Processing line: ~ def random_speed~ +** Processing line: ~ 1 + (4.randomize :ratio)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the position, size, and color (a shade of green) of the borders of only the player's~ -** Processing line: ~ # box and outputs it. If you change the 180 to 0, the player's box will be black and you~ -** Processing line: ~ # won't be able to see it (because it will match the black background).~ -** Processing line: ~ outputs.borders << [state.x,~ -** Processing line: ~ state.y,~ -** Processing line: ~ state.tile_size,~ -** Processing line: ~ state.tile_size, 0, 180, 0]~ +** Processing line: ~ def new_star args~ +** Processing line: ~ args.state.new_entity_strict(:star,~ +** Processing line: ~ x: (random_x args),~ +** Processing line: ~ y: (random_y args),~ +** Processing line: ~ w: 4, h: 4,~ +** Processing line: ~ path: 'sprites/tiny-star.png',~ +** Processing line: ~ s: random_speed) do |entity|~ +** Processing line: ~ # invoke attr_sprite so that it responds to~ +** Processing line: ~ # all properties that are required to render a sprite~ +** Processing line: ~ entity.attr_sprite~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calls methods needed to perform calculations.~ -** Processing line: ~ def calc~ -** Processing line: ~ calc_world_lookup~ -** Processing line: ~ calc_player~ +** Processing line: ~ def move_star args, star~ +** Processing line: ~ star.x += star.s~ +** Processing line: ~ star.y += star.s~ +** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ +** Processing line: ~ star.x = (random_x args)~ +** Processing line: ~ star.y = (random_y args)~ +** Processing line: ~ star.s = random_speed~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Performs calculations on world_lookup and sets values.~ -** Processing line: ~ def calc_world_lookup~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.star_count ||= 0~ ** Processing line: ~~ -** Processing line: ~ # If the tile size isn't equal to the previous tile size,~ -** Processing line: ~ # the previous tile size is set to the tile size,~ -** Processing line: ~ # and world_lookup hash is set to empty.~ -** Processing line: ~ if state.tile_size != state.previous_tile_size~ -** Processing line: ~ state.previous_tile_size = state.tile_size~ -** Processing line: ~ state.world_lookup = {} # empty hash~ -** Processing line: ~ end~ +** 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: ~ args.gtk.console.set_command "reset_with count: 100"~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # return if the world_lookup hash has keys (or, in other words, is not empty)~ -** Processing line: ~ # return unless the world collection has values inside of it (or is not empty)~ -** Processing line: ~ return if state.world_lookup.keys.length > 0~ -** Processing line: ~ return unless state.world.length > 0~ +** Processing line: ~ # init~ +** Processing line: ~ if args.state.tick_count == 0~ +** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Starts with an empty hash for world_lookup.~ -** Processing line: ~ # Searches through the world and finds the coordinates that exist.~ -** Processing line: ~ state.world_lookup = {}~ -** Processing line: ~ state.world.each { |x, y| state.world_lookup[[x, y]] = true }~ +** Processing line: ~ # update~ +** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ ** Processing line: ~~ -** Processing line: ~ # Assigns world_collision_rects for every sprite drawn.~ -** Processing line: ~ state.world_collision_rects =~ -** Processing line: ~ state.world_lookup~ -** Processing line: ~ .keys~ -** Processing line: ~ .map do |coord_x, coord_y|~ -** Processing line: ~ s = state.tile_size~ -** Processing line: ~ # multiply by tile size so the grid coordinates; sets pixel value~ -** Processing line: ~ # don't forget that position is denoted by bottom left corner~ -** Processing line: ~ # set x = coord_x or y = coord_y and see what happens!~ -** Processing line: ~ x = s * coord_x~ -** Processing line: ~ y = s * coord_y~ -** Processing line: ~ {~ -** Processing line: ~ # The values added to x, y, and s position the world_collision_rects so they all appear~ -** Processing line: ~ # stacked (on top of world rects) but don't directly overlap.~ -** Processing line: ~ # Remove these added values and mess around with the rect placement!~ -** Processing line: ~ args: [coord_x, coord_y],~ -** Processing line: ~ left_right: [x, y + 4, s, s - 6], # hash keys and values~ -** Processing line: ~ top: [x + 4, y + 6, s - 8, s - 6],~ -** Processing line: ~ bottom: [x + 1, y - 1, s - 2, s - 8],~ -** Processing line: ~ }~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ # render~ +** Processing line: ~ args.outputs.sprites << args.state.stars~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Performs calculations to change the x and y values of the player's box.~ -** Processing line: ~ def calc_player~ +** Processing line: ~ # resets game, and assigns star count given by user~ +** Processing line: ~ def reset_with count: count~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~ $gtk.args.state.star_count = count~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Since acceleration is the change in velocity, the change in y (dy) increases every frame.~ -** Processing line: ~ # What goes up must come down because of gravity.~ -** Processing line: ~ state.dy += state.gravity~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # Calls the calc_box_collision and calc_edge_collision methods.~ -** Processing line: ~ calc_box_collision~ -** Processing line: ~ calc_edge_collision~ ** Processing line: ~~ -** Processing line: ~ # Since velocity is the change in position, the change in y increases by dy. Same with x and dx.~ -** Processing line: ~ state.y += state.dy~ -** Processing line: ~ state.x += state.dx~ +** Processing line: ~*** Performance - Sprites As Classes - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Sprites As Classes - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Sprites As Classes - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/09_performance/04_sprites_as_classes/app/main.rb~ +** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.sprites~.~ +** Processing line: ~ # gives you full control of property declaration and method invocation.~ +** Processing line: ~ # They are more performant than OpenEntities and StrictEntities, but more code upfront.~ +** Processing line: ~ class Star~ +** Processing line: ~ attr_sprite~ ** Processing line: ~~ -** Processing line: ~ # Scales dx down.~ -** Processing line: ~ state.dx *= 0.8~ +** Processing line: ~ def initialize grid~ +** Processing line: ~ @grid = grid~ +** Processing line: ~ @x = (rand @grid.w) * -1~ +** Processing line: ~ @y = (rand @grid.h) * -1~ +** Processing line: ~ @w = 4~ +** Processing line: ~ @h = 4~ +** Processing line: ~ @s = 1 + (4.randomize :ratio)~ +** Processing line: ~ @path = 'sprites/tiny-star.png'~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calls methods needed to determine collisions between player and world_collision rects.~ -** Processing line: ~ def calc_box_collision~ -** Processing line: ~ return unless state.world_lookup.keys.length > 0 # return unless hash has atleast 1 key~ -** Processing line: ~ collision_floor!~ -** Processing line: ~ collision_left!~ -** Processing line: ~ collision_right!~ -** Processing line: ~ collision_ceiling!~ +** Processing line: ~ def move~ +** Processing line: ~ @x += @s~ +** Processing line: ~ @y += @s~ +** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ +** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Finds collisions between the bottom of the player's rect and the top of a world_collision_rect.~ -** Processing line: ~ def collision_floor!~ -** Processing line: ~ return unless state.dy <= 0 # return unless player is going down or is as far down as possible~ -** Processing line: ~ player_rect = [state.x, state.y - 0.1, state.tile_size, state.tile_size] # definition of player~ -** Processing line: ~~ -** Processing line: ~ # Goes through world_collision_rects to find all intersections between the bottom of player's rect and~ -** Processing line: ~ # the top of a world_collision_rect (hence the "-0.1" above)~ -** Processing line: ~ floor_collisions = state.world_collision_rects~ -** Processing line: ~ .find_all { |r| r[:top].intersect_rect?(player_rect, collision_tollerance) }~ -** Processing line: ~ .first~ +** Processing line: ~ # calls methods needed for game to run properly~ +** 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: ~ args.gtk.console.set_command "reset_with count: 100"~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ return unless floor_collisions # return unless collision occurred~ -** Processing line: ~ state.y = floor_collisions[:top].top # player's y is set to the y of the top of the collided rect~ -** Processing line: ~ state.dy = 0 # if a collision occurred, the player's rect isn't moving because its path is blocked~ +** 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: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Finds collisions between the player's left side and the right side of a world_collision_rect.~ -** Processing line: ~ def collision_left!~ -** Processing line: ~ return unless state.dx < 0 # return unless player is moving left~ -** Processing line: ~ player_rect = [state.x - 0.1, state.y, state.tile_size, state.tile_size]~ +** Processing line: ~ # update~ +** Processing line: ~ args.state.stars.each(&:move)~ ** Processing line: ~~ -** Processing line: ~ # Goes through world_collision_rects to find all intersections beween the player's left side and the~ -** Processing line: ~ # right side of a world_collision_rect.~ -** Processing line: ~ left_side_collisions = state.world_collision_rects~ -** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, collision_tollerance) }~ -** Processing line: ~ .first~ +** Processing line: ~ # render~ +** Processing line: ~ args.outputs.sprites << args.state.stars~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ return unless left_side_collisions # return unless collision occurred~ +** Processing line: ~ # resets game, and assigns star count given by user~ +** Processing line: ~ def reset_with count: count~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~ $gtk.args.state.star_count = count~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # player's x is set to the value of the x of the collided rect's right side~ -** Processing line: ~ state.x = left_side_collisions[:left_right].right~ -** Processing line: ~ state.dx = 0 # player isn't moving left because its path is blocked~ -** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # Finds collisions between the right side of the player and the left side of a world_collision_rect.~ -** Processing line: ~ def collision_right!~ -** Processing line: ~ return unless state.dx > 0 # return unless player is moving right~ -** Processing line: ~ player_rect = [state.x + 0.1, state.y, state.tile_size, state.tile_size]~ ** Processing line: ~~ -** Processing line: ~ # Goes through world_collision_rects to find all intersections between the player's right side~ -** Processing line: ~ # and the left side of a world_collision_rect (hence the "+0.1" above)~ -** Processing line: ~ right_side_collisions = state.world_collision_rects~ -** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, collision_tollerance) }~ -** Processing line: ~ .first~ +** Processing line: ~*** Performance - Static Sprites As Classes - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Static Sprites As Classes - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Static Sprites As Classes - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ return unless right_side_collisions # return unless collision occurred~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/09_performance/05_static_sprites_as_classes/app/main.rb~ +** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.static_sprites~.~ +** Processing line: ~ # bypasses the queue behavior of ~args.outputs.sprites~. All instances are held~ +** Processing line: ~ # by reference. You get better performance, but you are mutating state of held objects~ +** Processing line: ~ # which is less functional/data oriented.~ +** Processing line: ~ class Star~ +** Processing line: ~ attr_sprite~ ** Processing line: ~~ -** Processing line: ~ # player's x is set to the value of the collided rect's left, minus the size of a rect~ -** Processing line: ~ # tile size is subtracted because player's position is denoted by bottom left corner~ -** Processing line: ~ state.x = right_side_collisions[:left_right].left - state.tile_size~ -** Processing line: ~ state.dx = 0 # player isn't moving right because its path is blocked~ +** Processing line: ~ def initialize grid~ +** Processing line: ~ @grid = grid~ +** Processing line: ~ @x = (rand @grid.w) * -1~ +** Processing line: ~ @y = (rand @grid.h) * -1~ +** Processing line: ~ @w = 4~ +** Processing line: ~ @h = 4~ +** Processing line: ~ @s = 1 + (4.randomize :ratio)~ +** Processing line: ~ @path = 'sprites/tiny-star.png'~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Finds collisions between the top of the player's rect and the bottom of a world_collision_rect.~ -** Processing line: ~ def collision_ceiling!~ -** Processing line: ~ return unless state.dy > 0 # return unless player is moving up~ -** Processing line: ~ player_rect = [state.x, state.y + 0.1, state.tile_size, state.tile_size]~ -** Processing line: ~~ -** Processing line: ~ # Goes through world_collision_rects to find intersections between the bottom of a~ -** Processing line: ~ # world_collision_rect and the top of the player's rect (hence the "+0.1" above)~ -** Processing line: ~ ceil_collisions = state.world_collision_rects~ -** Processing line: ~ .find_all { |r| r[:bottom].intersect_rect?(player_rect, collision_tollerance) }~ -** Processing line: ~ .first~ -** Processing line: ~~ -** Processing line: ~ return unless ceil_collisions # return unless collision occurred~ +** Processing line: ~ def move~ +** Processing line: ~ @x += @s~ +** Processing line: ~ @y += @s~ +** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ +** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # player's y is set to the bottom y of the rect it collided with, minus the size of a rect~ -** Processing line: ~ state.y = ceil_collisions[:bottom].y - state.tile_size~ -** Processing line: ~ state.dy = 0 # if a collision occurred, the player isn't moving up because its path is blocked~ +** Processing line: ~ # calls methods needed for game to run properly~ +** 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: ~ args.gtk.console.set_command "reset_with count: 100"~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Makes sure the player remains within the screen's dimensions.~ -** Processing line: ~ def calc_edge_collision~ +** 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: ~ end~ ** Processing line: ~~ -** Processing line: ~ #Ensures that the player doesn't fall below the map.~ -** Processing line: ~ if state.y < 0~ -** Processing line: ~ state.y = 0~ -** Processing line: ~ state.dy = 0~ +** Processing line: ~ # update~ +** Processing line: ~ args.state.stars.each(&:move)~ ** Processing line: ~~ -** Processing line: ~ #Ensures that the player doesn't go too high.~ -** Processing line: ~ # Position of player is denoted by bottom left hand corner, which is why we have to subtract the~ -** Processing line: ~ # size of the player's box (so it remains visible on the screen)~ -** Processing line: ~ elsif state.y > 720 - state.tile_size # if the player's y position exceeds the height of screen~ -** Processing line: ~ state.y = 720 - state.tile_size # the player will remain as high as possible while staying on screen~ -** Processing line: ~ state.dy = 0~ -** Processing line: ~ end~ +** Processing line: ~ # render~ +** Processing line: ~ args.outputs.sprites << args.state.stars~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Ensures that the player remains in the horizontal range that it is supposed to.~ -** Processing line: ~ if state.x >= 1280 - state.tile_size && state.dx > 0 # if player moves too far right~ -** Processing line: ~ state.x = 1280 - state.tile_size # player will remain as right as possible while staying on screen~ -** Processing line: ~ state.dx = 0~ -** Processing line: ~ elsif state.x <= 0 && state.dx < 0 # if player moves too far left~ -** Processing line: ~ state.x = 0 # player will remain as left as possible while remaining on screen~ -** Processing line: ~ state.dx = 0~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ # resets game, and assigns star count given by user~ +** Processing line: ~ def reset_with count: count~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~ $gtk.args.state.star_count = count~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Processes input from the user on the keyboard.~ -** Processing line: ~ def process_inputs~ -** Processing line: ~ if inputs.mouse.down~ -** Processing line: ~ state.world_lookup = {}~ -** Processing line: ~ x, y = to_coord inputs.mouse.down.point # gets x, y coordinates for the grid~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ if state.world.any? { |loc| loc == [x, y] } # checks if coordinates duplicate~ -** Processing line: ~ state.world = state.world.reject { |loc| loc == [x, y] } # erases tile space~ -** Processing line: ~ else~ -** Processing line: ~ state.world << [x, y] # If no duplicates, adds to world collection~ -** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets dx to 0 if the player lets go of arrow keys.~ -** Processing line: ~ if inputs.keyboard.key_up.right~ -** Processing line: ~ state.dx = 0~ -** Processing line: ~ elsif inputs.keyboard.key_up.left~ -** Processing line: ~ state.dx = 0~ -** Processing line: ~ end~ +** Processing line: ~*** Performance - Static Sprites As Classes With Custom Drawing - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Static Sprites As Classes With Custom Drawing - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Static Sprites As Classes With Custom Drawing - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ # Sets dx to 3 in whatever direction the player chooses.~ -** Processing line: ~ if inputs.keyboard.key_held.right # if right key is pressed~ -** Processing line: ~ state.dx = 3~ -** Processing line: ~ elsif inputs.keyboard.key_held.left # if left key is pressed~ -** Processing line: ~ state.dx = -3~ -** Processing line: ~ end~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb~ +** Processing line: ~ # Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~.~ +** Processing line: ~ # is the fastest approach. This is comparable to what other game engines set as the default behavior.~ +** Processing line: ~ # There are tradeoffs for all this speed if the creation of a full blown class, and bypassing~ +** Processing line: ~ # functional/data-oriented practices.~ +** Processing line: ~ class Star~ +** Processing line: ~ def initialize grid~ +** Processing line: ~ @grid = grid~ +** Processing line: ~ @x = (rand @grid.w) * -1~ +** Processing line: ~ @y = (rand @grid.h) * -1~ +** Processing line: ~ @w = 4~ +** Processing line: ~ @h = 4~ +** Processing line: ~ @s = 1 + (4.randomize :ratio)~ +** Processing line: ~ @path = 'sprites/tiny-star.png'~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ #Sets dy to 5 to make the player ~fly~ when they press the space bar~ -** Processing line: ~ if inputs.keyboard.key_held.space~ -** Processing line: ~ state.dy = 5~ -** Processing line: ~ end~ +** Processing line: ~ def move~ +** Processing line: ~ @x += @s~ +** Processing line: ~ @y += @s~ +** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ +** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def to_coord point~ +** Processing line: ~ # if the object that is in args.outputs.sprites (or static_sprites)~ +** Processing line: ~ # respond_to? :draw_override, then the method is invoked giving you~ +** Processing line: ~ # access to the class used to draw to the canvas.~ +** Processing line: ~ def draw_override ffi_draw~ +** Processing line: ~ # first move then draw~ +** Processing line: ~ move~ ** Processing line: ~~ -** Processing line: ~ # Integer divides (idiv) point.x to turn into grid~ -** Processing line: ~ # Then, you can just multiply each integer by state.tile_size later so the grid coordinates.~ -** Processing line: ~ [point.x.idiv(state.tile_size), point.y.idiv(state.tile_size)]~ -** Processing line: ~ end~ +** Processing line: ~ # The argument order for ffi.draw_sprite is:~ +** Processing line: ~ # x, y, w, h, path~ +** Processing line: ~ ffi_draw.draw_sprite @x, @y, @w, @h, @path~ ** Processing line: ~~ -** Processing line: ~ # Represents the tolerance for a collision between the player's rect and another rect.~ -** Processing line: ~ def collision_tollerance~ -** Processing line: ~ 0.0~ +** Processing line: ~ # The argument order for ffi_draw.draw_sprite_2 is (pass in nil for default value):~ +** Processing line: ~ # x, y, w, h, path,~ +** Processing line: ~ # angle, alpha~ +** Processing line: ~~ +** Processing line: ~ # The argument order for ffi_draw.draw_sprite_3 is:~ +** Processing line: ~ # x, y, w, h,~ +** Processing line: ~ # path,~ +** Processing line: ~ # angle,~ +** Processing line: ~ # alpha, red_saturation, green_saturation, blue_saturation~ +** 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: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $platformer_physics = PoorManPlatformerPhysics.new~ -** Processing line: ~~ +** Processing line: ~ # calls methods needed for game to run properly~ ** Processing line: ~ def tick args~ -** Processing line: ~ $platformer_physics.grid = args.grid~ -** Processing line: ~ $platformer_physics.inputs = args.inputs~ -** Processing line: ~ $platformer_physics.state = args.state~ -** Processing line: ~ $platformer_physics.outputs = args.outputs~ -** Processing line: ~ $platformer_physics.tick~ -** Processing line: ~ tick_instructions args, "Sample app shows platformer collisions. CLICK to place box. ARROW keys to move around. SPACE to jump."~ -** Processing line: ~ end~ +** Processing line: ~ # sets console command when sample app initially opens~ +** Processing line: ~ if Kernel.global_tick_count == 0~ +** Processing line: ~ args.gtk.console.set_command "reset_with count: 100"~ +** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ +** 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: ~ 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: ~ # render framerate~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # resets game, and assigns star count given by user~ +** Processing line: ~ def reset_with count: count~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~ $gtk.args.state.star_count = count~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Physics And Collisions - Box Collision 2 - main.rb~ -- H1 detected. +** Processing line: ~*** Performance - Collision Limits - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Physics And Collisions - Box Collision 2 - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Collision Limits - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Performance - Collision Limits - 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/04_physics_and_collisions/05_box_collision_2/app/main.rb~ +** Processing line: ~ # ./samples/09_performance/07_collision_limits/app/main.rb~ ** Processing line: ~ =begin~ -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ ** Processing line: ~~ -** Processing line: ~ - times: Performs an action a specific number of times.~ -** Processing line: ~ For example, if we said~ -** Processing line: ~ 5.times puts "Hello DragonRuby",~ -** Processing line: ~ then we'd see the words "Hello DragonRuby" printed on the console 5 times.~ +** Processing line: ~ Reminders:~ +** Processing line: ~ - find_all: Finds all elements of a collection that meet certain requirements.~ +** Processing line: ~ In this sample app, we're finding all bodies that intersect with the center body.~ ** Processing line: ~~ -** Processing line: ~ - split: Divides a string into substrings based on a delimiter.~ -** Processing line: ~ For example, if we had a command~ -** Processing line: ~ "DragonRuby is awesome".split(" ")~ -** Processing line: ~ then the result would be~ -** Processing line: ~ ["DragonRuby", "is", "awesome"] because the words are separated by a space delimiter.~ +** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ +** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ +** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ ** Processing line: ~~ -** Processing line: ~ - join: Opposite of split; converts each element of array to a string separated by delimiter.~ -** Processing line: ~ For example, if we had a command~ -** Processing line: ~ ["DragonRuby","is","awesome"].join(" ")~ -** Processing line: ~ then the result would be~ -** Processing line: ~ "DragonRuby is awesome".~ +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ +** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect.~ ** Processing line: ~~ -** Processing line: ~ - to_s: Returns a string representation of an object.~ -** Processing line: ~ For example, if we had~ -** Processing line: ~ 500.to_s~ -** Processing line: ~ the string "500" would be returned.~ -** Processing line: ~ Similar to to_i, which returns an integer representation of an object.~ +** Processing line: ~ =end~ ** Processing line: ~~ -** Processing line: ~ - elapsed_time: How many frames have passed since the click event.~ +** Processing line: ~ # This code demonstrates moving objects that loop around once they exceed the scope of the screen,~ +** Processing line: ~ # which has dimensions of 1280 by 720, and also detects collisions between objects called "bodies".~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.labels: An array. Values in the array generate labels on the screen.~ -** Processing line: ~ The parameters are: [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +** Processing line: ~ def body_count num~ +** Processing line: ~ $gtk.args.state.other_bodies = num.map { [1280 * rand, 720 * rand, 10, 10] } # other_bodies set using num collection~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - inputs.mouse.down: Determines whether or not the mouse is being pressed down.~ -** Processing line: ~ The position of the mouse when it is pressed down can be found using inputs.mouse.down.point.(x|y).~ +** Processing line: ~ def tick args~ ** Processing line: ~~ -** Processing line: ~ - first: Returns the first element of the array.~ +** Processing line: ~ # Center body's values are set using an array~ +** Processing line: ~ # Map is used to set values of 2000 other bodies~ +** Processing line: ~ # All bodies that intersect with center body are stored in collisions collection~ +** Processing line: ~ args.state.center_body ||= [640 - 100, 360 - 100, 200, 200] # calculations done to place body in center~ +** Processing line: ~ args.state.other_bodies ||= 2000.map { [1280 * rand, 720 * rand, 10, 10] } # 2000 bodies given random position on screen~ ** Processing line: ~~ -** Processing line: ~ - num1.idiv(num2): Divides two numbers and returns an integer.~ +** Processing line: ~ # finds all bodies that intersect with center body, stores them in collisions~ +** Processing line: ~ collisions = args.state.other_bodies.find_all { |b| b.intersect_rect? args.state.center_body }~ ** Processing line: ~~ -** Processing line: ~ - find_all: Finds all values that satisfy specific requirements.~ +** Processing line: ~ args.borders << args.state.center_body # outputs center body as a black border~ ** Processing line: ~~ -** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect.~ +** Processing line: ~ # transparency changes based on number of collisions; the more collisions, the redder (more transparent) the box becomes~ +** Processing line: ~ args.solids << [args.state.center_body, 255, 0, 0, collisions.length * 5] # center body is red solid~ +** Processing line: ~ args.solids << args.state.other_bodies # other bodies are output as (black) solids, as well~ ** Processing line: ~~ -** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ +** Processing line: ~ args.labels << [10, 30, args.gtk.current_framerate] # outputs frame rate in bottom left corner~ ** Processing line: ~~ -** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +** Processing line: ~ # Bodies are returned to bottom left corner if positions exceed scope of screen~ +** Processing line: ~ args.state.other_bodies.each do |b| # for each body in the other_bodies collection~ +** Processing line: ~ b.x += 5 # x and y are both incremented by 5~ +** Processing line: ~ b.y += 5~ +** Processing line: ~ b.x = 0 if b.x > 1280 # x becomes 0 if star exceeds scope of screen (goes too far right)~ +** Processing line: ~ b.y = 0 if b.y > 720 # y becomes 0 if star exceeds scope of screen (goes too far up)~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ # Resets the game.~ +** Processing line: ~ $gtk.reset~ ** Processing line: ~~ -** Processing line: ~ MAP_FILE_PATH = 'app/map.txt' # the map.txt file in the app folder contains exported map~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ class MetroidvaniaStarter~ -** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs, :gtk~ ** Processing line: ~~ -** Processing line: ~ # Calls methods needed to run the game properly.~ -** Processing line: ~ def tick~ -** Processing line: ~ defaults~ -** Processing line: ~ render~ -** Processing line: ~ calc~ -** Processing line: ~ process_inputs~ +** Processing line: ~*** Advanced Debugging - Trace Debugging - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Trace Debugging - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Trace Debugging - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/10_advanced_debugging/01_trace_debugging/app/main.rb~ +** Processing line: ~ class Game~ +** Processing line: ~ attr_gtk~ +** Processing line: ~~ +** Processing line: ~ def method1 num~ +** Processing line: ~ method2 num~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets all the default variables.~ -** Processing line: ~ # '||' states that initialization occurs only in the first frame.~ -** Processing line: ~ def defaults~ -** Processing line: ~ state.tile_size = 64~ -** Processing line: ~ state.gravity = -0.2~ -** Processing line: ~ state.player_width = 60~ -** Processing line: ~ state.player_height = 64~ -** Processing line: ~ state.collision_tolerance = 0.0~ -** Processing line: ~ state.previous_tile_size ||= state.tile_size~ -** Processing line: ~ state.x ||= 0~ -** Processing line: ~ state.y ||= 800~ -** Processing line: ~ state.dy ||= 0~ -** Processing line: ~ state.dx ||= 0~ -** Processing line: ~ attempt_load_world_from_file~ -** Processing line: ~ state.world_lookup ||= { }~ -** Processing line: ~ state.world_collision_rects ||= []~ -** Processing line: ~ state.mode ||= :creating # alternates between :creating and :selecting for sprite selection~ -** Processing line: ~ state.select_menu ||= [0, 720, 1280, 720]~ -** Processing line: ~ #=======================================IMPORTANT=======================================#~ -** Processing line: ~ # When adding sprites, please label them "image1.png", "image2.png", image3".png", etc.~ -** Processing line: ~ # Once you have done that, adjust "state.sprite_quantity" to how many sprites you have.~ -** Processing line: ~ #=======================================================================================#~ -** Processing line: ~ state.sprite_quantity ||= 20 # IMPORTANT TO ALTER IF SPRITES ADDED IF YOU ADD MORE SPRITES~ -** Processing line: ~ state.sprite_coords ||= []~ -** Processing line: ~ state.banner_coords ||= [640, 680 + 720]~ -** Processing line: ~ state.sprite_selected ||= 1~ -** Processing line: ~ state.map_saved_at ||= 0~ +** Processing line: ~ def method2 num~ +** Processing line: ~ method3 num~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets all the cordinate values for the sprite selection screen into a grid~ -** Processing line: ~ # Displayed when 's' is pressed by player to access sprites~ -** Processing line: ~ if state.sprite_coords == [] # if sprite_coords is an empty array~ -** Processing line: ~ count = 1~ -** Processing line: ~ temp_x = 165 # sets a starting x and y position for display~ -** Processing line: ~ temp_y = 500 + 720~ -** Processing line: ~ state.sprite_quantity.times do # for the number of sprites you have~ -** Processing line: ~ state.sprite_coords += [[temp_x, temp_y, count]] # add element to sprite_coords array~ -** Processing line: ~ temp_x += 100 # increment temp_x~ -** Processing line: ~ count += 1 # increment count~ -** Processing line: ~ if temp_x > 1280 - (165 + 50) # if exceeding specific horizontal width on screen~ -** Processing line: ~ temp_x = 165 # a new row of sprites starts~ -** Processing line: ~ temp_y -= 75 # new row of sprites starts 75 units lower than the previous row~ -** Processing line: ~ end~ +** Processing line: ~ def method3 num~ +** Processing line: ~ method4 num~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def method4 num~ +** Processing line: ~ if num == 1~ +** Processing line: ~ puts "UNLUCKY #{num}."~ +** Processing line: ~ state.unlucky_count += 1~ +** Processing line: ~ if state.unlucky_count > 3~ +** Processing line: ~ raise "NAT 1 finally occurred. Check app/trace.txt for all method invocation history."~ ** Processing line: ~ end~ +** Processing line: ~ else~ +** Processing line: ~ puts "LUCKY #{num}."~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Places sprites~ -** Processing line: ~ def render~ -** Processing line: ~~ -** Processing line: ~ # Sets the x, y, width, height, and image path for each sprite in the world collection.~ -** Processing line: ~ outputs.sprites << state.world.map do |x, y, sprite|~ -** Processing line: ~ [x * state.tile_size, # multiply by size so grid coordinates; pixel value of location~ -** Processing line: ~ y * state.tile_size,~ -** Processing line: ~ state.tile_size,~ -** Processing line: ~ state.tile_size,~ -** Processing line: ~ 'sprites/image' + sprite.to_s + '.png'] # uses concatenation to create unique image path~ +** Processing line: ~ def tick~ +** Processing line: ~ state.roll_history ||= []~ +** Processing line: ~ state.roll_history << rand(20) + 1~ +** Processing line: ~ state.countdown ||= 600~ +** Processing line: ~ state.countdown -= 1~ +** Processing line: ~ state.unlucky_count ||= 0~ +** Processing line: ~ outputs.labels << [640, 360, "A dice roll of 1 will cause an exception.", 0, 1]~ +** Processing line: ~ if state.countdown > 0~ +** Processing line: ~ outputs.labels << [640, 340, "Dice roll countdown: #{state.countdown}", 0, 1]~ +** Processing line: ~ else~ +** Processing line: ~ state.attempts ||= 0~ +** Processing line: ~ state.attempts += 1~ +** Processing line: ~ outputs.labels << [640, 340, "ROLLING! #{state.attempts}", 0, 1]~ ** Processing line: ~ end~ +** Processing line: ~ return if state.countdown > 0~ +** Processing line: ~ method1 state.roll_history[-1]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs sprite for the player by setting x, y, width, height, and image path~ -** Processing line: ~ outputs.sprites << [state.x,~ -** Processing line: ~ state.y,~ -** Processing line: ~ state.player_width,~ -** Processing line: ~ state.player_height,'sprites/player.png']~ -** Processing line: ~~ -** Processing line: ~ # Outputs labels as primitives in top right of the screen~ -** Processing line: ~ outputs.primitives << [920, 700, 'Press \'s\' to access sprites.', 1, 0].label~ -** Processing line: ~ outputs.primitives << [920, 675, 'Click existing sprite to delete.', 1, 0].label~ -** Processing line: ~~ -** Processing line: ~ outputs.primitives << [920, 640, '<- and -> to move.', 1, 0].label~ -** Processing line: ~ outputs.primitives << [920, 615, 'Press and hold space to jump.', 1, 0].label~ -** Processing line: ~~ -** Processing line: ~ outputs.primitives << [920, 580, 'Press \'e\' to export current map.', 1, 0].label~ +** Processing line: ~ $game = Game.new~ ** Processing line: ~~ -** Processing line: ~ # if the map is saved and less than 120 frames have passed, the label is displayed~ -** Processing line: ~ if state.map_saved_at > 0 && state.map_saved_at.elapsed_time < 120~ -** Processing line: ~ outputs.primitives << [920, 555, 'Map has been exported!', 1, 0, 50, 100, 50].label~ -** Processing line: ~ end~ +** Processing line: ~ def tick args~ +** Processing line: ~ trace! $game # <------------------- TRACING ENABLED FOR THIS OBJECT~ +** Processing line: ~ $game.args = args~ +** Processing line: ~ $game.tick~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # If player hits 's', following appears~ -** Processing line: ~ if state.mode == :selecting~ -** Processing line: ~ # White background for sprite selection~ -** Processing line: ~ outputs.primitives << [state.select_menu, 255, 255, 255].solid~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # Select tile label at the top of the screen~ -** Processing line: ~ outputs.primitives << [state.banner_coords.x, state.banner_coords.y, "Select Sprite (sprites located in \"sprites\" folder)", 10, 1, 0, 0, 0, 255].label~ ** Processing line: ~~ -** Processing line: ~ # Places sprites in locations calculated in the defaults function~ -** Processing line: ~ outputs.primitives << state.sprite_coords.map do |x, y, order|~ -** Processing line: ~ [x, y, 50, 50, 'sprites/image' + order.to_s + ".png"].sprite~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~*** Advanced Debugging - Trace Debugging Classes - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Trace Debugging Classes - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Trace Debugging Classes - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ # Creates sprite following mouse to help indicate which sprite you have selected~ -** Processing line: ~ # 10 is subtracted from the mouse's x position so that the sprite is not covered by the mouse icon~ -** Processing line: ~ outputs.primitives << [inputs.mouse.position.x - 10, inputs.mouse.position.y,~ -** Processing line: ~ 10, 10, 'sprites/image' + state.sprite_selected.to_s + ".png"].sprite~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/10_advanced_debugging/02_trace_debugging_classes/app/main.rb~ +** Processing line: ~ class Foobar~ +** Processing line: ~ def initialize~ +** Processing line: ~ trace! # Trace is added to the constructor.~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calls methods that perform calculations~ -** Processing line: ~ def calc~ -** Processing line: ~ calc_in_game~ -** Processing line: ~ calc_sprite_selection~ +** Processing line: ~ def clicky args~ +** Processing line: ~ return unless args.inputs.mouse.click~ +** Processing line: ~ try_rand rand~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calls methods that perform calculations (if in creating mode)~ -** Processing line: ~ def calc_in_game~ -** Processing line: ~ return unless state.mode == :creating~ -** Processing line: ~ calc_world_lookup~ -** Processing line: ~ calc_player~ +** Processing line: ~ def try_rand num~ +** Processing line: ~ return if num < 0.9~ +** Processing line: ~ raise "Exception finally occurred. Take a look at logs/trace.txt #{num}."~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def calc_world_lookup~ -** Processing line: ~ # If the tile size isn't equal to the previous tile size,~ -** Processing line: ~ # the previous tile size is set to the tile size,~ -** Processing line: ~ # and world_lookup hash is set to empty.~ -** Processing line: ~ if state.tile_size != state.previous_tile_size~ -** Processing line: ~ state.previous_tile_size = state.tile_size~ -** Processing line: ~ state.world_lookup = {}~ -** Processing line: ~ end~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.labels << [640, 360, "Start clicking. Eventually an exception will be thrown. Then look at logs/trace.txt.", 0, 1]~ +** Processing line: ~ args.state.foobar = Foobar.new if args.tick_count~ +** Processing line: ~ return unless args.state.foobar~ +** Processing line: ~ args.state.foobar.clicky args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # return if world_lookup is not empty or if world is empty~ -** Processing line: ~ return if state.world_lookup.keys.length > 0~ -** Processing line: ~ return unless state.world.length > 0~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # Searches through the world and finds the coordinates that exist~ -** Processing line: ~ state.world_lookup = {}~ -** Processing line: ~ state.world.each { |x, y| state.world_lookup[[x, y]] = true }~ ** Processing line: ~~ -** Processing line: ~ # Assigns collision rects for every sprite drawn~ -** Processing line: ~ state.world_collision_rects =~ -** Processing line: ~ state.world_lookup~ -** Processing line: ~ .keys~ -** Processing line: ~ .map do |coord_x, coord_y|~ -** Processing line: ~ s = state.tile_size~ -** Processing line: ~ # Multiplying by s (the size of a tile) ensures that the rect is~ -** Processing line: ~ # placed exactly where you want it to be placed (causes grid to coordinate)~ -** Processing line: ~ # How many pixels horizontally across and vertically up and down~ -** Processing line: ~ x = s * coord_x~ -** Processing line: ~ y = s * coord_y~ -** Processing line: ~ {~ -** Processing line: ~ args: [coord_x, coord_y],~ -** Processing line: ~ left_right: [x, y + 4, s, s - 6], # hash keys and values~ -** Processing line: ~ top: [x + 4, y + 6, s - 8, s - 6],~ -** Processing line: ~ bottom: [x + 1, y - 1, s - 2, s - 8],~ -** Processing line: ~ }~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~*** Advanced Debugging - Unit Tests - exception_raising_tests.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - exception_raising_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 - exception_raising_tests.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ # Calculates movement of player and calls methods that perform collision calculations~ -** Processing line: ~ def calc_player~ -** Processing line: ~ state.dy += state.gravity # what goes up must come down because of gravity~ -** Processing line: ~ calc_box_collision~ -** Processing line: ~ calc_edge_collision~ -** Processing line: ~ state.y += state.dy # Since velocity is the change in position, the change in y increases by dy~ -** Processing line: ~ state.x += state.dx # Ditto line above but dx and x~ -** Processing line: ~ state.dx *= 0.8 # Scales dx down~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/exception_raising_tests.rb~ +** Processing line: ~ begin :shared~ +** Processing line: ~ class ExceptionalClass~ +** Processing line: ~ def initialize exception_to_throw = nil~ +** Processing line: ~ raise exception_to_throw if exception_to_throw~ +** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calls methods that determine whether the player collides with any world_collision_rects.~ -** Processing line: ~ def calc_box_collision~ -** Processing line: ~ return unless state.world_lookup.keys.length > 0 # return unless hash has atleast 1 key~ -** Processing line: ~ collision_floor~ -** Processing line: ~ collision_left~ -** Processing line: ~ collision_right~ -** Processing line: ~ collision_ceiling~ +** Processing line: ~ def test_exception_in_newing_object args, assert~ +** Processing line: ~ begin~ +** Processing line: ~ ExceptionalClass.new TypeError~ +** Processing line: ~ raise "Exception wasn't thrown!"~ +** Processing line: ~ rescue Exception => e~ +** Processing line: ~ assert.equal! e.class, TypeError, "Exceptions within constructor should be retained."~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Finds collisions between the bottom of the player's rect and the top of a world_collision_rect.~ -** Processing line: ~ def collision_floor~ -** Processing line: ~ return unless state.dy <= 0 # return unless player is going down or is as far down as possible~ -** Processing line: ~ player_rect = [state.x, next_y, state.tile_size, state.tile_size] # definition of player~ +** Processing line: ~ $gtk.reset 100~ +** Processing line: ~ $gtk.log_level = :off~ ** Processing line: ~~ -** Processing line: ~ # Runs through all the sprites on the field and finds all intersections between player's~ -** Processing line: ~ # bottom and the top of a rect.~ -** Processing line: ~ floor_collisions = state.world_collision_rects~ -** Processing line: ~ .find_all { |r| r[:top].intersect_rect?(player_rect, state.collision_tolerance) }~ -** Processing line: ~ .first~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ return unless floor_collisions # performs following changes if a collision has occurred~ -** Processing line: ~ state.y = floor_collisions[:top].top # y of player is set to the y of the colliding rect's top~ -** Processing line: ~ state.dy = 0 # no change in y because the player's path is blocked~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Finds collisions between the player's left side and the right side of a world_collision_rect.~ -** Processing line: ~ def collision_left~ -** Processing line: ~ return unless state.dx < 0 # return unless player is moving left~ -** Processing line: ~ player_rect = [next_x, state.y, state.tile_size, state.tile_size]~ +** Processing line: ~*** Advanced Debugging - Unit Tests - fn_tests.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - fn_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 - fn_tests.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ # Runs through all the sprites on the field and finds all intersections between the player's left side~ -** Processing line: ~ # and the right side of a rect.~ -** Processing line: ~ left_side_collisions = state.world_collision_rects~ -** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) }~ -** Processing line: ~ .first~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/fn_tests.rb~ +** Processing line: ~ def infinity~ +** Processing line: ~ 1 / 0~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def neg_infinity~ +** Processing line: ~ -1 / 0~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def nan~ +** Processing line: ~ 0.0 / 0~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_add args, assert~ +** Processing line: ~ assert.equal! (args.fn.add), 0~ +** Processing line: ~ assert.equal! (args.fn.+), 0~ +** Processing line: ~ assert.equal! (args.fn.+ 1, 2, 3), 6~ +** Processing line: ~ assert.equal! (args.fn.+ 0), 0~ +** Processing line: ~ assert.equal! (args.fn.+ 0, nil), 0~ +** Processing line: ~ assert.equal! (args.fn.+ 0, nan), nil~ +** Processing line: ~ assert.equal! (args.fn.+ 0, nil, infinity), nil~ +** Processing line: ~ assert.equal! (args.fn.+ [1, 2, 3, [4, 5, 6]]), 21~ +** Processing line: ~ assert.equal! (args.fn.+ [nil, [4, 5, 6]]), 15~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_sub args, assert~ +** Processing line: ~ neg_infinity = infinity * -1~ +** Processing line: ~ assert.equal! (args.fn.+), 0~ +** Processing line: ~ assert.equal! (args.fn.- 1, 2, 3), -4~ +** Processing line: ~ assert.equal! (args.fn.- 4), -4~ +** Processing line: ~ assert.equal! (args.fn.- 4, nan), nil~ +** Processing line: ~ assert.equal! (args.fn.- 0, nil), 0~ +** Processing line: ~ assert.equal! (args.fn.- 0, nil, infinity), nil~ +** Processing line: ~ assert.equal! (args.fn.- [0, 1, 2, 3, [4, 5, 6]]), -21~ +** Processing line: ~ assert.equal! (args.fn.- [nil, 0, [4, 5, 6]]), -15~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_div args, assert~ +** Processing line: ~ assert.equal! (args.fn.div), 1~ +** Processing line: ~ assert.equal! (args.fn./), 1~ +** Processing line: ~ assert.equal! (args.fn./ 6, 3), 2~ +** Processing line: ~ assert.equal! (args.fn./ 6, infinity), nil~ +** Processing line: ~ assert.equal! (args.fn./ 6, nan), nil~ +** Processing line: ~ assert.equal! (args.fn./ infinity), nil~ +** Processing line: ~ assert.equal! (args.fn./ 0), nil~ +** Processing line: ~ assert.equal! (args.fn./ 6, [3]), 2~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_idiv args, assert~ +** Processing line: ~ assert.equal! (args.fn.idiv), 1~ +** Processing line: ~ assert.equal! (args.fn.idiv 7, 3), 2~ +** Processing line: ~ assert.equal! (args.fn.idiv 6, infinity), nil~ +** Processing line: ~ assert.equal! (args.fn.idiv 6, nan), nil~ +** Processing line: ~ assert.equal! (args.fn.idiv infinity), nil~ +** Processing line: ~ assert.equal! (args.fn.idiv 0), nil~ +** Processing line: ~ assert.equal! (args.fn.idiv 7, [3]), 2~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_mul args, assert~ +** Processing line: ~ assert.equal! (args.fn.mul), 1~ +** Processing line: ~ assert.equal! (args.fn.*), 1~ +** Processing line: ~ assert.equal! (args.fn.* 7, 3), 21~ +** Processing line: ~ assert.equal! (args.fn.* 6, nan), nil~ +** Processing line: ~ assert.equal! (args.fn.* 6, infinity), nil~ +** Processing line: ~ assert.equal! (args.fn.* infinity), nil~ +** Processing line: ~ assert.equal! (args.fn.* 0), 0~ +** Processing line: ~ assert.equal! (args.fn.* 7, [3]), 21~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_lt args, assert~ +** Processing line: ~ assert.equal! (args.fn.lt 1), 1~ +** Processing line: ~ assert.equal! (args.fn.lt), nil~ +** Processing line: ~ assert.equal! (args.fn.lt infinity), nil~ +** Processing line: ~ assert.equal! (args.fn.lt nan), nil~ +** Processing line: ~ assert.equal! (args.fn.lt 10, 9, 8), 8~ +** Processing line: ~ assert.equal! (args.fn.< 10, 9, 8), 8~ +** Processing line: ~ assert.equal! (args.fn.< [10, 9, [8]]), 8~ +** Processing line: ~ assert.equal! (args.fn.< 10, 10), nil~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_lte args, assert~ +** Processing line: ~ assert.equal! (args.fn.lte 1), 1~ +** Processing line: ~ assert.equal! (args.fn.lte), nil~ +** Processing line: ~ assert.equal! (args.fn.lte infinity), nil~ +** Processing line: ~ assert.equal! (args.fn.lte nan), nil~ +** Processing line: ~ assert.equal! (args.fn.lte 10, 9, 8), 8~ +** Processing line: ~ assert.equal! (args.fn.lte 10, 10), 10~ +** Processing line: ~ assert.equal! (args.fn.lte 10, 9, [8]), 8~ +** Processing line: ~ assert.equal! (args.fn.<= 10, 9, 8), 8~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ return unless left_side_collisions # return unless collision occurred~ -** Processing line: ~ state.x = left_side_collisions[:left_right].right # sets player's x to the x of the colliding rect's right side~ -** Processing line: ~ state.dx = 0 # no change in x because the player's path is blocked~ -** Processing line: ~ end~ +** Processing line: ~ def test_gt args, assert~ +** Processing line: ~ assert.equal! (args.fn.gt 1), 1~ +** Processing line: ~ assert.equal! (args.fn.gt), nil~ +** Processing line: ~ assert.equal! (args.fn.gt infinity), nil~ +** Processing line: ~ assert.equal! (args.fn.gt nan), nil~ +** Processing line: ~ assert.equal! (args.fn.gt 8, 9, 10), 10~ +** Processing line: ~ assert.equal! (args.fn.gt [8, 9, [10]]), 10~ +** Processing line: ~ assert.equal! (args.fn.gt 10, 10), nil~ +** Processing line: ~ assert.equal! (args.fn.gt 10, 10), nil~ +** Processing line: ~ assert.equal! (args.fn.gt 10, 9), nil~ +** Processing line: ~ assert.equal! (args.fn.> 8, 9, 10), 10~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Finds collisions between the right side of the player and the left side of a world_collision_rect.~ -** Processing line: ~ def collision_right~ -** Processing line: ~ return unless state.dx > 0 # return unless player is moving right~ -** Processing line: ~ player_rect = [next_x, state.y, state.tile_size, state.tile_size]~ +** Processing line: ~ def test_gte args, assert~ +** Processing line: ~ assert.equal! (args.fn.gte 1), 1~ +** Processing line: ~ assert.equal! (args.fn.gte), nil~ +** Processing line: ~ assert.equal! (args.fn.gte infinity), nil~ +** Processing line: ~ assert.equal! (args.fn.gte nan), nil~ +** Processing line: ~ assert.equal! (args.fn.gte 8, 9, 10), 10~ +** Processing line: ~ assert.equal! (args.fn.gte 10, 10), 10~ +** Processing line: ~ assert.equal! (args.fn.gte 8, 9, [10]), 10~ +** Processing line: ~ assert.equal! (args.fn.gte 10, 9), nil~ +** Processing line: ~ assert.equal! (args.fn.>= 8, 9, 10), 10~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ def test_acopy args, assert~ +** Processing line: ~ orig = [1, 2, 3]~ +** Processing line: ~ clone = args.fn.acopy orig~ +** Processing line: ~ assert.equal! clone, [1, 2, 3]~ +** Processing line: ~ assert.equal! clone, orig~ +** Processing line: ~ assert.not_equal! clone.object_id, orig.object_id~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_aget args, assert~ +** Processing line: ~ assert.equal! (args.fn.aget [:a, :b, :c], 1), :b~ +** Processing line: ~ assert.equal! (args.fn.aget [:a, :b, :c], nil), nil~ +** Processing line: ~ assert.equal! (args.fn.aget nil, 1), nil~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_alength args, assert~ +** Processing line: ~ assert.equal! (args.fn.alength [:a, :b, :c]), 3~ +** Processing line: ~ assert.equal! (args.fn.alength nil), nil~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Runs through all the sprites on the field and finds all intersections between the player's~ -** Processing line: ~ # right side and the left side of a rect.~ -** Processing line: ~ right_side_collisions = state.world_collision_rects~ -** Processing line: ~ .find_all { |r| r[:left_right].intersect_rect?(player_rect, state.collision_tolerance) }~ -** Processing line: ~ .first~ +** Processing line: ~ def test_amap args, assert~ +** Processing line: ~ inc = lambda { |i| i + 1 }~ +** Processing line: ~ ary = [1, 2, 3]~ +** Processing line: ~ assert.equal! (args.fn.amap ary, inc), [2, 3, 4]~ +** Processing line: ~ assert.equal! (args.fn.amap nil, inc), nil~ +** Processing line: ~ assert.equal! (args.fn.amap ary, nil), nil~ +** Processing line: ~ assert.equal! (args.fn.amap ary, inc).class, Array~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ return unless right_side_collisions # return unless collision occurred~ -** Processing line: ~ state.x = right_side_collisions[:left_right].left - state.tile_size # player's x is set to the x of colliding rect's left side (minus tile size since x is the player's bottom left corner)~ -** Processing line: ~ state.dx = 0 # no change in x because the player's path is blocked~ -** Processing line: ~ end~ +** Processing line: ~ def test_and args, assert~ +** Processing line: ~ assert.equal! (args.fn.and 1, 2, 3, 4), 4~ +** Processing line: ~ assert.equal! (args.fn.and 1, 2, nil, 4), nil~ +** Processing line: ~ assert.equal! (args.fn.and), true~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Finds collisions between the top of the player's rect and the bottom of a world_collision_rect.~ -** Processing line: ~ def collision_ceiling~ -** Processing line: ~ return unless state.dy > 0 # return unless player is moving up~ -** Processing line: ~ player_rect = [state.x, next_y, state.player_width, state.player_height]~ +** Processing line: ~ def test_or args, assert~ +** Processing line: ~ assert.equal! (args.fn.or 1, 2, 3, 4), 1~ +** Processing line: ~ assert.equal! (args.fn.or 1, 2, nil, 4), 1~ +** Processing line: ~ assert.equal! (args.fn.or), nil~ +** Processing line: ~ assert.equal! (args.fn.or nil, nil, false, 5, 10), 5~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Runs through all the sprites on the field and finds all intersections between the player's top~ -** Processing line: ~ # and the bottom of a rect.~ -** Processing line: ~ ceil_collisions = state.world_collision_rects~ -** Processing line: ~ .find_all { |r| r[:bottom].intersect_rect?(player_rect, state.collision_tolerance) }~ -** Processing line: ~ .first~ +** Processing line: ~ def test_eq_eq args, assert~ +** Processing line: ~ assert.equal! (args.fn.eq?), true~ +** Processing line: ~ assert.equal! (args.fn.eq? 1, 0), false~ +** Processing line: ~ assert.equal! (args.fn.eq? 1, 1, 1), true~ +** Processing line: ~ assert.equal! (args.fn.== 1, 1, 1), true~ +** Processing line: ~ assert.equal! (args.fn.== nil, nil), true~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ return unless ceil_collisions # return unless collision occurred~ -** Processing line: ~ state.y = ceil_collisions[:bottom].y - state.tile_size # player's y is set to the y of the colliding rect's bottom (minus tile size)~ -** Processing line: ~ state.dy = 0 # no change in y because the player's path is blocked~ -** Processing line: ~ end~ +** Processing line: ~ def test_apply args, assert~ +** Processing line: ~ assert.equal! (args.fn.and [nil, nil, nil]), [nil, nil, nil]~ +** Processing line: ~ assert.equal! (args.fn.apply [nil, nil, nil], args.fn.method(:and)), nil~ +** Processing line: ~ and_lambda = lambda {|*xs| args.fn.and(*xs)}~ +** Processing line: ~ assert.equal! (args.fn.apply [nil, nil, nil], and_lambda), nil~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Makes sure the player remains within the screen's dimensions.~ -** Processing line: ~ def calc_edge_collision~ -** Processing line: ~ # Ensures that player doesn't fall below the map~ -** Processing line: ~ if next_y < 0 && state.dy < 0 # if player is moving down and is about to fall (next_y) below the map's scope~ -** Processing line: ~ state.y = 0 # 0 is the lowest the player can be while staying on the screen~ -** Processing line: ~ state.dy = 0~ -** Processing line: ~ # Ensures player doesn't go insanely high~ -** Processing line: ~ elsif next_y > 720 - state.tile_size && state.dy > 0 # if player is moving up, about to exceed map's scope~ -** Processing line: ~ state.y = 720 - state.tile_size # if we don't subtract tile_size, we won't be able to see the player on the screen~ -** Processing line: ~ state.dy = 0~ -** Processing line: ~ end~ +** Processing line: ~ def test_areduce args, assert~ +** Processing line: ~ assert.equal! (args.fn.areduce [1, 2, 3], 0, lambda { |i, a| i + a }), 6~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Ensures that player remains in the horizontal range its supposed to~ -** Processing line: ~ if state.x >= 1280 - state.tile_size && state.dx > 0 # if the player is moving too far right~ -** Processing line: ~ state.x = 1280 - state.tile_size # farthest right the player can be while remaining in the screen's scope~ -** Processing line: ~ state.dx = 0~ -** Processing line: ~ elsif state.x <= 0 && state.dx < 0 # if the player is moving too far left~ -** Processing line: ~ state.x = 0 # farthest left the player can be while remaining in the screen's scope~ -** Processing line: ~ state.dx = 0~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ def test_array_hash args, assert~ +** Processing line: ~ assert.equal! (args.fn.array_hash :a, 1, :b, 2), { a: 1, b: 2 }~ +** Processing line: ~ assert.equal! (args.fn.array_hash), { }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def calc_sprite_selection~ -** Processing line: ~ # Does the transition to bring down the select sprite screen~ -** Processing line: ~ if state.mode == :selecting && state.select_menu.y != 0~ -** Processing line: ~ state.select_menu.y = 0 # sets y position of select menu (shown when 's' is pressed)~ -** Processing line: ~ state.banner_coords.y = 680 # sets y position of Select Sprite banner~ -** Processing line: ~ state.sprite_coords = state.sprite_coords.map do |x, y, w, h|~ -** Processing line: ~ [x, y - 720, w, h] # sets definition of sprites (change '-' to '+' and the sprites can't be seen)~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # Does the transition to leave the select sprite screen~ -** Processing line: ~ if state.mode == :creating && state.select_menu.y != 720~ -** Processing line: ~ state.select_menu.y = 720 # sets y position of select menu (menu is retreated back up)~ -** Processing line: ~ state.banner_coords.y = 1000 # sets y position of Select Sprite banner~ -** Processing line: ~ state.sprite_coords = state.sprite_coords.map do |x, y, w, h|~ -** Processing line: ~ [x, y + 720, w, h] # sets definition of all elements in collection~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~*** Advanced Debugging - Unit Tests - gen_docs.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - gen_docs.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 - gen_docs.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/gen_docs.rb~ +** Processing line: ~ # ./dragonruby mygame --eval samples/99_zz_gtk_unit_tests/gen_docs.rb --no-tick~ +** Processing line: ~ Kernel.export_docs!~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Advanced Debugging - Unit Tests - geometry_tests.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - geometry_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 - geometry_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/geometry_tests.rb~ +** Processing line: ~ begin :shared~ +** Processing line: ~ def primitive_representations x, y, w, h~ +** Processing line: ~ [~ +** Processing line: ~ [x, y, w, h],~ +** Processing line: ~ { x: x, y: y, w: w, h: h },~ +** Processing line: ~ RectForTest.new(x, y, w, h)~ +** Processing line: ~ ]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def process_inputs~ -** Processing line: ~ # If the state.mode is back and if the menu has retreated back up~ -** Processing line: ~ # call methods that process user inputs~ -** Processing line: ~ if state.mode == :creating~ -** Processing line: ~ process_inputs_player_movement~ -** Processing line: ~ process_inputs_place_tile~ +** Processing line: ~ class RectForTest~ +** Processing line: ~ attr_sprite~ +** Processing line: ~~ +** Processing line: ~ def initialize x, y, w, h~ +** Processing line: ~ @x = x~ +** Processing line: ~ @y = y~ +** Processing line: ~ @w = w~ +** Processing line: ~ @h = h~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # For each sprite_coordinate added, check what sprite was selected~ -** Processing line: ~ if state.mode == :selecting~ -** Processing line: ~ state.sprite_coords.map do |x, y, order| # goes through all sprites in collection~ -** Processing line: ~ # checks that a specific sprite was pressed based on x, y position~ -** Processing line: ~ if inputs.mouse.down && # the && (and) sign means ALL statements must be true for the evaluation to be true~ -** Processing line: ~ inputs.mouse.down.point.x >= x && # x is greater than or equal to sprite's x and~ -** Processing line: ~ inputs.mouse.down.point.x <= x + 50 && # x is less than or equal to 50 pixels to the right~ -** Processing line: ~ inputs.mouse.down.point.y >= y && # y is greater than or equal to sprite's y~ -** Processing line: ~ inputs.mouse.down.point.y <= y + 50 # y is less than or equal to 50 pixels up~ -** Processing line: ~ state.sprite_selected = order # sprite is chosen~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ def to_s~ +** Processing line: ~ "RectForTest: #{[x, y, w, h]}"~ ** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ inputs_export_stage~ -** Processing line: ~ process_inputs_show_available_sprites~ +** Processing line: ~ begin :intersect_rect?~ +** Processing line: ~ def test_intersect_rect_point args, assert~ +** Processing line: ~ assert.true! [16, 13].intersect_rect?([13, 12, 4, 4]), "point intersects with rect."~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Moves the player based on the keys they press on their keyboard~ -** Processing line: ~ def process_inputs_player_movement~ -** Processing line: ~ # Sets dx to 0 if the player lets go of arrow keys (player won't move left or right)~ -** Processing line: ~ if inputs.keyboard.key_up.right~ -** Processing line: ~ state.dx = 0~ -** Processing line: ~ elsif inputs.keyboard.key_up.left~ -** Processing line: ~ state.dx = 0~ -** Processing line: ~ end~ +** Processing line: ~ def test_intersect_rect args, assert~ +** Processing line: ~ intersecting = primitive_representations(0, 0, 100, 100) +~ +** Processing line: ~ primitive_representations(20, 20, 20, 20)~ ** Processing line: ~~ -** Processing line: ~ # Sets dx to 3 in whatever direction the player chooses when they hold down (or press) the left or right keys~ -** Processing line: ~ if inputs.keyboard.key_held.right~ -** Processing line: ~ state.dx = 3~ -** Processing line: ~ elsif inputs.keyboard.key_held.left~ -** Processing line: ~ state.dx = -3~ +** Processing line: ~ intersecting.product(intersecting).each do |rect_one, rect_two|~ +** Processing line: ~ assert.true! rect_one.intersect_rect?(rect_two),~ +** Processing line: ~ "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected true)."~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets dy to 5 to make the player ~fly~ when they press the space bar on their keyboard~ -** Processing line: ~ if inputs.keyboard.key_held.space~ -** Processing line: ~ state.dy = 5~ +** Processing line: ~ not_intersecting = [~ +** Processing line: ~ [ 0, 0, 5, 5],~ +** Processing line: ~ { x: 10, y: 10, w: 5, h: 5 },~ +** Processing line: ~ RectForTest.new(20, 20, 5, 5)~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ not_intersecting.product(not_intersecting)~ +** Processing line: ~ .reject { |rect_one, rect_two| rect_one == rect_two }~ +** Processing line: ~ .each do |rect_one, rect_two|~ +** Processing line: ~ assert.false! rect_one.intersect_rect?(rect_two),~ +** Processing line: ~ "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected false)."~ ** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Adds tile in the place the user holds down the mouse~ -** Processing line: ~ def process_inputs_place_tile~ -** Processing line: ~ if inputs.mouse.down # if mouse is pressed~ -** Processing line: ~ state.world_lookup = {}~ -** Processing line: ~ x, y = to_coord inputs.mouse.down.point # gets x, y coordinates for the grid~ -** Processing line: ~~ -** Processing line: ~ # Checks if any coordinates duplicate (already exist in world)~ -** Processing line: ~ if state.world.any? { |existing_x, existing_y, n| existing_x == x && existing_y == y }~ -** Processing line: ~ #erases existing tile space by rejecting them from world~ -** Processing line: ~ state.world = state.world.reject do |existing_x, existing_y, n|~ -** Processing line: ~ existing_x == x && existing_y == y~ -** Processing line: ~ end~ -** Processing line: ~ else~ -** Processing line: ~ state.world << [x, y, state.sprite_selected] # If no duplicates, add the sprite~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ begin :inside_rect?~ +** Processing line: ~ def assert_inside_rect outer: nil, inner: nil, expected: nil, assert: nil~ +** Processing line: ~ assert.true! inner.inside_rect?(outer) == expected,~ +** Processing line: ~ "inside_rect? assertion failed for outer: #{outer} inner: #{inner} (expected #{expected})."~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Stores/exports world collection's info (coordinates, sprite number) into a file~ -** Processing line: ~ def inputs_export_stage~ -** Processing line: ~ if inputs.keyboard.key_down.e # if "e" is pressed~ -** Processing line: ~ export_string = state.world.map do |x, y, sprite_number| # stores world info in a string~ -** Processing line: ~ "#{x},#{y},#{sprite_number}" # using string interpolation~ -** Processing line: ~ end~ -** Processing line: ~ gtk.write_file(MAP_FILE_PATH, export_string.join("\n")) # writes string into a file~ -** Processing line: ~ state.map_saved_at = state.tick_count # frame number (passage of time) when the map was saved~ +** Processing line: ~ def test_inside_rect args, assert~ +** Processing line: ~ outer_rects = primitive_representations(0, 0, 10, 10)~ +** Processing line: ~ inner_rects = primitive_representations(1, 1, 5, 5)~ +** Processing line: ~ primitive_representations(0, 0, 10, 10).product(primitive_representations(1, 1, 5, 5))~ +** Processing line: ~ .each do |outer, inner|~ +** Processing line: ~ assert_inside_rect outer: outer, inner: inner,~ +** Processing line: ~ expected: true, assert: assert~ ** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def process_inputs_show_available_sprites~ -** Processing line: ~ # Based on keyboard input, the entity (:creating and :selecting) switch~ -** Processing line: ~ if inputs.keyboard.key_held.s && state.mode == :creating # if "s" is pressed and currently creating~ -** Processing line: ~ state.mode = :selecting # will change to selecting~ -** Processing line: ~ inputs.keyboard.clear # VERY IMPORTANT! If not present, it'll flicker between on and off~ -** Processing line: ~ elsif inputs.keyboard.key_held.s && state.mode == :selecting # if "s" is pressed and currently selecting~ -** Processing line: ~ state.mode = :creating # will change to creating~ -** Processing line: ~ inputs.keyboard.clear # VERY IMPORTANT! If not present, it'll flicker between on and off~ +** Processing line: ~ begin :angle_to~ +** Processing line: ~ def test_angle_to args, assert~ +** Processing line: ~ origins = primitive_representations(0, 0, 0, 0)~ +** Processing line: ~ rights = primitive_representations(1, 0, 0, 0)~ +** Processing line: ~ aboves = primitive_representations(0, 1, 0, 0)~ +** Processing line: ~~ +** Processing line: ~ origins.product(aboves).each do |origin, above|~ +** Processing line: ~ assert.equal! origin.angle_to(above), 90,~ +** Processing line: ~ "A point directly above should be 90 degrees."~ +** Processing line: ~~ +** Processing line: ~ assert.equal! above.angle_from(origin), 90,~ +** Processing line: ~ "A point coming from above should be 90 degrees."~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Loads the world collection by reading from the map.txt file in the app folder~ -** Processing line: ~ def attempt_load_world_from_file~ -** Processing line: ~ return if state.world # return if the world collection is already populated~ -** Processing line: ~ state.world ||= [] # initialized as an empty collection~ -** Processing line: ~ exported_world = gtk.read_file(MAP_FILE_PATH) # reads the file using the path mentioned at top of code~ -** Processing line: ~ return unless exported_world # return unless the file read was successful~ -** Processing line: ~ state.world = exported_world.each_line.map do |l| # perform action on each line of exported_world~ -** Processing line: ~ l.split(',').map(&:to_i) # calls split using ',' as a delimiter, and invokes .map on the collection,~ -** Processing line: ~ # calling to_i (converts to integers) on each element~ +** Processing line: ~ origins.product(rights).each do |origin, right|~ +** Processing line: ~ assert.equal! origin.angle_to(right) % 360, 0,~ +** Processing line: ~ "A point directly to the right should be 0 degrees."~ +** Processing line: ~~ +** Processing line: ~ assert.equal! right.angle_from(origin) % 360, 0,~ +** Processing line: ~ "A point coming from the right should be 0 degrees."~ +** Processing line: ~~ ** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Adds the change in y to y to determine the next y position of the player.~ -** Processing line: ~ def next_y~ -** Processing line: ~ state.y + state.dy~ +** Processing line: ~ begin :scale_rect~ +** Processing line: ~ def test_scale_rect args, assert~ +** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect(0.5, 0.5),~ +** Processing line: ~ [25.0, 25.0, 50.0, 50.0]~ +** Processing line: ~~ +** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect(0.5),~ +** Processing line: ~ [0.0, 0.0, 50.0, 50.0]~ +** Processing line: ~~ +** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0.5, anchor_y: 0.5),~ +** Processing line: ~ [25.0, 25.0, 50.0, 50.0]~ +** Processing line: ~~ +** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0, anchor_y: 0),~ +** Processing line: ~ [0.0, 0.0, 50.0, 50.0]~ ** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.reset 100~ +** Processing line: ~ $gtk.log_level = :off~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Advanced Debugging - Unit Tests - http_tests.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - http_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 - http_tests.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ # Determines next x position of player~ -** Processing line: ~ def next_x~ -** Processing line: ~ if state.dx < 0 # if the player moves left~ -** Processing line: ~ return state.x - (state.tile_size - state.player_width) # subtracts since the change in x is negative (player is moving left)~ -** Processing line: ~ else~ -** Processing line: ~ return state.x + (state.tile_size - state.player_width) # adds since the change in x is positive (player is moving right)~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/http_tests.rb~ +** Processing line: ~ def try_assert_or_schedule args, assert~ +** Processing line: ~ if $result[:complete]~ +** Processing line: ~ log_info "Request completed! Verifying."~ +** Processing line: ~ if $result[:http_response_code] != 200~ +** Processing line: ~ log_info "The request yielded a result of #{$result[:http_response_code]} instead of 200."~ +** Processing line: ~ exit~ +** Processing line: ~ end~ +** Processing line: ~ log_info ":try_assert_or_schedule succeeded!"~ +** Processing line: ~ else~ +** Processing line: ~ args.gtk.schedule_callback Kernel.tick_count + 10 do~ +** Processing line: ~ try_assert_or_schedule args, assert~ ** Processing line: ~ end~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ def to_coord point~ -** Processing line: ~ # Integer divides (idiv) point.x to turn into grid~ -** Processing line: ~ # Then, you can just multiply each integer by state.tile_size~ -** Processing line: ~ # later and huzzah. Grid coordinates~ -** Processing line: ~ [point.x.idiv(state.tile_size), point.y.idiv(state.tile_size)]~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $metroidvania_starter = MetroidvaniaStarter.new~ -** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ $metroidvania_starter.grid = args.grid~ -** Processing line: ~ $metroidvania_starter.inputs = args.inputs~ -** Processing line: ~ $metroidvania_starter.state = args.state~ -** Processing line: ~ $metroidvania_starter.outputs = args.outputs~ -** Processing line: ~ $metroidvania_starter.gtk = args.gtk~ -** Processing line: ~ $metroidvania_starter.tick~ +** Processing line: ~ def test_http args, assert~ +** Processing line: ~ $result = $gtk.http_get 'http://dragonruby.org'~ +** Processing line: ~ try_assert_or_schedule args, assert~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ $gtk.reset 100~ +** Processing line: ~ $gtk.log_level = :off~ +** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Physics And Collisions - Jump Physics - main.rb~ -- H1 detected. +** Processing line: ~*** Advanced Debugging - Unit Tests - nil_coercion_tests.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Physics And Collisions - Jump Physics - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - nil_coercion_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 - nil_coercion_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/04_physics_and_collisions/06_jump_physics/app/main.rb~ -** Processing line: ~ =begin~ -** Processing line: ~~ -** Processing line: ~ Reminders:~ -** Processing line: ~~ -** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ -** Processing line: ~ For example, if we want to create a new button, we would declare it as a new entity and~ -** Processing line: ~ then define its properties. (Remember, you can use state to define ANY property and it will~ -** Processing line: ~ be retained across frames.)~ +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/nil_coercion_tests.rb~ +** Processing line: ~ # numbers~ +** Processing line: ~ def test_open_entity_add_number args, assert~ +** Processing line: ~ assert.nil! args.state.i_value~ +** Processing line: ~ args.state.i_value += 5~ +** Processing line: ~ assert.equal! args.state.i_value, 5~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ -** Processing line: ~ The parameters for a solid are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ -** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~ assert.nil! args.state.f_value~ +** Processing line: ~ args.state.f_value += 5.5~ +** Processing line: ~ assert.equal! args.state.f_value, 5.5~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - num1.greater(num2): Returns the greater value.~ +** Processing line: ~ def test_open_entity_subtract_number args, assert~ +** Processing line: ~ assert.nil! args.state.i_value~ +** Processing line: ~ args.state.i_value -= 5~ +** Processing line: ~ assert.equal! args.state.i_value, -5~ ** Processing line: ~~ -** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ -** Processing line: ~ using their keys.~ +** Processing line: ~ assert.nil! args.state.f_value~ +** Processing line: ~ args.state.f_value -= 5.5~ +** Processing line: ~ assert.equal! args.state.f_value, -5.5~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect.~ +** Processing line: ~ def test_open_entity_multiply_number args, assert~ +** Processing line: ~ assert.nil! args.state.i_value~ +** Processing line: ~ args.state.i_value *= 5~ +** Processing line: ~ assert.equal! args.state.i_value, 0~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ assert.nil! args.state.f_value~ +** Processing line: ~ args.state.f_value *= 5.5~ +** Processing line: ~ assert.equal! args.state.f_value, 0~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # This sample app is a game that requires the user to jump from one platform to the next.~ -** Processing line: ~ # As the player successfully clears platforms, they become smaller and move faster.~ +** Processing line: ~ def test_open_entity_divide_number args, assert~ +** Processing line: ~ assert.nil! args.state.i_value~ +** Processing line: ~ args.state.i_value /= 5~ +** Processing line: ~ assert.equal! args.state.i_value, 0~ ** Processing line: ~~ -** Processing line: ~ class VerticalPlatformer~ -** Processing line: ~ attr_gtk~ +** Processing line: ~ assert.nil! args.state.f_value~ +** Processing line: ~ args.state.f_value /= 5.5~ +** Processing line: ~ assert.equal! args.state.f_value, 0~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # declares vertical platformer as new entity~ -** Processing line: ~ def s~ -** Processing line: ~ state.vertical_platformer ||= state.new_entity(:vertical_platformer)~ -** Processing line: ~ state.vertical_platformer~ -** Processing line: ~ end~ +** Processing line: ~ # array~ +** Processing line: ~ def test_open_entity_add_array args, assert~ +** Processing line: ~ assert.nil! args.state.values~ +** Processing line: ~ args.state.values += [:a, :b, :c]~ +** Processing line: ~ assert.equal! args.state.values, [:a, :b, :c]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # creates a new platform using a hash~ -** Processing line: ~ def new_platform hash~ -** Processing line: ~ s.new_entity_strict(:platform, hash) # platform key~ -** Processing line: ~ end~ +** Processing line: ~ def test_open_entity_subtract_array args, assert~ +** Processing line: ~ assert.nil! args.state.values~ +** Processing line: ~ args.state.values -= [:a, :b, :c]~ +** Processing line: ~ assert.equal! args.state.values, []~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # calls methods needed for game to run properly~ -** Processing line: ~ def tick~ -** Processing line: ~ defaults~ -** Processing line: ~ render~ -** Processing line: ~ calc~ -** Processing line: ~ input~ -** Processing line: ~ end~ +** Processing line: ~ def test_open_entity_shovel_array args, assert~ +** Processing line: ~ assert.nil! args.state.values~ +** Processing line: ~ args.state.values << :a~ +** Processing line: ~ assert.equal! args.state.values, [:a]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets default values~ -** Processing line: ~ def defaults~ -** Processing line: ~ s.platforms ||= [ # initializes platforms collection with two platforms using hashes~ -** Processing line: ~ new_platform(x: 0, y: 0, w: 700, h: 32, dx: 1, speed: 0, rect: nil),~ -** Processing line: ~ new_platform(x: 0, y: 300, w: 700, h: 32, dx: 1, speed: 0, rect: nil), # 300 pixels higher~ -** Processing line: ~ ]~ +** Processing line: ~ def test_open_entity_enumerate args, assert~ +** Processing line: ~ assert.nil! args.state.values~ +** Processing line: ~ args.state.values = args.state.values.map_with_index { |i| i }~ +** Processing line: ~ assert.equal! args.state.values, []~ ** Processing line: ~~ -** Processing line: ~ s.tick_count = args.state.tick_count~ -** Processing line: ~ s.gravity = -0.3 # what goes up must come down because of gravity~ -** Processing line: ~ s.player.platforms_cleared ||= 0 # counts how many platforms the player has successfully cleared~ -** Processing line: ~ s.player.x ||= 0 # sets player values~ -** Processing line: ~ s.player.y ||= 100~ -** Processing line: ~ s.player.w ||= 64~ -** Processing line: ~ s.player.h ||= 64~ -** Processing line: ~ s.player.dy ||= 0 # change in position~ -** Processing line: ~ s.player.dx ||= 0~ -** Processing line: ~ s.player_jump_power = 15~ -** Processing line: ~ s.player_jump_power_duration = 10~ -** Processing line: ~ s.player_max_run_speed = 5~ -** Processing line: ~ s.player_speed_slowdown_rate = 0.9~ -** Processing line: ~ s.player_acceleration = 1~ -** Processing line: ~ s.camera ||= { y: -100 } # shows view on screen (as the player moves upward, the camera does too)~ -** Processing line: ~ end~ +** Processing line: ~ assert.nil! args.state.values_2~ +** Processing line: ~ args.state.values_2 = args.state.values_2.map { |i| i }~ +** Processing line: ~ assert.equal! args.state.values_2, []~ ** Processing line: ~~ -** Processing line: ~ # Outputs objects onto the screen~ -** Processing line: ~ def render~ -** Processing line: ~ outputs.solids << s.platforms.map do |p| # outputs platforms onto screen~ -** Processing line: ~ [p.x + 300, p.y - s.camera[:y], p.w, p.h] # add 300 to place platform in horizontal center~ -** Processing line: ~ # don't forget, position of platform is denoted by bottom left hand corner~ -** Processing line: ~ end~ +** Processing line: ~ assert.nil! args.state.values_3~ +** Processing line: ~ args.state.values_3 = args.state.values_3.flat_map { |i| i }~ +** Processing line: ~ assert.equal! args.state.values_3, []~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # outputs player using hash~ -** Processing line: ~ outputs.solids << {~ -** Processing line: ~ x: s.player.x + 300, # player positioned on top of platform~ -** Processing line: ~ y: s.player.y - s.camera[:y],~ -** Processing line: ~ w: s.player.w,~ -** Processing line: ~ h: s.player.h,~ -** Processing line: ~ r: 100, # color saturation~ -** Processing line: ~ g: 100,~ -** Processing line: ~ b: 200~ -** Processing line: ~ }~ -** Processing line: ~ end~ +** Processing line: ~ # hashes~ +** Processing line: ~ def test_open_entity_indexer args, assert~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ assert.nil! args.state.values~ +** Processing line: ~ args.state.values[:test] = :value~ +** Processing line: ~ assert.equal! args.state.values.to_s, { entity_id: 1, entity_name: :values, entity_keys_by_ref: {}, test: :value }.to_s~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Performs calculations~ -** Processing line: ~ def calc~ -** Processing line: ~ s.platforms.each do |p| # for each platform in the collection~ -** Processing line: ~ p.rect = [p.x, p.y, p.w, p.h] # set the definition~ -** Processing line: ~ end~ +** Processing line: ~ # bug~ +** Processing line: ~ def test_open_entity_nil_bug args, assert~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ args.state.foo.a~ +** Processing line: ~ args.state.foo.b~ +** Processing line: ~ @hello[:foobar]~ +** Processing line: ~ assert.nil! args.state.foo.a, "a was not nil."~ +** Processing line: ~ # the line below fails~ +** Processing line: ~ # assert.nil! args.state.foo.b, "b was not nil."~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # sets player point by adding half the player's width to the player's x~ -** Processing line: ~ s.player.point = [s.player.x + s.player.w.half, s.player.y] # change + to - and see what happens!~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # search the platforms collection to find if the player's point is inside the rect of a platform~ -** Processing line: ~ collision = s.platforms.find { |p| s.player.point.inside_rect? p.rect }~ ** Processing line: ~~ -** Processing line: ~ # if collision occurred and player is moving down (or not moving vertically at all)~ -** Processing line: ~ if collision && s.player.dy <= 0~ -** Processing line: ~ s.player.y = collision.rect.y + collision.rect.h - 2 # player positioned on top of platform~ -** Processing line: ~ s.player.dy = 0 if s.player.dy < 0 # player stops moving vertically~ -** Processing line: ~ if !s.player.platform~ -** Processing line: ~ s.player.dx = 0 # no horizontal movement~ -** Processing line: ~ end~ -** Processing line: ~ # changes horizontal position of player by multiplying collision change in x (dx) by speed and adding it to current x~ -** Processing line: ~ s.player.x += collision.dx * collision.speed~ -** Processing line: ~ s.player.platform = collision # player is on the platform that it collided with (or landed on)~ -** Processing line: ~ if s.player.falling # if player is falling~ -** Processing line: ~ s.player.dx = 0 # no horizontal movement~ -** Processing line: ~ end~ -** Processing line: ~ s.player.falling = false~ -** Processing line: ~ s.player.jumped_at = nil~ -** Processing line: ~ else~ -** Processing line: ~ s.player.platform = nil # player is not on a platform~ -** Processing line: ~ s.player.y += s.player.dy # velocity is the change in position~ -** Processing line: ~ s.player.dy += s.gravity # acceleration is the change in velocity; what goes up must come down~ -** Processing line: ~ end~ +** Processing line: ~*** Advanced Debugging - Unit Tests - object_to_primitive_tests.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - object_to_primitive_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 - object_to_primitive_tests.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ s.platforms.each do |p| # for each platform in the collection~ -** Processing line: ~ p.x += p.dx * p.speed # x is incremented by product of dx and speed (causes platform to move horizontally)~ -** Processing line: ~ # changes platform's x so it moves left and right across the screen (between -300 and 300 pixels)~ -** Processing line: ~ if p.x < -300 # if platform goes too far left~ -** Processing line: ~ p.dx *= -1 # dx is scaled down~ -** Processing line: ~ p.x = -300 # as far left as possible within scope~ -** Processing line: ~ elsif p.x > (1000 - p.w) # if platform's x is greater than 300~ -** Processing line: ~ p.dx *= -1~ -** Processing line: ~ p.x = (1000 - p.w) # set to 300 (as far right as possible within scope)~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/object_to_primitive_tests.rb~ +** Processing line: ~ class PlayerSpriteForTest~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ delta = (s.player.y - s.camera[:y] - 100) # used to position camera view~ +** Processing line: ~ def test_array_to_sprite args, assert~ +** Processing line: ~ array = [[0, 0, 100, 100, "test.png"]].sprites~ +** Processing line: ~ puts "No exception was thrown. Sweet!"~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if delta > -200~ -** Processing line: ~ s.camera[:y] += delta * 0.01 # allows player to see view as they move upwards~ -** Processing line: ~ s.player.x += s.player.dx # velocity is change in position; change in x increases by dx~ +** Processing line: ~ def test_class_to_sprite args, assert~ +** Processing line: ~ array = [PlayerSprite.new].sprites~ +** Processing line: ~ assert.true! array.first.is_a?(PlayerSprite)~ +** Processing line: ~ puts "No exception was thrown. Sweet!"~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # searches platform collection to find platforms located more than 300 pixels above the player~ -** Processing line: ~ has_platforms = s.platforms.find { |p| p.y > (s.player.y + 300) }~ -** Processing line: ~ if !has_platforms # if there are no platforms 300 pixels above the player~ -** Processing line: ~ width = 700 - (700 * (0.1 * s.player.platforms_cleared)) # the next platform is smaller than previous~ -** Processing line: ~ s.player.platforms_cleared += 1 # player successfully cleared another platform~ -** Processing line: ~ last_platform = s.platforms[-1] # platform just cleared becomes last platform~ -** Processing line: ~ # another platform is created 300 pixels above the last platform, and this~ -** Processing line: ~ # new platform has a smaller width and moves faster than all previous platforms~ -** Processing line: ~ s.platforms << new_platform(x: (700 - width) * rand, # random x position~ -** Processing line: ~ y: last_platform.y + 300,~ -** Processing line: ~ w: width,~ -** Processing line: ~ h: 32,~ -** Processing line: ~ dx: 1.randomize(:sign), # random change in x~ -** Processing line: ~ speed: 2 * s.player.platforms_cleared,~ -** Processing line: ~ rect: nil)~ -** Processing line: ~ end~ -** Processing line: ~ else~ -** Processing line: ~ s.as_hash.clear # otherwise clear the hash (no new platform is necessary)~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ $gtk.reset 100~ +** Processing line: ~ $gtk.log_level = :off~ ** Processing line: ~~ -** Processing line: ~ # Takes input from the user to move the player~ -** Processing line: ~ def input~ -** Processing line: ~ if inputs.keyboard.space # if the space bar is pressed~ -** Processing line: ~ s.player.jumped_at ||= s.tick_count # set to current frame~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # if the time that has passed since the jump is less than the duration of a jump (10 frames)~ -** Processing line: ~ # and the player is not falling~ -** Processing line: ~ if s.player.jumped_at.elapsed_time < s.player_jump_power_duration && !s.player.falling~ -** Processing line: ~ s.player.dy = s.player_jump_power # player jumps up~ -** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if inputs.keyboard.key_up.space # if space bar is in "up" state~ -** Processing line: ~ s.player.falling = true # player is falling~ -** Processing line: ~ end~ +** Processing line: ~*** Advanced Debugging - Unit Tests - parsing_tests.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - parsing_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 - parsing_tests.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ if inputs.keyboard.left # if left key is pressed~ -** Processing line: ~ s.player.dx -= s.player_acceleration # player's position changes, decremented by acceleration~ -** Processing line: ~ s.player.dx = s.player.dx.greater(-s.player_max_run_speed) # dx is either current dx or -5, whichever is greater~ -** Processing line: ~ elsif inputs.keyboard.right # if right key is pressed~ -** Processing line: ~ s.player.dx += s.player_acceleration # player's position changes, incremented by acceleration~ -** Processing line: ~ s.player.dx = s.player.dx.lesser(s.player_max_run_speed) # dx is either current dx or 5, whichever is lesser~ -** Processing line: ~ else~ -** Processing line: ~ s.player.dx *= s.player_speed_slowdown_rate # scales dx down~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/parsing_tests.rb~ +** Processing line: ~ def test_parse_json args, assert~ +** Processing line: ~ result = args.gtk.parse_json '{ "name": "John Doe", "aliases": ["JD"] }'~ +** Processing line: ~ assert.equal! result, { "name"=>"John Doe", "aliases"=>["JD"] }, "Parsing JSON failed."~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $game = VerticalPlatformer.new~ +** Processing line: ~ def test_parse_xml args, assert~ +** Processing line: ~ result = args.gtk.parse_xml <<-S~ +** Processing line: ~ ~ +** Processing line: ~ John Doe~ +** Processing line: ~ ~ +** Processing line: ~ S~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ $game.args = args~ -** Processing line: ~ $game.tick~ +** Processing line: ~ expected = {:type=>:element,~ +** Processing line: ~ :name=>nil,~ +** Processing line: ~ :children=>[{:type=>:element,~ +** Processing line: ~ :name=>"Person",~ +** Processing line: ~ :children=>[{:type=>:element,~ +** Processing line: ~ :name=>"Name",~ +** Processing line: ~ :children=>[{:type=>:content,~ +** Processing line: ~ :data=>"John Doe"}]}],~ +** Processing line: ~ :attributes=>{"id"=>"100"}}]}~ +** Processing line: ~~ +** Processing line: ~ assert.equal! result, expected, "Parsing xml failed."~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ $gtk.reset 100~ +** Processing line: ~ $gtk.log_level = :off~ +** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Mouse - Mouse Click - main.rb~ -- H1 detected. +** Processing line: ~*** Advanced Debugging - Unit Tests - require_tests.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Mouse - Mouse Click - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - require_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 - require_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/05_mouse/01_mouse_click/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/require_tests.rb~ +** Processing line: ~ def write_src path, src~ +** Processing line: ~ $gtk.write_file path, src~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~ write_src 'app/unit_testing_game.rb', <<-S~ +** Processing line: ~ module UnitTesting~ +** Processing line: ~ class Game~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ S~ ** Processing line: ~~ -** Processing line: ~ - product: Returns an array of all combinations of elements from all arrays.~ +** Processing line: ~ write_src 'lib/unit_testing_lib.rb', <<-S~ +** Processing line: ~ module UnitTesting~ +** Processing line: ~ class Lib~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ S~ ** Processing line: ~~ -** Processing line: ~ For example, [1,2].product([1,2]) would return the following array...~ -** Processing line: ~ [[1,1], [1,2], [2,1], [2,2]]~ -** Processing line: ~ More than two arrays can be given to product and it will still work,~ -** Processing line: ~ such as [1,2].product([1,2],[3,4]). What would product return in this case?~ +** Processing line: ~ write_src 'app/nested/unit_testing_nested.rb', <<-S~ +** Processing line: ~ module UnitTesting~ +** Processing line: ~ class Nested~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ S~ ** Processing line: ~~ -** Processing line: ~ Answer:~ -** Processing line: ~ [[1,1,3],[1,1,4],[1,2,3],[1,2,4],[2,1,3],[2,1,4],[2,2,3],[2,2,4]]~ +** Processing line: ~ require 'app/unit_testing_game.rb'~ +** Processing line: ~ require 'app/nested/unit_testing_nested.rb'~ +** Processing line: ~ require 'lib/unit_testing_lib.rb'~ ** Processing line: ~~ -** Processing line: ~ - num1.fdiv(num2): Returns the float division (will have a decimal) of the two given numbers.~ -** Processing line: ~ For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0~ +** Processing line: ~ def test_require args, assert~ +** Processing line: ~ UnitTesting::Game.new~ +** Processing line: ~ UnitTesting::Lib.new~ +** Processing line: ~ UnitTesting::Nested.new~ +** Processing line: ~ $gtk.exec 'rm ./mygame/app/unit_testing_game.rb'~ +** Processing line: ~ $gtk.exec 'rm ./mygame/app/nested/unit_testing_nested.rb'~ +** Processing line: ~ $gtk.exec 'rm ./mygame/lib/unit_testing_lib.rb'~ +** Processing line: ~ assert.ok!~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - yield: Allows you to call a method with a code block and yield to that block.~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ Reminders:~ ** Processing line: ~~ -** Processing line: ~ - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect.~ +** Processing line: ~*** Advanced Debugging - Unit Tests - serialize_deserialize_tests.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - serialize_deserialize_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 - serialize_deserialize_tests.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/serialize_deserialize_tests.rb~ +** Processing line: ~ def test_serialize args, assert~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ args.state.player_one = "test"~ +** Processing line: ~ result = args.gtk.serialize_state args.state~ +** Processing line: ~ assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ args.gtk.write_file 'state.txt', ''~ +** Processing line: ~ result = args.gtk.serialize_state 'state.txt', args.state~ +** Processing line: ~ assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - Ternary operator (?): Will evaluate a statement (just like an if statement)~ -** Processing line: ~ and perform an action if the result is true or another action if it is false.~ +** Processing line: ~ def test_deserialize args, assert~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ result = args.gtk.deserialize_state '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}'~ +** Processing line: ~ assert.equal! result.player_one, "test"~ ** Processing line: ~~ -** Processing line: ~ - reject: Removes elements from a collection if they meet certain requirements.~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ args.gtk.write_file 'state.txt', '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}'~ +** Processing line: ~ result = args.gtk.deserialize_state 'state.txt'~ +** Processing line: ~ assert.equal! result.player_one, "test"~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.borders: An array. The values generate a border.~ -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ -** Processing line: ~ For more information about borders, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~ def test_very_large_serialization args, assert~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ size = 3000~ +** Processing line: ~ size.map_with_index do |i|~ +** Processing line: ~ args.state.send("k#{i}=".to_sym, i)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.~ +** Processing line: ~ result = args.gtk.serialize_state args.state~ +** Processing line: ~ assert.true! (args.gtk.console.log.join.include? "unlikely a string this large will deserialize correctly")~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ def test_strict_entity_serialization args, assert~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ args.state.player_one = args.state.new_entity(:player, name: "Ryu")~ +** Processing line: ~ args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken")~ ** Processing line: ~~ -** Processing line: ~ # This sample app is a classic game of Tic Tac Toe.~ +** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ +** Processing line: ~ assert.equal! serialized_state, '{:entity_id=>1, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>3, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken"}}'~ ** Processing line: ~~ -** Processing line: ~ class TicTacToe~ -** Processing line: ~ attr_accessor :_, :state, :outputs, :inputs, :grid, :gtk~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ deserialize_state = args.gtk.deserialize_state serialized_state~ ** Processing line: ~~ -** Processing line: ~ # Starts the game with player x's turn and creates an array (to_a) for space combinations.~ -** Processing line: ~ # Calls methods necessary for the game to run properly.~ -** Processing line: ~ def tick~ -** Processing line: ~ state.current_turn ||= :x~ -** Processing line: ~ state.space_combinations = [-1, 0, 1].product([-1, 0, 1]).to_a~ -** Processing line: ~ render_board~ -** Processing line: ~ input_board~ -** Processing line: ~ end~ +** Processing line: ~ assert.equal! args.state.player_one.name, deserialize_state.player_one.name~ +** Processing line: ~ assert.true! args.state.player_one.is_a? GTK::OpenEntity~ ** Processing line: ~~ -** Processing line: ~ # Uses borders to create grid squares for the game's board. Also outputs the game pieces using labels.~ -** Processing line: ~ def render_board~ -** Processing line: ~ square_size = 80~ +** Processing line: ~ assert.equal! args.state.player_two.name, deserialize_state.player_two.name~ +** Processing line: ~ assert.true! args.state.player_two.is_a? GTK::StrictEntity~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Positions the game's board in the center of the screen.~ -** Processing line: ~ # Try removing what follows grid.w_half or grid.h_half and see how the position changes!~ -** Processing line: ~ board_left = grid.w_half - square_size * 1.5~ -** Processing line: ~ board_top = grid.h_half - square_size * 1.5~ +** Processing line: ~ def test_strict_entity_serialization_with_nil args, assert~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ args.state.player_one = args.state.new_entity(:player, name: "Ryu")~ +** Processing line: ~ args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken", blood_type: nil)~ ** Processing line: ~~ -** Processing line: ~ # At first glance, the add(1) looks pretty trivial. But if you remove it,~ -** Processing line: ~ # you'll see that the positioning of the board would be skewed without it!~ -** Processing line: ~ # Or if you put 2 in the parenthesis, the pieces will be placed in the wrong squares~ -** Processing line: ~ # due to the change in board placement.~ -** Processing line: ~ outputs.borders << all_spaces do |x, y, space| # outputs borders for all board spaces~ -** Processing line: ~ space.border ||= [~ -** Processing line: ~ board_left + x.add(1) * square_size, # space.border is initialized using this definition~ -** Processing line: ~ board_top + y.add(1) * square_size,~ -** Processing line: ~ square_size,~ -** Processing line: ~ square_size~ -** Processing line: ~ ]~ -** Processing line: ~ end~ +** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ +** Processing line: ~ assert.equal! serialized_state, '{:entity_id=>9, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}'~ ** Processing line: ~~ -** Processing line: ~ # Again, the calculations ensure that the piece is placed in the center of the grid square.~ -** Processing line: ~ # Remove the '- 20' and the piece will be placed at the top of the grid square instead of the center.~ -** Processing line: ~ outputs.labels << filled_spaces do |x, y, space| # put label in each filled space of board~ -** Processing line: ~ label board_left + x.add(1) * square_size + square_size.fdiv(2),~ -** Processing line: ~ board_top + y.add(1) * square_size + square_size - 20,~ -** Processing line: ~ space.piece # text of label, either "x" or "o"~ -** Processing line: ~ end~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ ** Processing line: ~~ -** Processing line: ~ # Uses a label to output whether x or o won, or if a draw occurred.~ -** Processing line: ~ # If the game is ongoing, a label shows whose turn it currently is.~ -** Processing line: ~ outputs.labels << if state.x_won~ -** Processing line: ~ label grid.w_half, grid.top - 80, "x won" # the '-80' positions the label 80 pixels lower than top~ -** Processing line: ~ elsif state.o_won~ -** Processing line: ~ label grid.w_half, grid.top - 80, "o won" # grid.w_half positions the label in the center horizontally~ -** Processing line: ~ elsif state.draw~ -** Processing line: ~ label grid.w_half, grid.top - 80, "a draw"~ -** Processing line: ~ else # if no one won and the game is ongoing~ -** Processing line: ~ label grid.w_half, grid.top - 80, "turn: #{state.current_turn}"~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ assert.equal! args.state.player_one.name, deserialized_state.player_one.name~ +** Processing line: ~ assert.true! args.state.player_one.is_a? GTK::OpenEntity~ ** Processing line: ~~ -** Processing line: ~ # Calls the methods responsible for handling user input and determining the winner.~ -** Processing line: ~ # Does nothing unless the mouse is clicked.~ -** Processing line: ~ def input_board~ -** Processing line: ~ return unless inputs.mouse.click~ -** Processing line: ~ input_place_piece~ -** Processing line: ~ input_restart_game~ -** Processing line: ~ determine_winner~ -** Processing line: ~ end~ +** Processing line: ~ assert.equal! args.state.player_two.name, deserialized_state.player_two.name~ +** Processing line: ~ assert.equal! args.state.player_two.blood_type, deserialized_state.player_two.blood_type~ +** Processing line: ~ assert.equal! deserialized_state.player_two.blood_type, nil~ +** Processing line: ~ assert.true! args.state.player_two.is_a? GTK::StrictEntity~ ** Processing line: ~~ -** Processing line: ~ # Handles user input for placing pieces on the board.~ -** Processing line: ~ def input_place_piece~ -** Processing line: ~ return if state.game_over~ +** Processing line: ~ deserialized_state.player_two.blood_type = :O~ +** Processing line: ~ assert.equal! deserialized_state.player_two.blood_type, :O~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Checks to find the space that the mouse was clicked inside of, and makes sure the space does not already~ -** Processing line: ~ # have a piece in it.~ -** Processing line: ~ __, __, space = all_spaces.find do |__, __, space|~ -** Processing line: ~ inputs.mouse.click.point.inside_rect?(space.border) && !space.piece~ -** Processing line: ~ end~ +** Processing line: ~ def test_multiple_strict_entities args, assert~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ args.state.player = args.state.new_entity_strict(:player_one, name: "Ryu")~ +** Processing line: ~ args.state.enemy = args.state.new_entity_strict(:enemy, name: "Bison", other_property: 'extra mean')~ ** Processing line: ~~ -** Processing line: ~ # The piece that goes into the space belongs to the player whose turn it currently is.~ -** Processing line: ~ return unless space~ -** Processing line: ~ space.piece = state.current_turn~ +** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ ** Processing line: ~~ -** Processing line: ~ # This ternary operator statement allows us to change the current player's turn.~ -** Processing line: ~ # If it is currently x's turn, it becomes o's turn. If it is not x's turn, it become's x's turn.~ -** Processing line: ~ state.current_turn = state.current_turn == :x ? :o : :x~ -** Processing line: ~ end~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ ** Processing line: ~~ -** Processing line: ~ # Resets the game.~ -** Processing line: ~ def input_restart_game~ -** Processing line: ~ return unless state.game_over~ -** Processing line: ~ gtk.reset~ -** Processing line: ~ end~ +** Processing line: ~ assert.equal! deserialized_state.player.name, "Ryu"~ +** Processing line: ~ assert.equal! deserialized_state.enemy.other_property, "extra mean"~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Checks if x or o won the game.~ -** Processing line: ~ # If neither player wins and all nine squares are filled, a draw happens.~ -** Processing line: ~ # Once a player is chosen as the winner or a draw happens, the game is over.~ -** Processing line: ~ def determine_winner~ -** Processing line: ~ state.x_won = won? :x # evaluates to either true or false (boolean values)~ -** Processing line: ~ state.o_won = won? :o~ -** Processing line: ~ state.draw = true if filled_spaces.length == 9 && !state.x_won && !state.o_won~ -** Processing line: ~ state.game_over = state.x_won || state.o_won || state.draw~ +** Processing line: ~ def test_by_reference_state args, assert~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ args.state.a = { name: "Jane Doe" }~ +** Processing line: ~ args.state.b = args.state.a~ +** Processing line: ~ assert.equal! args.state.a.object_id, args.state.b.object_id~ +** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ +** Processing line: ~~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ +** Processing line: ~ assert.equal! deserialized_state.a.object_id, deserialized_state.b.object_id~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_by_reference_state_strict_entities args, assert~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ args.state.a = { name: "Jane Doe" }~ +** Processing line: ~ args.state.strict_entity = args.state.new_entity_strict(:couple) do |e|~ +** Processing line: ~ e.one = args.state.new_entity_strict(:person, name: "Jane")~ +** Processing line: ~ e.two = e.one~ ** Processing line: ~ end~ +** Processing line: ~ assert.equal! args.state.strict_entity.one, args.state.strict_entity.two~ +** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ ** Processing line: ~~ -** Processing line: ~ # Determines if a player won by checking if there is a horizontal match or vertical match.~ -** Processing line: ~ # Horizontal_match and vertical_match have boolean values. If either is true, the game has been won.~ -** Processing line: ~ def won? piece~ -** Processing line: ~ # performs action on all space combinations~ -** Processing line: ~ won = [[-1, 0, 1]].product([-1, 0, 1]).map do |xs, y|~ +** Processing line: ~ GTK::Entity.__reset_id__!~ +** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ +** Processing line: ~ assert.equal! deserialized_state.strict_entity.one, deserialized_state.strict_entity.two~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Checks if the 3 grid spaces with the same y value (or same row) and~ -** Processing line: ~ # x values that are next to each other have pieces that belong to the same player.~ -** Processing line: ~ # Remember, the value of piece is equal to the current turn (which is the player).~ -** Processing line: ~ horizontal_match = state.spaces[xs[0]][y].piece == piece &&~ -** Processing line: ~ state.spaces[xs[1]][y].piece == piece &&~ -** Processing line: ~ state.spaces[xs[2]][y].piece == piece~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # Checks if the 3 grid spaces with the same x value (or same column) and~ -** Processing line: ~ # y values that are next to each other have pieces that belong to the same player.~ -** Processing line: ~ # The && represents an "and" statement: if even one part of the statement is false,~ -** Processing line: ~ # the entire statement evaluates to false.~ -** Processing line: ~ vertical_match = state.spaces[y][xs[0]].piece == piece &&~ -** Processing line: ~ state.spaces[y][xs[1]].piece == piece &&~ -** Processing line: ~ state.spaces[y][xs[2]].piece == piece~ ** Processing line: ~~ -** Processing line: ~ horizontal_match || vertical_match # if either is true, true is returned~ -** Processing line: ~ end~ +** Processing line: ~*** Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - state_serialization_experimental_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 - state_serialization_experimental_tests.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ # Sees if there is a diagonal match, starting from the bottom left and ending at the top right.~ -** Processing line: ~ # Is added to won regardless of whether the statement is true or false.~ -** Processing line: ~ won << (state.spaces[-1][-1].piece == piece && # bottom left~ -** Processing line: ~ state.spaces[ 0][ 0].piece == piece && # center~ -** Processing line: ~ state.spaces[ 1][ 1].piece == piece) # top right~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/state_serialization_experimental_tests.rb~ +** Processing line: ~ MAX_CODE_GEN_LENGTH = 50~ ** Processing line: ~~ -** Processing line: ~ # Sees if there is a diagonal match, starting at the bottom right and ending at the top left~ -** Processing line: ~ # and is added to won.~ -** Processing line: ~ won << (state.spaces[ 1][-1].piece == piece && # bottom right~ -** Processing line: ~ state.spaces[ 0][ 0].piece == piece && # center~ -** Processing line: ~ state.spaces[-1][ 1].piece == piece) # top left~ +** Processing line: ~ # NOTE: This is experimental/advanced stuff.~ +** Processing line: ~ def needs_partitioning? target~ +** Processing line: ~ target[:value].to_s.length > MAX_CODE_GEN_LENGTH~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Any false statements (meaning false diagonal matches) are rejected from won~ -** Processing line: ~ won.reject_false.any?~ +** Processing line: ~ def partition target~ +** Processing line: ~ return [] unless needs_partitioning? target~ +** Processing line: ~ if target[:value].is_a? GTK::OpenEntity~ +** Processing line: ~ target[:value] = target[:value].hash~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Defines filled spaces on the board by rejecting all spaces that do not have game pieces in them.~ -** Processing line: ~ # The ! before a statement means "not". For example, we are rejecting any space combinations that do~ -** Processing line: ~ # NOT have pieces in them.~ -** Processing line: ~ def filled_spaces~ -** Processing line: ~ state.space_combinations~ -** Processing line: ~ .reject { |x, y| !state.spaces[x][y].piece } # reject spaces with no pieces in them~ -** Processing line: ~ .map do |x, y|~ -** Processing line: ~ if block_given?~ -** Processing line: ~ yield x, y, state.spaces[x][y]~ -** Processing line: ~ else~ -** Processing line: ~ [x, y, state.spaces[x][y]] # sets definition of space~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ results = []~ +** Processing line: ~ idx = 0~ +** Processing line: ~ left, right = target[:value].partition do~ +** Processing line: ~ idx += 1~ +** Processing line: ~ idx.even?~ ** Processing line: ~ end~ +** Processing line: ~ left, right = Hash[left], Hash[right]~ +** Processing line: ~ left = { value: left }~ +** Processing line: ~ right = { value: right}~ +** Processing line: ~ [left, right]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Defines all spaces on the board.~ -** Processing line: ~ def all_spaces~ -** Processing line: ~ if !block_given?~ -** Processing line: ~ state.space_combinations.map do |x, y|~ -** Processing line: ~ [x, y, state.spaces[x][y]] # sets definition of space~ -** Processing line: ~ end~ -** Processing line: ~ else # if a block is given (block_given? is true)~ -** Processing line: ~ state.space_combinations.map do |x, y|~ -** Processing line: ~ yield x, y, state.spaces[x][y] # yield if a block is given~ +** Processing line: ~ def add_partition target, path, aggregate, final_result~ +** Processing line: ~ partitions = partition target~ +** Processing line: ~ partitions.each do |part|~ +** Processing line: ~ if needs_partitioning? part~ +** Processing line: ~ if part[:value].keys.length == 1~ +** Processing line: ~ first_key = part[:value].keys[0]~ +** Processing line: ~ new_part = { value: part[:value][first_key] }~ +** Processing line: ~ path.push first_key~ +** Processing line: ~ add_partition new_part, path, aggregate, final_result~ +** Processing line: ~ path.pop~ +** Processing line: ~ else~ +** Processing line: ~ add_partition part, path, aggregate, final_result~ ** Processing line: ~ end~ +** Processing line: ~ else~ +** Processing line: ~ final_result << { value: { __path__: [*path] } }~ +** Processing line: ~ final_result << { value: part[:value] }~ ** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets values for a label, such as the position, value, size, alignment, and color.~ -** Processing line: ~ def label x, y, value~ -** Processing line: ~ [x, y + 10, value, 20, 1, 0, 0, 0]~ -** Processing line: ~ end~ +** Processing line: ~ def state_to_string state~ +** Processing line: ~ parts_queue = []~ +** Processing line: ~ final_queue = []~ +** Processing line: ~ add_partition({ value: state.hash },~ +** Processing line: ~ [],~ +** Processing line: ~ parts_queue,~ +** Processing line: ~ final_queue)~ +** Processing line: ~ final_queue.reject {|i| i[:value].keys.length == 0}.map do |i|~ +** Processing line: ~ i[:value].to_s~ +** Processing line: ~ end.join("\n#==================================================#\n")~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $tic_tac_toe = TicTacToe.new~ +** Processing line: ~ def state_from_string string~ +** Processing line: ~ Kernel.eval("$load_data = {}")~ +** Processing line: ~ lines = string.split("\n#==================================================#\n")~ +** Processing line: ~ lines.each do |l|~ +** Processing line: ~ puts "todo: #{l}"~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ $tic_tac_toe._ = args~ -** Processing line: ~ $tic_tac_toe.state = args.state~ -** Processing line: ~ $tic_tac_toe.outputs = args.outputs~ -** Processing line: ~ $tic_tac_toe.inputs = args.inputs~ -** Processing line: ~ $tic_tac_toe.grid = args.grid~ -** Processing line: ~ $tic_tac_toe.gtk = args.gtk~ -** Processing line: ~ $tic_tac_toe.tick~ -** Processing line: ~ tick_instructions args, "Sample app shows how to work with mouse clicks."~ +** Processing line: ~ GTK::OpenEntity.parse_from_hash $load_data~ ** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ +** Processing line: ~ def test_save_and_load args, assert~ +** Processing line: ~ args.state.item_1.name = "Jane"~ +** Processing line: ~ string = state_to_string args.state~ +** Processing line: ~ state = state_from_string string~ +** Processing line: ~ assert.equal! args.state.item_1.name, state.item_1.name~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_save_and_load_big args, assert~ +** Processing line: ~ size = 1000~ +** Processing line: ~ size.map_with_index do |i|~ +** Processing line: ~ args.state.send("k#{i}=".to_sym, i)~ ** 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: ~ string = state_to_string args.state~ +** Processing line: ~ state = state_from_string string~ +** Processing line: ~ size.map_with_index do |i|~ +** Processing line: ~ assert.equal! args.state.send("k#{i}".to_sym), state.send("k#{i}".to_sym)~ +** Processing line: ~ assert.equal! args.state.send("k#{i}".to_sym), i~ +** Processing line: ~ assert.equal! state.send("k#{i}".to_sym), i~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def test_save_and_load_big_nested args, assert~ +** Processing line: ~ args.state.player_one.friend.nested_hash.k0 = 0~ +** Processing line: ~ args.state.player_one.friend.nested_hash.k1 = 1~ +** Processing line: ~ args.state.player_one.friend.nested_hash.k2 = 2~ +** Processing line: ~ args.state.player_one.friend.nested_hash.k3 = 3~ +** Processing line: ~ args.state.player_one.friend.nested_hash.k4 = 4~ +** Processing line: ~ args.state.player_one.friend.nested_hash.k5 = 5~ +** Processing line: ~ args.state.player_one.friend.nested_hash.k6 = 6~ +** Processing line: ~ args.state.player_one.friend.nested_hash.k7 = 7~ +** Processing line: ~ args.state.player_one.friend.nested_hash.k8 = 8~ +** Processing line: ~ args.state.player_one.friend.nested_hash.k9 = 9~ +** Processing line: ~ string = state_to_string args.state~ +** Processing line: ~ state = state_from_string string~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ $gtk.reset 100~ +** Processing line: ~ $gtk.log_level = :off~ +** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Mouse - Mouse Move - main.rb~ -- H1 detected. +** Processing line: ~*** Advanced Debugging - Unit Tests - suggest_autocompletion_tests.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Mouse - Mouse Move - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Advanced Debugging - Unit Tests - suggest_autocompletion_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 - suggest_autocompletion_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/05_mouse/02_mouse_move/app/main.rb~ -** Processing line: ~ =begin~ -** Processing line: ~~ -** Processing line: ~ Reminders:~ -** Processing line: ~~ -** Processing line: ~ - num1.greater(num2): Returns the greater value.~ -** Processing line: ~ For example, if we have the command~ -** Processing line: ~ puts 4.greater(3)~ -** Processing line: ~ the number 4 would be printed to the console since it has a greater value than 3.~ -** Processing line: ~ Similar to lesser, which returns the lesser value.~ -** Processing line: ~~ -** Processing line: ~ - find_all: Finds all elements of a collection that meet certain requirements.~ -** Processing line: ~ For example, in this sample app, we're using find_all to find all zombies that have intersected~ -** Processing line: ~ or hit the player's sprite since these zombies have been killed.~ -** Processing line: ~~ -** Processing line: ~ - args.inputs.keyboard.key_down.KEY: Determines if a key is being held or pressed.~ -** Processing line: ~ Stores the frame the "down" event occurred.~ -** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ -** Processing line: ~~ -** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE]~ -** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ -** Processing line: ~~ -** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ -** Processing line: ~ When we want to create a new object, we can declare it as a new entity and then define~ -** Processing line: ~ its properties. (Remember, you can use state to define ANY property and it will~ -** Processing line: ~ be retained across frames.)~ -** Processing line: ~~ -** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ -** Processing line: ~~ -** Processing line: ~ - map: Ruby method used to transform data; used in arrays, hashes, and collections.~ -** Processing line: ~ Can be used to perform an action on every element of a collection, such as multiplying~ -** Processing line: ~ each element by 2 or declaring every element as a new entity.~ +** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/suggest_autocompletion_tests.rb~ +** Processing line: ~ def default_suggest_autocompletion args~ +** Processing line: ~ {~ +** Processing line: ~ index: 4,~ +** Processing line: ~ text: "args.",~ +** Processing line: ~ __meta__: {~ +** Processing line: ~ other_options: [~ +** Processing line: ~ {~ +** Processing line: ~ index: Fixnum,~ +** Processing line: ~ file: "app/main.rb"~ +** Processing line: ~ }~ +** Processing line: ~ ]~ +** Processing line: ~ }~ +** Processing line: ~ }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - sample: Chooses a random element from the array.~ +** Processing line: ~ def assert_completion source, *expected~ +** Processing line: ~ results = suggest_autocompletion text: (source.strip.gsub ":cursor", ""),~ +** Processing line: ~ index: (source.strip.index ":cursor")~ ** Processing line: ~~ -** Processing line: ~ - reject: Removes elements that meet certain requirements.~ -** Processing line: ~ In this sample app, we're removing/rejecting zombies that reach the center of the screen. We're also~ -** Processing line: ~ rejecting zombies that were killed more than 30 frames ago.~ +** Processing line: ~ puts results~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ def test_args_completion args, assert~ +** Processing line: ~ $gtk.write_file_root "autocomplete.txt", ($gtk.suggest_autocompletion text: <<-S, index: 128).join("\n")~ +** Processing line: ~ require 'app/game.rb'~ ** Processing line: ~~ -** Processing line: ~ # This sample app allows users to move around the screen in order to kill zombies. Zombies appear from every direction so the goal~ -** Processing line: ~ # is to kill the zombies as fast as possible!~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.gtk.suppress_mailbox = false~ +** Processing line: ~ $game ||= Game.new~ +** Processing line: ~ $game.args = args~ +** Processing line: ~ $game.args.~ +** Processing line: ~ $game.tick~ +** Processing line: ~ end~ +** Processing line: ~ S~ ** Processing line: ~~ -** Processing line: ~ class ProtectThePuppiesFromTheZombies~ -** Processing line: ~ attr_accessor :grid, :inputs, :state, :outputs~ +** Processing line: ~ puts "contents:"~ +** Processing line: ~ puts ($gtk.read_file "autocomplete.txt")~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calls the methods necessary for the game to run properly.~ -** Processing line: ~ def tick~ -** Processing line: ~ defaults~ -** Processing line: ~ render~ -** Processing line: ~ calc~ -** Processing line: ~ input~ -** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # Sets default values for the zombies and for the player.~ -** Processing line: ~ # Initialization happens only in the first frame.~ -** Processing line: ~ def defaults~ -** Processing line: ~ state.flash_at ||= 0~ -** Processing line: ~ state.zombie_min_spawn_rate ||= 60~ -** Processing line: ~ state.zombie_spawn_countdown ||= random_spawn_countdown state.zombie_min_spawn_rate~ -** Processing line: ~ state.zombies ||= []~ -** Processing line: ~ state.killed_zombies ||= []~ ** Processing line: ~~ -** Processing line: ~ # Declares player as a new entity and sets its properties.~ -** Processing line: ~ # The player begins the game in the center of the screen, not moving in any direction.~ -** Processing line: ~ state.player ||= state.new_entity(:player, { x: 640,~ -** Processing line: ~ y: 360,~ -** Processing line: ~ attack_angle: 0,~ -** Processing line: ~ dx: 0,~ -** Processing line: ~ dy: 0 })~ -** Processing line: ~ end~ +** Processing line: ~*** Http - Retrieve Images - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Http - Retrieve Images - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Http - Retrieve Images - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ # Outputs a gray background.~ -** Processing line: ~ # Calls the methods needed to output the player, zombies, etc onto the screen.~ -** Processing line: ~ def render~ -** Processing line: ~ outputs.solids << [grid.rect, 100, 100, 100]~ -** Processing line: ~ render_zombies~ -** Processing line: ~ render_killed_zombies~ -** Processing line: ~ render_player~ -** Processing line: ~ render_flash~ -** Processing line: ~ end~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/11_http/01_retrieve_images/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ ** Processing line: ~~ -** Processing line: ~ # Outputs the zombies on the screen and sets values for the sprites, such as the position, width, height, and animation.~ -** Processing line: ~ def render_zombies~ -** Processing line: ~ outputs.sprites << state.zombies.map do |z| # performs action on all zombies in the collection~ -** Processing line: ~ z.sprite = [z.x, z.y, 4 * 3, 8 * 3, animation_sprite(z)].sprite # sets definition for sprite, calls animation_sprite method~ -** Processing line: ~ z.sprite~ -** Processing line: ~ end~ +** Processing line: ~ # Show a warning at the start.~ +** Processing line: ~ args.state.warning_debounce ||= 11 * 60~ +** Processing line: ~ if args.state.warning_debounce > 0~ +** Processing line: ~ args.state.warning_debounce -= 1~ +** Processing line: ~ args.outputs.labels << [640, 600, "This app shows random images from the Internet.", 10, 1, 255, 255, 255]~ +** Processing line: ~ args.outputs.labels << [640, 500, "Quit in the next few seconds if this is a problem.", 10, 1, 255, 255, 255]~ +** Processing line: ~ args.outputs.labels << [640, 350, "#{(args.state.warning_debounce / 60.0).to_i}", 10, 1, 255, 255, 255]~ +** Processing line: ~ return~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs sprites of killed zombies, and displays a slash image to show that a zombie has been killed.~ -** Processing line: ~ def render_killed_zombies~ -** Processing line: ~ outputs.sprites << state.killed_zombies.map do |z| # performs action on all killed zombies in collection~ -** Processing line: ~ z.sprite = [z.x,~ -** Processing line: ~ z.y,~ -** Processing line: ~ 4 * 3,~ -** Processing line: ~ 8 * 3,~ -** Processing line: ~ animation_sprite(z, z.death_at), # calls animation_sprite method~ -** Processing line: ~ 0, # angle~ -** Processing line: ~ 255 * z.death_at.ease(30, :flip)].sprite # transparency of a zombie changes when they die~ -** Processing line: ~ # change the value of 30 and see what happens when a zombie is killed~ +** Processing line: ~ args.state.download_debounce ||= 0 # start immediately, reset to non zero later.~ +** Processing line: ~ args.state.photos ||= []~ ** Processing line: ~~ -** Processing line: ~ # Sets values to output the slash over the zombie's sprite when a zombie is killed.~ -** Processing line: ~ # The slash is tilted 45 degrees from the angle of the player's attack.~ -** Processing line: ~ # Change the 3 inside scale_rect to 30 and the slash will be HUGE! Scale_rect positions~ -** Processing line: ~ # the slash over the killed zombie's sprite.~ -** Processing line: ~ [z.sprite, [z.sprite.rect, 'sprites/slash.png', 45 + state.player.attack_angle_on_click, z.sprite.a].scale_rect(3, 0.5, 0.5)]~ +** Processing line: ~ # Put a little pause between each download.~ +** Processing line: ~ if args.state.download.nil?~ +** Processing line: ~ if args.state.download_debounce > 0~ +** Processing line: ~ args.state.download_debounce -= 1~ +** Processing line: ~ else~ +** Processing line: ~ args.state.download = $gtk.http_get 'https://picsum.photos/200/300.jpg'~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs the player sprite using the images in the sprites folder.~ -** Processing line: ~ def render_player~ -** Processing line: ~ state.player_sprite = [state.player.x,~ -** Processing line: ~ state.player.y,~ -** Processing line: ~ 4 * 3,~ -** Processing line: ~ 8 * 3, "sprites/player-#{animation_index(state.player.created_at_elapsed)}.png"] # string interpolation~ -** Processing line: ~ outputs.sprites << state.player_sprite~ -** Processing line: ~~ -** Processing line: ~ # Outputs a small red square that previews the angles that the player can attack in.~ -** Processing line: ~ # It can be moved in a perfect circle around the player to show possible movements.~ -** Processing line: ~ # Change the 60 in the parenthesis and see what happens to the movement of the red square.~ -** Processing line: ~ outputs.solids << [state.player.x + state.player.attack_angle.vector_x(60),~ -** Processing line: ~ state.player.y + state.player.attack_angle.vector_y(60),~ -** Processing line: ~ 3, 3, 255, 0, 0]~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # Renders flash as a solid. The screen turns white for 10 frames when a zombie is killed.~ -** Processing line: ~ def render_flash~ -** Processing line: ~ return if state.flash_at.elapsed_time > 10 # return if more than 10 frames have passed since flash.~ -** Processing line: ~ # Transparency gradually changes (or eases) during the 10 frames of flash.~ -** Processing line: ~ outputs.primitives << [grid.rect, 255, 255, 255, 255 * state.flash_at.ease(10, :flip)].solid~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # Calls all methods necessary for performing calculations.~ -** Processing line: ~ def calc~ -** Processing line: ~ calc_spawn_zombie~ -** Processing line: ~ calc_move_zombies~ -** Processing line: ~ calc_player~ -** Processing line: ~ calc_kill_zombie~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # Decreases the zombie spawn countdown by 1 if it has a value greater than 0.~ -** Processing line: ~ def calc_spawn_zombie~ -** Processing line: ~ if state.zombie_spawn_countdown > 0~ -** Processing line: ~ state.zombie_spawn_countdown -= 1~ -** Processing line: ~ return~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # New zombies are created, positioned on the screen, and added to the zombies collection.~ -** Processing line: ~ state.zombies << state.new_entity(:zombie) do |z| # each zombie is declared a new entity~ -** Processing line: ~ if rand > 0.5~ -** Processing line: ~ z.x = grid.rect.w.randomize(:ratio) # random x position on screen (within grid scope)~ -** Processing line: ~ z.y = [-10, 730].sample # y position is set to either -10 or 730 (randomly chosen)~ -** Processing line: ~ # the possible values exceed the screen's scope so zombies appear to be coming from far away~ -** Processing line: ~ else~ -** Processing line: ~ z.x = [-10, 1290].sample # x position is set to either -10 or 1290 (randomly chosen)~ -** Processing line: ~ z.y = grid.rect.w.randomize(:ratio) # random y position on screen~ +** Processing line: ~ if !args.state.download.nil?~ +** Processing line: ~ if args.state.download[:complete]~ +** Processing line: ~ if args.state.download[:http_response_code] == 200~ +** Processing line: ~ fname = "sprites/#{args.state.photos.length}.jpg"~ +** Processing line: ~ $gtk.write_file fname, args.state.download[:response_data]~ +** Processing line: ~ args.state.photos << [ 100 + rand(1080), 500 - rand(480), fname, rand(80) - 40 ]~ ** Processing line: ~ end~ +** Processing line: ~ args.state.download = nil~ +** Processing line: ~ args.state.download_debounce = (rand(3) + 2) * 60~ ** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # Calls random_spawn_countdown method (determines how fast new zombies appear)~ -** Processing line: ~ state.zombie_spawn_countdown = random_spawn_countdown state.zombie_min_spawn_rate~ -** Processing line: ~ state.zombie_min_spawn_rate -= 1~ -** Processing line: ~ # set to either the current zombie_min_spawn_rate or 0, depending on which value is greater~ -** Processing line: ~ state.zombie_min_spawn_rate = state.zombie_min_spawn_rate.greater(0)~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Moves all zombies towards the center of the screen.~ -** Processing line: ~ # All zombies that reach the center (640, 360) are rejected from the zombies collection and disappear.~ -** Processing line: ~ def calc_move_zombies~ -** Processing line: ~ state.zombies.each do |z| # for each zombie in the collection~ -** Processing line: ~ z.y = z.y.towards(360, 0.1) # move the zombie towards the center (640, 360) at a rate of 0.1~ -** Processing line: ~ z.x = z.x.towards(640, 0.1) # change 0.1 to 1.1 and see how much faster the zombies move to the center~ +** Processing line: ~ # draw any downloaded photos...~ +** Processing line: ~ args.state.photos.each { |i|~ +** Processing line: ~ args.outputs.primitives << [i[0], i[1], 200, 300, i[2], i[3]].sprite~ +** Processing line: ~ }~ +** Processing line: ~~ +** Processing line: ~ # Draw a download progress bar...~ +** Processing line: ~ args.outputs.primitives << [0, 0, 1280, 30, 0, 0, 0, 255].solid~ +** Processing line: ~ if !args.state.download.nil?~ +** Processing line: ~ br = args.state.download[:response_read]~ +** Processing line: ~ total = args.state.download[:response_total]~ +** Processing line: ~ if total != 0~ +** Processing line: ~ pct = br.to_f / total.to_f~ +** Processing line: ~ args.outputs.primitives << [0, 0, 1280 * pct, 30, 0, 0, 255, 255].solid~ ** Processing line: ~ end~ -** Processing line: ~ state.zombies = state.zombies.reject { |z| z.y == 360 && z.x == 640 } # remove zombies that are in center~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calculates the position and movement of the player on the screen.~ -** Processing line: ~ def calc_player~ -** Processing line: ~ state.player.x += state.player.dx # changes x based on dx (change in x)~ -** Processing line: ~ state.player.y += state.player.dy # changes y based on dy (change in y)~ -** Processing line: ~~ -** Processing line: ~ state.player.dx *= 0.9 # scales dx down~ -** Processing line: ~ state.player.dy *= 0.9 # scales dy down~ -** Processing line: ~~ -** Processing line: ~ # Compares player's x to 1280 to find lesser value, then compares result to 0 to find greater value.~ -** Processing line: ~ # This ensures that the player remains within the screen's scope.~ -** Processing line: ~ state.player.x = state.player.x.lesser(1280).greater(0)~ -** Processing line: ~ state.player.y = state.player.y.lesser(720).greater(0) # same with player's y~ -** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # Finds all zombies that intersect with the player's sprite. These zombies are removed from the zombies collection~ -** Processing line: ~ # and added to the killed_zombies collection since any zombie that intersects with the player is killed.~ -** Processing line: ~ def calc_kill_zombie~ ** Processing line: ~~ -** Processing line: ~ # Find all zombies that intersect with the player. They are considered killed.~ -** Processing line: ~ killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite }~ -** Processing line: ~ state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection~ -** Processing line: ~ state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies~ +** Processing line: ~*** Http - Web Server - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Http - Web Server - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Http - Web Server - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ if killed_this_frame.length > 0 # if atleast one zombie was killed in the frame~ -** Processing line: ~ state.flash_at = state.tick_count # flash_at set to the frame when the zombie was killed~ -** Processing line: ~ # Don't forget, the rendered flash lasts for 10 frames after the zombie is killed (look at render_flash method)~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/11_http/02_web_server/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.port ||= 3000~ +** Processing line: ~ # by default the embedded webserver runs on port 9001 (the port number is over 9000) and is disabled in a production build~ +** Processing line: ~ # to enable the http server in a production build, you need to manually start~ +** Processing line: ~ # the server up:~ +** Processing line: ~ args.gtk.start_server! port: args.state.port, enable_in_prod: true~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +** Processing line: ~ args.outputs.labels << [640, 600, "Point your web browser at http://localhost:#{args.state.port}/", 10, 1, 255, 255, 255]~ +** Processing line: ~~ +** Processing line: ~ args.inputs.http_requests.each { |req|~ +** Processing line: ~ puts("METHOD: #{req.method}");~ +** Processing line: ~ puts("URI: #{req.uri}");~ +** Processing line: ~ puts("HEADERS:");~ +** Processing line: ~ req.headers.each { |k,v| puts(" #{k}: #{v}") }~ +** Processing line: ~~ +** Processing line: ~ if (req.uri == '/')~ +** Processing line: ~ # headers and body can be nil if you don't care about them.~ +** Processing line: ~ # If you don't set the Content-Type, it will default to~ +** Processing line: ~ # "text/html; charset=utf-8".~ +** Processing line: ~ # Don't set Content-Length; we'll ignore it and calculate it for you~ +** Processing line: ~ args.state.reqnum += 1~ +** Processing line: ~ req.respond 200, "hello

    This #{req.method} was request number #{args.state.reqnum}!

    \n", { 'X-DRGTK-header' => 'Powered by DragonRuby!' }~ +** Processing line: ~ else~ +** Processing line: ~ req.reject~ ** Processing line: ~ end~ +** Processing line: ~ }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the tick_count (passage of time) as the value of the death_at variable for each killed zombie.~ -** Processing line: ~ # Death_at stores the frame a zombie was killed.~ -** Processing line: ~ killed_this_frame.each do |z|~ -** Processing line: ~ z.death_at = state.tick_count~ -** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # Zombies are rejected from the killed_zombies collection depending on when they were killed.~ -** Processing line: ~ # They are rejected if more than 30 frames have passed since their death.~ -** Processing line: ~ state.killed_zombies = state.killed_zombies.reject { |z| state.tick_count - z.death_at > 30 }~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Uses input from the user to move the player around the screen.~ -** Processing line: ~ def input~ +** Processing line: ~*** C Extensions - Basics - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~C Extensions - Basics - 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: ~C Extensions - Basics - 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/12_c_extensions/01_basics/app/main.rb~ +** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ +** Processing line: ~ include FFI::CExt~ ** Processing line: ~~ -** Processing line: ~ # If the "a" key or left key is pressed, the x position of the player decreases.~ -** Processing line: ~ # Otherwise, if the "d" key or right key is pressed, the x position of the player increases.~ -** Processing line: ~ if inputs.keyboard.key_held.a || inputs.keyboard.key_held.left~ -** Processing line: ~ state.player.x -= 5~ -** Processing line: ~ elsif inputs.keyboard.key_held.d || inputs.keyboard.key_held.right~ -** Processing line: ~ state.player.x += 5~ -** Processing line: ~ end~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.outputs.labels << [640, 500, "mouse.x = #{args.mouse.x.to_i}", 5, 1]~ +** Processing line: ~ args.outputs.labels << [640, 460, "square(mouse.x) = #{square(args.mouse.x.to_i)}", 5, 1]~ +** Processing line: ~ args.outputs.labels << [640, 420, "mouse.y = #{args.mouse.y.to_i}", 5, 1]~ +** Processing line: ~ args.outputs.labels << [640, 380, "square(mouse.y) = #{square(args.mouse.y.to_i)}", 5, 1]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # If the "w" or up key is pressed, the y position of the player increases.~ -** Processing line: ~ # Otherwise, if the "s" or down key is pressed, the y position of the player decreases.~ -** Processing line: ~ if inputs.keyboard.key_held.w || inputs.keyboard.key_held.up~ -** Processing line: ~ state.player.y += 5~ -** Processing line: ~ elsif inputs.keyboard.key_held.s || inputs.keyboard.key_held.down~ -** Processing line: ~ state.player.y -= 5~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the attack angle so the player can move and attack in the precise direction it wants to go.~ -** Processing line: ~ # If the mouse is moved, the attack angle is changed (based on the player's position and mouse position).~ -** Processing line: ~ # Attack angle also contributes to the position of red square.~ -** Processing line: ~ if inputs.mouse.moved~ -** Processing line: ~ state.player.attack_angle = inputs.mouse.position.angle_from [state.player.x, state.player.y]~ -** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ if inputs.mouse.click && state.player.dx < 0.5 && state.player.dy < 0.5~ -** Processing line: ~ state.player.attack_angle_on_click = inputs.mouse.position.angle_from [state.player.x, state.player.y]~ -** Processing line: ~ state.player.attack_angle = state.player.attack_angle_on_click # player's attack angle is set~ -** Processing line: ~ state.player.dx = state.player.attack_angle.vector_x(25) # change in player's position~ -** Processing line: ~ state.player.dy = state.player.attack_angle.vector_y(25)~ -** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the zombie spawn's countdown to a random number.~ -** Processing line: ~ # How fast zombies appear (change the 60 to 6 and too many zombies will appear at once!)~ -** Processing line: ~ def random_spawn_countdown minimum~ -** Processing line: ~ 10.randomize(:ratio, :sign).to_i + 60~ -** Processing line: ~ end~ +** Processing line: ~*** C Extensions - Intermediate - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~C Extensions - Intermediate - 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: ~C Extensions - Intermediate - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~ # Helps to iterate through the images in the sprites folder by setting the animation index.~ -** Processing line: ~ # 3 frames is how long to show an image, and 6 is how many images to flip through.~ -** Processing line: ~ def animation_index at~ -** Processing line: ~ at.idiv(3).mod(6)~ -** Processing line: ~ end~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/12_c_extensions/02_intermediate/app/main.rb~ +** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ +** Processing line: ~ include FFI::RE~ ** Processing line: ~~ -** Processing line: ~ # Animates the zombies by using the animation index to go through the images in the sprites folder.~ -** Processing line: ~ def animation_sprite zombie, at = nil~ -** Processing line: ~ at ||= zombie.created_at_elapsed # how long it is has been since a zombie was created~ -** Processing line: ~ index = animation_index at~ -** Processing line: ~ "sprites/zombie-#{index}.png" # string interpolation to iterate through images~ +** Processing line: ~ def split_words(input)~ +** Processing line: ~ words = []~ +** Processing line: ~ last = IntPointer.new~ +** Processing line: ~ re = re_compile("\\w+")~ +** Processing line: ~ first = re_matchp(re, input, last)~ +** Processing line: ~ while first != -1~ +** Processing line: ~ words << input.slice(first, last.value)~ +** Processing line: ~ input = input.slice(last.value + first, input.length)~ +** Processing line: ~ first = re_matchp(re, input, last)~ ** Processing line: ~ end~ +** Processing line: ~ words~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $protect_the_puppies_from_the_zombies = ProtectThePuppiesFromTheZombies.new~ -** Processing line: ~~ ** Processing line: ~ def tick args~ -** Processing line: ~ $protect_the_puppies_from_the_zombies.grid = args.grid~ -** Processing line: ~ $protect_the_puppies_from_the_zombies.inputs = args.inputs~ -** Processing line: ~ $protect_the_puppies_from_the_zombies.state = args.state~ -** Processing line: ~ $protect_the_puppies_from_the_zombies.outputs = args.outputs~ -** Processing line: ~ $protect_the_puppies_from_the_zombies.tick~ -** Processing line: ~ tick_instructions args, "How to get the mouse position and translate it to an x, y position using .vector_x and .vector_y. CLICK to play."~ +** Processing line: ~ args.outputs.labels << [640, 500, split_words("hello, dragonriders!").join(' '), 5, 1]~ ** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ -** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. ** 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: ~~ +** Processing line: ~*** C Extensions - Native Pixel Arrays - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~C Extensions - Native Pixel Arrays - 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: ~C Extensions - Native Pixel Arrays - 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/12_c_extensions/03_native_pixel_arrays/app/main.rb~ +** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ +** Processing line: ~ include FFI::CExt~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.rotation ||= 0~ +** Processing line: ~~ +** Processing line: ~ update_scanner_texture # this calls into a C extension!~ +** Processing line: ~~ +** Processing line: ~ # New/changed pixel arrays get uploaded to the GPU before we render~ +** Processing line: ~ # anything. At that point, they can be scaled, rotated, and otherwise~ +** Processing line: ~ # used like any other sprite.~ +** Processing line: ~ w = 100~ +** Processing line: ~ h = 100~ +** Processing line: ~ x = (1280 - w) / 2~ +** Processing line: ~ y = (720 - h) / 2~ +** Processing line: ~ args.outputs.background_color = [64, 0, 128]~ +** Processing line: ~ args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite~ +** Processing line: ~ args.state.rotation += 1~ +** Processing line: ~~ +** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Mouse - Mouse Move Paint App - main.rb~ -- H1 detected. +** Processing line: ~*** Path Finding Algorithms - Breadth First Search - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Mouse - Mouse Move Paint App - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Path Finding Algorithms - Breadth First Search - 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: ~Path Finding Algorithms - Breadth First Search - 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/05_mouse/03_mouse_move_paint_app/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # ./samples/13_path_finding_algorithms/01_breadth_first_search/app/main.rb~ +** Processing line: ~ # A visual demonstration of a breadth first search~ +** Processing line: ~ # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~ # An animation that can respond to user input in real time~ ** Processing line: ~~ -** Processing line: ~ - Floor: Method that returns an integer number smaller than or equal to the original with no decimal.~ +** Processing line: ~ # A breadth first search expands in all directions one step at a time~ +** Processing line: ~ # The frontier is a queue of cells to be expanded from~ +** Processing line: ~ # The visited hash allows quick lookups of cells that have been expanded from~ +** Processing line: ~ # The walls hash allows quick lookup of whether a cell is a wall~ ** Processing line: ~~ -** Processing line: ~ For example, if we have a variable, a = 13.7, and we called floor on it, it would look like this...~ -** Processing line: ~ puts a.floor()~ -** Processing line: ~ which would print out 13.~ -** Processing line: ~ (There is also a ceil method, which returns an integer number greater than or equal to the original~ -** Processing line: ~ with no decimal. If we had called ceil on the variable a, the result would have been 14.)~ +** Processing line: ~ # The breadth first search starts by adding the red star to the frontier array~ +** Processing line: ~ # and marking it as visited~ +** Processing line: ~ # Each step a cell is removed from the front of the frontier array (queue)~ +** Processing line: ~ # Unless the neighbor is a wall or visited, it is added to the frontier array~ +** Processing line: ~ # The neighbor is then marked as visited~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ +** Processing line: ~ # The frontier is blue~ +** Processing line: ~ # Visited cells are light brown~ +** Processing line: ~ # Walls are camo green~ +** Processing line: ~ # Even when walls are visited, they will maintain their wall color~ ** Processing line: ~~ -** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ -** Processing line: ~ using their keys.~ +** Processing line: ~ # The star can be moved by clicking and dragging~ +** Processing line: ~ # Walls can be added and removed by clicking and dragging~ ** Processing line: ~~ -** Processing line: ~ For example, if we have a "numbers" hash that stores numbers in English as the~ -** Processing line: ~ key and numbers in Spanish as the value, we'd have a hash that looks like this...~ -** Processing line: ~ numbers = { "one" => "uno", "two" => "dos", "three" => "tres" }~ -** Processing line: ~ and on it goes.~ +** Processing line: ~ class BreadthFirstSearch~ +** Processing line: ~ attr_gtk~ ** Processing line: ~~ -** Processing line: ~ Now if we wanted to find the corresponding value of the "one" key, we could say~ -** Processing line: ~ puts numbers["one"]~ -** Processing line: ~ which would print "uno" to the console.~ +** Processing line: ~ def initialize(args)~ +** Processing line: ~ # Variables to edit the size and appearance of the grid~ +** Processing line: ~ # Freely customizable to user's liking~ +** Processing line: ~ args.state.grid.width = 30~ +** Processing line: ~ args.state.grid.height = 15~ +** Processing line: ~ args.state.grid.cell_size = 40~ +** Processing line: ~~ +** Processing line: ~ # Stores which step of the animation is being rendered~ +** Processing line: ~ # When the user moves the star or messes with the walls,~ +** Processing line: ~ # the breadth first search is recalculated up to this step~ +** Processing line: ~ args.state.anim_steps = 0~ +** Processing line: ~~ +** Processing line: ~ # At some step the animation will end,~ +** Processing line: ~ # and further steps won't change anything (the whole grid will be explored)~ +** Processing line: ~ # This step is roughly the grid's width * height~ +** Processing line: ~ # When anim_steps equals max_steps no more calculations will occur~ +** Processing line: ~ # and the slider will be at the end~ +** Processing line: ~ args.state.max_steps = args.state.grid.width * args.state.grid.height~ +** Processing line: ~~ +** Processing line: ~ # Whether the animation should play or not~ +** Processing line: ~ # If true, every tick moves anim_steps forward one~ +** Processing line: ~ # Pressing the stepwise animation buttons will pause the animation~ +** Processing line: ~ args.state.play = true~ +** Processing line: ~~ +** Processing line: ~ # The location of the star and walls of the grid~ +** Processing line: ~ # They can be modified to have a different initial grid~ +** Processing line: ~ # Walls are stored in a hash for quick look up when doing the search~ +** Processing line: ~ args.state.star = [0, 0]~ +** Processing line: ~ args.state.walls = {~ +** Processing line: ~ [3, 3] => true,~ +** Processing line: ~ [3, 4] => true,~ +** Processing line: ~ [3, 5] => true,~ +** Processing line: ~ [3, 6] => true,~ +** Processing line: ~ [3, 7] => true,~ +** Processing line: ~ [3, 8] => true,~ +** Processing line: ~ [3, 9] => true,~ +** Processing line: ~ [3, 10] => true,~ +** Processing line: ~ [3, 11] => true,~ +** Processing line: ~ [4, 3] => true,~ +** Processing line: ~ [4, 4] => true,~ +** Processing line: ~ [4, 5] => true,~ +** Processing line: ~ [4, 6] => true,~ +** Processing line: ~ [4, 7] => true,~ +** Processing line: ~ [4, 8] => true,~ +** Processing line: ~ [4, 9] => true,~ +** Processing line: ~ [4, 10] => true,~ +** Processing line: ~ [4, 11] => true,~ +** Processing line: ~~ +** Processing line: ~ [13, 0] => true,~ +** Processing line: ~ [13, 1] => true,~ +** Processing line: ~ [13, 2] => true,~ +** Processing line: ~ [13, 3] => true,~ +** Processing line: ~ [13, 4] => true,~ +** Processing line: ~ [13, 5] => true,~ +** Processing line: ~ [13, 6] => true,~ +** Processing line: ~ [13, 7] => true,~ +** Processing line: ~ [13, 8] => true,~ +** Processing line: ~ [13, 9] => true,~ +** Processing line: ~ [13, 10] => true,~ +** Processing line: ~ [14, 0] => true,~ +** Processing line: ~ [14, 1] => true,~ +** Processing line: ~ [14, 2] => true,~ +** Processing line: ~ [14, 3] => true,~ +** Processing line: ~ [14, 4] => true,~ +** Processing line: ~ [14, 5] => true,~ +** Processing line: ~ [14, 6] => true,~ +** Processing line: ~ [14, 7] => true,~ +** Processing line: ~ [14, 8] => true,~ +** Processing line: ~ [14, 9] => true,~ +** Processing line: ~ [14, 10] => true,~ +** Processing line: ~~ +** Processing line: ~ [21, 8] => true,~ +** Processing line: ~ [21, 9] => true,~ +** Processing line: ~ [21, 10] => true,~ +** Processing line: ~ [21, 11] => true,~ +** Processing line: ~ [21, 12] => true,~ +** Processing line: ~ [21, 13] => true,~ +** Processing line: ~ [21, 14] => true,~ +** Processing line: ~ [22, 8] => true,~ +** Processing line: ~ [22, 9] => true,~ +** Processing line: ~ [22, 10] => true,~ +** Processing line: ~ [22, 11] => true,~ +** Processing line: ~ [22, 12] => true,~ +** Processing line: ~ [22, 13] => true,~ +** Processing line: ~ [22, 14] => true,~ +** Processing line: ~ [23, 8] => true,~ +** Processing line: ~ [23, 9] => true,~ +** Processing line: ~ [24, 8] => true,~ +** Processing line: ~ [24, 9] => true,~ +** Processing line: ~ [25, 8] => true,~ +** Processing line: ~ [25, 9] => true,~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ -** Processing line: ~ In this sample app, new_entity is used to create a new button that clears the grid.~ -** Processing line: ~ (Remember, you can use state to define ANY property and it will be retained across frames.)~ +** Processing line: ~ # Variables that are used by the breadth first search~ +** Processing line: ~ # Storing cells that the search has visited, prevents unnecessary steps~ +** Processing line: ~ # Expanding the frontier of the search in order makes the search expand~ +** Processing line: ~ # from the center outward~ +** Processing line: ~ args.state.visited = {}~ +** Processing line: ~ args.state.frontier = []~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # What the user is currently editing on the grid~ +** Processing line: ~ # Possible values are: :none, :slider, :star, :remove_wall, :add_wall~ +** Processing line: ~~ +** Processing line: ~ # We store this value, because we want to remember the value even when~ +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ +** Processing line: ~ # they are still clicking down on the mouse.~ +** Processing line: ~ args.state.click_and_drag = :none~ +** Processing line: ~~ +** Processing line: ~ # Store the rects of the buttons that control the animation~ +** Processing line: ~ # They are here for user customization~ +** Processing line: ~ # Editing these might require recentering the text inside them~ +** Processing line: ~ # Those values can be found in the render_button methods~ +** Processing line: ~ args.state.buttons.left = [450, 600, 50, 50]~ +** Processing line: ~ args.state.buttons.center = [500, 600, 200, 50]~ +** Processing line: ~ args.state.buttons.right = [700, 600, 50, 50]~ +** Processing line: ~~ +** Processing line: ~ # The variables below are related to the slider~ +** Processing line: ~ # They allow the user to customize them~ +** Processing line: ~ # They also give a central location for the render and input methods to get~ +** Processing line: ~ # information from~ +** Processing line: ~ # x & y are the coordinates of the leftmost part of the slider line~ +** Processing line: ~ args.state.slider.x = 400~ +** Processing line: ~ args.state.slider.y = 675~ +** Processing line: ~ # This is the width of the line~ +** Processing line: ~ args.state.slider.w = 360~ +** Processing line: ~ # This is the offset for the circle~ +** Processing line: ~ # Allows the center of the circle to be on the line,~ +** Processing line: ~ # as opposed to the upper right corner~ +** Processing line: ~ args.state.slider.offset = 20~ +** Processing line: ~ # This is the spacing between each of the notches on the slider~ +** Processing line: ~ # Notches are places where the circle can rest on the slider line~ +** Processing line: ~ # There needs to be a notch for each step before the maximum number of steps~ +** Processing line: ~ args.state.slider.spacing = args.state.slider.w.to_f / args.state.max_steps.to_f~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # This method is called every frame/tick~ +** Processing line: ~ # Every tick, the current state of the search is rendered on the screen,~ +** Processing line: ~ # User input is processed, and~ +** Processing line: ~ # The next step in the search is calculated~ +** Processing line: ~ def tick~ +** Processing line: ~ render~ +** Processing line: ~ input~ +** Processing line: ~ # If animation is playing, and max steps have not been reached~ +** Processing line: ~ # Move the search a step forward~ +** Processing line: ~ if state.play && state.anim_steps < state.max_steps~ +** Processing line: ~ # Variable that tells the program what step to recalculate up to~ +** Processing line: ~ state.anim_steps += 1~ +** Processing line: ~ calc~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ +** Processing line: ~ # Draws everything onto the screen~ +** Processing line: ~ def render~ +** Processing line: ~ render_buttons~ +** Processing line: ~ render_slider~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.mouse.click.point.created_at: The frame the mouse click occurred in.~ +** Processing line: ~ render_background~ +** Processing line: ~ render_visited~ +** Processing line: ~ render_frontier~ +** Processing line: ~ render_walls~ +** Processing line: ~ render_star~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # The methods below subdivide the task of drawing everything to the screen~ +** Processing line: ~~ +** Processing line: ~ # Draws the buttons that control the animation step and state~ +** Processing line: ~ def render_buttons~ +** Processing line: ~ render_left_button~ +** Processing line: ~ render_center_button~ +** Processing line: ~ render_right_button~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Draws the button which steps the search backward~ +** Processing line: ~ # Shows the user where to click to move the search backward~ +** Processing line: ~ def render_left_button~ +** Processing line: ~ # Draws the gray button, and a black border~ +** Processing line: ~ # The border separates the buttons visually~ +** Processing line: ~ outputs.solids << [buttons.left, gray]~ +** Processing line: ~ outputs.borders << [buttons.left, black]~ +** Processing line: ~~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ +** Processing line: ~ # Explains to the user what the button does~ +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ +** Processing line: ~ # to keep the label in the center of the button~ +** Processing line: ~ label_x = buttons.left.x + 20~ +** Processing line: ~ label_y = buttons.left.y + 35~ +** Processing line: ~ outputs.labels << [label_x, label_y, "<"]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render_center_button~ +** Processing line: ~ # Draws the gray button, and a black border~ +** Processing line: ~ # The border separates the buttons visually~ +** Processing line: ~ outputs.solids << [buttons.center, gray]~ +** Processing line: ~ outputs.borders << [buttons.center, black]~ +** Processing line: ~~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ +** Processing line: ~ # Explains to the user what the button does~ +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ +** Processing line: ~ # to keep the label in the center of the button~ +** Processing line: ~ label_x = buttons.center.x + 37~ +** Processing line: ~ label_y = buttons.center.y + 35~ +** Processing line: ~ label_text = state.play ? "Pause Animation" : "Play Animation"~ +** Processing line: ~ outputs.labels << [label_x, label_y, label_text]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render_right_button~ +** Processing line: ~ # Draws the gray button, and a black border~ +** Processing line: ~ # The border separates the buttons visually~ +** Processing line: ~ outputs.solids << [buttons.right, gray]~ +** Processing line: ~ outputs.borders << [buttons.right, black]~ +** Processing line: ~~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ +** Processing line: ~ # Explains to the user what the button does~ +** Processing line: ~ label_x = buttons.right.x + 20~ +** Processing line: ~ label_y = buttons.right.y + 35~ +** Processing line: ~ outputs.labels << [label_x, label_y, ">"]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Draws the slider so the user can move it and see the progress of the search~ +** Processing line: ~ def render_slider~ +** Processing line: ~ # Using primitives hides the line under the white circle of the slider~ +** Processing line: ~ # Draws the line~ +** Processing line: ~ outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line~ +** Processing line: ~ # The circle needs to be offset so that the center of the circle~ +** Processing line: ~ # overlaps the line instead of the upper right corner of the circle~ +** Processing line: ~ # The circle's x value is also moved based on the current seach step~ +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing)~ +** Processing line: ~ circle_y = (slider.y - slider.offset)~ +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ +** Processing line: ~ outputs.primitives << [circle_rect, 'circle-white.png'].sprite~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Draws what the grid looks like with nothing on it~ +** Processing line: ~ def render_background~ +** Processing line: ~ render_unvisited~ +** Processing line: ~ render_grid_lines~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.labels: An array. The values in the array generate a label.~ -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +** Processing line: ~ # Draws a rectangle the size of the entire grid to represent unvisited cells~ +** Processing line: ~ def render_unvisited~ +** Processing line: ~ outputs.solids << [scale_up([0, 0, grid.width, grid.height]), unvisited_color]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - ARRAY#inside_rect?: Returns true or false depending on if the point is inside the rect.~ +** Processing line: ~ # Draws grid lines to show the division of the grid into cells~ +** Processing line: ~ def render_grid_lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << vertical_line(x)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << horizontal_line(y)~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # This sample app shows an empty grid that the user can paint on.~ -** Processing line: ~ # To paint, the user must keep their mouse presssed and drag it around the grid.~ -** Processing line: ~ # The "clear" button allows users to clear the grid so they can start over.~ +** Processing line: ~ # Easy way to draw vertical lines given an index~ +** Processing line: ~ def vertical_line column~ +** Processing line: ~ scale_up([column, 0, column, grid.height])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ class PaintApp~ -** Processing line: ~ attr_accessor :inputs, :state, :outputs, :grid, :args~ +** Processing line: ~ # Easy way to draw horizontal lines given an index~ +** Processing line: ~ def horizontal_line row~ +** Processing line: ~ scale_up([0, row, grid.width, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Runs methods necessary for the game to function properly.~ -** Processing line: ~ def tick~ -** Processing line: ~ print_title~ -** Processing line: ~ add_grid~ -** Processing line: ~ check_click~ -** Processing line: ~ draw_buttons~ +** Processing line: ~ # Draws the area that is going to be searched from~ +** Processing line: ~ # The frontier is the most outward parts of the search~ +** Processing line: ~ def render_frontier~ +** Processing line: ~ outputs.solids << state.frontier.map do |cell|~ +** Processing line: ~ [scale_up([cell.x, cell.y]), frontier_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Prints the title onto the screen by using a label.~ -** Processing line: ~ # Also separates the title from the grid with a line as a horizontal separator.~ -** Processing line: ~ def print_title~ -** Processing line: ~ args.outputs.labels << [ 640, 700, 'Paint!', 0, 1 ]~ -** Processing line: ~ outputs.lines << horizontal_separator(660, 0, 1280)~ +** Processing line: ~ # Draws the walls~ +** Processing line: ~ def render_walls~ +** Processing line: ~ outputs.solids << state.walls.map do |wall|~ +** Processing line: ~ [scale_up([wall.x, wall.y]), wall_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the starting position, ending position, and color for the horizontal separator.~ -** Processing line: ~ # The starting and ending positions have the same y values.~ -** Processing line: ~ def horizontal_separator y, x, x2~ -** Processing line: ~ [x, y, x2, y, 150, 150, 150]~ +** Processing line: ~ # Renders cells that have been searched in the appropriate color~ +** Processing line: ~ def render_visited~ +** Processing line: ~ outputs.solids << state.visited.map do |cell|~ +** Processing line: ~ [scale_up([cell.x, cell.y]), visited_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the starting position, ending position, and color for the vertical separator.~ -** Processing line: ~ # The starting and ending positions have the same x values.~ -** Processing line: ~ def vertical_separator x, y, y2~ -** Processing line: ~ [x, y, x, y2, 150, 150, 150]~ +** Processing line: ~ # Renders the star~ +** Processing line: ~ def render_star~ +** Processing line: ~ outputs.sprites << [scale_up(state.star), 'star.png']~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs a border and a grid containing empty squares onto the screen.~ -** Processing line: ~ def add_grid~ +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ +** Processing line: ~ # This method is used to scale up cells, and lines~ +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ +** Processing line: ~ def scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ ** Processing line: ~~ -** Processing line: ~ # Sets the x, y, height, and width of the grid.~ -** Processing line: ~ # There are 31 horizontal lines and 31 vertical lines in the grid.~ -** Processing line: ~ # Feel free to count them yourself before continuing!~ -** Processing line: ~ x, y, h, w = 640 - 500/2, 640 - 500, 500, 500 # calculations done so the grid appears in screen's center~ -** Processing line: ~ lines_h = 31~ -** Processing line: ~ lines_v = 31~ +** Processing line: ~ # If cell is just an x and y coordinate~ +** Processing line: ~ if cell.size == 2~ +** Processing line: ~ # Add a width and height of 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets values for the grid's border, grid lines, and filled squares.~ -** Processing line: ~ # The filled_squares variable is initially set to an empty array.~ -** Processing line: ~ state.grid_border ||= [ x, y, h, w ] # definition of grid's outer border~ -** Processing line: ~ state.grid_lines ||= draw_grid(x, y, h, w, lines_h, lines_v) # calls draw_grid method~ -** Processing line: ~ state.filled_squares ||= [] # there are no filled squares until the user fills them in~ +** Processing line: ~ # Scale all the values up~ +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ ** Processing line: ~~ -** Processing line: ~ # Outputs the grid lines, border, and filled squares onto the screen.~ -** Processing line: ~ outputs.lines.concat state.grid_lines~ -** Processing line: ~ outputs.borders << state.grid_border~ -** Processing line: ~ outputs.solids << state.filled_squares~ +** Processing line: ~ # Returns the scaled up cell~ +** Processing line: ~ cell~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Draws the grid by adding in vertical and horizontal separators.~ -** Processing line: ~ def draw_grid x, y, h, w, lines_h, lines_v~ +** Processing line: ~ # This method processes user input every tick~ +** Processing line: ~ # This method allows the user to use the buttons, slider, and edit the grid~ +** Processing line: ~ # There are 2 types of input:~ +** Processing line: ~ # Button Input~ +** Processing line: ~ # Click and Drag Input~ +** Processing line: ~ #~ +** Processing line: ~ # Button Input is used for the backward step and forward step buttons~ +** Processing line: ~ # Input is detected by mouse up within the bounds of the rect~ +** Processing line: ~ #~ +** Processing line: ~ # Click and Drag Input is used for moving the star, adding walls,~ +** Processing line: ~ # removing walls, and the slider~ +** Processing line: ~ #~ +** Processing line: ~ # When the mouse is down on the star, the click_and_drag variable is set to :star~ +** Processing line: ~ # While click_and_drag equals :star, the cursor's position is used to calculate the~ +** Processing line: ~ # appropriate drag behavior~ +** Processing line: ~ #~ +** Processing line: ~ # When the mouse goes up click_and_drag is set to :none~ +** Processing line: ~ #~ +** Processing line: ~ # A variable has to be used because the star has to continue being edited even~ +** Processing line: ~ # when the cursor is no longer over the star~ +** Processing line: ~ #~ +** Processing line: ~ # Similar things occur for the other Click and Drag inputs~ +** Processing line: ~ def input~ +** Processing line: ~ # Checks whether any of the buttons are being clicked~ +** Processing line: ~ input_buttons~ ** Processing line: ~~ -** Processing line: ~ # The grid starts off empty.~ -** Processing line: ~ grid = []~ +** Processing line: ~ # The detection and processing of click and drag inputs are separate~ +** Processing line: ~ # The program has to remember that the user is dragging an object~ +** Processing line: ~ # even when the mouse is no longer over that object~ +** Processing line: ~ detect_click_and_drag~ +** Processing line: ~ process_click_and_drag~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calculates the placement and adds horizontal lines or separators into the grid.~ -** Processing line: ~ curr_y = y # start at the bottom of the box~ -** Processing line: ~ dist_y = h / (lines_h + 1) # finds distance to place horizontal lines evenly throughout 500 height of grid~ -** Processing line: ~ lines_h.times do~ -** Processing line: ~ curr_y += dist_y # increment curr_y by the distance between the horizontal lines~ -** Processing line: ~ grid << horizontal_separator(curr_y, x, x + w - 1) # add a separator into the grid~ -** Processing line: ~ end~ +** Processing line: ~ # Detects and Process input for each button~ +** Processing line: ~ def input_buttons~ +** Processing line: ~ input_left_button~ +** Processing line: ~ input_center_button~ +** Processing line: ~ input_next_step_button~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Calculates the placement and adds vertical lines or separators into the grid.~ -** Processing line: ~ curr_x = x # now start at the left of the box~ -** Processing line: ~ dist_x = w / (lines_v + 1) # finds distance to place vertical lines evenly throughout 500 width of grid~ -** Processing line: ~ lines_v.times do~ -** Processing line: ~ curr_x += dist_x # increment curr_x by the distance between the vertical lines~ -** Processing line: ~ grid << vertical_separator(curr_x, y + 1, y + h) # add separator~ +** Processing line: ~ # Checks if the previous step button is clicked~ +** Processing line: ~ # If it is, it pauses the animation and moves the search one step backward~ +** Processing line: ~ def input_left_button~ +** Processing line: ~ if left_button_clicked?~ +** Processing line: ~ state.play = false~ +** Processing line: ~ state.anim_steps -= 1~ +** Processing line: ~ recalculate~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # paint_grid uses a hash to assign values to keys.~ -** Processing line: ~ state.paint_grid ||= {"x" => x, "y" => y, "h" => h, "w" => w, "lines_h" => lines_h,~ -** Processing line: ~ "lines_v" => lines_v, "dist_x" => dist_x,~ -** Processing line: ~ "dist_y" => dist_y }~ +** Processing line: ~ # Controls the play/pause button~ +** Processing line: ~ # Inverses whether the animation is playing or not when clicked~ +** Processing line: ~ def input_center_button~ +** Processing line: ~ if center_button_clicked? or inputs.keyboard.key_down.space~ +** Processing line: ~ state.play = !state.play~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ return grid~ +** Processing line: ~ # Checks if the next step button is clicked~ +** Processing line: ~ # If it is, it pauses the animation and moves the search one step forward~ +** Processing line: ~ def input_next_step_button~ +** Processing line: ~ if right_button_clicked?~ +** Processing line: ~ state.play = false~ +** Processing line: ~ state.anim_steps += 1~ +** Processing line: ~ calc~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Checks if the user is keeping the mouse pressed down and sets the mouse_hold variable accordingly using boolean values.~ -** Processing line: ~ # If the mouse is up, the user cannot drag the mouse.~ -** Processing line: ~ def check_click~ -** Processing line: ~ if inputs.mouse.down #is mouse up or down?~ -** Processing line: ~ state.mouse_held = true # mouse is being held down~ -** Processing line: ~ elsif inputs.mouse.up # if mouse is up~ -** Processing line: ~ state.mouse_held = false # mouse is not being held down or dragged~ -** Processing line: ~ state.mouse_dragging = false~ +** Processing line: ~ # Determines what the user is editing and stores the value~ +** Processing line: ~ # Storing the value allows the user to continue the same edit as long as the~ +** Processing line: ~ # mouse left click is held~ +** Processing line: ~ def detect_click_and_drag~ +** Processing line: ~ if inputs.mouse.up~ +** Processing line: ~ state.click_and_drag = :none~ +** Processing line: ~ elsif star_clicked?~ +** Processing line: ~ state.click_and_drag = :star~ +** Processing line: ~ elsif wall_clicked?~ +** Processing line: ~ state.click_and_drag = :remove_wall~ +** Processing line: ~ elsif grid_clicked?~ +** Processing line: ~ state.click_and_drag = :add_wall~ +** Processing line: ~ elsif slider_clicked?~ +** Processing line: ~ state.click_and_drag = :slider~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ +** Processing line: ~ def process_click_and_drag~ +** Processing line: ~ if state.click_and_drag == :star~ +** Processing line: ~ input_star~ +** Processing line: ~ elsif state.click_and_drag == :remove_wall~ +** Processing line: ~ input_remove_wall~ +** Processing line: ~ elsif state.click_and_drag == :add_wall~ +** Processing line: ~ input_add_wall~ +** Processing line: ~ elsif state.click_and_drag == :slider~ +** Processing line: ~ input_slider~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Moves the star to the grid closest to the mouse~ +** Processing line: ~ # Only recalculates the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def input_star~ +** Processing line: ~ old_star = state.star.clone~ +** Processing line: ~ state.star = cell_closest_to_mouse~ +** Processing line: ~ unless old_star == state.star~ +** Processing line: ~ recalculate~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Removes walls that are under the cursor~ +** Processing line: ~ def input_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if mouse_inside_grid?~ +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse)~ +** Processing line: ~ state.walls.delete(cell_closest_to_mouse)~ +** Processing line: ~ recalculate~ +** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if state.mouse_held && # mouse needs to be down~ -** Processing line: ~ !inputs.mouse.click && # must not be first click~ -** Processing line: ~ ((inputs.mouse.previous_click.point.x - inputs.mouse.position.x).abs > 15) # Need to move 15 pixels before "drag"~ -** Processing line: ~ state.mouse_dragging = true~ +** Processing line: ~ # Adds walls at cells under the cursor~ +** Processing line: ~ def input_add_wall~ +** Processing line: ~ if mouse_inside_grid?~ +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse)~ +** Processing line: ~ state.walls[cell_closest_to_mouse] = true~ +** Processing line: ~ recalculate~ +** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # If the user clicks their mouse inside the grid, the search_lines method is called with a click input type.~ -** Processing line: ~ if ((inputs.mouse.click) && (inputs.mouse.click.point.inside_rect? state.grid_border))~ -** Processing line: ~ search_lines(inputs.mouse.click.point, :click)~ +** Processing line: ~ # This method is called when the user is editing the slider~ +** Processing line: ~ # It pauses the animation and moves the white circle to the closest integer point~ +** Processing line: ~ # on the slider~ +** Processing line: ~ # Changes the step of the search to be animated~ +** Processing line: ~ def input_slider~ +** Processing line: ~ state.play = false~ +** Processing line: ~ mouse_x = inputs.mouse.point.x~ ** Processing line: ~~ -** Processing line: ~ # If the user drags their mouse inside the grid, the search_lines method is called with a drag input type.~ -** Processing line: ~ elsif ((state.mouse_dragging) && (inputs.mouse.position.inside_rect? state.grid_border))~ -** Processing line: ~ search_lines(inputs.mouse.position, :drag)~ -** Processing line: ~ end~ +** Processing line: ~ # Bounds the mouse_x to the closest x value on the slider line~ +** Processing line: ~ mouse_x = slider.x if mouse_x < slider.x~ +** Processing line: ~ mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w~ +** Processing line: ~~ +** Processing line: ~ # Sets the current search step to the one represented by the mouse x value~ +** Processing line: ~ # The slider's circle moves due to the render_slider method using anim_steps~ +** Processing line: ~ state.anim_steps = ((mouse_x - slider.x) / slider.spacing).to_i~ +** Processing line: ~~ +** Processing line: ~ recalculate~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the definition of a grid box and handles user input to fill in or clear grid boxes.~ -** Processing line: ~ def search_lines (point, input_type)~ -** Processing line: ~ point.x -= state.paint_grid["x"] # subtracts the value assigned to the "x" key in the paint_grid hash~ -** Processing line: ~ point.y -= state.paint_grid["y"] # subtracts the value assigned to the "y" key in the paint_grid hash~ +** Processing line: ~ # Whenever the user edits the grid,~ +** Processing line: ~ # The search has to be recalculated upto the current step~ +** Processing line: ~ # with the current grid as the initial state of the grid~ +** Processing line: ~ def recalculate~ +** Processing line: ~ # Resets the search~ +** Processing line: ~ state.frontier = []~ +** Processing line: ~ state.visited = {}~ ** Processing line: ~~ -** Processing line: ~ # Remove code following the .floor and see what happens when you try to fill in grid squares~ -** Processing line: ~ point.x = (point.x / state.paint_grid["dist_x"]).floor * state.paint_grid["dist_x"]~ -** Processing line: ~ point.y = (point.y / state.paint_grid["dist_y"]).floor * state.paint_grid["dist_y"]~ +** Processing line: ~ # Moves the animation forward one step at a time~ +** Processing line: ~ state.anim_steps.times { calc }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ point.x += state.paint_grid["x"]~ -** Processing line: ~ point.y += state.paint_grid["y"]~ ** Processing line: ~~ -** Processing line: ~ # Sets definition of a grid box, meaning its x, y, width, and height.~ -** Processing line: ~ # Floor is called on the point.x and point.y variables.~ -** Processing line: ~ # Ceil method is called on values of the distance hash keys, setting the width and height of a box.~ -** Processing line: ~ grid_box = [ point.x.floor, point.y.floor, state.paint_grid["dist_x"].ceil, state.paint_grid["dist_y"].ceil ]~ +** Processing line: ~ # This method moves the search forward one step~ +** Processing line: ~ # When the animation is playing it is called every tick~ +** Processing line: ~ # And called whenever the current step of the animation needs to be recalculated~ ** Processing line: ~~ -** Processing line: ~ if input_type == :click # if user clicks their mouse~ -** Processing line: ~ if state.filled_squares.include? grid_box # if grid box is already filled in~ -** Processing line: ~ state.filled_squares.delete grid_box # box is cleared and removed from filled_squares~ -** Processing line: ~ else~ -** Processing line: ~ state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares~ -** Processing line: ~ end~ -** Processing line: ~ elsif input_type == :drag # if user drags mouse~ -** Processing line: ~ unless state.filled_squares.include? grid_box # unless the grid box dragged over is already filled in~ -** Processing line: ~ state.filled_squares << grid_box # the box is filled in and added to filled_squares~ +** Processing line: ~ # Moves the search forward one step~ +** Processing line: ~ # Parameter called_from_tick is true if it is called from the tick method~ +** Processing line: ~ # It is false when the search is being recalculated after user editing the grid~ +** Processing line: ~ def calc~ +** Processing line: ~~ +** Processing line: ~ # The setup to the search~ +** Processing line: ~ # Runs once when the there is no frontier or visited cells~ +** Processing line: ~ if state.frontier.empty? && state.visited.empty?~ +** Processing line: ~ state.frontier << state.star~ +** Processing line: ~ state.visited[state.star] = true~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # A step in the search~ +** Processing line: ~ unless state.frontier.empty?~ +** Processing line: ~ # Takes the next frontier cell~ +** Processing line: ~ new_frontier = state.frontier.shift~ +** Processing line: ~ # For each of its neighbors~ +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited~ +** Processing line: ~ state.frontier << neighbor~ +** Processing line: ~ state.visited[neighbor] = true~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Creates and outputs a "Clear" button on the screen using a label and a border.~ -** Processing line: ~ # If the button is clicked, the filled squares are cleared, making the filled_squares collection empty.~ -** Processing line: ~ def draw_buttons~ -** Processing line: ~ x, y, w, h = 390, 50, 240, 50~ -** Processing line: ~ state.clear_button ||= state.new_entity(:button_with_fade)~ ** Processing line: ~~ -** Processing line: ~ # The x and y positions are set to display the label in the center of the button.~ -** Processing line: ~ # Try changing the first two parameters to simply x, y and see what happens to the text placement!~ -** Processing line: ~ state.clear_button.label ||= [x + w.half, y + h.half + 10, "Clear", 0, 1] # placed in center of border~ -** Processing line: ~ state.clear_button.border ||= [x, y, w, h]~ +** Processing line: ~ # Returns a list of adjacent cells~ +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ +** Processing line: ~ def adjacent_neighbors(cell)~ +** Processing line: ~ neighbors = []~ ** Processing line: ~~ -** Processing line: ~ # If the mouse is clicked inside the borders of the clear button,~ -** Processing line: ~ # the filled_squares collection is emptied and the squares are cleared.~ -** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.clear_button.border)~ -** Processing line: ~ state.clear_button.clicked_at = inputs.mouse.click.created_at # time (frame) the click occurred~ -** Processing line: ~ state.filled_squares.clear~ -** Processing line: ~ inputs.mouse.previous_click = nil~ -** Processing line: ~ end~ +** Processing line: ~ neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1~ +** Processing line: ~ neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1~ +** Processing line: ~ neighbors << [cell.x, cell.y - 1] unless cell.y == 0~ +** Processing line: ~ neighbors << [cell.x - 1, cell.y] unless cell.x == 0~ ** Processing line: ~~ -** Processing line: ~ outputs.labels << state.clear_button.label~ -** Processing line: ~ outputs.borders << state.clear_button.border~ +** Processing line: ~ neighbors~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # When the clear button is clicked, the color of the button changes~ -** Processing line: ~ # and the transparency changes, as well. If you change the time from~ -** Processing line: ~ # 0.25.seconds to 1.25.seconds or more, the change will last longer.~ -** Processing line: ~ if state.clear_button.clicked_at~ -** Processing line: ~ outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.clear_button.clicked_at.ease(0.25.seconds, :flip)]~ -** Processing line: ~ end~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ +** Processing line: ~ def cell_closest_to_mouse~ +** Processing line: ~ # Closest cell to the mouse~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Bound x and y to the grid~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $paint_app = PaintApp.new~ +** Processing line: ~ # These methods detect when the buttons are clicked~ +** Processing line: ~ def left_button_clicked?~ +** Processing line: ~ inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.left)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ $paint_app.inputs = args.inputs~ -** Processing line: ~ $paint_app.state = args.state~ -** Processing line: ~ $paint_app.grid = args.grid~ -** Processing line: ~ $paint_app.args = args~ -** Processing line: ~ $paint_app.outputs = args.outputs~ -** Processing line: ~ $paint_app.tick~ -** Processing line: ~ tick_instructions args, "How to create a simple paint app. CLICK and HOLD to draw."~ -** Processing line: ~ end~ +** Processing line: ~ def center_button_clicked?~ +** Processing line: ~ inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.center)~ +** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ +** Processing line: ~ def right_button_clicked?~ +** Processing line: ~ inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.right)~ ** 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: ~ # Signal that the user is going to be moving the slider~ +** Processing line: ~ # Is the mouse down on the circle of the slider?~ +** Processing line: ~ def slider_clicked?~ +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing)~ +** Processing line: ~ circle_y = (slider.y - slider.offset)~ +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(circle_rect)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Signal that the user is going to be moving the star~ +** Processing line: ~ def star_clicked?~ +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star))~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be removing walls~ +** Processing line: ~ def wall_clicked?~ +** Processing line: ~ inputs.mouse.down && mouse_inside_a_wall?~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Mouse - Coordinate Systems - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Mouse - Coordinate Systems - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Signal that the user is going to be adding walls~ +** Processing line: ~ def grid_clicked?~ +** Processing line: ~ inputs.mouse.down && mouse_inside_grid?~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/05_mouse/04_coordinate_systems/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # Returns whether the mouse is inside of a wall~ +** Processing line: ~ # Part of the condition that checks whether the user is removing a wall~ +** Processing line: ~ def mouse_inside_a_wall?~ +** Processing line: ~ state.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(scale_up([wall.x, wall.y]))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~ false~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.mouse.click.position: Coordinates of the mouse's position on the screen.~ -** Processing line: ~ Unlike args.inputs.mouse.click.point, the mouse does not need to be pressed down for~ -** Processing line: ~ position to know the mouse's coordinates.~ -** Processing line: ~ For more information about the mouse, go to mygame/documentation/07-mouse.md.~ +** Processing line: ~ # Returns whether the mouse is inside of a grid~ +** Processing line: ~ # Part of the condition that checks whether the user is adding a wall~ +** Processing line: ~ def mouse_inside_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up([0, 0, grid.width, grid.height]))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ +** Processing line: ~ # These methods provide handy aliases to colors~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.mouse.click.point.(x|y): The x and y location of the mouse.~ +** Processing line: ~ # Light brown~ +** Processing line: ~ def unvisited_color~ +** Processing line: ~ [221, 212, 213]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +** Processing line: ~ # Black~ +** Processing line: ~ def grid_line_color~ +** Processing line: ~ [255, 255, 255]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ In this sample app, string interpolation is used to show the current position of the mouse~ -** Processing line: ~ in a label.~ +** Processing line: ~ # Dark Brown~ +** Processing line: ~ def visited_color~ +** Processing line: ~ [204, 191, 179]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.labels: An array that generates a label.~ -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +** Processing line: ~ # Blue~ +** Processing line: ~ def frontier_color~ +** Processing line: ~ [103, 136, 204]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.solids: An array that generates a solid.~ -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ -** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~ # Camo Green~ +** Processing line: ~ def wall_color~ +** Processing line: ~ [134, 134, 120]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.lines: An array that generates a line.~ -** Processing line: ~ The parameters are [X, Y, X2, Y2, RED, GREEN, BLUE, ALPHA]~ -** Processing line: ~ For more information about lines, go to mygame/documentation/04-lines.md.~ +** Processing line: ~ # Button Background~ +** Processing line: ~ def gray~ +** Processing line: ~ [190, 190, 190]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ # Button Outline~ +** Processing line: ~ def black~ +** Processing line: ~ [0, 0, 0]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # This sample app shows a coordinate system or grid. The user can move their mouse around the screen and the~ -** Processing line: ~ # coordinates of their position on the screen will be displayed. Users can choose to view one quadrant or~ -** Processing line: ~ # four quadrants by pressing the button.~ +** Processing line: ~ # These methods make the code more concise~ +** Processing line: ~ def grid~ +** Processing line: ~ state.grid~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ +** Processing line: ~ def buttons~ +** Processing line: ~ state.buttons~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The addition and subtraction in the first two parameters of the label and solid~ -** Processing line: ~ # ensure that the outputs don't overlap each other. Try removing them and see what happens.~ -** Processing line: ~ pos = args.inputs.mouse.position # stores coordinates of mouse's position~ -** Processing line: ~ args.outputs.labels << [pos.x + 10, pos.y + 10, "#{pos}"] # outputs label of coordinates~ -** Processing line: ~ args.outputs.solids << [pos.x - 2, pos.y - 2, 5, 5] # outputs small blackk box placed where mouse is hovering~ +** Processing line: ~ def slider~ +** Processing line: ~ state.slider~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ button = [0, 0, 370, 50] # sets definition of toggle button~ -** Processing line: ~ args.outputs.borders << button # outputs button as border (not filled in)~ -** Processing line: ~ args.outputs.labels << [10, 35, "click here toggle coordinate system"] # label of button~ -** Processing line: ~ args.outputs.lines << [ 0, -720, 0, 720] # vertical line dividing quadrants~ -** Processing line: ~ args.outputs.lines << [-1280, 0, 1280, 0] # horizontal line dividing quadrants~ +** Processing line: ~ # Method that is called by DragonRuby periodically~ +** Processing line: ~ # Used for updating animations and calculations~ +** Processing line: ~ def tick args~ ** Processing line: ~~ -** Processing line: ~ if args.inputs.mouse.click # if the user clicks the mouse~ -** Processing line: ~ pos = args.inputs.mouse.click.point # pos's value is point where user clicked (coordinates)~ -** Processing line: ~ if pos.inside_rect? button # if the click occurred inside the button~ -** Processing line: ~ if args.grid.name == :bottom_left # if the grid shows bottom left as origin~ -** Processing line: ~ args.grid.origin_center! # origin will be shown in center~ -** Processing line: ~ else~ -** Processing line: ~ args.grid.origin_bottom_left! # otherwise, the view will change to show bottom left as origin~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ # Pressing r will reset the application~ +** Processing line: ~ if args.inputs.keyboard.key_down.r~ +** Processing line: ~ args.gtk.reset~ +** Processing line: ~ reset~ +** Processing line: ~ return~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ tick_instructions args, "Sample app shows the two supported coordinate systems in Game Toolkit."~ +** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ +** Processing line: ~ $breadth_first_search ||= BreadthFirstSearch.new(args)~ +** Processing line: ~ $breadth_first_search.args = args~ +** Processing line: ~ $breadth_first_search.tick~ ** 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.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: ~ def reset~ +** Processing line: ~ $breadth_first_search = nil~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Save Load - Save Load Game - main.rb~ -- H1 detected. +** Processing line: ~*** Path Finding Algorithms - Detailed Breadth First Search - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Save Load - Save Load Game - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Path Finding Algorithms - Detailed Breadth First Search - 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: ~Path Finding Algorithms - Detailed Breadth First Search - 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/06_save_load/01_save_load_game/app/main.rb~ -** Processing line: ~ =begin~ -** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ -** Processing line: ~~ -** Processing line: ~ - Symbol (:): Ruby object with a name and an internal ID. Symbols are useful~ -** Processing line: ~ because with a given symbol name, you can refer to the same object throughout~ -** Processing line: ~ a Ruby program.~ +** Processing line: ~ # ./samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb~ +** Processing line: ~ # A visual demonstration of a breadth first search~ +** Processing line: ~ # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ ** Processing line: ~~ -** Processing line: ~ In this sample app, we're using symbols for our buttons. We have buttons that~ -** Processing line: ~ light fires, save, load, etc. Each of these buttons has a distinct symbol like~ -** Processing line: ~ :light_fire, :save_game, :load_game, etc.~ -** Processing line: ~~ -** Processing line: ~ - to_sym: Returns the symbol corresponding to the given string; creates the symbol~ -** Processing line: ~ if it does not already exist.~ -** Processing line: ~ For example,~ -** Processing line: ~ 'car'.to_sym~ -** Processing line: ~ would return the symbol :car.~ +** Processing line: ~ # An animation that can respond to user input in real time~ ** Processing line: ~~ -** Processing line: ~ - last: Returns the last element of an array.~ +** Processing line: ~ # A breadth first search expands in all directions one step at a time~ +** Processing line: ~ # The frontier is a queue of cells to be expanded from~ +** Processing line: ~ # The visited hash allows quick lookups of cells that have been expanded from~ +** Processing line: ~ # The walls hash allows quick lookup of whether a cell is a wall~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ +** Processing line: ~ # The breadth first search starts by adding the red star to the frontier array~ +** Processing line: ~ # and marking it as visited~ +** Processing line: ~ # Each step a cell is removed from the front of the frontier array (queue)~ +** Processing line: ~ # Unless the neighbor is a wall or visited, it is added to the frontier array~ +** Processing line: ~ # The neighbor is then marked as visited~ ** Processing line: ~~ -** Processing line: ~ - num1.lesser(num2): finds the lower value of the given options.~ -** Processing line: ~ For example, in the statement~ -** Processing line: ~ a = 4.lesser(3)~ -** Processing line: ~ 3 has a lower value than 4, which means that the value of a would be set to 3,~ -** Processing line: ~ but if the statement had been~ -** Processing line: ~ a = 4.lesser(5)~ -** Processing line: ~ 4 has a lower value than 5, which means that the value of a would be set to 4.~ +** Processing line: ~ # The frontier is blue~ +** Processing line: ~ # Visited cells are light brown~ +** Processing line: ~ # Walls are camo green~ +** Processing line: ~ # Even when walls are visited, they will maintain their wall color~ ** Processing line: ~~ -** Processing line: ~ - num1.fdiv(num2): returns the float division (will have a decimal) of the two given numbers.~ -** Processing line: ~ For example, 5.fdiv(2) = 2.5 and 5.fdiv(5) = 1.0~ +** Processing line: ~ # This search numbers the order in which new cells are explored~ +** Processing line: ~ # The next cell from where the search will continue is highlighted yellow~ +** Processing line: ~ # And the cells that will be considered for expansion are in semi-transparent green~ ** Processing line: ~~ -** Processing line: ~ - String interpolation: uses #{} syntax; everything between the #{ and the } is evaluated~ -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +** Processing line: ~ # The star can be moved by clicking and dragging~ +** Processing line: ~ # Walls can be added and removed by clicking and dragging~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.labels: An array. Values generate a label.~ -** Processing line: ~ Parameters are [X, Y, TEXT, SIZE, ALIGN, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ -** Processing line: ~ For more information, go to mygame/documentation/02-labels.md.~ +** Processing line: ~ class DetailedBreadthFirstSearch~ +** Processing line: ~ attr_gtk~ ** Processing line: ~~ -** Processing line: ~ - ARRAY#inside_rect?: An array with at least two values is considered a point. An array~ -** Processing line: ~ with at least four values is considered a rect. The inside_rect? function returns true~ -** Processing line: ~ or false depending on if the point is inside the rect.~ +** Processing line: ~ def initialize(args)~ +** Processing line: ~ # Variables to edit the size and appearance of the grid~ +** Processing line: ~ # Freely customizable to user's liking~ +** Processing line: ~ args.state.grid.width = 9~ +** Processing line: ~ args.state.grid.height = 4~ +** Processing line: ~ args.state.grid.cell_size = 90~ +** Processing line: ~~ +** Processing line: ~ # Stores which step of the animation is being rendered~ +** Processing line: ~ # When the user moves the star or messes with the walls,~ +** Processing line: ~ # the breadth first search is recalculated up to this step~ +** Processing line: ~ args.state.anim_steps = 0~ +** Processing line: ~~ +** Processing line: ~ # At some step the animation will end,~ +** Processing line: ~ # and further steps won't change anything (the whole grid will be explored)~ +** Processing line: ~ # This step is roughly the grid's width * height~ +** Processing line: ~ # When anim_steps equals max_steps no more calculations will occur~ +** Processing line: ~ # and the slider will be at the end~ +** Processing line: ~ args.state.max_steps = args.state.grid.width * args.state.grid.height~ +** Processing line: ~~ +** Processing line: ~ # The location of the star and walls of the grid~ +** Processing line: ~ # They can be modified to have a different initial grid~ +** Processing line: ~ # Walls are stored in a hash for quick look up when doing the search~ +** Processing line: ~ args.state.star = [3, 2]~ +** Processing line: ~ args.state.walls = {}~ +** Processing line: ~~ +** Processing line: ~ # Variables that are used by the breadth first search~ +** Processing line: ~ # Storing cells that the search has visited, prevents unnecessary steps~ +** Processing line: ~ # Expanding the frontier of the search in order makes the search expand~ +** Processing line: ~ # from the center outward~ +** Processing line: ~ args.state.visited = {}~ +** Processing line: ~ args.state.frontier = []~ +** Processing line: ~ args.state.cell_numbers = []~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # What the user is currently editing on the grid~ +** Processing line: ~ # Possible values are: :none, :slider, :star, :remove_wall, :add_wall~ +** Processing line: ~~ +** Processing line: ~ # We store this value, because we want to remember the value even when~ +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ +** Processing line: ~ # they are still clicking down on the mouse.~ +** Processing line: ~ args.state.click_and_drag = :none~ +** Processing line: ~~ +** Processing line: ~ # The x, y, w, h values for the buttons~ +** Processing line: ~ # Allow easy movement of the buttons location~ +** Processing line: ~ # A centralized location to get values to detect input and draw the buttons~ +** Processing line: ~ # Editing these values might mean needing to edit the label offsets~ +** Processing line: ~ # which can be found in the appropriate render button methods~ +** Processing line: ~ args.state.buttons.left = [450, 600, 160, 50]~ +** Processing line: ~ args.state.buttons.right = [610, 600, 160, 50]~ +** Processing line: ~~ +** Processing line: ~ # The variables below are related to the slider~ +** Processing line: ~ # They allow the user to customize them~ +** Processing line: ~ # They also give a central location for the render and input methods to get~ +** Processing line: ~ # information from~ +** Processing line: ~ # x & y are the coordinates of the leftmost part of the slider line~ +** Processing line: ~ args.state.slider.x = 400~ +** Processing line: ~ args.state.slider.y = 675~ +** Processing line: ~ # This is the width of the line~ +** Processing line: ~ args.state.slider.w = 360~ +** Processing line: ~ # This is the offset for the circle~ +** Processing line: ~ # Allows the center of the circle to be on the line,~ +** Processing line: ~ # as opposed to the upper right corner~ +** Processing line: ~ args.state.slider.offset = 20~ +** Processing line: ~ # This is the spacing between each of the notches on the slider~ +** Processing line: ~ # Notches are places where the circle can rest on the slider line~ +** Processing line: ~ # There needs to be a notch for each step before the maximum number of steps~ +** Processing line: ~ args.state.slider.spacing = args.state.slider.w.to_f / args.state.max_steps.to_f~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # This method is called every frame/tick~ +** Processing line: ~ # Every tick, the current state of the search is rendered on the screen,~ +** Processing line: ~ # User input is processed, and~ +** Processing line: ~ def tick~ +** Processing line: ~ render~ +** Processing line: ~ input~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ # This method is called from tick and renders everything every tick~ +** Processing line: ~ def render~ +** Processing line: ~ render_buttons~ +** Processing line: ~ render_slider~ ** Processing line: ~~ -** Processing line: ~ # This code allows users to perform different tasks, such as saving and loading the game.~ -** Processing line: ~ # Users also have options to reset the game and light a fire.~ +** Processing line: ~ render_background~ +** Processing line: ~ render_visited~ +** Processing line: ~ render_frontier~ +** Processing line: ~ render_walls~ +** Processing line: ~ render_star~ ** Processing line: ~~ -** Processing line: ~ class TextedBasedGame~ +** Processing line: ~ render_highlights~ +** Processing line: ~ render_cell_numbers~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # The methods below subdivide the task of drawing everything to the screen~ +** Processing line: ~~ +** Processing line: ~ # Draws the buttons that move the search backward or forward~ +** Processing line: ~ # These buttons are rendered so the user knows where to click to move the search~ +** Processing line: ~ def render_buttons~ +** Processing line: ~ render_left_button~ +** Processing line: ~ render_right_button~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Renders the button which steps the search backward~ +** Processing line: ~ # Shows the user where to click to move the search backward~ +** Processing line: ~ def render_left_button~ +** Processing line: ~ # Draws the gray button, and a black border~ +** Processing line: ~ # The border separates the buttons visually~ +** Processing line: ~ outputs.solids << [buttons.left, gray]~ +** Processing line: ~ outputs.borders << [buttons.left, black]~ +** Processing line: ~~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ +** Processing line: ~ # Explains to the user what the button does~ +** Processing line: ~ label_x = buttons.left.x + 05~ +** Processing line: ~ label_y = buttons.left.y + 35~ +** Processing line: ~ outputs.labels << [label_x, label_y, "< Step backward"]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Renders the button which steps the search forward~ +** Processing line: ~ # Shows the user where to click to move the search forward~ +** Processing line: ~ def render_right_button~ +** Processing line: ~ # Draws the gray button, and a black border~ +** Processing line: ~ # The border separates the buttons visually~ +** Processing line: ~ outputs.solids << [buttons.right, gray]~ +** Processing line: ~ outputs.borders << [buttons.right, black]~ +** Processing line: ~~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ +** Processing line: ~ # Explains to the user what the button does~ +** Processing line: ~ label_x = buttons.right.x + 10~ +** Processing line: ~ label_y = buttons.right.y + 35~ +** Processing line: ~ outputs.labels << [label_x, label_y, "Step forward >"]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Draws the slider so the user can move it and see the progress of the search~ +** Processing line: ~ def render_slider~ +** Processing line: ~ # Using primitives hides the line under the white circle of the slider~ +** Processing line: ~ # Draws the line~ +** Processing line: ~ outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line~ +** Processing line: ~ # The circle needs to be offset so that the center of the circle~ +** Processing line: ~ # overlaps the line instead of the upper right corner of the circle~ +** Processing line: ~ # The circle's x value is also moved based on the current seach step~ +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing)~ +** Processing line: ~ circle_y = (slider.y - slider.offset)~ +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ +** Processing line: ~ outputs.primitives << [circle_rect, 'circle-white.png'].sprite~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Draws what the grid looks like with nothing on it~ +** Processing line: ~ # Which is a bunch of unvisited cells~ +** Processing line: ~ # Drawn first so other things can draw on top of it~ +** Processing line: ~ def render_background~ +** Processing line: ~ render_unvisited~ ** Processing line: ~~ -** Processing line: ~ # Contains methods needed for game to run properly.~ -** Processing line: ~ # Increments tick count by 1 each time it runs (60 times in a single second)~ -** Processing line: ~ def tick~ -** Processing line: ~ default~ -** Processing line: ~ show_intro~ -** Processing line: ~ state.engine_tick_count += 1~ -** Processing line: ~ tick_fire~ +** Processing line: ~ # The grid lines make the cells appear separate~ +** Processing line: ~ render_grid_lines~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets default values.~ -** Processing line: ~ # The ||= ensures that a variable's value is only set to the value following the = sign~ -** Processing line: ~ # if the value has not already been set before. Intialization happens only in the first frame.~ -** Processing line: ~ def default~ -** Processing line: ~ state.engine_tick_count ||= 0~ -** Processing line: ~ state.active_module ||= :room~ -** Processing line: ~ state.fire_progress ||= 0~ -** Processing line: ~ state.fire_ready_in ||= 10~ -** Processing line: ~ state.previous_fire ||= :dead~ -** Processing line: ~ state.fire ||= :dead~ +** Processing line: ~ # Draws a rectangle the size of the entire grid to represent unvisited cells~ +** Processing line: ~ # Unvisited cells are the default cell~ +** Processing line: ~ def render_unvisited~ +** Processing line: ~ background = [0, 0, grid.width, grid.height]~ +** Processing line: ~ outputs.solids << [scale_up(background), unvisited_color]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def show_intro~ -** Processing line: ~ return unless state.engine_tick_count == 0 # return unless the game just started~ -** Processing line: ~ set_story_line "awake." # calls set_story_line method, sets to "awake"~ -** Processing line: ~ end~ +** Processing line: ~ # Draws grid lines to show the division of the grid into cells~ +** Processing line: ~ def render_grid_lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << [scale_up(vertical_line(x)), grid_line_color]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets story line.~ -** Processing line: ~ def set_story_line story_line~ -** Processing line: ~ state.story_line = story_line # story line set to value of parameter~ -** Processing line: ~ state.active_module = :alert # active module set to alert~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << [scale_up(horizontal_line(y)), grid_line_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Clears story line.~ -** Processing line: ~ def clear_storyline~ -** Processing line: ~ state.active_module = :none # active module set to none~ -** Processing line: ~ state.story_line = nil # story line is cleared, set to nil (or empty)~ +** Processing line: ~ # Easy way to get a vertical line given an index~ +** Processing line: ~ def vertical_line column~ +** Processing line: ~ [column, 0, column, grid.height]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Determines fire progress (how close the fire is to being ready to light).~ -** Processing line: ~ def tick_fire~ -** Processing line: ~ return if state.active_module == :alert # return if active module is alert~ -** Processing line: ~ state.fire_progress += 1 # increment fire progress~ -** Processing line: ~ # fire_ready_in is 10. The fire_progress is either the current value or 10, whichever has a lower value.~ -** Processing line: ~ state.fire_progress = state.fire_progress.lesser(state.fire_ready_in)~ +** Processing line: ~ # Easy way to get a horizontal line given an index~ +** Processing line: ~ def horizontal_line row~ +** Processing line: ~ [0, row, grid.width, row]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the value of fire (whether it is dead or roaring), and the story line~ -** Processing line: ~ def light_fire~ -** Processing line: ~ return unless fire_ready? # returns unless the fire is ready to be lit~ -** Processing line: ~ state.fire = :roaring # fire is lit, set to roaring~ -** Processing line: ~ state.fire_progress = 0 # the fire progress returns to 0, since the fire has been lit~ -** Processing line: ~ if state.fire != state.previous_fire~ -** Processing line: ~ set_story_line "the fire is #{state.fire}." # the story line is set using string interpolation~ -** Processing line: ~ state.previous_fire = state.fire~ +** Processing line: ~ # Draws the area that is going to be searched from~ +** Processing line: ~ # The frontier is the most outward parts of the search~ +** Processing line: ~ def render_frontier~ +** Processing line: ~ state.frontier.each do |cell|~ +** Processing line: ~ outputs.solids << [scale_up(cell), frontier_color]~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Checks if the fire is ready to be lit. Returns a boolean value.~ -** Processing line: ~ def fire_ready?~ -** Processing line: ~ # If fire_progress (value between 0 and 10) is equal to fire_ready_in (value of 10),~ -** Processing line: ~ # the fire is ready to be lit.~ -** Processing line: ~ state.fire_progress == state.fire_ready_in~ +** Processing line: ~ # Draws the walls~ +** Processing line: ~ def render_walls~ +** Processing line: ~ state.walls.each_key do |wall|~ +** Processing line: ~ outputs.solids << [scale_up(wall), wall_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Divides the value of the fire_progress variable by 10 to determine how close the user is to~ -** Processing line: ~ # being able to light a fire.~ -** Processing line: ~ def light_fire_progress~ -** Processing line: ~ state.fire_progress.fdiv(10) # float division~ +** Processing line: ~ # Renders cells that have been searched in the appropriate color~ +** Processing line: ~ def render_visited~ +** Processing line: ~ state.visited.each_key do |cell|~ +** Processing line: ~ outputs.solids << [scale_up(cell), visited_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Defines fire as the state.fire variable.~ -** Processing line: ~ def fire~ -** Processing line: ~ state.fire~ +** Processing line: ~ # Renders the star~ +** Processing line: ~ def render_star~ +** Processing line: ~ outputs.sprites << [scale_up(state.star), 'star.png']~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the title of the room.~ -** Processing line: ~ def room_title~ -** Processing line: ~ return "a room that is dark" if state.fire == :dead # room is dark if the fire is dead~ -** Processing line: ~ return "a room that is lit" # room is lit if the fire is not dead~ -** Processing line: ~ end~ +** Processing line: ~ # Cells have a number rendered in them based on when they were explored~ +** Processing line: ~ # This is based off of their index in the cell_numbers array~ +** Processing line: ~ # Cells are added to this array the same time they are added to the frontier array~ +** Processing line: ~ def render_cell_numbers~ +** Processing line: ~ state.cell_numbers.each_with_index do |cell, index|~ +** Processing line: ~ # Math that approx centers the number in the cell~ +** Processing line: ~ label_x = (cell.x * grid.cell_size) + grid.cell_size / 2 - 5~ +** Processing line: ~ label_y = (cell.y * grid.cell_size) + (grid.cell_size / 2) + 5~ ** Processing line: ~~ -** Processing line: ~ # Sets the active_module to room.~ -** Processing line: ~ def go_to_room~ -** Processing line: ~ state.active_module = :room~ +** Processing line: ~ outputs.labels << [label_x, label_y, (index + 1).to_s]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Defines active_module as the state.active_module variable.~ -** Processing line: ~ def active_module~ -** Processing line: ~ state.active_module~ -** Processing line: ~ end~ +** Processing line: ~ # The next frontier to be expanded is highlighted yellow~ +** Processing line: ~ # Its adjacent non-wall neighbors have their border highlighted green~ +** Processing line: ~ # This is to show the user how the search expands~ +** Processing line: ~ def render_highlights~ +** Processing line: ~ return if state.frontier.empty?~ ** Processing line: ~~ -** Processing line: ~ # Defines story_line as the state.story_line variable.~ -** Processing line: ~ def story_line~ -** Processing line: ~ state.story_line~ +** Processing line: ~ # Highlight the next frontier to be expanded yellow~ +** Processing line: ~ next_frontier = state.frontier[0]~ +** Processing line: ~ outputs.solids << [scale_up(next_frontier), highlighter_yellow]~ +** Processing line: ~~ +** Processing line: ~ # Neighbors have a semi-transparent green layer over them~ +** Processing line: ~ # Unless the neighbor is a wall~ +** Processing line: ~ adjacent_neighbors(next_frontier).each do |neighbor|~ +** Processing line: ~ unless state.walls.has_key?(neighbor)~ +** Processing line: ~ outputs.solids << [scale_up(neighbor), highlighter_green, 70]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Update every 60 frames (or every second)~ -** Processing line: ~ def should_tick?~ -** Processing line: ~ state.tick_count.mod_zero?(60)~ +** Processing line: ~~ +** Processing line: ~ # Cell Size is used when rendering to allow the grid to be scaled up or down~ +** Processing line: ~ # Cells in the frontier array and visited hash and walls hash are stored as x & y~ +** Processing line: ~ # Scaling up cells and lines when rendering allows omitting of width and height~ +** Processing line: ~ def scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ +** Processing line: ~~ +** Processing line: ~ # If cell is just an x and y coordinate~ +** Processing line: ~ if cell.size == 2~ +** Processing line: ~ # Add a width and height of 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Scale all the values up~ +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ +** Processing line: ~~ +** Processing line: ~ # Returns the scaled up cell~ +** Processing line: ~ cell~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets the value of the game state provider.~ -** Processing line: ~ def initialize game_state_provider~ -** Processing line: ~ @game_state_provider = game_state_provider~ +** Processing line: ~~ +** Processing line: ~ # This method processes user input every tick~ +** Processing line: ~ # This method allows the user to use the buttons, slider, and edit the grid~ +** Processing line: ~ # There are 2 types of input:~ +** Processing line: ~ # Button Input~ +** Processing line: ~ # Click and Drag Input~ +** Processing line: ~ #~ +** Processing line: ~ # Button Input is used for the backward step and forward step buttons~ +** Processing line: ~ # Input is detected by mouse up within the bounds of the rect~ +** Processing line: ~ #~ +** Processing line: ~ # Click and Drag Input is used for moving the star, adding walls,~ +** Processing line: ~ # removing walls, and the slider~ +** Processing line: ~ #~ +** Processing line: ~ # When the mouse is down on the star, the click_and_drag variable is set to :star~ +** Processing line: ~ # While click_and_drag equals :star, the cursor's position is used to calculate the~ +** Processing line: ~ # appropriate drag behavior~ +** Processing line: ~ #~ +** Processing line: ~ # When the mouse goes up click_and_drag is set to :none~ +** Processing line: ~ #~ +** Processing line: ~ # A variable has to be used because the star has to continue being edited even~ +** Processing line: ~ # when the cursor is no longer over the star~ +** Processing line: ~ #~ +** Processing line: ~ # Similar things occur for the other Click and Drag inputs~ +** Processing line: ~ def input~ +** Processing line: ~ # Processes inputs for the buttons~ +** Processing line: ~ input_buttons~ +** Processing line: ~~ +** Processing line: ~ # Detects which if any click and drag input is occurring~ +** Processing line: ~ detect_click_and_drag~ +** Processing line: ~~ +** Processing line: ~ # Does the appropriate click and drag input based on the click_and_drag variable~ +** Processing line: ~ process_click_and_drag~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Defines the game state.~ -** Processing line: ~ # Any variable prefixed with an @ symbol is an instance variable.~ -** Processing line: ~ def state~ -** Processing line: ~ @game_state_provider.state~ +** Processing line: ~ # Detects and Process input for each button~ +** Processing line: ~ def input_buttons~ +** Processing line: ~ input_left_button~ +** Processing line: ~ input_right_button~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Saves the state of the game in a text file called game_state.txt.~ -** Processing line: ~ def save~ -** Processing line: ~ $gtk.serialize_state('game_state.txt', state)~ +** Processing line: ~ # Checks if the previous step button is clicked~ +** Processing line: ~ # If it is, it pauses the animation and moves the search one step backward~ +** Processing line: ~ def input_left_button~ +** Processing line: ~ if left_button_clicked?~ +** Processing line: ~ unless state.anim_steps == 0~ +** Processing line: ~ state.anim_steps -= 1~ +** Processing line: ~ recalculate~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Loads the game state from the game_state.txt text file.~ -** Processing line: ~ # If the load is unsuccessful, the user is informed since the story line indicates the failure.~ -** Processing line: ~ def load~ -** Processing line: ~ parsed_state = $gtk.deserialize_state('game_state.txt')~ -** Processing line: ~ if !parsed_state~ -** Processing line: ~ set_story_line "no game to load. press save first."~ -** Processing line: ~ else~ -** Processing line: ~ $gtk.args.state = parsed_state~ +** Processing line: ~ # Checks if the next step button is clicked~ +** Processing line: ~ # If it is, it pauses the animation and moves the search one step forward~ +** Processing line: ~ def input_right_button~ +** Processing line: ~ if right_button_clicked?~ +** Processing line: ~ unless state.anim_steps == state.max_steps~ +** Processing line: ~ state.anim_steps += 1~ +** Processing line: ~ # Although normally recalculate would be called here~ +** Processing line: ~ # because the right button only moves the search forward~ +** Processing line: ~ # We can just do that~ +** Processing line: ~ calc~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Resets the game.~ -** Processing line: ~ def reset~ -** Processing line: ~ $gtk.reset~ +** Processing line: ~ # Whenever the user edits the grid,~ +** Processing line: ~ # The search has to be recalculated upto the current step~ +** Processing line: ~~ +** Processing line: ~ def recalculate~ +** Processing line: ~ # Resets the search~ +** Processing line: ~ state.frontier = []~ +** Processing line: ~ state.visited = {}~ +** Processing line: ~ state.cell_numbers = []~ +** Processing line: ~~ +** Processing line: ~ # Moves the animation forward one step at a time~ +** Processing line: ~ state.anim_steps.times { calc }~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ class TextedBasedGamePresenter~ -** Processing line: ~ attr_accessor :state, :outputs, :inputs~ ** Processing line: ~~ -** Processing line: ~ # Creates empty collection called highlights.~ -** Processing line: ~ # Calls methods necessary to run the game.~ -** Processing line: ~ def tick~ -** Processing line: ~ state.layout.highlights ||= []~ -** Processing line: ~ game.tick if game.should_tick?~ -** Processing line: ~ render~ -** Processing line: ~ process_input~ +** Processing line: ~ # Determines what the user is clicking and planning on dragging~ +** Processing line: ~ # Click and drag input is initiated by a click on the appropriate item~ +** Processing line: ~ # and ended by mouse up~ +** Processing line: ~ # Storing the value allows the user to continue the same edit as long as the~ +** Processing line: ~ # mouse left click is held~ +** Processing line: ~ def detect_click_and_drag~ +** Processing line: ~ if inputs.mouse.up~ +** Processing line: ~ state.click_and_drag = :none~ +** Processing line: ~ elsif star_clicked?~ +** Processing line: ~ state.click_and_drag = :star~ +** Processing line: ~ elsif wall_clicked?~ +** Processing line: ~ state.click_and_drag = :remove_wall~ +** Processing line: ~ elsif grid_clicked?~ +** Processing line: ~ state.click_and_drag = :add_wall~ +** Processing line: ~ elsif slider_clicked?~ +** Processing line: ~ state.click_and_drag = :slider~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Processes input based on what the user is currently dragging~ +** Processing line: ~ def process_click_and_drag~ +** Processing line: ~ if state.click_and_drag == :slider~ +** Processing line: ~ input_slider~ +** Processing line: ~ elsif state.click_and_drag == :star~ +** Processing line: ~ input_star~ +** Processing line: ~ elsif state.click_and_drag == :remove_wall~ +** Processing line: ~ input_remove_wall~ +** Processing line: ~ elsif state.click_and_drag == :add_wall~ +** Processing line: ~ input_add_wall~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # This method is called when the user is dragging the slider~ +** Processing line: ~ # It moves the current animation step to the point represented by the slider~ +** Processing line: ~ def input_slider~ +** Processing line: ~ mouse_x = inputs.mouse.point.x~ +** Processing line: ~~ +** Processing line: ~ # Bounds the mouse_x to the closest x value on the slider line~ +** Processing line: ~ mouse_x = slider.x if mouse_x < slider.x~ +** Processing line: ~ mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w~ +** Processing line: ~~ +** Processing line: ~ # Sets the current search step to the one represented by the mouse x value~ +** Processing line: ~ # The slider's circle moves due to the render_slider method using anim_steps~ +** Processing line: ~ state.anim_steps = ((mouse_x - slider.x) / slider.spacing).to_i~ +** Processing line: ~~ +** Processing line: ~ recalculate~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Moves the star to the grid closest to the mouse~ +** Processing line: ~ # Only recalculates the search if the star changes position~ +** Processing line: ~ # Called whenever the user is dragging the star~ +** Processing line: ~ def input_star~ +** Processing line: ~ old_star = state.star.clone~ +** Processing line: ~ state.star = cell_closest_to_mouse~ +** Processing line: ~ unless old_star == state.star~ +** Processing line: ~ recalculate~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Removes walls that are under the cursor~ +** Processing line: ~ def input_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if mouse_inside_grid?~ +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse)~ +** Processing line: ~ state.walls.delete(cell_closest_to_mouse)~ +** Processing line: ~ recalculate~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs a label of the tick count (passage of time) and calls all render methods.~ -** Processing line: ~ def render~ -** Processing line: ~ outputs.labels << [10, 30, state.tick_count]~ -** Processing line: ~ render_alert~ -** Processing line: ~ render_room~ -** Processing line: ~ render_highlights~ +** Processing line: ~ # Adds walls at cells under the cursor~ +** Processing line: ~ def input_add_wall~ +** Processing line: ~ # Adds a wall to the hash~ +** Processing line: ~ # We can use the grid closest to mouse, because the cursor is inside the grid~ +** Processing line: ~ if mouse_inside_grid?~ +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse)~ +** Processing line: ~ state.walls[cell_closest_to_mouse] = true~ +** Processing line: ~ recalculate~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs a label onto the screen that shows the story line, and also outputs a "close" button.~ -** Processing line: ~ def render_alert~ -** Processing line: ~ return unless game.active_module == :alert~ +** Processing line: ~ # This method moves the search forward one step~ +** Processing line: ~ # When the animation is playing it is called every tick~ +** Processing line: ~ # And called whenever the current step of the animation needs to be recalculated~ ** Processing line: ~~ -** Processing line: ~ outputs.labels << [640, 480, game.story_line, 5, 1] # outputs story line label~ -** Processing line: ~ outputs.primitives << button(:alert_dismiss, 490, 380, "close") # positions "close" button under story line~ +** Processing line: ~ # Moves the search forward one step~ +** Processing line: ~ # Parameter called_from_tick is true if it is called from the tick method~ +** Processing line: ~ # It is false when the search is being recalculated after user editing the grid~ +** Processing line: ~ def calc~ +** Processing line: ~ # The setup to the search~ +** Processing line: ~ # Runs once when the there is no frontier or visited cells~ +** Processing line: ~ if state.frontier.empty? && state.visited.empty?~ +** Processing line: ~ state.frontier << state.star~ +** Processing line: ~ state.visited[state.star] = true~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # A step in the search~ +** Processing line: ~ unless state.frontier.empty?~ +** Processing line: ~ # Takes the next frontier cell~ +** Processing line: ~ new_frontier = state.frontier.shift~ +** Processing line: ~ # For each of its neighbors~ +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited~ +** Processing line: ~ state.frontier << neighbor~ +** Processing line: ~ state.visited[neighbor] = true~ +** Processing line: ~~ +** Processing line: ~ # Also assign them a frontier number~ +** Processing line: ~ state.cell_numbers << neighbor~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def render_room~ -** Processing line: ~ return unless game.active_module == :room~ -** Processing line: ~ outputs.labels << [640, 700, game.room_title, 4, 1] # outputs room title label at top of screen~ ** Processing line: ~~ -** Processing line: ~ # The parameters for these outputs are (symbol, x, y, text, value/percentage) and each has a y value~ -** Processing line: ~ # that positions it 60 pixels lower than the previous output.~ +** Processing line: ~ # Returns a list of adjacent cells~ +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ +** Processing line: ~ def adjacent_neighbors cell~ +** Processing line: ~ neighbors = []~ ** Processing line: ~~ -** Processing line: ~ # outputs the light_fire_progress bar, uses light_fire_progress for its percentage (which changes bar's appearance)~ -** Processing line: ~ outputs.primitives << progress_bar(:light_fire, 490, 600, "light fire", game.light_fire_progress)~ -** Processing line: ~ outputs.primitives << button( :save_game, 490, 540, "save") # outputs save button~ -** Processing line: ~ outputs.primitives << button( :load_game, 490, 480, "load") # outputs load button~ -** Processing line: ~ outputs.primitives << button( :reset_game, 490, 420, "reset") # outputs reset button~ -** Processing line: ~ outputs.labels << [640, 30, "the fire is #{game.fire}", 0, 1] # outputs fire label at bottom of screen~ +** Processing line: ~ neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1~ +** Processing line: ~ neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1~ +** Processing line: ~ neighbors << [cell.x, cell.y - 1] unless cell.y == 0~ +** Processing line: ~ neighbors << [cell.x - 1, cell.y] unless cell.x == 0~ +** Processing line: ~~ +** Processing line: ~ neighbors~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs a collection of highlights using an array to set their values, and also rejects certain values from the collection.~ -** Processing line: ~ def render_highlights~ -** Processing line: ~ state.layout.highlights.each do |h| # for each highlight in the collection~ -** Processing line: ~ h.lifetime -= 1 # decrease the value of its lifetime~ -** Processing line: ~ end~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the grid closest to the mouse helps with this~ +** Processing line: ~ def cell_closest_to_mouse~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ outputs.solids << state.layout.highlights.map do |h| # outputs highlights collection~ -** Processing line: ~ [h.x, h.y, h.w, h.h, h.color, 255 * h.lifetime / h.max_lifetime] # sets definition for each highlight~ -** Processing line: ~ # transparency changes; divide lifetime by max_lifetime, multiply result by 255~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # reject highlights from collection that have no remaining lifetime~ -** Processing line: ~ state.layout.highlights = state.layout.highlights.reject { |h| h.lifetime <= 0 }~ +** Processing line: ~ # These methods detect when the buttons are clicked~ +** Processing line: ~ def left_button_clicked?~ +** Processing line: ~ (inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.left)) || inputs.keyboard.key_up.left~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Checks whether or not a button was clicked.~ -** Processing line: ~ # Returns a boolean value.~ -** Processing line: ~ def process_input~ -** Processing line: ~ button = button_clicked? # calls button_clicked? method~ +** Processing line: ~ def right_button_clicked?~ +** Processing line: ~ (inputs.mouse.up && inputs.mouse.point.inside_rect?(buttons.right)) || inputs.keyboard.key_up.right~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Returns a boolean value.~ -** Processing line: ~ # Finds the button that was clicked from the button list and determines what method to call.~ -** Processing line: ~ # Adds a highlight to the highlights collection.~ -** Processing line: ~ def button_clicked?~ -** Processing line: ~ return nil unless click_pos # return nil unless click_pos holds coordinates of mouse click~ -** Processing line: ~ button = @button_list.find do |k, v| # goes through button_list to find button clicked~ -** Processing line: ~ click_pos.inside_rect? v[:primitives].last.rect # was the mouse clicked inside the rect of button?~ -** Processing line: ~ end~ -** Processing line: ~ return unless button # return unless a button was clicked~ -** Processing line: ~ method_to_call = "#{button[0]}_clicked".to_sym # sets method_to_call to symbol (like :save_game or :load_game)~ -** Processing line: ~ if self.respond_to? method_to_call # returns true if self responds to the given method (method actually exists)~ -** Processing line: ~ border = button[1][:primitives].last # sets border definition using value of last key in button list hash~ +** Processing line: ~ # Signal that the user is going to be moving the slider~ +** Processing line: ~ def slider_clicked?~ +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.anim_steps * slider.spacing)~ +** Processing line: ~ circle_y = (slider.y - slider.offset)~ +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(circle_rect)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # declares each highlight as a new entity, sets properties~ -** Processing line: ~ state.layout.highlights << state.new_entity(:highlight) do |h|~ -** Processing line: ~ h.x = border.x~ -** Processing line: ~ h.y = border.y~ -** Processing line: ~ h.w = border.w~ -** Processing line: ~ h.h = border.h~ -** Processing line: ~ h.max_lifetime = 10~ -** Processing line: ~ h.lifetime = h.max_lifetime~ -** Processing line: ~ h.color = [120, 120, 180] # sets color to shade of purple~ -** Processing line: ~ end~ +** Processing line: ~ # Signal that the user is going to be moving the star~ +** Processing line: ~ def star_clicked?~ +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ self.send method_to_call # invoke method identified by symbol~ -** Processing line: ~ else # otherwise, if self doesn't respond to given method~ -** Processing line: ~ border = button[1][:primitives].last # sets border definition using value of last key in hash~ +** Processing line: ~ # Signal that the user is going to be removing walls~ +** Processing line: ~ def wall_clicked?~ +** Processing line: ~ inputs.mouse.down && mouse_inside_a_wall?~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # declares each highlight as a new entity, sets properties~ -** Processing line: ~ state.layout.highlights << state.new_entity(:highlight) do |h|~ -** Processing line: ~ h.x = border.x~ -** Processing line: ~ h.y = border.y~ -** Processing line: ~ h.w = border.w~ -** Processing line: ~ h.h = border.h~ -** Processing line: ~ h.max_lifetime = 4 # different max_lifetime than the one set if respond_to? had been true~ -** Processing line: ~ h.lifetime = h.max_lifetime~ -** Processing line: ~ h.color = [120, 80, 80] # sets color to dark color~ -** Processing line: ~ end~ +** Processing line: ~ # Signal that the user is going to be adding walls~ +** Processing line: ~ def grid_clicked?~ +** Processing line: ~ inputs.mouse.down && mouse_inside_grid?~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # instructions for users on how to add the missing method_to_call to the code~ -** Processing line: ~ puts "It looks like #{method_to_call} doesn't exists on TextedBasedGamePresenter. Please add this method:"~ -** Processing line: ~ puts "Just copy the code below and put it in the #{TextedBasedGamePresenter} class definition."~ -** Processing line: ~ puts ""~ -** Processing line: ~ puts "```"~ -** Processing line: ~ puts "class TextedBasedGamePresenter <--- find this class and put the method below in it"~ -** Processing line: ~ puts ""~ -** Processing line: ~ puts " def #{method_to_call}"~ -** Processing line: ~ puts " puts 'Yay that worked!'"~ -** Processing line: ~ puts " end"~ -** Processing line: ~ puts ""~ -** Processing line: ~ puts "end <-- make sure to put the #{method_to_call} method in between the `class` word and the final `end` statement."~ -** Processing line: ~ puts "```"~ -** Processing line: ~ puts ""~ -** Processing line: ~ end~ +** Processing line: ~ # Returns whether the mouse is inside of a wall~ +** Processing line: ~ # Part of the condition that checks whether the user is removing a wall~ +** Processing line: ~ def mouse_inside_a_wall?~ +** Processing line: ~ state.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(scale_up(wall))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ false~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Returns the position of the mouse when it is clicked.~ -** Processing line: ~ def click_pos~ -** Processing line: ~ return nil unless inputs.mouse.click # returns nil unless the mouse was clicked~ -** Processing line: ~ return inputs.mouse.click.point # returns location of mouse click (coordinates)~ +** Processing line: ~ # Returns whether the mouse is inside of a grid~ +** Processing line: ~ # Part of the condition that checks whether the user is adding a wall~ +** Processing line: ~ def mouse_inside_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up([0, 0, grid.width, grid.height]))~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Creates buttons for the button_list and sets their values using a hash (uses symbols as keys)~ -** Processing line: ~ def button id, x, y, text~ -** Processing line: ~ @button_list[id] ||= { # assigns values to hash keys~ -** Processing line: ~ id: id,~ -** Processing line: ~ text: text,~ -** Processing line: ~ primitives: [~ -** Processing line: ~ [x + 10, y + 30, text, 2, 0].label, # positions label inside border~ -** Processing line: ~ [x, y, 300, 50].border, # sets definition of border~ -** Processing line: ~ ]~ -** Processing line: ~ }~ +** Processing line: ~ # These methods provide handy aliases to colors~ ** Processing line: ~~ -** Processing line: ~ @button_list[id][:primitives] # returns label and border for buttons~ +** Processing line: ~ # Light brown~ +** Processing line: ~ def unvisited_color~ +** Processing line: ~ [221, 212, 213]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Creates a progress bar (used for lighting the fire) and sets its values.~ -** Processing line: ~ def progress_bar id, x, y, text, percentage~ -** Processing line: ~ @button_list[id] = { # assigns values to hash keys~ -** Processing line: ~ id: id,~ -** Processing line: ~ text: text,~ -** Processing line: ~ primitives: [~ -** Processing line: ~ [x, y, 300, 50, 100, 100, 100].solid, # sets definition for solid (which fills the bar with gray)~ -** Processing line: ~ [x + 10, y + 30, text, 2, 0].label, # sets definition for label, positions inside border~ -** Processing line: ~ [x, y, 300, 50].border, # sets definition of border~ -** Processing line: ~ ]~ -** Processing line: ~ }~ +** Processing line: ~ # Black~ +** Processing line: ~ def grid_line_color~ +** Processing line: ~ [255, 255, 255]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Fills progress bar based on percentage. If the fire was ready to be lit (100%) and we multiplied by~ -** Processing line: ~ # 100, only 1/3 of the bar would only be filled in. 200 would cause only 2/3 to be filled in.~ -** Processing line: ~ @button_list[id][:primitives][0][2] = 300 * percentage~ -** Processing line: ~ @button_list[id][:primitives]~ +** Processing line: ~ # Dark Brown~ +** Processing line: ~ def visited_color~ +** Processing line: ~ [204, 191, 179]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Defines the game.~ -** Processing line: ~ def game~ -** Processing line: ~ @game~ +** Processing line: ~ # Blue~ +** Processing line: ~ def frontier_color~ +** Processing line: ~ [103, 136, 204]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Initalizes the game and creates an empty list of buttons.~ -** Processing line: ~ def initialize~ -** Processing line: ~ @game = TextedBasedGame.new self~ -** Processing line: ~ @button_list ||= {}~ +** Processing line: ~ # Camo Green~ +** Processing line: ~ def wall_color~ +** Processing line: ~ [134, 134, 120]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Clears the storyline and takes the user to the room.~ -** Processing line: ~ def alert_dismiss_clicked~ -** Processing line: ~ game.clear_storyline~ -** Processing line: ~ game.go_to_room~ +** Processing line: ~ # Next frontier to be expanded~ +** Processing line: ~ def highlighter_yellow~ +** Processing line: ~ [214, 231, 125]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Lights the fire when the user clicks the "light fire" option.~ -** Processing line: ~ def light_fire_clicked~ -** Processing line: ~ game.light_fire~ +** Processing line: ~ # The neighbors of the next frontier to be expanded~ +** Processing line: ~ def highlighter_green~ +** Processing line: ~ [65, 191, 127]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Saves the game when the user clicks the "save" option.~ -** Processing line: ~ def save_game_clicked~ -** Processing line: ~ game.save~ +** Processing line: ~ # Button background~ +** Processing line: ~ def gray~ +** Processing line: ~ [190, 190, 190]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Resets the game when the user clicks the "reset" option.~ -** Processing line: ~ def reset_game_clicked~ -** Processing line: ~ game.reset~ +** Processing line: ~ # Button outline~ +** Processing line: ~ def black~ +** Processing line: ~ [0, 0, 0]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Loads the game when the user clicks the "load" option.~ -** Processing line: ~ def load_game_clicked~ -** Processing line: ~ game.load~ +** Processing line: ~ # These methods make the code more concise~ +** Processing line: ~ def grid~ +** Processing line: ~ state.grid~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def buttons~ +** Processing line: ~ state.buttons~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def slider~ +** Processing line: ~ state.slider~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $text_based_rpg = TextedBasedGamePresenter.new~ ** Processing line: ~~ ** Processing line: ~ def tick args~ -** Processing line: ~ $text_based_rpg.state = args.state~ -** Processing line: ~ $text_based_rpg.outputs = args.outputs~ -** Processing line: ~ $text_based_rpg.inputs = args.inputs~ -** Processing line: ~ $text_based_rpg.tick~ +** Processing line: ~ # Pressing r resets the program~ +** Processing line: ~ if args.inputs.keyboard.key_down.r~ +** Processing line: ~ args.gtk.reset~ +** Processing line: ~ reset~ +** Processing line: ~ return~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $detailed_breadth_first_search ||= DetailedBreadthFirstSearch.new(args)~ +** Processing line: ~ $detailed_breadth_first_search.args = args~ +** Processing line: ~ $detailed_breadth_first_search.tick~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ def reset~ +** Processing line: ~ $detailed_breadth_first_search = nil~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Advanced Rendering - Simple Render Targets - main.rb~ -- H1 detected. +** Processing line: ~*** Path Finding Algorithms - Breadcrumbs - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Rendering - Simple Render Targets - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Path Finding Algorithms - Breadcrumbs - 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: ~Path Finding Algorithms - Breadcrumbs - 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/01_simple_render_targets/app/main.rb~ -** Processing line: ~ def tick args~ -** Processing line: ~ # args.outputs.render_targets are really really powerful.~ -** Processing line: ~ # They essentially allow you to create a sprite programmatically and cache the result.~ -** Processing line: ~~ -** Processing line: ~ # Create a render_target of a :block and a :gradient on tick zero.~ -** Processing line: ~ if args.state.tick_count == 0~ -** Processing line: ~ args.render_target(:block).solids << [0, 0, 1280, 100]~ +** Processing line: ~ # ./samples/13_path_finding_algorithms/03_breadcrumbs/app/main.rb~ +** Processing line: ~ class Breadcrumbs~ +** Processing line: ~ attr_gtk~ ** Processing line: ~~ -** Processing line: ~ # The gradient is actually just a collection of black solids with increasing~ -** Processing line: ~ # opacities.~ -** Processing line: ~ args.render_target(:gradient).solids << 90.map_with_index do |x|~ -** Processing line: ~ 50.map_with_index do |y|~ -** Processing line: ~ [x * 15, y * 15, 15, 15, 0, 0, 0, (x * 3).fdiv(255) * 255]~ -** Processing line: ~ end~ +** Processing line: ~ # This method is called every frame/tick~ +** Processing line: ~ # Every tick, the current state of the search is rendered on the screen,~ +** Processing line: ~ # User input is processed, and~ +** Processing line: ~ # The next step in the search is calculated~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ # If the grid has not been searched~ +** Processing line: ~ if search.came_from.empty?~ +** Processing line: ~ calc~ +** Processing line: ~ # Calc Path~ ** Processing line: ~ end~ +** Processing line: ~ render~ +** Processing line: ~ input~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Take the :block render_target and present it horizontally centered.~ -** Processing line: ~ # Use a subsection of the render_targetd specified by source_x,~ -** Processing line: ~ # source_y, source_w, source_h.~ -** Processing line: ~ args.outputs.sprites << { x: 0,~ -** Processing line: ~ y: 310,~ -** Processing line: ~ w: 1280,~ -** Processing line: ~ h: 100,~ -** Processing line: ~ path: :block,~ -** Processing line: ~ source_x: 0,~ -** Processing line: ~ source_y: 0,~ -** Processing line: ~ source_w: 1280,~ -** Processing line: ~ source_h: 100 }~ +** Processing line: ~ def defaults~ +** Processing line: ~ # Variables to edit the size and appearance of the grid~ +** Processing line: ~ # Freely customizable to user's liking~ +** Processing line: ~ grid.width ||= 30~ +** Processing line: ~ grid.height ||= 15~ +** Processing line: ~ grid.cell_size ||= 40~ +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ +** Processing line: ~~ +** Processing line: ~ # The location of the star and walls of the grid~ +** Processing line: ~ # They can be modified to have a different initial grid~ +** Processing line: ~ # Walls are stored in a hash for quick look up when doing the search~ +** Processing line: ~ grid.star ||= [2, 8]~ +** Processing line: ~ grid.target ||= [10, 5]~ +** Processing line: ~ grid.walls ||= {~ +** Processing line: ~ [3, 3] => true,~ +** Processing line: ~ [3, 4] => true,~ +** Processing line: ~ [3, 5] => true,~ +** Processing line: ~ [3, 6] => true,~ +** Processing line: ~ [3, 7] => true,~ +** Processing line: ~ [3, 8] => true,~ +** Processing line: ~ [3, 9] => true,~ +** Processing line: ~ [3, 10] => true,~ +** Processing line: ~ [3, 11] => true,~ +** Processing line: ~ [4, 3] => true,~ +** Processing line: ~ [4, 4] => true,~ +** Processing line: ~ [4, 5] => true,~ +** Processing line: ~ [4, 6] => true,~ +** Processing line: ~ [4, 7] => true,~ +** Processing line: ~ [4, 8] => true,~ +** Processing line: ~ [4, 9] => true,~ +** Processing line: ~ [4, 10] => true,~ +** Processing line: ~ [4, 11] => true,~ +** Processing line: ~ [13, 0] => true,~ +** Processing line: ~ [13, 1] => true,~ +** Processing line: ~ [13, 2] => true,~ +** Processing line: ~ [13, 3] => true,~ +** Processing line: ~ [13, 4] => true,~ +** Processing line: ~ [13, 5] => true,~ +** Processing line: ~ [13, 6] => true,~ +** Processing line: ~ [13, 7] => true,~ +** Processing line: ~ [13, 8] => true,~ +** Processing line: ~ [13, 9] => true,~ +** Processing line: ~ [13, 10] => true,~ +** Processing line: ~ [14, 0] => true,~ +** Processing line: ~ [14, 1] => true,~ +** Processing line: ~ [14, 2] => true,~ +** Processing line: ~ [14, 3] => true,~ +** Processing line: ~ [14, 4] => true,~ +** Processing line: ~ [14, 5] => true,~ +** Processing line: ~ [14, 6] => true,~ +** Processing line: ~ [14, 7] => true,~ +** Processing line: ~ [14, 8] => true,~ +** Processing line: ~ [14, 9] => true,~ +** Processing line: ~ [14, 10] => true,~ +** Processing line: ~ [21, 8] => true,~ +** Processing line: ~ [21, 9] => true,~ +** Processing line: ~ [21, 10] => true,~ +** Processing line: ~ [21, 11] => true,~ +** Processing line: ~ [21, 12] => true,~ +** Processing line: ~ [21, 13] => true,~ +** Processing line: ~ [21, 14] => true,~ +** Processing line: ~ [22, 8] => true,~ +** Processing line: ~ [22, 9] => true,~ +** Processing line: ~ [22, 10] => true,~ +** Processing line: ~ [22, 11] => true,~ +** Processing line: ~ [22, 12] => true,~ +** Processing line: ~ [22, 13] => true,~ +** Processing line: ~ [22, 14] => true,~ +** Processing line: ~ [23, 8] => true,~ +** Processing line: ~ [23, 9] => true,~ +** Processing line: ~ [24, 8] => true,~ +** Processing line: ~ [24, 9] => true,~ +** Processing line: ~ [25, 8] => true,~ +** Processing line: ~ [25, 9] => true,~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~ # After rendering :block, render gradient on top of :block.~ -** Processing line: ~ args.outputs.sprites << [0, 0, 1280, 720, :gradient]~ +** Processing line: ~ # Variables that are used by the breadth first search~ +** Processing line: ~ # Storing cells that the search has visited, prevents unnecessary steps~ +** Processing line: ~ # Expanding the frontier of the search in order makes the search expand~ +** Processing line: ~ # from the center outward~ ** Processing line: ~~ -** Processing line: ~ args.outputs.labels << [1270, 710, args.gtk.current_framerate, 0, 2, 255, 255, 255]~ -** Processing line: ~ tick_instructions args, "Sample app shows how to use render_targets (programmatically create cached sprites)."~ -** Processing line: ~ end~ +** Processing line: ~ # The cells from which the search is to expand~ +** Processing line: ~ search.frontier ||= []~ +** Processing line: ~ # A hash of where each cell was expanded from~ +** Processing line: ~ # The key is a cell, and the value is the cell it came from~ +** Processing line: ~ search.came_from ||= {}~ +** Processing line: ~ # Cells that are part of the path from the target to the star~ +** Processing line: ~ search.path ||= {}~ ** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ +** Processing line: ~ # What the user is currently editing on the grid~ +** Processing line: ~ # We store this value, because we want to remember the value even when~ +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ +** Processing line: ~ # they are still clicking down on the mouse.~ +** Processing line: ~ state.current_input ||= :none~ ** 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: ~ def calc~ +** Processing line: ~ # Setup the search to start from the star~ +** Processing line: ~ search.frontier << grid.star~ +** Processing line: ~ search.came_from[grid.star] = nil~ +** Processing line: ~~ +** Processing line: ~ # Until there are no more cells to expand from~ +** Processing line: ~ until search.frontier.empty?~ +** Processing line: ~ # Takes the next frontier cell~ +** Processing line: ~ new_frontier = search.frontier.shift~ +** Processing line: ~ # For each of its neighbors~ +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless search.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited in the first grid~ +** Processing line: ~ # Unless the target has been visited~ +** Processing line: ~ # Add the neighbor to the frontier and remember which cell it came from~ +** Processing line: ~ search.frontier << neighbor~ +** Processing line: ~ search.came_from[neighbor] = new_frontier~ +** Processing line: ~ end~ +** 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: ~ # Draws everything onto the screen~ +** Processing line: ~ def render~ +** Processing line: ~ render_background~ +** Processing line: ~ # render_heat_map~ +** Processing line: ~ render_walls~ +** Processing line: ~ # render_path~ +** Processing line: ~ # render_labels~ +** Processing line: ~ render_arrows~ +** Processing line: ~ render_star~ +** Processing line: ~ render_target~ +** Processing line: ~ unless grid.walls.has_key?(grid.target)~ +** Processing line: ~ render_trail~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render_trail(current_cell=grid.target)~ +** Processing line: ~ return if current_cell == grid.star~ +** Processing line: ~ parent_cell = search.came_from[current_cell]~ +** Processing line: ~ if current_cell && parent_cell~ +** Processing line: ~ outputs.lines << [(current_cell.x + 0.5) * grid.cell_size, (current_cell.y + 0.5) * grid.cell_size,~ +** Processing line: ~ (parent_cell.x + 0.5) * grid.cell_size, (parent_cell.y + 0.5) * grid.cell_size, purple]~ +** Processing line: ~~ +** Processing line: ~ end~ +** Processing line: ~ render_trail(parent_cell)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render_arrows~ +** Processing line: ~ search.came_from.each do |child, parent|~ +** Processing line: ~ if parent && child~ +** Processing line: ~ arrow_cell = [(child.x + parent.x) / 2, (child.y + parent.y) / 2]~ +** Processing line: ~ if parent.x > child.x # If the parent cell is to the right of the child cell~ +** Processing line: ~ outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 0] # Point the arrow to the right~ +** Processing line: ~ elsif parent.x < child.x # If the parent cell is to the right of the child cell~ +** Processing line: ~ outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 180] # Point the arrow to the right~ +** Processing line: ~ elsif parent.y > child.y # If the parent cell is to the right of the child cell~ +** Processing line: ~ outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 90] # Point the arrow to the right~ +** Processing line: ~ elsif parent.y < child.y # If the parent cell is to the right of the child cell~ +** Processing line: ~ outputs.sprites << [scale_up(arrow_cell), 'arrow.png', 270] # Point the arrow to the right~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # The methods below subdivide the task of drawing everything to the screen~ ** Processing line: ~~ -** Processing line: ~* Advanced Rendering - Render Targets With Tile Manipulation - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Rendering - Render Targets With Tile Manipulation - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Draws what the grid looks like with nothing on it~ +** Processing line: ~ def render_background~ +** Processing line: ~ render_unvisited~ +** Processing line: ~ render_grid_lines~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/07_advanced_rendering/02_render_targets_with_tile_manipulation/app/main.rb~ -** Processing line: ~ # This sample is meant to show you how to do that dripping transition thing~ -** Processing line: ~ # at the start of the original Doom. Most of this file is here to animate~ -** Processing line: ~ # a scene to wipe away; the actual wipe effect is in the last 20 lines or~ -** Processing line: ~ # so.~ +** Processing line: ~ # Draws both grids~ +** Processing line: ~ def render_unvisited~ +** Processing line: ~ outputs.solids << [scale_up(grid.rect), unvisited_color]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.reset # reset all game state if reloaded.~ +** Processing line: ~ # Draws grid lines to show the division of the grid into cells~ +** Processing line: ~ def render_grid_lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << vertical_line(x)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def circle_of_blocks pass, xoffset, yoffset, angleoffset, blocksize, distance~ -** Processing line: ~ numblocks = 10~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << horizontal_line(y)~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ for i in 1..numblocks do~ -** Processing line: ~ angle = ((360 / numblocks) * i) + angleoffset~ -** Processing line: ~ radians = angle * (Math::PI / 180)~ -** Processing line: ~ x = (xoffset + (distance * Math.cos(radians))).round~ -** Processing line: ~ y = (yoffset + (distance * Math.sin(radians))).round~ -** Processing line: ~ pass.solids << [ x, y, blocksize, blocksize, 255, 255, 0 ]~ +** Processing line: ~ # Easy way to draw vertical lines given an index~ +** Processing line: ~ def vertical_line column~ +** Processing line: ~ scale_up([column, 0, column, grid.height])~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def draw_scene args, pass~ -** Processing line: ~ pass.solids << [0, 360, 1280, 360, 0, 0, 200]~ -** Processing line: ~ pass.solids << [0, 0, 1280, 360, 0, 127, 0]~ +** Processing line: ~ # Easy way to draw horizontal lines given an index~ +** Processing line: ~ def horizontal_line row~ +** Processing line: ~ scale_up([0, row, grid.width, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ blocksize = 100~ -** Processing line: ~ angleoffset = args.state.tick_count * 2.5~ -** Processing line: ~ centerx = (1280 - blocksize) / 2~ -** Processing line: ~ centery = (720 - blocksize) / 2~ +** Processing line: ~ # Draws the walls on both grids~ +** Processing line: ~ def render_walls~ +** Processing line: ~ grid.walls.each_key do |wall|~ +** Processing line: ~ outputs.solids << [scale_up(wall), wall_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize * 2, 500~ -** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize, 325~ -** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 2, 200~ -** Processing line: ~ circle_of_blocks pass, centerx, centery, angleoffset, blocksize / 4, 100~ -** Processing line: ~ end~ +** Processing line: ~ # Renders the star on both grids~ +** Processing line: ~ def render_star~ +** Processing line: ~ outputs.sprites << [scale_up(grid.star), 'star.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ segments = 160~ +** Processing line: ~ # Renders the target on both grids~ +** Processing line: ~ def render_target~ +** Processing line: ~ outputs.sprites << [scale_up(grid.target), 'target.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # On the first tick, initialize some stuff.~ -** Processing line: ~ if !args.state.yoffsets~ -** Processing line: ~ args.state.baseyoff = 0~ -** Processing line: ~ args.state.yoffsets = []~ -** Processing line: ~ for i in 0..segments do~ -** Processing line: ~ args.state.yoffsets << rand * 100~ +** Processing line: ~ # Labels the grids~ +** Processing line: ~ def render_labels~ +** Processing line: ~ outputs.labels << [200, 625, "Without early exit"]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Renders the path based off of the search.path hash~ +** Processing line: ~ def render_path~ +** Processing line: ~ # If the star and target are disconnected there will only be one path~ +** Processing line: ~ # The path should not render in that case~ +** Processing line: ~ unless search.path.size == 1~ +** Processing line: ~ search.path.each_key do | cell |~ +** Processing line: ~ # Renders path on both grids~ +** Processing line: ~ outputs.solids << [scale_up(cell), path_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Just draw some random stuff for a few seconds.~ -** Processing line: ~ args.state.static_debounce ||= 60 * 2.5~ -** Processing line: ~ if args.state.static_debounce > 0~ -** Processing line: ~ last_frame = args.state.static_debounce == 1~ -** Processing line: ~ target = last_frame ? args.render_target(:last_frame) : args.outputs~ -** Processing line: ~ draw_scene args, target~ -** Processing line: ~ args.state.static_debounce -= 1~ -** Processing line: ~ return unless last_frame~ +** Processing line: ~ # Calculates the path from the target to the star after the search is over~ +** Processing line: ~ # Relies on the came_from hash~ +** Processing line: ~ # Fills the search.path hash, which is later rendered on screen~ +** Processing line: ~ def calc_path~ +** Processing line: ~ endpoint = grid.target~ +** Processing line: ~ while endpoint~ +** Processing line: ~ search.path[endpoint] = true~ +** Processing line: ~ endpoint = search.came_from[endpoint]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # build up the wipe...~ +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ +** Processing line: ~ # This method is used to scale up cells, and lines~ +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ +** Processing line: ~ def scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ ** Processing line: ~~ -** Processing line: ~ # this is the thing we're wiping to.~ -** Processing line: ~ args.outputs.sprites << [ 0, 0, 1280, 720, 'dragonruby.png' ]~ +** Processing line: ~ # If cell is just an x and y coordinate~ +** Processing line: ~ if cell.size == 2~ +** Processing line: ~ # Add a width and height of 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ return if (args.state.baseyoff > (1280 + 100)) # stop when done sliding~ +** Processing line: ~ # Scale all the values up~ +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ ** Processing line: ~~ -** Processing line: ~ segmentw = 1280 / segments~ +** Processing line: ~ # Returns the scaled up cell~ +** Processing line: ~ cell~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ x = 0~ -** Processing line: ~ for i in 0..segments do~ -** Processing line: ~ yoffset = 0~ -** Processing line: ~ if args.state.yoffsets[i] < args.state.baseyoff~ -** Processing line: ~ yoffset = args.state.baseyoff - args.state.yoffsets[i]~ +** Processing line: ~ # This method processes user input every tick~ +** Processing line: ~ # Any method with "1" is related to the first grid~ +** Processing line: ~ # Any method with "2" is related to the second grid~ +** Processing line: ~ def input~ +** Processing line: ~ # The program has to remember that the user is dragging an object~ +** Processing line: ~ # even when the mouse is no longer over that object~ +** Processing line: ~ # So detecting input and processing input is separate~ +** Processing line: ~ # detect_input~ +** Processing line: ~ # process_input~ +** Processing line: ~ if inputs.mouse.up~ +** Processing line: ~ state.current_input = :none~ +** Processing line: ~ elsif star_clicked?~ +** Processing line: ~ state.current_input = :star~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # (720 - yoffset) flips the coordinate system, (- 720) adjusts for the height of the segment.~ -** Processing line: ~ args.outputs.sprites << [ x, (720 - yoffset) - 720, segmentw, 720, 'last_frame', 0, 255, 255, 255, 255, x, 0, segmentw, 720 ]~ -** Processing line: ~ x += segmentw~ +** Processing line: ~ if mouse_inside_grid?~ +** Processing line: ~ unless grid.target == cell_closest_to_mouse~ +** Processing line: ~ grid.target = cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ if state.current_input == :star~ +** Processing line: ~ unless grid.star == cell_closest_to_mouse~ +** Processing line: ~ grid.star = cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.baseyoff += 4~ +** Processing line: ~ # Determines what the user is editing and stores the value~ +** Processing line: ~ # Storing the value allows the user to continue the same edit as long as the~ +** Processing line: ~ # mouse left click is held~ +** Processing line: ~ def detect_input~ +** Processing line: ~ # When the mouse is up, nothing is being edited~ +** Processing line: ~ if inputs.mouse.up~ +** Processing line: ~ state.current_input = :none~ +** Processing line: ~ # When the star in the no second grid is clicked~ +** Processing line: ~ elsif star_clicked?~ +** Processing line: ~ state.current_input = :star~ +** Processing line: ~ # When the target in the no second grid is clicked~ +** Processing line: ~ elsif target_clicked?~ +** Processing line: ~ state.current_input = :target~ +** Processing line: ~ # When a wall in the first grid is clicked~ +** Processing line: ~ elsif wall_clicked?~ +** Processing line: ~ state.current_input = :remove_wall~ +** Processing line: ~ # When the first grid is clicked~ +** Processing line: ~ elsif grid_clicked?~ +** Processing line: ~ state.current_input = :add_wall~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ +** Processing line: ~ def process_input~ +** Processing line: ~ if state.current_input == :star~ +** Processing line: ~ input_star~ +** Processing line: ~ elsif state.current_input == :target~ +** Processing line: ~ input_target~ +** Processing line: ~ elsif state.current_input == :remove_wall~ +** Processing line: ~ input_remove_wall~ +** Processing line: ~ elsif state.current_input == :add_wall~ +** Processing line: ~ input_add_wall~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def input_star~ +** Processing line: ~ old_star = grid.star.clone~ +** Processing line: ~ grid.star = cell_closest_to_mouse~ +** Processing line: ~ unless old_star == grid.star~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ +** Processing line: ~ # Only reset_searchs the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def input_target~ +** Processing line: ~ old_target = grid.target.clone~ +** Processing line: ~ grid.target = cell_closest_to_mouse~ +** Processing line: ~ unless old_target == grid.target~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Removes walls in the first grid that are under the cursor~ +** Processing line: ~ def input_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if mouse_inside_grid?~ +** Processing line: ~ if grid.walls.has_key?(cell_closest_to_mouse)~ +** Processing line: ~ grid.walls.delete(cell_closest_to_mouse)~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ tick_instructions args, "Sample app shows an advanced usage of render_target."~ -** Processing line: ~ end~ +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ +** Processing line: ~ def input_add_wall~ +** Processing line: ~ if mouse_inside_grid?~ +** Processing line: ~ unless grid.walls.has_key?(cell_closest_to_mouse)~ +** Processing line: ~ grid.walls[cell_closest_to_mouse] = true~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ +** Processing line: ~~ +** Processing line: ~ # Whenever the user edits the grid,~ +** Processing line: ~ # The search has to be reset_searchd upto the current step~ +** Processing line: ~ # with the current grid as the initial state of the grid~ +** Processing line: ~ def reset_search~ +** Processing line: ~ # Reset_Searchs the search~ +** Processing line: ~ search.frontier = []~ +** Processing line: ~ search.came_from = {}~ +** Processing line: ~ search.path = {}~ ** 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: ~ # Returns a list of adjacent cells~ +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ +** Processing line: ~ def adjacent_neighbors(cell)~ +** Processing line: ~ neighbors = []~ ** Processing line: ~~ +** Processing line: ~ # Gets all the valid neighbors into the array~ +** Processing line: ~ # From southern neighbor, clockwise~ +** Processing line: ~ neighbors << [cell.x, cell.y - 1] unless cell.y == 0~ +** Processing line: ~ neighbors << [cell.x - 1, cell.y] unless cell.x == 0~ +** Processing line: ~ neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1~ +** Processing line: ~ neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1~ ** Processing line: ~~ -** Processing line: ~* Advanced Rendering - Render Target Viewports - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Rendering - Render Target Viewports - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Sorts the neighbors so the rendered path is a zigzag path~ +** Processing line: ~ # Cells in a diagonal direction are given priority~ +** Processing line: ~ # Comment this line to see the difference~ +** Processing line: ~ neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) }~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/07_advanced_rendering/03_render_target_viewports/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ neighbors~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ +** Processing line: ~ # and returns the larger value~ +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ +** Processing line: ~ # A cell that is [5, 5] from the star,~ +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ +** Processing line: ~ def proximity_to_star(x, y)~ +** Processing line: ~ distance_x = (grid.star.x - x).abs~ +** Processing line: ~ distance_y = (grid.star.y - y).abs~ ** Processing line: ~~ -** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ -** Processing line: ~ For example, if we want to create a new button, we would declare it as a new entity and~ -** Processing line: ~ then define its properties. (Remember, you can use state to define ANY property and it will~ -** Processing line: ~ be retained across frames.)~ +** Processing line: ~ if distance_x > distance_y~ +** Processing line: ~ return distance_x~ +** Processing line: ~ else~ +** Processing line: ~ return distance_y~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ If you have a solar system and you're creating args.state.sun and setting its image path to an~ -** Processing line: ~ image in the sprites folder, you would do the following:~ -** Processing line: ~ (See samples/99_sample_nddnug_workshop for more details.)~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ +** Processing line: ~ def cell_closest_to_mouse~ +** Processing line: ~ # Closest cell to the mouse in the first grid~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Bound x and y to the grid~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.sun ||= args.state.new_entity(:sun) do |s|~ -** Processing line: ~ s.path = 'sprites/sun.png'~ -** Processing line: ~ end~ +** Processing line: ~ # Signal that the user is going to be moving the star from the first grid~ +** Processing line: ~ def star_clicked?~ +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(grid.star))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ -** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ +** Processing line: ~ def target_clicked?~ +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(grid.target))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ For example, if we have a variable~ -** Processing line: ~ name = "Ruby"~ -** Processing line: ~ then the line~ -** Processing line: ~ puts "How are you, #{name}?"~ -** Processing line: ~ would print "How are you, Ruby?" to the console.~ -** Processing line: ~ (Remember, string interpolation only works with double quotes!)~ +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ +** Processing line: ~ def grid_clicked?~ +** Processing line: ~ inputs.mouse.down && mouse_inside_grid?~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - Ternary operator (?): Similar to if statement; first evalulates whether a statement is~ -** Processing line: ~ true or false, and then executes a command depending on that result.~ -** Processing line: ~ For example, if we had a variable~ -** Processing line: ~ grade = 75~ -** Processing line: ~ and used the ternary operator in the command~ -** Processing line: ~ pass_or_fail = grade > 65 ? "pass" : "fail"~ -** Processing line: ~ then the value of pass_or_fail would be "pass" since grade's value was greater than 65.~ +** Processing line: ~ # Returns whether the mouse is inside of the first grid~ +** Processing line: ~ # Part of the condition that checks whether the user is adding a wall~ +** Processing line: ~ def mouse_inside_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up(grid.rect))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ +** Processing line: ~ # These methods provide handy aliases to colors~ ** Processing line: ~~ -** Processing line: ~ - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual~ -** Processing line: ~ 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).~ +** Processing line: ~ # Light brown~ +** Processing line: ~ def unvisited_color~ +** Processing line: ~ [221, 212, 213]~ +** Processing line: ~ # [255, 255, 255]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - Numeric#shift_(left|right|up|down): Shifts the Numeric in the correct direction~ -** Processing line: ~ by adding or subracting.~ +** Processing line: ~ # Camo Green~ +** Processing line: ~ def wall_color~ +** Processing line: ~ [134, 134, 120]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - ARRAY#inside_rect?: An array with at least two values is considered a point. An array~ -** Processing line: ~ with at least four values is considered a rect. The inside_rect? function returns true~ -** Processing line: ~ or false depending on if the point is inside the rect.~ +** Processing line: ~ # Pastel White~ +** Processing line: ~ def path_color~ +** Processing line: ~ [231, 230, 228]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if the two rectangles intersect.~ +** Processing line: ~ def red~ +** Processing line: ~ [255, 0, 0]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.mouse.click: This property will be set if the mouse was clicked.~ -** Processing line: ~ For more information about the mouse, go to mygame/documentation/07-mouse.md.~ +** Processing line: ~ def purple~ +** Processing line: ~ [149, 64, 191]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.inputs.keyboard.key_up.KEY: The value of the properties will be set~ -** Processing line: ~ to the frame that the key_up event occurred (the frame correlates~ -** Processing line: ~ to args.state.tick_count).~ -** Processing line: ~ For more information about the keyboard, go to mygame/documentation/06-keyboard.md.~ +** Processing line: ~ # Makes code more concise~ +** Processing line: ~ def grid~ +** Processing line: ~ state.grid~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.state.labels:~ -** Processing line: ~ The parameters for a label are~ -** Processing line: ~ 1. the position (x, y)~ -** Processing line: ~ 2. the text~ -** Processing line: ~ 3. the size~ -** Processing line: ~ 4. the alignment~ -** Processing line: ~ 5. the color (red, green, and blue saturations)~ -** Processing line: ~ 6. the alpha (or transparency)~ -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +** Processing line: ~ def search~ +** Processing line: ~ state.search~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.state.lines:~ -** Processing line: ~ The parameters for a line are~ -** Processing line: ~ 1. the starting position (x, y)~ -** Processing line: ~ 2. the ending position (x2, y2)~ -** Processing line: ~ 3. the color (red, green, and blue saturations)~ -** Processing line: ~ 4. the alpha (or transparency)~ -** Processing line: ~ For more information about lines, go to mygame/documentation/04-lines.md.~ +** Processing line: ~ # Method that is called by DragonRuby periodically~ +** Processing line: ~ # Used for updating animations and calculations~ +** Processing line: ~ def tick args~ ** Processing line: ~~ -** Processing line: ~ - args.state.solids (and args.state.borders):~ -** Processing line: ~ The parameters for a solid (or border) are~ -** Processing line: ~ 1. the position (x, y)~ -** Processing line: ~ 2. the width (w)~ -** Processing line: ~ 3. the height (h)~ -** Processing line: ~ 4. the color (r, g, b)~ -** Processing line: ~ 5. the alpha (or transparency)~ -** Processing line: ~ For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~ # Pressing r will reset the application~ +** Processing line: ~ if args.inputs.keyboard.key_down.r~ +** Processing line: ~ args.gtk.reset~ +** Processing line: ~ reset~ +** Processing line: ~ return~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.state.sprites:~ -** Processing line: ~ The parameters for a sprite are~ -** Processing line: ~ 1. the position (x, y)~ -** Processing line: ~ 2. the width (w)~ -** Processing line: ~ 3. the height (h)~ -** Processing line: ~ 4. the image path~ -** Processing line: ~ 5. the angle~ -** Processing line: ~ 6. the alpha (or transparency)~ -** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ -** Processing line: ~ =end~ +** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ +** Processing line: ~ $breadcrumbs ||= Breadcrumbs.new(args)~ +** Processing line: ~ $breadcrumbs.args = args~ +** Processing line: ~ $breadcrumbs.tick~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # This sample app shows different objects that can be used when making games, such as labels,~ -** Processing line: ~ # lines, sprites, solids, buttons, etc. Each demo section shows how these objects can be used.~ ** Processing line: ~~ -** Processing line: ~ # Also note that state.tick_count refers to the passage of time, or current frame.~ +** Processing line: ~ def reset~ +** Processing line: ~ $breadcrumbs = nil~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # # Representation of how far away visited cells are from the star~ +** Processing line: ~ # # Replaces the render_visited method~ +** Processing line: ~ # # Visually demonstrates the effectiveness of early exit for pathfinding~ +** Processing line: ~ # def render_heat_map~ +** Processing line: ~ # # THIS CODE NEEDS SOME FIXING DUE TO REFACTORING~ +** Processing line: ~ # search.came_from.each_key do | cell |~ +** Processing line: ~ # distance = (grid.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs~ +** Processing line: ~ # max_distance = grid.width + grid.height~ +** Processing line: ~ # alpha = 255.to_i * distance.to_i / max_distance.to_i~ +** Processing line: ~ # outputs.solids << [scale_up(visited_cell), red, alpha]~ +** Processing line: ~ # # outputs.solids << [early_exit_scale_up(visited_cell), red, alpha]~ +** Processing line: ~ # end~ +** Processing line: ~ # end~ ** Processing line: ~~ -** Processing line: ~ class TechDemo~ -** Processing line: ~ attr_accessor :inputs, :state, :outputs, :grid, :args~ +** Processing line: ~#+end_src~ +- PRE end detected. ** Processing line: ~~ -** Processing line: ~ # Calls all methods necessary for the app to run properly.~ +** Processing line: ~~ +** Processing line: ~*** Path Finding Algorithms - Early Exit - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Path Finding Algorithms - Early Exit - 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: ~Path Finding Algorithms - Early Exit - 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/13_path_finding_algorithms/04_early_exit/app/main.rb~ +** Processing line: ~ # Comparison of a breadth first search with and without early exit~ +** Processing line: ~ # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ +** Processing line: ~~ +** Processing line: ~ # Demonstrates the exploration difference caused by early exit~ +** Processing line: ~ # Also demonstrates how breadth first search is used for path generation~ +** Processing line: ~~ +** Processing line: ~ # The left grid is a breadth first search without early exit~ +** Processing line: ~ # The right grid is a breadth first search with early exit~ +** Processing line: ~ # The red squares represent how far the search expanded~ +** Processing line: ~ # The darker the red, the farther the search proceeded~ +** Processing line: ~ # Comparison of the heat map reveals how much searching can be saved by early exit~ +** Processing line: ~ # The white path shows path generation via breadth first search~ +** Processing line: ~ class EarlyExitBreadthFirstSearch~ +** Processing line: ~ attr_gtk~ +** Processing line: ~~ +** Processing line: ~ # This method is called every frame/tick~ +** Processing line: ~ # Every tick, the current state of the search is rendered on the screen,~ +** Processing line: ~ # User input is processed, and~ +** Processing line: ~ # The next step in the search is calculated~ ** Processing line: ~ def tick~ -** Processing line: ~ labels_tech_demo~ -** Processing line: ~ lines_tech_demo~ -** Processing line: ~ solids_tech_demo~ -** Processing line: ~ borders_tech_demo~ -** Processing line: ~ sprites_tech_demo~ -** Processing line: ~ keyboards_tech_demo~ -** Processing line: ~ controller_tech_demo~ -** Processing line: ~ mouse_tech_demo~ -** Processing line: ~ point_to_rect_tech_demo~ -** Processing line: ~ rect_to_rect_tech_demo~ -** Processing line: ~ button_tech_demo~ -** Processing line: ~ export_game_state_demo~ -** Processing line: ~ window_state_demo~ -** Processing line: ~ render_seperators~ +** Processing line: ~ defaults~ +** Processing line: ~ # If the grid has not been searched~ +** Processing line: ~ if state.visited.empty?~ +** Processing line: ~ # Complete the search~ +** Processing line: ~ state.max_steps.times { step }~ +** Processing line: ~ # And calculate the path~ +** Processing line: ~ calc_path~ +** Processing line: ~ end~ +** Processing line: ~ render~ +** Processing line: ~ input~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Shows output of different kinds of labels on the screen~ -** Processing line: ~ def labels_tech_demo~ -** Processing line: ~ outputs.labels << [grid.left.shift_right(5), grid.top.shift_down(5), "This is a label located at the top left."]~ -** Processing line: ~ outputs.labels << [grid.left.shift_right(5), grid.bottom.shift_up(30), "This is a label located at the bottom left."]~ -** Processing line: ~ outputs.labels << [ 5, 690, "Labels (x, y, text, size, align, r, g, b, a)"]~ -** Processing line: ~ outputs.labels << [ 5, 660, "Smaller label.", -2]~ -** Processing line: ~ outputs.labels << [ 5, 630, "Small label.", -1]~ -** Processing line: ~ outputs.labels << [ 5, 600, "Medium label.", 0]~ -** Processing line: ~ outputs.labels << [ 5, 570, "Large label.", 1]~ -** Processing line: ~ outputs.labels << [ 5, 540, "Larger label.", 2]~ -** Processing line: ~ outputs.labels << [300, 660, "Left aligned.", 0, 2]~ -** Processing line: ~ outputs.labels << [300, 640, "Center aligned.", 0, 1]~ -** Processing line: ~ outputs.labels << [300, 620, "Right aligned.", 0, 0]~ -** Processing line: ~ outputs.labels << [175, 595, "Red Label.", 0, 0, 255, 0, 0]~ -** Processing line: ~ outputs.labels << [175, 575, "Green Label.", 0, 0, 0, 255, 0]~ -** Processing line: ~ outputs.labels << [175, 555, "Blue Label.", 0, 0, 0, 0, 255]~ -** Processing line: ~ outputs.labels << [175, 535, "Faded Label.", 0, 0, 0, 0, 0, 128]~ +** Processing line: ~ def defaults~ +** Processing line: ~ # Variables to edit the size and appearance of the grid~ +** Processing line: ~ # Freely customizable to user's liking~ +** Processing line: ~ grid.width ||= 15~ +** Processing line: ~ grid.height ||= 15~ +** Processing line: ~ grid.cell_size ||= 40~ +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ +** Processing line: ~~ +** Processing line: ~ # At some step the animation will end,~ +** Processing line: ~ # and further steps won't change anything (the whole grid.widthill be explored)~ +** Processing line: ~ # This step is roughly the grid's width * height~ +** Processing line: ~ # When anim_steps equals max_steps no more calculations will occur~ +** Processing line: ~ # and the slider will be at the end~ +** Processing line: ~ state.max_steps ||= args.state.grid.width * args.state.grid.height~ +** Processing line: ~~ +** Processing line: ~ # The location of the star and walls of the grid~ +** Processing line: ~ # They can be modified to have a different initial grid~ +** Processing line: ~ # Walls are stored in a hash for quick look up when doing the search~ +** Processing line: ~ state.star ||= [2, 8]~ +** Processing line: ~ state.target ||= [10, 5]~ +** Processing line: ~ state.walls ||= {}~ +** Processing line: ~~ +** Processing line: ~ # Variables that are used by the breadth first search~ +** Processing line: ~ # Storing cells that the search has visited, prevents unnecessary steps~ +** Processing line: ~ # Expanding the frontier of the search in order makes the search expand~ +** Processing line: ~ # from the center outward~ +** Processing line: ~~ +** Processing line: ~ # Visited cells in the first grid~ +** Processing line: ~ state.visited ||= {}~ +** Processing line: ~ # Visited cells in the second grid~ +** Processing line: ~ state.early_exit_visited ||= {}~ +** Processing line: ~ # The cells from which the search is to expand~ +** Processing line: ~ state.frontier ||= []~ +** Processing line: ~ # A hash of where each cell was expanded from~ +** Processing line: ~ # The key is a cell, and the value is the cell it came from~ +** Processing line: ~ state.came_from ||= {}~ +** Processing line: ~ # Cells that are part of the path from the target to the star~ +** Processing line: ~ state.path ||= {}~ +** Processing line: ~~ +** Processing line: ~ # What the user is currently editing on the grid~ +** Processing line: ~ # We store this value, because we want to remember the value even when~ +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ +** Processing line: ~ # they are still clicking down on the mouse.~ +** Processing line: ~ state.current_input ||= :none~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Draws everything onto the screen~ +** Processing line: ~ def render~ +** Processing line: ~ render_background~ +** Processing line: ~ render_heat_map~ +** Processing line: ~ render_walls~ +** Processing line: ~ render_path~ +** Processing line: ~ render_star~ +** Processing line: ~ render_target~ +** Processing line: ~ render_labels~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Shows output of lines on the screen~ -** Processing line: ~ def lines_tech_demo~ -** Processing line: ~ outputs.labels << [5, 500, "Lines (x, y, x2, y2, r, g, b, a)"]~ -** Processing line: ~ outputs.lines << [5, 450, 100, 450]~ -** Processing line: ~ outputs.lines << [5, 430, 300, 430]~ -** Processing line: ~ outputs.lines << [5, 410, 300, 410, state.tick_count % 255, 0, 0, 255] # red saturation changes~ -** Processing line: ~ outputs.lines << [5, 390 - state.tick_count % 25, 300, 390, 0, 0, 0, 255] # y position changes~ -** Processing line: ~ outputs.lines << [5 + state.tick_count % 200, 360, 300, 360, 0, 0, 0, 255] # x position changes~ -** Processing line: ~ end~ +** Processing line: ~ # The methods below subdivide the task of drawing everything to the screen~ ** Processing line: ~~ -** Processing line: ~ # Shows output of different kinds of solids on the screen~ -** Processing line: ~ def solids_tech_demo~ -** Processing line: ~ outputs.labels << [ 5, 350, "Solids (x, y, w, h, r, g, b, a)"]~ -** Processing line: ~ outputs.solids << [ 10, 270, 50, 50]~ -** Processing line: ~ outputs.solids << [ 70, 270, 50, 50, 0, 0, 0]~ -** Processing line: ~ outputs.solids << [130, 270, 50, 50, 255, 0, 0]~ -** Processing line: ~ outputs.solids << [190, 270, 50, 50, 255, 0, 0, 128]~ -** Processing line: ~ outputs.solids << [250, 270, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes~ +** Processing line: ~ # Draws what the grid looks like with nothing on it~ +** Processing line: ~ def render_background~ +** Processing line: ~ render_unvisited~ +** Processing line: ~ render_grid_lines~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Shows output of different kinds of borders on the screen~ -** Processing line: ~ # The parameters for a border are the same as the parameters for a solid~ -** Processing line: ~ def borders_tech_demo~ -** Processing line: ~ outputs.labels << [ 5, 260, "Borders (x, y, w, h, r, g, b, a)"]~ -** Processing line: ~ outputs.borders << [ 10, 180, 50, 50]~ -** Processing line: ~ outputs.borders << [ 70, 180, 50, 50, 0, 0, 0]~ -** Processing line: ~ outputs.borders << [130, 180, 50, 50, 255, 0, 0]~ -** Processing line: ~ outputs.borders << [190, 180, 50, 50, 255, 0, 0, 128]~ -** Processing line: ~ outputs.borders << [250, 180, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes~ +** Processing line: ~ # Draws both grids~ +** Processing line: ~ def render_unvisited~ +** Processing line: ~ outputs.solids << [scale_up(grid.rect), unvisited_color]~ +** Processing line: ~ outputs.solids << [early_exit_scale_up(grid.rect), unvisited_color]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Shows output of different kinds of sprites on the screen~ -** Processing line: ~ def sprites_tech_demo~ -** Processing line: ~ outputs.labels << [ 5, 170, "Sprites (x, y, w, h, path, angle, a)"]~ -** Processing line: ~ outputs.sprites << [ 10, 40, 128, 101, 'dragonruby.png']~ -** Processing line: ~ outputs.sprites << [ 150, 40, 128, 101, 'dragonruby.png', state.tick_count % 360] # angle changes~ -** Processing line: ~ outputs.sprites << [ 300, 40, 128, 101, 'dragonruby.png', 0, state.tick_count % 255] # transparency changes~ +** Processing line: ~ # Draws grid lines to show the division of the grid into cells~ +** Processing line: ~ def render_grid_lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << vertical_line(x)~ +** Processing line: ~ outputs.lines << early_exit_vertical_line(x)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << horizontal_line(y)~ +** Processing line: ~ outputs.lines << early_exit_horizontal_line(y)~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Holds size, alignment, color (black), and alpha (transparency) parameters~ -** Processing line: ~ # Using small_font as a parameter accounts for all remaining parameters~ -** Processing line: ~ # so they don't have to be repeatedly typed~ -** Processing line: ~ def small_font~ -** Processing line: ~ [-2, 0, 0, 0, 0, 255]~ +** Processing line: ~ # Easy way to draw vertical lines given an index~ +** Processing line: ~ def vertical_line column~ +** Processing line: ~ scale_up([column, 0, column, grid.height])~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets position of each row~ -** Processing line: ~ # Converts given row value to pixels that DragonRuby understands~ -** Processing line: ~ def row_to_px row_number~ +** Processing line: ~ # Easy way to draw horizontal lines given an index~ +** Processing line: ~ def horizontal_line row~ +** Processing line: ~ scale_up([0, row, grid.width, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Row 0 starts 5 units below the top of the grid.~ -** Processing line: ~ # Each row afterward is 20 units lower.~ -** Processing line: ~ grid.top.shift_down(5).shift_down(20 * row_number)~ +** Processing line: ~ # Easy way to draw vertical lines given an index~ +** Processing line: ~ def early_exit_vertical_line column~ +** Processing line: ~ scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height])~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Uses labels to output current game time (passage of time), and whether or not "h" was pressed~ -** Processing line: ~ # If "h" is pressed, the frame is output when the key_up event occurred~ -** Processing line: ~ def keyboards_tech_demo~ -** Processing line: ~ outputs.labels << [460, row_to_px(0), "Current game time: #{state.tick_count}", small_font]~ -** Processing line: ~ outputs.labels << [460, row_to_px(2), "Keyboard input: inputs.keyboard.key_up.h", small_font]~ -** Processing line: ~ outputs.labels << [460, row_to_px(3), "Press \"h\" on the keyboard.", small_font]~ +** Processing line: ~ # Easy way to draw horizontal lines given an index~ +** Processing line: ~ def early_exit_horizontal_line row~ +** Processing line: ~ scale_up([grid.width + 1, row, grid.width + grid.width + 1, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if inputs.keyboard.key_up.h # if "h" key_up event occurs~ -** Processing line: ~ state.h_pressed_at = state.tick_count # frame it occurred is stored~ +** Processing line: ~ # Draws the walls on both grids~ +** Processing line: ~ def render_walls~ +** Processing line: ~ state.walls.each_key do |wall|~ +** Processing line: ~ outputs.solids << [scale_up(wall), wall_color]~ +** Processing line: ~ outputs.solids << [early_exit_scale_up(wall), wall_color]~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # h_pressed_at is initially set to false, and changes once the user presses the "h" key.~ -** Processing line: ~ state.h_pressed_at ||= false~ +** Processing line: ~ # Renders the star on both grids~ +** Processing line: ~ def render_star~ +** Processing line: ~ outputs.sprites << [scale_up(state.star), 'star.png']~ +** Processing line: ~ outputs.sprites << [early_exit_scale_up(state.star), 'star.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if state.h_pressed_at # if h is pressed (pressed_at has a frame number and is no longer false)~ -** Processing line: ~ outputs.labels << [460, row_to_px(4), "\"h\" was pressed at time: #{state.h_pressed_at}", small_font]~ -** Processing line: ~ else # otherwise, label says "h" was never pressed~ -** Processing line: ~ outputs.labels << [460, row_to_px(4), "\"h\" has never been pressed.", small_font]~ -** Processing line: ~ end~ +** Processing line: ~ # Renders the target on both grids~ +** Processing line: ~ def render_target~ +** Processing line: ~ outputs.sprites << [scale_up(state.target), 'target.png']~ +** Processing line: ~ outputs.sprites << [early_exit_scale_up(state.target), 'target.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # border around keyboard input demo section~ -** Processing line: ~ outputs.borders << [455, row_to_px(5), 360, row_to_px(2).shift_up(5) - row_to_px(5)]~ +** Processing line: ~ # Labels the grids~ +** Processing line: ~ def render_labels~ +** Processing line: ~ outputs.labels << [200, 625, "Without early exit"]~ +** Processing line: ~ outputs.labels << [875, 625, "With early exit"]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sets definition for a small label~ -** Processing line: ~ # Makes it easier to position labels in respect to the position of other labels~ -** Processing line: ~ def small_label x, row, message~ -** Processing line: ~ [x, row_to_px(row), message, small_font]~ +** Processing line: ~ # Renders the path based off of the state.path hash~ +** Processing line: ~ def render_path~ +** Processing line: ~ # If the star and target are disconnected there will only be one path~ +** Processing line: ~ # The path should not render in that case~ +** Processing line: ~ unless state.path.size == 1~ +** Processing line: ~ state.path.each_key do | cell |~ +** Processing line: ~ # Renders path on both grids~ +** Processing line: ~ outputs.solids << [scale_up(cell), path_color]~ +** Processing line: ~ outputs.solids << [early_exit_scale_up(cell), path_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Uses small labels to show whether the "a" button on the controller is down, held, or up.~ -** Processing line: ~ # y value of each small label is set by calling the row_to_px method~ -** Processing line: ~ def controller_tech_demo~ -** Processing line: ~ x = 460~ -** Processing line: ~ outputs.labels << small_label(x, 6, "Controller one input: inputs.controller_one")~ -** Processing line: ~ outputs.labels << small_label(x, 7, "Current state of the \"a\" button.")~ -** Processing line: ~ outputs.labels << small_label(x, 8, "Check console window for more info.")~ +** Processing line: ~ # Calculates the path from the target to the star after the search is over~ +** Processing line: ~ # Relies on the came_from hash~ +** Processing line: ~ # Fills the state.path hash, which is later rendered on screen~ +** Processing line: ~ def calc_path~ +** Processing line: ~ endpoint = state.target~ +** Processing line: ~ while endpoint~ +** Processing line: ~ state.path[endpoint] = true~ +** Processing line: ~ endpoint = state.came_from[endpoint]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if inputs.controller_one.key_down.a # if "a" is in "down" state~ -** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button down: #{inputs.controller_one.key_down.a}")~ -** Processing line: ~ puts "\"a\" button down at #{inputs.controller_one.key_down.a}" # prints frame the event occurred~ -** Processing line: ~ elsif inputs.controller_one.key_held.a # if "a" is held down~ -** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button held: #{inputs.controller_one.key_held.a}")~ -** Processing line: ~ elsif inputs.controller_one.key_up.a # if "a" is in up state~ -** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button up: #{inputs.controller_one.key_up.a}")~ -** Processing line: ~ puts "\"a\" key up at #{inputs.controller_one.key_up.a}"~ -** Processing line: ~ else # if no event has occurred~ -** Processing line: ~ outputs.labels << small_label(x, 9, "\"a\" button state is nil.")~ +** Processing line: ~ # Representation of how far away visited cells are from the star~ +** Processing line: ~ # Replaces the render_visited method~ +** Processing line: ~ # Visually demonstrates the effectiveness of early exit for pathfinding~ +** Processing line: ~ def render_heat_map~ +** Processing line: ~ state.visited.each_key do | visited_cell |~ +** Processing line: ~ distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs~ +** Processing line: ~ max_distance = grid.width + grid.height~ +** Processing line: ~ alpha = 255.to_i * distance.to_i / max_distance.to_i~ +** Processing line: ~ outputs.solids << [scale_up(visited_cell), red, alpha]~ +** Processing line: ~ # outputs.solids << [early_exit_scale_up(visited_cell), red, alpha]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # border around controller input demo section~ -** Processing line: ~ outputs.borders << [455, row_to_px(10), 360, row_to_px(6).shift_up(5) - row_to_px(10)]~ +** Processing line: ~ state.early_exit_visited.each_key do | visited_cell |~ +** Processing line: ~ distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs~ +** Processing line: ~ max_distance = grid.width + grid.height~ +** Processing line: ~ alpha = 255.to_i * distance.to_i / max_distance.to_i~ +** Processing line: ~ outputs.solids << [early_exit_scale_up(visited_cell), red, alpha]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs when the mouse was clicked, as well as the coordinates on the screen~ -** Processing line: ~ # of where the click occurred~ -** Processing line: ~ def mouse_tech_demo~ -** Processing line: ~ x = 460~ +** Processing line: ~ # Translates the given cell grid.width + 1 to the right and then scales up~ +** Processing line: ~ # Used to draw cells for the second grid~ +** Processing line: ~ # This method does not work for lines,~ +** Processing line: ~ # so separate methods exist for the grid lines~ +** Processing line: ~ def early_exit_scale_up(cell)~ +** Processing line: ~ cell_clone = cell.clone~ +** Processing line: ~ cell_clone.x += grid.width + 1~ +** Processing line: ~ scale_up(cell_clone)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ outputs.labels << small_label(x, 11, "Mouse input: inputs.mouse")~ +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ +** Processing line: ~ # This method is used to scale up cells, and lines~ +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ +** Processing line: ~ def scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ ** Processing line: ~~ -** Processing line: ~ if inputs.mouse.click # if click has a value and is not nil~ -** Processing line: ~ state.last_mouse_click = inputs.mouse.click # coordinates of click are stored~ +** Processing line: ~ # If cell is just an x and y coordinate~ +** Processing line: ~ if cell.size == 2~ +** Processing line: ~ # Add a width and height of 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ cell << 1~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if state.last_mouse_click # if mouse is clicked (has coordinates as value)~ -** Processing line: ~ # outputs the time (frame) the click occurred, as well as how many frames have passed since the event~ -** Processing line: ~ outputs.labels << small_label(x, 12, "Mouse click happened at: #{state.last_mouse_click.created_at}, #{state.last_mouse_click.created_at_elapsed}")~ -** Processing line: ~ # outputs coordinates of click~ -** Processing line: ~ outputs.labels << small_label(x, 13, "Mouse click location: #{state.last_mouse_click.point.x}, #{state.last_mouse_click.point.y}")~ -** Processing line: ~ else # otherwise if the mouse has not been clicked~ -** Processing line: ~ outputs.labels << small_label(x, 12, "Mouse click has not occurred yet.")~ -** Processing line: ~ outputs.labels << small_label(x, 13, "Please click mouse.")~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ # Scale all the values up~ +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ ** Processing line: ~~ -** Processing line: ~ # Outputs whether a mouse click occurred inside or outside of a box~ -** Processing line: ~ def point_to_rect_tech_demo~ -** Processing line: ~ x = 460~ +** Processing line: ~ # Returns the scaled up cell~ +** Processing line: ~ cell~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ outputs.labels << small_label(x, 15, "Click inside the blue box maybe ---->")~ +** Processing line: ~ # This method processes user input every tick~ +** Processing line: ~ # Any method with "1" is related to the first grid~ +** Processing line: ~ # Any method with "2" is related to the second grid~ +** Processing line: ~ def input~ +** Processing line: ~ # The program has to remember that the user is dragging an object~ +** Processing line: ~ # even when the mouse is no longer over that object~ +** Processing line: ~ # So detecting input and processing input is separate~ +** Processing line: ~ detect_input~ +** Processing line: ~ process_input~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ box = [765, 370, 50, 50, 0, 0, 170] # blue box~ -** Processing line: ~ outputs.borders << box~ +** Processing line: ~ # Determines what the user is editing and stores the value~ +** Processing line: ~ # Storing the value allows the user to continue the same edit as long as the~ +** Processing line: ~ # mouse left click is held~ +** Processing line: ~ def detect_input~ +** Processing line: ~ # When the mouse is up, nothing is being edited~ +** Processing line: ~ if inputs.mouse.up~ +** Processing line: ~ state.current_input = :none~ +** Processing line: ~ # When the star in the no second grid is clicked~ +** Processing line: ~ elsif star_clicked?~ +** Processing line: ~ state.current_input = :star~ +** Processing line: ~ # When the star in the second grid is clicked~ +** Processing line: ~ elsif star2_clicked?~ +** Processing line: ~ state.current_input = :star2~ +** Processing line: ~ # When the target in the no second grid is clicked~ +** Processing line: ~ elsif target_clicked?~ +** Processing line: ~ state.current_input = :target~ +** Processing line: ~ # When the target in the second grid is clicked~ +** Processing line: ~ elsif target2_clicked?~ +** Processing line: ~ state.current_input = :target2~ +** Processing line: ~ # When a wall in the first grid is clicked~ +** Processing line: ~ elsif wall_clicked?~ +** Processing line: ~ state.current_input = :remove_wall~ +** Processing line: ~ # When a wall in the second grid is clicked~ +** Processing line: ~ elsif wall2_clicked?~ +** Processing line: ~ state.current_input = :remove_wall2~ +** Processing line: ~ # When the first grid is clicked~ +** Processing line: ~ elsif grid_clicked?~ +** Processing line: ~ state.current_input = :add_wall~ +** Processing line: ~ # When the second grid is clicked~ +** Processing line: ~ elsif grid2_clicked?~ +** Processing line: ~ state.current_input = :add_wall2~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ +** Processing line: ~ def process_input~ +** Processing line: ~ if state.current_input == :star~ +** Processing line: ~ input_star~ +** Processing line: ~ elsif state.current_input == :star2~ +** Processing line: ~ input_star2~ +** Processing line: ~ elsif state.current_input == :target~ +** Processing line: ~ input_target~ +** Processing line: ~ elsif state.current_input == :target2~ +** Processing line: ~ input_target2~ +** Processing line: ~ elsif state.current_input == :remove_wall~ +** Processing line: ~ input_remove_wall~ +** Processing line: ~ elsif state.current_input == :remove_wall2~ +** Processing line: ~ input_remove_wall2~ +** Processing line: ~ elsif state.current_input == :add_wall~ +** Processing line: ~ input_add_wall~ +** Processing line: ~ elsif state.current_input == :add_wall2~ +** Processing line: ~ input_add_wall2~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def input_star~ +** Processing line: ~ old_star = state.star.clone~ +** Processing line: ~ state.star = cell_closest_to_mouse~ +** Processing line: ~ unless old_star == state.star~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the second grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def input_star2~ +** Processing line: ~ old_star = state.star.clone~ +** Processing line: ~ state.star = cell_closest_to_mouse2~ +** Processing line: ~ unless old_star == state.star~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ +** Processing line: ~ # Only reset_searchs the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def input_target~ +** Processing line: ~ old_target = state.target.clone~ +** Processing line: ~ state.target = cell_closest_to_mouse~ +** Processing line: ~ unless old_target == state.target~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Moves the target to the cell closest to the mouse in the second grid~ +** Processing line: ~ # Only reset_searchs the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def input_target2~ +** Processing line: ~ old_target = state.target.clone~ +** Processing line: ~ state.target = cell_closest_to_mouse2~ +** Processing line: ~ unless old_target == state.target~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Removes walls in the first grid that are under the cursor~ +** Processing line: ~ def input_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if mouse_inside_grid?~ +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse)~ +** Processing line: ~ state.walls.delete(cell_closest_to_mouse)~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if state.last_mouse_click # if the mouse was clicked~ -** Processing line: ~ if state.last_mouse_click.point.inside_rect? box # if mouse clicked inside box~ -** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click happened inside the box.")~ -** Processing line: ~ else # otherwise, if mouse was clicked outside the box~ -** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click happened outside the box.")~ +** Processing line: ~ # Removes walls in the second grid that are under the cursor~ +** Processing line: ~ def input_remove_wall2~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if mouse_inside_grid2?~ +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse2)~ +** Processing line: ~ state.walls.delete(cell_closest_to_mouse2)~ +** Processing line: ~ reset_search~ ** Processing line: ~ end~ -** Processing line: ~ else # otherwise, if was not clicked at all~ -** Processing line: ~ outputs.labels << small_label(x, 16, "Mouse click has not occurred yet.") # output if the mouse was not clicked~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # border around mouse input demo section~ -** Processing line: ~ outputs.borders << [455, row_to_px(14), 360, row_to_px(11).shift_up(5) - row_to_px(14)]~ +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ +** Processing line: ~ def input_add_wall~ +** Processing line: ~ if mouse_inside_grid?~ +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse)~ +** Processing line: ~ state.walls[cell_closest_to_mouse] = true~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs a red box onto the screen. A mouse click from the user inside of the red box will output~ -** Processing line: ~ # a smaller box. If two small boxes are inside of the red box, it will be determined whether or not~ -** Processing line: ~ # they intersect.~ -** Processing line: ~ def rect_to_rect_tech_demo~ -** Processing line: ~ x = 460~ ** Processing line: ~~ -** Processing line: ~ outputs.labels << small_label(x, 17.5, "Click inside the red box below.") # label with instructions~ -** Processing line: ~ red_box = [460, 250, 355, 90, 170, 0, 0] # definition of the red box~ -** Processing line: ~ outputs.borders << red_box # output as a border (not filled in)~ +** Processing line: ~ # Adds a wall in the second grid in the cell the mouse is over~ +** Processing line: ~ def input_add_wall2~ +** Processing line: ~ if mouse_inside_grid2?~ +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse2)~ +** Processing line: ~ state.walls[cell_closest_to_mouse2] = true~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # If the mouse is clicked inside the red box, two collision boxes are created.~ -** Processing line: ~ if inputs.mouse.click~ -** Processing line: ~ if inputs.mouse.click.point.inside_rect? red_box~ -** Processing line: ~ if !state.box_collision_one # if the collision_one box does not yet have a definition~ -** Processing line: ~ # Subtracts 25 from the x and y positions of the click point in order to make the click point the center of the box.~ -** Processing line: ~ # You can try deleting the subtraction to see how it impacts the box placement.~ -** Processing line: ~ state.box_collision_one = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 180, 0, 0, 180] # sets definition~ -** Processing line: ~ elsif !state.box_collision_two # if collision_two does not yet have a definition~ -** Processing line: ~ state.box_collision_two = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 0, 0, 180, 180] # sets definition~ -** Processing line: ~ else~ -** Processing line: ~ state.box_collision_one = nil # both boxes are empty~ -** Processing line: ~ state.box_collision_two = nil~ +** Processing line: ~ # Whenever the user edits the grid,~ +** Processing line: ~ # The search has to be reset_searchd upto the current step~ +** Processing line: ~ # with the current grid as the initial state of the grid~ +** Processing line: ~ def reset_search~ +** Processing line: ~ # Reset_Searchs the search~ +** Processing line: ~ state.frontier = []~ +** Processing line: ~ state.visited = {}~ +** Processing line: ~ state.early_exit_visited = {}~ +** Processing line: ~ state.came_from = {}~ +** Processing line: ~ state.path = {}~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Moves the search forward one step~ +** Processing line: ~ def step~ +** Processing line: ~ # The setup to the search~ +** Processing line: ~ # Runs once when there are no visited cells~ +** Processing line: ~ if state.visited.empty?~ +** Processing line: ~ state.visited[state.star] = true~ +** Processing line: ~ state.early_exit_visited[state.star] = true~ +** Processing line: ~ state.frontier << state.star~ +** Processing line: ~ state.came_from[state.star] = nil~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # A step in the search~ +** Processing line: ~ unless state.frontier.empty?~ +** Processing line: ~ # Takes the next frontier cell~ +** Processing line: ~ new_frontier = state.frontier.shift~ +** Processing line: ~ # For each of its neighbors~ +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited in the first grid~ +** Processing line: ~ state.visited[neighbor] = true~ +** Processing line: ~ # Unless the target has been visited~ +** Processing line: ~ unless state.visited.has_key?(state.target)~ +** Processing line: ~ # Mark the neighbor as visited in the second grid as well~ +** Processing line: ~ state.early_exit_visited[neighbor] = true~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Add the neighbor to the frontier and remember which cell it came from~ +** Processing line: ~ state.frontier << neighbor~ +** Processing line: ~ state.came_from[neighbor] = new_frontier~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # If collision boxes exist, they are output onto screen inside the red box as solids~ -** Processing line: ~ if state.box_collision_one~ -** Processing line: ~ outputs.solids << state.box_collision_one~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if state.box_collision_two~ -** Processing line: ~ outputs.solids << state.box_collision_two~ -** Processing line: ~ end~ +** Processing line: ~ # Returns a list of adjacent cells~ +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ +** Processing line: ~ def adjacent_neighbors(cell)~ +** Processing line: ~ neighbors = []~ ** Processing line: ~~ -** Processing line: ~ # Outputs whether or not the two collision boxes intersect.~ -** Processing line: ~ if state.box_collision_one && state.box_collision_two # if both collision_boxes are defined (and not nil or empty)~ -** Processing line: ~ if state.box_collision_one.intersect_rect? state.box_collision_two # if the two boxes intersect~ -** Processing line: ~ outputs.labels << small_label(x, 23.5, 'The boxes intersect.')~ -** Processing line: ~ else # otherwise, if the two boxes do not intersect~ -** Processing line: ~ outputs.labels << small_label(x, 23.5, 'The boxes do not intersect.')~ -** Processing line: ~ end~ +** Processing line: ~ # Gets all the valid neighbors into the array~ +** Processing line: ~ # From southern neighbor, clockwise~ +** Processing line: ~ neighbors << [cell.x, cell.y - 1] unless cell.y == 0~ +** Processing line: ~ neighbors << [cell.x - 1, cell.y] unless cell.x == 0~ +** Processing line: ~ neighbors << [cell.x, cell.y + 1] unless cell.y == grid.height - 1~ +** Processing line: ~ neighbors << [cell.x + 1, cell.y] unless cell.x == grid.width - 1~ +** Processing line: ~~ +** Processing line: ~ # Sorts the neighbors so the rendered path is a zigzag path~ +** Processing line: ~ # Cells in a diagonal direction are given priority~ +** Processing line: ~ # Comment this line to see the difference~ +** Processing line: ~ neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) }~ +** Processing line: ~~ +** Processing line: ~ neighbors~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ +** Processing line: ~ # and returns the larger value~ +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ +** Processing line: ~ # A cell that is [5, 5] from the star,~ +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ +** Processing line: ~ def proximity_to_star(x, y)~ +** Processing line: ~ distance_x = (state.star.x - x).abs~ +** Processing line: ~ distance_y = (state.star.y - y).abs~ +** Processing line: ~~ +** Processing line: ~ if distance_x > distance_y~ +** Processing line: ~ return distance_x~ ** Processing line: ~ else~ -** Processing line: ~ outputs.labels << small_label(x, 23.5, '--') # if the two boxes are not defined (are nil or empty), this label is output~ +** Processing line: ~ return distance_y~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Creates a button and outputs it onto the screen using labels and borders.~ -** Processing line: ~ # If the button is clicked, the color changes to make it look faded.~ -** Processing line: ~ def button_tech_demo~ -** Processing line: ~ x, y, w, h = 460, 160, 300, 50~ -** Processing line: ~ state.button ||= state.new_entity(:button_with_fade)~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ +** Processing line: ~ def cell_closest_to_mouse~ +** Processing line: ~ # Closest cell to the mouse in the first grid~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Bound x and y to the grid~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Adds w.half to x and h.half + 10 to y in order to display the text inside the button's borders.~ -** Processing line: ~ state.button.label ||= [x + w.half, y + h.half + 10, "click me and watch me fade", 0, 1]~ -** Processing line: ~ state.button.border ||= [x, y, w, h]~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse in the second grid helps with this~ +** Processing line: ~ def cell_closest_to_mouse2~ +** Processing line: ~ # Closest cell grid to the mouse in the second~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Translate the cell to the first grid~ +** Processing line: ~ x -= grid.width + 1~ +** Processing line: ~ # Bound x and y to the first grid~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if inputs.mouse.click && inputs.mouse.click.point.inside_rect?(state.button.border) # if mouse is clicked, and clicked inside button's border~ -** Processing line: ~ state.button.clicked_at = inputs.mouse.click.created_at # stores the time the click occurred~ -** Processing line: ~ end~ +** Processing line: ~ # Signal that the user is going to be moving the star from the first grid~ +** Processing line: ~ def star_clicked?~ +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.star))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ outputs.labels << state.button.label~ -** Processing line: ~ outputs.borders << state.button.border~ +** Processing line: ~ # Signal that the user is going to be moving the star from the second grid~ +** Processing line: ~ def star2_clicked?~ +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(early_exit_scale_up(state.star))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if state.button.clicked_at # if button was clicked (variable has a value and is not nil)~ +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ +** Processing line: ~ def target_clicked?~ +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(state.target))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The appearance of the button changes for 0.25 seconds after the time the button is clicked at.~ -** Processing line: ~ # The color changes (rgb is set to 0, 180, 80) and the transparency gradually changes.~ -** Processing line: ~ # Change 0.25 to 1.25 and notice that the transparency takes longer to return to normal.~ -** Processing line: ~ outputs.solids << [x, y, w, h, 0, 180, 80, 255 * state.button.clicked_at.ease(0.25.seconds, :flip)]~ -** Processing line: ~ end~ +** Processing line: ~ # Signal that the user is going to be moving the target from the second grid~ +** Processing line: ~ def target2_clicked?~ +** Processing line: ~ inputs.mouse.down && inputs.mouse.point.inside_rect?(early_exit_scale_up(state.target))~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Creates a new button by declaring it as a new entity, and sets values.~ -** Processing line: ~ def new_button_prefab x, y, message~ -** Processing line: ~ w, h = 300, 50~ -** Processing line: ~ button = state.new_entity(:button_with_fade)~ -** Processing line: ~ button.label = [x + w.half, y + h.half + 10, message, 0, 1] # '+ 10' keeps label's text within button's borders~ -** Processing line: ~ button.border = [x, y, w, h] # sets border definition~ -** Processing line: ~ button~ +** Processing line: ~ # Signal that the user is going to be removing walls from the first grid~ +** Processing line: ~ def wall_clicked?~ +** Processing line: ~ inputs.mouse.down && mouse_inside_wall?~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # If the mouse has been clicked and the click's location is inside of the button's border, that means~ -** Processing line: ~ # that the button has been clicked. This method returns a boolean value.~ -** Processing line: ~ def button_clicked? button~ -** Processing line: ~ inputs.mouse.click && inputs.mouse.click.point.inside_rect?(button.border)~ +** Processing line: ~ # Signal that the user is going to be removing walls from the second grid~ +** Processing line: ~ def wall2_clicked?~ +** Processing line: ~ inputs.mouse.down && mouse_inside_wall2?~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Determines if button was clicked, and changes its appearance if it is clicked~ -** Processing line: ~ def tick_button_prefab button~ -** Processing line: ~ outputs.labels << button.label # outputs button's label and border~ -** Processing line: ~ outputs.borders << button.border~ +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ +** Processing line: ~ def grid_clicked?~ +** Processing line: ~ inputs.mouse.down && mouse_inside_grid?~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if button_clicked? button # if button is clicked~ -** Processing line: ~ button.clicked_at = inputs.mouse.click.created_at # stores the time that the button was clicked~ -** Processing line: ~ end~ +** Processing line: ~ # Signal that the user is going to be adding walls from the second grid~ +** Processing line: ~ def grid2_clicked?~ +** Processing line: ~ inputs.mouse.down && mouse_inside_grid2?~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if button.clicked_at # if clicked_at has a frame value and is not nil~ -** Processing line: ~ # button is output; color changes and transparency changes for 0.25 seconds after click occurs~ -** Processing line: ~ outputs.solids << [button.border.x, button.border.y, button.border.w, button.border.h,~ -** Processing line: ~ 0, 180, 80, 255 * button.clicked_at.ease(0.25.seconds, :flip)] # transparency changes for 0.25 seconds~ +** Processing line: ~ # Returns whether the mouse is inside of a wall in the first grid~ +** Processing line: ~ # Part of the condition that checks whether the user is removing a wall~ +** Processing line: ~ def mouse_inside_wall?~ +** Processing line: ~ state.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(scale_up(wall))~ ** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ false~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Exports the app's game state if the export button is clicked.~ -** Processing line: ~ def export_game_state_demo~ -** Processing line: ~ state.export_game_state_button ||= new_button_prefab(460, 100, "click to export app state")~ -** Processing line: ~ tick_button_prefab(state.export_game_state_button) # calls method to output button~ -** Processing line: ~ if button_clicked? state.export_game_state_button # if the export button is clicked~ -** Processing line: ~ args.gtk.export! "Exported from clicking the export button in the tech demo." # the export occurs~ +** Processing line: ~ # Returns whether the mouse is inside of a wall in the second grid~ +** Processing line: ~ # Part of the condition that checks whether the user is removing a wall~ +** Processing line: ~ def mouse_inside_wall2?~ +** Processing line: ~ state.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(early_exit_scale_up(wall))~ ** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ false~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The mouse and keyboard focus are set to "yes" when the Dragonruby window is the active window.~ -** Processing line: ~ def window_state_demo~ -** Processing line: ~ m = $gtk.args.inputs.mouse.has_focus ? 'Y' : 'N' # ternary operator (similar to if statement)~ -** Processing line: ~ k = $gtk.args.inputs.keyboard.has_focus ? 'Y' : 'N'~ -** Processing line: ~ outputs.labels << [460, 20, "mouse focus: #{m} keyboard focus: #{k}", small_font]~ +** Processing line: ~ # Returns whether the mouse is inside of the first grid~ +** Processing line: ~ # Part of the condition that checks whether the user is adding a wall~ +** Processing line: ~ def mouse_inside_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up(grid.rect))~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ #Sets values for the horizontal separator (divides demo sections)~ -** Processing line: ~ def horizontal_seperator y, x, x2~ -** Processing line: ~ [x, y, x2, y, 150, 150, 150]~ +** Processing line: ~ # Returns whether the mouse is inside of the second grid~ +** Processing line: ~ # Part of the condition that checks whether the user is adding a wall~ +** Processing line: ~ def mouse_inside_grid2?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(early_exit_scale_up(grid.rect))~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ #Sets the values for the vertical separator (divides demo sections)~ -** Processing line: ~ def vertical_seperator x, y, y2~ -** Processing line: ~ [x, y, x, y2, 150, 150, 150]~ +** Processing line: ~ # These methods provide handy aliases to colors~ +** Processing line: ~~ +** Processing line: ~ # Light brown~ +** Processing line: ~ def unvisited_color~ +** Processing line: ~ [221, 212, 213]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs vertical and horizontal separators onto the screen to separate each demo section.~ -** Processing line: ~ def render_seperators~ -** Processing line: ~ outputs.lines << horizontal_seperator(505, grid.left, 445)~ -** Processing line: ~ outputs.lines << horizontal_seperator(353, grid.left, 445)~ -** Processing line: ~ outputs.lines << horizontal_seperator(264, grid.left, 445)~ -** Processing line: ~ outputs.lines << horizontal_seperator(174, grid.left, 445)~ +** Processing line: ~ # Camo Green~ +** Processing line: ~ def wall_color~ +** Processing line: ~ [134, 134, 120]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ outputs.lines << vertical_seperator(445, grid.top, grid.bottom)~ +** Processing line: ~ # Pastel White~ +** Processing line: ~ def path_color~ +** Processing line: ~ [231, 230, 228]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ outputs.lines << horizontal_seperator(690, 445, 820)~ -** Processing line: ~ outputs.lines << horizontal_seperator(426, 445, 820)~ +** Processing line: ~ def red~ +** Processing line: ~ [255, 0, 0]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ outputs.lines << vertical_seperator(820, grid.top, grid.bottom)~ +** Processing line: ~ # Makes code more concise~ +** Processing line: ~ def grid~ +** Processing line: ~ state.grid~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $tech_demo = TechDemo.new~ -** Processing line: ~~ +** Processing line: ~ # Method that is called by DragonRuby periodically~ +** Processing line: ~ # Used for updating animations and calculations~ ** Processing line: ~ def tick args~ -** Processing line: ~ $tech_demo.inputs = args.inputs~ -** Processing line: ~ $tech_demo.state = args.state~ -** Processing line: ~ $tech_demo.grid = args.grid~ -** Processing line: ~ $tech_demo.args = args~ -** Processing line: ~ $tech_demo.outputs = args.render_target(:mini_map)~ -** Processing line: ~ $tech_demo.tick~ -** Processing line: ~ args.outputs.labels << [830, 715, "Render target:", [-2, 0, 0, 0, 0, 255]]~ -** Processing line: ~ args.outputs.sprites << [0, 0, 1280, 720, :mini_map]~ -** Processing line: ~ args.outputs.sprites << [830, 300, 675, 379, :mini_map]~ -** Processing line: ~ tick_instructions args, "Sample app shows all the rendering apis available."~ -** 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.escape~ -** Processing line: ~ args.state.key_event_occurred = true~ +** Processing line: ~ # Pressing r will reset the application~ +** Processing line: ~ if args.inputs.keyboard.key_down.r~ +** Processing line: ~ args.gtk.reset~ +** Processing line: ~ reset~ +** Processing line: ~ return~ ** 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: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ +** Processing line: ~ $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new(args)~ +** Processing line: ~ $early_exit_breadth_first_search.args = args~ +** Processing line: ~ $early_exit_breadth_first_search.tick~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ def reset~ +** Processing line: ~ $early_exit_breadth_first_search = nil~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Advanced Rendering - Render Primitive Hierarchies - main.rb~ -- H1 detected. +** Processing line: ~*** Path Finding Algorithms - Dijkstra - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Rendering - Render Primitive Hierarchies - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Path Finding Algorithms - Dijkstra - 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: ~Path Finding Algorithms - Dijkstra - 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/04_render_primitive_hierarchies/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # ./samples/13_path_finding_algorithms/05_dijkstra/app/main.rb~ +** Processing line: ~ # Demonstrates how Dijkstra's Algorithm allows movement costs to be considered~ ** Processing line: ~~ -** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ +** Processing line: ~ # Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ ** Processing line: ~~ -** Processing line: ~ - Nested array: An array whose individual elements are also arrays; useful for~ -** Processing line: ~ storing groups of similar data. Also called multidimensional arrays.~ +** Processing line: ~ # The first grid is a breadth first search with an early exit.~ +** Processing line: ~ # It shows a heat map of all the cells that were visited by the search and their relative distance.~ ** Processing line: ~~ -** Processing line: ~ In this sample app, we see nested arrays being used in object definitions.~ -** Processing line: ~ Notice the parameters for solids, listed below. Parameters 1-3 set the~ -** Processing line: ~ definition for the rect, and parameter 4 sets the definition of the color.~ +** Processing line: ~ # The second grid is an implementation of Dijkstra's algorithm.~ +** Processing line: ~ # Light green cells have 5 times the movement cost of regular cells.~ +** Processing line: ~ # The heat map will darken based on movement cost.~ ** Processing line: ~~ -** Processing line: ~ Instead of having a solid definition that looks like this,~ -** Processing line: ~ [X, Y, W, H, R, G, B]~ -** Processing line: ~ we can separate it into two separate array definitions in one, like this~ -** Processing line: ~ [[X, Y, W, H], [R, G, B]]~ -** Processing line: ~ and both options work fine in defining our solid (or any object).~ +** Processing line: ~ # Dark green cells are walls, and the search cannot go through them.~ +** Processing line: ~ class Movement_Costs~ +** Processing line: ~ attr_gtk~ ** Processing line: ~~ -** Processing line: ~ - Collections: Lists of data; useful for organizing large amounts of data.~ -** Processing line: ~ One element of a collection could be an array (which itself contains many elements).~ -** Processing line: ~ For example, a collection that stores two solid objects would look like this:~ -** Processing line: ~ [~ -** Processing line: ~ [100, 100, 50, 50, 0, 0, 0],~ -** Processing line: ~ [100, 150, 50, 50, 255, 255, 255]~ -** Processing line: ~ ]~ -** Processing line: ~ If this collection was added to args.outputs.solids, two solids would be output~ -** Processing line: ~ next to each other, one black and one white.~ -** Processing line: ~ Nested arrays can be used in collections, as you will see in this sample app.~ +** Processing line: ~ # This method is called every frame/tick~ +** Processing line: ~ # Every tick, the current state of the search is rendered on the screen,~ +** Processing line: ~ # User input is processed, and~ +** Processing line: ~ # The next step in the search is calculated~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ render~ +** Processing line: ~ input~ +** Processing line: ~ calc~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ +** Processing line: ~ def defaults~ +** Processing line: ~ # Variables to edit the size and appearance of the grid~ +** Processing line: ~ # Freely customizable to user's liking~ +** Processing line: ~ grid.width ||= 10~ +** Processing line: ~ grid.height ||= 10~ +** Processing line: ~ grid.cell_size ||= 60~ +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ +** Processing line: ~~ +** Processing line: ~ # The location of the star and walls of the grid~ +** Processing line: ~ # They can be modified to have a different initial grid~ +** Processing line: ~ # Walls are stored in a hash for quick look up when doing the search~ +** Processing line: ~ state.star ||= [1, 5]~ +** Processing line: ~ state.target ||= [8, 4]~ +** Processing line: ~ state.walls ||= {[1, 1] => true, [2, 1] => true, [3, 1] => true, [1, 2] => true, [2, 2] => true, [3, 2] => true}~ +** Processing line: ~ state.hills ||= {~ +** Processing line: ~ [4, 1] => true,~ +** Processing line: ~ [5, 1] => true,~ +** Processing line: ~ [4, 2] => true,~ +** Processing line: ~ [5, 2] => true,~ +** Processing line: ~ [6, 2] => true,~ +** Processing line: ~ [4, 3] => true,~ +** Processing line: ~ [5, 3] => true,~ +** Processing line: ~ [6, 3] => true,~ +** Processing line: ~ [3, 4] => true,~ +** Processing line: ~ [4, 4] => true,~ +** Processing line: ~ [5, 4] => true,~ +** Processing line: ~ [6, 4] => true,~ +** Processing line: ~ [7, 4] => true,~ +** Processing line: ~ [3, 5] => true,~ +** Processing line: ~ [4, 5] => true,~ +** Processing line: ~ [5, 5] => true,~ +** Processing line: ~ [6, 5] => true,~ +** Processing line: ~ [7, 5] => true,~ +** Processing line: ~ [4, 6] => true,~ +** Processing line: ~ [5, 6] => true,~ +** Processing line: ~ [6, 6] => true,~ +** Processing line: ~ [7, 6] => true,~ +** Processing line: ~ [4, 7] => true,~ +** Processing line: ~ [5, 7] => true,~ +** Processing line: ~ [6, 7] => true,~ +** Processing line: ~ [4, 8] => true,~ +** Processing line: ~ [5, 8] => true,~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ -** Processing line: ~ The parameters for a solid are~ -** Processing line: ~ 1. The position on the screen (x, y)~ -** Processing line: ~ 2. The width (w)~ -** Processing line: ~ 3. The height (h)~ -** Processing line: ~ 4. The color (r, g, b) (if a color is not assigned, the object's default color will be black)~ -** Processing line: ~ NOTE: THE PARAMETERS ARE THE SAME FOR BORDERS!~ +** Processing line: ~ # What the user is currently editing on the grid~ +** Processing line: ~ # We store this value, because we want to remember the value even when~ +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ +** Processing line: ~ # they are still clicking down on the mouse.~ +** Processing line: ~ state.user_input ||= :none~ +** Processing line: ~~ +** Processing line: ~ # Values that are used for the breadth first search~ +** Processing line: ~ # Keeping track of what cells were visited prevents counting cells multiple times~ +** Processing line: ~ breadth_first_search.visited ||= {}~ +** Processing line: ~ # The cells from which the breadth first search will expand~ +** Processing line: ~ breadth_first_search.frontier ||= []~ +** Processing line: ~ # Keeps track of which cell all cells were searched from~ +** Processing line: ~ # Used to recreate the path from the target to the star~ +** Processing line: ~ breadth_first_search.came_from ||= {}~ +** Processing line: ~~ +** Processing line: ~ # Keeps track of the movement cost so far to be at a cell~ +** Processing line: ~ # Allows the costs of new cells to be quickly calculated~ +** Processing line: ~ # Also doubles as a way to check if cells have already been visited~ +** Processing line: ~ dijkstra_search.cost_so_far ||= {}~ +** Processing line: ~ # The cells from which the Dijkstra search will expand~ +** Processing line: ~ dijkstra_search.frontier ||= []~ +** Processing line: ~ # Keeps track of which cell all cells were searched from~ +** Processing line: ~ # Used to recreate the path from the target to the star~ +** Processing line: ~ dijkstra_search.came_from ||= {}~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Draws everything onto the screen~ +** Processing line: ~ def render~ +** Processing line: ~ render_background~ ** Processing line: ~~ -** Processing line: ~ Here is an example of a (red) border or solid definition:~ -** Processing line: ~ [100, 100, 400, 500, 255, 0, 0]~ -** Processing line: ~ It will be a solid or border depending on if it is added to args.outputs.solids or args.outputs.borders.~ -** Processing line: ~ For more information about solids and borders, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~ render_heat_maps~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ -** Processing line: ~ The parameters for sprites are~ -** Processing line: ~ 1. The position on the screen (x, y)~ -** Processing line: ~ 2. The width (w)~ -** Processing line: ~ 3. The height (h)~ -** Processing line: ~ 4. The image path (p)~ +** Processing line: ~ render_star~ +** Processing line: ~ render_target~ +** Processing line: ~ render_hills~ +** Processing line: ~ render_walls~ ** Processing line: ~~ -** Processing line: ~ Here is an example of a sprite definition:~ -** Processing line: ~ [100, 100, 400, 500, 'sprites/dragonruby.png']~ -** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ +** Processing line: ~ render_paths~ +** Processing line: ~ end~ +** Processing line: ~ # The methods below subdivide the task of drawing everything to the screen~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ # Draws what the grid looks like with nothing on it~ +** Processing line: ~ def render_background~ +** Processing line: ~ render_unvisited~ +** Processing line: ~ render_grid_lines~ +** Processing line: ~ render_labels~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # This code demonstrates the creation and output of objects like sprites, borders, and solids~ -** Processing line: ~ # If filled in, they are solids~ -** Processing line: ~ # If hollow, they are borders~ -** Processing line: ~ # If images, they are sprites~ +** Processing line: ~ # Draws two rectangles the size of the grid in the default cell color~ +** Processing line: ~ # Used as part of the background~ +** Processing line: ~ def render_unvisited~ +** Processing line: ~ outputs.solids << [scale_up(grid.rect), unvisited_color]~ +** Processing line: ~ outputs.solids << [move_and_scale_up(grid.rect), unvisited_color]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Solids are added to args.outputs.solids~ -** Processing line: ~ # Borders are added to args.outputs.borders~ -** Processing line: ~ # Sprites are added to args.outputs.sprites~ +** Processing line: ~ # Draws grid lines to show the division of the grid into cells~ +** Processing line: ~ def render_grid_lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << vertical_line(x)~ +** Processing line: ~ outputs.lines << shifted_vertical_line(x)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The tick method runs 60 frames every second.~ -** Processing line: ~ # Your game is going to happen under this one function.~ -** Processing line: ~ def tick args~ -** Processing line: ~ border_as_solid_and_solid_as_border args~ -** Processing line: ~ sprite_as_border_or_solids args~ -** Processing line: ~ collection_of_borders_and_solids args~ -** Processing line: ~ collection_of_sprites args~ -** Processing line: ~ end~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << horizontal_line(y)~ +** Processing line: ~ outputs.lines << shifted_horizontal_line(y)~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Shows a border being output onto the screen as a border and a solid~ -** Processing line: ~ # Also shows how colors can be set~ -** Processing line: ~ def border_as_solid_and_solid_as_border args~ -** Processing line: ~ border = [0, 0, 50, 50]~ -** Processing line: ~ args.outputs.borders << border~ -** Processing line: ~ args.outputs.solids << border~ +** Processing line: ~ # Easy way to draw vertical lines given an index for the first grid~ +** Processing line: ~ def vertical_line column~ +** Processing line: ~ scale_up([column, 0, column, grid.height])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Red, green, blue saturations (last three parameters) can be any number between 0 and 255~ -** Processing line: ~ border_with_color = [0, 100, 50, 50, 255, 0, 0]~ -** Processing line: ~ args.outputs.borders << border_with_color~ -** Processing line: ~ args.outputs.solids << border_with_color~ +** Processing line: ~ # Easy way to draw horizontal lines given an index for the second grid~ +** Processing line: ~ def horizontal_line row~ +** Processing line: ~ scale_up([0, row, grid.width, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ border_with_nested_color = [0, 200, 50, 50, [0, 255, 0]] # nested color~ -** Processing line: ~ args.outputs.borders << border_with_nested_color~ -** Processing line: ~ args.outputs.solids << border_with_nested_color~ +** Processing line: ~ # Easy way to draw vertical lines given an index for the first grid~ +** Processing line: ~ def shifted_vertical_line column~ +** Processing line: ~ scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ border_with_nested_rect = [[0, 300, 50, 50], 0, 0, 255] # nested rect~ -** Processing line: ~ args.outputs.borders << border_with_nested_rect~ -** Processing line: ~ args.outputs.solids << border_with_nested_rect~ +** Processing line: ~ # Easy way to draw horizontal lines given an index for the second grid~ +** Processing line: ~ def shifted_horizontal_line row~ +** Processing line: ~ scale_up([grid.width + 1, row, grid.width + grid.width + 1, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ border_with_nested_color_and_rect = [[0, 400, 50, 50], [255, 0, 255]] # nested rect and color~ -** Processing line: ~ args.outputs.borders << border_with_nested_color_and_rect~ -** Processing line: ~ args.outputs.solids << border_with_nested_color_and_rect~ -** Processing line: ~ end~ +** Processing line: ~ # Labels the grids~ +** Processing line: ~ def render_labels~ +** Processing line: ~ outputs.labels << [175, 650, "Number of steps", 3]~ +** Processing line: ~ outputs.labels << [925, 650, "Distance", 3]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Shows a sprite output onto the screen as a sprite, border, and solid~ -** Processing line: ~ # Demonstrates that all three outputs appear differently on screen~ -** Processing line: ~ def sprite_as_border_or_solids args~ -** Processing line: ~ sprite = [100, 0, 50, 50, 'sprites/ship.png']~ -** Processing line: ~ args.outputs.sprites << sprite~ +** Processing line: ~ def render_paths~ +** Processing line: ~ render_breadth_first_search_path~ +** Processing line: ~ render_dijkstra_path~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sprite_as_border variable has same parameters (excluding position) as above object,~ -** Processing line: ~ # but will appear differently on screen because it is added to args.outputs.borders~ -** Processing line: ~ sprite_as_border = [100, 100, 50, 50, 'sprites/ship.png']~ -** Processing line: ~ args.outputs.borders << sprite_as_border~ +** Processing line: ~ def render_heat_maps~ +** Processing line: ~ render_breadth_first_search_heat_map~ +** Processing line: ~ render_dijkstra_heat_map~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Sprite_as_solid variable has same parameters (excluding position) as above object,~ -** Processing line: ~ # but will appear differently on screen because it is added to args.outputs.solids~ -** Processing line: ~ sprite_as_solid = [100, 200, 50, 50, 'sprites/ship.png']~ -** Processing line: ~ args.outputs.solids << sprite_as_solid~ -** Processing line: ~ end~ +** Processing line: ~ # Renders the breadth first search on the first grid~ +** Processing line: ~ def render_breadth_first_search~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Holds and outputs a collection of borders and a collection of solids~ -** Processing line: ~ # Collections are created by using arrays to hold parameters of each individual object~ -** Processing line: ~ def collection_of_borders_and_solids args~ -** Processing line: ~ collection_borders = [~ -** Processing line: ~ [~ -** Processing line: ~ [200, 0, 50, 50], # black border~ -** Processing line: ~ [200, 100, 50, 50, 255, 0, 0], # red border~ -** Processing line: ~ [200, 200, 50, 50, [0, 255, 0]], # nested color~ -** Processing line: ~ ],~ -** Processing line: ~ [[200, 300, 50, 50], 0, 0, 255], # nested rect~ -** Processing line: ~ [[200, 400, 50, 50], [255, 0, 255]] # nested rect and nested color~ -** Processing line: ~ ]~ +** Processing line: ~ # This heat map shows the cells explored by the breadth first search and how far they are from the star.~ +** Processing line: ~ def render_breadth_first_search_heat_map~ +** Processing line: ~ # For each cell explored~ +** Processing line: ~ breadth_first_search.visited.each_key do | visited_cell |~ +** Processing line: ~ # Find its distance from the star~ +** Processing line: ~ distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs~ +** Processing line: ~ max_distance = grid.width + grid.height~ +** Processing line: ~ # Get it as a percent of the maximum distance and scale to 255 for use as an alpha value~ +** Processing line: ~ alpha = 255.to_i * distance.to_i / max_distance.to_i~ +** Processing line: ~ outputs.solids << [scale_up(visited_cell), red, alpha]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.borders << collection_borders~ +** Processing line: ~ def render_breadth_first_search_path~ +** Processing line: ~ # If the search found the target~ +** Processing line: ~ if breadth_first_search.visited.has_key?(state.target)~ +** Processing line: ~ # Start from the target~ +** Processing line: ~ endpoint = state.target~ +** Processing line: ~ # And the cell it came from~ +** Processing line: ~ next_endpoint = breadth_first_search.came_from[endpoint]~ +** Processing line: ~ while endpoint and next_endpoint~ +** Processing line: ~ # Draw a path between these two cells~ +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ +** Processing line: ~ outputs.solids << [scale_up(path), path_color]~ +** Processing line: ~ # And get the next pair of cells~ +** Processing line: ~ endpoint = next_endpoint~ +** Processing line: ~ next_endpoint = breadth_first_search.came_from[endpoint]~ +** Processing line: ~ # Continue till there are no more cells~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ collection_solids = [~ -** Processing line: ~ [~ -** Processing line: ~ [[300, 300, 50, 50], 0, 0, 255], # nested rect~ -** Processing line: ~ [[300, 400, 50, 50], [255, 0, 255]] # nested rect and nested color~ -** Processing line: ~ ],~ -** Processing line: ~ [300, 0, 50, 50],~ -** Processing line: ~ [300, 100, 50, 50, 255, 0, 0],~ -** Processing line: ~ [300, 200, 50, 50, [0, 255, 0]], # nested color~ -** Processing line: ~ ]~ +** Processing line: ~ # Renders the Dijkstra search on the second grid~ +** Processing line: ~ def render_dijkstra~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.solids << collection_solids~ -** Processing line: ~ end~ +** Processing line: ~ def render_dijkstra_heat_map~ +** Processing line: ~ dijkstra_search.cost_so_far.each do |visited_cell, cost|~ +** Processing line: ~ max_cost = (grid.width + grid.height) #* 5~ +** Processing line: ~ alpha = 255.to_i * cost.to_i / max_cost.to_i~ +** Processing line: ~ outputs.solids << [move_and_scale_up(visited_cell), red, alpha]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Holds and outputs a collection of sprites by adding it to args.outputs.sprites~ -** Processing line: ~ # Also outputs a collection with same parameters (excluding position) by adding~ -** Processing line: ~ # it to args.outputs.solids and another to args.outputs.borders~ -** Processing line: ~ def collection_of_sprites args~ -** Processing line: ~ sprites_collection = [~ -** Processing line: ~ [~ -** Processing line: ~ [400, 0, 50, 50, 'sprites/ship.png'],~ -** Processing line: ~ [400, 100, 50, 50, 'sprites/ship.png'],~ -** Processing line: ~ ],~ -** Processing line: ~ [400, 200, 50, 50, 'sprites/ship.png']~ -** Processing line: ~ ]~ +** Processing line: ~ def render_dijkstra_path~ +** Processing line: ~ # If the search found the target~ +** Processing line: ~ if dijkstra_search.came_from.has_key?(state.target)~ +** Processing line: ~ # Get the target and the cell it came from~ +** Processing line: ~ endpoint = state.target~ +** Processing line: ~ next_endpoint = dijkstra_search.came_from[endpoint]~ +** Processing line: ~ while endpoint and next_endpoint~ +** Processing line: ~ # Draw a path between them~ +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ +** Processing line: ~ outputs.solids << [move_and_scale_up(path), path_color]~ ** Processing line: ~~ -** Processing line: ~ args.outputs.sprites << sprites_collection~ +** Processing line: ~ # Shift one cell down the path~ +** Processing line: ~ endpoint = next_endpoint~ +** Processing line: ~ next_endpoint = dijkstra_search.came_from[endpoint]~ ** Processing line: ~~ -** Processing line: ~ args.outputs.solids << [~ -** Processing line: ~ [500, 0, 50, 50, 'sprites/ship.png'],~ -** Processing line: ~ [500, 100, 50, 50, 'sprites/ship.png'],~ -** Processing line: ~ [[[500, 200, 50, 50, 'sprites/ship.png']]]~ -** Processing line: ~ ]~ +** Processing line: ~ # Repeat till the end of the path~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.borders << [~ -** Processing line: ~ [~ -** Processing line: ~ [600, 0, 50, 50, 'sprites/ship.png'],~ -** Processing line: ~ [600, 100, 50, 50, 'sprites/ship.png'],~ -** Processing line: ~ ],~ -** Processing line: ~ [600, 200, 50, 50, 'sprites/ship.png']~ -** Processing line: ~ ]~ -** Processing line: ~ end~ +** Processing line: ~ # Renders the star on both grids~ +** Processing line: ~ def render_star~ +** Processing line: ~ outputs.sprites << [scale_up(state.star), 'star.png']~ +** Processing line: ~ outputs.sprites << [move_and_scale_up(state.star), 'star.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Renders the target on both grids~ +** Processing line: ~ def render_target~ +** Processing line: ~ outputs.sprites << [scale_up(state.target), 'target.png']~ +** Processing line: ~ outputs.sprites << [move_and_scale_up(state.target), 'target.png']~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def render_hills~ +** Processing line: ~ state.hills.each_key do |hill|~ +** Processing line: ~ outputs.solids << [scale_up(hill), hill_color]~ +** Processing line: ~ outputs.solids << [move_and_scale_up(hill), hill_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Advanced Rendering - Render Primitives As Hash - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Rendering - Render Primitives As Hash - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Draws the walls on both grids~ +** Processing line: ~ def render_walls~ +** Processing line: ~ state.walls.each_key do |wall|~ +** Processing line: ~ outputs.solids << [scale_up(wall), wall_color]~ +** Processing line: ~ outputs.solids << [move_and_scale_up(wall), wall_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/07_advanced_rendering/05_render_primitives_as_hash/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ def get_path_between(cell_one, cell_two)~ +** Processing line: ~ path = nil~ +** Processing line: ~ if cell_one.x == cell_two.x~ +** Processing line: ~ if cell_one.y < cell_two.y~ +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4]~ +** Processing line: ~ else~ +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4]~ +** Processing line: ~ end~ +** Processing line: ~ else~ +** Processing line: ~ if cell_one.x < cell_two.x~ +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4]~ +** Processing line: ~ else~ +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ path~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ +** Processing line: ~ # Representation of how far away visited cells are from the star~ +** Processing line: ~ # Replaces the render_visited method~ +** Processing line: ~ # Visually demonstrates the effectiveness of early exit for pathfinding~ +** Processing line: ~ def render_breadth_first_search_heat_map~ +** Processing line: ~ breadth_first_search.visited.each_key do | visited_cell |~ +** Processing line: ~ distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs~ +** Processing line: ~ max_distance = grid.width + grid.height~ +** Processing line: ~ alpha = 255.to_i * distance.to_i / max_distance.to_i~ +** Processing line: ~ outputs.solids << [scale_up(visited_cell), red, alpha]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - Hashes: Collection of unique keys and their corresponding values. The value can be found~ -** Processing line: ~ using their keys.~ +** Processing line: ~ # Translates the given cell grid.width + 1 to the right and then scales up~ +** Processing line: ~ # Used to draw cells for the second grid~ +** Processing line: ~ # This method does not work for lines,~ +** Processing line: ~ # so separate methods exist for the grid lines~ +** Processing line: ~ def move_and_scale_up(cell)~ +** Processing line: ~ cell_clone = cell.clone~ +** Processing line: ~ cell_clone.x += grid.width + 1~ +** Processing line: ~ scale_up(cell_clone)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ For example, if we have a "numbers" hash that stores numbers in English as the~ -** Processing line: ~ key and numbers in Spanish as the value, we'd have a hash that looks like this...~ -** Processing line: ~ numbers = { "one" => "uno", "two" => "dos", "three" => "tres" }~ -** Processing line: ~ and on it goes.~ +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ +** Processing line: ~ # This method is used to scale up cells, and lines~ +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ +** Processing line: ~ def scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ ** Processing line: ~~ -** Processing line: ~ Now if we wanted to find the corresponding value of the "one" key, we could say~ -** Processing line: ~ puts numbers["one"]~ -** Processing line: ~ which would print "uno" to the console.~ +** Processing line: ~ # If cell is just an x and y coordinate~ +** Processing line: ~ if cell.size == 2~ +** Processing line: ~ # Add a width and height of 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.sprites: An array. The values generate a sprite.~ -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE]~ -** Processing line: ~ For more information about sprites, go to mygame/documentation/05-sprites.md.~ +** Processing line: ~ # Scale all the values up~ +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +** Processing line: ~ # Returns the scaled up cell~ +** Processing line: ~ cell~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ -** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~ # Handles user input every tick so the grid can be edited~ +** Processing line: ~ # Separate input detection and processing is needed~ +** Processing line: ~ # For example: Adding walls is started by clicking down on a hill,~ +** Processing line: ~ # but the mouse doesn't need to remain over hills to add walls~ +** Processing line: ~ def input~ +** Processing line: ~ # If the mouse was lifted this tick~ +** Processing line: ~ if inputs.mouse.up~ +** Processing line: ~ # Set current input to none~ +** Processing line: ~ state.user_input = :none~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.borders: An array. The values generate a border.~ -** Processing line: ~ The parameters are the same as a solid.~ -** Processing line: ~ For more information about borders, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~ # If the mouse was clicked this tick~ +** Processing line: ~ if inputs.mouse.down~ +** Processing line: ~ # Determine what the user is editing and edit the state.user_input variable~ +** Processing line: ~ determine_input~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.lines: An array. The values generate a line.~ -** Processing line: ~ The parameters are [X1, Y1, X2, Y2, RED, GREEN, BLUE]~ -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +** Processing line: ~ # Process user input based on user_input variable and current mouse position~ +** Processing line: ~ process_input~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ # Determines what the user is editing and stores the value~ +** Processing line: ~ # This method is called the tick the mouse is clicked~ +** Processing line: ~ # Storing the value allows the user to continue the same edit as long as the~ +** Processing line: ~ # mouse left click is held~ +** Processing line: ~ def determine_input~ +** Processing line: ~ # If the mouse is over the star in the first grid~ +** Processing line: ~ if mouse_over_star?~ +** Processing line: ~ # The user is editing the star from the first grid~ +** Processing line: ~ state.user_input = :star~ +** Processing line: ~ # If the mouse is over the star in the second grid~ +** Processing line: ~ elsif mouse_over_star2?~ +** Processing line: ~ # The user is editing the star from the second grid~ +** Processing line: ~ state.user_input = :star2~ +** Processing line: ~ # If the mouse is over the target in the first grid~ +** Processing line: ~ elsif mouse_over_target?~ +** Processing line: ~ # The user is editing the target from the first grid~ +** Processing line: ~ state.user_input = :target~ +** Processing line: ~ # If the mouse is over the target in the second grid~ +** Processing line: ~ elsif mouse_over_target2?~ +** Processing line: ~ # The user is editing the target from the second grid~ +** Processing line: ~ state.user_input = :target2~ +** Processing line: ~ # If the mouse is over a wall in the first grid~ +** Processing line: ~ elsif mouse_over_wall?~ +** Processing line: ~ # The user is removing a wall from the first grid~ +** Processing line: ~ state.user_input = :remove_wall~ +** Processing line: ~ # If the mouse is over a wall in the second grid~ +** Processing line: ~ elsif mouse_over_wall2?~ +** Processing line: ~ # The user is removing a wall from the second grid~ +** Processing line: ~ state.user_input = :remove_wall2~ +** Processing line: ~ # If the mouse is over a hill in the first grid~ +** Processing line: ~ elsif mouse_over_hill?~ +** Processing line: ~ # The user is adding a wall from the first grid~ +** Processing line: ~ state.user_input = :add_wall~ +** Processing line: ~ # If the mouse is over a hill in the second grid~ +** Processing line: ~ elsif mouse_over_hill2?~ +** Processing line: ~ # The user is adding a wall from the second grid~ +** Processing line: ~ state.user_input = :add_wall2~ +** Processing line: ~ # If the mouse is over the first grid~ +** Processing line: ~ elsif mouse_over_grid?~ +** Processing line: ~ # The user is adding a hill from the first grid~ +** Processing line: ~ state.user_input = :add_hill~ +** Processing line: ~ # If the mouse is over the second grid~ +** Processing line: ~ elsif mouse_over_grid2?~ +** Processing line: ~ # The user is adding a hill from the second grid~ +** Processing line: ~ state.user_input = :add_hill2~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ +** Processing line: ~ def process_input~ +** Processing line: ~ if state.user_input == :star~ +** Processing line: ~ input_star~ +** Processing line: ~ elsif state.user_input == :star2~ +** Processing line: ~ input_star2~ +** Processing line: ~ elsif state.user_input == :target~ +** Processing line: ~ input_target~ +** Processing line: ~ elsif state.user_input == :target2~ +** Processing line: ~ input_target2~ +** Processing line: ~ elsif state.user_input == :remove_wall~ +** Processing line: ~ input_remove_wall~ +** Processing line: ~ elsif state.user_input == :remove_wall2~ +** Processing line: ~ input_remove_wall2~ +** Processing line: ~ elsif state.user_input == :add_hill~ +** Processing line: ~ input_add_hill~ +** Processing line: ~ elsif state.user_input == :add_hill2~ +** Processing line: ~ input_add_hill2~ +** Processing line: ~ elsif state.user_input == :add_wall~ +** Processing line: ~ input_add_wall~ +** Processing line: ~ elsif state.user_input == :add_wall2~ +** Processing line: ~ input_add_wall2~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Calculates the two searches~ +** Processing line: ~ def calc~ +** Processing line: ~ # If the searches have not started~ +** Processing line: ~ if breadth_first_search.visited.empty?~ +** Processing line: ~ # Calculate the two searches~ +** Processing line: ~ calc_breadth_first~ +** Processing line: ~ calc_dijkstra~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ def calc_breadth_first~ +** Processing line: ~ # Sets up the Breadth First Search~ +** Processing line: ~ breadth_first_search.visited[state.star] = true~ +** Processing line: ~ breadth_first_search.frontier << state.star~ +** Processing line: ~ breadth_first_search.came_from[state.star] = nil~ +** Processing line: ~~ +** Processing line: ~ until breadth_first_search.frontier.empty?~ +** Processing line: ~ return if breadth_first_search.visited.has_key?(state.target)~ +** Processing line: ~ # A step in the search~ +** Processing line: ~ # Takes the next frontier cell~ +** Processing line: ~ new_frontier = breadth_first_search.frontier.shift~ +** Processing line: ~ # For each of its neighbors~ +** Processing line: ~ adjacent_neighbors(new_frontier).each do | neighbor |~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless breadth_first_search.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited in the first grid~ +** Processing line: ~ breadth_first_search.visited[neighbor] = true~ +** Processing line: ~ breadth_first_search.frontier << neighbor~ +** Processing line: ~ # Remember which cell the neighbor came from~ +** Processing line: ~ breadth_first_search.came_from[neighbor] = new_frontier~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # This sample app demonstrates how hashes can be used to output different kinds of objects.~ +** Processing line: ~ # Calculates the Dijkstra Search from the beginning to the end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.angle ||= 0 # initializes angle to 0~ -** Processing line: ~ args.state.angle += 1 # increments angle by 1 every frame (60 times a second)~ +** Processing line: ~ def calc_dijkstra~ +** Processing line: ~ # The initial values for the Dijkstra search~ +** Processing line: ~ dijkstra_search.frontier << [state.star, 0]~ +** Processing line: ~ dijkstra_search.came_from[state.star] = nil~ +** Processing line: ~ dijkstra_search.cost_so_far[state.star] = 0~ ** Processing line: ~~ -** Processing line: ~ # Outputs sprite using a hash~ -** Processing line: ~ args.outputs.sprites << {~ -** Processing line: ~ x: 30, # sprite position~ -** Processing line: ~ y: 550,~ -** Processing line: ~ w: 128, # sprite size~ -** Processing line: ~ h: 101,~ -** Processing line: ~ path: "dragonruby.png", # image path~ -** Processing line: ~ angle: args.state.angle, # angle~ -** Processing line: ~ a: 255, # alpha (transparency)~ -** Processing line: ~ r: 255, # color saturation~ -** Processing line: ~ g: 255,~ -** Processing line: ~ b: 255,~ -** Processing line: ~ tile_x: 0, # sprite sub division/tile~ -** Processing line: ~ tile_y: 0,~ -** Processing line: ~ tile_w: -1,~ -** Processing line: ~ tile_h: -1,~ -** Processing line: ~ flip_vertically: false, # don't flip sprite~ -** 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: ~ }~ +** Processing line: ~ # Until their are no more cells to be explored~ +** Processing line: ~ until dijkstra_search.frontier.empty?~ +** Processing line: ~ # Get the next cell to be explored from~ +** Processing line: ~ # We get the first element of the array which is the cell. The second element is the priority.~ +** Processing line: ~ current = dijkstra_search.frontier.shift[0]~ ** Processing line: ~~ -** Processing line: ~ # Outputs label using a hash~ -** Processing line: ~ args.outputs.labels << {~ -** Processing line: ~ x: 200, # label position~ -** Processing line: ~ y: 550,~ -** Processing line: ~ text: "dragonruby", # label text~ -** Processing line: ~ size_enum: 2,~ -** Processing line: ~ alignment_enum: 1,~ -** Processing line: ~ r: 155, # color saturation~ -** Processing line: ~ g: 50,~ -** Processing line: ~ b: 50,~ -** Processing line: ~ a: 255, # transparency~ -** Processing line: ~ font: "fonts/manaspc.ttf" # font style; without mentioned file, label won't output correctly~ -** Processing line: ~ }~ +** Processing line: ~ # Stop the search if we found the target~ +** Processing line: ~ return if current == state.target~ ** Processing line: ~~ -** Processing line: ~ # Outputs solid using a hash~ -** Processing line: ~ # [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE, ALPHA]~ -** Processing line: ~ args.outputs.solids << {~ -** Processing line: ~ x: 400, # position~ -** Processing line: ~ y: 550,~ -** Processing line: ~ w: 160, # size~ -** Processing line: ~ h: 90,~ -** Processing line: ~ r: 120, # color saturation~ -** Processing line: ~ g: 50,~ -** Processing line: ~ b: 50,~ -** Processing line: ~ a: 255 # transparency~ -** Processing line: ~ }~ +** Processing line: ~ # For each of the neighbors~ +** Processing line: ~ adjacent_neighbors(current).each do | neighbor |~ +** Processing line: ~ # Unless this cell is a wall or has already been explored.~ +** Processing line: ~ unless dijkstra_search.came_from.has_key?(neighbor) or state.walls.has_key?(neighbor)~ +** Processing line: ~ # Calculate the movement cost of getting to this cell and memo~ +** Processing line: ~ new_cost = dijkstra_search.cost_so_far[current] + cost(neighbor)~ +** Processing line: ~ dijkstra_search.cost_so_far[neighbor] = new_cost~ ** Processing line: ~~ -** Processing line: ~ # Outputs border using a hash~ -** Processing line: ~ # Same parameters as a solid~ -** Processing line: ~ args.outputs.borders << {~ -** Processing line: ~ x: 600,~ -** Processing line: ~ y: 550,~ -** Processing line: ~ w: 160,~ -** Processing line: ~ h: 90,~ -** Processing line: ~ r: 120,~ -** Processing line: ~ g: 50,~ -** Processing line: ~ b: 50,~ -** Processing line: ~ a: 255~ -** Processing line: ~ }~ +** Processing line: ~ # Add this neighbor to the cells too be explored~ +** Processing line: ~ dijkstra_search.frontier << [neighbor, new_cost]~ +** Processing line: ~ dijkstra_search.came_from[neighbor] = current~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs line using a hash~ -** Processing line: ~ args.outputs.lines << {~ -** Processing line: ~ x: 900, # starting position~ -** Processing line: ~ y: 550,~ -** Processing line: ~ x2: 1200, # ending position~ -** Processing line: ~ y2: 550,~ -** Processing line: ~ r: 120, # color saturation~ -** Processing line: ~ g: 50,~ -** Processing line: ~ b: 50,~ -** Processing line: ~ a: 255 # transparency~ -** Processing line: ~ }~ +** Processing line: ~ # Sort the frontier so exploration occurs that have a low cost so far.~ +** Processing line: ~ # My implementation of a priority queue~ +** Processing line: ~ dijkstra_search.frontier = dijkstra_search.frontier.sort_by {|cell, priority| priority}~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs sprite as a primitive using a hash~ -** Processing line: ~ args.outputs.primitives << {~ -** Processing line: ~ x: 30, # position~ -** Processing line: ~ y: 200,~ -** Processing line: ~ w: 128, # size~ -** Processing line: ~ h: 101,~ -** Processing line: ~ path: "dragonruby.png", # image path~ -** Processing line: ~ angle: args.state.angle, # angle~ -** Processing line: ~ a: 255, # transparency~ -** Processing line: ~ r: 255, # color saturation~ -** Processing line: ~ g: 255,~ -** Processing line: ~ b: 255,~ -** Processing line: ~ tile_x: 0, # sprite sub division/tile~ -** Processing line: ~ tile_y: 0,~ -** Processing line: ~ tile_w: -1,~ -** Processing line: ~ tile_h: -1,~ -** Processing line: ~ flip_vertically: false, # don't flip~ -** 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: ~ def cost(cell)~ +** Processing line: ~ if state.hills.has_key?(cell)~ +** Processing line: ~ return 5~ +** Processing line: ~ else~ +** Processing line: ~ return 1~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Outputs label as primitive using a hash~ -** Processing line: ~ args.outputs.primitives << {~ -** Processing line: ~ x: 200, # position~ -** Processing line: ~ y: 200,~ -** Processing line: ~ text: "dragonruby", # text~ -** Processing line: ~ size: 2,~ -** Processing line: ~ alignment: 1,~ -** Processing line: ~ r: 155, # color saturation~ -** Processing line: ~ g: 50,~ -** Processing line: ~ b: 50,~ -** Processing line: ~ a: 255, # transparency~ -** Processing line: ~ font: "fonts/manaspc.ttf" # font style~ -** Processing line: ~ }.label~ ** Processing line: ~~ -** Processing line: ~ # Outputs solid as primitive using a hash~ -** Processing line: ~ args.outputs.primitives << {~ -** Processing line: ~ x: 400, # position~ -** Processing line: ~ y: 200,~ -** Processing line: ~ w: 160, # size~ -** Processing line: ~ h: 90,~ -** Processing line: ~ r: 120, # color saturation~ -** Processing line: ~ g: 50,~ -** Processing line: ~ b: 50,~ -** Processing line: ~ a: 255 # transparency~ -** Processing line: ~ }.solid~ ** Processing line: ~~ -** Processing line: ~ # Outputs border as primitive using a hash~ -** Processing line: ~ # Same parameters as solid~ -** Processing line: ~ args.outputs.primitives << {~ -** Processing line: ~ x: 600, # position~ -** Processing line: ~ y: 200,~ -** Processing line: ~ w: 160, # size~ -** Processing line: ~ h: 90,~ -** Processing line: ~ r: 120, # color saturation~ -** Processing line: ~ g: 50,~ -** Processing line: ~ b: 50,~ -** Processing line: ~ a: 255 # transparency~ -** Processing line: ~ }.border~ ** Processing line: ~~ -** Processing line: ~ # Outputs line as primitive using a hash~ -** Processing line: ~ args.outputs.primitives << {~ -** Processing line: ~ x: 900, # starting position~ -** Processing line: ~ y: 200,~ -** Processing line: ~ x2: 1200, # ending position~ -** Processing line: ~ y2: 200,~ -** Processing line: ~ r: 120, # color saturation~ -** Processing line: ~ g: 50,~ -** Processing line: ~ b: 50,~ -** Processing line: ~ a: 255 # transparency~ -** Processing line: ~ }.line~ -** Processing line: ~ end~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def input_star~ +** Processing line: ~ old_star = state.star.clone~ +** Processing line: ~ unless cell_closest_to_mouse == state.target~ +** Processing line: ~ state.star = cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_star == state.star~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Moves the star to the cell closest to the mouse in the second grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def input_star2~ +** Processing line: ~ old_star = state.star.clone~ +** Processing line: ~ unless cell_closest_to_mouse2 == state.target~ +** Processing line: ~ state.star = cell_closest_to_mouse2~ +** Processing line: ~ end~ +** Processing line: ~ unless old_star == state.star~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ +** Processing line: ~ # Only reset_searchs the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def input_target~ +** Processing line: ~ old_target = state.target.clone~ +** Processing line: ~ unless cell_closest_to_mouse == state.star~ +** Processing line: ~ state.target = cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_target == state.target~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Advanced Rendering - Pixel Arrays - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Rendering - Pixel Arrays - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Moves the target to the cell closest to the mouse in the second grid~ +** Processing line: ~ # Only reset_searchs the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def input_target2~ +** Processing line: ~ old_target = state.target.clone~ +** Processing line: ~ unless cell_closest_to_mouse2 == state.star~ +** Processing line: ~ state.target = cell_closest_to_mouse2~ +** Processing line: ~ end~ +** Processing line: ~ unless old_target == state.target~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/07_advanced_rendering/06_pixel_arrays/app/main.rb~ -** Processing line: ~ $gtk.reset~ +** Processing line: ~ # Removes walls in the first grid that are under the cursor~ +** Processing line: ~ def input_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if mouse_over_grid?~ +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse) or state.hills.has_key?(cell_closest_to_mouse)~ +** Processing line: ~ state.walls.delete(cell_closest_to_mouse)~ +** Processing line: ~ state.hills.delete(cell_closest_to_mouse)~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.posinc ||= 1~ -** Processing line: ~ args.state.pos ||= 0~ -** Processing line: ~ args.state.rotation ||= 0~ +** Processing line: ~ # Removes walls in the second grid that are under the cursor~ +** Processing line: ~ def input_remove_wall2~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if mouse_over_grid2?~ +** Processing line: ~ if state.walls.has_key?(cell_closest_to_mouse2) or state.hills.has_key?(cell_closest_to_mouse2)~ +** Processing line: ~ state.walls.delete(cell_closest_to_mouse2)~ +** Processing line: ~ state.hills.delete(cell_closest_to_mouse2)~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ dimension = 10 # keep it small and let the GPU scale it when rendering the sprite.~ +** Processing line: ~ # Adds a hill in the first grid in the cell the mouse is over~ +** Processing line: ~ def input_add_hill~ +** Processing line: ~ if mouse_over_grid?~ +** Processing line: ~ unless state.hills.has_key?(cell_closest_to_mouse)~ +** Processing line: ~ state.hills[cell_closest_to_mouse] = true~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Set up our "scanner" pixel array and fill it with black pixels.~ -** Processing line: ~ args.pixel_array(:scanner).width = dimension~ -** Processing line: ~ args.pixel_array(:scanner).height = dimension~ -** Processing line: ~ args.pixel_array(:scanner).pixels.fill(0xFF000000, 0, dimension * dimension) # black, full alpha~ ** Processing line: ~~ -** Processing line: ~ # Draw a green line that bounces up and down the sprite.~ -** Processing line: ~ args.pixel_array(:scanner).pixels.fill(0xFF00FF00, dimension * args.state.pos, dimension) # green, full alpha~ +** Processing line: ~ # Adds a hill in the second grid in the cell the mouse is over~ +** Processing line: ~ def input_add_hill2~ +** Processing line: ~ if mouse_over_grid2?~ +** Processing line: ~ unless state.hills.has_key?(cell_closest_to_mouse2)~ +** Processing line: ~ state.hills[cell_closest_to_mouse2] = true~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Adjust position for next frame.~ -** Processing line: ~ args.state.pos += args.state.posinc~ -** Processing line: ~ if args.state.posinc > 0 && args.state.pos >= dimension~ -** Processing line: ~ args.state.posinc = -1~ -** Processing line: ~ args.state.pos = dimension - 1~ -** Processing line: ~ elsif args.state.posinc < 0 && args.state.pos < 0~ -** Processing line: ~ args.state.posinc = 1~ -** Processing line: ~ args.state.pos = 1~ +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ +** Processing line: ~ def input_add_wall~ +** Processing line: ~ if mouse_over_grid?~ +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse)~ +** Processing line: ~ state.hills.delete(cell_closest_to_mouse)~ +** Processing line: ~ state.walls[cell_closest_to_mouse] = true~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # New/changed pixel arrays get uploaded to the GPU before we render~ -** Processing line: ~ # anything. At that point, they can be scaled, rotated, and otherwise~ -** Processing line: ~ # used like any other sprite.~ -** Processing line: ~ w = 100~ -** Processing line: ~ h = 100~ -** Processing line: ~ x = (1280 - w) / 2~ -** Processing line: ~ y = (720 - h) / 2~ -** Processing line: ~ args.outputs.background_color = [64, 0, 128]~ -** Processing line: ~ args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite~ -** Processing line: ~ args.state.rotation += 1~ +** Processing line: ~ # Adds a wall in the second grid in the cell the mouse is over~ +** Processing line: ~ def input_add_wall2~ +** Processing line: ~ if mouse_over_grid2?~ +** Processing line: ~ unless state.walls.has_key?(cell_closest_to_mouse2)~ +** Processing line: ~ state.hills.delete(cell_closest_to_mouse2)~ +** Processing line: ~ state.walls[cell_closest_to_mouse2] = true~ +** Processing line: ~ reset_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Whenever the user edits the grid,~ +** Processing line: ~ # The search has to be reset_searchd upto the current step~ +** Processing line: ~ # with the current grid as the initial state of the grid~ +** Processing line: ~ def reset_search~ +** Processing line: ~ breadth_first_search.visited = {}~ +** Processing line: ~ breadth_first_search.frontier = []~ +** Processing line: ~ breadth_first_search.came_from = {}~ +** Processing line: ~~ +** Processing line: ~ dijkstra_search.frontier = []~ +** Processing line: ~ dijkstra_search.came_from = {}~ +** Processing line: ~ dijkstra_search.cost_so_far = {}~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # Returns a list of adjacent cells~ +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ +** Processing line: ~ def adjacent_neighbors(cell)~ +** Processing line: ~ neighbors = []~ +** Processing line: ~~ +** Processing line: ~ # Gets all the valid neighbors into the array~ +** Processing line: ~ # From southern neighbor, clockwise~ +** Processing line: ~ neighbors << [cell.x , cell.y - 1] unless cell.y == 0~ +** Processing line: ~ neighbors << [cell.x - 1, cell.y ] unless cell.x == 0~ +** Processing line: ~ neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1~ +** Processing line: ~ neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1~ +** Processing line: ~~ +** Processing line: ~ # Sorts the neighbors so the rendered path is a zigzag path~ +** Processing line: ~ # Cells in a diagonal direction are given priority~ +** Processing line: ~ # Comment this line to see the difference~ +** Processing line: ~ neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) }~ +** Processing line: ~~ +** Processing line: ~ neighbors~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ +** Processing line: ~ # and returns the larger value~ +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ +** Processing line: ~ # A cell that is [5, 5] from the star,~ +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ +** Processing line: ~ def proximity_to_star(x, y)~ +** Processing line: ~ distance_x = (state.star.x - x).abs~ +** Processing line: ~ distance_y = (state.star.y - y).abs~ +** Processing line: ~~ +** Processing line: ~ if distance_x > distance_y~ +** Processing line: ~ return distance_x~ +** Processing line: ~ else~ +** Processing line: ~ return distance_y~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ +** Processing line: ~ def cell_closest_to_mouse~ +** Processing line: ~ # Closest cell to the mouse in the first grid~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Bound x and y to the grid~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse in the second grid helps with this~ +** Processing line: ~ def cell_closest_to_mouse2~ +** Processing line: ~ # Closest cell grid to the mouse in the second~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Translate the cell to the first grid~ +** Processing line: ~ x -= grid.width + 1~ +** Processing line: ~ # Bound x and y to the first grid~ +** Processing line: ~ x = 0 if x < 0~ +** Processing line: ~ y = 0 if y < 0~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be moving the star from the first grid~ +** Processing line: ~ def mouse_over_star?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up(state.star))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be moving the star from the second grid~ +** Processing line: ~ def mouse_over_star2?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(move_and_scale_up(state.star))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ +** Processing line: ~ def mouse_over_target?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up(state.target))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be moving the target from the second grid~ +** Processing line: ~ def mouse_over_target2?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(move_and_scale_up(state.target))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be removing walls from the first grid~ +** Processing line: ~ def mouse_over_wall?~ +** Processing line: ~ state.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(scale_up(wall))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ false~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be removing walls from the second grid~ +** Processing line: ~ def mouse_over_wall2?~ +** Processing line: ~ state.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(move_and_scale_up(wall))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ false~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be removing hills from the first grid~ +** Processing line: ~ def mouse_over_hill?~ +** Processing line: ~ state.hills.each_key do | hill |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(scale_up(hill))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ false~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be removing hills from the second grid~ +** Processing line: ~ def mouse_over_hill2?~ +** Processing line: ~ state.hills.each_key do | hill |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(move_and_scale_up(hill))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ false~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ +** Processing line: ~ def mouse_over_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(scale_up(grid.rect))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be adding walls from the second grid~ +** Processing line: ~ def mouse_over_grid2?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(move_and_scale_up(grid.rect))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # These methods provide handy aliases to colors~ +** Processing line: ~~ +** Processing line: ~ # Light brown~ +** Processing line: ~ def unvisited_color~ +** Processing line: ~ [221, 212, 213]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Camo Green~ +** Processing line: ~ def wall_color~ +** Processing line: ~ [134, 134, 120]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Pastel White~ +** Processing line: ~ def path_color~ +** Processing line: ~ [231, 230, 228]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def red~ +** Processing line: ~ [255, 0, 0]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # A Green~ +** Processing line: ~ def hill_color~ +** Processing line: ~ [139, 173, 132]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Makes code more concise~ +** Processing line: ~ def grid~ +** Processing line: ~ state.grid~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def breadth_first_search~ +** Processing line: ~ state.breadth_first_search~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ +** Processing line: ~ def dijkstra_search~ +** Processing line: ~ state.dijkstra_search~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Method that is called by DragonRuby periodically~ +** Processing line: ~ # Used for updating animations and calculations~ +** Processing line: ~ def tick args~ +** Processing line: ~~ +** Processing line: ~ # Pressing r will reset the application~ +** Processing line: ~ if args.inputs.keyboard.key_down.r~ +** Processing line: ~ args.gtk.reset~ +** Processing line: ~ reset~ +** Processing line: ~ return~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Every tick, new args are passed, and the Dijkstra tick method is called~ +** Processing line: ~ $movement_costs ||= Movement_Costs.new(args)~ +** Processing line: ~ $movement_costs.args = args~ +** Processing line: ~ $movement_costs.tick~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~~ +** Processing line: ~ def reset~ +** Processing line: ~ $movement_costs = nil~ +** 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~ -- H1 detected. +** Processing line: ~*** Path Finding Algorithms - Heuristic - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Tweening Lerping Easing Functions - Easing Functions - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Path Finding Algorithms - Heuristic - 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: ~Path Finding Algorithms - Heuristic - 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/08_tweening_lerping_easing_functions/01_easing_functions/app/main.rb~ -** Processing line: ~ def tick args~ -** Processing line: ~ # STOP! Watch the following presentation first!!!!~ -** Processing line: ~ # Math for Game Programmers: Fast and Funky 1D Nonlinear Transformations~ -** Processing line: ~ # https://www.youtube.com/watch?v=mr5xkf6zSzk~ +** Processing line: ~ # ./samples/13_path_finding_algorithms/06_heuristic/app/main.rb~ +** Processing line: ~ # This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ ** Processing line: ~~ -** Processing line: ~ # You've watched the talk, yes? YES???~ +** Processing line: ~ # This time the heuristic search still explored less of the grid, hence finishing faster.~ +** Processing line: ~ # However, it did not find the shortest path between the star and the target.~ ** Processing line: ~~ -** Processing line: ~ # define starting and ending points of properties to animate~ -** Processing line: ~ args.state.target_x = 1180~ -** Processing line: ~ args.state.target_y = 620~ -** Processing line: ~ args.state.target_w = 100~ -** Processing line: ~ args.state.target_h = 100~ -** Processing line: ~ args.state.starting_x = 0~ -** Processing line: ~ args.state.starting_y = 0~ -** Processing line: ~ args.state.starting_w = 300~ -** Processing line: ~ args.state.starting_h = 300~ +** Processing line: ~ # The only difference between this app and Heuristic is the change of the starting position.~ ** Processing line: ~~ -** Processing line: ~ # define start time and duration of animation~ -** Processing line: ~ args.state.start_animate_at = 3.seconds # this is the same as writing 60 * 5 (or 300)~ -** Processing line: ~ args.state.duration = 2.seconds # this is the same as writing 60 * 2 (or 120)~ +** Processing line: ~ class Heuristic_With_Walls~ +** Processing line: ~ attr_gtk~ ** Processing line: ~~ -** Processing line: ~ # define type of animations~ -** Processing line: ~ # Here are all the options you have for values you can put in the array:~ -** Processing line: ~ # :identity, :quad, :cube, :quart, :quint, :flip~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ render~ +** Processing line: ~ input~ +** Processing line: ~ # If animation is playing, and max steps have not been reached~ +** Processing line: ~ # Move the search a step forward~ +** Processing line: ~ if state.play && state.current_step < state.max_steps~ +** Processing line: ~ # Variable that tells the program what step to recalculate up to~ +** Processing line: ~ state.current_step += 1~ +** Processing line: ~ move_searches_one_step_forward~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Linear is defined as:~ -** Processing line: ~ # [:identity]~ -** Processing line: ~ #~ -** Processing line: ~ # Smooth start variations are:~ -** Processing line: ~ # [:quad]~ -** Processing line: ~ # [:cube]~ -** Processing line: ~ # [:quart]~ -** Processing line: ~ # [:quint]~ +** Processing line: ~ def defaults~ +** Processing line: ~ # Variables to edit the size and appearance of the grid~ +** Processing line: ~ # Freely customizable to user's liking~ +** Processing line: ~ grid.width ||= 15~ +** Processing line: ~ grid.height ||= 15~ +** Processing line: ~ grid.cell_size ||= 40~ +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ +** Processing line: ~~ +** Processing line: ~ grid.star ||= [0, 2]~ +** Processing line: ~ grid.target ||= [14, 12]~ +** Processing line: ~ grid.walls ||= {}~ +** Processing line: ~ # There are no hills in the Heuristic Search Demo~ +** Processing line: ~~ +** Processing line: ~ # What the user is currently editing on the grid~ +** Processing line: ~ # We store this value, because we want to remember the value even when~ +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ +** Processing line: ~ # they are still clicking down on the mouse.~ +** Processing line: ~ state.user_input ||= :none~ +** Processing line: ~~ +** Processing line: ~ # These variables allow the breadth first search to take place~ +** Processing line: ~ # 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.~ +** Processing line: ~ # Used to prevent searching cells that have already been found~ +** Processing line: ~ # and to trace a path from the target back to the starting point.~ +** Processing line: ~ # Frontier is an array of cells to expand the search from.~ +** Processing line: ~ # The search is over when there are no more cells to search from.~ +** Processing line: ~ # Path stores the path from the target to the star, once the target has been found~ +** Processing line: ~ # It prevents calculating the path every tick.~ +** Processing line: ~ bfs.came_from ||= {}~ +** Processing line: ~ bfs.frontier ||= []~ +** Processing line: ~ bfs.path ||= []~ +** Processing line: ~~ +** Processing line: ~ heuristic.came_from ||= {}~ +** Processing line: ~ heuristic.frontier ||= []~ +** Processing line: ~ heuristic.path ||= []~ +** Processing line: ~~ +** Processing line: ~ # Stores which step of the animation is being rendered~ +** Processing line: ~ # When the user moves the star or messes with the walls,~ +** Processing line: ~ # the searches are recalculated up to this step~ +** Processing line: ~~ +** Processing line: ~ # Unless the current step has a value~ +** Processing line: ~ unless state.current_step~ +** Processing line: ~ # Set the current step to 10~ +** Processing line: ~ state.current_step = 10~ +** Processing line: ~ # And calculate the searches up to step 10~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # At some step the animation will end,~ +** Processing line: ~ # and further steps won't change anything (the whole grid will be explored)~ +** Processing line: ~ # This step is roughly the grid's width * height~ +** Processing line: ~ # When anim_steps equals max_steps no more calculations will occur~ +** Processing line: ~ # and the slider will be at the end~ +** Processing line: ~ state.max_steps = grid.width * grid.height~ +** Processing line: ~~ +** Processing line: ~ # Whether the animation should play or not~ +** Processing line: ~ # If true, every tick moves anim_steps forward one~ +** Processing line: ~ # Pressing the stepwise animation buttons will pause the animation~ +** Processing line: ~ # An if statement instead of the ||= operator is used for assigning a boolean value.~ +** Processing line: ~ # The || operator does not differentiate between nil and false.~ +** Processing line: ~ if state.play == nil~ +** Processing line: ~ state.play = false~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Store the rects of the buttons that control the animation~ +** Processing line: ~ # They are here for user customization~ +** Processing line: ~ # Editing these might require recentering the text inside them~ +** Processing line: ~ # Those values can be found in the render_button methods~ +** Processing line: ~ buttons.left = [470, 600, 50, 50]~ +** Processing line: ~ buttons.center = [520, 600, 200, 50]~ +** Processing line: ~ buttons.right = [720, 600, 50, 50]~ +** Processing line: ~~ +** Processing line: ~ # The variables below are related to the slider~ +** Processing line: ~ # They allow the user to customize them~ +** Processing line: ~ # They also give a central location for the render and input methods to get~ +** Processing line: ~ # information from~ +** Processing line: ~ # x & y are the coordinates of the leftmost part of the slider line~ +** Processing line: ~ slider.x = 440~ +** Processing line: ~ slider.y = 675~ +** Processing line: ~ # This is the width of the line~ +** Processing line: ~ slider.w = 360~ +** Processing line: ~ # This is the offset for the circle~ +** Processing line: ~ # Allows the center of the circle to be on the line,~ +** Processing line: ~ # as opposed to the upper right corner~ +** Processing line: ~ slider.offset = 20~ +** Processing line: ~ # This is the spacing between each of the notches on the slider~ +** Processing line: ~ # Notches are places where the circle can rest on the slider line~ +** Processing line: ~ # There needs to be a notch for each step before the maximum number of steps~ +** Processing line: ~ slider.spacing = slider.w.to_f / state.max_steps.to_f~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # All methods with render draw stuff on the screen~ +** Processing line: ~ # UI has buttons, the slider, and labels~ +** Processing line: ~ # The search specific rendering occurs in the respective methods~ +** Processing line: ~ def render~ +** Processing line: ~ render_ui~ +** Processing line: ~ render_bfs~ +** Processing line: ~ render_heuristic~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Linear reversed, and smooth stop are the same as the animations defined above, but reversed:~ -** Processing line: ~ # [:flip, :identity]~ -** Processing line: ~ # [:flip, :quad, :flip]~ -** Processing line: ~ # [:flip, :cube, :flip]~ -** Processing line: ~ # [:flip, :quart, :flip]~ -** Processing line: ~ # [:flip, :quint, :flip]~ +** Processing line: ~ def render_ui~ +** Processing line: ~ render_buttons~ +** Processing line: ~ render_slider~ +** Processing line: ~ render_labels~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # You can also do custom definitions. See the bottom of the file details~ -** Processing line: ~ # on how to do that. I've defined a couple for you:~ -** Processing line: ~ # [:smoothest_start]~ -** Processing line: ~ # [:smoothest_stop]~ +** Processing line: ~ def render_buttons~ +** Processing line: ~ render_left_button~ +** Processing line: ~ render_center_button~ +** Processing line: ~ render_right_button~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # CHANGE THIS LINE TO ONE OF THE LINES ABOVE TO SEE VARIATIONS~ -** Processing line: ~ args.state.animation_type = [:identity]~ -** Processing line: ~ # args.state.animation_type = [:quad]~ -** Processing line: ~ # args.state.animation_type = [:cube]~ -** Processing line: ~ # args.state.animation_type = [:quart]~ -** Processing line: ~ # args.state.animation_type = [:quint]~ -** Processing line: ~ # args.state.animation_type = [:flip, :identity]~ -** Processing line: ~ # args.state.animation_type = [:flip, :quad, :flip]~ -** Processing line: ~ # args.state.animation_type = [:flip, :cube, :flip]~ -** Processing line: ~ # args.state.animation_type = [:flip, :quart, :flip]~ -** Processing line: ~ # args.state.animation_type = [:flip, :quint, :flip]~ -** Processing line: ~ # args.state.animation_type = [:smoothest_start]~ -** Processing line: ~ # args.state.animation_type = [:smoothest_stop]~ +** Processing line: ~ def render_bfs~ +** Processing line: ~ render_bfs_grid~ +** Processing line: ~ render_bfs_star~ +** Processing line: ~ render_bfs_target~ +** Processing line: ~ render_bfs_visited~ +** Processing line: ~ render_bfs_walls~ +** Processing line: ~ render_bfs_frontier~ +** Processing line: ~ render_bfs_path~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # THIS IS WHERE THE MAGIC HAPPENS!~ -** Processing line: ~ # Numeric#ease~ -** Processing line: ~ progress = args.state.start_animate_at.ease(args.state.duration, args.state.animation_type)~ +** Processing line: ~ def render_heuristic~ +** Processing line: ~ render_heuristic_grid~ +** Processing line: ~ render_heuristic_star~ +** Processing line: ~ render_heuristic_target~ +** Processing line: ~ render_heuristic_visited~ +** Processing line: ~ render_heuristic_walls~ +** Processing line: ~ render_heuristic_frontier~ +** Processing line: ~ render_heuristic_path~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Numeric#ease needs to called:~ -** Processing line: ~ # 1. On the number that represents the point in time you want to start, and takes two parameters:~ -** Processing line: ~ # a. The first parameter is how long the animation should take.~ -** Processing line: ~ # b. The second parameter represents the functions that need to be called.~ -** Processing line: ~ #~ -** Processing line: ~ # For example, if I wanted an animate to start 3 seconds in, and last for 10 seconds,~ -** Processing line: ~ # and I want to animation to start fast and end slow, I would do:~ -** Processing line: ~ # (60 * 3).ease(60 * 10, :flip, :quint, :flip)~ +** Processing line: ~ # This method handles user input every tick~ +** Processing line: ~ def input~ +** Processing line: ~ # Check and handle button input~ +** Processing line: ~ input_buttons~ ** Processing line: ~~ -** Processing line: ~ # initial value delta to the final value~ -** Processing line: ~ calc_x = args.state.starting_x + (args.state.target_x - args.state.starting_x) * progress~ -** Processing line: ~ calc_y = args.state.starting_y + (args.state.target_y - args.state.starting_y) * progress~ -** Processing line: ~ calc_w = args.state.starting_w + (args.state.target_w - args.state.starting_w) * progress~ -** Processing line: ~ calc_h = args.state.starting_h + (args.state.target_h - args.state.starting_h) * progress~ +** Processing line: ~ # If the mouse was lifted this tick~ +** Processing line: ~ if inputs.mouse.up~ +** Processing line: ~ # Set current input to none~ +** Processing line: ~ state.user_input = :none~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.solids << [calc_x, calc_y, calc_w, calc_h, 0, 0, 0]~ +** Processing line: ~ # If the mouse was clicked this tick~ +** Processing line: ~ if inputs.mouse.down~ +** Processing line: ~ # Determine what the user is editing and appropriately edit the state.user_input variable~ +** Processing line: ~ determine_input~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # count down~ -** Processing line: ~ count_down = args.state.start_animate_at - args.state.tick_count~ -** Processing line: ~ if count_down > 0~ -** Processing line: ~ args.outputs.labels << [640, 375, "Running: #{args.state.animation_type} in...", 3, 1]~ -** Processing line: ~ args.outputs.labels << [640, 345, "%.2f" % count_down.fdiv(60), 3, 1]~ -** Processing line: ~ elsif progress >= 1~ -** Processing line: ~ args.outputs.labels << [640, 360, "Click screen to reset.", 3, 1]~ -** Processing line: ~ if args.inputs.click~ -** Processing line: ~ $gtk.reset~ +** Processing line: ~ # Process user input based on user_input variable and current mouse position~ +** Processing line: ~ process_input~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Determines what the user is editing~ +** Processing line: ~ # This method is called when the mouse is clicked down~ +** Processing line: ~ def determine_input~ +** Processing line: ~ if mouse_over_slider?~ +** Processing line: ~ state.user_input = :slider~ +** Processing line: ~ # If the mouse is over the star in the first grid~ +** Processing line: ~ elsif bfs_mouse_over_star?~ +** Processing line: ~ # The user is editing the star from the first grid~ +** Processing line: ~ state.user_input = :bfs_star~ +** Processing line: ~ # If the mouse is over the star in the second grid~ +** Processing line: ~ elsif heuristic_mouse_over_star?~ +** Processing line: ~ # The user is editing the star from the second grid~ +** Processing line: ~ state.user_input = :heuristic_star~ +** Processing line: ~ # If the mouse is over the target in the first grid~ +** Processing line: ~ elsif bfs_mouse_over_target?~ +** Processing line: ~ # The user is editing the target from the first grid~ +** Processing line: ~ state.user_input = :bfs_target~ +** Processing line: ~ # If the mouse is over the target in the second grid~ +** Processing line: ~ elsif heuristic_mouse_over_target?~ +** Processing line: ~ # The user is editing the target from the second grid~ +** Processing line: ~ state.user_input = :heuristic_target~ +** Processing line: ~ # If the mouse is over a wall in the first grid~ +** Processing line: ~ elsif bfs_mouse_over_wall?~ +** Processing line: ~ # The user is removing a wall from the first grid~ +** Processing line: ~ state.user_input = :bfs_remove_wall~ +** Processing line: ~ # If the mouse is over a wall in the second grid~ +** Processing line: ~ elsif heuristic_mouse_over_wall?~ +** Processing line: ~ # The user is removing a wall from the second grid~ +** Processing line: ~ state.user_input = :heuristic_remove_wall~ +** Processing line: ~ # If the mouse is over the first grid~ +** Processing line: ~ elsif bfs_mouse_over_grid?~ +** Processing line: ~ # The user is adding a wall from the first grid~ +** Processing line: ~ state.user_input = :bfs_add_wall~ +** Processing line: ~ # If the mouse is over the second grid~ +** Processing line: ~ elsif heuristic_mouse_over_grid?~ +** Processing line: ~ # The user is adding a wall from the second grid~ +** Processing line: ~ state.user_input = :heuristic_add_wall~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ +** Processing line: ~ def process_input~ +** Processing line: ~ if state.user_input == :slider~ +** Processing line: ~ process_input_slider~ +** Processing line: ~ elsif state.user_input == :bfs_star~ +** Processing line: ~ process_input_bfs_star~ +** Processing line: ~ elsif state.user_input == :heuristic_star~ +** Processing line: ~ process_input_heuristic_star~ +** Processing line: ~ elsif state.user_input == :bfs_target~ +** Processing line: ~ process_input_bfs_target~ +** Processing line: ~ elsif state.user_input == :heuristic_target~ +** Processing line: ~ process_input_heuristic_target~ +** Processing line: ~ elsif state.user_input == :bfs_remove_wall~ +** Processing line: ~ process_input_bfs_remove_wall~ +** Processing line: ~ elsif state.user_input == :heuristic_remove_wall~ +** Processing line: ~ process_input_heuristic_remove_wall~ +** Processing line: ~ elsif state.user_input == :bfs_add_wall~ +** Processing line: ~ process_input_bfs_add_wall~ +** Processing line: ~ elsif state.user_input == :heuristic_add_wall~ +** Processing line: ~ process_input_heuristic_add_wall~ ** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # $gtk.reset~ +** Processing line: ~ def render_slider~ +** Processing line: ~ # Using primitives hides the line under the white circle of the slider~ +** Processing line: ~ # Draws the line~ +** Processing line: ~ outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line~ +** Processing line: ~ # The circle needs to be offset so that the center of the circle~ +** Processing line: ~ # overlaps the line instead of the upper right corner of the circle~ +** Processing line: ~ # The circle's x value is also moved based on the current seach step~ +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing)~ +** Processing line: ~ circle_y = (slider.y - slider.offset)~ +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ +** Processing line: ~ outputs.primitives << [circle_rect, 'circle-white.png'].sprite~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # you can make own variations of animations using this~ -** Processing line: ~ module Easing~ -** Processing line: ~ # you have access to all the built in functions: identity, flip, quad, cube, quart, quint~ -** Processing line: ~ def self.smoothest_start x~ -** Processing line: ~ quad(quint(x))~ +** Processing line: ~ def render_labels~ +** Processing line: ~ outputs.labels << [205, 625, "Breadth First Search"]~ +** Processing line: ~ outputs.labels << [820, 625, "Heuristic Best-First Search"]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def self.smoothest_stop x~ -** Processing line: ~ flip(quad(quint(flip(x))))~ +** Processing line: ~ def render_left_button~ +** Processing line: ~ # Draws the button_color button, and a black border~ +** Processing line: ~ # The border separates the buttons visually~ +** Processing line: ~ outputs.solids << [buttons.left, button_color]~ +** Processing line: ~ outputs.borders << [buttons.left]~ +** Processing line: ~~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ +** Processing line: ~ # Explains to the user what the button does~ +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ +** Processing line: ~ # to keep the label in the center of the button~ +** Processing line: ~ label_x = buttons.left.x + 20~ +** Processing line: ~ label_y = buttons.left.y + 35~ +** Processing line: ~ outputs.labels << [label_x, label_y, "<"]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # this is the source for the existing easing functions~ -** Processing line: ~ def self.identity x~ -** Processing line: ~ x~ +** Processing line: ~ def render_center_button~ +** Processing line: ~ # Draws the button_color button, and a black border~ +** Processing line: ~ # The border separates the buttons visually~ +** Processing line: ~ outputs.solids << [buttons.center, button_color]~ +** Processing line: ~ outputs.borders << [buttons.center]~ +** Processing line: ~~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ +** Processing line: ~ # Explains to the user what the button does~ +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ +** Processing line: ~ # to keep the label in the center of the button~ +** Processing line: ~ label_x = buttons.center.x + 37~ +** Processing line: ~ label_y = buttons.center.y + 35~ +** Processing line: ~ label_text = state.play ? "Pause Animation" : "Play Animation"~ +** Processing line: ~ outputs.labels << [label_x, label_y, label_text]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def self.flip x~ -** Processing line: ~ 1 - x~ +** Processing line: ~ def render_right_button~ +** Processing line: ~ # Draws the button_color button, and a black border~ +** Processing line: ~ # The border separates the buttons visually~ +** Processing line: ~ outputs.solids << [buttons.right, button_color]~ +** Processing line: ~ outputs.borders << [buttons.right]~ +** Processing line: ~~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ +** Processing line: ~ # Explains to the user what the button does~ +** Processing line: ~ label_x = buttons.right.x + 20~ +** Processing line: ~ label_y = buttons.right.y + 35~ +** Processing line: ~ outputs.labels << [label_x, label_y, ">"]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def self.quad x~ -** Processing line: ~ x * x~ +** Processing line: ~ def render_bfs_grid~ +** Processing line: ~ # A large rect the size of the grid~ +** Processing line: ~ outputs.solids << [bfs_scale_up(grid.rect), default_color]~ +** Processing line: ~~ +** Processing line: ~ # The vertical grid lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << bfs_vertical_line(x)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # The horizontal grid lines~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << bfs_horizontal_line(y)~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def self.cube x~ -** Processing line: ~ x * x * x~ +** Processing line: ~ def render_heuristic_grid~ +** Processing line: ~ # A large rect the size of the grid~ +** Processing line: ~ outputs.solids << [heuristic_scale_up(grid.rect), default_color]~ +** Processing line: ~~ +** Processing line: ~ # The vertical grid lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << heuristic_vertical_line(x)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # The horizontal grid lines~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << heuristic_horizontal_line(y)~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def self.quart x~ -** Processing line: ~ x * x * x * x * x~ +** Processing line: ~ # Returns a vertical line for a column of the first grid~ +** Processing line: ~ def bfs_vertical_line column~ +** Processing line: ~ bfs_scale_up([column, 0, column, grid.height])~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def self.quint x~ -** Processing line: ~ x * x * x * x * x * x~ +** Processing line: ~ # Returns a horizontal line for a column of the first grid~ +** Processing line: ~ def bfs_horizontal_line row~ +** Processing line: ~ bfs_scale_up([0, row, grid.width, row])~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Returns a vertical line for a column of the second grid~ +** Processing line: ~ def heuristic_vertical_line column~ +** Processing line: ~ bfs_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height])~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Returns a horizontal line for a column of the second grid~ +** Processing line: ~ def heuristic_horizontal_line row~ +** Processing line: ~ bfs_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Tweening Lerping Easing Functions - Cubic Bezier - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Tweening Lerping Easing Functions - Cubic Bezier - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Renders the star on the first grid~ +** Processing line: ~ def render_bfs_star~ +** Processing line: ~ outputs.sprites << [bfs_scale_up(grid.star), 'star.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/08_tweening_lerping_easing_functions/02_cubic_bezier/app/main.rb~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.background_color = [33, 33, 33]~ -** Processing line: ~ args.outputs.lines << bezier(100, 100,~ -** Processing line: ~ 100, 620,~ -** Processing line: ~ 1180, 620,~ -** Processing line: ~ 1180, 100,~ -** Processing line: ~ 0)~ +** Processing line: ~ # Renders the star on the second grid~ +** Processing line: ~ def render_heuristic_star~ +** Processing line: ~ outputs.sprites << [heuristic_scale_up(grid.star), 'star.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.lines << bezier(100, 100,~ -** Processing line: ~ 100, 620,~ -** Processing line: ~ 1180, 620,~ -** Processing line: ~ 1180, 100,~ -** Processing line: ~ 20)~ -** Processing line: ~ end~ +** Processing line: ~ # Renders the target on the first grid~ +** Processing line: ~ def render_bfs_target~ +** Processing line: ~ outputs.sprites << [bfs_scale_up(grid.target), 'target.png']~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Renders the target on the second grid~ +** Processing line: ~ def render_heuristic_target~ +** Processing line: ~ outputs.sprites << [heuristic_scale_up(grid.target), 'target.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def bezier x1, y1, x2, y2, x3, y3, x4, y4, step~ -** Processing line: ~ step ||= 0~ -** Processing line: ~ color = [200, 200, 200]~ -** Processing line: ~ points = points_for_bezier [x1, y1], [x2, y2], [x3, y3], [x4, y4], step~ +** Processing line: ~ # Renders the walls on the first grid~ +** Processing line: ~ def render_bfs_walls~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ outputs.solids << [bfs_scale_up(wall), wall_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ points.each_cons(2).map do |p1, p2|~ -** Processing line: ~ [p1, p2, color]~ +** Processing line: ~ # Renders the walls on the second grid~ +** Processing line: ~ def render_heuristic_walls~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ outputs.solids << [heuristic_scale_up(wall), wall_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def points_for_bezier p1, p2, p3, p4, step~ -** Processing line: ~ points = []~ -** Processing line: ~ if step == 0~ -** Processing line: ~ [p1, p2, p3, p4]~ -** Processing line: ~ else~ -** Processing line: ~ t_step = 1.fdiv(step + 1)~ -** Processing line: ~ t = 0~ -** Processing line: ~ t += t_step~ -** Processing line: ~ points = []~ -** Processing line: ~ while t < 1~ -** Processing line: ~ points << [~ -** Processing line: ~ b_for_t(p1.x, p2.x, p3.x, p4.x, t),~ -** Processing line: ~ b_for_t(p1.y, p2.y, p3.y, p4.y, t),~ -** Processing line: ~ ]~ -** Processing line: ~ t += t_step~ +** Processing line: ~ # Renders the visited cells on the first grid~ +** Processing line: ~ def render_bfs_visited~ +** Processing line: ~ bfs.came_from.each_key do | visited_cell |~ +** Processing line: ~ outputs.solids << [bfs_scale_up(visited_cell), visited_color]~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ [~ -** Processing line: ~ p1,~ -** Processing line: ~ *points,~ -** Processing line: ~ p4~ -** Processing line: ~ ]~ +** Processing line: ~ # Renders the visited cells on the second grid~ +** Processing line: ~ def render_heuristic_visited~ +** Processing line: ~ heuristic.came_from.each_key do | visited_cell |~ +** Processing line: ~ outputs.solids << [heuristic_scale_up(visited_cell), visited_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def b_for_t v0, v1, v2, v3, t~ -** Processing line: ~ pow(1 - t, 3) * v0 +~ -** Processing line: ~ 3 * pow(1 - t, 2) * t * v1 +~ -** Processing line: ~ 3 * (1 - t) * pow(t, 2) * v2 +~ -** Processing line: ~ pow(t, 3) * v3~ -** Processing line: ~ end~ +** Processing line: ~ # Renders the frontier cells on the first grid~ +** Processing line: ~ def render_bfs_frontier~ +** Processing line: ~ bfs.frontier.each do | frontier_cell |~ +** Processing line: ~ outputs.solids << [bfs_scale_up(frontier_cell), frontier_color, 200]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def pow n, to~ -** Processing line: ~ n ** to~ -** Processing line: ~ end~ +** Processing line: ~ # Renders the frontier cells on the second grid~ +** Processing line: ~ def render_heuristic_frontier~ +** Processing line: ~ heuristic.frontier.each do | frontier_cell |~ +** Processing line: ~ outputs.solids << [heuristic_scale_up(frontier_cell), frontier_color, 200]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Renders the path found by the breadth first search on the first grid~ +** Processing line: ~ def render_bfs_path~ +** Processing line: ~ bfs.path.each do | path |~ +** Processing line: ~ outputs.solids << [bfs_scale_up(path), path_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Renders the path found by the heuristic search on the second grid~ +** Processing line: ~ def render_heuristic_path~ +** Processing line: ~ heuristic.path.each do | path |~ +** Processing line: ~ outputs.solids << [heuristic_scale_up(path), path_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Tweening Lerping Easing Functions - Easing Using Spline - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Tweening Lerping Easing Functions - Easing Using Spline - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Returns the rect for the path between two cells based on their relative positions~ +** Processing line: ~ def get_path_between(cell_one, cell_two)~ +** Processing line: ~ path = nil~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/08_tweening_lerping_easing_functions/03_easing_using_spline/app/main.rb~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.duration = 10.seconds~ -** Processing line: ~ args.state.spline = [~ -** Processing line: ~ [0.0, 0.33, 0.66, 1.0],~ -** Processing line: ~ [1.0, 1.0, 1.0, 1.0],~ -** Processing line: ~ [1.0, 0.66, 0.33, 0.0],~ -** Processing line: ~ ]~ +** Processing line: ~ # If cell one is above cell two~ +** Processing line: ~ if cell_one.x == cell_two.x and cell_one.y > cell_two.y~ +** Processing line: ~ # Path starts from the center of cell two and moves upward to the center of cell one~ +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4]~ +** Processing line: ~ # If cell one is below cell two~ +** Processing line: ~ elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y~ +** Processing line: ~ # Path starts from the center of cell one and moves upward to the center of cell two~ +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4]~ +** Processing line: ~ # If cell one is to the left of cell two~ +** Processing line: ~ elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y~ +** Processing line: ~ # Path starts from the center of cell two and moves rightward to the center of cell one~ +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4]~ +** Processing line: ~ # If cell one is to the right of cell two~ +** Processing line: ~ elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y~ +** Processing line: ~ # Path starts from the center of cell one and moves rightward to the center of cell two~ +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.simulation_tick = args.state.tick_count % args.state.duration~ -** Processing line: ~ progress = 0.ease_spline_extended args.state.simulation_tick, args.state.duration, args.state.spline~ -** Processing line: ~ args.outputs.borders << args.grid.rect~ -** Processing line: ~ args.outputs.solids << [20 + 1240 * progress,~ -** Processing line: ~ 20 + 680 * progress,~ -** Processing line: ~ 20, 20].anchor_rect(0.5, 0.5)~ -** Processing line: ~ args.outputs.labels << [10,~ -** Processing line: ~ 710,~ -** Processing line: ~ "perc: #{"%.2f" % (args.state.simulation_tick / args.state.duration)} t: #{args.state.simulation_tick}"]~ -** Processing line: ~ end~ +** Processing line: ~ path~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ +** Processing line: ~ # This method is used to scale up cells, and lines~ +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ +** Processing line: ~ # This method scales up cells for the first grid~ +** Processing line: ~ def bfs_scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ ** Processing line: ~~ +** Processing line: ~ # If cell is just an x and y coordinate~ +** Processing line: ~ if cell.size == 2~ +** Processing line: ~ # Add a width and height of 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Tweening Lerping Easing Functions - Parametric Enemy Movement - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Tweening Lerping Easing Functions - Parametric Enemy Movement - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Scale all the values up~ +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/08_tweening_lerping_easing_functions/04_parametric_enemy_movement/app/main.rb~ -** Processing line: ~ def new_star args~ -** Processing line: ~ { x: 1280.randomize(:ratio),~ -** Processing line: ~ starting_y: 800,~ -** Processing line: ~ distance_to_travel: 900 + 100.randomize(:ratio),~ -** Processing line: ~ duration: 100.randomize(:ratio) + 60,~ -** Processing line: ~ created_at: args.state.tick_count,~ -** Processing line: ~ max_alpha: 128.randomize(:ratio) + 128,~ -** Processing line: ~ b: 255.randomize(:ratio),~ -** Processing line: ~ g: 200.randomize(:ratio),~ -** Processing line: ~ w: 1.randomize(:ratio) + 1,~ -** Processing line: ~ h: 1.randomize(:ratio) + 1 }~ -** Processing line: ~ end~ +** Processing line: ~ # Returns the scaled up cell~ +** Processing line: ~ cell~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def new_enemy args~ -** Processing line: ~ { x: 1280.randomize(:ratio),~ -** Processing line: ~ starting_y: 800,~ -** Processing line: ~ distance_to_travel: -900,~ -** Processing line: ~ duration: 60.randomize(:ratio) + 180,~ -** Processing line: ~ created_at: args.state.tick_count,~ -** Processing line: ~ w: 32,~ -** Processing line: ~ h: 32,~ -** Processing line: ~ fire_rate: (30.randomize(:ratio) + (60 - args.state.score)).to_i }~ -** Processing line: ~ end~ +** Processing line: ~ # Translates the given cell grid.width + 1 to the right and then scales up~ +** Processing line: ~ # Used to draw cells for the second grid~ +** Processing line: ~ # This method does not work for lines,~ +** Processing line: ~ # so separate methods exist for the grid lines~ +** Processing line: ~ def heuristic_scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ +** Processing line: ~ # Translates the cell to the second grid equivalent~ +** Processing line: ~ cell.x += grid.width + 1~ +** Processing line: ~ # Proceeds as if scaling up for the first grid~ +** Processing line: ~ bfs_scale_up(cell)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def new_bullet args, starting_x, starting_y, enemy_speed~ -** Processing line: ~ { x: starting_x,~ -** Processing line: ~ starting_y: starting_y,~ -** Processing line: ~ distance_to_travel: -900,~ -** Processing line: ~ created_at: args.state.tick_count,~ -** Processing line: ~ duration: 900 / (enemy_speed.abs + 2.0 + (5.0 * args.state.score.fdiv(100))).abs,~ -** Processing line: ~ w: 5,~ -** Processing line: ~ h: 5 }~ -** Processing line: ~ end~ +** Processing line: ~ # Checks and handles input for the buttons~ +** Processing line: ~ # Called when the mouse is lifted~ +** Processing line: ~ def input_buttons~ +** Processing line: ~ input_left_button~ +** Processing line: ~ input_center_button~ +** Processing line: ~ input_right_button~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def new_player_bullet args, starting_x, starting_y, player_speed~ -** Processing line: ~ { x: starting_x,~ -** Processing line: ~ starting_y: starting_y,~ -** Processing line: ~ distance_to_travel: 900,~ -** Processing line: ~ created_at: args.state.tick_count,~ -** Processing line: ~ duration: 900 / (player_speed + 2.0),~ -** Processing line: ~ w: 5,~ -** Processing line: ~ h: 5 }~ -** Processing line: ~ end~ +** Processing line: ~ # Checks if the previous step button is clicked~ +** Processing line: ~ # If it is, it pauses the animation and moves the search one step backward~ +** Processing line: ~ def input_left_button~ +** Processing line: ~ if left_button_clicked?~ +** Processing line: ~ state.play = false~ +** Processing line: ~ state.current_step -= 1~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def defaults args~ -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ -** Processing line: ~ args.state.score ||= 0~ -** Processing line: ~ args.state.stars ||= []~ -** Processing line: ~ args.state.enemies ||= []~ -** Processing line: ~ args.state.bullets ||= []~ -** Processing line: ~ args.state.player_bullets ||= []~ -** Processing line: ~ args.state.max_stars = 50~ -** Processing line: ~ args.state.max_enemies = 10~ -** Processing line: ~ args.state.player.x ||= 640~ -** Processing line: ~ args.state.player.y ||= 100~ -** Processing line: ~ args.state.player.w ||= 32~ -** Processing line: ~ args.state.player.h ||= 32~ +** Processing line: ~ # Controls the play/pause button~ +** Processing line: ~ # Inverses whether the animation is playing or not when clicked~ +** Processing line: ~ def input_center_button~ +** Processing line: ~ if center_button_clicked? || inputs.keyboard.key_down.space~ +** Processing line: ~ state.play = !state.play~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.state.tick_count == 0~ -** Processing line: ~ args.state.stars.clear~ -** Processing line: ~ args.state.max_stars.times do~ -** Processing line: ~ s = new_star args~ -** Processing line: ~ s[:created_at] += s[:duration].randomize(:ratio)~ -** Processing line: ~ args.state.stars << s~ +** Processing line: ~ # Checks if the next step button is clicked~ +** Processing line: ~ # If it is, it pauses the animation and moves the search one step forward~ +** Processing line: ~ def input_right_button~ +** Processing line: ~ if right_button_clicked?~ +** Processing line: ~ state.play = false~ +** Processing line: ~ state.current_step += 1~ +** Processing line: ~ move_searches_one_step_forward~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.state.tick_count == 0~ -** Processing line: ~ args.state.enemies.clear~ -** Processing line: ~ args.state.max_enemies.times do~ -** Processing line: ~ s = new_enemy args~ -** Processing line: ~ s[:created_at] += s[:duration].randomize(:ratio)~ -** Processing line: ~ args.state.enemies << s~ +** Processing line: ~ # These methods detect when the buttons are clicked~ +** Processing line: ~ def left_button_clicked?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.left) && inputs.mouse.up~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def center_button_clicked?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.center) && inputs.mouse.up~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def right_button_clicked?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.right) && inputs.mouse.up~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be moving the slider~ +** Processing line: ~ # Is the mouse over the circle of the slider?~ +** Processing line: ~ def mouse_over_slider?~ +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing)~ +** Processing line: ~ circle_y = (slider.y - slider.offset)~ +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ +** Processing line: ~ inputs.mouse.point.inside_rect?(circle_rect)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be moving the star from the first grid~ +** Processing line: ~ def bfs_mouse_over_star?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.star))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be moving the star from the second grid~ +** Processing line: ~ def heuristic_mouse_over_star?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.star))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ +** Processing line: ~ def bfs_mouse_over_target?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.target))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be moving the target from the second grid~ +** Processing line: ~ def heuristic_mouse_over_target?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.target))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be removing walls from the first grid~ +** Processing line: ~ def bfs_mouse_over_wall?~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(bfs_scale_up(wall))~ ** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ false~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def input args~ -** Processing line: ~ if args.inputs.keyboard.left~ -** Processing line: ~ args.state.player.x -= 5~ -** Processing line: ~ elsif args.inputs.keyboard.right~ -** Processing line: ~ args.state.player.x += 5~ +** Processing line: ~ # Signal that the user is going to be removing walls from the second grid~ +** Processing line: ~ def heuristic_mouse_over_wall?~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(heuristic_scale_up(wall))~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ false~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.inputs.keyboard.up~ -** Processing line: ~ args.state.player.y += 5~ -** Processing line: ~ elsif args.inputs.keyboard.down~ -** Processing line: ~ args.state.player.y -= 5~ +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ +** Processing line: ~ def bfs_mouse_over_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.rect))~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if args.inputs.keyboard.key_down.space~ -** Processing line: ~ args.state.player_bullets << new_player_bullet(args,~ -** Processing line: ~ args.state.player.x + args.state.player.w.half,~ -** Processing line: ~ args.state.player.y + args.state.player.h, 5)~ +** Processing line: ~ # Signal that the user is going to be adding walls from the second grid~ +** Processing line: ~ def heuristic_mouse_over_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.rect))~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.player.y = args.state.player.y.greater(0).lesser(720 - args.state.player.w)~ -** Processing line: ~ args.state.player.x = args.state.player.x.greater(0).lesser(1280 - args.state.player.h)~ -** Processing line: ~ end~ +** Processing line: ~ # This method is called when the user is editing the slider~ +** Processing line: ~ # It pauses the animation and moves the white circle to the closest integer point~ +** Processing line: ~ # on the slider~ +** Processing line: ~ # Changes the step of the search to be animated~ +** Processing line: ~ def process_input_slider~ +** Processing line: ~ state.play = false~ +** Processing line: ~ mouse_x = inputs.mouse.point.x~ ** Processing line: ~~ -** Processing line: ~ def completed? entity~ -** Processing line: ~ (entity[:created_at] + entity[:duration]).elapsed_time > 0~ -** Processing line: ~ end~ +** Processing line: ~ # Bounds the mouse_x to the closest x value on the slider line~ +** Processing line: ~ mouse_x = slider.x if mouse_x < slider.x~ +** Processing line: ~ mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w~ ** Processing line: ~~ -** Processing line: ~ def calc_stars args~ -** Processing line: ~ if (stars_to_add = args.state.max_stars - args.state.stars.length) > 0~ -** Processing line: ~ stars_to_add.times { args.state.stars << new_star(args) }~ +** Processing line: ~ # Sets the current search step to the one represented by the mouse x value~ +** Processing line: ~ # The slider's circle moves due to the render_slider method using anim_steps~ +** Processing line: ~ state.current_step = ((mouse_x - slider.x) / slider.spacing).to_i~ +** Processing line: ~~ +** Processing line: ~ recalculate_searches~ ** Processing line: ~ end~ -** Processing line: ~ args.state.stars = args.state.stars.reject { |s| completed? s }~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def move_enemies args~ -** Processing line: ~ if (enemies_to_add = args.state.max_enemies - args.state.enemies.length) > 0~ -** Processing line: ~ enemies_to_add.times { args.state.enemies << new_enemy(args) }~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def process_input_bfs_star~ +** Processing line: ~ old_star = grid.star.clone~ +** Processing line: ~ unless bfs_cell_closest_to_mouse == grid.target~ +** Processing line: ~ grid.star = bfs_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_star == grid.star~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.enemies = args.state.enemies.reject { |s| completed? s }~ -** Processing line: ~ end~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the second grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def process_input_heuristic_star~ +** Processing line: ~ old_star = grid.star.clone~ +** Processing line: ~ unless heuristic_cell_closest_to_mouse == grid.target~ +** Processing line: ~ grid.star = heuristic_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_star == grid.star~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def move_bullets args~ -** Processing line: ~ args.state.enemies.each do |e|~ -** Processing line: ~ if args.state.tick_count.mod_zero?(e[:fire_rate])~ -** Processing line: ~ args.state.bullets << new_bullet(args, e[:x] + e[:w].half, current_y(e), e[:distance_to_travel] / e[:duration])~ +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ +** Processing line: ~ # Only recalculate_searchess the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def process_input_bfs_target~ +** Processing line: ~ old_target = grid.target.clone~ +** Processing line: ~ unless bfs_cell_closest_to_mouse == grid.star~ +** Processing line: ~ grid.target = bfs_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_target == grid.target~ +** Processing line: ~ recalculate_searches~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.bullets = args.state.bullets.reject { |s| completed? s }~ -** Processing line: ~ args.state.player_bullets = args.state.player_bullets.reject { |s| completed? s }~ -** Processing line: ~ end~ +** Processing line: ~ # Moves the target to the cell closest to the mouse in the second grid~ +** Processing line: ~ # Only recalculate_searchess the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def process_input_heuristic_target~ +** Processing line: ~ old_target = grid.target.clone~ +** Processing line: ~ unless heuristic_cell_closest_to_mouse == grid.star~ +** Processing line: ~ grid.target = heuristic_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_target == grid.target~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def intersect? entity_one, entity_two~ -** Processing line: ~ entity_one.merge(y: current_y(entity_one))~ -** Processing line: ~ .intersect_rect? entity_two.merge(y: current_y(entity_two))~ -** Processing line: ~ end~ +** Processing line: ~ # Removes walls in the first grid that are under the cursor~ +** Processing line: ~ def process_input_bfs_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if bfs_mouse_over_grid?~ +** Processing line: ~ if grid.walls.has_key?(bfs_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls.delete(bfs_cell_closest_to_mouse)~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def kill args~ -** Processing line: ~ bullets_hitting_enemies = []~ -** Processing line: ~ dead_bullets = []~ -** Processing line: ~ dead_enemies = []~ +** Processing line: ~ # Removes walls in the second grid that are under the cursor~ +** Processing line: ~ def process_input_heuristic_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if heuristic_mouse_over_grid?~ +** Processing line: ~ if grid.walls.has_key?(heuristic_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls.delete(heuristic_cell_closest_to_mouse)~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ +** Processing line: ~ def process_input_bfs_add_wall~ +** Processing line: ~ if bfs_mouse_over_grid?~ +** Processing line: ~ unless grid.walls.has_key?(bfs_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls[bfs_cell_closest_to_mouse] = true~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.player_bullets.each do |b|~ -** Processing line: ~ args.state.enemies.each do |e|~ -** Processing line: ~ if intersect? b, e~ -** Processing line: ~ dead_bullets << b~ -** Processing line: ~ dead_enemies << e~ +** Processing line: ~ # Adds a wall in the second grid in the cell the mouse is over~ +** Processing line: ~ def process_input_heuristic_add_wall~ +** Processing line: ~ if heuristic_mouse_over_grid?~ +** Processing line: ~ unless grid.walls.has_key?(heuristic_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls[heuristic_cell_closest_to_mouse] = true~ +** Processing line: ~ recalculate_searches~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.score += dead_enemies.length~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ +** Processing line: ~ def bfs_cell_closest_to_mouse~ +** Processing line: ~ # Closest cell to the mouse in the first grid~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Bound x and y to the grid~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse in the second grid helps with this~ +** Processing line: ~ def heuristic_cell_closest_to_mouse~ +** Processing line: ~ # Closest cell grid to the mouse in the second~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Translate the cell to the first grid~ +** Processing line: ~ x -= grid.width + 1~ +** Processing line: ~ # Bound x and y to the first grid~ +** Processing line: ~ x = 0 if x < 0~ +** Processing line: ~ y = 0 if y < 0~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def recalculate_searches~ +** Processing line: ~ # Reset the searches~ +** Processing line: ~ bfs.came_from = {}~ +** Processing line: ~ bfs.frontier = []~ +** Processing line: ~ bfs.path = []~ +** Processing line: ~ heuristic.came_from = {}~ +** Processing line: ~ heuristic.frontier = []~ +** Processing line: ~ heuristic.path = []~ +** Processing line: ~~ +** Processing line: ~ # Move the searches forward to the current step~ +** Processing line: ~ state.current_step.times { move_searches_one_step_forward }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def move_searches_one_step_forward~ +** Processing line: ~ bfs_one_step_forward~ +** Processing line: ~ heuristic_one_step_forward~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def bfs_one_step_forward~ +** Processing line: ~ return if bfs.came_from.has_key?(grid.target)~ +** Processing line: ~~ +** Processing line: ~ # Only runs at the beginning of the search as setup.~ +** Processing line: ~ if bfs.came_from.empty?~ +** Processing line: ~ bfs.frontier << grid.star~ +** Processing line: ~ bfs.came_from[grid.star] = nil~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # A step in the search~ +** Processing line: ~ unless bfs.frontier.empty?~ +** Processing line: ~ # Takes the next frontier cell~ +** Processing line: ~ new_frontier = bfs.frontier.shift~ +** Processing line: ~ # For each of its neighbors~ +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited~ +** Processing line: ~ bfs.frontier << neighbor~ +** Processing line: ~ bfs.came_from[neighbor] = new_frontier~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.player_bullets.reject! { |b| dead_bullets.include? b }~ -** Processing line: ~ args.state.enemies.reject! { |e| dead_enemies.include? e }~ +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ +** Processing line: ~ # Comment this line and let a path generate to see the difference~ +** Processing line: ~ bfs.frontier = bfs.frontier.sort_by {| cell | proximity_to_star(cell) }~ +** Processing line: ~~ +** Processing line: ~ # If the search found the target~ +** Processing line: ~ if bfs.came_from.has_key?(grid.target)~ +** Processing line: ~ # Calculate the path between the target and star~ +** Processing line: ~ bfs_calc_path~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Calculates the path between the target and star for the breadth first search~ +** Processing line: ~ # Only called when the breadth first search finds the target~ +** Processing line: ~ def bfs_calc_path~ +** Processing line: ~ # Start from the target~ +** Processing line: ~ endpoint = grid.target~ +** Processing line: ~ # And the cell it came from~ +** Processing line: ~ next_endpoint = bfs.came_from[endpoint]~ +** Processing line: ~ while endpoint and next_endpoint~ +** Processing line: ~ # Draw a path between these two cells and store it~ +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ +** Processing line: ~ bfs.path << path~ +** Processing line: ~ # And get the next pair of cells~ +** Processing line: ~ endpoint = next_endpoint~ +** Processing line: ~ next_endpoint = bfs.came_from[endpoint]~ +** Processing line: ~ # Continue till there are no more cells~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Moves the heuristic search forward one step~ +** Processing line: ~ # Can be called from tick while the animation is playing~ +** Processing line: ~ # Can also be called when recalculating the searches after the user edited the grid~ +** Processing line: ~ def heuristic_one_step_forward~ +** Processing line: ~ # Stop the search if the target has been found~ +** Processing line: ~ return if heuristic.came_from.has_key?(grid.target)~ +** Processing line: ~~ +** Processing line: ~ # If the search has not begun~ +** Processing line: ~ if heuristic.came_from.empty?~ +** Processing line: ~ # Setup the search to begin from the star~ +** Processing line: ~ heuristic.frontier << grid.star~ +** Processing line: ~ heuristic.came_from[grid.star] = nil~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # One step in the heuristic search~ +** Processing line: ~~ +** Processing line: ~ # Unless there are no more cells to explore from~ +** Processing line: ~ unless heuristic.frontier.empty?~ +** Processing line: ~ # Get the next cell to explore from~ +** Processing line: ~ new_frontier = heuristic.frontier.shift~ +** Processing line: ~ # For each of its neighbors~ +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited~ +** Processing line: ~ heuristic.frontier << neighbor~ +** Processing line: ~ heuristic.came_from[neighbor] = new_frontier~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ dead = args.state.bullets.any? do |b|~ -** Processing line: ~ [args.state.player.x,~ -** Processing line: ~ args.state.player.y,~ -** Processing line: ~ args.state.player.w,~ -** Processing line: ~ args.state.player.h].intersect_rect? b.merge(y: current_y(b))~ +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ +** Processing line: ~ heuristic.frontier = heuristic.frontier.sort_by {| cell | proximity_to_star(cell) }~ +** Processing line: ~ # Sort the frontier so cells that are close to the target are then prioritized~ +** Processing line: ~ heuristic.frontier = heuristic.frontier.sort_by {| cell | heuristic_heuristic(cell) }~ +** Processing line: ~~ +** Processing line: ~ # If the search found the target~ +** Processing line: ~ if heuristic.came_from.has_key?(grid.target)~ +** Processing line: ~ # Calculate the path between the target and star~ +** Processing line: ~ heuristic_calc_path~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ return unless dead~ -** Processing line: ~ args.gtk.reset~ -** Processing line: ~ defaults args~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def calc args~ -** Processing line: ~ calc_stars args~ -** Processing line: ~ move_enemies args~ -** Processing line: ~ move_bullets args~ -** Processing line: ~ kill args~ -** Processing line: ~ end~ +** Processing line: ~ # Returns one-dimensional absolute distance between cell and target~ +** Processing line: ~ # Returns a number to compare distances between cells and the target~ +** Processing line: ~ def heuristic_heuristic(cell)~ +** Processing line: ~ (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def current_y entity~ -** Processing line: ~ entity[:starting_y] + (entity[:distance_to_travel] * entity[:created_at].ease(entity[:duration], :identity))~ -** Processing line: ~ end~ +** Processing line: ~ # Calculates the path between the target and star for the heuristic search~ +** Processing line: ~ # Only called when the heuristic search finds the target~ +** Processing line: ~ def heuristic_calc_path~ +** Processing line: ~ # Start from the target~ +** Processing line: ~ endpoint = grid.target~ +** Processing line: ~ # And the cell it came from~ +** Processing line: ~ next_endpoint = heuristic.came_from[endpoint]~ +** Processing line: ~ while endpoint and next_endpoint~ +** Processing line: ~ # Draw a path between these two cells and store it~ +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ +** Processing line: ~ heuristic.path << path~ +** Processing line: ~ # And get the next pair of cells~ +** Processing line: ~ endpoint = next_endpoint~ +** Processing line: ~ next_endpoint = heuristic.came_from[endpoint]~ +** Processing line: ~ # Continue till there are no more cells~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def render args~ -** Processing line: ~ args.outputs.solids << args.state.stars.map do |s|~ -** Processing line: ~ [s[:x],~ -** Processing line: ~ current_y(s),~ -** Processing line: ~ s[:w], s[:h], 0, s[:g], s[:b], s[:max_alpha] * s[:created_at].ease(20, :identity)]~ +** Processing line: ~ # Returns a list of adjacent cells~ +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ +** Processing line: ~ def adjacent_neighbors(cell)~ +** Processing line: ~ neighbors = []~ +** Processing line: ~~ +** Processing line: ~ # Gets all the valid neighbors into the array~ +** Processing line: ~ # From southern neighbor, clockwise~ +** Processing line: ~ neighbors << [cell.x , cell.y - 1] unless cell.y == 0~ +** Processing line: ~ neighbors << [cell.x - 1, cell.y ] unless cell.x == 0~ +** Processing line: ~ neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1~ +** Processing line: ~ neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1~ +** Processing line: ~~ +** Processing line: ~ neighbors~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.borders << args.state.enemies.map do |s|~ -** Processing line: ~ [s[:x],~ -** Processing line: ~ current_y(s),~ -** Processing line: ~ s[:w], s[:h], 255, 0, 0]~ +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ +** Processing line: ~ # and returns the larger value~ +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ +** Processing line: ~ # A cell that is [5, 5] from the star,~ +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ +** Processing line: ~ def proximity_to_star(cell)~ +** Processing line: ~ distance_x = (grid.star.x - cell.x).abs~ +** Processing line: ~ distance_y = (grid.star.y - cell.y).abs~ +** Processing line: ~~ +** Processing line: ~ if distance_x > distance_y~ +** Processing line: ~ return distance_x~ +** Processing line: ~ else~ +** Processing line: ~ return distance_y~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.borders << args.state.bullets.map do |b|~ -** Processing line: ~ [b[:x],~ -** Processing line: ~ current_y(b),~ -** Processing line: ~ b[:w], b[:h], 255, 0, 0]~ +** Processing line: ~ # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored.~ +** Processing line: ~ def grid~ +** Processing line: ~ state.grid~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.outputs.borders << args.state.player_bullets.map do |b|~ -** Processing line: ~ [b[:x],~ -** Processing line: ~ current_y(b),~ -** Processing line: ~ b[:w], b[:h], 255, 255, 255]~ +** Processing line: ~ def buttons~ +** Processing line: ~ state.buttons~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.borders << [args.state.player.x,~ -** Processing line: ~ args.state.player.y,~ -** Processing line: ~ args.state.player.w,~ -** Processing line: ~ args.state.player.h, 255, 255, 255]~ -** Processing line: ~ end~ +** Processing line: ~ def slider~ +** Processing line: ~ state.slider~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def bfs~ +** Processing line: ~ state.bfs~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def heuristic~ +** Processing line: ~ state.heuristic~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Descriptive aliases for colors~ +** Processing line: ~ def default_color~ +** Processing line: ~ [221, 212, 213] # Light Brown~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def wall_color~ +** Processing line: ~ [134, 134, 120] # Camo Green~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def visited_color~ +** Processing line: ~ [204, 191, 179] # Dark Brown~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def frontier_color~ +** Processing line: ~ [103, 136, 204] # Blue~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def path_color~ +** Processing line: ~ [231, 230, 228] # Pastel White~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def button_color~ +** Processing line: ~ [190, 190, 190] # Gray~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ # Method that is called by DragonRuby periodically~ +** Processing line: ~ # Used for updating animations and calculations~ ** Processing line: ~ def tick args~ -** Processing line: ~ defaults args~ -** Processing line: ~ input args~ -** Processing line: ~ calc args~ -** Processing line: ~ render args~ +** Processing line: ~~ +** Processing line: ~ # Pressing r will reset the application~ +** Processing line: ~ if args.inputs.keyboard.key_down.r~ +** Processing line: ~ args.gtk.reset~ +** Processing line: ~ reset~ +** Processing line: ~ return~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ +** Processing line: ~ $heuristic_with_walls ||= Heuristic_With_Walls.new(args)~ +** Processing line: ~ $heuristic_with_walls.args = args~ +** Processing line: ~ $heuristic_with_walls.tick~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ def reset~ +** Processing line: ~ $heuristic_with_walls = nil~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Performance - Sprites As Hash - main.rb~ -- H1 detected. +** Processing line: ~*** Path Finding Algorithms - Heuristic With Walls - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Performance - Sprites As Hash - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Path Finding Algorithms - Heuristic With Walls - 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: ~Path Finding Algorithms - Heuristic With Walls - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ ** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ # ./samples/09_performance/01_sprites_as_hash/app/main.rb~ +** Processing line: ~ # ./samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb~ +** Processing line: ~ # This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ +** Processing line: ~ # The effectiveness of the Heuristic search algorithm is shown through this demonstration.~ +** Processing line: ~ # Notice that both searches find the shortest path~ +** Processing line: ~ # The heuristic search, however, explores less of the grid, and is therefore faster.~ +** Processing line: ~ # The heuristic search prioritizes searching cells that are closer to the target.~ +** Processing line: ~ # Make sure to look at the Heuristic with walls program to see some of the downsides of the heuristic algorithm.~ +** Processing line: ~~ +** Processing line: ~ class Heuristic~ +** Processing line: ~ attr_gtk~ ** Processing line: ~~ -** Processing line: ~ # Sprites represented as Hashes using the queue ~args.outputs.sprites~~ -** Processing line: ~ # code up, but are the "slowest" to render.~ -** Processing line: ~ # The reason for this is the access of the key in the Hash and also~ -** Processing line: ~ # because the data args.outputs.sprites is cleared every tick.~ -** Processing line: ~ def random_x args~ -** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ -** Processing line: ~ end~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ render~ +** Processing line: ~ input~ +** Processing line: ~ # If animation is playing, and max steps have not been reached~ +** Processing line: ~ # Move the search a step forward~ +** Processing line: ~ if state.play && state.current_step < state.max_steps~ +** Processing line: ~ # Variable that tells the program what step to recalculate up to~ +** Processing line: ~ state.current_step += 1~ +** Processing line: ~ move_searches_one_step_forward~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def random_y args~ -** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ -** Processing line: ~ end~ +** Processing line: ~ def defaults~ +** Processing line: ~ # Variables to edit the size and appearance of the grid~ +** Processing line: ~ # Freely customizable to user's liking~ +** Processing line: ~ grid.width ||= 15~ +** Processing line: ~ grid.height ||= 15~ +** Processing line: ~ grid.cell_size ||= 40~ +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ +** Processing line: ~~ +** Processing line: ~ grid.star ||= [0, 2]~ +** Processing line: ~ grid.target ||= [14, 12]~ +** Processing line: ~ grid.walls ||= {~ +** Processing line: ~ [2, 2] => true,~ +** Processing line: ~ [3, 2] => true,~ +** Processing line: ~ [4, 2] => true,~ +** Processing line: ~ [5, 2] => true,~ +** Processing line: ~ [6, 2] => true,~ +** Processing line: ~ [7, 2] => true,~ +** Processing line: ~ [8, 2] => true,~ +** Processing line: ~ [9, 2] => true,~ +** Processing line: ~ [10, 2] => true,~ +** Processing line: ~ [11, 2] => true,~ +** Processing line: ~ [12, 2] => true,~ +** Processing line: ~ [12, 3] => true,~ +** Processing line: ~ [12, 4] => true,~ +** Processing line: ~ [12, 5] => true,~ +** Processing line: ~ [12, 6] => true,~ +** Processing line: ~ [12, 7] => true,~ +** Processing line: ~ [12, 8] => true,~ +** Processing line: ~ [12, 9] => true,~ +** Processing line: ~ [12, 10] => true,~ +** Processing line: ~ [12, 11] => true,~ +** Processing line: ~ [12, 12] => true,~ +** Processing line: ~ [2, 12] => true,~ +** Processing line: ~ [3, 12] => true,~ +** Processing line: ~ [4, 12] => true,~ +** Processing line: ~ [5, 12] => true,~ +** Processing line: ~ [6, 12] => true,~ +** Processing line: ~ [7, 12] => true,~ +** Processing line: ~ [8, 12] => true,~ +** Processing line: ~ [9, 12] => true,~ +** Processing line: ~ [10, 12] => true,~ +** Processing line: ~ [11, 12] => true,~ +** Processing line: ~ [12, 12] => true~ +** Processing line: ~ }~ +** Processing line: ~ # There are no hills in the Heuristic Search Demo~ +** Processing line: ~~ +** Processing line: ~ # What the user is currently editing on the grid~ +** Processing line: ~ # We store this value, because we want to remember the value even when~ +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ +** Processing line: ~ # they are still clicking down on the mouse.~ +** Processing line: ~ state.user_input ||= :none~ +** Processing line: ~~ +** Processing line: ~ # These variables allow the breadth first search to take place~ +** Processing line: ~ # 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.~ +** Processing line: ~ # Used to prevent searching cells that have already been found~ +** Processing line: ~ # and to trace a path from the target back to the starting point.~ +** Processing line: ~ # Frontier is an array of cells to expand the search from.~ +** Processing line: ~ # The search is over when there are no more cells to search from.~ +** Processing line: ~ # Path stores the path from the target to the star, once the target has been found~ +** Processing line: ~ # It prevents calculating the path every tick.~ +** Processing line: ~ bfs.came_from ||= {}~ +** Processing line: ~ bfs.frontier ||= []~ +** Processing line: ~ bfs.path ||= []~ +** Processing line: ~~ +** Processing line: ~ heuristic.came_from ||= {}~ +** Processing line: ~ heuristic.frontier ||= []~ +** Processing line: ~ heuristic.path ||= []~ +** Processing line: ~~ +** Processing line: ~ # Stores which step of the animation is being rendered~ +** Processing line: ~ # When the user moves the star or messes with the walls,~ +** Processing line: ~ # the searches are recalculated up to this step~ +** Processing line: ~~ +** Processing line: ~ # Unless the current step has a value~ +** Processing line: ~ unless state.current_step~ +** Processing line: ~ # Set the current step to 10~ +** Processing line: ~ state.current_step = 10~ +** Processing line: ~ # And calculate the searches up to step 10~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # At some step the animation will end,~ +** Processing line: ~ # and further steps won't change anything (the whole grid will be explored)~ +** Processing line: ~ # This step is roughly the grid's width * height~ +** Processing line: ~ # When anim_steps equals max_steps no more calculations will occur~ +** Processing line: ~ # and the slider will be at the end~ +** Processing line: ~ state.max_steps = grid.width * grid.height~ +** Processing line: ~~ +** Processing line: ~ # Whether the animation should play or not~ +** Processing line: ~ # If true, every tick moves anim_steps forward one~ +** Processing line: ~ # Pressing the stepwise animation buttons will pause the animation~ +** Processing line: ~ # An if statement instead of the ||= operator is used for assigning a boolean value.~ +** Processing line: ~ # The || operator does not differentiate between nil and false.~ +** Processing line: ~ if state.play == nil~ +** Processing line: ~ state.play = false~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Store the rects of the buttons that control the animation~ +** Processing line: ~ # They are here for user customization~ +** Processing line: ~ # Editing these might require recentering the text inside them~ +** Processing line: ~ # Those values can be found in the render_button methods~ +** Processing line: ~ buttons.left = [470, 600, 50, 50]~ +** Processing line: ~ buttons.center = [520, 600, 200, 50]~ +** Processing line: ~ buttons.right = [720, 600, 50, 50]~ +** Processing line: ~~ +** Processing line: ~ # The variables below are related to the slider~ +** Processing line: ~ # They allow the user to customize them~ +** Processing line: ~ # They also give a central location for the render and input methods to get~ +** Processing line: ~ # information from~ +** Processing line: ~ # x & y are the coordinates of the leftmost part of the slider line~ +** Processing line: ~ slider.x = 440~ +** Processing line: ~ slider.y = 675~ +** Processing line: ~ # This is the width of the line~ +** Processing line: ~ slider.w = 360~ +** Processing line: ~ # This is the offset for the circle~ +** Processing line: ~ # Allows the center of the circle to be on the line,~ +** Processing line: ~ # as opposed to the upper right corner~ +** Processing line: ~ slider.offset = 20~ +** Processing line: ~ # This is the spacing between each of the notches on the slider~ +** Processing line: ~ # Notches are places where the circle can rest on the slider line~ +** Processing line: ~ # There needs to be a notch for each step before the maximum number of steps~ +** Processing line: ~ slider.spacing = slider.w.to_f / state.max_steps.to_f~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # All methods with render draw stuff on the screen~ +** Processing line: ~ # UI has buttons, the slider, and labels~ +** Processing line: ~ # The search specific rendering occurs in the respective methods~ +** Processing line: ~ def render~ +** Processing line: ~ render_ui~ +** Processing line: ~ render_bfs~ +** Processing line: ~ render_heuristic~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def random_speed~ -** Processing line: ~ 1 + (4.randomize :ratio)~ -** Processing line: ~ end~ +** Processing line: ~ def render_ui~ +** Processing line: ~ render_buttons~ +** Processing line: ~ render_slider~ +** Processing line: ~ render_labels~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def new_star args~ -** Processing line: ~ {~ -** Processing line: ~ x: (random_x args),~ -** Processing line: ~ y: (random_y args),~ -** Processing line: ~ w: 4, h: 4, path: 'sprites/tiny-star.png',~ -** Processing line: ~ s: random_speed~ -** Processing line: ~ }~ -** Processing line: ~ end~ +** Processing line: ~ def render_buttons~ +** Processing line: ~ render_left_button~ +** Processing line: ~ render_center_button~ +** Processing line: ~ render_right_button~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def move_star args, star~ -** Processing line: ~ star.x += star[:s]~ -** Processing line: ~ star.y += star[:s]~ -** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ -** Processing line: ~ star.x = (random_x args)~ -** Processing line: ~ star.y = (random_y args)~ -** Processing line: ~ star[:s] = random_speed~ +** Processing line: ~ def render_bfs~ +** Processing line: ~ render_bfs_grid~ +** Processing line: ~ render_bfs_star~ +** Processing line: ~ render_bfs_target~ +** Processing line: ~ render_bfs_visited~ +** Processing line: ~ render_bfs_walls~ +** Processing line: ~ render_bfs_frontier~ +** Processing line: ~ render_bfs_path~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.star_count ||= 0~ +** Processing line: ~ def render_heuristic~ +** Processing line: ~ render_heuristic_grid~ +** Processing line: ~ render_heuristic_star~ +** Processing line: ~ render_heuristic_target~ +** Processing line: ~ render_heuristic_visited~ +** Processing line: ~ render_heuristic_walls~ +** Processing line: ~ render_heuristic_frontier~ +** Processing line: ~ render_heuristic_path~ +** Processing line: ~ end~ ** 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: ~ args.gtk.console.set_command "reset_with count: 100"~ +** Processing line: ~ # This method handles user input every tick~ +** Processing line: ~ def input~ +** Processing line: ~ # Check and handle button input~ +** Processing line: ~ input_buttons~ +** Processing line: ~~ +** Processing line: ~ # If the mouse was lifted this tick~ +** Processing line: ~ if inputs.mouse.up~ +** Processing line: ~ # Set current input to none~ +** Processing line: ~ state.user_input = :none~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # If the mouse was clicked this tick~ +** Processing line: ~ if inputs.mouse.down~ +** Processing line: ~ # Determine what the user is editing and appropriately edit the state.user_input variable~ +** Processing line: ~ determine_input~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Process user input based on user_input variable and current mouse position~ +** Processing line: ~ process_input~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # init~ -** Processing line: ~ if args.state.tick_count == 0~ -** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ +** Processing line: ~ # Determines what the user is editing~ +** Processing line: ~ # This method is called when the mouse is clicked down~ +** Processing line: ~ def determine_input~ +** Processing line: ~ if mouse_over_slider?~ +** Processing line: ~ state.user_input = :slider~ +** Processing line: ~ # If the mouse is over the star in the first grid~ +** Processing line: ~ elsif bfs_mouse_over_star?~ +** Processing line: ~ # The user is editing the star from the first grid~ +** Processing line: ~ state.user_input = :bfs_star~ +** Processing line: ~ # If the mouse is over the star in the second grid~ +** Processing line: ~ elsif heuristic_mouse_over_star?~ +** Processing line: ~ # The user is editing the star from the second grid~ +** Processing line: ~ state.user_input = :heuristic_star~ +** Processing line: ~ # If the mouse is over the target in the first grid~ +** Processing line: ~ elsif bfs_mouse_over_target?~ +** Processing line: ~ # The user is editing the target from the first grid~ +** Processing line: ~ state.user_input = :bfs_target~ +** Processing line: ~ # If the mouse is over the target in the second grid~ +** Processing line: ~ elsif heuristic_mouse_over_target?~ +** Processing line: ~ # The user is editing the target from the second grid~ +** Processing line: ~ state.user_input = :heuristic_target~ +** Processing line: ~ # If the mouse is over a wall in the first grid~ +** Processing line: ~ elsif bfs_mouse_over_wall?~ +** Processing line: ~ # The user is removing a wall from the first grid~ +** Processing line: ~ state.user_input = :bfs_remove_wall~ +** Processing line: ~ # If the mouse is over a wall in the second grid~ +** Processing line: ~ elsif heuristic_mouse_over_wall?~ +** Processing line: ~ # The user is removing a wall from the second grid~ +** Processing line: ~ state.user_input = :heuristic_remove_wall~ +** Processing line: ~ # If the mouse is over the first grid~ +** Processing line: ~ elsif bfs_mouse_over_grid?~ +** Processing line: ~ # The user is adding a wall from the first grid~ +** Processing line: ~ state.user_input = :bfs_add_wall~ +** Processing line: ~ # If the mouse is over the second grid~ +** Processing line: ~ elsif heuristic_mouse_over_grid?~ +** Processing line: ~ # The user is adding a wall from the second grid~ +** Processing line: ~ state.user_input = :heuristic_add_wall~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ +** Processing line: ~ def process_input~ +** Processing line: ~ if state.user_input == :slider~ +** Processing line: ~ process_input_slider~ +** Processing line: ~ elsif state.user_input == :bfs_star~ +** Processing line: ~ process_input_bfs_star~ +** Processing line: ~ elsif state.user_input == :heuristic_star~ +** Processing line: ~ process_input_heuristic_star~ +** Processing line: ~ elsif state.user_input == :bfs_target~ +** Processing line: ~ process_input_bfs_target~ +** Processing line: ~ elsif state.user_input == :heuristic_target~ +** Processing line: ~ process_input_heuristic_target~ +** Processing line: ~ elsif state.user_input == :bfs_remove_wall~ +** Processing line: ~ process_input_bfs_remove_wall~ +** Processing line: ~ elsif state.user_input == :heuristic_remove_wall~ +** Processing line: ~ process_input_heuristic_remove_wall~ +** Processing line: ~ elsif state.user_input == :bfs_add_wall~ +** Processing line: ~ process_input_bfs_add_wall~ +** Processing line: ~ elsif state.user_input == :heuristic_add_wall~ +** Processing line: ~ process_input_heuristic_add_wall~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # update~ -** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ +** Processing line: ~ def render_slider~ +** Processing line: ~ # Using primitives hides the line under the white circle of the slider~ +** Processing line: ~ # Draws the line~ +** Processing line: ~ outputs.primitives << [slider.x, slider.y, slider.x + slider.w, slider.y].line~ +** Processing line: ~ # The circle needs to be offset so that the center of the circle~ +** Processing line: ~ # overlaps the line instead of the upper right corner of the circle~ +** Processing line: ~ # The circle's x value is also moved based on the current seach step~ +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing)~ +** Processing line: ~ circle_y = (slider.y - slider.offset)~ +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ +** Processing line: ~ outputs.primitives << [circle_rect, 'circle-white.png'].sprite~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # render~ -** Processing line: ~ args.outputs.sprites << args.state.stars~ -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ -** Processing line: ~ end~ +** Processing line: ~ def render_labels~ +** Processing line: ~ outputs.labels << [205, 625, "Breadth First Search"]~ +** Processing line: ~ outputs.labels << [820, 625, "Heuristic Best-First Search"]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # resets game, and assigns star count given by user~ -** Processing line: ~ def reset_with count: count~ -** Processing line: ~ $gtk.reset~ -** Processing line: ~ $gtk.args.state.star_count = count~ -** Processing line: ~ end~ +** Processing line: ~ def render_left_button~ +** Processing line: ~ # Draws the button_color button, and a black border~ +** Processing line: ~ # The border separates the buttons visually~ +** Processing line: ~ outputs.solids << [buttons.left, button_color]~ +** Processing line: ~ outputs.borders << [buttons.left]~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Renders an explanatory label in the center of the button~ +** Processing line: ~ # Explains to the user what the button does~ +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ +** Processing line: ~ # to keep the label in the center of the button~ +** Processing line: ~ label_x = buttons.left.x + 20~ +** Processing line: ~ label_y = buttons.left.y + 35~ +** Processing line: ~ outputs.labels << [label_x, label_y, "<"]~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def render_center_button~ +** Processing line: ~ # Draws the button_color button, and a black border~ +** Processing line: ~ # The border separates the buttons visually~ +** Processing line: ~ outputs.solids << [buttons.center, button_color]~ +** Processing line: ~ outputs.borders << [buttons.center]~ ** Processing line: ~~ -** Processing line: ~* Performance - Sprites As Entities - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Performance - Sprites As Entities - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Renders an explanatory label in the center of the button~ +** Processing line: ~ # Explains to the user what the button does~ +** Processing line: ~ # If the button size is changed, the label might need to be edited as well~ +** Processing line: ~ # to keep the label in the center of the button~ +** Processing line: ~ label_x = buttons.center.x + 37~ +** Processing line: ~ label_y = buttons.center.y + 35~ +** Processing line: ~ label_text = state.play ? "Pause Animation" : "Play Animation"~ +** Processing line: ~ outputs.labels << [label_x, label_y, label_text]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/09_performance/02_sprites_as_entities/app/main.rb~ -** Processing line: ~ # Sprites represented as Entities using the queue ~args.outputs.sprites~~ -** Processing line: ~ # yields nicer access apis over Hashes, but require a bit more code upfront.~ -** Processing line: ~ # The hash sample has to use star[:s] to get the speed of the star, but~ -** Processing line: ~ # an entity can use .s instead.~ -** Processing line: ~ def random_x args~ -** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ -** Processing line: ~ end~ +** Processing line: ~ def render_right_button~ +** Processing line: ~ # Draws the button_color button, and a black border~ +** Processing line: ~ # The border separates the buttons visually~ +** Processing line: ~ outputs.solids << [buttons.right, button_color]~ +** Processing line: ~ outputs.borders << [buttons.right]~ ** Processing line: ~~ -** Processing line: ~ def random_y args~ -** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ -** Processing line: ~ end~ +** Processing line: ~ # Renders an explanatory label in the center of the button~ +** Processing line: ~ # Explains to the user what the button does~ +** Processing line: ~ label_x = buttons.right.x + 20~ +** Processing line: ~ label_y = buttons.right.y + 35~ +** Processing line: ~ outputs.labels << [label_x, label_y, ">"]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def random_speed~ -** Processing line: ~ 1 + (4.randomize :ratio)~ -** Processing line: ~ end~ +** Processing line: ~ def render_bfs_grid~ +** Processing line: ~ # A large rect the size of the grid~ +** Processing line: ~ outputs.solids << [bfs_scale_up(grid.rect), default_color]~ ** Processing line: ~~ -** Processing line: ~ def new_star args~ -** Processing line: ~ args.state.new_entity :star, {~ -** Processing line: ~ x: (random_x args),~ -** Processing line: ~ y: (random_y args),~ -** Processing line: ~ w: 4, h: 4,~ -** Processing line: ~ path: 'sprites/tiny-star.png',~ -** Processing line: ~ s: random_speed~ -** Processing line: ~ }~ -** Processing line: ~ end~ +** Processing line: ~ # The vertical grid lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << bfs_vertical_line(x)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def move_star args, star~ -** Processing line: ~ star.x += star.s~ -** Processing line: ~ star.y += star.s~ -** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ -** Processing line: ~ star.x = (random_x args)~ -** Processing line: ~ star.y = (random_y args)~ -** Processing line: ~ star.s = random_speed~ +** Processing line: ~ # The horizontal grid lines~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << bfs_horizontal_line(y)~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.star_count ||= 0~ +** Processing line: ~ def render_heuristic_grid~ +** Processing line: ~ # A large rect the size of the grid~ +** Processing line: ~ outputs.solids << [heuristic_scale_up(grid.rect), default_color]~ ** 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: ~ args.gtk.console.set_command "reset_with count: 100"~ +** Processing line: ~ # The vertical grid lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << heuristic_vertical_line(x)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # The horizontal grid lines~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << heuristic_horizontal_line(y)~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # init~ -** Processing line: ~ if args.state.tick_count == 0~ -** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ +** Processing line: ~ # Returns a vertical line for a column of the first grid~ +** Processing line: ~ def bfs_vertical_line column~ +** Processing line: ~ bfs_scale_up([column, 0, column, grid.height])~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # update~ -** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ +** Processing line: ~ # Returns a horizontal line for a column of the first grid~ +** Processing line: ~ def bfs_horizontal_line row~ +** Processing line: ~ bfs_scale_up([0, row, grid.width, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # render~ -** Processing line: ~ args.outputs.sprites << args.state.stars~ -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ -** Processing line: ~ end~ +** Processing line: ~ # Returns a vertical line for a column of the second grid~ +** Processing line: ~ def heuristic_vertical_line column~ +** Processing line: ~ bfs_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # resets game, and assigns star count given by user~ -** Processing line: ~ def reset_with count: count~ -** Processing line: ~ $gtk.reset~ -** Processing line: ~ $gtk.args.state.star_count = count~ -** Processing line: ~ end~ +** Processing line: ~ # Returns a horizontal line for a column of the second grid~ +** Processing line: ~ def heuristic_horizontal_line row~ +** Processing line: ~ bfs_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Renders the star on the first grid~ +** Processing line: ~ def render_bfs_star~ +** Processing line: ~ outputs.sprites << [bfs_scale_up(grid.star), 'star.png']~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Renders the star on the second grid~ +** Processing line: ~ def render_heuristic_star~ +** Processing line: ~ outputs.sprites << [heuristic_scale_up(grid.star), 'star.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Performance - Sprites As Strict Entities - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Performance - Sprites As Strict Entities - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Renders the target on the first grid~ +** Processing line: ~ def render_bfs_target~ +** Processing line: ~ outputs.sprites << [bfs_scale_up(grid.target), 'target.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb~ -** Processing line: ~ # Sprites represented as StrictEntities using the queue ~args.outputs.sprites~~ -** Processing line: ~ # yields apis access similar to Entities, but all properties that can be set on the~ -** Processing line: ~ # entity must be predefined with a default value. Strict entities do not support the~ -** Processing line: ~ # addition of new properties after the fact. They are more performant than OpenEntities~ -** Processing line: ~ # because of this constraint.~ -** Processing line: ~ def random_x args~ -** Processing line: ~ (args.grid.w.randomize :ratio) * -1~ -** Processing line: ~ end~ +** Processing line: ~ # Renders the target on the second grid~ +** Processing line: ~ def render_heuristic_target~ +** Processing line: ~ outputs.sprites << [heuristic_scale_up(grid.target), 'target.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def random_y args~ -** Processing line: ~ (args.grid.h.randomize :ratio) * -1~ -** Processing line: ~ end~ +** Processing line: ~ # Renders the walls on the first grid~ +** Processing line: ~ def render_bfs_walls~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ outputs.solids << [bfs_scale_up(wall), wall_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def random_speed~ -** Processing line: ~ 1 + (4.randomize :ratio)~ -** Processing line: ~ end~ +** Processing line: ~ # Renders the walls on the second grid~ +** Processing line: ~ def render_heuristic_walls~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ outputs.solids << [heuristic_scale_up(wall), wall_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def new_star args~ -** Processing line: ~ args.state.new_entity_strict(:star,~ -** Processing line: ~ x: (random_x args),~ -** Processing line: ~ y: (random_y args),~ -** Processing line: ~ w: 4, h: 4,~ -** Processing line: ~ path: 'sprites/tiny-star.png',~ -** Processing line: ~ s: random_speed) do |entity|~ -** Processing line: ~ # invoke attr_sprite so that it responds to~ -** Processing line: ~ # all properties that are required to render a sprite~ -** Processing line: ~ entity.attr_sprite~ +** Processing line: ~ # Renders the visited cells on the first grid~ +** Processing line: ~ def render_bfs_visited~ +** Processing line: ~ bfs.came_from.each_key do | visited_cell |~ +** Processing line: ~ outputs.solids << [bfs_scale_up(visited_cell), visited_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def move_star args, star~ -** Processing line: ~ star.x += star.s~ -** Processing line: ~ star.y += star.s~ -** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~ -** Processing line: ~ star.x = (random_x args)~ -** Processing line: ~ star.y = (random_y args)~ -** Processing line: ~ star.s = random_speed~ +** Processing line: ~ # Renders the visited cells on the second grid~ +** Processing line: ~ def render_heuristic_visited~ +** Processing line: ~ heuristic.came_from.each_key do | visited_cell |~ +** Processing line: ~ outputs.solids << [heuristic_scale_up(visited_cell), visited_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.star_count ||= 0~ +** Processing line: ~ # Renders the frontier cells on the first grid~ +** Processing line: ~ def render_bfs_frontier~ +** Processing line: ~ bfs.frontier.each do | frontier_cell |~ +** Processing line: ~ outputs.solids << [bfs_scale_up(frontier_cell), frontier_color, 200]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** 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: ~ args.gtk.console.set_command "reset_with count: 100"~ +** Processing line: ~ # Renders the frontier cells on the second grid~ +** Processing line: ~ def render_heuristic_frontier~ +** Processing line: ~ heuristic.frontier.each do | frontier_cell |~ +** Processing line: ~ outputs.solids << [heuristic_scale_up(frontier_cell), frontier_color, 200]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # init~ -** Processing line: ~ if args.state.tick_count == 0~ -** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~ +** Processing line: ~ # Renders the path found by the breadth first search on the first grid~ +** Processing line: ~ def render_bfs_path~ +** Processing line: ~ bfs.path.each do | path |~ +** Processing line: ~ outputs.solids << [bfs_scale_up(path), path_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # update~ -** Processing line: ~ args.state.stars.each { |s| move_star args, s }~ +** Processing line: ~ # Renders the path found by the heuristic search on the second grid~ +** Processing line: ~ def render_heuristic_path~ +** Processing line: ~ heuristic.path.each do | path |~ +** Processing line: ~ outputs.solids << [heuristic_scale_up(path), path_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # render~ -** Processing line: ~ args.outputs.sprites << args.state.stars~ -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ -** Processing line: ~ end~ +** Processing line: ~ # Returns the rect for the path between two cells based on their relative positions~ +** Processing line: ~ def get_path_between(cell_one, cell_two)~ +** Processing line: ~ path = []~ ** Processing line: ~~ -** Processing line: ~ # resets game, and assigns star count given by user~ -** Processing line: ~ def reset_with count: count~ -** Processing line: ~ $gtk.reset~ -** Processing line: ~ $gtk.args.state.star_count = count~ -** Processing line: ~ end~ +** Processing line: ~ # If cell one is above cell two~ +** Processing line: ~ if cell_one.x == cell_two.x and cell_one.y > cell_two.y~ +** Processing line: ~ # Path starts from the center of cell two and moves upward to the center of cell one~ +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4]~ +** Processing line: ~ # If cell one is below cell two~ +** Processing line: ~ elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y~ +** Processing line: ~ # Path starts from the center of cell one and moves upward to the center of cell two~ +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4]~ +** Processing line: ~ # If cell one is to the left of cell two~ +** Processing line: ~ elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y~ +** Processing line: ~ # Path starts from the center of cell two and moves rightward to the center of cell one~ +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4]~ +** Processing line: ~ # If cell one is to the right of cell two~ +** Processing line: ~ elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y~ +** Processing line: ~ # Path starts from the center of cell one and moves rightward to the center of cell two~ +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ path~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ +** Processing line: ~ # This method is used to scale up cells, and lines~ +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ +** Processing line: ~ # This method scales up cells for the first grid~ +** Processing line: ~ def bfs_scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ ** Processing line: ~~ -** Processing line: ~* Performance - Sprites As Classes - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Performance - Sprites As Classes - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # If cell is just an x and y coordinate~ +** Processing line: ~ if cell.size == 2~ +** Processing line: ~ # Add a width and height of 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/09_performance/04_sprites_as_classes/app/main.rb~ -** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.sprites~.~ -** Processing line: ~ # gives you full control of property declaration and method invocation.~ -** Processing line: ~ # They are more performant than OpenEntities and StrictEntities, but more code upfront.~ -** Processing line: ~ class Star~ -** Processing line: ~ attr_sprite~ +** Processing line: ~ # Scale all the values up~ +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ ** Processing line: ~~ -** Processing line: ~ def initialize grid~ -** Processing line: ~ @grid = grid~ -** Processing line: ~ @x = (rand @grid.w) * -1~ -** Processing line: ~ @y = (rand @grid.h) * -1~ -** Processing line: ~ @w = 4~ -** Processing line: ~ @h = 4~ -** Processing line: ~ @s = 1 + (4.randomize :ratio)~ -** Processing line: ~ @path = 'sprites/tiny-star.png'~ +** Processing line: ~ # Returns the scaled up cell~ +** Processing line: ~ cell~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def move~ -** Processing line: ~ @x += @s~ -** Processing line: ~ @y += @s~ -** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ -** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ +** Processing line: ~ # Translates the given cell grid.width + 1 to the right and then scales up~ +** Processing line: ~ # Used to draw cells for the second grid~ +** Processing line: ~ # This method does not work for lines,~ +** Processing line: ~ # so separate methods exist for the grid lines~ +** Processing line: ~ def heuristic_scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ +** Processing line: ~ # Translates the cell to the second grid equivalent~ +** Processing line: ~ cell.x += grid.width + 1~ +** Processing line: ~ # Proceeds as if scaling up for the first grid~ +** Processing line: ~ bfs_scale_up(cell)~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # calls methods needed for game to run properly~ -** 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: ~ args.gtk.console.set_command "reset_with count: 100"~ +** Processing line: ~ # Checks and handles input for the buttons~ +** Processing line: ~ # Called when the mouse is lifted~ +** Processing line: ~ def input_buttons~ +** Processing line: ~ input_left_button~ +** Processing line: ~ input_center_button~ +** Processing line: ~ input_right_button~ ** 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: ~ # Checks if the previous step button is clicked~ +** Processing line: ~ # If it is, it pauses the animation and moves the search one step backward~ +** Processing line: ~ def input_left_button~ +** Processing line: ~ if left_button_clicked?~ +** Processing line: ~ state.play = false~ +** Processing line: ~ state.current_step -= 1~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # update~ -** Processing line: ~ args.state.stars.each(&:move)~ +** Processing line: ~ # Controls the play/pause button~ +** Processing line: ~ # Inverses whether the animation is playing or not when clicked~ +** Processing line: ~ def input_center_button~ +** Processing line: ~ if center_button_clicked? || inputs.keyboard.key_down.space~ +** Processing line: ~ state.play = !state.play~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # render~ -** Processing line: ~ args.outputs.sprites << args.state.stars~ -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ -** Processing line: ~ end~ +** Processing line: ~ # Checks if the next step button is clicked~ +** Processing line: ~ # If it is, it pauses the animation and moves the search one step forward~ +** Processing line: ~ def input_right_button~ +** Processing line: ~ if right_button_clicked?~ +** Processing line: ~ state.play = false~ +** Processing line: ~ state.current_step += 1~ +** Processing line: ~ move_searches_one_step_forward~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # resets game, and assigns star count given by user~ -** Processing line: ~ def reset_with count: count~ -** Processing line: ~ $gtk.reset~ -** Processing line: ~ $gtk.args.state.star_count = count~ -** Processing line: ~ end~ +** Processing line: ~ # These methods detect when the buttons are clicked~ +** Processing line: ~ def left_button_clicked?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.left) && inputs.mouse.up~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def center_button_clicked?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.center) && inputs.mouse.up~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def right_button_clicked?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(buttons.right) && inputs.mouse.up~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Performance - Static Sprites As Classes - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Performance - Static Sprites As Classes - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/09_performance/05_static_sprites_as_classes/app/main.rb~ -** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.static_sprites~.~ -** Processing line: ~ # bypasses the queue behavior of ~args.outputs.sprites~. All instances are held~ -** Processing line: ~ # by reference. You get better performance, but you are mutating state of held objects~ -** Processing line: ~ # which is less functional/data oriented.~ -** Processing line: ~ class Star~ -** Processing line: ~ attr_sprite~ +** Processing line: ~ # Signal that the user is going to be moving the slider~ +** Processing line: ~ # Is the mouse over the circle of the slider?~ +** Processing line: ~ def mouse_over_slider?~ +** Processing line: ~ circle_x = (slider.x - slider.offset) + (state.current_step * slider.spacing)~ +** Processing line: ~ circle_y = (slider.y - slider.offset)~ +** Processing line: ~ circle_rect = [circle_x, circle_y, 37, 37]~ +** Processing line: ~ inputs.mouse.point.inside_rect?(circle_rect)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def initialize grid~ -** Processing line: ~ @grid = grid~ -** Processing line: ~ @x = (rand @grid.w) * -1~ -** Processing line: ~ @y = (rand @grid.h) * -1~ -** Processing line: ~ @w = 4~ -** Processing line: ~ @h = 4~ -** Processing line: ~ @s = 1 + (4.randomize :ratio)~ -** Processing line: ~ @path = 'sprites/tiny-star.png'~ +** Processing line: ~ # Signal that the user is going to be moving the star from the first grid~ +** Processing line: ~ def bfs_mouse_over_star?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.star))~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def move~ -** Processing line: ~ @x += @s~ -** Processing line: ~ @y += @s~ -** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ -** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ +** Processing line: ~ # Signal that the user is going to be moving the star from the second grid~ +** Processing line: ~ def heuristic_mouse_over_star?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.star))~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # calls methods needed for game to run properly~ -** 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: ~ args.gtk.console.set_command "reset_with count: 100"~ +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ +** Processing line: ~ def bfs_mouse_over_target?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.target))~ ** 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: ~ # Signal that the user is going to be moving the target from the second grid~ +** Processing line: ~ def heuristic_mouse_over_target?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.target))~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # update~ -** Processing line: ~ args.state.stars.each(&:move)~ +** Processing line: ~ # Signal that the user is going to be removing walls from the first grid~ +** Processing line: ~ def bfs_mouse_over_wall?~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(bfs_scale_up(wall))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # render~ -** Processing line: ~ args.outputs.sprites << args.state.stars~ -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ -** Processing line: ~ end~ +** Processing line: ~ false~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # resets game, and assigns star count given by user~ -** Processing line: ~ def reset_with count: count~ -** Processing line: ~ $gtk.reset~ -** Processing line: ~ $gtk.args.state.star_count = count~ -** Processing line: ~ end~ +** Processing line: ~ # Signal that the user is going to be removing walls from the second grid~ +** Processing line: ~ def heuristic_mouse_over_wall?~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(heuristic_scale_up(wall))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ false~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ +** Processing line: ~ def bfs_mouse_over_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(bfs_scale_up(grid.rect))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Performance - Static Sprites As Classes With Custom Drawing - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Performance - Static Sprites As Classes With Custom Drawing - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Signal that the user is going to be adding walls from the second grid~ +** Processing line: ~ def heuristic_mouse_over_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(heuristic_scale_up(grid.rect))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb~ -** Processing line: ~ # Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~.~ -** Processing line: ~ # is the fastest approach. This is comparable to what other game engines set as the default behavior.~ -** Processing line: ~ # There are tradeoffs for all this speed if the creation of a full blown class, and bypassing~ -** Processing line: ~ # functional/data-oriented practices.~ -** Processing line: ~ class Star~ -** Processing line: ~ def initialize grid~ -** Processing line: ~ @grid = grid~ -** Processing line: ~ @x = (rand @grid.w) * -1~ -** Processing line: ~ @y = (rand @grid.h) * -1~ -** Processing line: ~ @w = 4~ -** Processing line: ~ @h = 4~ -** Processing line: ~ @s = 1 + (4.randomize :ratio)~ -** Processing line: ~ @path = 'sprites/tiny-star.png'~ +** Processing line: ~ # This method is called when the user is editing the slider~ +** Processing line: ~ # It pauses the animation and moves the white circle to the closest integer point~ +** Processing line: ~ # on the slider~ +** Processing line: ~ # Changes the step of the search to be animated~ +** Processing line: ~ def process_input_slider~ +** Processing line: ~ state.play = false~ +** Processing line: ~ mouse_x = inputs.mouse.point.x~ +** Processing line: ~~ +** Processing line: ~ # Bounds the mouse_x to the closest x value on the slider line~ +** Processing line: ~ mouse_x = slider.x if mouse_x < slider.x~ +** Processing line: ~ mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w~ +** Processing line: ~~ +** Processing line: ~ # Sets the current search step to the one represented by the mouse x value~ +** Processing line: ~ # The slider's circle moves due to the render_slider method using anim_steps~ +** Processing line: ~ state.current_step = ((mouse_x - slider.x) / slider.spacing).to_i~ +** Processing line: ~~ +** Processing line: ~ recalculate_searches~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def move~ -** Processing line: ~ @x += @s~ -** Processing line: ~ @y += @s~ -** Processing line: ~ @x = (rand @grid.w) * -1 if @x > @grid.right~ -** Processing line: ~ @y = (rand @grid.h) * -1 if @y > @grid.top~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def process_input_bfs_star~ +** Processing line: ~ old_star = grid.star.clone~ +** Processing line: ~ unless bfs_cell_closest_to_mouse == grid.target~ +** Processing line: ~ grid.star = bfs_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_star == grid.star~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # if the object that is in args.outputs.sprites (or static_sprites)~ -** Processing line: ~ # respond_to? :draw_override, then the method is invoked giving you~ -** Processing line: ~ # access to the class used to draw to the canvas.~ -** Processing line: ~ def draw_override ffi_draw~ -** Processing line: ~ # first move then draw~ -** Processing line: ~ move~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the second grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def process_input_heuristic_star~ +** Processing line: ~ old_star = grid.star.clone~ +** Processing line: ~ unless heuristic_cell_closest_to_mouse == grid.target~ +** Processing line: ~ grid.star = heuristic_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_star == grid.star~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The argument order for ffi.draw_sprite is:~ -** Processing line: ~ # x, y, w, h, path~ -** Processing line: ~ ffi_draw.draw_sprite @x, @y, @w, @h, @path~ +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ +** Processing line: ~ # Only recalculate_searchess the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def process_input_bfs_target~ +** Processing line: ~ old_target = grid.target.clone~ +** Processing line: ~ unless bfs_cell_closest_to_mouse == grid.star~ +** Processing line: ~ grid.target = bfs_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_target == grid.target~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The argument order for ffi_draw.draw_sprite_2 is (pass in nil for default value):~ -** Processing line: ~ # x, y, w, h, path,~ -** Processing line: ~ # angle, alpha~ +** Processing line: ~ # Moves the target to the cell closest to the mouse in the second grid~ +** Processing line: ~ # Only recalculate_searchess the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def process_input_heuristic_target~ +** Processing line: ~ old_target = grid.target.clone~ +** Processing line: ~ unless heuristic_cell_closest_to_mouse == grid.star~ +** Processing line: ~ grid.target = heuristic_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_target == grid.target~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # The argument order for ffi_draw.draw_sprite_3 is:~ -** Processing line: ~ # x, y, w, h,~ -** Processing line: ~ # path,~ -** Processing line: ~ # angle,~ -** Processing line: ~ # alpha, red_saturation, green_saturation, blue_saturation~ -** 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: ~ # Removes walls in the first grid that are under the cursor~ +** Processing line: ~ def process_input_bfs_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if bfs_mouse_over_grid?~ +** Processing line: ~ if grid.walls.has_key?(bfs_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls.delete(bfs_cell_closest_to_mouse)~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # calls methods needed for game to run properly~ -** 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: ~ args.gtk.console.set_command "reset_with count: 100"~ +** Processing line: ~ # Removes walls in the second grid that are under the cursor~ +** Processing line: ~ def process_input_heuristic_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if heuristic_mouse_over_grid?~ +** Processing line: ~ if grid.walls.has_key?(heuristic_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls.delete(heuristic_cell_closest_to_mouse)~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ +** Processing line: ~ def process_input_bfs_add_wall~ +** Processing line: ~ if bfs_mouse_over_grid?~ +** Processing line: ~ unless grid.walls.has_key?(bfs_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls[bfs_cell_closest_to_mouse] = true~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** 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: ~ # Adds a wall in the second grid in the cell the mouse is over~ +** Processing line: ~ def process_input_heuristic_add_wall~ +** Processing line: ~ if heuristic_mouse_over_grid?~ +** Processing line: ~ unless grid.walls.has_key?(heuristic_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls[heuristic_cell_closest_to_mouse] = true~ +** Processing line: ~ recalculate_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # render framerate~ -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ -** Processing line: ~ end~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ +** Processing line: ~ def bfs_cell_closest_to_mouse~ +** Processing line: ~ # Closest cell to the mouse in the first grid~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Bound x and y to the grid~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse in the second grid helps with this~ +** Processing line: ~ def heuristic_cell_closest_to_mouse~ +** Processing line: ~ # Closest cell grid to the mouse in the second~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Translate the cell to the first grid~ +** Processing line: ~ x -= grid.width + 1~ +** Processing line: ~ # Bound x and y to the first grid~ +** Processing line: ~ x = 0 if x < 0~ +** Processing line: ~ y = 0 if y < 0~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def recalculate_searches~ +** Processing line: ~ # Reset the searches~ +** Processing line: ~ bfs.came_from = {}~ +** Processing line: ~ bfs.frontier = []~ +** Processing line: ~ bfs.path = []~ +** Processing line: ~ heuristic.came_from = {}~ +** Processing line: ~ heuristic.frontier = []~ +** Processing line: ~ heuristic.path = []~ +** Processing line: ~~ +** Processing line: ~ # Move the searches forward to the current step~ +** Processing line: ~ state.current_step.times { move_searches_one_step_forward }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def move_searches_one_step_forward~ +** Processing line: ~ bfs_one_step_forward~ +** Processing line: ~ heuristic_one_step_forward~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def bfs_one_step_forward~ +** Processing line: ~ return if bfs.came_from.has_key?(grid.target)~ +** Processing line: ~~ +** Processing line: ~ # Only runs at the beginning of the search as setup.~ +** Processing line: ~ if bfs.came_from.empty?~ +** Processing line: ~ bfs.frontier << grid.star~ +** Processing line: ~ bfs.came_from[grid.star] = nil~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # A step in the search~ +** Processing line: ~ unless bfs.frontier.empty?~ +** Processing line: ~ # Takes the next frontier cell~ +** Processing line: ~ new_frontier = bfs.frontier.shift~ +** Processing line: ~ # For each of its neighbors~ +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited~ +** Processing line: ~ bfs.frontier << neighbor~ +** Processing line: ~ bfs.came_from[neighbor] = new_frontier~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # resets game, and assigns star count given by user~ -** Processing line: ~ def reset_with count: count~ -** Processing line: ~ $gtk.reset~ -** Processing line: ~ $gtk.args.state.star_count = count~ -** Processing line: ~ end~ +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ +** Processing line: ~ # Comment this line and let a path generate to see the difference~ +** Processing line: ~ bfs.frontier = bfs.frontier.sort_by {| cell | proximity_to_star(cell) }~ +** Processing line: ~~ +** Processing line: ~ # If the search found the target~ +** Processing line: ~ if bfs.came_from.has_key?(grid.target)~ +** Processing line: ~ # Calculate the path between the target and star~ +** Processing line: ~ bfs_calc_path~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Calculates the path between the target and star for the breadth first search~ +** Processing line: ~ # Only called when the breadth first search finds the target~ +** Processing line: ~ def bfs_calc_path~ +** Processing line: ~ # Start from the target~ +** Processing line: ~ endpoint = grid.target~ +** Processing line: ~ # And the cell it came from~ +** Processing line: ~ next_endpoint = bfs.came_from[endpoint]~ +** Processing line: ~ while endpoint and next_endpoint~ +** Processing line: ~ # Draw a path between these two cells and store it~ +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ +** Processing line: ~ bfs.path << path~ +** Processing line: ~ # And get the next pair of cells~ +** Processing line: ~ endpoint = next_endpoint~ +** Processing line: ~ next_endpoint = bfs.came_from[endpoint]~ +** Processing line: ~ # Continue till there are no more cells~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Moves the heuristic search forward one step~ +** Processing line: ~ # Can be called from tick while the animation is playing~ +** Processing line: ~ # Can also be called when recalculating the searches after the user edited the grid~ +** Processing line: ~ def heuristic_one_step_forward~ +** Processing line: ~ # Stop the search if the target has been found~ +** Processing line: ~ return if heuristic.came_from.has_key?(grid.target)~ +** Processing line: ~~ +** Processing line: ~ # If the search has not begun~ +** Processing line: ~ if heuristic.came_from.empty?~ +** Processing line: ~ # Setup the search to begin from the star~ +** Processing line: ~ heuristic.frontier << grid.star~ +** Processing line: ~ heuristic.came_from[grid.star] = nil~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # One step in the heuristic search~ +** Processing line: ~~ +** Processing line: ~ # Unless there are no more cells to explore from~ +** Processing line: ~ unless heuristic.frontier.empty?~ +** Processing line: ~ # Get the next cell to explore from~ +** Processing line: ~ new_frontier = heuristic.frontier.shift~ +** Processing line: ~ # For each of its neighbors~ +** Processing line: ~ adjacent_neighbors(new_frontier).each do |neighbor|~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited~ +** Processing line: ~ heuristic.frontier << neighbor~ +** Processing line: ~ heuristic.came_from[neighbor] = new_frontier~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ +** Processing line: ~ heuristic.frontier = heuristic.frontier.sort_by {| cell | proximity_to_star(cell) }~ +** Processing line: ~ # Sort the frontier so cells that are close to the target are then prioritized~ +** Processing line: ~ heuristic.frontier = heuristic.frontier.sort_by {| cell | heuristic_heuristic(cell) }~ ** Processing line: ~~ +** Processing line: ~ # If the search found the target~ +** Processing line: ~ if heuristic.came_from.has_key?(grid.target)~ +** Processing line: ~ # Calculate the path between the target and star~ +** Processing line: ~ heuristic_calc_path~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Performance - Collision Limits - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Performance - Collision Limits - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Returns one-dimensional absolute distance between cell and target~ +** Processing line: ~ # Returns a number to compare distances between cells and the target~ +** Processing line: ~ def heuristic_heuristic(cell)~ +** Processing line: ~ (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/09_performance/07_collision_limits/app/main.rb~ -** Processing line: ~ =begin~ +** Processing line: ~ # Calculates the path between the target and star for the heuristic search~ +** Processing line: ~ # Only called when the heuristic search finds the target~ +** Processing line: ~ def heuristic_calc_path~ +** Processing line: ~ # Start from the target~ +** Processing line: ~ endpoint = grid.target~ +** Processing line: ~ # And the cell it came from~ +** Processing line: ~ next_endpoint = heuristic.came_from[endpoint]~ +** Processing line: ~ while endpoint and next_endpoint~ +** Processing line: ~ # Draw a path between these two cells and store it~ +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ +** Processing line: ~ heuristic.path << path~ +** Processing line: ~ # And get the next pair of cells~ +** Processing line: ~ endpoint = next_endpoint~ +** Processing line: ~ next_endpoint = heuristic.came_from[endpoint]~ +** Processing line: ~ # Continue till there are no more cells~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ Reminders:~ -** Processing line: ~ - find_all: Finds all elements of a collection that meet certain requirements.~ -** Processing line: ~ In this sample app, we're finding all bodies that intersect with the center body.~ +** Processing line: ~ # Returns a list of adjacent cells~ +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ +** Processing line: ~ def adjacent_neighbors(cell)~ +** Processing line: ~ neighbors = []~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.solids: An array. The values generate a solid.~ -** Processing line: ~ The parameters are [X, Y, WIDTH, HEIGHT, RED, GREEN, BLUE]~ -** Processing line: ~ For more information about solids, go to mygame/documentation/03-solids-and-borders.md.~ +** Processing line: ~ # Gets all the valid neighbors into the array~ +** Processing line: ~ # From southern neighbor, clockwise~ +** Processing line: ~ neighbors << [cell.x , cell.y - 1] unless cell.y == 0~ +** Processing line: ~ neighbors << [cell.x - 1, cell.y ] unless cell.x == 0~ +** Processing line: ~ neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1~ +** Processing line: ~ neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1~ ** Processing line: ~~ -** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ -** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ -** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +** Processing line: ~ neighbors~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ +** Processing line: ~ # and returns the larger value~ +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ +** Processing line: ~ # A cell that is [5, 5] from the star,~ +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ +** Processing line: ~ def proximity_to_star(cell)~ +** Processing line: ~ distance_x = (grid.star.x - cell.x).abs~ +** Processing line: ~ distance_y = (grid.star.y - cell.y).abs~ +** Processing line: ~~ +** Processing line: ~ if distance_x > distance_y~ +** Processing line: ~ return distance_x~ +** Processing line: ~ else~ +** Processing line: ~ return distance_y~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored.~ +** Processing line: ~ def grid~ +** Processing line: ~ state.grid~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ - ARRAY#intersect_rect?: Returns true or false depending on if two rectangles intersect.~ +** Processing line: ~ def buttons~ +** Processing line: ~ state.buttons~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ =end~ +** Processing line: ~ def slider~ +** Processing line: ~ state.slider~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # This code demonstrates moving objects that loop around once they exceed the scope of the screen,~ -** Processing line: ~ # which has dimensions of 1280 by 720, and also detects collisions between objects called "bodies".~ +** Processing line: ~ def bfs~ +** Processing line: ~ state.bfs~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def body_count num~ -** Processing line: ~ $gtk.args.state.other_bodies = num.map { [1280 * rand, 720 * rand, 10, 10] } # other_bodies set using num collection~ -** Processing line: ~ end~ +** Processing line: ~ def heuristic~ +** Processing line: ~ state.heuristic~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ +** Processing line: ~ # Descriptive aliases for colors~ +** Processing line: ~ def default_color~ +** Processing line: ~ [221, 212, 213] # Light Brown~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Center body's values are set using an array~ -** Processing line: ~ # Map is used to set values of 2000 other bodies~ -** Processing line: ~ # All bodies that intersect with center body are stored in collisions collection~ -** Processing line: ~ args.state.center_body ||= [640 - 100, 360 - 100, 200, 200] # calculations done to place body in center~ -** Processing line: ~ args.state.other_bodies ||= 2000.map { [1280 * rand, 720 * rand, 10, 10] } # 2000 bodies given random position on screen~ +** Processing line: ~ def wall_color~ +** Processing line: ~ [134, 134, 120] # Camo Green~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # finds all bodies that intersect with center body, stores them in collisions~ -** Processing line: ~ collisions = args.state.other_bodies.find_all { |b| b.intersect_rect? args.state.center_body }~ +** Processing line: ~ def visited_color~ +** Processing line: ~ [204, 191, 179] # Dark Brown~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.borders << args.state.center_body # outputs center body as a black border~ +** Processing line: ~ def frontier_color~ +** Processing line: ~ [103, 136, 204] # Blue~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # transparency changes based on number of collisions; the more collisions, the redder (more transparent) the box becomes~ -** Processing line: ~ args.solids << [args.state.center_body, 255, 0, 0, collisions.length * 5] # center body is red solid~ -** Processing line: ~ args.solids << args.state.other_bodies # other bodies are output as (black) solids, as well~ +** Processing line: ~ def path_color~ +** Processing line: ~ [231, 230, 228] # Pastel White~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.labels << [10, 30, args.gtk.current_framerate] # outputs frame rate in bottom left corner~ +** Processing line: ~ def button_color~ +** Processing line: ~ [190, 190, 190] # Gray~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ # Method that is called by DragonRuby periodically~ +** Processing line: ~ # Used for updating animations and calculations~ +** Processing line: ~ def tick args~ ** Processing line: ~~ -** Processing line: ~ # Bodies are returned to bottom left corner if positions exceed scope of screen~ -** Processing line: ~ args.state.other_bodies.each do |b| # for each body in the other_bodies collection~ -** Processing line: ~ b.x += 5 # x and y are both incremented by 5~ -** Processing line: ~ b.y += 5~ -** Processing line: ~ b.x = 0 if b.x > 1280 # x becomes 0 if star exceeds scope of screen (goes too far right)~ -** Processing line: ~ b.y = 0 if b.y > 720 # y becomes 0 if star exceeds scope of screen (goes too far up)~ +** Processing line: ~ # Pressing r will reset the application~ +** Processing line: ~ if args.inputs.keyboard.key_down.r~ +** Processing line: ~ args.gtk.reset~ +** Processing line: ~ reset~ +** Processing line: ~ return~ ** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ +** Processing line: ~ $heuristic ||= Heuristic.new(args)~ +** Processing line: ~ $heuristic.args = args~ +** Processing line: ~ $heuristic.tick~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Resets the game.~ -** Processing line: ~ $gtk.reset~ +** Processing line: ~~ +** Processing line: ~ def reset~ +** Processing line: ~ $heuristic = nil~ +** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Advanced Debugging - Trace Debugging - main.rb~ -- H1 detected. +** Processing line: ~*** Path Finding Algorithms - A Star - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Debugging - Trace Debugging - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Path Finding Algorithms - A Star - 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: ~Path Finding Algorithms - A Star - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ ** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ # ./samples/10_advanced_debugging/01_trace_debugging/app/main.rb~ -** Processing line: ~ class Game~ +** Processing line: ~ # ./samples/13_path_finding_algorithms/08_a_star/app/main.rb~ +** Processing line: ~ # This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html~ +** Processing line: ~~ +** Processing line: ~ # The A* Search works by incorporating both the distance from the starting point~ +** Processing line: ~ # and the distance from the target in its heurisitic.~ +** Processing line: ~~ +** Processing line: ~ # It tends to find the correct (shortest) path even when the Greedy Best-First Search does not,~ +** Processing line: ~ # and it explores less of the grid, and is therefore faster, than Dijkstra's Search.~ +** Processing line: ~~ +** Processing line: ~ class A_Star_Algorithm~ ** Processing line: ~ attr_gtk~ ** Processing line: ~~ -** Processing line: ~ def method1 num~ -** Processing line: ~ method2 num~ -** Processing line: ~ end~ +** Processing line: ~ def tick~ +** Processing line: ~ defaults~ +** Processing line: ~ render~ +** Processing line: ~ input~ ** Processing line: ~~ -** Processing line: ~ def method2 num~ -** Processing line: ~ method3 num~ +** Processing line: ~ if dijkstra.came_from.empty?~ +** Processing line: ~ calc_searches~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def method3 num~ -** Processing line: ~ method4 num~ -** Processing line: ~ end~ +** Processing line: ~ def defaults~ +** Processing line: ~ # Variables to edit the size and appearance of the grid~ +** Processing line: ~ # Freely customizable to user's liking~ +** Processing line: ~ grid.width ||= 15~ +** Processing line: ~ grid.height ||= 15~ +** Processing line: ~ grid.cell_size ||= 27~ +** Processing line: ~ grid.rect ||= [0, 0, grid.width, grid.height]~ +** Processing line: ~~ +** Processing line: ~ grid.star ||= [0, 2]~ +** Processing line: ~ grid.target ||= [11, 13]~ +** Processing line: ~ grid.walls ||= {~ +** Processing line: ~ [2, 2] => true,~ +** Processing line: ~ [3, 2] => true,~ +** Processing line: ~ [4, 2] => true,~ +** Processing line: ~ [5, 2] => true,~ +** Processing line: ~ [6, 2] => true,~ +** Processing line: ~ [7, 2] => true,~ +** Processing line: ~ [8, 2] => true,~ +** Processing line: ~ [9, 2] => true,~ +** Processing line: ~ [10, 2] => true,~ +** Processing line: ~ [11, 2] => true,~ +** Processing line: ~ [12, 2] => true,~ +** Processing line: ~ [12, 3] => true,~ +** Processing line: ~ [12, 4] => true,~ +** Processing line: ~ [12, 5] => true,~ +** Processing line: ~ [12, 6] => true,~ +** Processing line: ~ [12, 7] => true,~ +** Processing line: ~ [12, 8] => true,~ +** Processing line: ~ [12, 9] => true,~ +** Processing line: ~ [12, 10] => true,~ +** Processing line: ~ [12, 11] => true,~ +** Processing line: ~ [12, 12] => true,~ +** Processing line: ~ [5, 12] => true,~ +** Processing line: ~ [6, 12] => true,~ +** Processing line: ~ [7, 12] => true,~ +** Processing line: ~ [8, 12] => true,~ +** Processing line: ~ [9, 12] => true,~ +** Processing line: ~ [10, 12] => true,~ +** Processing line: ~ [11, 12] => true,~ +** Processing line: ~ [12, 12] => true~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~ def method4 num~ -** Processing line: ~ if num == 1~ -** Processing line: ~ puts "UNLUCKY #{num}."~ -** Processing line: ~ state.unlucky_count += 1~ -** Processing line: ~ if state.unlucky_count > 3~ -** Processing line: ~ raise "NAT 1 finally occurred. Check app/trace.txt for all method invocation history."~ -** Processing line: ~ end~ -** Processing line: ~ else~ -** Processing line: ~ puts "LUCKY #{num}."~ -** Processing line: ~ end~ +** Processing line: ~ # What the user is currently editing on the grid~ +** Processing line: ~ # We store this value, because we want to remember the value even when~ +** Processing line: ~ # the user's cursor is no longer over what they're interacting with, but~ +** Processing line: ~ # they are still clicking down on the mouse.~ +** Processing line: ~ state.user_input ||= :none~ +** Processing line: ~~ +** Processing line: ~ # These variables allow the breadth first search to take place~ +** Processing line: ~ # 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.~ +** Processing line: ~ # Used to prevent searching cells that have already been found~ +** Processing line: ~ # and to trace a path from the target back to the starting point.~ +** Processing line: ~ # Frontier is an array of cells to expand the search from.~ +** Processing line: ~ # The search is over when there are no more cells to search from.~ +** Processing line: ~ # Path stores the path from the target to the star, once the target has been found~ +** Processing line: ~ # It prevents calculating the path every tick.~ +** Processing line: ~ dijkstra.came_from ||= {}~ +** Processing line: ~ dijkstra.cost_so_far ||= {}~ +** Processing line: ~ dijkstra.frontier ||= []~ +** Processing line: ~ dijkstra.path ||= []~ +** Processing line: ~~ +** Processing line: ~ greedy.came_from ||= {}~ +** Processing line: ~ greedy.frontier ||= []~ +** Processing line: ~ greedy.path ||= []~ +** Processing line: ~~ +** Processing line: ~ a_star.frontier ||= []~ +** Processing line: ~ a_star.came_from ||= {}~ +** Processing line: ~ a_star.path ||= []~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # All methods with render draw stuff on the screen~ +** Processing line: ~ # UI has buttons, the slider, and labels~ +** Processing line: ~ # The search specific rendering occurs in the respective methods~ +** Processing line: ~ def render~ +** Processing line: ~ render_labels~ +** Processing line: ~ render_dijkstra~ +** Processing line: ~ render_greedy~ +** Processing line: ~ render_a_star~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick~ -** Processing line: ~ state.roll_history ||= []~ -** Processing line: ~ state.roll_history << rand(20) + 1~ -** Processing line: ~ state.countdown ||= 600~ -** Processing line: ~ state.countdown -= 1~ -** Processing line: ~ state.unlucky_count ||= 0~ -** Processing line: ~ outputs.labels << [640, 360, "A dice roll of 1 will cause an exception.", 0, 1]~ -** Processing line: ~ if state.countdown > 0~ -** Processing line: ~ outputs.labels << [640, 340, "Dice roll countdown: #{state.countdown}", 0, 1]~ -** Processing line: ~ else~ -** Processing line: ~ state.attempts ||= 0~ -** Processing line: ~ state.attempts += 1~ -** Processing line: ~ outputs.labels << [640, 340, "ROLLING! #{state.attempts}", 0, 1]~ -** Processing line: ~ end~ -** Processing line: ~ return if state.countdown > 0~ -** Processing line: ~ method1 state.roll_history[-1]~ +** Processing line: ~ def render_labels~ +** Processing line: ~ outputs.labels << [150, 450, "Dijkstra's"]~ +** Processing line: ~ outputs.labels << [550, 450, "Greedy Best-First"]~ +** Processing line: ~ outputs.labels << [1025, 450, "A* Search"]~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $game = Game.new~ +** Processing line: ~ def render_dijkstra~ +** Processing line: ~ render_dijkstra_grid~ +** Processing line: ~ render_dijkstra_star~ +** Processing line: ~ render_dijkstra_target~ +** Processing line: ~ render_dijkstra_visited~ +** Processing line: ~ render_dijkstra_walls~ +** Processing line: ~ render_dijkstra_path~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ trace! $game # <------------------- TRACING ENABLED FOR THIS OBJECT~ -** Processing line: ~ $game.args = args~ -** Processing line: ~ $game.tick~ -** Processing line: ~ end~ +** Processing line: ~ def render_greedy~ +** Processing line: ~ render_greedy_grid~ +** Processing line: ~ render_greedy_star~ +** Processing line: ~ render_greedy_target~ +** Processing line: ~ render_greedy_visited~ +** Processing line: ~ render_greedy_walls~ +** Processing line: ~ render_greedy_path~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def render_a_star~ +** Processing line: ~ render_a_star_grid~ +** Processing line: ~ render_a_star_star~ +** Processing line: ~ render_a_star_target~ +** Processing line: ~ render_a_star_visited~ +** Processing line: ~ render_a_star_walls~ +** Processing line: ~ render_a_star_path~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # This method handles user input every tick~ +** Processing line: ~ def input~ +** Processing line: ~ # If the mouse was lifted this tick~ +** Processing line: ~ if inputs.mouse.up~ +** Processing line: ~ # Set current input to none~ +** Processing line: ~ state.user_input = :none~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Advanced Debugging - Trace Debugging Classes - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Debugging - Trace Debugging Classes - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # If the mouse was clicked this tick~ +** Processing line: ~ if inputs.mouse.down~ +** Processing line: ~ # Determine what the user is editing and appropriately edit the state.user_input variable~ +** Processing line: ~ determine_input~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/10_advanced_debugging/02_trace_debugging_classes/app/main.rb~ -** Processing line: ~ class Foobar~ -** Processing line: ~ def initialize~ -** Processing line: ~ trace! # Trace is added to the constructor.~ +** Processing line: ~ # Process user input based on user_input variable and current mouse position~ +** Processing line: ~ process_input~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def clicky args~ -** Processing line: ~ return unless args.inputs.mouse.click~ -** Processing line: ~ try_rand rand~ +** Processing line: ~ # Determines what the user is editing~ +** Processing line: ~ # This method is called when the mouse is clicked down~ +** Processing line: ~ def determine_input~ +** Processing line: ~ # If the mouse is over the star in the first grid~ +** Processing line: ~ if dijkstra_mouse_over_star?~ +** Processing line: ~ # The user is editing the star from the first grid~ +** Processing line: ~ state.user_input = :dijkstra_star~ +** Processing line: ~ # If the mouse is over the star in the second grid~ +** Processing line: ~ elsif greedy_mouse_over_star?~ +** Processing line: ~ # The user is editing the star from the second grid~ +** Processing line: ~ state.user_input = :greedy_star~ +** Processing line: ~ # If the mouse is over the star in the third grid~ +** Processing line: ~ elsif a_star_mouse_over_star?~ +** Processing line: ~ # The user is editing the star from the third grid~ +** Processing line: ~ state.user_input = :a_star_star~ +** Processing line: ~ # If the mouse is over the target in the first grid~ +** Processing line: ~ elsif dijkstra_mouse_over_target?~ +** Processing line: ~ # The user is editing the target from the first grid~ +** Processing line: ~ state.user_input = :dijkstra_target~ +** Processing line: ~ # If the mouse is over the target in the second grid~ +** Processing line: ~ elsif greedy_mouse_over_target?~ +** Processing line: ~ # The user is editing the target from the second grid~ +** Processing line: ~ state.user_input = :greedy_target~ +** Processing line: ~ # If the mouse is over the target in the third grid~ +** Processing line: ~ elsif a_star_mouse_over_target?~ +** Processing line: ~ # The user is editing the target from the third grid~ +** Processing line: ~ state.user_input = :a_star_target~ +** Processing line: ~ # If the mouse is over a wall in the first grid~ +** Processing line: ~ elsif dijkstra_mouse_over_wall?~ +** Processing line: ~ # The user is removing a wall from the first grid~ +** Processing line: ~ state.user_input = :dijkstra_remove_wall~ +** Processing line: ~ # If the mouse is over a wall in the second grid~ +** Processing line: ~ elsif greedy_mouse_over_wall?~ +** Processing line: ~ # The user is removing a wall from the second grid~ +** Processing line: ~ state.user_input = :greedy_remove_wall~ +** Processing line: ~ # If the mouse is over a wall in the third grid~ +** Processing line: ~ elsif a_star_mouse_over_wall?~ +** Processing line: ~ # The user is removing a wall from the third grid~ +** Processing line: ~ state.user_input = :a_star_remove_wall~ +** Processing line: ~ # If the mouse is over the first grid~ +** Processing line: ~ elsif dijkstra_mouse_over_grid?~ +** Processing line: ~ # The user is adding a wall from the first grid~ +** Processing line: ~ state.user_input = :dijkstra_add_wall~ +** Processing line: ~ # If the mouse is over the second grid~ +** Processing line: ~ elsif greedy_mouse_over_grid?~ +** Processing line: ~ # The user is adding a wall from the second grid~ +** Processing line: ~ state.user_input = :greedy_add_wall~ +** Processing line: ~ # If the mouse is over the third grid~ +** Processing line: ~ elsif a_star_mouse_over_grid?~ +** Processing line: ~ # The user is adding a wall from the third grid~ +** Processing line: ~ state.user_input = :a_star_add_wall~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Processes click and drag based on what the user is currently dragging~ +** Processing line: ~ def process_input~ +** Processing line: ~ if state.user_input == :dijkstra_star~ +** Processing line: ~ process_input_dijkstra_star~ +** Processing line: ~ elsif state.user_input == :greedy_star~ +** Processing line: ~ process_input_greedy_star~ +** Processing line: ~ elsif state.user_input == :a_star_star~ +** Processing line: ~ process_input_a_star_star~ +** Processing line: ~ elsif state.user_input == :dijkstra_target~ +** Processing line: ~ process_input_dijkstra_target~ +** Processing line: ~ elsif state.user_input == :greedy_target~ +** Processing line: ~ process_input_greedy_target~ +** Processing line: ~ elsif state.user_input == :a_star_target~ +** Processing line: ~ process_input_a_star_target~ +** Processing line: ~ elsif state.user_input == :dijkstra_remove_wall~ +** Processing line: ~ process_input_dijkstra_remove_wall~ +** Processing line: ~ elsif state.user_input == :greedy_remove_wall~ +** Processing line: ~ process_input_greedy_remove_wall~ +** Processing line: ~ elsif state.user_input == :a_star_remove_wall~ +** Processing line: ~ process_input_a_star_remove_wall~ +** Processing line: ~ elsif state.user_input == :dijkstra_add_wall~ +** Processing line: ~ process_input_dijkstra_add_wall~ +** Processing line: ~ elsif state.user_input == :greedy_add_wall~ +** Processing line: ~ process_input_greedy_add_wall~ +** Processing line: ~ elsif state.user_input == :a_star_add_wall~ +** Processing line: ~ process_input_a_star_add_wall~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def try_rand num~ -** Processing line: ~ return if num < 0.9~ -** Processing line: ~ raise "Exception finally occurred. Take a look at logs/trace.txt #{num}."~ +** Processing line: ~ def render_dijkstra_grid~ +** Processing line: ~ # A large rect the size of the grid~ +** Processing line: ~ outputs.solids << [dijkstra_scale_up(grid.rect), default_color]~ +** Processing line: ~~ +** Processing line: ~ # The vertical grid lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << dijkstra_vertical_line(x)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # The horizontal grid lines~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << dijkstra_horizontal_line(y)~ +** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.labels << [640, 360, "Start clicking. Eventually an exception will be thrown. Then look at logs/trace.txt.", 0, 1]~ -** Processing line: ~ args.state.foobar = Foobar.new if args.tick_count~ -** Processing line: ~ return unless args.state.foobar~ -** Processing line: ~ args.state.foobar.clicky args~ -** Processing line: ~ end~ +** Processing line: ~ def render_greedy_grid~ +** Processing line: ~ # A large rect the size of the grid~ +** Processing line: ~ outputs.solids << [greedy_scale_up(grid.rect), default_color]~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # The vertical grid lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << greedy_vertical_line(x)~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # The horizontal grid lines~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << greedy_horizontal_line(y)~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Advanced Debugging - Unit Tests - exception_raising_tests.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Debugging - Unit Tests - exception_raising_tests.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def render_a_star_grid~ +** Processing line: ~ # A large rect the size of the grid~ +** Processing line: ~ outputs.solids << [a_star_scale_up(grid.rect), default_color]~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/exception_raising_tests.rb~ -** Processing line: ~ begin :shared~ -** Processing line: ~ class ExceptionalClass~ -** Processing line: ~ def initialize exception_to_throw = nil~ -** Processing line: ~ raise exception_to_throw if exception_to_throw~ +** Processing line: ~ # The vertical grid lines~ +** Processing line: ~ for x in 0..grid.width~ +** Processing line: ~ outputs.lines << a_star_vertical_line(x)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # The horizontal grid lines~ +** Processing line: ~ for y in 0..grid.height~ +** Processing line: ~ outputs.lines << a_star_horizontal_line(y)~ ** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_exception_in_newing_object args, assert~ -** Processing line: ~ begin~ -** Processing line: ~ ExceptionalClass.new TypeError~ -** Processing line: ~ raise "Exception wasn't thrown!"~ -** Processing line: ~ rescue Exception => e~ -** Processing line: ~ assert.equal! e.class, TypeError, "Exceptions within constructor should be retained."~ +** Processing line: ~ # Returns a vertical line for a column of the first grid~ +** Processing line: ~ def dijkstra_vertical_line column~ +** Processing line: ~ dijkstra_scale_up([column, 0, column, grid.height])~ ** Processing line: ~ end~ -** 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: ~ # Returns a horizontal line for a column of the first grid~ +** Processing line: ~ def dijkstra_horizontal_line row~ +** Processing line: ~ dijkstra_scale_up([0, row, grid.width, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Returns a vertical line for a column of the second grid~ +** Processing line: ~ def greedy_vertical_line column~ +** Processing line: ~ dijkstra_scale_up([column + grid.width + 1, 0, column + grid.width + 1, grid.height])~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Returns a horizontal line for a column of the second grid~ +** Processing line: ~ def greedy_horizontal_line row~ +** Processing line: ~ dijkstra_scale_up([grid.width + 1, row, grid.width + grid.width + 1, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Advanced Debugging - Unit Tests - gen_docs.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Debugging - Unit Tests - gen_docs.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Returns a vertical line for a column of the third grid~ +** Processing line: ~ def a_star_vertical_line column~ +** Processing line: ~ dijkstra_scale_up([column + (grid.width * 2) + 2, 0, column + (grid.width * 2) + 2, grid.height])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/gen_docs.rb~ -** Processing line: ~ # sh ./amir-build-and-run.sh --eval samples/99_zz_gtk_unit_tests/gen_docs.rb --no-tick~ -** Processing line: ~ Kernel.export_docs!~ +** Processing line: ~ # Returns a horizontal line for a column of the third grid~ +** Processing line: ~ def a_star_horizontal_line row~ +** Processing line: ~ dijkstra_scale_up([(grid.width * 2) + 2, row, (grid.width * 2) + grid.width + 2, row])~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Renders the star on the first grid~ +** Processing line: ~ def render_dijkstra_star~ +** Processing line: ~ outputs.sprites << [dijkstra_scale_up(grid.star), 'star.png']~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Renders the star on the second grid~ +** Processing line: ~ def render_greedy_star~ +** Processing line: ~ outputs.sprites << [greedy_scale_up(grid.star), 'star.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Advanced Debugging - Unit Tests - geometry_tests.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Debugging - Unit Tests - geometry_tests.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Renders the star on the third grid~ +** Processing line: ~ def render_a_star_star~ +** Processing line: ~ outputs.sprites << [a_star_scale_up(grid.star), 'star.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/geometry_tests.rb~ -** Processing line: ~ begin :shared~ -** Processing line: ~ def primitive_representations x, y, w, h~ -** Processing line: ~ [~ -** Processing line: ~ [x, y, w, h],~ -** Processing line: ~ { x: x, y: y, w: w, h: h },~ -** Processing line: ~ RectForTest.new(x, y, w, h)~ -** Processing line: ~ ]~ +** Processing line: ~ # Renders the target on the first grid~ +** Processing line: ~ def render_dijkstra_target~ +** Processing line: ~ outputs.sprites << [dijkstra_scale_up(grid.target), 'target.png']~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ class RectForTest~ -** Processing line: ~ attr_sprite~ +** Processing line: ~ # Renders the target on the second grid~ +** Processing line: ~ def render_greedy_target~ +** Processing line: ~ outputs.sprites << [greedy_scale_up(grid.target), 'target.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def initialize x, y, w, h~ -** Processing line: ~ @x = x~ -** Processing line: ~ @y = y~ -** Processing line: ~ @w = w~ -** Processing line: ~ @h = h~ -** Processing line: ~ end~ +** Processing line: ~ # Renders the target on the third grid~ +** Processing line: ~ def render_a_star_target~ +** Processing line: ~ outputs.sprites << [a_star_scale_up(grid.target), 'target.png']~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def to_s~ -** Processing line: ~ "RectForTest: #{[x, y, w, h]}"~ +** Processing line: ~ # Renders the walls on the first grid~ +** Processing line: ~ def render_dijkstra_walls~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ outputs.solids << [dijkstra_scale_up(wall), wall_color]~ ** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ begin :intersect_rect?~ -** Processing line: ~ def test_intersect_rect_point args, assert~ -** Processing line: ~ assert.true! [16, 13].intersect_rect?([13, 12, 4, 4]), "point intersects with rect."~ +** Processing line: ~ # Renders the walls on the second grid~ +** Processing line: ~ def render_greedy_walls~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ outputs.solids << [greedy_scale_up(wall), wall_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_intersect_rect args, assert~ -** Processing line: ~ intersecting = primitive_representations(0, 0, 100, 100) +~ -** Processing line: ~ primitive_representations(20, 20, 20, 20)~ +** Processing line: ~ # Renders the walls on the third grid~ +** Processing line: ~ def render_a_star_walls~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ outputs.solids << [a_star_scale_up(wall), wall_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ intersecting.product(intersecting).each do |rect_one, rect_two|~ -** Processing line: ~ assert.true! rect_one.intersect_rect?(rect_two),~ -** Processing line: ~ "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected true)."~ +** Processing line: ~ # Renders the visited cells on the first grid~ +** Processing line: ~ def render_dijkstra_visited~ +** Processing line: ~ dijkstra.came_from.each_key do | visited_cell |~ +** Processing line: ~ outputs.solids << [dijkstra_scale_up(visited_cell), visited_color]~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ not_intersecting = [~ -** Processing line: ~ [ 0, 0, 5, 5],~ -** Processing line: ~ { x: 10, y: 10, w: 5, h: 5 },~ -** Processing line: ~ RectForTest.new(20, 20, 5, 5)~ -** Processing line: ~ ]~ +** Processing line: ~ # Renders the visited cells on the second grid~ +** Processing line: ~ def render_greedy_visited~ +** Processing line: ~ greedy.came_from.each_key do | visited_cell |~ +** Processing line: ~ outputs.solids << [greedy_scale_up(visited_cell), visited_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ not_intersecting.product(not_intersecting)~ -** Processing line: ~ .reject { |rect_one, rect_two| rect_one == rect_two }~ -** Processing line: ~ .each do |rect_one, rect_two|~ -** Processing line: ~ assert.false! rect_one.intersect_rect?(rect_two),~ -** Processing line: ~ "intersect_rect? assertion failed for #{rect_one}, #{rect_two} (expected false)."~ +** Processing line: ~ # Renders the visited cells on the third grid~ +** Processing line: ~ def render_a_star_visited~ +** Processing line: ~ a_star.came_from.each_key do | visited_cell |~ +** Processing line: ~ outputs.solids << [a_star_scale_up(visited_cell), visited_color]~ ** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ begin :inside_rect?~ -** Processing line: ~ def assert_inside_rect outer: nil, inner: nil, expected: nil, assert: nil~ -** Processing line: ~ assert.true! inner.inside_rect?(outer) == expected,~ -** Processing line: ~ "inside_rect? assertion failed for outer: #{outer} inner: #{inner} (expected #{expected})."~ +** Processing line: ~ # Renders the path found by the breadth first search on the first grid~ +** Processing line: ~ def render_dijkstra_path~ +** Processing line: ~ dijkstra.path.each do | path |~ +** Processing line: ~ outputs.solids << [dijkstra_scale_up(path), path_color]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_inside_rect args, assert~ -** Processing line: ~ outer_rects = primitive_representations(0, 0, 10, 10)~ -** Processing line: ~ inner_rects = primitive_representations(1, 1, 5, 5)~ -** Processing line: ~ primitive_representations(0, 0, 10, 10).product(primitive_representations(1, 1, 5, 5))~ -** Processing line: ~ .each do |outer, inner|~ -** Processing line: ~ assert_inside_rect outer: outer, inner: inner,~ -** Processing line: ~ expected: true, assert: assert~ +** Processing line: ~ # Renders the path found by the greedy search on the second grid~ +** Processing line: ~ def render_greedy_path~ +** Processing line: ~ greedy.path.each do | path |~ +** Processing line: ~ outputs.solids << [greedy_scale_up(path), path_color]~ ** Processing line: ~ end~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ begin :angle_to~ -** Processing line: ~ def test_angle_to args, assert~ -** Processing line: ~ origins = primitive_representations(0, 0, 0, 0)~ -** Processing line: ~ rights = primitive_representations(1, 0, 0, 0)~ -** Processing line: ~ aboves = primitive_representations(0, 1, 0, 0)~ +** Processing line: ~ # Renders the path found by the a_star search on the third grid~ +** Processing line: ~ def render_a_star_path~ +** Processing line: ~ a_star.path.each do | path |~ +** Processing line: ~ outputs.solids << [a_star_scale_up(path), path_color]~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ origins.product(aboves).each do |origin, above|~ -** Processing line: ~ assert.equal! origin.angle_to(above), 90,~ -** Processing line: ~ "A point directly above should be 90 degrees."~ +** Processing line: ~ # Returns the rect for the path between two cells based on their relative positions~ +** Processing line: ~ def get_path_between(cell_one, cell_two)~ +** Processing line: ~ path = []~ ** Processing line: ~~ -** Processing line: ~ assert.equal! above.angle_from(origin), 90,~ -** Processing line: ~ "A point coming from above should be 90 degrees."~ +** Processing line: ~ # If cell one is above cell two~ +** Processing line: ~ if cell_one.x == cell_two.x and cell_one.y > cell_two.y~ +** Processing line: ~ # Path starts from the center of cell two and moves upward to the center of cell one~ +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 0.4, 1.4]~ +** Processing line: ~ # If cell one is below cell two~ +** Processing line: ~ elsif cell_one.x == cell_two.x and cell_one.y < cell_two.y~ +** Processing line: ~ # Path starts from the center of cell one and moves upward to the center of cell two~ +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 0.4, 1.4]~ +** Processing line: ~ # If cell one is to the left of cell two~ +** Processing line: ~ elsif cell_one.x > cell_two.x and cell_one.y == cell_two.y~ +** Processing line: ~ # Path starts from the center of cell two and moves rightward to the center of cell one~ +** Processing line: ~ path = [cell_two.x + 0.3, cell_two.y + 0.3, 1.4, 0.4]~ +** Processing line: ~ # If cell one is to the right of cell two~ +** Processing line: ~ elsif cell_one.x < cell_two.x and cell_one.y == cell_two.y~ +** Processing line: ~ # Path starts from the center of cell one and moves rightward to the center of cell two~ +** Processing line: ~ path = [cell_one.x + 0.3, cell_one.y + 0.3, 1.4, 0.4]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ origins.product(rights).each do |origin, right|~ -** Processing line: ~ assert.equal! origin.angle_to(right) % 360, 0,~ -** Processing line: ~ "A point directly to the right should be 0 degrees."~ +** Processing line: ~ path~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ assert.equal! right.angle_from(origin) % 360, 0,~ -** Processing line: ~ "A point coming from the right should be 0 degrees."~ +** Processing line: ~ # In code, the cells are represented as 1x1 rectangles~ +** Processing line: ~ # When drawn, the cells are larger than 1x1 rectangles~ +** Processing line: ~ # This method is used to scale up cells, and lines~ +** Processing line: ~ # Objects are scaled up according to the grid.cell_size variable~ +** Processing line: ~ # This allows for easy customization of the visual scale of the grid~ +** Processing line: ~ # This method scales up cells for the first grid~ +** Processing line: ~ def dijkstra_scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ ** Processing line: ~~ +** Processing line: ~ # If cell is just an x and y coordinate~ +** Processing line: ~ if cell.size == 2~ +** Processing line: ~ # Add a width and height of 1~ +** Processing line: ~ cell << 1~ +** Processing line: ~ cell << 1~ ** Processing line: ~ end~ -** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ begin :scale_rect~ -** Processing line: ~ def test_scale_rect args, assert~ -** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect(0.5, 0.5),~ -** Processing line: ~ [25.0, 25.0, 50.0, 50.0]~ +** Processing line: ~ # Scale all the values up~ +** Processing line: ~ cell.map! { |value| value * grid.cell_size }~ ** Processing line: ~~ -** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect(0.5),~ -** Processing line: ~ [0.0, 0.0, 50.0, 50.0]~ +** Processing line: ~ # Returns the scaled up cell~ +** Processing line: ~ cell~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0.5, anchor_y: 0.5),~ -** Processing line: ~ [25.0, 25.0, 50.0, 50.0]~ +** Processing line: ~ # Translates the given cell grid.width + 1 to the right and then scales up~ +** Processing line: ~ # Used to draw cells for the second grid~ +** Processing line: ~ # This method does not work for lines,~ +** Processing line: ~ # so separate methods exist for the grid lines~ +** Processing line: ~ def greedy_scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ +** Processing line: ~ # Translates the cell to the second grid equivalent~ +** Processing line: ~ cell.x += grid.width + 1~ +** Processing line: ~ # Proceeds as if scaling up for the first grid~ +** Processing line: ~ dijkstra_scale_up(cell)~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ assert.equal! [0, 0, 100, 100].scale_rect_extended(percentage_x: 0.5, percentage_y: 0.5, anchor_x: 0, anchor_y: 0),~ -** Processing line: ~ [0.0, 0.0, 50.0, 50.0]~ +** Processing line: ~ # Translates the given cell (grid.width + 1) * 2 to the right and then scales up~ +** Processing line: ~ # Used to draw cells for the third grid~ +** Processing line: ~ # This method does not work for lines,~ +** Processing line: ~ # so separate methods exist for the grid lines~ +** Processing line: ~ def a_star_scale_up(cell)~ +** Processing line: ~ # Prevents the original value of cell from being edited~ +** Processing line: ~ cell = cell.clone~ +** Processing line: ~ # Translates the cell to the second grid equivalent~ +** Processing line: ~ cell.x += grid.width + 1~ +** Processing line: ~ # Translates the cell to the third grid equivalent~ +** Processing line: ~ cell.x += grid.width + 1~ +** Processing line: ~ # Proceeds as if scaling up for the first grid~ +** Processing line: ~ dijkstra_scale_up(cell)~ ** Processing line: ~ end~ -** 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: ~ # Signal that the user is going to be moving the star from the first grid~ +** Processing line: ~ def dijkstra_mouse_over_star?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.star))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Signal that the user is going to be moving the star from the second grid~ +** Processing line: ~ def greedy_mouse_over_star?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(greedy_scale_up(grid.star))~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be moving the star from the third grid~ +** Processing line: ~ def a_star_mouse_over_star?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(a_star_scale_up(grid.star))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Advanced Debugging - Unit Tests - http_tests.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Debugging - Unit Tests - http_tests.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Signal that the user is going to be moving the target from the first grid~ +** Processing line: ~ def dijkstra_mouse_over_target?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.target))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/http_tests.rb~ -** Processing line: ~ def try_assert_or_schedule args, assert~ -** Processing line: ~ if $result[:complete]~ -** Processing line: ~ log_info "Request completed! Verifying."~ -** Processing line: ~ if $result[:http_response_code] != 200~ -** Processing line: ~ log_info "The request yielded a result of #{$result[:http_response_code]} instead of 200."~ -** Processing line: ~ exit~ -** Processing line: ~ end~ -** Processing line: ~ log_info ":try_assert_or_schedule succeeded!"~ -** Processing line: ~ else~ -** Processing line: ~ args.gtk.schedule_callback Kernel.tick_count + 10 do~ -** Processing line: ~ try_assert_or_schedule args, assert~ -** Processing line: ~ end~ +** Processing line: ~ # Signal that the user is going to be moving the target from the second grid~ +** Processing line: ~ def greedy_mouse_over_target?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(greedy_scale_up(grid.target))~ ** Processing line: ~ end~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_http args, assert~ -** Processing line: ~ $result = $gtk.http_get 'http://dragonruby.org'~ -** Processing line: ~ try_assert_or_schedule args, assert~ -** Processing line: ~ end~ +** Processing line: ~ # Signal that the user is going to be moving the target from the third grid~ +** Processing line: ~ def a_star_mouse_over_target?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(a_star_scale_up(grid.target))~ +** 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: ~ # Signal that the user is going to be removing walls from the first grid~ +** Processing line: ~ def dijkstra_mouse_over_wall?~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(dijkstra_scale_up(wall))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ false~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Signal that the user is going to be removing walls from the second grid~ +** Processing line: ~ def greedy_mouse_over_wall?~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(greedy_scale_up(wall))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Advanced Debugging - Unit Tests - object_to_primitive_tests.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Debugging - Unit Tests - object_to_primitive_tests.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ false~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/object_to_primitive_tests.rb~ -** Processing line: ~ class PlayerSpriteForTest~ -** Processing line: ~ end~ +** Processing line: ~ # Signal that the user is going to be removing walls from the third grid~ +** Processing line: ~ def a_star_mouse_over_wall?~ +** Processing line: ~ grid.walls.each_key do | wall |~ +** Processing line: ~ return true if inputs.mouse.point.inside_rect?(a_star_scale_up(wall))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_array_to_sprite args, assert~ -** Processing line: ~ array = [[0, 0, 100, 100, "test.png"]].sprites~ -** Processing line: ~ puts "No exception was thrown. Sweet!"~ -** Processing line: ~ end~ +** Processing line: ~ false~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_class_to_sprite args, assert~ -** Processing line: ~ array = [PlayerSprite.new].sprites~ -** Processing line: ~ assert.true! array.first.is_a?(PlayerSprite)~ -** Processing line: ~ puts "No exception was thrown. Sweet!"~ -** Processing line: ~ end~ +** Processing line: ~ # Signal that the user is going to be adding walls from the first grid~ +** Processing line: ~ def dijkstra_mouse_over_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(dijkstra_scale_up(grid.rect))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.reset 100~ -** Processing line: ~ $gtk.log_level = :off~ -** Processing line: ~ $gtk.tests.start~ +** Processing line: ~ # Signal that the user is going to be adding walls from the second grid~ +** Processing line: ~ def greedy_mouse_over_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(greedy_scale_up(grid.rect))~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Signal that the user is going to be adding walls from the third grid~ +** Processing line: ~ def a_star_mouse_over_grid?~ +** Processing line: ~ inputs.mouse.point.inside_rect?(a_star_scale_up(grid.rect))~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the first grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def process_input_dijkstra_star~ +** Processing line: ~ old_star = grid.star.clone~ +** Processing line: ~ unless dijkstra_cell_closest_to_mouse == grid.target~ +** Processing line: ~ grid.star = dijkstra_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_star == grid.star~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Advanced Debugging - Unit Tests - parsing_tests.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Debugging - Unit Tests - parsing_tests.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Moves the star to the cell closest to the mouse in the second grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def process_input_greedy_star~ +** Processing line: ~ old_star = grid.star.clone~ +** Processing line: ~ unless greedy_cell_closest_to_mouse == grid.target~ +** Processing line: ~ grid.star = greedy_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_star == grid.star~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/parsing_tests.rb~ -** Processing line: ~ def test_parse_json args, assert~ -** Processing line: ~ result = args.gtk.parse_json '{ "name": "John Doe", "aliases": ["JD"] }'~ -** Processing line: ~ assert.equal! result, { "name"=>"John Doe", "aliases"=>["JD"] }, "Parsing JSON failed."~ -** Processing line: ~ end~ +** Processing line: ~ # Moves the star to the cell closest to the mouse in the third grid~ +** Processing line: ~ # Only resets the search if the star changes position~ +** Processing line: ~ # Called whenever the user is editing the star (puts mouse down on star)~ +** Processing line: ~ def process_input_a_star_star~ +** Processing line: ~ old_star = grid.star.clone~ +** Processing line: ~ unless a_star_cell_closest_to_mouse == grid.target~ +** Processing line: ~ grid.star = a_star_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_star == grid.star~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_parse_xml args, assert~ -** Processing line: ~ result = args.gtk.parse_xml <<-S~ -** Processing line: ~ ~ -** Processing line: ~ John Doe~ -** Processing line: ~ ~ -** Processing line: ~ S~ +** Processing line: ~ # Moves the target to the grid closest to the mouse in the first grid~ +** Processing line: ~ # Only reset_searchess the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def process_input_dijkstra_target~ +** Processing line: ~ old_target = grid.target.clone~ +** Processing line: ~ unless dijkstra_cell_closest_to_mouse == grid.star~ +** Processing line: ~ grid.target = dijkstra_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_target == grid.target~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ expected = {:type=>:element,~ -** Processing line: ~ :name=>nil,~ -** Processing line: ~ :children=>[{:type=>:element,~ -** Processing line: ~ :name=>"Person",~ -** Processing line: ~ :children=>[{:type=>:element,~ -** Processing line: ~ :name=>"Name",~ -** Processing line: ~ :children=>[{:type=>:content,~ -** Processing line: ~ :data=>"John Doe"}]}],~ -** Processing line: ~ :attributes=>{"id"=>"100"}}]}~ +** Processing line: ~ # Moves the target to the cell closest to the mouse in the second grid~ +** Processing line: ~ # Only reset_searchess the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def process_input_greedy_target~ +** Processing line: ~ old_target = grid.target.clone~ +** Processing line: ~ unless greedy_cell_closest_to_mouse == grid.star~ +** Processing line: ~ grid.target = greedy_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_target == grid.target~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ assert.equal! result, expected, "Parsing xml failed."~ -** Processing line: ~ end~ +** Processing line: ~ # Moves the target to the cell closest to the mouse in the third grid~ +** Processing line: ~ # Only reset_searchess the search if the target changes position~ +** Processing line: ~ # Called whenever the user is editing the target (puts mouse down on target)~ +** Processing line: ~ def process_input_a_star_target~ +** Processing line: ~ old_target = grid.target.clone~ +** Processing line: ~ unless a_star_cell_closest_to_mouse == grid.star~ +** Processing line: ~ grid.target = a_star_cell_closest_to_mouse~ +** Processing line: ~ end~ +** Processing line: ~ unless old_target == grid.target~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** 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: ~ # Removes walls in the first grid that are under the cursor~ +** Processing line: ~ def process_input_dijkstra_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if dijkstra_mouse_over_grid?~ +** Processing line: ~ if grid.walls.has_key?(dijkstra_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls.delete(dijkstra_cell_closest_to_mouse)~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ # Removes walls in the second grid that are under the cursor~ +** Processing line: ~ def process_input_greedy_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if greedy_mouse_over_grid?~ +** Processing line: ~ if grid.walls.has_key?(greedy_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls.delete(greedy_cell_closest_to_mouse)~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Removes walls in the third grid that are under the cursor~ +** Processing line: ~ def process_input_a_star_remove_wall~ +** Processing line: ~ # The mouse needs to be inside the grid, because we only want to remove walls~ +** Processing line: ~ # the cursor is directly over~ +** Processing line: ~ # Recalculations should only occur when a wall is actually deleted~ +** Processing line: ~ if a_star_mouse_over_grid?~ +** Processing line: ~ if grid.walls.has_key?(a_star_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls.delete(a_star_cell_closest_to_mouse)~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ # Adds a wall in the first grid in the cell the mouse is over~ +** Processing line: ~ def process_input_dijkstra_add_wall~ +** Processing line: ~ if dijkstra_mouse_over_grid?~ +** Processing line: ~ unless grid.walls.has_key?(dijkstra_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls[dijkstra_cell_closest_to_mouse] = true~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* Advanced Debugging - Unit Tests - serialize_deserialize_tests.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Debugging - Unit Tests - serialize_deserialize_tests.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Adds a wall in the second grid in the cell the mouse is over~ +** Processing line: ~ def process_input_greedy_add_wall~ +** Processing line: ~ if greedy_mouse_over_grid?~ +** Processing line: ~ unless grid.walls.has_key?(greedy_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls[greedy_cell_closest_to_mouse] = true~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/serialize_deserialize_tests.rb~ -** Processing line: ~ def test_serialize args, assert~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ args.state.player_one = "test"~ -** Processing line: ~ result = args.gtk.serialize_state args.state~ -** Processing line: ~ assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"~ +** Processing line: ~ # Adds a wall in the third grid in the cell the mouse is over~ +** Processing line: ~ def process_input_a_star_add_wall~ +** Processing line: ~ if a_star_mouse_over_grid?~ +** Processing line: ~ unless grid.walls.has_key?(a_star_cell_closest_to_mouse)~ +** Processing line: ~ grid.walls[a_star_cell_closest_to_mouse] = true~ +** Processing line: ~ reset_searches~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ args.gtk.write_file 'state.txt', ''~ -** Processing line: ~ result = args.gtk.serialize_state 'state.txt', args.state~ -** Processing line: ~ assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"~ -** Processing line: ~ end~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse helps with this~ +** Processing line: ~ def dijkstra_cell_closest_to_mouse~ +** Processing line: ~ # Closest cell to the mouse in the first grid~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Bound x and y to the grid~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse in the second grid helps with this~ +** Processing line: ~ def greedy_cell_closest_to_mouse~ +** Processing line: ~ # Closest cell grid to the mouse in the second~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Translate the cell to the first grid~ +** Processing line: ~ x -= grid.width + 1~ +** Processing line: ~ # Bound x and y to the first grid~ +** Processing line: ~ x = 0 if x < 0~ +** Processing line: ~ y = 0 if y < 0~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # When the user grabs the star and puts their cursor to the far right~ +** Processing line: ~ # and moves up and down, the star is supposed to move along the grid as well~ +** Processing line: ~ # Finding the cell closest to the mouse in the third grid helps with this~ +** Processing line: ~ def a_star_cell_closest_to_mouse~ +** Processing line: ~ # Closest cell grid to the mouse in the second~ +** Processing line: ~ x = (inputs.mouse.point.x / grid.cell_size).to_i~ +** Processing line: ~ y = (inputs.mouse.point.y / grid.cell_size).to_i~ +** Processing line: ~ # Translate the cell to the first grid~ +** Processing line: ~ x -= (grid.width + 1) * 2~ +** Processing line: ~ # Bound x and y to the first grid~ +** Processing line: ~ x = 0 if x < 0~ +** Processing line: ~ y = 0 if y < 0~ +** Processing line: ~ x = grid.width - 1 if x > grid.width - 1~ +** Processing line: ~ y = grid.height - 1 if y > grid.height - 1~ +** Processing line: ~ # Return closest cell~ +** Processing line: ~ [x, y]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def reset_searches~ +** Processing line: ~ # Reset the searches~ +** Processing line: ~ dijkstra.came_from = {}~ +** Processing line: ~ dijkstra.cost_so_far = {}~ +** Processing line: ~ dijkstra.frontier = []~ +** Processing line: ~ dijkstra.path = []~ +** Processing line: ~~ +** Processing line: ~ greedy.came_from = {}~ +** Processing line: ~ greedy.frontier = []~ +** Processing line: ~ greedy.path = []~ +** Processing line: ~ a_star.came_from = {}~ +** Processing line: ~ a_star.frontier = []~ +** Processing line: ~ a_star.path = []~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def calc_searches~ +** Processing line: ~ calc_dijkstra~ +** Processing line: ~ calc_greedy~ +** Processing line: ~ calc_a_star~ +** Processing line: ~ # Move the searches forward to the current step~ +** Processing line: ~ # state.current_step.times { move_searches_one_step_forward }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def calc_dijkstra~ +** Processing line: ~ # Sets up the search to begin from the star~ +** Processing line: ~ dijkstra.frontier << grid.star~ +** Processing line: ~ dijkstra.came_from[grid.star] = nil~ +** Processing line: ~ dijkstra.cost_so_far[grid.star] = 0~ +** Processing line: ~~ +** Processing line: ~ # Until the target is found or there are no more cells to explore from~ +** Processing line: ~ until dijkstra.came_from.has_key?(grid.target) or dijkstra.frontier.empty?~ +** Processing line: ~ # Take the next frontier cell. The first element is the cell, the second is the priority.~ +** Processing line: ~ new_frontier = dijkstra.frontier.shift#[0]~ +** Processing line: ~ # For each of its neighbors~ +** Processing line: ~ adjacent_neighbors(new_frontier).each do | neighbor |~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless dijkstra.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited~ +** Processing line: ~ dijkstra.frontier << neighbor~ +** Processing line: ~ dijkstra.came_from[neighbor] = new_frontier~ +** Processing line: ~ dijkstra.cost_so_far[neighbor] = dijkstra.cost_so_far[new_frontier] + 1~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_deserialize args, assert~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ result = args.gtk.deserialize_state '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}'~ -** Processing line: ~ assert.equal! result.player_one, "test"~ +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ +** Processing line: ~ # Comment this line and let a path generate to see the difference~ +** Processing line: ~ dijkstra.frontier = dijkstra.frontier.sort_by {| cell | proximity_to_star(cell) }~ +** Processing line: ~ dijkstra.frontier = dijkstra.frontier.sort_by {| cell | dijkstra.cost_so_far[cell] }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ args.gtk.write_file 'state.txt', '{:entity_id=>3, :tick_count=>-1, :player_one=>"test"}'~ -** Processing line: ~ result = args.gtk.deserialize_state 'state.txt'~ -** Processing line: ~ assert.equal! result.player_one, "test"~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_very_large_serialization args, assert~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ size = 3000~ -** Processing line: ~ size.map_with_index do |i|~ -** Processing line: ~ args.state.send("k#{i}=".to_sym, i)~ +** Processing line: ~ # If the search found the target~ +** Processing line: ~ if dijkstra.came_from.has_key?(grid.target)~ +** Processing line: ~ # Calculate the path between the target and star~ +** Processing line: ~ dijkstra_calc_path~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ result = args.gtk.serialize_state args.state~ -** Processing line: ~ assert.true! (args.gtk.console.log.join.include? "unlikely a string this large will deserialize correctly")~ -** Processing line: ~ end~ +** Processing line: ~ def calc_greedy~ +** Processing line: ~ # Sets up the search to begin from the star~ +** Processing line: ~ greedy.frontier << grid.star~ +** Processing line: ~ greedy.came_from[grid.star] = nil~ ** Processing line: ~~ -** Processing line: ~ def test_strict_entity_serialization args, assert~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ args.state.player_one = args.state.new_entity(:player, name: "Ryu")~ -** Processing line: ~ args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken")~ +** Processing line: ~ # Until the target is found or there are no more cells to explore from~ +** Processing line: ~ until greedy.came_from.has_key?(grid.target) or greedy.frontier.empty?~ +** Processing line: ~ # Take the next frontier cell~ +** Processing line: ~ new_frontier = greedy.frontier.shift~ +** Processing line: ~ # For each of its neighbors~ +** Processing line: ~ adjacent_neighbors(new_frontier).each do | neighbor |~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless greedy.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited~ +** Processing line: ~ greedy.frontier << neighbor~ +** Processing line: ~ greedy.came_from[neighbor] = new_frontier~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ +** Processing line: ~ # Comment this line and let a path generate to see the difference~ +** Processing line: ~ greedy.frontier = greedy.frontier.sort_by {| cell | proximity_to_star(cell) }~ +** Processing line: ~ # Sort the frontier so cells that are close to the target are then prioritized~ +** Processing line: ~ greedy.frontier = greedy.frontier.sort_by {| cell | greedy_heuristic(cell) }~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ -** Processing line: ~ assert.equal! serialized_state, '{:entity_id=>1, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>3, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken"}}'~ ** Processing line: ~~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ deserialize_state = args.gtk.deserialize_state serialized_state~ +** Processing line: ~ # If the search found the target~ +** Processing line: ~ if greedy.came_from.has_key?(grid.target)~ +** Processing line: ~ # Calculate the path between the target and star~ +** Processing line: ~ greedy_calc_path~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ assert.equal! args.state.player_one.name, deserialize_state.player_one.name~ -** Processing line: ~ assert.true! args.state.player_one.is_a? GTK::OpenEntity~ +** Processing line: ~ def calc_a_star~ +** Processing line: ~ # Setup the search to start from the star~ +** Processing line: ~ a_star.came_from[grid.star] = nil~ +** Processing line: ~ a_star.cost_so_far[grid.star] = 0~ +** Processing line: ~ a_star.frontier << grid.star~ ** Processing line: ~~ -** Processing line: ~ assert.equal! args.state.player_two.name, deserialize_state.player_two.name~ -** Processing line: ~ assert.true! args.state.player_two.is_a? GTK::StrictEntity~ -** Processing line: ~ end~ +** Processing line: ~ # Until there are no more cells to explore from or the search has found the target~ +** Processing line: ~ until a_star.frontier.empty? or a_star.came_from.has_key?(grid.target)~ +** Processing line: ~ # Get the next cell to expand from~ +** Processing line: ~ current_frontier = a_star.frontier.shift~ ** Processing line: ~~ -** Processing line: ~ def test_strict_entity_serialization_with_nil args, assert~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ args.state.player_one = args.state.new_entity(:player, name: "Ryu")~ -** Processing line: ~ args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken", blood_type: nil)~ +** Processing line: ~ # For each of that cells neighbors~ +** Processing line: ~ adjacent_neighbors(current_frontier).each do | neighbor |~ +** Processing line: ~ # That have not been visited and are not walls~ +** Processing line: ~ unless a_star.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)~ +** Processing line: ~ # Add them to the frontier and mark them as visited~ +** Processing line: ~ a_star.frontier << neighbor~ +** Processing line: ~ a_star.came_from[neighbor] = current_frontier~ +** Processing line: ~ a_star.cost_so_far[neighbor] = a_star.cost_so_far[current_frontier] + 1~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ -** Processing line: ~ assert.equal! serialized_state, '{:entity_id=>9, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}'~ +** Processing line: ~ # Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line~ +** Processing line: ~ # Comment this line and let a path generate to see the difference~ +** Processing line: ~ a_star.frontier = a_star.frontier.sort_by {| cell | proximity_to_star(cell) }~ +** Processing line: ~ a_star.frontier = a_star.frontier.sort_by {| cell | a_star.cost_so_far[cell] + greedy_heuristic(cell) }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # If the search found the target~ +** Processing line: ~ if a_star.came_from.has_key?(grid.target)~ +** Processing line: ~ # Calculate the path between the target and star~ +** Processing line: ~ a_star_calc_path~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Calculates the path between the target and star for the breadth first search~ +** Processing line: ~ # Only called when the breadth first search finds the target~ +** Processing line: ~ def dijkstra_calc_path~ +** Processing line: ~ # Start from the target~ +** Processing line: ~ endpoint = grid.target~ +** Processing line: ~ # And the cell it came from~ +** Processing line: ~ next_endpoint = dijkstra.came_from[endpoint]~ +** Processing line: ~ while endpoint and next_endpoint~ +** Processing line: ~ # Draw a path between these two cells and store it~ +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ +** Processing line: ~ dijkstra.path << path~ +** Processing line: ~ # And get the next pair of cells~ +** Processing line: ~ endpoint = next_endpoint~ +** Processing line: ~ next_endpoint = dijkstra.came_from[endpoint]~ +** Processing line: ~ # Continue till there are no more cells~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Returns one-dimensional absolute distance between cell and target~ +** Processing line: ~ # Returns a number to compare distances between cells and the target~ +** Processing line: ~ def greedy_heuristic(cell)~ +** Processing line: ~ (grid.target.x - cell.x).abs + (grid.target.y - cell.y).abs~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Calculates the path between the target and star for the greedy search~ +** Processing line: ~ # Only called when the greedy search finds the target~ +** Processing line: ~ def greedy_calc_path~ +** Processing line: ~ # Start from the target~ +** Processing line: ~ endpoint = grid.target~ +** Processing line: ~ # And the cell it came from~ +** Processing line: ~ next_endpoint = greedy.came_from[endpoint]~ +** Processing line: ~ while endpoint and next_endpoint~ +** Processing line: ~ # Draw a path between these two cells and store it~ +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ +** Processing line: ~ greedy.path << path~ +** Processing line: ~ # And get the next pair of cells~ +** Processing line: ~ endpoint = next_endpoint~ +** Processing line: ~ next_endpoint = greedy.came_from[endpoint]~ +** Processing line: ~ # Continue till there are no more cells~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Calculates the path between the target and star for the a_star search~ +** Processing line: ~ # Only called when the a_star search finds the target~ +** Processing line: ~ def a_star_calc_path~ +** Processing line: ~ # Start from the target~ +** Processing line: ~ endpoint = grid.target~ +** Processing line: ~ # And the cell it came from~ +** Processing line: ~ next_endpoint = a_star.came_from[endpoint]~ +** Processing line: ~~ +** Processing line: ~ while endpoint and next_endpoint~ +** Processing line: ~ # Draw a path between these two cells and store it~ +** Processing line: ~ path = get_path_between(endpoint, next_endpoint)~ +** Processing line: ~ a_star.path << path~ +** Processing line: ~ # And get the next pair of cells~ +** Processing line: ~ endpoint = next_endpoint~ +** Processing line: ~ next_endpoint = a_star.came_from[endpoint]~ +** Processing line: ~ # Continue till there are no more cells~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Returns a list of adjacent cells~ +** Processing line: ~ # Used to determine what the next cells to be added to the frontier are~ +** Processing line: ~ def adjacent_neighbors(cell)~ +** Processing line: ~ neighbors = []~ +** Processing line: ~~ +** Processing line: ~ # Gets all the valid neighbors into the array~ +** Processing line: ~ # From southern neighbor, clockwise~ +** Processing line: ~ neighbors << [cell.x , cell.y - 1] unless cell.y == 0~ +** Processing line: ~ neighbors << [cell.x - 1, cell.y ] unless cell.x == 0~ +** Processing line: ~ neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1~ +** Processing line: ~ neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1~ +** Processing line: ~~ +** Processing line: ~ neighbors~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Finds the vertical and horizontal distance of a cell from the star~ +** Processing line: ~ # and returns the larger value~ +** Processing line: ~ # This method is used to have a zigzag pattern in the rendered path~ +** Processing line: ~ # A cell that is [5, 5] from the star,~ +** Processing line: ~ # is explored before over a cell that is [0, 7] away.~ +** Processing line: ~ # So, if possible, the search tries to go diagonal (zigzag) first~ +** Processing line: ~ def proximity_to_star(cell)~ +** Processing line: ~ distance_x = (grid.star.x - cell.x).abs~ +** Processing line: ~ distance_y = (grid.star.y - cell.y).abs~ +** Processing line: ~~ +** Processing line: ~ if distance_x > distance_y~ +** Processing line: ~ return distance_x~ +** Processing line: ~ else~ +** Processing line: ~ return distance_y~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ +** Processing line: ~ # Methods that allow code to be more concise. Subdivides args.state, which is where all variables are stored.~ +** Processing line: ~ def grid~ +** Processing line: ~ state.grid~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ assert.equal! args.state.player_one.name, deserialized_state.player_one.name~ -** Processing line: ~ assert.true! args.state.player_one.is_a? GTK::OpenEntity~ +** Processing line: ~ def dijkstra~ +** Processing line: ~ state.dijkstra~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ assert.equal! args.state.player_two.name, deserialized_state.player_two.name~ -** Processing line: ~ assert.equal! args.state.player_two.blood_type, deserialized_state.player_two.blood_type~ -** Processing line: ~ assert.equal! deserialized_state.player_two.blood_type, nil~ -** Processing line: ~ assert.true! args.state.player_two.is_a? GTK::StrictEntity~ +** Processing line: ~ def greedy~ +** Processing line: ~ state.greedy~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ deserialized_state.player_two.blood_type = :O~ -** Processing line: ~ assert.equal! deserialized_state.player_two.blood_type, :O~ -** Processing line: ~ end~ +** Processing line: ~ def a_star~ +** Processing line: ~ state.a_star~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_multiple_strict_entities args, assert~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ args.state.player = args.state.new_entity_strict(:player_one, name: "Ryu")~ -** Processing line: ~ args.state.enemy = args.state.new_entity_strict(:enemy, name: "Bison", other_property: 'extra mean')~ +** Processing line: ~ # Descriptive aliases for colors~ +** Processing line: ~ def default_color~ +** Processing line: ~ [221, 212, 213] # Light Brown~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ +** Processing line: ~ def wall_color~ +** Processing line: ~ [134, 134, 120] # Camo Green~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ +** Processing line: ~ def visited_color~ +** Processing line: ~ [204, 191, 179] # Dark Brown~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ assert.equal! deserialized_state.player.name, "Ryu"~ -** Processing line: ~ assert.equal! deserialized_state.enemy.other_property, "extra mean"~ +** Processing line: ~ def path_color~ +** Processing line: ~ [231, 230, 228] # Pastel White~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def button_color~ +** Processing line: ~ [190, 190, 190] # Gray~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_by_reference_state args, assert~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ args.state.a = { name: "Jane Doe" }~ -** Processing line: ~ args.state.b = args.state.a~ -** Processing line: ~ assert.equal! args.state.a.object_id, args.state.b.object_id~ -** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ ** Processing line: ~~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ -** Processing line: ~ assert.equal! deserialized_state.a.object_id, deserialized_state.b.object_id~ -** Processing line: ~ end~ +** Processing line: ~ # Method that is called by DragonRuby periodically~ +** Processing line: ~ # Used for updating animations and calculations~ +** Processing line: ~ def tick args~ ** Processing line: ~~ -** Processing line: ~ def test_by_reference_state_strict_entities args, assert~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ args.state.a = { name: "Jane Doe" }~ -** Processing line: ~ args.state.strict_entity = args.state.new_entity_strict(:couple) do |e|~ -** Processing line: ~ e.one = args.state.new_entity_strict(:person, name: "Jane")~ -** Processing line: ~ e.two = e.one~ +** Processing line: ~ # Pressing r will reset the application~ +** Processing line: ~ if args.inputs.keyboard.key_down.r~ +** Processing line: ~ args.gtk.reset~ +** Processing line: ~ reset~ +** Processing line: ~ return~ ** Processing line: ~ end~ -** Processing line: ~ assert.equal! args.state.strict_entity.one, args.state.strict_entity.two~ -** Processing line: ~ serialized_state = args.gtk.serialize_state args.state~ ** Processing line: ~~ -** Processing line: ~ GTK::Entity.__reset_id__!~ -** Processing line: ~ deserialized_state = args.gtk.deserialize_state serialized_state~ -** Processing line: ~ assert.equal! deserialized_state.strict_entity.one, deserialized_state.strict_entity.two~ +** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~ +** Processing line: ~ $a_star_algorithm ||= A_Star_Algorithm.new(args)~ +** Processing line: ~ $a_star_algorithm.args = args~ +** Processing line: ~ $a_star_algorithm.tick~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $tests.start~ +** Processing line: ~~ +** Processing line: ~ def reset~ +** Processing line: ~ $a_star_algorithm = nil~ +** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb~ -- H1 detected. +** Processing line: ~*** Path Finding Algorithms - Tower Defense - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Path Finding Algorithms - Tower Defense - 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: ~Path Finding Algorithms - Tower Defense - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ ** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ # ./samples/10_advanced_debugging/03_unit_tests/state_serialization_experimental_tests.rb~ -** Processing line: ~ MAX_CODE_GEN_LENGTH = 50~ +** Processing line: ~ # ./samples/13_path_finding_algorithms/09_tower_defense/app/main.rb~ +** Processing line: ~ # An example of some major components in a tower defence game~ +** Processing line: ~ # The pathing of the tanks is determined by A* algorithm -- try editing the walls~ ** Processing line: ~~ -** Processing line: ~ # NOTE: This is experimental/advanced stuff.~ -** Processing line: ~ def needs_partitioning? target~ -** Processing line: ~ target[:value].to_s.length > MAX_CODE_GEN_LENGTH~ +** Processing line: ~ # The turrets shoot bullets at the closest tank. The bullets are heat-seeking~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ $gtk.reset if args.inputs.keyboard.key_down.r~ +** Processing line: ~ defaults args~ +** Processing line: ~ render args~ +** Processing line: ~ calc args~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def partition target~ -** Processing line: ~ return [] unless needs_partitioning? target~ -** Processing line: ~ if target[:value].is_a? GTK::OpenEntity~ -** Processing line: ~ target[:value] = target[:value].hash~ -** Processing line: ~ end~ +** Processing line: ~ def defaults args~ +** Processing line: ~ args.outputs.background_color = wall_color~ +** Processing line: ~ args.state.grid_size = 5~ +** Processing line: ~ args.state.tile_size = 50~ +** Processing line: ~ args.state.grid_start ||= [0, 0]~ +** Processing line: ~ args.state.grid_goal ||= [4, 4]~ +** Processing line: ~~ +** Processing line: ~ # Try editing these walls to see the path change!~ +** Processing line: ~ args.state.walls ||= {~ +** Processing line: ~ [0, 4] => true,~ +** Processing line: ~ [1, 3] => true,~ +** Processing line: ~ [3, 1] => true,~ +** Processing line: ~ # [4, 0] => true,~ +** Processing line: ~ }~ ** Processing line: ~~ -** Processing line: ~ results = []~ -** Processing line: ~ idx = 0~ -** Processing line: ~ left, right = target[:value].partition do~ -** Processing line: ~ idx += 1~ -** Processing line: ~ idx.even?~ +** Processing line: ~ args.state.a_star.frontier ||= []~ +** Processing line: ~ args.state.a_star.came_from ||= {}~ +** Processing line: ~ args.state.a_star.path ||= []~ +** Processing line: ~~ +** Processing line: ~ args.state.tanks ||= []~ +** Processing line: ~ args.state.tank_spawn_period ||= 60~ +** Processing line: ~ args.state.tank_sprite_path ||= 'sprites/circle/white.png'~ +** Processing line: ~ args.state.tank_speed ||= 1~ +** Processing line: ~~ +** Processing line: ~ args.state.turret_shoot_period = 10~ +** Processing line: ~ # Turrets can be entered as [x, y] but are immediately mapped to hashes~ +** Processing line: ~ # Walls are also added where the turrets are to prevent tanks from pathing over them~ +** Processing line: ~ args.state.turrets ||= [~ +** Processing line: ~ [2, 2]~ +** Processing line: ~ ].each { |turret| args.state.walls[turret] = true}.map do |x, y|~ +** Processing line: ~ {~ +** Processing line: ~ x: x * args.state.tile_size,~ +** Processing line: ~ y: y * args.state.tile_size,~ +** Processing line: ~ w: args.state.tile_size,~ +** Processing line: ~ h: args.state.tile_size,~ +** Processing line: ~ path: 'sprites/circle/gray.png',~ +** Processing line: ~ range: 100~ +** Processing line: ~ }~ ** Processing line: ~ end~ -** Processing line: ~ left, right = Hash[left], Hash[right]~ -** Processing line: ~ left = { value: left }~ -** Processing line: ~ right = { value: right}~ -** Processing line: ~ [left, right]~ -** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def add_partition target, path, aggregate, final_result~ -** Processing line: ~ partitions = partition target~ -** Processing line: ~ partitions.each do |part|~ -** Processing line: ~ if needs_partitioning? part~ -** Processing line: ~ if part[:value].keys.length == 1~ -** Processing line: ~ first_key = part[:value].keys[0]~ -** Processing line: ~ new_part = { value: part[:value][first_key] }~ -** Processing line: ~ path.push first_key~ -** Processing line: ~ add_partition new_part, path, aggregate, final_result~ -** Processing line: ~ path.pop~ -** Processing line: ~ else~ -** Processing line: ~ add_partition part, path, aggregate, final_result~ -** Processing line: ~ end~ -** Processing line: ~ else~ -** Processing line: ~ final_result << { value: { __path__: [*path] } }~ -** Processing line: ~ final_result << { value: part[:value] }~ -** Processing line: ~ end~ -** Processing line: ~ end~ +** Processing line: ~ args.state.bullet_size ||= 25~ +** Processing line: ~ args.state.bullets ||= []~ +** Processing line: ~ args.state.bullet_path ||= 'sprites/circle/orange.png'~ +** Processing line: ~ #~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def state_to_string state~ -** Processing line: ~ parts_queue = []~ -** Processing line: ~ final_queue = []~ -** Processing line: ~ add_partition({ value: state.hash },~ -** Processing line: ~ [],~ -** Processing line: ~ parts_queue,~ -** Processing line: ~ final_queue)~ -** Processing line: ~ final_queue.reject {|i| i[:value].keys.length == 0}.map do |i|~ -** Processing line: ~ i[:value].to_s~ -** Processing line: ~ end.join("\n#==================================================#\n")~ +** Processing line: ~ def render args~ +** Processing line: ~ render_grid args~ +** Processing line: ~ render_a_star args~ +** Processing line: ~ args.outputs.sprites << args.state.tanks~ +** Processing line: ~ args.outputs.sprites << args.state.turrets~ +** Processing line: ~ args.outputs.sprites << args.state.bullets~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def state_from_string string~ -** Processing line: ~ Kernel.eval("$load_data = {}")~ -** Processing line: ~ lines = string.split("\n#==================================================#\n")~ -** Processing line: ~ lines.each do |l|~ -** Processing line: ~ puts "todo: #{l}"~ +** Processing line: ~ def render_grid args~ +** Processing line: ~ # Draw a square the size and color of the grid~ +** Processing line: ~ args.outputs.solids << [~ +** Processing line: ~ 0,~ +** Processing line: ~ 0,~ +** Processing line: ~ args.state.grid_size * args.state.tile_size,~ +** Processing line: ~ args.state.grid_size * args.state.tile_size,~ +** Processing line: ~ grid_color~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ # Draw lines across the grid to show tiles~ +** Processing line: ~ (args.state.grid_size + 1).times do | value |~ +** Processing line: ~ render_horizontal_line(args, value)~ +** Processing line: ~ render_vertical_line(args, value)~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ GTK::OpenEntity.parse_from_hash $load_data~ +** Processing line: ~ # Render special tiles~ +** Processing line: ~ render_tile(args, args.state.grid_start, start_color)~ +** Processing line: ~ render_tile(args, args.state.grid_goal, goal_color)~ +** Processing line: ~ args.state.walls.keys.each { |wall| render_tile(args, wall, wall_color) }~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_save_and_load args, assert~ -** Processing line: ~ args.state.item_1.name = "Jane"~ -** Processing line: ~ string = state_to_string args.state~ -** Processing line: ~ state = state_from_string string~ -** Processing line: ~ assert.equal! args.state.item_1.name, state.item_1.name~ +** Processing line: ~ def render_vertical_line args, x~ +** Processing line: ~ args.outputs.lines << [~ +** Processing line: ~ x * args.state.tile_size,~ +** Processing line: ~ 0,~ +** Processing line: ~ x * args.state.tile_size,~ +** Processing line: ~ args.state.tile_size * args.state.grid_size,~ +** Processing line: ~ ]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_save_and_load_big args, assert~ -** Processing line: ~ size = 1000~ -** Processing line: ~ size.map_with_index do |i|~ -** Processing line: ~ args.state.send("k#{i}=".to_sym, i)~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ string = state_to_string args.state~ -** Processing line: ~ state = state_from_string string~ -** Processing line: ~ size.map_with_index do |i|~ -** Processing line: ~ assert.equal! args.state.send("k#{i}".to_sym), state.send("k#{i}".to_sym)~ -** Processing line: ~ assert.equal! args.state.send("k#{i}".to_sym), i~ -** Processing line: ~ assert.equal! state.send("k#{i}".to_sym), i~ -** Processing line: ~ end~ +** Processing line: ~ def render_horizontal_line args, y~ +** Processing line: ~ args.outputs.lines << [~ +** Processing line: ~ 0,~ +** Processing line: ~ y * args.state.tile_size,~ +** Processing line: ~ args.state.tile_size * args.state.grid_size,~ +** Processing line: ~ y * args.state.tile_size,~ +** Processing line: ~ ]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def test_save_and_load_big_nested args, assert~ -** Processing line: ~ args.state.player_one.friend.nested_hash.k0 = 0~ -** Processing line: ~ args.state.player_one.friend.nested_hash.k1 = 1~ -** Processing line: ~ args.state.player_one.friend.nested_hash.k2 = 2~ -** Processing line: ~ args.state.player_one.friend.nested_hash.k3 = 3~ -** Processing line: ~ args.state.player_one.friend.nested_hash.k4 = 4~ -** Processing line: ~ args.state.player_one.friend.nested_hash.k5 = 5~ -** Processing line: ~ args.state.player_one.friend.nested_hash.k6 = 6~ -** Processing line: ~ args.state.player_one.friend.nested_hash.k7 = 7~ -** Processing line: ~ args.state.player_one.friend.nested_hash.k8 = 8~ -** Processing line: ~ args.state.player_one.friend.nested_hash.k9 = 9~ -** Processing line: ~ string = state_to_string args.state~ -** Processing line: ~ state = state_from_string string~ +** Processing line: ~ def render_tile args, tile, color~ +** Processing line: ~ args.outputs.solids << [~ +** Processing line: ~ tile.x * args.state.tile_size,~ +** Processing line: ~ tile.y * args.state.tile_size,~ +** Processing line: ~ args.state.tile_size,~ +** Processing line: ~ args.state.tile_size,~ +** Processing line: ~ color~ +** Processing line: ~ ]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ $gtk.reset 100~ -** Processing line: ~ $gtk.log_level = :off~ -** Processing line: ~ $gtk.tests.start~ +** Processing line: ~ def calc args~ +** Processing line: ~ calc_a_star args~ +** Processing line: ~ calc_tanks args~ +** Processing line: ~ calc_turrets args~ +** Processing line: ~ calc_bullets args~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def calc_a_star args~ +** Processing line: ~ # Only does this one time~ +** Processing line: ~ return unless args.state.a_star.path.empty?~ ** Processing line: ~~ +** Processing line: ~ # Start the search from the grid start~ +** Processing line: ~ args.state.a_star.frontier << args.state.grid_start~ +** Processing line: ~ args.state.a_star.came_from[args.state.grid_start] = nil~ ** Processing line: ~~ -** Processing line: ~* Http - Retrieve Images - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Http - Retrieve Images - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ # Until a path to the goal has been found or there are no more tiles to explore~ +** Processing line: ~ until (args.state.a_star.came_from.has_key?(args.state.grid_goal)|| args.state.a_star.frontier.empty?)~ +** Processing line: ~ # For the first tile in the frontier~ +** Processing line: ~ tile_to_expand_from = args.state.a_star.frontier.shift~ +** Processing line: ~ # Add each of its neighbors to the frontier~ +** Processing line: ~ neighbors(args, tile_to_expand_from).each do | tile |~ +** Processing line: ~ args.state.a_star.frontier << tile~ +** Processing line: ~ args.state.a_star.came_from[tile] = tile_to_expand_from~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/11_http/01_retrieve_images/app/main.rb~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +** Processing line: ~ # Stop calculating a path if the goal was never reached~ +** Processing line: ~ return unless args.state.a_star.came_from.has_key? args.state.grid_goal~ ** Processing line: ~~ -** Processing line: ~ # Show a warning at the start.~ -** Processing line: ~ args.state.warning_debounce ||= 11 * 60~ -** Processing line: ~ if args.state.warning_debounce > 0~ -** Processing line: ~ args.state.warning_debounce -= 1~ -** Processing line: ~ args.outputs.labels << [640, 600, "This app shows random images from the Internet.", 10, 1, 255, 255, 255]~ -** Processing line: ~ args.outputs.labels << [640, 500, "Quit in the next few seconds if this is a problem.", 10, 1, 255, 255, 255]~ -** Processing line: ~ args.outputs.labels << [640, 350, "#{(args.state.warning_debounce / 60.0).to_i}", 10, 1, 255, 255, 255]~ -** Processing line: ~ return~ +** Processing line: ~ # Fill path by tracing back from the goal~ +** Processing line: ~ current_cell = args.state.grid_goal~ +** Processing line: ~ while current_cell~ +** Processing line: ~ args.state.a_star.path.unshift current_cell~ +** Processing line: ~ current_cell = args.state.a_star.came_from[current_cell]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ args.state.download_debounce ||= 0 # start immediately, reset to non zero later.~ -** Processing line: ~ args.state.photos ||= []~ +** Processing line: ~ puts "The path has been calculated"~ +** Processing line: ~ puts args.state.a_star.path~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # Put a little pause between each download.~ -** Processing line: ~ if args.state.download.nil?~ -** Processing line: ~ if args.state.download_debounce > 0~ -** Processing line: ~ args.state.download_debounce -= 1~ -** Processing line: ~ else~ -** Processing line: ~ args.state.download = $gtk.http_get 'https://picsum.photos/200/300.jpg'~ +** Processing line: ~ def calc_tanks args~ +** Processing line: ~ spawn_tank args~ +** Processing line: ~ move_tanks args~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def move_tanks args~ +** Processing line: ~ # Remove tanks that have reached the end of their path~ +** Processing line: ~ args.state.tanks.reject! { |tank| tank[:a_star].empty? }~ +** Processing line: ~~ +** Processing line: ~ # Tanks have an array that has each tile it has to go to in order from a* path~ +** Processing line: ~ args.state.tanks.each do | tank |~ +** Processing line: ~ destination = tank[:a_star][0]~ +** Processing line: ~ # Move the tank towards the destination~ +** Processing line: ~ tank[:x] += copy_sign(args.state.tank_speed, ((destination.x * args.state.tile_size) - tank[:x]))~ +** Processing line: ~ tank[:y] += copy_sign(args.state.tank_speed, ((destination.y * args.state.tile_size) - tank[:y]))~ +** Processing line: ~ # If the tank has reached its destination~ +** Processing line: ~ if (destination.x * args.state.tile_size) == tank[:x] and~ +** Processing line: ~ (destination.y * args.state.tile_size) == tank[:y]~ +** Processing line: ~ # Set the destination to the next point in the path~ +** Processing line: ~ tank[:a_star].shift~ ** Processing line: ~ end~ ** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ if !args.state.download.nil?~ -** Processing line: ~ if args.state.download[:complete]~ -** Processing line: ~ if args.state.download[:http_response_code] == 200~ -** Processing line: ~ fname = "sprites/#{args.state.photos.length}.jpg"~ -** Processing line: ~ $gtk.write_file fname, args.state.download[:response_data]~ -** Processing line: ~ args.state.photos << [ 100 + rand(1080), 500 - rand(480), fname, rand(80) - 40 ]~ +** Processing line: ~ def calc_turrets args~ +** Processing line: ~ return unless args.state.tick_count.mod_zero? args.state.turret_shoot_period~ +** Processing line: ~ args.state.turrets.each do | turret |~ +** Processing line: ~ # Finds the closest tank~ +** Processing line: ~ target = nil~ +** Processing line: ~ shortest_distance = turret[:range] + 1~ +** Processing line: ~ args.state.tanks.each do | tank |~ +** Processing line: ~ distance = distance_between(turret[:x], turret[:y], tank[:x], tank[:y])~ +** Processing line: ~ if distance < shortest_distance~ +** Processing line: ~ target = tank~ +** Processing line: ~ shortest_distance = distance~ ** Processing line: ~ end~ -** Processing line: ~ args.state.download = nil~ -** Processing line: ~ args.state.download_debounce = (rand(3) + 2) * 60~ ** Processing line: ~ end~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ # draw any downloaded photos...~ -** Processing line: ~ args.state.photos.each { |i|~ -** Processing line: ~ args.outputs.primitives << [i[0], i[1], 200, 300, i[2], i[3]].sprite~ -** Processing line: ~ }~ -** Processing line: ~~ -** Processing line: ~ # Draw a download progress bar...~ -** Processing line: ~ args.outputs.primitives << [0, 0, 1280, 30, 0, 0, 0, 255].solid~ -** Processing line: ~ if !args.state.download.nil?~ -** Processing line: ~ br = args.state.download[:response_read]~ -** Processing line: ~ total = args.state.download[:response_total]~ -** Processing line: ~ if total != 0~ -** Processing line: ~ pct = br.to_f / total.to_f~ -** Processing line: ~ args.outputs.primitives << [0, 0, 1280 * pct, 30, 0, 0, 255, 255].solid~ +** Processing line: ~ # If there is a tank in range, fires a bullet~ +** Processing line: ~ if target~ +** Processing line: ~ args.state.bullets << {~ +** Processing line: ~ x: turret[:x],~ +** Processing line: ~ y: turret[:y],~ +** Processing line: ~ w: args.state.bullet_size,~ +** Processing line: ~ h: args.state.bullet_size,~ +** Processing line: ~ path: args.state.bullet_path,~ +** Processing line: ~ # Note that this makes it heat-seeking, because target is passed by reference~ +** Processing line: ~ # Could do target.clone to make the bullet go to where the tank initially was~ +** Processing line: ~ target: target~ +** Processing line: ~ }~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def calc_bullets args~ +** Processing line: ~ # Bullets aim for the center of their targets~ +** Processing line: ~ args.state.bullets.each { |bullet| move bullet, center_of(bullet[:target])}~ +** Processing line: ~ args.state.bullets.reject! { |b| b.intersect_rect? b[:target] }~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def center_of object~ +** Processing line: ~ object = object.clone~ +** Processing line: ~ object[:x] += 0.5~ +** Processing line: ~ object[:y] += 0.5~ +** Processing line: ~ object~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* 12 C Extensions - Basics - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~12 C Extensions - Basics - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def render_a_star args~ +** Processing line: ~ args.state.a_star.path.map do |tile|~ +** Processing line: ~ # Map each x, y coordinate to the center of the tile and scale up~ +** Processing line: ~ [(tile.x + 0.5) * args.state.tile_size, (tile.y + 0.5) * args.state.tile_size]~ +** Processing line: ~ end.inject do | point_a, point_b |~ +** Processing line: ~ # Render the line between each point~ +** Processing line: ~ args.outputs.lines << [point_a.x, point_a.y, point_b.x, point_b.y, a_star_color]~ +** Processing line: ~ point_b~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/12_c_extensions/01_basics/app/main.rb~ -** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ -** Processing line: ~ include FFI::CExt~ +** Processing line: ~ # Moves object to target at speed~ +** Processing line: ~ def move object, target, speed = 1~ +** Processing line: ~ if target.is_a? Hash~ +** Processing line: ~ object[:x] += copy_sign(speed, target[:x] - object[:x])~ +** Processing line: ~ object[:y] += copy_sign(speed, target[:y] - object[:y])~ +** Processing line: ~ else~ +** Processing line: ~ object[:x] += copy_sign(speed, target.x - object[:x])~ +** Processing line: ~ object[:y] += copy_sign(speed, target.y - object[:y])~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ #~ +** Processing line: ~ #~ +** Processing line: ~ def distance_between a_x, a_y, b_x, b_y~ +** Processing line: ~ (((b_x - a_x) ** 2) + ((b_y - a_y) ** 2)) ** 0.5~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.labels << [640, 500, "mouse.x = #{args.mouse.x.to_i}", 5, 1]~ -** Processing line: ~ args.outputs.labels << [640, 460, "square(mouse.x) = #{square(args.mouse.x.to_i)}", 5, 1]~ -** Processing line: ~ args.outputs.labels << [640, 420, "mouse.y = #{args.mouse.y.to_i}", 5, 1]~ -** Processing line: ~ args.outputs.labels << [640, 380, "square(mouse.y) = #{square(args.mouse.y.to_i)}", 5, 1]~ +** Processing line: ~ def copy_sign value, sign~ +** Processing line: ~ return 0 if sign == 0~ +** Processing line: ~ return value if sign > 0~ +** Processing line: ~ -value~ +** Processing line: ~ end~ +** Processing line: ~ #~ +** Processing line: ~ def spawn_tank args~ +** Processing line: ~ return unless args.state.tick_count.mod_zero? args.state.tank_spawn_period~ +** Processing line: ~ args.state.tanks << {~ +** Processing line: ~ x: args.state.grid_start.x,~ +** Processing line: ~ y: args.state.grid_start.y,~ +** Processing line: ~ w: args.state.tile_size,~ +** Processing line: ~ h: args.state.tile_size,~ +** Processing line: ~ path: args.state.tank_sprite_path,~ +** Processing line: ~ a_star: args.state.a_star.path.clone~ +** Processing line: ~ }~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def neighbors args, tile~ +** Processing line: ~ [[tile.x, tile.y - 1],~ +** Processing line: ~ [tile.x, tile.y + 1],~ +** Processing line: ~ [tile.x + 1, tile.y],~ +** Processing line: ~ [tile.x - 1, tile.y]].reject do | neighbor |~ +** Processing line: ~ args.state.a_star.came_from.has_key?(neighbor) or~ +** Processing line: ~ tile_out_of_bounds?(args, neighbor) or~ +** Processing line: ~ args.state.walls.has_key? neighbor~ +** Processing line: ~ end~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. +** Processing line: ~ def tile_out_of_bounds? args, tile~ +** Processing line: ~ tile.x < 0 or tile.y < 0 or tile.x >= args.state.grid_size or tile.y >= args.state.grid_size~ +** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def grid_color~ +** Processing line: ~ [133, 226, 144]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~* 12 C Extensions - Intermediate - main.rb~ -- H1 detected. -- Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~12 C Extensions - Intermediate - main.rb~ -- Line's tilde count is: 0 -- Line contains link marker: false +** Processing line: ~ def start_color~ +** Processing line: ~ [226, 144, 133]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~#+begin_src ruby~ -- PRE start detected. -** Processing line: ~ # ./samples/12_c_extensions/02_intermediate/app/main.rb~ -** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ -** Processing line: ~ include FFI::RE~ +** Processing line: ~ def goal_color~ +** Processing line: ~ [226, 133, 144]~ +** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def split_words(input)~ -** Processing line: ~ words = []~ -** Processing line: ~ last = IntPointer.new~ -** Processing line: ~ re = re_compile("\\w+")~ -** Processing line: ~ first = re_matchp(re, input, last)~ -** Processing line: ~ while first != -1~ -** Processing line: ~ words << input.slice(first, last.value)~ -** Processing line: ~ input = input.slice(last.value + first, input.length)~ -** Processing line: ~ first = re_matchp(re, input, last)~ -** Processing line: ~ end~ -** Processing line: ~ words~ +** Processing line: ~ def wall_color~ +** Processing line: ~ [133, 144, 226]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.outputs.labels << [640, 500, split_words("hello, dragonriders!").join(' '), 5, 1]~ +** Processing line: ~ def a_star_color~ +** Processing line: ~ [0, 0, 255]~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* 12 C Extensions - Native Pixel Arrays - main.rb~ -- H1 detected. +** Processing line: ~*** 3d - 3d Cube - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~12 C Extensions - Native Pixel Arrays - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~3d - 3d Cube - 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/12_c_extensions/03_native_pixel_arrays/app/main.rb~ -** Processing line: ~ $gtk.ffi_misc.gtk_dlopen("ext")~ -** Processing line: ~ include FFI::CExt~ -** Processing line: ~~ -** Processing line: ~ def tick args~ -** Processing line: ~ args.state.rotation ||= 0~ -** Processing line: ~~ -** Processing line: ~ update_scanner_texture # this calls into a C extension!~ -** Processing line: ~~ -** Processing line: ~ # New/changed pixel arrays get uploaded to the GPU before we render~ -** Processing line: ~ # anything. At that point, they can be scaled, rotated, and otherwise~ -** Processing line: ~ # used like any other sprite.~ -** Processing line: ~ w = 100~ -** Processing line: ~ h = 100~ -** Processing line: ~ x = (1280 - w) / 2~ -** Processing line: ~ y = (720 - h) / 2~ -** Processing line: ~ args.outputs.background_color = [64, 0, 128]~ -** Processing line: ~ args.outputs.primitives << [x, y, w, h, :scanner, args.state.rotation].sprite~ -** Processing line: ~ args.state.rotation += 1~ -** Processing line: ~~ -** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~#+end_src~ -- PRE end detected. -** Processing line: ~~ -** Processing line: ~~ -** Processing line: ~* 3d - 3d Cube - main.rb~ -- H1 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~3d - 3d Cube - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ ** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ # ./samples/99_genre_3d/3d_cube/app/main.rb~ +** Processing line: ~ # ./samples/99_genre_3d/01_3d_cube/app/main.rb~ ** Processing line: ~ STARTX = 0.0~ ** Processing line: ~ STARTY = 0.0~ ** Processing line: ~ ENDY = 20.0~ @@ -132329,10 +204363,416 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Arcade - Dueling Starships - main.rb~ -- H1 detected. +** Processing line: ~*** 3d - Wireframe - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~3d - Wireframe - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~3d - Wireframe - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/99_genre_3d/02_wireframe/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.model ||= Object3D.new('data/shuttle.off')~ +** Processing line: ~ args.state.mtx ||= rotate3D(0, 0, 0)~ +** Processing line: ~ args.state.inv_mtx ||= rotate3D(0, 0, 0)~ +** Processing line: ~ delta_mtx = rotate3D(args.inputs.up_down * 0.01, input_roll(args) * 0.01, args.inputs.left_right * 0.01)~ +** Processing line: ~ args.outputs.lines << args.state.model.edges~ +** Processing line: ~ args.state.model.fast_3x3_transform! args.state.inv_mtx~ +** Processing line: ~ args.state.inv_mtx = mtx_mul(delta_mtx.transpose, args.state.inv_mtx)~ +** Processing line: ~ args.state.mtx = mtx_mul(args.state.mtx, delta_mtx)~ +** Processing line: ~ args.state.model.fast_3x3_transform! args.state.mtx~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +** Processing line: ~ args.outputs.debug << args.gtk.framerate_diagnostics_primitives~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def input_roll args~ +** Processing line: ~ roll = 0~ +** Processing line: ~ roll += 1 if args.inputs.keyboard.e~ +** Processing line: ~ roll -= 1 if args.inputs.keyboard.q~ +** Processing line: ~ roll~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def rotate3D(theta_x = 0.1, theta_y = 0.1, theta_z = 0.1)~ +** Processing line: ~ c_x, s_x = Math.cos(theta_x), Math.sin(theta_x)~ +** Processing line: ~ c_y, s_y = Math.cos(theta_y), Math.sin(theta_y)~ +** Processing line: ~ c_z, s_z = Math.cos(theta_z), Math.sin(theta_z)~ +** Processing line: ~ rot_x = [[1, 0, 0], [0, c_x, -s_x], [0, s_x, c_x]]~ +** Processing line: ~ rot_y = [[c_y, 0, s_y], [0, 1, 0], [-s_y, 0, c_y]]~ +** Processing line: ~ rot_z = [[c_z, -s_z, 0], [s_z, c_z, 0], [0, 0, 1]]~ +** Processing line: ~ mtx_mul(mtx_mul(rot_x, rot_y), rot_z)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def mtx_mul(a, b)~ +** Processing line: ~ is = (0...a.length)~ +** Processing line: ~ js = (0...b[0].length)~ +** Processing line: ~ ks = (0...b.length)~ +** Processing line: ~ is.map do |i|~ +** Processing line: ~ js.map do |j|~ +** Processing line: ~ ks.map do |k|~ +** Processing line: ~ a[i][k] * b[k][j]~ +** Processing line: ~ end.reduce(&:plus)~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ class Object3D~ +** Processing line: ~ attr_reader :vert_count, :face_count, :edge_count, :verts, :faces, :edges~ +** Processing line: ~~ +** Processing line: ~ def initialize(path)~ +** Processing line: ~ @vert_count = 0~ +** Processing line: ~ @face_count = 0~ +** Processing line: ~ @edge_count = 0~ +** Processing line: ~ @verts = []~ +** Processing line: ~ @faces = []~ +** Processing line: ~ @edges = []~ +** Processing line: ~ _init_from_file path~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def _init_from_file path~ +** Processing line: ~ file_lines = $gtk.read_file(path).split("\n")~ +** Processing line: ~ .reject { |line| line.start_with?('#') || line.split(' ').length == 0 } # Strip out simple comments and blank lines~ +** Processing line: ~ .map { |line| line.split('#')[0] } # Strip out end of line comments~ +** Processing line: ~ .map { |line| line.split(' ') } # Tokenize by splitting on whitespace~ +** Processing line: ~ raise "OFF file did not start with OFF." if file_lines.shift != ["OFF"] # OFF meshes are supposed to begin with "OFF" as the first line.~ +** Processing line: ~ raise " line malformed" if file_lines[0].length != 3 # The second line needs to have 3 numbers. Raise an error if it doesn't.~ +** Processing line: ~ @vert_count, @face_count, @edge_count = file_lines.shift&.map(&:to_i) # Update the counts~ +** Processing line: ~ # Only the vertex and face counts need to be accurate. Raise an error if they are inaccurate.~ +** Processing line: ~ raise "Incorrect number of vertices and/or faces (Parsed VFE header: #{@vert_count} #{@face_count} #{@edge_count})" if file_lines.length != @vert_count + @face_count~ +** Processing line: ~ # Grab all the lines describing vertices.~ +** Processing line: ~ vert_lines = file_lines[0, @vert_count]~ +** Processing line: ~ # Grab all the lines describing faces.~ +** Processing line: ~ face_lines = file_lines[@vert_count, @face_count]~ +** Processing line: ~ # Create all the vertices~ +** Processing line: ~ @verts = vert_lines.map_with_index { |line, id| Vertex.new(line, id) }~ +** Processing line: ~ # Create all the faces~ +** Processing line: ~ @faces = face_lines.map { |line| Face.new(line, @verts) }~ +** Processing line: ~ # Create all the edges~ +** Processing line: ~ @edges = @faces.flat_map(&:edges).uniq do |edge|~ +** Processing line: ~ sorted = edge.sorted~ +** Processing line: ~ [sorted.point_a, sorted.point_b]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def fast_3x3_transform! mtx~ +** Processing line: ~ @verts.each { |vert| vert.fast_3x3_transform! mtx }~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ class Face~ +** Processing line: ~~ +** Processing line: ~ attr_reader :verts, :edges~ +** Processing line: ~~ +** Processing line: ~ def initialize(data, verts)~ +** Processing line: ~ vert_count = data[0].to_i~ +** Processing line: ~ vert_ids = data[1, vert_count].map(&:to_i)~ +** Processing line: ~ @verts = vert_ids.map { |i| verts[i] }~ +** Processing line: ~ @edges = []~ +** Processing line: ~ (0...vert_count).each { |i| @edges[i] = Edge.new(verts[vert_ids[i - 1]], verts[vert_ids[i]]) }~ +** Processing line: ~ @edges.rotate! 1~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ class Edge~ +** Processing line: ~ attr_reader :point_a, :point_b~ +** Processing line: ~~ +** Processing line: ~ def initialize(point_a, point_b)~ +** Processing line: ~ @point_a = point_a~ +** Processing line: ~ @point_b = point_b~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def sorted~ +** Processing line: ~ @point_a.id < @point_b.id ? self : Edge.new(@point_b, @point_a)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def draw_override ffi~ +** Processing line: ~ ffi.draw_line(@point_a.render_x, @point_a.render_y, @point_b.render_x, @point_b.render_y, 255, 0, 0, 128)~ +** Processing line: ~ ffi.draw_line(@point_a.render_x+1, @point_a.render_y, @point_b.render_x+1, @point_b.render_y, 255, 0, 0, 128)~ +** Processing line: ~ ffi.draw_line(@point_a.render_x, @point_a.render_y+1, @point_b.render_x, @point_b.render_y+1, 255, 0, 0, 128)~ +** Processing line: ~ ffi.draw_line(@point_a.render_x+1, @point_a.render_y+1, @point_b.render_x+1, @point_b.render_y+1, 255, 0, 0, 128)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def primitive_marker~ +** Processing line: ~ :line~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ class Vertex~ +** Processing line: ~ attr_accessor :x, :y, :z, :id~ +** Processing line: ~~ +** Processing line: ~ def initialize(data, id)~ +** Processing line: ~ @x = data[0].to_f~ +** Processing line: ~ @y = data[1].to_f~ +** Processing line: ~ @z = data[2].to_f~ +** Processing line: ~ @id = id~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def fast_3x3_transform! mtx~ +** Processing line: ~ _x, _y, _z = @x, @y, @z~ +** Processing line: ~ @x = mtx[0][0] * _x + mtx[0][1] * _y + mtx[0][2] * _z~ +** Processing line: ~ @y = mtx[1][0] * _x + mtx[1][1] * _y + mtx[1][2] * _z~ +** Processing line: ~ @z = mtx[2][0] * _x + mtx[2][1] * _y + mtx[2][2] * _z~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render_x~ +** Processing line: ~ @x * (10 / (5 - @y)) * 170 + 640~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render_y~ +** Processing line: ~ @z * (10 / (5 - @y)) * 170 + 360~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** 3d - Wireframe - Data - what-is-this.txt~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~3d - Wireframe - Data - what-is-this.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: ~3d - Wireframe - Data - what-is-this.txt~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_src ruby~ +- PRE start detected. +** Processing line: ~ # ./samples/99_genre_3d/02_wireframe/data/what-is-this.txt~ +** Processing line: ~ https://en.wikipedia.org/wiki/OFF_(file_format)~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Arcade - Bullet Hell - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Arcade - Bullet Hell - 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: ~Arcade - Bullet Hell - 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_arcade/bullet_hell/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ args.state.base_columns ||= 10.times.map { |n| 50 * n + 1280 / 2 - 5 * 50 + 5 }~ +** Processing line: ~ args.state.base_rows ||= 5.times.map { |n| 50 * n + 720 - 5 * 50 }~ +** Processing line: ~ args.state.offset_columns = 10.times.map { |n| (n - 4.5) * Math.sin(Kernel.tick_count.to_radians) * 12 }~ +** Processing line: ~ args.state.offset_rows = 5.map { 0 }~ +** Processing line: ~ args.state.columns = 10.times.map { |i| args.state.base_columns[i] + args.state.offset_columns[i] }~ +** Processing line: ~ args.state.rows = 5.times.map { |i| args.state.base_rows[i] + args.state.offset_rows[i] }~ +** Processing line: ~ args.state.explosions ||= []~ +** Processing line: ~ args.state.enemies ||= []~ +** Processing line: ~ args.state.score ||= 0~ +** Processing line: ~ args.state.wave ||= 0~ +** Processing line: ~ if args.state.enemies.empty?~ +** Processing line: ~ args.state.wave += 1~ +** Processing line: ~ args.state.wave_root = Math.sqrt(args.state.wave)~ +** Processing line: ~ args.state.enemies = make_enemies~ +** Processing line: ~ end~ +** Processing line: ~ args.state.player ||= {x: 620, y: 80, w: 40, h: 40, path: 'sprites/circle-gray.png', angle: 90, cooldown: 0, alive: true}~ +** Processing line: ~ args.state.enemy_bullets ||= []~ +** Processing line: ~ args.state.player_bullets ||= []~ +** Processing line: ~ args.state.lives ||= 3~ +** Processing line: ~ args.state.missed_shots ||= 0~ +** Processing line: ~ args.state.fired_shots ||= 0~ +** Processing line: ~~ +** Processing line: ~ update_explosions args~ +** Processing line: ~ update_enemy_positions args~ +** Processing line: ~~ +** Processing line: ~ if args.inputs.left && args.state.player[:x] > (300 + 5)~ +** Processing line: ~ args.state.player[:x] -= 5~ +** Processing line: ~ end~ +** Processing line: ~ if args.inputs.right && args.state.player[:x] < (1280 - args.state.player[:w] - 300 - 5)~ +** Processing line: ~ args.state.player[:x] += 5~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.state.enemy_bullets.each do |bullet|~ +** Processing line: ~ bullet[:x] += bullet[:dx]~ +** Processing line: ~ bullet[:y] += bullet[:dy]~ +** Processing line: ~ end~ +** Processing line: ~ args.state.player_bullets.each do |bullet|~ +** Processing line: ~ bullet[:x] += bullet[:dx]~ +** Processing line: ~ bullet[:y] += bullet[:dy]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.state.enemy_bullets = args.state.enemy_bullets.find_all { |bullet| bullet[:y].between?(-16, 736) }~ +** Processing line: ~ args.state.player_bullets = args.state.player_bullets.find_all do |bullet|~ +** Processing line: ~ if bullet[:y].between?(-16, 736)~ +** Processing line: ~ true~ +** Processing line: ~ else~ +** Processing line: ~ args.state.missed_shots += 1~ +** Processing line: ~ false~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.state.enemies = args.state.enemies.reject do |enemy|~ +** Processing line: ~ if args.state.player[:alive] && 1500 > (args.state.player[:x] - enemy[:x]) ** 2 + (args.state.player[:y] - enemy[:y]) ** 2~ +** Processing line: ~ args.state.explosions << {x: enemy[:x] + 4, y: enemy[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0}~ +** Processing line: ~ args.state.explosions << {x: args.state.player[:x] + 4, y: args.state.player[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0}~ +** Processing line: ~ args.state.player[:alive] = false~ +** Processing line: ~ true~ +** Processing line: ~ else~ +** Processing line: ~ false~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ args.state.enemy_bullets.each do |bullet|~ +** Processing line: ~ if args.state.player[:alive] && 400 > (args.state.player[:x] - bullet[:x] + 12) ** 2 + (args.state.player[:y] - bullet[:y] + 12) ** 2~ +** Processing line: ~ args.state.explosions << {x: args.state.player[:x] + 4, y: args.state.player[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0}~ +** Processing line: ~ args.state.player[:alive] = false~ +** Processing line: ~ bullet[:despawn] = true~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ args.state.enemies = args.state.enemies.reject do |enemy|~ +** Processing line: ~ args.state.player_bullets.any? do |bullet|~ +** Processing line: ~ if 400 > (enemy[:x] - bullet[:x] + 12) ** 2 + (enemy[:y] - bullet[:y] + 12) ** 2~ +** Processing line: ~ args.state.explosions << {x: enemy[:x] + 4, y: enemy[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0}~ +** Processing line: ~ bullet[:despawn] = true~ +** Processing line: ~ args.state.score += 1000 * args.state.wave~ +** Processing line: ~ true~ +** Processing line: ~ else~ +** Processing line: ~ false~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.state.player_bullets = args.state.player_bullets.reject { |bullet| bullet[:despawn] }~ +** Processing line: ~ args.state.enemy_bullets = args.state.enemy_bullets.reject { |bullet| bullet[:despawn] }~ +** Processing line: ~~ +** Processing line: ~ args.state.player[:cooldown] -= 1~ +** Processing line: ~ if args.inputs.keyboard.key_held.space && args.state.player[:cooldown] <= 0 && args.state.player[:alive]~ +** Processing line: ~ args.state.player_bullets << {x: args.state.player[:x] + 12, y: args.state.player[:y] + 28, w: 16, h: 16, path: 'sprites/star.png', dx: 0, dy: 8}.sprite~ +** Processing line: ~ args.state.fired_shots += 1~ +** Processing line: ~ args.state.player[:cooldown] = 10 + 20 / args.state.wave~ +** Processing line: ~ end~ +** Processing line: ~ args.state.enemies.each do |enemy|~ +** Processing line: ~ if Math.rand < 0.0005 + 0.0005 * args.state.wave && args.state.player[:alive] && enemy[:move_state] == :normal~ +** Processing line: ~ args.state.enemy_bullets << {x: enemy[:x] + 12, y: enemy[:y] - 8, w: 16, h: 16, path: 'sprites/star.png', dx: 0, dy: -3 - args.state.wave_root}.sprite~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.outputs.background_color = [0, 0, 0]~ +** Processing line: ~ args.outputs.primitives << args.state.enemies.map do |enemy|~ +** Processing line: ~ [enemy[:x], enemy[:y], 40, 40, enemy[:path], -90].sprite~ +** Processing line: ~ end~ +** Processing line: ~ args.outputs.primitives << args.state.player if args.state.player[:alive]~ +** Processing line: ~ args.outputs.primitives << args.state.explosions~ +** Processing line: ~ args.outputs.primitives << args.state.player_bullets~ +** Processing line: ~ args.outputs.primitives << args.state.enemy_bullets~ +** Processing line: ~ accuracy = args.state.fired_shots.zero? ? 1 : (args.state.fired_shots - args.state.missed_shots) / args.state.fired_shots~ +** Processing line: ~ args.outputs.primitives << [~ +** Processing line: ~ [0, 0, 300, 720, 96, 0, 0].solid,~ +** Processing line: ~ [1280 - 300, 0, 300, 720, 96, 0, 0].solid,~ +** Processing line: ~ [1280 - 290, 60, "Wave #{args.state.wave}", 255, 255, 255].label,~ +** Processing line: ~ [1280 - 290, 40, "Accuracy #{(accuracy * 100).floor}%", 255, 255, 255].label,~ +** Processing line: ~ [1280 - 290, 20, "Score #{(args.state.score * accuracy).floor}", 255, 255, 255].label,~ +** Processing line: ~ ]~ +** Processing line: ~ args.outputs.primitives << args.state.lives.times.map do |n|~ +** Processing line: ~ [1280 - 290 + 50 * n, 80, 40, 40, 'sprites/circle-gray.png', 90].sprite~ +** Processing line: ~ end~ +** Processing line: ~ #args.outputs.debug << args.gtk.framerate_diagnostics_primitives~ +** Processing line: ~~ +** Processing line: ~ if (!args.state.player[:alive]) && args.state.enemy_bullets.empty? && args.state.explosions.empty? && args.state.enemies.all? { |enemy| enemy[:move_state] == :normal }~ +** Processing line: ~ args.state.player[:alive] = true~ +** Processing line: ~ args.state.player[:x] = 624~ +** Processing line: ~ args.state.player[:y] = 80~ +** Processing line: ~ args.state.lives -= 1~ +** Processing line: ~ if args.state.lives == -1~ +** Processing line: ~ args.state.clear!~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def make_enemies~ +** Processing line: ~ enemies = []~ +** Processing line: ~ enemies += 10.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 0, col: n, path: 'sprites/circle-orange.png', move_state: :retreat} }~ +** Processing line: ~ enemies += 10.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 1, col: n, path: 'sprites/circle-orange.png', move_state: :retreat} }~ +** Processing line: ~ enemies += 8.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 2, col: n + 1, path: 'sprites/circle-blue.png', move_state: :retreat} }~ +** Processing line: ~ enemies += 8.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 3, col: n + 1, path: 'sprites/circle-blue.png', move_state: :retreat} }~ +** Processing line: ~ enemies += 4.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 4, col: n + 3, path: 'sprites/circle-green.png', move_state: :retreat} }~ +** Processing line: ~ enemies~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def update_explosions args~ +** Processing line: ~ args.state.explosions.each do |explosion|~ +** Processing line: ~ explosion[:age] += 0.5~ +** Processing line: ~ explosion[:path] = "sprites/explosion-#{explosion[:age].floor}.png"~ +** Processing line: ~ end~ +** Processing line: ~ args.state.explosions = args.state.explosions.reject { |explosion| explosion[:age] >= 7 }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def update_enemy_positions args~ +** Processing line: ~ args.state.enemies.each do |enemy|~ +** Processing line: ~ if enemy[:move_state] == :normal~ +** Processing line: ~ enemy[:x] = args.state.columns[enemy[:col]]~ +** Processing line: ~ enemy[:y] = args.state.rows[enemy[:row]]~ +** Processing line: ~ enemy[:move_state] = :dive if Math.rand < 0.0002 + 0.00005 * args.state.wave && args.state.player[:alive]~ +** Processing line: ~ elsif enemy[:move_state] == :dive~ +** Processing line: ~ enemy[:target_x] ||= args.state.player[:x]~ +** Processing line: ~ enemy[:target_y] ||= args.state.player[:y]~ +** Processing line: ~ dx = enemy[:target_x] - enemy[:x]~ +** Processing line: ~ dy = enemy[:target_y] - enemy[:y]~ +** Processing line: ~ vel = Math.sqrt(dx * dx + dy * dy)~ +** Processing line: ~ speed_limit = 2 + args.state.wave_root~ +** Processing line: ~ if vel > speed_limit~ +** Processing line: ~ dx /= vel / speed_limit~ +** Processing line: ~ dy /= vel / speed_limit~ +** Processing line: ~ end~ +** Processing line: ~ if vel < 1 || !args.state.player[:alive]~ +** Processing line: ~ enemy[:move_state] = :retreat~ +** Processing line: ~ end~ +** Processing line: ~ enemy[:x] += dx~ +** Processing line: ~ enemy[:y] += dy~ +** Processing line: ~ elsif enemy[:move_state] == :retreat~ +** Processing line: ~ enemy[:target_x] = args.state.columns[enemy[:col]]~ +** Processing line: ~ enemy[:target_y] = args.state.rows[enemy[:row]]~ +** Processing line: ~ dx = enemy[:target_x] - enemy[:x]~ +** Processing line: ~ dy = enemy[:target_y] - enemy[:y]~ +** Processing line: ~ vel = Math.sqrt(dx * dx + dy * dy)~ +** Processing line: ~ speed_limit = 2 + args.state.wave_root~ +** Processing line: ~ if vel > speed_limit~ +** Processing line: ~ dx /= vel / speed_limit~ +** Processing line: ~ dy /= vel / speed_limit~ +** Processing line: ~ elsif vel < 1~ +** Processing line: ~ enemy[:move_state] = :normal~ +** Processing line: ~ enemy[:target_x] = nil~ +** Processing line: ~ enemy[:target_y] = nil~ +** Processing line: ~ end~ +** Processing line: ~ enemy[:x] += dx~ +** Processing line: ~ enemy[:y] += dy~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Arcade - Dueling Starships - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Arcade - Dueling Starships - 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: ~Arcade - Dueling Starships - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -132710,10 +205150,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* arcade/flappy dragon/credits.txt~ -- H1 detected. +** Processing line: ~*** arcade/flappy dragon/credits.txt~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~arcade/flappy dragon/credits.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: ~arcade/flappy dragon/credits.txt~ - Line's tilde count is: 0 - Line contains link marker: false @@ -132729,10 +205174,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* arcade/flappy dragon/main.rb~ -- H1 detected. +** Processing line: ~*** arcade/flappy dragon/main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~arcade/flappy dragon/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: ~arcade/flappy dragon/main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -133105,10 +205555,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Arcade - Pong - main.rb~ -- H1 detected. +** Processing line: ~*** Arcade - Pong - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Arcade - Pong - 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: ~Arcade - Pong - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -133280,10 +205735,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Arcade - Snakemoji - main.rb~ -- H1 detected. +** Processing line: ~*** Arcade - Snakemoji - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Arcade - Snakemoji - 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: ~Arcade - Snakemoji - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -133461,10 +205921,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Arcade - Solar System - main.rb~ -- H1 detected. +** Processing line: ~*** Arcade - Solar System - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Arcade - Solar System - 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: ~Arcade - Solar System - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -133585,10 +206050,397 @@ 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 - Craft Game Starting Point - main.rb~ -- H1 detected. +** Processing line: ~*** Arcade - Sound Golf - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Arcade - Sound Golf - 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: ~Arcade - Sound Golf - 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_arcade/sound_golf/app/main.rb~ +** Processing line: ~ =begin~ +** Processing line: ~~ +** Processing line: ~ APIs Listing that haven't been encountered in previous sample apps:~ +** Processing line: ~~ +** Processing line: ~ - sample: Chooses random element from array.~ +** Processing line: ~ In this sample app, the target note is set by taking a sample from the collection~ +** Processing line: ~ of available notes.~ +** Processing line: ~~ +** Processing line: ~ Reminders:~ +** Processing line: ~ - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual~ +** Processing line: ~ 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720).~ +** Processing line: ~~ +** Processing line: ~ - args.state.new_entity: Used when we want to create a new object, like a sprite or button.~ +** Processing line: ~ For example, if we want to create a new button, we would declare it as a new entity and~ +** Processing line: ~ then define its properties.~ +** Processing line: ~~ +** Processing line: ~ - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated~ +** Processing line: ~ as Ruby code, and the placeholder is replaced with its corresponding value or result.~ +** Processing line: ~~ +** Processing line: ~ - args.outputs.labels: An array. The values generate a label.~ +** Processing line: ~ The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE]~ +** Processing line: ~ For more information about labels, go to mygame/documentation/02-labels.md.~ +** Processing line: ~~ +** Processing line: ~ - find_all: Finds all elements from a collection that meet a certain requirements (and excludes the ones that don't).~ +** Processing line: ~~ +** Processing line: ~ - first: Returns the first element of an array.~ +** Processing line: ~~ +** Processing line: ~ - inside_rect: Returns true or false depending on if the point is inside the rect.~ +** Processing line: ~~ +** Processing line: ~ - to_sym: Returns symbol corresponding to string. Will create a symbol if it does~ +** Processing line: ~ not already exist.~ +** Processing line: ~~ +** Processing line: ~ =end~ +** Processing line: ~~ +** Processing line: ~ # This sample app allows users to test their musical skills by matching the piano sound that plays in each~ +** Processing line: ~ # level to the correct note.~ +** Processing line: ~~ +** Processing line: ~ # Runs all the methods necessary for the game to function properly.~ +** Processing line: ~ def tick args~ +** Processing line: ~ defaults args~ +** Processing line: ~ render args~ +** Processing line: ~ calc args~ +** Processing line: ~ input_mouse args~ +** Processing line: ~ tick_instructions args, "Sample app shows how to play sounds. args.outputs.sounds << \"path_to_wav.wav\""~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Sets default values and creates empty collections~ +** Processing line: ~ # Initialization happens in the first frame only~ +** Processing line: ~ def defaults args~ +** Processing line: ~ args.state.notes ||= []~ +** Processing line: ~ args.state.click_feedbacks ||= []~ +** Processing line: ~ args.state.current_level ||= 1~ +** Processing line: ~ args.state.times_wrong ||= 0 # when game starts, user hasn't guessed wrong yet~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Uses a label to display current level, and shows the score~ +** Processing line: ~ # Creates a button to play the sample note, and displays the available notes that could be a potential match~ +** Processing line: ~ def render args~ +** Processing line: ~~ +** Processing line: ~ # grid.w_half positions the label in the horizontal center of the screen.~ +** Processing line: ~ args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(40), "Hole #{args.state.current_level} of 9", 0, 1, 0, 0, 0]~ +** Processing line: ~~ +** Processing line: ~ render_score args # shows score on screen~ +** Processing line: ~~ +** Processing line: ~ args.state.play_again_button ||= { x: 560, y: args.grid.h * 3 / 4 - 40, w: 160, h: 60, label: 'again' } # array definition, text/title~ +** Processing line: ~ args.state.play_note_button ||= { x: 560, y: args.grid.h * 3 / 4 - 40, w: 160, h: 60, label: 'play' }~ +** Processing line: ~~ +** Processing line: ~ if args.state.game_over # if game is over, a "play again" button is shown~ +** Processing line: ~ # Calculations ensure that Play Again label is displayed in center of border~ +** Processing line: ~ # Remove calculations from y parameters and see what happens to border and label placement~ +** Processing line: ~ args.outputs.labels << [args.grid.w_half, args.grid.h * 3 / 4, "Play Again", 0, 1, 0, 0, 0] # outputs label~ +** Processing line: ~ args.outputs.borders << args.state.play_again_button # outputs border~ +** Processing line: ~ else # otherwise, if game is not over~ +** Processing line: ~ # Calculations ensure that label appears in center of border~ +** Processing line: ~ args.outputs.labels << [args.grid.w_half, args.grid.h * 3 / 4, "Play Note ##{args.state.current_level}", 0, 1, 0, 0, 0] # outputs label~ +** Processing line: ~ args.outputs.borders << args.state.play_note_button # outputs border~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ return if args.state.game_over # return if game is over~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << [args.grid.w_half, 400, "I think the note is a(n)...", 0, 1, 0, 0, 0] # outputs label~ +** Processing line: ~~ +** Processing line: ~ # Shows all of the available notes that can be potential matches.~ +** Processing line: ~ available_notes.each_with_index do |note, i|~ +** Processing line: ~ args.state.notes[i] ||= piano_button(args, note, i + 1) # calls piano_button method on each note (creates label and border)~ +** Processing line: ~ args.outputs.labels << args.state.notes[i].label # outputs note on screen with a label and a border~ +** Processing line: ~ args.outputs.borders << args.state.notes[i].border~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Shows whether or not the user is correct by filling the screen with either red or green~ +** Processing line: ~ args.outputs.solids << args.state.click_feedbacks.map { |c| c.solid }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Shows the score (number of times the user guesses wrong) onto the screen using labels.~ +** Processing line: ~ def render_score args~ +** Processing line: ~ if args.state.times_wrong == 0 # if the user has guessed wrong zero times, the score is par~ +** Processing line: ~ args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: PAR", 0, 1, 0, 0, 0]~ +** Processing line: ~ else # otherwise, number of times the user has guessed wrong is shown~ +** Processing line: ~ args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: +#{args.state.times_wrong}", 0, 1, 0, 0, 0] # shows score using string interpolation~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Sets the target note for the level and performs calculations on click_feedbacks.~ +** Processing line: ~ def calc args~ +** Processing line: ~ args.state.target_note ||= available_notes.sample # chooses a note from available_notes collection as target note~ +** Processing line: ~ args.state.click_feedbacks.each { |c| c.solid[-1] -= 5 } # remove this line and solid color will remain on screen indefinitely~ +** Processing line: ~ # comment this line out and the solid color will keep flashing on screen instead of being removed from click_feedbacks collection~ +** Processing line: ~ args.state.click_feedbacks.reject! { |c| c.solid[-1] <= 0 }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Uses input from the user to play the target note, as well as the other notes that could be a potential match.~ +** Processing line: ~ def input_mouse args~ +** Processing line: ~ return unless args.inputs.mouse.click # return unless the mouse is clicked~ +** Processing line: ~~ +** Processing line: ~ # finds button that was clicked by user~ +** Processing line: ~ button_clicked = args.outputs.borders.find_all do |b| # go through borders collection to find all borders that meet requirements~ +** Processing line: ~ args.inputs.mouse.click.point.inside_rect? b # find button border that mouse was clicked inside of~ +** Processing line: ~ end.find_all { |b| b.is_a? Hash }.first # reject, return first element~ +** Processing line: ~~ +** Processing line: ~ return unless button_clicked # return unless button_clicked as a value (a button was clicked)~ +** Processing line: ~~ +** Processing line: ~ queue_click_feedback args, # calls queue_click_feedback method on the button that was clicked~ +** Processing line: ~ button_clicked.x,~ +** Processing line: ~ button_clicked.y,~ +** Processing line: ~ button_clicked.w,~ +** Processing line: ~ button_clicked.h,~ +** Processing line: ~ 150, 100, 200 # sets color of button to shade of purple~ +** Processing line: ~~ +** Processing line: ~ if button_clicked[:label] == 'play' # if "play note" button is pressed~ +** Processing line: ~ args.outputs.sounds << "sounds/#{args.state.target_note}.wav" # sound of target note is output~ +** Processing line: ~ elsif button_clicked[:label] == 'again' # if "play game again" button is pressed~ +** Processing line: ~ args.state.target_note = nil # no target note~ +** Processing line: ~ args.state.current_level = 1 # starts at level 1 again~ +** Processing line: ~ args.state.times_wrong = 0 # starts off with 0 wrong guesses~ +** Processing line: ~ args.state.game_over = false # the game is not over (because it has just been restarted)~ +** Processing line: ~ else # otherwise if neither of those buttons were pressed~ +** Processing line: ~ args.outputs.sounds << "sounds/#{button_clicked[:label]}.wav" # sound of clicked note is played~ +** Processing line: ~ if button_clicked[:label] == args.state.target_note # if clicked note is target note~ +** Processing line: ~ args.state.target_note = nil # target note is emptied~ +** Processing line: ~~ +** Processing line: ~ if args.state.current_level < 9 # if game hasn't reached level 9~ +** Processing line: ~ args.state.current_level += 1 # game goes to next level~ +** Processing line: ~ else # otherwise, if game has reached level 9~ +** Processing line: ~ args.state.game_over = true # the game is over~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ queue_click_feedback args, 0, 0, args.grid.w, args.grid.h, 100, 200, 100 # green shown if user guesses correctly~ +** Processing line: ~ else # otherwise, if clicked note is not target note~ +** Processing line: ~ args.state.times_wrong += 1 # increments times user guessed wrong~ +** Processing line: ~ queue_click_feedback args, 0, 0, args.grid.w, args.grid.h, 200, 100, 100 # red shown is user guesses wrong~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Creates a collection of all of the available notes as symbols~ +** Processing line: ~ def available_notes~ +** Processing line: ~ [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Creates buttons for each note, and sets a label (the note's name) and border for each note's button.~ +** Processing line: ~ def piano_button args, note, position~ +** Processing line: ~ args.state.new_entity(:button) do |b| # declares button as new entity~ +** Processing line: ~ b.label = [460 + 40.mult(position), args.grid.h * 0.4, "#{note}", 0, 1, 0, 0, 0] # label definition~ +** Processing line: ~ b.border = { x: 460 + 40.mult(position) - 20, y: args.grid.h * 0.4 - 32, w: 40, h: 40, label: note } # border definition, text/title; 20 subtracted so label is in center of border~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Color of click feedback changes depending on what button was clicked, and whether the guess is right or wrong~ +** Processing line: ~ # If a button is clicked, the inside of button is purple (see input_mouse method)~ +** Processing line: ~ # If correct note is clicked, screen turns green~ +** Processing line: ~ # If incorrect note is clicked, screen turns red (again, see input_mouse method)~ +** Processing line: ~ def queue_click_feedback args, x, y, w, h, *color~ +** Processing line: ~ args.state.click_feedbacks << args.state.new_entity(:click_feedback) do |c| # declares feedback as new entity~ +** Processing line: ~ c.solid = [x, y, w, h, *color, 255] # sets color~ +** 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.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: ~*** Arcade - Twinstick - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Arcade - Twinstick - 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: ~Arcade - Twinstick - 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_arcade/twinstick/app/main.rb~ +** Processing line: ~ def tick args~ +** Processing line: ~ 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}~ +** Processing line: ~ args.state.enemies ||= []~ +** Processing line: ~ args.state.player_bullets ||= []~ +** Processing line: ~ args.state.tick_count ||= -1~ +** Processing line: ~ args.state.tick_count += 1~ +** Processing line: ~ spawn_enemies args~ +** Processing line: ~ kill_enemies args~ +** Processing line: ~ move_enemies args~ +** Processing line: ~ move_bullets args~ +** Processing line: ~ move_player args~ +** Processing line: ~ fire_player args~ +** Processing line: ~ args.state.player[:r] = args.state.player[:g] = args.state.player[:b] = (args.state.player[:health] * 25.5).clamp(0, 255)~ +** Processing line: ~ label_color = args.state.player[:health] <= 5 ? 255 : 0~ +** Processing line: ~ args.outputs.labels << [~ +** Processing line: ~ {~ +** Processing line: ~ x: args.state.player.x + 40, y: args.state.player.y + 60, alignment_enum: 1, text: "#{args.state.player[:health]} HP",~ +** Processing line: ~ r: label_color, g: label_color, b: label_color~ +** Processing line: ~ }, {~ +** Processing line: ~ x: args.state.player.x + 40, y: args.state.player.y + 40, alignment_enum: 1, text: "#{args.state.player[:score]} PTS",~ +** Processing line: ~ r: label_color, g: label_color, b: label_color, size_enum: 2 - args.state.player[:score].to_s.length,~ +** Processing line: ~ }~ +** Processing line: ~ ]~ +** Processing line: ~ args.outputs.sprites << [args.state.player, args.state.enemies, args.state.player_bullets]~ +** Processing line: ~ args.state.clear! if args.state.player[:health] < 0 # Reset the game if the player's health drops below zero~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def spawn_enemies args~ +** Processing line: ~ # Spawn enemies more frequently as the player's score increases.~ +** Processing line: ~ if rand < (100+args.state.player[:score])/(10000 + args.state.player[:score]) || args.state.tick_count.zero?~ +** Processing line: ~ theta = rand * Math::PI * 2~ +** Processing line: ~ args.state.enemies << {~ +** Processing line: ~ x: 600 + Math.cos(theta) * 800, y: 320 + Math.sin(theta) * 800, w: 80, h: 80, path: 'sprites/circle-white.png',~ +** Processing line: ~ r: (256 * rand).floor, g: (256 * rand).floor, b: (256 * rand).floor~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def kill_enemies args~ +** Processing line: ~ args.state.enemies.reject! do |enemy|~ +** Processing line: ~ # Check if enemy and player are within 80 pixels of each other (i.e. overlapping)~ +** Processing line: ~ if 6400 > (enemy.x - args.state.player.x) ** 2 + (enemy.y - args.state.player.y) ** 2~ +** Processing line: ~ # Enemy is touching player. Kill enemy, and reduce player HP by 1.~ +** Processing line: ~ args.state.player[:health] -= 1~ +** Processing line: ~ else~ +** Processing line: ~ args.state.player_bullets.any? do |bullet|~ +** Processing line: ~ # Check if enemy and bullet are within 50 pixels of each other (i.e. overlapping)~ +** Processing line: ~ if 2500 > (enemy.x - bullet.x + 30) ** 2 + (enemy.y - bullet.y + 30) ** 2~ +** Processing line: ~ # Increase player health by one for each enemy killed by a bullet after the first enemy, up to a maximum of 10 HP~ +** Processing line: ~ args.state.player[:health] += 1 if args.state.player[:health] < 10 && bullet[:kills] > 0~ +** Processing line: ~ # Keep track of how many enemies have been killed by this particular bullet~ +** Processing line: ~ bullet[:kills] += 1~ +** Processing line: ~ # Earn more points by killing multiple enemies with one shot.~ +** Processing line: ~ args.state.player[:score] += bullet[:kills]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def move_enemies args~ +** Processing line: ~ args.state.enemies.each do |enemy|~ +** Processing line: ~ # Get the angle from the enemy to the player~ +** Processing line: ~ theta = Math.atan2(enemy.y - args.state.player.y, enemy.x - args.state.player.x)~ +** Processing line: ~ # Convert the angle to a vector pointing at the player~ +** Processing line: ~ dx, dy = theta.to_degrees.vector 5~ +** Processing line: ~ # Move the enemy towards thr player~ +** Processing line: ~ enemy.x -= dx~ +** Processing line: ~ enemy.y -= dy~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def move_bullets args~ +** Processing line: ~ args.state.player_bullets.each do |bullet|~ +** Processing line: ~ # Move the bullets according to the bullet's velocity~ +** Processing line: ~ bullet.x += bullet[:vx]~ +** Processing line: ~ bullet.y += bullet[:vy]~ +** Processing line: ~ end~ +** Processing line: ~ args.state.player_bullets.reject! do |bullet|~ +** Processing line: ~ # Despawn bullets that are outside the screen area~ +** Processing line: ~ bullet.x < -20 || bullet.y < -20 || bullet.x > 1300 || bullet.y > 740~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def move_player args~ +** Processing line: ~ # Get the currently held direction.~ +** Processing line: ~ dx, dy = move_directional_vector args~ +** Processing line: ~ # Take the weighted average of the old velocities and the desired velocities.~ +** Processing line: ~ # Since move_directional_vector returns values between -1 and 1,~ +** Processing line: ~ # and we want to limit the speed to 7.5, we multiply dx and dy by 7.5*0.1 to get 0.75~ +** Processing line: ~ args.state.player[:vx] = args.state.player[:vx] * 0.9 + dx * 0.75~ +** Processing line: ~ args.state.player[:vy] = args.state.player[:vy] * 0.9 + dy * 0.75~ +** Processing line: ~ # Move the player~ +** Processing line: ~ args.state.player.x += args.state.player[:vx]~ +** Processing line: ~ args.state.player.y += args.state.player[:vy]~ +** Processing line: ~ # If the player is about to go out of bounds, put them back in bounds.~ +** Processing line: ~ args.state.player.x = args.state.player.x.clamp(0, 1201)~ +** Processing line: ~ args.state.player.y = args.state.player.y.clamp(0, 640)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ def fire_player args~ +** Processing line: ~ # Reduce the firing cooldown each tick~ +** Processing line: ~ args.state.player[:cooldown] -= 1~ +** Processing line: ~ # If the player is allowed to fire~ +** Processing line: ~ if args.state.player[:cooldown] <= 0~ +** Processing line: ~ dx, dy = shoot_directional_vector args # Get the bullet velocity~ +** Processing line: ~ return if dx == 0 && dy == 0 # If the velocity is zero, the player doesn't want to fire. Therefore, we just return early.~ +** Processing line: ~ # Add a new bullet to the list of player bullets.~ +** Processing line: ~ args.state.player_bullets << {~ +** Processing line: ~ x: args.state.player.x + 30 + 40 * dx,~ +** Processing line: ~ y: args.state.player.y + 30 + 40 * dy,~ +** Processing line: ~ w: 20, h: 20,~ +** Processing line: ~ path: 'sprites/circle-white.png',~ +** Processing line: ~ r: 0, g: 0, b: 0,~ +** Processing line: ~ vx: 10 * dx + args.state.player[:vx] / 7.5, vy: 10 * dy + args.state.player[:vy] / 7.5, # Factor in a bit of the player's velocity~ +** Processing line: ~ kills: 0~ +** Processing line: ~ }~ +** Processing line: ~ args.state.player[:cooldown] = 30 # Reset the cooldown~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Custom function for getting a directional vector just for movement using WASD~ +** Processing line: ~ def move_directional_vector args~ +** Processing line: ~ dx = 0~ +** Processing line: ~ dx += 1 if args.inputs.keyboard.d~ +** Processing line: ~ dx -= 1 if args.inputs.keyboard.a~ +** Processing line: ~ dy = 0~ +** Processing line: ~ dy += 1 if args.inputs.keyboard.w~ +** Processing line: ~ dy -= 1 if args.inputs.keyboard.s~ +** Processing line: ~ if dx != 0 && dy != 0~ +** Processing line: ~ dx *= 0.7071~ +** Processing line: ~ dy *= 0.7071~ +** Processing line: ~ end~ +** Processing line: ~ [dx, dy]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Custom function for getting a directional vector just for shooting using the arrow keys~ +** Processing line: ~ def shoot_directional_vector args~ +** Processing line: ~ dx = 0~ +** Processing line: ~ dx += 1 if args.inputs.keyboard.key_down.right || args.inputs.keyboard.key_held.right~ +** Processing line: ~ dx -= 1 if args.inputs.keyboard.key_down.left || args.inputs.keyboard.key_held.left~ +** Processing line: ~ dy = 0~ +** Processing line: ~ dy += 1 if args.inputs.keyboard.key_down.up || args.inputs.keyboard.key_held.up~ +** Processing line: ~ dy -= 1 if args.inputs.keyboard.key_down.down || args.inputs.keyboard.key_held.down~ +** Processing line: ~ if dx != 0 && dy != 0~ +** Processing line: ~ dx *= 0.7071~ +** Processing line: ~ dy *= 0.7071~ +** Processing line: ~ end~ +** Processing line: ~ [dx, dy]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Crafting - Craft Game Starting Point - main.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Crafting - Craft 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 - Craft Game Starting Point - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -134024,10 +206876,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Dev Tools - Add Buttons To Console - main.rb~ -- H1 detected. +** Processing line: ~*** Dev Tools - Add Buttons To Console - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Dev Tools - Add Buttons To Console - 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: ~Dev Tools - Add Buttons To Console - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -134098,10 +206955,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Dev Tools - Animation Creator Starting Point - main.rb~ -- H1 detected. +** Processing line: ~*** Dev Tools - Animation Creator Starting Point - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Dev Tools - Animation Creator 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: ~Dev Tools - Animation Creator Starting Point - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -134183,24 +207045,22 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def render_instructions~ -** Processing line: ~ instructions = <<-S~ -** Processing line: ~ * Instructions:~ -** Processing line: ~ - All data is stored in the ~canvas~ directory.~ -** Processing line: ~ - Hold ~d~ to set the edit mode to erase.~ -** Processing line: ~ - Release ~d~ to set the edit mode drawing.~ -** Processing line: ~ - Press ~a~ to added a frame to the end.~ -** Processing line: ~ - Press ~b~ to select the previous frame.~ -** Processing line: ~ - Press ~f~ to select the next frame.~ -** Processing line: ~ - Press ~c~ to copy a frame.~ -** Processing line: ~ - Press ~v~ to paste a copied frame into the selected frame.~ -** Processing line: ~ - Press ~x~ to delete the currently selected frame.~ -** Processing line: ~ - Press ~w~ to save the canvas and export all sprites.~ -** Processing line: ~ - Press ~l~ to load the canvas.~ -** Processing line: ~ S~ +** Processing line: ~ instructions = [~ +** Processing line: ~ "* Hotkeys:",~ +** Processing line: ~ "- d: hold to erase, release to draw.",~ +** Processing line: ~ "- a: add frame.",~ +** Processing line: ~ "- c: copy frame.",~ +** Processing line: ~ "- v: paste frame.",~ +** Processing line: ~ "- x: delete frame.",~ +** Processing line: ~ "- b: go to previous frame.",~ +** Processing line: ~ "- f: go to next frame.",~ +** Processing line: ~ "- w: save to ./canvas directory.",~ +** Processing line: ~ "- l: load from ./canvas."~ +** Processing line: ~ ]~ ** Processing line: ~~ -** Processing line: ~ instructions.strip.each_line.with_index do |l, i|~ +** Processing line: ~ instructions.each.with_index do |l, i|~ ** Processing line: ~ outputs.labels << { x: 840, y: 500 - (i * 20), text: "#{l}",~ -** Processing line: ~ r: 180, g: 180, b: 180, size_enum: -3 }~ +** Processing line: ~ r: 180, g: 180, b: 180, size_enum: 0 }~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ @@ -134561,10 +207421,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Dev Tools - Tile Editor Starting Point - main.rb~ -- H1 detected. +** Processing line: ~*** Dev Tools - Tile Editor Starting Point - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Dev Tools - Tile Editor 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: ~Dev Tools - Tile Editor Starting Point - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -134968,10 +207833,941 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Lowrez - Resolution 64x64 - lowrez.rb~ -- H1 detected. +** Processing line: ~*** Lowrez - Nokia 3310 - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Lowrez - Nokia 3310 - 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: ~Lowrez - Nokia 3310 - 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_lowrez/nokia_3310/app/main.rb~ +** Processing line: ~ require 'app/nokia.rb'~ +** Processing line: ~~ +** Processing line: ~ def tick args~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HELLO WORLD ======================================================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # Steps to get started:~ +** Processing line: ~ # 1. ~def tick args~ is the entry point for your game.~ +** Processing line: ~ # 2. There are quite a few code samples below, remove the "##"~ +** Processing line: ~ # before each line and save the file to see the changes.~ +** Processing line: ~ # 3. 0, 0 is in bottom left and 83, 47 is in top right corner.~ +** Processing line: ~ # 4. Be sure to come to the discord channel if you need~ +** Processing line: ~ # more help: [[http://discord.dragonruby.org]].~ +** Processing line: ~~ +** Processing line: ~ # Commenting and uncommenting code:~ +** Processing line: ~ # - Add a "#" infront of lines to comment out code~ +** Processing line: ~ # - Remove the "#" infront of lines to comment out code~ +** Processing line: ~~ +** Processing line: ~ # Invoke the hello_world subroutine/method~ +** Processing line: ~ hello_world args # <---- add a "#" to the beginning of the line to stop running this subroutine/method.~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HOW TO RENDER A LABEL ============================================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~~ +** Processing line: ~ # Uncomment the line below to invoke the how_to_render_a_label subroutine/method.~ +** Processing line: ~ # Note: The method is defined in this file with the signature ~def how_to_render_a_label args~~ +** Processing line: ~ # Scroll down to the method to see the details.~ +** Processing line: ~~ +** Processing line: ~ # Remove the "#" at the beginning of the line below~ +** Processing line: ~ # how_to_render_a_label args # <---- remove the "#" at the beginning of this line to run the method~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HOW TO RENDER A FILLED SQUARE (SOLID) ============================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # Remove the "#" at the beginning of the line below~ +** Processing line: ~ # how_to_render_solids args~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HOW TO RENDER AN UNFILLED SQUARE (BORDER) ========================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # Remove the "#" at the beginning of the line below~ +** Processing line: ~ # how_to_render_borders args~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HOW TO RENDER A LINE =============================================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # Remove the "#" at the beginning of the line below~ +** Processing line: ~ # how_to_render_lines args~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # == HOW TO RENDER A SPRITE =============================================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # Remove the "#" at the beginning of the line below~ +** Processing line: ~ # how_to_render_sprites args~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HOW TO MOVE A SPRITE BASED OFF OF USER INPUT =====================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # Remove the "#" at the beginning of the line below~ +** Processing line: ~ # how_to_move_a_sprite args~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # Remove the "#" at the beginning of the line below~ +** Processing line: ~ # how_to_animate_a_sprite args~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) ===========================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # Remove the "#" at the beginning of the line below~ +** Processing line: ~ # how_to_animate_a_sprite_sheet args~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HOW TO DETERMINE COLLISION =============================================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # Remove the "#" at the beginning of the line below~ +** Processing line: ~ # how_to_determine_collision args~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HOW TO CREATE BUTTONS ==================================================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # Remove the "#" at the beginning of the line below~ +** Processing line: ~ # how_to_create_buttons args~ +** Processing line: ~~ +** Processing line: ~ # ==== The line below renders a debug grid, mouse information, and current tick~ +** Processing line: ~ # render_debug args~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HELLO WORLD ======================================================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ def hello_world args~ +** Processing line: ~ args.nokia.solids << { x: 0, y: 64, w: 10, h: 10, r: 255 }~ +** Processing line: ~~ +** Processing line: ~ args.nokia.labels << {~ +** Processing line: ~ x: 42,~ +** Processing line: ~ y: 46,~ +** Processing line: ~ text: "nokia 3310 jam 3",~ +** Processing line: ~ size_enum: NOKIA_FONT_SM,~ +** Processing line: ~ alignment_enum: 1,~ +** Processing line: ~ r: 0,~ +** Processing line: ~ g: 0,~ +** Processing line: ~ b: 0,~ +** Processing line: ~ a: 255,~ +** Processing line: ~ font: NOKIA_FONT_PATH~ +** Processing line: ~ }~ +** Processing line: ~~ +** Processing line: ~ args.nokia.sprites << {~ +** Processing line: ~ x: 42 - 10,~ +** Processing line: ~ y: 26 - 10,~ +** Processing line: ~ w: 20,~ +** Processing line: ~ h: 20,~ +** Processing line: ~ path: 'sprites/monochrome-ship.png',~ +** Processing line: ~ a: 255,~ +** Processing line: ~ angle: args.state.tick_count % 360~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HOW TO RENDER A LABEL ============================================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ def how_to_render_a_label args~ +** Processing line: ~ # NOTE: Text is aligned from the TOP LEFT corner~ +** Processing line: ~~ +** Processing line: ~ # Render an EXTRA LARGE/XL label (remove the "#" in front of each line below)~ +** Processing line: ~ args.nokia.labels << { x: 0, y: 46, text: "Hello World",~ +** Processing line: ~ size_enum: NOKIA_FONT_XL,~ +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ +** Processing line: ~ font: NOKIA_FONT_PATH }~ +** Processing line: ~~ +** Processing line: ~ # Render a LARGE/LG label (remove the "#" in front of each line below)~ +** Processing line: ~ args.nokia.labels << { x: 0, y: 29, text: "Hello World",~ +** Processing line: ~ size_enum: NOKIA_FONT_LG,~ +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ +** Processing line: ~ font: NOKIA_FONT_PATH }~ +** Processing line: ~~ +** Processing line: ~ # Render a MEDIUM/MD label (remove the "#" in front of each line below)~ +** Processing line: ~ args.nokia.labels << { x: 0, y: 16, text: "Hello World",~ +** Processing line: ~ size_enum: NOKIA_FONT_MD,~ +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ +** Processing line: ~ font: NOKIA_FONT_PATH }~ +** Processing line: ~~ +** Processing line: ~ # Render a SMALL/SM label (remove the "#" in front of each line below)~ +** Processing line: ~ args.nokia.labels << { x: 0, y: 7, text: "Hello World",~ +** Processing line: ~ size_enum: NOKIA_FONT_SM,~ +** Processing line: ~ r: 0, g: 0, b: 0, a: 255,~ +** Processing line: ~ font: NOKIA_FONT_PATH }~ +** Processing line: ~~ +** Processing line: ~ # You are provided args.nokia.default_label which returns a Hash that you~ +** Processing line: ~ # can ~merge~ properties with~ +** Processing line: ~ # Example 1~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(text: "Default")~ +** Processing line: ~~ +** Processing line: ~ # Example 2~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 31,~ +** Processing line: ~ text: "Default")~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ # ==== HOW TO RENDER FILLED SQUARES (SOLIDS) ==================================~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ def how_to_render_solids args~ +** Processing line: ~ # Render a square at 0, 0 with a width and height of 1~ +** Processing line: ~ args.nokia.solids << { x: 0, y: 0, w: 1, h: 1 }~ +** Processing line: ~~ +** Processing line: ~ # Render a square at 1, 1 with a width and height of 2~ +** Processing line: ~ args.nokia.solids << { x: 1, y: 1, w: 2, h: 2 }~ +** Processing line: ~~ +** Processing line: ~ # Render a square at 3, 3 with a width and height of 3~ +** Processing line: ~ args.nokia.solids << { x: 3, y: 3, w: 3, h: 3 }~ +** Processing line: ~~ +** Processing line: ~ # Render a square at 6, 6 with a width and height of 4~ +** Processing line: ~ args.nokia.solids << { x: 6, y: 6, w: 4, h: 4 }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ # ==== HOW TO RENDER UNFILLED SQUARES (BORDERS) ===============================~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ def how_to_render_borders args~ +** Processing line: ~ # Render a square at 0, 0 with a width and height of 3~ +** Processing line: ~ args.nokia.borders << { x: 0, y: 0, w: 3, h: 3, a: 255 }~ +** Processing line: ~~ +** Processing line: ~ # Render a square at 3, 3 with a width and height of 3~ +** Processing line: ~ args.nokia.borders << { x: 3, y: 3, w: 4, h: 4, a: 255 }~ +** Processing line: ~~ +** Processing line: ~ # Render a square at 5, 5 with a width and height of 4~ +** Processing line: ~ args.nokia.borders << { x: 7, y: 7, w: 5, h: 5, a: 255 }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ # ==== HOW TO RENDER A LINE ===================================================~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ def how_to_render_lines args~ +** Processing line: ~ # Render a horizontal line at the bottom~ +** Processing line: ~ args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 0 }~ +** Processing line: ~~ +** Processing line: ~ # Render a vertical line at the left~ +** Processing line: ~ args.nokia.lines << { x: 0, y: 0, x2: 0, y2: 47 }~ +** Processing line: ~~ +** Processing line: ~ # Render a diagonal line starting from the bottom left and going to the top right~ +** Processing line: ~ args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 47 }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ # == HOW TO RENDER A SPRITE ===================================================~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ def how_to_render_sprites args~ +** Processing line: ~ # Loop 10 times and create 10 sprites in 10 positions~ +** Processing line: ~ # Render a sprite at the bottom left with a width and height of 5 and a path of 'sprites/monochrome-ship.png'~ +** Processing line: ~ 10.times do |i|~ +** Processing line: ~ args.nokia.sprites << {~ +** Processing line: ~ x: i * 8.4,~ +** Processing line: ~ y: i * 4.8,~ +** Processing line: ~ w: 5,~ +** Processing line: ~ h: 5,~ +** Processing line: ~ path: 'sprites/monochrome-ship.png'~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Given an array of positions create sprites~ +** Processing line: ~ positions = [~ +** Processing line: ~ { x: 20, y: 32 },~ +** Processing line: ~ { x: 45, y: 15 },~ +** Processing line: ~ { x: 72, y: 23 },~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ positions.each do |position|~ +** Processing line: ~ # use Ruby's ~Hash#merge~ function to create a sprite~ +** Processing line: ~ args.nokia.sprites << position.merge(path: 'sprites/monochrome-ship.png',~ +** Processing line: ~ w: 5,~ +** Processing line: ~ h: 5)~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ==========================~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ def how_to_animate_a_sprite args~ +** Processing line: ~ # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds~ +** Processing line: ~ start_animation_on_tick = 180~ +** Processing line: ~~ +** Processing line: ~ # STEP 2: Get the frame_index given the start tick.~ +** Processing line: ~ sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites?~ +** Processing line: ~ hold_for: 8, # how long to hold each sprite?~ +** Processing line: ~ repeat: true # should it repeat?~ +** Processing line: ~~ +** Processing line: ~ # STEP 3: frame_index will return nil if the frame hasn't arrived yet~ +** Processing line: ~ if sprite_index~ +** Processing line: ~ # if the sprite_index is populated, use it to determine the sprite path and render it~ +** Processing line: ~ sprite_path = "sprites/explosion-#{sprite_index}.png"~ +** Processing line: ~ args.nokia.sprites << { x: 42 - 16,~ +** Processing line: ~ y: 47 - 32,~ +** Processing line: ~ w: 32,~ +** Processing line: ~ h: 32,~ +** Processing line: ~ path: sprite_path }~ +** Processing line: ~ else~ +** Processing line: ~ # if the sprite_index is nil, render a countdown instead~ +** Processing line: ~ countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1)~ +** Processing line: ~~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 0,~ +** Processing line: ~ y: 18,~ +** Processing line: ~ text: "Count Down: #{countdown_in_seconds.to_sf}",~ +** Processing line: ~ alignment_enum: 0)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # render the current tick and the resolved sprite index~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 0,~ +** Processing line: ~ y: 11,~ +** Processing line: ~ text: "Tick: #{args.state.tick_count}")~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 0,~ +** Processing line: ~ y: 5,~ +** Processing line: ~ text: "sprite_index: #{sprite_index}")~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) =================================~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ def how_to_animate_a_sprite_sheet args~ +** Processing line: ~ # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds~ +** Processing line: ~ start_animation_on_tick = 180~ +** Processing line: ~~ +** Processing line: ~ # STEP 2: Get the frame_index given the start tick.~ +** Processing line: ~ sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites?~ +** Processing line: ~ hold_for: 8, # how long to hold each sprite?~ +** Processing line: ~ repeat: true # should it repeat?~ +** Processing line: ~~ +** Processing line: ~ # STEP 3: frame_index will return nil if the frame hasn't arrived yet~ +** Processing line: ~ if sprite_index~ +** Processing line: ~ # if the sprite_index is populated, use it to determine the source rectangle and render it~ +** Processing line: ~ args.nokia.sprites << {~ +** Processing line: ~ x: 42 - 16,~ +** Processing line: ~ y: 47 - 32,~ +** Processing line: ~ w: 32,~ +** Processing line: ~ h: 32,~ +** Processing line: ~ path: "sprites/explosion-sheet.png",~ +** Processing line: ~ source_x: 32 * sprite_index,~ +** Processing line: ~ source_y: 0,~ +** Processing line: ~ source_w: 32,~ +** Processing line: ~ source_h: 32~ +** Processing line: ~ }~ +** Processing line: ~ else~ +** Processing line: ~ # if the sprite_index is nil, render a countdown instead~ +** Processing line: ~ countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1)~ +** Processing line: ~~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 0,~ +** Processing line: ~ y: 18,~ +** Processing line: ~ text: "Count Down: #{countdown_in_seconds.to_sf}",~ +** Processing line: ~ alignment_enum: 0)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # render the current tick and the resolved sprite index~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 0,~ +** Processing line: ~ y: 11,~ +** Processing line: ~ text: "tick: #{args.state.tick_count}")~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 0,~ +** Processing line: ~ y: 5,~ +** Processing line: ~ text: "sprite_index: #{sprite_index}")~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ # ==== HOW TO STORE STATE, ACCEPT INPUT, AND RENDER SPRITE BASED OFF OF STATE =~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ def how_to_move_a_sprite args~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 42,~ +** Processing line: ~ y: 46, text: "Use Arrow Keys",~ +** Processing line: ~ alignment_enum: 1)~ +** Processing line: ~~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 42,~ +** Processing line: ~ y: 41, text: "Or WASD",~ +** Processing line: ~ alignment_enum: 1)~ +** Processing line: ~~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 42,~ +** Processing line: ~ y: 36, text: "Or Click",~ +** Processing line: ~ alignment_enum: 1)~ +** Processing line: ~~ +** Processing line: ~ # set the initial values for x and y using ||= ("or equal operator")~ +** Processing line: ~ args.state.ship.x ||= 0~ +** Processing line: ~ args.state.ship.y ||= 0~ +** Processing line: ~~ +** Processing line: ~ # if a mouse click occurs, update the ship's x and y to be the location of the click~ +** Processing line: ~ if args.nokia.mouse_click~ +** Processing line: ~ args.state.ship.x = args.nokia.mouse_click.x~ +** Processing line: ~ args.state.ship.y = args.nokia.mouse_click.y~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # if a or left arrow is pressed/held, decrement the ships x position~ +** Processing line: ~ if args.nokia.keyboard.left~ +** Processing line: ~ args.state.ship.x -= 1~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # if d or right arrow is pressed/held, increment the ships x position~ +** Processing line: ~ if args.nokia.keyboard.right~ +** Processing line: ~ args.state.ship.x += 1~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # if s or down arrow is pressed/held, decrement the ships y position~ +** Processing line: ~ if args.nokia.keyboard.down~ +** Processing line: ~ args.state.ship.y -= 1~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # if w or up arrow is pressed/held, increment the ships y position~ +** Processing line: ~ if args.nokia.keyboard.up~ +** Processing line: ~ args.state.ship.y += 1~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # render the sprite to the screen using the position stored in args.state.ship~ +** Processing line: ~ args.nokia.sprites << {~ +** Processing line: ~ x: args.state.ship.x,~ +** Processing line: ~ y: args.state.ship.y,~ +** Processing line: ~ w: 5,~ +** Processing line: ~ h: 5,~ +** Processing line: ~ path: 'sprites/monochrome-ship.png',~ +** Processing line: ~ # parameters beyond this point are optional~ +** Processing line: ~ angle: 0, # Note: rotation angle is denoted in degrees NOT radians~ +** Processing line: ~ r: 255,~ +** Processing line: ~ g: 255,~ +** Processing line: ~ b: 255,~ +** Processing line: ~ a: 255~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ # ==== HOW TO DETERMINE COLLISION =======================================~ +** Processing line: ~ # =======================================================================~ +** Processing line: ~ def how_to_determine_collision args~ +** Processing line: ~ # Render the instructions~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 42,~ +** Processing line: ~ y: 46, text: "Click Anywhere",~ +** Processing line: ~ alignment_enum: 1)~ +** Processing line: ~~ +** Processing line: ~ # if a mouse click occurs:~ +** Processing line: ~ # - set ship_one if it isn't set~ +** Processing line: ~ # - set ship_two if it isn't set~ +** Processing line: ~ # - otherwise reset ship one and ship two~ +** Processing line: ~ if args.nokia.mouse_click~ +** Processing line: ~ # is ship_one set?~ +** Processing line: ~ if !args.state.ship_one~ +** Processing line: ~ args.state.ship_one = { x: args.nokia.mouse_click.x - 5,~ +** Processing line: ~ y: args.nokia.mouse_click.y - 5,~ +** Processing line: ~ w: 10,~ +** Processing line: ~ h: 10 }~ +** Processing line: ~ # is ship_one set?~ +** Processing line: ~ elsif !args.state.ship_two~ +** Processing line: ~ args.state.ship_two = { x: args.nokia.mouse_click.x - 5,~ +** Processing line: ~ y: args.nokia.mouse_click.y - 5,~ +** Processing line: ~ w: 10,~ +** Processing line: ~ h: 10 }~ +** Processing line: ~ # should we reset?~ +** Processing line: ~ else~ +** Processing line: ~ args.state.ship_one = nil~ +** Processing line: ~ args.state.ship_two = nil~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # render ship one if it's set~ +** Processing line: ~ if args.state.ship_one~ +** Processing line: ~ # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha~ +** Processing line: ~ # render ship one~ +** Processing line: ~ args.nokia.sprites << args.state.ship_one.merge(path: 'sprites/monochrome-ship.png')~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if args.state.ship_two~ +** Processing line: ~ # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha~ +** Processing line: ~ # render ship two~ +** Processing line: ~ args.nokia.sprites << args.state.ship_two.merge(path: 'sprites/monochrome-ship.png')~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # if both ship one and ship two are set, then determine collision~ +** Processing line: ~ if args.state.ship_one && args.state.ship_two~ +** Processing line: ~ # collision is determined using the intersect_rect? method~ +** Processing line: ~ if args.state.ship_one.intersect_rect? args.state.ship_two~ +** Processing line: ~ # if collision occurred, render the words collision!~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 42,~ +** Processing line: ~ y: 5,~ +** Processing line: ~ text: "Collision!",~ +** Processing line: ~ alignment_enum: 1)~ +** Processing line: ~ else~ +** Processing line: ~ # if collision occurred, render the words no collision.~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 42,~ +** Processing line: ~ y: 5,~ +** Processing line: ~ text: "No Collision.",~ +** Processing line: ~ alignment_enum: 1)~ +** Processing line: ~ end~ +** Processing line: ~ else~ +** Processing line: ~ # if both ship one and ship two aren't set, then render --~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 42,~ +** Processing line: ~ y: 6,~ +** Processing line: ~ text: "--",~ +** Processing line: ~ alignment_enum: 1)~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ # ==== HOW TO CREATE BUTTONS ==================================================~ +** Processing line: ~ # =============================================================================~ +** Processing line: ~ def how_to_create_buttons args~ +** Processing line: ~ # Define a button style~ +** Processing line: ~ args.state.button_style = { w: 82, h: 10, }~ +** Processing line: ~~ +** Processing line: ~ # Render instructions~ +** Processing line: ~ args.state.button_message ||= "Press a Button!"~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 42,~ +** Processing line: ~ y: 82,~ +** Processing line: ~ text: args.state.button_message,~ +** Processing line: ~ alignment_enum: 1)~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ # Creates button one using a border and a label~ +** Processing line: ~ args.state.button_one_border = args.state.button_style.merge( x: 1, y: 32)~ +** Processing line: ~ args.nokia.borders << args.state.button_one_border~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: args.state.button_one_border.x + 2,~ +** Processing line: ~ y: args.state.button_one_border.y + NOKIA_FONT_SM_HEIGHT + 2,~ +** Processing line: ~ text: "Button One")~ +** Processing line: ~~ +** Processing line: ~ # Creates button two using a border and a label~ +** Processing line: ~ args.state.button_two_border = args.state.button_style.merge( x: 1, y: 20)~ +** Processing line: ~~ +** Processing line: ~ args.nokia.borders << args.state.button_two_border~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: args.state.button_two_border.x + 2,~ +** Processing line: ~ y: args.state.button_two_border.y + NOKIA_FONT_SM_HEIGHT + 2,~ +** Processing line: ~ text: "Button Two")~ +** Processing line: ~~ +** Processing line: ~ # Initialize the state variable that tracks which button was clicked to "" (empty stringI~ +** Processing line: ~ args.state.last_button_clicked ||= "--"~ +** Processing line: ~~ +** Processing line: ~ # If a click occurs, check to see if either button one, or button two was clicked~ +** Processing line: ~ # using the inside_rect? method of the mouse~ +** Processing line: ~ # set args.state.last_button_clicked accordingly~ +** Processing line: ~ if args.nokia.mouse_click~ +** Processing line: ~ if args.nokia.mouse_click.inside_rect? args.state.button_one_border~ +** Processing line: ~ args.state.last_button_clicked = "One Clicked!"~ +** Processing line: ~ elsif args.nokia.mouse_click.inside_rect? args.state.button_two_border~ +** Processing line: ~ args.state.last_button_clicked = "Two Clicked!"~ +** Processing line: ~ else~ +** Processing line: ~ args.state.last_button_clicked = "--"~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # Render the current value of args.state.last_button_clicked~ +** Processing line: ~ args.nokia.labels << args.nokia~ +** Processing line: ~ .default_label~ +** Processing line: ~ .merge(x: 42,~ +** Processing line: ~ y: 5,~ +** Processing line: ~ text: args.state.last_button_clicked,~ +** Processing line: ~ alignment_enum: 1)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def render_debug args~ +** Processing line: ~ if !args.state.grid_rendered~ +** Processing line: ~ (NOKIA_HEIGHT + 1).map_with_index do |i|~ +** Processing line: ~ args.outputs.static_debug << {~ +** Processing line: ~ x: NOKIA_X_OFFSET,~ +** Processing line: ~ y: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM),~ +** Processing line: ~ x2: NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH,~ +** Processing line: ~ y2: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM),~ +** Processing line: ~ r: 128,~ +** Processing line: ~ g: 128,~ +** Processing line: ~ b: 128,~ +** Processing line: ~ a: 80~ +** Processing line: ~ }.line~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ (NOKIA_WIDTH + 1).map_with_index do |i|~ +** Processing line: ~ args.outputs.static_debug << {~ +** Processing line: ~ x: NOKIA_X_OFFSET + (i * NOKIA_ZOOM),~ +** Processing line: ~ y: NOKIA_Y_OFFSET,~ +** Processing line: ~ x2: NOKIA_X_OFFSET + (i * NOKIA_ZOOM),~ +** Processing line: ~ y2: NOKIA_Y_OFFSET + NOKIA_ZOOMED_HEIGHT,~ +** Processing line: ~ r: 128,~ +** Processing line: ~ g: 128,~ +** Processing line: ~ b: 128,~ +** Processing line: ~ a: 80~ +** Processing line: ~ }.line~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.state.grid_rendered = true~ +** Processing line: ~~ +** Processing line: ~ args.state.last_click ||= 0~ +** Processing line: ~ args.state.last_up ||= 0~ +** Processing line: ~ args.state.last_click = args.state.tick_count if args.nokia.mouse_down # you can also use args.nokia.click~ +** Processing line: ~ args.state.last_up = args.state.tick_count if args.nokia.mouse_up~ +** Processing line: ~ args.state.label_style = { size_enum: -1.5 }~ +** Processing line: ~~ +** Processing line: ~ args.state.watch_list = [~ +** Processing line: ~ "args.state.tick_count is: #{args.state.tick_count}",~ +** Processing line: ~ "args.nokia.mouse_position is: #{args.nokia.mouse_position.x}, #{args.nokia.mouse_position.y}",~ +** Processing line: ~ "args.nokia.mouse_down tick: #{args.state.last_click || "never"}",~ +** Processing line: ~ "args.nokia.mouse_up tick: #{args.state.last_up || "false"}",~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ args.outputs.debug << args.state~ +** Processing line: ~ .watch_list~ +** Processing line: ~ .map_with_index do |text, i|~ +** Processing line: ~ {~ +** Processing line: ~ x: 5,~ +** Processing line: ~ y: 720 - (i * 18),~ +** Processing line: ~ text: text,~ +** Processing line: ~ size_enum: -1.5,~ +** Processing line: ~ r: 255, g: 255, b: 255~ +** Processing line: ~ }.label~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ args.outputs.debug << {~ +** Processing line: ~ x: 640,~ +** Processing line: ~ y: 25,~ +** 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: ~ r: 255, g: 255, b: 255~ +** Processing line: ~ }.label~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def snake_demo args~ +** Processing line: ~~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ $gtk.reset~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Lowrez - Nokia 3310 - nokia.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Lowrez - Nokia 3310 - nokia.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: ~Lowrez - Nokia 3310 - nokia.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_lowrez/nokia_3310/app/nokia.rb~ +** Processing line: ~ # Emulation of a 64x64 canvas. Don't change this file unless you know what you're doing :-)~ +** Processing line: ~ # Head over to main.rb and study the code there.~ +** Processing line: ~~ +** Processing line: ~ NOKIA_WIDTH = 84~ +** Processing line: ~ NOKIA_HEIGHT = 48~ +** Processing line: ~ NOKIA_ZOOM = 12~ +** Processing line: ~ NOKIA_ZOOMED_WIDTH = NOKIA_WIDTH * NOKIA_ZOOM~ +** Processing line: ~ NOKIA_ZOOMED_HEIGHT = NOKIA_HEIGHT * NOKIA_ZOOM~ +** Processing line: ~ NOKIA_X_OFFSET = (1280 - NOKIA_ZOOMED_WIDTH).half~ +** Processing line: ~ NOKIA_Y_OFFSET = ( 720 - NOKIA_ZOOMED_HEIGHT).half~ +** Processing line: ~~ +** Processing line: ~ NOKIA_FONT_XL = -1~ +** Processing line: ~ NOKIA_FONT_XL_HEIGHT = 20~ +** Processing line: ~~ +** Processing line: ~ NOKIA_FONT_LG = -3.5~ +** Processing line: ~ NOKIA_FONT_LG_HEIGHT = 15~ +** Processing line: ~~ +** Processing line: ~ NOKIA_FONT_MD = -6~ +** Processing line: ~ NOKIA_FONT_MD_HEIGHT = 10~ +** Processing line: ~~ +** Processing line: ~ NOKIA_FONT_SM = -8.5~ +** Processing line: ~ NOKIA_FONT_SM_HEIGHT = 5~ +** Processing line: ~~ +** Processing line: ~ NOKIA_FONT_PATH = 'fonts/lowrez.ttf'~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ class NokiaOutputs~ +** Processing line: ~ attr_accessor :width, :height~ +** Processing line: ~~ +** Processing line: ~ def initialize args~ +** Processing line: ~ @args = args~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def outputs_nokia~ +** Processing line: ~ return @args.outputs if @args.state.tick_count <= 0~ +** Processing line: ~ return @args.outputs[:nokia]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def solids~ +** Processing line: ~ outputs_nokia.solids~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def borders~ +** Processing line: ~ outputs_nokia.borders~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def sprites~ +** Processing line: ~ outputs_nokia.sprites~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def labels~ +** Processing line: ~ outputs_nokia.labels~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def default_label~ +** Processing line: ~ {~ +** Processing line: ~ x: 0,~ +** Processing line: ~ y: 63,~ +** Processing line: ~ text: "",~ +** Processing line: ~ size_enum: NOKIA_FONT_SM,~ +** Processing line: ~ alignment_enum: 0,~ +** Processing line: ~ r: 0,~ +** Processing line: ~ g: 0,~ +** Processing line: ~ b: 0,~ +** Processing line: ~ a: 255,~ +** Processing line: ~ font: NOKIA_FONT_PATH~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def lines~ +** Processing line: ~ outputs_nokia.lines~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def primitives~ +** Processing line: ~ outputs_nokia.primitives~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def click~ +** Processing line: ~ return nil unless @args.inputs.mouse.click~ +** Processing line: ~ mouse~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def mouse_click~ +** Processing line: ~ click~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def mouse_down~ +** Processing line: ~ @args.inputs.mouse.down~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def mouse_up~ +** Processing line: ~ @args.inputs.mouse.up~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def mouse~ +** Processing line: ~ [~ +** Processing line: ~ ((@args.inputs.mouse.x - NOKIA_X_OFFSET).idiv(NOKIA_ZOOM)),~ +** Processing line: ~ ((@args.inputs.mouse.y - NOKIA_Y_OFFSET).idiv(NOKIA_ZOOM))~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def mouse_position~ +** Processing line: ~ mouse~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def keyboard~ +** Processing line: ~ @args.inputs.keyboard~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ class GTK::Args~ +** Processing line: ~ def init_nokia~ +** Processing line: ~ return if @nokia~ +** Processing line: ~ @nokia = NokiaOutputs.new self~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def nokia~ +** Processing line: ~ @nokia~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ module GTK~ +** Processing line: ~ class Runtime~ +** Processing line: ~ alias_method :__original_tick_core__, :tick_core unless Runtime.instance_methods.include?(:__original_tick_core__)~ +** Processing line: ~~ +** Processing line: ~ def tick_core~ +** Processing line: ~ @args.init_nokia~ +** Processing line: ~~ +** Processing line: ~ __original_tick_core__~ +** Processing line: ~~ +** Processing line: ~ return if @args.state.tick_count <= 0~ +** Processing line: ~~ +** Processing line: ~ @args.render_target(:nokia)~ +** Processing line: ~ .labels~ +** Processing line: ~ .each do |l|~ +** Processing line: ~ l.y += 1~ +** Processing line: ~ if (l.a || 255) > 128~ +** Processing line: ~ l.r = 67~ +** Processing line: ~ l.g = 82~ +** Processing line: ~ l.b = 61~ +** Processing line: ~ l.a = 255~ +** Processing line: ~ else~ +** Processing line: ~ l.a = 0~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ @args.render_target(:nokia)~ +** Processing line: ~ .sprites~ +** Processing line: ~ .each do |s|~ +** Processing line: ~ if (s.a || 255) > 128~ +** Processing line: ~ s.a = 255~ +** Processing line: ~ else~ +** Processing line: ~ s.a = 0~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ @args.render_target(:nokia)~ +** Processing line: ~ .solids~ +** Processing line: ~ .each do |s|~ +** Processing line: ~ if (s.a || 255) > 128~ +** Processing line: ~ s.r = 67~ +** Processing line: ~ s.g = 82~ +** Processing line: ~ s.b = 61~ +** Processing line: ~ s.a = 255~ +** Processing line: ~ else~ +** Processing line: ~ s.a = 0~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ @args.render_target(:nokia)~ +** Processing line: ~ .borders~ +** Processing line: ~ .each do |s|~ +** Processing line: ~ if (s.a || 255) > 128~ +** Processing line: ~ s.r = 67~ +** Processing line: ~ s.g = 82~ +** Processing line: ~ s.b = 61~ +** Processing line: ~ s.a = 255~ +** Processing line: ~ else~ +** Processing line: ~ s.a = 0~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ @args.render_target(:nokia)~ +** Processing line: ~ .lines~ +** Processing line: ~ .each do |l|~ +** Processing line: ~ l.y += 1~ +** Processing line: ~ l.y2 += 1~ +** Processing line: ~ l.y2 += 1 if l.y1 != l.y2~ +** Processing line: ~ l.x2 += 1 if l.x1 != l.x2~ +** Processing line: ~~ +** Processing line: ~ if (l.a || 255) > 128~ +** Processing line: ~ l.r = 67~ +** Processing line: ~ l.g = 82~ +** Processing line: ~ l.b = 61~ +** Processing line: ~ l.a = 255~ +** Processing line: ~ else~ +** Processing line: ~ l.a = 0~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ @args.outputs.borders << {~ +** Processing line: ~ x: NOKIA_X_OFFSET - 1,~ +** Processing line: ~ y: NOKIA_Y_OFFSET - 1,~ +** Processing line: ~ w: NOKIA_ZOOMED_WIDTH + 2,~ +** Processing line: ~ h: NOKIA_ZOOMED_HEIGHT + 2,~ +** Processing line: ~ r: 128, g: 128, b: 128~ +** Processing line: ~ }~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ @args.outputs.background_color = [199, 240, 216]~ +** Processing line: ~~ +** Processing line: ~ @args.outputs.solids << [0, 0, NOKIA_X_OFFSET, 720]~ +** Processing line: ~ @args.outputs.solids << [0, 0, 1280, NOKIA_Y_OFFSET]~ +** Processing line: ~ @args.outputs.solids << [NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH, 0, NOKIA_X_OFFSET, 720]~ +** Processing line: ~ @args.outputs.solids << [0, NOKIA_Y_OFFSET.from_top, 1280, NOKIA_Y_OFFSET]~ +** Processing line: ~~ +** Processing line: ~ @args.outputs~ +** Processing line: ~ .sprites << { x: NOKIA_X_OFFSET,~ +** Processing line: ~ y: NOKIA_Y_OFFSET,~ +** Processing line: ~ w: NOKIA_ZOOMED_WIDTH,~ +** Processing line: ~ h: NOKIA_ZOOMED_HEIGHT,~ +** Processing line: ~ source_x: 0,~ +** Processing line: ~ source_y: 0,~ +** Processing line: ~ source_w: NOKIA_WIDTH,~ +** Processing line: ~ source_h: NOKIA_HEIGHT,~ +** Processing line: ~ path: :nokia }~ +** Processing line: ~~ +** Processing line: ~ if !@args.state.overlay_rendered~ +** Processing line: ~ (NOKIA_HEIGHT + 1).map_with_index do |i|~ +** Processing line: ~ @args.outputs.static_lines << {~ +** Processing line: ~ x: NOKIA_X_OFFSET,~ +** Processing line: ~ y: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM),~ +** Processing line: ~ x2: NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH,~ +** Processing line: ~ y2: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM),~ +** Processing line: ~ r: 199,~ +** Processing line: ~ g: 240,~ +** Processing line: ~ b: 216,~ +** Processing line: ~ a: 100~ +** Processing line: ~ }.line~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ (NOKIA_WIDTH + 1).map_with_index do |i|~ +** Processing line: ~ @args.outputs.static_lines << {~ +** Processing line: ~ x: NOKIA_X_OFFSET + (i * NOKIA_ZOOM),~ +** Processing line: ~ y: NOKIA_Y_OFFSET,~ +** Processing line: ~ x2: NOKIA_X_OFFSET + (i * NOKIA_ZOOM),~ +** Processing line: ~ y2: NOKIA_Y_OFFSET + NOKIA_ZOOMED_HEIGHT,~ +** Processing line: ~ r: 199,~ +** Processing line: ~ g: 240,~ +** Processing line: ~ b: 216,~ +** Processing line: ~ a: 100~ +** Processing line: ~ }.line~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ @args.state.overlay_rendered = true~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** Lowrez - Resolution 64x64 - lowrez.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Lowrez - Resolution 64x64 - lowrez.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: ~Lowrez - Resolution 64x64 - lowrez.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -135154,10 +208950,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Lowrez - Resolution 64x64 - main.rb~ -- H1 detected. +** Processing line: ~*** Lowrez - Resolution 64x64 - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Lowrez - Resolution 64x64 - 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: ~Lowrez - Resolution 64x64 - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -135783,10 +209584,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Platformer - Clepto Frog - main.rb~ -- H1 detected. +** Processing line: ~*** Platformer - Clepto Frog - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Platformer - Clepto Frog - 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: ~Platformer - Clepto Frog - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -136663,10 +210469,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Platformer - Clepto Frog - map.rb~ -- H1 detected. +** Processing line: ~*** Platformer - Clepto Frog - map.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Platformer - Clepto Frog - map.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: ~Platformer - Clepto Frog - map.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -137704,10 +211515,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Platformer - Gorillas Basic - credits.txt~ -- H1 detected. +** Processing line: ~*** Platformer - Gorillas Basic - credits.txt~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Platformer - Gorillas Basic - credits.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: ~Platformer - Gorillas Basic - credits.txt~ - Line's tilde count is: 0 - Line contains link marker: false @@ -137723,10 +211539,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Platformer - Gorillas Basic - main.rb~ -- H1 detected. +** Processing line: ~*** Platformer - Gorillas Basic - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Platformer - Gorillas Basic - 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: ~Platformer - Gorillas Basic - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -138112,10 +211933,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Platformer - Gorillas Basic - tests.rb~ -- H1 detected. +** Processing line: ~*** Platformer - Gorillas Basic - tests.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Platformer - Gorillas Basic - 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: ~Platformer - Gorillas Basic - tests.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -138132,10 +211958,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Platformer - Gorillas Basic - Tests - building_generation_tests.rb~ -- H1 detected. +** Processing line: ~*** Platformer - Gorillas Basic - Tests - building_generation_tests.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Platformer - Gorillas Basic - Tests - building_generation_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: ~Platformer - Gorillas Basic - Tests - building_generation_tests.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -138163,10 +211994,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Platformer - The Little Probe - main.rb~ -- H1 detected. +** Processing line: ~*** Platformer - The Little Probe - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Platformer - The Little Probe - 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: ~Platformer - The Little Probe - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -139066,10 +212902,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Platformer - The Little Probe - Data - level.txt~ -- H1 detected. +** Processing line: ~*** Platformer - The Little Probe - Data - level.txt~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Platformer - The Little Probe - Data - level.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: ~Platformer - The Little Probe - Data - level.txt~ - Line's tilde count is: 0 - Line contains link marker: false @@ -140562,10 +214403,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Platformer - The Little Probe - Data - level_lava.txt~ -- H1 detected. +** Processing line: ~*** Platformer - The Little Probe - Data - level_lava.txt~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Platformer - The Little Probe - Data - level_lava.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: ~Platformer - The Little Probe - Data - level_lava.txt~ - Line's tilde count is: 0 - Line contains link marker: false @@ -140812,10 +214658,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Choose Your Own Adventure - decision.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Choose Your Own Adventure - decision.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Choose Your Own Adventure - decision.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Choose Your Own Adventure - decision.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -140865,10 +214716,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Choose Your Own Adventure - main.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Choose Your Own Adventure - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Choose Your Own Adventure - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Choose Your Own Adventure - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -141013,10 +214869,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - lowrez_simulator.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - lowrez_simulator.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - lowrez_simulator.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - lowrez_simulator.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -141120,10 +214981,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - main.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -141609,10 +215475,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - require.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - require.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - require.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - require.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -141636,10 +215507,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - storyline.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - storyline.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -141798,10 +215674,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_anka.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_anka.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_anka.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_anka.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -141941,10 +215822,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -142032,10 +215918,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_day_one.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_day_one.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_day_one.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_day_one.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -142254,10 +216145,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_final_decision.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_final_decision.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_final_decision.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_final_decision.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -142406,10 +216302,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_final_message.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_final_message.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_final_message.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_final_message.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -142638,10 +216539,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -142873,10 +216779,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -143040,10 +216951,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -143151,10 +217067,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb~ -- H1 detected. +** Processing line: ~*** Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -143271,17 +217192,22 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Roguelike - Roguelike Line Of Sight - constants.rb~ -- H1 detected. +** Processing line: ~*** Rpg Roguelike - Roguelike Starting Point - constants.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rpg Roguelike - Roguelike Line Of Sight - constants.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Roguelike - Roguelike Starting Point - constants.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Roguelike - Roguelike Starting Point - constants.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ ** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/constants.rb~ +** Processing line: ~ # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/constants.rb~ ** Processing line: ~ SHOW_LEGEND = true~ ** Processing line: ~ SOURCE_TILE_SIZE = 16~ ** Processing line: ~ DESTINATION_TILE_SIZE = 16~ @@ -143295,17 +217221,22 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Roguelike - Roguelike Line Of Sight - legend.rb~ -- H1 detected. +** Processing line: ~*** Rpg Roguelike - Roguelike Starting Point - legend.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rpg Roguelike - Roguelike Line Of Sight - legend.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Roguelike - Roguelike Starting Point - legend.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Roguelike - Roguelike Starting Point - legend.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ ** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/legend.rb~ +** Processing line: ~ # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/legend.rb~ ** Processing line: ~ def tick_legend args~ ** Processing line: ~ return unless SHOW_LEGEND~ ** Processing line: ~~ @@ -143376,17 +217307,22 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Roguelike - Roguelike Line Of Sight - main.rb~ -- H1 detected. +** Processing line: ~*** Rpg Roguelike - Roguelike Starting Point - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rpg Roguelike - Roguelike Line Of Sight - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Roguelike - Roguelike 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: ~Rpg Roguelike - Roguelike 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_rpg_roguelike/roguelike_line_of_sight/app/main.rb~ +** Processing line: ~ # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb~ ** Processing line: ~ require 'app/constants.rb'~ ** Processing line: ~ require 'app/sprite_lookup.rb'~ ** Processing line: ~ require 'app/legend.rb'~ @@ -143489,17 +217425,22 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Roguelike - Roguelike Line Of Sight - sprite_lookup.rb~ -- H1 detected. +** Processing line: ~*** Rpg Roguelike - Roguelike Starting Point - sprite_lookup.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rpg Roguelike - Roguelike Line Of Sight - sprite_lookup.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Roguelike - Roguelike Starting Point - sprite_lookup.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Roguelike - Roguelike Starting Point - sprite_lookup.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ ** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ # ./samples/99_genre_rpg_roguelike/roguelike_line_of_sight/app/sprite_lookup.rb~ +** Processing line: ~ # ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb~ ** Processing line: ~ def sprite_lookup~ ** Processing line: ~ {~ ** Processing line: ~ 0 => [3, 0],~ @@ -143629,17 +217570,22 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Roguelike - Roguelike Starting Point - main.rb~ -- H1 detected. +** Processing line: ~*** Rpg Roguelike - Roguelike Line Of Sight - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string -- Formatting line: ~Rpg Roguelike - Roguelike Starting Point - main.rb~ +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Roguelike - Roguelike Line Of Sight - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Roguelike - Roguelike Line Of Sight - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false ** Processing line: ~~ ** Processing line: ~#+begin_src ruby~ - PRE start detected. -** Processing line: ~ # ./samples/99_genre_rpg_roguelike/roguelike_starting_point/app/main.rb~ +** Processing line: ~ # ./samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb~ ** Processing line: ~ =begin~ ** Processing line: ~~ ** Processing line: ~ APIs listing that haven't been encountered in previous sample apps:~ @@ -144084,10 +218030,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Tactical - Hexagonal Grid - main.rb~ -- H1 detected. +** Processing line: ~*** Rpg Tactical - Hexagonal Grid - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Tactical - Hexagonal Grid - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Tactical - Hexagonal Grid - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -144168,10 +218119,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Tactical - Isometric Grid - main.rb~ -- H1 detected. +** Processing line: ~*** Rpg Tactical - Isometric Grid - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Tactical - Isometric Grid - main.rb~ +- Line's tilde count is: 0 +- Line contains link marker: false +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string - Formatting line: ~Rpg Tactical - Isometric Grid - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -144446,10 +218402,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* Rpg Topdown - Topdown Starting Point - main.rb~ -- H1 detected. +** Processing line: ~*** Rpg Topdown - Topdown Starting Point - main.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~Rpg Topdown - Topdown 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: ~Rpg Topdown - Topdown Starting Point - main.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -144570,10 +218531,35 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* args.rb~ -- H1 detected. +** Processing line: ~** OSS~ +- H2 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~** ~... gsub-ing empty string +- Formatting line: ~OSS~ +- 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: ~OSS~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~Follows is a source code listing for all files that have been open sourced. This code can be found online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]].~ +- P detected. +- Determining if line is a header. +- Line does not appear to be a header. +- Formatting line: ~Follows is a source code listing for all files that have been open sourced. This code can be found online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]].~ +- Line's tilde count is: 0 +- Line contains link marker: true +- LINK detected. +** Processing line: ~*** args.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~args.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: ~args.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -144624,6 +218610,8 @@ Follows is a source code listing for all files that have been open sourced. This ** 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]~ @@ -144641,6 +218629,10 @@ Follows is a source code listing for all files that have been open sourced. This ** 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~ ** Processing line: ~ @inputs = Inputs.new~ ** Processing line: ~ @outputs = Outputs.new args: self~ @@ -144655,8 +218647,11 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ @pixel_arrays = {}~ ** Processing line: ~ @all_tests = []~ ** Processing line: ~ @geometry = GTK::Geometry~ +** Processing line: ~ @fn = GTK::Fn~ ** Processing line: ~ @wizards = Wizards.new~ ** Processing line: ~ @layout = GTK::Layout.new @grid.w, @grid.h~ +** Processing line: ~ @easing = GTK::Easing~ +** Processing line: ~ @string = String~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~~ @@ -144805,6 +218800,10 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ def controller_two~ ** Processing line: ~ @inputs.controller_two~ ** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def autocomplete_methods~ +** Processing line: ~ [:inputs, :outputs, :gtk, :state, :geometry, :audio, :grid, :layout, :fn]~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ @@ -144812,10 +218811,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* assert.rb~ -- H1 detected. +** Processing line: ~*** assert.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~assert.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: ~assert.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -144929,6 +218933,16 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ nil~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def not_equal! actual, expected, message = nil~ +** 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: ~ raise message~ +** Processing line: ~ end~ +** Processing line: ~ nil~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ =begin~ ** Processing line: ~ Assert if a value is explicitly nil (not false).~ ** Processing line: ~~ @@ -144956,10 +218970,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* attr_gtk.rb~ -- H1 detected. +** Processing line: ~*** attr_gtk.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~attr_gtk.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: ~attr_gtk.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -145011,16 +219030,25 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ def geometry~ ** Processing line: ~ args.geometry~ ** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def layout~ +** Processing line: ~ args.layout~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~#+end_src~ - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* attr_sprite.rb~ -- H1 detected. +** Processing line: ~*** attr_sprite.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~attr_sprite.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: ~attr_sprite.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -145034,26 +219062,35 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~~ ** Processing line: ~ # @private~ ** Processing line: ~ module AttrRect~ +** Processing line: ~ include GTK::Geometry~ +** Processing line: ~~ ** Processing line: ~ def left~ -** Processing line: ~ @x~ +** Processing line: ~ (@x || self.x)~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def right~ -** Processing line: ~ @x + @w~ +** Processing line: ~ (@x || self.x) + (@w || self.w)~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def bottom~ -** Processing line: ~ @y~ +** Processing line: ~ (@y || self.y)~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def top~ -** Processing line: ~ @y + @h~ +** Processing line: ~ (@y || self.y) + (@h || self.h)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def x1~ +** Processing line: ~ (@x || self.x)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def y1~ +** Processing line: ~ (@y || self.y)~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ module AttrSprite~ ** Processing line: ~ include AttrRect~ -** Processing line: ~ include GTK::Geometry~ ** Processing line: ~~ ** 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,~ @@ -145068,18 +219105,10 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ self~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def x1~ -** Processing line: ~ @x~ -** Processing line: ~ end~ -** Processing line: ~~ ** Processing line: ~ def x1= value~ ** Processing line: ~ @x = value~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def y1~ -** Processing line: ~ @y~ -** Processing line: ~ end~ -** Processing line: ~~ ** Processing line: ~ def y1= value~ ** Processing line: ~ @y = value~ ** Processing line: ~ end~ @@ -145089,10 +219118,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* console.rb~ -- H1 detected. +** Processing line: ~*** console.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~console.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: ~console.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -145255,7 +219289,10 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ @visible~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # @gtk~ +** Processing line: ~ def open reason = nil~ +** Processing line: ~ show reason~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ def show reason = nil~ ** Processing line: ~ @shown_at = Kernel.global_tick_count~ ** Processing line: ~ @show_reason = reason~ @@ -145538,6 +219575,10 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ if args.inputs.keyboard.key_down.control || args.inputs.keyboard.key_down.meta~ ** Processing line: ~ prompt << $gtk.ffi_misc.getclipboard~ ** Processing line: ~ end~ +** Processing line: ~ elsif args.inputs.keyboard.key_down.home~ +** Processing line: ~ prompt.move_cursor_home~ +** Processing line: ~ elsif args.inputs.keyboard.key_down.end~ +** Processing line: ~ prompt.move_cursor_end~ ** Processing line: ~ elsif args.inputs.keyboard.key_down.up~ ** Processing line: ~ if @command_history_index == -1~ ** Processing line: ~ @nonhistory_input = current_input_str~ @@ -145556,9 +219597,17 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ self.current_input_str = @command_history[@command_history_index].dup~ ** Processing line: ~ end~ ** Processing line: ~ elsif args.inputs.keyboard.key_down.left~ -** Processing line: ~ prompt.move_cursor_left~ +** Processing line: ~ if args.inputs.keyboard.key_down.control~ +** Processing line: ~ prompt.move_cursor_left_word~ +** Processing line: ~ else~ +** Processing line: ~ prompt.move_cursor_left~ +** Processing line: ~ end~ ** Processing line: ~ elsif args.inputs.keyboard.key_down.right~ -** Processing line: ~ prompt.move_cursor_right~ +** Processing line: ~ if args.inputs.keyboard.key_down.control~ +** Processing line: ~ prompt.move_cursor_right_word~ +** Processing line: ~ else~ +** Processing line: ~ prompt.move_cursor_right~ +** Processing line: ~ end~ ** Processing line: ~ elsif inputs_scroll_up_full? args~ ** Processing line: ~ scroll_up_full~ ** Processing line: ~ elsif inputs_scroll_down_full? args~ @@ -145571,8 +219620,10 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ prompt.clear~ ** Processing line: ~ @command_history_index = -1~ ** Processing line: ~ @nonhistory_input = ''~ -** Processing line: ~ elsif args.inputs.keyboard.key_down.backspace || args.inputs.keyboard.key_down.delete~ +** Processing line: ~ elsif args.inputs.keyboard.key_down.backspace~ ** Processing line: ~ prompt.backspace~ +** Processing line: ~ elsif args.inputs.keyboard.key_down.delete~ +** Processing line: ~ prompt.delete~ ** Processing line: ~ elsif args.inputs.keyboard.key_down.tab~ ** Processing line: ~ prompt.autocomplete~ ** Processing line: ~ end~ @@ -145657,7 +219708,7 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def error_markers~ -** Processing line: ~ ["exception", "error", "undefined method", "failed", "syntax", "deprecated"]~ +** Processing line: ~ ["exception:", "error:", "undefined method", "failed", "syntax", "deprecated"]~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def include_subdued_markers? text~ @@ -145669,7 +219720,7 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def subdued_markers~ -** Processing line: ~ ["reloaded", "exported the"]~ +** Processing line: ~ ["reloaded", "exported the", "~require~"]~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def calc args~ @@ -145858,10 +219909,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* console_color.rb~ -- H1 detected. +** Processing line: ~*** console_color.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~console_color.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: ~console_color.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -145904,10 +219960,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* console_font_style.rb~ -- H1 detected. +** Processing line: ~*** console_font_style.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~console_font_style.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: ~console_font_style.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -145960,10 +220021,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* console_menu.rb~ -- H1 detected. +** Processing line: ~*** console_menu.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~console_menu.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: ~console_menu.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -146135,10 +220201,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* console_prompt.rb~ -- H1 detected. +** Processing line: ~*** console_prompt.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~console_prompt.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: ~console_prompt.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -146156,6 +220227,9 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ module GTK~ ** Processing line: ~ class Console~ ** Processing line: ~ class Prompt~ +** Processing line: ~ # ? Can be changed, it was just taken from my editor settings :>~ +** Processing line: ~ WORD_LIMITER_CHARS = "`~!@#$%^&*-=+()[]{}\|;:'\",.<>/?_ \t\n\0".chars~ +** Processing line: ~~ ** Processing line: ~ attr_accessor :current_input_str, :font_style, :console_text_width, :last_input_str, :last_input_str_changed~ ** Processing line: ~~ ** Processing line: ~ def initialize(font_style:, text_color:, console_text_width:)~ @@ -146180,6 +220254,7 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ def current_input_str=(str)~ ** Processing line: ~ @current_input_str = str~ ** Processing line: ~ @cursor_position = str.length~ +** Processing line: ~ update_cursor_position_px~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def <<(str)~ @@ -146199,16 +220274,57 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ reset_autocomplete~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def delete~ +** Processing line: ~ return if current_input_str.length.zero? || @cursor_position == current_input_str.length~ +** Processing line: ~~ +** Processing line: ~ @cursor_position += 1~ +** Processing line: ~ backspace~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ def move_cursor_left~ ** Processing line: ~ @cursor_position -= 1 if @cursor_position > 0~ ** Processing line: ~ update_cursor_position_px~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def move_cursor_left_word~ +** Processing line: ~ return if @cursor_position.zero?~ +** Processing line: ~~ +** Processing line: ~ new_pos = @cursor_position - 1~ +** Processing line: ~ (is_word_boundary? @current_input_str[new_pos]) ?~ +** Processing line: ~ (new_pos -= 1 until !(is_word_boundary? @current_input_str[new_pos - 1]) || new_pos.zero?):~ +** Processing line: ~ (new_pos -= 1 until (is_word_boundary? @current_input_str[new_pos - 1]) || new_pos.zero?)~ +** Processing line: ~~ +** Processing line: ~ @cursor_position = new_pos~ +** Processing line: ~ update_cursor_position_px~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ def move_cursor_right~ ** Processing line: ~ @cursor_position += 1 if @cursor_position < current_input_str.length~ ** Processing line: ~ update_cursor_position_px~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def move_cursor_right_word~ +** Processing line: ~ return if @cursor_position.equal? str_len~ +** Processing line: ~~ +** Processing line: ~ new_pos = @cursor_position + 1~ +** Processing line: ~ (is_word_boundary? @current_input_str[new_pos]) ?~ +** Processing line: ~ (new_pos += 1 until !(is_word_boundary? @current_input_str[new_pos]) || (new_pos.equal? str_len)):~ +** Processing line: ~ (new_pos += 1 until (is_word_boundary? @current_input_str[new_pos]) || (new_pos.equal? str_len))~ +** Processing line: ~~ +** Processing line: ~ @cursor_position = new_pos~ +** Processing line: ~ update_cursor_position_px~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def move_cursor_home~ +** Processing line: ~ @cursor_position = 0~ +** Processing line: ~ update_cursor_position_px~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def move_cursor_end~ +** Processing line: ~ @cursor_position = str_len~ +** Processing line: ~ update_cursor_position_px~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ def clear~ ** Processing line: ~ @current_input_str = ''~ ** Processing line: ~ @cursor_position = 0~ @@ -146360,6 +220476,17 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ @last_autocomplete_prefix = nil~ ** Processing line: ~ @next_candidate_index = 0~ ** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def is_word_boundary? char~ +** Processing line: ~ # Alternative method~ +** Processing line: ~ # (WORD_LIMITER_CHARS - [char]).length != WORD_LIMITER_CHARS.length~ +** Processing line: ~ # Production code~ +** Processing line: ~ WORD_LIMITER_CHARS.include? char~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def str_len~ +** Processing line: ~ @current_input_str.length~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~ end~ @@ -146368,10 +220495,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* controller.rb~ -- H1 detected. +** Processing line: ~*** controller.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~controller.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: ~controller.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -146506,10 +220638,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* controller/config.rb~ -- H1 detected. +** Processing line: ~*** controller/config.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~controller/config.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: ~controller/config.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -146921,10 +221058,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* controller/keys.rb~ -- H1 detected. +** Processing line: ~*** controller/keys.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~controller/keys.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: ~controller/keys.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -146953,7 +221095,7 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ ].freeze~ ** Processing line: ~~ ** Processing line: ~ LABELS.each do |label|~ -** Processing line: ~ attr_reader label~ +** Processing line: ~ attr label~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ # Activate a key.~ @@ -146988,10 +221130,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* directional_input_helper_methods.rb~ -- H1 detected. +** Processing line: ~*** directional_input_helper_methods.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~directional_input_helper_methods.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: ~directional_input_helper_methods.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -147055,8 +221202,8 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ # - ~nil~ which denotes that no directional input exists.~ ** Processing line: ~ # - ~[ 0, 1]~ which denotes that only up is being held/pressed.~ ** Processing line: ~ # - ~[ 0, -1]~ which denotes that only down is being held/pressed.~ -** Processing line: ~ # - ~[ 0.5, 0.5]~ which denotes that right and up are being pressed/held.~ -** Processing line: ~ # - ~[-0.5, -0.5]~ which denotes that left and down are being pressed/held.~ +** Processing line: ~ # - ~[-0.707, 0.707]~ which denotes that right and up are being pressed/held.~ +** Processing line: ~ # - ~[-0.707, -0.707]~ which denotes that left and down are being pressed/held.~ ** Processing line: ~ #~ ** Processing line: ~ # @gtk~ ** Processing line: ~ def directional_vector~ @@ -147065,7 +221212,7 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ if lr == 0 && ud == 0~ ** Processing line: ~ return nil~ ** Processing line: ~ elsif lr.abs == ud.abs~ -** Processing line: ~ return [lr.half, ud.half]~ +** Processing line: ~ return [45.vector_x * lr.sign, 45.vector_y * ud.sign, ud.sign]~ ** Processing line: ~ else~ ** Processing line: ~ return [lr, ud]~ ** Processing line: ~ end~ @@ -147096,10 +221243,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* easing.rb~ -- H1 detected. +** Processing line: ~*** easing.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~easing.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: ~easing.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -147114,6 +221266,15 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~~ ** Processing line: ~ module GTK~ ** Processing line: ~ module Easing~ +** Processing line: ~ def self.ease start_tick, current_tick, duration, *definitions~ +** Processing line: ~ ease_extended start_tick,~ +** Processing line: ~ current_tick,~ +** Processing line: ~ start_tick + duration,~ +** Processing line: ~ (initial_value *definitions),~ +** Processing line: ~ (final_value *definitions),~ +** Processing line: ~ *definitions~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ def self.ease_extended start_tick, current_tick, end_tick, default_before, default_after, *definitions~ ** Processing line: ~ definitions.flatten!~ ** Processing line: ~ definitions = [:identity] if definitions.length == 0~ @@ -147128,7 +221289,12 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ y~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def self.ease_spline start_tick, current_tick, duration, spline~ +** Processing line: ~ ease_spline_extended start_tick, current_tick, start_tick + duration, spline~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ def self.ease_spline_extended start_tick, current_tick, end_tick, spline~ +** Processing line: ~ return spline[-1][-1] if current_tick >= end_tick~ ** Processing line: ~ duration = end_tick - start_tick~ ** Processing line: ~ t = (current_tick - start_tick).fdiv duration~ ** Processing line: ~ time_allocation_per_curve = 1.fdiv(spline.length)~ @@ -147140,12 +221306,12 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~~ ** Processing line: ~ def self.initial_value *definitions~ ** Processing line: ~ definitions.flatten!~ -** Processing line: ~ return Easing.exec_definition (definitions.value(-1) || :identity), 0, 10, 0~ +** Processing line: ~ return Easing.exec_definition (definitions.at(-1) || :identity), 0, 10, 0~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def self.final_value *definitions~ ** Processing line: ~ definitions.flatten!~ -** Processing line: ~ return Easing.exec_definition (definitions.value(-1) || :identity), 0, 10, 1.0~ +** Processing line: ~ return Easing.exec_definition (definitions.at(-1) || :identity), 0, 10, 1.0~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def self.exec_definition definition, start_tick, duration, x~ @@ -147194,10 +221360,127 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* geometry.rb~ -- H1 detected. +** Processing line: ~*** entity.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~entity.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: ~entity.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/entity.rb~ +** Processing line: ~ # coding: utf-8~ +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +** Processing line: ~ # MIT License~ +** Processing line: ~ # entity.rb has been released under MIT (*only this file*).~ +** Processing line: ~~ +** Processing line: ~ module GTK~ +** Processing line: ~ class Entity~ +** Processing line: ~ def self.id!~ +** Processing line: ~ @id ||= 0~ +** Processing line: ~ @id += 1~ +** Processing line: ~ @id~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.__reset_id__!~ +** Processing line: ~ @id = 0~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.strict_entities~ +** Processing line: ~ @strict_entities ||= {}~ +** Processing line: ~ @strict_entities~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.parse_serialization_data data~ +** Processing line: ~ r = Entity.parse_serialization_data data~ +** Processing line: ~ return r if r.is_a? OpenEntity~ +** Processing line: ~ return r if r.is_a? StrictEntity~ +** Processing line: ~ raise <<-S~ +** Processing line: ~ * ERROR:~ +** Processing line: ~ The save data looks to be corrupt.~ +** Processing line: ~~ +** Processing line: ~ S~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.parse_serialization_data value~ +** Processing line: ~ if value.is_a?(Hash) && value[:entity_id] && value[:entity_strict]~ +** Processing line: ~ o = new_entity_strict value[:entity_name], value~ +** Processing line: ~ o.load_entity_data! value~ +** Processing line: ~ return o~ +** Processing line: ~ elsif value.is_a?(Hash) && value[:entity_id]~ +** Processing line: ~ o = OpenEntity.new~ +** Processing line: ~ o.load_entity_data! value~ +** Processing line: ~ return o~ +** Processing line: ~ elsif value.is_a? Array~ +** Processing line: ~ return value.map { |entry| Entity.parse_serialization_data entry }~ +** Processing line: ~ else~ +** Processing line: ~ return value~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.new_entity entity_type, init_hash = nil, block = nil~ +** Processing line: ~ n = OpenEntity.new(entity_type)~ +** Processing line: ~ n.entity_type = entity_type~ +** Processing line: ~ n.created_at = Kernel.tick_count~ +** Processing line: ~ n.global_created_at = Kernel.global_tick_count~ +** Processing line: ~~ +** Processing line: ~ if init_hash~ +** Processing line: ~ init_hash.each do |k, v|~ +** Processing line: ~ n.as_hash[k] = v~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ block.call(n) if block~ +** Processing line: ~~ +** Processing line: ~ n~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.new_entity_strict entity_type, init_hash = nil, block = nil~ +** Processing line: ~ if !Entity.strict_entities[entity_type]~ +** Processing line: ~ init_hash ||= { }~ +** Processing line: ~~ +** Processing line: ~ n = new_entity entity_type, init_hash, block~ +** Processing line: ~ klass = Class.new(StrictEntity)~ +** Processing line: ~~ +** Processing line: ~ klass.class_eval do~ +** Processing line: ~ init_hash.each do |k, v|~ +** Processing line: ~ attr_accessor k~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ n.as_hash.each do |k, v|~ +** Processing line: ~ attr_accessor k if !init_hash[k]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ Entity.strict_entities[entity_type] = klass~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ klass = Entity.strict_entities[entity_type]~ +** Processing line: ~ (klass.new entity_type, init_hash, block)~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** geometry.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~geometry.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: ~geometry.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -147233,8 +221516,8 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~~ ** Processing line: ~ # Returns true if a primitive's rectangle is entirely inside another primitive's rectangle.~ ** Processing line: ~ # @gtk~ -** Processing line: ~ def inside_rect? outer~ -** Processing line: ~ Geometry.inside_rect? self, outer~ +** Processing line: ~ def inside_rect? outer, tolerance = 0.0~ +** Processing line: ~ Geometry.inside_rect? self, outer, tolerance~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ # Returns true if a primitive's rectangle overlaps another primitive's rectangle.~ @@ -147283,10 +221566,10 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ Geometry.point_inside_circle? self, circle_center_point, radius~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def center_inside_rect other_rect~ -** Processing line: ~ offset_x = (other_rect.w - w).half~ -** Processing line: ~ offset_y = (other_rect.h - h).half~ -** Processing line: ~ new_rect = self.shift_rect(0, 0)~ +** Processing line: ~ def self.center_inside_rect rect, other_rect~ +** Processing line: ~ offset_x = (other_rect.w - rect.w).half~ +** Processing line: ~ offset_y = (other_rect.h - rect.h).half~ +** Processing line: ~ new_rect = rect.shift_rect(0, 0)~ ** Processing line: ~ new_rect.x = other_rect.x + offset_x~ ** Processing line: ~ new_rect.y = other_rect.y + offset_y~ ** Processing line: ~ new_rect~ @@ -147297,30 +221580,45 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ S~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def center_inside_rect_y other_rect~ -** Processing line: ~ offset_y = (other_rect.h - h).half~ -** Processing line: ~ new_rect = self.shift_rect(0, 0)~ -** Processing line: ~ new_rect.y = other_rect.y + offset_y~ +** Processing line: ~ def center_inside_rect other_rect~ +** Processing line: ~ Geometry.center_inside_rect self, other_rect~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.center_inside_rect_x rect, other_rect~ +** Processing line: ~ offset_x = (other_rect.w - rect.w).half~ +** Processing line: ~ new_rect = rect.shift_rect(0, 0)~ +** Processing line: ~ new_rect.x = other_rect.x + offset_x~ +** Processing line: ~ new_rect.y = other_rect.y~ ** Processing line: ~ new_rect~ ** 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_x for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.~ ** Processing line: ~ S~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def center_inside_rect_x other_rect~ -** Processing line: ~ offset_x = (other_rect.w - w).half~ -** Processing line: ~ new_rect = self.shift_rect(0, 0)~ -** Processing line: ~ new_rect.x = other_rect.x + offset_x~ +** Processing line: ~ Geometry.center_inside_rect_x self, other_rect~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.center_inside_rect_y rect, other_rect~ +** Processing line: ~ offset_y = (other_rect.h - rect.h).half~ +** Processing line: ~ new_rect = rect.shift_rect(0, 0)~ +** Processing line: ~ new_rect.x = other_rect.x~ +** Processing line: ~ new_rect.y = other_rect.y + offset_y~ ** Processing line: ~ new_rect~ ** 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_y for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.~ ** Processing line: ~ S~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def center_inside_rect_y other_rect~ +** Processing line: ~ Geometry.center_inside_rect_y self, other_rect~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~~ ** Processing line: ~ # Returns a primitive that is anchored/repositioned based off its retangle.~ ** Processing line: ~ # @gtk~ ** Processing line: ~ def anchor_rect anchor_x, anchor_y~ @@ -147377,10 +221675,27 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~~ ** Processing line: ~ # @gtk~ ** Processing line: ~ def self.line_slope line, replace_infinity: nil~ +** Processing line: ~ return replace_infinity if line.x2 == line.x~ ** Processing line: ~ (line.y2 - line.y).fdiv(line.x2 - line.x)~ ** Processing line: ~ .replace_infinity(replace_infinity)~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def self.line_rise_run line~ +** Processing line: ~ rise = (line.y2 - line.y).to_f~ +** Processing line: ~ run = (line.x2 - line.x).to_f~ +** Processing line: ~ if rise.abs > run.abs && rise != 0~ +** Processing line: ~ rise = rise.fdiv rise.abs~ +** Processing line: ~ run = run.fdiv rise.abs~ +** Processing line: ~ elsif run.abs > rise.abs && run != 0~ +** Processing line: ~ rise = rise.fdiv run.abs~ +** Processing line: ~ run = run.fdiv run.abs~ +** Processing line: ~ else~ +** Processing line: ~ rise = rise / rise.abs if rise != 0~ +** Processing line: ~ run = run / run.abs if run != 0~ +** Processing line: ~ end~ +** Processing line: ~ return { x: run , y: rise }~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ # @gtk~ ** Processing line: ~ def self.ray_test point, line~ ** Processing line: ~ slope = (line.y2 - line.y).fdiv(line.x2 - line.x)~ @@ -147446,8 +221761,8 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ return false if rect_one.bottom + tolerance > rect_two.top - 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]~ -** Processing line: ~ context_help_rect_two = (rect_two.help_contract_implementation contract_intersect_rect?)[:not_implemented_methods]~ +** Processing line: ~ context_help_rect_one = (rect_one.__help_contract_implementation contract_intersect_rect?)[:not_implemented_methods]~ +** Processing line: ~ context_help_rect_two = (rect_two.__help_contract_implementation contract_intersect_rect?)[:not_implemented_methods]~ ** Processing line: ~ context_help = ""~ ** Processing line: ~ if context_help_rect_one && context_help_rect_one.length > 0~ ** Processing line: ~ context_help += <<-S~ @@ -147515,11 +221830,11 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ # @gtk~ -** Processing line: ~ def self.inside_rect? inner_rect, outer_rect~ -** Processing line: ~ inner_rect.x >= outer_rect.x &&~ -** Processing line: ~ inner_rect.right <= outer_rect.right &&~ -** Processing line: ~ inner_rect.y >= outer_rect.y &&~ -** Processing line: ~ inner_rect.top <= outer_rect.top~ +** Processing line: ~ def self.inside_rect? inner_rect, outer_rect, tolerance = 0.0~ +** Processing line: ~ inner_rect.x + tolerance >= outer_rect.x - tolerance &&~ +** Processing line: ~ inner_rect.right - tolerance <= outer_rect.right + tolerance &&~ +** Processing line: ~ inner_rect.y + tolerance >= outer_rect.y - tolerance &&~ +** Processing line: ~ inner_rect.top - tolerance <= outer_rect.top + tolerance~ ** Processing line: ~ rescue Exception => e~ ** Processing line: ~ raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}."~ ** Processing line: ~ end~ @@ -147579,10 +221894,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* grid.rb~ -- H1 detected. +** Processing line: ~*** grid.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~grid.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: ~grid.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -147784,10 +222104,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* inputs.rb~ -- H1 detected. +** Processing line: ~*** inputs.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~inputs.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: ~inputs.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -147826,6 +222151,11 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ :q, :r, :s, :t, :u, :v, :w, :x,~ ** Processing line: ~ :y, :z,~ ** Processing line: ~ :shift, :control, :alt, :meta,~ +** Processing line: ~ :shift_left, :shift_right,~ +** Processing line: ~ :control_left, :control_right,~ +** Processing line: ~ :alt_left, :alt_right,~ +** Processing line: ~ :meta_left, :meta_right,~ +** Processing line: ~ :home, :end,~ ** Processing line: ~ :left, :right, :up, :down, :pageup, :pagedown,~ ** Processing line: ~ :char, :plus, :at, :forward_slash, :back_slash, :asterisk,~ ** Processing line: ~ :less_than, :greater_than, :carat, :ampersand, :superscript_two,~ @@ -147840,7 +222170,10 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ raw_key == 1073741905 ||~ ** Processing line: ~ raw_key == 1073741906 ||~ ** Processing line: ~ raw_key == 1073741899 ||~ -** Processing line: ~ raw_key == 1073741902~ +** Processing line: ~ raw_key == 1073741902 ||~ +** Processing line: ~ raw_key == 1073741898 ||~ +** Processing line: ~ raw_key == 1073741901 ||~ +** Processing line: ~ (raw_key >= 1073742048 && raw_key <= 1073742055) # Modifier Keys~ ** Processing line: ~~ ** Processing line: ~ char = KeyboardKeys.char_with_shift raw_key, modifier~ ** Processing line: ~ names = KeyboardKeys.char_to_method char, raw_key~ @@ -147884,32 +222217,32 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~~ ** Processing line: ~ def self.char_to_method_hash~ ** Processing line: ~ @char_to_method ||= {~ -** Processing line: ~ 'A' => [:a, :shift],~ -** Processing line: ~ 'B' => [:b, :shift],~ -** Processing line: ~ 'C' => [:c, :shift],~ -** Processing line: ~ 'D' => [:d, :shift],~ -** Processing line: ~ 'E' => [:e, :shift],~ -** Processing line: ~ 'F' => [:f, :shift],~ -** Processing line: ~ 'G' => [:g, :shift],~ -** Processing line: ~ 'H' => [:h, :shift],~ -** Processing line: ~ 'I' => [:i, :shift],~ -** Processing line: ~ 'J' => [:j, :shift],~ -** Processing line: ~ 'K' => [:k, :shift],~ -** Processing line: ~ 'L' => [:l, :shift],~ -** Processing line: ~ 'M' => [:m, :shift],~ -** Processing line: ~ 'N' => [:n, :shift],~ -** Processing line: ~ 'O' => [:o, :shift],~ -** Processing line: ~ 'P' => [:p, :shift],~ -** Processing line: ~ 'Q' => [:q, :shift],~ -** Processing line: ~ 'R' => [:r, :shift],~ -** Processing line: ~ 'S' => [:s, :shift],~ -** Processing line: ~ 'T' => [:t, :shift],~ -** Processing line: ~ 'U' => [:u, :shift],~ -** Processing line: ~ 'V' => [:v, :shift],~ -** Processing line: ~ 'W' => [:w, :shift],~ -** Processing line: ~ 'X' => [:x, :shift],~ -** Processing line: ~ 'Y' => [:y, :shift],~ -** Processing line: ~ 'Z' => [:z, :shift],~ +** Processing line: ~ 'A' => [:a],~ +** Processing line: ~ 'B' => [:b],~ +** Processing line: ~ 'C' => [:c],~ +** Processing line: ~ 'D' => [:d],~ +** Processing line: ~ 'E' => [:e],~ +** Processing line: ~ 'F' => [:f],~ +** Processing line: ~ 'G' => [:g],~ +** Processing line: ~ 'H' => [:h],~ +** Processing line: ~ 'I' => [:i],~ +** Processing line: ~ 'J' => [:j],~ +** Processing line: ~ 'K' => [:k],~ +** Processing line: ~ 'L' => [:l],~ +** Processing line: ~ 'M' => [:m],~ +** Processing line: ~ 'N' => [:n],~ +** Processing line: ~ 'O' => [:o],~ +** Processing line: ~ 'P' => [:p],~ +** Processing line: ~ 'Q' => [:q],~ +** Processing line: ~ 'R' => [:r],~ +** Processing line: ~ 'S' => [:s],~ +** Processing line: ~ 'T' => [:t],~ +** Processing line: ~ 'U' => [:u],~ +** Processing line: ~ 'V' => [:v],~ +** Processing line: ~ 'W' => [:w],~ +** Processing line: ~ 'X' => [:x],~ +** Processing line: ~ 'Y' => [:y],~ +** Processing line: ~ 'Z' => [:z],~ ** Processing line: ~ "!" => [:exclamation_point],~ ** Processing line: ~ "0" => [:zero],~ ** Processing line: ~ "1" => [:one],~ @@ -147960,18 +222293,29 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ "?" => [:question_mark],~ ** Processing line: ~ '%' => [:percent_sign],~ ** Processing line: ~ "º" => [:ordinal_indicator],~ +** Processing line: ~ 1073741898 => [:home],~ +** Processing line: ~ 1073741901 => [:end],~ ** Processing line: ~ 1073741903 => [:right],~ ** Processing line: ~ 1073741904 => [:left],~ ** Processing line: ~ 1073741905 => [:down],~ ** Processing line: ~ 1073741906 => [:up],~ ** Processing line: ~ 1073741899 => [:pageup],~ ** Processing line: ~ 1073741902 => [:pagedown],~ -** Processing line: ~ 127 => [:delete]~ +** Processing line: ~ 127 => [:delete],~ +** Processing line: ~ 1073742049 => [:shift_left, :shift],~ +** Processing line: ~ 1073742053 => [:shift_right, :shift],~ +** Processing line: ~ 1073742048 => [:control_left, :control],~ +** Processing line: ~ 1073742052 => [:control_right, :control],~ +** Processing line: ~ 1073742050 => [:alt_left, :alt],~ +** Processing line: ~ 1073742054 => [:alt_right, :alt],~ +** Processing line: ~ 1073742051 => [:meta_left, :meta],~ +** Processing line: ~ 1073742055 => [:meta_right, :meta]~ ** Processing line: ~ }~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def self.char_to_method char, int = nil~ -** Processing line: ~ char_to_method_hash[char] || char_to_method_hash[int] || [char.to_sym || int]~ +** Processing line: ~ methods = char_to_method_hash[char] || char_to_method_hash[int]~ +** Processing line: ~ methods ? methods.dup : [char.to_sym || int]~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def clear~ @@ -148303,6 +222647,10 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ point.point_inside_circle? center, radius~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def intersect_rect? other_rect~ +** Processing line: ~ { x: point.x, y: point.y, w: 0, h: 0 }.intersect_rect? other_rect~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ alias_method :position, :point~ ** Processing line: ~~ ** Processing line: ~ def clear~ @@ -148360,14 +222708,20 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ attr_accessor :moved,~ ** Processing line: ~ :moved_at,~ ** Processing line: ~ :global_moved_at,~ +** Processing line: ~ :down_at,~ +** Processing line: ~ :global_down_at,~ ** Processing line: ~ :touch_order,~ +** Processing line: ~ :first_tick_down,~ ** Processing line: ~ :x, :y~ ** Processing line: ~~ ** Processing line: ~ def initialize~ ** Processing line: ~ @moved = false~ ** Processing line: ~ @moved_at = 0~ ** Processing line: ~ @global_moved_at = 0~ +** Processing line: ~ @down_at = 0~ +** Processing line: ~ @global_down_at = 0~ ** Processing line: ~ @touch_order = 0~ +** Processing line: ~ @first_tick_down = true~ ** Processing line: ~ @x = 0~ ** Processing line: ~ @y = 0~ ** Processing line: ~ end~ @@ -148393,6 +222747,9 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ result[:touch_order] = @touch_order~ ** Processing line: ~ result[:moved] = @moved~ ** Processing line: ~ result[:moved_at] = @moved_at~ +** Processing line: ~ result[:global_moved_at] = @global_moved_at~ +** Processing line: ~ result[:down_at] = @down_at~ +** Processing line: ~ result[:global_down_at] = @global_down_at~ ** Processing line: ~~ ** Processing line: ~ result~ ** Processing line: ~ end~ @@ -148423,6 +222780,10 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ # @gtk~ ** Processing line: ~ attr_reader :mouse~ ** Processing line: ~~ +** Processing line: ~ # @return [HTTPRequest[]]~ +** Processing line: ~ # @gtk~ +** Processing line: ~ attr_accessor :http_requests~ +** Processing line: ~~ ** Processing line: ~ # @return {FingerTouch}~ ** Processing line: ~ # @gtk~ ** Processing line: ~ attr_reader :touch~ @@ -148439,6 +222800,7 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ @finger_one = nil~ ** Processing line: ~ @finger_two = nil~ ** Processing line: ~ @text = []~ +** Processing line: ~ @http_requests = []~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def up~ @@ -148514,6 +222876,7 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ @keyboard.clear~ ** Processing line: ~ @controllers.each(&:clear)~ ** Processing line: ~ @touch.clear~ +** Processing line: ~ @http_requests.clear~ ** Processing line: ~ @finger_one = nil~ ** Processing line: ~ @finger_two = nil~ ** Processing line: ~ end~ @@ -148535,10 +222898,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* ios_wizard.rb~ -- H1 detected. +** Processing line: ~*** ios_wizard.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~ios_wizard.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: ~ios_wizard.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -148568,21 +222936,49 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def steps~ +** Processing line: ~ @steps ||= []~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def steps_development_build~ ** 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: ~ :determine_team_identifier,~ +** Processing line: ~ :determine_app_name,~ +** Processing line: ~ :determine_app_id,~ +** Processing line: ~ :blow_away_temp,~ +** Processing line: ~ :stage_app,~ +** Processing line: ~ :development_write_info_plist,~ +** Processing line: ~ :write_entitlements_plist,~ +** Processing line: ~ :compile_icons,~ +** Processing line: ~ :create_payload_directory,~ +** Processing line: ~ :code_sign_payload,~ +** Processing line: ~ :create_ipa,~ +** Processing line: ~ :deploy~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** 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: ~ :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: ~ :stage_app,~ -** Processing line: ~ :write_info_plist,~ +** Processing line: ~ :production_write_info_plist,~ ** Processing line: ~ :write_entitlements_plist,~ -** Processing line: ~ :code_sign,~ +** Processing line: ~ :compile_icons,~ +** Processing line: ~ :create_payload_directory,~ +** Processing line: ~ :code_sign_payload,~ ** Processing line: ~ :create_ipa,~ -** Processing line: ~ :deploy,~ +** Processing line: ~ :print_publish_help~ ** Processing line: ~ ]~ ** Processing line: ~ end~ ** Processing line: ~~ @@ -148601,36 +222997,45 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ sprite_path~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def start~ +** Processing line: ~ def start opts = nil~ +** Processing line: ~ @opts = opts || {}~ +** Processing line: ~~ +** Processing line: ~ if !(@opts.is_a? Hash) || !($gtk.args.fn.eq_any? @opts[:env], :dev, :prod)~ +** Processing line: ~ raise WizardException.new(~ +** Processing line: ~ "* $wizards.ios.start needs to be provided an environment option.",~ +** Processing line: ~ "** For development builds type: $wizards.ios.start env: :dev",~ +** Processing line: ~ "** For production builds type: $wizards.ios.start env: :prod"~ +** Processing line: ~ )~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ @production_build = (@opts[:env] == :prod)~ +** Processing line: ~ @steps = steps_development_build~ +** Processing line: ~ @steps = steps_production_build if @production_build~ ** Processing line: ~ @certificate_name = nil~ ** 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~ ** Processing line: ~ steps.each do |m|~ -** Processing line: ~ begin~ -** Processing line: ~ result = (send m) || :success if @wizard_status[m][:result] != :success~ -** Processing line: ~ @wizard_status[m][:result] = result~ -** Processing line: ~ rescue Exception => e~ -** Processing line: ~ if e.is_a? WizardException~ -** Processing line: ~ $console.log.clear~ -** Processing line: ~ $console.archived_log.clear~ -** Processing line: ~ log "=" * $console.console_text_width~ -** Processing line: ~ e.console_primitives.each do |p|~ -** Processing line: ~ $console.add_primitive p~ -** Processing line: ~ end~ -** Processing line: ~ log "=" * $console.console_text_width~ -** Processing line: ~ else~ -** Processing line: ~ log_error "Step #{m} failed."~ -** Processing line: ~ log_error e.to_s~ -** Processing line: ~ end~ -** Processing line: ~~ -** Processing line: ~ $console.set_command "$wizards.ios.start"~ -** Processing line: ~~ -** Processing line: ~ break~ +** Processing line: ~ log_info "Running step ~:#{m}~."~ +** Processing line: ~ result = (send m) || :success if @wizard_status[m][:result] != :success~ +** Processing line: ~ @wizard_status[m][:result] = result~ +** Processing line: ~ log_info "Running step ~:#{m}~ complete."~ +** Processing line: ~ end~ +** Processing line: ~ nil~ +** Processing line: ~ rescue Exception => e~ +** Processing line: ~ if e.is_a? WizardException~ +** Processing line: ~ $console.log.clear~ +** Processing line: ~ $console.archived_log.clear~ +** Processing line: ~ log "=" * $console.console_text_width~ +** Processing line: ~ e.console_primitives.each do |p|~ +** Processing line: ~ $console.add_primitive p~ ** Processing line: ~ end~ +** Processing line: ~ log "=" * $console.console_text_width~ +** Processing line: ~ else~ +** Processing line: ~ log_error e.to_s~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ return nil~ +** Processing line: ~ $console.set_command "$wizards.ios.start env: :#{@opts[:env]}"~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def always_fail~ @@ -148687,8 +223092,31 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ start~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def check_for_distribution_profile~ +** Processing line: ~ @provisioning_profile_path = "profiles/distribution.mobileprovision"~ +** Processing line: ~ if !($gtk.read_file @provisioning_profile_path)~ +** Processing line: ~ $gtk.system "mkdir -p #{relative_path}/profiles"~ +** Processing line: ~ $gtk.system "open #{relative_path}/profiles"~ +** Processing line: ~ $gtk.system "echo Download the mobile provisioning profile and place it here with the name distribution.mobileprovision > #{relative_path}/profiles/README.txt"~ +** Processing line: ~ raise WizardException.new(~ +** Processing line: ~ "* I didn't find a mobile provision.",~ +** Processing line: ~ "** 1. Go to http://developer.apple.com and click \"Certificates, IDs & Profiles\".",~ +** Processing line: ~ "** 2. Add an App Identifier.",~ +** Processing line: ~ "** 3. Select the App IDs option from the list.",~ +** Processing line: ~ { w: 700, h: 75, path: get_reserved_sprite("identifiers.png") },~ +** Processing line: ~ "** 4. Add your Device next. You can use idevice_id -l to get the UUID of your device.",~ +** Processing line: ~ { w: 365, h: 69, path: get_reserved_sprite("device-link.png") },~ +** Processing line: ~ "** 5. Create a Profile. Associate your certs, id, and device.",~ +** Processing line: ~ { w: 300, h: 122, path: get_reserved_sprite("profiles.png") },~ +** Processing line: ~ "** 6. Download the mobile provision and save it to 'profiles/development.mobileprovision'.",~ +** Processing line: ~ { w: 200, h: 124, path: get_reserved_sprite("profiles-folder.png") },~ +** Processing line: ~ )~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ def check_for_dev_profile~ -** Processing line: ~ if !($gtk.read_file 'profiles/development.mobileprovision')~ +** Processing line: ~ @provisioning_profile_path = "profiles/development.mobileprovision"~ +** Processing line: ~ if !($gtk.read_file @provisioning_profile_path)~ ** Processing line: ~ $gtk.system "mkdir -p #{relative_path}/profiles"~ ** Processing line: ~ $gtk.system "open #{relative_path}/profiles"~ ** Processing line: ~ $gtk.system "echo Download the mobile provisioning profile and place it here with the name development.mobileprovision > #{relative_path}/profiles/README.txt"~ @@ -148708,13 +223136,23 @@ 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 provisioning_profile_path environment~ +** Processing line: ~ return "profiles/distribution.mobileprovision" if environment == :prod~ +** Processing line: ~ return "profiles/development.mobileprovision"~ +** 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: ~ end~ +** Processing line: ~~ ** Processing line: ~ def determine_app_name~ -** Processing line: ~ @app_name = dev_profile_xml[:children].first[:children].first[:children][1][:children].first[:data]~ +** Processing line: ~ @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}."~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def dev_profile_xml~ -** Processing line: ~ xml = $gtk.read_file 'profiles/development.mobileprovision'~ +** Processing line: ~ def provisioning_profile_xml environment~ +** Processing line: ~ xml = $gtk.read_file (provisioning_profile_path environment)~ ** Processing line: ~ scrubbed = xml.each_line.map do |l|~ ** Processing line: ~ if l.strip.start_with? "<"~ ** Processing line: ~ if l.start_with? ''~ @@ -148733,9 +223171,36 @@ 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: ~ # lol~ -** Processing line: ~ @app_id = dev_profile_xml[:children].first[:children].first[:children][13][:children][1][:children].first[:data]~ +** Processing line: ~ @app_id = app_id_from_provisioning_profile @opts[:env]~ +** Processing line: ~~ ** Processing line: ~ log_info "App Identifier is set to : #{@app_id}"~ ** Processing line: ~ end~ ** Processing line: ~~ @@ -148749,7 +223214,7 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ log_error "I couldn't find a development profile at #{path}."~ ** Processing line: ~ ask_for_dev_profile~ ** Processing line: ~ else~ -** Processing line: ~ @dev_profile_path = path~ +** Processing line: ~ @provisioning_profile_path = path~ ** Processing line: ~ start~ ** Processing line: ~ end~ ** Processing line: ~ end~ @@ -148816,8 +223281,12 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ raise "You do not have any Apple development certs on this computer."~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ @certificate_name = valid_certs.first[:name]~ -** Processing line: ~ log_info "I will be using '#{@certificate_name}' to deploy to your device."~ +** Processing line: ~ if @production_build~ +** Processing line: ~ @certificate_name = valid_certs.find_all { |f| f[:name].include? "Distribution" }.first[:name]~ +** Processing line: ~ else~ +** Processing line: ~ @certificate_name = valid_certs.find_all { |f| f[:name].include? "Development" }.first[:name]~ +** Processing line: ~ end~ +** Processing line: ~ log_info "I will be using Certificate: '#{@certificate_name}'."~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def idevice_id_cli_app~ @@ -148834,7 +223303,7 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~~ ** Processing line: ~ def valid_certs~ ** Processing line: ~ certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l|~ -** Processing line: ~ if l.include?(")") && !l.include?("Developer ID") && l.include?("Development")~ +** Processing line: ~ if l.include?(")") && !l.include?("Developer ID") && (l.include?("Development") || l.include?("Distribution"))~ ** Processing line: ~ l.strip~ ** Processing line: ~ else~ ** Processing line: ~ nil~ @@ -148861,22 +223330,37 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def write_entitlements_plist~ -** Processing line: ~ entitlement_plist_string = <<-XML~ +** Processing line: ~ if @production_build~ +** Processing line: ~ entitlement_plist_string = <<-XML~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ application-identifier~ +** Processing line: ~ :app_id~ +** Processing line: ~ beta-reports-active~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ XML~ +** Processing line: ~ else~ +** Processing line: ~ entitlement_plist_string = <<-XML~ ** Processing line: ~ ~ ** Processing line: ~ ~ ** Processing line: ~ ~ -** Processing line: ~ ~ -** Processing line: ~ application-identifier~ -** Processing line: ~ :app_id~ -** Processing line: ~ get-task-allow~ -** Processing line: ~ ~ -** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ application-identifier~ +** Processing line: ~ :app_id~ +** Processing line: ~ get-task-allow~ +** Processing line: ~ ~ +** Processing line: ~ ~ ** Processing line: ~ ~ ** Processing line: ~ XML~ +** Processing line: ~ end~ ** 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", @app_id).strip~ +** Processing line: ~ $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_name}.#{@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\""~ @@ -148884,19 +223368,130 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ @entitlement_plist_written = true~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def code_sign~ -** Processing line: ~ sh "cp #{@dev_profile_path} \"#{app_path}/embedded.mobileprovision\""~ -** Processing line: ~~ +** Processing line: ~ def code_sign_payload~ ** Processing line: ~ log_info "Signing app with #{@certificate_name}."~ ** Processing line: ~~ -** Processing line: ~ sh "/usr/bin/plutil -convert binary1 \"#{app_path}/Info.plist\""~ -** Processing line: ~~ -** 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\""~ +** 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}/ipa_root/Payload/#{@app_name}.app\""~ +** 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}/ipa_root/Payload/#{@app_name}.app/Runtime\""~ ** Processing line: ~~ ** Processing line: ~ @code_sign_completed = true~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def write_info_plist~ +** Processing line: ~ def write_info_plist_distribution~ +** Processing line: ~ log_info "Adding Info.plist."~ +** Processing line: ~~ +** Processing line: ~ <<-XML~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ BuildMachineOSBuild~ +** Processing line: ~ 20D91~ +** Processing line: ~ CFBundleDevelopmentRegion~ +** Processing line: ~ en~ +** Processing line: ~ CFBundleName~ +** Processing line: ~ :app_name~ +** Processing line: ~ CFBundleDisplayName~ +** Processing line: ~ A Dark Room~ +** Processing line: ~ CFBundleIdentifier~ +** Processing line: ~ :app_id~ +** Processing line: ~ CFBundleExecutable~ +** Processing line: ~ :app_name~ +** Processing line: ~ CFBundleInfoDictionaryVersion~ +** Processing line: ~ 6.0~ +** Processing line: ~ CFBundlePackageType~ +** Processing line: ~ APPL~ +** Processing line: ~ CFBundleShortVersionString~ +** Processing line: ~ 5.6~ +** Processing line: ~ CFBundleSignature~ +** Processing line: ~ ????~ +** Processing line: ~ CFBundleVersion~ +** Processing line: ~ 5.6~ +** Processing line: ~ CFBundleIcons~ +** Processing line: ~ ~ +** Processing line: ~ CFBundlePrimaryIcon~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIconName~ +** Processing line: ~ AppIcon~ +** Processing line: ~ CFBundleIconFiles~ +** Processing line: ~ ~ +** Processing line: ~ AppIcon60x60~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIcons~ipad~ +** Processing line: ~ ~ +** Processing line: ~ CFBundlePrimaryIcon~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIconName~ +** Processing line: ~ AppIcon~ +** Processing line: ~ CFBundleIconFiles~ +** Processing line: ~ ~ +** Processing line: ~ AppIcon60x60~ +** Processing line: ~ AppIcon76x76~ +** Processing line: ~ AppIcon83.5x83.5~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ UILaunchStoryboardName~ +** Processing line: ~ SimpleSplash~ +** Processing line: ~ UIRequiresFullScreen~ +** Processing line: ~ ~ +** Processing line: ~ ITSAppUsesNonExemptEncryption~ +** Processing line: ~ ~ +** Processing line: ~ UIRequiredDeviceCapabilities~ +** Processing line: ~ ~ +** Processing line: ~ arm64~ +** Processing line: ~ ~ +** Processing line: ~ MinimumOSVersion~ +** Processing line: ~ 10.3~ +** Processing line: ~ CFBundleSupportedPlatforms~ +** Processing line: ~ ~ +** Processing line: ~ iPhoneOS~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIconFiles~ +** Processing line: ~ ~ +** Processing line: ~ AppIcon20x20~ +** Processing line: ~ AppIcon29x29~ +** Processing line: ~ AppIcon40x40~ +** Processing line: ~ AppIcon60x60~ +** Processing line: ~ ~ +** Processing line: ~ UIDeviceFamily~ +** Processing line: ~ ~ +** Processing line: ~ 1~ +** Processing line: ~ 2~ +** Processing line: ~ ~ +** Processing line: ~ UISupportedInterfaceOrientations~ +** Processing line: ~ ~ +** Processing line: ~ UIInterfaceOrientationPortrait~ +** Processing line: ~ ~ +** Processing line: ~ UIStatusBarStyle~ +** Processing line: ~ UIStatusBarStyleDefault~ +** Processing line: ~ UIBackgroundModes~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ DTXcode~ +** Processing line: ~ 0124~ +** Processing line: ~ DTXcodeBuild~ +** Processing line: ~ 12D4e~ +** Processing line: ~ DTSDKName~ +** Processing line: ~ iphoneos14.4~ +** Processing line: ~ DTSDKBuild~ +** Processing line: ~ 18D46~ +** Processing line: ~ DTPlatformName~ +** Processing line: ~ iphoneos~ +** Processing line: ~ DTCompiler~ +** Processing line: ~ com.apple.compilers.llvm.clang.1_0~ +** Processing line: ~ DTPlatformVersion~ +** Processing line: ~ 14.4~ +** Processing line: ~ DTPlatformBuild~ +** Processing line: ~ 18D46~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ XML~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def development_write_info_plist~ ** Processing line: ~ log_info "Adding Info.plist."~ ** Processing line: ~~ ** Processing line: ~ info_plist_string = <<-XML~ @@ -148919,165 +223514,136 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ ~ ** Processing line: ~ ~ ** Processing line: ~ ~ -** Processing line: ~ BuildMachineOSBuild~ -** Processing line: ~ 19C57~ -** Processing line: ~ CFBundleDevelopmentRegion~ -** Processing line: ~ en~ -** Processing line: ~ CFBundleDisplayName~ -** Processing line: ~ :app_name~ -** Processing line: ~ CFBundleExecutable~ -** Processing line: ~ Runtime~ -** Processing line: ~ CFBundleIconFiles~ -** Processing line: ~ ~ -** Processing line: ~ AppIcon60x60~ -** Processing line: ~ ~ -** Processing line: ~ CFBundleIcons~ -** Processing line: ~ ~ -** Processing line: ~ CFBundlePrimaryIcon~ -** Processing line: ~ ~ -** Processing line: ~ CFBundleIconFiles~ -** Processing line: ~ ~ -** Processing line: ~ AppIcon60x60~ -** Processing line: ~ ~ -** Processing line: ~ CFBundleIconName~ -** Processing line: ~ AppIcon~ -** Processing line: ~ ~ -** Processing line: ~ ~ -** Processing line: ~ CFBundleIcons~ipad~ -** Processing line: ~ ~ -** Processing line: ~ CFBundlePrimaryIcon~ -** Processing line: ~ ~ -** Processing line: ~ CFBundleIconFiles~ -** Processing line: ~ ~ -** Processing line: ~ AppIcon60x60~ -** Processing line: ~ AppIcon76x76~ -** Processing line: ~ ~ -** Processing line: ~ CFBundleIconName~ -** Processing line: ~ AppIcon~ -** Processing line: ~ ~ -** Processing line: ~ ~ -** Processing line: ~ CFBundleIdentifier~ -** Processing line: ~ com.carlile.swisscheese~ -** Processing line: ~ CFBundleInfoDictionaryVersion~ -** Processing line: ~ 6.0~ -** Processing line: ~ CFBundleName~ -** Processing line: ~ :app_name~ -** Processing line: ~ CFBundlePackageType~ -** Processing line: ~ APPL~ -** Processing line: ~ CFBundleShortVersionString~ -** Processing line: ~ 1.0~ -** Processing line: ~ CFBundleSignature~ -** Processing line: ~ ????~ -** Processing line: ~ CFBundleSupportedPlatforms~ -** Processing line: ~ ~ -** Processing line: ~ iPhoneOS~ -** Processing line: ~ ~ -** Processing line: ~ CFBundleVersion~ -** Processing line: ~ 1.0~ -** Processing line: ~ DTCompiler~ -** Processing line: ~ com.apple.compilers.llvm.clang.1_0~ -** Processing line: ~ DTPlatformBuild~ -** Processing line: ~ 17B102~ -** Processing line: ~ DTPlatformName~ -** Processing line: ~ iphoneos~ -** Processing line: ~ DTPlatformVersion~ -** Processing line: ~ 13.2~ -** Processing line: ~ DTSDKBuild~ -** Processing line: ~ 17B102~ -** Processing line: ~ DTSDKName~ -** Processing line: ~ iphoneos13.2~ -** Processing line: ~ DTXcode~ -** Processing line: ~ 01131~ -** Processing line: ~ DTXcodeBuild~ -** Processing line: ~ 11C505~ -** Processing line: ~ ITSAppUsesNonExemptEncryption~ -** Processing line: ~ ~ -** Processing line: ~ MinimumOSVersion~ -** Processing line: ~ 11.0~ -** Processing line: ~ UIAppFonts~ -** Processing line: ~ ~ -** Processing line: ~ UIBackgroundModes~ -** Processing line: ~ ~ -** Processing line: ~ UIDeviceFamily~ -** Processing line: ~ ~ -** Processing line: ~ 1~ -** Processing line: ~ 2~ -** Processing line: ~ ~ -** Processing line: ~ UILaunchImages~ -** Processing line: ~ ~ -** Processing line: ~ ~ -** Processing line: ~ UILaunchImageMinimumOSVersion~ -** Processing line: ~ 11.0~ -** Processing line: ~ UILaunchImageName~ -** Processing line: ~ LaunchImage-1100-Portrait-2436h~ -** Processing line: ~ UILaunchImageOrientation~ -** Processing line: ~ Portrait~ -** Processing line: ~ UILaunchImageSize~ -** Processing line: ~ {375, 812}~ -** Processing line: ~ ~ -** Processing line: ~ ~ -** Processing line: ~ UILaunchImageMinimumOSVersion~ -** Processing line: ~ 8.0~ -** Processing line: ~ UILaunchImageName~ -** Processing line: ~ LaunchImage-800-Portrait-736h~ -** Processing line: ~ UILaunchImageOrientation~ -** Processing line: ~ Portrait~ -** Processing line: ~ UILaunchImageSize~ -** Processing line: ~ {414, 736}~ -** Processing line: ~ ~ -** Processing line: ~ ~ -** Processing line: ~ UILaunchImageMinimumOSVersion~ -** Processing line: ~ 8.0~ -** Processing line: ~ UILaunchImageName~ -** Processing line: ~ LaunchImage-800-667h~ -** Processing line: ~ UILaunchImageOrientation~ -** Processing line: ~ Portrait~ -** Processing line: ~ UILaunchImageSize~ -** Processing line: ~ {375, 667}~ -** Processing line: ~ ~ -** Processing line: ~ ~ -** Processing line: ~ UILaunchImageMinimumOSVersion~ -** Processing line: ~ 7.0~ -** Processing line: ~ UILaunchImageName~ -** Processing line: ~ LaunchImage-700~ -** Processing line: ~ UILaunchImageOrientation~ -** Processing line: ~ Portrait~ -** Processing line: ~ UILaunchImageSize~ -** Processing line: ~ {320, 480}~ -** Processing line: ~ ~ -** Processing line: ~ ~ -** Processing line: ~ UILaunchImageMinimumOSVersion~ -** Processing line: ~ 7.0~ -** Processing line: ~ UILaunchImageName~ -** Processing line: ~ LaunchImage-700-568h~ -** Processing line: ~ UILaunchImageOrientation~ -** Processing line: ~ Portrait~ -** Processing line: ~ UILaunchImageSize~ -** Processing line: ~ {320, 568}~ -** Processing line: ~ ~ -** Processing line: ~ ~ -** Processing line: ~ UILaunchImageMinimumOSVersion~ -** Processing line: ~ 7.0~ -** Processing line: ~ UILaunchImageName~ -** Processing line: ~ LaunchImage-700-Portrait~ -** Processing line: ~ UILaunchImageOrientation~ -** Processing line: ~ Portrait~ -** Processing line: ~ UILaunchImageSize~ -** Processing line: ~ {768, 1024}~ -** Processing line: ~ ~ -** Processing line: ~ ~ -** Processing line: ~ UIRequiredDeviceCapabilities~ -** Processing line: ~ ~ -** Processing line: ~ arm64~ -** Processing line: ~ ~ -** Processing line: ~ UIRequiresFullScreen~ -** Processing line: ~ ~ -** Processing line: ~ UIStatusBarStyle~ -** Processing line: ~ UIStatusBarStyleDefault~ -** Processing line: ~ UISupportedInterfaceOrientations~ -** Processing line: ~ ~ -** Processing line: ~ #{device_orientation_xml}~ -** Processing line: ~ ~ +** Processing line: ~ BuildMachineOSBuild~ +** Processing line: ~ 20D91~ +** Processing line: ~ CFBundleDevelopmentRegion~ +** Processing line: ~ en~ +** Processing line: ~ CFBundleDisplayName~ +** Processing line: ~ :app_name~ +** Processing line: ~ CFBundleExecutable~ +** Processing line: ~ Runtime~ +** Processing line: ~ CFBundleIconFiles~ +** Processing line: ~ ~ +** Processing line: ~ AppIcon60x60~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIcons~ +** Processing line: ~ ~ +** Processing line: ~ CFBundlePrimaryIcon~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIconFiles~ +** Processing line: ~ ~ +** Processing line: ~ AppIcon60x60~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIconName~ +** Processing line: ~ AppIcon~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIcons~ipad~ +** Processing line: ~ ~ +** Processing line: ~ CFBundlePrimaryIcon~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIconFiles~ +** Processing line: ~ ~ +** Processing line: ~ AppIcon60x60~ +** Processing line: ~ AppIcon76x76~ +** Processing line: ~ AppIcon83.5x83.5~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIconName~ +** Processing line: ~ AppIcon~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIdentifier~ +** Processing line: ~ :app_id~ +** Processing line: ~ CFBundleInfoDictionaryVersion~ +** Processing line: ~ 6.0~ +** Processing line: ~ CFBundleName~ +** Processing line: ~ :app_name~ +** Processing line: ~ CFBundlePackageType~ +** Processing line: ~ APPL~ +** Processing line: ~ CFBundleShortVersionString~ +** Processing line: ~ 5.2~ +** Processing line: ~ CFBundleSignature~ +** Processing line: ~ ????~ +** Processing line: ~ CFBundleSupportedPlatforms~ +** Processing line: ~ ~ +** Processing line: ~ iPhoneOS~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleVersion~ +** Processing line: ~ 5.2~ +** Processing line: ~ DTCompiler~ +** Processing line: ~ com.apple.compilers.llvm.clang.1_0~ +** Processing line: ~ DTPlatformBuild~ +** Processing line: ~ 18D46~ +** Processing line: ~ DTPlatformName~ +** Processing line: ~ iphoneos~ +** Processing line: ~ DTPlatformVersion~ +** Processing line: ~ 14.4~ +** Processing line: ~ DTSDKBuild~ +** Processing line: ~ 18D46~ +** Processing line: ~ DTSDKName~ +** Processing line: ~ iphoneos14.4~ +** Processing line: ~ DTXcode~ +** Processing line: ~ 0124~ +** Processing line: ~ DTXcodeBuild~ +** Processing line: ~ 12D4e~ +** Processing line: ~ MinimumOSVersion~ +** Processing line: ~ 14.4~ +** Processing line: ~ UIAppFonts~ +** Processing line: ~ ~ +** Processing line: ~ UIBackgroundModes~ +** Processing line: ~ ~ +** Processing line: ~ UIDeviceFamily~ +** Processing line: ~ ~ +** Processing line: ~ 1~ +** Processing line: ~ 2~ +** Processing line: ~ ~ +** Processing line: ~ UILaunchImages~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ UILaunchImageMinimumOSVersion~ +** Processing line: ~ 7.0~ +** Processing line: ~ UILaunchImageName~ +** Processing line: ~ Default-568h@2x~ +** Processing line: ~ UILaunchImageOrientation~ +** Processing line: ~ Portrait~ +** Processing line: ~ UILaunchImageSize~ +** Processing line: ~ {320, 568}~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ UILaunchImageMinimumOSVersion~ +** Processing line: ~ 7.0~ +** Processing line: ~ UILaunchImageName~ +** Processing line: ~ Default-667h@2x~ +** Processing line: ~ UILaunchImageOrientation~ +** Processing line: ~ Portrait~ +** Processing line: ~ UILaunchImageSize~ +** Processing line: ~ {375, 667}~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ UILaunchImageMinimumOSVersion~ +** Processing line: ~ 7.0~ +** Processing line: ~ UILaunchImageName~ +** Processing line: ~ Default-736h@3x~ +** Processing line: ~ UILaunchImageOrientation~ +** Processing line: ~ Portrait~ +** Processing line: ~ UILaunchImageSize~ +** Processing line: ~ {414, 736}~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ UILaunchStoryboardName~ +** Processing line: ~ SimpleSplash~ +** Processing line: ~ UIRequiredDeviceCapabilities~ +** Processing line: ~ ~ +** Processing line: ~ arm64~ +** Processing line: ~ ~ +** Processing line: ~ UIRequiresFullScreen~ +** Processing line: ~ ~ +** Processing line: ~ UIStatusBarStyle~ +** Processing line: ~ UIStatusBarStyleDefault~ +** Processing line: ~ UISupportedInterfaceOrientations~ +** Processing line: ~ ~ +** Processing line: ~ UIInterfaceOrientationLandscapeRight~ +** Processing line: ~ ~ ** Processing line: ~ ~ ** Processing line: ~ ~ ** Processing line: ~ XML~ @@ -149085,7 +223651,163 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ # UIInterfaceOrientationPortrait~ ** Processing line: ~ # UIInterfaceOrientationLandscapeRight~ ** Processing line: ~~ -** Processing line: ~ $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.gsub(":app_name", @app_name).strip~ +** Processing line: ~ info_plist_string.gsub!(":app_name", @app_name)~ +** 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: ~~ +** Processing line: ~ @info_plist_written = true~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def production_write_info_plist~ +** Processing line: ~ log_info "Adding Info.plist."~ +** Processing line: ~~ +** Processing line: ~ info_plist_string = <<-XML~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ BuildMachineOSBuild~ +** Processing line: ~ 20D91~ +** Processing line: ~ CFBundleDevelopmentRegion~ +** Processing line: ~ en~ +** Processing line: ~ CFBundleDisplayName~ +** Processing line: ~ :app_name~ +** Processing line: ~ CFBundleExecutable~ +** Processing line: ~ Runtime~ +** Processing line: ~ CFBundleIconFiles~ +** Processing line: ~ ~ +** Processing line: ~ AppIcon60x60~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIcons~ +** Processing line: ~ ~ +** Processing line: ~ CFBundlePrimaryIcon~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIconFiles~ +** Processing line: ~ ~ +** Processing line: ~ AppIcon60x60~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIconName~ +** Processing line: ~ AppIcon~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIcons~ipad~ +** Processing line: ~ ~ +** Processing line: ~ CFBundlePrimaryIcon~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIconFiles~ +** Processing line: ~ ~ +** Processing line: ~ AppIcon60x60~ +** Processing line: ~ AppIcon76x76~ +** Processing line: ~ AppIcon83.5x83.5~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIconName~ +** Processing line: ~ AppIcon~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleIdentifier~ +** Processing line: ~ :app_id~ +** Processing line: ~ CFBundleInfoDictionaryVersion~ +** Processing line: ~ 6.0~ +** Processing line: ~ CFBundleName~ +** Processing line: ~ :app_name~ +** Processing line: ~ CFBundlePackageType~ +** Processing line: ~ APPL~ +** Processing line: ~ CFBundleShortVersionString~ +** Processing line: ~ 5.2~ +** Processing line: ~ CFBundleSignature~ +** Processing line: ~ ????~ +** Processing line: ~ CFBundleSupportedPlatforms~ +** Processing line: ~ ~ +** Processing line: ~ iPhoneOS~ +** Processing line: ~ ~ +** Processing line: ~ CFBundleVersion~ +** Processing line: ~ 5.2~ +** Processing line: ~ DTCompiler~ +** Processing line: ~ com.apple.compilers.llvm.clang.1_0~ +** Processing line: ~ DTPlatformBuild~ +** Processing line: ~ 18D46~ +** Processing line: ~ DTPlatformName~ +** Processing line: ~ iphoneos~ +** Processing line: ~ DTPlatformVersion~ +** Processing line: ~ 14.4~ +** Processing line: ~ DTSDKBuild~ +** Processing line: ~ 18D46~ +** Processing line: ~ DTSDKName~ +** Processing line: ~ iphoneos14.4~ +** Processing line: ~ DTXcode~ +** Processing line: ~ 0124~ +** Processing line: ~ DTXcodeBuild~ +** Processing line: ~ 12D4e~ +** Processing line: ~ MinimumOSVersion~ +** Processing line: ~ 14.4~ +** Processing line: ~ UIAppFonts~ +** Processing line: ~ ~ +** Processing line: ~ UIBackgroundModes~ +** Processing line: ~ ~ +** Processing line: ~ UIDeviceFamily~ +** Processing line: ~ ~ +** Processing line: ~ 1~ +** Processing line: ~ 2~ +** Processing line: ~ ~ +** Processing line: ~ UILaunchImages~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ UILaunchImageMinimumOSVersion~ +** Processing line: ~ 7.0~ +** Processing line: ~ UILaunchImageName~ +** Processing line: ~ Default-568h@2x~ +** Processing line: ~ UILaunchImageOrientation~ +** Processing line: ~ Portrait~ +** Processing line: ~ UILaunchImageSize~ +** Processing line: ~ {320, 568}~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ UILaunchImageMinimumOSVersion~ +** Processing line: ~ 7.0~ +** Processing line: ~ UILaunchImageName~ +** Processing line: ~ Default-667h@2x~ +** Processing line: ~ UILaunchImageOrientation~ +** Processing line: ~ Portrait~ +** Processing line: ~ UILaunchImageSize~ +** Processing line: ~ {375, 667}~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ UILaunchImageMinimumOSVersion~ +** Processing line: ~ 7.0~ +** Processing line: ~ UILaunchImageName~ +** Processing line: ~ Default-736h@3x~ +** Processing line: ~ UILaunchImageOrientation~ +** Processing line: ~ Portrait~ +** Processing line: ~ UILaunchImageSize~ +** Processing line: ~ {414, 736}~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ UILaunchStoryboardName~ +** Processing line: ~ SimpleSplash~ +** Processing line: ~ UIRequiredDeviceCapabilities~ +** Processing line: ~ ~ +** Processing line: ~ arm64~ +** Processing line: ~ ~ +** Processing line: ~ UIRequiresFullScreen~ +** Processing line: ~ ~ +** Processing line: ~ UIStatusBarStyle~ +** Processing line: ~ UIStatusBarStyleDefault~ +** Processing line: ~ UISupportedInterfaceOrientations~ +** Processing line: ~ ~ +** Processing line: ~ UIInterfaceOrientationLandscapeRight~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ ~ +** Processing line: ~ XML~ +** Processing line: ~~ +** Processing line: ~ # UIInterfaceOrientationPortrait~ +** Processing line: ~ # UIInterfaceOrientationLandscapeRight~ +** Processing line: ~~ +** Processing line: ~ info_plist_string.gsub!(":app_name", @app_name)~ +** 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: ~~ ** Processing line: ~ @info_plist_written = true~ ** Processing line: ~ end~ @@ -149111,7 +223833,9 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ $gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ def create_ipa~ +** 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\""~ @@ -149127,18 +223851,11 @@ Follows is a source code listing for all files that have been open sourced. This ** 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: ~ end~ +** Processing line: ~~ +** Processing line: ~ def create_ipa~ ** Processing line: ~ do_zip~ ** Processing line: ~ sh "cp \"#{tmp_directory}/ipa_root/archive.zip\" \"#{tmp_directory}/#{@app_name}.ipa\""~ -** Processing line: ~ sh "XCODE_DIR=\"/Applications/Xcode.app/Contents/Developer\" \"#{relative_path}/dragonruby-deploy-ios\" -d \"#{@device_id}\" \"#{tmp_directory}/#{@app_name}.ipa\""~ -** Processing line: ~ cmd_result = `ps -e | grep civetweb`~ -** Processing line: ~ is_civet_running = (`ps -e | grep civetweb`).strip.each_line.to_a.length > 2~ -** Processing line: ~ if !is_civet_running~ -** Processing line: ~ $gtk.system "cp \"#{relative_path}/civetweb\" \"#{tmp_directory}/../src_backup/civetweb\""~ -** Processing line: ~ $gtk.system "open \"#{tmp_directory}/../src_backup/civetweb\" -g"~ -** Processing line: ~ else~ -** Processing line: ~ log "* INFO: civetweb is running already running. No need to start another instance."~ -** Processing line: ~ end~ -** Processing line: ~ log_info "Check your device!!"~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def do_zip~ @@ -149161,6 +223878,34 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def deploy~ +** Processing line: ~ sh "XCODE_DIR=\"/Applications/Xcode.app/Contents/Developer\" \"#{relative_path}/dragonruby-deploy-ios\" -d \"#{@device_id}\" \"#{tmp_directory}/#{@app_name}.ipa\""~ +** Processing line: ~ log_info "Check your device!!"~ +** 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: ~ end~ +** Processing line: ~~ +** Processing line: ~ def compile_icons~ +** Processing line: ~ cmd = <<-S~ +** Processing line: ~ "/Applications/Xcode.app/Contents/Developer/usr/bin/actool" --output-format human-readable-text \~ +** Processing line: ~ --notices --warnings --platform iphoneos \~ +** Processing line: ~ --minimum-deployment-target 10.3 \~ +** Processing line: ~ --target-device iphone \~ +** Processing line: ~ --target-device ipad --app-icon 'AppIcon' \~ +** Processing line: ~ --output-partial-info-plist '#{app_path}/AssetCatalog-Info.plist' \~ +** Processing line: ~ --compress-pngs --compile "#{app_path}" \~ +** Processing line: ~ "#{app_path}/Assets.xcassets"~ +** Processing line: ~ S~ +** Processing line: ~ sh cmd~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def stage_native_libs~ +** 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: ~ end~ ** Processing line: ~~ @@ -149168,10 +223913,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* itch_wizard.rb~ -- H1 detected. +** Processing line: ~*** itch_wizard.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~itch_wizard.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: ~itch_wizard.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -149273,7 +224023,7 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ if metadata[:icon].start_with?("#") || !@icon~ -** Processing line: ~ log "* PROPT: Please provide icon path for your game."~ +** Processing line: ~ log "* PROMPT: Please provide icon path for your game."~ ** Processing line: ~ $console.set_command "$wizards.itch.set_icon \"icon.png\""~ ** Processing line: ~ return :need_icon~ ** Processing line: ~ end~ @@ -149452,10 +224202,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* layout.rb~ -- H1 detected. +** Processing line: ~*** layout.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~layout.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: ~layout.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -149824,6 +224579,18 @@ 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[:row] = opts[:row]~ +** Processing line: ~ result[:col] = opts[:col]~ +** Processing line: ~~ +** Processing line: ~ if $gtk.args.grid.name == :center~ +** Processing line: ~ result[:x] -= 640~ +** Processing line: ~ result[:y] -= 360~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ result~ ** Processing line: ~ end~ ** Processing line: ~~ @@ -149947,10 +224714,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* log.rb~ -- H1 detected. +** Processing line: ~*** log.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~log.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: ~log.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -150227,10 +224999,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* numeric.rb~ -- H1 detected. +** Processing line: ~*** numeric.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~numeric.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: ~numeric.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -150247,8 +225024,12 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ include ValueType~ ** Processing line: ~ include NumericDeprecated~ ** Processing line: ~~ +** Processing line: ~ alias_method :gt, :>~ ** Processing line: ~ alias_method :gte, :>=~ +** Processing line: ~ alias_method :lt, :<~ ** Processing line: ~ alias_method :lte, :<=~ +** Processing line: ~ alias_method :__original_eq_eq__, :== unless Numeric.instance_methods.include? :__original_eq_eq__~ +** Processing line: ~~ ** Processing line: ~~ ** Processing line: ~ # Converts a numeric value representing seconds into frames.~ ** Processing line: ~ #~ @@ -150268,6 +225049,23 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ clamp(0, 255).to_i~ ** 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~ +** Processing line: ~ return min if min == max~ +** Processing line: ~ if self < min~ +** Processing line: ~ overflow = min - self~ +** Processing line: ~ return (max - overflow).clamp_wrap min, max~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if self > max~ +** Processing line: ~ overflow = self - max~ +** Processing line: ~ return (min + overflow).clamp_wrap min, max~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ return self~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ def elapsed_time tick_count_override = nil~ ** Processing line: ~ (tick_count_override || Kernel.tick_count) - self~ ** Processing line: ~ end~ @@ -150521,16 +225319,18 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ vector_y max_value~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # @gtk~ ** Processing line: ~ def mod n~ ** Processing line: ~ self % n~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # @gtk~ ** Processing line: ~ def mod_zero? *ns~ ** Processing line: ~ ns.any? { |n| mod(n) == 0 }~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def zmod? n~ +** Processing line: ~ (self % n) == 0~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ def mult n~ ** Processing line: ~ self * n~ ** Processing line: ~ end~ @@ -150652,13 +225452,10 @@ 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: ~ alias_method(:original_eq_eq, :==) unless Numeric.instance_methods.include?(:original_eq_eq)~ ** Processing line: ~ def == other~ -** Processing line: ~ return true if self.original_eq_eq(other)~ -** Processing line: ~ if other.is_a?(OpenEntity)~ -** Processing line: ~ return self.original_eq_eq(other.entity_id)~ -** Processing line: ~ end~ -** Processing line: ~ return self.original_eq_eq(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~ @@ -150676,6 +225473,48 @@ 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 each~ +** Processing line: ~ unless block_given?~ +** Processing line: ~ raise <<-S~ +** Processing line: ~ * ERROR:~ +** Processing line: ~ A block is required for Numeric#each.~ +** Processing line: ~~ +** Processing line: ~ S~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ self.to_i.times do~ +** Processing line: ~ yield~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def times_with_index~ +** Processing line: ~ unless block_given?~ +** Processing line: ~ raise <<-S~ +** Processing line: ~ * ERROR:~ +** Processing line: ~ A block is required for Numeric#times_with_index.~ +** Processing line: ~~ +** Processing line: ~ S~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ self.to_i.times.with_index do |i|~ +** Processing line: ~ yield i~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def each_with_index~ +** Processing line: ~ unless block_given?~ +** Processing line: ~ raise <<-S~ +** Processing line: ~ * ERROR:~ +** Processing line: ~ A block is required for Numeric#each_with_index.~ +** Processing line: ~~ +** Processing line: ~ S~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ self.to_i.times.with_index do |i|~ +** Processing line: ~ yield i~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ # @gtk~ ** Processing line: ~ def map_with_index~ ** Processing line: ~ unless block_given?~ @@ -150691,69 +225530,82 @@ 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 check_numeric! sender, other~ -** Processing line: ~ return if other.is_a? Numeric~ -** Processing line: ~~ +** Processing line: ~ def __raise_arithmetic_exception__ other, m, e~ ** Processing line: ~ raise <<-S~ ** Processing line: ~ * ERROR:~ -** Processing line: ~ Attempted to invoke :+ on #{self} with the right hand argument of:~ +** Processing line: ~ Attempted to invoke :#{m} on #{self} with the right hand argument of:~ ** Processing line: ~~ ** Processing line: ~ #{other}~ ** Processing line: ~~ ** Processing line: ~ The object above is not a Numeric.~ ** Processing line: ~~ +** Processing line: ~ #{e}~ ** Processing line: ~ S~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def - other~ ** Processing line: ~ return nil unless other~ -** Processing line: ~ check_numeric! :-, 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: ~ check_numeric! :+, 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: ~ check_numeric! :*, 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: ~ check_numeric! :/, other~ ** Processing line: ~ super~ +** Processing line: ~ rescue Exception => e~ +** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def serialize~ ** Processing line: ~ self~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def self.from_top n~ +** Processing line: ~ return 720 - n unless $gtk~ +** Processing line: ~ $gtk.args.grid.top - n~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ def from_top~ -** Processing line: ~ return 720 - self unless $gtk~ -** Processing line: ~ $gtk.args.grid.h - self~ +** Processing line: ~ Numeric.from_top self~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.from_right n~ +** Processing line: ~ return 1280 - n unless $gtk~ +** Processing line: ~ $gtk.args.grid.right - n~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def from_right~ -** Processing line: ~ return 1280 - self unless $gtk~ -** Processing line: ~ $gtk.args.grid.w - self~ +** Processing line: ~ Numeric.from_right self~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def self.clamp n, min, max~ +** Processing line: ~ n.clamp min, max~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ class Fixnum~ ** Processing line: ~ include ValueType~ ** Processing line: ~~ -** Processing line: ~ alias_method(:original_eq_eq, :==) unless Fixnum.instance_methods.include?(:original_eq_eq)~ -** Processing line: ~~ -** Processing line: ~ def - other~ -** Processing line: ~ return nil unless other~ -** Processing line: ~ check_numeric! :-, other~ -** Processing line: ~ super~ -** Processing line: ~ end~ +** Processing line: ~ alias_method :__original_eq_eq__, :== unless Fixnum.instance_methods.include? :__original_eq_eq__~ +** Processing line: ~ alias_method :__original_add__, :+ unless Fixnum.instance_methods.include? :__original_add__~ +** Processing line: ~ alias_method :__original_subtract__, :- unless Fixnum.instance_methods.include? :__original_subtract__~ +** Processing line: ~ alias_method :__original_multiply__, :* unless Fixnum.instance_methods.include? :__original_multiply__~ +** Processing line: ~ alias_method :__original_divide__, :- unless Fixnum.instance_methods.include? :__original_divide__~ ** Processing line: ~~ ** Processing line: ~ # Returns `true` if the numeric value is evenly divisible by 2.~ ** Processing line: ~ #~ @@ -150771,28 +225623,36 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~~ ** Processing line: ~ def + other~ ** Processing line: ~ return nil unless other~ -** Processing line: ~ check_numeric! :+, 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: ~ check_numeric! :*, 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: ~ check_numeric! :/, 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: ~ 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 true if self.original_eq_eq(other)~ -** Processing line: ~ if other.is_a?(GTK::OpenEntity)~ -** Processing line: ~ return self.original_eq_eq(other.entity_id)~ -** Processing line: ~ end~ -** Processing line: ~ return self.original_eq_eq(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~ @@ -150832,33 +225692,50 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ def sin~ ** Processing line: ~ Math.sin(self.to_radians)~ ** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def to_sf~ +** Processing line: ~ "%.2f" % self~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def ifloor int~ +** Processing line: ~ (self.idiv int.to_i) * int.to_i~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ class Float~ ** Processing line: ~ include ValueType~ ** Processing line: ~~ +** Processing line: ~ alias_method :__original_add__, :+ unless Float.instance_methods.include? :__original_add__~ +** Processing line: ~ alias_method :__original_subtract__, :- unless Float.instance_methods.include? :__original_subtract__~ +** Processing line: ~ alias_method :__original_multiply__, :* unless Float.instance_methods.include? :__original_multiply__~ +** Processing line: ~ alias_method :__original_divide__, :- unless Float.instance_methods.include? :__original_divide__~ +** Processing line: ~~ ** Processing line: ~ def - other~ ** Processing line: ~ return nil unless other~ -** Processing line: ~ check_numeric! :-, 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: ~ check_numeric! :+, 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: ~ check_numeric! :*, 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: ~ check_numeric! :/, other~ ** Processing line: ~ super~ +** Processing line: ~ rescue Exception => e~ +** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ def serialize~ @@ -150878,13 +225755,29 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ return -scalar if self < 0~ ** Processing line: ~ return scalar if self > 0~ ** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def to_sf~ +** Processing line: ~ "%.2f" % self~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def ifloor int~ +** Processing line: ~ (self.idiv int.to_i) * int.to_i~ +** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ class Integer~ -** Processing line: ~ alias_method(:original_round, :round) unless Fixnum.instance_methods.include?(:original_round)~ +** Processing line: ~ alias_method :__original_round__, :round unless Integer.instance_methods.include? :__original_round__~ +** Processing line: ~ alias_method :__original_add__, :+ unless Integer.instance_methods.include? :__original_add__~ +** Processing line: ~ alias_method :__original_subtract__, :- unless Integer.instance_methods.include? :__original_subtract__~ +** Processing line: ~ alias_method :__original_multiply__, :* unless Integer.instance_methods.include? :__original_multiply__~ +** Processing line: ~ alias_method :__original_divide__, :- unless Integer.instance_methods.include? :__original_divide__~ ** Processing line: ~~ ** Processing line: ~ def round *args~ -** Processing line: ~ original_round~ +** Processing line: ~ __original_round__~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def nan?~ +** Processing line: ~ false~ ** Processing line: ~ end~ ** Processing line: ~ end~ ** Processing line: ~~ @@ -150892,10 +225785,386 @@ 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~ -- H1 detected. +** Processing line: ~*** remote_hotload_client.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~remote_hotload_client.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: ~remote_hotload_client.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/remote_hotload_client.rb~ +** Processing line: ~ # coding: utf-8~ +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +** Processing line: ~ # MIT License~ +** Processing line: ~ # hotload_client.rb has been released under MIT (*only this file*).~ +** Processing line: ~~ +** Processing line: ~ module GTK~ +** Processing line: ~ class RemoteHotloadClient~ +** Processing line: ~ attr :args~ +** Processing line: ~~ +** Processing line: ~ def gtk~ +** Processing line: ~ args.gtk~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def state~ +** Processing line: ~ local_state~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def initialize local_ip_address~ +** Processing line: ~ local_state.local_ip_address = local_ip_address~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick~ +** Processing line: ~ return unless server_available?~ +** Processing line: ~ return unless server_needed?~ +** Processing line: ~~ +** Processing line: ~ if should_tick? && server_needed? && !local_state.notified~ +** Processing line: ~ if server_available?~ +** Processing line: ~ remote_log "* REMOTE CLIENT INFO: Hotload server found at #{get_server_ip_address}:9001."~ +** Processing line: ~ end~ +** Processing line: ~ local_state.notified = true~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ tick_process_file_retrieval~ +** Processing line: ~ tick_process_queue~ +** Processing line: ~ tick_changes~ +** Processing line: ~ tick_http_boot~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def should_tick?~ +** Processing line: ~ (game_state.tick_count.mod_zero? 60) && game_state.tick_count > 5.seconds~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def game_state~ +** Processing line: ~ args.state~ +** Processing line: ~ end~ +** Processing line: ~~ +** 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: ~ changes: { },~ +** Processing line: ~ changes_queue: [],~ +** Processing line: ~ reloaded_files_times: [])~ +** Processing line: ~ @local_state.hotload_client~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def remote_log message~ +** Processing line: ~ log message~ +** Processing line: ~ args.gtk.http_post "http://#{get_server_ip_address}:9001/dragon/log/", { message: "=======\n#{message}\n=======\n" }, ["Content-Type: application/x-www-form-urlencoded"]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def get_server_ip_address~ +** Processing line: ~ return local_state.ip_address if local_state.ip_address~ +** Processing line: ~ local_state.ip_address ||= ((gtk.read_file 'app/server_ip_address.txt') || "").strip~ +** Processing line: ~ local_state.ip_address~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def server_available?~ +** Processing line: ~ return false if gtk.platform == 'Emscripten'~ +** Processing line: ~ get_server_ip_address.length != 0~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def server_needed?~ +** Processing line: ~ return false if gtk.platform == 'Emscripten'~ +** Processing line: ~ local_state.local_ip_address != get_server_ip_address~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_changes~ +** Processing line: ~ return unless should_tick?~ +** Processing line: ~~ +** Processing line: ~ local_state.greatest_tick ||= 0~ +** Processing line: ~ local_state.last_greatest_tick ||= 0~ +** Processing line: ~~ +** Processing line: ~ tick_http_changes~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_http_boot~ +** Processing line: ~ return if local_state.booted_at~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ if !local_state.http_boot~ +** Processing line: ~ # first retrieve changes.txt which has the following format~ +** Processing line: ~ # file with latest change,~ +** Processing line: ~ # latest file update_time key~ +** Processing line: ~ # tmp/src_backup/src_backup_app_main.rb, 1597926596, app/main.rb~ +** Processing line: ~ local_state.http_boot = args.gtk.http_get "http://#{get_server_ip_address}:9001/dragon/boot/"~ +** Processing line: ~ elsif local_state.http_boot && local_state.http_boot[:http_response_code] == 200~ +** Processing line: ~ local_state.last_greatest_tick = local_state.http_boot[:response_data].strip.to_i~ +** Processing line: ~ local_state.greatest_tick = local_state.http_boot[:response_data].strip.to_i~ +** Processing line: ~ local_state.booted_at = local_state.greatest_tick~ +** Processing line: ~ remote_log '* REMOTE CLIENT INFO: HTTP GET for local_state. boot.txt succeeded.'~ +** Processing line: ~ remote_log "* REMOTE CLIENT INFO: Looking for changes after: #{local_state.greatest_tick}."~ +** Processing line: ~ elsif local_state.http_boot && local_state.http_boot[:http_response_code] == -1 && local_state.http_boot[:complete]~ +** Processing line: ~ remote_log '* REMOTE CLIENT INFO: HTTP GET for boot.txt failed. Retrying.'~ +** Processing line: ~ local_state.http_boot = nil~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_http_changes~ +** Processing line: ~ return unless local_state.booted_at~ +** Processing line: ~~ +** Processing line: ~ if !local_state.http_changes~ +** Processing line: ~ local_state.http_changes = args.gtk.http_get "http://#{get_server_ip_address}:9001/dragon/changes/"~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if local_state.http_changes && local_state.http_changes[:http_response_code] == 200 && local_state.booted_at~ +** Processing line: ~ local_state.last_greatest_tick = local_state.greatest_tick~ +** Processing line: ~ # if the retrieval of changes.txt was successful~ +** Processing line: ~ local_state.http_changes[:response_data].each_line do |l|~ +** Processing line: ~ if l.strip.length != 0~ +** Processing line: ~ # within reload state for that specific changes hash~ +** Processing line: ~ # set the last time the file was updated~ +** Processing line: ~ file_name, updated_at, key = l.strip.split(',')~ +** Processing line: ~ file_name.strip!~ +** Processing line: ~ updated_at.strip!~ +** Processing line: ~ key.strip!~ +** Processing line: ~ updated_at = updated_at.to_i~ +** Processing line: ~ file_name = file_name.gsub("tmp/src_backup/", "")~ +** Processing line: ~~ +** Processing line: ~ # keep an internal clock that denotes that current time on the~ +** Processing line: ~ # dev machine~ +** Processing line: ~ if updated_at > local_state.greatest_tick~ +** Processing line: ~ local_state.greatest_tick = updated_at~ +** Processing line: ~~ +** Processing line: ~ # create a new entry in change tracking for the file~ +** Processing line: ~ # for every file where the file was last updated, find all the ones where the time is not the same~ +** Processing line: ~ # and queue those to be retrieved and required~ +** Processing line: ~ # if the last time the dev machine time was retrieved is less than the file time changed~ +** Processing line: ~ # then queue the file for reload~ +** Processing line: ~ current_updated_at = (local_state.changes[key] || { updated_at: 0 })[:updated_at]~ +** Processing line: ~ if updated_at > current_updated_at~ +** Processing line: ~ remote_log "* REMOTE CLIENT INFO: Queueing file #{file_name} for update."~ +** Processing line: ~ local_state.changes[key] = { key: key,~ +** Processing line: ~ latest_file: file_name,~ +** Processing line: ~ updated_at: updated_at }~ +** Processing line: ~ local_state.changes_queue << local_state.changes[key]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ # set the greatest tick/current time of the machine~ +** Processing line: ~ local_state.http_changes = nil~ +** Processing line: ~ elsif local_state.http_changes && local_state.http_changes[:http_response_code] == -1 && local_state.http_change[:complete] && local_state.booted_at~ +** Processing line: ~ local_state.http_changes = nil~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_process_queue~ +** Processing line: ~ return if local_state.http_file_changes # don't pop a file off the queue if there is an http request in flight~ +** Processing line: ~ return if local_state.processing_file_changes # don't pop a file if there is a file currently being processed~ +** Processing line: ~ return unless local_state.changes_queue.length > 0 # return if the queue is empty~ +** Processing line: ~~ +** Processing line: ~ # if it isn't empty, pop the first file off the queue (FIFO)~ +** Processing line: ~ local_state.processing_file_changes = local_state.changes_queue.shift~ +** Processing line: ~~ +** Processing line: ~ # create an http request for the file~ +** Processing line: ~ url = "http://#{get_server_ip_address}:9001/dragon/#{local_state.processing_file_changes[:latest_file]}"~ +** Processing line: ~ remote_log "* REMOTE CLIENT INFO: Getting new version of #{local_state.processing_file_changes[:latest_file]} (#{url})."~ +** Processing line: ~ local_state.http_file_changes = args.gtk.http_get url~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def tick_process_file_retrieval~ +** Processing line: ~ return if !local_state.http_file_changes~ +** Processing line: ~~ +** Processing line: ~ # if the http request has finished successfully~ +** Processing line: ~ if local_state.http_file_changes[:http_response_code] == 200~ +** Processing line: ~ file_key = local_state.processing_file_changes[:key]~ +** Processing line: ~ # notify that a file will be reloaded~ +** Processing line: ~ remote_log "* REMOTE CLIENT INFO: Loading #{file_key}: #{local_state.processing_file_changes[:latest_file]}"~ +** Processing line: ~ remote_log "#{local_state.http_file_changes[:response_data]}"~ +** Processing line: ~~ +** Processing line: ~ # write the latest file with what came back from the response data~ +** Processing line: ~ gtk.write_file "#{file_key}", local_state.http_file_changes[:response_data]~ +** Processing line: ~~ +** Processing line: ~ # nil out the currently processing file so a new item can be processed from the queue~ +** Processing line: ~ # local_state.reloaded_files_times << local_state.processing_file_changes[:key]~ +** Processing line: ~ local_state.http_file_changes = nil~ +** Processing line: ~ local_state.processing_file_changes = nil~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** runtime/autocomplete.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~runtime/autocomplete.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/autocomplete.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/autocomplete.rb~ +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +** Processing line: ~ # MIT License~ +** Processing line: ~ # autocomplete.rb has been released under MIT (*only this file*).~ +** Processing line: ~~ +** Processing line: ~ module GTK~ +** Processing line: ~ class Runtime~ +** Processing line: ~ module Autocomplete~ +** Processing line: ~ def autocomplete_parse opts~ +** Processing line: ~ if opts[:file] && !opts[:text]~ +** Processing line: ~ opts[:text] = read_file opts[:file]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ text = opts[:text]~ +** Processing line: ~ index = opts[:index]~ +** Processing line: ~ sum = 0~ +** Processing line: ~ lines = text.each_line.to_a.map do |l|~ +** Processing line: ~ sum += l.length~ +** Processing line: ~ { line: l, length: l.length, sum: sum }~ +** Processing line: ~ end~ +** Processing line: ~ cursor_line = lines.find { |l| l[:sum] >= index }~ +** Processing line: ~ previous_line = lines.find { |l| l[:sum] < index }~ +** Processing line: ~ previous_line ||= { sum: 0 }~ +** Processing line: ~ if cursor_line~ +** 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: ~ dot = dots[-1]~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ {~ +** Processing line: ~ text: opts[:text],~ +** Processing line: ~ file: opts[:file],~ +** Processing line: ~ index: opts[:index],~ +** Processing line: ~ cursor_line: cursor_line,~ +** Processing line: ~ previous_line: previous_line,~ +** Processing line: ~ word: word,~ +** Processing line: ~ token: token,~ +** Processing line: ~ dots: dots,~ +** Processing line: ~ dot: dot~ +** Processing line: ~ }~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def autocomplete_filter_methods keys, *ignores~ +** Processing line: ~ ignores ||= []~ +** Processing line: ~ ignores = [ignores].flatten~ +** Processing line: ~ keys = keys.map { |k| k.to_s }~ +** Processing line: ~ others = ["def", "end"] +~ +** Processing line: ~ [ :entity_keys_by_ref,~ +** Processing line: ~ :entity_name,~ +** Processing line: ~ :as_hash,~ +** Processing line: ~ :clear!,~ +** Processing line: ~ :created_at_elapsed,~ +** Processing line: ~ :entity_id,~ +** Processing line: ~ "entity_id=",~ +** Processing line: ~ "tick_count=",~ +** Processing line: ~ :global_created_at_elapsed,~ +** Processing line: ~ :load_entity_data!,~ +** Processing line: ~ :meta,~ +** Processing line: ~ :meta!,~ +** Processing line: ~ :new?,~ +** Processing line: ~ :old?,~ +** Processing line: ~ :__original_eq_eq__, :set!,~ +** Processing line: ~ :update_entity_keys_by_ref,~ +** Processing line: ~ :with_meta] +~ +** Processing line: ~ ignores + keys.find_all { |k| k.to_s.to_i.to_s == k.to_s }~ +** Processing line: ~~ +** Processing line: ~ final = (keys - (others.map { |m| m.to_s })).uniq~ +** Processing line: ~ final~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def suggest_autocompletion opts~ +** Processing line: ~ parse_result = autocomplete_parse opts~ +** Processing line: ~ return [] unless parse_result[:cursor_line]~ +** Processing line: ~ text = parse_result[:text]~ +** Processing line: ~ word = parse_result[:word]~ +** Processing line: ~ token = parse_result[:token]~ +** Processing line: ~ dots = parse_result[:dots]~ +** Processing line: ~ dot = parse_result[:dot]~ +** Processing line: ~~ +** Processing line: ~ return [] if word.strip.start_with? "#"~ +** Processing line: ~~ +** Processing line: ~ if word[-1] == "." && token~ +** Processing line: ~ lookup = {~ +** Processing line: ~ 'args' => lambda { $gtk.args.autocomplete_methods },~ +** Processing line: ~ 'inputs' => lambda { $gtk.args.inputs.autocomplete_methods },~ +** Processing line: ~ 'geometry' => lambda { $gtk.args.geometry.autocomplete_methods },~ +** Processing line: ~ 'outputs' => lambda { $gtk.args.outputs.autocomplete_methods },~ +** Processing line: ~ 'layout' => lambda { $gtk.args.layouts.autocomplete_methods },~ +** Processing line: ~ 'keyboard' => lambda { $gtk.args.keyboard.autocomplete_methods },~ +** Processing line: ~ 'key_down' => lambda { $gtk.args.keyboard.key_down.autocomplete_methods },~ +** Processing line: ~ 'key_up' => lambda { $gtk.args.keyboard.key_up.autocomplete_methods },~ +** Processing line: ~ 'state' => lambda { $gtk.args.state.autocomplete_methods },~ +** Processing line: ~ 'fn' => lambda { $gtk.args.fn.autocomplete_methods },~ +** Processing line: ~ '$gtk' => lambda { $gtk.autocomplete_methods },~ +** Processing line: ~ 'gtk' => lambda { $gtk.autocomplete_methods },~ +** Processing line: ~ 'mouse' => lambda { $gtk.args.inputs.mouse.autocomplete_methods },~ +** Processing line: ~ 'click' => lambda { [:x, :y, :point] }~ +** Processing line: ~ }~ +** Processing line: ~~ +** Processing line: ~ lookup_result = lookup[dot]~ +** Processing line: ~~ +** Processing line: ~ return autocomplete_filter_methods lookup_result.call if lookup_result~ +** Processing line: ~~ +** Processing line: ~ start_collecting = false~ +** Processing line: ~ dots_after_state = dots.find_all do |s|~ +** Processing line: ~ if s == "state"~ +** Processing line: ~ start_collecting = true~ +** Processing line: ~ false~ +** Processing line: ~ else~ +** Processing line: ~ start_collecting~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ target = $gtk.args.state~ +** Processing line: ~ dots_after_state.each do |k|~ +** 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: ~ end~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~ text.gsub!("[", " ")~ +** Processing line: ~ text.gsub!("]", " ")~ +** Processing line: ~ text.gsub!("(", " ")~ +** Processing line: ~ text.gsub!(")", " ")~ +** Processing line: ~ text.gsub!(":", "")~ +** Processing line: ~ text.gsub!(".", " ")~ +** Processing line: ~ text.gsub!("=", " ")~ +** Processing line: ~ return (autocomplete_filter_methods (text.split " "),~ +** Processing line: ~ :gtk, :false, :true, :args, :suppress_mailbox, :end)~ +** Processing line: ~ end~ +** Processing line: ~ end # end Autocomplete~ +** Processing line: ~ end # end Runtime~ +** Processing line: ~ end # end GTK~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** 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 @@ -150921,115 +226190,131 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ # pass.solids.each { |s| draw_solid s }~ ** Processing line: ~ # while loops are faster than each with block~ ** Processing line: ~ idx = 0~ +** Processing line: ~ length = pass.solids.length~ ** Processing line: ~ while idx < pass.solids.length~ -** Processing line: ~ draw_solid (pass.solids.value idx) # accessing an array using .value instead of [] is faster~ +** Processing line: ~ draw_solid (pass.solids.at idx) # accessing an array using .value instead of [] is faster~ ** 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: ~ while idx < pass.static_solids.length~ -** Processing line: ~ draw_solid (pass.static_solids.value idx)~ +** 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: ~~ ** Processing line: ~ # pass.sprites.each { |s| draw_sprite s }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.sprites.length~ -** Processing line: ~ draw_sprite (pass.sprites.value idx)~ +** 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: ~~ ** Processing line: ~ # pass.static_sprites.each { |s| draw_sprite s }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.static_sprites.length~ -** Processing line: ~ draw_sprite (pass.static_sprites.value idx)~ +** 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: ~~ ** Processing line: ~ # pass.primitives.each { |p| draw_primitive p }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.primitives.length~ -** Processing line: ~ draw_primitive (pass.primitives.value idx)~ +** 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: ~~ ** Processing line: ~ # pass.static_primitives.each { |p| draw_primitive p }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.static_primitives.length~ -** Processing line: ~ draw_primitive (pass.static_primitives.value idx)~ +** 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: ~ end~ ** Processing line: ~~ ** Processing line: ~ # pass.labels.each { |l| draw_label l }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.labels.length~ -** Processing line: ~ draw_label (pass.labels.value idx)~ +** 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: ~ end~ ** Processing line: ~~ ** Processing line: ~ # pass.static_labels.each { |l| draw_label l }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.static_labels.length~ -** Processing line: ~ draw_label (pass.static_labels.value idx)~ +** 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: ~~ ** Processing line: ~ # pass.lines.each { |l| draw_line l }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.lines.length~ -** Processing line: ~ draw_line (pass.lines.value idx)~ +** 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: ~~ ** 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.value idx)~ +** Processing line: ~ draw_line (pass.static_lines.at idx)~ ** Processing line: ~ idx += 1~ ** Processing line: ~ end~ ** Processing line: ~~ ** Processing line: ~ # pass.borders.each { |b| draw_border b }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.borders.length~ -** Processing line: ~ draw_border (pass.borders.value idx)~ +** 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: ~ end~ ** Processing line: ~~ ** Processing line: ~ # pass.static_borders.each { |b| draw_border b }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.static_borders.length~ -** Processing line: ~ draw_border (pass.static_borders.value idx)~ +** 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: ~~ ** Processing line: ~ if !$gtk.production~ ** Processing line: ~ # pass.debug.each { |r| draw_primitive r }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.debug.length~ -** Processing line: ~ draw_primitive (pass.debug.value idx)~ +** 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: ~~ ** Processing line: ~ # pass.static_debug.each { |r| draw_primitive r }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.static_debug.length~ -** Processing line: ~ draw_primitive (pass.static_debug.value idx)~ +** 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: ~ while idx < pass.reserved.length~ -** Processing line: ~ draw_primitive (pass.reserved.value idx)~ +** 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: ~ end~ ** Processing line: ~~ ** Processing line: ~ # pass.static_reserved.each { |r| draw_primitive r }~ ** Processing line: ~ idx = 0~ -** Processing line: ~ while idx < pass.static_reserved.length~ -** Processing line: ~ draw_primitive (pass.static_reserved.value idx)~ +** 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: ~ end~ ** Processing line: ~ rescue Exception => e~ @@ -151143,10 +226428,119 @@ 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/framerate_diagnostics.rb~ -- H1 detected. +** Processing line: ~*** runtime/framerate.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~runtime/framerate.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/framerate.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/framerate.rb~ +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +** Processing line: ~ # MIT License~ +** Processing line: ~ # framerate.rb has been released under MIT (*only this file*).~ +** Processing line: ~~ +** Processing line: ~ module GTK~ +** Processing line: ~ class Runtime~ +** Processing line: ~ module Framerate~ +** Processing line: ~ def framerate_init~ +** Processing line: ~ @tick_time = Time.new.to_i~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def delta_framerate~ +** Processing line: ~ (current_framerate || 0) - (@previous_framerate || 0)~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def reset_framerate_calculation~ +** Processing line: ~ @tick_speed_sum = 0~ +** Processing line: ~ @tick_speed_count = 0~ +** Processing line: ~ @previous_framerate = 0~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def check_framerate~ +** Processing line: ~ if @framerate_diagnostics_requested~ +** Processing line: ~ log "================================"~ +** Processing line: ~ log framerate_get_diagnostics~ +** Processing line: ~ @framerate_diagnostics_requested = false~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ if !@paused~ +** Processing line: ~ if @tick_time~ +** Processing line: ~ @tick_speed_count += 1~ +** Processing line: ~ @tick_speed_sum += Time.now.to_i - @tick_time~ +** Processing line: ~ if @tick_speed_count > 60 * 2~ +** Processing line: ~ if framerate_below_threshold?~ +** Processing line: ~ @last_framerate = current_framerate~ +** Processing line: ~ if !@console.visible?~ +** Processing line: ~ if !@framerate_important_notification_happened~ +** Processing line: ~ log_important framerate_warning_message~ +** Processing line: ~ else~ +** Processing line: ~ log framerate_warning_message~ +** Processing line: ~ end~ +** Processing line: ~ @framerate_important_notification_happened = true~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ @previous_framerate = current_framerate.floor~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ @tick_time = Time.new.to_i~ +** Processing line: ~ else~ +** Processing line: ~ reset_framerate_calculation~ +** Processing line: ~ end~ +** Processing line: ~ rescue~ +** Processing line: ~ reset_framerate_calculation~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def framerate_diagnostics~ +** Processing line: ~ # request framerate diagnostics to be printed at the end of tick~ +** Processing line: ~ @framerate_diagnostics_requested = true~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def framerate_below_threshold?~ +** Processing line: ~ @last_framerate ||= 60~ +** Processing line: ~ current_framerate < @last_framerate &&~ +** Processing line: ~ current_framerate < 50 &&~ +** Processing line: ~ @previous_framerate > current_framerate &&~ +** Processing line: ~ Kernel.tick_count > 600~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def current_framerate~ +** Processing line: ~ return 60 if !@tick_speed_sum || !@tick_speed_sum~ +** Processing line: ~ r = 100.fdiv(@tick_speed_sum.fdiv(@tick_speed_count) * 100)~ +** Processing line: ~ if (r.nan? || r.infinite? || r > 58)~ +** Processing line: ~ r = 60~ +** Processing line: ~ end~ +** Processing line: ~ r || 60~ +** Processing line: ~ rescue~ +** Processing line: ~ 60~ +** Processing line: ~ end~ +** Processing line: ~ end # module Framerate~ +** Processing line: ~ end # end class Runtime~ +** Processing line: ~ end # end module GTK~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** runtime/framerate_diagnostics.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~runtime/framerate_diagnostics.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/framerate_diagnostics.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -151160,7 +226554,6 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~~ ** Processing line: ~ module GTK~ ** Processing line: ~ class Runtime~ -** Processing line: ~ # @visibility private~ ** Processing line: ~ module FramerateDiagnostics~ ** Processing line: ~ def framerate_get_diagnostics~ ** Processing line: ~ <<-S~ @@ -151329,10 +226722,194 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* string.rb~ -- H1 detected. +** Processing line: ~*** runtime/hotload.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~runtime/hotload.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/hotload.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/hotload.rb~ +** Processing line: ~ # coding: utf-8~ +** Processing line: ~ # Copyright 2019 DragonRuby LLC~ +** Processing line: ~ # MIT License~ +** Processing line: ~ # hotlaod.rb has been released under MIT (*only this file*).~ +** Processing line: ~~ +** Processing line: ~ module GTK~ +** Processing line: ~ class Runtime~ +** Processing line: ~ # @visibility private~ +** Processing line: ~ module Hotload~ +** Processing line: ~ def hotload_init~ +** Processing line: ~ @hotload_if_needed = 0~ +** Processing line: ~ @mailbox_if_needed = 0~ +** Processing line: ~ @file_mtimes = { }~ +** Processing line: ~ @suppress_mailbox = true~ +** Processing line: ~ files_to_reload.each { |f| init_mtimes f }~ +** Processing line: ~ init_mtimes 'app/mailbox.rb'~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def hotload_on_write_file file_name~ +** Processing line: ~ return unless file_name.include? 'mailbox.rb'~ +** Processing line: ~ @mailbox_if_needed = :force~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def files_to_reload~ +** Processing line: ~ if @rcb_release_mode~ +** Processing line: ~ core_files_to_reload + @required_files~ +** Processing line: ~ else~ +** Processing line: ~ [~ +** Processing line: ~ 'dragon/docs.rb',~ +** Processing line: ~ 'dragon/help.rb',~ +** Processing line: ~ 'dragon/kernel_docs.rb',~ +** Processing line: ~ 'dragon/kernel.rb',~ +** Processing line: ~ 'dragon/easing.rb',~ +** Processing line: ~ 'dragon/top_level.rb',~ +** Processing line: ~ 'dragon/log.rb',~ +** Processing line: ~ 'dragon/geometry.rb',~ +** Processing line: ~ 'dragon/attr_gtk.rb',~ +** Processing line: ~ 'dragon/attr_sprite.rb',~ +** Processing line: ~ 'dragon/object.rb',~ +** Processing line: ~ 'dragon/class.rb',~ +** Processing line: ~ 'dragon/string.rb',~ +** Processing line: ~ 'dragon/entity.rb',~ +** Processing line: ~ 'dragon/strict_entity.rb',~ +** Processing line: ~ 'dragon/open_entity.rb',~ +** Processing line: ~ 'dragon/serialize.rb',~ +** Processing line: ~ 'dragon/primitive.rb',~ +** Processing line: ~ 'dragon/nil_class_false_class.rb',~ +** Processing line: ~ 'dragon/symbol.rb',~ +** Processing line: ~ 'dragon/numeric_deprecated.rb',~ +** Processing line: ~ 'dragon/numeric.rb',~ +** Processing line: ~ 'dragon/hash.rb',~ +** Processing line: ~ 'dragon/outputs_deprecated.rb',~ +** Processing line: ~ 'dragon/array_docs.rb',~ +** Processing line: ~ 'dragon/array.rb',~ +** Processing line: ~ 'dragon/outputs.rb',~ +** Processing line: ~ 'dragon/inputs.rb',~ +** Processing line: ~ 'dragon/mouse_docs.rb',~ +** Processing line: ~ 'dragon/recording.rb',~ +** Processing line: ~ 'dragon/grid.rb',~ +** Processing line: ~ 'dragon/layout.rb',~ +** Processing line: ~ 'dragon/args_deprecated.rb',~ +** Processing line: ~ 'dragon/fn.rb',~ +** Processing line: ~ 'dragon/args.rb',~ +** Processing line: ~ 'dragon/console_prompt.rb',~ +** Processing line: ~ 'dragon/console_menu.rb',~ +** Processing line: ~ 'dragon/console.rb',~ +** Processing line: ~ 'dragon/assert.rb',~ +** Processing line: ~ 'dragon/tests.rb',~ +** Processing line: ~ 'dragon/controller_config.rb',~ +** Processing line: ~ 'dragon/runtime/draw.rb',~ +** Processing line: ~ 'dragon/runtime/deprecated.rb',~ +** Processing line: ~ 'dragon/runtime/framerate.rb',~ +** Processing line: ~ 'dragon/runtime/c_bridge.rb',~ +** Processing line: ~ 'dragon/runtime/hotload.rb',~ +** Processing line: ~ 'dragon/runtime/backup.rb',~ +** Processing line: ~ 'dragon/runtime/async_require.rb',~ +** Processing line: ~ 'dragon/runtime/autocomplete.rb',~ +** Processing line: ~ 'dragon/api.rb',~ +** Processing line: ~ 'dragon/runtime.rb',~ +** Processing line: ~ 'dragon/trace.rb',~ +** Processing line: ~ 'dragon/readme_docs.rb',~ +** Processing line: ~ 'dragon/hotload_client.rb',~ +** Processing line: ~ 'dragon/ios_wizard.rb',~ +** Processing line: ~ 'dragon/itch_wizard.rb',~ +** Processing line: ~ ] + core_files_to_reload + @required_files~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def core_files_to_reload~ +** Processing line: ~ [~ +** Processing line: ~ 'repl.rb',~ +** Processing line: ~ 'app/main.rb',~ +** Processing line: ~ 'app/repl.rb',~ +** Processing line: ~ 'app/tests.rb',~ +** Processing line: ~ 'app/test.rb',~ +** Processing line: ~ 'app/stdin.rb'~ +** Processing line: ~ ]~ +** 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: ~ end~ +** Processing line: ~~ +** Processing line: ~ def hotload_source_files~ +** Processing line: ~ @hotload_if_needed += 1~ +** Processing line: ~ return unless @hotload_if_needed == 60~ +** Processing line: ~ @hotload_if_needed = 0~ +** Processing line: ~ files_to_reload.each { |f| reload_if_needed f }~ +** Processing line: ~ console.enable~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def mailbox_timeout~ +** Processing line: ~ if @suppress_mailbox~ +** Processing line: ~ 60~ +** Processing line: ~ else~ +** Processing line: ~ 3~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def check_mailbox~ +** Processing line: ~ if @mailbox_if_needed == :force # lol~ +** Processing line: ~ reload_if_needed 'app/mailbox.rb', true~ +** Processing line: ~ @mailbox_if_needed = 1~ +** Processing line: ~ return~ +** Processing line: ~ end~ +** Processing line: ~ @mailbox_if_needed += 1~ +** Processing line: ~ return unless @mailbox_if_needed.mod_zero? mailbox_timeout~ +** Processing line: ~ @mailbox_if_needed = 1~ +** Processing line: ~ reload_if_needed 'app/mailbox.rb'~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~ def hotload_if_needed~ +** 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: ~ Trace.untrace_classes!~ +** 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: ~ on_load_succeeded file if reload_ruby_file file~ +** Processing line: ~ @file_mtimes[last_key] = @file_mtimes[current_key]~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~ end~ +** Processing line: ~~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** string.rb~ +- H3 detected. +- Determining if line is a header. +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~string.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: ~string.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -151348,7 +226925,7 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ class String~ ** Processing line: ~ include ValueType~ ** Processing line: ~~ -** Processing line: ~ def wrapped_lines_recur word, rest, length, aggregate~ +** Processing line: ~ def self.wrapped_lines_recur word, rest, length, aggregate~ ** Processing line: ~ if word.nil?~ ** Processing line: ~ return aggregate~ ** Processing line: ~ elsif rest[0].nil?~ @@ -151380,9 +226957,8 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ self[0..-2]~ ** Processing line: ~ end~ ** Processing line: ~~ -** Processing line: ~ # @gtk~ -** Processing line: ~ def wrapped_lines length~ -** Processing line: ~ self.each_line.map do |l|~ +** Processing line: ~ def self.wrapped_lines string, length~ +** Processing line: ~ string.each_line.map do |l|~ ** Processing line: ~ l = l.rstrip~ ** Processing line: ~ if l.length < length~ ** Processing line: ~ l + "\n"~ @@ -151393,6 +226969,10 @@ Follows is a source code listing for all files that have been open sourced. This ** Processing line: ~ end.flatten~ ** Processing line: ~ end~ ** Processing line: ~~ +** Processing line: ~ def wrapped_lines length~ +** Processing line: ~ String.wrapped_lines self, length~ +** Processing line: ~ end~ +** Processing line: ~~ ** Processing line: ~ # @gtk~ ** Processing line: ~ def wrap length~ ** Processing line: ~ wrapped_lines(length).join.rstrip~ @@ -151450,10 +227030,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* tests.rb~ -- H1 detected. +** Processing line: ~*** tests.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~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: ~tests.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -151605,10 +227190,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* trace.rb~ -- H1 detected. +** Processing line: ~*** trace.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~trace.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: ~trace.rb~ - Line's tilde count is: 0 - Line contains link marker: false @@ -151805,10 +227395,15 @@ Follows is a source code listing for all files that have been open sourced. This - PRE end detected. ** Processing line: ~~ ** Processing line: ~~ -** Processing line: ~* wizards.rb~ -- H1 detected. +** Processing line: ~*** wizards.rb~ +- H3 detected. - Determining if line is a header. -- Line contains ~* ~... gsub-ing empty string +- Line contains ~*** ~... gsub-ing empty string +- Formatting line: ~wizards.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: ~wizards.rb~ - Line's tilde count is: 0 - Line contains link marker: false diff --git a/docs/site.webmanifest b/docs/site.webmanifest new file mode 100644 index 0000000..45dc8a2 --- /dev/null +++ b/docs/site.webmanifest @@ -0,0 +1 @@ +{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file diff --git a/dragon/args.rb b/dragon/args.rb index 43e6a18..2b11008 100644 --- a/dragon/args.rb +++ b/dragon/args.rb @@ -41,6 +41,8 @@ module GTK # @return [Geometry] attr_accessor :geometry + attr_accessor :fn + # This is where you'll put state associated with your video game. # # @return [OpenEntity] @@ -58,6 +60,10 @@ module GTK attr_accessor :layout + attr_accessor :easing + + attr_accessor :string + def initialize runtime, recording @inputs = Inputs.new @outputs = Outputs.new args: self @@ -72,8 +78,11 @@ module GTK @pixel_arrays = {} @all_tests = [] @geometry = GTK::Geometry + @fn = GTK::Fn @wizards = Wizards.new @layout = GTK::Layout.new @grid.w, @grid.h + @easing = GTK::Easing + @string = String end @@ -224,7 +233,7 @@ module GTK end def autocomplete_methods - [:inputs, :outputs, :gtk, :state, :geometry, :audio, :grid, :layout] + [:inputs, :outputs, :gtk, :state, :geometry, :audio, :grid, :layout, :fn] end end end diff --git a/dragon/assert.rb b/dragon/assert.rb index 67fc0dd..bc21add 100644 --- a/dragon/assert.rb +++ b/dragon/assert.rb @@ -104,6 +104,16 @@ end nil end + def not_equal! actual, expected, message = nil + @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}" + raise message + end + nil + end + =begin Assert if a value is explicitly nil (not false). diff --git a/dragon/attr_sprite.rb b/dragon/attr_sprite.rb index 81701ec..69ddd8c 100644 --- a/dragon/attr_sprite.rb +++ b/dragon/attr_sprite.rb @@ -4,26 +4,35 @@ # @private module AttrRect + include GTK::Geometry + def left - @x + (@x || self.x) end def right - @x + @w + (@x || self.x) + (@w || self.w) end def bottom - @y + (@y || self.y) end def top - @y + @h + (@y || self.y) + (@h || self.h) + end + + def x1 + (@x || self.x) + end + + def y1 + (@y || self.y) end end module AttrSprite include AttrRect - include GTK::Geometry attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :tile_x, :tile_y, :tile_w, :tile_h, :flip_horizontally, @@ -38,18 +47,10 @@ module AttrSprite self end - def x1 - @x - end - def x1= value @x = value end - def y1 - @y - end - def y1= value @y = value end diff --git a/dragon/autocomplete.rb b/dragon/autocomplete.rb index f5f03b4..490d6c9 100644 --- a/dragon/autocomplete.rb +++ b/dragon/autocomplete.rb @@ -60,7 +60,7 @@ module GTK :meta!, :new?, :old?, - :original_eq_eq, :set!, + :__original_eq_eq__, :set!, :update_entity_keys_by_ref, :with_meta] + ignores + keys.find_all { |k| k.to_s.to_i.to_s == k.to_s } @@ -82,20 +82,25 @@ module GTK if word[-1] == "." && token lookup = { - 'args' => lambda { $gtk.args }, - 'inputs' => lambda { $gtk.args.inputs }, - 'outputs' => lambda { $gtk.args.outputs }, - 'layout' => lambda { $gtk.args.outputs }, - 'keyboard' => lambda { $gtk.args.keyboard }, - 'key_down' => lambda { $gtk.args.keyboard.key_down }, - 'key_up' => lambda { $gtk.args.keyboard.key_up }, - 'state' => lambda { $gtk.args.state }, - '$gtk' => lambda { $gtk } + 'args' => lambda { $gtk.args.autocomplete_methods }, + 'inputs' => lambda { $gtk.args.inputs.autocomplete_methods }, + 'geometry' => lambda { $gtk.args.geometry.autocomplete_methods }, + 'outputs' => lambda { $gtk.args.outputs.autocomplete_methods }, + 'layout' => lambda { $gtk.args.layouts.autocomplete_methods }, + 'keyboard' => lambda { $gtk.args.keyboard.autocomplete_methods }, + 'key_down' => lambda { $gtk.args.keyboard.key_down.autocomplete_methods }, + 'key_up' => lambda { $gtk.args.keyboard.key_up.autocomplete_methods }, + 'state' => lambda { $gtk.args.state.autocomplete_methods }, + 'fn' => lambda { $gtk.args.fn.autocomplete_methods }, + '$gtk' => lambda { $gtk.autocomplete_methods }, + 'gtk' => lambda { $gtk.autocomplete_methods }, + 'mouse' => lambda { $gtk.args.inputs.mouse.autocomplete_methods }, + 'click' => lambda { [:x, :y, :point] } } lookup_result = lookup[dot] - return autocomplete_filter_methods lookup_result.call.autocomplete_methods if lookup_result + return autocomplete_filter_methods lookup_result.call if lookup_result start_collecting = false dots_after_state = dots.find_all do |s| diff --git a/dragon/console.rb b/dragon/console.rb index 644f365..c30c311 100644 --- a/dragon/console.rb +++ b/dragon/console.rb @@ -154,7 +154,10 @@ module GTK @visible end - # @gtk + def open reason = nil + show reason + end + def show reason = nil @shown_at = Kernel.global_tick_count @show_reason = reason @@ -524,7 +527,7 @@ S return if !@toggled_at return if slide_progress == 0 - @bottom = h - (h * slide_progress) + @bottom = top - (h * slide_progress) args.outputs.reserved << [left, @bottom, w, h, *@background_color.mult_alpha(slide_progress)].solid args.outputs.reserved << [right.shift_left(110), @bottom.shift_up(630), 100, 100, @logo, 0, (80.0 * slide_progress).to_i].sprite diff --git a/dragon/directional_input_helper_methods.rb b/dragon/directional_input_helper_methods.rb index 0e7c118..a587212 100644 --- a/dragon/directional_input_helper_methods.rb +++ b/dragon/directional_input_helper_methods.rb @@ -54,8 +54,8 @@ S # - ~nil~ which denotes that no directional input exists. # - ~[ 0, 1]~ which denotes that only up is being held/pressed. # - ~[ 0, -1]~ which denotes that only down is being held/pressed. - # - ~[ 0.5, 0.5]~ which denotes that right and up are being pressed/held. - # - ~[-0.5, -0.5]~ which denotes that left and down are being pressed/held. + # - ~[-0.707, 0.707]~ which denotes that right and up are being pressed/held. + # - ~[-0.707, -0.707]~ which denotes that left and down are being pressed/held. # # @gtk def directional_vector @@ -64,7 +64,7 @@ S if lr == 0 && ud == 0 return nil elsif lr.abs == ud.abs - return [lr.half, ud.half] + return [45.vector_x * lr.sign, 45.vector_y * ud.sign, ud.sign] else return [lr, ud] end diff --git a/dragon/docs.rb b/dragon/docs.rb index 148eda8..cc80d7e 100644 --- a/dragon/docs.rb +++ b/dragon/docs.rb @@ -257,8 +257,6 @@ S DragonRuby Game Toolkit Documentation - -
    @@ -407,7 +405,7 @@ S inside_ul = false formatted_html = __docs_line_to_html__ l, parse_log link_id = text_to_id.call l - toc_html += "
  • #{formatted_html}
  • \n" + toc_html += "
  • #{formatted_html}
  • \n" content_html += "

    #{formatted_html}

    \n" elsif l.start_with? "** " parse_log << "- H2 detected." @@ -416,8 +414,8 @@ S inside_ul = false formatted_html = __docs_line_to_html__ l, parse_log link_id = text_to_id.call l - # toc_html += "#{formatted_html}
    \n" - content_html += "

    #{__docs_line_to_html__ l, parse_log}

    \n" + toc_html += "" + content_html += "\n" elsif l.start_with? "*** " parse_log << "- H3 detected." content_html += close_list_if_needed.call inside_ul, inside_ol @@ -425,8 +423,8 @@ S inside_ul = false formatted_html = __docs_line_to_html__ l, parse_log link_id = text_to_id.call l - # toc_html += "#{formatted_html}
    \n" - content_html += "

    #{__docs_line_to_html__ l, parse_log}

    \n" + toc_html += "" + content_html += "\n" elsif l.start_with? "**** " parse_log << "- H4 detected." content_html += close_list_if_needed.call inside_ul, inside_ol @@ -434,7 +432,7 @@ S inside_ul = false formatted_html = __docs_line_to_html__ l, parse_log link_id = text_to_id.call l - # toc_html += "#{formatted_html}
    \n" + # toc_html += "" content_html += "

    #{__docs_line_to_html__ l, parse_log}

    \n" elsif l.strip.length == 0 && !inside_pre # do nothing diff --git a/dragon/easing.rb b/dragon/easing.rb index f503132..ef8ca0c 100644 --- a/dragon/easing.rb +++ b/dragon/easing.rb @@ -5,6 +5,15 @@ module GTK module Easing + def self.ease start_tick, current_tick, duration, *definitions + ease_extended start_tick, + current_tick, + start_tick + duration, + (initial_value *definitions), + (final_value *definitions), + *definitions + end + def self.ease_extended start_tick, current_tick, end_tick, default_before, default_after, *definitions definitions.flatten! definitions = [:identity] if definitions.length == 0 @@ -19,7 +28,12 @@ module GTK y end + def self.ease_spline start_tick, current_tick, duration, spline + ease_spline_extended start_tick, current_tick, start_tick + duration, spline + end + def self.ease_spline_extended start_tick, current_tick, end_tick, spline + return spline[-1][-1] if current_tick >= end_tick duration = end_tick - start_tick t = (current_tick - start_tick).fdiv duration time_allocation_per_curve = 1.fdiv(spline.length) diff --git a/dragon/hotload.rb b/dragon/hotload.rb index 0539ca6..1cb062a 100644 --- a/dragon/hotload.rb +++ b/dragon/hotload.rb @@ -59,6 +59,7 @@ module GTK 'dragon/grid.rb', 'dragon/layout.rb', 'dragon/args_deprecated.rb', + 'dragon/fn.rb', 'dragon/args.rb', 'dragon/console_prompt.rb', 'dragon/console_menu.rb', @@ -74,6 +75,7 @@ module GTK 'dragon/runtime/backup.rb', 'dragon/runtime/async_require.rb', 'dragon/runtime/autocomplete.rb', + 'dragon/api.rb', 'dragon/runtime.rb', 'dragon/trace.rb', 'dragon/readme_docs.rb', diff --git a/dragon/inputs.rb b/dragon/inputs.rb index 5d1727b..0ae4f86 100644 --- a/dragon/inputs.rb +++ b/dragon/inputs.rb @@ -586,6 +586,8 @@ module GTK attr_accessor :moved, :moved_at, :global_moved_at, + :down_at, + :global_down_at, :touch_order, :first_tick_down, :x, :y @@ -594,6 +596,8 @@ module GTK @moved = false @moved_at = 0 @global_moved_at = 0 + @down_at = 0 + @global_down_at = 0 @touch_order = 0 @first_tick_down = true @x = 0 @@ -621,6 +625,9 @@ module GTK result[:touch_order] = @touch_order result[:moved] = @moved result[:moved_at] = @moved_at + result[:global_moved_at] = @global_moved_at + result[:down_at] = @down_at + result[:global_down_at] = @global_down_at result end @@ -651,6 +658,10 @@ module GTK # @gtk attr_reader :mouse + # @return [HTTPRequest[]] + # @gtk + attr_accessor :http_requests + # @return {FingerTouch} # @gtk attr_reader :touch @@ -667,6 +678,7 @@ module GTK @finger_one = nil @finger_two = nil @text = [] + @http_requests = [] end def up @@ -742,6 +754,7 @@ module GTK @keyboard.clear @controllers.each(&:clear) @touch.clear + @http_requests.clear @finger_one = nil @finger_two = nil end diff --git a/dragon/ios_wizard.rb b/dragon/ios_wizard.rb index 77fd703..0d48108 100644 --- a/dragon/ios_wizard.rb +++ b/dragon/ios_wizard.rb @@ -20,21 +20,49 @@ class IOSWizard end def steps + @steps ||= [] + end + + def steps_development_build [ :check_for_xcode, :check_for_brew, :check_for_certs, :check_for_device, :check_for_dev_profile, + :determine_team_identifier, :determine_app_name, :determine_app_id, :blow_away_temp, :stage_app, - :write_info_plist, + :development_write_info_plist, :write_entitlements_plist, - :code_sign, + :compile_icons, + :create_payload_directory, + :code_sign_payload, :create_ipa, - :deploy, + :deploy + ] + end + + def steps_production_build + [ + :check_for_xcode, + :check_for_brew, + :check_for_certs, + :check_for_distribution_profile, + :determine_team_identifier, + :determine_app_name, + :determine_app_id, + :blow_away_temp, + :stage_app, + :production_write_info_plist, + :write_entitlements_plist, + :compile_icons, + :create_payload_directory, + :code_sign_payload, + :create_ipa, + :print_publish_help ] end @@ -53,36 +81,45 @@ class IOSWizard sprite_path end - def start + def start opts = nil + @opts = opts || {} + + if !(@opts.is_a? Hash) || !($gtk.args.fn.eq_any? @opts[:env], :dev, :prod) + raise WizardException.new( + "* $wizards.ios.start needs to be provided an environment option.", + "** For development builds type: $wizards.ios.start env: :dev", + "** For production builds type: $wizards.ios.start env: :prod" + ) + end + + @production_build = (@opts[:env] == :prod) + @steps = steps_development_build + @steps = steps_production_build if @production_build @certificate_name = nil init_wizard_status log_info "Starting iOS Wizard so we can deploy to your device." @start_at = Kernel.global_tick_count steps.each do |m| - begin - result = (send m) || :success if @wizard_status[m][:result] != :success - @wizard_status[m][:result] = result - rescue Exception => e - if e.is_a? WizardException - $console.log.clear - $console.archived_log.clear - log "=" * $console.console_text_width - e.console_primitives.each do |p| - $console.add_primitive p - end - log "=" * $console.console_text_width - else - log_error "Step #{m} failed." - log_error e.to_s - end - - $console.set_command "$wizards.ios.start" - - break + log_info "Running step ~:#{m}~." + result = (send m) || :success if @wizard_status[m][:result] != :success + @wizard_status[m][:result] = result + log_info "Running step ~:#{m}~ complete." + end + nil + rescue Exception => e + if e.is_a? WizardException + $console.log.clear + $console.archived_log.clear + log "=" * $console.console_text_width + e.console_primitives.each do |p| + $console.add_primitive p end + log "=" * $console.console_text_width + else + log_error e.to_s end - return nil + $console.set_command "$wizards.ios.start env: :#{@opts[:env]}" end def always_fail @@ -139,9 +176,31 @@ class IOSWizard start end + def check_for_distribution_profile + @provisioning_profile_path = "profiles/distribution.mobileprovision" + if !($gtk.read_file @provisioning_profile_path) + $gtk.system "mkdir -p #{relative_path}/profiles" + $gtk.system "open #{relative_path}/profiles" + $gtk.system "echo Download the mobile provisioning profile and place it here with the name distribution.mobileprovision > #{relative_path}/profiles/README.txt" + raise WizardException.new( + "* I didn't find a mobile provision.", + "** 1. Go to http://developer.apple.com and click \"Certificates, IDs & Profiles\".", + "** 2. Add an App Identifier.", + "** 3. Select the App IDs option from the list.", + { w: 700, h: 75, path: get_reserved_sprite("identifiers.png") }, + "** 4. Add your Device next. You can use idevice_id -l to get the UUID of your device.", + { w: 365, h: 69, path: get_reserved_sprite("device-link.png") }, + "** 5. Create a Profile. Associate your certs, id, and device.", + { w: 300, h: 122, path: get_reserved_sprite("profiles.png") }, + "** 6. Download the mobile provision and save it to 'profiles/development.mobileprovision'.", + { w: 200, h: 124, path: get_reserved_sprite("profiles-folder.png") }, + ) + end + end + def check_for_dev_profile - @dev_profile_path = "profiles/development.mobileprovision" - if !($gtk.read_file @dev_profile_path) + @provisioning_profile_path = "profiles/development.mobileprovision" + if !($gtk.read_file @provisioning_profile_path) $gtk.system "mkdir -p #{relative_path}/profiles" $gtk.system "open #{relative_path}/profiles" $gtk.system "echo Download the mobile provisioning profile and place it here with the name development.mobileprovision > #{relative_path}/profiles/README.txt" @@ -161,13 +220,23 @@ class IOSWizard end end + def provisioning_profile_path environment + return "profiles/distribution.mobileprovision" if environment == :prod + return "profiles/development.mobileprovision" + end + + def determine_team_identifier + @team_name = (team_identifier_from_provisioning_profile @opts[:env]) + log_info "Team Identifer is: #{@team_name}" + end + def determine_app_name - @app_name = dev_profile_xml[:children].first[:children].first[:children][1][:children].first[:data] + @app_name = (provisioning_profile_xml @opts[:env])[:children].first[:children].first[:children][1][:children].first[:data] log_info "App name is: #{@app_name}." end - def dev_profile_xml - xml = $gtk.read_file 'profiles/development.mobileprovision' + def provisioning_profile_xml environment + xml = $gtk.read_file (provisioning_profile_path environment) scrubbed = xml.each_line.map do |l| if l.strip.start_with? "<" if l.start_with? '' @@ -186,9 +255,36 @@ 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 - # lol - @app_id = dev_profile_xml[:children].first[:children].first[:children][13][:children][1][:children].first[:data] + @app_id = app_id_from_provisioning_profile @opts[:env] + log_info "App Identifier is set to : #{@app_id}" end @@ -202,7 +298,7 @@ class IOSWizard log_error "I couldn't find a development profile at #{path}." ask_for_dev_profile else - @dev_profile_path = path + @provisioning_profile_path = path start end end @@ -269,8 +365,12 @@ class IOSWizard raise "You do not have any Apple development certs on this computer." end - @certificate_name = valid_certs.first[:name] - log_info "I will be using '#{@certificate_name}' to deploy to your device." + if @production_build + @certificate_name = valid_certs.find_all { |f| f[:name].include? "Distribution" }.first[:name] + else + @certificate_name = valid_certs.find_all { |f| f[:name].include? "Development" }.first[:name] + end + log_info "I will be using Certificate: '#{@certificate_name}'." end def idevice_id_cli_app @@ -287,7 +387,7 @@ class IOSWizard def valid_certs certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l| - if l.include?(")") && !l.include?("Developer ID") && l.include?("Development") + if l.include?(")") && !l.include?("Developer ID") && (l.include?("Development") || l.include?("Distribution")) l.strip else nil @@ -314,22 +414,37 @@ class IOSWizard end def write_entitlements_plist - entitlement_plist_string = <<-XML + if @production_build + entitlement_plist_string = <<-XML + + + + + application-identifier + :app_id + beta-reports-active + + + +XML + else + entitlement_plist_string = <<-XML - - application-identifier - :app_id - get-task-allow - - + + application-identifier + :app_id + get-task-allow + + XML + end log_info "Creating Entitlements.plist" - $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", @app_id).strip + $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_name}.#{@app_id}").strip sh "/usr/bin/plutil -convert binary1 \"#{tmp_directory}/Entitlements.plist\"" sh "/usr/bin/plutil -convert xml1 \"#{tmp_directory}/Entitlements.plist\"" @@ -337,19 +452,130 @@ XML @entitlement_plist_written = true end - def code_sign - sh "cp #{@dev_profile_path} \"#{app_path}/embedded.mobileprovision\"" - + def code_sign_payload log_info "Signing app with #{@certificate_name}." - sh "/usr/bin/plutil -convert binary1 \"#{app_path}/Info.plist\"" - - 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\"" + 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}/ipa_root/Payload/#{@app_name}.app\"" + 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}/ipa_root/Payload/#{@app_name}.app/Runtime\"" @code_sign_completed = true end - def write_info_plist + def write_info_plist_distribution + log_info "Adding Info.plist." + + <<-XML + + + + + BuildMachineOSBuild + 20D91 + CFBundleDevelopmentRegion + en + CFBundleName + :app_name + CFBundleDisplayName + A Dark Room + CFBundleIdentifier + :app_id + CFBundleExecutable + :app_name + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + 5.6 + CFBundleSignature + ???? + CFBundleVersion + 5.6 + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconName + AppIcon + CFBundleIconFiles + + AppIcon60x60 + + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconName + AppIcon + CFBundleIconFiles + + AppIcon60x60 + AppIcon76x76 + AppIcon83.5x83.5 + + + + UILaunchStoryboardName + SimpleSplash + UIRequiresFullScreen + + ITSAppUsesNonExemptEncryption + + UIRequiredDeviceCapabilities + + arm64 + + MinimumOSVersion + 10.3 + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleIconFiles + + AppIcon20x20 + AppIcon29x29 + AppIcon40x40 + AppIcon60x60 + + UIDeviceFamily + + 1 + 2 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UIStatusBarStyle + UIStatusBarStyleDefault + UIBackgroundModes + + + DTXcode + 0124 + DTXcodeBuild + 12D4e + DTSDKName + iphoneos14.4 + DTSDKBuild + 18D46 + DTPlatformName + iphoneos + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformVersion + 14.4 + DTPlatformBuild + 18D46 + + +XML + end + + def development_write_info_plist log_info "Adding Info.plist." info_plist_string = <<-XML @@ -372,165 +598,289 @@ XML - BuildMachineOSBuild - 19C57 - CFBundleDevelopmentRegion - en - CFBundleDisplayName - :app_name - CFBundleExecutable - Runtime - CFBundleIconFiles - - AppIcon60x60 - - CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - AppIcon60x60 - - CFBundleIconName - AppIcon - - - CFBundleIcons~ipad - - CFBundlePrimaryIcon - - CFBundleIconFiles - - AppIcon60x60 - AppIcon76x76 - - CFBundleIconName - AppIcon - - - CFBundleIdentifier - :app_id - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - :app_name - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - iPhoneOS - - CFBundleVersion - 1.0 - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 17B102 - DTPlatformName - iphoneos - DTPlatformVersion - 13.2 - DTSDKBuild - 17B102 - DTSDKName - iphoneos13.2 - DTXcode - 01131 - DTXcodeBuild - 11C505 - ITSAppUsesNonExemptEncryption - - MinimumOSVersion - 11.0 - UIAppFonts - - UIBackgroundModes - - UIDeviceFamily - - 1 - 2 - - UILaunchImages - - - UILaunchImageMinimumOSVersion - 11.0 - UILaunchImageName - LaunchImage-1100-Portrait-2436h - UILaunchImageOrientation - Portrait - UILaunchImageSize - {375, 812} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - LaunchImage-800-Portrait-736h - UILaunchImageOrientation - Portrait - UILaunchImageSize - {414, 736} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - LaunchImage-800-667h - UILaunchImageOrientation - Portrait - UILaunchImageSize - {375, 667} - - - UILaunchImageMinimumOSVersion - 7.0 - UILaunchImageName - LaunchImage-700 - UILaunchImageOrientation - Portrait - UILaunchImageSize - {320, 480} - - - UILaunchImageMinimumOSVersion - 7.0 - UILaunchImageName - LaunchImage-700-568h - UILaunchImageOrientation - Portrait - UILaunchImageSize - {320, 568} - - - UILaunchImageMinimumOSVersion - 7.0 - UILaunchImageName - LaunchImage-700-Portrait - UILaunchImageOrientation - Portrait - UILaunchImageSize - {768, 1024} - - - UIRequiredDeviceCapabilities - - arm64 - - UIRequiresFullScreen - - UIStatusBarStyle - UIStatusBarStyleDefault - UISupportedInterfaceOrientations - - #{device_orientation_xml} - + BuildMachineOSBuild + 20D91 + CFBundleDevelopmentRegion + en + CFBundleDisplayName + :app_name + CFBundleExecutable + Runtime + CFBundleIconFiles + + AppIcon60x60 + + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon60x60 + + CFBundleIconName + AppIcon + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon60x60 + AppIcon76x76 + AppIcon83.5x83.5 + + CFBundleIconName + AppIcon + + + CFBundleIdentifier + :app_id + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + :app_name + CFBundlePackageType + APPL + CFBundleShortVersionString + 5.2 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 5.2 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 18D46 + DTPlatformName + iphoneos + DTPlatformVersion + 14.4 + DTSDKBuild + 18D46 + DTSDKName + iphoneos14.4 + DTXcode + 0124 + DTXcodeBuild + 12D4e + MinimumOSVersion + 14.4 + UIAppFonts + + UIBackgroundModes + + UIDeviceFamily + + 1 + 2 + + UILaunchImages + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-568h@2x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {320, 568} + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-667h@2x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {375, 667} + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-736h@3x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {414, 736} + + + UILaunchStoryboardName + SimpleSplash + UIRequiredDeviceCapabilities + + arm64 + + UIRequiresFullScreen + + UIStatusBarStyle + UIStatusBarStyleDefault + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeRight + + + +XML + + # UIInterfaceOrientationPortrait + # UIInterfaceOrientationLandscapeRight + + info_plist_string.gsub!(":app_name", @app_name) + info_plist_string.gsub!(":app_id", @app_id) + + $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip + + @info_plist_written = true + end + + def production_write_info_plist + log_info "Adding Info.plist." + + info_plist_string = <<-XML + + + + + BuildMachineOSBuild + 20D91 + CFBundleDevelopmentRegion + en + CFBundleDisplayName + :app_name + CFBundleExecutable + Runtime + CFBundleIconFiles + + AppIcon60x60 + + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon60x60 + + CFBundleIconName + AppIcon + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon60x60 + AppIcon76x76 + AppIcon83.5x83.5 + + CFBundleIconName + AppIcon + + + CFBundleIdentifier + :app_id + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + :app_name + CFBundlePackageType + APPL + CFBundleShortVersionString + 5.2 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 5.2 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 18D46 + DTPlatformName + iphoneos + DTPlatformVersion + 14.4 + DTSDKBuild + 18D46 + DTSDKName + iphoneos14.4 + DTXcode + 0124 + DTXcodeBuild + 12D4e + MinimumOSVersion + 14.4 + UIAppFonts + + UIBackgroundModes + + UIDeviceFamily + + 1 + 2 + + UILaunchImages + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-568h@2x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {320, 568} + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-667h@2x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {375, 667} + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + Default-736h@3x + UILaunchImageOrientation + Portrait + UILaunchImageSize + {414, 736} + + + UILaunchStoryboardName + SimpleSplash + UIRequiredDeviceCapabilities + + arm64 + + UIRequiresFullScreen + + UIStatusBarStyle + UIStatusBarStyleDefault + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeRight + XML @@ -567,7 +917,9 @@ XML $gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip end - def create_ipa + 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\"" @@ -583,18 +935,11 @@ XML 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\"" + end + + def create_ipa do_zip sh "cp \"#{tmp_directory}/ipa_root/archive.zip\" \"#{tmp_directory}/#{@app_name}.ipa\"" - sh "XCODE_DIR=\"/Applications/Xcode.app/Contents/Developer\" \"#{relative_path}/dragonruby-deploy-ios\" -d \"#{@device_id}\" \"#{tmp_directory}/#{@app_name}.ipa\"" - cmd_result = `ps -e | grep civetweb` - is_civet_running = (`ps -e | grep civetweb`).strip.each_line.to_a.length > 2 - if !is_civet_running - $gtk.system "cp \"#{relative_path}/civetweb\" \"#{tmp_directory}/../src_backup/civetweb\"" - $gtk.system "open \"#{tmp_directory}/../src_backup/civetweb\" -g" - else - log "* INFO: civetweb is running already running. No need to start another instance." - end - log_info "Check your device!!" end def do_zip @@ -617,5 +962,33 @@ SCRIPT end def deploy + sh "XCODE_DIR=\"/Applications/Xcode.app/Contents/Developer\" \"#{relative_path}/dragonruby-deploy-ios\" -d \"#{@device_id}\" \"#{tmp_directory}/#{@app_name}.ipa\"" + log_info "Check your device!!" + 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" + end + + def compile_icons + cmd = <<-S +"/Applications/Xcode.app/Contents/Developer/usr/bin/actool" --output-format human-readable-text \ + --notices --warnings --platform iphoneos \ + --minimum-deployment-target 10.3 \ + --target-device iphone \ + --target-device ipad --app-icon 'AppIcon' \ + --output-partial-info-plist '#{app_path}/AssetCatalog-Info.plist' \ + --compress-pngs --compile "#{app_path}" \ + "#{app_path}/Assets.xcassets" +S + sh cmd + end + + def stage_native_libs + 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 end diff --git a/dragon/keys.rb b/dragon/keys.rb index 9f41fa2..c931aff 100644 --- a/dragon/keys.rb +++ b/dragon/keys.rb @@ -19,7 +19,7 @@ module GTK ].freeze LABELS.each do |label| - attr_reader label + attr label end # Activate a key. diff --git a/dragon/layout.rb b/dragon/layout.rb index 238193d..1b0f8d0 100644 --- a/dragon/layout.rb +++ b/dragon/layout.rb @@ -366,6 +366,11 @@ module GTK result[:row] = opts[:row] result[:col] = opts[:col] + if $gtk.args.grid.name == :center + result[:x] -= 640 + result[:y] -= 360 + end + result end diff --git a/dragon/numeric.rb b/dragon/numeric.rb index 0ee1457..93bacae 100644 --- a/dragon/numeric.rb +++ b/dragon/numeric.rb @@ -7,8 +7,12 @@ class Numeric include ValueType include NumericDeprecated + alias_method :gt, :> alias_method :gte, :>= + alias_method :lt, :< alias_method :lte, :<= + alias_method :__original_eq_eq__, :== unless Numeric.instance_methods.include? :__original_eq_eq__ + # Converts a numeric value representing seconds into frames. # @@ -28,6 +32,23 @@ class Numeric clamp(0, 255).to_i end + def clamp_wrap min, max + max, min = min, max if min > max + return self if self >= min && self <= max + return min if min == max + if self < min + overflow = min - self + return (max - overflow).clamp_wrap min, max + end + + if self > max + overflow = self - max + return (min + overflow).clamp_wrap min, max + end + + return self + end + def elapsed_time tick_count_override = nil (tick_count_override || Kernel.tick_count) - self end @@ -140,16 +161,16 @@ S def randomize *definitions result = self + if definitions.include?(:sign) + result = rand_sign + end + if definitions.include?(:ratio) result = rand * result elsif definitions.include?(:int) result = (rand result) end - - if definitions.include?(:sign) - result = result.rand_sign - end - + result end @@ -414,13 +435,10 @@ S return gt other end - alias_method(:original_eq_eq, :==) unless Numeric.instance_methods.include?(:original_eq_eq) def == other - return true if self.original_eq_eq(other) - if other.is_a?(OpenEntity) - return self.original_eq_eq(other.entity_id) - end - return self.original_eq_eq(other) + return true if __original_eq_eq__ other + return __original_eq_eq__ other.entity_id if other.is_a? OpenEntity + return false end # @gtk @@ -438,6 +456,48 @@ S end end + def each + unless block_given? + raise <<-S +* ERROR: +A block is required for Numeric#each. + +S + end + + self.to_i.times do + yield + end + end + + def times_with_index + unless block_given? + raise <<-S +* ERROR: +A block is required for Numeric#times_with_index. + +S + end + + self.to_i.times.with_index do |i| + yield i + end + end + + def each_with_index + unless block_given? + raise <<-S +* ERROR: +A block is required for Numeric#each_with_index. + +S + end + + self.to_i.times.with_index do |i| + yield i + end + end + # @gtk def map_with_index unless block_given? @@ -453,69 +513,82 @@ S end end - def check_numeric! sender, other - return if other.is_a? Numeric - + def __raise_arithmetic_exception__ other, m, e raise <<-S * ERROR: -Attempted to invoke :+ on #{self} with the right hand argument of: +Attempted to invoke :#{m} on #{self} with the right hand argument of: #{other} The object above is not a Numeric. +#{e} S end def - other return nil unless other - check_numeric! :-, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :-, e end def + other return nil unless other - check_numeric! :+, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :+, e end def * other return nil unless other - check_numeric! :*, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :*, e end def / other return nil unless other - check_numeric! :/, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :/, e end def serialize self end + def self.from_top n + return 720 - n unless $gtk + $gtk.args.grid.top - n + end + def from_top - return 720 - self unless $gtk - $gtk.args.grid.h - self + Numeric.from_top self + end + + def self.from_right n + return 1280 - n unless $gtk + $gtk.args.grid.right - n end def from_right - return 1280 - self unless $gtk - $gtk.args.grid.w - self + Numeric.from_right self + end + + def self.clamp n, min, max + n.clamp min, max end end class Fixnum include ValueType - alias_method(:original_eq_eq, :==) unless Fixnum.instance_methods.include?(:original_eq_eq) - - def - other - return nil unless other - check_numeric! :-, other - super - end + alias_method :__original_eq_eq__, :== unless Fixnum.instance_methods.include? :__original_eq_eq__ + alias_method :__original_add__, :+ unless Fixnum.instance_methods.include? :__original_add__ + alias_method :__original_subtract__, :- unless Fixnum.instance_methods.include? :__original_subtract__ + alias_method :__original_multiply__, :* unless Fixnum.instance_methods.include? :__original_multiply__ + alias_method :__original_divide__, :- unless Fixnum.instance_methods.include? :__original_divide__ # Returns `true` if the numeric value is evenly divisible by 2. # @@ -533,28 +606,36 @@ class Fixnum def + other return nil unless other - check_numeric! :+, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :+, e end def * other return nil unless other - check_numeric! :*, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :*, e end def / other return nil unless other - check_numeric! :/, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :/, e + end + + def - other + return nil unless other + super + rescue Exception => e + __raise_arithmetic_exception__ other, :-, e end def == other - return true if self.original_eq_eq(other) - if other.is_a?(GTK::OpenEntity) - return self.original_eq_eq(other.entity_id) - end - return self.original_eq_eq(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 @@ -607,28 +688,37 @@ end class Float include ValueType + alias_method :__original_add__, :+ unless Float.instance_methods.include? :__original_add__ + alias_method :__original_subtract__, :- unless Float.instance_methods.include? :__original_subtract__ + alias_method :__original_multiply__, :* unless Float.instance_methods.include? :__original_multiply__ + alias_method :__original_divide__, :- unless Float.instance_methods.include? :__original_divide__ + def - other return nil unless other - check_numeric! :-, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :-, e end def + other return nil unless other - check_numeric! :+, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :+, e end def * other return nil unless other - check_numeric! :*, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :*, e end def / other return nil unless other - check_numeric! :/, other super + rescue Exception => e + __raise_arithmetic_exception__ other, :/, e end def serialize @@ -659,9 +749,17 @@ class Float end class Integer - alias_method(:original_round, :round) unless Fixnum.instance_methods.include?(:original_round) + alias_method :__original_round__, :round unless Integer.instance_methods.include? :__original_round__ + alias_method :__original_add__, :+ unless Integer.instance_methods.include? :__original_add__ + alias_method :__original_subtract__, :- unless Integer.instance_methods.include? :__original_subtract__ + alias_method :__original_multiply__, :* unless Integer.instance_methods.include? :__original_multiply__ + alias_method :__original_divide__, :- unless Integer.instance_methods.include? :__original_divide__ def round *args - original_round + __original_round__ + end + + def nan? + false end end diff --git a/dragon/readme_docs.rb b/dragon/readme_docs.rb index 0b5e1a1..020f856 100644 --- a/dragon/readme_docs.rb +++ b/dragon/readme_docs.rb @@ -339,44 +339,6 @@ 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 ~args.output~ anymore. - -* IMPORTANT: Go through all of the sample apps! Study them thoroughly!! No really, you should definitely do this! - -Now that you've completed the Hello World tutorial. Head over to the -`samples` directory. It is very very important that you study the -sample apps thoroughly! Go through them in order. Here is a short -description of each sample app. - -** Guided Samples - -1. ~samples/00_learn_ruby_optional~: This directory contains sample apps that will help you learn the language. -2. ~samples/01_rendering_basics~: This set of samples will show you how to render basic primitives such as ~labels~, ~solids~, ~borders~, ~lines~, ~sprites~, and how to play ~sounds~. -3. ~samples/02_input_basics~: This set of samples show you how to accept input from the ~mouse~, ~keyboard~, and ~controllers~. -4. ~samples/03_rendering_sprites~: This set of samples shows you all the different ways to render sprites (including how to use a sprite sheet). -4. ~samples/04_physics_and_collision~: This set of samples shows how to do various types of collisions and physics. -5. ~samples/05_mouse~: This set of samples show more advanced usages of the mouse. -6. ~samples/06_save_load~: This set of samples show how to save and load game data. -7. ~samples/07_advanced_rendering~: This set of samples show how to programmatically render sprites using render targets. -8. ~samples/08_tweening_lerping_easing_functions~: This set of samples show how to perform animations. -9. ~samples/09_performance~: This set of samples show how to handle performance issues when a large number of sprites on the screen. -10. ~samples/10_advanced_debugging~: This set of samples show how advanced debugging techniques and testing techniques. -11. ~samples/11_http~: This set of samples show how use http. - -** Sample Games - -There are samples that contain the path ~samples/99_*~. The sample apps that are prefixed with ~99_~ show non-trivial implemementations for a real game: - -1. 3D Cube: Shows how to do faux 3D in DragonRuby. -2. Dueling Starships: A two player top-down versus game where each player controls a ship. -3. Flappy Dragon: DragonRuby's clone of Flappy Bird. -4. Pong: A simple implementation of the game Pong. -5. Snakemoji: The classic game of Snake but with all of the code written using emojis (sometimes you just have to have a little fun). -6. Solar System: A simulation of our solar system. -7. Crafting Starting Point: A starting point for those that want to build a crafting game. -8. Dev Tools: A set of sample apps that show how you can extend DragonRuby's Console, starting point for a tile editor, and a starting point for a paint app. -9. LOWREZ: Sample apps that show how to render at different resolutions. -10. RPG: Various sample apps that show how to create narrative, topdown, tactical grid-based, and roguelike RPGs. -11. Platformers: Various sample apps that show how to create different kinds of physics/collision based platformers. S end @@ -514,7 +476,7 @@ 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 unnessary code; creates barriers to rapid prototyping and shipping a game; and +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. DragonRuby's philosophy is to provide multiple options across the "make it @@ -551,7 +513,7 @@ and encouraged within the community. Give what you create away for free to those that can't afford it. If you are gainfully employed, pay full price for the things you use. If you -do end up getting something at a discount, pay the differnce "forward" to +do end up getting something at a discount, pay the difference "forward" to someone else. ** Sustainable And Ethical Open Source @@ -595,7 +557,8 @@ S def docs_ticks_and_frames <<-S -* CHEATSHEET: How To Determine What Frame You Are On +* RECIPIES: +** How To Determine What Frame You Are On There is a property on ~state~ called ~tick_count~ that is incremented by DragonRuby every time the ~tick~ method is called. The following @@ -607,7 +570,7 @@ code renders a label that displays the current ~tick_count~. end #+end_src -* CHEATSHEET: How To Get Current Framerate +** How To Get Current Framerate Current framerate is a top level property on the Game Toolkit Runtime and is accessible via ~args.gtk.current_framerate~. @@ -622,7 +585,7 @@ S def docs_sprites <<-S -* CHEATSHEET: How To Render A Sprite Using An Array +** How To Render A Sprite Using An Array All file paths should use the forward slash ~/~ *not* backslash ~\~. Game Toolkit includes a number of sprites in the ~sprites~ @@ -645,7 +608,7 @@ The following code renders a sprite with a ~width~ and ~height~ of end #+end_src -* CHEATSHEET: More Sprite Properties As An Array +** More Sprite Properties As An Array Here are all the properties you can set on a sprite. @@ -666,7 +629,7 @@ Here are all the properties you can set on a sprite. end #+end_src -* CHEATSHEET: Different Sprite Representations +** Different Sprite Representations Using ordinal positioning can get a little unruly given so many properties you have control over. @@ -736,7 +699,7 @@ S def docs_labels <<-S -* CHEATSHEET: How To Render A Label +** How To Render A Label ~args.outputs.labels~ is used to render labels. @@ -752,7 +715,7 @@ Here is the minimum code: end #+end_src -* CHEATSHEET: A Colored Label +** A Colored Label #+begin_src def tick args @@ -762,7 +725,7 @@ Here is the minimum code: end #+end_src -* CHEATSHEET: Extended Label Properties +** Extended Label Properties #+begin_src def tick args @@ -790,7 +753,7 @@ label's size. An ~ALIGNMENT_ENUM~ of ~0~ represents "left aligned". ~1~ represents "center aligned". ~2~ represents "right aligned". -* CHEATSHEET: Rendering A Label As A ~Hash~ +** Rendering A Label As A ~Hash~ You can add additional metadata about your game within a label, which requires you to use a `Hash` instead. @@ -818,7 +781,7 @@ You can add additional metadata about your game within a label, which requires y end #+end_src -* CHEATSHEET: Getting The Size Of A Piece Of Text +** Getting The Size Of A Piece Of Text You can get the render size of any string using ~args.gtk.calcstringbox~. @@ -843,7 +806,7 @@ S def docs_sounds <<-S -* CHEATSHEET: How To Play A Sound +** How To Play A Sound Sounds that end ~.wav~ will play once: @@ -882,7 +845,7 @@ S def docs_game_state <<-S -* CHEATSHEET: Using ~args.state~ To Store Your Game State +** Using ~args.state~ To Store Your Game State ~args.state~ is a open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of @@ -924,7 +887,7 @@ S def animate_a_sprite <<-S -* CHEATSHEET: How To Animate A Sprite Using Separate PNGs +** How To Animate A Sprite Using Separate PNGs DragonRuby has a property on ~Numeric~ called ~frame_index~ that can be used to determine what frame of an animation to show. Here is an @@ -958,7 +921,7 @@ S def docs_troubleshooting_performance <<-S -* CHEATSHEET: Troubleshoot Performance +** Troubleshoot Performance 1. If you're using ~Array~s for your primitives (~args.outputs.sprites << []~), use ~Hash~ instead (~args.outputs.sprites << { x: ... }~). 2. If you're using ~Entity~ for your primitives (~args.outputs.sprites << args.state.new_entity~), use ~StrictEntity~ instead (~args.outputs.sprites << args.state.new_entity_strict~). @@ -982,7 +945,7 @@ S def scale_sprites <<-S -* CHEATSHEET: How to Scale a Sprite +** How to Scale a Sprite The ~scale_rect~ method can be used to change the scale of a sprite by a given ~ratio~. @@ -1167,7 +1130,7 @@ file called ~repl.rb~ and put it in ~mygame/app/repl.rb~: # use xrepl to "comment out" code xrepl do - puts "This code will not be executed because of the x infront of repl". + puts "This code will not be executed because of the x in front of repl". end #+end_src diff --git a/dragon/remote_hotload_client.rb b/dragon/remote_hotload_client.rb new file mode 100644 index 0000000..87693cd --- /dev/null +++ b/dragon/remote_hotload_client.rb @@ -0,0 +1,193 @@ +# coding: utf-8 +# Copyright 2019 DragonRuby LLC +# MIT License +# hotload_client.rb has been released under MIT (*only this file*). + +module GTK + class RemoteHotloadClient + attr :args + + def gtk + args.gtk + end + + def state + local_state + end + + def initialize local_ip_address + local_state.local_ip_address = local_ip_address + end + + def tick + return unless server_available? + return unless server_needed? + + if should_tick? && server_needed? && !local_state.notified + if server_available? + remote_log "* REMOTE CLIENT INFO: Hotload server found at #{get_server_ip_address}:9001." + end + local_state.notified = true + end + + tick_process_file_retrieval + tick_process_queue + tick_changes + tick_http_boot + end + + def should_tick? + (game_state.tick_count.mod_zero? 60) && game_state.tick_count > 5.seconds + end + + def game_state + args.state + end + + 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.", + changes: { }, + changes_queue: [], + reloaded_files_times: []) + @local_state.hotload_client + end + + def remote_log message + log message + args.gtk.http_post "http://#{get_server_ip_address}:9001/dragon/log/", { message: "=======\n#{message}\n=======\n" }, ["Content-Type: application/x-www-form-urlencoded"] + end + + def get_server_ip_address + return local_state.ip_address if local_state.ip_address + local_state.ip_address ||= ((gtk.read_file 'app/server_ip_address.txt') || "").strip + local_state.ip_address + end + + def server_available? + return false if gtk.platform == 'Emscripten' + get_server_ip_address.length != 0 + end + + def server_needed? + return false if gtk.platform == 'Emscripten' + local_state.local_ip_address != get_server_ip_address + end + + def tick_changes + return unless should_tick? + + local_state.greatest_tick ||= 0 + local_state.last_greatest_tick ||= 0 + + tick_http_changes + end + + def tick_http_boot + return if local_state.booted_at + + + if !local_state.http_boot + # first retrieve changes.txt which has the following format + # file with latest change, + # latest file update_time key + # tmp/src_backup/src_backup_app_main.rb, 1597926596, app/main.rb + local_state.http_boot = args.gtk.http_get "http://#{get_server_ip_address}:9001/dragon/boot/" + elsif local_state.http_boot && local_state.http_boot[:http_response_code] == 200 + local_state.last_greatest_tick = local_state.http_boot[:response_data].strip.to_i + local_state.greatest_tick = local_state.http_boot[:response_data].strip.to_i + local_state.booted_at = local_state.greatest_tick + remote_log '* REMOTE CLIENT INFO: HTTP GET for local_state. boot.txt succeeded.' + remote_log "* REMOTE CLIENT INFO: Looking for changes after: #{local_state.greatest_tick}." + elsif local_state.http_boot && local_state.http_boot[:http_response_code] == -1 && local_state.http_boot[:complete] + remote_log '* REMOTE CLIENT INFO: HTTP GET for boot.txt failed. Retrying.' + local_state.http_boot = nil + end + end + + def tick_http_changes + return unless local_state.booted_at + + if !local_state.http_changes + local_state.http_changes = args.gtk.http_get "http://#{get_server_ip_address}:9001/dragon/changes/" + end + + if local_state.http_changes && local_state.http_changes[:http_response_code] == 200 && local_state.booted_at + local_state.last_greatest_tick = local_state.greatest_tick + # if the retrieval of changes.txt was successful + local_state.http_changes[:response_data].each_line do |l| + if l.strip.length != 0 + # within reload state for that specific changes hash + # set the last time the file was updated + file_name, updated_at, key = l.strip.split(',') + file_name.strip! + updated_at.strip! + key.strip! + updated_at = updated_at.to_i + file_name = file_name.gsub("tmp/src_backup/", "") + + # keep an internal clock that denotes that current time on the + # dev machine + if updated_at > local_state.greatest_tick + local_state.greatest_tick = updated_at + + # create a new entry in change tracking for the file + # for every file where the file was last updated, find all the ones where the time is not the same + # and queue those to be retrieved and required + # if the last time the dev machine time was retrieved is less than the file time changed + # then queue the file for reload + current_updated_at = (local_state.changes[key] || { updated_at: 0 })[:updated_at] + if updated_at > current_updated_at + remote_log "* REMOTE CLIENT INFO: Queueing file #{file_name} for update." + local_state.changes[key] = { key: key, + latest_file: file_name, + updated_at: updated_at } + local_state.changes_queue << local_state.changes[key] + end + end + end + end + + # set the greatest tick/current time of the machine + local_state.http_changes = nil + elsif local_state.http_changes && local_state.http_changes[:http_response_code] == -1 && local_state.http_change[:complete] && local_state.booted_at + local_state.http_changes = nil + end + end + + def tick_process_queue + return if local_state.http_file_changes # don't pop a file off the queue if there is an http request in flight + return if local_state.processing_file_changes # don't pop a file if there is a file currently being processed + return unless local_state.changes_queue.length > 0 # return if the queue is empty + + # if it isn't empty, pop the first file off the queue (FIFO) + local_state.processing_file_changes = local_state.changes_queue.shift + + # create an http request for the file + url = "http://#{get_server_ip_address}:9001/dragon/#{local_state.processing_file_changes[:latest_file]}" + remote_log "* REMOTE CLIENT INFO: Getting new version of #{local_state.processing_file_changes[:latest_file]} (#{url})." + local_state.http_file_changes = args.gtk.http_get url + end + + def tick_process_file_retrieval + return if !local_state.http_file_changes + + # if the http request has finished successfully + if local_state.http_file_changes[:http_response_code] == 200 + file_key = local_state.processing_file_changes[:key] + # notify that a file will be reloaded + remote_log "* REMOTE CLIENT INFO: Loading #{file_key}: #{local_state.processing_file_changes[:latest_file]}" + remote_log "#{local_state.http_file_changes[:response_data]}" + + # write the latest file with what came back from the response data + gtk.write_file "#{file_key}", local_state.http_file_changes[:response_data] + + # nil out the currently processing file so a new item can be processed from the queue + # local_state.reloaded_files_times << local_state.processing_file_changes[:key] + local_state.http_file_changes = nil + local_state.processing_file_changes = nil + end + end + end +end diff --git a/dragon/runtime_docs.rb b/dragon/runtime_docs.rb index 50734ce..5b4d660 100644 --- a/dragon/runtime_docs.rb +++ b/dragon/runtime_docs.rb @@ -4,6 +4,15 @@ # runtime_docs.rb has been released under MIT (*only this file*). module RuntimeDocs + def docs_method_sort_order + [ + :docs_api_summary, + :docs_reset, + :docs_calcstringbox, + :docs_write_file + ] + end + def docs_class <<-S * DOCS: ~GTK::Runtime~ @@ -11,6 +20,476 @@ The GTK::Runtime class is the core of DragonRuby. It is globally accessible via S end + def docs_api_summary + <<-S +* SUMMARY: ~def tick args; end;~ +Most everything you will need to build your game is in the ~args~ parameter that is provided to your ~tick~ method. Follows is a high level summary of each function that is available from ~args~. + +All the properties below hang off of ~args~ and can be accessed in the ~tick~ method: +#+begin_src + def tick args + args.PROPERTY + end +#+end_src +** ~args.state~ +Store your game state inside of this ~state~. Properties with arbitrary nesting is allowed and a backing Entity will be created on your behalf. +#+begin_src + def tick args + args.state.player.x ||= 0 + args.state.player.y ||= 0 + end +#+end_src +*** ~.*.entity_id~ +Entities automatically receive an ~entity_id~ of type ~Fixnum~. +*** ~.*.entity_type~ +Entities can have an ~entity_type~ which is represented as a ~Symbol~. +*** ~.*.created_at~ +Entities have ~created_at~ set to ~args.state.tick_count~ when they are created. +*** ~.*.created_at_elapsed~ +Returns the elapsed number of ticks since creation. +*** ~.*.global_created_at~ +Entities have ~global_created_at~ set to ~Kernel.global_tick_count~ when they are created. +*** ~.*.global_created_at_elapsed~ +Returns the elapsed number of global ticks since creation. +*** ~.*.as_hash~ +Entity cast to a ~Hash~ so you can update values as if you were updating a ~Hash~. +*** ~.new_entity~ +Creates a new Entity with a ~type~, and initial properties. An option block can be passed to change the newly created entity: +#+begin_src ruby + def tick args + args.state.player ||= args.state.new_entity :player, x: 0, y: 0 do |e| + e.max_hp = 100 + e.hp = e.max_hp * rand + end + end +#+end_src +*** ~.new_entity_strict~ +Creates a new Strict Entity. While Entities created via ~args.state.new_entity~ can have new properties added later on, Entities created +using ~args.state.new_entity~ must define all properties that are allowed during its initialization. Attempting to add new properties after +initialization will result in an exception. +*** ~.tick_count~ +Returns the current tick of the game. ~args.state.tick_count~ is ~0~ when the game is first started or if the game is reset via ~$gtk.reset~. +** ~args.inputs~ +Access using input using ~args.inputs~. +*** ~.up~ +Returns ~true~ if: the ~up~ arrow or ~w~ key is pressed or held on the ~keyboard~; or if ~up~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted upwards. +*** ~.down~ +Returns ~true~ if: the ~down~ arrow or ~s~ key is pressed or held on the ~keyboard~; or if ~down~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted downwards. +*** ~.left~ +Returns ~true~ if: the ~left~ arrow or ~a~ key is pressed or held on the ~keyboard~; or if ~left~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the left. +*** ~.right~ +Returns ~true~ if: the ~right~ arrow or ~d~ key is pressed or held on the ~keyboard~; or if ~right~ is pressed or held on ~controller_one~; or if the ~left_analog~ on ~controller_one~ is tilted to the right. +*** ~.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~. +*** ~.text~ OR ~.history~ +Returns a string that represents the last key that was pressed on the keyboard. +*** ~.mouse~ +Represents the user's +**** ~.x~ +Returns the current ~x~ location of the mouse. +**** ~mouse.y~ +Return. +**** ~.inside_rect? rect~ +Return. ~args.inputs.mouse.inside_rect?~ takes in any primitive that responds to ~x, y, w, h~: +**** ~.inside_circle? center_point, radius~ +Returns ~true~ if the mouse is inside of a specified circle. ~args.inputs.mouse.inside_circle?~ takes in any primitive that responds to ~x, y~ (which represents the circle's center), and takes in a ~radius~: +**** ~.moved~ +Returns ~true~ if the mouse has moved on the current frame. +**** ~.button_left~ +Returns ~true~ if the left mouse button is down. +**** ~.button_middle~ +Returns ~true~ if the middle mouse button is down. +**** ~.button_right~ +Returns ~true~ if the right mouse button is down. +**** ~.button_bits~ +Returns a bitmask for all buttons on the mouse: ~1~ for a button in the ~down~ state, ~0~ for a button in the ~up~ state. +**** ~mouse.wheel~ +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. +**** ~.click~ OR ~.down~, ~.previous_click~, ~.up~ +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 +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 +Returns ~true~ if ~up~ is pressed or held on the directional or left analog. +**** ~.down +Returns ~true~ if ~down~ is pressed or held on the directional or left analog. +**** ~.left +Returns ~true~ if ~left~ is pressed or held on the directional or left analog. +**** ~.right +Returns ~true~ if ~right~ is pressed or held on the directional or left analog. +**** ~.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 +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~). +**** ~.left_analog_y_raw|right_analog_y_raw)~ +Returns the raw integer value for the analog's vertical movement (~-32,000 to +32,000~). +**** ~.left_analog_x_perc|right_analog_x_perc)~ +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)~ +Returns ~true~ if ~up~ is pressed or held on the directional. +**** ~.directional_down)~ +Returns ~true~ if ~down~ is pressed or held on the directional. +**** ~.directional_left)~ +Returns ~true~ if ~left~ is pressed or held on the directional. +**** ~.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. +**** ~.truthy_keys~ +Returns a collection of ~Symbol~s that represent all keys that are in the pressed or held state. +**** ~.key_down~ +Returns ~true~ if the specific button was pressed on this frame. ~args.inputs.controller_(one|two).key_down.BUTTON~ will only be true on the frame it was pressed. +**** ~.key_held~ +Returns ~true~ if the specific button is being held. ~args.inputs.controller_(one|two).key_held.BUTTON~ will be true for all frames after ~key_down~ (until released). +**** ~.key_up~ +Returns ~true~ if the specific button was released. ~args.inputs.controller_(one|two).key_up.BUTTON~ will be true only on the frame the button was released. +*** ~.keyboard~ +Represents the user's keyboard +**** ~.up~ +Returns ~true~ if ~up~ or ~w~ is pressed or held on the keyboard. +**** ~.down~ +Returns ~true~ if ~down~ or ~s~ is pressed or held on the keyboard. +**** ~.left~ +Returns ~true~ if ~left~ or ~a~ is pressed or held on the keyboard. +**** ~.right~ +Returns ~true~ if ~right~ or ~d~ is pressed or held on the keyboard. +**** ~.left_right~ +Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.left~ and ~args.inputs.keyboard.right~. +**** ~.up_down~ +Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.keyboard.up~ and ~args.inputs.keyboard.up~. +**** keyboard properties +The following properties represent keys on the keyboard and are available on ~args.inputs.keyboard.KEY~, ~args.inputs.keyboard.key_down.KEY~, ~args.inputs.keyboard.key_held.KEY~, and ~args.inputs.keyboard.key_up.KEY~: +- ~alt~ +- ~meta~ +- ~control~ +- ~shift~ +- ~ctrl_KEY~ (dynamic method, eg ~args.inputs.keyboard.ctrl_a~) +- ~exclamation_point~ +- ~zero~ +- ~one~ +- ~two~ +- ~three~ +- ~four~ +- ~five~ +- ~six~ +- ~seven~ +- ~eight~ +- ~nine~ +- ~backspace~ +- ~delete~ +- ~escape~ +- ~enter~ +- ~tab~ +- ~open_round_brace~ +- ~close_round_brace~ +- ~open_curly_brace~ +- ~close_curly_brace~ +- ~open_square_brace~ +- ~close_square_brace~ +- ~colon~ +- ~semicolon~ +- ~equal_sign~ +- ~hyphen~ +- ~space~ +- ~dollar_sign~ +- ~double_quotation_mark~ +- ~single_quotation_mark~ +- ~backtick~ +- ~tilde~ +- ~period~ +- ~comma~ +- ~pipe~ +- ~underscore~ +- ~a~ +- ~b~ +- ~c~ +- ~d~ +- ~e~ +- ~f~ +- ~g~ +- ~h~ +- ~i~ +- ~j~ +- ~k~ +- ~l~ +- ~m~ +- ~n~ +- ~o~ +- ~p~ +- ~q~ +- ~r~ +- ~s~ +- ~t~ +- ~u~ +- ~v~ +- ~w~ +- ~x~ +- ~y~ +- ~z~ +- ~shift~ +- ~control~ +- ~alt~ +- ~meta~ +- ~left~ +- ~right~ +- ~up~ +- ~down~ +- ~pageup~ +- ~pagedown~ +- ~char~ +- ~plus~ +- ~at~ +- ~forward_slash~ +- ~back_slash~ +- ~asterisk~ +- ~less_than~ +- ~greater_than~ +- ~carat~ +- ~ampersand~ +- ~superscript_two~ +- ~circumflex~ +- ~question_mark~ +- ~section_sign~ +- ~ordinal_indicator~ +- ~raw_key~ +- ~raw_key~ +- ~left_right~ +- ~up_down~ +- ~directional_vector~ +- ~truthy_keys~ +**** ~inputs.keyboard.keys~ +Returns a ~Hash~ with all keys on the keyboard in their respective state. The ~Hash~ contains the following ~keys~ +- ~:down~ +- ~:held~ +- ~:down_or_held~ +- ~:up~ +** ~args.outputs~ +~args.outputs.PROPERTY~ is how you render to the screen. +*** ~.background_color~ +Set ~args.outputs.background_color~ to an ~Array~ with ~RGB~ values (eg. ~[255, 255, 255]~ for the color white). +*** ~.sounds~ +Send a file path to this collection to play a sound. The sound file must be under the ~mygame~ directory. Example: ~args.outputs.sounds << "sounds/jump.wav"~. +*** ~.solids~ +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. +*** ~.static_solids~ +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. +*** ~.sprites~, ~.static_sprites~ +Send a Primitive to this collection to render a sprite to the screen. +*** ~.primitives~, ~.static_primitives~ +Send a Primitive of any type and it'll be rendered. The Primitive must have a ~primitive_marker~ that returns ~:solid~, ~:sprite~, ~:label~, ~:line~, ~:border~. +*** ~.labels~, ~.static_labels~ +Send a Primitive to this collection to render text to the screen. +*** ~.lines~, ~.static_lines~ +Send a Primitive to this collection to render a line to the screen. +*** ~.borders~, ~.static_borders~ +Send a Primitive to this collection to render an unfilled rectangle to the screen. +*** ~.debug~, ~.static_debug~ +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~. +*** ~.inside_rect? rect_1, rect_2~ +Returns ~true~ if ~rect_1~ is inside ~rect_2~. +*** ~.intersect_rect? rect_2, rect_2~ +Returns ~true~ if ~rect_1~ intersects ~rect_2~. +*** ~.scale_rect rect, x_percentage, y_percentage~ +Returns a new rectangle that is scaled by the percentages provided. +*** ~.angle_to start_point, end_point~ +Returns the angle in degrees between two points ~start_point~ to ~end_point~. +*** ~.angle_from start_point, end_point~ +Returns the angle in degrees between two points ~start_point~ from ~end_point~. +*** ~.point_inside_circle? point, circle_center_point, radius~ +Returns ~true~ if a point is inside a circle defined by its center and radius. +*** ~.center_inside_rect rect, other_rect~ +Returns a new rectangle based of off ~rect~ that is centered inside of ~other_rect~. +*** ~.center_inside_rect_x rect, other_rect~ +Returns a new rectangle based of off ~rect~ that is centered horizontally inside of ~other_rect~. +*** ~.center_inside_rect_y rect, other_rect~ +Returns a new rectangle based of off ~rect~ that is centered vertically inside of ~other_rect~. +*** ~.anchor_rect rect, anchor_x, anchor_y~ +Returns a new rectangle based of off ~rect~ that has been repositioned based on the percentages passed into anchor_x, and anchor_y. +*** ~.shift_line line, x, y~ +Returns a line that is offset by ~x~, and ~y~. +*** ~.line_y_intercept line~ +Given a line, the ~b~ value is determined for the point slope form equation: ~y = mx + b~. +*** ~.angle_between_lines line_one, line_two, replace_infinity:~ +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. +*** ~.line_slope line, replace_infinity:~ +Given a line, the ~m~ value is determined for the point slope form equation: ~y = mx + b~. +*** ~.line_rise_run~ +Given a line, a ~Hash~ is returned that returns the slope as ~x~ and ~y~ properties with normalized values (the number is between -1 and 1). +*** ~.ray_test point, line~ +Given a point and a line, ~:on~, ~:left~, or ~:right~ which represents the location of the point relative to the line. +*** ~.line_rect line~ +Returns the bounding rectangle for a line. +*** ~.line_intersect line_one, line_two~ +Returns a point that represents the intersection of the lines. +*** ~.distance point_one, point_two~ +Returns the distance between two points. +*** ~.cubic_bezier t, a, b, c, d~ +Returns the cubic bezier function for tick_count ~t~ with anchors ~a~, ~b~, ~c~, and ~d~. +** ~args.easing~ +A set of functions that allow you to determine the current progression of an easing function. +*** ~.ease start_tick, current_tick, duration, easing_functions~ +Given a start, current, duration, and easing function names, ~ease~ returns a number between 0 and 1 that represents the progress of an easing function. + +The built in easing definitions you have access to are ~:identity~, ~:flip~, ~:quad~, ~:cube~, ~:quart~, and ~:quint~. + +This example will move a box at a linear speed from 0 to 1280. + +#+begin_src ruby + def tick args + start_time = 10 + duration = 60 + current_progress = args.easing.ease start_time, + args.state.tick_count, + duration, + :identity + args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 } + end +#+end_src +*** ~.ease_spline start_tick, current_tick, duration, spline~ +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. + +This example will move a box at a linear speed from 0 to 1280 and then back to 0 using two bezier definitions (represented as an array with four values). + +#+begin_src ruby + def tick args + start_time = 10 + duration = 60 + spline = [ + [ 0, 0.25, 0.75, 1.0], + [1.0, 0.75, 0.25, 0] + ] + current_progress = args.easing.ease_spline start_time, + args.state.tick_count, + duration, + spline + args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 } + end +#+end_src +** ~args.string~ +Useful string functions not included in Ruby core libraries. +*** ~.wrapped_lines string, max_character_length~ +This function will return a collection of strings given an input +~string~ and ~max_character_length~. The collection of strings returned will split the +input string into strings of ~length <= max_character_length~. + +The following example takes a string with new lines and creates a label for each one. +Labels (~args.outputs.labels~) ignore newline characters ~\\n~. + +#+begin_src ruby + def tick args + long_string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nInteger 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 +** ~args.grid~ +Returns the virtual grid for the game. +*** ~.name~ +Returns either ~:origin_bottom_left~ or ~:origin_center~. +*** ~.bottom~ +Returns the ~y~ value that represents the bottom of the grid. +*** ~.top~ +Returns the ~y~ value that represents the top of the grid. +*** ~.left~ +Returns the ~x~ value that represents the left of the grid. +*** ~.right~ +Returns the ~x~ value that represents the right of the grid. +*** ~.rect~ +Returns a rectangle Primitive that represents the grid. +*** ~.origin_bottom_left!~ +Change the grids coordinate system to 0, 0 at the bottom left corner. +*** ~.origin_center!~ +Change the grids coordinate system to 0, 0 at the center of the screen. +*** ~.w~ +Returns the grid's width (always 1280). +*** ~.h~ +Returns the grid's height (always 720). +** ~args.gtk~ +This represents the DragonRuby Game Toolkit's Runtime Environment and can be accessed via ~args.gtk.METHOD~. +*** ~.argv~ +Returns a ~String~ that represents the parameters passed into the ~./dragonruby~ binary. +*** ~.platform~ +Returns a ~String~ representing the operating system the game is running on. +*** ~.request_quit~ +Request that the runtime quit the game. +*** ~.write_file path, contents~ +Writes/overwrites a file within the game directory + path. +*** ~.write_file_root~ +Writes/overwrites a file within the root dragonruby binary directory + path. +*** ~.append_file path, contents~ +Append content to a file located at the game directory + path. +*** ~.append_file_root path, contents~ +Append content to a file located at the root dragonruby binary directory + path. +*** ~.read_file path~ +Reads a file from the sandboxed file system. +*** ~.parse_xml string, parse_xml_file path~ +Returns a ~Hash~ for a ~String~ that represents XML. +*** ~.parse_json string, parse_json_file path~ +Returns a ~Hash~ for a ~String~ that represents JSON. +*** ~.http_get url, extra_headers = {}~ +Creates an async task to perform an HTTP GET. +*** ~.http_post url, form_fields = {}, extra_headers = {}~ +Creates an async task to perform an HTTP POST. +*** ~.reset~ +Resets the game by deleting all data in ~args.state~ and setting ~args.state.tick_count~ back to ~0~. +*** ~.stop_music~ +Stops all background music. +*** ~.calcstringbox str, size_enum, font~ +Returns a tuple with width and height of a string being rendered. +*** ~.slowmo! factor~ +Slows the game down by the factor provided. +*** ~.notify! string~ +Renders a toast message at the bottom of the screen. +*** ~.system~ +Invokes a shell command and prints the result to the console. +*** ~.exec~ +Invokes a shell command and returns a ~String~ that represents the result. +*** ~.save_state~ +Saves the game state to ~game_state.txt~. +*** ~.load_state~ +Load ~args.state~ from ~game_state.txt~. +*** ~.serialize_state file, state~ +Saves entity state to a file. If only one parameter is provided a string is returned for state instead of writing to a file. +*** ~.deserialize_state file~ +Returns entity state from a file or serialization data represented as a ~String~. +*** ~.reset_sprite path~ +Invalids the texture cache of a sprite. +*** ~.show_cursor~ +Shows the mouse cursor. +*** ~.hide_cursor~ +Hides the mouse cursor. +*** ~.cursor_shown?~ +Returns ~true~ if the mouse cursor is shown. +*** ~.set_window_fullscreen enabled~ +Sets the game to either fullscreen (~enabled=true~) or windowed (~enabled=false)~. +*** ~.openurl url~ +Opens a url using the Operating System's default browser. +*** ~.get_base_dir~ +Returns the full path of the DragonRuby binary directory. +*** ~.get_game_dir~ +Returns the full path of the game directory in its sandboxed environment. +S + + end + + + def docs_reset <<-S * DOCS: ~GTK::Runtime#reset~ @@ -35,7 +514,7 @@ S def docs_write_file <<-S * DOCS: ~GTK::Runtime#write_file~ -This function takes in two parameters. The first paramter is the file path and assumes the the game +This function takes in two parameters. The first parameter is the file path and assumes the the game directory is the root. The second parameter is the string that will be written. The method overwrites whatever is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting. diff --git a/dragon/string.rb b/dragon/string.rb index 121c3f3..62c151a 100644 --- a/dragon/string.rb +++ b/dragon/string.rb @@ -6,7 +6,7 @@ class String include ValueType - def wrapped_lines_recur word, rest, length, aggregate + def self.wrapped_lines_recur word, rest, length, aggregate if word.nil? return aggregate elsif rest[0].nil? @@ -38,9 +38,8 @@ S self[0..-2] end - # @gtk - def wrapped_lines length - self.each_line.map do |l| + def self.wrapped_lines string, length + string.each_line.map do |l| l = l.rstrip if l.length < length l + "\n" @@ -51,6 +50,10 @@ S end.flatten end + def wrapped_lines length + String.wrapped_lines self, length + end + # @gtk def wrap length wrapped_lines(length).join.rstrip diff --git a/samples/01_rendering_basics/05_sounds/app/main.rb b/samples/01_rendering_basics/05_sounds/app/main.rb index 28e6503..630ce11 100644 --- a/samples/01_rendering_basics/05_sounds/app/main.rb +++ b/samples/01_rendering_basics/05_sounds/app/main.rb @@ -7,12 +7,6 @@ of available notes. Reminders: - - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual - 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720). - - - args.state.new_entity: Used when we want to create a new object, like a sprite or button. - For example, if we want to create a new button, we would declare it as a new entity and - then define its properties. - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated as Ruby code, and the placeholder is replaced with its corresponding value or result. diff --git a/samples/07_advanced_rendering/08_z_targeting_camera/app/main.rb b/samples/07_advanced_rendering/08_z_targeting_camera/app/main.rb new file mode 100644 index 0000000..ecdbfd3 --- /dev/null +++ b/samples/07_advanced_rendering/08_z_targeting_camera/app/main.rb @@ -0,0 +1,106 @@ +class Game + attr_gtk + + def tick + defaults + render + input + calc + end + + def defaults + outputs.background_color = [219, 208, 191] + player.x ||= 634 + player.y ||= 153 + player.angle ||= 90 + player.distance ||= arena_radius + target.x ||= 634 + target.y ||= 359 + end + + def render + outputs[:scene].sprites << ([0, 0, 933, 700, 'sprites/arena.png'].center_inside_rect grid.rect) + outputs[:scene].sprites << target_sprite + outputs[:scene].sprites << player_sprite + outputs.sprites << scene + end + + def target_sprite + { + x: target.x, y: target.y, + w: 10, h: 10, + path: 'sprites/square/black.png' + }.anchor_rect 0.5, 0.5 + end + + def input + if inputs.up && player.distance > 30 + player.distance -= 2 + elsif inputs.down && player.distance < 200 + player.distance += 2 + end + + player.angle += inputs.left_right * -1 + end + + def calc + player.x = target.x + ((player.angle * 1).vector_x player.distance) + player.y = target.y + ((player.angle * -1).vector_y player.distance) + end + + def player_sprite + { + x: player.x, + y: player.y, + w: 50, + h: 100, + path: 'sprites/player.png', + angle: (player.angle * -1) + 90 + }.anchor_rect 0.5, 0 + end + + def center_map + { x: 634, y: 359 } + end + + def zoom_factor_single + 2 - ((args.geometry.distance player, center_map).fdiv arena_radius) + end + + def zoom_factor + zoom_factor_single ** 2 + end + + def arena_radius + 206 + end + + def scene + { + x: (640 - player.x) + (640 - (640 * zoom_factor)), + y: (360 - player.y - (75 * zoom_factor)) + (320 - (320 * zoom_factor)), + w: 1280 * zoom_factor, + h: 720 * zoom_factor, + path: :scene, + angle: player.angle - 90, + angle_anchor_x: (player.x.fdiv 1280), + angle_anchor_y: (player.y.fdiv 720) + } + end + + def player + state.player + end + + def target + state.target + end +end + +def tick args + $game ||= Game.new + $game.args = args + $game.tick +end + +$gtk.reset diff --git a/samples/07_advanced_rendering/08_z_targeting_camera/metadata/game_metadata.txt b/samples/07_advanced_rendering/08_z_targeting_camera/metadata/game_metadata.txt new file mode 100644 index 0000000..3ad3a1a --- /dev/null +++ b/samples/07_advanced_rendering/08_z_targeting_camera/metadata/game_metadata.txt @@ -0,0 +1,6 @@ +devid=dragonruby +devtitle=DragonRuby LLC +gameid=httpserverexample +gametitle=DragonRuby GTK HTTP Server Example +version=0.1 +icon=metadata/icon.png diff --git a/samples/07_advanced_rendering/08_z_targeting_camera/metadata/icon.png b/samples/07_advanced_rendering/08_z_targeting_camera/metadata/icon.png new file mode 100644 index 0000000..57254fe Binary files /dev/null and b/samples/07_advanced_rendering/08_z_targeting_camera/metadata/icon.png differ diff --git a/samples/07_advanced_rendering/08_z_targeting_camera/sprites/arena.png b/samples/07_advanced_rendering/08_z_targeting_camera/sprites/arena.png new file mode 100644 index 0000000..5c92e91 Binary files /dev/null and b/samples/07_advanced_rendering/08_z_targeting_camera/sprites/arena.png differ diff --git a/samples/07_advanced_rendering/08_z_targeting_camera/sprites/player.png b/samples/07_advanced_rendering/08_z_targeting_camera/sprites/player.png new file mode 100644 index 0000000..332a80b Binary files /dev/null and b/samples/07_advanced_rendering/08_z_targeting_camera/sprites/player.png differ diff --git a/samples/07_advanced_rendering/08_z_targeting_camera/sprites/square/black.png b/samples/07_advanced_rendering/08_z_targeting_camera/sprites/square/black.png new file mode 100644 index 0000000..cea7bd7 Binary files /dev/null and b/samples/07_advanced_rendering/08_z_targeting_camera/sprites/square/black.png differ diff --git a/samples/10_advanced_debugging/03_unit_tests/fn_tests.rb b/samples/10_advanced_debugging/03_unit_tests/fn_tests.rb new file mode 100644 index 0000000..206c89e --- /dev/null +++ b/samples/10_advanced_debugging/03_unit_tests/fn_tests.rb @@ -0,0 +1,180 @@ +def infinity + 1 / 0 +end + +def neg_infinity + -1 / 0 +end + +def nan + 0.0 / 0 +end + +def test_add args, assert + assert.equal! (args.fn.add), 0 + assert.equal! (args.fn.+), 0 + assert.equal! (args.fn.+ 1, 2, 3), 6 + assert.equal! (args.fn.+ 0), 0 + assert.equal! (args.fn.+ 0, nil), 0 + assert.equal! (args.fn.+ 0, nan), nil + assert.equal! (args.fn.+ 0, nil, infinity), nil + assert.equal! (args.fn.+ [1, 2, 3, [4, 5, 6]]), 21 + assert.equal! (args.fn.+ [nil, [4, 5, 6]]), 15 +end + +def test_sub args, assert + neg_infinity = infinity * -1 + assert.equal! (args.fn.+), 0 + assert.equal! (args.fn.- 1, 2, 3), -4 + assert.equal! (args.fn.- 4), -4 + assert.equal! (args.fn.- 4, nan), nil + assert.equal! (args.fn.- 0, nil), 0 + assert.equal! (args.fn.- 0, nil, infinity), nil + assert.equal! (args.fn.- [0, 1, 2, 3, [4, 5, 6]]), -21 + assert.equal! (args.fn.- [nil, 0, [4, 5, 6]]), -15 +end + +def test_div args, assert + assert.equal! (args.fn.div), 1 + assert.equal! (args.fn./), 1 + assert.equal! (args.fn./ 6, 3), 2 + assert.equal! (args.fn./ 6, infinity), nil + assert.equal! (args.fn./ 6, nan), nil + assert.equal! (args.fn./ infinity), nil + assert.equal! (args.fn./ 0), nil + assert.equal! (args.fn./ 6, [3]), 2 +end + +def test_idiv args, assert + assert.equal! (args.fn.idiv), 1 + assert.equal! (args.fn.idiv 7, 3), 2 + assert.equal! (args.fn.idiv 6, infinity), nil + assert.equal! (args.fn.idiv 6, nan), nil + assert.equal! (args.fn.idiv infinity), nil + assert.equal! (args.fn.idiv 0), nil + assert.equal! (args.fn.idiv 7, [3]), 2 +end + +def test_mul args, assert + assert.equal! (args.fn.mul), 1 + assert.equal! (args.fn.*), 1 + assert.equal! (args.fn.* 7, 3), 21 + assert.equal! (args.fn.* 6, nan), nil + assert.equal! (args.fn.* 6, infinity), nil + assert.equal! (args.fn.* infinity), nil + assert.equal! (args.fn.* 0), 0 + assert.equal! (args.fn.* 7, [3]), 21 +end + +def test_lt args, assert + assert.equal! (args.fn.lt 1), 1 + assert.equal! (args.fn.lt), nil + assert.equal! (args.fn.lt infinity), nil + assert.equal! (args.fn.lt nan), nil + assert.equal! (args.fn.lt 10, 9, 8), 8 + assert.equal! (args.fn.< 10, 9, 8), 8 + assert.equal! (args.fn.< [10, 9, [8]]), 8 + assert.equal! (args.fn.< 10, 10), nil +end + +def test_lte args, assert + assert.equal! (args.fn.lte 1), 1 + assert.equal! (args.fn.lte), nil + assert.equal! (args.fn.lte infinity), nil + assert.equal! (args.fn.lte nan), nil + assert.equal! (args.fn.lte 10, 9, 8), 8 + assert.equal! (args.fn.lte 10, 10), 10 + assert.equal! (args.fn.lte 10, 9, [8]), 8 + assert.equal! (args.fn.<= 10, 9, 8), 8 +end + +def test_gt args, assert + assert.equal! (args.fn.gt 1), 1 + assert.equal! (args.fn.gt), nil + assert.equal! (args.fn.gt infinity), nil + assert.equal! (args.fn.gt nan), nil + assert.equal! (args.fn.gt 8, 9, 10), 10 + assert.equal! (args.fn.gt [8, 9, [10]]), 10 + assert.equal! (args.fn.gt 10, 10), nil + assert.equal! (args.fn.gt 10, 10), nil + assert.equal! (args.fn.gt 10, 9), nil + assert.equal! (args.fn.> 8, 9, 10), 10 +end + +def test_gte args, assert + assert.equal! (args.fn.gte 1), 1 + assert.equal! (args.fn.gte), nil + assert.equal! (args.fn.gte infinity), nil + assert.equal! (args.fn.gte nan), nil + assert.equal! (args.fn.gte 8, 9, 10), 10 + assert.equal! (args.fn.gte 10, 10), 10 + assert.equal! (args.fn.gte 8, 9, [10]), 10 + assert.equal! (args.fn.gte 10, 9), nil + assert.equal! (args.fn.>= 8, 9, 10), 10 +end + + +def test_acopy args, assert + orig = [1, 2, 3] + clone = args.fn.acopy orig + assert.equal! clone, [1, 2, 3] + assert.equal! clone, orig + assert.not_equal! clone.object_id, orig.object_id +end + +def test_aget args, assert + assert.equal! (args.fn.aget [:a, :b, :c], 1), :b + assert.equal! (args.fn.aget [:a, :b, :c], nil), nil + assert.equal! (args.fn.aget nil, 1), nil +end + +def test_alength args, assert + assert.equal! (args.fn.alength [:a, :b, :c]), 3 + assert.equal! (args.fn.alength nil), nil +end + +def test_amap args, assert + inc = lambda { |i| i + 1 } + ary = [1, 2, 3] + assert.equal! (args.fn.amap ary, inc), [2, 3, 4] + assert.equal! (args.fn.amap nil, inc), nil + assert.equal! (args.fn.amap ary, nil), nil + assert.equal! (args.fn.amap ary, inc).class, Array +end + +def test_and args, assert + assert.equal! (args.fn.and 1, 2, 3, 4), 4 + assert.equal! (args.fn.and 1, 2, nil, 4), nil + assert.equal! (args.fn.and), true +end + +def test_or args, assert + assert.equal! (args.fn.or 1, 2, 3, 4), 1 + assert.equal! (args.fn.or 1, 2, nil, 4), 1 + assert.equal! (args.fn.or), nil + assert.equal! (args.fn.or nil, nil, false, 5, 10), 5 +end + +def test_eq_eq args, assert + assert.equal! (args.fn.eq?), true + assert.equal! (args.fn.eq? 1, 0), false + assert.equal! (args.fn.eq? 1, 1, 1), true + assert.equal! (args.fn.== 1, 1, 1), true + assert.equal! (args.fn.== nil, nil), true +end + +def test_apply args, assert + assert.equal! (args.fn.and [nil, nil, nil]), [nil, nil, nil] + assert.equal! (args.fn.apply [nil, nil, nil], args.fn.method(:and)), nil + and_lambda = lambda {|*xs| args.fn.and(*xs)} + assert.equal! (args.fn.apply [nil, nil, nil], and_lambda), nil +end + +def test_areduce args, assert + assert.equal! (args.fn.areduce [1, 2, 3], 0, lambda { |i, a| i + a }), 6 +end + +def test_array_hash args, assert + assert.equal! (args.fn.array_hash :a, 1, :b, 2), { a: 1, b: 2 } + assert.equal! (args.fn.array_hash), { } +end diff --git a/samples/10_advanced_debugging/03_unit_tests/nil_coercion_tests.rb b/samples/10_advanced_debugging/03_unit_tests/nil_coercion_tests.rb new file mode 100644 index 0000000..dac14b4 --- /dev/null +++ b/samples/10_advanced_debugging/03_unit_tests/nil_coercion_tests.rb @@ -0,0 +1,92 @@ +# numbers +def test_open_entity_add_number args, assert + assert.nil! args.state.i_value + args.state.i_value += 5 + assert.equal! args.state.i_value, 5 + + assert.nil! args.state.f_value + args.state.f_value += 5.5 + assert.equal! args.state.f_value, 5.5 +end + +def test_open_entity_subtract_number args, assert + assert.nil! args.state.i_value + args.state.i_value -= 5 + assert.equal! args.state.i_value, -5 + + assert.nil! args.state.f_value + args.state.f_value -= 5.5 + assert.equal! args.state.f_value, -5.5 +end + +def test_open_entity_multiply_number args, assert + assert.nil! args.state.i_value + args.state.i_value *= 5 + assert.equal! args.state.i_value, 0 + + assert.nil! args.state.f_value + args.state.f_value *= 5.5 + assert.equal! args.state.f_value, 0 +end + +def test_open_entity_divide_number args, assert + assert.nil! args.state.i_value + args.state.i_value /= 5 + assert.equal! args.state.i_value, 0 + + assert.nil! args.state.f_value + args.state.f_value /= 5.5 + assert.equal! args.state.f_value, 0 +end + +# array +def test_open_entity_add_array args, assert + assert.nil! args.state.values + args.state.values += [:a, :b, :c] + assert.equal! args.state.values, [:a, :b, :c] +end + +def test_open_entity_subtract_array args, assert + assert.nil! args.state.values + args.state.values -= [:a, :b, :c] + assert.equal! args.state.values, [] +end + +def test_open_entity_shovel_array args, assert + assert.nil! args.state.values + args.state.values << :a + assert.equal! args.state.values, [:a] +end + +def test_open_entity_enumerate args, assert + assert.nil! args.state.values + args.state.values = args.state.values.map_with_index { |i| i } + assert.equal! args.state.values, [] + + assert.nil! args.state.values_2 + args.state.values_2 = args.state.values_2.map { |i| i } + assert.equal! args.state.values_2, [] + + assert.nil! args.state.values_3 + args.state.values_3 = args.state.values_3.flat_map { |i| i } + assert.equal! args.state.values_3, [] +end + +# hashes +def test_open_entity_indexer args, assert + GTK::Entity.__reset_id__! + assert.nil! args.state.values + args.state.values[:test] = :value + assert.equal! args.state.values.to_s, { entity_id: 1, entity_name: :values, entity_keys_by_ref: {}, test: :value }.to_s +end + +# bug +def test_open_entity_nil_bug args, assert + GTK::Entity.__reset_id__! + args.state.foo.a + args.state.foo.b + @hello[:foobar] + assert.nil! args.state.foo.a, "a was not nil." + # the line below fails + # assert.nil! args.state.foo.b, "b was not nil." +end diff --git a/samples/11_http/02_web_server/app/main.rb b/samples/11_http/02_web_server/app/main.rb new file mode 100644 index 0000000..545a855 --- /dev/null +++ b/samples/11_http/02_web_server/app/main.rb @@ -0,0 +1,27 @@ +def tick args + args.state.port ||= 3000 + # by default the embedded webserver runs on port 9001 (the port number is over 9000) and is disabled in a production build + # to enable the http server in a production build, you need to manually start + # the server up: + args.gtk.start_server! port: args.state.port, enable_in_prod: true + args.outputs.background_color = [0, 0, 0] + args.outputs.labels << [640, 600, "Point your web browser at http://localhost:#{args.state.port}/", 10, 1, 255, 255, 255] + + args.inputs.http_requests.each { |req| + puts("METHOD: #{req.method}"); + puts("URI: #{req.uri}"); + puts("HEADERS:"); + req.headers.each { |k,v| puts(" #{k}: #{v}") } + + if (req.uri == '/') + # headers and body can be nil if you don't care about them. + # If you don't set the Content-Type, it will default to + # "text/html; charset=utf-8". + # Don't set Content-Length; we'll ignore it and calculate it for you + args.state.reqnum += 1 + req.respond 200, "hello

    This #{req.method} was request number #{args.state.reqnum}!

    \n", { 'X-DRGTK-header' => 'Powered by DragonRuby!' } + else + req.reject + end + } +end diff --git a/samples/11_http/02_web_server/license-for-sample.txt b/samples/11_http/02_web_server/license-for-sample.txt new file mode 100644 index 0000000..175ac25 --- /dev/null +++ b/samples/11_http/02_web_server/license-for-sample.txt @@ -0,0 +1,9 @@ +Copyright 2021 DragonRuby LLC + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/samples/11_http/02_web_server/metadata/game_metadata.txt b/samples/11_http/02_web_server/metadata/game_metadata.txt new file mode 100644 index 0000000..3ad3a1a --- /dev/null +++ b/samples/11_http/02_web_server/metadata/game_metadata.txt @@ -0,0 +1,6 @@ +devid=dragonruby +devtitle=DragonRuby LLC +gameid=httpserverexample +gametitle=DragonRuby GTK HTTP Server Example +version=0.1 +icon=metadata/icon.png diff --git a/samples/11_http/02_web_server/metadata/icon.png b/samples/11_http/02_web_server/metadata/icon.png new file mode 100644 index 0000000..57254fe Binary files /dev/null and b/samples/11_http/02_web_server/metadata/icon.png differ diff --git a/samples/13_path_finding_algorithms/09_tower_defense/app/main.rb b/samples/13_path_finding_algorithms/09_tower_defense/app/main.rb new file mode 100644 index 0000000..5b6a127 --- /dev/null +++ b/samples/13_path_finding_algorithms/09_tower_defense/app/main.rb @@ -0,0 +1,301 @@ +# 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 + +# The turrets shoot bullets at the closest tank. The bullets are heat-seeking + +def tick args + $gtk.reset if args.inputs.keyboard.key_down.r + defaults args + render args + calc args +end + +def defaults args + args.outputs.background_color = wall_color + args.state.grid_size = 5 + args.state.tile_size = 50 + args.state.grid_start ||= [0, 0] + args.state.grid_goal ||= [4, 4] + + # Try editing these walls to see the path change! + args.state.walls ||= { + [0, 4] => true, + [1, 3] => true, + [3, 1] => true, + # [4, 0] => true, + } + + args.state.a_star.frontier ||= [] + args.state.a_star.came_from ||= {} + args.state.a_star.path ||= [] + + args.state.tanks ||= [] + args.state.tank_spawn_period ||= 60 + args.state.tank_sprite_path ||= 'sprites/circle/white.png' + args.state.tank_speed ||= 1 + + args.state.turret_shoot_period = 10 + # Turrets can be entered as [x, y] but are immediately mapped to hashes + # Walls are also added where the turrets are to prevent tanks from pathing over them + args.state.turrets ||= [ + [2, 2] + ].each { |turret| args.state.walls[turret] = true}.map do |x, y| + { + x: x * args.state.tile_size, + y: y * args.state.tile_size, + w: args.state.tile_size, + h: args.state.tile_size, + path: 'sprites/circle/gray.png', + range: 100 + } + end + + args.state.bullet_size ||= 25 + args.state.bullets ||= [] + args.state.bullet_path ||= 'sprites/circle/orange.png' + # +end + +def render args + render_grid args + render_a_star args + args.outputs.sprites << args.state.tanks + args.outputs.sprites << args.state.turrets + args.outputs.sprites << args.state.bullets +end + +def render_grid args + # Draw a square the size and color of the grid + args.outputs.solids << [ + 0, + 0, + args.state.grid_size * args.state.tile_size, + args.state.grid_size * args.state.tile_size, + grid_color + ] + + # Draw lines across the grid to show tiles + (args.state.grid_size + 1).times do | value | + render_horizontal_line(args, value) + render_vertical_line(args, value) + end + + # Render special tiles + render_tile(args, args.state.grid_start, start_color) + render_tile(args, args.state.grid_goal, goal_color) + args.state.walls.keys.each { |wall| render_tile(args, wall, wall_color) } +end + +def render_vertical_line args, x + args.outputs.lines << [ + x * args.state.tile_size, + 0, + x * args.state.tile_size, + args.state.tile_size * args.state.grid_size, + ] +end + +def render_horizontal_line args, y + args.outputs.lines << [ + 0, + y * args.state.tile_size, + args.state.tile_size * args.state.grid_size, + y * args.state.tile_size, + ] +end + +def render_tile args, tile, color + args.outputs.solids << [ + tile.x * args.state.tile_size, + tile.y * args.state.tile_size, + args.state.tile_size, + args.state.tile_size, + color + ] +end + +def calc args + calc_a_star args + calc_tanks args + calc_turrets args + calc_bullets args +end + +def calc_a_star args + # Only does this one time + return unless args.state.a_star.path.empty? + + # Start the search from the grid start + args.state.a_star.frontier << args.state.grid_start + args.state.a_star.came_from[args.state.grid_start] = nil + + # Until a path to the goal has been found or there are no more tiles to explore + until (args.state.a_star.came_from.has_key?(args.state.grid_goal)|| args.state.a_star.frontier.empty?) + # For the first tile in the frontier + tile_to_expand_from = args.state.a_star.frontier.shift + # Add each of its neighbors to the frontier + neighbors(args, tile_to_expand_from).each do | tile | + args.state.a_star.frontier << tile + args.state.a_star.came_from[tile] = tile_to_expand_from + end + end + + # Stop calculating a path if the goal was never reached + return unless args.state.a_star.came_from.has_key? args.state.grid_goal + + # Fill path by tracing back from the goal + current_cell = args.state.grid_goal + while current_cell + args.state.a_star.path.unshift current_cell + current_cell = args.state.a_star.came_from[current_cell] + end + + puts "The path has been calculated" + puts args.state.a_star.path +end + +def calc_tanks args + spawn_tank args + move_tanks args +end + +def move_tanks args + # Remove tanks that have reached the end of their path + args.state.tanks.reject! { |tank| tank[:a_star].empty? } + + # Tanks have an array that has each tile it has to go to in order from a* path + args.state.tanks.each do | tank | + destination = tank[:a_star][0] + # Move the tank towards the destination + tank[:x] += copy_sign(args.state.tank_speed, ((destination.x * args.state.tile_size) - tank[:x])) + tank[:y] += copy_sign(args.state.tank_speed, ((destination.y * args.state.tile_size) - tank[:y])) + # If the tank has reached its destination + if (destination.x * args.state.tile_size) == tank[:x] and + (destination.y * args.state.tile_size) == tank[:y] + # Set the destination to the next point in the path + tank[:a_star].shift + end + end +end + +def calc_turrets args + return unless args.state.tick_count.mod_zero? args.state.turret_shoot_period + args.state.turrets.each do | turret | + # Finds the closest tank + target = nil + shortest_distance = turret[:range] + 1 + args.state.tanks.each do | tank | + distance = distance_between(turret[:x], turret[:y], tank[:x], tank[:y]) + if distance < shortest_distance + target = tank + shortest_distance = distance + end + end + # If there is a tank in range, fires a bullet + if target + args.state.bullets << { + x: turret[:x], + y: turret[:y], + w: args.state.bullet_size, + h: args.state.bullet_size, + path: args.state.bullet_path, + # Note that this makes it heat-seeking, because target is passed by reference + # Could do target.clone to make the bullet go to where the tank initially was + target: target + } + end + end +end + +def calc_bullets args + # Bullets aim for the center of their targets + args.state.bullets.each { |bullet| move bullet, center_of(bullet[:target])} + args.state.bullets.reject! { |b| b.intersect_rect? b[:target] } +end + +def center_of object + object = object.clone + object[:x] += 0.5 + object[:y] += 0.5 + object +end + +def render_a_star args + args.state.a_star.path.map do |tile| + # Map each x, y coordinate to the center of the tile and scale up + [(tile.x + 0.5) * args.state.tile_size, (tile.y + 0.5) * args.state.tile_size] + end.inject do | point_a, point_b | + # Render the line between each point + args.outputs.lines << [point_a.x, point_a.y, point_b.x, point_b.y, a_star_color] + point_b + end +end + +# Moves object to target at speed +def move object, target, speed = 1 + if target.is_a? Hash + object[:x] += copy_sign(speed, target[:x] - object[:x]) + object[:y] += copy_sign(speed, target[:y] - object[:y]) + else + object[:x] += copy_sign(speed, target.x - object[:x]) + object[:y] += copy_sign(speed, target.y - object[:y]) + end +end +# +# +def distance_between a_x, a_y, b_x, b_y + (((b_x - a_x) ** 2) + ((b_y - a_y) ** 2)) ** 0.5 +end + +def copy_sign value, sign + return 0 if sign == 0 + return value if sign > 0 + -value +end +# +def spawn_tank args + return unless args.state.tick_count.mod_zero? args.state.tank_spawn_period + args.state.tanks << { + x: args.state.grid_start.x, + y: args.state.grid_start.y, + w: args.state.tile_size, + h: args.state.tile_size, + path: args.state.tank_sprite_path, + a_star: args.state.a_star.path.clone + } +end + +def neighbors args, tile + [[tile.x, tile.y - 1], + [tile.x, tile.y + 1], + [tile.x + 1, tile.y], + [tile.x - 1, tile.y]].reject do | neighbor | + args.state.a_star.came_from.has_key?(neighbor) or + tile_out_of_bounds?(args, neighbor) or + args.state.walls.has_key? neighbor + end +end + +def tile_out_of_bounds? args, tile + tile.x < 0 or tile.y < 0 or tile.x >= args.state.grid_size or tile.y >= args.state.grid_size +end + +def grid_color + [133, 226, 144] +end + +def start_color + [226, 144, 133] +end + +def goal_color + [226, 133, 144] +end + +def wall_color + [133, 144, 226] +end + +def a_star_color + [0, 0, 255] +end diff --git a/samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/gray.png b/samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/gray.png new file mode 100644 index 0000000..960f191 Binary files /dev/null and b/samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/gray.png differ diff --git a/samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/orange.png b/samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/orange.png new file mode 100644 index 0000000..5604a42 Binary files /dev/null and b/samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/orange.png differ diff --git a/samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/white.png b/samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/white.png new file mode 100644 index 0000000..bd32155 Binary files /dev/null and b/samples/13_path_finding_algorithms/09_tower_defense/sprites/circle/white.png differ diff --git a/samples/13_path_finding_algorithms/09_tower_defense/tower_defence.gif b/samples/13_path_finding_algorithms/09_tower_defense/tower_defence.gif new file mode 100644 index 0000000..80120b7 Binary files /dev/null and b/samples/13_path_finding_algorithms/09_tower_defense/tower_defence.gif differ diff --git a/samples/99_genre_arcade/bullet_hell/app/main.rb b/samples/99_genre_arcade/bullet_hell/app/main.rb new file mode 100644 index 0000000..aac6de7 --- /dev/null +++ b/samples/99_genre_arcade/bullet_hell/app/main.rb @@ -0,0 +1,189 @@ +def tick args + args.state.base_columns ||= 10.times.map { |n| 50 * n + 1280 / 2 - 5 * 50 + 5 } + args.state.base_rows ||= 5.times.map { |n| 50 * n + 720 - 5 * 50 } + args.state.offset_columns = 10.times.map { |n| (n - 4.5) * Math.sin(Kernel.tick_count.to_radians) * 12 } + args.state.offset_rows = 5.map { 0 } + args.state.columns = 10.times.map { |i| args.state.base_columns[i] + args.state.offset_columns[i] } + args.state.rows = 5.times.map { |i| args.state.base_rows[i] + args.state.offset_rows[i] } + args.state.explosions ||= [] + args.state.enemies ||= [] + args.state.score ||= 0 + args.state.wave ||= 0 + if args.state.enemies.empty? + args.state.wave += 1 + args.state.wave_root = Math.sqrt(args.state.wave) + args.state.enemies = make_enemies + end + args.state.player ||= {x: 620, y: 80, w: 40, h: 40, path: 'sprites/circle-gray.png', angle: 90, cooldown: 0, alive: true} + args.state.enemy_bullets ||= [] + args.state.player_bullets ||= [] + args.state.lives ||= 3 + args.state.missed_shots ||= 0 + args.state.fired_shots ||= 0 + + update_explosions args + update_enemy_positions args + + if args.inputs.left && args.state.player[:x] > (300 + 5) + args.state.player[:x] -= 5 + end + if args.inputs.right && args.state.player[:x] < (1280 - args.state.player[:w] - 300 - 5) + args.state.player[:x] += 5 + end + + args.state.enemy_bullets.each do |bullet| + bullet[:x] += bullet[:dx] + bullet[:y] += bullet[:dy] + end + args.state.player_bullets.each do |bullet| + bullet[:x] += bullet[:dx] + bullet[:y] += bullet[:dy] + end + + args.state.enemy_bullets = args.state.enemy_bullets.find_all { |bullet| bullet[:y].between?(-16, 736) } + args.state.player_bullets = args.state.player_bullets.find_all do |bullet| + if bullet[:y].between?(-16, 736) + true + else + args.state.missed_shots += 1 + false + end + end + + args.state.enemies = args.state.enemies.reject do |enemy| + if args.state.player[:alive] && 1500 > (args.state.player[:x] - enemy[:x]) ** 2 + (args.state.player[:y] - enemy[:y]) ** 2 + args.state.explosions << {x: enemy[:x] + 4, y: enemy[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} + args.state.explosions << {x: args.state.player[:x] + 4, y: args.state.player[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} + args.state.player[:alive] = false + true + else + false + end + end + args.state.enemy_bullets.each do |bullet| + if args.state.player[:alive] && 400 > (args.state.player[:x] - bullet[:x] + 12) ** 2 + (args.state.player[:y] - bullet[:y] + 12) ** 2 + args.state.explosions << {x: args.state.player[:x] + 4, y: args.state.player[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} + args.state.player[:alive] = false + bullet[:despawn] = true + end + end + args.state.enemies = args.state.enemies.reject do |enemy| + args.state.player_bullets.any? do |bullet| + if 400 > (enemy[:x] - bullet[:x] + 12) ** 2 + (enemy[:y] - bullet[:y] + 12) ** 2 + args.state.explosions << {x: enemy[:x] + 4, y: enemy[:y] + 4, w: 32, h: 32, path: 'sprites/explosion-0.png', age: 0} + bullet[:despawn] = true + args.state.score += 1000 * args.state.wave + true + else + false + end + end + end + + args.state.player_bullets = args.state.player_bullets.reject { |bullet| bullet[:despawn] } + args.state.enemy_bullets = args.state.enemy_bullets.reject { |bullet| bullet[:despawn] } + + args.state.player[:cooldown] -= 1 + if args.inputs.keyboard.key_held.space && args.state.player[:cooldown] <= 0 && args.state.player[:alive] + args.state.player_bullets << {x: args.state.player[:x] + 12, y: args.state.player[:y] + 28, w: 16, h: 16, path: 'sprites/star.png', dx: 0, dy: 8}.sprite + args.state.fired_shots += 1 + args.state.player[:cooldown] = 10 + 20 / args.state.wave + end + args.state.enemies.each do |enemy| + if Math.rand < 0.0005 + 0.0005 * args.state.wave && args.state.player[:alive] && enemy[:move_state] == :normal + args.state.enemy_bullets << {x: enemy[:x] + 12, y: enemy[:y] - 8, w: 16, h: 16, path: 'sprites/star.png', dx: 0, dy: -3 - args.state.wave_root}.sprite + end + end + + args.outputs.background_color = [0, 0, 0] + args.outputs.primitives << args.state.enemies.map do |enemy| + [enemy[:x], enemy[:y], 40, 40, enemy[:path], -90].sprite + end + args.outputs.primitives << args.state.player if args.state.player[:alive] + args.outputs.primitives << args.state.explosions + args.outputs.primitives << args.state.player_bullets + args.outputs.primitives << args.state.enemy_bullets + accuracy = args.state.fired_shots.zero? ? 1 : (args.state.fired_shots - args.state.missed_shots) / args.state.fired_shots + args.outputs.primitives << [ + [0, 0, 300, 720, 96, 0, 0].solid, + [1280 - 300, 0, 300, 720, 96, 0, 0].solid, + [1280 - 290, 60, "Wave #{args.state.wave}", 255, 255, 255].label, + [1280 - 290, 40, "Accuracy #{(accuracy * 100).floor}%", 255, 255, 255].label, + [1280 - 290, 20, "Score #{(args.state.score * accuracy).floor}", 255, 255, 255].label, + ] + args.outputs.primitives << args.state.lives.times.map do |n| + [1280 - 290 + 50 * n, 80, 40, 40, 'sprites/circle-gray.png', 90].sprite + end + #args.outputs.debug << args.gtk.framerate_diagnostics_primitives + + if (!args.state.player[:alive]) && args.state.enemy_bullets.empty? && args.state.explosions.empty? && args.state.enemies.all? { |enemy| enemy[:move_state] == :normal } + args.state.player[:alive] = true + args.state.player[:x] = 624 + args.state.player[:y] = 80 + args.state.lives -= 1 + if args.state.lives == -1 + args.state.clear! + end + end +end + +def make_enemies + enemies = [] + enemies += 10.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 0, col: n, path: 'sprites/circle-orange.png', move_state: :retreat} } + enemies += 10.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 1, col: n, path: 'sprites/circle-orange.png', move_state: :retreat} } + enemies += 8.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 2, col: n + 1, path: 'sprites/circle-blue.png', move_state: :retreat} } + enemies += 8.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 3, col: n + 1, path: 'sprites/circle-blue.png', move_state: :retreat} } + enemies += 4.times.map { |n| {x: Math.rand * 1280 * 2 - 640, y: Math.rand * 720 * 2 + 720, row: 4, col: n + 3, path: 'sprites/circle-green.png', move_state: :retreat} } + enemies +end + +def update_explosions args + args.state.explosions.each do |explosion| + explosion[:age] += 0.5 + explosion[:path] = "sprites/explosion-#{explosion[:age].floor}.png" + end + args.state.explosions = args.state.explosions.reject { |explosion| explosion[:age] >= 7 } +end + +def update_enemy_positions args + args.state.enemies.each do |enemy| + if enemy[:move_state] == :normal + enemy[:x] = args.state.columns[enemy[:col]] + enemy[:y] = args.state.rows[enemy[:row]] + enemy[:move_state] = :dive if Math.rand < 0.0002 + 0.00005 * args.state.wave && args.state.player[:alive] + elsif enemy[:move_state] == :dive + enemy[:target_x] ||= args.state.player[:x] + enemy[:target_y] ||= args.state.player[:y] + dx = enemy[:target_x] - enemy[:x] + dy = enemy[:target_y] - enemy[:y] + vel = Math.sqrt(dx * dx + dy * dy) + speed_limit = 2 + args.state.wave_root + if vel > speed_limit + dx /= vel / speed_limit + dy /= vel / speed_limit + end + if vel < 1 || !args.state.player[:alive] + enemy[:move_state] = :retreat + end + enemy[:x] += dx + enemy[:y] += dy + elsif enemy[:move_state] == :retreat + enemy[:target_x] = args.state.columns[enemy[:col]] + enemy[:target_y] = args.state.rows[enemy[:row]] + dx = enemy[:target_x] - enemy[:x] + dy = enemy[:target_y] - enemy[:y] + vel = Math.sqrt(dx * dx + dy * dy) + speed_limit = 2 + args.state.wave_root + if vel > speed_limit + dx /= vel / speed_limit + dy /= vel / speed_limit + elsif vel < 1 + enemy[:move_state] = :normal + enemy[:target_x] = nil + enemy[:target_y] = nil + end + enemy[:x] += dx + enemy[:y] += dy + end + end +end diff --git a/samples/99_genre_arcade/bullet_hell/sprites/circle-blue.png b/samples/99_genre_arcade/bullet_hell/sprites/circle-blue.png new file mode 100644 index 0000000..1726d2a Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/circle-blue.png differ diff --git a/samples/99_genre_arcade/bullet_hell/sprites/circle-gray.png b/samples/99_genre_arcade/bullet_hell/sprites/circle-gray.png new file mode 100644 index 0000000..960f191 Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/circle-gray.png differ diff --git a/samples/99_genre_arcade/bullet_hell/sprites/circle-green.png b/samples/99_genre_arcade/bullet_hell/sprites/circle-green.png new file mode 100644 index 0000000..43cf7ee Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/circle-green.png differ diff --git a/samples/99_genre_arcade/bullet_hell/sprites/circle-orange.png b/samples/99_genre_arcade/bullet_hell/sprites/circle-orange.png new file mode 100644 index 0000000..5604a42 Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/circle-orange.png differ diff --git a/samples/99_genre_arcade/bullet_hell/sprites/explosion-0.png b/samples/99_genre_arcade/bullet_hell/sprites/explosion-0.png new file mode 100644 index 0000000..f48636f Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/explosion-0.png differ diff --git a/samples/99_genre_arcade/bullet_hell/sprites/explosion-1.png b/samples/99_genre_arcade/bullet_hell/sprites/explosion-1.png new file mode 100644 index 0000000..b4018d9 Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/explosion-1.png differ diff --git a/samples/99_genre_arcade/bullet_hell/sprites/explosion-2.png b/samples/99_genre_arcade/bullet_hell/sprites/explosion-2.png new file mode 100644 index 0000000..3abaedd Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/explosion-2.png differ diff --git a/samples/99_genre_arcade/bullet_hell/sprites/explosion-3.png b/samples/99_genre_arcade/bullet_hell/sprites/explosion-3.png new file mode 100644 index 0000000..fe94a5a Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/explosion-3.png differ diff --git a/samples/99_genre_arcade/bullet_hell/sprites/explosion-4.png b/samples/99_genre_arcade/bullet_hell/sprites/explosion-4.png new file mode 100644 index 0000000..ed04237 Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/explosion-4.png differ diff --git a/samples/99_genre_arcade/bullet_hell/sprites/explosion-5.png b/samples/99_genre_arcade/bullet_hell/sprites/explosion-5.png new file mode 100644 index 0000000..2cd8f06 Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/explosion-5.png differ diff --git a/samples/99_genre_arcade/bullet_hell/sprites/explosion-6.png b/samples/99_genre_arcade/bullet_hell/sprites/explosion-6.png new file mode 100644 index 0000000..e55909c Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/explosion-6.png differ diff --git a/samples/99_genre_arcade/bullet_hell/sprites/star.png b/samples/99_genre_arcade/bullet_hell/sprites/star.png new file mode 100644 index 0000000..e0ee0f9 Binary files /dev/null and b/samples/99_genre_arcade/bullet_hell/sprites/star.png differ diff --git a/samples/99_genre_arcade/sound_golf/app/main.rb b/samples/99_genre_arcade/sound_golf/app/main.rb new file mode 100644 index 0000000..9606d23 --- /dev/null +++ b/samples/99_genre_arcade/sound_golf/app/main.rb @@ -0,0 +1,190 @@ +=begin + + APIs Listing that haven't been encountered in previous sample apps: + + - sample: Chooses random element from array. + In this sample app, the target note is set by taking a sample from the collection + of available notes. + + Reminders: + - args.grid.(left|right|top|bottom): Pixel value for the boundaries of the virtual + 720 p screen (Dragon Ruby Game Toolkits's virtual resolution is always 1280x720). + + - args.state.new_entity: Used when we want to create a new object, like a sprite or button. + For example, if we want to create a new button, we would declare it as a new entity and + then define its properties. + + - String interpolation: Uses #{} syntax; everything between the #{ and the } is evaluated + as Ruby code, and the placeholder is replaced with its corresponding value or result. + + - args.outputs.labels: An array. The values generate a label. + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] + For more information about labels, go to mygame/documentation/02-labels.md. + + - find_all: Finds all elements from a collection that meet a certain requirements (and excludes the ones that don't). + + - first: Returns the first element of an array. + + - inside_rect: Returns true or false depending on if the point is inside the rect. + + - to_sym: Returns symbol corresponding to string. Will create a symbol if it does + not already exist. + +=end + +# This sample app allows users to test their musical skills by matching the piano sound that plays in each +# level to the correct note. + +# Runs all the methods necessary for the game to function properly. +def tick args + defaults args + render args + calc args + input_mouse args + tick_instructions args, "Sample app shows how to play sounds. args.outputs.sounds << \"path_to_wav.wav\"" +end + +# Sets default values and creates empty collections +# Initialization happens in the first frame only +def defaults args + args.state.notes ||= [] + args.state.click_feedbacks ||= [] + args.state.current_level ||= 1 + args.state.times_wrong ||= 0 # when game starts, user hasn't guessed wrong yet +end + +# Uses a label to display current level, and shows the score +# Creates a button to play the sample note, and displays the available notes that could be a potential match +def render args + + # grid.w_half positions the label in the horizontal center of the screen. + args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(40), "Hole #{args.state.current_level} of 9", 0, 1, 0, 0, 0] + + render_score args # shows score on screen + + args.state.play_again_button ||= { x: 560, y: args.grid.h * 3 / 4 - 40, w: 160, h: 60, label: 'again' } # array definition, text/title + args.state.play_note_button ||= { x: 560, y: args.grid.h * 3 / 4 - 40, w: 160, h: 60, label: 'play' } + + if args.state.game_over # if game is over, a "play again" button is shown + # Calculations ensure that Play Again label is displayed in center of border + # Remove calculations from y parameters and see what happens to border and label placement + args.outputs.labels << [args.grid.w_half, args.grid.h * 3 / 4, "Play Again", 0, 1, 0, 0, 0] # outputs label + args.outputs.borders << args.state.play_again_button # outputs border + else # otherwise, if game is not over + # Calculations ensure that label appears in center of border + args.outputs.labels << [args.grid.w_half, args.grid.h * 3 / 4, "Play Note ##{args.state.current_level}", 0, 1, 0, 0, 0] # outputs label + args.outputs.borders << args.state.play_note_button # outputs border + end + + return if args.state.game_over # return if game is over + + args.outputs.labels << [args.grid.w_half, 400, "I think the note is a(n)...", 0, 1, 0, 0, 0] # outputs label + + # Shows all of the available notes that can be potential matches. + available_notes.each_with_index do |note, i| + args.state.notes[i] ||= piano_button(args, note, i + 1) # calls piano_button method on each note (creates label and border) + args.outputs.labels << args.state.notes[i].label # outputs note on screen with a label and a border + args.outputs.borders << args.state.notes[i].border + end + + # Shows whether or not the user is correct by filling the screen with either red or green + args.outputs.solids << args.state.click_feedbacks.map { |c| c.solid } +end + +# Shows the score (number of times the user guesses wrong) onto the screen using labels. +def render_score args + if args.state.times_wrong == 0 # if the user has guessed wrong zero times, the score is par + args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: PAR", 0, 1, 0, 0, 0] + else # otherwise, number of times the user has guessed wrong is shown + args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: +#{args.state.times_wrong}", 0, 1, 0, 0, 0] # shows score using string interpolation + end +end + +# Sets the target note for the level and performs calculations on click_feedbacks. +def calc args + args.state.target_note ||= available_notes.sample # chooses a note from available_notes collection as target note + args.state.click_feedbacks.each { |c| c.solid[-1] -= 5 } # remove this line and solid color will remain on screen indefinitely + # comment this line out and the solid color will keep flashing on screen instead of being removed from click_feedbacks collection + args.state.click_feedbacks.reject! { |c| c.solid[-1] <= 0 } +end + +# Uses input from the user to play the target note, as well as the other notes that could be a potential match. +def input_mouse args + return unless args.inputs.mouse.click # return unless the mouse is clicked + + # finds button that was clicked by user + button_clicked = args.outputs.borders.find_all do |b| # go through borders collection to find all borders that meet requirements + args.inputs.mouse.click.point.inside_rect? b # find button border that mouse was clicked inside of + end.find_all { |b| b.is_a? Hash }.first # reject, return first element + + return unless button_clicked # return unless button_clicked as a value (a button was clicked) + + queue_click_feedback args, # calls queue_click_feedback method on the button that was clicked + button_clicked.x, + button_clicked.y, + button_clicked.w, + button_clicked.h, + 150, 100, 200 # sets color of button to shade of purple + + if button_clicked[:label] == 'play' # if "play note" button is pressed + args.outputs.sounds << "sounds/#{args.state.target_note}.wav" # sound of target note is output + elsif button_clicked[:label] == 'again' # if "play game again" button is pressed + args.state.target_note = nil # no target note + args.state.current_level = 1 # starts at level 1 again + args.state.times_wrong = 0 # starts off with 0 wrong guesses + args.state.game_over = false # the game is not over (because it has just been restarted) + else # otherwise if neither of those buttons were pressed + args.outputs.sounds << "sounds/#{button_clicked[:label]}.wav" # sound of clicked note is played + if button_clicked[:label] == args.state.target_note # if clicked note is target note + args.state.target_note = nil # target note is emptied + + if args.state.current_level < 9 # if game hasn't reached level 9 + args.state.current_level += 1 # game goes to next level + else # otherwise, if game has reached level 9 + args.state.game_over = true # the game is over + end + + queue_click_feedback args, 0, 0, args.grid.w, args.grid.h, 100, 200, 100 # green shown if user guesses correctly + else # otherwise, if clicked note is not target note + args.state.times_wrong += 1 # increments times user guessed wrong + queue_click_feedback args, 0, 0, args.grid.w, args.grid.h, 200, 100, 100 # red shown is user guesses wrong + end + end +end + +# Creates a collection of all of the available notes as symbols +def available_notes + [:C3, :D3, :E3, :F3, :G3, :A3, :B3, :C4] +end + +# Creates buttons for each note, and sets a label (the note's name) and border for each note's button. +def piano_button args, note, position + args.state.new_entity(:button) do |b| # declares button as new entity + b.label = [460 + 40.mult(position), args.grid.h * 0.4, "#{note}", 0, 1, 0, 0, 0] # label definition + b.border = { x: 460 + 40.mult(position) - 20, y: args.grid.h * 0.4 - 32, w: 40, h: 40, label: note } # border definition, text/title; 20 subtracted so label is in center of border + end +end + +# Color of click feedback changes depending on what button was clicked, and whether the guess is right or wrong +# If a button is clicked, the inside of button is purple (see input_mouse method) +# If correct note is clicked, screen turns green +# If incorrect note is clicked, screen turns red (again, see input_mouse method) +def queue_click_feedback args, x, y, w, h, *color + args.state.click_feedbacks << args.state.new_entity(:click_feedback) do |c| # declares feedback as new entity + c.solid = [x, y, w, h, *color, 255] # sets color + 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.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 diff --git a/samples/99_genre_arcade/sound_golf/license-for-sample.txt b/samples/99_genre_arcade/sound_golf/license-for-sample.txt new file mode 100644 index 0000000..100dcec --- /dev/null +++ b/samples/99_genre_arcade/sound_golf/license-for-sample.txt @@ -0,0 +1,9 @@ +Copyright 2019 DragonRuby LLC + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/samples/99_genre_arcade/sound_golf/replay.txt b/samples/99_genre_arcade/sound_golf/replay.txt new file mode 100644 index 0000000..ba1b5a6 --- /dev/null +++ b/samples/99_genre_arcade/sound_golf/replay.txt @@ -0,0 +1,965 @@ +replay_version 2.0 +stopped_at 2343 +seed 100 +recorded_at Sun Sep 29 22:15:31 2019 +[:mouse_move, 1039, 23, 2, 1, 71] +[:mouse_move, 1005, 37, 2, 2, 72] +[:mouse_move, 862, 94, 2, 3, 73] +[:mouse_move, 791, 114, 2, 4, 74] +[:mouse_move, 664, 128, 2, 5, 75] +[:mouse_move, 610, 128, 2, 6, 76] +[:mouse_move, 577, 121, 2, 7, 77] +[:mouse_move, 566, 117, 2, 8, 78] +[:mouse_move, 566, 115, 2, 9, 90] +[:mouse_move, 566, 110, 2, 10, 91] +[:mouse_move, 566, 104, 2, 11, 91] +[:mouse_move, 566, 98, 2, 12, 92] +[:mouse_move, 567, 92, 2, 13, 93] +[:mouse_move, 567, 85, 2, 14, 94] +[:mouse_move, 567, 83, 2, 15, 95] +[:mouse_move, 568, 78, 2, 16, 96] +[:mouse_move, 568, 77, 2, 17, 97] +[:mouse_move, 568, 76, 2, 18, 97] +[:mouse_move, 568, 75, 2, 19, 98] +[:mouse_move, 567, 75, 2, 20, 102] +[:mouse_move, 566, 74, 2, 21, 103] +[:mouse_move, 565, 74, 2, 22, 106] +[:mouse_move, 565, 73, 2, 23, 106] +[:mouse_move, 565, 72, 2, 24, 110] +[:mouse_move, 565, 71, 2, 25, 111] +[:mouse_move, 565, 70, 2, 26, 112] +[:mouse_move, 567, 69, 2, 27, 112] +[:mouse_move, 569, 67, 2, 28, 114] +[:mouse_move, 571, 66, 2, 29, 114] +[:mouse_move, 577, 65, 2, 30, 115] +[:mouse_move, 581, 64, 2, 31, 116] +[:mouse_move, 584, 64, 2, 32, 116] +[:mouse_move, 589, 64, 2, 33, 117] +[:mouse_move, 592, 63, 2, 34, 118] +[:mouse_move, 597, 63, 2, 35, 118] +[:mouse_move, 601, 62, 2, 36, 119] +[:mouse_move, 605, 62, 2, 37, 120] +[:mouse_move, 610, 61, 2, 38, 120] +[:mouse_move, 613, 61, 2, 39, 121] +[:mouse_move, 617, 61, 2, 40, 122] +[:mouse_move, 620, 60, 2, 41, 122] +[:mouse_move, 622, 60, 2, 42, 123] +[:mouse_move, 627, 60, 2, 43, 124] +[:mouse_move, 632, 60, 2, 44, 125] +[:mouse_move, 635, 60, 2, 45, 126] +[:mouse_move, 638, 59, 2, 46, 126] +[:mouse_move, 640, 59, 2, 47, 127] +[:mouse_move, 642, 59, 2, 48, 129] +[:mouse_move, 644, 59, 2, 49, 129] +[:mouse_move, 650, 58, 2, 50, 130] +[:mouse_move, 655, 57, 2, 51, 131] +[:mouse_move, 657, 57, 2, 52, 132] +[:mouse_move, 661, 56, 2, 53, 133] +[:mouse_move, 665, 55, 2, 54, 134] +[:mouse_move, 671, 54, 2, 55, 135] +[:mouse_move, 673, 54, 2, 56, 136] +[:mouse_move, 677, 54, 2, 57, 137] +[:mouse_move, 680, 54, 2, 58, 138] +[:mouse_move, 684, 54, 2, 59, 139] +[:mouse_move, 686, 54, 2, 60, 140] +[:mouse_move, 688, 54, 2, 61, 141] +[:mouse_move, 690, 54, 2, 62, 141] +[:mouse_move, 691, 54, 2, 63, 142] +[:mouse_move, 694, 54, 2, 64, 143] +[:mouse_move, 696, 54, 2, 65, 144] +[:mouse_move, 698, 54, 2, 66, 146] +[:mouse_move, 699, 55, 2, 67, 147] +[:mouse_move, 700, 55, 2, 68, 149] +[:mouse_move, 700, 56, 2, 69, 176] +[:mouse_move, 700, 57, 2, 70, 176] +[:mouse_move, 701, 58, 2, 71, 177] +[:mouse_move, 701, 60, 2, 72, 178] +[:mouse_move, 702, 65, 2, 73, 179] +[:mouse_move, 702, 69, 2, 74, 180] +[:mouse_move, 702, 75, 2, 75, 181] +[:mouse_move, 700, 79, 2, 76, 182] +[:mouse_move, 689, 88, 2, 77, 183] +[:mouse_move, 682, 91, 2, 78, 184] +[:mouse_move, 663, 98, 2, 79, 185] +[:mouse_move, 651, 100, 2, 80, 186] +[:mouse_move, 626, 105, 2, 81, 187] +[:mouse_move, 612, 108, 2, 82, 188] +[:mouse_move, 600, 108, 2, 83, 189] +[:mouse_move, 595, 109, 2, 84, 189] +[:mouse_move, 586, 109, 2, 85, 190] +[:mouse_move, 577, 110, 2, 86, 191] +[:mouse_move, 572, 110, 2, 87, 192] +[:mouse_move, 569, 110, 2, 88, 193] +[:mouse_move, 567, 110, 2, 89, 194] +[:mouse_move, 564, 110, 2, 90, 196] +[:mouse_move, 562, 110, 2, 91, 197] +[:mouse_move, 561, 110, 2, 92, 197] +[:mouse_move, 558, 110, 2, 93, 198] +[:mouse_move, 557, 110, 2, 94, 199] +[:mouse_move, 556, 110, 2, 95, 199] +[:mouse_move, 555, 110, 2, 96, 200] +[:mouse_move, 554, 110, 2, 97, 201] +[:mouse_move, 553, 110, 2, 98, 203] +[:mouse_move, 555, 110, 2, 99, 206] +[:mouse_move, 556, 110, 2, 100, 207] +[:mouse_move, 560, 110, 2, 101, 208] +[:mouse_move, 562, 110, 2, 102, 209] +[:mouse_move, 566, 110, 2, 103, 209] +[:mouse_move, 569, 110, 2, 104, 210] +[:mouse_move, 572, 110, 2, 105, 211] +[:mouse_move, 579, 110, 2, 106, 212] +[:mouse_move, 582, 110, 2, 107, 213] +[:mouse_move, 590, 110, 2, 108, 215] +[:mouse_move, 597, 110, 2, 109, 216] +[:mouse_move, 601, 110, 2, 110, 216] +[:mouse_move, 605, 110, 2, 111, 217] +[:mouse_move, 612, 110, 2, 112, 218] +[:mouse_move, 614, 110, 2, 113, 219] +[:mouse_move, 620, 110, 2, 114, 220] +[:mouse_move, 622, 110, 2, 115, 220] +[:mouse_move, 627, 110, 2, 116, 221] +[:mouse_move, 633, 110, 2, 117, 222] +[:mouse_move, 635, 110, 2, 118, 223] +[:mouse_move, 640, 110, 2, 119, 224] +[:mouse_move, 643, 110, 2, 120, 224] +[:mouse_move, 644, 110, 2, 121, 225] +[:mouse_move, 647, 110, 2, 122, 226] +[:mouse_move, 649, 110, 2, 123, 226] +[:mouse_move, 653, 109, 2, 124, 227] +[:mouse_move, 656, 109, 2, 125, 228] +[:mouse_move, 659, 109, 2, 126, 229] +[:mouse_move, 662, 109, 2, 127, 230] +[:mouse_move, 668, 109, 2, 128, 231] +[:mouse_move, 671, 109, 2, 129, 232] +[:mouse_move, 673, 109, 2, 130, 232] +[:mouse_move, 678, 109, 2, 131, 233] +[:mouse_move, 681, 109, 2, 132, 234] +[:mouse_move, 686, 109, 2, 133, 235] +[:mouse_move, 689, 109, 2, 134, 236] +[:mouse_move, 692, 109, 2, 135, 236] +[:mouse_move, 694, 110, 2, 136, 237] +[:mouse_move, 696, 110, 2, 137, 238] +[:mouse_move, 698, 110, 2, 138, 238] +[:mouse_move, 699, 110, 2, 139, 239] +[:mouse_move, 700, 110, 2, 140, 240] +[:mouse_move, 702, 110, 2, 141, 241] +[:mouse_move, 703, 110, 2, 142, 242] +[:mouse_move, 704, 110, 2, 143, 245] +[:mouse_move, 704, 111, 2, 144, 290] +[:mouse_move, 695, 111, 2, 145, 347] +[:mouse_move, 691, 111, 2, 146, 348] +[:mouse_move, 689, 111, 2, 147, 348] +[:mouse_move, 687, 111, 2, 148, 349] +[:mouse_move, 685, 111, 2, 149, 350] +[:mouse_move, 684, 111, 2, 150, 351] +[:mouse_move, 683, 112, 2, 151, 353] +[:mouse_move, 683, 114, 2, 152, 365] +[:mouse_move, 684, 114, 2, 153, 366] +[:mouse_move, 684, 116, 2, 154, 367] +[:mouse_move, 686, 118, 2, 155, 368] +[:mouse_move, 686, 119, 2, 156, 369] +[:mouse_move, 687, 120, 2, 157, 370] +[:mouse_move, 687, 121, 2, 158, 371] +[:mouse_move, 687, 122, 2, 159, 374] +[:mouse_move, 682, 121, 2, 160, 378] +[:mouse_move, 678, 120, 2, 161, 379] +[:mouse_move, 668, 118, 2, 162, 380] +[:mouse_move, 660, 117, 2, 163, 381] +[:mouse_move, 653, 115, 2, 164, 382] +[:mouse_move, 628, 111, 2, 165, 383] +[:mouse_move, 619, 110, 2, 166, 384] +[:mouse_move, 609, 109, 2, 167, 384] +[:mouse_move, 604, 109, 2, 168, 385] +[:mouse_move, 596, 109, 2, 169, 385] +[:mouse_move, 586, 109, 2, 170, 387] +[:mouse_move, 581, 110, 2, 171, 388] +[:mouse_move, 574, 112, 2, 172, 388] +[:mouse_move, 571, 113, 2, 173, 389] +[:mouse_move, 567, 115, 2, 174, 390] +[:mouse_move, 562, 120, 2, 175, 391] +[:mouse_move, 559, 123, 2, 176, 392] +[:mouse_move, 556, 126, 2, 177, 392] +[:mouse_move, 553, 130, 2, 178, 393] +[:mouse_move, 550, 135, 2, 179, 394] +[:mouse_move, 547, 139, 2, 180, 394] +[:mouse_move, 545, 143, 2, 181, 395] +[:mouse_move, 543, 148, 2, 182, 396] +[:mouse_move, 540, 156, 2, 183, 397] +[:mouse_move, 539, 161, 2, 184, 398] +[:mouse_move, 537, 171, 2, 185, 399] +[:mouse_move, 537, 177, 2, 186, 400] +[:mouse_move, 537, 179, 2, 187, 400] +[:mouse_move, 536, 183, 2, 188, 401] +[:mouse_move, 536, 188, 2, 189, 402] +[:mouse_move, 536, 197, 2, 190, 403] +[:mouse_move, 538, 202, 2, 191, 404] +[:mouse_move, 541, 206, 2, 192, 405] +[:mouse_move, 544, 211, 2, 193, 405] +[:mouse_move, 548, 216, 2, 194, 406] +[:mouse_move, 557, 226, 2, 195, 407] +[:mouse_move, 566, 233, 2, 196, 408] +[:mouse_move, 575, 238, 2, 197, 409] +[:mouse_move, 583, 241, 2, 198, 409] +[:mouse_move, 591, 245, 2, 199, 410] +[:mouse_move, 602, 248, 2, 200, 411] +[:mouse_move, 613, 250, 2, 201, 411] +[:mouse_move, 625, 251, 2, 202, 412] +[:mouse_move, 637, 253, 2, 203, 413] +[:mouse_move, 650, 254, 2, 204, 413] +[:mouse_move, 663, 254, 2, 205, 414] +[:mouse_move, 669, 254, 2, 206, 415] +[:mouse_move, 680, 254, 2, 207, 415] +[:mouse_move, 690, 252, 2, 208, 416] +[:mouse_move, 699, 250, 2, 209, 417] +[:mouse_move, 707, 247, 2, 210, 417] +[:mouse_move, 714, 244, 2, 211, 418] +[:mouse_move, 720, 241, 2, 212, 419] +[:mouse_move, 726, 238, 2, 213, 419] +[:mouse_move, 730, 235, 2, 214, 420] +[:mouse_move, 734, 232, 2, 215, 421] +[:mouse_move, 741, 225, 2, 216, 422] +[:mouse_move, 744, 221, 2, 217, 423] +[:mouse_move, 747, 216, 2, 218, 424] +[:mouse_move, 748, 213, 2, 219, 425] +[:mouse_move, 751, 206, 2, 220, 426] +[:mouse_move, 751, 203, 2, 221, 427] +[:mouse_move, 750, 196, 2, 222, 428] +[:mouse_move, 748, 193, 2, 223, 429] +[:mouse_move, 740, 184, 2, 224, 430] +[:mouse_move, 735, 180, 2, 225, 431] +[:mouse_move, 726, 171, 2, 226, 432] +[:mouse_move, 722, 169, 2, 227, 432] +[:mouse_move, 710, 160, 2, 228, 433] +[:mouse_move, 691, 149, 2, 229, 434] +[:mouse_move, 680, 144, 2, 230, 435] +[:mouse_move, 663, 137, 2, 231, 436] +[:mouse_move, 652, 134, 2, 232, 437] +[:mouse_move, 642, 131, 2, 233, 438] +[:mouse_move, 634, 130, 2, 234, 438] +[:mouse_move, 624, 128, 2, 235, 439] +[:mouse_move, 616, 127, 2, 236, 440] +[:mouse_move, 608, 126, 2, 237, 440] +[:mouse_move, 594, 126, 2, 238, 441] +[:mouse_move, 586, 126, 2, 239, 442] +[:mouse_move, 573, 127, 2, 240, 443] +[:mouse_move, 566, 129, 2, 241, 444] +[:mouse_move, 559, 132, 2, 242, 444] +[:mouse_move, 553, 135, 2, 243, 445] +[:mouse_move, 548, 138, 2, 244, 446] +[:mouse_move, 543, 142, 2, 245, 446] +[:mouse_move, 539, 146, 2, 246, 447] +[:mouse_move, 536, 150, 2, 247, 448] +[:mouse_move, 529, 158, 2, 248, 449] +[:mouse_move, 527, 162, 2, 249, 450] +[:mouse_move, 525, 170, 2, 250, 451] +[:mouse_move, 524, 183, 2, 251, 453] +[:mouse_move, 524, 187, 2, 252, 454] +[:mouse_move, 525, 192, 2, 253, 455] +[:mouse_move, 528, 197, 2, 254, 456] +[:mouse_move, 532, 202, 2, 255, 457] +[:mouse_move, 536, 204, 2, 256, 458] +[:mouse_move, 549, 212, 2, 257, 459] +[:mouse_move, 558, 216, 2, 258, 460] +[:mouse_move, 583, 223, 2, 259, 461] +[:mouse_move, 597, 226, 2, 260, 462] +[:mouse_move, 616, 228, 2, 261, 463] +[:mouse_move, 627, 228, 2, 262, 464] +[:mouse_move, 636, 228, 2, 263, 465] +[:mouse_move, 643, 227, 2, 264, 465] +[:mouse_move, 645, 226, 2, 265, 466] +[:mouse_move, 649, 225, 2, 266, 467] +[:mouse_move, 652, 224, 2, 267, 467] +[:mouse_move, 654, 223, 2, 268, 468] +[:mouse_move, 655, 222, 2, 269, 469] +[:mouse_move, 656, 222, 2, 270, 469] +[:mouse_move, 657, 221, 2, 271, 470] +[:mouse_move, 657, 220, 2, 272, 480] +[:mouse_move, 657, 219, 2, 273, 481] +[:mouse_move, 657, 218, 2, 274, 481] +[:mouse_move, 656, 215, 2, 275, 482] +[:mouse_move, 655, 212, 2, 276, 483] +[:mouse_move, 653, 207, 2, 277, 484] +[:mouse_move, 652, 205, 2, 278, 485] +[:mouse_move, 651, 201, 2, 279, 486] +[:mouse_move, 650, 200, 2, 280, 487] +[:mouse_move, 650, 198, 2, 281, 488] +[:mouse_button_pressed, 1, 0, 1, 282, 500] +[:mouse_button_up, 1, 0, 1, 283, 509] +[:mouse_move, 650, 199, 2, 284, 581] +[:mouse_move, 649, 202, 2, 285, 582] +[:mouse_move, 646, 214, 2, 286, 583] +[:mouse_move, 643, 223, 2, 287, 584] +[:mouse_move, 637, 245, 2, 288, 585] +[:mouse_move, 633, 257, 2, 289, 586] +[:mouse_move, 627, 282, 2, 290, 587] +[:mouse_move, 625, 294, 2, 291, 588] +[:mouse_move, 621, 312, 2, 292, 589] +[:mouse_move, 618, 320, 2, 293, 590] +[:mouse_move, 613, 337, 2, 294, 591] +[:mouse_move, 611, 343, 2, 295, 592] +[:mouse_move, 607, 349, 2, 296, 593] +[:mouse_move, 602, 359, 2, 297, 594] +[:mouse_move, 599, 363, 2, 298, 595] +[:mouse_move, 592, 371, 2, 299, 596] +[:mouse_move, 589, 375, 2, 300, 597] +[:mouse_move, 581, 382, 2, 301, 598] +[:mouse_move, 577, 385, 2, 302, 599] +[:mouse_move, 569, 390, 2, 303, 600] +[:mouse_move, 564, 393, 2, 304, 601] +[:mouse_move, 556, 398, 2, 305, 602] +[:mouse_move, 552, 399, 2, 306, 603] +[:mouse_move, 542, 403, 2, 307, 604] +[:mouse_move, 538, 405, 2, 308, 605] +[:mouse_move, 528, 408, 2, 309, 606] +[:mouse_move, 523, 410, 2, 310, 607] +[:mouse_move, 515, 414, 2, 311, 608] +[:mouse_move, 510, 415, 2, 312, 609] +[:mouse_move, 502, 419, 2, 313, 610] +[:mouse_move, 500, 420, 2, 314, 611] +[:mouse_move, 495, 424, 2, 315, 612] +[:mouse_move, 490, 427, 2, 316, 613] +[:mouse_move, 488, 428, 2, 317, 614] +[:mouse_move, 486, 431, 2, 318, 615] +[:mouse_move, 484, 434, 2, 319, 616] +[:mouse_move, 483, 435, 2, 320, 617] +[:mouse_move, 483, 436, 2, 321, 618] +[:mouse_move, 483, 437, 2, 322, 619] +[:mouse_move, 483, 438, 2, 323, 620] +[:mouse_move, 483, 439, 2, 324, 621] +[:mouse_move, 483, 440, 2, 325, 624] +[:mouse_move, 484, 440, 2, 326, 625] +[:mouse_move, 485, 441, 2, 327, 628] +[:mouse_move, 486, 441, 2, 328, 629] +[:mouse_move, 487, 441, 2, 329, 630] +[:mouse_move, 488, 441, 2, 330, 631] +[:mouse_move, 490, 442, 2, 331, 633] +[:mouse_move, 492, 442, 2, 332, 635] +[:mouse_move, 494, 442, 2, 333, 637] +[:mouse_move, 496, 442, 2, 334, 639] +[:mouse_move, 498, 442, 2, 335, 641] +[:mouse_move, 499, 442, 2, 336, 643] +[:mouse_move, 501, 442, 2, 337, 644] +[:mouse_move, 504, 442, 2, 338, 645] +[:mouse_move, 506, 442, 2, 339, 646] +[:mouse_move, 510, 442, 2, 340, 647] +[:mouse_move, 512, 442, 2, 341, 648] +[:mouse_move, 513, 442, 2, 342, 649] +[:mouse_move, 515, 442, 2, 343, 650] +[:mouse_move, 516, 442, 2, 344, 651] +[:mouse_move, 517, 442, 2, 345, 653] +[:mouse_move, 518, 442, 2, 346, 658] +[:mouse_move, 520, 442, 2, 347, 660] +[:mouse_move, 521, 442, 2, 348, 661] +[:mouse_move, 524, 442, 2, 349, 662] +[:mouse_move, 526, 442, 2, 350, 663] +[:mouse_move, 528, 442, 2, 351, 664] +[:mouse_move, 530, 442, 2, 352, 665] +[:mouse_move, 531, 442, 2, 353, 666] +[:mouse_move, 532, 442, 2, 354, 667] +[:mouse_move, 533, 442, 2, 355, 668] +[:mouse_move, 534, 442, 2, 356, 671] +[:mouse_move, 533, 442, 2, 357, 676] +[:mouse_move, 528, 442, 2, 358, 677] +[:mouse_move, 525, 442, 2, 359, 678] +[:mouse_move, 518, 442, 2, 360, 679] +[:mouse_move, 515, 442, 2, 361, 680] +[:mouse_move, 508, 442, 2, 362, 681] +[:mouse_move, 506, 442, 2, 363, 682] +[:mouse_move, 504, 442, 2, 364, 683] +[:mouse_move, 503, 442, 2, 365, 684] +[:mouse_button_pressed, 1, 0, 1, 366, 698] +[:mouse_button_up, 1, 0, 1, 367, 703] +[:mouse_move, 502, 444, 2, 368, 780] +[:mouse_move, 501, 446, 2, 369, 781] +[:mouse_move, 497, 451, 2, 370, 782] +[:mouse_move, 495, 453, 2, 371, 783] +[:mouse_move, 493, 455, 2, 372, 784] +[:mouse_move, 492, 457, 2, 373, 785] +[:mouse_move, 490, 460, 2, 374, 786] +[:mouse_move, 496, 456, 2, 375, 787] +[:mouse_move, 513, 441, 2, 376, 788] +[:mouse_move, 517, 437, 2, 377, 789] +[:mouse_move, 527, 429, 2, 378, 790] +[:mouse_move, 529, 427, 2, 379, 791] +[:mouse_move, 528, 428, 2, 380, 792] +[:mouse_move, 504, 456, 2, 381, 793] +[:mouse_move, 498, 462, 2, 382, 794] +[:mouse_move, 490, 471, 2, 383, 795] +[:mouse_move, 483, 477, 2, 384, 796] +[:mouse_move, 489, 468, 2, 385, 797] +[:mouse_move, 495, 461, 2, 386, 798] +[:mouse_move, 502, 454, 2, 387, 799] +[:mouse_move, 505, 450, 2, 388, 800] +[:mouse_move, 511, 445, 2, 389, 801] +[:mouse_move, 511, 446, 2, 390, 802] +[:mouse_move, 508, 450, 2, 391, 803] +[:mouse_move, 507, 452, 2, 392, 804] +[:mouse_move, 505, 454, 2, 393, 809] +[:mouse_move, 504, 455, 2, 394, 810] +[:mouse_move, 503, 457, 2, 395, 811] +[:mouse_move, 504, 454, 2, 396, 813] +[:mouse_move, 505, 452, 2, 397, 814] +[:mouse_move, 507, 450, 2, 398, 815] +[:mouse_move, 508, 449, 2, 399, 816] +[:mouse_move, 508, 448, 2, 400, 817] +[:mouse_move, 509, 448, 2, 401, 818] +[:mouse_move, 509, 447, 2, 402, 819] +[:mouse_move, 509, 446, 2, 403, 821] +[:mouse_move, 509, 445, 2, 404, 824] +[:mouse_move, 509, 442, 2, 405, 826] +[:mouse_move, 509, 440, 2, 406, 827] +[:mouse_move, 510, 428, 2, 407, 828] +[:mouse_move, 512, 419, 2, 408, 829] +[:mouse_move, 524, 385, 2, 409, 830] +[:mouse_move, 531, 366, 2, 410, 831] +[:mouse_move, 546, 332, 2, 411, 832] +[:mouse_move, 554, 311, 2, 412, 833] +[:mouse_move, 571, 269, 2, 413, 834] +[:mouse_move, 579, 250, 2, 414, 835] +[:mouse_move, 592, 215, 2, 415, 836] +[:mouse_move, 598, 202, 2, 416, 837] +[:mouse_move, 601, 189, 2, 417, 838] +[:mouse_move, 605, 172, 2, 418, 839] +[:mouse_move, 609, 154, 2, 419, 840] +[:mouse_move, 610, 151, 2, 420, 841] +[:mouse_move, 612, 136, 2, 421, 842] +[:mouse_move, 613, 130, 2, 422, 843] +[:mouse_move, 613, 126, 2, 423, 844] +[:mouse_move, 614, 116, 2, 424, 845] +[:mouse_move, 614, 111, 2, 425, 846] +[:mouse_move, 614, 105, 2, 426, 847] +[:mouse_move, 614, 102, 2, 427, 848] +[:mouse_move, 614, 97, 2, 428, 849] +[:mouse_move, 614, 96, 2, 429, 850] +[:mouse_move, 614, 95, 2, 430, 851] +[:mouse_move, 614, 94, 2, 431, 852] +[:mouse_move, 614, 92, 2, 432, 853] +[:mouse_move, 613, 92, 2, 433, 854] +[:mouse_move, 612, 91, 2, 434, 855] +[:mouse_move, 611, 91, 2, 435, 856] +[:mouse_move, 607, 91, 2, 436, 857] +[:mouse_move, 605, 91, 2, 437, 858] +[:mouse_move, 601, 93, 2, 438, 859] +[:mouse_move, 600, 94, 2, 439, 860] +[:mouse_move, 598, 96, 2, 440, 861] +[:mouse_move, 597, 96, 2, 441, 862] +[:mouse_move, 596, 97, 2, 442, 863] +[:mouse_move, 596, 99, 2, 443, 865] +[:mouse_move, 596, 100, 2, 444, 866] +[:mouse_move, 597, 104, 2, 445, 867] +[:mouse_move, 599, 106, 2, 446, 868] +[:mouse_move, 605, 110, 2, 447, 869] +[:mouse_move, 609, 113, 2, 448, 870] +[:mouse_move, 618, 116, 2, 449, 871] +[:mouse_move, 624, 118, 2, 450, 872] +[:mouse_move, 629, 119, 2, 451, 873] +[:mouse_move, 638, 121, 2, 452, 874] +[:mouse_move, 642, 123, 2, 453, 875] +[:mouse_move, 651, 124, 2, 454, 876] +[:mouse_move, 655, 124, 2, 455, 877] +[:mouse_move, 662, 125, 2, 456, 878] +[:mouse_move, 665, 125, 2, 457, 879] +[:mouse_move, 673, 125, 2, 458, 880] +[:mouse_move, 676, 125, 2, 459, 881] +[:mouse_move, 681, 123, 2, 460, 882] +[:mouse_move, 684, 123, 2, 461, 883] +[:mouse_move, 688, 120, 2, 462, 884] +[:mouse_move, 690, 118, 2, 463, 885] +[:mouse_move, 694, 115, 2, 464, 886] +[:mouse_move, 695, 113, 2, 465, 887] +[:mouse_move, 696, 110, 2, 466, 888] +[:mouse_move, 697, 108, 2, 467, 889] +[:mouse_move, 698, 106, 2, 468, 890] +[:mouse_move, 698, 105, 2, 469, 891] +[:mouse_move, 698, 103, 2, 470, 892] +[:mouse_move, 698, 102, 2, 471, 893] +[:mouse_move, 698, 99, 2, 472, 894] +[:mouse_move, 698, 98, 2, 473, 895] +[:mouse_move, 695, 94, 2, 474, 896] +[:mouse_move, 693, 91, 2, 475, 897] +[:mouse_move, 686, 85, 2, 476, 898] +[:mouse_move, 682, 83, 2, 477, 899] +[:mouse_move, 680, 82, 2, 478, 900] +[:mouse_move, 671, 76, 2, 479, 901] +[:mouse_move, 667, 75, 2, 480, 902] +[:mouse_move, 652, 71, 2, 481, 903] +[:mouse_move, 643, 71, 2, 482, 904] +[:mouse_move, 621, 69, 2, 483, 905] +[:mouse_move, 615, 69, 2, 484, 906] +[:mouse_move, 595, 69, 2, 485, 907] +[:mouse_move, 586, 69, 2, 486, 908] +[:mouse_move, 568, 71, 2, 487, 909] +[:mouse_move, 556, 74, 2, 488, 910] +[:mouse_move, 547, 79, 2, 489, 911] +[:mouse_move, 541, 81, 2, 490, 912] +[:mouse_move, 532, 89, 2, 491, 913] +[:mouse_move, 529, 93, 2, 492, 914] +[:mouse_move, 527, 98, 2, 493, 915] +[:mouse_move, 524, 109, 2, 494, 916] +[:mouse_move, 524, 128, 2, 495, 917] +[:mouse_move, 527, 132, 2, 496, 918] +[:mouse_move, 536, 143, 2, 497, 919] +[:mouse_move, 542, 147, 2, 498, 920] +[:mouse_move, 558, 155, 2, 499, 921] +[:mouse_move, 566, 156, 2, 500, 922] +[:mouse_move, 585, 156, 2, 501, 923] +[:mouse_move, 594, 156, 2, 502, 924] +[:mouse_move, 617, 154, 2, 503, 925] +[:mouse_move, 622, 153, 2, 504, 926] +[:mouse_move, 632, 150, 2, 505, 927] +[:mouse_move, 648, 143, 2, 506, 928] +[:mouse_move, 655, 139, 2, 507, 929] +[:mouse_move, 667, 131, 2, 508, 930] +[:mouse_move, 673, 127, 2, 509, 931] +[:mouse_move, 681, 119, 2, 510, 932] +[:mouse_move, 684, 115, 2, 511, 933] +[:mouse_move, 688, 110, 2, 512, 934] +[:mouse_move, 690, 107, 2, 513, 935] +[:mouse_move, 692, 101, 2, 514, 936] +[:mouse_move, 693, 99, 2, 515, 937] +[:mouse_move, 694, 93, 2, 516, 938] +[:mouse_move, 693, 90, 2, 517, 939] +[:mouse_move, 683, 82, 2, 518, 940] +[:mouse_move, 677, 79, 2, 519, 941] +[:mouse_move, 660, 72, 2, 520, 942] +[:mouse_move, 648, 70, 2, 521, 943] +[:mouse_move, 632, 67, 2, 522, 944] +[:mouse_move, 623, 66, 2, 523, 945] +[:mouse_move, 608, 66, 2, 524, 946] +[:mouse_move, 602, 66, 2, 525, 947] +[:mouse_move, 591, 68, 2, 526, 948] +[:mouse_move, 587, 70, 2, 527, 949] +[:mouse_move, 579, 77, 2, 528, 950] +[:mouse_move, 572, 85, 2, 529, 951] +[:mouse_move, 566, 94, 2, 530, 952] +[:mouse_move, 563, 101, 2, 531, 954] +[:mouse_move, 558, 117, 2, 532, 955] +[:mouse_move, 555, 131, 2, 533, 956] +[:mouse_move, 555, 141, 2, 534, 957] +[:mouse_move, 555, 147, 2, 535, 958] +[:mouse_move, 558, 155, 2, 536, 959] +[:mouse_move, 561, 159, 2, 537, 960] +[:mouse_move, 569, 167, 2, 538, 961] +[:mouse_move, 575, 171, 2, 539, 962] +[:mouse_move, 588, 178, 2, 540, 963] +[:mouse_move, 593, 182, 2, 541, 964] +[:mouse_move, 604, 187, 2, 542, 965] +[:mouse_move, 609, 191, 2, 543, 966] +[:mouse_move, 618, 194, 2, 544, 967] +[:mouse_move, 622, 196, 2, 545, 968] +[:mouse_move, 630, 199, 2, 546, 969] +[:mouse_move, 635, 200, 2, 547, 970] +[:mouse_move, 642, 201, 2, 548, 971] +[:mouse_move, 651, 202, 2, 549, 973] +[:mouse_move, 658, 202, 2, 550, 974] +[:mouse_move, 662, 200, 2, 551, 975] +[:mouse_move, 664, 199, 2, 552, 976] +[:mouse_move, 666, 198, 2, 553, 977] +[:mouse_move, 667, 198, 2, 554, 980] +[:mouse_move, 667, 197, 2, 555, 985] +[:mouse_button_pressed, 1, 0, 1, 556, 992] +[:mouse_button_up, 1, 0, 1, 557, 1000] +[:mouse_move, 671, 212, 2, 558, 1043] +[:mouse_move, 678, 231, 2, 559, 1044] +[:mouse_move, 698, 290, 2, 560, 1045] +[:mouse_move, 702, 304, 2, 561, 1046] +[:mouse_move, 712, 341, 2, 562, 1047] +[:mouse_move, 717, 358, 2, 563, 1048] +[:mouse_move, 721, 382, 2, 564, 1049] +[:mouse_move, 722, 391, 2, 565, 1050] +[:mouse_move, 723, 398, 2, 566, 1051] +[:mouse_move, 723, 410, 2, 567, 1052] +[:mouse_move, 720, 426, 2, 568, 1053] +[:mouse_move, 714, 439, 2, 569, 1054] +[:mouse_move, 705, 453, 2, 570, 1055] +[:mouse_move, 694, 464, 2, 571, 1056] +[:mouse_move, 670, 474, 2, 572, 1057] +[:mouse_move, 654, 476, 2, 573, 1058] +[:mouse_move, 635, 476, 2, 574, 1059] +[:mouse_move, 606, 476, 2, 575, 1060] +[:mouse_move, 589, 476, 2, 576, 1061] +[:mouse_move, 568, 476, 2, 577, 1062] +[:mouse_move, 556, 476, 2, 578, 1063] +[:mouse_move, 545, 476, 2, 579, 1064] +[:mouse_move, 536, 476, 2, 580, 1065] +[:mouse_move, 524, 476, 2, 581, 1066] +[:mouse_move, 522, 476, 2, 582, 1067] +[:mouse_move, 519, 476, 2, 583, 1068] +[:mouse_move, 518, 476, 2, 584, 1069] +[:mouse_move, 517, 476, 2, 585, 1071] +[:mouse_move, 516, 475, 2, 586, 1072] +[:mouse_move, 515, 473, 2, 587, 1074] +[:mouse_move, 514, 472, 2, 588, 1075] +[:mouse_move, 512, 469, 2, 589, 1076] +[:mouse_move, 512, 468, 2, 590, 1077] +[:mouse_move, 510, 465, 2, 591, 1078] +[:mouse_move, 509, 463, 2, 592, 1079] +[:mouse_move, 508, 460, 2, 593, 1080] +[:mouse_move, 507, 459, 2, 594, 1081] +[:mouse_move, 507, 457, 2, 595, 1082] +[:mouse_move, 506, 456, 2, 596, 1083] +[:mouse_move, 506, 455, 2, 597, 1084] +[:mouse_move, 505, 455, 2, 598, 1085] +[:mouse_move, 507, 454, 2, 599, 1097] +[:mouse_move, 510, 452, 2, 600, 1098] +[:mouse_move, 516, 449, 2, 601, 1099] +[:mouse_move, 521, 446, 2, 602, 1100] +[:mouse_move, 533, 440, 2, 603, 1101] +[:mouse_move, 539, 437, 2, 604, 1102] +[:mouse_move, 547, 434, 2, 605, 1103] +[:mouse_move, 551, 433, 2, 606, 1104] +[:mouse_move, 557, 432, 2, 607, 1105] +[:mouse_move, 559, 432, 2, 608, 1106] +[:mouse_move, 560, 432, 2, 609, 1107] +[:mouse_move, 561, 433, 2, 610, 1108] +[:mouse_move, 561, 434, 2, 611, 1109] +[:mouse_move, 561, 437, 2, 612, 1110] +[:mouse_move, 561, 438, 2, 613, 1111] +[:mouse_move, 561, 440, 2, 614, 1112] +[:mouse_move, 561, 441, 2, 615, 1113] +[:mouse_move, 561, 443, 2, 616, 1114] +[:mouse_move, 560, 446, 2, 617, 1116] +[:mouse_move, 560, 447, 2, 618, 1117] +[:mouse_move, 560, 448, 2, 619, 1118] +[:mouse_move, 560, 449, 2, 620, 1119] +[:mouse_move, 559, 450, 2, 621, 1122] +[:mouse_move, 560, 449, 2, 622, 1129] +[:mouse_move, 563, 448, 2, 623, 1130] +[:mouse_move, 565, 447, 2, 624, 1131] +[:mouse_move, 566, 446, 2, 625, 1132] +[:mouse_move, 569, 445, 2, 626, 1133] +[:mouse_move, 572, 444, 2, 627, 1134] +[:mouse_move, 574, 444, 2, 628, 1135] +[:mouse_move, 575, 444, 2, 629, 1136] +[:mouse_move, 579, 444, 2, 630, 1137] +[:mouse_move, 582, 444, 2, 631, 1138] +[:mouse_move, 584, 444, 2, 632, 1139] +[:mouse_move, 591, 444, 2, 633, 1140] +[:mouse_move, 593, 444, 2, 634, 1141] +[:mouse_move, 598, 445, 2, 635, 1142] +[:mouse_move, 600, 446, 2, 636, 1143] +[:mouse_move, 603, 446, 2, 637, 1144] +[:mouse_move, 605, 447, 2, 638, 1145] +[:mouse_move, 606, 448, 2, 639, 1146] +[:mouse_move, 607, 448, 2, 640, 1147] +[:mouse_move, 607, 449, 2, 641, 1148] +[:mouse_move, 608, 449, 2, 642, 1149] +[:mouse_move, 608, 450, 2, 643, 1152] +[:mouse_move, 608, 451, 2, 644, 1155] +[:mouse_move, 607, 451, 2, 645, 1167] +[:mouse_move, 605, 451, 2, 646, 1168] +[:mouse_move, 600, 450, 2, 647, 1169] +[:mouse_move, 591, 449, 2, 648, 1170] +[:mouse_move, 587, 449, 2, 649, 1171] +[:mouse_move, 580, 449, 2, 650, 1172] +[:mouse_move, 578, 448, 2, 651, 1173] +[:mouse_move, 575, 448, 2, 652, 1174] +[:mouse_move, 574, 448, 2, 653, 1175] +[:mouse_move, 574, 447, 2, 654, 1178] +[:mouse_move, 575, 447, 2, 655, 1179] +[:mouse_move, 576, 447, 2, 656, 1180] +[:mouse_move, 580, 446, 2, 657, 1181] +[:mouse_move, 586, 446, 2, 658, 1182] +[:mouse_move, 589, 446, 2, 659, 1183] +[:mouse_move, 594, 446, 2, 660, 1184] +[:mouse_move, 597, 446, 2, 661, 1185] +[:mouse_move, 601, 446, 2, 662, 1186] +[:mouse_move, 603, 446, 2, 663, 1187] +[:mouse_move, 604, 446, 2, 664, 1188] +[:mouse_move, 605, 447, 2, 665, 1190] +[:mouse_move, 606, 447, 2, 666, 1192] +[:mouse_move, 608, 447, 2, 667, 1194] +[:mouse_move, 609, 447, 2, 668, 1196] +[:mouse_move, 610, 448, 2, 669, 1197] +[:mouse_move, 612, 449, 2, 670, 1198] +[:mouse_move, 614, 449, 2, 671, 1199] +[:mouse_move, 615, 449, 2, 672, 1200] +[:mouse_move, 617, 450, 2, 673, 1201] +[:mouse_move, 618, 450, 2, 674, 1202] +[:mouse_move, 619, 451, 2, 675, 1203] +[:mouse_move, 620, 451, 2, 676, 1210] +[:mouse_button_pressed, 1, 0, 1, 677, 1226] +[:mouse_button_up, 1, 0, 1, 678, 1233] +[:mouse_move, 615, 449, 2, 679, 1295] +[:mouse_move, 607, 447, 2, 680, 1296] +[:mouse_move, 605, 447, 2, 681, 1297] +[:mouse_move, 600, 445, 2, 682, 1298] +[:mouse_move, 597, 445, 2, 683, 1299] +[:mouse_move, 595, 444, 2, 684, 1300] +[:mouse_move, 594, 444, 2, 685, 1301] +[:mouse_button_pressed, 1, 0, 1, 686, 1307] +[:mouse_button_up, 1, 0, 1, 687, 1317] +[:mouse_move, 595, 444, 2, 688, 1343] +[:mouse_move, 602, 444, 2, 689, 1344] +[:mouse_move, 606, 445, 2, 690, 1345] +[:mouse_move, 617, 445, 2, 691, 1346] +[:mouse_move, 622, 445, 2, 692, 1347] +[:mouse_move, 633, 445, 2, 693, 1348] +[:mouse_move, 635, 445, 2, 694, 1349] +[:mouse_move, 642, 446, 2, 695, 1350] +[:mouse_move, 645, 446, 2, 696, 1351] +[:mouse_move, 648, 447, 2, 697, 1352] +[:mouse_move, 649, 447, 2, 698, 1353] +[:mouse_move, 651, 447, 2, 699, 1354] +[:mouse_move, 652, 447, 2, 700, 1356] +[:mouse_move, 652, 448, 2, 701, 1357] +[:mouse_move, 653, 448, 2, 702, 1361] +[:mouse_move, 654, 448, 2, 703, 1363] +[:mouse_move, 656, 448, 2, 704, 1365] +[:mouse_move, 657, 448, 2, 705, 1366] +[:mouse_move, 659, 448, 2, 706, 1367] +[:mouse_move, 660, 448, 2, 707, 1368] +[:mouse_move, 661, 448, 2, 708, 1369] +[:mouse_move, 661, 449, 2, 709, 1370] +[:mouse_move, 662, 449, 2, 710, 1371] +[:mouse_button_pressed, 1, 0, 1, 711, 1388] +[:mouse_button_up, 1, 0, 1, 712, 1396] +[:mouse_move, 662, 441, 2, 713, 1555] +[:mouse_move, 664, 434, 2, 714, 1556] +[:mouse_move, 669, 398, 2, 715, 1557] +[:mouse_move, 671, 349, 2, 716, 1558] +[:mouse_move, 673, 289, 2, 717, 1559] +[:mouse_move, 675, 248, 2, 718, 1560] +[:mouse_move, 675, 222, 2, 719, 1561] +[:mouse_move, 675, 199, 2, 720, 1562] +[:mouse_move, 675, 167, 2, 721, 1563] +[:mouse_move, 675, 157, 2, 722, 1564] +[:mouse_move, 670, 144, 2, 723, 1565] +[:mouse_move, 668, 139, 2, 724, 1566] +[:mouse_move, 664, 136, 2, 725, 1567] +[:mouse_move, 655, 129, 2, 726, 1568] +[:mouse_move, 651, 126, 2, 727, 1569] +[:mouse_move, 641, 120, 2, 728, 1570] +[:mouse_move, 633, 116, 2, 729, 1571] +[:mouse_move, 628, 115, 2, 730, 1572] +[:mouse_move, 624, 113, 2, 731, 1573] +[:mouse_move, 617, 111, 2, 732, 1574] +[:mouse_move, 612, 110, 2, 733, 1575] +[:mouse_move, 604, 110, 2, 734, 1576] +[:mouse_move, 594, 110, 2, 735, 1577] +[:mouse_move, 591, 110, 2, 736, 1578] +[:mouse_move, 588, 110, 2, 737, 1579] +[:mouse_move, 587, 110, 2, 738, 1580] +[:mouse_move, 586, 110, 2, 739, 1581] +[:mouse_move, 587, 110, 2, 740, 1585] +[:mouse_move, 589, 110, 2, 741, 1586] +[:mouse_move, 595, 110, 2, 742, 1587] +[:mouse_move, 599, 111, 2, 743, 1588] +[:mouse_move, 607, 112, 2, 744, 1589] +[:mouse_move, 613, 112, 2, 745, 1590] +[:mouse_move, 623, 113, 2, 746, 1591] +[:mouse_move, 625, 114, 2, 747, 1592] +[:mouse_move, 634, 114, 2, 748, 1593] +[:mouse_move, 637, 114, 2, 749, 1594] +[:mouse_move, 645, 114, 2, 750, 1595] +[:mouse_move, 649, 114, 2, 751, 1596] +[:mouse_move, 656, 113, 2, 752, 1597] +[:mouse_move, 660, 113, 2, 753, 1598] +[:mouse_move, 663, 113, 2, 754, 1599] +[:mouse_move, 671, 113, 2, 755, 1600] +[:mouse_move, 679, 113, 2, 756, 1601] +[:mouse_move, 683, 113, 2, 757, 1602] +[:mouse_move, 687, 114, 2, 758, 1603] +[:mouse_move, 692, 115, 2, 759, 1604] +[:mouse_move, 695, 115, 2, 760, 1605] +[:mouse_move, 699, 116, 2, 761, 1606] +[:mouse_move, 701, 116, 2, 762, 1607] +[:mouse_move, 704, 116, 2, 763, 1608] +[:mouse_move, 705, 116, 2, 764, 1609] +[:mouse_move, 707, 116, 2, 765, 1610] +[:mouse_move, 708, 117, 2, 766, 1612] +[:mouse_move, 709, 117, 2, 767, 1613] +[:mouse_move, 703, 112, 2, 768, 1645] +[:mouse_move, 699, 109, 2, 769, 1646] +[:mouse_move, 671, 93, 2, 770, 1647] +[:mouse_move, 655, 86, 2, 771, 1648] +[:mouse_move, 628, 75, 2, 772, 1649] +[:mouse_move, 612, 70, 2, 773, 1650] +[:mouse_move, 592, 66, 2, 774, 1651] +[:mouse_move, 582, 64, 2, 775, 1652] +[:mouse_move, 579, 63, 2, 776, 1653] +[:mouse_move, 568, 61, 2, 777, 1654] +[:mouse_move, 564, 61, 2, 778, 1655] +[:mouse_move, 560, 60, 2, 779, 1656] +[:mouse_move, 559, 60, 2, 780, 1657] +[:mouse_move, 557, 59, 2, 781, 1658] +[:mouse_move, 558, 59, 2, 782, 1664] +[:mouse_move, 559, 59, 2, 783, 1665] +[:mouse_move, 562, 59, 2, 784, 1666] +[:mouse_move, 564, 59, 2, 785, 1667] +[:mouse_move, 571, 60, 2, 786, 1668] +[:mouse_move, 574, 60, 2, 787, 1669] +[:mouse_move, 580, 60, 2, 788, 1670] +[:mouse_move, 586, 60, 2, 789, 1671] +[:mouse_move, 593, 60, 2, 790, 1672] +[:mouse_move, 597, 61, 2, 791, 1673] +[:mouse_move, 604, 61, 2, 792, 1674] +[:mouse_move, 607, 61, 2, 793, 1675] +[:mouse_move, 614, 62, 2, 794, 1676] +[:mouse_move, 617, 62, 2, 795, 1677] +[:mouse_move, 623, 63, 2, 796, 1678] +[:mouse_move, 627, 63, 2, 797, 1679] +[:mouse_move, 629, 64, 2, 798, 1680] +[:mouse_move, 637, 64, 2, 799, 1681] +[:mouse_move, 640, 65, 2, 800, 1682] +[:mouse_move, 648, 65, 2, 801, 1683] +[:mouse_move, 650, 65, 2, 802, 1684] +[:mouse_move, 657, 65, 2, 803, 1685] +[:mouse_move, 663, 65, 2, 804, 1686] +[:mouse_move, 670, 65, 2, 805, 1687] +[:mouse_move, 673, 65, 2, 806, 1688] +[:mouse_move, 681, 66, 2, 807, 1689] +[:mouse_move, 685, 66, 2, 808, 1690] +[:mouse_move, 691, 67, 2, 809, 1691] +[:mouse_move, 694, 67, 2, 810, 1692] +[:mouse_move, 698, 67, 2, 811, 1693] +[:mouse_move, 700, 68, 2, 812, 1694] +[:mouse_move, 702, 68, 2, 813, 1695] +[:mouse_move, 703, 68, 2, 814, 1696] +[:mouse_move, 704, 68, 2, 815, 1699] +[:mouse_move, 703, 75, 2, 816, 1708] +[:mouse_move, 702, 81, 2, 817, 1709] +[:mouse_move, 697, 101, 2, 818, 1710] +[:mouse_move, 696, 106, 2, 819, 1711] +[:mouse_move, 691, 122, 2, 820, 1712] +[:mouse_move, 687, 129, 2, 821, 1713] +[:mouse_move, 681, 142, 2, 822, 1714] +[:mouse_move, 679, 147, 2, 823, 1715] +[:mouse_move, 674, 156, 2, 824, 1716] +[:mouse_move, 674, 158, 2, 825, 1717] +[:mouse_move, 670, 166, 2, 826, 1718] +[:mouse_move, 669, 169, 2, 827, 1719] +[:mouse_move, 666, 177, 2, 828, 1720] +[:mouse_move, 665, 182, 2, 829, 1721] +[:mouse_move, 663, 189, 2, 830, 1722] +[:mouse_move, 662, 193, 2, 831, 1723] +[:mouse_move, 660, 199, 2, 832, 1724] +[:mouse_move, 660, 201, 2, 833, 1725] +[:mouse_move, 659, 202, 2, 834, 1726] +[:mouse_move, 658, 203, 2, 835, 1727] +[:mouse_move, 658, 202, 2, 836, 1733] +[:mouse_move, 658, 201, 2, 837, 1734] +[:mouse_move, 658, 199, 2, 838, 1735] +[:mouse_move, 658, 197, 2, 839, 1736] +[:mouse_move, 658, 196, 2, 840, 1737] +[:mouse_move, 658, 195, 2, 841, 1739] +[:mouse_button_pressed, 1, 0, 1, 842, 1739] +[:mouse_button_up, 1, 0, 1, 843, 1746] +[:mouse_move, 662, 207, 2, 844, 1794] +[:mouse_move, 668, 224, 2, 845, 1795] +[:mouse_move, 672, 238, 2, 846, 1796] +[:mouse_move, 686, 283, 2, 847, 1797] +[:mouse_move, 702, 338, 2, 848, 1798] +[:mouse_move, 705, 353, 2, 849, 1799] +[:mouse_move, 713, 382, 2, 850, 1800] +[:mouse_move, 717, 398, 2, 851, 1801] +[:mouse_move, 721, 419, 2, 852, 1802] +[:mouse_move, 722, 426, 2, 853, 1803] +[:mouse_move, 723, 435, 2, 854, 1804] +[:mouse_move, 724, 437, 2, 855, 1805] +[:mouse_move, 725, 443, 2, 856, 1806] +[:mouse_move, 725, 444, 2, 857, 1807] +[:mouse_move, 726, 447, 2, 858, 1808] +[:mouse_move, 727, 448, 2, 859, 1809] +[:mouse_move, 727, 449, 2, 860, 1811] +[:mouse_move, 728, 449, 2, 861, 1812] +[:mouse_move, 729, 450, 2, 862, 1815] +[:mouse_move, 730, 450, 2, 863, 1817] +[:mouse_move, 731, 450, 2, 864, 1818] +[:mouse_move, 732, 450, 2, 865, 1819] +[:mouse_move, 733, 449, 2, 866, 1820] +[:mouse_move, 734, 449, 2, 867, 1821] +[:mouse_move, 734, 448, 2, 868, 1822] +[:mouse_move, 735, 448, 2, 869, 1823] +[:mouse_move, 736, 447, 2, 870, 1825] +[:mouse_button_pressed, 1, 0, 1, 871, 1835] +[:mouse_button_up, 1, 0, 1, 872, 1843] +[:mouse_move, 737, 447, 2, 873, 1876] +[:mouse_move, 735, 447, 2, 874, 1886] +[:mouse_move, 734, 447, 2, 875, 1887] +[:mouse_move, 730, 446, 2, 876, 1888] +[:mouse_move, 726, 445, 2, 877, 1889] +[:mouse_move, 719, 445, 2, 878, 1890] +[:mouse_move, 716, 444, 2, 879, 1891] +[:mouse_move, 713, 444, 2, 880, 1892] +[:mouse_move, 709, 444, 2, 881, 1893] +[:mouse_move, 708, 443, 2, 882, 1894] +[:mouse_button_pressed, 1, 0, 1, 883, 1914] +[:mouse_button_up, 1, 0, 1, 884, 1923] +[:mouse_move, 707, 442, 2, 885, 1971] +[:mouse_move, 702, 432, 2, 886, 1972] +[:mouse_move, 695, 416, 2, 887, 1973] +[:mouse_move, 677, 373, 2, 888, 1974] +[:mouse_move, 671, 360, 2, 889, 1975] +[:mouse_move, 666, 351, 2, 890, 1976] +[:mouse_move, 658, 334, 2, 891, 1977] +[:mouse_move, 648, 318, 2, 892, 1978] +[:mouse_move, 643, 313, 2, 893, 1979] +[:key_down_raw, 92, 0, 2, 894, 2046] +[:key_up_raw, 92, 0, 2, 895, 2046] +[:key_down_raw, 92, 0, 2, 896, 2050] +[:key_down_raw, 92, 0, 2, 897, 2075] +[:key_down_raw, 92, 0, 2, 898, 2077] +[:key_down_raw, 92, 0, 2, 899, 2079] +[:key_down_raw, 92, 0, 2, 900, 2081] +[:key_down_raw, 92, 0, 2, 901, 2083] +[:key_down_raw, 92, 0, 2, 902, 2085] +[:key_down_raw, 92, 0, 2, 903, 2087] +[:key_down_raw, 92, 0, 2, 904, 2089] +[:key_down_raw, 92, 0, 2, 905, 2091] +[:key_down_raw, 92, 0, 2, 906, 2093] +[:key_down_raw, 92, 0, 2, 907, 2095] +[:key_down_raw, 92, 0, 2, 908, 2097] +[:key_down_raw, 92, 0, 2, 909, 2099] +[:key_down_raw, 92, 0, 2, 910, 2100] +[:key_down_raw, 92, 0, 2, 911, 2102] +[:key_down_raw, 92, 0, 2, 912, 2105] +[:key_down_raw, 92, 0, 2, 913, 2107] +[:key_down_raw, 92, 0, 2, 914, 2108] +[:key_down_raw, 92, 0, 2, 915, 2110] +[:key_down_raw, 92, 0, 2, 916, 2112] +[:key_down_raw, 92, 0, 2, 917, 2114] +[:key_down_raw, 92, 0, 2, 918, 2116] +[:key_down_raw, 92, 0, 2, 919, 2118] +[:key_down_raw, 92, 0, 2, 920, 2120] +[:key_down_raw, 92, 0, 2, 921, 2122] +[:key_down_raw, 92, 0, 2, 922, 2124] +[:key_down_raw, 92, 0, 2, 923, 2127] +[:key_down_raw, 92, 0, 2, 924, 2128] +[:key_down_raw, 92, 0, 2, 925, 2130] +[:key_down_raw, 92, 0, 2, 926, 2132] +[:key_down_raw, 92, 0, 2, 927, 2134] +[:key_down_raw, 92, 0, 2, 928, 2136] +[:key_down_raw, 92, 0, 2, 929, 2138] +[:key_down_raw, 92, 0, 2, 930, 2140] +[:key_down_raw, 92, 0, 2, 931, 2142] +[:key_down_raw, 113, 0, 2, 932, 2143] +[:key_up_raw, 113, 0, 2, 933, 2149] +[:key_up_raw, 92, 0, 2, 934, 2217] +[:mouse_move, 643, 310, 2, 935, 2263] +[:mouse_move, 643, 295, 2, 936, 2264] +[:mouse_move, 643, 289, 2, 937, 2265] +[:mouse_move, 643, 279, 2, 938, 2266] +[:mouse_move, 644, 274, 2, 939, 2267] +[:mouse_move, 644, 269, 2, 940, 2268] +[:mouse_move, 645, 267, 2, 941, 2269] +[:mouse_move, 647, 256, 2, 942, 2270] +[:mouse_move, 648, 248, 2, 943, 2271] +[:mouse_move, 652, 227, 2, 944, 2272] +[:mouse_move, 653, 219, 2, 945, 2273] +[:mouse_move, 655, 204, 2, 946, 2274] +[:mouse_move, 659, 188, 2, 947, 2275] +[:mouse_move, 661, 178, 2, 948, 2276] +[:mouse_move, 664, 169, 2, 949, 2277] +[:mouse_move, 667, 160, 2, 950, 2278] +[:mouse_move, 669, 158, 2, 951, 2279] +[:mouse_move, 671, 153, 2, 952, 2280] +[:mouse_move, 674, 146, 2, 953, 2281] +[:mouse_move, 675, 141, 2, 954, 2282] +[:mouse_move, 677, 133, 2, 955, 2283] +[:mouse_move, 678, 129, 2, 956, 2284] +[:mouse_move, 679, 123, 2, 957, 2285] +[:mouse_move, 679, 120, 2, 958, 2286] +[:mouse_move, 680, 116, 2, 959, 2287] +[:key_down_raw, 1073742051, 1024, 2, 960, 2340] +[:key_down_raw, 113, 1024, 2, 961, 2342] diff --git a/samples/99_genre_arcade/sound_golf/sounds/A3.wav b/samples/99_genre_arcade/sound_golf/sounds/A3.wav new file mode 100644 index 0000000..9848caf Binary files /dev/null and b/samples/99_genre_arcade/sound_golf/sounds/A3.wav differ diff --git a/samples/99_genre_arcade/sound_golf/sounds/B3.wav b/samples/99_genre_arcade/sound_golf/sounds/B3.wav new file mode 100644 index 0000000..96ca3d2 Binary files /dev/null and b/samples/99_genre_arcade/sound_golf/sounds/B3.wav differ diff --git a/samples/99_genre_arcade/sound_golf/sounds/C3.wav b/samples/99_genre_arcade/sound_golf/sounds/C3.wav new file mode 100644 index 0000000..804fa99 Binary files /dev/null and b/samples/99_genre_arcade/sound_golf/sounds/C3.wav differ diff --git a/samples/99_genre_arcade/sound_golf/sounds/C4.wav b/samples/99_genre_arcade/sound_golf/sounds/C4.wav new file mode 100644 index 0000000..1a0ac75 Binary files /dev/null and b/samples/99_genre_arcade/sound_golf/sounds/C4.wav differ diff --git a/samples/99_genre_arcade/sound_golf/sounds/D3.wav b/samples/99_genre_arcade/sound_golf/sounds/D3.wav new file mode 100644 index 0000000..2db46fc Binary files /dev/null and b/samples/99_genre_arcade/sound_golf/sounds/D3.wav differ diff --git a/samples/99_genre_arcade/sound_golf/sounds/E3.wav b/samples/99_genre_arcade/sound_golf/sounds/E3.wav new file mode 100644 index 0000000..5765098 Binary files /dev/null and b/samples/99_genre_arcade/sound_golf/sounds/E3.wav differ diff --git a/samples/99_genre_arcade/sound_golf/sounds/F3.wav b/samples/99_genre_arcade/sound_golf/sounds/F3.wav new file mode 100644 index 0000000..484270f Binary files /dev/null and b/samples/99_genre_arcade/sound_golf/sounds/F3.wav differ diff --git a/samples/99_genre_arcade/sound_golf/sounds/G3.wav b/samples/99_genre_arcade/sound_golf/sounds/G3.wav new file mode 100644 index 0000000..324e620 Binary files /dev/null and b/samples/99_genre_arcade/sound_golf/sounds/G3.wav differ diff --git a/samples/99_genre_lowrez/nokia_3310/app/main.rb b/samples/99_genre_lowrez/nokia_3310/app/main.rb new file mode 100644 index 0000000..d275ada --- /dev/null +++ b/samples/99_genre_lowrez/nokia_3310/app/main.rb @@ -0,0 +1,625 @@ +require 'app/nokia.rb' + +def tick args + # ======================================================================= + # ==== HELLO WORLD ====================================================== + # ======================================================================= + # Steps to get started: + # 1. ~def tick args~ is the entry point for your game. + # 2. There are quite a few code samples below, remove the "##" + # before each line and save the file to see the changes. + # 3. 0, 0 is in bottom left and 83, 47 is in top right corner. + # 4. Be sure to come to the discord channel if you need + # more help: [[http://discord.dragonruby.org]]. + + # Commenting and uncommenting code: + # - Add a "#" infront of lines to comment out code + # - Remove the "#" infront of lines to comment out code + + # Invoke the hello_world subroutine/method + hello_world args # <---- add a "#" to the beginning of the line to stop running this subroutine/method. + + # ======================================================================= + # ==== HOW TO RENDER A LABEL ============================================ + # ======================================================================= + + # Uncomment the line below to invoke the how_to_render_a_label subroutine/method. + # Note: The method is defined in this file with the signature ~def how_to_render_a_label args~ + # Scroll down to the method to see the details. + + # Remove the "#" at the beginning of the line below + # how_to_render_a_label args # <---- remove the "#" at the beginning of this line to run the method + + + # ======================================================================= + # ==== HOW TO RENDER A FILLED SQUARE (SOLID) ============================ + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_render_solids args + + + # ======================================================================= + # ==== HOW TO RENDER AN UNFILLED SQUARE (BORDER) ======================== + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_render_borders args + + + # ======================================================================= + # ==== HOW TO RENDER A LINE ============================================= + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_render_lines args + + + # ======================================================================= + # == HOW TO RENDER A SPRITE ============================================= + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_render_sprites args + + + # ======================================================================= + # ==== HOW TO MOVE A SPRITE BASED OFF OF USER INPUT ===================== + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_move_a_sprite args + + + # ======================================================================= + # ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ========================== + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_animate_a_sprite args + + + # ======================================================================= + # ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) =========================== + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_animate_a_sprite_sheet args + + + # ======================================================================= + # ==== HOW TO DETERMINE COLLISION ============================================= + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_determine_collision args + + + # ======================================================================= + # ==== HOW TO CREATE BUTTONS ================================================== + # ======================================================================= + # Remove the "#" at the beginning of the line below + # how_to_create_buttons args + + # ==== The line below renders a debug grid, mouse information, and current tick + # render_debug args +end + +# ======================================================================= +# ==== HELLO WORLD ====================================================== +# ======================================================================= +def hello_world args + args.nokia.solids << { x: 0, y: 64, w: 10, h: 10, r: 255 } + + args.nokia.labels << { + x: 42, + y: 46, + text: "nokia 3310 jam 3", + size_enum: NOKIA_FONT_SM, + alignment_enum: 1, + r: 0, + g: 0, + b: 0, + a: 255, + font: NOKIA_FONT_PATH + } + + args.nokia.sprites << { + x: 42 - 10, + y: 26 - 10, + w: 20, + h: 20, + path: 'sprites/monochrome-ship.png', + a: 255, + angle: args.state.tick_count % 360 + } +end + +# ======================================================================= +# ==== HOW TO RENDER A LABEL ============================================ +# ======================================================================= +def how_to_render_a_label args + # NOTE: Text is aligned from the TOP LEFT corner + + # Render an EXTRA LARGE/XL label (remove the "#" in front of each line below) + args.nokia.labels << { x: 0, y: 46, text: "Hello World", + size_enum: NOKIA_FONT_XL, + r: 0, g: 0, b: 0, a: 255, + font: NOKIA_FONT_PATH } + + # Render a LARGE/LG label (remove the "#" in front of each line below) + args.nokia.labels << { x: 0, y: 29, text: "Hello World", + size_enum: NOKIA_FONT_LG, + r: 0, g: 0, b: 0, a: 255, + font: NOKIA_FONT_PATH } + + # Render a MEDIUM/MD label (remove the "#" in front of each line below) + args.nokia.labels << { x: 0, y: 16, text: "Hello World", + size_enum: NOKIA_FONT_MD, + r: 0, g: 0, b: 0, a: 255, + font: NOKIA_FONT_PATH } + + # Render a SMALL/SM label (remove the "#" in front of each line below) + args.nokia.labels << { x: 0, y: 7, text: "Hello World", + size_enum: NOKIA_FONT_SM, + r: 0, g: 0, b: 0, a: 255, + font: NOKIA_FONT_PATH } + + # You are provided args.nokia.default_label which returns a Hash that you + # can ~merge~ properties with + # Example 1 + args.nokia.labels << args.nokia + .default_label + .merge(text: "Default") + + # Example 2 + args.nokia.labels << args.nokia + .default_label + .merge(x: 31, + text: "Default") +end + +# ============================================================================= +# ==== HOW TO RENDER FILLED SQUARES (SOLIDS) ================================== +# ============================================================================= +def how_to_render_solids args + # Render a square at 0, 0 with a width and height of 1 + args.nokia.solids << { x: 0, y: 0, w: 1, h: 1 } + + # Render a square at 1, 1 with a width and height of 2 + args.nokia.solids << { x: 1, y: 1, w: 2, h: 2 } + + # Render a square at 3, 3 with a width and height of 3 + args.nokia.solids << { x: 3, y: 3, w: 3, h: 3 } + + # Render a square at 6, 6 with a width and height of 4 + args.nokia.solids << { x: 6, y: 6, w: 4, h: 4 } +end + +# ============================================================================= +# ==== HOW TO RENDER UNFILLED SQUARES (BORDERS) =============================== +# ============================================================================= +def how_to_render_borders args + # Render a square at 0, 0 with a width and height of 3 + args.nokia.borders << { x: 0, y: 0, w: 3, h: 3, a: 255 } + + # Render a square at 3, 3 with a width and height of 3 + args.nokia.borders << { x: 3, y: 3, w: 4, h: 4, a: 255 } + + # Render a square at 5, 5 with a width and height of 4 + args.nokia.borders << { x: 7, y: 7, w: 5, h: 5, a: 255 } +end + +# ============================================================================= +# ==== HOW TO RENDER A LINE =================================================== +# ============================================================================= +def how_to_render_lines args + # Render a horizontal line at the bottom + args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 0 } + + # Render a vertical line at the left + args.nokia.lines << { x: 0, y: 0, x2: 0, y2: 47 } + + # Render a diagonal line starting from the bottom left and going to the top right + args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 47 } +end + +# ============================================================================= +# == HOW TO RENDER A SPRITE =================================================== +# ============================================================================= +def how_to_render_sprites args + # Loop 10 times and create 10 sprites in 10 positions + # Render a sprite at the bottom left with a width and height of 5 and a path of 'sprites/monochrome-ship.png' + 10.times do |i| + args.nokia.sprites << { + x: i * 8.4, + y: i * 4.8, + w: 5, + h: 5, + path: 'sprites/monochrome-ship.png' + } + end + + # Given an array of positions create sprites + positions = [ + { x: 20, y: 32 }, + { x: 45, y: 15 }, + { x: 72, y: 23 }, + ] + + positions.each do |position| + # use Ruby's ~Hash#merge~ function to create a sprite + args.nokia.sprites << position.merge(path: 'sprites/monochrome-ship.png', + w: 5, + h: 5) + end +end + +# ============================================================================= +# ==== HOW TO ANIMATE A SPRITE (SEPERATE PNGS) ========================== +# ============================================================================= +def how_to_animate_a_sprite args + # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds + start_animation_on_tick = 180 + + # STEP 2: Get the frame_index given the start tick. + sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites? + hold_for: 8, # how long to hold each sprite? + repeat: true # should it repeat? + + # STEP 3: frame_index will return nil if the frame hasn't arrived yet + if sprite_index + # if the sprite_index is populated, use it to determine the sprite path and render it + sprite_path = "sprites/explosion-#{sprite_index}.png" + args.nokia.sprites << { x: 42 - 16, + y: 47 - 32, + w: 32, + h: 32, + path: sprite_path } + else + # if the sprite_index is nil, render a countdown instead + countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1) + + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 18, + text: "Count Down: #{countdown_in_seconds.to_sf}", + alignment_enum: 0) + end + + # render the current tick and the resolved sprite index + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 11, + text: "Tick: #{args.state.tick_count}") + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 5, + text: "sprite_index: #{sprite_index}") +end + +# ============================================================================= +# ==== HOW TO ANIMATE A SPRITE (SPRITE SHEET) ================================= +# ============================================================================= +def how_to_animate_a_sprite_sheet args + # STEP 1: Define when you want the animation to start. The animation in this case will start in 3 seconds + start_animation_on_tick = 180 + + # STEP 2: Get the frame_index given the start tick. + sprite_index = start_animation_on_tick.frame_index count: 7, # how many sprites? + hold_for: 8, # how long to hold each sprite? + repeat: true # should it repeat? + + # STEP 3: frame_index will return nil if the frame hasn't arrived yet + if sprite_index + # if the sprite_index is populated, use it to determine the source rectangle and render it + args.nokia.sprites << { + x: 42 - 16, + y: 47 - 32, + w: 32, + h: 32, + path: "sprites/explosion-sheet.png", + source_x: 32 * sprite_index, + source_y: 0, + source_w: 32, + source_h: 32 + } + else + # if the sprite_index is nil, render a countdown instead + countdown_in_seconds = ((start_animation_on_tick - args.state.tick_count) / 60).round(1) + + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 18, + text: "Count Down: #{countdown_in_seconds.to_sf}", + alignment_enum: 0) + end + + # render the current tick and the resolved sprite index + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 11, + text: "tick: #{args.state.tick_count}") + args.nokia.labels << args.nokia + .default_label + .merge(x: 0, + y: 5, + text: "sprite_index: #{sprite_index}") +end + +# ============================================================================= +# ==== HOW TO STORE STATE, ACCEPT INPUT, AND RENDER SPRITE BASED OFF OF STATE = +# ============================================================================= +def how_to_move_a_sprite args + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 46, text: "Use Arrow Keys", + alignment_enum: 1) + + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 41, text: "Or WASD", + alignment_enum: 1) + + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 36, text: "Or Click", + alignment_enum: 1) + + # set the initial values for x and y using ||= ("or equal operator") + args.state.ship.x ||= 0 + args.state.ship.y ||= 0 + + # if a mouse click occurs, update the ship's x and y to be the location of the click + if args.nokia.mouse_click + args.state.ship.x = args.nokia.mouse_click.x + args.state.ship.y = args.nokia.mouse_click.y + end + + # if a or left arrow is pressed/held, decrement the ships x position + if args.nokia.keyboard.left + args.state.ship.x -= 1 + end + + # if d or right arrow is pressed/held, increment the ships x position + if args.nokia.keyboard.right + args.state.ship.x += 1 + end + + # if s or down arrow is pressed/held, decrement the ships y position + if args.nokia.keyboard.down + args.state.ship.y -= 1 + end + + # if w or up arrow is pressed/held, increment the ships y position + if args.nokia.keyboard.up + args.state.ship.y += 1 + end + + # render the sprite to the screen using the position stored in args.state.ship + args.nokia.sprites << { + x: args.state.ship.x, + y: args.state.ship.y, + w: 5, + h: 5, + path: 'sprites/monochrome-ship.png', + # parameters beyond this point are optional + angle: 0, # Note: rotation angle is denoted in degrees NOT radians + r: 255, + g: 255, + b: 255, + a: 255 + } +end + +# ======================================================================= +# ==== HOW TO DETERMINE COLLISION ======================================= +# ======================================================================= +def how_to_determine_collision args + # Render the instructions + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 46, text: "Click Anywhere", + alignment_enum: 1) + + # if a mouse click occurs: + # - set ship_one if it isn't set + # - set ship_two if it isn't set + # - otherwise reset ship one and ship two + if args.nokia.mouse_click + # is ship_one set? + if !args.state.ship_one + args.state.ship_one = { x: args.nokia.mouse_click.x - 5, + y: args.nokia.mouse_click.y - 5, + w: 10, + h: 10 } + # is ship_one set? + elsif !args.state.ship_two + args.state.ship_two = { x: args.nokia.mouse_click.x - 5, + y: args.nokia.mouse_click.y - 5, + w: 10, + h: 10 } + # should we reset? + else + args.state.ship_one = nil + args.state.ship_two = nil + end + end + + # render ship one if it's set + if args.state.ship_one + # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha + # render ship one + args.nokia.sprites << args.state.ship_one.merge(path: 'sprites/monochrome-ship.png') + end + + if args.state.ship_two + # use Ruby's .merge method which is available on ~Hash~ to set the sprite and alpha + # render ship two + args.nokia.sprites << args.state.ship_two.merge(path: 'sprites/monochrome-ship.png') + end + + # if both ship one and ship two are set, then determine collision + if args.state.ship_one && args.state.ship_two + # collision is determined using the intersect_rect? method + if args.state.ship_one.intersect_rect? args.state.ship_two + # if collision occurred, render the words collision! + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 5, + text: "Collision!", + alignment_enum: 1) + else + # if collision occurred, render the words no collision. + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 5, + text: "No Collision.", + alignment_enum: 1) + end + else + # if both ship one and ship two aren't set, then render -- + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 6, + text: "--", + alignment_enum: 1) + end +end + +# ============================================================================= +# ==== HOW TO CREATE BUTTONS ================================================== +# ============================================================================= +def how_to_create_buttons args + # Define a button style + args.state.button_style = { w: 82, h: 10, } + + # Render instructions + args.state.button_message ||= "Press a Button!" + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 82, + text: args.state.button_message, + alignment_enum: 1) + + + # Creates button one using a border and a label + args.state.button_one_border = args.state.button_style.merge( x: 1, y: 32) + args.nokia.borders << args.state.button_one_border + args.nokia.labels << args.nokia + .default_label + .merge(x: args.state.button_one_border.x + 2, + y: args.state.button_one_border.y + NOKIA_FONT_SM_HEIGHT + 2, + text: "Button One") + + # Creates button two using a border and a label + args.state.button_two_border = args.state.button_style.merge( x: 1, y: 20) + + args.nokia.borders << args.state.button_two_border + args.nokia.labels << args.nokia + .default_label + .merge(x: args.state.button_two_border.x + 2, + y: args.state.button_two_border.y + NOKIA_FONT_SM_HEIGHT + 2, + text: "Button Two") + + # Initialize the state variable that tracks which button was clicked to "" (empty stringI + args.state.last_button_clicked ||= "--" + + # If a click occurs, check to see if either button one, or button two was clicked + # using the inside_rect? method of the mouse + # set args.state.last_button_clicked accordingly + if args.nokia.mouse_click + if args.nokia.mouse_click.inside_rect? args.state.button_one_border + args.state.last_button_clicked = "One Clicked!" + elsif args.nokia.mouse_click.inside_rect? args.state.button_two_border + args.state.last_button_clicked = "Two Clicked!" + else + args.state.last_button_clicked = "--" + end + end + + # Render the current value of args.state.last_button_clicked + args.nokia.labels << args.nokia + .default_label + .merge(x: 42, + y: 5, + text: args.state.last_button_clicked, + alignment_enum: 1) +end + +def render_debug args + if !args.state.grid_rendered + (NOKIA_HEIGHT + 1).map_with_index do |i| + args.outputs.static_debug << { + x: NOKIA_X_OFFSET, + y: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), + x2: NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH, + y2: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), + r: 128, + g: 128, + b: 128, + a: 80 + }.line + end + + (NOKIA_WIDTH + 1).map_with_index do |i| + args.outputs.static_debug << { + x: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), + y: NOKIA_Y_OFFSET, + x2: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), + y2: NOKIA_Y_OFFSET + NOKIA_ZOOMED_HEIGHT, + r: 128, + g: 128, + b: 128, + a: 80 + }.line + end + end + + args.state.grid_rendered = true + + args.state.last_click ||= 0 + args.state.last_up ||= 0 + args.state.last_click = args.state.tick_count if args.nokia.mouse_down # you can also use args.nokia.click + args.state.last_up = args.state.tick_count if args.nokia.mouse_up + args.state.label_style = { size_enum: -1.5 } + + args.state.watch_list = [ + "args.state.tick_count is: #{args.state.tick_count}", + "args.nokia.mouse_position is: #{args.nokia.mouse_position.x}, #{args.nokia.mouse_position.y}", + "args.nokia.mouse_down tick: #{args.state.last_click || "never"}", + "args.nokia.mouse_up tick: #{args.state.last_up || "false"}", + ] + + args.outputs.debug << args.state + .watch_list + .map_with_index do |text, i| + { + x: 5, + y: 720 - (i * 18), + text: text, + size_enum: -1.5, + r: 255, g: 255, b: 255 + }.label + end + + args.outputs.debug << { + x: 640, + y: 25, + 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, + r: 255, g: 255, b: 255 + }.label +end + +def snake_demo args + +end + +$gtk.reset diff --git a/samples/99_genre_lowrez/nokia_3310/app/nokia.rb b/samples/99_genre_lowrez/nokia_3310/app/nokia.rb new file mode 100644 index 0000000..077e36f --- /dev/null +++ b/samples/99_genre_lowrez/nokia_3310/app/nokia.rb @@ -0,0 +1,259 @@ +# 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. + +NOKIA_WIDTH = 84 +NOKIA_HEIGHT = 48 +NOKIA_ZOOM = 12 +NOKIA_ZOOMED_WIDTH = NOKIA_WIDTH * NOKIA_ZOOM +NOKIA_ZOOMED_HEIGHT = NOKIA_HEIGHT * NOKIA_ZOOM +NOKIA_X_OFFSET = (1280 - NOKIA_ZOOMED_WIDTH).half +NOKIA_Y_OFFSET = ( 720 - NOKIA_ZOOMED_HEIGHT).half + +NOKIA_FONT_XL = -1 +NOKIA_FONT_XL_HEIGHT = 20 + +NOKIA_FONT_LG = -3.5 +NOKIA_FONT_LG_HEIGHT = 15 + +NOKIA_FONT_MD = -6 +NOKIA_FONT_MD_HEIGHT = 10 + +NOKIA_FONT_SM = -8.5 +NOKIA_FONT_SM_HEIGHT = 5 + +NOKIA_FONT_PATH = 'fonts/lowrez.ttf' + + +class NokiaOutputs + attr_accessor :width, :height + + def initialize args + @args = args + end + + def outputs_nokia + return @args.outputs if @args.state.tick_count <= 0 + return @args.outputs[:nokia] + end + + def solids + outputs_nokia.solids + end + + def borders + outputs_nokia.borders + end + + def sprites + outputs_nokia.sprites + end + + def labels + outputs_nokia.labels + end + + def default_label + { + x: 0, + y: 63, + text: "", + size_enum: NOKIA_FONT_SM, + alignment_enum: 0, + r: 0, + g: 0, + b: 0, + a: 255, + font: NOKIA_FONT_PATH + } + end + + def lines + outputs_nokia.lines + end + + def primitives + outputs_nokia.primitives + end + + def click + return nil unless @args.inputs.mouse.click + mouse + end + + def mouse_click + click + end + + def mouse_down + @args.inputs.mouse.down + end + + def mouse_up + @args.inputs.mouse.up + end + + def mouse + [ + ((@args.inputs.mouse.x - NOKIA_X_OFFSET).idiv(NOKIA_ZOOM)), + ((@args.inputs.mouse.y - NOKIA_Y_OFFSET).idiv(NOKIA_ZOOM)) + ] + end + + def mouse_position + mouse + end + + def keyboard + @args.inputs.keyboard + end +end + +class GTK::Args + def init_nokia + return if @nokia + @nokia = NokiaOutputs.new self + end + + def nokia + @nokia + end +end + +module GTK + class Runtime + alias_method :__original_tick_core__, :tick_core unless Runtime.instance_methods.include?(:__original_tick_core__) + + def tick_core + @args.init_nokia + + __original_tick_core__ + + return if @args.state.tick_count <= 0 + + @args.render_target(:nokia) + .labels + .each do |l| + l.y += 1 + if (l.a || 255) > 128 + l.r = 67 + l.g = 82 + l.b = 61 + l.a = 255 + else + l.a = 0 + end + end + + @args.render_target(:nokia) + .sprites + .each do |s| + if (s.a || 255) > 128 + s.a = 255 + else + s.a = 0 + end + end + + @args.render_target(:nokia) + .solids + .each do |s| + if (s.a || 255) > 128 + s.r = 67 + s.g = 82 + s.b = 61 + s.a = 255 + else + s.a = 0 + end + end + + @args.render_target(:nokia) + .borders + .each do |s| + if (s.a || 255) > 128 + s.r = 67 + s.g = 82 + s.b = 61 + s.a = 255 + else + s.a = 0 + end + end + + @args.render_target(:nokia) + .lines + .each do |l| + l.y += 1 + l.y2 += 1 + l.y2 += 1 if l.y1 != l.y2 + l.x2 += 1 if l.x1 != l.x2 + + if (l.a || 255) > 128 + l.r = 67 + l.g = 82 + l.b = 61 + l.a = 255 + else + l.a = 0 + end + end + + @args.outputs.borders << { + x: NOKIA_X_OFFSET - 1, + y: NOKIA_Y_OFFSET - 1, + w: NOKIA_ZOOMED_WIDTH + 2, + h: NOKIA_ZOOMED_HEIGHT + 2, + r: 128, g: 128, b: 128 + } + + + @args.outputs.background_color = [199, 240, 216] + + @args.outputs.solids << [0, 0, NOKIA_X_OFFSET, 720] + @args.outputs.solids << [0, 0, 1280, NOKIA_Y_OFFSET] + @args.outputs.solids << [NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH, 0, NOKIA_X_OFFSET, 720] + @args.outputs.solids << [0, NOKIA_Y_OFFSET.from_top, 1280, NOKIA_Y_OFFSET] + + @args.outputs + .sprites << { x: NOKIA_X_OFFSET, + y: NOKIA_Y_OFFSET, + w: NOKIA_ZOOMED_WIDTH, + h: NOKIA_ZOOMED_HEIGHT, + source_x: 0, + source_y: 0, + source_w: NOKIA_WIDTH, + source_h: NOKIA_HEIGHT, + path: :nokia } + + if !@args.state.overlay_rendered + (NOKIA_HEIGHT + 1).map_with_index do |i| + @args.outputs.static_lines << { + x: NOKIA_X_OFFSET, + y: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), + x2: NOKIA_X_OFFSET + NOKIA_ZOOMED_WIDTH, + y2: NOKIA_Y_OFFSET + (i * NOKIA_ZOOM), + r: 199, + g: 240, + b: 216, + a: 100 + }.line + end + + (NOKIA_WIDTH + 1).map_with_index do |i| + @args.outputs.static_lines << { + x: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), + y: NOKIA_Y_OFFSET, + x2: NOKIA_X_OFFSET + (i * NOKIA_ZOOM), + y2: NOKIA_Y_OFFSET + NOKIA_ZOOMED_HEIGHT, + r: 199, + g: 240, + b: 216, + a: 100 + }.line + end + + @args.state.overlay_rendered = true + end + end + end +end diff --git a/samples/99_genre_lowrez/nokia_3310/fonts/lowrez.ttf b/samples/99_genre_lowrez/nokia_3310/fonts/lowrez.ttf new file mode 100644 index 0000000..2682cb0 Binary files /dev/null and b/samples/99_genre_lowrez/nokia_3310/fonts/lowrez.ttf differ diff --git a/samples/99_genre_lowrez/nokia_3310/sprites/explosion-0.png b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-0.png new file mode 100644 index 0000000..93dff6a Binary files /dev/null and b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-0.png differ diff --git a/samples/99_genre_lowrez/nokia_3310/sprites/explosion-1.png b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-1.png new file mode 100644 index 0000000..9a3f4a7 Binary files /dev/null and b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-1.png differ diff --git a/samples/99_genre_lowrez/nokia_3310/sprites/explosion-2.png b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-2.png new file mode 100644 index 0000000..2755496 Binary files /dev/null and b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-2.png differ diff --git a/samples/99_genre_lowrez/nokia_3310/sprites/explosion-3.png b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-3.png new file mode 100644 index 0000000..6b3b60c Binary files /dev/null and b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-3.png differ diff --git a/samples/99_genre_lowrez/nokia_3310/sprites/explosion-4.png b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-4.png new file mode 100644 index 0000000..7a6988b Binary files /dev/null and b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-4.png differ diff --git a/samples/99_genre_lowrez/nokia_3310/sprites/explosion-5.png b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-5.png new file mode 100644 index 0000000..caf23b6 Binary files /dev/null and b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-5.png differ diff --git a/samples/99_genre_lowrez/nokia_3310/sprites/explosion-6.png b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-6.png new file mode 100644 index 0000000..f85bec8 Binary files /dev/null and b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-6.png differ diff --git a/samples/99_genre_lowrez/nokia_3310/sprites/explosion-sheet.png b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-sheet.png new file mode 100644 index 0000000..f41d20e Binary files /dev/null and b/samples/99_genre_lowrez/nokia_3310/sprites/explosion-sheet.png differ diff --git a/samples/99_genre_lowrez/nokia_3310/sprites/monochrome-ship.png b/samples/99_genre_lowrez/nokia_3310/sprites/monochrome-ship.png new file mode 100644 index 0000000..824f7a6 Binary files /dev/null and b/samples/99_genre_lowrez/nokia_3310/sprites/monochrome-ship.png differ diff --git a/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/constants.rb b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/constants.rb new file mode 100644 index 0000000..37dd493 --- /dev/null +++ b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/constants.rb @@ -0,0 +1,8 @@ +SHOW_LEGEND = true +SOURCE_TILE_SIZE = 16 +DESTINATION_TILE_SIZE = 16 +TILE_SHEET_SIZE = 256 +TILE_R = 0 +TILE_G = 0 +TILE_B = 0 +TILE_A = 255 diff --git a/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/legend.rb b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/legend.rb new file mode 100644 index 0000000..4d07b79 --- /dev/null +++ b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/legend.rb @@ -0,0 +1,65 @@ +def tick_legend args + return unless SHOW_LEGEND + + legend_padding = 16 + legend_x = 1280 - TILE_SHEET_SIZE - legend_padding + legend_y = 720 - TILE_SHEET_SIZE - legend_padding + tile_sheet_sprite = [legend_x, + legend_y, + TILE_SHEET_SIZE, + TILE_SHEET_SIZE, + 'sprites/simple-mood-16x16.png', 0, + TILE_A, + TILE_R, + TILE_G, + TILE_B] + + if args.inputs.mouse.point.inside_rect? tile_sheet_sprite + mouse_row = args.inputs.mouse.point.y.idiv(SOURCE_TILE_SIZE) + tile_row = 15 - (mouse_row - legend_y.idiv(SOURCE_TILE_SIZE)) + + mouse_col = args.inputs.mouse.point.x.idiv(SOURCE_TILE_SIZE) + tile_col = (mouse_col - legend_x.idiv(SOURCE_TILE_SIZE)) + + args.outputs.primitives << [legend_x - legend_padding * 2, + mouse_row * SOURCE_TILE_SIZE, 256 + legend_padding * 2, 16, 128, 128, 128, 64].solid + + args.outputs.primitives << [mouse_col * SOURCE_TILE_SIZE, + legend_y - legend_padding * 2, 16, 256 + legend_padding * 2, 128, 128, 128, 64].solid + + sprite_key = sprite_lookup.find { |k, v| v == [tile_row, tile_col] } + if sprite_key + member_name, _ = sprite_key + member_name = member_name_as_code member_name + args.outputs.labels << [660, 70, "# CODE SAMPLE (place in the tick_game method located in main.rb)", -1, 0] + args.outputs.labels << [660, 50, "# GRID_X, GRID_Y, TILE_KEY", -1, 0] + args.outputs.labels << [660, 30, "args.outputs.sprites << tile_in_game( 5, 6, #{member_name} )", -1, 0] + else + args.outputs.labels << [660, 50, "Tile [#{tile_row}, #{tile_col}] not found. Add a key and value to app/sprite_lookup.rb:", -1, 0] + args.outputs.labels << [660, 30, "{ \"some_string\" => [#{tile_row}, #{tile_col}] } OR { some_symbol: [#{tile_row}, #{tile_col}] }.", -1, 0] + end + + end + + # render the sprite in the top right with a padding to the top and right so it's + # not flush against the edge + args.outputs.sprites << tile_sheet_sprite + + # carefully place some ascii arrows to show the legend labels + args.outputs.labels << [895, 707, "ROW --->"] + args.outputs.labels << [943, 412, " ^"] + args.outputs.labels << [943, 412, " |"] + args.outputs.labels << [943, 394, "COL ---+"] + + # use the tile sheet to print out row and column numbers + args.outputs.sprites << 16.map_with_index do |i| + sprite_key = i % 10 + [ + tile(1280 - TILE_SHEET_SIZE - legend_padding * 2 - SOURCE_TILE_SIZE, + 720 - legend_padding * 2 - (SOURCE_TILE_SIZE * i), + sprite(sprite_key)), + tile(1280 - TILE_SHEET_SIZE - SOURCE_TILE_SIZE + (SOURCE_TILE_SIZE * i), + 720 - TILE_SHEET_SIZE - legend_padding * 3, sprite(sprite_key)) + ] + end +end diff --git a/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb new file mode 100644 index 0000000..bd5f521 --- /dev/null +++ b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb @@ -0,0 +1,97 @@ +require 'app/constants.rb' +require 'app/sprite_lookup.rb' +require 'app/legend.rb' + +def tick args + tick_game args + tick_legend args +end + +def tick_game args + # setup the grid + args.state.grid.padding = 104 + args.state.grid.size = 512 + + # set up your game + # initialize the game/game defaults. ||= means that you only initialize it if + # the value isn't alread initialized + args.state.player.x ||= 0 + args.state.player.y ||= 0 + + args.state.enemies ||= [ + { x: 10, y: 10, type: :goblin, tile_key: :G }, + { x: 15, y: 30, type: :rat, tile_key: :R } + ] + + args.state.info_message ||= "Use arrow keys to move around." + + # handle keyboard input + # keyboard input (arrow keys to move player) + new_player_x = args.state.player.x + new_player_y = args.state.player.y + player_direction = "" + player_moved = false + if args.inputs.keyboard.key_down.up + new_player_y += 1 + player_direction = "north" + player_moved = true + elsif args.inputs.keyboard.key_down.down + new_player_y -= 1 + player_direction = "south" + player_moved = true + elsif args.inputs.keyboard.key_down.right + new_player_x += 1 + player_direction = "east" + player_moved = true + elsif args.inputs.keyboard.key_down.left + new_player_x -= 1 + player_direction = "west" + player_moved = true + end + + #handle game logic + # determine if there is an enemy on that square, + # if so, don't let the player move there + if player_moved + found_enemy = args.state.enemies.find do |e| + e[:x] == new_player_x && e[:y] == new_player_y + end + + if !found_enemy + args.state.player.x = new_player_x + args.state.player.y = new_player_y + args.state.info_message = "You moved #{player_direction}." + else + args.state.info_message = "You cannot move into a square an enemy occupies." + end + end + + args.outputs.sprites << tile_in_game(args.state.player.x, + args.state.player.y, '@') + + # render game + # render enemies at locations + args.outputs.sprites << args.state.enemies.map do |e| + tile_in_game(e[:x], e[:y], e[:tile_key]) + end + + # render the border + border_x = args.state.grid.padding - DESTINATION_TILE_SIZE + border_y = args.state.grid.padding - DESTINATION_TILE_SIZE + border_size = args.state.grid.size + DESTINATION_TILE_SIZE * 2 + + args.outputs.borders << [border_x, + border_y, + border_size, + border_size] + + # render label stuff + args.outputs.labels << [border_x, border_y - 10, "Current player location is: #{args.state.player.x}, #{args.state.player.y}"] + args.outputs.labels << [border_x, border_y + 25 + border_size, args.state.info_message] +end + +def tile_in_game x, y, tile_key + tile($gtk.args.state.grid.padding + x * DESTINATION_TILE_SIZE, + $gtk.args.state.grid.padding + y * DESTINATION_TILE_SIZE, + tile_key) +end diff --git a/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb new file mode 100644 index 0000000..f129e25 --- /dev/null +++ b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb @@ -0,0 +1,124 @@ +def sprite_lookup + { + 0 => [3, 0], + 1 => [3, 1], + 2 => [3, 2], + 3 => [3, 3], + 4 => [3, 4], + 5 => [3, 5], + 6 => [3, 6], + 7 => [3, 7], + 8 => [3, 8], + 9 => [3, 9], + '@' => [4, 0], + A: [ 4, 1], + B: [ 4, 2], + C: [ 4, 3], + D: [ 4, 4], + E: [ 4, 5], + F: [ 4, 6], + G: [ 4, 7], + H: [ 4, 8], + I: [ 4, 9], + J: [ 4, 10], + K: [ 4, 11], + L: [ 4, 12], + M: [ 4, 13], + N: [ 4, 14], + O: [ 4, 15], + P: [ 5, 0], + Q: [ 5, 1], + R: [ 5, 2], + S: [ 5, 3], + T: [ 5, 4], + U: [ 5, 5], + V: [ 5, 6], + W: [ 5, 7], + X: [ 5, 8], + Y: [ 5, 9], + Z: [ 5, 10], + a: [ 6, 1], + b: [ 6, 2], + c: [ 6, 3], + d: [ 6, 4], + e: [ 6, 5], + f: [ 6, 6], + g: [ 6, 7], + h: [ 6, 8], + i: [ 6, 9], + j: [ 6, 10], + k: [ 6, 11], + l: [ 6, 12], + m: [ 6, 13], + n: [ 6, 14], + o: [ 6, 15], + p: [ 7, 0], + q: [ 7, 1], + r: [ 7, 2], + s: [ 7, 3], + t: [ 7, 4], + u: [ 7, 5], + v: [ 7, 6], + w: [ 7, 7], + x: [ 7, 8], + y: [ 7, 9], + z: [ 7, 10], + '|' => [ 7, 12] + } +end + +def sprite key + $gtk.args.state.reserved.sprite_lookup[key] +end + +def member_name_as_code raw_member_name + if raw_member_name.is_a? Symbol + ":#{raw_member_name}" + elsif raw_member_name.is_a? String + "'#{raw_member_name}'" + elsif raw_member_name.is_a? Fixnum + "#{raw_member_name}" + else + "UNKNOWN: #{raw_member_name}" + end +end + +def tile x, y, tile_row_column_or_key + tile_extended x, y, DESTINATION_TILE_SIZE, DESTINATION_TILE_SIZE, TILE_R, TILE_G, TILE_B, TILE_A, tile_row_column_or_key +end + +def tile_extended x, y, w, h, r, g, b, a, tile_row_column_or_key + row_or_key, column = tile_row_column_or_key + if !column + row, column = sprite row_or_key + else + row, column = row_or_key, column + end + + if !row + member_name = member_name_as_code tile_row_column_or_key + raise "Unabled to find a sprite for #{member_name}. Make sure the value exists in app/sprite_lookup.rb." + end + + # Sprite provided by Rogue Yun + # http://www.bay12forums.com/smf/index.php?topic=144897.0 + # License: Public Domain + + { + x: x, + y: y, + w: w, + h: h, + tile_x: column * 16, + tile_y: (row * 16), + tile_w: 16, + tile_h: 16, + r: r, + g: g, + b: b, + a: a, + path: 'sprites/simple-mood-16x16.png' + } +end + +$gtk.args.state.reserved.sprite_lookup = sprite_lookup diff --git a/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/license-for-sample.txt b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/license-for-sample.txt new file mode 100644 index 0000000..100dcec --- /dev/null +++ b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/license-for-sample.txt @@ -0,0 +1,9 @@ +Copyright 2019 DragonRuby LLC + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/sprites/simple-mood-16x16.png b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/sprites/simple-mood-16x16.png new file mode 100644 index 0000000..0eca11e Binary files /dev/null and b/samples/99_genre_rpg_roguelike/01_roguelike_starting_point/sprites/simple-mood-16x16.png differ diff --git a/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb b/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb new file mode 100644 index 0000000..66ff027 --- /dev/null +++ b/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb @@ -0,0 +1,439 @@ +=begin + + APIs listing that haven't been encountered in previous sample apps: + + - lambda: A way to define a block and its parameters with special syntax. + For example, the syntax of lambda looks like this: + my_lambda = -> { puts "This is my lambda" } + + Reminders: + - args.outputs.labels: An array. The values generate a label. + The parameters are [X, Y, TEXT, SIZE, ALIGNMENT, RED, GREEN, BLUE, ALPHA, FONT STYLE] + For more information about labels, go to mygame/documentation/02-labels. + + - ARRAY#inside_rect?: Returns whether or not the point is inside a rect. + + - product: Returns an array of all combinations of elements from all arrays. + + - find: Finds all elements of a collection that meet requirements. + + - abs: Returns the absolute value. + +=end + +# This sample app allows the player to move around in the dungeon, which becomes more or less visible +# depending on the player's location, and also has enemies. + +class Game + attr_accessor :args, :state, :inputs, :outputs, :grid + + # Calls all the methods needed for the game to run properly. + def tick + defaults + render_canvas + render_dungeon + render_player + render_enemies + print_cell_coordinates + calc_canvas + input_move + input_click_map + end + + # Sets default values and initializes variables + def defaults + outputs.background_color = [0, 0, 0] # black background + + # Initializes empty canvas, dungeon, and enemies collections. + state.canvas ||= [] + state.dungeon ||= [] + state.enemies ||= [] + + # If state.area doesn't have value, load_area_one and derive_dungeon_from_area methods are called + if !state.area + load_area_one + derive_dungeon_from_area + + # Changing these values will change the position of player + state.x = 7 + state.y = 5 + + # Creates new enemies, sets their values, and adds them to the enemies collection. + state.enemies << state.new_entity(:enemy) do |e| # declares each enemy as new entity + e.x = 13 # position + e.y = 5 + e.previous_hp = 3 + e.hp = 3 + e.max_hp = 3 + e.is_dead = false # the enemy is alive + end + + update_line_of_sight # updates line of sight by adding newly visible cells + end + end + + # Adds elements into the state.area collection + # The dungeon is derived using the coordinates of this collection + def load_area_one + state.area ||= [] + state.area << [8, 6] + state.area << [7, 6] + state.area << [7, 7] + state.area << [8, 9] + state.area << [7, 8] + state.area << [7, 9] + state.area << [6, 4] + state.area << [7, 3] + state.area << [7, 4] + state.area << [6, 5] + state.area << [7, 5] + state.area << [8, 5] + state.area << [8, 4] + state.area << [1, 1] + state.area << [0, 1] + state.area << [0, 2] + state.area << [1, 2] + state.area << [2, 2] + state.area << [2, 1] + state.area << [2, 3] + state.area << [1, 3] + state.area << [1, 4] + state.area << [2, 4] + state.area << [2, 5] + state.area << [1, 5] + state.area << [2, 6] + state.area << [3, 6] + state.area << [4, 6] + state.area << [4, 7] + state.area << [4, 8] + state.area << [5, 8] + state.area << [5, 9] + state.area << [6, 9] + state.area << [7, 10] + state.area << [7, 11] + state.area << [7, 12] + state.area << [7, 12] + state.area << [7, 13] + state.area << [8, 13] + state.area << [9, 13] + state.area << [10, 13] + state.area << [11, 13] + state.area << [12, 13] + state.area << [12, 12] + state.area << [8, 12] + state.area << [9, 12] + state.area << [10, 12] + state.area << [11, 12] + state.area << [12, 11] + state.area << [13, 11] + state.area << [13, 10] + state.area << [13, 9] + state.area << [13, 8] + state.area << [13, 7] + state.area << [13, 6] + state.area << [12, 6] + state.area << [14, 6] + state.area << [14, 5] + state.area << [13, 5] + state.area << [12, 5] + state.area << [12, 4] + state.area << [13, 4] + state.area << [14, 4] + state.area << [1, 6] + state.area << [6, 6] + end + + # Starts with an empty dungeon collection, and adds dungeon cells into it. + def derive_dungeon_from_area + state.dungeon = [] # starts as empty collection + + state.area.each do |a| # for each element of the area collection + state.dungeon << state.new_entity(:dungeon_cell) do |d| # declares each dungeon cell as new entity + d.x = a.x # dungeon cell position using coordinates from area + d.y = a.y + d.is_visible = false # cell is not visible + d.alpha = 0 # not transparent at all + d.border = [left_margin + a.x * grid_size, + bottom_margin + a.y * grid_size, + grid_size, + grid_size, + *blue, + 255] # sets border definition for dungeon cell + d # returns dungeon cell + end + end + end + + def left_margin + 40 # sets left margin + end + + def bottom_margin + 60 # sets bottom margin + end + + def grid_size + 40 # sets size of grid square + end + + # Updates the line of sight by calling the thick_line_of_sight method and + # adding dungeon cells to the newly_visible collection + def update_line_of_sight + variations = [-1, 0, 1] + # creates collection of newly visible dungeon cells + newly_visible = variations.product(variations).flat_map do |rise, run| # combo of all elements + thick_line_of_sight state.x, state.y, rise, run, 15, # calls thick_line_of_sight method + lambda { |x, y| dungeon_cell_exists? x, y } # checks whether or not cell exists + end.uniq# removes duplicates + + state.dungeon.each do |d| # perform action on each element of dungeons collection + d.is_visible = newly_visible.find { |v| v.x == d.x && v.y == d.y } # finds match inside newly_visible collection + end + end + + #Returns a boolean value + def dungeon_cell_exists? x, y + # Finds cell coordinates inside dungeon collection to determine if dungeon cell exists + state.dungeon.find { |d| d.x == x && d.y == y } + end + + # Calls line_of_sight method to add elements to result collection + def thick_line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda + result = [] + result += line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda + result += line_of_sight start_x - 1, start_y, rise, run, distance, cell_exists_lambda # one left + result += line_of_sight start_x + 1, start_y, rise, run, distance, cell_exists_lambda # one right + result + end + + # Adds points to the result collection to create the player's line of sight + def line_of_sight start_x, start_y, rise, run, distance, cell_exists_lambda + result = [] # starts as empty collection + points = points_on_line start_x, start_y, rise, run, distance # calls points_on_line method + points.each do |p| # for each point in collection + if cell_exists_lambda.call(p.x, p.y) # if the cell exists + result << p # add it to result collection + else # if cell does not exist + return result # return result collection as it is + end + end + + result # return result collection + end + + # Finds the coordinates of the points on the line by performing calculations + def points_on_line start_x, start_y, rise, run, distance + distance.times.map do |i| # perform an action + [start_x + run * i, start_y + rise * i] # definition of point + end + end + + def render_canvas + return + outputs.borders << state.canvas.map do |c| # on each element of canvas collection + c.border # outputs border + end + end + + # Outputs the dungeon cells. + def render_dungeon + outputs.solids << [0, 0, grid.w, grid.h] # outputs black background for grid + + # Sets the alpha value (opacity) for each dungeon cell and calls the cell_border method. + outputs.borders << state.dungeon.map do |d| # for each element in dungeon collection + d.alpha += if d.is_visible # if cell is visible + 255.fdiv(30) # increment opacity (transparency) + else # if cell is not visible + 255.fdiv(600) * -1 # decrease opacity + end + d.alpha = d.alpha.cap_min_max(0, 255) + cell_border d.x, d.y, [*blue, d.alpha] # sets blue border using alpha value + end.reject_nil + end + + # Sets definition of a cell border using the parameters + def cell_border x, y, color = nil + [left_margin + x * grid_size, + bottom_margin + y * grid_size, + grid_size, + grid_size, + *color] + end + + # Sets the values for the player and outputs it as a label + def render_player + outputs.labels << [grid_x(state.x) + 20, # positions "@" text in center of grid square + grid_y(state.y) + 35, + "@", # player is represented by a white "@" character + 1, 1, *white] + end + + def grid_x x + left_margin + x * grid_size # positions horizontally on grid + end + + def grid_y y + bottom_margin + y * grid_size # positions vertically on grid + end + + # Outputs enemies onto the screen. + def render_enemies + state.enemies.map do |e| # for each enemy in the collection + alpha = 255 # set opacity (full transparency) + + # Outputs an enemy using a label. + outputs.labels << [ + left_margin + 20 + e.x * grid_size, # positions enemy's "r" text in center of grid square + bottom_margin + 35 + e.y * grid_size, + "r", # enemy's text + 1, 1, *white, alpha] + + # Creates a red border around an enemy. + outputs.borders << [grid_x(e.x), grid_y(e.y), grid_size, grid_size, *red] + end + end + + #White labels are output for the cell coordinates of each element in the dungeon collection. + def print_cell_coordinates + return unless state.debug + state.dungeon.each do |d| + outputs.labels << [grid_x(d.x) + 2, + grid_y(d.y) - 2, + "#{d.x},#{d.y}", + -2, 0, *white] + end + end + + # Adds new elements into the canvas collection and sets their values. + def calc_canvas + return if state.canvas.length > 0 # return if canvas collection has at least one element + 15.times do |x| # 15 times perform an action + 15.times do |y| + state.canvas << state.new_entity(:canvas) do |c| # declare canvas element as new entity + c.x = x # set position + c.y = y + c.border = [left_margin + x * grid_size, + bottom_margin + y * grid_size, + grid_size, + grid_size, + *white, 30] # sets border definition + end + end + end + end + + # Updates x and y values of the player, and updates player's line of sight + def input_move + x, y, x_diff, y_diff = input_target_cell + + return unless dungeon_cell_exists? x, y # player can't move there if a dungeon cell doesn't exist in that location + return if enemy_at x, y # player can't move there if there is an enemy in that location + + state.x += x_diff # increments x by x_diff (so player moves left or right) + state.y += y_diff # same with y and y_diff ( so player moves up or down) + update_line_of_sight # updates visible cells + end + + def enemy_at x, y + # Finds if coordinates exist in enemies collection and enemy is not dead + state.enemies.find { |e| e.x == x && e.y == y && !e.is_dead } + end + + #M oves the user based on their keyboard input and sets values for target cell + def input_target_cell + if inputs.keyboard.key_down.up # if "up" key is in "down" state + [state.x, state.y + 1, 0, 1] # user moves up + elsif inputs.keyboard.key_down.down # if "down" key is pressed + [state.x, state.y - 1, 0, -1] # user moves down + elsif inputs.keyboard.key_down.left # if "left" key is pressed + [state.x - 1, state.y, -1, 0] # user moves left + elsif inputs.keyboard.key_down.right # if "right" key is pressed + [state.x + 1, state.y, 1, 0] # user moves right + else + nil # otherwise, empty + end + end + + # Goes through the canvas collection to find if the mouse was clicked inside of the borders of an element. + def input_click_map + return unless inputs.mouse.click # return unless the mouse is clicked + canvas_entry = state.canvas.find do |c| # find element from canvas collection that meets requirements + inputs.mouse.click.inside_rect? c.border # find border that mouse was clicked inside of + end + puts canvas_entry # prints canvas_entry value + end + + # Sets the definition of a label using the parameters. + def label text, x, y, color = nil + color ||= white # color is initialized to white + [x, y, text, 1, 1, *color] # sets label definition + end + + def green + [60, 200, 100] # sets color saturation to shade of green + end + + def blue + [50, 50, 210] # sets color saturation to shade of blue + end + + def white + [255, 255, 255] # sets color saturation to white + end + + def red + [230, 80, 80] # sets color saturation to shade of red + end + + def orange + [255, 80, 60] # sets color saturation to shade of orange + end + + def pink + [255, 0, 200] # sets color saturation to shade of pink + end + + def gray + [75, 75, 75] # sets color saturation to shade of gray + end + + # Recolors the border using the parameters. + def recolor_border border, r, g, b + border[4] = r + border[5] = g + border[6] = b + border + end + + # Returns a boolean value. + def visible? cell + # finds cell's coordinates inside visible_cells collections to determine if cell is visible + state.visible_cells.find { |c| c.x == cell.x && c.y == cell.y} + end + + # Exports dungeon by printing dungeon cell coordinates + def export_dungeon + state.dungeon.each do |d| # on each element of dungeon collection + puts "state.dungeon << [#{d.x}, #{d.y}]" # prints cell coordinates + end + end + + def distance_to_cell cell + distance_to state.x, cell.x, state.y, cell.y # calls distance_to method + end + + def distance_to from_x, x, from_y, y + (from_x - x).abs + (from_y - y).abs # finds distance between two cells using coordinates + end +end + +$game = Game.new + +def tick args + $game.args = args + $game.state = args.state + $game.inputs = args.inputs + $game.outputs = args.outputs + $game.grid = args.grid + $game.tick +end diff --git a/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/license-for-sample.txt b/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/license-for-sample.txt new file mode 100644 index 0000000..100dcec --- /dev/null +++ b/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/license-for-sample.txt @@ -0,0 +1,9 @@ +Copyright 2019 DragonRuby LLC + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/replay.txt b/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/replay.txt new file mode 100644 index 0000000..a2b4c52 --- /dev/null +++ b/samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/replay.txt @@ -0,0 +1,555 @@ +replay_version 2.0 +stopped_at 1731 +seed 100 +recorded_at Sun Sep 29 22:38:52 2019 +[:mouse_move, 785, 468, 2, 1, 114] +[:mouse_move, 756, 468, 2, 2, 115] +[:mouse_move, 745, 468, 2, 3, 117] +[:mouse_move, 718, 470, 2, 4, 118] +[:mouse_move, 705, 472, 2, 5, 119] +[:mouse_move, 680, 476, 2, 6, 120] +[:mouse_move, 668, 478, 2, 7, 121] +[:mouse_move, 606, 492, 2, 8, 122] +[:mouse_move, 581, 499, 2, 9, 123] +[:mouse_move, 523, 511, 2, 10, 124] +[:mouse_move, 417, 527, 2, 11, 125] +[:mouse_move, 387, 528, 2, 12, 126] +[:mouse_move, 344, 528, 2, 13, 127] +[:mouse_move, 324, 526, 2, 14, 128] +[:mouse_move, 295, 520, 2, 15, 129] +[:mouse_move, 285, 518, 2, 16, 130] +[:mouse_move, 276, 515, 2, 17, 131] +[:mouse_move, 255, 512, 2, 18, 132] +[:mouse_move, 244, 511, 2, 19, 133] +[:mouse_move, 228, 511, 2, 20, 134] +[:mouse_move, 213, 513, 2, 21, 135] +[:mouse_move, 194, 523, 2, 22, 136] +[:mouse_move, 190, 526, 2, 23, 137] +[:mouse_move, 183, 532, 2, 24, 138] +[:mouse_move, 180, 533, 2, 25, 139] +[:mouse_move, 177, 536, 2, 26, 140] +[:mouse_move, 177, 537, 2, 27, 141] +[:mouse_move, 193, 537, 2, 28, 142] +[:mouse_move, 208, 536, 2, 29, 143] +[:mouse_move, 222, 536, 2, 30, 144] +[:mouse_move, 232, 535, 2, 31, 145] +[:mouse_move, 241, 535, 2, 32, 146] +[:mouse_move, 245, 535, 2, 33, 147] +[:mouse_move, 249, 535, 2, 34, 148] +[:mouse_move, 250, 535, 2, 35, 149] +[:mouse_move, 251, 535, 2, 36, 150] +[:mouse_move, 252, 534, 2, 37, 151] +[:mouse_move, 256, 531, 2, 38, 152] +[:mouse_move, 259, 527, 2, 39, 153] +[:mouse_move, 265, 520, 2, 40, 154] +[:mouse_move, 270, 515, 2, 41, 155] +[:mouse_move, 274, 511, 2, 42, 156] +[:mouse_move, 282, 501, 2, 43, 157] +[:mouse_move, 293, 490, 2, 44, 159] +[:mouse_move, 295, 489, 2, 45, 160] +[:mouse_move, 299, 487, 2, 46, 161] +[:mouse_move, 301, 485, 2, 47, 162] +[:mouse_move, 303, 484, 2, 48, 163] +[:mouse_move, 304, 484, 2, 49, 164] +[:mouse_move, 306, 484, 2, 50, 165] +[:mouse_move, 307, 484, 2, 51, 166] +[:mouse_move, 308, 484, 2, 52, 167] +[:mouse_move, 310, 484, 2, 53, 168] +[:mouse_move, 314, 484, 2, 54, 169] +[:mouse_move, 316, 484, 2, 55, 170] +[:mouse_move, 317, 484, 2, 56, 171] +[:mouse_move, 318, 484, 2, 57, 172] +[:mouse_move, 319, 484, 2, 58, 173] +[:key_down_raw, 1073741906, 0, 2, 59, 232] +[:key_up_raw, 1073741906, 0, 2, 60, 237] +[:key_down_raw, 1073741906, 0, 2, 61, 243] +[:key_up_raw, 1073741906, 0, 2, 62, 247] +[:key_down_raw, 1073741906, 0, 2, 63, 254] +[:key_up_raw, 1073741906, 0, 2, 64, 257] +[:key_down_raw, 1073741906, 0, 2, 65, 266] +[:key_up_raw, 1073741906, 0, 2, 66, 272] +[:key_down_raw, 1073741906, 0, 2, 67, 279] +[:key_up_raw, 1073741906, 0, 2, 68, 284] +[:key_down_raw, 1073741905, 0, 2, 69, 326] +[:key_up_raw, 1073741905, 0, 2, 70, 334] +[:key_down_raw, 1073741904, 0, 2, 71, 421] +[:key_up_raw, 1073741904, 0, 2, 72, 428] +[:key_down_raw, 1073741904, 0, 2, 73, 438] +[:key_up_raw, 1073741904, 0, 2, 74, 445] +[:key_down_raw, 1073741905, 0, 2, 75, 459] +[:key_up_raw, 1073741905, 0, 2, 76, 466] +[:key_down_raw, 1073741904, 0, 2, 77, 480] +[:key_up_raw, 1073741904, 0, 2, 78, 488] +[:key_down_raw, 1073741905, 0, 2, 79, 499] +[:key_up_raw, 1073741905, 0, 2, 80, 507] +[:mouse_move, 289, 484, 2, 81, 545] +[:mouse_move, 274, 484, 2, 82, 546] +[:mouse_move, 244, 484, 2, 83, 547] +[:mouse_move, 231, 485, 2, 84, 548] +[:mouse_move, 208, 485, 2, 85, 549] +[:mouse_move, 199, 485, 2, 86, 550] +[:mouse_move, 178, 485, 2, 87, 551] +[:mouse_move, 174, 485, 2, 88, 552] +[:mouse_move, 162, 483, 2, 89, 553] +[:mouse_move, 159, 482, 2, 90, 554] +[:mouse_move, 157, 477, 2, 91, 555] +[:mouse_move, 157, 473, 2, 92, 556] +[:mouse_move, 161, 465, 2, 93, 557] +[:mouse_move, 165, 459, 2, 94, 558] +[:mouse_move, 174, 449, 2, 95, 559] +[:mouse_move, 179, 443, 2, 96, 560] +[:mouse_move, 191, 431, 2, 97, 561] +[:mouse_move, 196, 425, 2, 98, 562] +[:mouse_move, 205, 413, 2, 99, 563] +[:mouse_move, 210, 408, 2, 100, 564] +[:mouse_move, 212, 406, 2, 101, 565] +[:mouse_move, 219, 397, 2, 102, 566] +[:mouse_move, 223, 395, 2, 103, 567] +[:mouse_move, 228, 390, 2, 104, 568] +[:mouse_move, 230, 388, 2, 105, 569] +[:mouse_move, 233, 386, 2, 106, 570] +[:mouse_move, 234, 385, 2, 107, 571] +[:mouse_move, 235, 384, 2, 108, 573] +[:mouse_move, 234, 384, 2, 109, 580] +[:mouse_move, 234, 382, 2, 110, 622] +[:mouse_move, 234, 379, 2, 111, 623] +[:mouse_move, 236, 374, 2, 112, 624] +[:mouse_move, 237, 371, 2, 113, 625] +[:mouse_move, 240, 366, 2, 114, 626] +[:mouse_move, 241, 364, 2, 115, 627] +[:mouse_move, 243, 362, 2, 116, 628] +[:mouse_move, 243, 361, 2, 117, 629] +[:mouse_move, 242, 361, 2, 118, 632] +[:mouse_move, 239, 361, 2, 119, 633] +[:mouse_move, 229, 367, 2, 120, 634] +[:mouse_move, 223, 372, 2, 121, 635] +[:mouse_move, 208, 385, 2, 122, 636] +[:mouse_move, 198, 393, 2, 123, 637] +[:mouse_move, 179, 410, 2, 124, 638] +[:mouse_move, 169, 421, 2, 125, 639] +[:mouse_move, 149, 440, 2, 126, 640] +[:mouse_move, 139, 451, 2, 127, 641] +[:mouse_move, 127, 465, 2, 128, 642] +[:mouse_move, 119, 473, 2, 129, 643] +[:mouse_move, 108, 486, 2, 130, 644] +[:mouse_move, 103, 491, 2, 131, 645] +[:mouse_move, 98, 496, 2, 132, 646] +[:mouse_move, 96, 498, 2, 133, 647] +[:mouse_move, 94, 500, 2, 134, 648] +[:mouse_move, 92, 501, 2, 135, 649] +[:mouse_move, 91, 502, 2, 136, 650] +[:mouse_move, 92, 500, 2, 137, 653] +[:mouse_move, 95, 498, 2, 138, 654] +[:mouse_move, 105, 488, 2, 139, 655] +[:mouse_move, 112, 482, 2, 140, 656] +[:mouse_move, 128, 463, 2, 141, 657] +[:mouse_move, 138, 450, 2, 142, 658] +[:mouse_move, 159, 419, 2, 143, 659] +[:mouse_move, 168, 403, 2, 144, 660] +[:mouse_move, 182, 382, 2, 145, 661] +[:mouse_move, 188, 370, 2, 146, 662] +[:mouse_move, 200, 354, 2, 147, 663] +[:mouse_move, 205, 348, 2, 148, 664] +[:mouse_move, 214, 338, 2, 149, 665] +[:mouse_move, 218, 335, 2, 150, 666] +[:mouse_move, 222, 331, 2, 151, 667] +[:mouse_move, 224, 330, 2, 152, 668] +[:mouse_move, 226, 328, 2, 153, 669] +[:mouse_move, 227, 328, 2, 154, 670] +[:mouse_move, 222, 329, 2, 155, 674] +[:mouse_move, 219, 332, 2, 156, 675] +[:mouse_move, 207, 342, 2, 157, 676] +[:mouse_move, 201, 350, 2, 158, 677] +[:mouse_move, 184, 370, 2, 159, 678] +[:mouse_move, 173, 384, 2, 160, 679] +[:mouse_move, 151, 415, 2, 161, 680] +[:mouse_move, 140, 431, 2, 162, 681] +[:mouse_move, 119, 458, 2, 163, 682] +[:mouse_move, 114, 463, 2, 164, 683] +[:mouse_move, 99, 478, 2, 165, 684] +[:mouse_move, 97, 480, 2, 166, 685] +[:mouse_move, 88, 490, 2, 167, 686] +[:mouse_move, 85, 493, 2, 168, 687] +[:mouse_move, 82, 496, 2, 169, 688] +[:mouse_move, 81, 497, 2, 170, 689] +[:mouse_move, 82, 497, 2, 171, 692] +[:mouse_move, 84, 496, 2, 172, 693] +[:mouse_move, 94, 489, 2, 173, 694] +[:mouse_move, 101, 482, 2, 174, 695] +[:mouse_move, 119, 463, 2, 175, 696] +[:mouse_move, 129, 451, 2, 176, 697] +[:mouse_move, 151, 426, 2, 177, 698] +[:mouse_move, 155, 420, 2, 178, 699] +[:mouse_move, 172, 401, 2, 179, 700] +[:mouse_move, 178, 393, 2, 180, 701] +[:mouse_move, 185, 387, 2, 181, 702] +[:mouse_move, 197, 376, 2, 182, 703] +[:mouse_move, 202, 371, 2, 183, 704] +[:mouse_move, 209, 365, 2, 184, 705] +[:mouse_move, 215, 360, 2, 185, 706] +[:mouse_move, 218, 357, 2, 186, 707] +[:mouse_move, 222, 353, 2, 187, 708] +[:mouse_move, 225, 351, 2, 188, 709] +[:mouse_move, 226, 350, 2, 189, 710] +[:mouse_move, 227, 348, 2, 190, 711] +[:mouse_move, 228, 348, 2, 191, 712] +[:mouse_move, 229, 347, 2, 192, 713] +[:mouse_move, 229, 346, 2, 193, 715] +[:mouse_move, 225, 352, 2, 194, 721] +[:mouse_move, 219, 361, 2, 195, 722] +[:mouse_move, 201, 385, 2, 196, 723] +[:mouse_move, 193, 393, 2, 197, 724] +[:mouse_move, 165, 424, 2, 198, 725] +[:mouse_move, 151, 439, 2, 199, 726] +[:mouse_move, 127, 468, 2, 200, 727] +[:mouse_move, 116, 480, 2, 201, 728] +[:mouse_move, 106, 490, 2, 202, 729] +[:mouse_move, 92, 504, 2, 203, 730] +[:mouse_move, 84, 512, 2, 204, 731] +[:mouse_move, 77, 519, 2, 205, 732] +[:mouse_move, 73, 523, 2, 206, 733] +[:mouse_move, 69, 527, 2, 207, 734] +[:mouse_move, 68, 527, 2, 208, 735] +[:mouse_move, 68, 528, 2, 209, 736] +[:mouse_move, 70, 525, 2, 210, 738] +[:mouse_move, 73, 522, 2, 211, 739] +[:mouse_move, 86, 511, 2, 212, 740] +[:mouse_move, 93, 503, 2, 213, 741] +[:mouse_move, 117, 477, 2, 214, 742] +[:mouse_move, 123, 469, 2, 215, 743] +[:mouse_move, 156, 427, 2, 216, 744] +[:mouse_move, 169, 407, 2, 217, 745] +[:mouse_move, 187, 376, 2, 218, 746] +[:mouse_move, 199, 356, 2, 219, 747] +[:mouse_move, 221, 318, 2, 220, 748] +[:mouse_move, 231, 302, 2, 221, 749] +[:mouse_move, 250, 276, 2, 222, 750] +[:mouse_move, 260, 266, 2, 223, 751] +[:mouse_move, 267, 259, 2, 224, 752] +[:mouse_move, 272, 254, 2, 225, 753] +[:mouse_move, 279, 247, 2, 226, 754] +[:mouse_move, 281, 245, 2, 227, 755] +[:mouse_move, 282, 245, 2, 228, 756] +[:mouse_move, 283, 244, 2, 229, 757] +[:key_down_raw, 1073741906, 0, 2, 230, 813] +[:key_up_raw, 1073741906, 0, 2, 231, 820] +[:key_down_raw, 1073741903, 0, 2, 232, 833] +[:key_up_raw, 1073741903, 0, 2, 233, 840] +[:key_down_raw, 1073741903, 0, 2, 234, 848] +[:key_up_raw, 1073741903, 0, 2, 235, 855] +[:key_down_raw, 1073741906, 0, 2, 236, 862] +[:key_up_raw, 1073741906, 0, 2, 237, 870] +[:key_down_raw, 1073741903, 0, 2, 238, 880] +[:key_up_raw, 1073741903, 0, 2, 239, 901] +[:key_down_raw, 1073741903, 0, 2, 240, 917] +[:key_up_raw, 1073741903, 0, 2, 241, 924] +[:key_down_raw, 1073741905, 0, 2, 242, 943] +[:key_up_raw, 1073741905, 0, 2, 243, 948] +[:key_down_raw, 1073741905, 0, 2, 244, 952] +[:key_up_raw, 1073741905, 0, 2, 245, 956] +[:key_down_raw, 1073741905, 0, 2, 246, 960] +[:key_up_raw, 1073741905, 0, 2, 247, 963] +[:key_down_raw, 1073741905, 0, 2, 248, 967] +[:key_up_raw, 1073741905, 0, 2, 249, 972] +[:mouse_move, 244, 247, 2, 250, 997] +[:mouse_move, 229, 253, 2, 251, 998] +[:mouse_move, 174, 283, 2, 252, 999] +[:mouse_move, 152, 299, 2, 253, 1000] +[:mouse_move, 133, 313, 2, 254, 1001] +[:mouse_move, 63, 372, 2, 255, 1002] +[:mouse_move, 53, 384, 2, 256, 1003] +[:mouse_move, 40, 399, 2, 257, 1004] +[:mouse_move, 20, 424, 2, 258, 1005] +[:mouse_move, 13, 440, 2, 259, 1006] +[:mouse_move, 12, 445, 2, 260, 1007] +[:mouse_move, 12, 450, 2, 261, 1008] +[:mouse_move, 12, 451, 2, 262, 1009] +[:mouse_move, 13, 454, 2, 263, 1010] +[:mouse_move, 14, 454, 2, 264, 1011] +[:mouse_move, 15, 455, 2, 265, 1012] +[:mouse_move, 15, 454, 2, 266, 1014] +[:mouse_move, 15, 452, 2, 267, 1015] +[:mouse_move, 15, 447, 2, 268, 1016] +[:mouse_move, 15, 443, 2, 269, 1017] +[:mouse_move, 16, 438, 2, 270, 1018] +[:mouse_move, 17, 435, 2, 271, 1019] +[:mouse_move, 19, 431, 2, 272, 1020] +[:mouse_move, 20, 430, 2, 273, 1021] +[:mouse_move, 22, 428, 2, 274, 1022] +[:mouse_move, 23, 427, 2, 275, 1023] +[:mouse_move, 25, 426, 2, 276, 1024] +[:mouse_move, 26, 426, 2, 277, 1025] +[:mouse_move, 29, 426, 2, 278, 1026] +[:mouse_move, 30, 426, 2, 279, 1028] +[:mouse_move, 31, 427, 2, 280, 1029] +[:mouse_move, 32, 428, 2, 281, 1030] +[:mouse_move, 33, 431, 2, 282, 1031] +[:mouse_move, 34, 432, 2, 283, 1032] +[:mouse_move, 35, 437, 2, 284, 1033] +[:mouse_move, 36, 439, 2, 285, 1034] +[:mouse_move, 37, 444, 2, 286, 1035] +[:mouse_move, 39, 449, 2, 287, 1036] +[:mouse_move, 44, 460, 2, 288, 1037] +[:mouse_move, 45, 464, 2, 289, 1038] +[:mouse_move, 52, 475, 2, 290, 1039] +[:mouse_move, 55, 479, 2, 291, 1040] +[:mouse_move, 62, 485, 2, 292, 1041] +[:mouse_move, 66, 487, 2, 293, 1042] +[:mouse_move, 74, 488, 2, 294, 1043] +[:mouse_move, 79, 488, 2, 295, 1044] +[:mouse_move, 89, 484, 2, 296, 1045] +[:mouse_move, 95, 480, 2, 297, 1046] +[:mouse_move, 111, 468, 2, 298, 1047] +[:mouse_move, 115, 466, 2, 299, 1048] +[:mouse_move, 134, 453, 2, 300, 1049] +[:mouse_move, 142, 447, 2, 301, 1050] +[:mouse_move, 160, 437, 2, 302, 1051] +[:mouse_move, 170, 431, 2, 303, 1052] +[:mouse_move, 179, 425, 2, 304, 1053] +[:mouse_move, 192, 417, 2, 305, 1054] +[:mouse_move, 200, 411, 2, 306, 1055] +[:mouse_move, 213, 401, 2, 307, 1056] +[:mouse_move, 219, 396, 2, 308, 1057] +[:mouse_move, 230, 386, 2, 309, 1058] +[:mouse_move, 238, 375, 2, 310, 1059] +[:mouse_move, 244, 363, 2, 311, 1060] +[:mouse_move, 247, 355, 2, 312, 1061] +[:mouse_move, 253, 341, 2, 313, 1062] +[:mouse_move, 255, 335, 2, 314, 1063] +[:mouse_move, 257, 321, 2, 315, 1064] +[:mouse_move, 258, 309, 2, 316, 1065] +[:mouse_move, 257, 298, 2, 317, 1066] +[:mouse_move, 255, 291, 2, 318, 1067] +[:mouse_move, 249, 281, 2, 319, 1068] +[:mouse_move, 242, 271, 2, 320, 1069] +[:mouse_move, 233, 264, 2, 321, 1070] +[:mouse_move, 226, 260, 2, 322, 1071] +[:mouse_move, 207, 252, 2, 323, 1072] +[:mouse_move, 203, 251, 2, 324, 1073] +[:mouse_move, 185, 249, 2, 325, 1074] +[:mouse_move, 178, 249, 2, 326, 1075] +[:mouse_move, 161, 249, 2, 327, 1076] +[:mouse_move, 153, 250, 2, 328, 1077] +[:mouse_move, 139, 256, 2, 329, 1078] +[:mouse_move, 132, 259, 2, 330, 1079] +[:mouse_move, 120, 269, 2, 331, 1080] +[:mouse_move, 110, 279, 2, 332, 1081] +[:mouse_move, 104, 287, 2, 333, 1082] +[:mouse_move, 93, 304, 2, 334, 1083] +[:mouse_move, 87, 313, 2, 335, 1084] +[:mouse_move, 80, 326, 2, 336, 1085] +[:mouse_move, 75, 335, 2, 337, 1086] +[:mouse_move, 69, 351, 2, 338, 1087] +[:mouse_move, 67, 359, 2, 339, 1088] +[:mouse_move, 64, 376, 2, 340, 1089] +[:mouse_move, 64, 383, 2, 341, 1090] +[:mouse_move, 62, 399, 2, 342, 1091] +[:mouse_move, 62, 406, 2, 343, 1092] +[:mouse_move, 62, 418, 2, 344, 1093] +[:mouse_move, 62, 423, 2, 345, 1094] +[:mouse_move, 66, 433, 2, 346, 1095] +[:mouse_move, 69, 437, 2, 347, 1096] +[:mouse_move, 78, 444, 2, 348, 1097] +[:mouse_move, 86, 450, 2, 349, 1098] +[:mouse_move, 102, 457, 2, 350, 1099] +[:mouse_move, 112, 458, 2, 351, 1100] +[:mouse_move, 136, 461, 2, 352, 1101] +[:mouse_move, 142, 461, 2, 353, 1102] +[:mouse_move, 162, 460, 2, 354, 1103] +[:mouse_move, 172, 459, 2, 355, 1104] +[:mouse_move, 188, 454, 2, 356, 1105] +[:mouse_move, 195, 451, 2, 357, 1106] +[:mouse_move, 211, 443, 2, 358, 1107] +[:mouse_move, 214, 440, 2, 359, 1108] +[:mouse_move, 222, 432, 2, 360, 1109] +[:mouse_move, 233, 412, 2, 361, 1110] +[:mouse_move, 238, 400, 2, 362, 1111] +[:mouse_move, 248, 375, 2, 363, 1112] +[:mouse_move, 250, 370, 2, 364, 1113] +[:mouse_move, 258, 351, 2, 365, 1114] +[:mouse_move, 261, 343, 2, 366, 1115] +[:mouse_move, 264, 328, 2, 367, 1116] +[:mouse_move, 264, 321, 2, 368, 1117] +[:mouse_move, 265, 307, 2, 369, 1118] +[:mouse_move, 265, 305, 2, 370, 1119] +[:mouse_move, 264, 296, 2, 371, 1120] +[:mouse_move, 262, 289, 2, 372, 1121] +[:mouse_move, 257, 282, 2, 373, 1122] +[:mouse_move, 252, 277, 2, 374, 1123] +[:mouse_move, 237, 271, 2, 375, 1124] +[:mouse_move, 227, 269, 2, 376, 1125] +[:mouse_move, 211, 268, 2, 377, 1126] +[:mouse_move, 201, 268, 2, 378, 1127] +[:mouse_move, 177, 268, 2, 379, 1128] +[:mouse_move, 168, 269, 2, 380, 1129] +[:mouse_move, 149, 274, 2, 381, 1130] +[:mouse_move, 137, 279, 2, 382, 1131] +[:mouse_move, 124, 288, 2, 383, 1132] +[:mouse_move, 116, 294, 2, 384, 1133] +[:mouse_move, 102, 307, 2, 385, 1134] +[:mouse_move, 91, 319, 2, 386, 1135] +[:mouse_move, 88, 323, 2, 387, 1136] +[:mouse_move, 73, 344, 2, 388, 1137] +[:mouse_move, 68, 353, 2, 389, 1138] +[:mouse_move, 57, 374, 2, 390, 1139] +[:mouse_move, 52, 386, 2, 391, 1140] +[:mouse_move, 44, 412, 2, 392, 1141] +[:mouse_move, 42, 418, 2, 393, 1142] +[:mouse_move, 36, 437, 2, 394, 1143] +[:mouse_move, 34, 445, 2, 395, 1144] +[:mouse_move, 33, 453, 2, 396, 1145] +[:mouse_move, 32, 457, 2, 397, 1146] +[:mouse_move, 32, 466, 2, 398, 1147] +[:mouse_move, 33, 468, 2, 399, 1148] +[:mouse_move, 38, 475, 2, 400, 1149] +[:mouse_move, 44, 482, 2, 401, 1150] +[:mouse_move, 56, 492, 2, 402, 1151] +[:mouse_move, 64, 496, 2, 403, 1152] +[:mouse_move, 81, 503, 2, 404, 1153] +[:mouse_move, 92, 503, 2, 405, 1154] +[:mouse_move, 106, 503, 2, 406, 1155] +[:mouse_move, 115, 501, 2, 407, 1156] +[:mouse_move, 134, 492, 2, 408, 1157] +[:mouse_move, 147, 485, 2, 409, 1158] +[:mouse_move, 163, 471, 2, 410, 1159] +[:mouse_move, 171, 463, 2, 411, 1160] +[:mouse_move, 183, 451, 2, 412, 1161] +[:mouse_move, 202, 425, 2, 413, 1163] +[:mouse_move, 215, 401, 2, 414, 1164] +[:mouse_move, 217, 395, 2, 415, 1165] +[:mouse_move, 226, 373, 2, 416, 1166] +[:mouse_move, 234, 357, 2, 417, 1167] +[:mouse_move, 238, 343, 2, 418, 1168] +[:mouse_move, 240, 334, 2, 419, 1169] +[:mouse_move, 247, 310, 2, 420, 1170] +[:mouse_move, 249, 299, 2, 421, 1171] +[:mouse_move, 250, 290, 2, 422, 1172] +[:mouse_move, 251, 283, 2, 423, 1173] +[:mouse_move, 251, 269, 2, 424, 1174] +[:mouse_move, 248, 263, 2, 425, 1175] +[:mouse_move, 237, 256, 2, 426, 1176] +[:mouse_move, 229, 254, 2, 427, 1177] +[:mouse_move, 210, 250, 2, 428, 1178] +[:mouse_move, 199, 249, 2, 429, 1179] +[:mouse_move, 184, 248, 2, 430, 1180] +[:mouse_move, 173, 248, 2, 431, 1181] +[:mouse_move, 153, 248, 2, 432, 1182] +[:mouse_move, 145, 249, 2, 433, 1183] +[:mouse_move, 138, 251, 2, 434, 1184] +[:mouse_move, 125, 257, 2, 435, 1185] +[:mouse_move, 121, 260, 2, 436, 1186] +[:mouse_move, 112, 267, 2, 437, 1187] +[:mouse_move, 101, 280, 2, 438, 1188] +[:mouse_move, 97, 287, 2, 439, 1189] +[:mouse_move, 86, 306, 2, 440, 1190] +[:mouse_move, 81, 316, 2, 441, 1191] +[:mouse_move, 79, 322, 2, 442, 1192] +[:mouse_move, 70, 345, 2, 443, 1193] +[:mouse_move, 63, 365, 2, 444, 1194] +[:mouse_move, 59, 389, 2, 445, 1195] +[:mouse_move, 59, 401, 2, 446, 1196] +[:mouse_move, 59, 416, 2, 447, 1197] +[:mouse_move, 59, 425, 2, 448, 1198] +[:mouse_move, 60, 439, 2, 449, 1199] +[:mouse_move, 60, 442, 2, 450, 1200] +[:mouse_move, 64, 454, 2, 451, 1201] +[:mouse_move, 66, 457, 2, 452, 1202] +[:mouse_move, 70, 462, 2, 453, 1203] +[:mouse_move, 74, 464, 2, 454, 1204] +[:mouse_move, 81, 467, 2, 455, 1205] +[:mouse_move, 85, 468, 2, 456, 1206] +[:mouse_move, 97, 469, 2, 457, 1207] +[:mouse_move, 107, 469, 2, 458, 1208] +[:mouse_move, 124, 471, 2, 459, 1209] +[:mouse_move, 134, 471, 2, 460, 1210] +[:mouse_move, 148, 471, 2, 461, 1211] +[:mouse_move, 161, 468, 2, 462, 1212] +[:mouse_move, 178, 457, 2, 463, 1213] +[:mouse_move, 186, 451, 2, 464, 1214] +[:mouse_move, 202, 434, 2, 465, 1215] +[:mouse_move, 210, 424, 2, 466, 1216] +[:mouse_move, 227, 400, 2, 467, 1217] +[:mouse_move, 234, 388, 2, 468, 1218] +[:mouse_move, 237, 383, 2, 469, 1219] +[:mouse_move, 250, 360, 2, 470, 1220] +[:mouse_move, 254, 351, 2, 471, 1221] +[:mouse_move, 261, 334, 2, 472, 1222] +[:mouse_move, 262, 326, 2, 473, 1223] +[:mouse_move, 264, 312, 2, 474, 1224] +[:mouse_move, 265, 305, 2, 475, 1225] +[:mouse_move, 265, 293, 2, 476, 1226] +[:mouse_move, 265, 287, 2, 477, 1227] +[:mouse_move, 259, 272, 2, 478, 1228] +[:mouse_move, 255, 267, 2, 479, 1229] +[:mouse_move, 246, 260, 2, 480, 1230] +[:mouse_move, 239, 257, 2, 481, 1231] +[:mouse_move, 226, 253, 2, 482, 1232] +[:mouse_move, 213, 251, 2, 483, 1233] +[:mouse_move, 194, 251, 2, 484, 1234] +[:mouse_move, 184, 252, 2, 485, 1235] +[:mouse_move, 163, 259, 2, 486, 1236] +[:mouse_move, 153, 263, 2, 487, 1237] +[:mouse_move, 133, 274, 2, 488, 1238] +[:mouse_move, 128, 278, 2, 489, 1239] +[:mouse_move, 107, 297, 2, 490, 1240] +[:mouse_move, 100, 305, 2, 491, 1241] +[:mouse_move, 86, 324, 2, 492, 1242] +[:mouse_move, 79, 335, 2, 493, 1243] +[:mouse_move, 74, 348, 2, 494, 1244] +[:mouse_move, 66, 388, 2, 495, 1245] +[:mouse_move, 66, 399, 2, 496, 1246] +[:mouse_move, 68, 429, 2, 497, 1247] +[:mouse_move, 73, 441, 2, 498, 1248] +[:mouse_move, 83, 452, 2, 499, 1249] +[:mouse_move, 89, 457, 2, 500, 1250] +[:mouse_move, 97, 462, 2, 501, 1251] +[:key_down_raw, 1073741906, 0, 2, 502, 1292] +[:key_up_raw, 1073741906, 0, 2, 503, 1296] +[:key_down_raw, 1073741906, 0, 2, 504, 1309] +[:key_up_raw, 1073741906, 0, 2, 505, 1314] +[:key_down_raw, 1073741906, 0, 2, 506, 1319] +[:key_up_raw, 1073741906, 0, 2, 507, 1322] +[:key_down_raw, 1073741906, 0, 2, 508, 1327] +[:key_up_raw, 1073741906, 0, 2, 509, 1331] +[:key_down_raw, 1073741906, 0, 2, 510, 1336] +[:key_up_raw, 1073741906, 0, 2, 511, 1339] +[:key_down_raw, 1073741906, 0, 2, 512, 1345] +[:key_up_raw, 1073741906, 0, 2, 513, 1348] +[:key_down_raw, 1073741906, 0, 2, 514, 1354] +[:key_up_raw, 1073741906, 0, 2, 515, 1358] +[:key_down_raw, 1073741906, 0, 2, 516, 1362] +[:key_up_raw, 1073741906, 0, 2, 517, 1370] +[:key_down_raw, 1073741903, 0, 2, 518, 1386] +[:key_up_raw, 1073741903, 0, 2, 519, 1392] +[:key_down_raw, 1073741903, 0, 2, 520, 1397] +[:key_up_raw, 1073741903, 0, 2, 521, 1401] +[:key_down_raw, 1073741903, 0, 2, 522, 1407] +[:key_up_raw, 1073741903, 0, 2, 523, 1412] +[:key_down_raw, 1073741903, 0, 2, 524, 1415] +[:key_up_raw, 1073741903, 0, 2, 525, 1421] +[:key_down_raw, 1073741903, 0, 2, 526, 1428] +[:key_up_raw, 1073741903, 0, 2, 527, 1436] +[:key_down_raw, 1073741905, 0, 2, 528, 1446] +[:key_up_raw, 1073741905, 0, 2, 529, 1458] +[:key_down_raw, 1073741905, 0, 2, 530, 1466] +[:key_up_raw, 1073741905, 0, 2, 531, 1472] +[:key_down_raw, 1073741903, 0, 2, 532, 1479] +[:key_up_raw, 1073741903, 0, 2, 533, 1489] +[:key_down_raw, 1073741905, 0, 2, 534, 1513] +[:key_up_raw, 1073741905, 0, 2, 535, 1517] +[:key_down_raw, 1073741905, 0, 2, 536, 1522] +[:key_up_raw, 1073741905, 0, 2, 537, 1526] +[:key_down_raw, 1073741905, 0, 2, 538, 1531] +[:key_up_raw, 1073741905, 0, 2, 539, 1535] +[:key_down_raw, 1073741905, 0, 2, 540, 1540] +[:key_up_raw, 1073741905, 0, 2, 541, 1544] +[:key_down_raw, 1073741905, 0, 2, 542, 1549] +[:key_up_raw, 1073741905, 0, 2, 543, 1554] +[:key_down_raw, 1073741905, 0, 2, 544, 1558] +[:key_up_raw, 1073741905, 0, 2, 545, 1564] +[:key_down_raw, 1073742051, 1024, 2, 546, 1663] +[:key_down_raw, 114, 1024, 2, 547, 1664] +[:key_up_raw, 114, 1024, 2, 548, 1669] +[:key_up_raw, 1073742051, 0, 2, 549, 1677] +[:key_down_raw, 1073742051, 1024, 2, 550, 1729] +[:key_down_raw, 113, 1024, 2, 551, 1730] -- cgit v1.2.3